123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- <template>
- <div class="page-container list-container">
- <!-- 功能按钮区 -->
- <div class="list-btns-container">
- <el-dropdown style="margin-top: 2px">
- <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:deposit:export']"
- >
- 导出</el-dropdown-item
- >
- <!-- <el-dropdown-item type="warning" size="small" icon="Download" @click="handleArea"
- v-hasPermi="['business:deposit:export']"> area</el-dropdown-item> -->
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-radio-group
- v-model="queryRadio"
- style="margin-left: 20px; height: 100%"
- size="small"
- @change="radioChangeHandler"
- >
- <el-radio-button label="全部" />
- <el-radio-button label="待确认扣款" />
- <el-radio-button label="可扣款" />
- <el-radio-button label="已申报" />
- <el-radio-button label="已扣款" />
- <el-radio-button label="扣款失败" />
- </el-radio-group>
- <!-- <el-button type="warning" size="small" icon="Download" @click="handleExport"
- v-hasPermi="['business:deposit:export']">导出</el-button> -->
- <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
- </div>
- <!-- 搜索区 -->
- <el-form
- class="list-search-container"
- size="small"
- :model="queryParams"
- ref="queryRef"
- :inline="true"
- label-width="78px"
- >
- <el-form-item label="来源名:">
- <el-select
- v-model="queryParams.sourceNames"
- placeholder="请选择来源名"
- multiple
- >
- <el-option
- v-for="item in sources"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="客户名称:">
- <el-input
- v-model.trim="queryParams.companyName"
- size="small"
- type="text"
- placeholder="客户名称"
- :clearable="true"
- style="width: 140px"
- />
- </el-form-item>
- <el-form-item label="所属期:">
- <el-date-picker
- v-model="queryParams.currentMonth"
- type="month"
- format="YYYY年MM月"
- value-format="YYYY-MM"
- style="width: 130px"
- />
- </el-form-item>
- <el-form-item label="是否自己负责:">
- <el-switch v-model="oneself" @change="handleOneself" />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery"
- >搜索</el-button
- >
- <el-button icon="operation" @click="moreSearch = true">更多</el-button>
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <!-- 列表区 -->
- <el-table
- v-loading="loading"
- :data="list"
- size="small"
- border
- height="100%"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column
- label="客户名"
- prop="companyName"
- min-width="250"
- align="center"
- />
- <el-table-column
- label="来源"
- min-width="100"
- align="center"
- prop="fromCompanyName"
- />
- <el-table-column
- label="纳税性质"
- prop="taxType"
- width="100"
- align="center"
- />
- <el-table-column
- label="扣款期"
- prop="currentMonth"
- min-width="100"
- align="center"
- >
- <template #default="scope">
- {{ scope.row.year }}年{{ scope.row.month }}月
- </template>
- </el-table-column>
- <el-table-column
- label="来源名"
- prop="sourceName"
- width="150"
- align="center"
- />
- <el-table-column label="金额" prop="amount" width="150" align="center">
- <template #default="scope">
- <el-button
- v-if="scope.row.deductible === 1"
- type="primary"
- link
- size="small"
- @click="amountDetail(scope.row)"
- >{{ scope.row.amount }}</el-button
- >
- </template>
- </el-table-column>
- <el-table-column
- label="确认人"
- prop="confirmName"
- width="110"
- align="center"
- />
- <el-table-column
- label="确认时间"
- prop="confirmDate"
- min-width="140"
- align="center"
- />
- <el-table-column
- label="操作人"
- prop="operationName"
- width="100"
- align="center"
- />
- <el-table-column
- label="操作时间"
- min-width="140"
- prop="operationDate"
- align="center"
- />
- <el-table-column label="文件查看" align="center" width="100">
- <template #default="scope">
- <el-button
- v-if="scope.row.status === 2"
- size="small"
- type="primary"
- link
- @click="showFiles(scope.row)"
- >查看文件</el-button
- >
- <span v-else>--</span>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="100" align="center">
- <template #default="scope">
- <span v-if="scope.row.status === 0">待审核</span>
- <span v-if="scope.row.status === 1">可扣款</span>
- <span v-if="scope.row.status === 2">已扣款</span>
- <el-tooltip
- v-if="scope.row.status === 4"
- :content="
- scope.row.failureType === 1 ? scope.row.failureResult : '余额不足'
- "
- placement="top"
- >
- <span>扣款失败</span>
- </el-tooltip>
- <span v-if="scope.row.status === 5">已申报</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" fixed="right" width="220" align="center">
- <template #default="scope">
- <template v-if="scope.row.deductible === 1">
- <el-button
- v-hasPermi="['business:deduction:confirm']"
- v-show="
- (scope.row.status === 0 || scope.row.status === 4) &&
- checkConfirm(scope.row)
- "
- link
- type="primary"
- size="small"
- @click="showConfirm(scope.row)"
- >确认扣款</el-button
- >
- <div v-if="scope.row.sourceName === '公积金'">
- <el-button
- link
- v-hasPermi="['business:deduction:declare']"
- v-show="scope.row.status === 1"
- style="margin-right: 5px"
- type="primary"
- size="small"
- @click="applySuccess(scope.row, 5)"
- >申报成功</el-button
- >
- </div>
- <div
- v-if="scope.row.sourceName === '公积金'"
- style="margin-left: 26px; display: flex; align-items: center"
- >
- <el-button
- link
- v-hasPermi="['business:deduction:deduction']"
- v-show="scope.row.status === 5"
- style="margin-left: 5px; :5px "
- type="primary"
- size="small"
- @click="showFeedbackDialog(scope.row)"
- >扣款失败</el-button
- >
- <el-button
- link
- v-hasPermi="['business:deduction:deduction']"
- v-show="scope.row.status === 5"
- style="margin-right: 5px"
- type="primary"
- size="small"
- @click="openUpload(scope.row)"
- >扣款成功</el-button
- >
- </div>
- <div
- v-else
- style="margin-left: 26px; display: flex; align-items: center"
- >
- <el-button
- link
- v-hasPermi="['business:deduction:deduction']"
- v-show="scope.row.status === 1"
- style="margin-right: 5px"
- type="primary"
- size="small"
- @click="openUpload(scope.row)"
- >扣款成功</el-button
- >
- <el-button
- link
- v-hasPermi="['business:deduction:deduction']"
- v-show="scope.row.status === 1"
- style="margin-left: 5px; :5px "
- type="primary"
- size="small"
- @click="showFeedbackDialog(scope.row)"
- >扣款失败</el-button
- >
- </div>
- </template>
- </template>
- </el-table-column>
- </el-table>
- <!-- <Deposit-form ref="DepositRef" :get-list="getList" /> -->
- <el-dialog
- title="扣款信息"
- v-model="formOpen"
- width="500px"
- append-to-body
- draggable
- @close="formCancel"
- >
- <el-form ref="dictRef" :model="form" label-width="100" size="small">
- <el-row :gutter="30">
- <el-col :span="24">
- <el-form-item label="扣款金额:">
- <div>{{ form.amount }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="凭证附件:">
- <div class="details-btns-container" style="display: flex">
- <el-upload
- action="#"
- :http-request="upload"
- :with-credentials="true"
- :show-file-list="false"
- multiple
- >
- <el-button size="small" type="primary" icon="Upload"
- >点击上传</el-button
- >
- </el-upload>
- </div>
- <el-table
- ref="filesTable"
- :data="form.files"
- size="small"
- height="200px"
- border
- header-row-class-name="list-header-row"
- >
- <el-table-column
- type="index"
- label="序号"
- width="47"
- align="center"
- />
- <el-table-column
- label="文件名"
- prop="originalFileName"
- align="center"
- >
- <template #default="scope">
- <el-link
- :href="`${baseUrl}${scope.row.fileUrl}`"
- :underline="false"
- target="_blank"
- type="primary"
- >
- {{ scope.row.originalFileName }}
- </el-link>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="47" align="center">
- <template #default="scope">
- <el-button
- link
- size="small"
- type="danger"
- @click="handleDelFile(scope.$index)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button
- type="primary"
- size="small"
- icon="Finished"
- @click="saveHandler"
- >确 定</el-button
- >
- <el-button icon="close" size="small" @click="formCancel"
- >取 消</el-button
- >
- </div>
- </template>
- </el-dialog>
- <!-- 分页 -->
- <pagination
- v-show="total > 0"
- :total="total"
- v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
- <el-image-viewer
- v-if="showViewer"
- :url-list="currentFileList"
- @close="closeImages"
- :initial-index="showIndex"
- />
- <feedbackDialog ref="feedbackDialogRef" :verify="verifyDeduction" />
- <FileDialog ref="fileDialog" />
- <MergeTaxViewDialog ref="mergeTaxViewDialog" />
- <HousingFundViewDialog ref="housingFundViewDialog" />
- <SocialSecurityViewDialog ref="socialSecurityViewDialog" />
- <!-- 更多搜索弹窗 -->
- <el-dialog
- title="更多搜索"
- v-model="moreSearch"
- width="620px"
- append-to-body
- draggable
- >
- <el-form
- :model="queryParams"
- ref="queryRef"
- size="small"
- :rules="rules"
- label-width="100"
- >
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="客户名称:">
- <el-input
- v-model.trim="queryParams.companyName"
- size="small"
- type="text"
- placeholder="客户名称"
- :clearable="true"
- />
- </el-form-item>
- <el-form-item label="来源名:" prop="sourceNames">
- <el-select
- v-model="queryParams.sourceNames"
- placeholder="请选择来源名"
- multiple
- >
- <el-option
- v-for="item in sources"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="来源:" prop="fromCompanyName">
- <el-input
- size="small"
- v-model="queryParams.fromCompanyName"
- type="text"
- placeholder="客户来源"
- :clearable="true"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="纳税性质:" prop="taxType">
- <el-select
- size="small"
- v-model="queryParams.taxType"
- placeholder="请选择纳税性质"
- :clearable="true"
- @change="taxTypeChange"
- >
- <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-date-picker
- v-model="queryParams.currentMonth"
- type="month"
- format="YYYY年MM月"
- value-format="YYYY-MM"
- />
- </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="Company">
- import {
- listDeduction,
- exportDeposition,
- saveDeduction,
- } from "@/api/business/production/deduction";
- import MergeTaxViewDialog from "./MergeTaxViewDialog.vue";
- import feedbackDialog from "./feedbackDialog.vue";
- import { uploadFile } from "@/api/tool/file";
- import { listCompany } from "@/api/business/crm/company";
- import { taxTypes } from "@/utils/default";
- import useUserStore from "@/store/modules/user";
- import { getTenant } from "@/utils/auth";
- import { ref } from "vue";
- import FileDialog from "../../dialog/fileDialog.vue";
- import HousingFundViewDialog from "./HousingFundViewDialog";
- import SocialSecurityViewDialog from "./SocialSecurityViewDialog";
- // import DepositForm from "./form"
- const { proxy } = getCurrentInstance();
- /** 字典数组区 */
- /** 查询 对象 */
- const list = ref([]);
- const loading = ref(true);
- const ids = ref([]);
- const single = ref(true);
- const multiple = ref(true);
- const oneself = ref(false);
- const moreSearch = ref(false);
- const total = ref(0);
- const prev = ref([]);
- const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
- const showViewer = ref(false);
- const currentFileList = ref([]);
- const showIndex = ref(0);
- const queryRadio = ref("全部");
- const permissions = useUserStore().permissions;
- const sources = ref([
- {
- value: "税款",
- label: "税款",
- },
- {
- value: "社保",
- label: "社保",
- },
- {
- value: "公积金",
- label: "公积金",
- },
- ]);
- const formOpen = ref(false);
- const form = ref({
- id: null,
- companyName: "",
- companyId: null,
- remark: "",
- type: 1,
- files: [],
- });
- const emptyForm = {
- id: null,
- companyName: "",
- companyId: null,
- type: 1,
- remark: "",
- files: [],
- };
- const { verify_status } = proxy.useDict("verify_status");
- /** 查询对象 */
- const queryParams = ref({
- pageNum: 1,
- pageSize: 10,
- companyName: "",
- orderByColumn: "create_time",
- noContract: 1,
- });
- /*********************** 方法区 ****************************/
- /** 查询company列表 */
- function getList() {
- loading.value = true;
- listDeduction(queryParams.value).then((response) => {
- list.value = response.rows.map((l) => ({ ...l }));
- prev.value = proxy.deepClone(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 radioChangeHandler(arg) {
- const query = {
- pageNum: 1,
- pageSize: 10,
- companyName: "",
- };
- switch (arg) {
- case "全部":
- query.status = null;
- break;
- case "待确认扣款":
- query.status = 0;
- break;
- case "可扣款":
- query.status = 1;
- break;
- case "已扣款":
- query.status = 2;
- break;
- case "已申报":
- query.status = 5;
- break;
- case "扣款失败":
- query.status = 4;
- break;
- default:
- break;
- }
- queryParams.value = query;
- handleQuery();
- }
- /** 搜索按钮操作 */
- function handleQuery() {
- queryParams.value.pageNum = 1;
- moreSearch.value = false;
- getList();
- }
- /** 重置按钮操作 */
- function resetQuery() {
- // proxy.resetForm("queryRef");
- queryParams.value = {
- pageNum: 1,
- pageSize: 10,
- companyName: "",
- orderByColumn: "create_time",
- noContract: 1,
- };
- handleQuery();
- }
- // 多选框选中数据
- function handleSelectionChange(selection) {
- ids.value = selection.map((item) => item.id);
- single.value = selection.length != 1;
- multiple.value = !selection.length;
- }
- /** 新增按钮操作 */
- function handleAdd() {
- // proxy.$refs.DepositRef.open();
- formOpen.value = true;
- }
- function formCancel() {
- formOpen.value = false;
- reset();
- }
- function reset() {
- form.value = proxy.deepClone(emptyForm);
- }
- /** 修改按钮操作 */
- function handleUpdate(row) {
- // const id = row.id || ids.value;
- // proxy.$refs.DepositRef.open(id);
- }
- /** 删除按钮操作 */
- function handleDelete(row) {
- const _ids = row.id || ids.value;
- proxy.$modal
- .confirm("是否确认删除选中的数据项?")
- .then(function () {
- return delDeposit(_ids);
- })
- .then(() => {
- getList();
- proxy.$modal.msgSuccess("删除成功!");
- })
- .catch(() => {});
- }
- /** 导出按钮操作 */
- function handleExport() {
- // proxy.download(
- // "business/archive/order/export",
- // {
- // ...queryParams.value,
- // },
- // `合同导出_${new Date().getTime()}.xlsx`
- // );
- exportDeposit(queryParams.value);
- }
- function startDateChangeHandler(row, startDate) {
- if (startDate) {
- // console.log(startDate)
- row.endMonth = proxy
- .moment(startDate)
- .add(row.monthNum - 1, "M")
- .format("YYYY-MM-DD");
- } else row.endMonth = null;
- console.log(row);
- }
- function saveHandler() {
- if (form.value.amount == null || form.value.amount === 0) {
- proxy.$modal.msgError("请输入存款金额");
- return;
- }
- if (form.value.files.length === 0) {
- proxy.$modal.msgError("请上传凭证附件");
- return;
- }
- form.value.operationId = useUserStore().user.userId;
- form.value.operationDate = proxy.moment().format("YYYY-MM-DD HH:mm:ss");
- form.value.status = 2;
- saveDeduction(form.value).then((res) => {
- formCancel();
- getList();
- });
- }
- function upload(param) {
- const formData = new FormData();
- formData.append("file", param.file);
- uploadFile(formData).then((res) => {
- if (res.code === 200) {
- const file = {};
- file.fileName = res.newFileName;
- file.url = res.url;
- file.originalFileName = res.originalFilename;
- file.fileUrl = res.fileName;
- file.masterId = form.value.id;
- file.masterTableName = "biz_deduction";
- form.value.files.push(file);
- }
- });
- }
- function openFollowFile(arg) {
- // console.log(arg)
- const attach = arg;
- window.open(`${arg.url}`, arg.fileName);
- }
- function showFileList(row) {
- currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
- showViewer.value = true;
- }
- function closeImages() {
- showViewer.value = false;
- }
- function handleInfo(row) {
- formOpen.value = true;
- getForm(row.id);
- }
- function getForm(id) {
- getDeposit(id).then((res) => {
- form.value = res.data;
- if (form.value == null) {
- reset();
- }
- });
- }
- function handleDelFile(index) {
- form.value.files.splice(index, 1);
- }
- function amountDetail(row) {
- const item = {
- year: proxy.moment().format("YYYY"),
- month: proxy.moment().subtract(1, "months").format("MM"),
- };
- switch (row.sourceName) {
- case "税款":
- proxy.$refs.mergeTaxViewDialog.open(row);
- break;
- case "社保":
- proxy.$refs.socialSecurityViewDialog.open(row);
- break;
- case "公积金":
- proxy.$refs.housingFundViewDialog.open(row);
- break;
- }
- }
- function showFiles(row) {
- proxy.$refs.fileDialog.open({
- masterTableName: "biz_deduction",
- masterId: row.id,
- });
- }
- function checkConfirm(row) {
- // console.log(row.tenantId)
- if (row.tenantId === getTenant()) {
- return true;
- } else {
- return false;
- }
- }
- function showConfirm(row) {
- proxy.$modal.confirm("确认扣款么?").then((res) => {
- row.confirmId = useUserStore().user.userId;
- row.confirmDate = proxy.moment().format("YYYY-MM-DD HH:mm:ss");
- row.status = 1;
- saveDeduction(row).then((res) => {
- getList();
- });
- });
- }
- function applySuccess(row, status) {
- proxy.$modal
- .confirm("确认公积金申报成功么?")
- .then((_) => {
- const value = proxy.deepClone(row);
- value.status = status;
- saveDeduction(value).then((res) => {
- getList();
- });
- })
- .catch((_) => {
- proxy.$modal.msg("取消申报");
- });
- }
- function showFeedbackDialog(row) {
- const value = proxy.deepClone(row);
- value.status = 4;
- proxy.$refs.feedbackDialogRef.open(value);
- }
- function verifyDeduction(value) {
- saveDeduction(value).then((res) => {
- getList();
- });
- }
- function openUpload(row) {
- formOpen.value = true;
- form.value = proxy.deepClone(row);
- }
- getList();
- </script>
|