工艺流程

This commit is contained in:
打豆豆 2024-03-11 13:19:28 +08:00
parent 37ae89d618
commit 2415808862
2 changed files with 389 additions and 152 deletions

View File

@ -311,12 +311,12 @@
placeholder="请选择设备类型" placeholder="请选择设备类型"
@select="handleNodeClick" @select="handleNodeClick"
/> />
<!-- :disable-branch-nodes="true" --> <!-- :disable-branch-nodes="true" -->
</el-form-item> </el-form-item>
</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 @@
>&nbsp;预览文件</el-button >&nbsp;预览文件</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;

View File

@ -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,86 +67,191 @@
/> />
</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
</div> class="left-container"
</div> ref="ganttChar"
:tasks="tasks"
></GanttChar>
</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 label="工单编码" width="180" prop="workorderCode" > <el-table-column
type="selection"
width="55"
align="center"
:selectable="selectable"
/>
<el-table-column label="工单编码" width="180" prop="workorderCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
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
<el-table-column label="工单来源" align="center" prop="orderSource" > label="工单名称"
width="200"
align="center"
prop="workorderName"
:show-overflow-tooltip="true"
/>
<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"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
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>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -159,25 +271,26 @@
<el-form-item label="工单名称" prop="workorderName"> <el-form-item label="工单名称" prop="workorderName">
<el-input v-model="form.workorderName" readonly="readonly" /> <el-input v-model="form.workorderName" readonly="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="来源类型" prop="orderSource"> <el-form-item label="来源类型" prop="orderSource">
<el-radio-group v-model="form.orderSource" disabled> <el-radio-group v-model="form.orderSource" disabled>
<el-radio <el-radio
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>
<el-col :span="8" v-if="form.orderSource == 'ORDER'"> <el-col :span="8" v-if="form.orderSource == 'ORDER'">
<el-form-item label="订单编号" prop="sourceCode"> <el-form-item label="订单编号" prop="sourceCode">
<el-input v-model="form.sourceCode" readonly="readonly" /> <el-input v-model="form.sourceCode" readonly="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="排产状态" prop="status"> <el-form-item label="排产状态" prop="status">
<el-select v-model="form.status" disabled> <el-select v-model="form.status" disabled>
@ -189,12 +302,12 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产品编号" prop="productCode"> <el-form-item label="产品编号" prop="productCode">
<el-input v-model="form.productCode" readonly="readonly" > <el-input v-model="form.productCode" readonly="readonly">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -202,7 +315,7 @@
<el-form-item label="产品名称" prop="productName"> <el-form-item label="产品名称" prop="productName">
<el-input v-model="form.productName" readonly="readonly" /> <el-input v-model="form.productName" readonly="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -214,7 +327,7 @@
<el-form-item label="单位" prop="unitOfMeasure"> <el-form-item label="单位" prop="unitOfMeasure">
<el-input v-model="form.unitOfMeasure" readonly="readonly" /> <el-input v-model="form.unitOfMeasure" readonly="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -224,19 +337,21 @@
</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>
</el-row> </el-row>
<el-row v-if="form.orderSource == 'ORDER'"> <el-row v-if="form.orderSource == 'ORDER'">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户编号" prop="clientCode"> <el-form-item label="客户编号" prop="clientCode">
<el-input v-model="form.clientCode" readonly="readonly" > <el-input v-model="form.clientCode" readonly="readonly">
</el-input> </el-input>
</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,8 +431,14 @@
</template> </template>
<script> <script>
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder } from "@/api/mes/pro/workorder"; import {
import {listGanttTaskList} from "@/api/mes/pro/protask"; listWorkorder,
getWorkorder,
delWorkorder,
addWorkorder,
updateWorkorder,
} from "@/api/mes/pro/workorder";
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";
import GanttChar from "./ganttx.vue"; import GanttChar from "./ganttx.vue";
@ -284,16 +447,16 @@ 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 {
// //
autoGenFlag:true, autoGenFlag: true,
optType: undefined, optType: undefined,
activeProcess: 0, activeProcess: 0,
// //
@ -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,
@ -342,9 +505,9 @@ export default {
ancestors: null, ancestors: null,
status: null, status: null,
}, },
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();
@ -376,10 +543,10 @@ 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,19 +609,19 @@ 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;
this.resetForm("form"); this.resetForm("form");
}, },
// //
openGanttChart(){ openGanttChart() {
this.$refs.ganttChar.showFlag =true; this.$refs.ganttChar.showFlag = true;
}, },
//Step //Step
handleStepClick(index){ handleStepClick(index) {
this.activeProcess =index; this.activeProcess = index;
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -457,8 +632,24 @@ 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;
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
@ -472,7 +663,7 @@ export default {
} }
this.open = true; this.open = true;
this.title = "添加生产工单"; this.title = "添加生产工单";
this.optType="add"; this.optType = "add";
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd(row) { handleAdd(row) {
@ -490,17 +681,17 @@ 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;
}); });
}, },
// //
handleView(row){ handleView(row) {
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,27 +706,27 @@ 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;
this.title = "生产排产"; this.title = "生产排产";
this.optType="edit"; this.optType = "edit";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
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,66 +738,78 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal.confirm('是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?').then(function() { this.$modal
return delWorkorder(row.workorderId); .confirm(
}).then(() => { '是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?'
this.getList(); )
this.$modal.msgSuccess("删除成功"); .then(function () {
}).catch(() => {}); return delWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
handleSelectProduct(){ handleSelectProduct() {
this.$refs.itemSelect.showFlag = true; this.$refs.itemSelect.showFlag = true;
}, },
handleSelectClient(){ handleSelectClient() {
this.$refs.clientSelect.showFlag = true; this.$refs.clientSelect.showFlag = true;
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
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("是否完成工单编制?【完成后将不能更改】")
that.submitForm(); .then(function () {
}); that.form.status = "CONFIRMED";
that.submitForm();
});
}, },
// //
onItemSelected(obj){ onItemSelected(obj) {
if(obj != undefined && obj != null){ if (obj != undefined && obj != null) {
this.form.productId = obj.itemId; this.form.productId = obj.itemId;
this.form.productCode = obj.itemCode; this.form.productCode = obj.itemCode;
this.form.productName = obj.itemName; this.form.productName = obj.itemName;
this.form.productSpc = obj.specification; this.form.productSpc = obj.specification;
this.form.unitOfMeasure = obj.unitOfMeasure; this.form.unitOfMeasure = obj.unitOfMeasure;
} }
}, },
// //
onClientSelected(obj){ onClientSelected(obj) {
if(obj != undefined && obj != null){ if (obj != undefined && obj != null) {
this.form.clientId = obj.clientId; this.form.clientId = obj.clientId;
this.form.clientCode = obj.clientCode; this.form.clientCode = obj.clientCode;
this.form.clientName = obj.clientName; this.form.clientName = obj.clientName;
} }
}, },
// //
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>
.wrapper{ .wrapper {
height: 400px; height: 400px;
} }
.container { .container {
height: 100%; height: 100%;