addProblemForm.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <a-form
  3. :rules="rules"
  4. :model="problemForm"
  5. :label-col="{span: 8}"
  6. :wrapper-col="{span: 16}"
  7. class="wtzgfc_add_pblm"
  8. ref="problemForm">
  9. <a-card>
  10. <p class="p_title">问题整改情况</p>
  11. <a-form-item label="问题类别" style="text-align:left">
  12. <a-input placeholder="请输入内容" v-model:value="problemForm.pblmType" class="w30" />
  13. </a-form-item>
  14. <a-form-item label="检查项目" style="text-align:left">
  15. <a-input placeholder="请输入内容" v-model:value="problemForm.pblmOption" class="w30" />
  16. </a-form-item>
  17. <a-form-item label="问题描述">
  18. <a-textarea placeholder="请输入内容" :rows="2" v-model:value="problemForm.pblmDesc" class="w30" />
  19. </a-form-item>
  20. <a-form-item label="问题等级" style="text-align:left">
  21. <a-select v-model:value="problemForm.pblmLevl" placeholder="请选择" allow-clear>
  22. <a-select-option v-for="item in supervisionState" :key="item.value" :value="item.value">{{ item.label }}</a-select-option>
  23. </a-select>
  24. </a-form-item>
  25. <a-form-item label="整改措施" style="text-align:left" required>
  26. <a-input placeholder="请输入内容" v-model:value="problemForm.rectMsrs" class="w30" />
  27. </a-form-item>
  28. </a-card>
  29. <a-card>
  30. <p class="p_title">佐证材料</p>
  31. <a-form-item v-if="!problemForm.zcOtherIsMakeFiles.length" class="zzcl_fj" >
  32. <uploadZz
  33. ref="uploadZzcl"
  34. :url="`/modular-source/7446637943aa4c50b5d69c814517fca0/pdcApi/file/insert?bizId=${currentObjectRgstrId}&bizType=MEND_PROV`"
  35. accept=".pdf,.PDF,.doc,.DOC,.DOCX,.docx,.excel,.EXCEL"
  36. @uploadOver="removeNewSupervisionZcOtherIsMake"></uploadZz>
  37. </a-form-item>
  38. <a-form-item label="上传列表" v-if="problemForm.zcOtherIsMakeFiles.length">
  39. <ul v-for="(item,index) in problemForm.zcOtherIsMakeFiles" :key="index">
  40. <li style="list-style: none;">
  41. <a-button type="link" class="w300">{{ item.fileName }}</a-button>
  42. <a-button type="link" @click="rowPreview(item)">下载</a-button>
  43. <a-button type="link" @click="rowDelete(item,index,'qt')" class="font_red">删除</a-button>
  44. </li>
  45. </ul>
  46. </a-form-item>
  47. </a-card>
  48. <a-card style="margin-top: 20px;">
  49. <p class="p_title">复核情况</p>
  50. <a-form-item label="整改状态" style="text-align:left">
  51. <a-radio-group v-model:value="problemForm.revwRectConc">
  52. <a-radio value="1">未整改</a-radio>
  53. <a-radio value="2">正在整改</a-radio>
  54. <a-radio value="3">整改完成</a-radio>
  55. <br />
  56. <br />
  57. <a-radio value="4">整改不到位</a-radio>
  58. <a-radio value="5">上报整改情况与实际不符</a-radio>
  59. </a-radio-group>
  60. </a-form-item>
  61. <a-form-item :label="problemForm.revwRectConc == 3 ? '实际整改完成时间' : problemForm.revwRectConc == 2 ? '计划整改完成时间': ''" style="text-align:left" v-if="(Number(problemForm.revwRectConc) === 2 || Number(problemForm.revwRectConc) === 3) && problemForm.revwRectConc">
  62. <a-date-picker v-model:value="problemForm.realPlanDt" placeholder="选择日期" class="w30" v-if="(Number(problemForm.revwRectConc) === 2 || Number(problemForm.revwRectConc) === 3) && problemForm.revwRectConc"></a-date-picker>
  63. </a-form-item>
  64. <div>
  65. <a-form-item label="备注" v-if="problemForm.revwRectConc != 3">
  66. <a-textarea placeholder="请输入" v-model:value="problemForm.revwRectPblm" :rows="4" class="w30" />
  67. </a-form-item>
  68. <a-form-item label="备注" prop="revwRectPblm" v-else key="revwRectPblm">
  69. <a-textarea placeholder="请输入" v-model:value="problemForm.revwRectPblm" :rows="4" class="w30" />
  70. </a-form-item>
  71. </div>
  72. </a-card>
  73. <a-card>
  74. <p class="p_title">多媒体</p>
  75. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizType=MEND_EXTRA&bizId=`" @uploadOver="removeNewSupervision">
  76. </upload>
  77. </a-card>
  78. <a-form-item :wrapper-col="{ span: 16, offset: 8 }" style="margin-top: 50px">
  79. <a-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right" :loading="saveLoading">保存</a-button>
  80. </a-form-item>
  81. </a-form>
  82. </template>
  83. <script>
  84. import { hostUrl } from '../../../../utils/global_variable';
  85. import request from '../../../../utils/gw_ajax_request';
  86. import upload from '../../../../widgets/uploadFile.vue';
  87. import uploadZz from '../../../../widgets/uploadPdf.vue';
  88. export default {
  89. props: [
  90. 'objId',
  91. 'objName',
  92. 'villType',
  93. 'objType',
  94. 'problemMiddleType',
  95. 'problemSmallType',
  96. 'engId',
  97. 'currentObjectRgstrId',
  98. 'problData',
  99. 'currentProblemId',
  100. 'currentResCode',
  101. 'currentAdCode',
  102. 'currentRsvrNm',
  103. ],
  104. data() {
  105. return {
  106. problemForm: {
  107. pblmDesc: '', // 问题描述 ,
  108. pblmLevl: '', // 问题等级 ,
  109. pblmOption: '', // 检查项目 ,
  110. pblmSn: '', // 问题序号 ,
  111. pblmType: '', // 问题类别 ,
  112. proName: '', // 省 ,
  113. realPlanDt: '', // 实际/计划整改完成时间 ,
  114. rectConc: '', // 整改状态(1:未整改;2:正在整改;3:已整改) ,
  115. rectMsrs: '', // 整改措施 ,
  116. revwInfo: '', // 复核情况 ,
  117. revwRectConc: '', // 复核整改状态(1:未整改;2:正在整改;3:整改完成;4:整改不到位;5:上报整改情况与实际不符) ,
  118. revwRectPblm: '', // 复核整改问题 ,
  119. revwState: '', // 复核填报状态(0:未填报;1:填报中;2:已填报) ,
  120. rgstrId: '', // 登记表ID ,
  121. rsCode: '', // 水库编码 ,
  122. rsName: '', // 水库名称 ,
  123. safeComment: '', // 工况总体评价 ,
  124. unit: '', // 管理单位 ,
  125. uptm: '', // 修改时间 ,
  126. year: '', // 年度
  127. gwComFiles: [],
  128. zcOtherIsMakeFiles: [],
  129. auditConc: '', // 审核状态
  130. },
  131. supervisionState: [
  132. {
  133. value: '0',
  134. label: '一般',
  135. },
  136. {
  137. value: '1',
  138. label: '较重',
  139. },
  140. {
  141. value: '2',
  142. label: '严重',
  143. },
  144. {
  145. value: '3',
  146. label: '特别严重',
  147. },
  148. ],
  149. abarbeitungStatusList: [
  150. {
  151. label: '未填写',
  152. value: '0',
  153. },
  154. {
  155. label: '未整改',
  156. value: '1',
  157. },
  158. {
  159. label: '正在整改',
  160. value: '2',
  161. },
  162. {
  163. label: '已整改',
  164. value: '3',
  165. },
  166. ],
  167. expertReviewList: [
  168. {
  169. label: '审核已整改',
  170. value: '1',
  171. },
  172. {
  173. label: '审核未整改',
  174. value: '2',
  175. },
  176. {
  177. label: '未审核',
  178. value: '3',
  179. },
  180. {
  181. label: '审核正在整改',
  182. value: '4',
  183. },
  184. ],
  185. inspPblmCate: '',
  186. imgList: [],
  187. videoList: [],
  188. audioList: [],
  189. pblmStat: '',
  190. gwComFiles: [],
  191. problemList: [],
  192. currentCheckPointList: [
  193. {
  194. value: '1',
  195. label: '质量安全',
  196. },
  197. {
  198. value: '2',
  199. label: '合同',
  200. },
  201. {
  202. value: '3',
  203. label: '资金',
  204. },
  205. ],
  206. currentProblemDescList: [
  207. {
  208. value: '1',
  209. label: '项目法人(建设单位)',
  210. },
  211. {
  212. value: '2',
  213. label: '勘察设计单位',
  214. },
  215. {
  216. value: '3',
  217. label: '监理单位',
  218. },
  219. {
  220. value: '4',
  221. label: '施工单位',
  222. },
  223. {
  224. value: '5',
  225. label: '金属结构及机电设备安装单位',
  226. },
  227. {
  228. value: '6',
  229. label: '安全监测单位',
  230. },
  231. {
  232. value: '7',
  233. label: '质量检测单位',
  234. },
  235. ],
  236. t1: '',
  237. t2: '',
  238. t3: '',
  239. xiangqingmiaoshu: '',
  240. wenTiLeiBie: '',
  241. jianChaXiangMu: '',
  242. rules: {
  243. revwRectPblm: [
  244. {
  245. required: true,
  246. message: '请填写备注',
  247. trigger: 'blur',
  248. },
  249. ],
  250. },
  251. saveLoading: false,
  252. };
  253. },
  254. components: {
  255. upload,
  256. uploadZz,
  257. },
  258. computed: {
  259. recPers() {
  260. return localStorage.getItem('persId')
  261. ? localStorage.getItem('persId')
  262. : '';
  263. },
  264. },
  265. created() {},
  266. methods: {
  267. async onSubmit(problemForm) {
  268. this.$refs[problemForm].validate((valid) => {
  269. if (valid) {
  270. this.problemForm.recPers = this.recPers;
  271. this.problemForm.rgstrId = this.currentObjectRgstrId;
  272. this.problemForm.rsName = this.currentRsvrNm;
  273. this.problemForm.adCode = this.currentAdCode;
  274. this.problemForm.rsCode = this.currentResCode;
  275. this.problemForm.revwState = '2'; // 只要添加问题就是已复核状态
  276. if (!this.problemForm.revwRectConc) {
  277. this.$message.warning('请选择整改状态');
  278. return;
  279. }
  280. if (!this.problemForm.rectMsrs) {
  281. this.$message.warning('请填写整改措施');
  282. return;
  283. }
  284. // if (!this.problemForm.auditConc) {
  285. // this.$message.warning('请选择审核状态');
  286. // return;
  287. // }
  288. this.$nextTick(() => {
  289. if (this.$refs.uploadFile.submitUpload(this.currentObjectRgstrId)) {
  290. this.removeNewSupervision();
  291. }
  292. });
  293. } else {
  294. console.log('error submit!!');
  295. return false;
  296. }
  297. });
  298. },
  299. // 文件上传
  300. submitUpload() {
  301. this.$refs.upload.submit();
  302. },
  303. // updatefilelist(arg) {
  304. // request.post('/dc/insp/pblm/update', {
  305. // pblmId: this.pblmId,
  306. // gwComFiles: arg,
  307. // pblmStat: this.pblmStat
  308. // }).then(res => {
  309. // this.removeNewSupervision()
  310. // });
  311. // },
  312. removeNewSupervision(arg) {
  313. if (arg) {
  314. this.problemForm.gwComFiles = this.problemForm.gwComFiles.concat(arg);
  315. }
  316. if (!this.saveLoading) {
  317. this.saveLoading = true;
  318. this.problemForm.gwComFiles = [
  319. ...this.problemForm.gwComFiles,
  320. ...this.problemForm.zcOtherIsMakeFiles,
  321. ];
  322. delete this.problemForm.zcOtherIsMakeFiles;
  323. request
  324. .post('bis/insp/rsvr/pblm/mend/2021/update', this.problemForm)
  325. .then((res) => {
  326. if (res.success) {
  327. this.$message.success('保存成功');
  328. this.$emit('closeDialog');
  329. this.$refs.uploadFile.init();
  330. }
  331. this.saveLoading = false;
  332. })
  333. .catch((err) => {
  334. this.saveLoading = false;
  335. });
  336. }
  337. },
  338. removeNewSupervisionZcOtherIsMake(arg) {
  339. this.$nextTick(() => {
  340. if (arg.length) {
  341. let len = this.problemForm.zcOtherIsMakeFiles.length;
  342. for (var i = 0; i < arg.length; i++) {
  343. this.$set(this.problemForm.zcOtherIsMakeFiles, len, arg[i]);
  344. len++;
  345. }
  346. }
  347. });
  348. },
  349. rowPreview(row) {
  350. window.open(`${hostUrl}${row.filePath}`, '_blank');
  351. },
  352. rowDelete(row, index) {
  353. this.$confirm({
  354. title: '提示',
  355. content: `确定要删除'${row.fileName}', 是否继续?`,
  356. okType: 'warning',
  357. onOk: () => {
  358. request.post(`/file/${row.id}`).then((res) => {
  359. if (res.success) {
  360. this.$message.success('删除成功');
  361. this.problemForm.zcOtherIsMakeFiles.splice(index, 1);
  362. } else {
  363. this.$message.warning(res.message);
  364. }
  365. });
  366. },
  367. cancel: () => {
  368. this.$message.info('已取消删除');
  369. },
  370. });
  371. },
  372. },
  373. };
  374. </script>
  375. <style lang='less' scoped>
  376. .wtzgfc_add_pblm {
  377. .w30 {
  378. width: 50%;
  379. }
  380. .el-textarea {
  381. display: block !important;
  382. }
  383. p.p_title {
  384. text-align: left;
  385. font-weight: bold;
  386. }
  387. .el-radio {
  388. margin-bottom: 15px;
  389. }
  390. .zzcl_fj>div {
  391. margin: 0 !important;
  392. }
  393. .zzcl_fj>div>div {
  394. margin: 0 !important;
  395. display: inline-block;
  396. width: 80px !important;
  397. }
  398. .w300 {
  399. width: 180px;
  400. text-align: left;
  401. }
  402. }
  403. </style>