d9b2b7c617df69e14b6082c5b30cb25c1152686b.svn-base 12 KB

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