index.vue 16 KB

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