feat:添加bx入库检验

This commit is contained in:
shijing 2024-12-31 16:26:51 +08:00
parent 81889ef149
commit ac7f5d7471
1 changed files with 129 additions and 84 deletions

View File

@ -770,11 +770,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date"> <el-form-item label="检验时间" prop="test_time">
<el-date-picker <el-date-picker
v-model="form.test_date" v-model="form.test_time"
type="date" type="datetime"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
@ -932,6 +932,13 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
test_time: [
{
required: true,
message: "请选择检验时间",
trigger: "blur",
},
],
test_user: [ test_user: [
{ {
required: true, required: true,
@ -956,6 +963,7 @@ export default {
qct_testitems:[], qct_testitems:[],
qct_defects:[], qct_defects:[],
qctId:'', qctId:'',
wproductId:'',
}; };
}, },
watch: { watch: {
@ -989,6 +997,7 @@ export default {
that.project_code = config_base.base_code; that.project_code = config_base.base_code;
that.getUserList(); that.getUserList();
if(that.project_code=='bxerp'){ if(that.project_code=='bxerp'){
that.wproductId = that.objitem.wproducts[0].id;
this.getQctDetail(); this.getQctDetail();
}else{ }else{
if (that.type == "pur_in") { if (that.type == "pur_in") {
@ -1185,6 +1194,41 @@ export default {
// //
submit() { submit() {
let that = this; let that = this;
if(that.project_code=='bxerp'){
let defect_json = [],test_json = {};
that.qct_testitems.forEach((item) => {
let val = that.form[item.testitem_name];
let obj0 = {};
obj0.val = val;
test_json[item.id] =obj0;
})
that.qct_defects.forEach((item) => {
if(that.form[item.defect_name]){
defect_json.push(item.id);
}
})
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
let obj = {};
obj.test_user = that.form.test_user;
obj.test_time = that.form.test_time;
obj.is_testok = that.form.is_testok;
obj.qct = that.qctId;
obj.note = that.form.test_note;
obj.test_json = test_json;//
obj.defect_json = defect_json;//defecttrueid
that.$API.inm.mioitem.wtest.req(that.wproductId,obj).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
})
}
})
}else{
if ( if (
(that.type == "do_in" && that.cate == "halfgood") || (that.type == "do_in" && that.cate == "halfgood") ||
that.type == "other_in" that.type == "other_in"
@ -1267,6 +1311,7 @@ export default {
} }
} }
}); });
}
}, },
// //
setData(data) { setData(data) {