1d93101b486a1123db5c7113b0df2e0eea0cd44e.svn-base 9.9 KB

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