123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471 |
- <template>
- <div class="page-container list-container">
- <!-- 功能按钮区 -->
- <div class="list-btns-container">
- <el-dropdown trigger="click">
- <el-button type="primary" size="small">
- 其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
- </el-button>
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:detail:export']">
- 导出</el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </div>
- <!-- 搜索区 -->
- <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
- <el-form-item label="客户名称:">
- <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称" :clearable="true"
- style="width: 130px" />
- </el-form-item>
- <el-form-item label="客户标签:">
- <el-select size="small" v-model="queryParams.customerLabelId" style="width:130px" clearable>
- <el-option v-for="item in options" :key="item.id" :label="item.lable" :value="item.id" />
- </el-select>
- </el-form-item>
- <el-form-item label="所属期:" prop="year">
- <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
- :clearable="false" value-format="YYYY-MM-01" :disabled-date="disabledDateHandler"
- @change="monthChangeHandler" />
- </el-form-item>
- <el-form-item label="个税状态:">
- <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true"
- style="width: 130px">
- <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- <el-form-item label="审核人:" prop="verifierName">
- <el-input size="small" v-model="queryParams.verifierName" placeholder="请输入审核人" clearable style="width: 130px"
- @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item prop="dateFilter" label="审核时间:">
- <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
- format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
- end-placeholder="业务日期" style="width: 70%;"></el-date-picker>
- </el-form-item>
- <!-- <el-form-item v-if="tenant.versionId !== '4'" label="是否自己负责:" v-hasPermi="['business:individual:person']">
- <el-switch v-model="oneself" @change="handleOneself" />
- </el-form-item> -->
- <el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
- <el-button icon="Operation" @click="moreSearch = true" size="small">更多</el-button>
- <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
- </el-form-item>
- </el-form>
- <div v-if="flag && flag2 && tenant.versionId !== '4'">
- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
- <el-tab-pane label="全部" name="first"> </el-tab-pane>
- <el-tab-pane label="我的" name="second"> </el-tab-pane>
- </el-tabs>
- </div>
- <!-- 列表区 -->
- <el-table v-loading="loading" :data="detailList" size="small" border height="100%"
- @selection-change="handleSelectionChange">
- <!-- <el-table-column type="selection" width="55" align="center" /> -->
- <el-table-column label="客户名称" align="center" prop="companyName" min-width="250">
- <template #default="scope">
- <div style="display: flex; align-items: center; ">
- <template v-if="scope.row.customerLabelName ">
- <el-tooltip :content="scope.row.customerLabelName" placement="top">
- <el-icon :size="15">
- <CollectionTag />
- </el-icon>
- </el-tooltip>
- <span style="padding-left:5px;">{{ scope.row.companyName }}</span>
- </template>
- <template v-else>
- <div style="width: 20px; height: 15px;"></div>
- <span>{{ scope.row.companyName }}</span>
- </template>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="客户名称" align="center" prop="companyName" min-width="250" />
- <el-table-column label="来源" align="center" prop="fromCompanyName" width="180" />
- <el-table-column label="纳税性质" align="center" width="100" prop="taxType" />
- <el-table-column label="人员信息" align="center">
- <template #default="scope">
- <el-button v-show="scope.row.detail != null" link type="primary" size="small" @click="showMember(scope.row)"
- v-hasPermi="['business:tax:wageList']">查看</el-button>
- </template>
- </el-table-column>
- <el-table-column label="个税填写" align="center" prop="evidenceFile">
- <template #default="scope">
- <el-button type="primary" link size="small" v-hasPermi="['business:individualIncomeTaxDetail:saveDetail']"
- @click="fillIn(scope.row)">{{
- scope.row.detail == null
- ? "填写"
- : scope.row.detail.status === 1
- ? "进行中"
- : "已填写"
- }}</el-button>
- </template>
- </el-table-column>
- <el-table-column label="个税附件" align="center" prop="content">
- <template #default="scope">
- <el-button type="primary" link size="small" v-hasPermi="['business:individualIncomeTaxDetail:query']"
- :disabled="
- scope.row.detail == null || scope.row.detail.evidenceFile === ''
- " @click="showFiles(scope.row)">查看文件</el-button>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="verifyContent">
- <template #default="scope">
- <div :style="getStatusStyle(scope.row)">
- {{ getStatusLabel(scope.row) }}
- <el-popover placement="top-start" width="250" trigger="hover">
- <div style="display: flex; flex-direction: row">
- <div v-for="item in selectStatus" :key="item.value"
- style="display: flex; flex-direction: row; margin-right: 10px">
- <div :style="{
- backgroundColor: item.color,
- width: '14px',
- height: '14px',
- margin: 'auto',
- borderRadius: '50%',
- border: item.color === '#fff' ? '1px solid #ddd' : 'none',
- }" />
- <div style="
- display: inline-block;
- margin-left: 10px;
- line-height: 36px;
- font-size: 10px;
- ">
- {{ item.label }}
- </div>
- </div>
- </div>
- <template #reference>
- <span style="
- color: #fff;
- font-size: 12px;
- text-align: center;
- display: inline-block;
- line-height: 14px;
- width: 14px;
- height: 14px;
- background-color: #ccc;
- border-radius: 50%;
- ">?</span>
- </template>
- </el-popover>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="执行人" align="center" prop="serviceName" />
- <el-table-column label="审核人" align="center" prop="verifierName" min-width="100" />
- <el-table-column label="审核时间" align="center" prop="verifierTime" min-width="100" :show-overflow-tooltip="true" />
- <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="150"
- :show-overflow-tooltip="true" />
- <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template #default="scope">
- <el-button size="small" type="text" :disabled="
- scope.row.detail == null || scope.row.detail.status !== 3
- " @click="turnBack(scope.row.detail)" v-hasPermi="[
- 'business:individualIncomeTaxDetail:deductionTurnBack',
- ]">退回</el-button>
- </template>
- </el-table-column> -->
- </el-table>
- <!-- 分页 -->
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize" @pagination="getList" />
- <!-- 表单 -->
- <MemberDialog ref="memberDialog" :get-list="getList"></MemberDialog>
- <FormDialog ref="fromDialog" :get-list="getList" :workOrderId=workOrderId></FormDialog>
- <!-- 更多搜索弹窗 -->
- <el-dialog title="更多搜索" v-model="moreSearch" width="620px" append-to-body size="small" draggable
- :close-on-click-modal="false">
- <el-form ref="dictRef" size="small" label-width="100">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="报税所属期:" prop="year">
- <el-date-picker size="small" v-model="currentMonth" type="month" format="YYYY年MM月"
- value-format="YYYY-MM-01" :disabled-date="disabledDateHandler" @change="monthChangeHandler"
- :clearable="false" />
- </el-form-item>
- <el-form-item label="纳税性质:" prop="taxType">
- <el-select size="small" v-model="queryParams.taxType" placeholder="请选择纳税性质" :clearable="true">
- <el-option v-for="item in taxTypes" :key="item.label" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- <el-form-item label="个税状态:">
- <el-select size="small" v-model="queryParams.status" type="text" placeholder="状态" :clearable="true">
- <el-option v-for="item in selectStatus" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="关键字:">
- <el-input size="small" v-model="queryParams.companyName" type="text" placeholder="请输入客户名称"
- :clearable="true" />
- </el-form-item>
- <el-form-item v-if="tenant.versionId === '4'" label="来源:">
- <el-input v-model="queryParams.fromCompanyName" size="small" type="text" placeholder="请输入客户来源"
- :clearable="true" />
- </el-form-item>
- <el-form-item label="税号:">
- <el-input size="small" v-model="queryParams.socialCreditCode" type="text" placeholder="请输入税号"
- :clearable="true" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" icon="Finished" size="small" @click="handleQuery">确 定</el-button>
- <el-button icon="close" size="small" @click="moreSearch = false">取 消</el-button>
- </div>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup name="IndividualIncomeTax">
- import {
- listDetail,
- delDetail,
- updateIndividualIncomeTaxDetail,
- exportIndividualIncome,
- } from "@/api/business/production/detail";
- import { selectMonths, selectStatus, taxTypes } from "@/utils/default";
- import MemberDialog from "./MemberDialog.vue";
- import FormDialog from "./FormDialog.vue";
- import useUserStore from "@/store/modules/user";
- import { listLableNoPage } from "@/api/business/lable"
- const { proxy } = getCurrentInstance();
- const tenant = useUserStore().tenant;
- /** 字典数组区 */
- /** 查询 对象 */
- const detailList = ref([]);
- const bizStandardCompanyList = ref([]);
- const loading = ref(false);
- const ids = ref([]);
- const oneself = ref(true);
- const moreSearch = ref(false);
- const single = ref(true);
- const multiple = ref(true);
- const total = ref(0);
- const workOrderId = ref(null);
- const currentMonth = ref(
- proxy.moment().subtract(1, "month").format("YYYY-MM-01")
- );
- const flag = ref(checkPermission(['business:individual:person']))
- const flag2 = ref(checkPermission(['business:individual:myself']))
- const activeName = flag.value ? ref('first') : ref('second')
- const options = ref([]);
- /** 查询对象 */
- const queryParams = ref({
- pageNum: 1,
- pageSize: 20,
- companyId: null,
- year: null,
- month: null,
- amount: null,
- status: null,
- evidenceFile: null,
- content: null,
- verifyContent: null,
- reportFile: null,
- companyName: null,
- fromCompanyName: null,
- evidenceFile: null,
- socialCreditCode: null,
- taxType: null,
- currentEmployeeName: null,
- year: proxy.moment().subtract(1, "month").format("YYYY"),
- month: proxy.moment().subtract(1, "month").format("MM"),
- principal: tenant.versionId !== '4' && !flag.value ? useUserStore().user.userId : null,
- });
- /*********************** 方法区 ****************************/
- function getOption() {
- listLableNoPage().then(res => {
- options.value = res.data
- })
- }
- function showMember(row) {
- console.log(row);
- proxy.$refs.memberDialog.open(row);
- }
- function monthChangeHandler(arg) {
- const year = proxy.moment(arg).format("YYYY");
- const month = proxy.moment(arg).format("MM");
- queryParams.value.year = year;
- queryParams.value.month = month;
- console.log(year, month);
- handleQuery();
- }
- function getStatusStyle(row) {
- if (row.detail == null) {
- return { color: getStatusColor(0), verticalAlign: "middle" };
- } else {
- return {
- color: getStatusColor(row.detail.status),
- verticalAlign: "middle",
- };
- }
- }
- function getStatusLabel(row) {
- const index = selectStatus.findIndex(
- (v) => v.value === (row.detail == null ? 0 : row.detail.status)
- );
- return index >= 0 ? selectStatus[index].label : "";
- }
- function getStatusColor(status) {
- const index = selectStatus.findIndex((v) => v.value === status);
- return index >= 0 ? selectStatus[index].color : "#fff";
- }
- /** 导出按钮操作 */
- function handleExport() {
- exportIndividualIncome(queryParams.value);
- }
- /** 填写按钮操作 */
- function fillIn(row) {
- workOrderId.value = row.workOrderId
- if (row.detail == null) {
- openByPermission(0, row, {
- month: queryParams.value.month,
- year: queryParams.value.year,
- });
- } else {
- openByPermission(row.detail, row, {
- month: queryParams.value.month,
- year: queryParams.value.year,
- });
- }
- }
- function checkPermission(templatePermission) {
- const all_permission = "*:*:*";
- const permissions = useUserStore().permissions;
- const hasPermissions = permissions.some((permission) => {
- return (
- all_permission === permission || templatePermission.includes(permission)
- );
- });
- return hasPermissions;
- }
- function handleClick(tab) {
- console.log(tab.props.name)
- if (tab.props.name === "second") {
- oneself.value = true
- handleOneself()
- } else {
- oneself.value = false
- handleOneself()
- }
- }
- /** 打开弹窗 */
- function openByPermission(detailItem, row, item) {
- if (detailItem == null) {
- proxy.$refs.fromDialog.open(null, row, item);
- } else {
- proxy.$refs.fromDialog.open(detailItem, row, item);
- }
- }
- /** 查看文件 */
- function showFiles(row) {
- console.log("查看文件");
- console.log(row.companyId);
- openByPermission(null, row, {
- month: queryParams.value.month,
- year: queryParams.value.year,
- });
- }
- /** 退回按钮操作 */
- function turnBack(detail) {
- updateIndividualIncomeTaxDetail(detail);
- getList();
- }
- /** 查询个税详情列表 */
- function getList() {
- loading.value = true;
- listDetail(queryParams.value).then((response) => {
- detailList.value = response.rows;
- total.value = response.total;
- loading.value = false;
- });
- }
- /** 是否为自己负责 */
- function handleOneself() {
- if (oneself.value) {
- queryParams.value.principal = useUserStore().user.userId;
- } else {
- queryParams.value.principal = null;
- }
- getList();
- }
- /** 搜索按钮操作 */
- function handleQuery() {
- moreSearch.value = false;
- queryParams.value.pageNum = 1;
- getList();
- }
- /** 重置按钮操作 */
- function resetQuery() {
- proxy.resetForm("queryRef");
- queryParams.value = {
- pageNum: 1,
- pageSize: 20,
- companyId: null,
- year: null,
- month: null,
- amount: null,
- status: null,
- evidenceFile: null,
- content: null,
- verifyContent: null,
- reportFile: null,
- companyName: null,
- fromCompanyName: null,
- evidenceFile: null,
- socialCreditCode: null,
- taxType: null,
- currentEmployeeName: null,
- year: proxy.moment().subtract(1, "month").format("YYYY"),
- month: proxy.moment().subtract(1, "month").format("MM"),
- };
- currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01");
- if (activeName.value != null && activeName.value === 'second') {
- queryParams.value.principal = useUserStore().user.userId;
- }
- handleQuery();
- }
- // 多选框选中数据
- function handleSelectionChange(selection) {
- ids.value = selection.map((item) => item.id);
- single.value = selection.length != 1;
- multiple.value = !selection.length;
- }
- function disabledDateHandler(date) {
- if (date <= proxy.moment().subtract(1, "month")) {
- return false;
- } else {
- return true;
- }
- }
- getList();
- getOption();
- </script>
|