szh-new
张同海 5 months ago
commit df6e2e89ba

@ -54,8 +54,8 @@
default: '',
},
id: {
type: Number,
default: 0
type: String,
default: '0'
}
},
emits: ['columns-change'],

@ -19,7 +19,6 @@
>
{{ t('component.table.settingColumnShow') }}
</Checkbox>
<Checkbox v-model:checked="checkIndex" @change="handleIndexCheckChange">
{{ t('component.table.settingIndexColumnShow') }}
</Checkbox>
@ -163,8 +162,8 @@
emits: ['columns-change'],
props: {
id: {
type: Number,
default: 0
type: String,
default: '0'
}
},
@ -246,6 +245,7 @@
const columns2 = []
let Apidata = {
permissionId: '',
tagNo: props.id
}
usePermissionStore().getWrouteList.forEach((item: any) => {
item.children[0].children?.forEach((item2) => {
@ -373,7 +373,7 @@
//
const editTable = () => {
const Apidata = {
id: 0,
tagNo: props.id,
templateName: '列表设置',
content: JSON.stringify({
columns: getColumns(),
@ -511,7 +511,7 @@
})
if (!type) {
let Apidata = {
id: props.id,
tagNo: props.id,
permissionId: '',
content: JSON.stringify({
columns: data,
@ -519,7 +519,6 @@
showIndexColumn: table.getBindValues.value.showIndexColumn,
}),
}
console.log(usePermissionStore().getWrouteList)
usePermissionStore().getWrouteList.forEach((item) => {
item.children[0].children?.forEach((item2) => {
if (fullPath.value.indexOf(item2.path) != -1) {

@ -36,8 +36,8 @@
default: () => ({}),
},
id: {
type: Number,
default: 0
type: String,
default: '0'
}
},
emits: ['columns-change'],

@ -154,7 +154,7 @@ export const basicProps = {
},
// 表格的id增加全选使用
id: {
type: Number,
default: 0
type: String,
default: '0'
}
}

@ -215,7 +215,7 @@ export interface BasicTableProps<T = any> {
pagination?: PaginationProps | boolean
// loading加载
loading?: boolean,
id?: Number,
id?: string | number,
/**
* The column contains children to display

@ -1,5 +1,8 @@
import { router } from "/@/router"
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
import { useMessage } from '/@/hooks/web/useMessage'
import * as XLSX from 'xlsx'
const { createMessage } = useMessage()
// 格式表格时间
export function formatTableData(v) {
if (v) {
@ -34,3 +37,59 @@ export function closePage(topath) {
}
}
}
/* excel()
* api: params: columes: name: excel
*/
export function exportExcel(api, params = {}, columns = [], name = '未命名') {
if (!api) return createMessage.warning('缺少api')
params['pageCondition']['isExport'] = true
// 过滤出需要显示的列
const cols = columns.filter(item => {
return !item.defaultHidden || item.visible
})
api(params).then(res => {
const { data } = res
const fileData = data.map(row => {
const obj = {}
cols.forEach(item => {
for (var key in row) {
if (item.dataIndex === key) {
obj[item.title] = row[key]
}
}
})
return obj
})
// 创建工作簿
const workbook = XLSX.utils.book_new()
// 将数据转换为工作表
const worksheet = XLSX.utils.json_to_sheet(fileData)
// 将工作表添加到工作簿
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
// 生成Excel的配置
const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' })
// 创建二进制对象并创建url
const blob = new Blob([s2ab(wbout)], { type: 'application/octet-stream' })
const url = URL.createObjectURL(blob)
// 创建a标签模拟点击进行下载
const a = document.createElement('a')
a.href = url
a.download = name + '.xlsx'
document.body.appendChild(a)
a.click()
// 清除对象URL
setTimeout(() => {
URL.revokeObjectURL(url)
document.body.removeChild(a)
}, 0)
})
}
// 将字符串转换为ArrayBuffer
function s2ab(s) {
const buf = new ArrayBuffer(s.length)
const view = new Uint8Array(buf)
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
return buf
}

@ -51,19 +51,20 @@
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id
updateFormField(updateSchema)
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({

@ -174,6 +174,7 @@
}
})
Data.push(Obj)
console.log(Data)
})
// 簿
const workbook = XLSX.utils.book_new()

@ -91,8 +91,8 @@ export const columns: BasicColumn[] = [
},
{
title: '申请支付日期',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'paymentDate',
width: 130
},
{
title: '最后审核日期',
@ -104,16 +104,16 @@ export const columns: BasicColumn[] = [
dataIndex: 'auditerName',
width: 120
},
{
title: '结算对象银行',
dataIndex: 'customerBank',
width: 150
},
{
title: '结算对象账户',
dataIndex: 'customerBAN',
width: 140
},
// {
// title: '结算对象银行',
// dataIndex: 'customerBank',
// width: 150
// },
// {
// title: '结算对象账户',
// dataIndex: 'customerBAN',
// width: 140
// },
{
title: '备注',
dataIndex: 'note',
@ -161,64 +161,64 @@ export const columns: BasicColumn[] = [
// },
{
title: '委托单位',
dataIndex: 'client',
dataIndex: 'clientName',
width: 120
},
////////////////////
{
title: '申请方式',
dataIndex: 'financeSoftCode',
width: 200
},
// {
// title: '申请方式',
// dataIndex: 'financeSoftCode',
// width: 200
// },
{
title: '已打印',
dataIndex: 'financeSoftCode',
width: 200
},
{
title: '入账申请编号',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'isPrinted',
width: 100
},
// {
// title: '入账申请编号',
// dataIndex: 'financeSoftCode',
// width: 200
// },
{
title: '驳回原因',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'reason',
width: 150
},
{
title: '结算方式',
dataIndex: 'financeSoftCode',
width: 200
},
{
title: '申请部门',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'settlementTypeName',
width: 130
},
// {
// title: '申请部门',
// dataIndex: 'financeSoftCode',
// width: 200
// },
{
title: '打印次数',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'printTimes',
width: 100
},
{
title: '所属分部',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'saleDeptName',
width: 150,
},
{
title: '发票日期',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'invoiceDate',
width: 120,
},
{
title: '发票金额',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'invoiceAmount',
width: 120
},
{
title: '收到发票',
dataIndex: 'financeSoftCode',
width: 200
dataIndex: 'isInvoiceReceived',
width: 80
}
]
@ -254,7 +254,7 @@ export const searchFormSchema: FormSchema[] = [
}
},
{
field: 'billStatus',
field: 'status',
label: '申请单状态',
component: 'Select',
colProps: { span: 4 },

@ -37,19 +37,23 @@
</a-popconfirm>
<div class="nav"><i class="iconfont icon-xiaopiaodayin"></i>打印</div>
<div class="nav">
<div class="nav" @click="exportFile">
<i class="iconfont icon-shishijifei"></i>导出Excel
</div>
<!-- 打印组件 -->
<DsPrint
ref="dsPrint"
name="费用录入"
></DsPrint>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, defineProps, reactive } from 'vue'
import { ref, defineProps, reactive, defineEmits } from 'vue'
import { useGo } from '/@/hooks/web/usePage'
import { useMessage } from '/@/hooks/web/useMessage'
import { useRouter } from 'vue-router'
import { useModal } from '/@/components/Modal'
//
import DsPrint from '/@/components/Print/index.vue'
import { Delete, ApplyAudit, Withdraw } from '../api'
const router = useRouter()
const { createMessage } = useMessage()
const go = useGo()
const props = defineProps({
@ -60,6 +64,7 @@
type: Function
}
})
const emit = defineEmits(['exportFile'])
//
function create() {
go(`/paid-apply/create`)
@ -76,6 +81,10 @@
}
go(`/BookingDetail?id=${pkIdArr[0]}&isCopy=${true}`)
}
//
const exportFile = () => {
emit('exportFile')
}
const copyMoreFlag = ref(false)
const copyMoreForm = reactive({
number: 1,

@ -96,7 +96,7 @@
canResize: false,
rowSelection: { type: 'checkbox' },
immediate: false,
id: 1
id: '1'
})
//
const add = () => {

@ -7,7 +7,7 @@
<div class="ds-pay-apply">
<BasicTable @register="registerTable" @row-dbClick="edit">
<template #toolbar>
<TableActionBar :selectRow="getSelectRows" :reload="reload"></TableActionBar>
<TableActionBar :selectRow="getSelectRows" :reload="reload" @exportFile="exportFile"></TableActionBar>
</template>
<template v-slot:bodyCell="{ column, record }">
<!-- 复制单号 -->
@ -35,10 +35,13 @@
import { GetList } from './api'
import { columns, searchFormSchema, FeeStatus } from './columns'
import { useGo } from '/@/hooks/web/usePage'
import { exportExcel } from '/@/hooks/web/common'
const go = useGo()
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({
const params = ref([])
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows, getColumns }] = useTable({
title: '',
api: async (p) => {
params.value = p
const res = await GetList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
@ -56,22 +59,36 @@
},
}
let condition: API.ConditionItem[] = []
if (!!data.UserName) {
if (!!data.billNO) {
condition.push({
FieldName: 'UserName',
FieldValue: data.UserName,
FieldName: 'billNO',
FieldValue: data.billNO,
ConditionalType: 1,
})
}
if (!!data.UserCode) {
if (!!data.applicationNO) {
condition.push({
FieldName: 'UserCode',
FieldValue: data.UserCode,
FieldName: 'applicationNO',
FieldValue: data.applicationNO,
ConditionalType: 1,
})
}
if (!!data.customerId) {
condition.push({
FieldName: 'customerId',
FieldValue: data.customerId,
ConditionalType: 1,
})
}
if (!!data.status) {
condition.push({
FieldName: 'status',
FieldValue: data.status,
ConditionalType: 1,
})
}
console.log(condition)
postParam.queryCondition = JSON.stringify(condition)
// console.log(postParam);
return postParam
},
columns,
@ -87,8 +104,13 @@
bordered: true,
showIndexColumn: true,
canResize: false,
immediate: false
immediate: false,
id: '0'
})
// Excel
const exportFile = () => {
exportExcel(GetList, params.value, getColumns(), '费用申请')
}
const copyNo = (e, v) => {
e.stopPropagation()
navigator.clipboard.writeText(v)

Loading…
Cancel
Save