8e2edf88a0d742f114d8a2307ac88641736f1f12.svn-base 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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="备注">
  30. <el-input
  31. type="textarea"
  32. :rows="2"
  33. placeholder="请输入内容"
  34. v-model="problemForm.note">
  35. </el-input>
  36. </el-form-item>
  37. <el-form-item label="上传照片">
  38. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  39. </el-form-item>
  40. <el-form-item style="margin-top: 50px">
  41. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
  42. </el-form-item>
  43. </el-form>
  44. </template>
  45. <script>
  46. import request from '../../../utils/gw_ajax_request.js'
  47. import {
  48. submitUpload,getJsGLProblemList
  49. } from "../../../api/duChaAPI.js";
  50. export default {
  51. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId','problData','currentGroupId'],
  52. data() {
  53. return {
  54. problemForm: {
  55. t1: '',
  56. t2: '',
  57. t3: '',
  58. villType: '',
  59. objId: "",
  60. regid: '',
  61. objType: "",
  62. // inspPblmName: "",
  63. inspPblmCate: "",
  64. inspPblmDesc: "",
  65. ifCasePblm: '0',
  66. pblmStat: "",
  67. dataStat: "",
  68. nm: "",
  69. recPers: "",
  70. note: "",
  71. gwComFiles: [{
  72. id: "",
  73. filePath: "",
  74. bizId: ""
  75. }]
  76. },
  77. inspPblmCate:"",
  78. inspPlamCatelist: ['一般', '较重', '严重','特别严重'],
  79. imgList: [],
  80. videoList: [],
  81. audioList: [],
  82. pblmStat: '',
  83. gwComFiles: [],
  84. problemList: [],
  85. currentCheckPointList: [],
  86. currentProblemDescList: [],
  87. t1: '',
  88. t2: '',
  89. t3: '',
  90. xiangqingmiaoshu: '',
  91. wenTiLeiBie:"",
  92. jianChaXiangMu:"",
  93. rules: {
  94. inspPblmDesc: [{
  95. required: true,
  96. message: '请输入描述',
  97. trigger: 'blur'
  98. },
  99. ],
  100. }
  101. }
  102. },
  103. components: {
  104. upload: resolve => {
  105. require(["../../../widgets/uploadFile.vue"], resolve);
  106. },
  107. },
  108. computed: {
  109. recPers() {
  110. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  111. }
  112. },
  113. created() {
  114. this.getproblemSmallType();
  115. },
  116. methods:{
  117. getproblemSmallType() {
  118. var _self = this;
  119. getJsGLProblemList( _self.problData)
  120. .then(res => {
  121. if (res.success) {
  122. this.problemList = res.data;
  123. this.problemList = res.data;
  124. this.t1 = this.problemList[0]
  125. this.currentCheckPointList = this.problemList[0].items
  126. this.t2 = this.currentCheckPointList[0]
  127. this.currentProblemDescList = this.problemList[0].items[0].items
  128. this.t3 = this.currentProblemDescList[0]
  129. }
  130. })
  131. },
  132. getYanZhongChengDu(){
  133. this.inspPblmCate = this.t3.inspPblmCate;
  134. },
  135. onSubmit(problemForm) {
  136. this.$refs[problemForm].validate((valid) => {
  137. if (valid) {
  138. this.problemForm.villType = '15';
  139. this.problemForm.recPers = this.recPers
  140. this.problemForm.objId = this.objId;
  141. this.problemForm.regid = this.currentObjectRgstrId;
  142. this.problemForm.nm = this.objName
  143. this.problemForm.objType = '15';
  144. this.problemForm.pblmStat = "0";
  145. this.problemForm['inspPblmName'] = this.t1.name;//问题类别
  146. // this.problemForm['inspPblmsName'] = this.t2.name;//检查项目
  147. // this.problemForm['inspPlbmType'] = this.t2.sort;
  148. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  149. this.problemForm['inspPblmCode'] = this.t3.sn;
  150. this.problemForm['pblmsTypeId'] = this.t3.guid;
  151. this.problemForm['inspGroupId'] = this.currentGroupId;
  152. if (!this.problemForm.inspPblmName) {
  153. this.$message.info('请选择问题类别')
  154. return
  155. }
  156. // if (!this.problemForm.inspPblmsName) {
  157. // this.$message.info('请选择检查项目')
  158. // return
  159. // }
  160. if (!this.problemForm.inspPblmDesc) {
  161. this.$message.info('请填写详细描述')
  162. return
  163. }
  164. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  165. if (res.success) {
  166. this.pblmId = res.data.pblmId;
  167. this.gwComFiles = [];
  168. this.pblmStat = res.data.pblmStat;
  169. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  170. this.removeNewSupervision();
  171. }
  172. }
  173. })
  174. } else {
  175. console.log('error submit!!');
  176. return false;
  177. }
  178. });
  179. },
  180. // 文件上传
  181. submitUpload() {
  182. this.$refs.upload.submit();
  183. },
  184. updatefilelist(arg) {
  185. request.post('/dc/insp/pblm/update', {
  186. pblmId: this.pblmId,
  187. gwComFiles: arg,
  188. pblmStat: this.pblmStat
  189. }).then(res => {
  190. this.removeNewSupervision()
  191. });
  192. },
  193. removeNewSupervision(arg) {
  194. if (arg) {
  195. console.log(arg);
  196. var args = this.gwComFiles.concat(arg);
  197. this.updatefilelist(args);
  198. }
  199. this.$message.success('保存成功')
  200. this.$emit('closeDialog')
  201. this.gwComFiles = [];
  202. this.$refs.uploadFile.init();
  203. },
  204. problemListChange: function (item) {
  205. this.currentCheckPointList = item.items;
  206. },
  207. currentCheckPointListChange: function (item) {
  208. this.currentProblemDescList = item.items;
  209. },
  210. currentProblemDescListChange: function (item) {
  211. console.log(item);
  212. },
  213. },
  214. watch: {
  215. 't1': {
  216. handler: function (val, oldVal) {
  217. // console.log("详情"+val.pblmDesc)
  218. this.wenTiLeiBie = val.name;
  219. this.getYanZhongChengDu()
  220. },
  221. deep: true
  222. },
  223. 't2': {
  224. handler: function (val, oldVal) {
  225. this.jianChaXiangMu = val.name;
  226. this.getYanZhongChengDu()
  227. },
  228. deep: true
  229. },
  230. 't3': {
  231. handler: function (val, oldVal) {
  232. this.xiangqingmiaoshu = val.pblmDesc;
  233. this.getYanZhongChengDu()
  234. },
  235. deep: true
  236. },
  237. },
  238. }
  239. </script>
  240. <style>
  241. .media_item {
  242. float: left;
  243. width: 60px;
  244. font-size: 32px;
  245. }
  246. /*.el-select--mini {*/
  247. /*width: 100%;*/
  248. /*}*/
  249. </style>