24fae577f7a7e85f601593de8e2dbb7f83a9635f.svn-base 13 KB

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