7afdc14e2d7371cc67db2cf7564d2b3d757d800f.svn-base 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="80px">
  3. <el-form-item label="问题类别" style="text-align:left">
  4. <el-select v-model="t1" value-key="items" placeholder="请选择" @change="problemListChange">
  5. <el-option v-for="(item,index) in problemList" :key="index" :label="item.name" :value="item">
  6. </el-option>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item label="检查项目" style="text-align:left">
  10. <el-select v-model="t2" placeholder="请选择" value-key="items" @change="currentCheckPointListChange">
  11. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.name" :value="item">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="问题描述" style=" text-align:left">
  16. <el-select v-model="t3" placeholder="请选择" value-key="pblmDesc" @change="currentProblemDescListChange" style="max-width: 500px">
  17. <el-option v-for="(item,index) in currentProblemDescList" :key="index" :label="item.pblmDesc" :value="item" :title="item.pblmDesc" style="max-width: 500px">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="详情" style=" text-align:left">
  22. <span style="font-size: 12px;color:#5bb7e7">{{t3.pblmDesc}}</span>
  23. </el-form-item>
  24. <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate">
  25. <p v-if="t3.inspPblmCate == 0" >一般</p>
  26. <p v-if="t3.inspPblmCate == 1" >较重</p>
  27. <p v-if="t3.inspPblmCate == 2" >严重</p>
  28. <p v-if="t3.inspPblmCate == 3" >特别严重</p>
  29. </el-form-item>
  30. <el-form-item label="典型问题" label-width="80px" style="text-align:left">
  31. <el-radio v-model="problemForm.ifCasePblm" label="1">是</el-radio>
  32. <el-radio v-model="problemForm.ifCasePblm" label="0">否</el-radio>
  33. </el-form-item>
  34. <el-form-item label="详细描述" required>
  35. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc">
  36. </el-input>
  37. </el-form-item>
  38. <el-form-item label="备注">
  39. <el-input
  40. type="textarea"
  41. :rows="2"
  42. placeholder="请输入内容"
  43. v-model="problemForm.note">
  44. </el-input>
  45. </el-form-item>
  46. <el-form-item label="上传照片">
  47. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  48. </el-form-item>
  49. <el-form-item style="margin-top: 50px">
  50. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
  51. </el-form-item>
  52. </el-form>
  53. </template>
  54. <script>
  55. import request from '@util/gw_ajax_request.js'
  56. import {
  57. submitUpload
  58. } from "@api/duChaAPI.js";
  59. export default {
  60. props: ['objId', 'objName', 'villType', 'objType', 'currentObjectRgstrId', 'problData', 'rowData', 'yshRowData', 'gsgcRowData', 'oriFatherName', 'villageNm'],
  61. data() {
  62. return {
  63. problemForm: {
  64. t1: '',
  65. t2: '',
  66. t3: '',
  67. villType: '',
  68. objId: "",
  69. regid: '',
  70. objType: "",
  71. // inspPblmName: "",
  72. inspPblmCate: "",
  73. inspPblmDesc: "",
  74. note: "",
  75. ifCasePblm: '0',
  76. cwsCode: '',
  77. pblmStat: "",
  78. dataStat: "",
  79. nm: "",
  80. recPers: "",
  81. newVillName: '', //督查对象名称
  82. inspAddDesc: '', //行政区划
  83. gwComFiles: []
  84. },
  85. inspPblmCate: "",
  86. inspPlamCatelist: ['一般', '较重', '严重'],
  87. imgList: [],
  88. videoList: [],
  89. audioList: [],
  90. pblmStat: '',
  91. gwComFiles: [],
  92. problemList: [],
  93. currentCheckPointList: [],
  94. currentProblemDescList: [],
  95. t1: '',
  96. t2: '',
  97. t3: '',
  98. xiangqingmiaoshu: '',
  99. wenTiLeiBie: "",
  100. jianChaXiangMu: "",
  101. rules: {
  102. inspPblmDesc: [{
  103. required: true,
  104. message: '请输入描述',
  105. trigger: 'blur'
  106. },
  107. ],
  108. }
  109. }
  110. },
  111. components: {
  112. upload: resolve => {
  113. require(["@widget/uploadFile.vue"], resolve);
  114. },
  115. },
  116. computed: {
  117. recPers() {
  118. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  119. }
  120. },
  121. created() {
  122. // this.getproblemSmallType();
  123. console.log(this.rowData);
  124. this.getPblmsByQuesNum();
  125. },
  126. methods: {
  127. getproblemMiddleType() {
  128. this.middleTypeList = [];
  129. request.get('/dc/insp/pblms/getPblmType', {
  130. params: {
  131. type: 108
  132. }
  133. }).then(res => {
  134. if (res.success) {
  135. console.log(res.data);
  136. res.data.forEach((ele) => {
  137. this.middleTypeList.push(ele);
  138. })
  139. }
  140. })
  141. },
  142. getYanZhongChengDu() {
  143. this.inspPblmCate = this.t3.inspPblmCate;
  144. },
  145. onSubmit(problemForm) {
  146. this.$refs[problemForm].validate((valid) => {
  147. if (valid) {
  148. let _self = this;
  149. if(_self.yshRowData)if(_self.yshRowData.id) this.problemForm["waterUserId"] = _self.yshRowData.id;
  150. if(_self.gsgcRowData)if(_self.gsgcRowData.id) this.problemForm["cwsCode"] = _self.gsgcRowData.id;
  151. this.problemForm.recPers = this.recPers
  152. this.problemForm.objId = this.objId;
  153. this.problemForm.regid = this.rowData.regstrId;
  154. this.problemForm.nm = this.objName
  155. this.problemForm.objType = '108';
  156. this.problemForm.villType = '1';
  157. let userNm = '' //用水户名称
  158. let projectNm = '' //饮水工程名称
  159. // let userNm = this.yshRowData.userNm //用水户名称
  160. // let projectNm = this.gsgcRowData.projectNm //饮水工程名称
  161. this.problemForm.newVillName = userNm ? userNm : projectNm ? projectNm : this.objName
  162. this.problemForm.inspAddDesc = (userNm || projectNm) ? `${this.rowData.adFullName}-${this.oriFatherName}-${this.villageNm}` : this.rowData.adFullName
  163. this.problemForm['inspPblmName'] = this.t1.name;
  164. this.problemForm['inspPblmDesc'] = this.problemForm.inspPblmDesc;
  165. this.problemForm['inspPblmCode'] = this.t3.sn;
  166. this.problemForm['pblmsTypeId'] = this.t3.guid;
  167. if (!this.problemForm.inspPblmName) {
  168. this.$message.info('请选择问题类别')
  169. return
  170. }
  171. if (!this.problemForm.inspPblmDesc) {
  172. this.$message.info('请输入问题描述')
  173. return
  174. }
  175. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  176. if (res.success) {
  177. this.pblmId = res.data.pblmId;
  178. this.gwComFiles = [];
  179. this.pblmStat = res.data.pblmStat;
  180. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  181. this.removeNewSupervision();
  182. }
  183. }
  184. })
  185. } else {
  186. console.log('error submit!!');
  187. return false;
  188. }
  189. });
  190. },
  191. getPblmsByQuesNum() {
  192. var _self = this;
  193. request.get(`/dc/insp/pblms/getPblmsByQuesNum/${_self.problData}/108`).then(res => {
  194. if (res.success) {
  195. _self.problemList = res.data;
  196. _self.t1 = _self.problemList[0]
  197. _self.currentCheckPointList = _self.problemList[0].items
  198. _self.t2 = _self.currentCheckPointList[0]
  199. _self.currentProblemDescList = _self.problemList[0].items[0].items
  200. _self.t3 = _self.currentProblemDescList[0]
  201. _self.problemForm['pblmsTypeId'] = _self.currentProblemDescList[0].guid;
  202. }
  203. })
  204. },
  205. // 文件上传
  206. submitUpload() {
  207. this.$refs.upload.submit();
  208. },
  209. updatefilelist(arg) {
  210. request.post('/dc/insp/pblm/update', {
  211. pblmId: this.pblmId,
  212. gwComFiles: arg,
  213. pblmStat: this.pblmStat
  214. }).then(res => {
  215. this.removeNewSupervision()
  216. });
  217. },
  218. removeNewSupervision(arg) {
  219. if (arg) {
  220. console.log(arg);
  221. var args = this.gwComFiles.concat(arg);
  222. this.updatefilelist(args);
  223. return;
  224. }
  225. this.$message.success('保存成功')
  226. this.$emit('closeDialog')
  227. this.gwComFiles = [];
  228. this.$refs.uploadFile.init();
  229. },
  230. problemListChange: function (item) {
  231. this.currentCheckPointList = item.items;
  232. },
  233. currentCheckPointListChange: function (item) {
  234. this.currentProblemDescList = item.items;
  235. },
  236. currentProblemDescListChange: function (item) {
  237. console.log(item);
  238. },
  239. },
  240. watch: {
  241. 't1': {
  242. handler: function (val, oldVal) {
  243. // console.log("详情"+val.pblmDesc)
  244. this.wenTiLeiBie = val.inspPblmsName;
  245. this.getYanZhongChengDu()
  246. },
  247. deep: true
  248. },
  249. 't2': {
  250. handler: function (val, oldVal) {
  251. this.jianChaXiangMu = val.checkPointName;
  252. this.getYanZhongChengDu()
  253. },
  254. deep: true
  255. },
  256. 't3': {
  257. handler: function (val, oldVal) {
  258. this.xiangqingmiaoshu = val.pblmDesc;
  259. this.getYanZhongChengDu()
  260. },
  261. deep: true
  262. },
  263. },
  264. }
  265. </script>
  266. <style>
  267. .media_item {
  268. float: left;
  269. width: 60px;
  270. font-size: 32px;
  271. }
  272. /*.el-select--mini {*/
  273. /*width: 100%;*/
  274. /*}*/
  275. </style>