| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <el-form ref="form" :model="problemForm" label-width="150px" class="ysh_dialog">
- <el-form-item label="问题类别">
- <el-input v-model="problemForm.inspPblmName" readonly style="width:80%;"></el-input>
- </el-form-item>
- <el-form-item label="检查项目">
- <el-input v-model="problemForm.inspPblmsName" readonly style="width:80%;"></el-input>
- </el-form-item>
- <el-form-item label="问题描述">
- <el-input type="textarea" v-model="problemForm.inspPblmDesc" style="width:80%;"></el-input>
- </el-form-item>
- <el-form-item label="整改意见">
- <el-input type="textarea" v-model="problemForm.note" style="width:80%;"></el-input>
- </el-form-item>
- <el-form-item label="列为典型问题">
- <el-checkbox style="display: -webkit-box;margin-left: 10%;" v-model="checked"></el-checkbox>
- </el-form-item>
- <!-- <el-form-item label="严重程度" style="text-align:left">
- <el-radio v-model="problemForm.inspPblmCate" label="0" style="margin-left: 10%;">一般</el-radio>
- <el-radio v-model="problemForm.inspPblmCate" label="1">较重</el-radio>
- <el-radio v-model="problemForm.inspPblmCate" label="2">严重</el-radio>
- </el-form-item> -->
- <!-- <el-form-item label="经度">
- <el-input v-model="problemForm.longitude" autocomplete="off" style="width:80%;"></el-input>
- </el-form-item>
- <el-form-item label="纬度">
- <el-input v-model="problemForm.latitude" autocomplete="off" style="width:80%;"></el-input>
- </el-form-item> -->
- <el-form-item label="相关文件">
- <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
- </el-form-item>
- <el-form-item style="margin-top: 50px">
- <el-button type="primary" @click="onSubmit" style="width: 100px;float:right">保存</el-button>
- </el-form-item>
- </el-form>
- </template>
- <script>
- import request from '../../../../utils/gw_ajax_request.js'
- import { submitUpload } from "../../../../api/duChaAPI.js";
- export default {
- props: ['objId','objName','objType','villType','grwCode','problemMiddleType','problemSmallType','stationType','regId'],
- data(){
- return{
- checked:false,
- problemForm:{
- objId: "",
- objType: "",
- villType: "",
- inspPblmName: "",
- inspPblmsName: "",
- ifCasePblm: "",
- pblmsTypeId: "",
- inspPblmCate: "",
- inspPblmDesc: "",
- pblmStat: "",
- dataStat: "",
- nm: "",
- recPers: "",
- note: "",
- gwComFiles: [{
- id: "",
- filePath: "",
- bizId: ""
- }]
- },
- pblmsTypeId: '',
- smallTypeList: [],
- pblmId: '',
- imgList: [],
- videoList:[],
- audioList: [],
- pblmStat: '',
- gwComFiles: []
- }
- },
- computed:{
- recPers(){
- return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
- }
- },
- components: {
- upload: resolve => {
- require(["../../../../widgets/uploadFile.vue"], resolve);
- },
- },
- mounted(){
- this.getType()
- },
- methods:{
- getType(){
- let pguid
- if(this.stationType == 'autoStation'){
- pguid = '00000000000000000000000000000000'
- }else{
- pguid = '50000000000000000000000000000000'
- }
- request.get('/dc/insp/pblms/getPblmType',{params:{'type':5,'pguid':pguid}}).then(res=>{
- if(res.success){
- let _this = this
- res.data.forEach((ele)=>{
- if(ele.inspPblmsName.indexOf(_this.problemMiddleType) > -1){
- let guid = ele.guid
- this.problemForm.inspPblmName = ele.inspPblmsName
- request.get('/dc/insp/pblms/getPblmType',{params:{'type':5,'pguid':guid}}).then(res=>{
- if(res.success){
- this.smallTypeList = res.data
- this.smallTypeList.forEach(ele=>{
- if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
- _this.pblmsTypeId = ele.guid
- this.problemForm.inspPblmsName = ele.inspPblmsName
- }
- })
- }
- })
- }
- })
- }
- })
- },
- onSubmit(){
- this.problemForm.regid = this.regId
- this.problemForm.recPers = this.recPers
- this.problemForm.objId = this.objId
- this.problemForm.nm = this.objName
- this.problemForm.objType = this.objType
- this.problemForm.villType = this.villType
- this.problemForm.pblmsTypeId = this.pblmsTypeId
- this.problemForm.pblmStat = "0";
- this.problemForm.ifCasePblm = this.checked ? '1' : '0'
- if(!this.problemForm.inspPblmDesc){
- this.$message.warning('请填写问题描述')
- return
- }
- if(!this.problemForm.note){
- this.$message.warning('请填写整改意见')
- return
- }
- request.post('/dc/insp/pblm',this.problemForm).then(res=>{
- if (res.success) {
- this.pblmId = res.data.pblmId;
- this.gwComFiles = [];
- this.pblmStat = res.data.pblmStat;
- if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
- this.removeNewSupervision();
- }
- }
- })
- },
- // 文件上传
- submitUpload() {
- this.$refs.upload.submit();
- },
- updatefilelist(arg) {
- request.post('/dc/insp/pblm/update',{
- pblmId: this.pblmId,
- gwComFiles: arg,
- pblmStat: this.pblmStat
- }).then(res => {
- this.removeNewSupervision()
- });
- },
- removeNewSupervision(arg){
- if (arg) {
- console.log(arg);
- var args = this.gwComFiles.concat(arg);
- this.updatefilelist(args);
- }
- this.$message.success('保存成功')
- this.$emit('closeDialog')
- this.gwComFiles = [];
- this.$refs.uploadFile.init();
- }
- },
- watch:{
- pblmsTypeId(newVal,oldVal){
- this.smallTypeList.forEach(ele=>{
- if(this.pblmsTypeId == ele.guid){
- this.problemForm.inspPblmsName = ele.inspPblmsName
- }
- })
- }
- }
- }
- </script>
- <style>
- .media_item{
- float: left;
- width: 60px;
- font-size: 32px;
- }
- </style>
|