海运出口bug调整

szh-new
lijingjia 3 months ago
parent 3390c99751
commit ca5e2ad560

@ -52,11 +52,11 @@
}, },
label: { type: String } label: { type: String }
}, },
emits: ['change', 'update:value'], emits: ['blur', 'update:value'],
setup(props, { emit }) { setup(props, { emit }) {
const attrs = useAttrs() const attrs = useAttrs()
const { t } = useI18n() const { t } = useI18n()
const [state] = useRuleFormItem(props, 'value', 'change') const [state] = useRuleFormItem(props, 'value', 'blur')
// //
const cutList = attrs.value.slice || [] const cutList = attrs.value.slice || []
function emitChange() { function emitChange() {
@ -138,7 +138,8 @@
return text.replace(/ \s*$/gm, '') return text.replace(/ \s*$/gm, '')
} }
// //
const textareaBlur = () => { const textareaBlur = (_, ...args) => {
emit('blur', _, ...args)
if (cutList.length == 0 || !state.value) return if (cutList.length == 0 || !state.value) return
state.value = ToCDB(state.value).toUpperCase() state.value = ToCDB(state.value).toUpperCase()
// //

@ -22,6 +22,7 @@ export function useRuleFormItem<T extends Recordable, K extends keyof T, V = Unw
key?: K, key?: K,
changeEvent?, changeEvent?,
emitData?: Ref<any[]>, emitData?: Ref<any[]>,
flag
): [WritableComputedRef<V>, (val: V) => void, DeepReadonly<V>] ): [WritableComputedRef<V>, (val: V) => void, DeepReadonly<V>]
export function useRuleFormItem<T extends Recordable>( export function useRuleFormItem<T extends Recordable>(

@ -990,6 +990,11 @@ export const storageColumns: BasicColumn[] = [
dataIndex: 'slotBookingNo', dataIndex: 'slotBookingNo',
width: 100, width: 100,
}, },
{
title: '箱型箱量(余量)',
dataIndex: 'ctnStat',
width: 120
},
{ {
title: '合约号', title: '合约号',
dataIndex: 'contractNo', dataIndex: 'contractNo',
@ -1039,11 +1044,6 @@ export const storageColumns: BasicColumn[] = [
title: '订舱编号', title: '订舱编号',
dataIndex: 'slotNo', dataIndex: 'slotNo',
width: 150 width: 150
},
{
title: '箱型箱量(余量)',
dataIndex: 'ctnStat',
width: 120
} }
] ]

@ -103,7 +103,7 @@
businessType="1" businessType="1"
> >
<span> <span>
<a-button v-repeat v-if="route.query.status != 'WAIT_ORDER_AUDIT' && route.query.source != 'Complete'" @click="completeTask(null)" type="primary"> <a-button v-repeat v-if="route.query.status != 'WAIT_ORDER_AUDIT' && route.query.source != 'Complete'" @click="completeTask(null, null)" type="primary">
{{ completeText }} {{ completeText }}
</a-button> </a-button>
</span> </span>
@ -307,9 +307,6 @@
if (route.query.id && !id.value) { if (route.query.id && !id.value) {
id.value = route.query.id id.value = route.query.id
} }
bookingDetails.value = {
orderContactList: []
}
if (id.value) { if (id.value) {
// //
excuteRules.value = [] excuteRules.value = []
@ -334,6 +331,9 @@
id: id.value, id: id.value,
}) })
.then(async (res) => { .then(async (res) => {
bookingDetails.value = {
orderContactList: []
}
if (route.query.isCopy) { if (route.query.isCopy) {
res.data = { res.data = {
...res.data, ...res.data,
@ -378,7 +378,6 @@
// //
const goodsForm = await RefcargoInfo.value.validateFields() const goodsForm = await RefcargoInfo.value.validateFields()
// //
console.log(goodsForm.ctnPriceInfo)
if (goodsForm.ctnPriceInfo && goodsForm.ctnPriceInfo.length) { if (goodsForm.ctnPriceInfo && goodsForm.ctnPriceInfo.length) {
for (let i = 0; i < goodsForm.ctnPriceInfo.length; i++) { for (let i = 0; i < goodsForm.ctnPriceInfo.length; i++) {
if (!goodsForm.ctnPriceInfo[i].ctn) { if (!goodsForm.ctnPriceInfo[i].ctn) {
@ -651,7 +650,7 @@
businessType: '1', businessType: '1',
taskTypeName: type || route.query.status taskTypeName: type || route.query.status
} }
completeTask(type) completeTask(type, true)
if (type) postData['hasCabin'] = true if (type) postData['hasCabin'] = true
loading.value = true loading.value = true
await CreateTask(postData).then(res => { await CreateTask(postData).then(res => {
@ -814,7 +813,7 @@
}) })
} }
// //
const completeTask = (type) => { const completeTask = (type, b) => {
const { fullPath } = route // const { fullPath } = route //
const postData = { const postData = {
businessId: id.value, businessId: id.value,
@ -825,7 +824,7 @@
} }
if (type) postData.autoCreateNext = false if (type) postData.autoCreateNext = false
SetTaskStatus(postData).then(res => { SetTaskStatus(postData).then(res => {
createMessage.success('操作成功!') if (!b) createMessage.success('操作成功!')
tabStore.closeTabByKey(fullPath, router) tabStore.closeTabByKey(fullPath, router)
}) })
} }

@ -452,7 +452,6 @@ export const mailingInfoFormSchemaL: FormSchema[] = [
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => { onChange: (e, obj) => {
console.log(e, obj)
if (e && obj) { if (e && obj) {
formModel.shipperId = obj.id formModel.shipperId = obj.id
formModel.shipperContent = obj.content formModel.shipperContent = obj.content
@ -540,7 +539,7 @@ export const mailingInfoFormSchemaL: FormSchema[] = [
} }
if (e === undefined && obj === undefined) { if (e === undefined && obj === undefined) {
formModel.notifyPartyId = null formModel.notifyPartyId = null
formModel.notifyPartyContent = null formModel.notifyPartyContent = ''
formModel.notifyParty = '' formModel.notifyParty = ''
} }
} }

@ -217,7 +217,6 @@
emitter.emit('seaAddNotes', item.value) emitter.emit('seaAddNotes', item.value)
} else if (item.key == 'customerName') { } else if (item.key == 'customerName') {
// //
console.log(item)
emitter.emit('customerBack', item.value) emitter.emit('customerBack', item.value)
} }
} }

@ -49,7 +49,9 @@
style="width: 66px" style="width: 66px"
:fieldNames="{ :fieldNames="{
label: 'ctnName', label: 'ctnName',
value: 'id' value: 'id',
ctnCode: 'ediCode',
ctnSize: 'ctnSize'
}" }"
:options="optionsStore.getOptionsByCode('GetCtnSelectList')" :options="optionsStore.getOptionsByCode('GetCtnSelectList')"
:filter-option="filterOption" :filter-option="filterOption"
@ -58,7 +60,7 @@
</a-select> </a-select>
<div class="ctn-price-box"> <div class="ctn-price-box">
<span>箱量<i style="color: red;">*</i></span> <span>箱量<i style="color: red;">*</i></span>
<a-input-number v-model:value="item.ctnNum" size="small" :min="0" :max="999999999" placeholder="箱量" /> <a-input-number v-model:value="item.ctnNum" size="small" :min="0" :max="999999999" placeholder="箱量" @change="ctnNumChange($event, item)" />
</div> </div>
<div class="ctn-price-box"> <div class="ctn-price-box">
<span>报价<i style="color: red;">*</i></span> <span>报价<i style="color: red;">*</i></span>
@ -105,6 +107,7 @@
import { ref, watch, onMounted, computed } from 'vue' import { ref, watch, onMounted, computed } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { getDictOption } from '/@/utils/dictUtil' import { getDictOption } from '/@/utils/dictUtil'
import emitter from '/@/utils/Bus'
import { BatchDelBusinessCtnPrice } from '/@/views/operation/seaexport/api/BookingLedger' import { BatchDelBusinessCtnPrice } from '/@/views/operation/seaexport/api/BookingLedger'
import { useOptionsStore } from '/@/store/modules/options' import { useOptionsStore } from '/@/store/modules/options'
import GoodsTable from '/@/views/baseinfo/goods/index.vue' import GoodsTable from '/@/views/baseinfo/goods/index.vue'
@ -425,48 +428,62 @@
// }) // })
// } // }
}) })
function SetTOTALNO(SS) { // function SetTOTALNO(SS) {
let DSS = SS.toString() // let DSS = SS.toString()
const i = DSS.indexOf('\n') // const i = DSS.indexOf('\n')
let num = 0 // let num = 0
let strKind = '' // let strKind = ''
let enCapital = '' // let enCapital = ''
if (i > 0) { // if (i > 0) {
const slist = DSS.split('\n') // const slist = DSS.split('\n')
for (let i = 0; i < slist.length; i += 1) { // for (let i = 0; i < slist.length; i += 1) {
const member = slist[i] // const member = slist[i]
const strNum: any = GetStringNum(member) // const strNum: any = GetStringNum(member)
if (i == 0) { // if (i == 0) {
strKind = member.substring(strNum.length) // strKind = member.substring(strNum.length)
} // }
num = parseFloat(num).add(parseFloat(strNum)) // num = parseFloat(num).add(parseFloat(strNum))
} // }
if (strKind !== '') { // if (strKind !== '') {
enCapital = strKind // enCapital = strKind
} else { // } else {
strKind = props.details.kindpkgs // strKind = props.details.kindpkgs
enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.' // enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.'
} // }
} else { // } else {
const strNum: any = GetStringNum(DSS) // const strNum: any = GetStringNum(DSS)
strKind = DSS.substring(strNum.length) // strKind = DSS.substring(strNum.length)
if (strKind !== '') { // if (strKind !== '') {
enCapital = strKind // enCapital = strKind
} else { // } else {
strKind = props.details.kindpkgs // strKind = props.details.kindpkgs
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.' // enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
} // }
} // }
return enCapital // return enCapital
} // }
// //
const ctnChange = (v, item) => { const ctnChange = (v, item) => {
console.log(item) let data = {}
optionsStore.getOptionsByCode('GetCtnSelectList').forEach(row => { optionsStore.getOptionsByCode('GetCtnSelectList').forEach(row => {
if (row.id == v) { if (row.id == v) {
item.ctn = row.ctnName item.ctn = row.ctnName
data = row
}
})
//
emitter.emit('ctnTable', data)
}
// change
const ctnNumChange = (v, item) => {
let data = {}
optionsStore.getOptionsByCode('GetCtnSelectList').forEach(row => {
if (row.ctnName == item.ctn) {
data = row
} }
}) })
//
emitter.emit('ctnNumTable', { item, data })
} }
function ToEn(a) { function ToEn(a) {
// eslint-disable-next-line no-array-constructor // eslint-disable-next-line no-array-constructor

@ -236,7 +236,7 @@
BatchDelOpCtnDetail, BatchDelOpCtnDetail,
GetCtnSelectList, GetCtnSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger' } from '/@/views/operation/seaexport/api/BookingLedger'
import { ref, Ref, watchEffect, watch, onMounted, nextTick } from 'vue' import { ref, Ref, watchEffect, watch, onMounted, nextTick, onUnmounted } from 'vue'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
const { notification, createMessage } = useMessage() const { notification, createMessage } = useMessage()
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
@ -245,6 +245,7 @@
import { getDictOption } from '/@/utils/dictUtil' import { getDictOption } from '/@/utils/dictUtil'
import { GetPackageSelectList } from '/@/views/operation/seaexport/api/BookingLedger' import { GetPackageSelectList } from '/@/views/operation/seaexport/api/BookingLedger'
import { createVNode } from 'vue' import { createVNode } from 'vue'
import emitter from '/@/utils/Bus'
import { Modal } from 'ant-design-vue' import { Modal } from 'ant-design-vue'
registerAllModules() registerAllModules()
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
@ -269,11 +270,7 @@
if (nval.id) { if (nval.id) {
GetCtnList(nval) GetCtnList(nval)
} }
}, }
{
deep: true,
immediate: true,
},
) )
// //
const hotmain = ref(null) const hotmain = ref(null)
@ -326,7 +323,6 @@
// (process) // (process)
source: async (query, process) => { source: async (query, process) => {
const res = (await GetCtnSelectList({ queryKey: query }))?.data const res = (await GetCtnSelectList({ queryKey: query }))?.data
if (!ctnDict.value.length) ctnDict.value = res
const dict = res.map((res) => { const dict = res.map((res) => {
return res.ctnName return res.ctnName
}) })
@ -856,9 +852,7 @@
// ) // )
const { data } = res const { data } = res
if (data.length == 0) { if (data.length == 0) {
list.value = [{ list.value = [{}]
selectd: false
}]
} else { } else {
list.value = [] list.value = []
totalPkgs.value = 0 totalPkgs.value = 0
@ -1567,6 +1561,7 @@
} }
} }
function handleRefsh() { function handleRefsh() {
alert(1)
GetCtnList(props.details) GetCtnList(props.details)
} }
function handleOpen() { function handleOpen() {
@ -1667,7 +1662,7 @@
fixedColumnsLeft: 1, fixedColumnsLeft: 1,
// //
hiddenColumns: { hiddenColumns: {
columns: [1, 2, 3], columns: [1, 2, 3, 6],
indicators: true, indicators: true,
}, },
// //
@ -1781,7 +1776,6 @@
} }
// //
if (changes[0][1] === 'ctnNum') { if (changes[0][1] === 'ctnNum') {
console.log(ctnDict.value)
let RData = 0 let RData = 0
list.value.forEach((e) => { list.value.forEach((e) => {
if (e.ctnNum) { if (e.ctnNum) {
@ -1797,7 +1791,7 @@
} }
}) })
totalCtn.value = RData totalCtn.value = RData
if (list.value[changes[0][0]]['teu'] && changes[0][3]) { if (teu && changes[0][3]) {
list.value[changes[0][0]]['teu'] = parseInt(teu) * parseInt(changes[0][3]) list.value[changes[0][0]]['teu'] = parseInt(teu) * parseInt(changes[0][3])
} }
} }
@ -1990,6 +1984,60 @@
} }
} }
}) })
//
emitter.on('ctnNumTable', (data) => {
list.value.forEach(item => {
if (item.ctn == data.item.ctn) {
item.ctnNum = data.item.ctnNum
if (data.data.teu) {
item['teu'] = Number(data.data.teu) * (Number(item.ctnNum) || 0)
}
}
})
})
//
emitter.on('ctnTable', (data) => {
const cList = list.value
if (cList && cList.length) {
let flag = true
cList.forEach(item => {
if (item.ctn == data.ctnName) {
flag = false
}
})
if (flag) {
if (cList && cList.length) {
if (!cList[0].ctn) {
cList[0].ctn = data.ctnName
cList[0].ctnCode = data.ediCode
cList[0].tareWeight = data.ctnWeight
} else {
cList.push({
ctn: data.ctnName,
ctnCode: data.ediCode,
tareWeight: data.ctnWeight
})
}
} else {
cList.push({
ctn: data.ctnName,
ctnCode: data.ediCode,
tareWeight: data.ctnWeight
})
}
}
} else {
cList.push({
ctnCode: data.ediCode,
ctn: data.ctnName,
size: data.ctnSize
})
}
})
})
onUnmounted(() => {
emitter.off('ctnTable')
emitter.off('ctnNumTable')
}) })
defineExpose({ defineExpose({
list, list,

@ -185,11 +185,11 @@
templateName: '', templateName: '',
content: '' content: ''
} }
if (key == 'shipper') { if (key == '2') {
postData.id = model.shipperId postData.id = model.shipperId
postData.templateName = model.shipper postData.templateName = model.shipper
postData.content = model.shipperContent postData.content = model.shipperContent
} else if (key == 'consignee') { } else if (key == '1') {
postData.id = model.consigneeId postData.id = model.consigneeId
postData.templateName = model.consignee postData.templateName = model.consignee
postData.content = model.consigneeContent postData.content = model.consigneeContent
@ -208,9 +208,9 @@
// //
temFlag.value = true temFlag.value = true
let content = '' let content = ''
if (key == 'shipper') { if (key == '2') {
content = model.shipperContent content = model.shipperContent
} else if (key == 'consignee') { } else if (key == '1') {
content = model.consigneeContent content = model.consigneeContent
} else { } else {
content = model.notifyPartyContent content = model.notifyPartyContent

Loading…
Cancel
Save