|
|
@ -115,12 +115,15 @@
|
|
|
|
>导出
|
|
|
|
>导出
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<!--
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button type="primary" plain icon="el-icon-edit" size="mini" @click="handleAutoSplit" v-hasPermi="['mes:pro:order:edit']">自动排产
|
|
|
|
<el-button type="primary" plain icon="el-icon-guide" size="mini"
|
|
|
|
|
|
|
|
@click="handleAutoSplit"
|
|
|
|
|
|
|
|
:disabled="single"
|
|
|
|
|
|
|
|
v-hasPermi="['mes:pro:order:edit']">辅助排产
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
-->
|
|
|
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
@ -499,32 +502,67 @@
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
<!-- 自动排产规划 -->
|
|
|
|
<!-- 辅助排产规划 -->
|
|
|
|
<el-dialog :title="titleAutoSplit" :visible.sync="openAutoSplit" width="1000px">
|
|
|
|
<el-dialog :title="titleAutoSplit" :visible.sync="openAutoSplit" width="1000px">
|
|
|
|
<el-table v-loading="autoSplitLoading" :data="autoSplitList" ref="autoSplitTable">
|
|
|
|
<el-steps :active="activeSplit" simple>
|
|
|
|
<el-table-column label="订单号" width="150" align="left" prop="orderCode" />
|
|
|
|
<el-step title="工单基本信息" icon="el-icon-edit"></el-step>
|
|
|
|
<el-table-column label="产品编码" width="150" align="left" prop="prodCode" :formatter="productCodeFormate"/>
|
|
|
|
<el-step title="生产线体选择" icon="el-icon-s-tools"></el-step>
|
|
|
|
<el-table-column label="产品名称" width="150" align="left" prop="prodDesc" :show-overflow-tooltip="true" />
|
|
|
|
<el-step title="排产结果查看" icon="el-icon-s-order"></el-step>
|
|
|
|
<el-table-column width="90" label="订单数量" align="center" prop="quantity"/>
|
|
|
|
</el-steps>
|
|
|
|
<el-table-column width="70" label="单位" align="center" prop="unit"/>
|
|
|
|
<!--第一步-->
|
|
|
|
<el-table-column label="任务清单" align="center" prop="workerOrder" width="100"/>
|
|
|
|
<el-form ref="autoSplitform1" :model="autoSplitform1" label-width="80px" v-if="activeSplit == 0">
|
|
|
|
<el-table-column width="120" label="计划生产日期" align="center" prop="planProDate">
|
|
|
|
<div style="margin-top:20px">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-row>
|
|
|
|
<span>{{ parseTime(scope.row.planProDate, '{y}-{m}-{d}') }}</span>
|
|
|
|
<el-col :span="12">
|
|
|
|
</template>
|
|
|
|
<el-form-item label="计划生产时间" label-width="100px">
|
|
|
|
</el-table-column>
|
|
|
|
<el-date-picker type="date" placeholder="选择日期" v-model="autoSplitform1.productDate" style="width: 100%;">
|
|
|
|
<el-table-column label="排产顺序" align="center" prop="useMan">
|
|
|
|
</el-date-picker>
|
|
|
|
<template slot-scope="scope">
|
|
|
|
</el-form-item>
|
|
|
|
<el-input type="number" size="small" v-model="scope.row.useMan" @change="handleEdit(scope.$index,scope.row)"></el-input>
|
|
|
|
</el-col>
|
|
|
|
</template>
|
|
|
|
</el-row>
|
|
|
|
</el-table-column>
|
|
|
|
<el-row>
|
|
|
|
</el-table>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-button type="primary autoSplitBtn">自动拆分</el-button>
|
|
|
|
<el-form-item label="生产工艺" label-width="100px">
|
|
|
|
<el-divider content-position="center" >拆分结果</el-divider>
|
|
|
|
<el-select v-model="autoSplitform1.routeCode" placeholder="请选择工艺" style="width: 100%;">
|
|
|
|
<el-table
|
|
|
|
<el-option v-for="item in routes" :key="item.routeCode" :label="item.routeName"
|
|
|
|
|
|
|
|
:value="item.routeCode"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-form-item label="工单排序" label-width="100px">
|
|
|
|
|
|
|
|
<el-input v-model="autoSplitform1.sortNo" type="Number" style="width: 100%;"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--第二步-->
|
|
|
|
|
|
|
|
<el-form ref="autoSplitform2" :model="autoSplitform2" label-width="80px" v-if="activeSplit == 1">
|
|
|
|
|
|
|
|
<div style="margin-top:20px">
|
|
|
|
|
|
|
|
<el-form-item label="选择设备" >
|
|
|
|
|
|
|
|
<el-checkbox-group v-model="autoSplitform2.lineCodes">
|
|
|
|
|
|
|
|
<el-checkbox
|
|
|
|
|
|
|
|
v-for="(item, index) in lineCodes"
|
|
|
|
|
|
|
|
:key="item.lineCode"
|
|
|
|
|
|
|
|
:label="item.lineCode"
|
|
|
|
|
|
|
|
:name="item.lineName"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ item.lineName }}
|
|
|
|
|
|
|
|
</el-checkbox>
|
|
|
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--第三步-->
|
|
|
|
|
|
|
|
<el-table v-if="activeSplit == 2"
|
|
|
|
border
|
|
|
|
border
|
|
|
|
:data="splitData"
|
|
|
|
:data="splitData"
|
|
|
|
v-if="refreshWorkerTable"
|
|
|
|
|
|
|
|
v-loading="workerLoading"
|
|
|
|
v-loading="workerLoading"
|
|
|
|
row-key="workorderCode"
|
|
|
|
row-key="workorderCode"
|
|
|
|
style="width: 100%"
|
|
|
|
style="width: 100%"
|
|
|
@ -532,27 +570,21 @@
|
|
|
|
default-expand-all
|
|
|
|
default-expand-all
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-table-column width="50" align="center" type="selection"/>
|
|
|
|
<el-table-column width="160" align="center" prop="workorderCode" label="工单号"></el-table-column>
|
|
|
|
<el-table-column width="160" align="center" prop="workorderCode" label="母工单号"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="70" align="center" prop="quantitySplit" label="母单物料编码"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="70" align="center" prop="quantitySplit" label="母单物料名称"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="70" align="center" prop="quantitySplit" label="母单数量"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="60" label="单位" align="center" prop="unit"/>
|
|
|
|
|
|
|
|
<el-table-column width="160" align="center" prop="workorderCode" label="子工单号"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="70" align="center" prop="quantitySplit" label="子单物料编码"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="70" align="center" prop="quantitySplit" label="子单物料名称"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="70" align="center" prop="quantitySplit" label="子单数量"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column width="60" label="单位" align="center" prop="unit"/>
|
|
|
|
|
|
|
|
<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="150" 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="70" 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="routeCode"/>
|
|
|
|
<el-table-column width="70" label="班次" align="center" prop="shiftDesc"/>
|
|
|
|
<el-table-column width="70" label="班次" align="center" prop="shiftDesc"/>
|
|
|
|
<el-table-column width="160" align="center" prop="batchCodeList" label="批次号"></el-table-column>
|
|
|
|
<el-table-column width="160" align="center" prop="batchCodeList" label="批次号"></el-table-column>
|
|
|
|
<el-table-column width="100" align="center" prop="batchNumList" label="批次数量"></el-table-column>
|
|
|
|
<el-table-column width="100" align="center" prop="batchNumList" label="批次数量"></el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary">提 交</el-button>
|
|
|
|
<el-button style="margin-top: 12px;" @click="next" v-if="this.activeSplit < 2">下一步</el-button>
|
|
|
|
|
|
|
|
<el-button style="margin-top: 12px;" @click="prev" v-if="this.activeSplit > 0">上一步</el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="autoSplitCommit" v-if="this.activeSplit==2">确 认</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
@ -565,13 +597,14 @@ import {
|
|
|
|
getProEquipment,
|
|
|
|
getProEquipment,
|
|
|
|
getProRoutes,getProSortNo,
|
|
|
|
getProRoutes,getProSortNo,
|
|
|
|
getProShifts,
|
|
|
|
getProShifts,
|
|
|
|
getWorkOrderList,
|
|
|
|
getWorkOrderList,getWorkOrderListCG,
|
|
|
|
subSplitOrder,checkRepeatBatchCodes,
|
|
|
|
subSplitOrder,checkRepeatBatchCodes,
|
|
|
|
listOrder,
|
|
|
|
listOrder,
|
|
|
|
addOrder,
|
|
|
|
addOrder,
|
|
|
|
updateOrder,
|
|
|
|
updateOrder,
|
|
|
|
syncSAP, selectMaterielList,getAutoSplitList,
|
|
|
|
syncSAP, selectMaterielList,getAutoSplitList,
|
|
|
|
deleteOrder
|
|
|
|
deleteOrder,getCanProductLine,
|
|
|
|
|
|
|
|
autoSplitOrder,autoSplitOrderCancel,autoSplitOrderOk
|
|
|
|
} from '@/api/plan/order'
|
|
|
|
} from '@/api/plan/order'
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
@ -689,11 +722,18 @@ export default {
|
|
|
|
/**********************************/
|
|
|
|
/**********************************/
|
|
|
|
eRouteProps: {multiple: true},
|
|
|
|
eRouteProps: {multiple: true},
|
|
|
|
eRouteOptions: [],
|
|
|
|
eRouteOptions: [],
|
|
|
|
titleAutoSplit:"订单排产",
|
|
|
|
titleAutoSplit:"订单辅助排产",
|
|
|
|
openAutoSplit:false,
|
|
|
|
openAutoSplit:false,
|
|
|
|
orderCodes:[],
|
|
|
|
orderCodes:[],
|
|
|
|
autoSplitList:[],
|
|
|
|
autoSplitList:[],
|
|
|
|
autoSplitLoading: true
|
|
|
|
openAutoSplit: false,
|
|
|
|
|
|
|
|
activeSplit: 0,
|
|
|
|
|
|
|
|
autoSplitform1:{
|
|
|
|
|
|
|
|
productDate:null,
|
|
|
|
|
|
|
|
sortNo:null
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
autoSplitform2: {lineCodes:[]},
|
|
|
|
|
|
|
|
lineCodes:[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
@ -1335,6 +1375,9 @@ export default {
|
|
|
|
this.dialogVisible = false;
|
|
|
|
this.dialogVisible = false;
|
|
|
|
this.splitOpen = false;
|
|
|
|
this.splitOpen = false;
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
this.openAutoSplit = false;
|
|
|
|
|
|
|
|
this.activeSplit = 0;
|
|
|
|
|
|
|
|
autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 判空、空串
|
|
|
|
// 判空、空串
|
|
|
|
checkNull(entity) {
|
|
|
|
checkNull(entity) {
|
|
|
@ -1444,7 +1487,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**自动排产**/
|
|
|
|
/**辅助排产**/
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
|
handleAutoSplitSelection(selection) {
|
|
|
|
handleAutoSplitSelection(selection) {
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
this.single = selection.length !== 1
|
|
|
@ -1453,11 +1496,33 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//排产优先级
|
|
|
|
//排产优先级
|
|
|
|
handleAutoSplit(row) {
|
|
|
|
handleAutoSplit(row) {
|
|
|
|
debugger
|
|
|
|
this.openAutoSplit = true;
|
|
|
|
this.autoSplitLoading = true;
|
|
|
|
|
|
|
|
this.autoSplitList = this.orderCodes;
|
|
|
|
this.autoSplitList = this.orderCodes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.autoSplitList[0] == 'o2'){
|
|
|
|
|
|
|
|
this.$modal.msgError("已经拆分结束!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.autoSplitform1.productDate = this.autoSplitList[0].planProDate;
|
|
|
|
|
|
|
|
// 获取工艺信息(工艺选最新的)
|
|
|
|
|
|
|
|
getProRoutes(this.autoSplitList[0].prodCode).then(response => {
|
|
|
|
|
|
|
|
this.routes = response.data;
|
|
|
|
|
|
|
|
this.autoSplitform1.routeCode = response.data[0].routeCode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
//var ymd = moment(this.autoSplitform1.productDate).format('YYYY-MM-DD')
|
|
|
|
|
|
|
|
// 获取工单生产顺序
|
|
|
|
|
|
|
|
getProSortNo(this.autoSplitform1.productDate).then(response => {
|
|
|
|
|
|
|
|
this.autoSplitform1.sortNo = response
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
// 获取生产线体列表
|
|
|
|
|
|
|
|
getCanProductLine(this.autoSplitList[0]).then(response => {
|
|
|
|
|
|
|
|
this.lineCodes = response.lineList;
|
|
|
|
|
|
|
|
this.autoSplitform2.lineCodes = response.recommendLineList;//['XL01','XL02'];
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.openAutoSplit = true;
|
|
|
|
this.openAutoSplit = true;
|
|
|
|
this.autoSplitLoading = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//判断勾选
|
|
|
|
//判断勾选
|
|
|
|
selectable(row, index) {
|
|
|
|
selectable(row, index) {
|
|
|
@ -1494,6 +1559,43 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
next() {
|
|
|
|
|
|
|
|
if (this.activeSplit++ > 2) this.activeSplit = 0;
|
|
|
|
|
|
|
|
//选完线体后的下一步,会进行模拟拆分
|
|
|
|
|
|
|
|
if(this.activeSplit == 2){
|
|
|
|
|
|
|
|
autoSplitOrder(Object.assign({},this.autoSplitList[0],this.autoSplitform1,this.autoSplitform2)).then(response => {
|
|
|
|
|
|
|
|
this.workerLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
|
|
|
|
// 获取历史拆分工单信息
|
|
|
|
|
|
|
|
getWorkOrderListCG(this.autoSplitList[0].id).then(response => {
|
|
|
|
|
|
|
|
var data = response.data
|
|
|
|
|
|
|
|
this.splitData = data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
|
|
|
this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
|
|
|
this.workerLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
prev(){
|
|
|
|
|
|
|
|
if (this.activeSplit-- > 2) this.activeSplit = 2;
|
|
|
|
|
|
|
|
//会进行模拟拆分的取消
|
|
|
|
|
|
|
|
if(this.activeSplit == 1){
|
|
|
|
|
|
|
|
autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
autoSplitCommit(){
|
|
|
|
|
|
|
|
autoSplitOrderOk(Object.assign({},this.autoSplitList[0])).then(response => {
|
|
|
|
|
|
|
|
this.$modal.msgSuccess('提交成功')
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
this.openAutoSplit = false;
|
|
|
|
|
|
|
|
this.activeSplit = 0;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|