工艺流程
This commit is contained in:
parent
37ae89d618
commit
2415808862
@ -316,7 +316,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="12"> -->
|
<!-- <el-col :span="12"> -->
|
||||||
<el-col :span="12" v-if="Typefile">
|
<el-col :span="12" v-if="Typefile">
|
||||||
<el-form-item label="代码上传" prop="">
|
<!-- <el-form-item label="代码上传" prop="">
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="codeName"
|
ref="codeName"
|
||||||
class="upload-demo"
|
class="upload-demo"
|
||||||
@ -339,6 +339,21 @@
|
|||||||
> 预览文件</el-button
|
> 预览文件</el-button
|
||||||
>
|
>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="代码上传" prop="url">
|
||||||
|
<el-select
|
||||||
|
v-model="form.originalName"
|
||||||
|
value-key="codeId"
|
||||||
|
placeholder="请选择工序"
|
||||||
|
@change="selectSource($event)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in machineryList"
|
||||||
|
:key="item.codeId"
|
||||||
|
:label="item.codeName"
|
||||||
|
:value="{ url: item.codeId, originalName: item.codeName }"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -412,6 +427,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { list } from "@/api/management/codeprogram";
|
||||||
import { findProAgvline } from "@/api/mes/dv/route";
|
import { findProAgvline } from "@/api/mes/dv/route";
|
||||||
import { findProAgvsite } from "@/api/mes/dv/siteConfiguration";
|
import { findProAgvsite } from "@/api/mes/dv/siteConfiguration";
|
||||||
import {
|
import {
|
||||||
@ -490,6 +506,7 @@ export default {
|
|||||||
lineId: "",
|
lineId: "",
|
||||||
pointId: "",
|
pointId: "",
|
||||||
},
|
},
|
||||||
|
machineryList: [],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
routeId: [
|
routeId: [
|
||||||
@ -594,15 +611,28 @@ export default {
|
|||||||
this.form.lineId = "";
|
this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
this.form.pointId = "";
|
||||||
this.form.exitType = "0";
|
this.form.exitType = "0";
|
||||||
|
this.form.originalName = "";
|
||||||
|
this.form.url = "";
|
||||||
} else {
|
} else {
|
||||||
this.TypeId = false;
|
this.TypeId = false;
|
||||||
this.Typefile = false;
|
this.Typefile = true;
|
||||||
this.warehousing = false;
|
this.warehousing = false;
|
||||||
this.form.lineId = "";
|
this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
this.form.pointId = "";
|
||||||
this.form.exitType = "";
|
this.form.exitType = "";
|
||||||
|
this.form.originalName = "";
|
||||||
|
this.form.url = "";
|
||||||
}
|
}
|
||||||
this.form.machineryTypeName = data.machineryTypeName;
|
this.form.machineryTypeName = data.machineryTypeName;
|
||||||
|
var queryParams = { machineryTypeId: data.machineryTypeId };
|
||||||
|
list(queryParams).then((response) => {
|
||||||
|
this.machineryList = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
selectSource(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.form.url = e.url;
|
||||||
|
this.form.originalName = e.originalName;
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -752,24 +782,28 @@ export default {
|
|||||||
this.TypeId = true;
|
this.TypeId = true;
|
||||||
this.Typefile = false;
|
this.Typefile = false;
|
||||||
this.warehousing = false;
|
this.warehousing = false;
|
||||||
this.form.originalName = "";
|
// this.form.originalName = "";
|
||||||
this.form.url = "";
|
// this.form.url = "";
|
||||||
this.form.exitType = "";
|
// this.form.exitType = "";
|
||||||
} else if (row.machineryTypeId == 230) {
|
} else if (row.machineryTypeId == 230) {
|
||||||
this.TypeId = false;
|
this.TypeId = false;
|
||||||
this.Typefile = false;
|
this.Typefile = false;
|
||||||
this.warehousing = true;
|
this.warehousing = true;
|
||||||
this.form.lineId = "";
|
// this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
// this.form.pointId = "";
|
||||||
} else {
|
} else {
|
||||||
this.TypeId = false;
|
this.TypeId = false;
|
||||||
this.Typefile = true;
|
this.Typefile = true;
|
||||||
this.warehousing = false;
|
this.warehousing = false;
|
||||||
this.form.lineId = "";
|
// this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
// this.form.pointId = "";
|
||||||
this.form.exitType = "";
|
// this.form.exitType = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var queryParams = { machineryTypeId: row.machineryTypeId };
|
||||||
|
list(queryParams).then((response) => {
|
||||||
|
this.machineryList = response.data;
|
||||||
|
});
|
||||||
var name = {};
|
var name = {};
|
||||||
if (row.originalName != undefined && row.originalName != "") {
|
if (row.originalName != undefined && row.originalName != "") {
|
||||||
this.$set(name, "name", row.originalName);
|
this.$set(name, "name", row.originalName);
|
||||||
@ -781,13 +815,13 @@ export default {
|
|||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.recordId != null) {
|
if (this.form.recordId != null) {
|
||||||
if (this.form.machineryTypeId == 229) {
|
// if (this.form.machineryTypeId == 229) {
|
||||||
this.form.originalName = "";
|
// this.form.originalName = "";
|
||||||
this.form.url = "";
|
// this.form.url = "";
|
||||||
} else {
|
// } else {
|
||||||
this.form.lineId = "";
|
// this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
// this.form.pointId = "";
|
||||||
}
|
// }
|
||||||
updateRouteprocess(this.form).then((response) => {
|
updateRouteprocess(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="工单编码" prop="workorderCode">
|
<el-form-item label="工单编码" prop="workorderCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.workorderCode"
|
v-model="queryParams.workorderCode"
|
||||||
@ -60,34 +67,77 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="需求日期" prop="requestDate">
|
<el-form-item label="需求日期" prop="requestDate">
|
||||||
<el-date-picker clearable
|
<el-date-picker
|
||||||
|
clearable
|
||||||
v-model="queryParams.requestDate"
|
v-model="queryParams.requestDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择需求日期">
|
placeholder="请选择需求日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-refresh" v-hasPermi="['mes:pro:protask:list']" circle="" @click="getList"></el-button>
|
<el-button
|
||||||
<el-button type="primary" icon="el-icon-edit" v-hasPermi="['mes:pro:protask:edit']" circle="" @click="handleOpenGantt"></el-button>
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
v-hasPermi="['mes:pro:protask:list']"
|
||||||
|
circle=""
|
||||||
|
@click="getList"
|
||||||
|
></el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
v-hasPermi="['mes:pro:protask:edit']"
|
||||||
|
circle=""
|
||||||
|
@click="handleOpenGantt"
|
||||||
|
></el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<GanttChar class="left-container" ref="ganttChar" :tasks="tasks"></GanttChar>
|
<GanttChar
|
||||||
|
class="left-container"
|
||||||
|
ref="ganttChar"
|
||||||
|
:tasks="tasks"
|
||||||
|
></GanttChar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain size="mini" @click="production"
|
||||||
|
>批量执行生产</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="workorderList"
|
:data="workorderList"
|
||||||
row-key="workorderId"
|
row-key="workorderId"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
width="55"
|
||||||
|
align="center"
|
||||||
|
:selectable="selectable"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-table-column label="工单编码" width="180" prop="workorderCode">
|
<el-table-column label="工单编码" width="180" prop="workorderCode">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@ -95,36 +145,90 @@
|
|||||||
type="text"
|
type="text"
|
||||||
@click="handleView(scope.row)"
|
@click="handleView(scope.row)"
|
||||||
v-hasPermi="['mes:pro:protask:query']"
|
v-hasPermi="['mes:pro:protask:query']"
|
||||||
>{{scope.row.workorderCode}}</el-button>
|
>{{ scope.row.workorderCode }}</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工单名称" width="200" align="center" prop="workorderName" :show-overflow-tooltip="true"/>
|
<el-table-column
|
||||||
|
label="工单名称"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
prop="workorderName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="工单来源" align="center" prop="orderSource">
|
<el-table-column label="工单来源" align="center" prop="orderSource">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mes_workorder_sourcetype" :value="scope.row.orderSource"/>
|
<dict-tag
|
||||||
|
:options="dict.type.mes_workorder_sourcetype"
|
||||||
|
:value="scope.row.orderSource"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="订单编号" width="140" align="center" prop="sourceCode" />
|
<el-table-column
|
||||||
<el-table-column label="产品编号" width="120" align="center" prop="productCode" />
|
label="订单编号"
|
||||||
<el-table-column label="产品名称" width="200" align="center" prop="productName" :show-overflow-tooltip="true"/>
|
width="140"
|
||||||
<el-table-column label="规格型号" align="center" prop="productSpc" :show-overflow-tooltip="true"/>
|
align="center"
|
||||||
|
prop="sourceCode"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="产品编号"
|
||||||
|
width="120"
|
||||||
|
align="center"
|
||||||
|
prop="productCode"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="产品名称"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
prop="productName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="规格型号"
|
||||||
|
align="center"
|
||||||
|
prop="productSpc"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||||
<el-table-column label="调整数量" align="center" prop="quantityChanged" />
|
<el-table-column label="调整数量" align="center" prop="quantityChanged" />
|
||||||
<el-table-column label="已生产数量" align="center" width="100px" prop="quantityProduced" />
|
<el-table-column
|
||||||
|
label="已生产数量"
|
||||||
|
align="center"
|
||||||
|
width="100px"
|
||||||
|
prop="quantityProduced"
|
||||||
|
/>
|
||||||
<el-table-column label="客户编码" align="center" prop="clientCode" />
|
<el-table-column label="客户编码" align="center" prop="clientCode" />
|
||||||
<el-table-column label="客户名称" align="center" prop="clientName" :show-overflow-tooltip="true"/>
|
<el-table-column
|
||||||
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">
|
label="客户名称"
|
||||||
|
align="center"
|
||||||
|
prop="clientName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="需求日期"
|
||||||
|
align="center"
|
||||||
|
prop="requestDate"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.requestDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.requestDate, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="排产状态" align="center" prop="status">
|
<el-table-column label="排产状态" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
<dict-tag
|
||||||
|
:options="dict.type.mes_order_status"
|
||||||
|
:value="scope.row.status"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150px" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="150px"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -133,7 +237,15 @@
|
|||||||
v-if="scope.row.status == 'CONFIRMED'"
|
v-if="scope.row.status == 'CONFIRMED'"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['mes:pro:protask:edit']"
|
v-hasPermi="['mes:pro:protask:edit']"
|
||||||
>排产</el-button>
|
>排产</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
v-if="scope.row.status == 'CONFIRMED'"
|
||||||
|
@click="handleproductione(scope.row)"
|
||||||
|
>执行生产</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -169,7 +281,8 @@
|
|||||||
v-for="dict in dict.type.mes_workorder_sourcetype"
|
v-for="dict in dict.type.mes_workorder_sourcetype"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -224,11 +337,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="需求日期" prop="requestDate">
|
<el-form-item label="需求日期" prop="requestDate">
|
||||||
<el-date-picker disabled
|
<el-date-picker
|
||||||
|
disabled
|
||||||
v-model="form.requestDate"
|
v-model="form.requestDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择需求日期">
|
placeholder="请选择需求日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -250,23 +365,65 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" readonly="readonly" />
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
readonly="readonly"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-steps :active="activeProcess" v-if="form.workorderId !=null" align-center simple>
|
<el-steps
|
||||||
<el-step v-for="(item,index) in processOptions"
|
:active="activeProcess"
|
||||||
:title="item.processName" @click.native="handleStepClick(index)">
|
v-if="form.workorderId != null"
|
||||||
|
align-center
|
||||||
|
simple
|
||||||
|
>
|
||||||
|
<el-step
|
||||||
|
v-for="(item, index) in processOptions"
|
||||||
|
:title="item.processName"
|
||||||
|
@click.native="handleStepClick(index)"
|
||||||
|
>
|
||||||
</el-step>
|
</el-step>
|
||||||
</el-steps>
|
</el-steps>
|
||||||
<el-card v-for=" (item,index) in processOptions " :key="index" v-if="activeProcess == index && form.workorderId !=null">
|
<el-card
|
||||||
<ProTask :workorderId="form.workorderId" :routeId="item.routeId" :processId="item.processId" :colorCode="item.colorCode" :optType="optType" :recordId="item.recordId"></ProTask>
|
v-for="(item, index) in processOptions"
|
||||||
|
:key="index"
|
||||||
|
v-if="activeProcess == index && form.workorderId != null"
|
||||||
|
>
|
||||||
|
<ProTask
|
||||||
|
:workorderId="form.workorderId"
|
||||||
|
:routeId="item.routeId"
|
||||||
|
:processId="item.processId"
|
||||||
|
:colorCode="item.colorCode"
|
||||||
|
:optType="optType"
|
||||||
|
:recordId="item.recordId"
|
||||||
|
></ProTask>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
<el-button
|
||||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">确 定</el-button>
|
type="primary"
|
||||||
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
@click="cancel"
|
||||||
|
v-if="optType == 'view' || form.status != 'PREPARE'"
|
||||||
|
>返回</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="submitForm"
|
||||||
|
v-if="form.status == 'PREPARE' && optType != 'view'"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
@click="handleFinish"
|
||||||
|
v-if="
|
||||||
|
form.status == 'PREPARE' &&
|
||||||
|
optType != 'view' &&
|
||||||
|
form.workorderId != null
|
||||||
|
"
|
||||||
|
>完成</el-button
|
||||||
|
>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -274,7 +431,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder } from "@/api/mes/pro/workorder";
|
import {
|
||||||
|
listWorkorder,
|
||||||
|
getWorkorder,
|
||||||
|
delWorkorder,
|
||||||
|
addWorkorder,
|
||||||
|
updateWorkorder,
|
||||||
|
} from "@/api/mes/pro/workorder";
|
||||||
import { listGanttTaskList } from "@/api/mes/pro/protask";
|
import { listGanttTaskList } from "@/api/mes/pro/protask";
|
||||||
import { listProductprocess } from "@/api/mes/pro/routeprocess";
|
import { listProductprocess } from "@/api/mes/pro/routeprocess";
|
||||||
import ProTask from "./proTask.vue";
|
import ProTask from "./proTask.vue";
|
||||||
@ -284,11 +447,11 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Workorder",
|
name: "Workorder",
|
||||||
dicts: ['mes_order_status','mes_workorder_sourcetype'],
|
dicts: ["mes_order_status", "mes_workorder_sourcetype"],
|
||||||
components: {
|
components: {
|
||||||
Treeselect,
|
Treeselect,
|
||||||
ProTask,
|
ProTask,
|
||||||
GanttChar
|
GanttChar,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -322,7 +485,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
workorderCode: null,
|
workorderCode: null,
|
||||||
workorderName: null,
|
workorderName: null,
|
||||||
workorderType: 'SELF', //这里的排产要排除自产之外的外协和外购
|
workorderType: "SELF", //这里的排产要排除自产之外的外协和外购
|
||||||
orderSource: null,
|
orderSource: null,
|
||||||
sourceCode: null,
|
sourceCode: null,
|
||||||
productId: null,
|
productId: null,
|
||||||
@ -344,7 +507,7 @@ export default {
|
|||||||
},
|
},
|
||||||
tasks: {
|
tasks: {
|
||||||
data: [],
|
data: [],
|
||||||
links: []
|
links: [],
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@ -358,17 +521,21 @@ export default {
|
|||||||
/** 查询生产工单列表 */
|
/** 查询生产工单列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listWorkorder(this.queryParams).then(response => {
|
listWorkorder(this.queryParams).then((response) => {
|
||||||
this.workorderList = this.handleTree(response.rows, "workorderId", "parentId");
|
this.workorderList = this.handleTree(
|
||||||
|
response.rows,
|
||||||
|
"workorderId",
|
||||||
|
"parentId"
|
||||||
|
);
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleOpenGantt() {
|
handleOpenGantt() {
|
||||||
this.$router.push({ path: '/mes/pro/schedule/ganttedit'})
|
this.$router.push({ path: "/mes/pro/schedule/ganttedit" });
|
||||||
},
|
},
|
||||||
getGanttTasks() {
|
getGanttTasks() {
|
||||||
listGanttTaskList(this.queryParams).then(response =>{
|
listGanttTaskList(this.queryParams).then((response) => {
|
||||||
this.tasks.data = response.data.data;
|
this.tasks.data = response.data.data;
|
||||||
this.tasks.links = response.data.links;
|
this.tasks.links = response.data.links;
|
||||||
this.$refs.ganttChar.reload();
|
this.$refs.ganttChar.reload();
|
||||||
@ -377,7 +544,7 @@ export default {
|
|||||||
|
|
||||||
//获取当前产品对应的生产工序
|
//获取当前产品对应的生产工序
|
||||||
getProcess() {
|
getProcess() {
|
||||||
listProductprocess(this.form.productId).then(response =>{
|
listProductprocess(this.form.productId).then((response) => {
|
||||||
this.processOptions = response.data;
|
this.processOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -390,15 +557,23 @@ export default {
|
|||||||
return {
|
return {
|
||||||
id: node.workorderId,
|
id: node.workorderId,
|
||||||
label: node.workorderName,
|
label: node.workorderName,
|
||||||
children: node.children
|
children: node.children,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/** 查询生产工单下拉树结构 */
|
/** 查询生产工单下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
listWorkorder().then(response => {
|
listWorkorder().then((response) => {
|
||||||
this.workorderOptions = [];
|
this.workorderOptions = [];
|
||||||
const data = { workorderId: 0, workorderName: '顶级节点', children: [] };
|
const data = {
|
||||||
data.children = this.handleTree(response.data, "workorderId", "parentId");
|
workorderId: 0,
|
||||||
|
workorderName: "顶级节点",
|
||||||
|
children: [],
|
||||||
|
};
|
||||||
|
data.children = this.handleTree(
|
||||||
|
response.data,
|
||||||
|
"workorderId",
|
||||||
|
"parentId"
|
||||||
|
);
|
||||||
this.workorderOptions.push(data);
|
this.workorderOptions.push(data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -434,7 +609,7 @@ export default {
|
|||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
};
|
};
|
||||||
this.activeProcess = 0;
|
this.activeProcess = 0;
|
||||||
this.autoGenFlag = true;
|
this.autoGenFlag = true;
|
||||||
@ -457,6 +632,22 @@ export default {
|
|||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
var ids = [];
|
||||||
|
ids = selection.map((item) => item.routeId);
|
||||||
|
},
|
||||||
|
production() {},
|
||||||
|
handleproductione() {},
|
||||||
|
|
||||||
|
selectable(row, index) {
|
||||||
|
if (row.status == "WORKING") {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//从BOM行中直接新增
|
//从BOM行中直接新增
|
||||||
handleSubAdd(row) {
|
handleSubAdd(row) {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -491,7 +682,7 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加生产工单";
|
this.title = "添加生产工单";
|
||||||
this.optType = "add";
|
this.optType = "add";
|
||||||
genCode('WORKORDER_CODE').then(response =>{
|
genCode("WORKORDER_CODE").then((response) => {
|
||||||
this.form.workorderCode = response;
|
this.form.workorderCode = response;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -500,7 +691,7 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
const workorderId = row.workorderId || this.ids;
|
const workorderId = row.workorderId || this.ids;
|
||||||
getWorkorder(workorderId).then(response => {
|
getWorkorder(workorderId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.getProcess();
|
this.getProcess();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
@ -515,7 +706,7 @@ export default {
|
|||||||
if (row != null) {
|
if (row != null) {
|
||||||
this.form.parentId = row.workorderId;
|
this.form.parentId = row.workorderId;
|
||||||
}
|
}
|
||||||
getWorkorder(row.workorderId).then(response => {
|
getWorkorder(row.workorderId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.getProcess();
|
this.getProcess();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
@ -525,17 +716,17 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.workorderId != null) {
|
if (this.form.workorderId != null) {
|
||||||
updateWorkorder(this.form).then(response => {
|
updateWorkorder(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
//this.open = false;
|
//this.open = false;
|
||||||
this.$refs["bomlist"].getList();
|
this.$refs["bomlist"].getList();
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addWorkorder(this.form).then(response => {
|
addWorkorder(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
//this.open = false;
|
//this.open = false;
|
||||||
this.form.workorderId = response.data;
|
this.form.workorderId = response.data;
|
||||||
@ -547,12 +738,18 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.confirm(
|
||||||
|
'是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?'
|
||||||
|
)
|
||||||
|
.then(function () {
|
||||||
return delWorkorder(row.workorderId);
|
return delWorkorder(row.workorderId);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
handleSelectProduct() {
|
handleSelectProduct() {
|
||||||
this.$refs.itemSelect.showFlag = true;
|
this.$refs.itemSelect.showFlag = true;
|
||||||
@ -562,14 +759,20 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('mes/pro/workorder/export', {
|
this.download(
|
||||||
...this.queryParams
|
"mes/pro/workorder/export",
|
||||||
}, `workorder_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`workorder_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
handleFinish() {
|
handleFinish() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$modal.confirm('是否完成工单编制?【完成后将不能更改】').then(function(){
|
this.$modal
|
||||||
that.form.status = 'CONFIRMED';
|
.confirm("是否完成工单编制?【完成后将不能更改】")
|
||||||
|
.then(function () {
|
||||||
|
that.form.status = "CONFIRMED";
|
||||||
that.submitForm();
|
that.submitForm();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -594,14 +797,14 @@ export default {
|
|||||||
//自动生成编码
|
//自动生成编码
|
||||||
handleAutoGenChange(autoGenFlag) {
|
handleAutoGenChange(autoGenFlag) {
|
||||||
if (autoGenFlag) {
|
if (autoGenFlag) {
|
||||||
genCode('WORKORDER_CODE').then(response =>{
|
genCode("WORKORDER_CODE").then((response) => {
|
||||||
this.form.workorderCode = response;
|
this.form.workorderCode = response;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.form.workorderCode = null;
|
this.form.workorderCode = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user