2b1c6b5f865ddada9ab319c712ffeda1528c20b7.svn-base 12 KB

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