| | |
| | | 检测结果 :{{ fList.proResult }}{{ fList.project.proMetering }} |
| | | </h3> |
| | | |
| | | <h2 style="text-align: center;">{{ proName || '暂无项目名称' }}</h2> |
| | | <h2 style="text-align: center">{{ proName || "暂无项目名称" }}</h2> |
| | | <div style="display: flex; width: 100%"> |
| | | <div style="width: 50%; margin-right: 40px"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> |
| | |
| | | <h3 style="margin-left: 160px">已选项目</h3> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <el-table :data="dataList" ref="multipleTable" v-loading="loading" @selection-change="handleSelectionChange" |
| | | <el-table :data="dataList" ref="multipleTable" row-key="aid" v-loading="loading" @selection-change="handleSelectionChange" |
| | | border height="480px"> |
| | | <el-table-column type="selection" width="40" align="center" /> |
| | | <el-table-column type="selection" width="40" align="center" :reserve-selection="true"/> |
| | | <el-table-column label="序号" type="index" align="center" width="50px" /> |
| | | <!-- <el-table-column label="规则" align="center" prop="ruleStr" /> --> |
| | | <el-table-column label="检查所见" align="center" prop="yxbx" /> |
| | |
| | | // 弹出层标题 |
| | | title: "", |
| | | yxbx: "", |
| | | proName: '', |
| | | proName: "", |
| | | // lastDesc: "", |
| | | total: 0, |
| | | dataList: [], |
| | |
| | | queryParams: { |
| | | ruleStr: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | pageSize: 50, |
| | | }, |
| | | list: [], |
| | | fList: {}, |
| | |
| | | }, |
| | | watch: { |
| | | checkStatus(newValue) { |
| | | console.log(565658) |
| | | if (newValue === "1") { |
| | | this.updateData(this.proResult, this.conclusion); |
| | | }else{ |
| | | |
| | | } |
| | | }, |
| | | projectList: { |
| | | immediate: true, |
| | | deep: true, |
| | | handler(newVal) { |
| | | console.log("收到的项目数据:", newVal); |
| | | // 你可以在这里处理数据,比如保存到 data 或做逻辑判断 |
| | | if (newVal && newVal.length > 0) { |
| | | const firstProject = newVal[0]; // 你也可以遍历所有项目,看你业务需求 |
| | | this.queryParams.proId = firstProject.proId; // 假设项目中叫 id |
| | | //this.queryParams.proName = firstProject.proName; // 假设叫 proName |
| | | this.proName = firstProject.proName |
| | | this.proName = firstProject.proName; |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | mounted() { }, |
| | | |
| | | created() { }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | async getList() { |
| | | try { |
| | |
| | | }, |
| | | |
| | | updateData(proResult, conclusion) { |
| | | console.log(proResult, conclusion, 5658) |
| | | if (this.checkStatus == 1) { |
| | | |
| | | this.form.jcsj = proResult; // 更新检查所见 |
| | | this.form.desc = conclusion; // 更新检查结论 |
| | | } else { |
| | | this.form.desc = ""; |
| | | this.form.jcsj = ""; |
| | | } |
| | | |
| | | |
| | | if (this.list.length != 0) { |
| | | let desc = "" |
| | | let desc = ""; |
| | | desc += this.list |
| | | .map((item) => item.bingzhong || item.ruleStr) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | let jcsj = "" |
| | | let jcsj = ""; |
| | | jcsj += this.list |
| | | .map((item) => item.yxbx) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | this.form.jcsj = this.form.jcsj + jcsj; // 更新检查所见 |
| | | this.form.desc = this.form.desc + desc; |
| | | this.form.jcsj = jcsj; // 更新检查所见 |
| | | this.form.desc = desc; |
| | | // if (this.queryParams.pageNum == 1) { |
| | | |
| | | // } else { |
| | | // this.form.jcsj = this.form.jcsj + jcsj; // 更新检查所见 |
| | | // this.form.desc = this.form.desc + desc; |
| | | // this.form.jcsj = this.uniqueStrings(this.form.jcsj) |
| | | // this.form.desc = this.uniqueStrings(this.form.desc) |
| | | // } |
| | | }else{ |
| | | this.form.jcsj = ""; // 更新检查所见 |
| | | this.form.desc = ""; |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | // uniqueStrings(strings) { |
| | | // // 使用Set来去重 |
| | | // const uniqueSet = new Set(strings); |
| | | // return Array.from(uniqueSet).join("") |
| | | // }, |
| | | handleSelectionChange(selection) { |
| | | this.list = selection; |
| | | this.list = selection |
| | | this.updateFormContent(selection); |
| | | }, |
| | | |
| | |
| | | if (!this.form.desc && !this.form.jcsj) { |
| | | this.$message.warning("请选择数据"); |
| | | return; |
| | | } else { |
| | | const desc = this.form.desc?.trim(); |
| | | const jcsj = this.form.jcsj?.trim(); |
| | | |
| | | // 如果没有选中表格项 |
| | | if (!this.list || this.list.length === 0) { |
| | | if (!desc && !jcsj) { |
| | | this.$message.warning( |
| | | "请填写有效的检查所见和检查结论,或选择表格数据" |
| | | ); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | try { |
| | |
| | | console.error("处理数据失败:", error); |
| | | this.$message.error("操作失败"); |
| | | } |
| | | this.$refs.multipleTable?.clearSelection(); |
| | | }, |
| | | |
| | | resetForm() { |
| | |
| | | }, |
| | | callcolos() { |
| | | this.open = false; |
| | | } |
| | | this.$refs.multipleTable?.clearSelection(); |
| | | }, |
| | | }, |
| | | computed: { |
| | | isCheckMode() { |
| | |
| | | .jianc { |
| | | width: 100%; |
| | | height: 600px; |
| | | padding-top: 40px |
| | | padding-top: 40px; |
| | | } |
| | | </style> |