| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <template>
- <el-form ref="form" :model="problemForm" label-width="80px">
- <el-form-item label="问题类别">
- <el-input v-model="problemForm.inspPblmName" :disabled="true"></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"
- :title="item.inspPblmsName"
- :value="item.guid"
- 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, getRygcPlm } from "../../../api/duChaAPI.js";
- export default {
- props: [
- "objId",
- "objName",
- "objType",
- "villType",
- "problemMiddleType",
- "problemSmallType",
- "cwsCode"
- ],
- data() {
- return {
- problemForm: {
- objId: "",
- objType: "",
- villType: "",
- villCode: "",
- inspPblmName: "",
- inspPblmsName: "",
- pblmsTypeId: "",
- inspPblmCate: "",
- inspPblmDesc: "",
- pblmStat: "",
- dataStat: "",
- nm: "",
- recPers: "",
- note: "",
- gwComFiles: [
- {
- id: "",
- filePath: "",
- bizId: ""
- }
- ]
- },
- pblmsTypeId: "",
- smallTypeList: [
- // "间断供水问题",
- // "净化设施设备问题",
- // // "消毒设备",
- // "水质报告存在问题",
- // "千顿万人水厂水质化验室问题",
- // "取水许可证问题",
- // "卫生许可证问题",
- // "自动化控制系统问题",
- // "视频安防视频问题",
- // "水费水价问题"
- ],
- pblmId: "",
- imgList: [],
- videoList: [],
- audioList: [],
- pblmStat: "",
- gwComFiles: [],
- arr1: []
- };
- },
- computed: {
- recPers() {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "";
- }
- },
- components: {
- upload: resolve => {
- require(["../../../widgets/uploadFile.vue"], resolve);
- }
- },
- watch: {
- pblmsTypeId(n, o) {
- this.smallTypeList.forEach(ele => {
- if (this.pblmsTypeId == ele.guid) {
- this.problemForm.inspPblmsName = ele.inspPblmsName;
- }
- });
- }
- },
- mounted() {
- this.getType();
- this.problemForm.inspPblmsName = this.problemSmallType
- ? this.problemSmallType
- : this.smallTypeList[0].inspPblmsName;
- 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 == "人饮工程" || ele.inspPblmsName == '供水工程' || ele.inspPblmsName == '农饮工程' || 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
- }
- })
- }
- });
- }
- });
- }
- });
- // request
- // .get("/dc/insp/pblms/getPblmType", { params: { type: 2,pguid:"10000000000000000000000000000133"} })
- // .then(res => {
- // if (res.success) {
- // this.smallTypeList = res.data;
- // }
- // });
- },
- 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.cwsCode = this.cwsCode;
- 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();
- }
- }
- };
- </script>
- <style>
- .media_item {
- float: left;
- width: 60px;
- font-size: 32px;
- }
- </style>
|