feat: 采购登记详细增加一键完成逻辑
This commit is contained in:
parent
2cb68d0f76
commit
a70b59bdbc
@ -118,6 +118,7 @@
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button v-if="showOneClickExecute" @click="oneClickExecute">一键完成</el-button>
|
||||
<el-button @click="dialogDocumentDetailVisible = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -360,6 +361,7 @@ import {
|
||||
} from "@/api/mes/wms-nalinv/poRegister";
|
||||
import {fetchList as fetchWarehouseList} from "@/api/wms/warehouse";
|
||||
import {listByActivityId} from "@/api/admin/activity-option";
|
||||
import {submit} from "@/api/wms/purchase-into-storage";
|
||||
|
||||
export default {
|
||||
name: 'po-register',
|
||||
@ -481,10 +483,14 @@ export default {
|
||||
}
|
||||
for (let i = 0; i < response.data.data.length; i++) {
|
||||
// 判断 作业规则是否为 ITEM_GROUP物料组;
|
||||
if (response.data.data[i].optionName == 'ITEM_GROUP') {
|
||||
if (response.data.data[i].optionName === 'ITEM_GROUP') {
|
||||
this.itemGroups = response.data.data[i].optionValue
|
||||
} else if (response.data.data[i].optionName == 'QUALITY_INSPECTION_STATUS') {
|
||||
} else if (response.data.data[i].optionName === 'QUALITY_INSPECTION_STATUS') {
|
||||
this.qualityInspectionStatus = response.data.data[i].optionValue
|
||||
} else if (response.data.data[i].optionName === 'FAST_EXEC_ITEM_GROUP') {
|
||||
this.fastExecItemGroup = response.data.data[i].optionValue.split(",")
|
||||
} else if (response.data.data[i].optionName === 'PRINTER') {
|
||||
this.printer = response.data.data[i].optionValue
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -496,7 +502,14 @@ export default {
|
||||
this.getDataDictionary('DOCUMENT_STATE', 'documentStatusList');
|
||||
this.getDataDictionary('IQC_STATUS', 'iqcStatusList')
|
||||
},
|
||||
computed: {},
|
||||
computed: {
|
||||
showOneClickExecute() {
|
||||
if (this.detailFormObj.detailList.length === 0 || this.detailFormObj.detailList[0].state !== 'SUBMIT' || !this.fastExecItemGroup) return false;
|
||||
return this.detailFormObj.detailList.every(item =>
|
||||
this.fastExecItemGroup.includes(item.itemGroup)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
let me = this;
|
||||
@ -850,6 +863,33 @@ export default {
|
||||
me.documentRegisterList[me.warehouseIndex].storagLocation = row.warehouse;
|
||||
},
|
||||
|
||||
oneClickExecute() {
|
||||
let me = this;
|
||||
let submitList = [];
|
||||
for (let row of me.detailFormObj.detailList) {
|
||||
submitList.push({
|
||||
seq: row.seq,
|
||||
targetWarehouse: row.targetWarehouse,
|
||||
item: row.item,
|
||||
itemDescription: row.itemDescription,
|
||||
inventoryList: [{
|
||||
inventoryQty: row.applicationsQuantity
|
||||
}]
|
||||
})
|
||||
}
|
||||
submitList[0].documentNo = me.detailFormObj.detailList[0].documentNo;
|
||||
submitList[0].printer = me.printer;
|
||||
showLoading();
|
||||
submit(submitList).then(res => {
|
||||
hideLoading();
|
||||
if (res.data.code === 0) {
|
||||
me.$message.success("提交成功");
|
||||
me.dialogDocumentDetailVisible = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user