b53dcc9fc4200df0cb2c6d581a051d104ae0c0c5.svn-base 13 KB

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