dataApprove copy.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <template>
  2. <a-layout>
  3. <a-layout-content>
  4. <div class="page" style="display: flex;background-color: #fff;">
  5. <div class="leftTree">
  6. <ul>
  7. <!-- <li :class="{'active':isActive=='603'}" @click="showDetail('603')">测试</li>-->
  8. <li :class="{'active':isActive=='615'}" @click="showDetail('615')">大中型水闸工程督查填报</li>
  9. <li :class="{'active':isActive=='616'}" @click="showDetail('616')">堤防工程督查填报</li>
  10. <li :class="{'active':isActive=='617'}" @click="showDetail('617')">农村水电站督查填报</li>
  11. <li :class="{'active':isActive=='618'}" @click="showDetail('618')">取用水管理监督督查填报</li>
  12. <li :class="{'active':isActive=='619'}" @click="showDetail('619')">山洪灾害县水利局督查填报</li>
  13. <li :class="{'active':isActive=='620'}" @click="showDetail('620')">山洪灾害预警广播站督查填报</li>
  14. <li :class="{'active':isActive=='621'}" @click="showDetail('621')">水资源重点工作督查填报</li>
  15. <li :class="{'active':isActive=='622'}" @click="showDetail('622')">万人以上农饮工程督查填报</li>
  16. <li :class="{'active':isActive=='623'}" @click="showDetail('623')">万人以下工程农饮工程督查填报</li>
  17. <li :class="{'active':isActive=='624'}" @click="showDetail('624')">小型水闸工程督查填报</li>
  18. <li :class="{'active':isActive=='625'}" @click="showDetail('625')">饮用水水源地督查填报</li>
  19. <li :class="{'active':isActive=='626'}" @click="showDetail('626')">用水统计督查填报</li>
  20. <li :class="{'active':isActive=='627'}" @click="showDetail('627')">自动监测站点督查填报</li>
  21. <li :class="{'active':isActive=='628'}" @click="showDetail('628')">小型水库督查填报</li>
  22. <li :class="{'active':isActive=='629'}" @click="showDetail('629')">大中型水库督查填报</li>
  23. </ul>
  24. </div>
  25. <div class="rightContent">
  26. <a-form layout="inline" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" class="demo-form-inline">
  27. <a-form-item label="原督查对象名称" style="width: 24%;">
  28. <a-input v-model:value="searchObj.nm" allow-clear placeholder="原督查对象名称" />
  29. </a-form-item>
  30. <!-- <a-form-item label="行政区名称" style="width: 24%;">
  31. <addvSearch
  32. v-model="searchObj.adFullName"
  33. :maxHeight="300"
  34. :maxWidth="250"
  35. :rootAddCode="curAdcode_long"
  36. :level="&quot;3&quot;"
  37. :nameOrCode="'name'"></addvSearch>
  38. </a-form-item> -->
  39. <a-form-item label="调整方式" style="width: 24%;">
  40. <a-select v-model:value="searchObj.adjustWay" placeholder="调整方式" allow-clear style="margin-left:10px;margin-right:15px">
  41. <a-select-option value="1">数据调整</a-select-option>
  42. <a-select-option value="2">逻辑删除</a-select-option>
  43. </a-select>
  44. </a-form-item>
  45. <a-form-item>
  46. <a-button type="primary" icon="appstore" @click="agreeShow" :disabled="!multipleSelection || multipleSelection.length==0">批量审核</a-button>
  47. </a-form-item>
  48. <a-form-item>
  49. <a-button type="primary" ghost @click="searchPlan">查询</a-button>
  50. </a-form-item>
  51. </a-form>
  52. <a-table
  53. :data-source="tableData"
  54. :columns="columns"
  55. :pagination="false"
  56. row-key="id"
  57. style="width: 100%;"
  58. :style="{ height: tableHeight + 'px' }"
  59. :row-selection="rowSelection"
  60. :scroll="{y:tableHeight-60}"
  61. bordered>
  62. <template slot="index" slot-scope="text, recode, index">
  63. <span>{{ (pageIndex - 1) * pageSize + (index + 1) }}</span>
  64. </template>
  65. <template slot="adjustWay" slot-scope="text">
  66. <span v-if="text.adjustWay == '1'">数据调整</span>
  67. <span v-if="text.adjustWay == '2'">逻辑删除</span>
  68. </template>
  69. <template slot="auditStatus" slot-scope="text">
  70. <span :style="{color:text.buttonCss}">{{ text.auditStatus }}</span>
  71. </template>
  72. <template slot="action" slot-scope="text">
  73. <a-button type="primary" size="small" @click="showFileList(text)">相关文件</a-button>
  74. <a-button type="primary" size="small" @click="showApprove(text)">查看</a-button>
  75. <a-button type="primary" size="small" @click="showRecord(text)">记录</a-button>
  76. </template>
  77. </a-table>
  78. <a-pagination
  79. show-size-changer
  80. :pageSize="pageSize" @update:pageSize="pageSize = $event"
  81. :total="total"
  82. :page-size-options="['10', '20', '30', '40']"
  83. :show-total="total => `共${total}条`"
  84. @showSizeChange="handleSizeChange"
  85. @change="handleCurrentChange"
  86. style="margin-top: 10px;" />
  87. </div>
  88. </div>
  89. <a-modal :title="editTitle+'信息调整申请'" :open="isEditShow" width="30%" @cancel="isEditShow=false">
  90. <a-form :model="editForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" ref="editForm" class="demo-ruleForm">
  91. <a-form-item label="调整方式">
  92. {{ editForm.adjustWay=='1'?'数据调整':'逻辑删除' }}
  93. </a-form-item>
  94. <a-form-item label="对象名称">
  95. {{ editForm.nm }}
  96. </a-form-item>
  97. <a-form-item label="原所属区划" v-show="editForm.adjustWay=='1'">
  98. {{ editForm.adName }}
  99. </a-form-item>
  100. <a-form-item label="调整后区划" v-show="editForm.adjustWay=='1'">
  101. {{ editForm.newAdName }}
  102. </a-form-item>
  103. <a-form-item label="所属区划" v-show="editForm.adjustWay=='2'">
  104. {{ editForm.adName }}
  105. </a-form-item>
  106. <a-form-item :label="editForm.adjustWay=='1'?'调整说明':'删除原因'">
  107. {{ editForm.adjustRecord }}
  108. </a-form-item>
  109. </a-form>
  110. <span slot="footer" class="dialog-footer" style="display: flex;justify-content: center;" v-if="editForm.button">
  111. <a-button type="primary" @click="agree(1)" :disabled="isLoadingBtn">同 意</a-button>
  112. <a-button type="danger" @click="agree(2)" :disabled="isLoadingBtn">驳 回</a-button>
  113. </span>
  114. </a-modal>
  115. <adjustment :bizId="bizId" :bizType="bizType" v-if="isAdjust" @jqmmDialogClose="jqmmDialogClose"></adjustment>
  116. <a-modal :title="recordTitle+'数据调整记录'" :open="isRecord" width="40%" @cancel="isRecord=false">
  117. <span style="display: block;max-height:500px;overflow:auto;padding: 20px">
  118. <a-timeline v-if="activities && activities.length>0">
  119. <a-timeline-item v-for="(activity, index) in activities" :key="index" color="#3fa4ff">
  120. <p style="font-size: 18px;font-weight: bold;">{{ activity.timestamp }}</p>
  121. <p style="font-size: 18px;">{{ activity.title }}</p>
  122. <p style="font-size: 15px;">{{ activity.detail }}</p>
  123. </a-timeline-item>
  124. </a-timeline>
  125. <div
  126. style="width:100%;height:100%;display: flex;align-items: center;justify-content: center;font-size: 20px;font-weight: bold"
  127. v-else>无记录</div>
  128. </span>
  129. </a-modal>
  130. <a-modal
  131. :title="'批量审核'"
  132. :open="isApprove"
  133. width="300px"
  134. @cancel="isApprove=false"
  135. :footer="null">
  136. <span style="display:block;text-align: center;">
  137. <a-button type="primary" @click="batchAgree(1)" :disabled="isLoadingBtn">同意</a-button>
  138. <a-button type="warning" @click="batchAgree(2)" :disabled="isLoadingBtn">驳回</a-button>
  139. </span>
  140. </a-modal>
  141. </a-layout-content>
  142. </a-layout>
  143. </template>
  144. <script>
  145. import { curAdcode_long } from '../../utils/global_variable';
  146. import request from '../../utils/gw_ajax_request.js';
  147. import { dateFormat } from '../../utils/gw_date.js';
  148. import addvSearch from '../../widgets/addvSearch.vue';
  149. import adjustment from './adjustment';
  150. export default {
  151. components: {
  152. addvSearch,
  153. adjustment,
  154. },
  155. data() {
  156. return {
  157. tableHeight: window.innerHeight - 250,
  158. loading: false,
  159. pageIndex: 1,
  160. total: 0,
  161. pageSize: 10,
  162. addDialogVisible: false,
  163. formLabelWidth: 80,
  164. addObj: {},
  165. searchObj: {
  166. nm: '',
  167. adFullName: '',
  168. adjustWay: '',
  169. },
  170. userRole: '',
  171. dialogTitle: '添加',
  172. tableData: [],
  173. isActive: '615',
  174. editTitle: '',
  175. editForm: {},
  176. isEditShow: false,
  177. isLoadingBtn: false,
  178. bizId: '',
  179. bizType: '',
  180. isAdjust: false,
  181. isEditRecordShow: false,
  182. isRecord: false,
  183. activities: [],
  184. recordTitle: '',
  185. multipleSelection: [],
  186. isApprove: false,
  187. selectedRowKeys: [],
  188. columns: [
  189. {
  190. title: '序号',
  191. dataIndex: 'index',
  192. width: 80,
  193. align: 'center',
  194. ellipsis: true,
  195. },
  196. {
  197. title: '督查对象名称',
  198. dataIndex: 'nm',
  199. align: 'center',
  200. ellipsis: true,
  201. },
  202. {
  203. title: '原所属区划',
  204. dataIndex: 'adName',
  205. align: 'center',
  206. ellipsis: true,
  207. },
  208. {
  209. title: '调整后区划',
  210. dataIndex: 'newAdName',
  211. align: 'center',
  212. ellipsis: true,
  213. },
  214. {
  215. title: '调整方式',
  216. dataIndex: 'adjustWay',
  217. align: 'center',
  218. ellipsis: true,
  219. },
  220. {
  221. title: '状态',
  222. dataIndex: 'auditStatus',
  223. align: 'center',
  224. ellipsis: true,
  225. },
  226. {
  227. title: '操作',
  228. dataIndex: 'action',
  229. align: 'center',
  230. ellipsis: true,
  231. },
  232. ],
  233. };
  234. },
  235. computed: {
  236. userId: () =>
  237. localStorage.getItem('persId')
  238. ? localStorage.getItem('persId')
  239. : '1098101939614724096',
  240. curAdcode_long() {
  241. return curAdcode_long;
  242. },
  243. rowSelection() {
  244. return {
  245. selectedRowKeys: this.selectedRowKeys,
  246. onChange: this.handleSelectionChange,
  247. getCheckboxProps: (record) => ({
  248. props: {
  249. disabled: record.button === false,
  250. },
  251. }),
  252. };
  253. },
  254. },
  255. created() {},
  256. mounted() {
  257. this.searchPlan();
  258. },
  259. methods: {
  260. agreeShow() {
  261. this.isApprove = true;
  262. },
  263. selected(row, index) {
  264. if (row.button) {
  265. return true;
  266. } else {
  267. return false;
  268. }
  269. },
  270. handleSelectionChange(val, row) {
  271. this.selectedRowKeys = val;
  272. this.multipleSelection = row;
  273. },
  274. showRecord(row) {
  275. this.recordTitle = row.nm;
  276. this.isRecord = true;
  277. this.activities = [];
  278. var params = {
  279. objId: row.objId,
  280. };
  281. request
  282. .post('/bis/insp/gnrlRgstrAdjust/findDtoList', params)
  283. .then((res) => {
  284. if (res.success) {
  285. if (res.data && res.data.length > 0) {
  286. var data = res.data;
  287. var dataList = [];
  288. data.forEach((item) => {
  289. var updateContent = item.detail;
  290. item.auditList.forEach((item1) => {
  291. var date = new Date(item1.intm);
  292. var timestamp =
  293. date.getFullYear() +
  294. '年' +
  295. (date.getMonth() + 1) +
  296. '月' +
  297. date.getDate() +
  298. '日';
  299. dataList.push({
  300. title: item1.roleName + '-' + item1.auditPersName,
  301. timestamp: timestamp,
  302. detail: item1.opStatus + ',' + updateContent,
  303. });
  304. });
  305. });
  306. this.activities = dataList;
  307. }
  308. } else {
  309. this.$message.error(res.message);
  310. }
  311. })
  312. .catch((res) => {
  313. this.$message.error('请求错误' + res.message);
  314. });
  315. },
  316. jqmmDialogClose() {
  317. this.isAdjust = false;
  318. },
  319. showFileList(row) {
  320. this.bizId = row.id;
  321. this.bizType = 'adjustment';
  322. this.isAdjust = true;
  323. },
  324. batchAgree(type) {
  325. this.isLoadingBtn = true;
  326. var list = [];
  327. this.multipleSelection.forEach((item) => {
  328. list.push({
  329. id: item.id,
  330. auditWay: type,
  331. });
  332. });
  333. this.$confirm({
  334. title: '提示',
  335. content: `确认要批量${type == '1' ? '同意' : '驳回'}, 是否继续?`,
  336. okType: 'warning',
  337. onOk: () => {
  338. request
  339. .post(
  340. '/bis/insp/gnrlRgstrAdjust/batchAgreeToDismissFlowStatus',
  341. list,
  342. )
  343. .then((res) => {
  344. if (res.success) {
  345. this.isLoadingBtn = false;
  346. this.isApprove = false;
  347. this.searchPlan();
  348. }
  349. });
  350. },
  351. onCancel: () => {
  352. this.isLoadingBtn = false;
  353. this.$message.info('已取消删除');
  354. },
  355. });
  356. },
  357. agree(type) {
  358. this.isLoadingBtn = true;
  359. var obj = {
  360. id: this.editForm.id,
  361. auditWay: type,
  362. };
  363. request
  364. .post('/bis/insp/gnrlRgstrAdjust/agreeToDismissFlowStatus', obj)
  365. .then((res) => {
  366. if (res.success) {
  367. this.isLoadingBtn = false;
  368. this.isEditShow = false;
  369. this.searchPlan();
  370. }
  371. });
  372. },
  373. showApprove(row) {
  374. this.isLoadingBtn = false;
  375. this.editForm = row;
  376. this.editTitle = row.nm;
  377. this.isEditShow = true;
  378. },
  379. showDetail(type) {
  380. this.isActive = type;
  381. this.searchPlan();
  382. },
  383. formatDate(row, column) {
  384. if (row[column.property]) {
  385. return dateFormat(row[column.property], 'yyyy-MM-dd');
  386. }
  387. },
  388. searchPlan() {
  389. this.loading = true;
  390. this.searchObj.type = this.isActive;
  391. this.searchObj.pageNum = this.pageIndex;
  392. this.searchObj.pageSize = this.pageSize;
  393. // this.searchObj.userRole = this.$route.params.id
  394. this.searchObj.userRole = this.$route.path.substring(
  395. this.$route.path.length - 1,
  396. );
  397. request
  398. .post('/bis/insp/gnrlRgstrAdjust/findList', this.searchObj)
  399. .then((res) => {
  400. if (res.success) {
  401. this.tableData = res.data.list;
  402. this.total = res.data.total;
  403. this.loading = false;
  404. this.multipleSelection = [];
  405. this.$nextTick(() => {
  406. // _self.$refs.myTable.doLayout()
  407. // _self.$refs.myTable.clearSelection()
  408. this.selectedRowKeys = [];
  409. });
  410. }
  411. });
  412. },
  413. addPlanDialog() {
  414. this.addDialogVisible = true;
  415. this.addObj = {};
  416. this.dialogTitle = '添加';
  417. },
  418. handleSizeChange(size, val) {
  419. this.pageSize = val;
  420. this.searchPlan();
  421. },
  422. handleCurrentChange(val) {
  423. this.pageIndex = val;
  424. this.searchPlan();
  425. },
  426. },
  427. watch: {
  428. $route(to, from) {
  429. this.searchPlan();
  430. },
  431. },
  432. };
  433. </script>
  434. <style lang='less' scoped>
  435. .active {
  436. background: #00b0f0;
  437. color: white;
  438. }
  439. .el-container {
  440. width: 100%;
  441. height: 100%;
  442. }
  443. .leftTree {
  444. overflow: auto;
  445. }
  446. .leftTree ul {
  447. width: 100%;
  448. padding: 0px;
  449. margin: 0;
  450. }
  451. .leftTree ul li {
  452. width: 100%;
  453. height: 40px;
  454. line-height: 40px;
  455. text-align: left;
  456. text-indent: 10px;
  457. border-bottom: 1px solid #eeeeee;
  458. font-size: 14px;
  459. cursor: pointer;
  460. text-align: center;
  461. }
  462. .demo-form-inline {
  463. padding-top: 10px;
  464. padding-left: 10px;
  465. padding-right: 10px;
  466. }
  467. .page {
  468. width: 100%;
  469. height: 100%;
  470. margin: 0;
  471. padding: 0;
  472. }
  473. .leftTree {
  474. width: 300px;
  475. height: calc(100% - 20px);
  476. margin-top: 10px;
  477. margin-left: 10px;
  478. box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
  479. }
  480. .rightContent {
  481. width: calc(100% - 330px);
  482. height: calc(100% - 20px);
  483. margin-top: 10px;
  484. margin-left: 10px;
  485. box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
  486. }
  487. .rightContent /deep/ .el-tabs--border-card {
  488. width: 100%;
  489. height: 100%;
  490. border: 0;
  491. }
  492. .rightContent /deep/ .ant-table-content {
  493. height: calc(100% - 70px);
  494. }
  495. .rightContent /deep/ .el-tab-pane {
  496. height: 100%;
  497. }
  498. .tabs_detail1 .ant-table {
  499. height: 100% !important;
  500. }
  501. .tabs_detail1 /deep/ .el-table__body-wrapper {
  502. height: calc(100% - 40px);
  503. overflow: auto;
  504. }
  505. .tabs_detail2 .el-table {
  506. height: calc(100% - 80px) !important;
  507. }
  508. .tabs_detail2 /deep/.el-table__body-wrapper {
  509. height: calc(100% - 40px);
  510. overflow: auto;
  511. }
  512. </style>