index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <template>
  2. <div class="snapshot-re-audit-citizen-Twenty-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <vxe-grid v-bind="gridOptions" ref="gridRef" @checkbox-all="selectAllChangeEvent" @checkbox-change="selectChangeEvent">
  5. <template #form>
  6. <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent :disabled="gridOptions.loading">
  7. <el-form-item label="审批状态" prop="Status">
  8. <el-select v-model="state.queryParams.Status" class="w100" placeholder="请选择审批状态" @change="handleQuery">
  9. <el-option v-for="item in statusOptions" :key="item.key" :label="item.value" :value="item.key" />
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="工单编码" prop="No">
  13. <el-input v-model="state.queryParams.No" placeholder="请填写工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  14. </el-form-item>
  15. <el-form-item label="工单标题" prop="Title">
  16. <el-input v-model="state.queryParams.Title" placeholder="请填写工单标题" clearable @keyup.enter="handleQuery" class="keyword-input" />
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  20. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  21. </el-form-item>
  22. </el-form>
  23. </template>
  24. <template #toolbar_buttons>
  25. <!--
  26. v-if="state.queryParams.Status === 1"-->
  27. <!-- <el-button type="primary" @click="onRemark" :disabled="isChecked" v-auth="'snapshot:reAudit:citizenTwenty:remark'">
  28. <SvgIcon name="ele-Plus" class="mr5" />添加备注
  29. </el-button>
  30. <el-button type="primary" @click="onSupply" v-auth="'snapshot:reAudit:citizenTwenty:supply'" :disabled="isChecked" :loading="state.loading"
  31. ><SvgIcon name="ele-Plus" class="mr5" />补充发放
  32. </el-button>-->
  33. </template>
  34. <template #statusTxt="{ row }">
  35. <el-text type="danger" tag="b" v-if="[1, 2, 3, 9, 101, 102, 103, 104, 105, 200].includes(row.status)">{{ row.statusTxt }}</el-text>
  36. <span v-else>{{ row.statusTxt }}</span>
  37. </template>
  38. <template #order_detail="{ row }">
  39. <order-detail :order="{ id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  40. </template>
  41. <template #action="{ row }">
  42. <template v-if="state.queryParams.Status === 0">
  43. <el-button link type="primary" @click="onAudit(row)" v-auth="'snapshot:reAudit:citizenTwenty:audit'"> 审批 </el-button>
  44. <el-button link type="danger" @click="onReturn(row)" v-auth="'snapshot:reAudit:citizenTwenty:return'"> 退回 </el-button>
  45. </template>
  46. <template v-if="state.queryParams.Status === 1">
  47. <el-button link type="primary" @click="onRemark(row)" v-auth="'snapshot:reAudit:citizenTwenty:remark'"> 添加备注 </el-button>
  48. <el-button link type="primary" @click="onSupply(row)" v-auth="'snapshot:reAudit:citizenTwenty:supply'"> 补充发放 </el-button>
  49. </template>
  50. </template>
  51. <template #pager>
  52. <pagination
  53. @pagination="queryList"
  54. :total="state.total"
  55. v-model:current-page="state.queryParams.PageIndex"
  56. v-model:page-size="state.queryParams.PageSize"
  57. :disabled="state.loading"
  58. />
  59. </template>
  60. </vxe-grid>
  61. </div>
  62. <!-- 更多查询 -->
  63. <el-drawer v-model="drawer" title="更多查询" size="500px">
  64. <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="110px">
  65. <el-form-item label="受理时间" prop="slTime">
  66. <el-date-picker
  67. v-model="state.queryParams.slTime"
  68. type="datetimerange"
  69. unlink-panels
  70. range-separator="至"
  71. start-placeholder="开始时间"
  72. end-placeholder="结束时间"
  73. :shortcuts="shortcuts"
  74. @change="handleQuery"
  75. value-format="YYYY-MM-DD[T]HH:mm:ss"
  76. :default-time="defaultTimeStartEnd"
  77. />
  78. </el-form-item>
  79. <el-form-item label="审批时间" prop="spTime">
  80. <el-date-picker
  81. v-model="state.queryParams.spTime"
  82. type="datetimerange"
  83. unlink-panels
  84. range-separator="至"
  85. start-placeholder="开始时间"
  86. end-placeholder="结束时间"
  87. :shortcuts="shortcuts"
  88. @change="handleQuery"
  89. value-format="YYYY-MM-DD[T]HH:mm:ss"
  90. :default-time="defaultTimeStartEnd"
  91. />
  92. </el-form-item>
  93. <el-form-item label="办结时间" prop="bjTime">
  94. <el-date-picker
  95. v-model="state.queryParams.bjTime"
  96. type="datetimerange"
  97. unlink-panels
  98. range-separator="至"
  99. start-placeholder="开始时间"
  100. end-placeholder="结束时间"
  101. :shortcuts="shortcuts"
  102. @change="handleQuery"
  103. value-format="YYYY-MM-DD[T]HH:mm:ss"
  104. :default-time="defaultTimeStartEnd"
  105. />
  106. </el-form-item>
  107. <el-form-item label="来电人电话" prop="FromPhone">
  108. <el-input v-model="state.queryParams.FromPhone" placeholder="请填写来电人电话" clearable @keyup.enter="handleQuery" />
  109. </el-form-item>
  110. <el-form-item label="网格员是否办理" prop="IsDeal">
  111. <el-select v-model="state.queryParams.IsDeal" class="w100" placeholder="请选择网格员是否办理" @change="handleQuery" clearable>
  112. <el-option label="是" :value="true" />
  113. <el-option label="否" :value="false" />
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="部门是否属实" prop="IsTruthDepartment">
  117. <el-select v-model="state.queryParams.IsTruthDepartment" class="w100" placeholder="请选择部门是否属实" @change="handleQuery" clearable>
  118. <el-option label="是" :value="true" />
  119. <el-option label="否" :value="false" />
  120. </el-select>
  121. </el-form-item>
  122. <el-form-item label="网格员是否属实" prop="IsTruth">
  123. <el-select v-model="state.queryParams.IsTruth" class="w100" placeholder="请选择网格员是否属实" @change="handleQuery" clearable>
  124. <el-option label="是" :value="true" />
  125. <el-option label="否" :value="false" />
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item label="是否发放红包" prop="IsIssued">
  129. <el-select v-model="state.queryParams.IsIssued" class="w100" placeholder="请选择是否发放红包" @change="handleQuery" clearable>
  130. <el-option label="是" :value="true" />
  131. <el-option label="否" :value="false" />
  132. </el-select>
  133. </el-form-item>
  134. <el-form-item label="行业类型" prop="IndustryId">
  135. <el-select v-model="state.queryParams.IndustryId" class="w100" placeholder="请选择行业类型" @change="handleQuery" clearable>
  136. <el-option v-for="item in industryOptions" :key="item.id" :label="item.name" :value="item.id" />
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item label="配置金额" prop="ConfigAmount">
  140. <el-select v-model="state.queryParams.ConfigAmount" class="w100" placeholder="请选择配置金额" @change="handleQuery">
  141. <el-option v-for="item in configAmountOptions" :key="item" :label="item" :value="item" />
  142. </el-select>
  143. </el-form-item>
  144. <el-form-item label="实发金额" prop="AcutalAmount">
  145. <el-input v-model="state.queryParams.AcutalAmount" placeholder="请填写实发金额" clearable @keyup.enter="handleQuery" />
  146. </el-form-item>
  147. <el-form-item label="审批(应发)金额" prop="ApprovedAmount" label-width="130px">
  148. <el-input v-model="state.queryParams.ApprovedAmount" placeholder="请填写审批(应发)金额" clearable @keyup.enter="handleQuery" />
  149. </el-form-item>
  150. <el-form-item label="是否安全生产" prop="IsIssued">
  151. <el-select v-model="state.queryParams.IsDanger" class="w100" placeholder="请选择是否安全生产" @change="handleQuery" clearable>
  152. <el-option label="是" :value="true" />
  153. <el-option label="否" :value="false" />
  154. </el-select>
  155. </el-form-item>
  156. </el-form>
  157. <template #footer>
  158. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  159. <el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
  160. </template>
  161. </el-drawer>
  162. <!-- 红包审批 -->
  163. <re-audit ref="reAuditRef" @updateList="queryList" />
  164. <!-- 红包退回 -->
  165. <re-return ref="reReturnRef" @updateList="queryList" />
  166. <!-- 红包补充 -->
  167. <re-supply ref="reSupplyRef" @updateList="queryList" />
  168. <!-- 红包备注 -->
  169. <re-remark ref="reRemarkRef" @updateList="queryList" />
  170. </div>
  171. </template>
  172. <script lang="tsx" setup name="snapshotReAuditCitizenTwenty">
  173. import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  174. import { ElMessage, FormInstance } from 'element-plus';
  175. import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  176. import { getCitizenRedEnvelopeApprovalBaseData, getCitizenRedEnvelopeApprovalList } from '@/api/snapshot/reAudit';
  177. import Other from '@/utils/other';
  178. // 引入组件
  179. const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
  180. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  181. const ReAudit = defineAsyncComponent(() => import('@/views/snapshot/reAudit/components/Re-audit.vue')); // 红包审批
  182. const ReReturn = defineAsyncComponent(() => import('@/views/snapshot/reAudit/components/Re-return.vue')); // 红包退回
  183. const ReRemark = defineAsyncComponent(() => import('@/views/snapshot/reAudit/components/Re-remark.vue')); // 红包备注
  184. const ReSupply = defineAsyncComponent(() => import('@/views/snapshot/reAudit/components/Re-supply.vue')); // 红包补充
  185. // 定义变量内容
  186. const state = reactive<any>({
  187. loading: false,
  188. queryParams: {
  189. // 查询参数
  190. PageIndex: 1,
  191. PageSize: 20,
  192. Status: 0, // 审批状态 默认审批
  193. No: null, // 工单编码
  194. Title: null, // 工单标题
  195. slTime: [], // 受理时间
  196. BeginCreationTime: null,
  197. EndCreationTime: null,
  198. spTime: [], // 审批时间
  199. BeginAuditTime: null,
  200. EndAuditTime: null,
  201. bjTime: [], // 办结时间
  202. BeginFiledTime: null,
  203. EndFiledTime: null,
  204. FromPhone: null, // 来电人电话
  205. IsDeal: null, // 网格员是否办理
  206. IsTruth: null, // 网格员是否属实
  207. IsTruthDepartment: null, // 部门是否属实
  208. IsIssued: null, // 是否发放红包
  209. IndustryId: null, // 行业
  210. CaseName: null, // 线索名称
  211. IndustryName: null, // 行业类型
  212. AcutalAmount: null, // 实发金额
  213. ApprovedAmount: null, // 审批金额
  214. IsDanger: null, // 是否安全生成
  215. ConfigAmount: 20, // 配置金额 默认写死
  216. },
  217. total: 0, // 总条数
  218. });
  219. const gridOptions = reactive<any>({
  220. loading: false,
  221. border: true,
  222. showOverflow: true,
  223. columnConfig: {
  224. resizable: true,
  225. },
  226. scrollY: {
  227. enabled: true,
  228. gt: 100,
  229. },
  230. toolbarConfig: {
  231. zoom: true,
  232. custom: true,
  233. refresh: {
  234. queryMethod: () => {
  235. handleQuery();
  236. },
  237. },
  238. slots: {
  239. buttons: 'toolbar_buttons',
  240. },
  241. },
  242. customConfig: {
  243. storage: true,
  244. },
  245. id: 'snapshotReSendCitizen',
  246. rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
  247. height: 'auto',
  248. columns: [
  249. { type: 'checkbox', width: 50, align: 'center' },
  250. {
  251. field: 'statusTxt',
  252. title: '工单状态',
  253. width: 110,
  254. slots: {
  255. default: 'statusTxt',
  256. },
  257. },
  258. {
  259. field: 'sourceChannel',
  260. title: '来源渠道',
  261. width: 110,
  262. },
  263. {
  264. field: 'no',
  265. title: '工单编码',
  266. width: 140,
  267. },
  268. {
  269. field: 'title',
  270. title: '工单标题',
  271. slots: { default: 'order_detail' },
  272. minWidth: 200,
  273. },
  274. {
  275. field: 'industryName',
  276. title: '行业',
  277. width: 120,
  278. },
  279. {
  280. field: 'industryCase',
  281. title: '线索分类',
  282. width: 120,
  283. },
  284. {
  285. field: 'isDanger',
  286. title: '标记为安全生产',
  287. width: 120,
  288. slots: {
  289. default: ({ row }) => {
  290. return row.isDanger === null ? '' : row.isDanger ? '是' : '否';
  291. },
  292. },
  293. },
  294. {
  295. field: 'fromName',
  296. title: '来电人姓名',
  297. width: 120,
  298. },
  299. {
  300. field: 'fromPhone',
  301. title: '来电人电话',
  302. width: 140,
  303. },
  304. {
  305. field: 'auditTime',
  306. title: '审批时间',
  307. formatter: 'formatDate',
  308. width: 160,
  309. },
  310. {
  311. field: 'approvedAmount',
  312. title: '审批金额',
  313. width: 100,
  314. },
  315. {
  316. field: 'acutalAmount',
  317. title: '实发金额',
  318. width: 100,
  319. },
  320. {
  321. field: 'replenishAmount',
  322. title: '补充发放金额',
  323. width: 120,
  324. },
  325. {
  326. field: 'isIssued',
  327. title: '市民奖励发放结果',
  328. width: 140,
  329. slots: {
  330. default: ({ row }) => {
  331. return row.isIssued === null ? '' : row.isIssued ? '已发放' : '未发放';
  332. },
  333. },
  334. },
  335. {
  336. field: 'citizenAward',
  337. title: '市民奖励',
  338. width: 100,
  339. },
  340. {
  341. field: 'recordRemark',
  342. title: '市民奖励发放备注',
  343. width: 140,
  344. },
  345. {
  346. field: 'county',
  347. title: '区域',
  348. width: 120,
  349. },
  350. {
  351. field: 'isRectify',
  352. title: '部门是否整改完成',
  353. width: 140,
  354. slots: {
  355. default: ({ row }) => {
  356. return row.isRectify === null ? '' : row.isRectify ? '是' : '否';
  357. },
  358. },
  359. },
  360. {
  361. field: 'isTruthDepartment',
  362. title: '部门是否属实',
  363. width: 120,
  364. slots: {
  365. default: ({ row }) => {
  366. return row.isTruthDepartment === null ? '' : row.isRepetition ? '是' : '否';
  367. },
  368. },
  369. },
  370. {
  371. field: 'isRepetition',
  372. title: '是否重复',
  373. width: 100,
  374. slots: {
  375. default: ({ row }) => {
  376. return row.isRepetition === null ? '' : row.isRepetition ? '是' : '否';
  377. },
  378. },
  379. },
  380. {
  381. field: 'isDeal',
  382. title: '网格员是否办理',
  383. width: 120,
  384. slots: {
  385. default: ({ row }) => {
  386. return row.isDeal === null ? '' : row.isDeal ? '是' : '否';
  387. },
  388. },
  389. },
  390. {
  391. field: 'networkENumber',
  392. title: '网格E通编号',
  393. width: 120,
  394. },
  395. {
  396. field: 'creationTime',
  397. title: '受理时间',
  398. formatter: 'formatDate',
  399. width: 160,
  400. },
  401. {
  402. field: 'orgLevelOneName',
  403. title: '一级部门',
  404. width: 140,
  405. },
  406. {
  407. field: 'auditStatusTxt',
  408. title: '审批状态',
  409. width: 100,
  410. },
  411. {
  412. field: 'auditName',
  413. title: '审批人',
  414. width: 120,
  415. },
  416. {
  417. field: 'auditOrgName',
  418. title: '审批部门',
  419. width: 140,
  420. },
  421. {
  422. field: 'auditRemark',
  423. title: '审批意见',
  424. width: 150,
  425. },
  426. {
  427. field: 'bankCardNo',
  428. title: '卡号',
  429. width: 150,
  430. },
  431. {
  432. field: 'openBank',
  433. title: '开户行',
  434. width: 150,
  435. },
  436. {
  437. title: '操作',
  438. width: 160,
  439. fixed: 'right',
  440. showOverflow: false,
  441. align: 'center',
  442. slots: { default: 'action' },
  443. },
  444. ],
  445. data: [],
  446. });
  447. /** 搜索按钮操作 节流操作 */
  448. const handleQuery = () => {
  449. state.queryParams.PageIndex = 1;
  450. queryList();
  451. };
  452. // 获取参数列表
  453. const requestParams = ref<EmptyObjectType>({});
  454. const queryList = () => {
  455. state.loading = true;
  456. gridOptions.loading = true;
  457. requestParams.value = Other.deepClone(state.queryParams);
  458. requestParams.value.BeginCreationTime = state.queryParams.slTime === null ? null : state.queryParams.slTime[0]; // 受理时间
  459. requestParams.value.EndCreationTime = state.queryParams.slTime === null ? null : state.queryParams.slTime[1];
  460. Reflect.deleteProperty(requestParams.value, 'slTime'); // 删除无用的参数
  461. requestParams.value.BeginAuditTime = state.queryParams.spTime === null ? null : state.queryParams.spTime[0]; // 审批时间
  462. requestParams.value.EndAuditTime = state.queryParams.spTime === null ? null : state.queryParams.spTime[1];
  463. Reflect.deleteProperty(requestParams.value, 'spTime'); // 删除无用的参数
  464. requestParams.value.BeginFiledTime = state.queryParams.bjTime === null ? null : state.queryParams.bjTime[0]; // 办结时间
  465. requestParams.value.EndFiledTime = state.queryParams.bjTime === null ? null : state.queryParams.bjTime[1];
  466. Reflect.deleteProperty(requestParams.value, 'bjTime'); // 删除无用的参数
  467. getCitizenRedEnvelopeApprovalList(requestParams.value)
  468. .then((res) => {
  469. state.loading = false;
  470. gridOptions.data = res.result.items ?? [];
  471. state.total = res.result.total ?? 0;
  472. gridOptions.loading = false;
  473. })
  474. .finally(() => {
  475. state.loading = false;
  476. gridOptions.loading = false;
  477. });
  478. };
  479. // 重置表单
  480. const drawerRuleFormRef = ref<RefType>();
  481. const ruleFormRef = ref<any>(null); // 表单ref
  482. const drawer = ref(false);
  483. const resetQuery = (formEl: FormInstance | undefined) => {
  484. if (!formEl) return;
  485. formEl.resetFields();
  486. ruleFormRef.value?.resetFields();
  487. queryList();
  488. };
  489. const checkTable = ref<EmptyArrayType>([]);
  490. const gridRef = ref<RefType>();
  491. const selectAllChangeEvent = ({ checked }) => {
  492. if (gridRef.value) {
  493. const records = gridRef.value.getCheckboxRecords();
  494. checkTable.value = records;
  495. console.log(checked ? '所有勾选事件' : '所有取消事件', records);
  496. }
  497. };
  498. const selectChangeEvent = ({ checked }) => {
  499. if (gridRef.value) {
  500. const records = gridRef.value.getCheckboxRecords();
  501. checkTable.value = records;
  502. console.log(checked ? '勾选事件' : '取消事件', records);
  503. }
  504. };
  505. const isChecked = computed(() => {
  506. return !Boolean(checkTable.value.length);
  507. });
  508. // 审批
  509. const reAuditRef = ref<RefType>();
  510. const onAudit = (row: any) => {
  511. reAuditRef.value.openDialog(row);
  512. };
  513. // 退回
  514. const reReturnRef = ref<RefType>();
  515. const onReturn = (row: any) => {
  516. reReturnRef.value.openDialog(row);
  517. };
  518. // 添加备注
  519. const reRemarkRef = ref<RefType>();
  520. const onRemark = (row: any) => {
  521. if (checkTable.value.length > 1) {
  522. ElMessage.warning('只能选择1个添加备注。');
  523. return;
  524. }
  525. reRemarkRef.value.openDialog(row);
  526. };
  527. // 补充
  528. const reSupplyRef = ref<RefType>();
  529. const onSupply = (row: any) => {
  530. if (checkTable.value.length > 1) {
  531. ElMessage.warning('只能添加1个补充发放。');
  532. return;
  533. }
  534. reSupplyRef.value.openDialog(row);
  535. };
  536. // 获取基础信息
  537. const statusOptions = ref<EmptyArrayType>([]); // 状态
  538. const industryOptions = ref<EmptyArrayType>([]); // 行业
  539. const configAmountOptions = ref<EmptyArrayType>([]);
  540. const getBaseData = async () => {
  541. try {
  542. const { result } = await getCitizenRedEnvelopeApprovalBaseData();
  543. statusOptions.value = result.status ?? [];
  544. statusOptions.value.push({
  545. key: -1,
  546. value: '全部',
  547. });
  548. industryOptions.value = result.industry ?? [];
  549. configAmountOptions.value = result.configAmount ?? [];
  550. } catch (e) {
  551. console.log(e);
  552. }
  553. };
  554. // 页面加载时
  555. onMounted(() => {
  556. queryList();
  557. getBaseData();
  558. });
  559. </script>