领料发布

This commit is contained in:
bb_pan 2025-09-11 10:52:03 +08:00
parent 99c318a345
commit 5c71891cfe
2 changed files with 34 additions and 8 deletions

View File

@ -129,6 +129,7 @@
width="600px" width="600px"
append-to-body append-to-body
@close="closeView" @close="closeView"
v-loading="loading"
> >
<el-form ref="maForm" :model="maForm" :rules="rules" label-width="120px"> <el-form ref="maForm" :model="maForm" :rules="rules" label-width="120px">
<el-row :gutter="24"> <el-row :gutter="24">
@ -266,6 +267,7 @@ export default {
}, },
data() { data() {
return { return {
isSubmit: false,
taskId: "", taskId: "",
// isEdit: false, // isEdit: false,
// //
@ -511,6 +513,9 @@ export default {
return this.$modal.msgError(errorInfo); return this.$modal.msgError(errorInfo);
} }
console.log("xxxxxxxxxxxxxxxxxxxxxx", itemsTemp) console.log("xxxxxxxxxxxxxxxxxxxxxx", itemsTemp)
if (this.isSubmit) return
this.isSubmit = true
this.loading = true
applySubmit({ applySubmit({
leaseApplyDetailsList: itemsTemp, leaseApplyDetailsList: itemsTemp,
leaseApplyInfo: leaseApplyInfo, leaseApplyInfo: leaseApplyInfo,
@ -524,7 +529,11 @@ export default {
this.$emit("addToolsSuccess"); this.$emit("addToolsSuccess");
} }
this.loading = false; this.loading = false;
}); this.isSubmit = false
}).catch(() => {
this.loading = false
this.isSubmit = false
})
} }
}) })

View File

@ -46,7 +46,7 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">领料申请</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">领料申请</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5" v-hasPermi="['purchase:person:notice']">
<el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleSendAll">发布</el-button> <el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleSendAll">发布</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -453,6 +453,7 @@ export default {
data() { data() {
return { return {
// //
isSubmit: false,
loading: true, loading: true,
loadingTwo: true, loadingTwo: true,
updateTime: '', updateTime: '',
@ -1173,12 +1174,20 @@ export default {
const param = { id: row.id, taskId: row.taskId } const param = { id: row.id, taskId: row.taskId }
this.$modal this.$modal
.confirm('是否确认发布所选择的数据项?') .confirm('是否确认发布所选择的数据项?')
.then(function () { .then(async () => {
return applySend(param) try {
}) if (this.isSubmit) return
.then(() => { this.isSubmit = true
this.loading = true
await applySend(param)
this.getList() this.getList()
this.$modal.msgSuccess('发布成功') this.$modal.msgSuccess('发布成功')
} catch (error) {
console.log('🚀 ~ handleSend ~ error:', error)
} finally {
this.isSubmit = false
this.loading = false
}
}) })
.catch(() => {}) .catch(() => {})
}, },
@ -1191,11 +1200,19 @@ export default {
}) })
return return
} else { } else {
if (this.isSubmit) return
this.isSubmit = true
this.loading = true
applySendAll(this.sendTemp).then(response => { applySendAll(this.sendTemp).then(response => {
this.isSubmit = false
this.loading = false
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess('发布成功') this.$modal.msgSuccess('发布成功')
} }
this.getList() this.getList()
}).catch(() => {
this.isSubmit = false
this.loading = false
}) })
} }
}, },