|
|
|
@ -150,6 +150,17 @@
|
|
|
|
|
>打印预览
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleDetail"
|
|
|
|
|
>工单详情
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
@ -168,7 +179,12 @@
|
|
|
|
|
<el-table-column width="300" label="产品名称" align="center" prop="productName"/>
|
|
|
|
|
<el-table-column label="规格型号" align="center" prop="productSpc" v-if="false"/>
|
|
|
|
|
<el-table-column width="50" label="单位" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column width="120" label="已生产数量" align="center" prop="quantityProduced"/>
|
|
|
|
|
<!--
|
|
|
|
|
<el-table-column label="子单批次信息" width="300" align="center" prop="batchInfo">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-for="item in scope.row.batchInfo">{{ item }}</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>-->
|
|
|
|
|
<el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/>
|
|
|
|
|
<el-table-column width="150" label="工艺编码" align="center" prop="routeCode"/>
|
|
|
|
|
<el-table-column width="200" label="工艺名称" align="center" prop="routeName" />
|
|
|
|
@ -188,6 +204,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="班次" align="center" prop="shiftId" :formatter="shiftFormat">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="工单状态" align="center" prop="status">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.workorder_type" :value="scope.row.status"/>
|
|
|
|
@ -463,12 +480,13 @@
|
|
|
|
|
<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" prop="batchCodeList" label="批次号"></el-table-column>
|
|
|
|
|
<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="submitForm">确 定</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm" v-if="showDetail">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
@ -486,7 +504,6 @@
|
|
|
|
|
v-model="materielParams.productCode"
|
|
|
|
|
placeholder="请输入物料编码"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleMaterielQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料名称" prop="productCode">
|
|
|
|
@ -494,7 +511,6 @@
|
|
|
|
|
v-model="materielParams.productDescZh"
|
|
|
|
|
placeholder="请输入物料名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleMaterielQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
@ -554,6 +570,7 @@ export default {
|
|
|
|
|
// 打印
|
|
|
|
|
formRef: 'form',
|
|
|
|
|
validateRules: [],
|
|
|
|
|
materielList:[],
|
|
|
|
|
printData: {
|
|
|
|
|
printable: 'printFrom',
|
|
|
|
|
ignore: ['no-print'],
|
|
|
|
@ -698,6 +715,7 @@ export default {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
},
|
|
|
|
|
materielBP: [],
|
|
|
|
|
showDetail:true
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
@ -714,6 +732,12 @@ export default {
|
|
|
|
|
return cellValue.slice(7,18); //返回值
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 新增-物料搜索
|
|
|
|
|
handleMaterielQuery() {
|
|
|
|
|
this.materielQueryParams.pageNum = 1;
|
|
|
|
|
this.getMaterielList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 变更-车数数量校验
|
|
|
|
|
changeCarNum(num) {
|
|
|
|
|
|
|
|
|
@ -1279,9 +1303,150 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 工单详情按钮操作
|
|
|
|
|
handleDetail(row) {
|
|
|
|
|
// 数据初始化
|
|
|
|
|
this.reset();
|
|
|
|
|
this.splitData = [];
|
|
|
|
|
this.productData = [];
|
|
|
|
|
this.splitForm = {
|
|
|
|
|
prodLineCodeArray: [],
|
|
|
|
|
splitNum: null,
|
|
|
|
|
productDate: null,
|
|
|
|
|
shiftId: null,
|
|
|
|
|
routeCode: null,
|
|
|
|
|
carNum: null,
|
|
|
|
|
prodType:null,
|
|
|
|
|
materialCode:null,
|
|
|
|
|
materialName:null
|
|
|
|
|
}
|
|
|
|
|
this.formFields = []
|
|
|
|
|
this.converCarNum = null;
|
|
|
|
|
|
|
|
|
|
// 获取班次信息
|
|
|
|
|
getProShifts().then(response => {
|
|
|
|
|
this.workShift = response.data
|
|
|
|
|
})
|
|
|
|
|
// 获取工艺信息
|
|
|
|
|
getProRoutes(this.selectWork.productCode).then(response => {
|
|
|
|
|
this.routes = response.data
|
|
|
|
|
getProEquipment(this.selectWork.routeCode).then(response => {
|
|
|
|
|
this.proline = response.data
|
|
|
|
|
})
|
|
|
|
|
// 设置车数换算值
|
|
|
|
|
for (let i = 0; i < this.routes.length; i++) {
|
|
|
|
|
if (this.routes[i].routeCode == this.selectWork.routeCode) {
|
|
|
|
|
this.converCarNum = this.routes[i].carNumUnit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// 获取工艺设备信息
|
|
|
|
|
getProEquipment(this.selectWork.routeCode).then(response2 => {
|
|
|
|
|
this.eRouteOptions = response2.data
|
|
|
|
|
})
|
|
|
|
|
// 获取批次信息list
|
|
|
|
|
getWorkBatchList(this.selectWork).then(response => {
|
|
|
|
|
this.formFields = response.data
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 获取工单和订单信息
|
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
|
this.proLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
|
this.workerLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
|
getOrderAndWork(this.selectWork).then(response => {
|
|
|
|
|
this.splitData.push(response.data.workOrder)
|
|
|
|
|
this.productData.push(response.data.order)
|
|
|
|
|
|
|
|
|
|
//订单产品类型
|
|
|
|
|
this.splitForm.prodType = this.splitData[0].prodType
|
|
|
|
|
|
|
|
|
|
if(this.productData[0].prodType == 'white') {
|
|
|
|
|
this.checkType = true
|
|
|
|
|
this.splitForm.materialName = this.splitData[0].materialName
|
|
|
|
|
this.splitForm.materialCode = this.splitData[0].materialCode
|
|
|
|
|
}else {
|
|
|
|
|
this.checkType = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.refreshProTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshProTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.proLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
})
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.workerLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 设置拆分数量
|
|
|
|
|
this.splitForm.splitNum = this.splitData[0].quantitySplit
|
|
|
|
|
// 设置选择机型
|
|
|
|
|
this.splitForm.prodLineCodeArray = response.data.workOrder.prodLineCodeArray
|
|
|
|
|
// 设置车数
|
|
|
|
|
this.splitForm.carNum = this.splitData[0].carNum
|
|
|
|
|
// 设置班次
|
|
|
|
|
this.splitForm.shiftId = this.splitData[0].shiftDesc
|
|
|
|
|
// 设置工艺
|
|
|
|
|
this.splitForm.routeCode = this.splitData[0].routeCode
|
|
|
|
|
|
|
|
|
|
//初始化日期为默认今天
|
|
|
|
|
if(this.splitData[0].productDate != null){
|
|
|
|
|
this.splitForm.productDate = this.splitData[0].productDate;
|
|
|
|
|
}else{
|
|
|
|
|
this.splitForm.productDate = new Date();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 订单为白坯
|
|
|
|
|
if (this.productData[0].prodType == 'white'){
|
|
|
|
|
// 递归将拆分数量还原
|
|
|
|
|
function setAtrr1(order, work) {
|
|
|
|
|
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
|
|
|
|
|
order.atrr1 = work.quantitySplit;
|
|
|
|
|
|
|
|
|
|
if (order.children !== undefined && work.children !== undefined) {
|
|
|
|
|
setAtrr1(order.children[0], work);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setAtrr1(this.productData[0], this.splitData[0]);
|
|
|
|
|
}
|
|
|
|
|
// 订单为成品
|
|
|
|
|
if (this.productData[0],prototype != 'white'){
|
|
|
|
|
|
|
|
|
|
if(this.splitData[0].sortNo != null){
|
|
|
|
|
this.splitForm.sortNo = this.splitData[0].sortNo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 递归将拆分数量还原
|
|
|
|
|
function setAtrr1(order, work) {
|
|
|
|
|
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
|
|
|
|
|
order.atrr1 = work.quantitySplit;
|
|
|
|
|
|
|
|
|
|
if (order.children !== undefined && work.children !== undefined) {
|
|
|
|
|
setAtrr1(order.children[0], work.children[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setAtrr1(this.productData[0], this.splitData[0]);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "生产工单详情";
|
|
|
|
|
this.showDetail = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.showDetail = true;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 首-表单重置
|
|
|
|
|