| | |
| | | <div> |
| | | <Titlename title="填写督查"></Titlename> |
| | | <div class="whole-form"> |
| | | <el-form :model="config" ref="configTableForm"> |
| | | <el-form ref="configTableForm"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | |
| | | width="100"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="hiddenDanger" |
| | | prop="ht_branch" |
| | | label="隐患单位" |
| | | align="center" |
| | | width="100"> |
| | |
| | | prop="check_date" |
| | | label="检查时间" |
| | | align="center" |
| | | :formatter="formatDate" |
| | | width="100"> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | prop="alter_time" |
| | | label="限改时间" |
| | | align="center" |
| | | :formatter="formatDate" |
| | | width="120"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="ACCOMPLISHTIME" |
| | | align="center" |
| | | label="完成时间" |
| | | :formatter="formatDate" |
| | | width="100"> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | prop="CALLBACKTIME" |
| | | align="center" |
| | | width="100" |
| | | :formatter="formatDate" |
| | | label="复查时间"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="inspectionClass" |
| | | label="督察单位" |
| | | disabled="" |
| | | align="center" |
| | | width="160"> |
| | | <div class="item" slot-scope="scope"> |
| | | <el-input class="item__input" v-model="scope.row.inspectionClass" placeholder="请输入内容" clearable></el-input> |
| | | <el-input class="item__input" v-model="scope.row.inspectionClass" disabled placeholder="请输入内容" clearable></el-input> |
| | | <div class="item__txt">{{scope.row.inspectionClass}}</div> |
| | | </div> |
| | | </el-table-column> |
| | |
| | | class="btns" |
| | | size="small" |
| | | type="primary" |
| | | @click="submitConfig('config')">保存</el-button> |
| | | @click="submitConfig()">保存</el-button> |
| | | <el-button size="small" |
| | | @click="close()">关闭</el-button> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import Titlename from "../../components/Titlename/index.vue"; |
| | | import {getUserInfo,self_edit_do} from "@/api/sgyhpczl/hiddenDangerManagement"; |
| | | |
| | | export default { |
| | | components: {Titlename}, |
| | | name: "fillInspector", |
| | | data() { |
| | | return { |
| | | department:"", |
| | | // 表格数据 |
| | | tableData: [], |
| | | // 需要编辑的属性 |
| | |
| | | }; |
| | | }, |
| | | mounted(){ |
| | | console.log(this.$store) |
| | | this.tableData = this.$route.query.checkData; |
| | | getUserInfo().then(res=>{ |
| | | if(res.data.code == 200){ |
| | | this.tableData.forEach(n=>{ |
| | | n.inspectionClass = res.data.result.department; |
| | | n.inspectionTime = new Date().toLocaleDateString().replaceAll("/","-") |
| | | }) |
| | | }else{ |
| | | this.$message({type:'error', message:"用户信息获取失败!请重试", duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | computed: { |
| | | foodLabel () { |
| | |
| | | // cell.querySelector('.item__txt').style.display = 'block' |
| | | } |
| | | }, |
| | | submitConfig(){ |
| | | console.log(this.tableData) |
| | | var requestData = []; |
| | | this.tableData.forEach(n=>{ |
| | | if(n.inspectionResult == null ||n.inspectionResult == "" |
| | | ||n.inspectionMan == null ||n.inspectionMan == "" ){ |
| | | this.$message({type: 'Warn', message: "请填写完整信息", duration: 3000}) |
| | | return; |
| | | } |
| | | var data= { |
| | | "type": 2, |
| | | "id": n.id, |
| | | "inspectionResult": n.inspectionResult, |
| | | "inspectionMan": n.inspectionMan, |
| | | "inspectionTime": n.inspectionTime, |
| | | "inspectionClass": n.inspectionClass |
| | | } |
| | | requestData.push(data); |
| | | }) |
| | | |
| | | var successFlag = 0; |
| | | for (let i = 0; i < requestData.length; i++) { |
| | | self_edit_do(requestData[i]).then(res=>{ |
| | | if(res.data.ok){ |
| | | successFlag ++; |
| | | if(successFlag== requestData.length){ |
| | | this.$message({type: 'success', message: "操作成功!", duration: 3000}) |
| | | this.$router.push({ |
| | | path:"/hiddenDangerManagement" |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | formatDate(row, column) { |
| | | // 获取单元格数据 |
| | | let data = row[column.property] |
| | | if(data == null) { |
| | | return null |
| | | } |
| | | let dt = new Date(data) |
| | | return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() |
| | | }, |
| | | close(){ |
| | | this.$router.push({ |
| | | path:"/hiddenDangerManagement" |