|
|
|
@ -17,18 +17,38 @@
|
|
|
|
|
<div class="nav" @click="GoDetailed(false, null)">
|
|
|
|
|
<i class="iconfont icon-jiahao2fill"></i>新建
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav" @click="FnDel"> <i class="iconfont icon-shanchu"></i>删除 </div>
|
|
|
|
|
<div class="nav" @click="Lock">
|
|
|
|
|
<Icon icon="ant-design:lock-outlined" class="iconfont" />
|
|
|
|
|
锁定
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav" @click="UnLock">
|
|
|
|
|
<Icon icon="ant-design:unlock-outlined" class="iconfont" />
|
|
|
|
|
撤销锁定
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav" @click="ExportExcel">
|
|
|
|
|
<i class="iconfont icon-weibiaoti--"></i>EXCEL导出
|
|
|
|
|
</div>
|
|
|
|
|
<div class="nav" @click="printFee"> <i class="iconfont icon-xiaopiaodayin"></i>打印 </div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<DsPrint ref="dsPrint" name="客户对账"></DsPrint>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { GetCheckBillList } from './api.js'
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { GetCheckBillList, CheckBillLocking, CheckBillUnLocking } from './api.js'
|
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
|
import { columns, searchFormSchema } from './columns'
|
|
|
|
|
import { columns, searchFormSchema, billTypeData } from './columns'
|
|
|
|
|
import { GetOpenPrintModuleList } from '/@/views/operation/seaexport/api/BookingLedger.js'
|
|
|
|
|
import * as XLSX from 'xlsx'
|
|
|
|
|
import DsPrint from '/@/components/Print/index.vue'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
const { notification } = useMessage()
|
|
|
|
|
import { useGo } from '/@/hooks/web/usePage'
|
|
|
|
|
const go = useGo()
|
|
|
|
|
// 表格
|
|
|
|
|
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({
|
|
|
|
|
const [registerTable, { getForm, getPaginationRef, getSelectRows, getRawDataSource }] = useTable({
|
|
|
|
|
title: '',
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
const res: API.DataResult = await GetCheckBillList(p)
|
|
|
|
@ -47,6 +67,10 @@
|
|
|
|
|
sortConditions: [],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
postParam.pageCondition.sortConditions.push({
|
|
|
|
|
sortField: 'createTime',
|
|
|
|
|
listSortDirection: 1,
|
|
|
|
|
})
|
|
|
|
|
let condition: API.ConditionItem[] = []
|
|
|
|
|
if (!!data.billNo) {
|
|
|
|
|
condition.push({
|
|
|
|
@ -55,6 +79,13 @@
|
|
|
|
|
ConditionalType: 1,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (!!data.customerName) {
|
|
|
|
|
condition.push({
|
|
|
|
|
FieldName: 'customerName',
|
|
|
|
|
FieldValue: data.customerName,
|
|
|
|
|
ConditionalType: 1,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
postParam.queryCondition = JSON.stringify(condition)
|
|
|
|
|
return postParam
|
|
|
|
|
},
|
|
|
|
@ -74,16 +105,110 @@
|
|
|
|
|
resizeHeightOffset: 35,
|
|
|
|
|
immediate: true,
|
|
|
|
|
})
|
|
|
|
|
// 新增 编辑
|
|
|
|
|
function GoDetailed(type, data) {
|
|
|
|
|
console.log(type, data)
|
|
|
|
|
|
|
|
|
|
if (type) {
|
|
|
|
|
console.log(data)
|
|
|
|
|
go(`/CustomerReconciliationDetails?id=${data.id}`)
|
|
|
|
|
} else {
|
|
|
|
|
go(`/CustomerReconciliationDetails`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 删除
|
|
|
|
|
function FnDel() {
|
|
|
|
|
notification.warning({ message: '待开发', duration: 3 })
|
|
|
|
|
}
|
|
|
|
|
// 锁定
|
|
|
|
|
function Lock() {
|
|
|
|
|
let ApiData: any = {
|
|
|
|
|
ids: [],
|
|
|
|
|
}
|
|
|
|
|
getSelectRows().forEach((e) => {
|
|
|
|
|
ApiData.ids.push(e.id)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
CheckBillLocking(ApiData).then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
notification.success({ message: '锁定成功', duration: 3 })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 解除锁定
|
|
|
|
|
function UnLock() {
|
|
|
|
|
let ApiData: any = {
|
|
|
|
|
ids: [],
|
|
|
|
|
}
|
|
|
|
|
getSelectRows().forEach((e) => {
|
|
|
|
|
ApiData.ids.push(e.id)
|
|
|
|
|
})
|
|
|
|
|
CheckBillUnLocking(ApiData).then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
notification.success({ message: '解除锁定成功', duration: 3 })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 导出 EXCEL
|
|
|
|
|
function ExportExcel() {
|
|
|
|
|
let Data: any = []
|
|
|
|
|
let DelData = ['id', 'bsno', 'ctnCode']
|
|
|
|
|
getRawDataSource().forEach((item, index) => {
|
|
|
|
|
let Obj = {}
|
|
|
|
|
Object.keys(item).forEach((item2) => {
|
|
|
|
|
if (!DelData.includes(item2)) {
|
|
|
|
|
columns.forEach((e) => {
|
|
|
|
|
if (e.dataIndex == item2) {
|
|
|
|
|
if (e.title == '收付类型') {
|
|
|
|
|
let data = ''
|
|
|
|
|
billTypeData.forEach((d) => {
|
|
|
|
|
if (d.code == item[item2]) {
|
|
|
|
|
data = d.value
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
Obj[e.title] = data
|
|
|
|
|
} else {
|
|
|
|
|
Obj[e.title] = item[item2]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
Data.push(Obj)
|
|
|
|
|
})
|
|
|
|
|
// 创建工作簿
|
|
|
|
|
const workbook = XLSX.utils.book_new()
|
|
|
|
|
// 将数据转换为工作表
|
|
|
|
|
const worksheet = XLSX.utils.json_to_sheet(Data)
|
|
|
|
|
// 将工作表添加到工作簿
|
|
|
|
|
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 = '客户对账.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
|
|
|
|
|
}
|
|
|
|
|
const dsPrint = ref()
|
|
|
|
|
// 打印费用
|
|
|
|
|
async function printFee() {
|
|
|
|
|
dsPrint.value.init()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
|