Qxxb.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <div class="qxyh max-box flex-box column">
  3. <div class="header flex-box align-center box-sizing">
  4. <div class="header-left">
  5. <el-form :inline="true" :model="formInline">
  6. <el-form-item label="标题:">
  7. <el-input v-model="formInline.subject"></el-input>
  8. </el-form-item>
  9. <el-form-item label="规划类型:" style="display: none">
  10. <el-select v-model="formInline.planType" placeholder="请选择">
  11. <el-option label="总体规划" value="1"></el-option>
  12. <el-option label="村庄规划" value="2"></el-option>
  13. <el-option label="报批项目" value="3"></el-option>
  14. <el-option label="总体规划(对部)" value="4"></el-option>
  15. <el-option label="详细规划" value="5"></el-option>
  16. <el-option label="专项规划" value="6"></el-option>
  17. <el-option label="乡镇苏木国土空间规划" value="7"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="行政区:">
  21. <el-cascader
  22. :options="xzoptions"
  23. :props="{
  24. ...props,
  25. checkStrictly: true,
  26. expandTrigger: 'hover',
  27. }"
  28. v-model="xzqCode"
  29. clearable
  30. ref="cascader"
  31. class="cascader-style"
  32. style="width: 90%"
  33. popper-class="popper-cascader"
  34. :filterable="true"
  35. @change="setXzqdm"
  36. :show-all-levels="false"
  37. ></el-cascader>
  38. </el-form-item>
  39. <el-button
  40. type="primary"
  41. @click="changeForm"
  42. style="margin-left: 20px"
  43. >查询</el-button
  44. >
  45. </el-form>
  46. </div>
  47. </div>
  48. <div class="table-layout flex-box column height-100-60">
  49. <div class="table max-width height-100-50">
  50. <el-table
  51. ref="multipleTable"
  52. :data="tableData"
  53. style="width: 100%"
  54. border
  55. fit
  56. cell-class-name="cell-item"
  57. height="100%"
  58. tooltip-effect="dark"
  59. >
  60. <el-table-column prop="id" label="记录主键" align="center">
  61. </el-table-column>
  62. <el-table-column prop="name" label="成果名称" align="center">
  63. </el-table-column>
  64. <el-table-column prop="instid" label="流程主键" align="center">
  65. </el-table-column>
  66. <el-table-column prop="xzqmc" label="行政区名称" align="center">
  67. </el-table-column>
  68. <el-table-column prop="uploadtime" label="提交时间" align="center">
  69. </el-table-column>
  70. <el-table-column prop="shzt" label="上报状态" align="center">
  71. <template #default="scope">
  72. <span>
  73. {{ getShzt(scope.row.shzt) }}
  74. </span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. label="操作"
  79. align="center"
  80. type="flex"
  81. justity="space-between"
  82. width="220"
  83. >
  84. <template #default="scope">
  85. <div class="">
  86. <el-button
  87. type="primary"
  88. size="mini"
  89. @click="open(scope.row)"
  90. style="display: inline-block"
  91. >审批记录</el-button
  92. >
  93. <el-button
  94. type="primary"
  95. size="mini"
  96. @click="xbUpload(scope.row)"
  97. v-if="scope.row.shzt == '0'"
  98. style="display: inline-block"
  99. >修编</el-button
  100. >
  101. <el-button
  102. type="primary"
  103. size="mini"
  104. @click="xbDownload(scope.row.id)"
  105. v-if="scope.row.path"
  106. style="display: inline-block"
  107. >下载</el-button
  108. >
  109. </div>
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. </div>
  114. <div class="flex-box footer height-50 flex-box align-center box-sizing">
  115. <el-pagination
  116. @size-change="handleSizeChange"
  117. @current-change="handleCurrentChange"
  118. :current-page="formInline.current"
  119. :page-sizes="[10, 20, 50, 100]"
  120. :page-size="formInline.size"
  121. background
  122. :pager-count="5"
  123. layout="total, sizes, prev, pager, next, jumper"
  124. :total="formInline.total"
  125. >
  126. </el-pagination>
  127. </div>
  128. </div>
  129. <ShjlDialog
  130. v-model:list="shjllist"
  131. v-model:ShjlDialog="shjlShow"
  132. v-if="shjlShow"
  133. style="margin-top: 300px"
  134. ></ShjlDialog>
  135. <GhcgDialog
  136. v-if="ztghDialog"
  137. v-model:ghcgscDialog="ztghDialog"
  138. :isCity="
  139. $store.getters.roles.join(',').indexOf('qixian') > -1 ? false : true
  140. "
  141. :instid="instid"
  142. @refresh="changeForm"
  143. @getlist="changeForm"
  144. ></GhcgDialog>
  145. <CzghcgDialog
  146. v-if="ghcgscDialog"
  147. v-model:ghcgscDialog="ghcgscDialog"
  148. :instid="instid"
  149. @refresh="changeForm"
  150. @getlist="changeForm"
  151. ></CzghcgDialog>
  152. <XxghcgDialog
  153. v-if="xxghcgscDialog"
  154. v-model:xxghcgscDialog="xxghcgscDialog"
  155. :instid="instid"
  156. @refresh="changeForm"
  157. @getlist="changeForm"
  158. ></XxghcgDialog>
  159. <el-dialog
  160. title="修编上传"
  161. v-model="dialogVisible"
  162. style="width: 360px; height: 300px"
  163. :before-close="handleClose"
  164. append-to-body
  165. >
  166. <div style="width: 100%; height: 100%">
  167. <el-form label-width="100px">
  168. <!-- <el-form-item label="选择文件">
  169. <el-upload
  170. ref="fileUploadBtn"
  171. :limit="1"
  172. :file-list="fileList"
  173. :on-change="handleChangeFile"
  174. :on-remove="handleRemove"
  175. :auto-upload="false"
  176. :show-file-list="true"
  177. >
  178. <el-button size="small" type="primary">点击上传</el-button>
  179. </el-upload>
  180. </el-form-item> -->
  181. <el-form-item label="主键id">
  182. <el-input readonly v-model="xbid" placeholder="主键id"></el-input>
  183. </el-form-item>
  184. <el-form-item label="流程主键">
  185. <el-input
  186. readonly
  187. v-model="instid"
  188. placeholder="请输入流程主键"
  189. ></el-input>
  190. </el-form-item>
  191. </el-form>
  192. </div>
  193. <span slot="footer" class="dialog-footer">
  194. <el-button type="primary" @click="xbSubmit()" size="small"
  195. >修编</el-button
  196. >
  197. </span>
  198. </el-dialog>
  199. </div>
  200. </template>
  201. <script>
  202. import { reactive, toRefs, ref } from "@vue/reactivity";
  203. import { getCurrentInstance, onMounted } from "@vue/runtime-core";
  204. import {
  205. getLandMyAttendsData,
  206. getLandGetAllTasks,
  207. getLandTaskStatus,
  208. reportDownloadAction,
  209. getInstIds,
  210. getcgglInstIds,
  211. getLandGetRevisePageData,
  212. reuploadThirdpartyReviseData,
  213. } from "@/api/ghcgysc/search.js";
  214. import request from "@/utils/request.js";
  215. import { getxblist } from "@/api/ghcgysc/cggl.js";
  216. import ShjlDialog from "@/components/ghcgscygl/ghcgsb/search/Shjl.vue";
  217. import GhcgDialog from "@/components/ghcgscygl/ghcgsb/ztgh/ghcgDialog.vue";
  218. import CzghcgDialog from "@/components/ghcgscygl/ghcgsb/xxgh/czgh/Qxyh/czghcgDialog.vue";
  219. import XxghcgDialog from "@/components/ghcgscygl/ghcgsb/xxgh/xxgh/Qxyh/czghcgDialog.vue";
  220. import { ElMessage } from "element-plus";
  221. import { GetXzq } from "@/api/homeApi.js";
  222. export default {
  223. components: {
  224. ShjlDialog,
  225. GhcgDialog,
  226. CzghcgDialog,
  227. XxghcgDialog,
  228. },
  229. setup(props, context) {
  230. const { proxy } = getCurrentInstance();
  231. const parent = { ...context };
  232. const qxyh = reactive({
  233. formInline: {
  234. planType: "1",
  235. current: 1,
  236. size: 20,
  237. total: 0,
  238. divisionCode: "",
  239. subject: "",
  240. },
  241. xbid: "",
  242. fileList: [],
  243. xbfile: null,
  244. dialogVisible: false,
  245. xzqCode: [],
  246. xzoptions: [],
  247. instid: "",
  248. instids: "",
  249. cascader: ref(null),
  250. multipleTable: ref(null),
  251. ckxqDialog: false,
  252. ztghDialog: false,
  253. ghcgscDialog: false,
  254. xxghcgscDialog: false,
  255. ghcgbjDialog: false,
  256. editDialogVisible: false, //公共弹窗
  257. activeCg: {},
  258. activeCgb: {},
  259. options: [],
  260. shjllist: [],
  261. shjlShow: false,
  262. tableData: [],
  263. dialogTitle: "",
  264. dialogMessage1: "",
  265. dialogMessage2: "",
  266. editStatus: "",
  267. name: "",
  268. index: "",
  269. uuidList: [],
  270. uuidList1: "",
  271. getShzt(shzt) {
  272. switch (shzt) {
  273. case "0":
  274. return "待上报";
  275. case "1":
  276. return "已上报";
  277. case "2":
  278. return "退回";
  279. default:
  280. return "未知";
  281. }
  282. },
  283. handleSizeChange(val) {
  284. qxyh.formInline.size = val;
  285. qxyh.getlist2();
  286. },
  287. handleCurrentChange(val) {
  288. qxyh.formInline.current = val;
  289. qxyh.getlist2();
  290. },
  291. // 筛选
  292. changeForm() {
  293. qxyh.formInline.current = 1;
  294. qxyh.getlist();
  295. },
  296. // 查询
  297. onSearch() {
  298. qxyh.getlist();
  299. },
  300. // 详情
  301. detail(activeCg) {
  302. qxyh.activeCg = activeCg;
  303. qxyh.ckxqDialog = true;
  304. },
  305. handleClose() {
  306. qxyh.dialogVisible = false;
  307. qxyh.xbfile = null;
  308. qxyh.fileList = [];
  309. },
  310. // 审核记录
  311. open(row) {
  312. let id = row.id;
  313. let instId = row.instid;
  314. getLandTaskStatus({
  315. id: id,
  316. instId: instId,
  317. }).then((res) => {
  318. if (res && res.data && res.data.length > 0) {
  319. qxyh.shjllist = res.data;
  320. qxyh.shjlShow = true;
  321. } else {
  322. ElMessage.error("审核记录列表为空");
  323. }
  324. });
  325. },
  326. // 修编记录
  327. xbUpload(row) {
  328. qxyh.instid = row.instid;
  329. qxyh.xbid = row.id;
  330. qxyh.dialogVisible = true;
  331. },
  332. // 修编记录
  333. xbDownload(id) {
  334. window.open(
  335. request.defaults.baseURL + "/apply/cggl/xbfiledownload?id=" + id,
  336. );
  337. },
  338. handleRemove() {
  339. qxyh.xbfile = null;
  340. qxyh.fileList = [];
  341. },
  342. handleChangeFile(file, fileList) {
  343. qxyh.xbfile = file.raw;
  344. qxyh.fileList = fileList;
  345. },
  346. xbSubmit() {
  347. if (!qxyh.instid) {
  348. ElMessage.error("请输入流程主键");
  349. } else {
  350. console.log("开始修编上传");
  351. const formdata = new FormData();
  352. formdata.append("instid", qxyh.instid);
  353. formdata.append("id", qxyh.xbid);
  354. reuploadThirdpartyReviseData(formdata).then((res) => {
  355. if (res.success) {
  356. ElMessage.success("修编上报成功");
  357. qxyh.dialogVisible = false;
  358. qxyh.xbfile = null;
  359. qxyh.fileList = [];
  360. } else {
  361. ElMessage.error("修编上报失败");
  362. }
  363. qxyh.getlist();
  364. });
  365. }
  366. },
  367. setXzqdm() {
  368. if (qxyh.xzqCode && qxyh.xzqCode.length > 0) {
  369. qxyh.formInline.divisionCode = qxyh.xzqCode[qxyh.xzqCode.length - 1];
  370. } else {
  371. qxyh.formInline.divisionCode = "";
  372. }
  373. console.log(qxyh.formInline.divisionCode);
  374. },
  375. upload(row) {
  376. qxyh.instid = row.instid;
  377. if (qxyh.formInline.planType == "1") {
  378. qxyh.ztghDialog = true;
  379. } else if (qxyh.formInline.planType == "2") {
  380. qxyh.ghcgscDialog = true;
  381. } else if (qxyh.formInline.planType == "3") {
  382. qxyh.ztghDialog = true;
  383. }
  384. },
  385. // 获取行政区
  386. getXzq() {
  387. GetXzq({ city: true }).then((res) => {
  388. if (res.success) {
  389. qxyh.xzoptions = proxy.$comfun.resetTree(res.data);
  390. qxyh.getlist();
  391. }
  392. });
  393. },
  394. // 审查报告
  395. download(row) {
  396. let id = row.id;
  397. let solId = row.solId;
  398. reportDownloadAction({
  399. id: id,
  400. solId: solId,
  401. }).then((res) => {
  402. if (res.type == "application/json") {
  403. ElMessage.info("质检审查报告暂没生成。");
  404. } else {
  405. let blob = new Blob([res], { type: "application/zip" });
  406. qxyh.ways(blob, ".zip");
  407. }
  408. });
  409. },
  410. //创建文件超链接并进行下载
  411. ways(blob, suffix, res) {
  412. let elink = document.createElement("a");
  413. elink.style.display = "none"; // 隐藏标签
  414. elink.href = window.URL.createObjectURL(blob); // 配置href
  415. // 获取后端返回的响应头中的名称
  416. // let filename = res.headers["content-disposition"];
  417. // let newFilename = filename.split(";")[1].split("=")[1];
  418. let newFilename = "report" + suffix;
  419. newFilename = decodeURIComponent(newFilename);
  420. elink.download = newFilename;
  421. elink.click();
  422. URL.revokeObjectURL(elink.href); // 释放URL 对象(弹出框进行下载)
  423. document.body.removeChild(elink); // 移除<a>标签
  424. },
  425. // 获取列表数据
  426. getlist2() {
  427. getxblist(qxyh.formInline).then((res) => {
  428. qxyh.tableData = res.data;
  429. qxyh.formInline.total = res.recordstotal || 999;
  430. });
  431. },
  432. // 获取列表数据
  433. getlist() {
  434. getxblist(qxyh.formInline).then((res) => {
  435. qxyh.formInline.current = 1;
  436. qxyh.tableData = res.data;
  437. qxyh.formInline.total = res.recordstotal || 999;
  438. });
  439. },
  440. });
  441. onMounted(() => {
  442. // qxyh.getlist();
  443. // qxyh.getXzq();
  444. qxyh.getXzq();
  445. });
  446. return { ...toRefs(qxyh) };
  447. },
  448. };
  449. </script>
  450. <style lang="less" scoped>
  451. .qxyh {
  452. .header {
  453. border-bottom: 1px solid rgb(230, 230, 230);
  454. justify-content: space-between;
  455. flex-wrap: nowrap;
  456. height: 60px;
  457. }
  458. .header-left {
  459. margin-left: 20px;
  460. }
  461. :deep(.el-form-item) {
  462. margin-bottom: 0;
  463. }
  464. .footer {
  465. width: 100%;
  466. padding: 10px;
  467. }
  468. }
  469. </style>
  470. <style lang="less">
  471. .popper-cascader {
  472. .el-cascader-menu {
  473. max-height: 400px;
  474. overflow: auto;
  475. height: inherit;
  476. }
  477. }
  478. .search-btn {
  479. position: absolute;
  480. right: -40px;
  481. }
  482. .dialog-footer {
  483. width: 100%;
  484. text-align: center;
  485. // position: absolute;
  486. bottom: 30px;
  487. }
  488. </style>