Commit 402ade04 authored by xiangzj's avatar xiangzj

审批

parent 480791fc
......@@ -43,7 +43,7 @@
:required="taskNode.subProcUnitId === 'base'"
label="基地审批量"
placeholder=""
:disabled="isReadonly"
:disabled="taskNode.subProcUnitId !== 'base'"
/>
<van-field
v-if="isShowWarZone"
......@@ -52,16 +52,16 @@
:required="taskNode.subProcUnitId === 'warZone'"
placeholder=""
error-message=""
:disabled="isReadonly"
:disabled="taskNode.subProcUnitId !== 'warZone'"
/>
<van-field
v-if="isShowWork"
v-model="form.salecenterAuditQuantity"
required
:required="taskNode.subProcUnitId === 'work'"
label="内勤审批量"
placeholder=""
error-message=""
:disabled="isReadonly"
:disabled="taskNode.subProcUnitId !== 'work'"
/>
</van-cell-group>
</div>
......@@ -335,6 +335,9 @@ export default {
}
}
}
this.form.baseAuditQuantity = res.data.wantGoodsDetailList[0].baseAuditQuantity || 0
this.form.warAuditQuantity = res.data.wantGoodsDetailList[0].warAuditQuantity || 0
this.form.salecenterAuditQuantity = res.data.wantGoodsDetailList[0].salecenterAuditQuantity || 0
})
},
flowPath() {
......@@ -349,23 +352,41 @@ export default {
.catch(() => {})
},
async submit(handleResult) {
this.conditions = { ...this.conditions, ...this.form }
this.conditions = { ...this.conditions }
this.conditions.handleResult = handleResult
const params = JSON.parse(JSON.stringify(this.conditions))
params.wantGoodsDetailList[0].baseAuditQuantity = this.form.baseAuditQuantity
params.wantGoodsDetailList[0].warAuditQuantity = this.form.warAuditQuantity
params.wantGoodsDetailList[0].salecenterAuditQuantity = this.form.salecenterAuditQuantity
params.currentHandleId = this.taskNode.procUnitHandlerId
params.currentHandleGroupId = this.taskNode.groupId
params.taskId = this.$route.query.taskId
if (this.isShowBase && !this.form.baseAuditQuantity) {
Toast('请正确填写基地审批量')
return
if (this.isShowBase && this.taskNode.subProcUnitId === 'base') {
if (this.form.baseAuditQuantity - 0 <= 0) {
Toast('请正确填写基地审批量')
return
} else if (this.form.baseAuditQuantity - 0 > params.wantGoodsDetailList[0].wantQuantity - 0) {
Toast('基地审批数量不能大于本次要货数量')
return
}
}
if (this.isShowWarZone && !this.form.warAuditQuantity) {
Toast('请正确填写战区审批量')
return
if (this.isShowWarZone && this.taskNode.subProcUnitId === 'warZone') {
if (this.form.warAuditQuantity - 0 <= 0) {
Toast('请正确填写战区审批量')
return
} else if (this.form.warAuditQuantity - 0 > this.form.baseAuditQuantity - 0) {
Toast('战区审批数量不能大于本次要货数量')
return
}
}
if (this.isShowWork && !this.form.salecenterAuditQuantity) {
Toast('请正确填写内勤审批量')
return
if (this.form.salecenterAuditQuantity - 0 <= 0) {
Toast('请正确填写内勤审批量')
return
} else if (this.form.salecenterAuditQuantity - 0 > this.form.warAuditQuantity - 0) {
Toast('销售内勤审批数量不能大于本次要货数量')
return
}
}
if (this.conditions.id) {
const toast = Toast.loading({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment