Browse Source

fix: 修复堤防细节问题

sy-water-data-board-ui
hejunjie 1 month ago
parent
commit
31ef8e9514
  1. 436
      src/views/dike/runManage/patrolMaintenance/InspectionRecords/components/inspectionRecordDetails.vue
  2. 68
      src/views/dike/runManage/patrolMaintenance/InspectionRecords/index.vue
  3. 0
      src/views/dike/runManage/patrolMaintenance/acceptanceRecords/details.vue
  4. 59
      src/views/dike/runManage/patrolMaintenance/acceptanceRecords/index.vue
  5. 58
      src/views/dike/runManage/patrolMaintenance/componentsDetails/acceptanceDetails.vue
  6. 73
      src/views/dike/runManage/patrolMaintenance/componentsDetails/defectDetails.vue
  7. 112
      src/views/dike/runManage/patrolMaintenance/componentsDetails/inspectionRecordDetails.vue
  8. 108
      src/views/dike/runManage/patrolMaintenance/componentsDetails/maintenanceDetails.vue
  9. 0
      src/views/dike/runManage/patrolMaintenance/defectList/details.vue
  10. 8
      src/views/dike/runManage/patrolMaintenance/defectList/index.vue
  11. 0
      src/views/dike/runManage/patrolMaintenance/maintenanceRecords/details.vue
  12. 33
      src/views/dike/runManage/patrolMaintenance/maintenanceRecords/index.vue
  13. 4
      vue.config.js

436
src/views/dike/runManage/patrolMaintenance/InspectionRecords/components/inspectionRecordDetails.vue

