feat(入库计划): 查询计划编码是否重复
This commit is contained in:
parent
57445a6f24
commit
eada1f3f27
@ -42,3 +42,12 @@ export function delPLAN(planId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询计划编码是否重复
|
||||
export function isDuplicatePlanCode(planCode) {
|
||||
return request({
|
||||
url: '/wm/PLAN/isDuplicatePlanCode/' + planCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -254,7 +254,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addPLAN, delPLAN, getPLAN, listPLAN, updatePLAN} from "@/api/wm/PLAN";
|
||||
import {listPLAN, getPLAN, delPLAN, addPLAN, updatePLAN, isDuplicatePlanCode,} from "@/api/wm/PLAN";
|
||||
import {listTYPE} from "@/api/md/TYPE";
|
||||
import {listMdItem} from "@/api/mes/md/mdItem"
|
||||
import {listArea} from "@/api/mes/wm/area"
|
||||
@ -262,6 +262,20 @@ import {addWmsInTask} from "@/api/mes/wm/wmsInTask"
|
||||
import WmsInPlanDetailEntityTableCmps from "@/views/mes/wm/inPlan/wmsInPlanDetailEntityTableCmps.vue";
|
||||
import WmsInPlanKnifeBackFormCmps from "@/views/mes/wm/inPlan/wmsInPlanKnifeBackFormCmps.vue";
|
||||
|
||||
// 计划编码重复性验证
|
||||
const planCodeValidator = (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
callback();
|
||||
} else {
|
||||
isDuplicatePlanCode(value).then(res => {
|
||||
if (res.data) {
|
||||
callback(new Error("计划编码重复"))
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: "PLAN",
|
||||
components: {WmsInPlanKnifeBackFormCmps, WmsInPlanDetailEntityTableCmps},
|
||||
@ -340,19 +354,16 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
planCode: [{required: true}],
|
||||
planCode: [{required: true}, {validator: planCodeValidator, trigger: "change"}],
|
||||
planTypeId: [{required: true}],
|
||||
relBillCode: [{required: true}],
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
/** 控制弹窗类型 */
|
||||
isKnifeBack() {
|
||||
if (this.form.planTypeId == 9 || this.form.planTypeId == 7 || this.form.planTypeId == 15) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
return this.form.planTypeId == 9 || this.form.planTypeId == 7 || this.form.planTypeId == 15;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
Loading…
Reference in New Issue
Block a user