|
|
@ -110,7 +110,7 @@
|
|
|
|
<td style="width: 16%">产品名称</td>
|
|
|
|
<td style="width: 16%">产品名称</td>
|
|
|
|
<td style="width: 14%">批次号</td>
|
|
|
|
<td style="width: 14%">批次号</td>
|
|
|
|
<td style="width: 8%">计划数量</td>
|
|
|
|
<td style="width: 8%">计划数量</td>
|
|
|
|
<td style="width: 8%">完成数量</td>
|
|
|
|
<td style="width: 8%">报工数量</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
@ -519,6 +519,7 @@ export default {
|
|
|
|
getDictData({
|
|
|
|
getDictData({
|
|
|
|
factoryCode: "ds_" + _this.selectxt,
|
|
|
|
factoryCode: "ds_" + _this.selectxt,
|
|
|
|
equipmentTypeCode: "equ_type_bzx",
|
|
|
|
equipmentTypeCode: "equ_type_bzx",
|
|
|
|
|
|
|
|
isqua: "1"
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response) {
|
|
|
|
if (response) {
|
|
|
|
this.dictDatatype = response;
|
|
|
|
this.dictDatatype = response;
|
|
|
@ -571,6 +572,7 @@ export default {
|
|
|
|
factoryCode: "ds_" + _this.selectxt,
|
|
|
|
factoryCode: "ds_" + _this.selectxt,
|
|
|
|
workorderCodeSap: item,
|
|
|
|
workorderCodeSap: item,
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
|
|
|
|
console.log(response);
|
|
|
|
if (response) {
|
|
|
|
if (response) {
|
|
|
|
_this.workOrder = response.data.workOrder;
|
|
|
|
_this.workOrder = response.data.workOrder;
|
|
|
|
_this.taskNum = response.data.taskNum;
|
|
|
|
_this.taskNum = response.data.taskNum;
|
|
|
@ -607,13 +609,37 @@ export default {
|
|
|
|
workorderCode: _this.workOrder.workorderCode
|
|
|
|
workorderCode: _this.workOrder.workorderCode
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response) {
|
|
|
|
if (response) {
|
|
|
|
let strQty = response.data.qty_total.toString();
|
|
|
|
// let strQty = response.data.qty_total.toString();
|
|
|
|
|
|
|
|
// if (strQty.length < 6) {
|
|
|
|
|
|
|
|
// strQty = String(
|
|
|
|
|
|
|
|
// strQty
|
|
|
|
|
|
|
|
// ).padStart(6, "0");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// this.actProduction = strQty.split("");
|
|
|
|
|
|
|
|
// // 计算总产量
|
|
|
|
|
|
|
|
// const totalProduction = _this.orderdetail.reduce((sum, item) => {
|
|
|
|
|
|
|
|
// return sum + (item.quantityProduced || 0);
|
|
|
|
|
|
|
|
// }, Number(this.actProduction.join("")));
|
|
|
|
|
|
|
|
// console.log('总产量:', totalProduction);
|
|
|
|
|
|
|
|
// 获取基础产量并格式化为6位字符串
|
|
|
|
|
|
|
|
const baseQty = Number(response.data.qty_build);
|
|
|
|
|
|
|
|
let strQty = baseQty.toString();
|
|
|
|
if (strQty.length < 6) {
|
|
|
|
if (strQty.length < 6) {
|
|
|
|
strQty = String(
|
|
|
|
strQty = strQty.padStart(6, "0");
|
|
|
|
strQty
|
|
|
|
|
|
|
|
).padStart(6, "0");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.actProduction = strQty.split("");
|
|
|
|
|
|
|
|
|
|
|
|
// 计算orderdetail中的总产量
|
|
|
|
|
|
|
|
const detailTotal = _this.orderdetail.reduce((sum, item) => {
|
|
|
|
|
|
|
|
return sum + (item.quantityProduced || 0);
|
|
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算总和并保持6位格式
|
|
|
|
|
|
|
|
const total = baseQty + detailTotal;
|
|
|
|
|
|
|
|
const totalStr = total.toString().padStart(6, "0");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 赋值给actProduction
|
|
|
|
|
|
|
|
this.actProduction = totalStr.split("");
|
|
|
|
|
|
|
|
console.log('总产量:', total);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|