上传
This commit is contained in:
@@ -128,11 +128,13 @@
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="form.signProduct.push({ productId: undefined, specsId: undefined, signNum: 0 })"
|
||||
@click="
|
||||
form.signProducts.push({ productId: undefined, specsId: undefined, signNum: 0 })
|
||||
"
|
||||
>
|
||||
添加成交产品
|
||||
</el-button>
|
||||
<el-table :data="form.signProduct" border size="small">
|
||||
<el-table :data="form.signProducts" border size="small">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="productId" label="产品">
|
||||
<template #default="{ row }">
|
||||
@@ -189,7 +191,7 @@
|
||||
<Icon
|
||||
icon="ep:remove-filled"
|
||||
class="text-red-500"
|
||||
@click="handleRemove('signProduct', $index)"
|
||||
@click="handleRemove('signProducts', $index)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -255,7 +257,7 @@
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSave">保 存</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
@@ -339,7 +341,7 @@ function resetForm(id) {
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
extraPay: [],
|
||||
signProduct: []
|
||||
signProducts: []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,7 +357,7 @@ async function handleSave() {
|
||||
return
|
||||
}
|
||||
|
||||
if (form.value.signProduct.some((it) => !it.schoolId || !item.specsId || !it.signNum)) {
|
||||
if (form.value.signProducts.some((it) => !it.productId || !item.specsId || !it.signNum)) {
|
||||
message.info('请将成交产品信息填写完整!')
|
||||
return
|
||||
}
|
||||
@@ -363,9 +365,19 @@ async function handleSave() {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await createSign(form.value)
|
||||
const params = { ...form.value }
|
||||
params.diyParams = {}
|
||||
diyFieldList.value.map((it) => {
|
||||
params.diyParams[it.field] = undefined
|
||||
})
|
||||
for (const key in params.diyParams) {
|
||||
if (Object.hasOwnProperty.call(params, key)) {
|
||||
params.diyParams[key] = params[key]
|
||||
}
|
||||
}
|
||||
await createSign(params)
|
||||
message.success(t('common.createSuccess'))
|
||||
dialogVisible.value = false
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user