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

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

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

@ -1,6 +1,7 @@
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ field: 'billNo', label: '对账编号', component: 'Input', colProps: { span: 4 } }, { field: 'billNo', label: '对账编号', component: 'Input', colProps: { span: 4 } },
{ field: 'customerName', label: '对账客户名称', component: 'Input', colProps: { span: 4 } },
// { // {
// field: 'mblno', // field: 'mblno',
// label: '对账客户', // label: '对账客户',
@ -74,7 +75,7 @@ export const searchFormSchema: FormSchema[] = [
// colProps: { span: 2 }, // colProps: { span: 2 },
// }, // },
] ]
const billTypeData = [ export const billTypeData = [
{ code: 0, value: '全部' }, { code: 0, value: '全部' },
{ code: 1, value: '应收' }, { code: 1, value: '应收' },
{ code: 2, value: '应付' }, { code: 2, value: '应付' },
@ -108,4 +109,7 @@ export const columns: BasicColumn[] = [
{ title: '未付RMB', dataIndex: 'balrmbcr', align: 'left' }, { title: '未付RMB', dataIndex: 'balrmbcr', align: 'left' },
{ title: '应付USD', dataIndex: 'usdcr', align: 'left' }, { title: '应付USD', dataIndex: 'usdcr', align: 'left' },
{ title: '未付USD', dataIndex: 'balusdcr', 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" @cancel="closeModal"
:defaultFullscreen="true" :defaultFullscreen="true"
:canFullscreen="false" :canFullscreen="false"
:showFooter="false"
> >
<div class="CsMain"> <div class="CsMain">
<a-row class="p-4 CsHeader" :gutter="5"> <a-row class="p-4 CsHeader" :gutter="5">

@ -17,18 +17,38 @@
<div class="nav" @click="GoDetailed(false, null)"> <div class="nav" @click="GoDetailed(false, null)">
<i class="iconfont icon-jiahao2fill"></i>新建 <i class="iconfont icon-jiahao2fill"></i>新建
</div> </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> </div>
</template> </template>
</BasicTable> </BasicTable>
<DsPrint ref="dsPrint" name="客户对账"></DsPrint>
</template> </template>
<script lang="ts" setup> <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 { 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' import { useGo } from '/@/hooks/web/usePage'
const go = useGo() const go = useGo()
// //
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({ const [registerTable, { getForm, getPaginationRef, getSelectRows, getRawDataSource }] = useTable({
title: '', title: '',
api: async (p) => { api: async (p) => {
const res: API.DataResult = await GetCheckBillList(p) const res: API.DataResult = await GetCheckBillList(p)
@ -47,6 +67,10 @@
sortConditions: [], sortConditions: [],
}, },
} }
postParam.pageCondition.sortConditions.push({
sortField: 'createTime',
listSortDirection: 1,
})
let condition: API.ConditionItem[] = [] let condition: API.ConditionItem[] = []
if (!!data.billNo) { if (!!data.billNo) {
condition.push({ condition.push({
@ -55,6 +79,13 @@
ConditionalType: 1, ConditionalType: 1,
}) })
} }
if (!!data.customerName) {
condition.push({
FieldName: 'customerName',
FieldValue: data.customerName,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition) postParam.queryCondition = JSON.stringify(condition)
return postParam return postParam
}, },
@ -74,16 +105,110 @@
resizeHeightOffset: 35, resizeHeightOffset: 35,
immediate: true, immediate: true,
}) })
//
function GoDetailed(type, data) { function GoDetailed(type, data) {
console.log(type, data)
if (type) { if (type) {
console.log(data)
go(`/CustomerReconciliationDetails?id=${data.id}`) go(`/CustomerReconciliationDetails?id=${data.id}`)
} else { } else {
go(`/CustomerReconciliationDetails`) 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> </script>
<style lang="less"> <style lang="less">

@ -131,166 +131,171 @@
// size: 'small', // size: 'small',
}) })
async function submit() { async function submit() {
let data = getFieldsValue2() setTimeout(() => {
let data = getFieldsValue2()
console.log(data, 11111111111)
let SS = data.pkgs let SS = data.pkgs
if (SS) { if (SS) {
let GetStringNum = (str) => { let GetStringNum = (str) => {
var num = 0 var num = 0
if (str == null || str == '') return num if (str == null || str == '') return num
if (str.length == 0) return num if (str.length == 0) return num
var if_find = false var if_find = false
var str_num = '' var str_num = ''
for (var i = 0; i < str.length; i += 1) { for (var i = 0; i < str.length; i += 1) {
var member = str.substr(i, 1) var member = str.substr(i, 1)
if ( if (
member == '0' || member == '0' ||
member == '1' || member == '1' ||
member == '2' || member == '2' ||
member == '3' || member == '3' ||
member == '4' || member == '4' ||
member == '5' || member == '5' ||
member == '6' || member == '6' ||
member == '7' || member == '7' ||
member == '8' || member == '8' ||
member == '9' || member == '9' ||
member == '.' || member == '.' ||
member == '-' member == '-'
) { ) {
if (!if_find) { if (!if_find) {
str_num = str_num + member str_num = str_num + member
}
} else {
if_find = true
} }
} else {
if_find = true
} }
return str_num
} }
return str_num let ToEn = (a) => {
} // eslint-disable-next-line no-array-constructor
let ToEn = (a) => { const arr1 = new Array('', ' thousand', ' million', ' billion')
// eslint-disable-next-line no-array-constructor const b = a.length
const arr1 = new Array('', ' thousand', ' million', ' billion') let f: any = null
const b = a.length let h = 0
let f: any = null let g = ''
let h = 0 const e = Math.ceil(b / 3)
let g = '' const k = b - e * 3
const e = Math.ceil(b / 3) g = ''
const k = b - e * 3 for (f = k; f < b; f += 3) {
g = '' ++h
for (f = k; f < b; f += 3) { // eslint-disable-next-line no-undef
++h const num3 = f >= 0 ? a.substring(f, f + 3) : a.substring(0, k + 3)
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
const num3 = f >= 0 ? a.substring(f, f + 3) : a.substring(0, k + 3) const strEng = English(num3)
// eslint-disable-next-line no-undef
const strEng = English(num3)
// eslint-disable-next-line eqeqeq
if (strEng != '') {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (g != '') g += ' ' if (strEng != '') {
g += English(num3) + arr1[e - h] // eslint-disable-next-line eqeqeq
if (g != '') g += ' '
g += English(num3) + arr1[e - h]
}
} }
return g
} }
return g let English = (a) => {
} // eslint-disable-next-line no-array-constructor
let English = (a) => { var arr2 = new Array(
// eslint-disable-next-line no-array-constructor 'zero',
var arr2 = new Array( 'ten',
'zero', 'twenty',
'ten', 'thirty',
'twenty', 'forty',
'thirty', 'fifty',
'forty', 'sixty',
'fifty', 'seventy',
'sixty', 'eighty',
'seventy', 'ninety',
'eighty', )
'ninety', // eslint-disable-next-line no-array-constructor
) var arr3 = new Array(
// eslint-disable-next-line no-array-constructor 'zero',
var arr3 = new Array( 'one',
'zero', 'two',
'one', 'three',
'two', 'four',
'three', 'five',
'four', 'six',
'five', 'seven',
'six', 'eight',
'seven', 'nine',
'eight', )
'nine', // eslint-disable-next-line no-array-constructor
) var arr4 = new Array(
// eslint-disable-next-line no-array-constructor 'ten',
var arr4 = new Array( 'eleven',
'ten', 'twelve',
'eleven', 'thirteen',
'twelve', 'fourteen',
'thirteen', 'fifteen',
'fourteen', 'sixteen',
'fifteen', 'seventeen',
'sixteen', 'eighteen',
'seventeen', 'nineteen',
'eighteen', )
'nineteen',
)
let strRet = '' let strRet = ''
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (a.length == 3 && a.substr(0, 3) != '000') { if (a.length == 3 && a.substr(0, 3) != '000') {
if (a.substr(0, 1) != '0') { if (a.substr(0, 1) != '0') {
strRet += arr3[a.substr(0, 1)] + ' hundred' strRet += arr3[a.substr(0, 1)] + ' hundred'
if (a.substr(1, 2) != '00') strRet += ' and ' if (a.substr(1, 2) != '00') strRet += ' and '
} else { } else {
strRet += ' and ' strRet += ' and '
} }
a = a.substring(1)
}
if (a.length == 2) {
if (a.substr(0, 1) == '0') a = a.substring(1)
else if (a.substr(0, 1) == '1') strRet += arr4[a.substr(1, 2)]
else {
strRet += arr2[a.substr(0, 1)]
if (a.substr(1, 1) != '0') strRet += '-'
a = a.substring(1) a = a.substring(1)
} }
} if (a.length == 2) {
if (a.length == 1 && a.substr(0, 1) != '0') strRet += arr3[a.substr(0, 1)] if (a.substr(0, 1) == '0') a = a.substring(1)
return strRet else if (a.substr(0, 1) == '1') strRet += arr4[a.substr(1, 2)]
} else {
SS = SS.toString() strRet += arr2[a.substr(0, 1)]
const i = SS.indexOf('\n') if (a.substr(1, 1) != '0') strRet += '-'
let num = 0 a = a.substring(1)
let strKind: any = '' }
let enCapital = ''
if (i > 0) {
const slist = SS.split('\n')
for (let i = 0; i < slist.length; i += 1) {
const member = slist[i]
const strNum: any = GetStringNum(member)
if (i == 0) {
strKind = member.substring(strNum.length)
} }
num = parseFloat(num).add(parseFloat(strNum)) if (a.length == 1 && a.substr(0, 1) != '0') strRet += arr3[a.substr(0, 1)]
return strRet
} }
SS = SS.toString()
const i = SS.indexOf('\n')
let num = 0
let strKind: any = ''
let enCapital = ''
if (i > 0) {
const slist = SS.split('\n')
for (let i = 0; i < slist.length; i += 1) {
const member = slist[i]
const strNum: any = GetStringNum(member)
if (i == 0) {
strKind = member.substring(strNum.length)
}
num = parseFloat(num).add(parseFloat(strNum))
}
if (strKind !== '') { if (strKind !== '') {
enCapital = strKind enCapital = strKind
} else {
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.'
}
console.log(strKind, 1)
} else { } else {
strKind = data.kindPkgsName ? data.kindPkgsName : '' const strNum: any = GetStringNum(SS)
enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.' strKind = SS.substring(strNum.length) ? SS.substring(strNum.length) : ''
if (strKind !== '') {
enCapital = strKind
} else {
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
}
console.log(strKind, 2)
} }
setFieldsValue4({ totalNo: enCapital })
} else { } else {
const strNum: any = GetStringNum(SS) setFieldsValue4({ totalNo: '' })
strKind = SS.substring(strNum.length) ? SS.substring(strNum.length) : ''
if (strKind !== '') {
enCapital = strKind
} else {
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
}
} }
setFieldsValue4({ totalNo: enCapital }) }, 0)
} else {
setFieldsValue4({ totalNo: '' })
}
} }
const [ const [
registerForm4, registerForm4,

@ -733,7 +733,7 @@
<!-- 打印弹窗 start --> <!-- 打印弹窗 start -->
<a-modal <a-modal
:zIndex="1005" :zIndex="1005"
width="35vw" width="45vw"
:maskClosable="false" :maskClosable="false"
v-model:visible="PrintModalVisible" v-model:visible="PrintModalVisible"
title="打印" title="打印"
@ -991,7 +991,6 @@
const dataSource = ref<any>([]) const dataSource = ref<any>([])
// //
const [registerTable, { reload, getForm, setTableData }] = useTable({ const [registerTable, { reload, getForm, setTableData }] = useTable({
title: '打印列表',
// //
handleSearchInfoFn: () => { handleSearchInfoFn: () => {
let Arr: any = [] let Arr: any = []
@ -1048,6 +1047,7 @@
} }
// //
function FnCilckTemplateType({ templateId, printType }) { function FnCilckTemplateType({ templateId, printType }) {
spinning.value = true
notification.success({ message: '搜索文件中...', duration: 3 }) notification.success({ message: '搜索文件中...', duration: 3 })
GetOpenJsonPrintInfo({ GetOpenJsonPrintInfo({
templateId, templateId,
@ -1059,47 +1059,14 @@
if (!res.succeeded) { if (!res.succeeded) {
notification.error({ message: res.message, duration: 3 }) notification.error({ message: res.message, duration: 3 })
} else { } 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}` let fileURL = `http://60.209.125.238:3009/PrintTempFile/${res.data}`
window.open(fileURL) window.open(fileURL)
} }
spinning.value = false
}) })
.catch((err) => { .catch((err) => {
console.log(err) console.log(err)
spinning.value = false
}) })
} }
function openModel(type) { function openModel(type) {

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

@ -1,5 +1,7 @@
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
import { Tag } from 'ant-design-vue' import { Tag } from 'ant-design-vue'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '机构名称', title: '机构名称',
@ -336,13 +338,32 @@ export const formSchema: FormSchema[] = [
span: 6, span: 6,
}, },
}, },
// {
// label: '本地货币',
// field: 'localCurrency',
// component: 'Input',
// defaultValue: '',
// colProps: {
// span: 6,
// },
// },
{ {
label: '本地货币',
field: 'localCurrency', field: 'localCurrency',
component: 'Input', label: '本地货币',
defaultValue: '', component: 'ApiSelect',
colProps: { defaultValue: '',
span: 6, 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', field: 'currency',
component: 'Input', label: '币别',
defaultValue: '', component: 'ApiSelect',
colProps: { defaultValue: '',
span: 12, 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