| | |
| | | const TABLE_KEY = 'table-locDetl'; |
| | | |
| | | let tableData = ref([]); |
| | | let editTableData = ref([]); |
| | | let deleteDetlId = ref([]); |
| | | let orderId = ref(null); |
| | | getColumns(); |
| | | |
| | | const { |
| | |
| | | tableData.value = tmp; |
| | | } |
| | | |
| | | watch(editTableData, (newVal, oldVal) => { |
| | | 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 = []; |
| | | if (newVal.length > 0) { |
| | | newVal.forEach((item) => { |
| | | result.data.forEach((item) => { |
| | | let data = { |
| | | _id: index++, |
| | | detlId: item.id, |
| | |
| | | }) |
| | | tmp.push(data) |
| | | }) |
| | | } |
| | | tableData.value = tmp; |
| | | }) |
| | | |
| | | }) |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | editTableData, |
| | | orderId, |
| | | deleteDetlId, |
| | | }) |
| | | |