湿料计划集成到白胚订单拆分

master
zhaoxiaolin 1 year ago
parent d1162e6acc
commit 0219b43ac8

@ -1136,6 +1136,7 @@ export default {
handleSelectionChange(selection) {
//
this.checkSelect = true
/**
//
for (let i = 0; i < selection.length; i++) {
if (selection[0].shiftId != selection[i].shiftId) {
@ -1146,6 +1147,7 @@ export default {
this.checkSelect = false
}
}
**/
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length

@ -394,27 +394,17 @@
</el-select>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<el-form-item label="选择设备:">
<el-cascader
@focus="changeEquipment"
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
style="width:100%"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<el-col :span="7">
<el-col :offset="1" :span="7">
<!-- 选择班次 -->
<el-form-item size="small" label="选择班次:" class="my-select my-first">
<el-select v-model="splitForm.shiftId" placeholder="请选择班次">
@ -424,6 +414,18 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<el-col :span="7">
<!-- 选择物料 -->
<el-form-item size="small" label="投料名称:">
<el-input @focus="selectBPMateriel" readonly v-model="splitForm.materialName" placeholder="点击选择物料"/>
</el-form-item>
<el-form-item size="small" label="投料编码:">
<el-input readonly v-model="splitForm.materialCode" placeholder="点击选择物料" disabled/>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<!-- 拆分数量 -->
<el-form-item size="small" label="拆分数量:">
@ -437,6 +439,20 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="选择设备:">
<div style="height: 130px;overflow-y: auto;">
<el-cascader
@focus="changeEquipment"
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
</div>
</el-form-item>
</el-col>
</el-row>
<!-- 第三行 -->
<el-row v-for="(item, index) in formFields" :key="index">
<!-- 批次编号 -->
@ -522,6 +538,56 @@
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<!--组成白坯物料选择弹窗-->
<el-dialog
width="800px"
title="物料选择"
:visible.sync="innerBPVisible"
append-to-body>
<el-form :model="materielParams" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="物料编码" prop="productCode">
<el-input
v-model="materielParams.productCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="productCode">
<el-input
v-model="materielParams.productDescZh"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterielQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 物料列表展示 -->
<el-table v-loading="loading" :data="materielList" @selection-change="selectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column label="物料编码" align="center" prop="productCode"/>
<el-table-column label="物料名称" align="center" prop="productDescZh"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="materielParams.pageNum"
:limit.sync="materielParams.pageSize"
@pagination="getBPMaterielList"
/>
<el-button @click="subMaterielBP" class="my-materiel-btn" type="primary">确定</el-button>
</el-dialog>
</div>
</template>
@ -573,7 +639,9 @@ export default {
shiftId: null,
routeCode: null,
formFields: [],
carNum: null
carNum: null,
materialCode: null,
materialName: null
},
// -
refreshProTable: true,
@ -672,7 +740,17 @@ export default {
headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/plan/order/importData"
}
},
//
innerBPVisible: false,
materielParams: {
mtart: 'material_type1',
productCode: null,
productDescZh: null,
pageNum: 1,
pageSize: 10,
},
materielBP: [],
};
},
created() {
@ -795,7 +873,9 @@ export default {
productDate: null,
shiftId: null,
routeCode: null,
formFields: []
formFields: [],
materialCode: null,
materialName: null
}
this.splitData = []
this.productData = []
@ -871,7 +951,14 @@ export default {
}
if (this.splitForm.productDate == null) {
this.$message({
message: '请选择工单日期!!',
message: '请选择工单日期!',
type: 'warning'
})
return
}
if (this.splitForm.materialCode == null) {
this.$message({
message: '请选择组成白坯的物料!',
type: 'warning'
})
return
@ -908,7 +995,9 @@ export default {
splitNum: this.splitForm.splitNum,
product: this.productData[0],
routeCode: this.splitForm.routeCode,
carNum: this.splitForm.carNum
carNum: this.splitForm.carNum,
materialCode: this.splitForm.materialCode,
materialName: this.splitForm.materialName
}
subSplitOrder(data).then(response => {
@ -930,7 +1019,9 @@ export default {
splitNum: null,
productDate: null,
shiftId: null,
formFields: []
formFields: [],
materialCode:null,
materialName:null
}
this.formFields = [{
batchCode: '',
@ -1016,7 +1107,9 @@ export default {
productDate: null,
shiftId: null,
routeCode: null,
formFields: []
formFields: [],
materialCode:null,
materialName:null
};
this.splitData = [];
@ -1379,7 +1472,51 @@ export default {
// -
importTemplate() {
this.download('/plan/whiteOrder/importTemplate', {}, `order_example_template_${new Date().getTime()}.xlsx`)
}
},
//-
selectBPMateriel() {
//
this.materielParams.productCode = null;
this.materielParams.productDescZh = null;
this.innerBPVisible = true;
this.getBPMaterielList();
},
//-
getBPMaterielList() {
this.loading = true;
selectMaterielList(this.materielParams).then(response => {
this.materielList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// --
selectionChange(e) {
this.materielBP = e;
},
// --
subMaterielBP() {
if (this.materielBP.length == 0) {
this.$message({
message: '请选择物料!',
type: 'warning'
})
return
}
if (this.materielBP.length > 1) {
this.$message({
message: '物料只能选择一个!',
type: 'warning'
})
return
}
this.splitForm.materialCode = this.materielBP[0].productCode;
this.splitForm.materialName = this.materielBP[0].productDescZh;
this.innerBPVisible = false;
},
}
};
</script>

@ -68,12 +68,9 @@
</el-form-item>
<el-form-item label="班次" prop="shiftId">
<el-select v-model="queryParams.shiftId" placeholder="请选择班次" clearable>
<el-option
v-for="dict in dict.type.shift_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-option v-for="item in workShift" :key="item.shiftId" :label="item.shiftDesc"
:value="item.shiftId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
@ -188,10 +185,7 @@
<span>{{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="班次" align="center" prop="shiftId">
<template slot-scope="scope">
<dict-tag :options="dict.type.shift_type" :value="scope.row.shiftId"/>
</template>
<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">
@ -275,10 +269,7 @@
prop="prodLineCode"
label="产线设备">
</el-table-column>
<el-table-column label="班次" align="center" prop="shiftId">
<template slot-scope="scope">
<dict-tag :options="dict.type.shift_type" :value="scope.row.shiftId"/>
</template>
<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">
@ -354,15 +345,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<el-form-item label="选择设备:">
<el-cascader
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
@ -370,28 +352,44 @@
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<el-col :span="7">
<el-col :offset="1" :span="7">
<!-- 选择班次 -->
<el-form-item size="small" label="选择班次:" class="my-select my-first">
<el-select @change="shiftChange" v-model="splitForm.shiftId" placeholder="请选择班次" clearable>
<el-option
v-for="dict in dict.type.shift_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-option v-for="item in workShift" :key="item.shiftId" :label="item.shiftDesc"
:value="item.shiftId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<!-- 拆分数量 -->
<el-form-item size="small" label="拆分数量:">
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<div v-if="splitForm.prodType == 'white'">
<el-col :span="7">
<!-- 选择物料 -->
<el-form-item size="small" label="投料名称:">
<el-input @focus="selectBPMateriel" readonly v-model="splitForm.materialName" placeholder="点击选择物料"/>
</el-form-item>
<el-form-item size="small" label="投料编码:">
<el-input readonly v-model="splitForm.materialCode" placeholder="点击选择物料" disabled/>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<!-- 拆分数量 -->
<el-form-item size="small" label="拆分数量:">
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item>
</el-col>
</div>
<div v-else>
<el-col :span="7">
<!-- 拆分数量 -->
<el-form-item size="small" label="拆分数量:">
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item>
</el-col>
</div>
<el-col :offset="1" :span="7">
<!-- 车数 -->
<el-form-item v-if="checkType" size="small" label="分配车数:">
@ -399,6 +397,19 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="7">
<el-form-item label="选择设备:">
<div style="height: 130px;overflow-y: auto;">
<el-cascader
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
</div>
</el-form-item>
</el-col>
</el-row>
<!-- 第三行 -->
<el-row v-for="(item, index) in formFields" :key="index">
<!-- 批次编号 -->
@ -446,7 +457,7 @@
<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"/>
<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>
<!-- 测试 -->
@ -456,7 +467,56 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--组成白坯物料选择弹窗-->
<el-dialog
width="800px"
title="物料选择"
:visible.sync="innerBPVisible"
append-to-body>
<el-form :model="materielParams" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="物料编码" prop="productCode">
<el-input
v-model="materielParams.productCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="productCode">
<el-input
v-model="materielParams.productDescZh"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterielQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 物料列表展示 -->
<el-table v-loading="loading" :data="materielList" @selection-change="selectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column label="物料编码" align="center" prop="productCode"/>
<el-table-column label="物料名称" align="center" prop="productDescZh"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="materielParams.pageNum"
:limit.sync="materielParams.pageSize"
@pagination="getBPMaterielList"
/>
<el-button @click="subMaterielBP" class="my-materiel-btn" type="primary">确定</el-button>
</el-dialog>
</div>
</template>
@ -472,12 +532,12 @@ import {
checkWorkOrder
} from '@/api/plan/workorder'
import moment from 'moment';
import { getProEquipment, getProRoutes, getProShifts} from '@/api/plan/order'
import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order'
import {prototype} from "clipboard";
export default {
name: "Workorder",
dicts: ['product_type', 'workorder_type', 'shift_type'],
dicts: ['product_type', 'workorder_type'],
data() {
return {
//
@ -539,6 +599,9 @@ export default {
shiftId: null,
routeCode: null,
carNum: 0,
prodType:null,
materialCode:null,
materialName:null
},
//
loading: true,
@ -617,12 +680,28 @@ export default {
},
/**********************************/
eRouteProps: {multiple: true},
eRouteOptions: []
eRouteOptions: [],
//
workShift: [],
//
innerBPVisible: false,
materielParams: {
mtart: 'material_type1',
productCode: null,
productDescZh: null,
pageNum: 1,
pageSize: 10,
},
materielBP: [],
};
},
created() {
this.getList();
//
getProShifts().then(response => {
this.workShift = response.data
})
},
methods: {
// -
@ -701,13 +780,14 @@ export default {
productDate: null,
shiftId: null,
routeCode: null,
carNum: null
carNum: null,
prodType:null,
materialCode:null,
materialName:null
}
this.formFields = []
this.converCarNum = null;
//
this.splitForm.productDate = new Date()
//
getProShifts().then(response => {
this.workShift = response.data
@ -741,8 +821,14 @@ export default {
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
}
@ -771,6 +857,13 @@ export default {
//
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'){
@ -1050,6 +1143,8 @@ export default {
routeCode: this.workForm.routeCode,
proOrderWorkorder: this.selectWork,
carNum: this.workForm.carNum,
materialCode: this.splitForm.materialCode,
materialName: this.splitForm.materialName
}
subChangeWorkOrder(data).then(response => {
@ -1070,7 +1165,9 @@ export default {
productDate: null,
shiftId: null,
formFields: [],
carNum: null
carNum: null,
materialCode: null,
materialName: null
}
this.formFields = [{
batchCode: '',
@ -1228,6 +1325,60 @@ export default {
//this.reset();
//this.open = true;
//this.title = "";
},
shiftFormat(row,column){
let array = this.workShift;
let value = '其他';
array.forEach((item) => {
if (item.shiftId == row.shiftId) {
value = item.shiftDesc
}
})
return value;
},
//-
selectBPMateriel() {
//
this.materielParams.productCode = null;
this.materielParams.productDescZh = null;
this.innerBPVisible = true;
this.getBPMaterielList();
},
//-
getBPMaterielList() {
this.loading = true;
selectMaterielList(this.materielParams).then(response => {
this.materielList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// --
selectionChange(e) {
this.materielBP = e;
},
// --
subMaterielBP() {
if (this.materielBP.length == 0) {
this.$message({
message: '请选择物料!',
type: 'warning'
})
return
}
if (this.materielBP.length > 1) {
this.$message({
message: '物料只能选择一个!',
type: 'warning'
})
return
}
this.splitForm.materialCode = this.materielBP[0].productCode;
this.splitForm.materialName = this.materielBP[0].productDescZh;
this.innerBPVisible = false;
}
}
};

Loading…
Cancel
Save