工单变更设备功能

master
zhaoxiaolin 1 year ago
parent 5bc949bd1b
commit 2e29e01da2

@ -92,3 +92,12 @@ export function downWorkorder(workorderId) {
method: 'post'
});
}
// 提交修改工单接口
export function subChangeWorkOrderM(data){
return request({
url:'/plan/pro/workorder/subChangeWorkOrderM',
method:'post',
data:data
})
}

@ -161,6 +161,18 @@
>工单详情
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="editMachine"
v-hasPermi="['mes:pro:workorder:edit']"
>设备修改
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -538,6 +550,75 @@
<el-button @click="subMaterielBP" class="my-materiel-btn" type="primary">确定</el-button>
</el-dialog>
<!-- 工单设备修改模块 -->
<el-dialog :title="titleM" :visible.sync="openM" width="1000px" append-to-body>
<el-table
border
v-if="refreshProTable"
v-loading="proLoading"
:data="productData"
row-key="orderCode"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column width="150" label="订单编号" prop="orderCode"/>
<el-table-column width="380" label="产品名称" align="center" prop="prodDesc"/>
<el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="130" label="产品数量" align="center" prop="quantity"/>
<el-table-column label="已拆分数量" align="center" prop="quantitySplit"/>
<el-table-column label="拆分数量" align="center" prop="atrr1"/>
</el-table>
<el-form class="my-margin" :model="splitFormM" ref="dynamicForm" label-width="80px">
<el-row>
<el-col :span="7">
<el-form-item label="选择设备:">
<div style="height: 130px;overflow-y: auto;">
<el-cascader
:options="eRouteOptionsM"
:props="eRouteProps"
v-model="splitFormM.prodLineCodeArray"
clearable></el-cascader>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 拆分尾 -->
<el-table
border
:data="splitData"
v-if="refreshWorkerTable"
v-loading="workerLoading"
row-key="workorderCode"
style="width: 100%"
max-height="240"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column width="200" align="center" prop="workorderCode" label="工单号"></el-table-column>
<el-table-column width="100" align="center" prop="productDate" label="工单日期"></el-table-column>
<el-table-column width="150" align="center" label="生产线体设备">
<template slot-scope="scope">
<el-popover width="250" placement="top-start" trigger="hover" :content="scope.row.prodLineCode">
<span slot="reference" class="btn">{{ scope.row.prodLineCode }}</span>
</el-popover>
</template>
</el-table-column>
<el-table-column width="80" align="center" prop="quantitySplit" label="数量"></el-table-column>
<el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="90" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="90" label="班次" align="center" prop="shiftDesc" :formatter="shiftFormat"/>
<el-table-column align="center" width="230" prop="batchCodeList" label="批次号"></el-table-column>
<el-table-column align="center" width="150" prop="batchNumList" label="批次数量"></el-table-column>
</el-table>
<!-- 测试 -->
<!-- 操作按钮 -->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFormM"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -549,7 +630,7 @@ import {
downWorkorder,
getOrderAndWork,getProSortNo,
getWorkBatchList,
subChangeWorkOrder,
subChangeWorkOrder,subChangeWorkOrderM,
checkWorkOrder
} from '@/api/plan/workorder'
import moment from 'moment';
@ -625,6 +706,9 @@ export default {
materialCode:null,
materialName:null
},
splitFormM: {
prodLineCodeArray: []
},
//
loading: true,
//
@ -646,6 +730,7 @@ export default {
title: "",
//
open: false,
openM:false,
//
queryParams: {
productDateArray: [new Date(), new Date()],
@ -703,6 +788,7 @@ export default {
/**********************************/
eRouteProps: {multiple: true},
eRouteOptions: [],
eRouteOptionsM: [],
//
workShift: [],
//
@ -940,7 +1026,7 @@ export default {
}
setAtrr1(this.productData[0], this.splitData[0]);
}
})
@ -1434,7 +1520,7 @@ export default {
}
setAtrr1(this.productData[0], this.splitData[0]);
}
})
@ -1443,10 +1529,72 @@ export default {
this.title = "生产工单详情";
this.showDetail = false;
},
//-----
editMachine(row) {
//
this.reset();
this.splitData = [];
this.productData = [];
this.splitFormM = {
prodLineCodeArray: [],
}
//
getProEquipment(this.selectWork.routeCode).then(response2 => {
this.eRouteOptionsM = response2.data
})
getOrderAndWork(this.selectWork).then(response => {
//
this.splitFormM.prodLineCodeArray = response.data.workOrder.prodLineCodeArray
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
this.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true // refreshProTabletrue
this.proLoading = false // false
})
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
})
this.openM = true;
this.titleM = "生产工单设备修改";
},
//-----
// -
submitFormM() {
//
const data = {
proOrderWorkorder: this.selectWork,
prodLineCodeArray: this.splitFormM.prodLineCodeArray
}
subChangeWorkOrderM(data).then(response => {
if (response.code == 500) {
this.$modal.msgError(response.msg)
return
}
this.getList()
this.$modal.msgSuccess('提交成功')
})
//
this.splitFormM = {
prodLineCodeArray: []
}
this.openM = false
},
//
cancel() {
this.open = false;
this.openM = false;
this.showDetail = true;
this.reset();
},

Loading…
Cancel
Save