dea3c9456c6843e2a50e286b6993753b0eff685b.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="120px">
  3. <el-form-item label="问题类别" style="text-align:left">
  4. <el-select v-model="t1" value-key="inspPblmsName" placeholder="请选择" @change="problemListChange">
  5. <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :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="checkPointName" @change="currentCheckPointListChange">
  11. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :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">
  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="典型问题" 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="text" placeholder="请输入内容" v-model="problemForm.inspPblmOrgName" required>
  37. </el-input>
  38. </el-form-item>
  39. <el-form-item label="详细描述">
  40. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
  41. </el-input>
  42. </el-form-item>
  43. <el-form-item label="备注">
  44. <el-input
  45. type="textarea"
  46. :rows="2"
  47. placeholder="请输入内容"
  48. v-model="problemForm.note">
  49. </el-input>
  50. </el-form-item>
  51. <el-form-item label="上传照片">
  52. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  53. </el-form-item>
  54. <el-form-item style="margin-top: 50px">
  55. <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
  56. </el-form-item>
  57. </el-form>
  58. </template>
  59. <script>
  60. import request from '../../../utils/gw_ajax_request.js'
  61. import {
  62. submitUpload
  63. } from "../../../api/duChaAPI.js";
  64. export default {
  65. props: ['objId', 'objName', 'villType', 'objType', 'problemMiddleType', 'problemSmallType', 'engId', 'currentObjectRgstrId'],
  66. data() {
  67. return {
  68. problemForm: {
  69. t1: '',
  70. t2: '',
  71. t3: '',
  72. villType: '',
  73. objId: "",
  74. regid: '',
  75. objType: "",
  76. // inspPblmName: "",
  77. inspPblmCate: "",
  78. inspPblmDesc: "",
  79. ifCasePblm: '0',
  80. inspPblmOrgName: '',
  81. pblmStat: "",
  82. dataStat: "",
  83. nm: "",
  84. recPers: "",
  85. note: "",
  86. gwComFiles: [{
  87. id: "",
  88. filePath: "",
  89. bizId: ""
  90. }]
  91. },
  92. inspPblmCate:"",
  93. inspPlamCatelist: ['一般', '较重', '严重'],
  94. imgList: [],
  95. videoList: [],
  96. audioList: [],
  97. pblmStat: '',
  98. gwComFiles: [],
  99. problemList: [],
  100. currentCheckPointList: [],
  101. currentProblemDescList: [],
  102. t1: '',
  103. t2: '',
  104. t3: '',
  105. xiangqingmiaoshu: '',
  106. wenTiLeiBie:"",
  107. jianChaXiangMu:"",
  108. rules: {
  109. inspPblmDesc: [{
  110. required: true,
  111. message: '请输入描述',
  112. trigger: 'blur'
  113. },
  114. ],
  115. }
  116. }
  117. },
  118. components: {
  119. upload: resolve => {
  120. require(["../../../widgets/uploadFile.vue"], resolve);
  121. },
  122. },
  123. computed: {
  124. recPers() {
  125. return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
  126. }
  127. },
  128. created() {
  129. this.getproblemSmallType();
  130. },
  131. methods:{
  132. problemMiddleTypeChange() {
  133. this.middleTypeList.forEach((ele) => {
  134. // if(ele.)
  135. });
  136. },
  137. getproblemSmallType() {
  138. let result = [];
  139. request.get('/dc/insp/pblms/getPblmType', {
  140. params: {
  141. type: this.objType
  142. }
  143. }).then(res => {
  144. if (res.success) {
  145. res.data.forEach((ele) => {
  146. let haveinspPblmsName = false;
  147. result.forEach((inspPblm) => {
  148. if (inspPblm['inspPblmsName'] == ele.inspPblmsName) {
  149. //
  150. let havechekPoint = false;
  151. inspPblm['checkPoints'].forEach((chekPoint) => {
  152. if (chekPoint['checkPointName'] == ele.checkPoint) {
  153. //
  154. chekPoint['pblmDescs'].push({
  155. pblmDesc: ele.pblmDesc,
  156. sn: ele.sn,
  157. guid: ele.guid,
  158. });
  159. havechekPoint = true;
  160. }
  161. });
  162. if (!havechekPoint) {
  163. let newCheckPoint = {};
  164. newCheckPoint['checkPointName'] = ele.checkPoint;
  165. newCheckPoint['sort2'] = ele.sort2;
  166. newCheckPoint['pblmDescs'] = [{
  167. pblmDesc: ele.pblmDesc,
  168. sn: ele.sn,
  169. guid: ele.guid,
  170. }]
  171. inspPblm['checkPoints'].push(newCheckPoint);
  172. }
  173. haveinspPblmsName = true;
  174. }
  175. });
  176. if (!haveinspPblmsName) {
  177. let haveinspPblmsObj = {};
  178. haveinspPblmsObj['inspPblmsName'] = ele.inspPblmsName;
  179. haveinspPblmsObj['sort1'] = ele.sort1;
  180. haveinspPblmsObj['checkPoints'] = [{
  181. checkPointName: ele.checkPoint,
  182. sort2: ele.sort2,
  183. pblmDescs: [{
  184. pblmDesc: ele.pblmDesc,
  185. sn: ele.sn,
  186. guid: ele.guid,
  187. }]
  188. }];
  189. result.push(haveinspPblmsObj);
  190. }
  191. })
  192. this.problemList = result;
  193. console.log(this.problemList);
  194. }
  195. })
  196. },
  197. getproblemMiddleType() {
  198. this.middleTypeList = [];
  199. request.get('/dc/insp/pblms/getPblmType', {
  200. params: {
  201. type: 1
  202. }
  203. }).then(res => {
  204. if (res.success) {
  205. console.log(res.data);
  206. res.data.forEach((ele) => {
  207. this.middleTypeList.push(ele);
  208. })
  209. }
  210. })
  211. },
  212. getYanZhongChengDu(){
  213. request.post('/dc/insp/pblms/getByPblms', {
  214. inspPblmsName:this.wenTiLeiBie,
  215. checkPoint:this.jianChaXiangMu,
  216. pblmDesc:this.xiangqingmiaoshu,
  217. type: 17
  218. }).then(res => {
  219. if (res.success) {
  220. console.log("验证"+res);
  221. this.inspPblmCate=res.data.inspPblmCate;
  222. }
  223. })
  224. },
  225. onSubmit(problemForm) {
  226. this.$refs[problemForm].validate((valid) => {
  227. if (valid) {
  228. this.problemForm.villType = '0';
  229. this.problemForm.recPers = this.recPers
  230. this.problemForm.objId = this.objId;
  231. this.problemForm.regid = this.currentObjectRgstrId;
  232. this.problemForm.nm = this.objName
  233. this.problemForm.objType = this.objType;
  234. this.problemForm.pblmStat = "0";
  235. this.problemForm['inspPblmName'] = this.t1.inspPblmsName;
  236. this.problemForm['inspPlbmType'] = this.t2.sort2;
  237. // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
  238. this.problemForm['inspPblmCode'] = this.t3.sn;
  239. this.problemForm['pblmsTypeId'] = this.t3.guid;
  240. if (!this.problemForm.inspPblmName) {
  241. this.$message.info('请选择问题类别')
  242. return
  243. }
  244. if (!this.problemForm.inspPlbmType) {
  245. this.$message.info('请选择单位性质')
  246. return
  247. }
  248. if (!this.problemForm.inspPblmName) {
  249. this.$message.info('请选择发现问题')
  250. return
  251. }
  252. request.post('/dc/insp/pblm', this.problemForm).then(res => {
  253. if (res.success) {
  254. this.pblmId = res.data.pblmId;
  255. this.gwComFiles = [];
  256. this.pblmStat = res.data.pblmStat;
  257. if (this.$refs.uploadFile.submitUpload(res.data.pblmId)) {
  258. this.removeNewSupervision();
  259. }
  260. }
  261. })
  262. } else {
  263. console.log('error submit!!');
  264. return false;
  265. }
  266. });
  267. },
  268. // 文件上传
  269. submitUpload() {
  270. this.$refs.upload.submit();
  271. },
  272. updatefilelist(arg) {
  273. request.post('/dc/insp/pblm/update', {
  274. pblmId: this.pblmId,
  275. gwComFiles: arg,
  276. pblmStat: this.pblmStat
  277. }).then(res => {
  278. this.removeNewSupervision()
  279. });
  280. },
  281. removeNewSupervision(arg) {
  282. if (arg) {
  283. console.log(arg);
  284. var args = this.gwComFiles.concat(arg);
  285. this.updatefilelist(args);
  286. }
  287. this.$message.success('保存成功')
  288. this.$emit('closeDialog')
  289. this.gwComFiles = [];
  290. this.$refs.uploadFile.init();
  291. },
  292. problemListChange: function (item) {
  293. this.currentCheckPointList = item.checkPoints;
  294. },
  295. currentCheckPointListChange: function (item) {
  296. this.currentProblemDescList = item.pblmDescs;
  297. },
  298. currentProblemDescListChange: function (item) {
  299. console.log(item);
  300. },
  301. },
  302. watch: {
  303. 't1': {
  304. handler: function (val, oldVal) {
  305. // console.log("详情"+val.pblmDesc)
  306. this.wenTiLeiBie = val.inspPblmsName;
  307. this.getYanZhongChengDu()
  308. },
  309. deep: true
  310. },
  311. 't2': {
  312. handler: function (val, oldVal) {
  313. this.jianChaXiangMu = val.checkPointName;
  314. this.getYanZhongChengDu()
  315. },
  316. deep: true
  317. },
  318. 't3': {
  319. handler: function (val, oldVal) {
  320. this.xiangqingmiaoshu = val.pblmDesc;
  321. this.problemForm.inspPblmDesc = val.pblmDesc;
  322. this.getYanZhongChengDu()
  323. },
  324. deep: true
  325. },
  326. },
  327. }
  328. </script>
  329. <style>
  330. .media_item {
  331. float: left;
  332. width: 60px;
  333. font-size: 32px;
  334. }
  335. /*.el-select--mini {*/
  336. /*width: 100%;*/
  337. /*}*/
  338. </style>