index.vue 18 KB

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