c93377e9f0b8662f1efa352db77152cc3b0d4770.svn-base 8.7 KB

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