#
Junjie
2024-07-29 4a2b38544137fcfb164ee247ef080897d497e854
zy-asrs-admin/src/components/orderDetl/edit.vue
@@ -13,8 +13,8 @@
const TABLE_KEY = 'table-locDetl';
let tableData = ref([]);
let editTableData = ref([]);
let deleteDetlId = ref([]);
let orderId = ref(null);
getColumns();
const {
@@ -56,6 +56,20 @@
    {
        title: formatMessage('db.man_loc_detl.anfme', '数量'),
        dataIndex: 'anfme',
        width: 140,
        ellipsis: true,
        editable: true,
    },
    {
        title: formatMessage('db.man_loc_detl.qty', '已完成数量'),
        dataIndex: 'qty',
        width: 140,
        ellipsis: true,
        editable: true,
    },
    {
        title: formatMessage('db.man_loc_detl.workQty', '作业中数量'),
        dataIndex: 'workQty',
        width: 140,
        ellipsis: true,
        editable: true,
@@ -128,6 +142,8 @@
            maktx: item.data.maktx,
            batch: '',
            anfme: 0,
            qty: 0,
            workQty: 0,
            memo: ''
        };
        fieldList.forEach((field) => {
@@ -216,11 +232,17 @@
    tableData.value = tmp;
}
watch(editTableData, (newVal, oldVal) => {
    let index = 1;
    let tmp = [];
    if (newVal.length > 0) {
        newVal.forEach((item) => {
watch(orderId, (newVal, oldVal) => {
    if(newVal == undefined || newVal == null) {
        tableData.value = [];
        return;
    }
    get("/api/orderDetl/orderId/" + newVal, {}).then((resp) => {
        let result = resp.data;
        let index = 1;
        let tmp = [];
        result.data.forEach((item) => {
            let data = {
                _id: index++,
                detlId: item.id,
@@ -228,6 +250,8 @@
                maktx: item.mat$.maktx,
                batch: item.batch,
                anfme: item.anfme,
                qty: item.qty,
                workQty: item.workQty,
                memo: item.memo
            };
            fieldList.forEach((field) => {
@@ -235,13 +259,14 @@
            })
            tmp.push(data)
        })
    }
    tableData.value = tmp;
        tableData.value = tmp;
    })
})
defineExpose({
    tableData,
    editTableData,
    orderId,
    deleteDetlId,
})