sunzehua 5 months ago
commit cd3d00ae99

@ -67,7 +67,7 @@ enum Api {
GetFeeCodeSelectList = '/mainApi/ClientCommon/GetFeeCodeSelectList', GetFeeCodeSelectList = '/mainApi/ClientCommon/GetFeeCodeSelectList',
// 获取箱型下拉数据 // 获取箱型下拉数据
GetCtnSelectList = '/mainApi/ClientCommon/GetCtnSelectList', GetCtnSelectList = '/mainApi/ClientCommon/GetCtnSelectList',
// 保证类型下拉数据 // 包装类型下拉数据
GetPackageSelectList = '/mainApi/ClientCommon/GetPackageSelectList', GetPackageSelectList = '/mainApi/ClientCommon/GetPackageSelectList',
// 签约方式下拉数据 // 签约方式下拉数据
GetIssueTypeSelectList = '/mainApi/ClientCommon/GetIssueTypeSelectList', GetIssueTypeSelectList = '/mainApi/ClientCommon/GetIssueTypeSelectList',

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -165,9 +165,8 @@
.ds-action-bar { .ds-action-bar {
position: fixed; position: fixed;
right: 30px; right: 30px;
height: auto; height: auto;
z-index: 99; z-index: 999;
cursor: pointer; cursor: pointer;
width: 52px; width: 52px;
opacity: 1; opacity: 1;

@ -6,45 +6,63 @@
<template> <template>
<div> <div>
<a-modal <a-modal
class="ds-form-detail ds-print" class="ds-form-detail ds-print ds-modal-small"
v-model:visible="visible" v-model:visible="visible"
v-if="visible" v-if="visible"
title="打印" title="打印"
width="600px" width="850px"
:maskClosable="false" :maskClosable="false"
> >
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div>
<a-form <a-form
ref="fileForm"
name="basic"
layout="vertical" layout="vertical"
autocomplete="off" autocomplete="off"
class="ant-form-small"
> >
<div class="flex" style="justify-content: space-between;">
<a-form-item <a-form-item
label="打印格式" label="关键字"
> >
<a-radio-group v-model:value="type"> <a-input v-model:value="name" @keyup.enter="search" style="width: 400px;"></a-input>
<a-radio value="1">.pdf</a-radio>
<a-radio value="2">.xlsx</a-radio>
<a-radio value="3">.docx</a-radio>
</a-radio-group>
<p class="message">默认打印格式为pdf,如需其他格式请选择</p>
</a-form-item> </a-form-item>
<a-spin :spinning="loading"> <div>
<a-form-item <a-button @click="reset"> </a-button>
label="点击选择模版将跳转打印预览页" <a-button @click="search" type="primary"> </a-button>
> </div>
<a-row :gutter="15"> </div>
<a-col :span="12" v-for="item in modelData" :key="item.id" @click="toPrint(item.id)"> </a-form>
</div>
<div>
<h4>模版</h4>
</div>
<a-row :gutter="10">
<a-col :span="12" v-for="item in modelData" class="mb10" :key="item.id">
<div class="model-card"> <div class="model-card">
<span class="iconfont icon-printing" :style="{ fontSize: '13px' }"></span> <span class="tem-name">
{{ item.templateName }} {{ item.templateName }}
</span>
<span class="flex flex-btns">
<dl @click="toPrint(item.id, '1')">
<dt><img src="../../assets/images/PDF2.png" alt=""></dt>
<dd>pdf</dd>
</dl>
<dl @click="toPrint(item.id, '2', item.name)">
<dt><img src="../../assets/images/xksx2.png" alt=""></dt>
<dd>xlsx</dd>
</dl>
<dl @click="toPrint(item.id, '3')">
<dt><img src="../../assets/images/DOC2.png" alt=""></dt>
<dd>doc</dd>
</dl>
</span>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
</a-form-item> <div v-show="!modelData.length" class="no-data">
</a-spin> <span class="iconfont icon-wushuju" :style="{ fontSize: '50px' }"></span>
</a-form> <div class="mb10">暂无数据</div>
</div>
</a-spin> </a-spin>
<template #footer> <template #footer>
</template> </template>
@ -64,6 +82,8 @@
default: null default: null
} }
}) })
//
const name = ref()
// //
const visible = ref(false) const visible = ref(false)
const loading = ref(false) const loading = ref(false)
@ -73,6 +93,8 @@
const modelData = ref([]) const modelData = ref([])
// //
const jsonDataStr = ref() const jsonDataStr = ref()
//
const sourceData = ref([])
// (list) // (list)
const init = (v) => { const init = (v) => {
visible.value = true visible.value = true
@ -80,12 +102,26 @@
loading.value = true loading.value = true
GetOpenPrintTemplateList({ id: props.id }).then(r => { GetOpenPrintTemplateList({ id: props.id }).then(r => {
loading.value = false loading.value = false
//
modelData.value = r.data modelData.value = r.data
sourceData.value = JSON.parse(JSON.stringify(r.data))
}).catch(() => { }).catch(() => {
loading.value = false loading.value = false
}) })
} }
//
const reset = () => {
name.value = null
modelData.value = sourceData.value
}
//
const search = () => {
if (!name.value) return reset()
const source = JSON.parse(JSON.stringify(sourceData.value))
modelData.value = source.filter(item => {
return item.templateName.includes(name.value)
})
}
const handleOk = () => { const handleOk = () => {
visible.value = false visible.value = false
} }
@ -95,18 +131,24 @@
} }
// //
const toPrint = (id) => { const toPrint = (id, type, name) => {
const postData = { const postData = {
jsonDataStr: jsonDataStr.value, jsonDataStr: jsonDataStr.value,
printType: Number(type.value), printType: type,
templateId: id templateId: id
} }
loading.value = true
GetOpenJsonPrintInfo(postData).then(res => { GetOpenJsonPrintInfo(postData).then(res => {
loading.value = false
if (!res.succeeded) { if (!res.succeeded) {
createMessage.error(res.message) createMessage.error(res.message)
} else { } else {
let fileURL = `http://60.209.125.238:3009/PrintTempFile/${res.data}` let fileURL = `http://60.209.125.238:3009/PrintTempFile/${res.data}`
if (type == 1) {
window.open(fileURL) window.open(fileURL)
} else {
window.open(`//60.209.125.238:3009/PrintTempFile/${res.data}`, '_blank')
}
} }
}) })
} }
@ -121,17 +163,55 @@
font-size: 12px; font-size: 12px;
color: #f05; color: #f05;
} }
.tem-name {
font-size: 12px;
color: #7A8798;
}
.ant-spin-container {
min-height: 270;
}
.model-card { .model-card {
padding: 10px; padding: 10px;
background: #eff6f5; background: #F5F9FC;
cursor: pointer; border-radius: 2px;
border-radius: 5px; border-left: 1px solid #257AFA;
display: flex;
justify-content: space-between;
align-items: center;
} }
.ant-modal-footer { .ant-modal-footer {
display: none; display: none;
} }
.model-card:hover { .ant-btn {
color: #4A54FF; width: 80px;
margin-left: 10px;
margin-top: 25px;
}
h4 {
margin: 16px 0 13px;
}
dt {
img {
width: 16px;
height: 18px;
}
}
dd {
font-size: 10px;
margin: 0;
color: #257AFA;
}
dl {
margin: 0 10px 0 7px;
cursor: pointer;
}
.flex-btns {
position: relative;
top: 2px;
}
.no-data {
text-align: center;
color: #7A8798;
} }
} }
</style> </style>

