|
@@ -0,0 +1,345 @@
|
|
|
+<template>
|
|
|
+ <a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
|
|
|
+ <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="结算单号" name="settleNo">
|
|
|
+ <a-input v-model:value="searchFormState.settleNo" placeholder="结算单号查询" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="结算类型" name="settleType">
|
|
|
+ <a-select v-model:value="searchFormState.settleType" placeholder="结算类型查询"
|
|
|
+ :options="settleTypeList"
|
|
|
+ > </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="创建时间" name="createTime">
|
|
|
+ <a-range-picker
|
|
|
+ v-model:value="searchFormState.createTime"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="状态" name="settleStatus">
|
|
|
+ <a-select v-model:value="searchFormState.settleStatus" placeholder="状态查询"
|
|
|
+ :options="settleStatusList"
|
|
|
+ > </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
|
|
+ <a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
|
|
+ <a @click="toggleAdvanced" style="margin-left: 8px">
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
+ <component :is="advanced ? 'up-outlined' : 'down-outlined'" />
|
|
|
+ </a>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </a-card>
|
|
|
+ <a-card :bordered="false">
|
|
|
+ <s-table
|
|
|
+ ref="tableRef"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ bordered
|
|
|
+ :row-key="(record) => record.id"
|
|
|
+ >
|
|
|
+ <template #operator class="table-operator">
|
|
|
+ <a-space>
|
|
|
+ <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizSettleAdd')">
|
|
|
+ <template #icon><plus-outlined /></template>
|
|
|
+ 新增
|
|
|
+ </a-button>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="column.dataIndex === 'settleType'">
|
|
|
+ <a-tag
|
|
|
+ :color="
|
|
|
+ record.settleType === '1'
|
|
|
+ ? 'orange'
|
|
|
+ : record.settleType === '2'
|
|
|
+ ? 'green'
|
|
|
+ : 'purple'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ $TOOL.dictTypeData('settle_type', record.settleType) }}
|
|
|
+ </a-tag>
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'settleStatus'">
|
|
|
+ <a-tag
|
|
|
+ :color="
|
|
|
+ record.settleStatus === '1'
|
|
|
+ ? 'red'
|
|
|
+ : record.settleStatus === '2'
|
|
|
+ ? 'green'
|
|
|
+ : record.settleStatus === '3'
|
|
|
+ ? '#f50'
|
|
|
+ : record.settleStatus === '4'
|
|
|
+ ? 'processing'
|
|
|
+ : record.settleStatus === '5'
|
|
|
+ ? 'processing'
|
|
|
+ : record.settleStatus === '6'
|
|
|
+ ? 'cyan'
|
|
|
+ : 'purple'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ $TOOL.dictTypeData('settle_status', record.settleStatus) }}
|
|
|
+ </a-tag>
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'action'">
|
|
|
+<!-- <a-space>
|
|
|
+ <a @click="formRef.onOpen(record)" v-if="hasPerm('bizSettleEdit')">编辑</a>
|
|
|
+ <a-divider type="vertical" v-if="hasPerm(['bizSettleEdit', 'bizSettleDelete'], 'and')" />
|
|
|
+ <a style="color:red" size="small" type="link" @click="deleteConfig(record)">删除</a>
|
|
|
+ </a-space>-->
|
|
|
+ <a size="small" type="link" @click="detailRef.onOpen(record)" >详情</a>
|
|
|
+
|
|
|
+ <a-divider type="vertical" v-if="(hasPerm('bizSettleSubmit') && record.settleStatus == '1') ||
|
|
|
+ (hasPerm('bizSettleAdminAudit') && record.settleStatus == '2') ||
|
|
|
+ (hasPerm('bizSettleFinanceAudit') && record.settleStatus == '4') ||
|
|
|
+ (hasPerm('bizSettleEdit') && (record.settleStatus == '1' || record.settleStatus == '3')) ||
|
|
|
+ (hasPerm('bizSettleUploadInvoice') && (record.settleStatus == '5')) ||
|
|
|
+ (hasPerm('bizSettleUploadVoucher') && (record.settleStatus == '6')) ||
|
|
|
+ (hasPerm('bizSettleDelete') && record.settleStatus !='7')"/>
|
|
|
+
|
|
|
+ <a-dropdown v-if="(hasPerm('bizSettleSubmit') && record.settleStatus == '1') ||
|
|
|
+ (hasPerm('bizSettleAdminAudit') && record.settleStatus == '2') ||
|
|
|
+ (hasPerm('bizSettleFinanceAudit') && record.settleStatus == '4') ||
|
|
|
+ (hasPerm('bizSettleEdit') && (record.settleStatus == '1' || record.settleStatus == '3')) ||
|
|
|
+ (hasPerm('bizSettleUploadInvoice') && (record.settleStatus == '5')) ||
|
|
|
+ (hasPerm('bizSettleUploadVoucher') && (record.settleStatus == '6')) ||
|
|
|
+ (hasPerm('bizSettleDelete') && record.settleStatus !='7' )">
|
|
|
+ <a class="ant-dropdown-link">
|
|
|
+ 更多
|
|
|
+ <DownOutlined />
|
|
|
+ </a>
|
|
|
+
|
|
|
+ <template #overlay>
|
|
|
+ <a-menu>
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleSubmit') && record.settleStatus == '1'">
|
|
|
+ <a style="color:blue" @click="onSubmit(record)" >提交</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <!--管理员审核-->
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleAdminAudit') && record.settleStatus == '2'">
|
|
|
+ <a style="color:blue" @click="adminReviewRef.showModal(record.id)" >审核</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <!--财务审核-->
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleFinanceAudit') && record.settleStatus == '4'">
|
|
|
+ <a style="color:blue" @click="financeReviewRef.showModal(record.id)" >审核</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleEdit') && (record.settleStatus == '1' || record.settleStatus == '3')">
|
|
|
+ <a @click="formRef.onOpen(record)" >编辑</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleUploadInvoice') && (record.settleStatus == '5')">
|
|
|
+ <a style="color:green" @click="uploadFileRef.onOpen(record)" >上传发票</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleUploadVoucher') && (record.settleStatus == '6')">
|
|
|
+ <a style="color:green" @click="uploadVoucherRef.onOpen(record)" >结款凭证</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizSettleDelete') && record.settleStatus !='7'">
|
|
|
+ <a style="color:red" size="small" type="link" @click="deleteConfig(record)">删除</a>
|
|
|
+ </a-menu-item>
|
|
|
+ </a-menu>
|
|
|
+ </template>
|
|
|
+ </a-dropdown>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ <Form ref="formRef" @successful="tableRef.refresh()" />
|
|
|
+ <Detail ref="detailRef" @successful="tableRef.refresh()" />
|
|
|
+ <ReviewAdmin ref="adminReviewRef" @successful="tableRef.refresh(true)" />
|
|
|
+ <ReviewFinance ref="financeReviewRef" @successful="tableRef.refresh(true)" />
|
|
|
+ <UploadFileRef ref="uploadFileRef" @successful="tableRef.refresh()" />
|
|
|
+ <UploadVoucherRef ref="uploadVoucherRef" @successful="tableRef.refresh()" />
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="bizsettle">
|
|
|
+ import { cloneDeep } from 'lodash-es'
|
|
|
+ import Form from './form.vue'
|
|
|
+ import bizSettleApi from '@/api/biz/bizSettleApi'
|
|
|
+ import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
+ import {Modal} from 'ant-design-vue';
|
|
|
+ import {createVNode} from 'vue';
|
|
|
+ import ReviewAdmin from "./reviewadmin.vue";
|
|
|
+ import ReviewFinance from './reviewfinance.vue'
|
|
|
+ import UploadFileRef from './uploadFile.vue'
|
|
|
+ import UploadVoucherRef from './uploadVoucher.vue'
|
|
|
+ import Detail from './detail.vue'
|
|
|
+ import tool from '@/utils/tool'
|
|
|
+
|
|
|
+
|
|
|
+ const settleStatusList = tool.dictList('settle_status')
|
|
|
+ const settleTypeList = tool.dictList('settle_type')
|
|
|
+ const detailRef = ref()
|
|
|
+ const uploadVoucherRef = ref()
|
|
|
+ const uploadFileRef = ref()
|
|
|
+ const financeReviewRef = ref()
|
|
|
+ const adminReviewRef = ref()
|
|
|
+ const submitLoading = ref(false)
|
|
|
+ const tableRef = ref()
|
|
|
+ const formRef = ref()
|
|
|
+ const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
|
+
|
|
|
+ //查询数据
|
|
|
+ const searchFormState = ref({})
|
|
|
+ const searchFormRef = ref()
|
|
|
+
|
|
|
+ // 查询区域显示更多控制
|
|
|
+ const advanced = ref(false)
|
|
|
+ const toggleAdvanced = () => {
|
|
|
+ advanced.value = !advanced.value
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ title: '结算单号',
|
|
|
+ dataIndex: 'settleNo',
|
|
|
+ align:'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '结算类型',
|
|
|
+ dataIndex: 'settleType',
|
|
|
+ align:'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '结算金额(元)',
|
|
|
+ dataIndex: 'settleAccount',
|
|
|
+ align:'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '创建日期',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ align:'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'settleStatus',
|
|
|
+ align:'center',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ // 操作栏通过权限判断是否显示
|
|
|
+ columns.push({
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ align: 'center',
|
|
|
+ width: 150
|
|
|
+ })
|
|
|
+
|
|
|
+ const selectedRowKeys = ref([])
|
|
|
+ // 列表选择配置
|
|
|
+ const options = {
|
|
|
+ // columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
|
|
+ alert: {
|
|
|
+ show: true,
|
|
|
+ clear: () => {
|
|
|
+ selectedRowKeys.value = ref([])
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowSelection: {
|
|
|
+ onChange: (selectedRowKey, selectedRows) => {
|
|
|
+ selectedRowKeys.value = selectedRowKey
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loadData = (parameter) => {
|
|
|
+ const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
+ // grossTime范围查询条件重载
|
|
|
+ if (searchFormParam.createTime) {
|
|
|
+ searchFormParam.startCreateTime = searchFormParam.createTime[0]
|
|
|
+ searchFormParam.endCreateTime = searchFormParam.createTime[1]
|
|
|
+ delete searchFormParam.createTime
|
|
|
+ }
|
|
|
+ searchFormParam.settleType = '3'
|
|
|
+ return bizSettleApi.bizSettlePage(Object.assign(parameter, searchFormParam)).then((data) => {
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 重置
|
|
|
+ const reset = () => {
|
|
|
+ searchFormRef.value.resetFields()
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ }
|
|
|
+ // 删除
|
|
|
+ const deleteBizSettle = (record) => {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ bizSettleApi.bizSettleDelete(params).then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //提交
|
|
|
+ const onSubmit = (record) => {
|
|
|
+
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确定提交该数据吗?',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '',
|
|
|
+ onOk() {
|
|
|
+ submitLoading.value = true
|
|
|
+ let params =
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ bizSettleApi
|
|
|
+ .submit(params)
|
|
|
+ .then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submitLoading.value = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ const deleteConfig = (record) => {
|
|
|
+
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确定删除该数据吗?',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '',
|
|
|
+ onOk() {
|
|
|
+ submitLoading.value = true
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ bizSettleApi
|
|
|
+ .bizSettleDelete(params)
|
|
|
+ .then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submitLoading.value = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 批量删除
|
|
|
+ const deleteBatchBizSettle = (params) => {
|
|
|
+ bizSettleApi.bizSettleDelete(params).then(() => {
|
|
|
+ tableRef.value.clearRefreshSelected()
|
|
|
+ })
|
|
|
+ }
|
|
|
+</script>
|