From 8f03059619b5a5e9574b71d2ada27b76db2ffd7a Mon Sep 17 00:00:00 2001 From: Admin <978517621@qq.com> Date: 星期五, 18 十一月 2022 16:48:28 +0800 Subject: [PATCH] 新增 --- src/views/selfCheck/components/repair.vue | 152 ++++++++++++++++++++++---------------------------- 1 files changed, 66 insertions(+), 86 deletions(-) diff --git a/src/views/selfCheck/components/repair.vue b/src/views/selfCheck/components/repair.vue index deafa3f..8f1e622 100644 --- a/src/views/selfCheck/components/repair.vue +++ b/src/views/selfCheck/components/repair.vue @@ -19,64 +19,26 @@ > <el-table-column type="index" label="序号" align="center" width="80"/> - - <el-table-column label="检查出的隐患问题" prop="info" align="center" width="180"> + <el-table-column label="检查出的隐患问题" prop="hiddendangerRemark" align="center" width="180"></el-table-column> + <el-table-column label="检查时间" prop="checkTime" align="center"></el-table-column> + <el-table-column label="最后整改期限" prop="rectifyDeadlineTime" align="center"></el-table-column> + <el-table-column label="整改资金(元)" prop="rectifyPrice" align="center"></el-table-column> + <el-table-column label="整改措施" prop="rectifyMeasure" width="130" align="center" sortable></el-table-column> + <el-table-column label="负责人" prop="chargePerson" align="center"></el-table-column> + <el-table-column label="整改状态" prop="rectifyStatus" align="center"> <template slot-scope="scope"> - <span>{{ scope.row.info }}</span> + <span>{{ scope.row.rectifyStatus ==0?'未整改':'已整改' }}</span> </template> </el-table-column> - - <el-table-column label="检查时间" prop="checkTime" align="center"> + <el-table-column label="完成整改时间" prop="completeRectifyTime " align="center"></el-table-column> + <el-table-column label="隐患等级" prop="hiddendangerLevel" align="center"> <template slot-scope="scope"> - <span>{{scope.row.checkTime}}</span> + <span>{{ scope.row.hiddendangerLevel==1 ? '一般隐患' : '重大隐患' }}</span> </template> </el-table-column> - - <el-table-column label="最后整改期限" prop="deadline" align="center"> - <template slot-scope="scope"> - <span>{{ scope.row.deadline }}</span> - </template> - </el-table-column> - - <el-table-column label="整改资金(元)" prop="money" align="center"> - <template slot-scope="scope"> - <span>{{ scope.row.money }}</span> - </template> - </el-table-column> - - <el-table-column label="整改措施" prop="action" width="130" align="center" sortable> - <template slot-scope="scope"> - <span>{{ scope.row.action }}</span> - </template> - </el-table-column> - - <el-table-column label="负责人" prop="principal" align="center"> - <template slot-scope="scope"> - <span>{{ scope.row.principal }}</span> - </template> - </el-table-column> - - <el-table-column label="整改状态" prop="fixStatus" align="center"> - <template slot-scope="scope"> - <span>{{ scope.row.fixStatus ==0?'未整改':'已整改' }}</span> - </template> - </el-table-column> - - <el-table-column label="完成整改时间" prop="finishTime" align="center"> - <template slot-scope="scope"> - <span>{{ scope.row.finishTime }}</span> - </template> - </el-table-column> - - <el-table-column label="隐患等级" prop="level" align="center"> - <template slot-scope="scope"> - <span>{{ scope.row.level==0 ? '一般隐患' : '重大隐患' }}</span> - </template> - </el-table-column> - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> - <el-button v-if="scope.row.fixStatus==0" type="text" @click="toFix(scope.row)">整改填报</el-button> + <el-button v-if="scope.row.rectifyStatus==0" type="text" @click="toFix(scope.row)">整改填报</el-button> <el-button v-else type="text">--</el-button> </template> </el-table-column> @@ -114,19 +76,19 @@ <el-form-item label="当前完成整改日期:"> <el-date-picker - v-model="fixForm.finishDate" + v-model="fixForm.completeRectifyTime" type="date" placeholder="请选择整改日期"> </el-date-picker> </el-form-item> <el-form-item label="整改资金:"> - <el-input v-model="fixForm.money"></el-input> + <el-input v-model="fixForm.rectifyPrice"></el-input> </el-form-item> <el-form-item label="整改措施:"> - <el-input type="textarea" autosize v-model="fixForm.actions"></el-input> + <el-input type="textarea" autosize v-model="fixForm.rectifyMeasure"></el-input> </el-form-item> <el-form-item label="负责人:"> - <el-input v-model="fixForm.name"></el-input> + <el-input v-model="fixForm.chargePerson"></el-input> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> @@ -140,11 +102,13 @@ <script> import {computePageCount} from "@/utils"; + import { getSelfRectifyInfo, saveSelfRectifyInfo } from "@/api/selfCheck"; export default { name: "repair", data(){ return{ + id: null, listLoading: false, dialogFix: false, recordTotal: 0, @@ -153,38 +117,20 @@ currentPage: 1, tableKey: 0, dialogVisible:false, - checkList:[ - { - info: '虫吃鼠咬', - checkTime: '2022-10-31', - deadline: '2022-11-01', - money: '30', - action: '补充灭虫药', - principal: '叼毛', - fixStatus: 1, - finishTime: '2022-11-01', - level: 1 - }, - { - info: '虫吃鼠咬', - checkTime: '2022-10-31', - deadline: '2022-11-01', - money: '3000', - action: '补充灭虫药', - principal: '叼毛', - fixStatus: 0, - finishTime: '2022-11-01', - level: 0 - } - ], + checkList:[], fixForm:{ + id: null, + enterpriseSubmitId: null, info: '', - finishDate: '', - money: '', - actions: '', - name: '' + completeRectifyTime: '', + rectifyPrice: 0, + rectifyMeasure: '', + chargePerson: '' } } + }, + created() { + this.getSelfRectifyInfo() }, watch: { }, @@ -199,17 +145,51 @@ // this.getDataList() }, + async getSelfRectifyInfo(){ + const t = this + t.listLoading = true + let res = await getSelfRectifyInfo(t.id) + if(res.data.code === "200"){ + t.checkList = res.data.result.hiddendangerBaseInfos + }else{ + t.$message({ + type:'warning', + message:res.data.message + }) + } + t.listLoading = false + }, confirm(){ this.dialogVisible = false }, - confirmFix(){ - this.dialogFix = false + toFix(row){ + const t= this + t.fixForm.info = row.hiddendangerRemark + t.fixForm.id = row.id + t.dialogFix = true }, - toFix(){ - this.dialogFix = true + async confirmFix(){ + const t = this + t.listLoading = true + t.fixForm.enterpriseSubmitId = t.id + let {info,...data} = t.fixForm + let res = await saveSelfRectifyInfo(data) + if(res.data.code === "200"){ + t.$message({ + type:'success', + message:res.data.message + }) + }else{ + t.$message({ + type:'warning', + message:res.data.message + }) + } + t.listLoading = false + t.dialogFix = false } }, } -- Gitblit v1.9.2