ce6d263a536018a94eded58bd58aceaf661feea1.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <el-form ref="problemForm"
  3. :rules="rules"
  4. :model="problemForm"
  5. label-width="80px">
  6. <el-form-item label="问题类别"
  7. style="text-align:left">
  8. <el-select v-model="t1"
  9. value-key="items"
  10. placeholder="请选择"
  11. @change="problemListChange">
  12. <el-option v-for="(item,index) in problemList"
  13. :key="index"
  14. :label="item.name"
  15. :value="item">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <!--<el-form-item label="检查项目" style="text-align:left">-->
  20. <!--<el-select v-model="t2" placeholder="请选择" value-key="items" @change="currentCheckPointListChange">-->
  21. <!--<el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.name" :value="item">-->
  22. <!--</el-option>-->
  23. <!--</el-select>-->
  24. <!--</el-form-item>-->
  25. <el-form-item label="检查事项"
  26. style="text-align:left">
  27. <el-select v-model="t3"
  28. placeholder="请选择"
  29. value-key="pblmDesc"
  30. @change="currentProblemDescListChange"
  31. style="max-width: 500px">
  32. <el-option v-for="(item,index) in currentProblemDescList"
  33. :key="index"
  34. :label="item.pblmDesc"
  35. :value="item"
  36. :title="item.pblmDesc"
  37. style="max-width: 500px">
  38. </el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="详细描述"
  42. :required="true">
  43. <el-input type="textarea"
  44. :rows="2"
  45. placeholder="请输入内容"
  46. v-model="problemForm.inspPblmDesc"
  47. required>
  48. </el-input>
  49. </el-form-item>
  50. <!-- <el-form-item label="典型问题"-->
  51. <!-- label-width="80px"-->
  52. <!-- style=" text-align:left">-->
  53. <!-- <el-radio v-model="problemForm.ifCasePblm"-->
  54. <!-- label="1">是</el-radio>-->
  55. <!-- <el-radio v-model="problemForm.ifCasePblm"-->
  56. <!-- label="0">否</el-radio>-->
  57. <!-- </el-form-item>-->
  58. <el-form-item label="备注">
  59. <el-input type="textarea"
  60. :rows="2"
  61. placeholder="请输入内容"
  62. v-model="problemForm.note">
  63. </el-input>
  64. </el-form-item>
  65. <el-form-item label="上传照片">
  66. <upload ref="uploadFile"
  67. :url="`/pdcApi/file/insert?bizId=`"
  68. @uploadOver="removeNewSupervision"></upload>
  69. </el-form-item>
  70. <el-form-item style="margin-top: 50px">
  71. <el-button type="primary"
  72. @click="onSubmit('problemForm')"
  73. style="width: 100px;float:right">保存</el-button>
  74. </el-form-item>
  75. </el-form>
  76. </template>
  77. <script>
  78. import request from '../../../utils/gw_ajax_request.js'
  79. import {
  80. submitUpload, getSydProblemList, getzxProblemList
  81. } from "../../../api/duChaAPI.js";
  82. import { changeInfo, recordProblem } from "../../../api/duChaAPI";
  83. export default {
  84. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId', 'problData', 'currentGroupId'],
  85. data () {
  86. return {
  87. problemForm: {
  88. t1: '',
  89. t2: '',
  90. t3: '',
  91. villType: '',
  92. objId: "",
  93. regid: '',
  94. objType: "",
  95. // inspPblmName: "",
  96. inspPblmCate: "",
  97. inspPblmDesc: "",
  98. // ifCasePblm: '0',
  99. pblmStat: "",
  100. dataStat: "",
  101. nm: "",
  102. recPers: "",
  103. note: "",
  104. gwComFiles: [{
  105. id: "",
  106. filePath: "",
  107. bizId: ""
  108. }]
  109. },
  110. inspPblmCate: "",
  111. inspPlamCatelist: ['一般', '较重', '严重', '特别严重'],
  112. imgList: [],
  113. videoList: [],
  114. audioList: [],
  115. pblmStat: '',
  116. gwComFiles: [],
  117. problemList: [],
  118. currentCheckPointList: [],
  119. currentProblemDescList: [],
  120. t1: '',
  121. t2: '',
  122. t3: '',
  123. xiangqingmiaoshu: '',
  124. wenTiLeiBie: "",
  125. jianChaXiangMu: "",
  126. rules: {
  127. inspPblmDesc: [{
  128. required: true,
  129. message: '请输入描述',
  130. trigger: 'blur'
  131. },
  132. ],
  133. }
  134. }
  135. },
  136. components: {
  137. upload: resolve => {
  138. require(["../../../widgets/uploadFile.vue"], resolve);
  139. },
  140. },
  141. computed: {
  142. recPers () {
  143. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  144. }
  145. },
  146. created () {
  147. this.getproblemSmallType();
  148. },
  149. methods: {
  150. problemMiddleTypeChange () {
  151. this.middleTypeList.forEach((ele) => {
  152. // if(ele.)
  153. });
  154. },
  155. getproblemSmallType () {
  156. var _self = this;
  157. getzxProblemList(_self.problData)
  158. .then(res => {
  159. console.log("_self.res:" + JSON.stringify(res));
  160. if (res.success) {
  161. this.problemList = res.data;
  162. this.problemList = res.data;
  163. this.t1 = this.problemList[0]
  164. this.currentCheckPointList = this.problemList[0].items
  165. this.t2 = this.currentCheckPointList[0]
  166. this.currentProblemDescList = this.problemList[0].items[0].items
  167. this.t3 = this.currentProblemDescList[0]
  168. }
  169. })
  170. },
  171. // getproblemMiddleType() {
  172. // this.middleTypeList = [];
  173. // request.get('/dc/insp/pblms/getPblmType', {
  174. // params: {
  175. // type: 1
  176. // }
  177. // }).then(res => {
  178. // if (res.success) {
  179. // console.log(res.data);
  180. // res.data.forEach((ele) => {
  181. // this.middleTypeList.push(ele);
  182. // })
  183. // }
  184. // })
  185. // },
  186. getYanZhongChengDu () {
  187. // alert(this.t3);
  188. var _self = this;
  189. // request.post('/dc/insp/pblms/getByPblms', {
  190. // inspPblmsName:this.wenTiLeiBie,
  191. // checkPoint:this.jianChaXiangMu,
  192. // pblmDesc:this.xiangqingmiaoshu
  193. // })
  194. // getSzProblemList( _self.problData)
  195. // .then(res => {
  196. // if (res.success) {
  197. // console.log("验证"+res);
  198. // this.inspPblmCate = res.data.datas.inspPblmCate;
  199. // }
  200. // })
  201. this.inspPblmCate = this.t3.inspPblmCate;
  202. },
  203. onSubmit (problemForm) {
  204. this.$refs[problemForm].validate((valid) => {
  205. if (valid) {
  206. this.problemForm.villType = '101';
  207. this.problemForm.recPers = this.recPers
  208. this.problemForm.objId = this.objId;
  209. this.problemForm.regid = this.currentObjectRgstrId;
  210. this.problemForm.nm = this.objName
  211. this.problemForm.objType = '101';
  212. this.problemForm.pblmStat = "0";
  213. this.problemForm['inspPblmName'] = this.t1.name;//问题类别
  214. // this.problemForm['inspPblmsName'] = this.t2.name;//检查项目
  215. // this.problemForm['inspPlbmType'] = this.t2.sort;
  216. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  217. this.problemForm['inspPblmCode'] = this.t3.sn;
  218. this.problemForm['pblmsTypeId'] = this.t3.guid;
  219. this.problemForm['inspGroupId'] = this.currentGroupId;
  220. if (!this.problemForm.inspPblmName) {
  221. this.$message.info('请选择问题类别')
  222. return
  223. }
  224. // if (!this.problemForm.inspPblmsName) {
  225. // this.$message.info('请选择检查项目')
  226. // return
  227. // }
  228. if (!this.problemForm.inspPblmDesc) {
  229. this.$message.info('请填写详细描述')
  230. return
  231. }
  232. changeInfo(this.problemForm).then(res => {
  233. if (res.success) {
  234. this.pblmId = res.data.pblmId;
  235. this.gwComFiles = [];
  236. this.pblmStat = res.data.pblmStat;
  237. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  238. this.removeNewSupervision();
  239. }
  240. }
  241. })
  242. } else {
  243. console.log('error submit!!');
  244. return false;
  245. }
  246. });
  247. },
  248. // onSubmit() {
  249. // this.problemForm.villType = '0';
  250. // this.problemForm.recPers = this.recPers
  251. // this.problemForm.objId = this.objId;
  252. // this.problemForm.regid = this.currentObjectRgstrId;
  253. // this.problemForm.nm = this.objName
  254. // this.problemForm.objType = '1';
  255. // this.problemForm.pblmStat = "0";
  256. // this.problemForm['inspPblmsName'] = this.t1.inspPblmsName;
  257. // this.problemForm['inspPblmName'] = this.t2.checkPointName;
  258. // this.problemForm['inspPlbmType'] = this.t2.sort2;
  259. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  260. // this.problemForm['inspPblmCode'] = this.t3.sn;
  261. // this.problemForm['pblmsTypeId'] = this.t3.guid;
  262. // if (!this.problemForm.inspPblmsName) {
  263. // this.$message.info('请选择问题类别')
  264. // return
  265. // }
  266. // if (!this.problemForm.inspPlbmType) {
  267. // this.$message.info('请选择检查项目')
  268. // return
  269. // }
  270. // if (!this.problemForm.inspPblmName) {
  271. // this.$message.info('请选择发现问题')
  272. // return
  273. // }
  274. // request.post('/dc/insp/pblm', this.problemForm).then(res => {
  275. // if (res.success) {
  276. // this.pblmId = res.data.pblmId;
  277. // this.gwComFiles = [];
  278. // this.pblmStat = res.data.pblmStat;
  279. // if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  280. // this.removeNewSupervision();
  281. // }
  282. // }
  283. // })
  284. // },
  285. // 文件上传
  286. submitUpload () {
  287. this.$refs.upload.submit();
  288. },
  289. updatefilelist (arg) {
  290. request.post('/dc/insp/pblm/update', {
  291. pblmId: this.pblmId,
  292. gwComFiles: arg,
  293. pblmStat: this.pblmStat
  294. }).then(res => {
  295. this.removeNewSupervision()
  296. });
  297. },
  298. removeNewSupervision (arg) {
  299. if (arg) {
  300. console.log(arg);
  301. var args = this.gwComFiles.concat(arg);
  302. this.updatefilelist(args);
  303. }
  304. this.$message.success('保存成功')
  305. this.$emit('closeDialog')
  306. this.gwComFiles = [];
  307. this.$refs.uploadFile.init();
  308. },
  309. problemListChange: function (item) {
  310. this.currentCheckPointList = item.items;
  311. },
  312. currentCheckPointListChange: function (item) {
  313. this.currentProblemDescList = item.items;
  314. },
  315. currentProblemDescListChange: function (item) {
  316. console.log(item);
  317. },
  318. },
  319. watch: {
  320. 't1': {
  321. handler: function (val, oldVal) {
  322. // console.log("详情"+val.pblmDesc)
  323. this.wenTiLeiBie = val.name;
  324. this.getYanZhongChengDu()
  325. },
  326. deep: true
  327. },
  328. 't2': {
  329. handler: function (val, oldVal) {
  330. this.jianChaXiangMu = val.name;
  331. this.getYanZhongChengDu()
  332. },
  333. deep: true
  334. },
  335. 't3': {
  336. handler: function (val, oldVal) {
  337. this.xiangqingmiaoshu = val.pblmDesc;
  338. this.getYanZhongChengDu()
  339. },
  340. deep: true
  341. },
  342. },
  343. }
  344. </script>
  345. <style>
  346. .media_item {
  347. float: left;
  348. width: 60px;
  349. font-size: 32px;
  350. }
  351. /*.el-select--mini {*/
  352. /*width: 100%;*/
  353. /*}*/
  354. </style>