箱型表格

szh-new
lijingjia 3 months ago
parent 0aaf503c52
commit 10a2d24a27

@ -179,4 +179,14 @@
.hot-red {
background-color: #f5222d;
}
.handsontableInputHolder {
.autocompleteEditor {
.ht_master {
.wtHolder {
min-height: 200px!important;
overflow: visible!important;
}
}
}
}
}

@ -113,9 +113,9 @@
:details="bookingDetails"
@openFlag="otherOpenFlag"
>
<Divider type="horizontal" />
<Divider v-if="id" type="horizontal" />
<!-- 联系人信息 -->
<ContactList :id="id" :data="bookingDetails.orderContactList"></ContactList>
<ContactList v-if="id" :id="id" :data="bookingDetails.orderContactList" @getBaseInfo="getBaseInfo"></ContactList>
</otherInfo>
</transition>
<transition name="slide">
@ -209,6 +209,7 @@
import otherInfo from './modules/otherInfo.vue'
//
import ContactList from './modules/contactList.vue'
import emitter from '/@/utils/Bus'
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
import { Divider } from 'ant-design-vue'
@ -712,8 +713,10 @@
RefmailingInfo.value.$data.userHasLine = !!bookingDetails.value.lineName
}
}
function pkgsEnCapitalFun(data) {
bookingDetails.value.totalno = data
//
const getBaseInfo = () => {
const data = RefbasicInfo.value.getFieldsValue()
emitter.emit('sendBaseInfo', data)
}
function changeTab(e) {
tabActiveKey.value = e

@ -32,11 +32,12 @@
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue'
import { ref, computed, unref, defineEmits, onMounted } from 'vue'
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
import emitter from '/@/utils/Bus'
//
import { personFormSchema } from './baseInfo'
//
@ -44,7 +45,7 @@
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register'])
const emit = defineEmits(['success', 'register', 'getBaseInfo'])
const isUpdate = ref(true)
// loading
const loading = ref(false)
@ -88,10 +89,12 @@
}
setModalProps({ loading: false })
})
let changeType = ''
//
const linkageForm = (v) => {
console.log(v)
changeType = v
emit('getBaseInfo', v)
}
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
//
@ -118,4 +121,25 @@
setModalProps({ confirmLoading: false, loading: false })
}
}
onMounted(() => {
emitter.on('sendBaseInfo', (v) => {
console.log(v)
if (changeType == 'controller') {
setFieldsValue({
customerName: v.customerName,
customerId: v.customerId
})
} else if (changeType == 'booking') {
setFieldsValue({
customerName: v.forwarder,
customerId: v.forwarderId
})
} else if (changeType == 'shipper') {
setFieldsValue({
customerName: v.shipperCn,
customerId: v.shipperCnId
})
}
})
})
</script>

