index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  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 icon="Download" @click="handleExport" v-hasPermi="['business:detail:export']">
  12. 导出</el-dropdown-item>
  13. </el-dropdown-menu>
  14. </template>
  15. </el-dropdown>
  16. </div>
  17. <!-- 搜索区 -->
  18. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
  19. <el-form-item label="客户名称:">
  20. <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称" :clearable="true"
  21. style="width: 130px" />
  22. </el-form-item>
  23. <el-form-item label="客户标签:">
  24. <el-select size="small" v-model="queryParams.customerLabelId" style="width:130px" clearable>
  25. <el-option v-for="item in options" :key="item.id" :label="item.lable" :value="item.id" />
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="所属期:" prop="year">
  29. <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月" style="width: 130px" :clearable="false"
  30. value-format="YYYY-MM-01" :disabled-date="disabledDateHandler" @change="monthChangeHandler" />
  31. </el-form-item>
  32. <el-form-item label="个税状态:">
  33. <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true" style="width: 130px">
  34. <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="审核人:" prop="verifierName">
  38. <el-input size="small" v-model="queryParams.verifierName" placeholder="请输入审核人" clearable style="width: 130px"
  39. @keyup.enter="handleQuery" />
  40. </el-form-item>
  41. <el-form-item prop="dateFilter" label="审核时间:">
  42. <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
  43. format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
  44. end-placeholder="业务日期" style="width: 70%;"></el-date-picker>
  45. </el-form-item>
  46. <!-- <el-form-item v-if="tenant.versionId !== '4'" label="是否自己负责:" v-hasPermi="['business:individual:person']">
  47. <el-switch v-model="oneself" @change="handleOneself" />
  48. </el-form-item> -->
  49. <el-form-item>
  50. <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
  51. <el-button icon="Operation" @click="moreSearch = true" size="small">更多</el-button>
  52. <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
  53. </el-form-item>
  54. </el-form>
  55. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" v-if="flag">
  56. <el-tab-pane label="全部" name="first"> </el-tab-pane>
  57. <el-tab-pane label="我的" name="second"> </el-tab-pane>
  58. </el-tabs>
  59. <!-- 列表区 -->
  60. <el-table v-loading="loading" :data="detailList" size="small" border height="100%"
  61. @selection-change="handleSelectionChange">
  62. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  63. <el-table-column label="客户名称" align="center" prop="companyName" min-width="250">
  64. <template #default="scope">
  65. <div style="display: flex; align-items: center; ">
  66. <template v-if="scope.row.customerLabelName ">
  67. <el-tooltip :content="scope.row.customerLabelName" placement="top">
  68. <el-icon :size="15">
  69. <CollectionTag />
  70. </el-icon>
  71. </el-tooltip>
  72. <span style="padding-left:5px;">{{ scope.row.companyName }}</span>
  73. </template>
  74. <template v-else>
  75. <div style="width: 20px; height: 15px;"></div>
  76. <span>{{ scope.row.companyName }}</span>
  77. </template>
  78. </div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="客户名称" align="center" prop="companyName" min-width="250" />
  82. <el-table-column label="来源" align="center" prop="fromCompanyName" width="180" />
  83. <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
  84. <el-table-column label="人员信息" align="center">
  85. <template #default="scope">
  86. <el-button v-show="scope.row.detail != null" link type="primary" size="small" @click="showMember(scope.row)"
  87. v-hasPermi="['business:tax:wageList']">查看</el-button>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="个税填写" align="center" prop="evidenceFile">
  91. <template #default="scope">
  92. <el-button type="primary" link size="small" v-hasPermi="['business:individualIncomeTaxDetail:saveDetail']"
  93. @click="fillIn(scope.row)">{{
  94. scope.row.detail == null
  95. ? "填写"
  96. : scope.row.detail.status === 1
  97. ? "进行中"
  98. : "已填写"
  99. }}</el-button>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="个税附件" align="center" prop="content">
  103. <template #default="scope">
  104. <el-button type="primary" link size="small" v-hasPermi="['business:individualIncomeTaxDetail:query']"
  105. :disabled="
  106. scope.row.detail == null || scope.row.detail.evidenceFile === ''
  107. " @click="showFiles(scope.row)">查看文件</el-button>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="状态" align="center" prop="verifyContent">
  111. <template #default="scope">
  112. <div :style="getStatusStyle(scope.row)">
  113. {{ getStatusLabel(scope.row) }}
  114. <el-popover placement="top-start" width="250" trigger="hover">
  115. <div style="display: flex; flex-direction: row">
  116. <div v-for="item in selectStatus" :key="item.value"
  117. style="display: flex; flex-direction: row; margin-right: 10px">
  118. <div :style="{
  119. backgroundColor: item.color,
  120. width: '14px',
  121. height: '14px',
  122. margin: 'auto',
  123. borderRadius: '50%',
  124. border: item.color === '#fff' ? '1px solid #ddd' : 'none',
  125. }" />
  126. <div style="
  127. display: inline-block;
  128. margin-left: 10px;
  129. line-height: 36px;
  130. font-size: 10px;
  131. ">
  132. {{ item.label }}
  133. </div>
  134. </div>
  135. </div>
  136. <template #reference>
  137. <span style="
  138. color: #fff;
  139. font-size: 12px;
  140. text-align: center;
  141. display: inline-block;
  142. line-height: 14px;
  143. width: 14px;
  144. height: 14px;
  145. background-color: #ccc;
  146. border-radius: 50%;
  147. ">?</span>
  148. </template>
  149. </el-popover>
  150. </div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="执行人" align="center" prop="serviceName" />
  154. <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
  155. <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100"
  156. :show-overflow-tooltip="true" />
  157. <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="150"
  158. :show-overflow-tooltip="true" />
  159. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  160. <template #default="scope">
  161. <el-button size="small" type="text" :disabled="
  162. scope.row.detail == null || scope.row.detail.status !== 3
  163. " @click="turnBack(scope.row.detail)" v-hasPermi="[
  164. 'business:individualIncomeTaxDetail:deductionTurnBack',
  165. ]">退回</el-button>
  166. </template>
  167. </el-table-column> -->
  168. </el-table>
  169. <!-- 分页 -->
  170. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  171. v-model:limit="queryParams.pageSize" @pagination="getList" />
  172. <!-- 表单 -->
  173. <MemberDialog ref="memberDialog" :get-list="getList"></MemberDialog>
  174. <FormDialog ref="fromDialog" :get-list="getList" :workOrderId = workOrderId></FormDialog>
  175. <!-- 更多搜索弹窗 -->
  176. <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable :close-on-click-modal = "false">
  177. <el-form ref="dictRef" size="small" label-width="100">
  178. <el-row :gutter="20">
  179. <el-col :span="12">
  180. <el-form-item label="报税所属期:" prop="year">
  181. <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月"
  182. value-format="YYYY-MM-01" :disabled-date="disabledDateHandler" @change="monthChangeHandler"
  183. :clearable="false" />
  184. </el-form-item>
  185. <el-form-item label="纳税性质:" prop="taxType">
  186. <el-select size="small" v-model="queryParams.taxType" placeholder="请选择纳税性质" :clearable="true">
  187. <el-option v-for="item in taxTypes" :key="item.label" :label="item.label" :value="item.value" />
  188. </el-select>
  189. </el-form-item>
  190. <el-form-item label="个税状态:">
  191. <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true">
  192. <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
  193. </el-select>
  194. </el-form-item>
  195. </el-col>
  196. <el-col :span="12">
  197. <el-form-item label="关键字:">
  198. <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称"
  199. :clearable="true" />
  200. </el-form-item>
  201. <el-form-item v-if="tenant.versionId === '4'" label="来源:">
  202. <el-input v-model="queryParams.fromCompanyName" size="small" type="text" placeholder="请输入客户来源"
  203. :clearable="true" />
  204. </el-form-item>
  205. <el-form-item label="税号:">
  206. <el-input size="small" v-model="queryParams.socialCreditCode" type="text" placeholder="请输入税号"
  207. :clearable="true" />
  208. </el-form-item>
  209. </el-col>
  210. </el-row>
  211. </el-form>
  212. <template #footer>
  213. <div class="dialog-footer">
  214. <el-button type="primary" icon="Finished" size="small" @click="handleQuery">确 定</el-button>
  215. <el-button icon="close" size="small" @click="moreSearch = false">取 消</el-button>
  216. </div>
  217. </template>
  218. </el-dialog>
  219. </div>
  220. </template>
  221. <script setup name="Detail">
  222. import {
  223. listDetail,
  224. delDetail,
  225. updateIndividualIncomeTaxDetail,
  226. exportIndividualIncome,
  227. } from "@/api/business/production/detail";
  228. import { selectMonths, selectStatus, taxTypes } from "@/utils/default";
  229. import MemberDialog from "./MemberDialog.vue";
  230. import FormDialog from "./FormDialog.vue";
  231. import useUserStore from "@/store/modules/user";
  232. import { listLableNoPage } from "@/api/business/lable"
  233. const { proxy } = getCurrentInstance();
  234. const tenant = useUserStore().tenant;
  235. /** 字典数组区 */
  236. /** 查询 对象 */
  237. const detailList = ref([]);
  238. const bizStandardCompanyList = ref([]);
  239. const loading = ref(false);
  240. const ids = ref([]);
  241. const oneself = ref(true);
  242. const moreSearch = ref(false);
  243. const single = ref(true);
  244. const multiple = ref(true);
  245. const total = ref(0);
  246. const workOrderId = ref(null);
  247. const currentMonth = ref(
  248. proxy.moment().subtract(1, "month").format("YYYY-MM-01")
  249. );
  250. const flag = ref(checkPermission(['business:individual:person']))
  251. const activeName = flag.value ? ref('first') : ref('second')
  252. const options = ref([]);
  253. /** 查询对象 */
  254. const queryParams = ref({
  255. pageNum: 1,
  256. pageSize: 20,
  257. companyId: null,
  258. year: null,
  259. month: null,
  260. amount: null,
  261. status: null,
  262. evidenceFile: null,
  263. content: null,
  264. verifyContent: null,
  265. reportFile: null,
  266. companyName: null,
  267. fromCompanyName: null,
  268. evidenceFile: null,
  269. socialCreditCode: null,
  270. taxType: null,
  271. currentEmployeeName: null,
  272. year: proxy.moment().subtract(1, "month").format("YYYY"),
  273. month: proxy.moment().subtract(1, "month").format("MM"),
  274. principal: tenant.versionId !== '4' && !flag.value? useUserStore().user.userId : null,
  275. });
  276. /*********************** 方法区 ****************************/
  277. function getOption() {
  278. listLableNoPage().then(res => {
  279. options.value = res.data
  280. })
  281. }
  282. function showMember(row) {
  283. console.log(row);
  284. proxy.$refs.memberDialog.open(row);
  285. }
  286. function monthChangeHandler(arg) {
  287. const year = proxy.moment(arg).format("YYYY");
  288. const month = proxy.moment(arg).format("MM");
  289. queryParams.value.year = year;
  290. queryParams.value.month = month;
  291. console.log(year, month);
  292. handleQuery();
  293. }
  294. function getStatusStyle(row) {
  295. if (row.detail == null) {
  296. return { color: getStatusColor(0), verticalAlign: "middle" };
  297. } else {
  298. return {
  299. color: getStatusColor(row.detail.status),
  300. verticalAlign: "middle",
  301. };
  302. }
  303. }
  304. function getStatusLabel(row) {
  305. const index = selectStatus.findIndex(
  306. (v) => v.value === (row.detail == null ? 0 : row.detail.status)
  307. );
  308. return index >= 0 ? selectStatus[index].label : "";
  309. }
  310. function getStatusColor(status) {
  311. const index = selectStatus.findIndex((v) => v.value === status);
  312. return index >= 0 ? selectStatus[index].color : "#fff";
  313. }
  314. /** 导出按钮操作 */
  315. function handleExport() {
  316. exportIndividualIncome(queryParams.value);
  317. }
  318. /** 填写按钮操作 */
  319. function fillIn(row) {
  320. workOrderId.value = row.workOrderId
  321. if (row.detail == null) {
  322. openByPermission(0, row, {
  323. month: queryParams.value.month,
  324. year: queryParams.value.year,
  325. });
  326. } else {
  327. openByPermission(row.detail, row, {
  328. month: queryParams.value.month,
  329. year: queryParams.value.year,
  330. });
  331. }
  332. }
  333. function checkPermission(templatePermission) {
  334. const all_permission = "*:*:*";
  335. const permissions = useUserStore().permissions;
  336. const hasPermissions = permissions.some((permission) => {
  337. return (
  338. all_permission === permission || templatePermission.includes(permission)
  339. );
  340. });
  341. return hasPermissions;
  342. }
  343. function handleClick(tab) {
  344. console.log(tab.props.name)
  345. if (tab.props.name === "second") {
  346. oneself.value = true
  347. handleOneself()
  348. } else {
  349. oneself.value = false
  350. handleOneself()
  351. }
  352. }
  353. /** 打开弹窗 */
  354. function openByPermission(detailItem, row, item) {
  355. if (detailItem == null) {
  356. proxy.$refs.fromDialog.open(null, row, item);
  357. } else {
  358. proxy.$refs.fromDialog.open(detailItem, row, item);
  359. }
  360. }
  361. /** 查看文件 */
  362. function showFiles(row) {
  363. console.log("查看文件");
  364. console.log(row.companyId);
  365. openByPermission(null, row, {
  366. month: queryParams.value.month,
  367. year: queryParams.value.year,
  368. });
  369. }
  370. /** 退回按钮操作 */
  371. function turnBack(detail) {
  372. updateIndividualIncomeTaxDetail(detail);
  373. getList();
  374. }
  375. /** 查询个税详情列表 */
  376. function getList() {
  377. loading.value = true;
  378. listDetail(queryParams.value).then((response) => {
  379. detailList.value = response.rows;
  380. total.value = response.total;
  381. loading.value = false;
  382. });
  383. }
  384. /** 是否为自己负责 */
  385. function handleOneself() {
  386. if (oneself.value) {
  387. queryParams.value.principal = useUserStore().user.userId;
  388. } else {
  389. queryParams.value.principal = null;
  390. }
  391. getList();
  392. }
  393. /** 搜索按钮操作 */
  394. function handleQuery() {
  395. moreSearch.value = false;
  396. queryParams.value.pageNum = 1;
  397. getList();
  398. }
  399. /** 重置按钮操作 */
  400. function resetQuery() {
  401. proxy.resetForm("queryRef");
  402. queryParams.value = {
  403. pageNum: 1,
  404. pageSize: 20,
  405. companyId: null,
  406. year: null,
  407. month: null,
  408. amount: null,
  409. status: null,
  410. evidenceFile: null,
  411. content: null,
  412. verifyContent: null,
  413. reportFile: null,
  414. companyName: null,
  415. fromCompanyName: null,
  416. evidenceFile: null,
  417. socialCreditCode: null,
  418. taxType: null,
  419. currentEmployeeName: null,
  420. year: proxy.moment().subtract(1, "month").format("YYYY"),
  421. month: proxy.moment().subtract(1, "month").format("MM"),
  422. };
  423. currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01");
  424. if (activeName.value != null && activeName.value === 'second') {
  425. queryParams.value.principal = useUserStore().user.userId;
  426. }
  427. handleQuery();
  428. }
  429. // 多选框选中数据
  430. function handleSelectionChange(selection) {
  431. ids.value = selection.map((item) => item.id);
  432. single.value = selection.length != 1;
  433. multiple.value = !selection.length;
  434. }
  435. function disabledDateHandler(date) {
  436. if (date <= proxy.moment().subtract(1, "month")) {
  437. return false;
  438. } else {
  439. return true;
  440. }
  441. }
  442. getList();
  443. getOption();
  444. </script>