Commit a571d877 authored by renjintao's avatar renjintao

mesplan order handel

parent 3608078b
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
type="daterange" type="daterange"
placeholder="请选择日期" placeholder="请选择日期"
style="width:240px" style="width:240px"
transfer="true" :transfer="true"
:options="optionsDate" :options="optionsDate"
@on-change="inputOrderCat(row,index)" @on-change="inputOrderCat(row,index)"
></DatePicker> ></DatePicker>
......
This diff is collapsed.
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<DataGrid <DataGrid
:action="action" :action="action"
:columns="columns" :columns="columns"
:conditions="easySearch"
ref="grid" ref="grid"
@on-selection-change="onSelect" @on-selection-change="onSelect"
:batch="true" :batch="true"
...@@ -114,8 +115,10 @@ export default { ...@@ -114,8 +115,10 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,productName", op: "mesCode,productName",
value: null value: null,
} default: true
},
productId: { op: "In", value: "" }
}, },
addModal: false, addModal: false,
editModal: false, editModal: false,
...@@ -303,7 +306,14 @@ export default { ...@@ -303,7 +306,14 @@ export default {
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }, on: { click: () => this.edit(params.row) },
style: params.row._disabled||params.row.id!=params.row.rootId ? "display:none" : "" style:
(params.row.status == 1 &&
params.row.id == params.row.rootId &&
params.row.divideMark != 0) ||
params.row.id != params.row.rootId ||
params.row.status != 1
? "display:none"
: ""
}, },
"编辑" "编辑"
), ),
...@@ -312,7 +322,14 @@ export default { ...@@ -312,7 +322,14 @@ export default {
{ {
attrs: { oprate: "remove" }, attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row) }, on: { click: () => this.remove(params.row) },
style: params.row._disabled ? "display:none" : "" style:
(params.row.status == 1 &&
params.row.id == params.row.rootId &&
params.row.divideMark != 0) ||
params.row.status != 1
// ||(params.row.id != params.row.rootId && this.sondeletecheck1(params.row.rootId)>0)
? "display:none"
: ""
}, },
"删除" "删除"
), ),
...@@ -321,7 +338,13 @@ export default { ...@@ -321,7 +338,13 @@ export default {
{ {
attrs: { oprate: "detail" }, attrs: { oprate: "detail" },
on: { click: () => this.split(params.row) }, on: { click: () => this.split(params.row) },
style: params.row._disabled&&params.row.status!=1 ? "display:none" : "" style:
(params.row.divideMark != 0 &&
params.row.id == params.row.rootId) ||
params.row.status != 1 ||
params.row.quantity <= 1
? "display:none"
: ""
}, },
"分解" "分解"
) )
...@@ -371,7 +394,8 @@ export default { ...@@ -371,7 +394,8 @@ export default {
metCodesStrTxt: "", metCodesStrTxt: "",
actIds: [], //批量处理时ids actIds: [], //批量处理时ids
actMescodes: [], actMescodes: [],
delNum: 0 delNum: 0, //判断是否可以进行修改
arrayIds: [] //选择列表后的ids
}; };
}, },
created() { created() {
...@@ -560,12 +584,35 @@ export default { ...@@ -560,12 +584,35 @@ export default {
}, },
//确定派发 //确定派发
sendOk() { sendOk() {
this.$refs.orderSplit.$refs["formValidate"].validate(valid => { this.$refs.orderSend.$refs["formValidate"].validate(valid => {
if (valid) { if (valid) {
let objInfo = this.$refs.orderSplit.returnData(); let objInfo = this.$refs.orderSend.returnData();
let params = { let ids = this.arrayIds;
ids: this.delIds let parms = [];
}; ids.forEach(e => {
objInfo.id = e;
parms.push(objInfo);
});
Api.mesorderdistribute(parms)
.then(r => {
if (r.success) {
if (r.result) {
this.$refs.grid.load();
this.sendModal = false;
this.$Message.success("派发成功");
} else {
this.sendModal = false;
this.$Message.error("派发失败");
}
} else {
this.sendModal = false;
this.$Message.error("派发失败");
}
})
.catch(err => {
this.sendModal = false;
this.$Message.error("操作失败");
});
} }
}); });
}, },
...@@ -591,7 +638,7 @@ export default { ...@@ -591,7 +638,7 @@ export default {
let metCodesSingle = []; //没有子订单的订单 let metCodesSingle = []; //没有子订单的订单
let metCodesFather = []; //有子订单的原始订单 let metCodesFather = []; //有子订单的原始订单
this.actIds = []; this.actIds = [];
alert(JSON.stringify(this.rowDataArry)) //alert(JSON.stringify(this.rowDataArry));
if (this.rowDataArry.length > 0) { if (this.rowDataArry.length > 0) {
this.rowDataArry.forEach(data => { this.rowDataArry.forEach(data => {
this.delNum = 0; this.delNum = 0;
...@@ -599,13 +646,13 @@ export default { ...@@ -599,13 +646,13 @@ export default {
if (data.id != data.rootId) { if (data.id != data.rootId) {
//this.metCodesSingle.push(data.id); //this.metCodesSingle.push(data.id);
this.sondeletecheck(data.rootId); this.sondeletecheck(data.rootId);
} }
}); });
setTimeout(() => { setTimeout(() => {
if (this.delNum > 0) { if (this.delNum > 0) {
this.$Message.error("删除的原始订单中有非新建状态的子订单!"); this.$Message.error("删除的原始订单中有非新建状态的子订单!");
this.actIds = []; this.actIds = [];
return false; return false;
} }
}, 400); }, 400);
...@@ -629,6 +676,19 @@ export default { ...@@ -629,6 +676,19 @@ export default {
this.delNum += 1; this.delNum += 1;
} }
}); });
},
//删除前判断子订单
sondeletecheck1(code) {
let param = { id: code };
let delStaut=0
Api.sondeletecheck(param).then(res => {
if (res.result == 1) {//可以删除
delStaut = 0;
} else {
delStaut = 1;
}
});
return delStaut
}, },
//删除确定 //删除确定
removeOk() { removeOk() {
...@@ -694,7 +754,9 @@ export default { ...@@ -694,7 +754,9 @@ export default {
this.orderSearchForm.productId = "-1"; this.orderSearchForm.productId = "-1";
this.orderSearchForm.productName = ""; this.orderSearchForm.productName = "";
} }
//this.$refs.CustomTable.easySearch(this.orderSearchForm);
this.easySearch.productId.value = this.orderSearchForm.productId;
this.$refs.grid.easySearch();
} }
}, },
//得到此树节点下所有是产品的productId //得到此树节点下所有是产品的productId
...@@ -750,11 +812,11 @@ export default { ...@@ -750,11 +812,11 @@ export default {
//alert(JSON.stringify(a)); //alert(JSON.stringify(a));
//批量选择 //批量选择
let selectRows = a; let selectRows = a;
this.arrPartPkId = []; this.arrayIds = [];
this.rowDataArry = a; this.rowDataArry = a;
// selectRows.forEach(e => { selectRows.forEach(e => {
// this.arrPartPkId.push(e.part_task_pk); this.arrayIds.push(e.id);
// }); });
} }
//list end //list end
} }
......
...@@ -169,10 +169,23 @@ export default { ...@@ -169,10 +169,23 @@ export default {
return objStr; return objStr;
}, },
getTimeProductPFD(value) { getTimeProductPFD(value) {
this.orderForm.ProductingPreparationFinishDate = value; this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd(value);
}, },
getTimeQuotationFD(value) { getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate = value; this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value);
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate())+ " 23:59:59";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
} }
}, },
created() { created() {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
type="daterange" type="daterange"
placeholder="请选择日期" placeholder="请选择日期"
style="width:240px" style="width:240px"
transfer="true" :transfer="true"
:options="optionsDate" :options="optionsDate"
@on-change="inputOrderCat(row,index)" @on-change="inputOrderCat(row,index)"
></DatePicker> ></DatePicker>
......
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