diff --git a/src/api/erp/stock/stock/index.ts b/src/api/erp/stock/stock/index.ts
index 2c5bf5ec..9296efa0 100644
--- a/src/api/erp/stock/stock/index.ts
+++ b/src/api/erp/stock/stock/index.ts
@@ -24,6 +24,11 @@ export const StockApi = {
return await request.get({ url: `/erp/stock/get?id=` + id })
},
+ // 查询产品库存详情
+ getStock2: async (productId: number, warehouseId: number) => {
+ return await request.get({ url: `/erp/stock/get`, params: { productId, warehouseId } })
+ },
+
// 导出产品库存 Excel
exportStock: async (params) => {
return await request.download({ url: `/erp/stock/export-excel`, params })
diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue
index a0ef08d6..5e9c8f3a 100644
--- a/src/components/UploadFile/src/UploadFile.vue
+++ b/src/components/UploadFile/src/UploadFile.vue
@@ -160,7 +160,7 @@ const emitUpdateModelValue = () => {
// 情况1:数组结果
let result: string | string[] = fileList.value.map((file) => file.url!)
// 情况2:逗号分隔的字符串
- if (isString(props.modelValue)) {
+ if (props.limit === 1 || isString(props.modelValue)) {
result = result.join(',')
}
emit('update:modelValue', result)
diff --git a/src/views/erp/stock/in/StockInForm.vue b/src/views/erp/stock/in/StockInForm.vue
index fe9cb68f..fb0f66ab 100644
--- a/src/views/erp/stock/in/StockInForm.vue
+++ b/src/views/erp/stock/in/StockInForm.vue
@@ -8,54 +8,54 @@
v-loading="formLoading"
>
-
+
+
-
+
-
+
+
-
+
-
-
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
确 定
取 消
@@ -82,18 +82,15 @@ const formData = ref({
no: undefined,
supplierId: undefined,
inTime: undefined,
- totalCount: undefined,
- totalPrice: undefined,
- remark: undefined
+ remark: undefined,
+ fileUrl: '',
+ items: []
})
const formRules = reactive({
no: [{ required: true, message: '入库单号不能为空', trigger: 'blur' }],
- inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }],
- totalCount: [{ required: true, message: '合计数量不能为空', trigger: 'blur' }],
- totalPrice: [{ required: true, message: '合计金额,单位:元不能为空', trigger: 'blur' }]
+ inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }]
})
const formRef = ref() // 表单 Ref
-const formRef2 = ref() // 表单 Ref TODO 芋艿:需要优化
/** 子表的表单 */
const subTabsName = ref('stockInItem')
@@ -122,20 +119,11 @@ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成
const submitForm = async () => {
// 校验表单
await formRef.value.validate()
- await formRef2.value.validate() // TODO 芋艿:需要在看看
- // 校验子表单
- try {
- await stockInItemFormRef.value.validate()
- } catch (e) {
- subTabsName.value = 'stockInItem'
- return
- }
+ await stockInItemFormRef.value.validate()
// 提交请求
formLoading.value = true
try {
const data = formData.value as unknown as StockInVO
- // 拼接子表的数据
- data.stockInItems = stockInItemFormRef.value.getData()
if (formType.value === 'create') {
await StockInApi.createStockIn(data)
message.success(t('common.createSuccess'))
@@ -160,9 +148,10 @@ const resetForm = () => {
inTime: undefined,
totalCount: undefined,
totalPrice: undefined,
- remark: undefined
+ remark: undefined,
+ fileUrl: undefined,
+ items: []
}
formRef.value?.resetFields()
- formRef2.value?.resetFields() // TODO 芋艿:需要在看看
}
diff --git a/src/views/erp/stock/in/components/StockInItemForm.vue b/src/views/erp/stock/in/components/StockInItemForm.vue
index b3821123..a3adc1b8 100644
--- a/src/views/erp/stock/in/components/StockInItemForm.vue
+++ b/src/views/erp/stock/in/components/StockInItemForm.vue
@@ -8,65 +8,101 @@
:inline-message="true"
>
-
-
+
+
-
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -90,57 +126,74 @@