5ae651de1ca4fac343d6ff90541d7ca669e3cd5a.svn-base 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="100px">
  3. <el-form-item label="问题类别" style="text-align:left">
  4. <el-select v-model="problemForm.inspPblmName" placeholder="请选择">
  5. <el-option v-for="(item,index) in problemList" :key="index" :label="item.name" :value="item.name">
  6. </el-option>
  7. </el-select>
  8. </el-form-item>
  9. <!--<el-form-item label="检查项目" style="text-align:left">-->
  10. <!--<el-input placeholder="请输入检查项目" v-model="problemForm.checkPoint" required></el-input>-->
  11. <!--</el-form-item>-->
  12. <el-form-item label="详细描述">
  13. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
  14. </el-input>
  15. </el-form-item>
  16. <el-form-item label="上传照片">
  17. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  18. </el-form-item>
  19. <el-form-item style="margin-top: 50px">
  20. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right"
  21. :loading="saveLoading">保存
  22. </el-button>
  23. </el-form-item>
  24. </el-form>
  25. </template>
  26. <script>
  27. import request from '@util/gw_ajax_request.js'
  28. import {submitUpload} from "@api/duChaAPI.js";
  29. export default {
  30. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId', 'problData', 'rowData'],
  31. data() {
  32. return {
  33. problemForm: {
  34. checkPoint: '',
  35. t1: '',
  36. t2: '',
  37. t3: '',
  38. objId: "",
  39. regid: '',
  40. objType: "",
  41. // inspPblmName: "",
  42. inspPblmCate: "",
  43. inspPblmDesc: "",
  44. pblmStat: "",
  45. dataStat: "",
  46. nm: "",
  47. recPers: "",
  48. note: "",
  49. gwComFiles: [{
  50. id: "",
  51. filePath: "",
  52. bizId: ""
  53. }]
  54. },
  55. inspPblmCate: "",
  56. imgList: [],
  57. videoList: [],
  58. audioList: [],
  59. pblmStat: '',
  60. gwComFiles: [],
  61. problemList: [
  62. {
  63. name: '消防安全问题',
  64. value: '1'
  65. },
  66. {
  67. name: '疫情防控问题',
  68. value: '2'
  69. }
  70. ],
  71. currentCheckPointList: [],
  72. currentProblemDescList: [],
  73. t1: '',
  74. t2: '',
  75. t3: '',
  76. xiangqingmiaoshu: '',
  77. wenTiLeiBie: "",
  78. jianChaXiangMu: "",
  79. rules: {
  80. inspPblmDesc: [{
  81. required: true,
  82. message: '请输入描述',
  83. trigger: 'blur'
  84. },
  85. ],
  86. },
  87. saveLoading: false
  88. }
  89. },
  90. components: {
  91. upload: resolve => {
  92. require(["@widget/uploadFile.vue"], resolve);
  93. },
  94. },
  95. computed: {
  96. recPers() {
  97. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  98. }
  99. },
  100. created() {
  101. },
  102. methods: {
  103. onSubmit(problemForm) {
  104. this.$refs[problemForm].validate((valid) => {
  105. if (valid) {
  106. this.problemForm.recPers = this.recPers;
  107. this.problemForm.objId = this.objId;
  108. this.problemForm.regid = this.currentObjectRgstrId;
  109. this.problemForm.nm = this.objName;
  110. this.problemForm.objType = '74';
  111. this.problemForm.pblmStat = "0";
  112. this.problemForm['inspPblmsName'] = this.problemForm.inspPblmName;//检查项目
  113. this.problemForm['checkPoint'] = this.problemForm.checkPoint;//add by lch
  114. this.problemForm['inspPblmDesc'] = this.problemForm.inspPblmDesc;
  115. // this.problemForm['inspPlbmType'] = this.t2.sort;
  116. // this.problemForm['inspPblmCode'] = this.t3.sn;
  117. // this.problemForm['pblmsTypeId'] = this.t3.guid;
  118. // this.problemForm['reviConc'] = "0";
  119. if (!this.problemForm.inspPblmName) {
  120. this.$message.info('请选择问题类别');
  121. return
  122. }
  123. // if (!this.problemForm.checkPoint) {
  124. // this.$message.info('请选择检查项目');
  125. // return
  126. // }
  127. if (!this.problemForm.inspPblmDesc) {
  128. this.$message.info('请填写详细描述');
  129. return
  130. }
  131. if (!this.saveLoading) {
  132. this.saveLoading = true;
  133. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  134. if (res.success) {
  135. this.pblmId = res.data.pblmId;
  136. this.gwComFiles = [];
  137. this.pblmStat = res.data.pblmStat;
  138. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  139. this.removeNewSupervision();
  140. }
  141. }
  142. this.saveLoading = false;
  143. }).catch(err => {
  144. this.saveLoading = false;
  145. });
  146. }
  147. } else {
  148. console.log('error submit!!');
  149. return false;
  150. }
  151. });
  152. },
  153. // 文件上传
  154. submitUpload() {
  155. this.$refs.upload.submit();
  156. },
  157. updatefilelist(arg) {
  158. request.post('/dc/insp/pblm/update', {
  159. pblmId: this.pblmId,
  160. gwComFiles: arg,
  161. pblmStat: this.pblmStat
  162. }).then(res => {
  163. this.removeNewSupervision()
  164. });
  165. },
  166. removeNewSupervision(arg) {
  167. if (arg) {
  168. console.log(arg);
  169. var args = this.gwComFiles.concat(arg);
  170. this.updatefilelist(args);
  171. }
  172. this.$message.success('保存成功');
  173. this.$emit('closeDialog');
  174. this.gwComFiles = [];
  175. this.$refs.uploadFile.init();
  176. },
  177. },
  178. }
  179. </script>
  180. <style>
  181. .media_item {
  182. float: left;
  183. width: 60px;
  184. font-size: 32px;
  185. }
  186. /*.el-select--mini {*/
  187. /*width: 100%;*/
  188. /*}*/
  189. </style>