| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <template>
- <el-form ref="form" :model="problemForm" label-width="80px" class="ysh_dialog">
- <el-form-item label="问题类别" style=" text-align:left">
- <el-input v-model="problemForm.inspPblmName" disabled></el-input>
- </el-form-item>
- <!-- <el-form-item label="严重程度" style=" text-align:left">
- <el-radio v-model="problemForm.inspPblmCate" label="0">一般</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="典型问题" 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="发现问题" style=" text-align:left">
- <el-select v-model="pblmsTypeId" placeholder="三项制度问题" disabled style="max-width: 500px;">
- <el-option
- v-for="item in smallTypeList"
- :key="item.guid"
- :label="item.inspPblmsName"
- :value="item.guid"
- :title="item.inspPblmsName"
- style="max-width: 500px">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="问题描述">
- <el-input type="textarea" v-model="problemForm.inspPblmDesc"></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','villCode','problemMiddleType','problemSmallType'],
- data(){
- return{
- problemForm:{
- objId: "",
- objType: "",
- villType: "",
- villCode: "",
- inspPblmName: "",
- inspPblmsName: "",
- pblmsTypeId: "",
- inspPblmCate: "",
- inspPblmDesc: "",
- pblmStat: "",
- dataStat: "",
- nm: "",
- recPers: "",
- note: "",
- ifCasePblm:"0",
- gwComFiles: [{
- id: "",
- filePath: "",
- bizId: ""
- }]
- },
- pblmsTypeId: '',
- smallTypeList: [{
- guid:'1',
- inspPblmsName:'三项制度问题',
- }],
- 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()
- this.problemForm.inspPblmsName = this.problemSmallType
- this.problemForm.inspPblmName = this.problemMiddleType
- },
- methods:{
- getType(){
- request.get('/dc/insp/pblms/getPblmType',{params:{type:2}}).then(res=>{
- if(res.success){
- let _this = this
- res.data.forEach((ele)=>{
- if(ele.inspPblmsName == '行政村'){
- let pguid = ele.guid
- request.get('/dc/insp/pblms/getPblmType',{params:{'type':2,'pguid':pguid}}).then(res=>{
- if(res.success){
- this.smallTypeList = res.data
- this.smallTypeList.forEach(ele=>{
- if(ele.inspPblmsName.indexOf(_this.problemSmallType) > -1){
- _this.pblmsTypeId = ele.guid
- }
- })
- }
- })
- }
- })
- }
- })
- },
- onSubmit(){
- 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.villCode = this.villCode
- this.problemForm.pblmsTypeId = this.pblmsTypeId
- this.problemForm.pblmStat = "0";
- 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>
|