@ -97,6 +97,9 @@
width: 100%; width: 100%;
font-size: 12px!important; font-size: 12px!important;
} }
.ant-btn {
height: 26px;
}
} }
.ant-col-5 { .ant-col-5 {

@ -24,7 +24,7 @@ import {
GetCodeCountryList GetCodeCountryList
} from '/@/views/operation/seaexport/api/BookingLedger' } from '/@/views/operation/seaexport/api/BookingLedger'
import { getList } from '/@/views/flowcenter/flowInstances/api' import { getList } from '/@/views/flowcenter/flowInstances/api'
import { GetFeeCurrencySelectList, GetClientListByCode } from '/@/api/common/index' import { GetFeeCurrencySelectList, GetClientListByCode, GetCtnSelectList } from '/@/api/common/index'
import { getClientBankList } from '/@/views/baseinfo/infoclient/api' import { getClientBankList } from '/@/views/baseinfo/infoclient/api'
export default { export default {
// 业务来源 // 业务来源
@ -141,19 +141,25 @@ export default {
return res.data return res.data
}) })
}, },
//派车调度人员 // 派车调度人员
GetDispatcherList: () => { GetDispatcherList: () => {
return GetDispatcherList().then((res) => { return GetDispatcherList().then((res) => {
return res.data return res.data
}) })
}, },
//工厂信息 // 工厂信息
GetFactorySelectList: () => { GetFactorySelectList: () => {
return GetFactorySelectList().then((res) => { return GetFactorySelectList().then((res) => {
return res.data return res.data
}) })
}, },
//国家 // 箱型
GetCtnSelectList: () => {
return GetCtnSelectList().then((res) => {
return res.data
})
},
// 国家
GetCodeCountryList: () => { GetCodeCountryList: () => {
return GetCodeCountryList().then((res) => { return GetCodeCountryList().then((res) => {
return res.data return res.data

@ -51,9 +51,11 @@ export const useOptionsStore = defineStore({
// 银行信息 // 银行信息
getClientBankList: null, getClientBankList: null,
// 派车调度人员 // 派车调度人员
GetDispatcherList:null, GetDispatcherList: null,
// 工厂 // 工厂
GetFactorySelectList:null GetFactorySelectList: null,
// 箱型
GetCtnSelectList: null
}), }),
getters: { getters: {
// 通过code获取下拉字典code)就是接口尾部单词 // 通过code获取下拉字典code)就是接口尾部单词

@ -168,6 +168,12 @@ h5 {
.mt15 { .mt15 {
margin-top: 15px; margin-top: 15px;
} }
.mb15 {
margin-bottom: 15px;
}
.ml15 {
margin-left: 15px;
}
// 使 // 使
.ds-green-tag, .ds-green-tag,

@ -6,26 +6,153 @@
<template> <template>
<div class="ds-sea-container-info"> <div class="ds-sea-container-info">
<div class="flex">
<h4>集装箱信息</h4>
<a-button type="link" @click="addRow">
<span class="iconfont icon-icon_tianjia"></span>
添加
</a-button>
<a-popconfirm
:visible="deleteFlag"
title="确定要删除勾选的数据?"
ok-text="确定"
cancel-text="取消"
@confirm="deleteRow"
@cancel="cancelDelete"
@click="checkDelete"
>
<a-button danger type="link" >
<span class="iconfont icon-shanchu1"></span>
删除
</a-button>
</a-popconfirm>
<a-button type="link">
<span class="iconfont icon-refresh-1-copy"></span>
更新合计
</a-button>
<a-button type="link">
<span class="iconfont icon-a-17Btuichu"></span>
调入主单信息
</a-button>
</div>
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table> <hot-table ref="hotTb" :data="list" :settings="settings"></hot-table>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, defineProps } from 'vue' import { ref, nextTick, defineProps, defineComponent, onMounted } from 'vue'
import { GetSeaExportBillManageList } from '../../api/BookingLedger' import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry'
import 'handsontable/dist/handsontable.full.min.css'
import { GetCtnSelectList, GetPackageSelectList } from '/@/api/common'
//
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
defineComponent({
HotTable,
})
const props = defineProps({ const props = defineProps({
id: { id: {
type: String type: String
} }
}) })
// ref
const hotTb = ref(null) const hotTb = ref(null)
//
let ctnList = []
//
let packageList = []
// //
const columns = [ const columns = [
{
data: 'selected',
type: 'checkbox',
title: ' ',
width: 32,
className: 'htCenter',
readOnly: false,
},
{
title: '箱型',
width: 80,
data: 'ctn',
type: 'dropdown',
source: async (query, process) => {
const results = await GetCtnSelectList()
ctnList = results.data
const dict = results.data.map((item) => {
return item.ctnName
})
process(dict)
},
},
{
title: '箱量',
width: 80,
data: 'ctnNum',
type: 'numeric',
},
{
title: '箱号',
width: 80,
data: 'cntrNo',
type: 'numeric',
},
{
title: '封号',
width: 80,
data: 'sealNo',
type: 'numeric',
},
{
title: '件数',
width: 80,
data: 'pkgs',
type: 'numeric',
},
{
title: '件数包装',
width: 80,
data: 'kindPkgsName',
type: 'dropdown',
source: async (query, process) => {
const results = await GetPackageSelectList()
packageList = results.data
const dict = results.data.map((item) => {
return item.packageName
})
process(dict)
},
},
{
title: '重量',
width: 80,
data: 'kgs',
type: 'numeric'
},
{
title: '尺码',
width: 80,
data: 'cbm',
type: 'numeric'
},
{
title: '箱皮重',
width: 80,
data: 'tareWeight',
type: 'numeric'
},
{
title: '备注',
width: 80,
data: 'note',
type: 'numeric'
},
] ]
// //
const list = ref([]) const list = ref([])
// //
const settings = { const settings = {
height: '600',
width: '100%', width: '100%',
autoWrapRow: true, autoWrapRow: true,
autoWrapCol: true, autoWrapCol: true,
@ -50,156 +177,98 @@
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') { if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict = {} let dict = {}
changes.forEach((res) => { changes.forEach((res) => {
// //
if (res[1] === 'feeName') { if (changes[0][1] === 'ctn') {
// const item = ctnList.filter((item) => {
const item = feeDict.value.filter((item) => { return item.ctn === changes[0][3]
return changes[0][3].includes(item.name)
}) })
if (item) dict = item[0] if (item) dict = item[0]
list.value[res[0]]['feeName'] = changes[0][3].split('-')[1] list.value[changes[0][0]]['ctnId'] = dict?.id
list.value[res[0]]['feeEnName'] = dict['enName']
list.value[res[0]]['currency'] = dict['defaultCurrency']
list.value[res[0]]['unitText'] = dict['defaultUnitName']
list.value[res[0]]['unit'] = dict['defaultUnit']
list.value[res[0]]['customerTypeText'] = dict['defaultDebitName']
list.value[res[0]]['customerType'] = dict['defaultDebit']
list.value[res[0]]['isOpen'] = dict['isOpen']
list.value[res[0]]['isAdvancedPay'] = dict['isAdvancedPay']
list.value[res[0]]['isInvoice'] = dict['isInvoice']
list.value[res[0]]['feeFrt'] = dict['feeFrt']
list.value[res[0]]['feeCode'] = dict['code']
list.value[res[0]]['taxRate'] = dict['taxRate']
} }
}) //
// if (changes[0][1] === 'kindPkgsName') {
if (changes[0][1] === 'feeEnName') { const item = ctnList.filter((item) => {
} return item.packageName === changes[0][3]
//
if (changes[0][1] === 'customerName') {
const item = companyDict.value.filter((item) => {
return changes[0][3].includes(item.name)
}) })
if (item) dict = item[0] if (item) dict = item[0]
list.value[changes[0][0]]['customerCode'] = dict?.value list.value[changes[0][0]]['kindPkgs'] = dict?.ediCode
list.value[changes[0][0]]['customerName'] = changes[0][3].split('-')[1]
}
//
if (changes[0][1] === 'customerTypeText') {
getDictOption('djy_cust_prop').then((res) => {
const item = res.filter((item) => {
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
list.value[changes[0][0]]['customerType'] = dict?.value
list.value[changes[0][0]]['customerTypeText'] = changes[0][3].split('-')[1]
//
console.log(props.details)
GetClientSelectInfoByCode({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['customerCode'] = res.data.clientId
list.value[changes[0][0]]['customerName'] = res.data.clientName
})
})
} }
//
if (changes[0][1] === 'unitText') {
const item = unitDict.value.filter((item) => {
return changes[0][3].includes(item.name)
}) })
if (item) dict = item[0] }
list.value[changes[0][0]]['unit'] = dict?.value }
list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[1] }
GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => { const row = {
list.value[changes[0][0]]['quantity'] = res.data.quantity selected: false,
ctn: '',
ctnId: '',
id: '',
ctnNum: '',
cntrNo: '',
sealNo: '',
pkgs: '',
kindPkgs: '',
kindPkgsName: '',
kgs: '',
cbm: '',
tareWeight: '',
note: ''
}
//
const addRow = () => {
const deepCopyRow = JSON.parse(JSON.stringify(row))
list.value.push(deepCopyRow)
}
//
const deleteFlag = ref(false)
//
const checkDelete = () => {
let flag = false
list.value.forEach(item => {
if (item.selected) flag = true
}) })
// if (!flag) {
// const text = list.value[changes[0][0]]['unitText'] return createMessage.warning('请勾选要删除的数据!')
// if (text == '') {
// list.value[changes[0][0]]['quantity'] = 1
// } else if (text == '') {
// list.value[changes[0][0]]['quantity'] = props.details.pkgs
// } else if (text == '') {
// list.value[changes[0][0]]['quantity'] = props.details.kgs
// } else if (text == '') {
// list.value[changes[0][0]]['quantity'] = props.details.cbm
// } else if (text == '') {
// let r = props.details.kgs
// const k = (props.details.pkgs || 0) / 1000
// if (k > r) {
// r = k
// }
// list.value[changes[0][0]]['quantity'] = r
} }
// deleteFlag.value = true
if (changes[0][1] === 'currencyName') { }
const item = currencyDict.value.filter((item) => { //
return item.name === changes[0][3] const deleteRow = () => {
const res = list.value.filter(item => {
return !item.selected
}) })
if (item) dict = item[0] deleteFlag.value = false
list.value[changes[0][0]]['currency'] = dict?.codeName hotTb.value.hotInstance.loadData(res)
}
//
const index = changes[0][0]
//
if (changes[0][1] === 'noTaxPrice') {
//
list.value[index].unitPrice = Number(
(changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1),
).toFixed(6)
//
list.value[index].amount = Number(
(list.value[index].unitPrice || 0) * (list.value[index].quantity || 0),
).toFixed(6)
//
list.value[index].noTaxAmount = Number(
(changes[0][3] || 0) * (list.value[index].quantity || 0),
).toFixed(6)
}
//
if (changes[0][1] === 'unitPrice') {
//
list.value[index].noTaxPrice = Number(
(changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1),
).toFixed(6)
//
list.value[index].amount = Number(
(changes[0][3] || 0) * (list.value[index].quantity || 0),
).toFixed(6)
//
list.value[index].noTaxAmount = Number(
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
).toFixed(6)
}
//
if (changes[0][1] === 'quantity') {
//
list.value[index].amount = Number(
(changes[0][3] || 0) * (list.value[index].unitPrice || 0),
).toFixed(6)
//
list.value[index].noTaxAmount = Number(
(changes[0][3] || 0) * (list.value[index].noTaxPrice || 0),
).toFixed(6)
}
//
if (changes[0][1] === 'taxRate') {
//
list.value[index].noTaxPrice = Number(
(list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1),
).toFixed(6)
//
list.value[index].noTaxAmount = Number(
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
).toFixed(6)
} }
//
const cancelDelete = () => {
deleteFlag.value = false
}
onMounted(() => {
const hot = hotTb.value.hotInstance
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) {})
//
hot.addHook('beforeKeyDown', function (event) {
// 'Enter'
if (event.key === 'ArrowDown') {
if (hot.getSelected()[0][0] == list.value.length - 1 && !hot.getActiveEditor()?._opened) {
list.value.push(JSON.parse(JSON.stringify(row)))
nextTick(() => {
hot.selectCell(list.value.length - 1, 3)
})
return false
} }
},
} }
})
})
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ds-sea-container-info { .ds-sea-container-info {
.flex {
align-items: center;
h4 {
margin: 0 15px 0 0;
}
}
} }
</style> </style>

@ -22,9 +22,12 @@
<a-tab-pane key="1" tab="提单信息" size="small"> <a-tab-pane key="1" tab="提单信息" size="small">
<div class="flex"> <div class="flex">
<!-- 收发通表单 --> <!-- 收发通表单 -->
<BasicForm @register="registerForm" /> <BasicForm style="flex: 1;" @register="registerForm" />
<!-- 集装箱组件 --> <!-- 集装箱组件 -->
<container
class="ml15"
style="width: 700px;"
></container>
</div> </div>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="其他信息" size="small"> <a-tab-pane key="2" tab="其他信息" size="small">
@ -39,6 +42,7 @@
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { GetSeaExportBillManageList } from '../../api/BookingLedger' import { GetSeaExportBillManageList } from '../../api/BookingLedger'
import { formSchema1 } from './ladingInfo' import { formSchema1 } from './ladingInfo'
import container from './container.vue'
const props = defineProps({ const props = defineProps({
id: { id: {
type: String type: String

Loading…
Cancel
Save