| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <template>
- <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="100px">
- <el-form-item label="问题类别" style="text-align:left">
- <el-select v-model="problemForm.inspPblmName" placeholder="请选择">
- <el-option v-for="(item,index) in problemList" :key="index" :label="item.name" :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- <!--<el-form-item label="检查项目" style="text-align:left">-->
- <!--<el-input placeholder="请输入检查项目" v-model="problemForm.checkPoint" required></el-input>-->
- <!--</el-form-item>-->
- <el-form-item label="详细描述">
- <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
- </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('problemForm')" style="width: 100px;float:right"
- :loading="saveLoading">保存
- </el-button>
- </el-form-item>
- </el-form>
- </template>
- <script>
- import request from '@util/gw_ajax_request.js'
- import {submitUpload} from "@api/duChaAPI.js";
- export default {
- props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId', 'problData', 'rowData'],
- data() {
- return {
- problemForm: {
- checkPoint: '',
- t1: '',
- t2: '',
- t3: '',
- objId: "",
- regid: '',
- objType: "",
- // inspPblmName: "",
- inspPblmCate: "",
- inspPblmDesc: "",
- pblmStat: "",
- dataStat: "",
- nm: "",
- recPers: "",
- note: "",
- gwComFiles: [{
- id: "",
- filePath: "",
- bizId: ""
- }]
- },
- inspPblmCate: "",
- imgList: [],
- videoList: [],
- audioList: [],
- pblmStat: '',
- gwComFiles: [],
- problemList: [
- {
- name: '消防安全问题',
- value: '1'
- },
- {
- name: '疫情防控问题',
- value: '2'
- }
- ],
- currentCheckPointList: [],
- currentProblemDescList: [],
- t1: '',
- t2: '',
- t3: '',
- xiangqingmiaoshu: '',
- wenTiLeiBie: "",
- jianChaXiangMu: "",
- rules: {
- inspPblmDesc: [{
- required: true,
- message: '请输入描述',
- trigger: 'blur'
- },
- ],
- },
- saveLoading: false
- }
- },
- components: {
- upload: resolve => {
- require(["@widget/uploadFile.vue"], resolve);
- },
- },
- computed: {
- recPers() {
- return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
- }
- },
- created() {
- },
- methods: {
- onSubmit(problemForm) {
- this.$refs[problemForm].validate((valid) => {
- if (valid) {
- this.problemForm.recPers = this.recPers;
- this.problemForm.objId = this.objId;
- this.problemForm.regid = this.currentObjectRgstrId;
- this.problemForm.nm = this.objName;
- this.problemForm.objType = '74';
- this.problemForm.pblmStat = "0";
- this.problemForm['inspPblmsName'] = this.problemForm.inspPblmName;//检查项目
- this.problemForm['checkPoint'] = this.problemForm.checkPoint;//add by lch
- this.problemForm['inspPblmDesc'] = this.problemForm.inspPblmDesc;
- // this.problemForm['inspPlbmType'] = this.t2.sort;
- // this.problemForm['inspPblmCode'] = this.t3.sn;
- // this.problemForm['pblmsTypeId'] = this.t3.guid;
- // this.problemForm['reviConc'] = "0";
- if (!this.problemForm.inspPblmName) {
- this.$message.info('请选择问题类别');
- return
- }
- // if (!this.problemForm.checkPoint) {
- // this.$message.info('请选择检查项目');
- // return
- // }
- if (!this.problemForm.inspPblmDesc) {
- this.$message.info('请填写详细描述');
- return
- }
- if (!this.saveLoading) {
- this.saveLoading = true;
- 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();
- }
- }
- this.saveLoading = false;
- }).catch(err => {
- this.saveLoading = false;
- });
- }
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- // 文件上传
- 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();
- },
- },
- }
- </script>
- <style>
- .media_item {
- float: left;
- width: 60px;
- font-size: 32px;
- }
- /*.el-select--mini {*/
- /*width: 100%;*/
- /*}*/
- </style>
|