index.vue 13 KB

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