feat: 手动关联

20240912_adapter
chenhc 6 months ago
parent 18d31cf8a9
commit b0db8f8fd3

@ -16,10 +16,10 @@
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;"
>放弃 >放弃
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <!-- <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"-->
style="margin-right: 8px;border-radius: 5%;" <!-- style="margin-right: 8px;border-radius: 5%;"-->
>保存 <!-- >保存-->
</el-button> <!-- </el-button>-->
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;"
>提交 >提交
@ -99,7 +99,7 @@
v-model="relFormData.batchNo" v-model="relFormData.batchNo"
auto-complete="off" auto-complete="off"
style="width: 90%" style="width: 90%"
:disabled="this.parentCode" :disabled="this.parentCode && this.detailList.length > 0"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -113,7 +113,7 @@
clearable clearable
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 90%" style="width: 90%"
:disabled="this.parentCode" :disabled="this.parentCode && this.detailList.length > 0"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -127,7 +127,7 @@
clearable clearable
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 90%" style="width: 90%"
:disabled="this.parentCode" :disabled="this.parentCode && this.detailList.length > 0"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -140,7 +140,7 @@
clearable clearable
style="width: 90%" style="width: 90%"
placeholder="请输入备注" placeholder="请输入备注"
:disabled="this.parentCode" :disabled="this.parentCode && this.detailList.length > 0"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -383,20 +383,21 @@
}, },
// //
addCode() { addCode() {
// if (this.parentCode != null) {
if (this.relFormData.batchNo == null) { //
this.$message.warning("请输入批次号!"); if (this.relFormData.batchNo == null) {
return; this.$message.warning("请输入批次号!");
} return;
if (this.relFormData.madeDate == null) { }
this.$message.warning("请选择生产日期!"); if (this.relFormData.madeDate == null) {
return; this.$message.warning("请选择生产日期!");
} return;
if (this.relFormData.validateDate == null) { }
this.$message.warning("请选择失效日期!"); if (this.relFormData.validateDate == null) {
return; this.$message.warning("请选择失效日期!");
return;
}
} }
let tQuery = Object.assign(this.codeFormData); let tQuery = Object.assign(this.codeFormData);
tQuery.curCode = this.codeFormData.code; tQuery.curCode = this.codeFormData.code;
tQuery.parentCode = this.parentCode; tQuery.parentCode = this.parentCode;
@ -440,7 +441,6 @@
return; return;
} }
} }
// //
if(data.packLayer == this.relFormData.packLayer) { if(data.packLayer == this.relFormData.packLayer) {
// //
@ -496,7 +496,6 @@
this.title = "手工关联:" + data.curCode; this.title = "手工关联:" + data.curCode;
this.popParentCode = data.curCode; this.popParentCode = data.curCode;
}else { }else {
if( this.bhxjsl === this.syxjsl){ if( this.bhxjsl === this.syxjsl){
this.$confirm("该层级已录入完成, 是否关闭?", "提示", { this.$confirm("该层级已录入完成, 是否关闭?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -568,25 +567,54 @@
this.$message.warning("请选择失效日期!"); this.$message.warning("请选择失效日期!");
return; return;
} }
this.loading = true;
this.$set(this.relFormData, 'detailList', []); this.$set(this.relFormData, 'detailList', []);
this.detailList.forEach( item =>{ this.detailList.forEach( item =>{
this.relFormData.detailList.push(item) this.relFormData.detailList.push(item)
}); });
addRelCode(this.relFormData).then((response) => {
this.loading = false; //
if (response.code === 20000) { if( this.bhxjsl != this.syxjsl){
this.$message.success("保存成功!"); this.$confirm("该层级已录入数量与应录入数量不符, 是否继续提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.loading = true;
addRelCode(this.relFormData).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("保存成功!");
this.clearRel();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.clearRel();
});
})
.catch(() => {
});
}else {
this.loading = true;
addRelCode(this.relFormData).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("保存成功!");
this.clearRel();
} else {
this.$message.error(response.message);
}
}).catch(() => {
this.loading = false;
this.clearRel(); this.clearRel();
} else { });
this.$message.error(response.message); }
}
})
.catch(() => {
this.loading = false;
this.clearRel();
});
}, },
// //

@ -16,10 +16,10 @@
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;"
>放弃 >放弃
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <!-- <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"-->
style="margin-right: 8px;border-radius: 5%;" <!-- style="margin-right: 8px;border-radius: 5%;"-->
>保存 <!-- >保存-->
</el-button> <!-- </el-button>-->
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;"
>提交 >提交
@ -455,21 +455,68 @@
this.warnVisible = false; this.warnVisible = false;
this.errVisible = false; this.errVisible = false;
}, },
giveUp() {
this.relFormData = {
productCode: null,
subTypeNo: null,
cascadeRatio: null,
packageSpec: null,
comment: null,
batchNo: null,
madeDate: null,
validateDate: null,
workShop: null,
lineName: null,
lineManager: null,
packUnit: null,
bhxjsl: null,
detailList: []
}
this.detailList = []
this.parentCode = null
this.bhxjsl = 0
this.syxjsl = 0
this.packLayer = null
},
submit() { submit() {
addRelCode(this.relFormData).then((response) => { //
this.loading = false; if( this.bhxjsl != this.syxjsl){
if (response.code === 20000) { this.$confirm("该层级已录入数量与应录入数量不符, 是否继续提交?", "提示", {
this.$message.success("保存成功!"); confirmButtonText: "确定",
this.clearRel(); cancelButtonText: "取消",
} else { type: "warning",
this.$message.error(response.message); })
} .then(() => {
}) addRelCode(this.relFormData).then((response) => {
.catch(() => { this.loading = false;
this.loading = false; if (response.code === 20000) {
this.clearRel(); this.$message.success("保存成功!");
}); this.clearRel();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.clearRel();
});
})
.catch(() => {
});
}else {
addRelCode(this.relFormData).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("保存成功!");
this.clearRel();
} else {
this.$message.error(response.message);
}
}).catch(() => {
this.loading = false;
this.clearRel();
});
}
}, },
// //

Loading…
Cancel
Save