e0e20a26e4d36193c2775abef7f4578ad0acf807.svn-base 9.0 KB

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