@ -237,8 +237,8 @@ export const basicInfoFormSchema: FormSchema[] = [
return {
api: GetCarrierSelectList,
labelField: 'pinYinCode',
showName: 'cnName',
valueField: 'cnName',
showName: 'ediCode',
valueField: 'ediCode',
resultField: 'data',
immediate: false,
onChange: (e, obj) => {

@ -5,7 +5,7 @@
@register="registerTable"
>
<template #tableTitle>
<h4 style="margin: 0">联系人信息</h4>
<h4 style="margin: 0; white-space: nowrap;">联系人信息</h4>
<a-button style="margin-left: 100px;" type="link" @click="create">
<span class="iconfont icon-new_document"></span>
新增
@ -36,12 +36,12 @@
</template>
</template>
</BasicTable>
<PersonModal @register="registerModal" @success="handleSuccess" />
<PersonModal @register="registerModal" @success="handleSuccess" @getBaseInfo="getBaseInfo" />
</a-spin>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ref, defineEmits, watch } from 'vue'
import { personColumns } from './baseInfo.tsx'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { GetBusinessOrderContactList, BatchDelBusinessOrderContact } from '/@/views/operation/seaexport/api/BookingLedger'
@ -51,6 +51,7 @@
import PersonModal from './PersonModal.vue'
const [registerModal, { openModal }] = useModal()
const { createMessage } = useMessage()
const emit = defineEmits(['getBaseInfo'])
// loading
const loading = ref(false)
const props = defineProps({
@ -63,12 +64,31 @@
}
}
})
watch(
() => props.data,
(v) => {
reload()
}
)
const flag = ref(true)
//
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
api: async (p) => {
return new Promise((resolve) => {
resolve({ data: props.data })
})
if (flag.value) {
flag.value = false
return new Promise((resolve) => {
resolve({ data: props.data })
})
} else {
const res: API.DataResult = await GetBusinessOrderContactList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data] })
})
}
},
beforeFetch: (p) => {
p['businessId'] = props.id
return formatParams(p)
},
columns: personColumns,
isTreeTable: false,
@ -81,6 +101,7 @@
rowSelection: {
type: 'checkbox'
},
immediate: false,
canResize: false,
actionColumn: {
width: 60,
@ -89,8 +110,11 @@
fixed: 'right',
}
})
function handleSuccess(v) {
console.log(v)
function handleSuccess() {
reload()
}
const getBaseInfo = () => {
emit('getBaseInfo')
}
//
const create = () => {

@ -45,7 +45,7 @@
watch(
() => props.details,
(nval) => {
setFieldsValue(nval.ediInfo)
if (nval.ediInfo) setFieldsValue(nval.ediInfo)
}
)
// function getSelectViewRes({ type, res }) {

@ -50,7 +50,7 @@
<span class="iconfont icon-refresh-1-copy"></span>
刷新
</a-button>
<a-button type="link" v-repeat size="mini" @click="addboxLine">
<a-button type="link" size="mini" @click="addboxLine">
<span class="iconfont icon-new_document"></span>
添加
</a-button>
@ -284,7 +284,9 @@
const kindPkgsDict = ref([])
//
const hotTb = ref<any>()
const list = ref<any>([])
const list = ref([{
selected: false
}])
const moreTList = ref<any>([])
const moreData = ref<any>([[]])
//
@ -318,6 +320,7 @@
title: '箱型',
width: 60,
data: 'ctn',
className: 'ctn-type',
type: 'dropdown',
// (process)
source: async (query, process) => {
@ -845,79 +848,86 @@
sortConditions: [],
},
}).then((res) => {
res.data = JSON.parse(
JSON.stringify(res.data)
.replaceAll('"0001-01-01 00:00:00"', '""')
.replaceAll(':"0"', ':""')
.replaceAll(':0,', ':"",'),
)
list.value.splice(0)
let data = res.data
totalPkgs.value = 0
data.forEach(async (item, index) => {
totalPkgs.value = totalPkgs.value
? parseInt(totalPkgs.value)
: 0 + item.pkgs
? parseInt(item.pkgs)
: 0
totalKgs.value = totalKgs.value
? parseInt(totalKgs.value)
: 0 + item.kgs
? parseInt(item.kgs)
: 0
totalCbm.value = totalCbm.value
? parseInt(totalCbm.value)
: 0 + item.cbm
? parseInt(item.cbm)
: 0
totalCtn.value = totalCtn.value
? parseInt(totalCtn.value)
: 0 + item.ctnNum
? parseInt(item.ctnNum)
: 0
item.rowKey = index
const weightTypeList = await getDictOption('weight_type')
if (!weightTypeDict.value.length) {
// res.data = JSON.parse(
// JSON.stringify(res.data)
// .replaceAll('"0001-01-01 00:00:00"', '""')
// .replaceAll(':"0"', ':""')
// .replaceAll(':0,', ':"",'),
// )
const { data } = res
if (data.length == 0) {
list.value = [{
selectd: false
}]
} else {
list.value = []
totalPkgs.value = 0
data.forEach(async (item, index) => {
totalPkgs.value = totalPkgs.value
? parseInt(totalPkgs.value)
: 0 + item.pkgs
? parseInt(item.pkgs)
: 0
totalKgs.value = totalKgs.value
? parseInt(totalKgs.value)
: 0 + item.kgs
? parseInt(item.kgs)
: 0
totalCbm.value = totalCbm.value
? parseInt(totalCbm.value)
: 0 + item.cbm
? parseInt(item.cbm)
: 0
totalCtn.value = totalCtn.value
? parseInt(totalCtn.value)
: 0 + item.ctnNum
? parseInt(item.ctnNum)
: 0
item.rowKey = index
const weightTypeList = await getDictOption('weight_type')
if (!weightTypeDict.value.length) {
weightTypeList.forEach((e) => {
weightTypeDict.value.push(e)
})
}
weightTypeList.forEach((e) => {
weightTypeDict.value.push(e)
if (e.value == item.weightType) {
item.weightTypeName = e.name
}
})
}
weightTypeList.forEach((e) => {
if (e.value == item.weightType) {
item.weightTypeName = e.name
const kindPkgsList = kindPkgsDict.value.length
? kindPkgsDict.value
: (await GetPackageSelectList())?.data
if (!kindPkgsDict.value.length) {
kindPkgsDict.value.splice(0)
kindPkgsList.forEach((e) => {
kindPkgsDict.value.push(e)
})
}
})
const kindPkgsList = kindPkgsDict.value.length
? kindPkgsDict.value
: (await GetPackageSelectList())?.data
if (!kindPkgsDict.value.length) {
kindPkgsDict.value.splice(0)
kindPkgsList.forEach((e) => {
kindPkgsDict.value.push(e)
if (e.id == item.kindPkgs) {
item.kindPkgsName = e.packageName
}
})
const isTempList = [
{
name: '是',
value: true,
},
{
name: '否',
value: false,
},
]
isTempList.forEach((e) => {
if (e.value == item.isTemp) {
item.isTempName = e.name
}
})
}
kindPkgsList.forEach((e) => {
if (e.id == item.kindPkgs) {
item.kindPkgsName = e.packageName
}
})
const isTempList = [
{
name: '是',
value: true,
},
{
name: '否',
value: false,
},
]
isTempList.forEach((e) => {
if (e.value == item.isTemp) {
item.isTempName = e.name
}
})
list.value.push(item)
})
list.value = data
}
hotmain.value.hotInstance.loadData(list.value)
//
if (source != 'edit') {
hotTb.value.hotInstance.updateSettings({
@ -967,7 +977,10 @@
//
function addboxLine() {
list.value.push({})
list.value.push({
selected: false
})
hotmain.value.hotInstance.loadData(list.value)
}
const deleteFlag = ref(false)
//
@ -1332,7 +1345,7 @@
}
function importYarn() {
if (!props.details.id) {
notification.error({ message: '请先保存订舱信息', duration: 3 })
createMessage.warning('请先保存订舱信息')
return false
}
loadingTable.value = true
@ -1343,19 +1356,20 @@
.then((res) => {
if (res.succeeded) {
const data = JSON.parse(res.data)
const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
//
if (data.length) {
//
for (var i = 0; i < data.length; i++) {
if (list.value.length) {
list.value.forEach(row => {
if (data[i].CNTRNO == row.cntrNo) {
if (data[i].CNTRNO === row.cntrNo) {
data.splice(i, 1)
}
})
}
}
if (data.length) {
//
Modal.confirm({
title: '提示',
content: createVNode(
@ -1373,22 +1387,25 @@
}
})
}
data.map((item, index) => {
const _data = {
cbm: item.CBM,
cntrNo: item.CNTRNO,
ctn: item.CTNALL,
ctnCode: item.CtnCode,
kgs: item.KGS,
kindpkgs: kindpkgsOld || item.KINDPKGS,
pkgs: item.PKGS,
sealNo: item.SEALNO,
ctnNum: 1,
tareWeight: item.TAREWEIGHT,
}
list.value.push(_data)
})
}
const newData = data.map((item) => {
return {
cbm: item.CBM,
cntrNo: item.CNTRNO,
ctn: item.CTNALL,
ctnCode: item.CtnCode,
kgs: item.KGS,
kindpkgs: item.KINDPKGS,
pkgs: item.PKGS,
sealNo: item.SEALNO,
ctnNum: 1,
tareWeight: item.TAREWEIGHT
}
})
list.value = [...list.value, ...newData]
// const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
hotmain.value.hotInstance.loadData(list.value)
// }
}
loadingTable.value = false
computing()
@ -1635,7 +1652,7 @@
)
//
const settings = {
height: '208',
height: 'auto',
autoWrapRow: true,
autoWrapCol: true,
//
@ -1988,3 +2005,6 @@
}
}
</style>
<style>
</style>

@ -285,7 +285,7 @@
</div>
</div>
</a-card> -->
<div v-if="id" class="card" style="padding-bottom: 15px;">
<div class="card" style="padding-bottom: 15px;">
<Divider type="horizontal" />
<!-- 日志组件 -->
<DsJournal :id="id" :data="details.businessLogList"/>

@ -118,7 +118,7 @@ export const formSchema: FormSchema[] = [
// required: !isButton(e),
// },
// ])
if (isMenu(e) && !formModel.id && formModel.component == 'layouts/RouteView') {
if (isMenu(e) && !formModel.id) {
formModel.component = ''
}
},
@ -176,7 +176,7 @@ export const formSchema: FormSchema[] = [
componentProps: {
placeholder: '请输入前端组件',
},
defaultValue: 'layouts/RouteView',
defaultValue: '',
required: true,
ifShow: ({ values }) => !isButton(values.menuType),
itemProps: {

Loading…
Cancel
Save