优化
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -80,6 +80,7 @@
|
||||
style="width: 210px"
|
||||
placeholder="是否二次投料"
|
||||
class="filter-item"
|
||||
disabled
|
||||
@change="storChange2"
|
||||
>
|
||||
<el-option
|
||||
@@ -314,15 +315,6 @@
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="添加物料重量" prop="add_qty2">
|
||||
<el-input-number
|
||||
v-model="form2.add_qty2"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
</div>
|
||||
<span class="crud-opts-right2">
|
||||
@@ -439,6 +431,7 @@ export default {
|
||||
mstrow: {},
|
||||
tabledis: [],
|
||||
XLList: [],
|
||||
chunfen_qty: '0',
|
||||
form: { waste_limit_down: 0, waste_limit_uo: 0 },
|
||||
form2: {
|
||||
total_qty1: '0',
|
||||
@@ -480,6 +473,7 @@ export default {
|
||||
this.button1 = true
|
||||
this.button2 = false
|
||||
}
|
||||
this.form.is_again_put = '0'
|
||||
if (this.form.is_again_put === '1' && this.form.formula_type === '00') {
|
||||
this.button3 = false
|
||||
} else {
|
||||
@@ -498,7 +492,7 @@ export default {
|
||||
}
|
||||
this.tableDtl.splice(i, 1, row)
|
||||
}
|
||||
this.tabledis = res.tabledis
|
||||
/* this.tabledis = res.tabledis
|
||||
this.form2.total_qty2 = 0
|
||||
this.form2.add_qty2 = 0
|
||||
for (let i = 0; i < this.tabledis.length; i++) {
|
||||
@@ -510,7 +504,7 @@ export default {
|
||||
this.form2.add_qty2 = this.form2.add_qty2 + parseFloat(row.formula_qty)
|
||||
}
|
||||
this.tabledis.splice(i, 1, row)
|
||||
}
|
||||
}*/
|
||||
})
|
||||
},
|
||||
moveUp(index, item) {
|
||||
@@ -1099,39 +1093,106 @@ export default {
|
||||
}
|
||||
},
|
||||
autoCalculation() {
|
||||
this.fullscreenLoading = true
|
||||
autoformula.autoCalculation(this.form).then(res => {
|
||||
this.crud.notify('自动计算成功!')
|
||||
this.tableDtl = res.tableDtl
|
||||
this.form2.total_qty1 = 0
|
||||
this.form2.add_qty1 = 0
|
||||
for (let i = 0; i < this.tableDtl.length; i++) {
|
||||
const row = this.tableDtl[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty1 = this.form2.total_qty1 + parseFloat(row.formula_qty)
|
||||
if (this.form.formula_type === '03') {
|
||||
this.fullscreenLoading = true
|
||||
autoformula.autoCalculation(this.form).then(res => {
|
||||
this.crud.notify('自动计算成功!')
|
||||
this.chunfen_qty = res.chunfen_qty
|
||||
this.fullscreenLoading = false
|
||||
if ((parseFloat(this.chunfen_qty) > 0) && (parseFloat(this.chunfen_qty) < parseFloat(this.form.workorder_qty))) {
|
||||
this.$confirm('软废纯粉重量为' + parseFloat(this.chunfen_qty) + '公斤,不足工令重量,是否继续?')
|
||||
.then(_ => {
|
||||
this.form.workorder_qty = parseFloat(this.chunfen_qty)
|
||||
this.fullscreenLoading = true
|
||||
autoformula.autoCalculation(this.form).then(res => {
|
||||
this.crud.notify('自动计算成功!')
|
||||
this.tableDtl = res.tableDtl
|
||||
this.form2.total_qty1 = 0
|
||||
this.form2.add_qty1 = 0
|
||||
for (let i = 0; i < this.tableDtl.length; i++) {
|
||||
const row = this.tableDtl[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty1 = this.form2.total_qty1 + parseFloat(row.formula_qty)
|
||||
} else {
|
||||
this.form2.add_qty1 = this.form2.add_qty1 + parseFloat(row.formula_qty)
|
||||
}
|
||||
this.tableDtl.splice(i, 1, row)
|
||||
}
|
||||
/* this.tabledis = res.tabledis
|
||||
this.form2.total_qty2 = 0
|
||||
this.form2.add_qty2 = 0
|
||||
for (let i = 0; i < this.tabledis.length; i++) {
|
||||
const row = this.tabledis[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty2 = this.form2.total_qty2 + parseFloat(row.formula_qty)
|
||||
} else {
|
||||
this.form2.add_qty2 = this.form2.add_qty2 + parseFloat(row.formula_qty)
|
||||
}
|
||||
this.tabledis.splice(i, 1, row)
|
||||
}*/
|
||||
this.fullscreenLoading = false
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
} else {
|
||||
this.form2.add_qty1 = this.form2.add_qty1 + parseFloat(row.formula_qty)
|
||||
this.tableDtl = res.tableDtl
|
||||
this.form2.total_qty1 = 0
|
||||
this.form2.add_qty1 = 0
|
||||
for (let i = 0; i < this.tableDtl.length; i++) {
|
||||
const row = this.tableDtl[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty1 = this.form2.total_qty1 + parseFloat(row.formula_qty)
|
||||
} else {
|
||||
this.form2.add_qty1 = this.form2.add_qty1 + parseFloat(row.formula_qty)
|
||||
}
|
||||
this.tableDtl.splice(i, 1, row)
|
||||
}
|
||||
this.fullscreenLoading = false
|
||||
}
|
||||
this.tableDtl.splice(i, 1, row)
|
||||
}
|
||||
this.tabledis = res.tabledis
|
||||
this.form2.total_qty2 = 0
|
||||
this.form2.add_qty2 = 0
|
||||
for (let i = 0; i < this.tabledis.length; i++) {
|
||||
const row = this.tabledis[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty2 = this.form2.total_qty2 + parseFloat(row.formula_qty)
|
||||
} else {
|
||||
this.form2.add_qty2 = this.form2.add_qty2 + parseFloat(row.formula_qty)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
this.fullscreenLoading = true
|
||||
autoformula.autoCalculation(this.form).then(res => {
|
||||
this.crud.notify('自动计算成功!')
|
||||
this.tableDtl = res.tableDtl
|
||||
this.form2.total_qty1 = 0
|
||||
this.form2.add_qty1 = 0
|
||||
for (let i = 0; i < this.tableDtl.length; i++) {
|
||||
const row = this.tableDtl[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty1 = this.form2.total_qty1 + parseFloat(row.formula_qty)
|
||||
} else {
|
||||
this.form2.add_qty1 = this.form2.add_qty1 + parseFloat(row.formula_qty)
|
||||
}
|
||||
this.tableDtl.splice(i, 1, row)
|
||||
}
|
||||
this.tabledis.splice(i, 1, row)
|
||||
}
|
||||
this.fullscreenLoading = false
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
/* this.tabledis = res.tabledis
|
||||
this.form2.total_qty2 = 0
|
||||
this.form2.add_qty2 = 0
|
||||
for (let i = 0; i < this.tabledis.length; i++) {
|
||||
const row = this.tabledis[i]
|
||||
row.edit = true
|
||||
if (row.is_need_manage === '1') {
|
||||
this.form2.total_qty2 = this.form2.total_qty2 + parseFloat(row.formula_qty)
|
||||
} else {
|
||||
this.form2.add_qty2 = this.form2.add_qty2 + parseFloat(row.formula_qty)
|
||||
}
|
||||
this.tabledis.splice(i, 1, row)
|
||||
}*/
|
||||
this.fullscreenLoading = false
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
if (this.tableDtl.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user