|
@@ -8,6 +8,7 @@ import {
|
|
|
betchSubmit,
|
|
|
classifyDetails,
|
|
|
getDiCode,
|
|
|
+ checkDiCode,
|
|
|
} from "@/api/requisition/basic";
|
|
|
import { REFER } from "@/components/popover-select/api/index";
|
|
|
export default {
|
|
@@ -409,6 +410,7 @@ export default {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
let params = await this.handleParams();
|
|
|
+ this.checkDi(params.sysMaterialApply.diCode);
|
|
|
if (params) {
|
|
|
let { code, msg } =
|
|
|
this.addType === "add"
|
|
@@ -430,6 +432,7 @@ export default {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
let params = await this.handleParams();
|
|
|
+ this.checkDi(params.sysMaterialApply.diCode);
|
|
|
if (params) {
|
|
|
let { code, msg } = await betchSubmit({
|
|
|
ids: [Number(params.sysMaterialApply.id)],
|
|
@@ -450,6 +453,7 @@ export default {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
let params = await this.handleParams();
|
|
|
+ this.checkDi(params.sysMaterialApply.diCode);
|
|
|
if (params) {
|
|
|
let { code, msg } = await saveAndToOa(params);
|
|
|
code == 200 && this.hide();
|
|
@@ -528,6 +532,7 @@ export default {
|
|
|
},
|
|
|
async changeDiCode(prop) {
|
|
|
console.log(prop, "prop");
|
|
|
+ this.checkDi(prop);
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
let { code, data } = await getDiCode(prop);
|
|
@@ -547,6 +552,23 @@ export default {
|
|
|
this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
+ // 校验DI码
|
|
|
+ async checkDi(prop) {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ let param = {
|
|
|
+ diCode: prop,
|
|
|
+ isApply: 0
|
|
|
+ }
|
|
|
+ let { code, data } = await checkDiCode(param);
|
|
|
+ if (code === 200 && data.sysApplyDiInfo.length != 0 ) {
|
|
|
+ this.$modal.notifyWarning(data.sysApplyDiInfo[0].billCode + '物料申请单已填写' + data.sysApplyDiInfo[0].diCode + 'DI码');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {},
|
|
@@ -857,7 +879,7 @@ export default {
|
|
|
<template slot="diCode" slot-scope="scope">
|
|
|
<component
|
|
|
v-bind="scope.attr"
|
|
|
- v-model="scope.row[scope.item.key]"
|
|
|
+ v-model.trim="scope.row[scope.item.key]"
|
|
|
:size="$attrs.size"
|
|
|
:source.sync="scope.row"
|
|
|
:disabled="addType === 'see'"
|