From b543b293505ab764ef80361d4b2994db936c53d6 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期五, 29 十一月 2024 13:05:32 +0800 Subject: [PATCH] # --- zy-asrs-admin/src/components/orderDetl/edit.vue | 79 ++++++++++++++++++++++++++------------- 1 files changed, 53 insertions(+), 26 deletions(-) diff --git a/zy-asrs-admin/src/components/orderDetl/edit.vue b/zy-asrs-admin/src/components/orderDetl/edit.vue index ec756a4..291aafc 100644 --- a/zy-asrs-admin/src/components/orderDetl/edit.vue +++ b/zy-asrs-admin/src/components/orderDetl/edit.vue @@ -16,6 +16,7 @@ let tableData = ref([]); let deleteDetlId = ref([]); let orderId = ref(null); +let isAdd = ref(false); getColumns(); const { @@ -28,7 +29,7 @@ columns: [], }); -state.columns = [ +let defaultColumns = [ { title: '#', dataIndex: '_id', @@ -61,27 +62,27 @@ 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, - }, - { - title: formatMessage('db.man_loc_detl.memo', '澶囨敞'), - dataIndex: 'memo', - 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, + // }, + // { + // title: formatMessage('db.man_loc_detl.memo', '澶囨敞'), + // dataIndex: 'memo', + // width: 140, + // ellipsis: true, + // editable: true, + // }, ]; const fieldList = []; @@ -91,9 +92,27 @@ fieldType: 1 }) let fieldResult = fieldResp.data; - let tmp = state.columns; + let tmp = defaultColumns; if (fieldResult.code == 200) { let data = fieldResult.data; + + if (!isAdd.value) { + tmp.push({ + title: formatMessage('db.man_loc_detl.qty', '宸插畬鎴愭暟閲�'), + dataIndex: 'qty', + width: 140, + ellipsis: true, + editable: true, + }) + + tmp.push({ + title: formatMessage('db.man_loc_detl.workQty', '浣滀笟涓暟閲�'), + dataIndex: 'workQty', + width: 140, + ellipsis: true, + editable: true, + }) + } data.forEach((item) => { tmp.push({ @@ -106,6 +125,14 @@ }) fieldList.push(item.name); + }) + + tmp.push({ + title: formatMessage('db.man_loc_detl.memo', '澶囨敞'), + dataIndex: 'memo', + width: 140, + ellipsis: true, + editable: true, }) tmp.push({ @@ -239,6 +266,7 @@ watch(orderId, (newVal, oldVal) => { if (newVal == undefined || newVal == null) { tableData.value = []; + getColumns() return; } @@ -272,6 +300,7 @@ tableData, orderId, deleteDetlId, + isAdd, }) </script> @@ -298,9 +327,7 @@ </template> <template v-if="column.editable"> - <div> - <a-input v-model:value="record[column.dataIndex]" /> - </div> + <a-input v-model:value="record[column.dataIndex]" /> </template> </template> </a-table> -- Gitblit v1.9.1