eac2f21a50e752cab752e5b631b5afdc66eeee1f.svn-base 11 KB

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