| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- <template>
- <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="80px">
- <el-form-item label="问题类别" style="text-align:left">
- <el-select v-model="t1" value-key="items" placeholder="请选择" @change="problemListChange">
- <el-option v-for="(item,index) in problemList" :key="index" :label="item.name" :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="检查项目" style=" text-align:left">
- <el-select v-model="t2" placeholder="请选择" value-key="items" @change="currentCheckPointListChange">
- <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.name" :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="问题描述" style=" text-align:left">
- <el-select v-model="t3" placeholder="请选择" value-key="pblmDesc" @change="currentProblemDescListChange" style="max-width: 500px">
- <el-option v-for="(item,index) in currentProblemDescList" :key="index" :label="item.pblmDesc" :value="item" :title="item.pblmDesc" style="max-width: 500px">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="详细描述" required="true">
- <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
- </el-input>
- </el-form-item>
- <el-form-item label="典型问题" label-width="80px" style="text-align:left">
- <el-radio v-model="problemForm.ifCasePblm" label="1">是</el-radio>
- <el-radio v-model="problemForm.ifCasePblm" label="0">否</el-radio>
- </el-form-item>
- <el-form-item label="原因分析" prop="pblmReason">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="problemForm.pblmReason">
- </el-input>
- </el-form-item>
- <el-form-item label="整改建议" prop="pblmSggtn">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="problemForm.pblmSggtn">
- </el-input>
- </el-form-item>
- <el-form-item label="备注">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="problemForm.note">
- </el-input>
- </el-form-item>
- <!-- <el-form-item label="详情" style=" text-align:left">-->
- <!-- <el-input disabled type="textarea" :rows="2" placeholder="" v-model="xiangqingmiaoshu">-->
- <!-- </el-input>-->
- <!-- </el-form-item>-->
- <!-- <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate">-->
- <!-- <p v-if="inspPblmCate == 0" >一般</p>-->
- <!-- <p v-if="inspPblmCate == 1" >较重</p>-->
- <!-- <p v-if="inspPblmCate == 2" >严重</p>-->
- <!-- <p v-if="inspPblmCate == 3" >特别严重</p>-->
- <!-- </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('problemForm')" style="width: 100px;float:right">保存</el-button>
- </el-form-item>
- </el-form>
- </template>
- <script>
- import request from '../../../utils/gw_ajax_request.js'
- import {
- submitUpload,getAqscssjygkProblemList
- } from "../../../api/duChaAPI.js";
- export default {
- props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId','problData','currentGroupId','newModelData'],
- data() {
- return {
- problemForm: {
- t1: '',
- t2: '',
- t3: '',
- inspPblmOrgName:"",
- pblmReason:"",
- pblmSggtn:"",
- villType: '',
- objId: "",
- regid: '',
- objType: "",
- // inspPblmName: "",
- inspPblmCate: "",
- inspPblmDesc: "",
- ifCasePblm: '0',
- pblmStat: "",
- dataStat: "",
- nm: "",
- recPers: "",
- note: "",
- gwComFiles: [{
- id: "",
- filePath: "",
- bizId: ""
- }]
- },
- inspPblmCate:"",
- inspPlamCatelist: ['一般', '较重', '严重','特别严重'],
- imgList: [],
- videoList: [],
- audioList: [],
- pblmStat: '',
- gwComFiles: [],
- problemList: [],
- currentCheckPointList: [],
- currentProblemDescList: [],
- t1: '',
- t2: '',
- t3: '',
- xiangqingmiaoshu: '',
- wenTiLeiBie:"",
- jianChaXiangMu:"",
- rules: {
- inspPblmDesc: [{
- required: true,
- message: '请输入描述',
- trigger: 'blur'
- },
- ],
- }
- }
- },
- components: {
- upload: resolve => {
- require(["../../../widgets/uploadFile.vue"], resolve);
- },
- },
- computed: {
- recPers() {
- return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
- }
- },
- created() {
- this.getproblemSmallType();
- },
- methods:{
- problemMiddleTypeChange() {
- this.middleTypeList.forEach((ele) => {
- // if(ele.)
- });
- },
- getproblemSmallType() {
- var _self = this;
- let result = [];
- request.get(`/dc/insp/pblms/getPblmsByQuesNum/${this.problData}/${this.objType}`).then(res=>{
- if (res.success) {
- this.problemList = res.data;
- this.problemList = res.data;
- this.t1 = this.problemList[0]
- this.currentCheckPointList = this.problemList[0].items
- this.t2 = this.currentCheckPointList[0]
- this.currentProblemDescList = this.problemList[0].items[0].items
- this.t3 = this.currentProblemDescList[0]
- // this.problemForm['pblmsTypeId'] = this.currentProblemDescList[0].guid;
- }
- })
- },
- getproblemMiddleType() {
- this.middleTypeList = [];
- request.get('/dc/insp/pblms/getPblmType', {
- params: {
- type: 94
- }
- }).then(res => {
- if (res.success) {
- console.log(res.data);
- res.data.forEach((ele) => {
- this.middleTypeList.push(ele);
- })
- }
- })
- },
- getYanZhongChengDu(){
- this.inspPblmCate = this.t3.inspPblmCate;
- },
- onSubmit(problemForm) {
- this.$refs[problemForm].validate((valid) => {
- if (valid) {
- this.problemForm.villType = this.objType;
- this.problemForm.recPers = this.recPers
- this.problemForm.objId = this.objId;
- this.problemForm.regid = this.currentObjectRgstrId;
- this.problemForm.nm = this.objName
- this.problemForm.objType = this.objType;
- this.problemForm.pblmStat = "0";
- this.problemForm['inspPblmName'] = this.t1.name;//问题类别
- this.problemForm['inspPblmsName'] = this.t2.name;//检查项目
- this.problemForm['inspPlbmType'] = this.t2.sort;
- // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
- this.problemForm['inspPblmCode'] = this.t3.sn;
- this.problemForm['pblmsTypeId'] = this.t3.guid;
- this.problemForm['inspGroupId'] = this.currentGroupId;
- this.problemForm.inspPblmCate = this.inspPblmCate;
- if (!this.problemForm.inspPblmName) {
- this.$message.info('请选择问题类别')
- return
- }
- if (!this.problemForm.inspPblmsName) {
- this.$message.info('请选择检查项目')
- return
- }
- if (!this.problemForm.inspPblmName) {
- this.$message.info('请选择发现问题')
- return
- }
- if (!this.problemForm.inspPblmDesc) {
- this.$message.info('请填写详细描述')
- 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();
- }
- }
- })
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- // onSubmit() {
- // this.problemForm.villType = '0';
- // this.problemForm.recPers = this.recPers
- // this.problemForm.objId = this.objId;
- // this.problemForm.regid = this.currentObjectRgstrId;
- // this.problemForm.nm = this.objName
- // this.problemForm.objType = '1';
- // this.problemForm.pblmStat = "0";
- // this.problemForm['inspPblmsName'] = this.t1.inspPblmsName;
- // this.problemForm['inspPblmName'] = this.t2.checkPointName;
- // this.problemForm['inspPlbmType'] = this.t2.sort2;
- // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
- // this.problemForm['inspPblmCode'] = this.t3.sn;
- // this.problemForm['pblmsTypeId'] = this.t3.guid;
- // if (!this.problemForm.inspPblmsName) {
- // this.$message.info('请选择问题类别')
- // return
- // }
- // if (!this.problemForm.inspPlbmType) {
- // this.$message.info('请选择检查项目')
- // return
- // }
- // if (!this.problemForm.inspPblmName) {
- // this.$message.info('请选择发现问题')
- // 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();
- },
- problemListChange: function (item) {
- this.currentCheckPointList = item.items;
- },
- currentCheckPointListChange: function (item) {
- this.currentProblemDescList = item.items;
- },
- currentProblemDescListChange: function (item) {
- console.log(item);
- },
- },
- watch: {
- 't1': {
- handler: function (val, oldVal) {
- // console.log("详情"+val.pblmDesc)
- this.wenTiLeiBie = val.name;
- this.getYanZhongChengDu()
- },
- deep: true
- },
- 't2': {
- handler: function (val, oldVal) {
- this.jianChaXiangMu = val.name;
- this.getYanZhongChengDu()
- },
- deep: true
- },
- 't3': {
- handler: function (val, oldVal) {
- this.xiangqingmiaoshu = val.pblmDesc;
- this.getYanZhongChengDu()
- },
- deep: true
- },
- },
- }
- </script>
- <style>
- .media_item {
- float: left;
- width: 60px;
- font-size: 32px;
- }
- /*.el-select--mini {*/
- /*width: 100%;*/
- /*}*/
- </style>
|