@ -1,436 +0,0 @@
<template>
<div class="slider-right">
<!-- <div class="top-title">{{ $router.currentRoute.meta.title }}</div> -->
<TopBackTitle></TopBackTitle>
<div class="table-box">
<div class="top-box">
<span>巡视检查名称</span>
<el-input
:disabled="isEdit"
v-model="formData.name"
:maxlength="50"
size="small"
class="search-input"
placeholder="请输入巡视检查名称"
></el-input>
<span>巡检类型</span>
<el-select
:disabled="isEdit"
v-model="formData.type"
placeholder="请选择"
>
<el-option
v-for="item in xcTypeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
</el-option>
</el-select>
</div>
<div class="xc-form-table">
<el-row class="flex l-t-border">
<div
class="w-240 flex-shrink-0 flex justify-center items-center r-b-border p-4"
>
<div>工程部位</div>
</div>
<div class="flex flex-1 w-full">
<div class="flex-1 flex justify-center items-center r-b-border">
<div>检查内容</div>
</div>
<div class="w-120 flex justify-center items-center r-b-border">
<div>是否检查项</div>
</div>
</div>
</el-row>
<el-row
v-for="(item, index) in xcTreeData"
:key="item.key"
class="flex font-12"
>
<el-col>
<div class="flex w-full l-t-border">
<div
class="flex items-center p-4 r-b-border"
:class="{
'w-240 flex-shrink-0': !item.children.length,
'w-80 flex-shrink-0': item.children.length,
}"
>
{{ index + 1 }},{{ item.value }}
</div>
<div v-if="item.children.length" class="flex flex-1 flex-col">
<div
class="flex flex-1"
v-for="item2 in item.children"
:key="item2.key"
>
<div
class="flex items-center p-4 r-b-border"
:class="{
'w-80 flex-shrink-0': item2.children.length,
'w-160 flex-shrink-0': !item2.children.length,
}"
>
{{ item2.value }}
</div>
<div
v-if="item2.children.length"
class="flex flex-1 flex-col"
>
<div
class="flex"
v-for="item3 in item2.children"
:key="item3.key"
>
<div
class="flex items-center p-4 r-b-border w-80 flex-shrink-0"
>
{{ item3.value }}
</div>
<!-- 三级项目的问题 -->
<div class="flex flex-1 items-center">
<div
class="flex flex-1 items-center p-4 r-b-border h-full"
>
<el-input
:disabled="!item3.check || isEdit"
v-model="item3.content"
type="textarea"
:rows="1"
:maxlength="500"
placeholder="请输入检查内容"
></el-input>
</div>
<div
class="w-120 flex justify-center items-center p-4 r-b-border h-full"
>
<el-radio-group
:disabled="isEdit"
class="inspection-radio-group"
v-model="item3.check"
>
<el-radio :disabled="isEdit" :label="true"
></el-radio
>
<el-radio :disabled="isEdit" :label="false"
></el-radio
>
</el-radio-group>
</div>
</div>
</div>
</div>
<!-- 两级项目的问题 -->
<div v-else class="flex flex-1 items-center">
<div class="flex-1 flex items-center p-4 r-b-border h-full">
<el-input
:disabled="!item2.check || isEdit"
v-model="item2.content"
type="textarea"
:rows="1"
:maxlength="500"
placeholder="请输入检查内容"
></el-input>
</div>
<div
class="w-120 flex justify-center items-center p-4 r-b-border h-full"
>
<el-radio-group
:disabled="isEdit"
class="inspection-radio-group"
v-model="item2.check"
>
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</div>
</div>
</div>
</div>
<!-- 只有一级项目的问题 -->
<div v-else class="flex flex-1 items-center">
<div class="flex-1 flex items-center p-4 r-b-border h-full">
<el-input
:disabled="!item.check || isEdit"
v-model="item.content"
type="textarea"
:rows="1"
:maxlength="500"
placeholder="请输入检查内容"
></el-input>
</div>
<div
class="w-120 flex justify-center items-center p-4 r-b-border h-full"
>
<el-radio-group
:disabled="isEdit"
class="inspection-radio-group"
v-model="item.check"
>
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
<div class="bottom-btns">
<el-button :disabled="isEdit" type="primary" @click="handleSave"
>保存</el-button
>
<el-button @click="$router.go(-1)">返回</el-button>
</div>
</div>
</template>
<script>
import { intersection } from "lodash";
import {
putInspectionProjectData,
checkUsed,
postInspectionProjectData,
getCheckingDictTree,
getInspectionProjectDetails,
} from "@/api/dike";
import TopBackTitle from "@/components/TopBackTitle/index.vue";
export default {
components: {
TopBackTitle,
},
data() {
return {
xcTreeData: [],
xcTypeOptions: [],
isEdit: false,
formData: {
id: null,
name: "",
type: "",
items: [],
},
};
},
created() {
//
this.getDicts("xs_classfy").then((res) => {
if (res.data && Array.isArray(res.data)) {
this.xcTypeOptions = res.data;
}
});
},
methods: {
//
async getDetailsData() {
const dictData = await getCheckingDictTree("df_xs_c_classfy");
let _xcTreeData = this.transformArr(dictData?.data);
const checkId = this.$route.query.id;
if (checkId) {
const detailData = await getInspectionProjectDetails(checkId);
if (detailData?.data?.items) {
// xcTreeData
this.formData.name = detailData.data.name;
this.formData.type = detailData.data.type;
this.matchXcTreeData(_xcTreeData, detailData.data.items);
}
const checkUsedData = await checkUsed(this.$route.query.id);
this.isEdit = checkUsedData?.data;
}
this.xcTreeData = _xcTreeData;
},
//
transformArr(treeList) {
//
function deepCalc(item, part = []) {
item.parts = [...part, item.key];
if (item.children?.length) {
item.children.forEach((v) => {
if (!v.children || v.children.length === 0) {
v.parts = [...item.parts, v.key];
v.content = v.remark || "";
} else {
deepCalc(v, item.parts);
}
});
}
}
treeList.forEach((item) => {
deepCalc(item);
});
return treeList;
},
// xcTreeData
matchXcTreeData(treeData, dataList) {
treeData.forEach((v) => {
if (!v.children?.length) {
for (const item of dataList) {
v.id = item.id;
if (intersection(v.parts, item.parts).length === v.parts.length) {
//
v.content = item.content || "";
v.check = true;
break;
}
}
} else {
this.matchXcTreeData(v.children, dataList);
}
});
},
// xcTreeDatachecktrue
getCheckData(treeData) {
let res = [];
treeData.forEach((v) => {
if (v.check) {
res.push({
parts: v.parts,
id: v.id || null,
content: v.content,
});
}
if (v.children?.length) {
res = res.concat(this.getCheckData(v.children));
}
});
return res;
},
//
handleSave() {
if (!this.formData.name) {
this.$message.error("请输入巡视检查名称");
return;
}
if (!this.formData.type) {
this.$message.error("请选择巡检类型");
return;
}
this.formData.items = this.getCheckData(this.xcTreeData);
if (this.$route.query.id) {
this.formData.id = this.$route.query.id;
}
if (this.formData.id) {
putInspectionProjectData(this.formData).then((res) => {
this.$message.success("保存成功");
setTimeout(() => {
this.$router.go(-1);
}, 500);
});
} else {
postInspectionProjectData(this.formData).then((res) => {
if (res.data?.id) {
this.formData.id = res.data.id;
}
this.$message.success("保存成功");
setTimeout(() => {
this.$router.go(-1);
}, 500);
});
}
},
},
mounted() {
this.getDetailsData();
},
};
</script>
<style scoped lang="scss">
.top-title {
height: 50px;
background-color: white;
display: flex;
padding-left: 16px;
align-items: center;
font-weight: 600;
}
.table-box {
width: 100%;
height: calc(100% - 50px - 24px);
margin-top: 24px;
padding: 16px;
background-color: white;
overflow: auto;
.top-box {
display: flex;
align-items: center;
margin-bottom: 8px;
.search-input {
width: 300px;
margin-right: 10px;
}
}
.search-btn {
margin-left: 10px;
background-color: #37b29e;
border: none;
&:hover {
background-color: #5ac6b9;
}
&:active {
background-color: #2b8070;
}
}
}
.xc-form-table {
}
.l-t-border {
border-left: 1px solid #eee;
border-top: 1px solid #eee;
}
.r-b-border {
border-right: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.w-p-20 {
width: 20%;
}
.w-p-80 {
width: 80%;
}
.w-p-50 {
width: 50%;
}
.w-80 {
width: 80px !important;
}
.w-120 {
width: 120px !important;
}
.w-160 {
width: 160px !important;
}
.w-240 {
width: 240px !important;
}
</style>
<style lang="scss">
.inspection-radio-group {
.el-radio {
margin-right: 10px;
.el-radio__label {
padding-left: 4px;
}
&:last-child {
margin-right: 0;
}
}
}
</style>

68
src/views/dike/runManage/patrolMaintenance/InspectionRecords/index.vue

@ -28,7 +28,7 @@
filterable
placeholder="请选择"
>
<el-option label="全部" value=""> </el-option>
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in maintenanceType"
:key="item.dictValue"
@ -77,7 +77,7 @@
filterable
placeholder="请选择"
>
<el-option label="全部" value=""> </el-option>
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in maintenanceCategory"
:key="item.dictValue"
@ -99,7 +99,7 @@
filterable
placeholder="请选择"
>
<el-option label="全部" value=""> </el-option>
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in maintenanceStatus"
:key="item.dictValue"
@ -115,13 +115,15 @@
class="flex-shrink-0 myml-12"
type="success"
@click="handleChangeQuery"
>查询</el-button
>查询
</el-button
>
<el-button
class="flex-shrink-0"
size="small"
@click="handleResetQuery"
>重置</el-button
>重置
</el-button
>
</div>
</div>
@ -132,8 +134,8 @@
:data="tableData"
border
>
<el-table-column prop="id" align="center" label="单号" />
<el-table-column prop="checkingName" align="center" label="巡查名称" />
<el-table-column prop="id" align="center" label="单号"/>
<el-table-column prop="checkingName" align="center" label="巡查名称"/>
<el-table-column prop="type" align="center" label="巡查类型">
<template slot-scope="scope">
<span>{{
@ -148,14 +150,31 @@
}}</span>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="巡查状态">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.status, "maintenanceStatus")
}}</span>
</template>
</el-table-column>
<el-table-column prop="createName" align="center" label="责任人" />
<el-table-column prop="status" align="center" label="巡查状态" width="100">
<template slot-scope="scope">
<span style="position: relative"
:style="['3', '5', '6'].includes(scope.row.status) && {color: 'rgba(0,0,0,0.4)'}">
<div
v-if="scope.row.status === '1'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #FFB20D"
></div>
<div
v-if="scope.row.status === '2'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #0EC885"
></div>
<div
v-if="scope.row.status === '4'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #3A89FE"
></div>
<div
v-if="['3', '5', '6'].includes(scope.row.status)"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #A6A6A6"
></div>
{{ getDictLabelName(scope.row.status, "maintenanceStatus") }}
</span>
</template>
</el-table-column>
<el-table-column prop="createName" align="center" label="责任人"/>
<el-table-column
prop="startDate"
align="center"
@ -181,15 +200,19 @@
<el-button
type="text"
size="small"
v-hasPermi="['df:run:patrol:inspection:list:item:check']"
@click="handleCheckDetails(scope.row, false)"
>查看</el-button
>查看
</el-button
>
<el-button
type="text"
size="small"
:disabled="scope.row.status !== '1'"
v-hasPermi="['df:run:patrol:inspection:list:item:edit']"
@click="handleEditDetails(scope.row, true)"
>编辑</el-button
>编辑
</el-button
>
</template>
</el-table-column>
@ -211,7 +234,7 @@
</template>
<script>
import TopBackTitle from "@/components/TopBackTitle/index.vue";
import { calcTableHeight } from "@/mixins/calcTableHeight";
import {calcTableHeight} from "@/mixins/calcTableHeight";
import {
postV2RecordList
@ -268,13 +291,13 @@ export default {
handleCheckDetails(row) {
this.$router.push({
path: "inspectionRecordDetails",
query: { id: row.id, checkingId: row.checkingId, mode: "check" },
query: {id: row.id, checkingId: row.checkingId, mode: "check"},
});
},
handleEditDetails(row) {
this.$router.push({
path: "inspectionRecordDetails",
query: { id: row.id, checkingId: row.checkingId, mode: "edit" },
query: {id: row.id, checkingId: row.checkingId, mode: "edit"},
});
},
getDictLabelName(type, dictListName) {
@ -307,8 +330,8 @@ export default {
dutyHolder: this.paramsData.dutyHolder,
category: this.paramsData.category,
status: this.paramsData.status,
startTime: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[0] : '',
endTime: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[1] : '',
startDate: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[0] : '',
endDate: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[1] : '',
}
postV2RecordList({
data: {
@ -337,6 +360,7 @@ export default {
.search-form {
.search-item {
margin-bottom: 16px;
.search-label {
width: 120px;
text-align: right;

0
src/views/dike/runManage/patrolMaintenance/acceptanceRecords/details.vue

59
src/views/dike/runManage/patrolMaintenance/acceptanceRecords/index.vue

@ -165,15 +165,32 @@
}}</span>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="巡查状态">
<el-table-column prop="status" align="center" label="巡查状态" width="100">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.detail.status || '', "maintenanceStatus")
}}</span>
<span style="position: relative"
:style="['3', '5', '6'].includes(scope.row.detail.status) && {color: 'rgba(0,0,0,0.4)'}">
<div
v-if="scope.row.detail.status === '1'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #FFB20D"
></div>
<div
v-if="scope.row.detail.status === '2'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #0EC885"
></div>
<div
v-if="scope.row.detail.status === '4'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #3A89FE"
></div>
<div
v-if="['3', '5', '6'].includes(scope.row.detail.status)"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #A6A6A6"
></div>
{{ getDictLabelName(scope.row.detail.status, "maintenanceStatus") }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="问题等级">
<el-table-column align="center" label="问题等级" width="120">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.detail.problemLevel || '', "maintenanceLevel")
@ -198,6 +215,7 @@
<el-button
type="text"
size="small"
v-hasPermi="['df:run:patrol:acceptance:list:item:check']"
@click="handleCheckDetails(scope.row, 'check')"
>查看</el-button
>
@ -205,6 +223,7 @@
type="text"
size="small"
:disabled="scope.row.detail.status === '5'"
v-hasPermi="['df:run:patrol:acceptance:list:item:edit']"
@click="handleCheckDetails(scope.row, 'edit')"
>编辑</el-button
>
@ -316,20 +335,22 @@ export default {
},
getTableData() {
const data = {
name: this.paramsData.name,
type: this.paramsData.type,
dutyHolder: this.paramsData.dutyHolder,
category: this.paramsData.category,
status: this.paramsData.status,
problemLevel: this.paramsData.problemLevel,
startTime:
this.paramsData.time && this.paramsData.time.length > 1
? this.paramsData.time[0]
: "",
endTime:
this.paramsData.time && this.paramsData.time.length > 1
? this.paramsData.time[1]
: "",
condition: {
status: this.paramsData.status,
name: this.paramsData.name,
type: this.paramsData.type,
dutyHolder: this.paramsData.dutyHolder,
category: this.paramsData.category,
problemLevel: this.paramsData.problemLevel,
startDate:
this.paramsData.time && this.paramsData.time.length > 1
? this.paramsData.time[0]
: "",
endDate:
this.paramsData.time && this.paramsData.time.length > 1
? this.paramsData.time[1]
: "",
}
};
postV2ApprovalList({
data: {

58
src/views/dike/runManage/patrolMaintenance/componentsDetails/acceptanceDetails.vue

@ -56,7 +56,7 @@
</el-row>
</div>
<div class="form-row-title">养护记录</div>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="top">
<el-form :model="form" :rules="rules" label-width="120px" label-position="top">
<el-row :gutter="48">
<el-col :span="8">
<el-form-item label="维养责任人:" prop="userName">
@ -123,7 +123,6 @@
<div style="display:flex;">
<el-button disabled size="small" style="margin-right: 10px;" type="text">上传</el-button>
<el-button
style="color: red"
type="text"
size="small"
disabled
@ -180,10 +179,16 @@
</el-form>
</div>
<div class="bottom-btns" v-if="$route.query.mode !== 'check'">
<el-button type="primary" @click="handleAccept(true)"
<el-button
type="primary"
@click="handleAccept(true)"
v-hasPermi="['df:run:patrol:acceptance:detail:passed']"
>通过</el-button
>
<el-button type="danger" @click="handleAccept(false)"
<el-button
type="danger"
@click="handleAccept(false)"
v-hasPermi="['df:run:patrol:acceptance:detail:rejected']"
>驳回</el-button
>
</div>
@ -244,6 +249,9 @@ export default {
inspectionCategory: [{required: true}],
time: [{required: true}],
describe: [{required: true}],
operator: [{required: true}],
approvalTime: [{required: true, message: "请选择复核时间", trigger: "change"}],
comment: [{required: true, message: "请输入复核意见", trigger: "change"}],
}
};
},
@ -322,23 +330,27 @@ export default {
);
},
handleAccept(type) {
const data = {
approvalTime: this.form.approvalTime,
comment: this.form.comment,
formId: this.$route.query.formId,
id: this.$route.query.id,
}
if (type) {
postV2ApprovalPassed(data, this.$route.query.id).then(res => {
this.$message.success('通过成功')
this.$router.go(-1)
})
} else {
postV2ApprovalRejected(data, this.$route.query.id).then(res => {
this.$message.success('驳回成功')
this.$router.go(-1)
})
}
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
approvalTime: this.form.approvalTime,
comment: this.form.comment,
formId: this.$route.query.formId,
id: this.$route.query.id,
}
if (type) {
postV2ApprovalPassed(data, this.$route.query.id).then(res => {
this.$message.success('通过成功')
this.$router.go(-1)
})
} else {
postV2ApprovalRejected(data, this.$route.query.id).then(res => {
this.$message.success('驳回成功')
this.$router.go(-1)
})
}
}
})
},
},
};
@ -378,4 +390,8 @@ export default {
}
}
.tc-text2,.tc-text1 {
line-height: 22px;
}
</style>

