集装箱复制bug,审单选舱流程变更

szh-new
lijingjia 1 month ago
parent d20d17d277
commit 522a088697

@ -83,8 +83,6 @@
function handleChange(keys: string[], direction: TransferDirection, moveKeys: string[]) { function handleChange(keys: string[], direction: TransferDirection, moveKeys: string[]) {
_targetKeys.value = keys _targetKeys.value = keys
console.log(direction)
console.log(moveKeys)
emit('change', keys) emit('change', keys)
} }

@ -114,7 +114,6 @@ export function useForm(props?: Props): UseFormReturnType {
validate: async (nameList?: NamePath[]): Promise<Recordable> => { validate: async (nameList?: NamePath[]): Promise<Recordable> => {
const form = await getForm() const form = await getForm()
console.log(form.validate(nameList))
return form.validate(nameList) return form.validate(nameList)
}, },

@ -1,506 +0,0 @@
<!--
* @Description: 审核审批 -> 应收应付费用审批
* @Author: lijj
* @Date: 2024-06-13 17:08:08
-->
<template>
<a-spin :spinning="loading">
<div class="ds-approve-fee-sf">
<BasicTable
class="ds-mini-table fee-table"
height="500px"
:scroll="{ 'x': '100%', 'y': fheight + 'px' }"
@register="registerTable"
@selection-change="selectHandle"
>
<template #toolbar>
<MainActionBar
:ids="busId"
:data="data"
@apporveHandle="mainApprove"
></MainActionBar>
</template>
<template v-slot:bodyCell="{ column, record }">
<!-- 应收费用 -->
<template v-if="column.dataIndex == 'arFeeStatus'">
<span v-if="record.arFeeStatus == 0" class="ds-green-tag">
{{ record.arFeeStatusText }}</span>
<span v-else-if="record.arFeeStatus == 1" class="ds-blue-tag">{{
record.arFeeStatusText
}}</span>
<span v-else-if="/^2|3|4|5|6$/.test(record.arFeeStatus)" class="ds-orange-tag">{{
record.arFeeStatusText
}}</span>
<span v-else-if="/^7|8$/.test(record.arFeeStatus)" class="ds-red-tag">{{
record.arFeeStatusText
}}</span>
<span v-else class="ds-purple-tag">{{ record.arFeeStatusText }}</span>
</template>
<!-- 应付费用 -->
<template v-if="column.dataIndex == 'apFeeStatus'">
<span v-if="record.apFeeStatus == 0" class="ds-green-tag">{{
record.apFeeStatusText
}}</span>
<span v-else-if="record.apFeeStatus == 1" class="ds-blue-tag">{{
record.apFeeStatusText
}}</span>
<span v-else-if="/^2|3|4|5|6$/.test(record.apFeeStatus)" class="ds-orange-tag">{{
record.apFeeStatusText
}}</span>
<span v-else-if="/^7|8$/.test(record.apFeeStatus)" class="ds-red-tag">{{
record.apFeeStatusText
}}</span>
<span v-else class="ds-purple-tag">{{ record.apFeeStatusText }}</span>
</template>
</template>
</BasicTable>
<!-- <Statistic v-show="busId.length" :id="busId"></Statistic> -->
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { onMounted, ref, defineExpose } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common'
import { GetList, GetFees } from './api'
import { Divider } from 'ant-design-vue'
import FeeActionBar from './components/feeActionBar.vue'
// import { useModal } from '/@/components/Modal'
import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
// import FeeTable from './components/feeTable.vue'
// import Statistic from './components/Statistic.vue'
import MainActionBar from './components/mainActionBar.vue'
import { formatTableData } from '/@/hooks/web/common'
const { createMessage } = useMessage()
// loading
const loading = ref(false)
// id
const busId = ref([])
const data = ref([])
const innerHeight = window.innerHeight
const fheight = (innerHeight / 2) - 97
const [registerTable, { reload, getDataSource }] = useTable({
maxHeight: (innerHeight - 60) / 2,
api: async (p) => {
const res = await GetList(p)
return new Promise((resolve) => {
res.data.forEach(item => {
item.etd = formatTableData(item.etd)
item.accountDate = formatTableData(item.accountDate)
})
data.value = res.data
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
return formatParams(p)
},
afterFetch: () => {
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
// ()
useAdvancedSearch: true,
},
isTreeTable: false,
pagination: true,
striped: false,
useSearchForm: true,
showTableSetting: true,
showIndexColumn: true,
rowSelection: { type: 'checkbox' },
canResize: false,
immediate: false,
resizeHeightOffset: (innerHeight - 60) / 2
})
//
const tableData = ref([])
const selectHandle = (v) => {
let ids = []
if (v.rows && v.rows.length) {
ids = v.rows.map(item => {
return { id: item.id, businessType: item.businessType }
})
}
//
busId.value = ids
if (ids && ids.length) {
GetFees(ids[0]).then(res => {
const val = res.data
//
if (val.etd) val.etd = val.etd.split(' ')[0]
if (val.eta) val.etd = val.eta.split(' ')[0]
val.etd = val.etd || '' + (val.etd ? '/' : '') + val.eta || ''
val.loadPort = val.loadPort || '' + (val.loadPort ? '/' : '') + val.dischargePort || ''
val.vessel = val.vessel || '' + (val.vessel ? '/' : '') + val.voyno || ''
list.value.forEach(item => {
for(let key in val) {
if (item.field === key) {
if (key == 'etd' && val[key]) {
val[key] = val[key].split(' ')[0]
}
item.value = val[key]
}
}
})
//
tableData.value = val.itemGroups
//
if (val.itemGroups) {
RData.value = []
PData.value = []
val.itemGroups.forEach(item => {
if (item.items.length == 0) {
item.items = [{ feeType: 1 }, { feeType: 2 }]
}
if (item.items.length == 1) {
if (item.items[0].feeType == 1) {
item.items[1] = { feeType: 2 }
} else {
item.items[1] = { feeType: 1 }
}
}
item.items.forEach(row => {
if (row.currency == 'RMB') {
row['RMB'] = row.amount
} else if (row.currency == 'USD') {
row['USD'] = row.amount
} else {
row['other'] = row.amount
}
//
if (row.feeType === 1) {
RData.value.push(row)
}
//
if (row.feeType === 2) {
PData.value.push(row)
}
})
})
}
})
} else {
list.value.forEach(item => {
item.value = ''
})
tableData.value = []
PData.value = []
RData.value = []
}
}
const feeColumns = (v) => {
return [
{
title: v == 1 ? '应收' : '应付',
align: 'center',
width: 200,
children: [
{
dataIndex: 'RMB',
title: 'RMB',
align: 'left',
minWidth: 80
},
{
dataIndex: 'USD',
title: 'USD',
align: 'left',
minWidth: 80
},
{
dataIndex: 'other',
title: '其他币别',
align: 'left',
minWidth: 80
},
{
dataIndex: 'customerFullName',
title: '客户名称',
align: 'left',
minWidth: 80
},
{
dataIndex: 'feeStatusText',
title: '状态',
align: 'left',
width: 85
},
{
dataIndex: 'unitPrice',
title: '单价',
align: 'left',
width: 100
},
{
dataIndex: 'quantity',
title: '数量',
align: 'left',
width: 50
},
{
dataIndex: 'exchangeRate',
title: '汇率',
align: 'left',
width: 50
}
]
}
]
}
//
const RData = ref([])
//
const PData = ref([])
const [registerTable1] = useTable({
dataSource: RData,
columns: feeColumns(1),
isTreeTable: false,
pagination: false,
showIndexColumn: false,
bordered: true,
rowSelection: { type: 'checkbox' },
canResize: false,
showSummary: true,
summaryFunc(param) {
const sums = {}
//
const columns = feeColumns(1)
columns[0].children.forEach(column => {
if (['RMB', 'USD', 'other'].includes(column.dataIndex)) {
console.log(column)
// 0
sums[column.dataIndex] = 0
//
param.forEach(row => {
if (!isNaN(row[column.dataIndex])) {
sums[column.dataIndex] += Number(row[column.dataIndex])
}
})
}
})
//
return [sums]
}
})
const [registerTable2] = useTable({
dataSource: PData,
columns: feeColumns(2),
isTreeTable: false,
pagination: false,
showIndexColumn: false,
bordered: true,
rowSelection: { type: 'checkbox' },
canResize: false,
showSummary: true,
summaryFunc(param) {
const sums = {}
//
const columns = feeColumns(2)
columns[0].children.forEach(column => {
if (['RMB', 'USD', 'other'].includes(column.dataIndex)) {
console.log(column)
// 0
sums[column.dataIndex] = 0
//
param.forEach(row => {
if (!isNaN(row[column.dataIndex])) {
sums[column.dataIndex] += Number(row[column.dataIndex])
}
})
}
})
//
return [sums]
}
})
const receiveTable = ref(null)
const payTable = ref(null)
const mainApprove = () => {
loading.value = !loading.value
if (!loading.value) {
receiveTable.value.reload()
payTable.value.reload()
}
}
//
const profit = ref(0)
//
const checkProfit = () => {
const receiveData = receiveTable.value.getDataSource()
const payData = payTable.value.getDataSource()
let rAmount = 0
receiveData.forEach(item => {
rAmount = rAmount + Number(item.amount )
})
let pAmount = 0
payData.forEach(item => {
pAmount = pAmount + Number(item.amount )
})
profit.value = rAmount - pAmount
}
//
const list = ref([
{ label: 'M B/L NO', field: 'mblno', span: 5, value: '' },
{ label: '业务类别', field: 'businessTypeText', span: 5, value: '' },
{ label: '委托单位', field: 'cntrTotal', span: 5, value: '' },
{ label: '业务编号', field: 'customerNo', span: 5, value: '' },
{ label: 'VSL/VOY', field: 'vessel', span: 5, value: '' },
{ label: 'CARRIER', field: 'carrier', span: 5, value: '' },
{ label: '会计期间', field: 'accountDate', span: 5, value: '' },
{ label: 'ETD/ETA', field: 'etd', span: 5, value: '' },
{ label: '放单方式', field: 'voyno', span: 5, value: '' },
{ label: 'POL/POD', field: 'loadPort', span: 5, value: '' }
])
// box
// const feeHeight = ref(465)
// const oldFeeHeight = ref(465)
// // Y
// const clientY = ref()
// const handleMouseDown = (event) => {
// //
// document.onselectstart = () => false
// //
// document.ondragstart = () => false
// // Y
// clientY.value = event.clientY
// //
// document.addEventListener('mousemove', handleMouseMove)
// //
// document.addEventListener('mouseup', handleMouseUp)
// }
// //
// const handleMouseMove = (event) => {
// feeHeight.value = clientY.value - event.clientY + Number(oldFeeHeight.value)
// }
// const handleMouseUp = (event) => {
// oldFeeHeight.value = feeHeight.value
// //
// document.removeEventListener('mousemove', handleMouseMove)
// //
// document.removeEventListener('mouseup', handleMouseUp)
// //
// document.onselectstart = null
// //
// document.ondragstart = null
// }
onMounted(() => {
//
reload()
})
defineExpose({
getDataSource
})
</script>
<style lang="less">
.ds-approve-fee-sf {
.vben-basic-table-header__toolbar {
justify-content: space-between;
}
.content {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.columns-name {
width: 110px;
}
.fee-tables {
height: calc(50vh - 136px);
overflow-y: auto;
}
.receive-table, .pay-table {
flex: 1;
th::before {
height: 0!important;
}
.ant-table-footer {
.ant-table-measure-row {
display: none;
}
.ant-table-row-level-0 {
height: 26px!important;
padding-left: 50px;
td {
padding: 5px 6px!important;
font-size: 14px;
font-weight: 600!important;
}
}
}
}
.receive-table {
.ant-table-footer {
td {
color: #17A6A3!important;
}
}
}
.pay-table {
.ant-table-footer {
td {
color: #BA3849!important;
}
}
}
.receive-table {
th {
background: #F2FAFA!important;
}
}
.pay-table {
th {
background: #FCF5F5!important;
}
}
ul {
font-size: 12px;
.fee-name, .fee-data {
background: #FFFDF5;
padding-left: 10px;
}
.fee-name {
height: 51px;
display: flex;
align-items: flex-end;
padding-bottom: 5px;
}
.fee-data {
height: 26px;
border-top: 1px solid #e5e7eb;
line-height: 26px;
}
}
.ant-form-item-label {
label {
font-size: 12px;
height: 24px;
color: #7A8798;
}
}
.ant-form-item-control-input {
min-height: 24px;
}
.ant-form-item-control-input-content {
font-size: 12px;
font-weight: 400;
}
.ant-form-item {
margin-bottom: 4px;
}
.ds-green-tag, .ds-blue-tag, .ds-orange-tag, .ds-red-tag, .ds-purple-tag {
padding: 2px 13px;
}
.fee-table {
.ant-table-body {
min-height: calc(50vh - 210px);
}
}
}
</style>

@ -7,6 +7,7 @@
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="ds-approve-fee"> <div class="ds-approve-fee">
<BasicTable <BasicTable
v-if="!route.query.id"
class="ds-mini-table fee-table" class="ds-mini-table fee-table"
height="500px" height="500px"
:scroll="{ 'x': '100%', 'y': fheight + 'px' }" :scroll="{ 'x': '100%', 'y': fheight + 'px' }"
@ -88,7 +89,7 @@
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
import { GetList, GetStat } from './api' import { GetList, GetStat } from './api'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import FeeActionBar from './components/feeActionBar.vue' // import FeeActionBar from './components/feeActionBar.vue'
// import { useModal } from '/@/components/Modal' // import { useModal } from '/@/components/Modal'
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
@ -96,6 +97,8 @@
// import Statistic from './components/Statistic.vue' // import Statistic from './components/Statistic.vue'
import MainActionBar from './components/mainActionBar.vue' import MainActionBar from './components/mainActionBar.vue'
import { formatTableData } from '/@/hooks/web/common' import { formatTableData } from '/@/hooks/web/common'
import { useRoute } from 'vue-router'
const route = useRoute()
const { createMessage } = useMessage() const { createMessage } = useMessage()
// //
const visible = ref(false) const visible = ref(false)

@ -2240,3 +2240,12 @@ export function CreateChangeTaskAsync(data) {
data data
}) })
} }
// 判断订单审单当前是否是最后一个审批人
export function IsLastMarker(params) {
return request({
url: '/mainApi/ClientFlowInstance/IsLastMarker',
method: 'get',
params
})
}

