diff --git a/src/views/stock/component/applyForm.vue b/src/views/stock/component/applyForm.vue index 7834b4e..a9988ef 100644 --- a/src/views/stock/component/applyForm.vue +++ b/src/views/stock/component/applyForm.vue @@ -3,21 +3,21 @@
- + - 采购入库 - 归还入库 + 采购入库 + 归还入库 - - + + @@ -25,45 +25,24 @@
- - - - - - - - - + - - - - - - - - - - + + + + + + + + - + + @@ -77,19 +56,21 @@ import { VxeTableInstance } from 'vxe-table' import api from '@/api' import { useUserStore } from '@/stores/user' +import dayjs,{Dayjs} from 'dayjs'; + interface FormData { applicant: string; // 申请人 - applyDate: Date; // 申请日期 - applyType: number; // 申请类型 - slectedList: string[]; // 入库物料 + applyDate: Dayjs; // 申请日期 + applyType: string; // 申请类型 + slectedList: number[]; // 入库物料 } const userStore = useUserStore() const formData = ref({ applicant: userStore.userName, - applyDate: new Date(), - applyType: 1, // 1: 采购入库 2: 归还入库 3: 出库外借 + applyDate: dayjs(), + applyType: '1', // 1: 采购入库 2: 归还入库 3: 出库外借 slectedList: [] }); @@ -124,33 +105,33 @@ const getMaterialList = async () => { getMaterialList() + // 选中时在末尾新增一行 // value: number, option: { label: string, value: number } const insertEvent = (value: string) => { - - window.console.log('insertEvent', tableData.value) - // 根据value找到对应的物料信息 - const material = materialList.value.find((item) => item.id === (value ? parseInt(value) : -1)) - if (material) { + const m = materialList.value.find((item) => item.id === (value ? parseInt(value) : -1)) + if (m) { const row: RowVO = { - id: material.id ? material.id : -1, - name: material.name ? material.name : '未知', - code: material.code ? material.code : '未知', - spec: material.spec ? material.spec : '未知', - type: material.type ? material.type : '未知', + id: m.id ? m.id : -1, + name: m.name ? m.name : '未知', + code: m.code ? m.code : '未知', + spec: m.spec ? m.spec : '未知', + type: m.type ? m.type : '未知', quantity: 1, - assignRule: material.assignRule ? material.assignRule : 1, + assignRule: m.assignRule ? m.assignRule : 1, disabled: false, checked: false } const $table = tableRef.value if ($table) { $table.insertAt(row, -1) + window.console.log('表数据1:', tableData.value) + window.console.log('表数据2:', $table.getTableData().fullData) + } } - - + } // 取消选中时,删除table中的行 @@ -183,4 +164,3 @@ const removeRow = async (row: RowVO) => { } - diff --git a/src/views/stock/component/applyModal.vue b/src/views/stock/component/applyModal.vue index 59b54e1..013ce97 100644 --- a/src/views/stock/component/applyModal.vue +++ b/src/views/stock/component/applyModal.vue @@ -14,11 +14,6 @@
- - 上一步 - 下一步 - 提交 -