index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. <template>
  2. <div class="page-container list-container">
  3. <!-- 功能按钮区 -->
  4. <div class="list-btns-container">
  5. <el-dropdown trigger="click">
  6. <el-button type="primary" size="small">
  7. 其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
  8. </el-button>
  9. <template #dropdown>
  10. <el-dropdown-menu>
  11. <el-dropdown-item
  12. icon="Download"
  13. @click="handleExport"
  14. v-hasPermi="['business:housingFundDeclare:export']"
  15. >
  16. 导出</el-dropdown-item
  17. >
  18. <!-- <el-dropdown-item type="warning" size="small" icon="Download" @click="handleArea"
  19. v-hasPermi="['business:deposit:export']"> area</el-dropdown-item> -->
  20. </el-dropdown-menu>
  21. </template>
  22. </el-dropdown>
  23. </div>
  24. <!-- 搜索区 -->
  25. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
  26. <el-form-item label="客户名称:" prop="companyName">
  27. <el-input
  28. v-model="queryParams.companyName"
  29. placeholder="请输入客户名称"
  30. clearable
  31. style="width: 150px"
  32. @keyup.enter="handleQuery"
  33. size="small"
  34. />
  35. </el-form-item>
  36. <el-form-item label="所属月:">
  37. <el-date-picker
  38. v-model="currentMonth"
  39. type="month"
  40. format="YYYY年MM月"
  41. :clearable="false"
  42. value-format="YYYY-MM-01"
  43. @change="currentMonthChange"
  44. :disabled-date="disabledDateHandler"
  45. size="small"
  46. />
  47. </el-form-item>
  48. <el-form-item label="状态:">
  49. <el-select
  50. v-model.trim="queryParams.status"
  51. prop="status"
  52. size="small"
  53. type="text"
  54. placeholder="状态"
  55. :clearable="true"
  56. style="width: 130px"
  57. @clear="clearStatus"
  58. >
  59. <el-option
  60. v-for="item in selectStatus"
  61. :key="item.value"
  62. :label="item.label"
  63. :value="item.value"
  64. />
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="审核人:" prop="verifierName">
  68. <el-input size="small" v-model="queryParams.verifierName" placeholder="请输入审核人" clearable style="width: 130px"
  69. @keyup.enter="handleQuery" />
  70. </el-form-item>
  71. <el-form-item prop="dateFilter" label="审核时间:">
  72. <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
  73. format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
  74. end-placeholder="业务日期" style="width: 70%;"></el-date-picker>
  75. </el-form-item>
  76. <!-- <el-form-item v-if="tenant.versionId !== '4'" label="是否自己负责:" v-hasPermi="['business:funddeclare:person']">
  77. <el-switch v-model="oneself" @change="handleOneself" />
  78. </el-form-item> -->
  79. <el-form-item>
  80. <el-button type="primary" icon="Search" @click="handleQuery" size="small"
  81. >搜索</el-button
  82. >
  83. <el-button icon="operation" @click="moreSearch = true" size="small" >更多</el-button>
  84. <el-button icon="Refresh" @click="resetQuery" size="small" >重置</el-button>
  85. </el-form-item>
  86. </el-form>
  87. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" v-if="flag">
  88. <el-tab-pane label="全部" name="first">
  89. </el-tab-pane>
  90. <el-tab-pane label="我的" name="second">
  91. </el-tab-pane>
  92. </el-tabs>
  93. <!-- 列表区 -->
  94. <el-table
  95. v-loading="loading"
  96. :data="orderList"
  97. size="small"
  98. border
  99. height="100%"
  100. @selection-change="handleSelectionChange"
  101. >
  102. <el-table-column type="selection" width="55" align="center" />
  103. <el-table-column
  104. label="客户名称"
  105. min-width="250"
  106. align="center"
  107. prop="companyName"
  108. />
  109. <el-table-column
  110. label="来源"
  111. min-width="100"
  112. align="center"
  113. prop="fromCompanyName"
  114. />
  115. <el-table-column
  116. label="纳税性质"
  117. width="100"
  118. align="center"
  119. prop="taxType"
  120. />
  121. <el-table-column label="人员信息" width="100" align="center" prop="">
  122. <template #default="scope">
  123. <el-button
  124. v-if="scope.row.detail != null"
  125. link
  126. type="primary"
  127. size="small"
  128. @click="showMember(scope.row)"
  129. >查看</el-button
  130. >
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="申报填写" width="100" align="center" prop="">
  134. <template #default="scope">
  135. <el-button
  136. link
  137. type="primary"
  138. size="small"
  139. v-hasPermi="['business:housingFundDeclare:edit']"
  140. @click="fillIn(scope.row)"
  141. >{{
  142. scope.row.detail == null
  143. ? "填写"
  144. : scope.row.detail.status === 1
  145. ? "进行中"
  146. : "已填写"
  147. }}</el-button
  148. >
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="申报附件" width="100" align="center" prop="">
  152. <template #default="scope">
  153. <el-button
  154. size="small"
  155. type="primary"
  156. link
  157. :disabled="scope.row.detail == null || scope.row.detail.status <= 1"
  158. @click="showFiles(scope.row)"
  159. >查看文件</el-button
  160. >
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="状态" width="110" align="center" prop="">
  164. <template #default="scope">
  165. <div :style="getStatusStyle(scope.row)">
  166. {{ getStatusLabel(scope.row) }}
  167. <el-popover placement="top-start" width="250" trigger="hover">
  168. <div style="display: flex; flex-direction: row">
  169. <div
  170. v-for="item in selectStatus"
  171. :key="item.value"
  172. style="display: flex; flex-direction: row; margin-right: 10px"
  173. >
  174. <div
  175. :style="{
  176. backgroundColor: item.color,
  177. width: '14px',
  178. height: '14px',
  179. margin: 'auto',
  180. borderRadius: '50%',
  181. border: item.color === '#fff' ? '1px solid #ddd' : 'none',
  182. }"
  183. />
  184. <div
  185. style="
  186. display: inline-block;
  187. margin-left: 10px;
  188. line-height: 36px;
  189. font-size: 10px;
  190. "
  191. >
  192. {{ item.label }}
  193. </div>
  194. </div>
  195. </div>
  196. <template #reference>
  197. <span
  198. style="
  199. color: #fff;
  200. font-size: 12px;
  201. text-align: center;
  202. display: inline-block;
  203. line-height: 14px;
  204. width: 14px;
  205. height: 14px;
  206. background-color: #ccc;
  207. border-radius: 50%;
  208. "
  209. >?</span
  210. >
  211. </template>
  212. </el-popover>
  213. </div>
  214. </template>
  215. </el-table-column>
  216. <el-table-column
  217. label="执行人"
  218. width="80"
  219. align="center"
  220. prop="serviceName"
  221. />
  222. <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
  223. <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100"
  224. :show-overflow-tooltip="true" />
  225. <!-- <el-table-column label="操作" width="80" align="center" prop="">
  226. <template #default="scope">
  227. <el-button
  228. size="small"
  229. type="primary"
  230. link
  231. :disabled="
  232. scope.row.detail == null || scope.row.detail.status !== 3
  233. "
  234. v-hasPermi="['business:housingFundDeclare:verify']"
  235. @click="turnBack(scope.row.detail)"
  236. >退回</el-button
  237. >
  238. </template>
  239. </el-table-column> -->
  240. </el-table>
  241. <!-- 分页 -->
  242. <pagination
  243. v-show="total > 0"
  244. :total="total"
  245. v-model:page="queryParams.pageNum"
  246. v-model:limit="queryParams.pageSize"
  247. @pagination="getList"
  248. />
  249. <form-dialog ref="formDialogRef" :get-list="getList" />
  250. <view-dialog ref="viewDialogRef" :get-list="getList" />
  251. <member-dialog ref="memeberDialogRef" :get-list="getList" />
  252. <FileListDialog ref="fileListDialogRef" :get-list="getList" />
  253. <!-- 更多搜索弹窗 -->
  254. <el-dialog
  255. title="更多搜索"
  256. v-model="moreSearch"
  257. width="620px"
  258. append-to-body
  259. size="small"
  260. draggable
  261. :close-on-click-modal = "false"
  262. >
  263. <el-form
  264. :model="queryParams"
  265. ref="queryRef"
  266. size="small"
  267. label-width="100"
  268. >
  269. <el-row :gutter="20">
  270. <el-col :span="12">
  271. <el-form-item label="客户名称:" prop="companyName">
  272. <el-input
  273. v-model="queryParams.companyName"
  274. placeholder="请输入客户名称"
  275. clearable
  276. @keyup.enter="handleQuery"
  277. />
  278. </el-form-item>
  279. <el-form-item label="纳税性质:" prop="taxType">
  280. <el-select
  281. size="small"
  282. v-model="queryParams.taxType"
  283. placeholder="请选择纳税性质"
  284. :clearable="true"
  285. @change="taxTypeChange"
  286. >
  287. <el-option
  288. v-for="item in taxTypes"
  289. :key="item.label"
  290. :label="item.label"
  291. :value="item.value"
  292. />
  293. </el-select>
  294. </el-form-item>
  295. <el-form-item
  296. v-if="tenant.versionId === '4'"
  297. label="来源:"
  298. prop="fromCompanyName"
  299. >
  300. <el-input
  301. size="small"
  302. v-model="queryParams.fromCompanyName"
  303. type="text"
  304. placeholder="客户来源"
  305. :clearable="true"
  306. />
  307. </el-form-item>
  308. </el-col>
  309. <el-col :span="12">
  310. <el-form-item label="所属月:">
  311. <el-date-picker
  312. v-model="currentMonth"
  313. type="month"
  314. format="YYYY年MM月"
  315. :clearable="false"
  316. value-format="YYYY-MM-01"
  317. @change="currentMonthChange"
  318. :disabled-date="disabledDateHandler"
  319. />
  320. </el-form-item>
  321. <el-form-item label="状态:">
  322. <el-select
  323. v-model.trim="queryParams.status"
  324. prop="status"
  325. size="small"
  326. type="text"
  327. placeholder="状态"
  328. :clearable="true"
  329. @clear="clearStatus"
  330. >
  331. <el-option
  332. v-for="item in selectStatus"
  333. :key="item.value"
  334. :label="item.label"
  335. :value="item.value"
  336. />
  337. </el-select>
  338. </el-form-item>
  339. </el-col>
  340. </el-row>
  341. </el-form>
  342. <template #footer>
  343. <div class="dialog-footer">
  344. <el-button
  345. type="primary"
  346. icon="Finished"
  347. size="small"
  348. @click="handleQuery"
  349. >确 定</el-button
  350. >
  351. <el-button icon="close" size="small" @click="moreSearch = false"
  352. >取 消</el-button
  353. >
  354. </div>
  355. </template>
  356. </el-dialog>
  357. </div>
  358. </template>
  359. <script setup>
  360. import useUserStore from "@/store/modules/user";
  361. import {
  362. listHousingFundDeclare,
  363. turnBackDetail,
  364. exportHoisngFundDeclare,
  365. } from "@/api/business/production/housingFundDeclare";
  366. import { uploadFile } from "@/api/tool/file";
  367. import { listCompany } from "@/api/business/crm/company";
  368. import { ref } from "vue";
  369. import formDialog from "./form";
  370. import { taxTypes } from "@/utils/default";
  371. import viewDialog from "./view";
  372. import memberDialog from "../memberDialog";
  373. import FileListDialog from "../fileListDialog.vue";
  374. const { proxy } = getCurrentInstance();
  375. /** 字典数组区 */
  376. /** 查询 对象 */
  377. const tenant = useUserStore().tenant;
  378. const orderList = ref([]);
  379. const loading = ref(true);
  380. const ids = ref([]);
  381. const single = ref(true);
  382. const multiple = ref(true);
  383. const oneself = ref(false);
  384. const total = ref(0);
  385. const prev = ref([]);
  386. const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
  387. const showViewer = ref(false);
  388. const currentFileList = ref([]);
  389. const moreSearch = ref(false);
  390. const showIndex = ref(0);
  391. const formDialogRef = ref(null);
  392. const viewDialogRef = ref(null);
  393. const memeberDialogRef = ref(null);
  394. const fileListDialogRef = ref(null);
  395. const formOpen = ref(false);
  396. const currentMonth = ref(proxy.moment().format("YYYY-MM-01"));
  397. const form = ref({
  398. id: null,
  399. companyName: "",
  400. companyId: null,
  401. remark: "",
  402. type: 1,
  403. files: [],
  404. });
  405. const emptyForm = {
  406. id: null,
  407. companyName: "",
  408. companyId: null,
  409. type: 1,
  410. remark: "",
  411. files: [],
  412. };
  413. const permissions = useUserStore().permissions;
  414. const all_permission = "*:*:*";
  415. const flag = ref(checkPermission(['business:funddeclare:person']))
  416. const activeName = flag.value ? ref('first') : ref('second');
  417. const data = reactive({
  418. selectStatus: [
  419. {
  420. label: "未开始",
  421. value: 0,
  422. color: "#888",
  423. },
  424. {
  425. label: "进行中",
  426. value: 1,
  427. color: "#FFB836",
  428. },
  429. {
  430. label: "已完成",
  431. value: 3,
  432. color: "#2FCB81",
  433. },
  434. ],
  435. });
  436. const { selectStatus, selectMonths } = toRefs(data);
  437. const { verify_status } = proxy.useDict("verify_status");
  438. /** 查询对象 */
  439. const queryParams = ref({
  440. pageNum: 1,
  441. pageSize: 20,
  442. companyName: "",
  443. orderByColumn: "create_time",
  444. year: proxy.moment().format("YYYY"),
  445. month: proxy.moment().format("MM"),
  446. principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
  447. });
  448. /*********************** 方法区 ****************************/
  449. /** 查询company列表 */
  450. function getList() {
  451. loading.value = true;
  452. listHousingFundDeclare(queryParams.value).then((response) => {
  453. orderList.value = response.rows.map((l) => ({ ...l }));
  454. prev.value = proxy.deepClone(response.rows);
  455. total.value = response.total;
  456. loading.value = false;
  457. });
  458. }
  459. /** 是否为自己负责 */
  460. function handleOneself() {
  461. if (oneself.value) {
  462. queryParams.value.principal = useUserStore().user.userId;
  463. } else {
  464. queryParams.value.principal = null;
  465. }
  466. getList();
  467. }
  468. /** 搜索按钮操作 */
  469. function handleQuery() {
  470. queryParams.value.pageNum = 1;
  471. moreSearch.value = false;
  472. getList();
  473. }
  474. /** 重置按钮操作 */
  475. function resetQuery() {
  476. queryParams.value = {
  477. pageNum: 1,
  478. pageSize: 20,
  479. companyName: "",
  480. year: proxy.moment().format("YYYY"),
  481. month: proxy.moment().format("MM"),
  482. };
  483. currentMonth.value = proxy.moment().format("YYYY-MM-01");
  484. if (activeName.value != null && activeName.value === 'second') {
  485. queryParams.value.principal = useUserStore().user.userId;
  486. }
  487. handleQuery();
  488. }
  489. // 多选框选中数据
  490. function handleSelectionChange(selection) {
  491. ids.value = selection.map((item) => item.id);
  492. single.value = selection.length != 1;
  493. multiple.value = !selection.length;
  494. }
  495. /** 导出按钮操作 */
  496. function handleExport() {
  497. exportHoisngFundDeclare(queryParams.value);
  498. }
  499. function openFollowFile(arg) {
  500. // console.log(arg)
  501. const attach = arg;
  502. window.open(`${arg.url}`, arg.fileName);
  503. }
  504. function showFileList(row) {
  505. currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
  506. showViewer.value = true;
  507. }
  508. function closeImages() {
  509. showViewer.value = false;
  510. }
  511. function showMember(row) {
  512. memeberDialogRef.value.open({
  513. companyId: row.companyId,
  514. year: queryParams.value.year,
  515. month: queryParams.value.month,
  516. });
  517. }
  518. function fillIn(row) {
  519. // 判断选中行的状态
  520. if (row.detail != null) {
  521. const detail = row.detail;
  522. directDialog(detail);
  523. } else {
  524. const detail = {
  525. housingFundDeclareId: row.id,
  526. companyId: row.companyId,
  527. companyName: row.companyName,
  528. month: queryParams.value.month,
  529. year: queryParams.value.year,
  530. };
  531. directDialog(detail);
  532. }
  533. }
  534. function directDialog(detail) {
  535. if (detail.status === 0 || detail.status == null) {
  536. if (editable()) {
  537. formDialogRef.value.open(detail);
  538. } else {
  539. proxy.$modal.msgError("没有权限");
  540. }
  541. } else if (detail.status === 1 || detail.status === 4) {
  542. if (editable()) {
  543. formDialogRef.value.open(detail);
  544. } else if (viewable() || verifiable()) {
  545. viewDialogRef.value.open(detail);
  546. } else {
  547. proxy.$modal.msgError("没有权限");
  548. }
  549. } else if (detail.status === 2 || detail.status === 3) {
  550. if (editable() || viewable() || verifiable()) {
  551. viewDialogRef.value.open(detail);
  552. } else {
  553. proxy.$modal.msgError("没有权限");
  554. }
  555. }
  556. }
  557. function viewable() {
  558. return (
  559. permissions.includes(all_permission) ||
  560. permissions.includes("business:housingFundDeclare:view")
  561. );
  562. }
  563. function editable() {
  564. return (
  565. permissions.includes(all_permission) ||
  566. permissions.includes("business:housingFundDeclare:edit")
  567. );
  568. }
  569. function verifiable() {
  570. return (
  571. permissions.includes(all_permission) ||
  572. permissions.includes("business:housingFundDeclare:verify")
  573. );
  574. }
  575. function showFiles(row) {
  576. fileListDialogRef.value.open(row.detail);
  577. }
  578. function getStatusStyle(row) {
  579. if (row.detail == null) {
  580. return { color: getStatusColor(0), verticalAlign: "middle" };
  581. } else {
  582. return {
  583. color: getStatusColor(row.detail.status),
  584. verticalAlign: "middle",
  585. };
  586. }
  587. }
  588. function getStatusColor(status) {
  589. const index = selectStatus.value.findIndex((v) => v.value === status);
  590. return index >= 0 ? selectStatus.value[index].color : "#fff";
  591. }
  592. function getStatusLabel(row) {
  593. const index = selectStatus.value.findIndex(
  594. (v) => v.value === (row.detail == null ? 0 : row.detail.status)
  595. );
  596. return index >= 0 ? selectStatus.value[index].label : "";
  597. }
  598. function turnBack(detail) {
  599. turnBackDetail(detail)
  600. .then((res) => {
  601. getList();
  602. })
  603. .catch((err) => {
  604. proxy.$modal.msgError(err.message);
  605. });
  606. }
  607. function checkPermission(templatePermission) {
  608. const all_permission = "*:*:*";
  609. const permissions = useUserStore().permissions;
  610. const hasPermissions = permissions.some((permission) => {
  611. return (
  612. all_permission === permission || templatePermission.includes(permission)
  613. );
  614. });
  615. return hasPermissions;
  616. }
  617. function handleClick(tab) {
  618. console.log(tab.props.name)
  619. if (tab.props.name === "second") {
  620. oneself.value = true
  621. handleOneself()
  622. } else {
  623. oneself.value = false
  624. handleOneself()
  625. }
  626. }
  627. function currentMonthChange(arg) {
  628. const year = proxy.moment(arg).format("YYYY");
  629. const month = proxy.moment(arg).format("MM");
  630. queryParams.value.year = year;
  631. queryParams.value.month = month;
  632. handleQuery();
  633. }
  634. function clearStatus() {
  635. queryParams.value.status = null;
  636. }
  637. function disabledDateHandler(date) {
  638. if (date <= proxy.moment()) {
  639. return false;
  640. } else {
  641. return true;
  642. }
  643. }
  644. getList();
  645. </script>