index.vue 16 KB

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