57ad2bbbb19e66857ec3ebc0fbefe01cf509b8fd.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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="原因分析" prop="pblmReason">
  30. <el-input
  31. type="textarea"
  32. :rows="2"
  33. placeholder="请输入内容"
  34. v-model="problemForm.pblmReason">
  35. </el-input>
  36. </el-form-item>
  37. <el-form-item label="整改建议" prop="pblmSggtn">
  38. <el-input
  39. type="textarea"
  40. :rows="2"
  41. placeholder="请输入内容"
  42. v-model="problemForm.pblmSggtn">
  43. </el-input>
  44. </el-form-item>
  45. <el-form-item label="备注">
  46. <el-input
  47. type="textarea"
  48. :rows="2"
  49. placeholder="请输入内容"
  50. v-model="problemForm.note">
  51. </el-input>
  52. </el-form-item>
  53. <!-- <el-form-item label="详情" style=" text-align:left">-->
  54. <!-- <el-input disabled type="textarea" :rows="2" placeholder="" v-model="xiangqingmiaoshu">-->
  55. <!-- </el-input>-->
  56. <!-- </el-form-item>-->
  57. <!-- <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate">-->
  58. <!-- <p v-if="inspPblmCate == 0" >一般</p>-->
  59. <!-- <p v-if="inspPblmCate == 1" >较重</p>-->
  60. <!-- <p v-if="inspPblmCate == 2" >严重</p>-->
  61. <!-- <p v-if="inspPblmCate == 3" >特别严重</p>-->
  62. <!-- </el-form-item>-->
  63. <el-form-item label="上传照片">
  64. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  65. </el-form-item>
  66. <el-form-item style="margin-top: 50px">
  67. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
  68. </el-form-item>
  69. </el-form>
  70. </template>
  71. <script>
  72. import request from '../../../utils/gw_ajax_request.js'
  73. import {
  74. submitUpload,getAqscssjygkProblemList
  75. } from "../../../api/duChaAPI.js";
  76. export default {
  77. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId','problData','currentGroupId','newModelData'],
  78. data() {
  79. return {
  80. problemForm: {
  81. t1: '',
  82. t2: '',
  83. t3: '',
  84. inspPblmOrgName:"",
  85. pblmReason:"",
  86. pblmSggtn:"",
  87. villType: '',
  88. objId: "",
  89. regid: '',
  90. objType: "",
  91. // inspPblmName: "",
  92. inspPblmCate: "",
  93. inspPblmDesc: "",
  94. ifCasePblm: '0',
  95. pblmStat: "",
  96. dataStat: "",
  97. nm: "",
  98. recPers: "",
  99. note: "",
  100. gwComFiles: [{
  101. id: "",
  102. filePath: "",
  103. bizId: ""
  104. }]
  105. },
  106. inspPblmCate:"",
  107. inspPlamCatelist: ['一般', '较重', '严重','特别严重'],
  108. imgList: [],
  109. videoList: [],
  110. audioList: [],
  111. pblmStat: '',
  112. gwComFiles: [],
  113. problemList: [],
  114. currentCheckPointList: [],
  115. currentProblemDescList: [],
  116. t1: '',
  117. t2: '',
  118. t3: '',
  119. xiangqingmiaoshu: '',
  120. wenTiLeiBie:"",
  121. jianChaXiangMu:"",
  122. rules: {
  123. inspPblmDesc: [{
  124. required: true,
  125. message: '请输入描述',
  126. trigger: 'blur'
  127. },
  128. ],
  129. }
  130. }
  131. },
  132. components: {
  133. upload: resolve => {
  134. require(["../../../widgets/uploadFile.vue"], resolve);
  135. },
  136. },
  137. computed: {
  138. recPers() {
  139. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  140. }
  141. },
  142. created() {
  143. this.getproblemSmallType();
  144. },
  145. methods:{
  146. problemMiddleTypeChange() {
  147. this.middleTypeList.forEach((ele) => {
  148. // if(ele.)
  149. });
  150. },
  151. getproblemSmallType() {
  152. var _self = this;
  153. let result = [];
  154. request.get(`/dc/insp/pblms/getPblmsByQuesNum/${this.problData}/${this.objType}`).then(res=>{
  155. if (res.success) {
  156. this.problemList = res.data;
  157. this.problemList = res.data;
  158. this.t1 = this.problemList[0]
  159. this.currentCheckPointList = this.problemList[0].items
  160. this.t2 = this.currentCheckPointList[0]
  161. this.currentProblemDescList = this.problemList[0].items[0].items
  162. this.t3 = this.currentProblemDescList[0]
  163. // this.problemForm['pblmsTypeId'] = this.currentProblemDescList[0].guid;
  164. }
  165. })
  166. },
  167. getproblemMiddleType() {
  168. this.middleTypeList = [];
  169. request.get('/dc/insp/pblms/getPblmType', {
  170. params: {
  171. type: 94
  172. }
  173. }).then(res => {
  174. if (res.success) {
  175. console.log(res.data);
  176. res.data.forEach((ele) => {
  177. this.middleTypeList.push(ele);
  178. })
  179. }
  180. })
  181. },
  182. getYanZhongChengDu(){
  183. this.inspPblmCate = this.t3.inspPblmCate;
  184. },
  185. onSubmit(problemForm) {
  186. this.$refs[problemForm].validate((valid) => {
  187. if (valid) {
  188. this.problemForm.villType = this.objType;
  189. this.problemForm.recPers = this.recPers
  190. this.problemForm.objId = this.objId;
  191. this.problemForm.regid = this.currentObjectRgstrId;
  192. this.problemForm.nm = this.objName
  193. this.problemForm.objType = this.objType;
  194. this.problemForm.pblmStat = "0";
  195. this.problemForm['inspPblmName'] = this.t1.name;//问题类别
  196. this.problemForm['inspPblmsName'] = this.t2.name;//检查项目
  197. this.problemForm['inspPlbmType'] = this.t2.sort;
  198. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  199. this.problemForm['inspPblmCode'] = this.t3.sn;
  200. this.problemForm['pblmsTypeId'] = this.t3.guid;
  201. this.problemForm['inspGroupId'] = this.currentGroupId;
  202. this.problemForm.inspPblmCate = this.inspPblmCate;
  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>