73
src/views/dike/runManage/patrolMaintenance/componentsDetails/defectDetails.vue

@ -62,9 +62,8 @@
import TopBackTitle from "@/components/TopBackTitle/index.vue";
import {calcTableHeight} from "@/mixins/calcTableHeight";
import SyMixMap from "@/views/components/SyMixMap.vue";
import {getV2Yh, postV2Yh, getV2ApprovalComment, gettV2Record, postV2ApprovalPassed, postV2ApprovalRejected} from "@/api/dike/patrolMaintenance";
import {gettV2Record} from "@/api/dike/patrolMaintenance";
import {getDictMapData} from "@/api/system/dict/data";
import {mapGetters} from "vuex";
export default {
components: {
@ -74,41 +73,21 @@ export default {
mixins: [calcTableHeight],
data() {
return {
entries: {},
traceList: [],
maintenanceCategory: [],
maintenanceLevel: [],
tableData: [{
nspectionLocation: '堤坡与戗台',
inspectionContent: '是否坚实平整',
}],
form: {
createName: '',
userName: '',
dikeName: '',
category: '',
parts: '',
partsName: '',
content: '',
describe: '',
position: '',
problemImages: '',
problemLevel: '',
createUid: '',
dikeCode: '',
dikeType: '',
type: '',
time: [],
scope: '',
startDate: '',
endDate: '',
},
rules: {
userName: [{required: true}],
projectName: [{required: true}],
dikeName: [{required: true}],
inspectionCategory: [{required: true}],
time: [{required: true}],
describe: [{required: true}],
}
};
},
created() {
@ -122,28 +101,13 @@ export default {
mounted() {
this.initData()
},
computed: {
...mapGetters({
userId: "uid",
userName: "name",
}),
},
methods: {
async initData() {
const checking = await gettV2Record(this.$route.query.recordId)
this.form.createName = checking.data.createName
this.form.userName = this.userName
this.form.userId = this.userId
this.form.dikeName = checking.data.dikeName
this.form.checkingId = checking.data.checkingId
this.form.checkingName = checking.data.checkingName
this.form.status = checking.data.status
this.form.problems = checking.data.problems
this.form.category = checking.data.category
this.form.createUid = checking.data.createUid
this.form.dikeCode = checking.data.dikeCode
this.form.dikeType = checking.data.dikeType
this.form.type = checking.data.type
this.form.startDate = checking.data.startDate
this.form.endDate = checking.data.endDate
checking.data.problems.forEach(item => {
@ -166,11 +130,6 @@ export default {
this.form.problemImages = item.problemImages
}
})
// if (this.$route.query.fromId) {
// const ApprovalComment = await getV2ApprovalComment(this.$route.query.fromId)
// } else {
// const ApprovalComment = await getV2ApprovalComment(0)
// }
},
getDictLabelName(type, dictListName) {
@ -179,29 +138,6 @@ export default {
this[dictListName].find((item) => item.dictValue === type)?.dictLabel ||
""
);
},
handleAccept() {
},
handleSave(commit) {
const data = {
checkingId: this.form.checkingId,
content: this.form.describe,
dutyHolderId: this.form.userId,
dutyHolderName: this.form.userName,
problemLevel: this.form.problemLevel,
problemId: this.$route.query.defectId,
recordId: this.$route.query.recordId,
startDate: this.form.time && this.form.time.length > 1 ? this.form.time[0] : '',
endDate: this.form.time && this.form.time.length > 1 ? this.form.time[1] : '',
}
if (this.$route.query.id) {
data.id = this.$route.query.id
}
postV2Yh(data, commit).then(res => {
this.$message.success('保存成功')
this.$router.go(-1)
})
}
},
};
@ -241,4 +177,7 @@ export default {
}
}
.tc-text2,.tc-text1 {
line-height: 22px;
}
</style>

112
src/views/dike/runManage/patrolMaintenance/componentsDetails/inspectionRecordDetails.vue

@ -81,6 +81,7 @@
:disabled="$route.query.mode === 'check'"
class="flex-shrink-0 myml-12"
type="success"
v-hasPermi="['df:run:patrol:inspection:detail:add']"
@click="addProblems"
>新增</el-button
>
@ -89,6 +90,7 @@
:disabled="$route.query.mode === 'check'"
class="flex-shrink-0"
@click="delProblems"
v-hasPermi="['df:run:patrol:inspection:detail:allDel']"
size="small"
>删除</el-button
>
@ -122,12 +124,11 @@
</el-select>
</template>
</el-table-column>
<el-table-column prop="problemLevel" label="问题等级">
<el-table-column prop="problemLevel" label="问题等级" width="180">
<template slot-scope="scope">
<el-select
clearable
size="small"
class="w-202 ml-10"
:disabled="$route.query.mode === 'check'"
v-model="scope.row.problemLevel"
filterable
@ -182,11 +183,28 @@
</div>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="维养状态">
<el-table-column prop="status" align="center" label="维养状态" width="100">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.status, "maintenanceStatus")
}}</span>
<span style="position: relative"
:style="['3', '5', '6'].includes(scope.row.status) && {color: 'rgba(0,0,0,0.4)'}">
<div
v-if="scope.row.status === '1'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #FFB20D"
></div>
<div
v-if="scope.row.status === '2'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #0EC885"
></div>
<div
v-if="scope.row.status === '4'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #3A89FE"
></div>
<div
v-if="['3', '5', '6'].includes(scope.row.status)"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #A6A6A6"
></div>
{{ getDictLabelName(scope.row.status, "maintenanceStatus") }}
</span>
</template>
</el-table-column>
<el-table-column
@ -219,6 +237,7 @@
size="small"
style="margin-right: 10px"
type="text"
v-hasPermi="['df:run:patrol:inspection:detail:item:upload']"
>上传图片</el-button
>
</el-upload>
@ -231,12 +250,12 @@
@confirm="deleteTableItem(scope.row)"
>
<el-button
style="color: red"
:style="$route.query.mode !== 'check' &&{color: 'red'}"
type="text"
size="small"
:disabled="$route.query.mode === 'check'"
slot="reference"
v-hasPermi="['df:run:checking:item:delete']"
v-hasPermi="['df:run:patrol:inspection:detail:item:del']"
>删除</el-button
>
</el-popconfirm>
@ -246,8 +265,20 @@
</el-table>
</div>
<div class="bottom-btns" v-if="$route.query.mode !== 'check'">
<el-button type="primary" @click="handleSave(true)">保存并提交</el-button>
<el-button type="primary" @click="handleSave(false)">保存</el-button>
<el-button
type="primary"
v-hasPermi="['df:run:patrol:inspection:detail:submit']"
@click="handleSave(true)"
>
保存并提交
</el-button>
<el-button
type="primary"
v-hasPermi="['df:run:patrol:inspection:detail:save']"
@click="handleSave(false)"
>
保存
</el-button>
<el-button @click="$router.go(-1)">返回</el-button>
</div>
</div>
@ -278,9 +309,9 @@ export default {
maintenanceLevel: [],
maintenanceCategory: [],
traceList: [],
problemsCheckData: [],
problemsData: [],
tableData: [],
problemsCheckData: [], //
problemsData: [], //
tableData: [], //
form: {
createName: "",
name: "",
@ -298,8 +329,8 @@ export default {
name: [{ required: true }],
dikeName: [{ required: true }],
category: [{ required: true }],
time: [{ required: true }],
scope: [{ required: true }],
time: [{ required: true, message: "请选择巡查时间", trigger: "change"}],
scope: [{ required: true, message: "请输入巡查方位", trigger: "change" }],
},
};
},
@ -415,7 +446,6 @@ export default {
delImage(img, problemImages) {
const index = problemImages.indexOf(img);
problemImages.splice(index, 1);
problemImages;
},
addProblems() {
this.problemsData.push({
@ -458,29 +488,33 @@ export default {
this.problemsData.splice(index, 1);
},
handleSave(commit) {
const data = {
category: this.form.category,
checkingId: this.$route.query.checkingId,
checkingName: this.form.name,
createName: this.form.createName,
createUid: this.form.createUid,
dikeName: this.form.dikeName,
dikeCode: this.form.dikeCode,
dikeType: this.form.dikeType,
scope: this.form.scope,
problems: this.problemsData,
startDate:
this.form.time && this.form.time.length > 1 ? this.form.time[0] : "",
endDate:
this.form.time && this.form.time.length > 1 ? this.form.time[1] : "",
type: this.form.type,
};
if (this.$route.query.id) {
data.id = this.$route.query.id;
}
postV2Record(data, commit).then((res) => {
this.$message.success("保存成功");
this.$router.go(-1);
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
category: this.form.category,
checkingId: this.$route.query.checkingId,
checkingName: this.form.name,
createName: this.form.createName,
createUid: this.form.createUid,
dikeName: this.form.dikeName,
dikeCode: this.form.dikeCode,
dikeType: this.form.dikeType,
scope: this.form.scope,
problems: this.problemsData,
startDate:
this.form.time && this.form.time.length > 1 ? this.form.time[0] : "",
endDate:
this.form.time && this.form.time.length > 1 ? this.form.time[1] : "",
type: this.form.type,
};
if (this.$route.query.id) {
data.id = this.$route.query.id;
}
postV2Record(data, commit).then((res) => {
this.$message.success("保存成功");
this.$router.go(-1);
});
}
});
},
},

108
src/views/dike/runManage/patrolMaintenance/componentsDetails/maintenanceDetails.vue

@ -104,12 +104,22 @@
<el-upload
class=""
action="#"
style="margin-bottom: 16px;"
:http-request="handleUploadProject1"
:before-upload="beforeUploadProject1"
:show-file-list="false"
accept=".png,.jpg,.jpeg"
accept=".png,.jpg,.tif,.gif"
>
<el-button :disabled="$route.query.mode === 'check'" size="small" style="margin-bottom: 16px;" type="primary">上传</el-button>
<div style="display:flex;">
<el-button
:disabled="$route.query.mode === 'check'"
style="margin-right: 16px;"
size="small"
type="primary"
v-hasPermi="['df:run:patrol:maintenance:detail:attachment']"
>上传</el-button>
<div slot="tip" style="margin-top: 0" class="el-upload__tip">文件上传支持.jpg.png.tif.gif 单张图片5M以内最多上传3张</div>
</div>
</el-upload>
<el-image
v-for="item in form.images"
@ -140,7 +150,13 @@
:show-file-list="false"
accept=".png,.jpg,.jpeg"
>
<el-button :disabled="$route.query.mode === 'check'" size="small" style="margin-right: 10px;" type="text">上传</el-button>
<el-button
:disabled="$route.query.mode === 'check'"
size="small"
style="margin-right: 10px;"
type="text"
v-hasPermi="['df:run:patrol:maintenance:detail:item:upload']"
>上传</el-button>
</el-upload>
<el-popconfirm
confirm-button-text="确定"
@ -151,12 +167,12 @@
@confirm="deleteTableItem(scope.row)"
>
<el-button
style="color: red"
:style="$route.query.mode !== 'check' &&{color: 'red'}"
type="text"
size="small"
:disabled="$route.query.mode === 'check'"
slot="reference"
v-hasPermi="['df:run:checking:item:delete']"
v-hasPermi="['df:run:patrol:maintenance:detail:item:del']"
>删除</el-button
>
</el-popconfirm>
@ -166,10 +182,16 @@
</el-table>
</div>
<div class="bottom-btns" v-if="$route.query.mode !== 'check'">
<el-button type="primary" @click="handleSave(true)"
<el-button
type="primary"
@click="handleSave(true)"
v-hasPermi="['df:run:patrol:maintenance:detail:submit']"
>保存并提交</el-button
>
<el-button type="primary" @click="handleSave(false)"
<el-button
type="primary"
@click="handleSave(false)"
v-hasPermi="['df:run:patrol:maintenance:detail:save']"
>保存</el-button
>
<el-button @click="$router.go(-1)">返回</el-button>
@ -236,8 +258,8 @@ export default {
projectName: [{required: true}],
dikeName: [{required: true}],
inspectionCategory: [{required: true}],
time: [{required: true}],
describe: [{required: true}],
time: [{required: true, message: "请选择巡查时间", trigger: "change"}],
describe: [{required: true, message: "输入巡查详情", trigger: "change"}],
}
};
},
@ -306,7 +328,6 @@ export default {
this.fileData = ApprovalComment.data.doc.docs
}
},
getDictLabelName(type, dictListName) {
if (!this[dictListName]) return "";
return (
@ -362,7 +383,7 @@ export default {
//
beforeUploadProject1(e, row) {
const { name, size } = e;
if (!/\.(jpg|png|jpeg)$/.test(name)) {
if (!/\.(jpg|png|tif|gif)$/.test(name)) {
this.$message.warning("文件格式不正确");
return false;
}
@ -379,35 +400,40 @@ export default {
row.url = ''
},
handleSave(commit) {
const data = {
name: this.form.checkingName,
dikeCode: this.form.dikeCode,
dikeType: this.form.dikeType,
dikeName: this.form.dikeName,
status: this.form.status,
type: this.form.type,
category: this.form.category,
checkingId: this.form.checkingId,
content: this.form.describe,
dutyHolderId: this.form.userId,
dutyHolderName: this.form.userName,
problemLevel: this.form.problemLevel,
problemId: this.$route.query.defectId,
recordId: this.$route.query.recordId,
doc: {
images: this.form.images,
docs: this.fileData,
},
startDate: this.form.time && this.form.time.length > 1 ? this.form.time[0] : '',
endDate: this.form.time && this.form.time.length > 1 ? this.form.time[1] : '',
}
if (this.$route.query.id) {
data.id = this.$route.query.id
}
postV2Yh(data, commit).then(res => {
this.$message.success('保存成功')
this.$router.go(-1)
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
name: this.form.checkingName,
dikeCode: this.form.dikeCode,
dikeType: this.form.dikeType,
dikeName: this.form.dikeName,
status: this.form.status,
type: this.form.type,
category: this.form.category,
checkingId: this.form.checkingId,
content: this.form.describe,
dutyHolderId: this.form.userId,
dutyHolderName: this.form.userName,
problemLevel: this.form.problemLevel,
problemId: this.$route.query.defectId,
recordId: this.$route.query.recordId,
doc: {
images: this.form.images,
docs: this.fileData,
},
startDate: this.form.time && this.form.time.length > 1 ? this.form.time[0] : '',
endDate: this.form.time && this.form.time.length > 1 ? this.form.time[1] : '',
}
if (this.$route.query.id) {
data.id = this.$route.query.id
}
postV2Yh(data, commit).then(res => {
this.$message.success('保存成功')
this.$router.go(-1)
})
}
})
}
},
};
@ -447,4 +473,8 @@ export default {
}
}
.tc-text2,.tc-text1 {
line-height: 22px;
}
</style>

