6cca7e604deb0bf8cd731a659991c19b79b94fa2.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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="inspPblmsName" placeholder="请选择" @change="problemListChange">
  5. <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :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="checkPointName" @change="currentCheckPointListChange">
  11. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :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 {submitUpload} from "@api/duChaAPI.js";
  36. export default {
  37. props: ['objId', 'objName', 'villType', 'objType', 'currentObjectRgstrId', 'problData', 'rowData', 'yshRowData', 'gsgcRowData', 'rowId', 'adFullName', 'projectName'],
  38. data() {
  39. return {
  40. problemForm: {
  41. t1: '',
  42. t2: '',
  43. t3: '',
  44. villType: '',
  45. objId: "",
  46. regid: '',
  47. objType: "",
  48. // inspPblmName: "",
  49. inspPblmCate: "",
  50. inspPblmDesc: "",
  51. note: "",
  52. ifCasePblm: '0',
  53. pblmStat: "",
  54. dataStat: "",
  55. nm: "",
  56. recPers: "",
  57. newVillName: '', //督查对象名称
  58. inspAddDesc: '', //行政区划
  59. gwComFiles: []
  60. },
  61. inspPblmCate: "",
  62. inspPlamCatelist: ['一般', '较重', '严重'],
  63. imgList: [],
  64. videoList: [],
  65. audioList: [],
  66. pblmStat: '',
  67. gwComFiles: [],
  68. problemList: [],
  69. currentCheckPointList: [],
  70. currentProblemDescList: [],
  71. t1: '',
  72. t2: '',
  73. t3: '',
  74. xiangqingmiaoshu: '',
  75. wenTiLeiBie: "",
  76. jianChaXiangMu: "",
  77. rules: {
  78. inspPblmDesc: [{
  79. required: true,
  80. message: '请输入描述',
  81. trigger: 'blur'
  82. },
  83. ],
  84. }
  85. }
  86. },
  87. components: {
  88. upload: resolve => {
  89. require(["@widget/uploadFile.vue"], resolve);
  90. },
  91. },
  92. computed: {
  93. recPers() {
  94. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  95. }
  96. },
  97. created() {
  98. this.getproblemSmallType();
  99. // this.getPblmsByQuesNum();
  100. },
  101. methods: {
  102. getproblemSmallType() {
  103. let result = [];
  104. request.get('/dc/insp/pblms/getPblmType', {
  105. params: {
  106. type: '42',
  107. pguid: '42000000000000000000000000000000'
  108. }
  109. }).then(res => {
  110. if (res.success) {
  111. res.data.forEach((ele) => {
  112. let haveinspPblmsName = false;
  113. result.forEach((inspPblm) => {
  114. if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
  115. //
  116. let havechekPoint = false;
  117. inspPblm['checkPoints'].forEach((chekPoint) => {
  118. if (chekPoint['checkPointName'] == ele.checkPoint) {
  119. //
  120. chekPoint['pblmDescs'].push({
  121. pblmDesc: ele.pblmDesc,
  122. sn: ele.sn,
  123. guid: ele.guid,
  124. });
  125. havechekPoint = true;
  126. }
  127. });
  128. if (!havechekPoint) {
  129. let newCheckPoint = {};
  130. newCheckPoint['checkPointName'] = ele.checkPoint;
  131. newCheckPoint['sort2'] = ele.sort2;
  132. newCheckPoint['pblmDescs'] = [{
  133. pblmDesc: ele.pblmDesc,
  134. sn: ele.sn,
  135. guid: ele.guid,
  136. }]
  137. inspPblm['checkPoints'].push(newCheckPoint);
  138. }
  139. haveinspPblmsName = true;
  140. }
  141. });
  142. if (!haveinspPblmsName) {
  143. let haveinspPblmsObj = {};
  144. haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
  145. haveinspPblmsObj['sort1'] = ele.sort1;
  146. haveinspPblmsObj['checkPoints'] = [{
  147. checkPointName: ele.checkPoint,
  148. sort2: ele.sort2,
  149. pblmDescs: [{
  150. pblmDesc: ele.pblmDesc,
  151. sn: ele.sn,
  152. guid: ele.guid,
  153. }]
  154. }];
  155. result.push(haveinspPblmsObj);
  156. }
  157. })
  158. this.problemList = result;
  159. console.log(this.problemList);
  160. }
  161. })
  162. },
  163. onSubmit(problemForm) {
  164. this.$refs[problemForm].validate((valid) => {
  165. if (valid) {
  166. this.problemForm.recPers = this.recPers
  167. this.problemForm.objId = this.objId;
  168. this.problemForm.regid = this.currentObjectRgstrId;
  169. this.problemForm.objType = '42';
  170. this.problemForm.villType = '1';
  171. this.problemForm['inspPblmName'] = this.t1.inspPblmsName;
  172. this.problemForm['inspPblmDesc'] = this.problemForm.inspPblmDesc;
  173. this.problemForm['inspPblmCode'] = this.currentProblemDescList[0].sn;
  174. this.problemForm['pblmsTypeId'] = this.currentProblemDescList[0].guid;
  175. if (!this.problemForm.inspPblmName) {
  176. this.$message.info('请选择问题类别')
  177. return
  178. }
  179. if (!this.problemForm.inspPblmDesc) {
  180. this.$message.info('请输入问题描述')
  181. return
  182. }
  183. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  184. if (res.success) {
  185. this.pblmId = res.data.pblmId;
  186. this.gwComFiles = [];
  187. this.pblmStat = res.data.pblmStat;
  188. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  189. this.removeNewSupervision();
  190. }
  191. }
  192. })
  193. } else {
  194. console.log('error submit!!');
  195. return false;
  196. }
  197. });
  198. },
  199. // 文件上传
  200. submitUpload() {
  201. this.$refs.upload.submit();
  202. },
  203. updatefilelist(arg) {
  204. request.post('/dc/insp/pblm/update', {
  205. pblmId: this.pblmId,
  206. gwComFiles: arg,
  207. pblmStat: this.pblmStat
  208. }).then(res => {
  209. this.removeNewSupervision()
  210. });
  211. },
  212. removeNewSupervision(arg) {
  213. if (arg) {
  214. console.log(arg);
  215. var args = this.gwComFiles.concat(arg);
  216. this.updatefilelist(args);
  217. return;
  218. }
  219. this.$message.success('保存成功')
  220. this.$emit('closeDialog')
  221. this.gwComFiles = [];
  222. this.$refs.uploadFile.init();
  223. },
  224. problemListChange: function (item) {
  225. this.currentCheckPointList = item.checkPoints;
  226. },
  227. currentCheckPointListChange: function (item) {
  228. this.currentProblemDescList = item.pblmDescs;
  229. },
  230. },
  231. watch: {
  232. },
  233. }
  234. </script>
  235. <style>
  236. .media_item {
  237. float: left;
  238. width: 60px;
  239. font-size: 32px;
  240. }
  241. /*.el-select--mini {*/
  242. /*width: 100%;*/
  243. /*}*/
  244. </style>