9ad9ad8b7022baef0f389ec8a55ffb3a1afa8356.svn-base 10 KB

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