0
src/views/dike/runManage/patrolMaintenance/defectList/details.vue

8
src/views/dike/runManage/patrolMaintenance/defectList/index.vue

@ -169,7 +169,7 @@
}}</span>
</template>
</el-table-column>
<el-table-column prop="level" align="center" label="问题等级">
<el-table-column prop="level" align="center" label="问题等级" width="120">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.problemLevel, "maintenanceLevel")
@ -202,12 +202,14 @@
<el-button
type="text"
size="small"
v-hasPermi="['df:run:patrol:defect:list:item:getInvoices']"
@click="handleReceiveDetails(scope.row)"
>领单</el-button
>
<el-button
type="text"
size="small"
v-hasPermi="['df:run:patrol:defect:list:item:check']"
@click="handleCheckDetails(scope.row)"
>查看</el-button
>
@ -333,8 +335,8 @@ export default {
category: this.paramsData.category,
status: this.paramsData.status,
problemLevel: this.paramsData.problemLevel,
startTime: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[0] : '',
endTime: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[1] : '',
startDate: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[0] : '',
endDate: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[1] : '',
}
postV2ProblemList({
data: {

0
src/views/dike/runManage/patrolMaintenance/maintenanceRecords/details.vue

33
src/views/dike/runManage/patrolMaintenance/maintenanceRecords/index.vue

@ -169,15 +169,32 @@
}}</span>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="巡查状态">
<el-table-column prop="status" align="center" label="巡查状态" width="100">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.status, "maintenanceStatus")
}}</span>
<span style="position: relative"
:style="['3', '5', '6'].includes(scope.row.status) && {color: 'rgba(0,0,0,0.4)'}">
<div
v-if="scope.row.status === '1'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #FFB20D"
></div>
<div
v-if="scope.row.status === '2'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #0EC885"
></div>
<div
v-if="scope.row.status === '4'"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #3A89FE"
></div>
<div
v-if="['3', '5', '6'].includes(scope.row.status)"
style="position: absolute;left: -16px;top: 6px;width: 8px;height: 8px;border-radius: 50%; background: #A6A6A6"
></div>
{{ getDictLabelName(scope.row.status, "maintenanceStatus") }}
</span>
</template>
</el-table-column>
<el-table-column prop="level" align="center" label="问题等级">
<el-table-column prop="level" align="center" label="问题等级" width="120">
<template slot-scope="scope">
<span>{{
getDictLabelName(scope.row.problemLevel, "maintenanceLevel")
@ -210,12 +227,14 @@
<el-button
type="text"
size="small"
v-hasPermi="['df:run:patrol:maintenance:list:item:check']"
@click="handleCheckDetails(scope.row, 'check')"
>查看</el-button
>
<el-button
type="text"
size="small"
v-hasPermi="['df:run:patrol:maintenance:list:item:edit']"
:disabled="scope.row.status !== '4'"
@click="handleCheckDetails(scope.row, 'edit')"
>编辑</el-button
@ -335,8 +354,8 @@ export default {
category: this.paramsData.category,
status: this.paramsData.status,
problemLevel: this.paramsData.problemLevel,
startTime: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[0] : '',
endTime: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[1] : '',
startDate: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[0] : '',
endDate: this.paramsData.time && this.paramsData.time.length > 1 ? this.paramsData.time[1] : '',
}
postV2YhList({
data: {

4
vue.config.js

@ -80,8 +80,8 @@ module.exports = {
changeOrigin: true,
},
[process.env.VUE_APP_BASE_API]: {
target: "http://shuili.product.dev.com:30115/",
// target: "http://172.16.34.80:18082/",
// target: "http://shuili.product.dev.com:30115/",
target: "http://172.16.34.80:18082/",
// target: 'http://172.16.32.62:18888/',
// target: "http://172.16.34.27:18082",
changeOrigin: true,

Loading…
Cancel
Save