9dc88e627689434a65536e344f8bfd1f55e02642.svn-base 9.4 KB

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