<el-form
:rules="rules"
:model="item"
label-width="110px"
size="small"
ref="ruleForm"
>
<table
border="1"
width="80%"
align="center"
cellspacing="0"
cellpadding="6"
v-for="(item,index) in qualitySafetyItemVOList"
:key='index'
>
<tbody>
<tr
align="left"
height="70px"
>
<td colspan="2">
<el-form-item
label="内容:"
prop="content"
>
<!-- <span style="color:#d43030;">* </span>内容: -->
<el-input
class="search"
type="textarea"
v-model="item.content"
placeholder="请输入检查内容"
style="width:80%;"
/>
</el-form-item>
</td>
</tr>
</tbody>
</table>
</el-form>
dataForm: {
projectId: "",
qualityCheckType: 1,
checkDate: "",
checkId: "",
},
item: {
content: "",
},
rules: {
content: [
{ required: true, message: "请输入检查内容", trigger: "blur" },
],
},
//确定 提交
submitbtn(draftFlag) {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (draftFlag == 2) {
var checkF = this.checkInfo();
if (checkF === "checkFalse") {
return;
}
}
let data = {};
for (
let index = 0;
index < this.qualitySafetyItemVOList.length;
index++
) {
if (
this.qualitySafetyItemVOList[index].content == "" &&
draftFlag == 2
)
if (
this.qualitySafetyItemVOList[index].checkResult === "" &&
draftFlag == 2
) {
this.$message.error("请选择检查结果");
return;
}
data = Object.assign(this.dataForm, {
["qualitySafetyItemVOList[" + index + "].sort"]: index,
["qualitySafetyItemVOList[" + index + "].noticeId"]:
this.qualitySafetyItemVOList[index].noticeId,
["qualitySafetyItemVOList[" + index + "].checkResult"]:
this.qualitySafetyItemVOList[index].checkResult,
["qualitySafetyItemVOList[" + index + "].content"]: this
.qualitySafetyItemVOList[index].content
? remarkData(this.qualitySafetyItemVOList[index].content, "add")
: "",
["qualitySafetyItemVOList[" + index + "].attachmentIds"]: this
.qualitySafetyItemVOList[index].fileList
? this.qualitySafetyItemVOList[index].fileList
.map((x) => {
return x.attachmentId;
})
.join(",")
: "",
});
}
data.draftFlag = draftFlag;
data = qs.stringify(data);
// let data = qs.stringify(this.dataForm)
this.btnDisabled = true;
editQualityInfo(data)
.then((res) => {
this.btnDisabled = false;
if (res.status === 200 && res.data.returncode == 0) {
this.$message.success("质量安全修改成功");
this.$router.push({ path: "/home/quality" });
} else {
this.$message.error(res.data.message);
}
})
.catch(() => {
this.btnDisabled = false;
console.log("error", "入库单");
});
}
});
},