@ -57,6 +57,7 @@
// //
const init = () => { const init = () => {
const data = props.data const data = props.data
console.log(data)
data.forEach(item => { data.forEach(item => {
item['flag'] = false item['flag'] = false
}) })

@ -146,8 +146,8 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<!-- 选择舱位 --> <!-- 选择舱位 -->
<StorageSpace ref="sspace" :id="id" @createTask="createTask"></StorageSpace> <StorageSpace ref="sspace" :id="id" @createTask="approveAndCreateTast"></StorageSpace>
<a-modal <!-- <a-modal
:visible="cvisible" :visible="cvisible"
:maskClosable="false" :maskClosable="false"
title="是否现舱" title="是否现舱"
@ -162,7 +162,7 @@
<template #footer> <template #footer>
<a-button type="primary" @click="handleOk"></a-button> <a-button type="primary" @click="handleOk"></a-button>
</template> </template>
</a-modal> </a-modal> -->
</div> </div>
</template> </template>
@ -185,7 +185,8 @@
SetTaskStatus, SetTaskStatus,
AutomaticBooking, AutomaticBooking,
SubmitAudit, SubmitAudit,
Withdraw Withdraw,
IsLastMarker
} from '../api/BookingLedger' } from '../api/BookingLedger'
import { GetFormSetInfoByModule } from '/@/api/common' import { GetFormSetInfoByModule } from '/@/api/common'
const appStore = useAppStore() const appStore = useAppStore()
@ -536,7 +537,8 @@
if (!task) { if (!task) {
createMessage.success('保存成功!') createMessage.success('保存成功!')
} else { } else {
completeTask(null, null) //
if (task != 'dc') completeTask(null, null)
} }
} else { } else {
createMessage.success('新增成功!') createMessage.success('新增成功!')
@ -865,6 +867,11 @@
init() init()
}) })
} }
//
const approveAndCreateTast = (type) => {
createTask(type)
seaExportTaskAudit(null)
}
// //
const createTask = async (type) => { const createTask = async (type) => {
const postData = { const postData = {
@ -878,9 +885,6 @@
await CreateTask(postData).then(res => { await CreateTask(postData).then(res => {
loading.value = false loading.value = false
createMessage.success(res.message) createMessage.success(res.message)
//
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
}).catch(() => { }).catch(() => {
loading.value = false loading.value = false
}) })
@ -1004,21 +1008,46 @@
} }
// //
const sspace = ref() const sspace = ref()
const cvisible = ref(false) // const cvisible = ref(false)
const cvalue = ref(1) const cvalue = ref(1)
const handleOk = () => { // const handleOk = () => {
if (cvalue.value == 1) { // if (cvalue.value == 1) {
// // //
sspace.value.init() // sspace.value.init()
} else { // } else {
// // //
AutomaticBooking(id.value) // AutomaticBooking(id.value)
} // }
cvisible.value = false // // cvisible.value = false
} // }
// //
const approveDc = async (remark) => { const approveDc = async (remark) => {
await save() await save('dc')
if (!remark) {
IsLastMarker({
bsType: 1,
bsId: id.value,
taskType: route.query.status
}).then(res => {
if (res.data) {
//
if (bookingDetails.value.shippingSpaceType == 'xc') {
//
sspace.value.init()
} else {
//
seaExportTaskAudit(remark)
AutomaticBooking(id.value)
}
} else {
//
seaExportTaskAudit(remark)
}
})
}
}
//
const seaExportTaskAudit = (remark) => {
const postData = { const postData = {
result: remark ? 2 : 1, result: remark ? 2 : 1,
ids: [id.value], ids: [id.value],
@ -1030,22 +1059,9 @@
SeaExportTaskAudit(postData).then(res => { SeaExportTaskAudit(postData).then(res => {
loading.value = false loading.value = false
createMessage.success(res.message) createMessage.success(res.message)
// //
if (res.data.isCompleted && res.data.flowStatus == 3) { const { fullPath } = route //
// tabStore.closeTabByKey(fullPath, router)
if (bookingDetails.value.shippingSpaceType == 'xc') {
//
sspace.value.init()
} else {
AutomaticBooking(id.value)
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
}
} else {
//
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
}
}).catch(() => { }).catch(() => {
loading.value = false loading.value = false
}) })

@ -1684,6 +1684,8 @@
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') { if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict: any = {} let dict: any = {}
// //
console.log(changes)
console.log(source)
if (changes[0][1] === 'ctn') { if (changes[0][1] === 'ctn') {
const res = ctnDict.value.length ? ctnDict.value : (await GetCtnSelectList())?.data const res = ctnDict.value.length ? ctnDict.value : (await GetCtnSelectList())?.data
if (!ctnDict.value.length) ctnDict.value = res if (!ctnDict.value.length) ctnDict.value = res
@ -1691,14 +1693,16 @@
return item.ctnName === changes[0][3] return item.ctnName === changes[0][3]
}) })
if (item) dict = item[0] if (item) dict = item[0]
list.value[changes[0][0]]['ctn'] = dict?.ctnName changes.forEach(item => {
list.value[changes[0][0]]['ctnCode'] = dict?.ediCode list.value[item[0]]['ctn'] = dict?.ctnName
list.value[changes[0][0]]['size'] = dict?.ctnSize list.value[item[0]]['ctnCode'] = dict?.ediCode
if (list.value[changes[0][0]]['ctnNum']) { list.value[item[0]]['size'] = dict?.ctnSize
list.value[changes[0][0]]['teu'] = list.value[item[0]]['tareWeight'] = dict?.ctnWeight
parseInt(dict.teu || 0) * parseInt(list.value[changes[0][0]]['ctnNum']) if (list.value[changes[0][0]]['ctnNum']) {
} list.value[item[0]]['teu'] =
list.value[changes[0][0]]['tareWeight'] = dict?.ctnWeight parseInt(dict.teu || 0) * parseInt(list.value[item[0]]['ctnNum'])
}
})
} }
if (changes[0][1] === 'kindPkgsName') { if (changes[0][1] === 'kindPkgsName') {
const res = mainPkgs.value const res = mainPkgs.value
@ -1706,8 +1710,10 @@
return item.packageName === changes[0][3] return item.packageName === changes[0][3]
}) })
if (item) dict = item[0] if (item) dict = item[0]
list.value[changes[0][0]]['kindPkgs'] = dict?.id changes.forEach(item => {
list.value[changes[0][0]]['kindPkgsName'] = dict?.packageName list.value[item[0]]['kindPkgs'] = dict?.id
list.value[item[0]]['kindPkgsName'] = dict?.packageName
})
} }
if (changes[0][1] === 'weightTypeName') { if (changes[0][1] === 'weightTypeName') {
const res = await getDictOption('weight_type') const res = await getDictOption('weight_type')

@ -452,7 +452,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { import {
ExcuteRuleEngine, ExcuteRuleEngine,
refreshSailingDate,
GetRuleOpinionLog, GetRuleOpinionLog,
SubmitRule0pinion, SubmitRule0pinion,
SaveDataInList, SaveDataInList,
@ -466,22 +465,19 @@
EditSeaExportRemark, EditSeaExportRemark,
DelSeaExportRemark DelSeaExportRemark
} from '/@/views/operation/seaexport/api/BookingLedger' } from '/@/views/operation/seaexport/api/BookingLedger'
import { ref, Ref, watch, defineEmits, onMounted, onUnmounted } from 'vue' import { ref, Ref, watch, defineEmits, onMounted, onUnmounted, defineAsyncComponent } from 'vue'
// //
import DsJournal from '../components/journal.vue' // import DsJournal from '../components/journal.vue'
const DsJournal = defineAsyncComponent(() => import("../components/journal.vue"))
// //
import DsFile from '/@/components/File/index.vue' const DsFile = defineAsyncComponent(() => import("/@/components/File/index.vue"))
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import emitter from '/@/utils/Bus' import emitter from '/@/utils/Bus'
const { createMessage, notification } = useMessage() const { createMessage, notification } = useMessage()
import { useAppStore } from '/@/store/modules/app' import { useAppStore } from '/@/store/modules/app'
const appStore = useAppStore() const appStore = useAppStore()
import { useRoute, useRouter } from 'vue-router' import { useRoute } from 'vue-router'
import { useUserStore } from '/@/store/modules/user'
import { Item } from 'ant-design-vue/lib/menu'
const userStore = useUserStore()
const router = useRouter()
const route = useRoute() const route = useRoute()
const props = defineProps({ const props = defineProps({
id: { type: String, default: '' }, id: { type: String, default: '' },

@ -1185,6 +1185,9 @@
// //
go({ go({
path: '/approve-fee', path: '/approve-fee',
query: {
id: data.ouT_BS_NO
}
}) })
break break
case 'WAIT_ORDER_AUDIT': case 'WAIT_ORDER_AUDIT':

Loading…
Cancel
Save