7ceffd88b77ad2a76ea15d4b4825fc71cc9a29f6.svn-base 14 KB

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