Browse Source

fix: 修改bug

sy-water-data-board-ui
panyuyi 10 months ago
parent
commit
42651c4321
  1. 49
      src/views/dike/runManage/enginerring/inspectionPlan/components/PlanDetail.vue
  2. 11
      src/views/dike/runManage/enginerring/inspectionRecords/CreateInspectionRecords.vue
  3. 60
      src/views/dike/runManage/enginerring/inspectionRecords/components/NewRecord.vue
  4. 6
      src/views/dike/runManage/enginerring/inspectionRecords/index.vue

49
src/views/dike/runManage/enginerring/inspectionPlan/components/PlanDetail.vue

@ -565,28 +565,37 @@ export default {
...this.$refs.subFormRef.map((item) => item.validate()), ...this.$refs.subFormRef.map((item) => item.validate()),
]) ])
.then((res) => { .then((res) => {
this.formData.contents.forEach((item) => { //
item.startDate = item.planDateTimeArr[0] this.$confirm("确认提交吗?", "提示", {
? item.planDateTimeArr[0] + " 00:00:00" confirmButtonText: "确定",
: ""; cancelButtonText: "取消",
item.endDate = item.planDateTimeArr[1] type: "warning",
? item.planDateTimeArr[1] + " 23:59:59"
: "";
});
(this.id ? putProjectCheckingPlan : postProjectCheckingPlan)({
id: this.id || null,
...this.formData,
}) })
.then((res) => { .then(() => {
this.$message.success("提交成功"); this.formData.contents.forEach((item) => {
if (reset) { item.startDate = item.planDateTimeArr[0]
this.reset(); ? item.planDateTimeArr[0] + " 00:00:00"
} : "";
r(); item.endDate = item.planDateTimeArr[1]
? item.planDateTimeArr[1] + " 23:59:59"
: "";
});
(this.id ? putProjectCheckingPlan : postProjectCheckingPlan)({
id: this.id || null,
...this.formData,
})
.then((res) => {
this.$message.success("提交成功");
if (reset) {
this.reset();
}
r();
})
.catch(() => {
j();
});
}) })
.catch(() => { .catch(() => {});
j();
});
}) })
.catch(() => { .catch(() => {
j(); j();

11
src/views/dike/runManage/enginerring/inspectionRecords/CreateInspectionRecords.vue

@ -15,6 +15,13 @@
@click="handleSave(true)" @click="handleSave(true)"
>保存并继续新增</el-button >保存并继续新增</el-button
> >
<el-button
type="primary"
size="small"
v-if="$route.query.mode === 'edit'"
@click="handleSave(false, true)"
>保存并完成巡查</el-button
>
<el-button size="small" @click="handleCancel">取消</el-button> <el-button size="small" @click="handleCancel">取消</el-button>
</div> </div>
</div> </div>
@ -35,8 +42,8 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
handleSave(reset) { handleSave(reset, endXc = false) {
this.$refs.formRef.submit(reset).then((res) => { this.$refs.formRef.submit(reset, endXc).then((res) => {
if (!reset) { if (!reset) {
this.$router.go(-1); this.$router.go(-1);
} }

60
src/views/dike/runManage/enginerring/inspectionRecords/components/NewRecord.vue

@ -701,36 +701,48 @@ export default {
}, 30); }, 30);
} }
}, },
submit(reset) { submit(reset, endXc = false) {
console.log("提交表单 >>>> ", this.formData); console.log("提交表单 >>>> ", this.formData);
return new Promise((r, j) => { return new Promise((r, j) => {
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
this.items?.forEach((v) => { //
if (v.hasProblem != "1") { this.$confirm(`确认提交吗?`, "提示", {
v.problem = ""; confirmButtonText: "确定",
v.problemImages = []; cancelButtonText: "取消",
} type: "warning",
});
(this.id ? updateRecordData : addRecordData)({
id: this.id || null,
...this.formData,
items: this.items,
startDate: this.xcDateArr[0] || "",
endDate: this.xcDateArr[1] || "",
subPlanStartDate: this.subPlanDateArr[0] || "",
subPlanEndDate: this.subPlanDateArr[1] || "",
}) })
.then((res) => { .then(() => {
this.$message.success("提交成功"); this.items?.forEach((v) => {
if (reset) { if (v.hasProblem != "1") {
this.reset(); v.problem = "";
} v.problemImages = [];
r(); }
});
(this.id ? updateRecordData : addRecordData)({
id: this.id || null,
...this.formData,
items: this.items,
startDate: this.xcDateArr[0] || "",
endDate: this.xcDateArr[1] || "",
subPlanStartDate: this.subPlanDateArr[0] || "",
subPlanEndDate: this.subPlanDateArr[1] || "",
status: endXc ? "1" : "0",
})
.then((res) => {
this.$message.success("提交成功");
if (reset) {
this.reset();
}
r();
})
.catch((e) => {
console.log("err >>>>> ", e);
j();
});
}) })
.catch((e) => { .catch(() => {
console.log("err >>>>> ", e);
j(); j();
}); });
} else { } else {

6
src/views/dike/runManage/enginerring/inspectionRecords/index.vue

@ -86,7 +86,7 @@ export default {
handleEdit(row) { handleEdit(row) {
this.$router.push({ this.$router.push({
path: "createInspectionRecords", path: "createInspectionRecords",
query: { id: row.id }, query: { id: row.id, mode: "edit" },
}); });
}, },
handleDel(row) { handleDel(row) {
@ -565,7 +565,9 @@ export default {
<el-button <el-button
type="text" type="text"
size="small" size="small"
:disabled="scope.row.status == '0' ||scope.row.handleStatus != '1'" :disabled="
scope.row.status == '0' || scope.row.handleStatus != '1'
"
@click="handleCheckDetails(scope.row, true)" @click="handleCheckDetails(scope.row, true)"
>处置</el-button >处置</el-button
> >

Loading…
Cancel
Save