szh-new
张同海 5 months ago
parent 74ab977de9
commit 2424dc9001

@ -1,25 +1,32 @@
import {
GetClientSourceSelectList,
GetClientStlModeSelectList,
GetVesselSelectList
GetVesselSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger'
import { GetFeeCurrencySelectList } from '/@/api/common/index'
export default {
// 业务来源
GetClientSourceSelectList: () => {
return GetClientSourceSelectList().then(res => {
return GetClientSourceSelectList().then((res) => {
return res.data
})
},
// 结算方式
GetClientStlModeSelectList: () => {
return GetClientStlModeSelectList().then(res => {
return GetClientStlModeSelectList().then((res) => {
return res.data
})
},
// 船名
GetVesselSelectList: () => {
return GetVesselSelectList().then(res => {
return GetVesselSelectList().then((res) => {
return res.data
})
}
},
// 币别
GetFeeCurrencySelectList: () => {
return GetFeeCurrencySelectList().then((res) => {
return res.data
})
},
}

@ -16,6 +16,8 @@ export const useOptionsStore = defineStore({
GetClientStlModeSelectList: [],
// 船名
GetVesselSelectList: [],
// 币别
GetFeeCurrencySelectList: [],
}),
getters: {
// 通过code获取下拉字典code)就是接口尾部单词
@ -25,11 +27,11 @@ export const useOptionsStore = defineStore({
return store.$state[code]
} else {
// 没有值调用接口存数据
store.setOptionsByCode(code).then(res => {
store.setOptionsByCode(code).then((res) => {
return res
})
}
}
},
},
actions: {
/**
@ -38,12 +40,12 @@ export const useOptionsStore = defineStore({
*/
setOptionsByCode(code) {
const options = Config[code]()
return options.then(res => {
return options.then((res) => {
this[code] = res
return res
})
}
}
},
},
})
// Need to be used outside the setup

@ -1,6 +1,7 @@
import { BasicColumn, FormSchema } from '/@/components/Table'
export const searchFormSchema: FormSchema[] = [
{ field: 'billNo', label: '对账编号', component: 'Input', colProps: { span: 4 } },
{ field: 'customerName', label: '对账客户名称', component: 'Input', colProps: { span: 4 } },
// {
// field: 'mblno',
// label: '对账客户',
@ -74,7 +75,7 @@ export const searchFormSchema: FormSchema[] = [
// colProps: { span: 2 },
// },
]
const billTypeData = [
export const billTypeData = [
{ code: 0, value: '全部' },
{ code: 1, value: '应收' },
{ code: 2, value: '应付' },
@ -108,4 +109,7 @@ export const columns: BasicColumn[] = [
{ title: '未付RMB', dataIndex: 'balrmbcr', align: 'left' },
{ title: '应付USD', dataIndex: 'usdcr', align: 'left' },
{ title: '未付USD', dataIndex: 'balusdcr', align: 'left' },
{ title: '对账时间', dataIndex: 'createTime', align: 'left' },
{ title: '对账人', dataIndex: 'createByName', align: 'left' },
{ title: '备注', dataIndex: 'note', align: 'left' },
]

@ -9,6 +9,7 @@
@cancel="closeModal"
:defaultFullscreen="true"
:canFullscreen="false"
:showFooter="false"
>
<div class="CsMain">
<a-row class="p-4 CsHeader" :gutter="5">

@ -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">

@ -131,7 +131,9 @@
// size: 'small',
})
async function submit() {
setTimeout(() => {
let data = getFieldsValue2()
console.log(data, 11111111111)
let SS = data.pkgs
if (SS) {
@ -277,6 +279,7 @@
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.'
}
console.log(strKind, 1)
} else {
const strNum: any = GetStringNum(SS)
strKind = SS.substring(strNum.length) ? SS.substring(strNum.length) : ''
@ -286,11 +289,13 @@
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
}
console.log(strKind, 2)
}
setFieldsValue4({ totalNo: enCapital })
} else {
setFieldsValue4({ totalNo: '' })
}
}, 0)
}
const [
registerForm4,

@ -733,7 +733,7 @@
<!-- 打印弹窗 start -->
<a-modal
:zIndex="1005"
width="35vw"
width="45vw"
:maskClosable="false"
v-model:visible="PrintModalVisible"
title="打印"
@ -991,7 +991,6 @@
const dataSource = ref<any>([])
//
const [registerTable, { reload, getForm, setTableData }] = useTable({
title: '打印列表',
//
handleSearchInfoFn: () => {
let Arr: any = []
@ -1048,6 +1047,7 @@
}
//
function FnCilckTemplateType({ templateId, printType }) {
spinning.value = true
notification.success({ message: '搜索文件中...', duration: 3 })
GetOpenJsonPrintInfo({
templateId,
@ -1059,47 +1059,14 @@
if (!res.succeeded) {
notification.error({ message: res.message, duration: 3 })
} else {
// // 1.pdf; 2.excel; 3.word
// let base64ToBlob = (code) => {
// code = code.replace(/[\n\r]/g, '') // base64base64
// // atob() 使 base-64
// const raw = window.atob(code)
// const rawLength = raw.length
// const uInt8Array = new Uint8Array(rawLength)
// for (let i = 0; i < rawLength; ++i) {
// // UnicodeUnit8Array
// uInt8Array[i] = raw.charCodeAt(i)
// }
// // BlobUint8Arraypdf
// let type = ''
// switch (res.data.printType) {
// case '2':
// type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
// break
// case '3':
// type = 'application/msword'
// break
// default:
// type = 'application/pdf'
// break
// }
// return new Blob([uInt8Array], { type })
// }
// const blob = base64ToBlob(res.data.printData)
// ''
// if (window.navigator && window.navigator.msSaveOrOpenBlob) {
// window.navigator.msSaveOrOpenBlob(blob)
// } else {
// const fileURL = URL.createObjectURL(blob)
// window.open(fileURL) //ppf
// }
let fileURL = `http://60.209.125.238:3009/PrintTempFile/${res.data}`
window.open(fileURL)
}
spinning.value = false
})
.catch((err) => {
console.log(err)
spinning.value = false
})
}
function openModel(type) {

@ -20,6 +20,6 @@ export const searchFormSchema: FormSchema[] = [
field: 'templateName',
label: '模板名称',
component: 'Input',
colProps: { span: 6 },
colProps: { span: 8 },
},
]

@ -1,5 +1,7 @@
import { BasicColumn, FormSchema } from '/@/components/Table'
import { Tag } from 'ant-design-vue'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
export const columns: BasicColumn[] = [
{
title: '机构名称',
@ -336,13 +338,32 @@ export const formSchema: FormSchema[] = [
span: 6,
},
},
// {
// label: '本地货币',
// field: 'localCurrency',
// component: 'Input',
// defaultValue: '',
// colProps: {
// span: 6,
// },
// },
{
label: '本地货币',
field: 'localCurrency',
component: 'Input',
defaultValue: '',
colProps: {
span: 6,
label: '本地货币',
component: 'ApiSelect',
defaultValue: '',
colProps: { span: 6 },
componentProps: () => {
return {
allowClear: true,
showSearch: true,
option: optionsStore.getOptionsByCode('GetFeeCurrencySelectList'),
labelField: 'codeName',
valueField: 'codeName',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
@ -534,12 +555,22 @@ export const BankformSchema: FormSchema[] = [
},
},
{
label: '币别',
field: 'currency',
component: 'Input',
defaultValue: '',
colProps: {
span: 12,
label: '币别',
component: 'ApiSelect',
defaultValue: '',
colProps: { span: 12 },
componentProps: () => {
return {
allowClear: true,
showSearch: true,
option: optionsStore.getOptionsByCode('GetFeeCurrencySelectList'),
labelField: 'codeName',
valueField: 'codeName',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{

Loading…
Cancel
Save