b3ebd424bbf026b232f291ae5e9bbb6f302acc8e.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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: ['currentUnitId', 'currentUnitName','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: 76
  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. // alert(this.t3);
  165. var _self = this;
  166. // request.post('/dc/insp/pblms/getByPblms', {
  167. // inspPblmsName:this.wenTiLeiBie,
  168. // checkPoint:this.jianChaXiangMu,
  169. // pblmDesc:this.xiangqingmiaoshu
  170. // })
  171. // getSzProblemList( _self.problData)
  172. // .then(res => {
  173. // if (res.success) {
  174. // console.log("验证"+res);
  175. // this.inspPblmCate = res.data.datas.inspPblmCate;
  176. // }
  177. // })
  178. this.inspPblmCate = this.t3.inspPblmCate;
  179. },
  180. onSubmit(problemForm) {
  181. this.$refs[problemForm].validate((valid) => {
  182. if (valid) {
  183. this.problemForm.villType = this.objType;
  184. this.problemForm.recPers = this.recPers
  185. this.problemForm.objId = this.objId;
  186. this.problemForm.regid = this.currentUnitId?this.currentUnitId:this.currentObjectRgstrId;
  187. this.problemForm.nm = this.currentUnitName?this.currentUnitName:this.objName;
  188. this.problemForm.objType = this.objType;
  189. this.problemForm.pblmStat = "0";
  190. this.problemForm['inspPblmName'] = this.t1.name;//问题类别
  191. this.problemForm['inspPblmsName'] = this.t2.name;//检查项目
  192. this.problemForm['inspPlbmType'] = this.t2.sort;
  193. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  194. this.problemForm['inspPblmCode'] = this.t3.sn;
  195. this.problemForm['pblmsTypeId'] = this.t3.guid;
  196. this.problemForm['inspGroupId'] = this.currentGroupId;
  197. this.problemForm.inspPblmCate = this.inspPblmCate;
  198. if (!this.problemForm.inspPblmName) {
  199. this.$message.info('请选择问题类别')
  200. return
  201. }
  202. if (!this.problemForm.inspPblmsName) {
  203. this.$message.info('请选择检查项目')
  204. return
  205. }
  206. if (!this.problemForm.inspPblmName) {
  207. this.$message.info('请选择发现问题')
  208. return
  209. }
  210. if (!this.problemForm.inspPblmDesc) {
  211. this.$message.info('请填写详细描述')
  212. return
  213. }
  214. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  215. if (res.success) {
  216. this.pblmId = res.data.pblmId;
  217. this.gwComFiles = [];
  218. this.pblmStat = res.data.pblmStat;
  219. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  220. this.removeNewSupervision();
  221. }
  222. }
  223. })
  224. } else {
  225. console.log('error submit!!');
  226. return false;
  227. }
  228. });
  229. },
  230. // onSubmit() {
  231. // this.problemForm.villType = '0';
  232. // this.problemForm.recPers = this.recPers
  233. // this.problemForm.objId = this.objId;
  234. // this.problemForm.regid = this.currentObjectRgstrId;
  235. // this.problemForm.nm = this.objName
  236. // this.problemForm.objType = '1';
  237. // this.problemForm.pblmStat = "0";
  238. // this.problemForm['inspPblmsName'] = this.t1.inspPblmsName;
  239. // this.problemForm['inspPblmName'] = this.t2.checkPointName;
  240. // this.problemForm['inspPlbmType'] = this.t2.sort2;
  241. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  242. // this.problemForm['inspPblmCode'] = this.t3.sn;
  243. // this.problemForm['pblmsTypeId'] = this.t3.guid;
  244. // if (!this.problemForm.inspPblmsName) {
  245. // this.$message.info('请选择问题类别')
  246. // return
  247. // }
  248. // if (!this.problemForm.inspPlbmType) {
  249. // this.$message.info('请选择检查项目')
  250. // return
  251. // }
  252. // if (!this.problemForm.inspPblmName) {
  253. // this.$message.info('请选择发现问题')
  254. // return
  255. // }
  256. // request.post('/dc/insp/pblm', this.problemForm).then(res => {
  257. // if (res.success) {
  258. // this.pblmId = res.data.pblmId;
  259. // this.gwComFiles = [];
  260. // this.pblmStat = res.data.pblmStat;
  261. // if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  262. // this.removeNewSupervision();
  263. // }
  264. // }
  265. // })
  266. // },
  267. // 文件上传
  268. submitUpload() {
  269. this.$refs.upload.submit();
  270. },
  271. updatefilelist(arg) {
  272. request.post('/dc/insp/pblm/update', {
  273. pblmId: this.pblmId,
  274. gwComFiles: arg,
  275. pblmStat: this.pblmStat
  276. }).then(res => {
  277. this.removeNewSupervision()
  278. });
  279. },
  280. removeNewSupervision(arg) {
  281. if (arg) {
  282. console.log(arg);
  283. var args = this.gwComFiles.concat(arg);
  284. this.updatefilelist(args);
  285. }
  286. this.$message.success('保存成功')
  287. this.$emit('closeDialog')
  288. this.gwComFiles = [];
  289. this.$refs.uploadFile.init();
  290. },
  291. problemListChange: function (item) {
  292. this.currentCheckPointList = item.items;
  293. },
  294. currentCheckPointListChange: function (item) {
  295. this.currentProblemDescList = item.items;
  296. },
  297. currentProblemDescListChange: function (item) {
  298. console.log(item);
  299. },
  300. },
  301. watch: {
  302. 't1': {
  303. handler: function (val, oldVal) {
  304. // console.log("详情"+val.pblmDesc)
  305. this.wenTiLeiBie = val.name;
  306. this.getYanZhongChengDu()
  307. },
  308. deep: true
  309. },
  310. 't2': {
  311. handler: function (val, oldVal) {
  312. this.jianChaXiangMu = val.name;
  313. this.getYanZhongChengDu()
  314. },
  315. deep: true
  316. },
  317. 't3': {
  318. handler: function (val, oldVal) {
  319. this.xiangqingmiaoshu = val.pblmDesc;
  320. this.getYanZhongChengDu()
  321. },
  322. deep: true
  323. },
  324. },
  325. }
  326. </script>
  327. <style>
  328. .media_item {
  329. float: left;
  330. width: 60px;
  331. font-size: 32px;
  332. }
  333. /*.el-select--mini {*/
  334. /*width: 100%;*/
  335. /*}*/
  336. </style>