Commit caaa8df4 authored by 周远喜's avatar 周远喜

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 0f0f64ce 31927bd1
......@@ -277,6 +277,7 @@ export default {
//拆分工序
split(item, i) {
this.chaiModal = true;
this.curIndex = i;
this.maxnum = this.result[i].quantity - 1;
},
......@@ -284,30 +285,34 @@ export default {
okChai() {
let items = this.$u.clone(this.result);
let curItem = items[this.curIndex];
console.log(curItem);
let addItem = this.$u.clone(curItem);
curItem.quantity -= this.chaiNum;
curItem.chaiCount += 1;
addItem.seq = addItem.task_seq + curItem.chaiCount * 0.1;
addItem.quantity = this.chaiNum;
addItem.chai = true;
items.splice(this.curIndex + curItem.chaiCount, 0, addItem);
let total = null;
if (curItem.chaiCount) {
total = this.curIndex + curItem.chaiCount;
} else {
total = this.curIndex;
}
items.splice(total, 0, addItem);
this.result = items;
},
//删除工序
remove(item, index) {
console.log(item);
var root = -1;
for (let i = 0; i < this.result.length; i++) {
const element = this.result[i];
if (element.indexId == item.indexId) {
root = i;
break;
let vroot = -1;
this.result.map((u, i) => {
if (!u.chai && u.detailId === item.detailId) {
vroot = i;
}
}
var rootItem = this.result[root];
this.result[root].quantity = rootItem.quantity + item.quantity;
this.result.splice(index, 1);
u.chaiCount = u.chaiCount - 1;
});
this.result[vroot].quantity += item.quantity;
var list = this.$u.clone(this.result);
list.splice(index, 1);
this.result = list;
},
//下发
lowerHair() {
......
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