| | |
| | | <div style=""> |
| | | <Titlename title="发送隐患单"></Titlename> |
| | | <div class="whole-form"> |
| | | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm" |
| | | <el-form :model="ruleForm" ref="ruleForm" label-width="150px" class="demo-ruleForm" |
| | | style="margin: 0 14% 0 16%;"> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="date" |
| | | type="index" |
| | | label="步骤" |
| | | align="center" |
| | | width="60"> |
| | |
| | | width="260"> |
| | | <template slot-scope="scope"> |
| | | <span size="medium">{{ scope.row.content }}</span> |
| | | <a v-for="item in scope.row.realFileName" |
| | | :href="process.env.BASE_API+'/'+item"> |
| | | {{ item.split("fileName=")[1] }} |
| | | </a> |
| | | <span v-for="item in scope.row.realFileName"> |
| | | <el-link type="primary" @click="downloadFile(subFile(item))"> |
| | | {{subFile(item)}} |
| | | </el-link> |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="发送流程" prop="name"> |
| | | <el-input type="textarea" v-model="ruleForm.name" class="multiline" |
| | | :disabled="true"></el-input> |
| | | <el-form-item label="发送流程:" prop="name"> |
| | | <!-- <el-input type="textarea" v-model="ruleForm.name" class="multiline"--> |
| | | <!-- :disabled="true"></el-input>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="是否发送" prop="name"> |
| | | <el-radio-group v-model="ruleForm.ispass"> |
| | | <el-radio :label="0">通过</el-radio> |
| | | <el-radio :label="1">不通过</el-radio> |
| | | <el-form-item label="下一步:" prop="name"> |
| | | <span> 流程结束,不通过则返回隐患部门</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-form :model="sendDataForm" :rules="rules" ref="sendDataForm" label-width="150px" |
| | | class="demo-ruleForm" |
| | | style="margin: 0 14% 0 16%;"> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="是否发送" prop="ispass"> |
| | | <el-radio-group v-model="sendDataForm.ispass"> |
| | | <el-radio label="通过">通过</el-radio> |
| | | <el-radio label="不通过">不通过</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | v-if="ruleForm.safetyInspectionItemResult == 0"> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item label="复查时间" prop="reviewTime"> |
| | | <el-form-item label="复查时间" prop="CALLBACKTIME"> |
| | | <el-date-picker |
| | | v-model="ruleForm.CALLBACKTIME" |
| | | v-model="sendDataForm.CALLBACKTIME" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | style="width: 100%"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item label="复查人" prop="rechecker"> |
| | | <el-input v-model="ruleForm.CALLBACKPERSON" clearable></el-input> |
| | | <el-form-item label="复查人" prop="CALLBACKPERSON"> |
| | | <el-input v-model="sendDataForm.CALLBACKPERSON" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="复查结果" prop="reviewResults"> |
| | | <el-form-item label="复查结果" prop="CALLBACKRESULT"> |
| | | <el-input class="textarea2" type="textarea" clearable |
| | | v-model="ruleForm.CALLBACKRESULT"></el-input> |
| | | v-model="sendDataForm.CALLBACKRESULT"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="备注" prop="desc"> |
| | | <el-input class="textarea" type="textarea" v-model="ruleForm.dealContent"></el-input> |
| | | <el-form-item label="备注" prop="dealContent"> |
| | | <el-input class="textarea" type="textarea" |
| | | v-model="sendDataForm.dealContent"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | v-else="ruleForm.safetyInspectionItemResult == 1"> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item label="复查时间" prop="reviewTime"> |
| | | <el-form-item label="复查时间" prop="CALLBACKTIME"> |
| | | <el-date-picker |
| | | v-model="ruleForm.CALLBACKTIME" |
| | | v-model="sendDataForm.CALLBACKTIME" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | style="width: 100%"> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item label="复查人" prop="rechecker"> |
| | | <el-input v-model="ruleForm.CALLBACKPERSON" clearable></el-input> |
| | | <el-form-item label="复查人" prop="CALLBACKPERSON"> |
| | | <el-input v-model="sendDataForm.CALLBACKPERSON" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="复查结果" prop="reviewResults"> |
| | | <el-form-item label="复查结果" prop="CALLBACKRESULT"> |
| | | <el-input class="textarea2" type="textarea" |
| | | v-model="ruleForm.CALLBACKRESULT"></el-input> |
| | | v-model="sendDataForm.CALLBACKRESULT"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="备注" prop="desc1"> |
| | | <el-input class="textarea" type="textarea" v-model="ruleForm.dealContent"></el-input> |
| | | <el-form-item label="备注" prop="dealContent"> |
| | | <el-input class="textarea" type="textarea" |
| | | v-model="sendDataForm.dealContent"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item style="text-align: center;"> |
| | | <el-button class="btn" size="small" type="primary" @click="submitForm('ruleForm')">保存 |
| | | <el-button class="btn" size="small" type="primary" @click="submitForm('sendDataForm')"> |
| | | 保存 |
| | | </el-button> |
| | | <el-button size="small" @click="close()">关闭</el-button> |
| | | </el-form-item> |
| | |
| | | <script> |
| | | import Titlename from "../../components/Titlename/index.vue"; |
| | | import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber"; |
| | | import {downloadFile} from "@/api/sgyhpczl/fileUtils"; |
| | | |
| | | export default { |
| | | components: {Titlename}, |
| | |
| | | CALLBACKRESULT: "", |
| | | dealContent: "", |
| | | }, |
| | | sendDataForm: { |
| | | id: "", |
| | | step: "3", |
| | | ispass: "通过", |
| | | CALLBACKTIME: "", |
| | | CALLBACKPERSON: "", |
| | | CALLBACKRESULT: "", |
| | | dealContent: "", |
| | | }, |
| | | rules: { |
| | | CALLBACKTIME: {required: true, message: '请填写复查时间', trigger: 'blur'}, |
| | | CALLBACKPERSON: {required: true, message: '请填写复查人', trigger: 'blur'}, |
| | | CALLBACKRESULT: {required: true, message: '请填写复查结果', trigger: 'blur'}, |
| | | dealContent: {required: true, message: '复查不通过时请在备注说明原因!', trigger: 'blur'}, |
| | | }, |
| | | tableData: [], |
| | | fileList: [], |
| | |
| | | }; |
| | | }, |
| | | mounted() { |
| | | console.log(process.env.BASE_API) |
| | | this.getDangerDetails(); |
| | | this.getWfRecordList(); |
| | | }, |
| | |
| | | var data = res.data; |
| | | if (data.ok) { |
| | | this.ruleForm = data.data; |
| | | console.log(this.ruleForm); |
| | | this.ruleForm.url = process.env.BASE_API; |
| | | this.sendDataForm.id = this.ruleForm.id |
| | | } else { |
| | | this.$message({type: 'error', message: "数据查询失败,请重试!", duration: 3000}) |
| | | } |
| | |
| | | }) |
| | | }, |
| | | submitForm(formName) { |
| | | console.log(this.ruleForm); |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | sendDangerNext(this.ruleForm).then(res => { |
| | | |
| | | sendDangerNext(this.sendDataForm).then(res => { |
| | | var msg = res.data.msg; |
| | | if (res.data.ok) { |
| | | this.$router.push({ |
| | | path:"/recheckCancellationNumber", |
| | | }) |
| | | this.$message({type: 'success', message: msg, duration: 3000}) |
| | | } else { |
| | | this.$message({type: 'error', message: msg, duration: 3000}) |
| | | } |
| | | }) |
| | | // alert('submit!'); |
| | | } else { |
| | |
| | | this.$router.push({ |
| | | path: "/recheckCancellationNumber" |
| | | }) |
| | | } |
| | | }, |
| | | subFile(fileName){ |
| | | return fileName.substring(fileName.indexOf("fileName=")+9) |
| | | }, |
| | | downloadFile(path){ |
| | | let params = { |
| | | type: 0, |
| | | fileName: path, |
| | | }; |
| | | downloadFile(params).then((res) => { |
| | | if(res.data.type=='text/json'){ |
| | | const reader = new FileReader(); |
| | | reader.readAsText(res.data, 'utf-8'); |
| | | reader.onload = e => { |
| | | this.$message({ |
| | | type: "error", |
| | | message: JSON.parse(reader.result).msg, |
| | | duration: 3000, |
| | | }); |
| | | } |
| | | } else { |
| | | let blob = new Blob([res.data], {type: 'application/octet-stream'}) |
| | | console.log(blob) |
| | | let blobUrl = window.URL.createObjectURL(blob) |
| | | let downloadElement = document.createElement('a') |
| | | downloadElement.href = blobUrl |
| | | downloadElement.download = path |
| | | document.body.appendChild(downloadElement) |
| | | downloadElement.click() |
| | | document.body.removeChild(downloadElement) |
| | | window.URL.revokeObjectURL(blobUrl) |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |