index.vue 15 KB

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