Commit 058e14eb authored by renjintao's avatar renjintao

plan

parent d4a07780
...@@ -25,4 +25,7 @@ export default { ...@@ -25,4 +25,7 @@ export default {
routingdistribute(params) {//工艺派发 routingdistribute(params) {//工艺派发
return Api.post(`${PlanUrl}/messchedule/routingdistribute`, params); return Api.post(`${PlanUrl}/messchedule/routingdistribute`, params);
}, },
moveintoaps() {//跳转进入排产池前判断
return Api.post(`${PlanUrl}/messchedule/moveintoaps`);
},
} }
\ No newline at end of file
<template> <template>
<div class="myBug"> <div class="myBug">
<DataGrid :columns="columns" ref="grid" :action="action" @on-selection-change="selectInfo" :batch='false'> <DataGrid
:columns="columns"
ref="grid"
:action="action"
@on-selection-change="selectInfo"
:batch="false"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
...@@ -60,14 +66,14 @@ ...@@ -60,14 +66,14 @@
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Add from './add' import Add from "./add";
import Edit from './edit' import Edit from "./edit";
import Detail from './detail' import Detail from "./detail";
import Search from './search' import Search from "./search";
import Dispatch from './dispatch' import Dispatch from "./dispatch";
export default { export default {
name: 'list', name: "list",
components: { components: {
Add, Add,
Edit, Edit,
...@@ -80,8 +86,7 @@ export default { ...@@ -80,8 +86,7 @@ export default {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { keys: {
op: op: "mesCode,taskType,stage,projectNumber,materialName",
'mesCode,taskType,stage,projectNumber,materialName',
value: null value: null
} }
}, },
...@@ -94,181 +99,181 @@ export default { ...@@ -94,181 +99,181 @@ export default {
curId: 0, curId: 0,
columns: [ columns: [
{ {
type: 'selection', type: "selection",
width: 70, width: 70,
align: 'center' align: "center"
}, },
{ {
title: this.l('mesCode'), title: this.l("mesCode"),
key: 'mesCode', key: "mesCode",
width: 240, width: 240,
align: 'left' align: "left"
}, },
{ {
key: 'productName', key: "productName",
title: this.l('productName'), title: this.l("productName"),
align: 'left', align: "left",
easy: true, easy: true,
width:160, width: 160,
high: true, high: true,
tooltip:true tooltip: true
}, },
{ {
key: 'status', key: "status",
title: this.l('status'), title: this.l("status"),
align: 'center', align: "center",
high: true, high: true,
code: 'plan.order.status' code: "plan.order.status"
}, },
{ {
key: 'mainRoutingSetStatus', key: "mainRoutingSetStatus",
title: this.l('mainRoutingSetStatus'), title: this.l("mainRoutingSetStatus"),
align: 'center', align: "center",
high: true, high: true,
code: 'aps.plan.mainRoutingStatus' code: "aps.plan.mainRoutingStatus"
}, },
{ {
key: 'isSupportingFinish', key: "isSupportingFinish",
title: this.l('isSupportingFinish'), title: this.l("isSupportingFinish"),
align: 'center', align: "center",
high: true, high: true,
code: 'aps.plan.supportingStatus' code: "aps.plan.supportingStatus"
}, },
{ {
key: 'projectNumber', key: "projectNumber",
title: this.l('projectNumber'), title: this.l("projectNumber"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'batchNumber', key: "batchNumber",
title: this.l('batchNumber'), title: this.l("batchNumber"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'urgencyLevel', key: "urgencyLevel",
title: this.l('urgencyLevel'), title: this.l("urgencyLevel"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'taskType', key: "taskType",
title: this.l('taskType'), title: this.l("taskType"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true,
code: 'plan.order.taskType' code: "plan.order.taskType"
}, },
{ {
key: 'drawnNumber', key: "drawnNumber",
title: this.l('drawnNumber'), title: this.l("drawnNumber"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'stage', key: "stage",
title: this.l('stage'), title: this.l("stage"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
code: 'plan.order.stage' code: "plan.order.stage"
}, },
{ {
key: 'materialName', key: "materialName",
title: this.l('materialName'), title: this.l("materialName"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'quantity', key: "quantity",
title: this.l('quantity'), title: this.l("quantity"),
align: 'left', align: "left",
high: true high: true
}, },
{ {
key: 'routingMethod', key: "routingMethod",
title: this.l('routingMethod'), title: this.l("routingMethod"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
code: 'plan.order.routingMethod' code: "plan.order.routingMethod"
}, },
{ {
key: 'materialWeight', key: "materialWeight",
title: this.l('materialWeight'), title: this.l("materialWeight"),
align: 'left', align: "left",
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'productCode', key: "productCode",
title: this.l('productCode'), title: this.l("productCode"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'isPreschedule', key: "isPreschedule",
title: this.l('isPreschedule'), title: this.l("isPreschedule"),
align: 'left', align: "left",
high: true, high: true,
code: 'mes_xingchi_plan.mes_order.is_preschedule', code: "mes_xingchi_plan.mes_order.is_preschedule",
hide: true hide: true
}, },
{ {
key: 'spareQty', key: "spareQty",
title: this.l('spareQty'), title: this.l("spareQty"),
align: 'left', align: "left",
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'demandStart', key: "demandStart",
title: this.l('demandStart'), title: this.l("demandStart"),
align: 'left', align: "left",
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'demandFinish', key: "demandFinish",
title: this.l('demandFinish'), title: this.l("demandFinish"),
align: 'left', align: "left",
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'partNamePro', key: "partNamePro",
title: this.l('partNamePro'), title: this.l("partNamePro"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true
}, },
{ {
title: '操作', title: "操作",
key: 'action', key: "action",
width: 140, width: 140,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'op', "op",
{ {
attrs: { oprate: 'detail' }, attrs: { oprate: "detail" },
style: { style: {
color: params.row.mainRoutingSetStatus == 0 ? 'red' : '' color: params.row.mainRoutingSetStatus == 0 ? "red" : ""
}, },
on: { on: {
click: () => click: () =>
...@@ -279,10 +284,10 @@ export default { ...@@ -279,10 +284,10 @@ export default {
} }
}, },
params.row.mainRoutingSetStatus == 0 params.row.mainRoutingSetStatus == 0
? '工艺派发' ? "工艺派发"
: params.row.mainRoutingSetStatus == 1 : params.row.mainRoutingSetStatus == 1
? '移入排产' ? "移入排产"
: '' : ""
) )
// h( // h(
// 'op', // 'op',
...@@ -300,7 +305,7 @@ export default { ...@@ -300,7 +305,7 @@ export default {
// }, // },
// '删除' // '删除'
// ) // )
]) ]);
} }
} }
], ],
...@@ -315,206 +320,215 @@ export default { ...@@ -315,206 +320,215 @@ export default {
resultsStatus: 0, resultsStatus: 0,
dispatchStatus: 0, //派发标识 dispatchStatus: 0, //派发标识
scheduleStatus: 0, //排产标识 scheduleStatus: 0, //排产标识
resultsOrderList: '' resultsOrderList: ""
} };
}, },
mounted() { mounted() {
console.log(this) console.log(this);
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
handleSelectAll(status) { handleSelectAll(status) {
//选择列表数据 //选择列表数据
this.$refs.grid.selectAll(status) this.$refs.grid.selectAll(status);
}, },
selectInfo(value) { selectInfo(value) {
if (value.length > 0) { if (value.length > 0) {
this.footerBar = true this.footerBar = true;
} else { } else {
this.footerBar = false this.footerBar = false;
} }
this.selectList = [] this.selectList = [];
this.selectList = value this.selectList = value;
this.selectCount = this.selectList.length this.selectCount = this.selectList.length;
let statueArry = [] let statueArry = [];
let tempmesCodeList = [] let tempmesCodeList = [];
this.resultsStatusArr = [] this.resultsStatusArr = [];
value.forEach((data) => { value.forEach(data => {
var that = this var that = this;
statueArry.push(data.id) statueArry.push(data.id);
this.resultsStatusArr.push(data.mainRoutingSetStatus) this.resultsStatusArr.push(data.mainRoutingSetStatus);
tempmesCodeList.push(data.mesCode) tempmesCodeList.push(data.mesCode);
}) });
let mainRS = this.uniq(this.resultsStatusArr) //数组去重 let mainRS = this.uniq(this.resultsStatusArr); //数组去重
if (mainRS.length == 1) { if (mainRS.length == 1) {
this.results = [] this.results = [];
this.results = statueArry this.results = statueArry;
this.getListId(statueArry) this.getListId(statueArry);
this.resultsOrderList = JSON.stringify(tempmesCodeList) //提示mesCode this.resultsOrderList = JSON.stringify(tempmesCodeList) //提示mesCode
.replace('[', '') .replace("[", "")
.replace(']', '') .replace("]", "")
.replace(/\"/g, '') .replace(/\"/g, "");
if (mainRS[0] == 0) { if (mainRS[0] == 0) {
//未派发 //未派发
this.dispatchStatus = 1 this.dispatchStatus = 1;
this.scheduleStatus = 0 this.scheduleStatus = 0;
} else if (mainRS[0] == 1) { } else if (mainRS[0] == 1) {
//已派发 //已派发
this.dispatchStatus = 0 this.dispatchStatus = 0;
this.scheduleStatus = 1 this.scheduleStatus = 1;
} else { } else {
//派发中 //派发中
this.dispatchStatus = 0 this.dispatchStatus = 0;
this.scheduleStatus = 0 this.scheduleStatus = 0;
} }
} else { } else {
this.dispatchStatus = 0 this.dispatchStatus = 0;
this.scheduleStatus = 0 this.scheduleStatus = 0;
} }
}, },
//得到需要批量操作的ids //得到需要批量操作的ids
getListId(value) { getListId(value) {
this.listBatchIds1 = value this.listBatchIds1 = value;
if (this.listBatchIds1.length > 0) { if (this.listBatchIds1.length > 0) {
this.footerBar = true this.footerBar = true;
} else { } else {
this.footerBar = false this.footerBar = false;
} }
}, },
canselFooter() { canselFooter() {
this.footerBar = false this.footerBar = false;
this.handleSelectAll(false) this.handleSelectAll(false);
}, },
modalDispatch() { modalDispatch() {
//打开工艺派发 //打开工艺派发
this.listBatchIds = this.listBatchIds1 //用于列表操作时和多选时的listBatchId的冲突 this.listBatchIds = this.listBatchIds1; //用于列表操作时和多选时的listBatchId的冲突
if (this.dispatchStatus == 1) { if (this.dispatchStatus == 1) {
this.dispatchModal = true this.dispatchModal = true;
} else { } else {
this.$Message.error('所选订单里存在已派发订单!') this.$Message.error("所选订单里存在已派发订单!");
} }
}, },
modalSchedule() { modalSchedule() {
//移入排产 //移入排产
this.listBatchIds = this.listBatchIds1 this.listBatchIds = this.listBatchIds1;
if (this.scheduleStatus == 1) { if (this.scheduleStatus == 1) {
this.scheduleModal = true this.scheduleModal = true;
} else { } else {
this.$Message.error('所选订单里存在未派发订单!') this.$Message.error("所选订单里存在未派发订单!");
} }
}, },
goMethod(value) { goMethod(value) {
//行内点击后面按钮 //行内点击后面按钮
this.resultsOrderList = value.mesCode this.resultsOrderList = value.mesCode;
this.listBatchIds = [value.id] this.listBatchIds = [value.id];
if (value.mainRoutingSetStatus == 0) { if (value.mainRoutingSetStatus == 0) {
//this.dispatchStatus = 1 //this.dispatchStatus = 1
//this.scheduleStatus = 0 //this.scheduleStatus = 0
this.dispatchModal = true this.dispatchModal = true;
} else if (value.mainRoutingSetStatus == 1) { } else if (value.mainRoutingSetStatus == 1) {
//this.dispatchStatus = 0 //this.dispatchStatus = 0
//this.scheduleStatus = 1 //this.scheduleStatus = 1
this.scheduleModal = true this.scheduleModal = true;
} }
}, },
scheduleOk() { scheduleOk() {
let params = { ids: this.listBatchIds } let params = { ids: this.listBatchIds };
Api.moveinbatch(params) Api.moveinbatch(params)
.then((r) => { .then(r => {
if (r.success) { if (r.success) {
this.$Message.success('移入排产成功') this.$Message.success("移入排产成功");
} else { } else {
this.$Message.error('移入排产失败') this.$Message.error("移入排产失败");
} }
}) })
.catch((err) => { .catch(err => {
this.$Message.error('移入排产失败') this.$Message.error("移入排产失败");
}) });
this.canselFooter() this.canselFooter();
this.cancel() this.cancel();
}, },
//跳转到aps排产池(有判断)
goAps() { goAps() {
Api.moveintoaps().then((res) => {
if (res.success) {
if (res.result.res) {
this.$router.push({ this.$router.push({
name: 'aps-aps' name: "aps-aps"
// params: { customerId: id } // params: { customerId: id }
}) });
} else {
this.$Message.error(res.result.msg);
}
}
});
}, },
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load();
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.curId = 0 this.curId = 0;
//aps //aps
this.dispatchModal = false this.dispatchModal = false;
this.scheduleModal = false this.scheduleModal = false;
this.listBatchIds = [] this.listBatchIds = [];
this.listBatchIds1 = [] this.listBatchIds1 = [];
this.canselFooter() this.canselFooter();
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch);
}, },
detail(id) { detail(id) {
this.detailModal = true this.detailModal = true;
this.curId = id this.curId = id;
}, },
edit(id) { edit(id) {
this.editModal = true this.editModal = true;
this.curId = id this.curId = id;
}, },
remove(id) { remove(id) {
this.deletelModal = true this.deletelModal = true;
this.curId = id this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({ id: this.curId }).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load() this.$refs.grid.load();
this.deletelModal = false this.deletelModal = false;
this.$Message.success('删除成功') this.$Message.success("删除成功");
} }
}) });
}, },
removeCancel() { removeCancel() {
this.deletelModal = false this.deletelModal = false;
}, },
cancel() { cancel() {
this.curId = 0 this.curId = 0;
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.deletedlModal = false this.deletedlModal = false;
//aps //aps
this.dispatchModal = false this.dispatchModal = false;
this.scheduleModal = false this.scheduleModal = false;
// this.listBatchIds = [] // this.listBatchIds = []
// this.listBatchIds1 = [] // this.listBatchIds1 = []
// this.canselFooter() // this.canselFooter()
}, },
l(key) { l(key) {
let vkey = 'mes_order' + '.' + key let vkey = "mes_order" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
}, },
uniq(array) { uniq(array) {
//数组去重 //数组去重
array.sort() array.sort();
var temp = [] var temp = [];
temp = [array[0]] temp = [array[0]];
for (var i = 1; i < array.length; i++) { for (var i = 1; i < array.length; i++) {
if (array[i] !== temp[temp.length - 1]) { if (array[i] !== temp[temp.length - 1]) {
temp.push(array[i]) temp.push(array[i]);
} }
} }
return temp return temp;
} }
} }
} };
</script> </script>
<style lang="less"> <style lang="less">
.footerSpan { .footerSpan {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment