计划的设备选择方式修改

yangwl
zhaoxiaolin 1 year ago
parent 9cbe8c9902
commit 50e20c3e0c

@ -243,7 +243,7 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('mes/prepare/export', { this.download('mes/reportWork/productionExport', {
...this.queryParams ...this.queryParams
}, `prepare_${new Date().getTime()}.xlsx`) }, `prepare_${new Date().getTime()}.xlsx`)
}, },

@ -345,18 +345,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="1" :span="7"> <el-col :offset="1" :span="7">
<!-- 选择产线 --> <el-form-item label="选择设备:">
<el-form-item label="选择线体:"> <el-cascader
<el-select @focus="changeEquipment" size="small" v-model="splitForm.prodLineCode" placeholder="请选择线体"> :options="eRouteOptions"
<el-option v-for="item in proline" :key="item.key" :label="item.label" :value="item.key"></el-option> :props="eRouteProps"
</el-select> v-model="splitForm.prodLineCodeArray"
</el-form-item> clearable></el-cascader>
</el-col>
<el-col :offset="1" :span="5">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -378,6 +372,13 @@
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input> <el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="1" :span="5">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row> </el-row>
<!-- 第三行 --> <!-- 第三行 -->
<el-row v-for="(item, index) in formFields" :key="index"> <el-row v-for="(item, index) in formFields" :key="index">
@ -411,12 +412,13 @@
row-key="workorderCode" row-key="workorderCode"
style="width: 100%" style="width: 100%"
max-height="240" max-height="240"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
> >
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column> <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="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="100" align="center" prop="productDate" label="工单日期"></el-table-column>
<el-table-column width="100" align="center" prop="prodLineCode" label="成型机"></el-table-column> <el-table-column width="150" align="center" prop="prodLineCode" label="生产线体设备"></el-table-column>
<el-table-column width="80" align="center" prop="quantitySplit" label="数量"></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="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="routeCode"/>
@ -548,7 +550,7 @@ export default {
// //
splitForm: { splitForm: {
id: null, id: null,
prodLineCode: null, prodLineCodeArray: [],
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,
@ -557,7 +559,10 @@ export default {
}, },
// //
rules: {}, rules: {},
addrules: {} addrules: {},
/**********************************/
eRouteProps: { multiple: true },
eRouteOptions: []
} }
}, },
created() { created() {
@ -576,7 +581,7 @@ export default {
// //
changeRoute(routeCode) { changeRoute(routeCode) {
getProEquipment(routeCode).then(response => { getProEquipment(routeCode).then(response => {
this.proline = response.data this.eRouteOptions = response.data
}) })
}, },
// 线 // 线
@ -877,9 +882,9 @@ export default {
}) })
return return
} }
if (this.splitForm.prodLineCode == null) { if (this.splitForm.prodLineCodeArray.length ==0) {
this.$message({ this.$message({
message: '请选择线体', message: '请选择各流程节点的设备',
type: 'warning' type: 'warning'
}) })
return return
@ -924,7 +929,7 @@ export default {
// //
const data = { const data = {
formFields: this.formFields, formFields: this.formFields,
prodLineCode: this.splitForm.prodLineCode, prodLineCodeArray: this.splitForm.prodLineCodeArray,
productDate: this.splitForm.productDate, productDate: this.splitForm.productDate,
shiftId: this.splitForm.shiftId, shiftId: this.splitForm.shiftId,
splitNum: this.splitForm.splitNum, splitNum: this.splitForm.splitNum,
@ -946,7 +951,7 @@ export default {
// //
this.splitForm = { this.splitForm = {
id: null, id: null,
prodLineCode: null, prodLineCode: [],
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,
@ -1076,7 +1081,7 @@ export default {
resetBatch() { resetBatch() {
this.splitForm = { this.splitForm = {
id: null, id: null,
prodLineCode: null, prodLineCode: [],
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,
@ -1146,6 +1151,7 @@ export default {
if (row != null) { if (row != null) {
this.splitForm.parentOrder = row.orderCode this.splitForm.parentOrder = row.orderCode
} }
getOrder(row.id).then(response => { getOrder(row.id).then(response => {
this.splitForm = response.data this.splitForm = response.data
this.splitOpen = true this.splitOpen = true

@ -170,7 +170,7 @@
<el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/> <el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/>
<el-table-column width="150" label="工艺编码" align="center" prop="routeCode" /> <el-table-column width="150" label="工艺编码" align="center" prop="routeCode" />
<el-table-column width="150" label="工艺名称" align="center" prop="routeName" /> <el-table-column width="150" label="工艺名称" align="center" prop="routeName" />
<el-table-column width="130" label="产线设备" align="center" prop="prodLineCode" /> <el-table-column width="130" label="产线设备" align="center" prop="prodLineName" />
<el-table-column width="120" label="工单生产日期" align="center" prop="productDate"> <el-table-column width="120" label="工单生产日期" align="center" prop="productDate">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }}</span>
@ -343,18 +343,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="1" :span="7"> <el-col :offset="1" :span="7">
<!-- 选择产线 --> <el-form-item label="选择设备:">
<el-form-item label="选择线体:"> <el-cascader
<el-select @change="machineType" size="small" v-model="splitForm.prodLineCode" placeholder="请选择线体"> :options="eRouteOptions"
<el-option v-for="item in proline" :key="item.key" :label="item.label" :value="item.key"></el-option> :props="eRouteProps"
</el-select> v-model="splitForm.prodLineCodeArray"
</el-form-item> clearable></el-cascader>
</el-col>
<el-col :offset="1" :span="5">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker value-format="yyyy-MM-dd" @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -379,6 +373,13 @@
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input> <el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="1" :span="5">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row> </el-row>
<!-- 第三行 --> <!-- 第三行 -->
<el-row v-for="(item, index) in formFields" :key="index"> <el-row v-for="(item, index) in formFields" :key="index">
@ -417,7 +418,7 @@
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column> <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="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="100" align="center" prop="productDate" label="工单日期"></el-table-column>
<el-table-column width="100" align="center" prop="prodLineCode" label="成型机"></el-table-column> <el-table-column width="150" align="center" prop="prodLineCode" label="生产线体设备"></el-table-column>
<el-table-column width="80" align="center" prop="quantitySplit" label="数量"></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="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="routeCode"/>
@ -505,7 +506,7 @@ export default {
refreshProTable: true, refreshProTable: true,
// form // form
splitForm:{ splitForm:{
prodLineCode: null, prodLineCodeArray: [],
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,
@ -585,8 +586,12 @@ export default {
unit: [ unit: [
{ required: true, message: "单位不能为空", trigger: "blur" } { required: true, message: "单位不能为空", trigger: "blur" }
], ],
} },
/**********************************/
eRouteProps: { multiple: true },
eRouteOptions: []
}; };
}, },
created() { created() {
this.getList(); this.getList();
@ -710,7 +715,7 @@ export default {
/** 更改工艺 */ /** 更改工艺 */
routeChange(e){ routeChange(e){
getProEquipment(e).then(response => { getProEquipment(e).then(response => {
this.proline = response.data this.eRouteOptions = response.data
}) })
this.workForm.routeCode = e this.workForm.routeCode = e
}, },
@ -768,10 +773,7 @@ export default {
checkDate(e){ checkDate(e){
this.workForm.productDate = e this.workForm.productDate = e
}, },
/** 成型机选择 */
machineType(e) {
this.workForm.prodLineCode = e
},
/** 查询生产工单列表 */ /** 查询生产工单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -809,6 +811,7 @@ export default {
quantitySplit: null, quantitySplit: null,
routeCode: null, routeCode: null,
prodLineCode: null, prodLineCode: null,
prodLineCodeArray:[],
productDate: null, productDate: null,
shiftId: null, shiftId: null,
parentOrder: null, parentOrder: null,
@ -859,14 +862,14 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
// // ()
if (this.selectWork.status == "w1"){ //if (this.selectWork.status == "w1"){
this.$message({ // this.$message({
message:'工单已派发!不可修改!', // message:'',
type:'warning' // type:'warning'
}) // })
return; // return;
} //}
// //
checkWorkOrder(this.selectWork.workorderId).then(response => { checkWorkOrder(this.selectWork.workorderId).then(response => {
if (response.code == 500){ if (response.code == 500){
@ -882,7 +885,7 @@ export default {
this.splitData = []; this.splitData = [];
this.productData =[]; this.productData =[];
this.splitForm={ this.splitForm={
prodLineCode: null, prodLineCodeArray: [],
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,
@ -902,6 +905,10 @@ export default {
getProEquipment(this.selectWork.routeCode).then(response => { getProEquipment(this.selectWork.routeCode).then(response => {
this.proline = response.data this.proline = response.data
}) })
})
//
getProEquipment(this.selectWork.routeCode).then(response2 => {
this.eRouteOptions = response2.data
}) })
// list // list
getWorkBatchList(this.selectWork).then(response => { getWorkBatchList(this.selectWork).then(response => {
@ -932,7 +939,7 @@ export default {
// //
this.splitForm.splitNum = this.splitData[0].quantitySplit this.splitForm.splitNum = this.splitData[0].quantitySplit
// //
this.splitForm.prodLineCode = this.splitData[0].prodLineCode this.splitForm.prodLineCodeArray = response.data.workOrder.prodLineCodeArray
// //
this.splitForm.shiftId = this.splitData[0].shiftDesc this.splitForm.shiftId = this.splitData[0].shiftDesc
// //
@ -978,21 +985,6 @@ export default {
}, },
/** 拆分-提交按钮 */ /** 拆分-提交按钮 */
submitForm() { submitForm() {
//
if (this.splitForm.splitNum == null || this.splitForm.shiftId == null || this.splitForm.prodLineCode == null || this.splitForm.routeCode == null) {
this.$message({
message: '数据不能为空!',
type: 'warning'
})
return
}
if (this.splitForm.routeCode == null) {
this.$message({
message: '数据不能为空!',
type: 'warning'
})
return
}
// //
let sum = 0 let sum = 0
for (let i = 0; i < this.formFields.length; i++) { for (let i = 0; i < this.formFields.length; i++) {
@ -1020,7 +1012,7 @@ export default {
// //
const data = { const data = {
formFields: this.formFields, formFields: this.formFields,
prodLineCode: this.workForm.prodLineCode, prodLineCodeArray: this.splitForm.prodLineCodeArray,
productDate: this.splitForm.productDate, productDate: this.splitForm.productDate,
shiftId: this.workForm.shiftId, shiftId: this.workForm.shiftId,
splitNum: this.workForm.splitNum, splitNum: this.workForm.splitNum,
@ -1042,7 +1034,7 @@ export default {
// //
this.splitForm = { this.splitForm = {
id: null, id: null,
prodLineCode: null, prodLineCodeArray: [],
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,

Loading…
Cancel
Save