更新舱位问题

szh-new
sunzehua 4 months ago
parent 7fe13bb40b
commit 75a17f5594

@ -187,6 +187,5 @@ export function formatParams(params = {}) {
} }
function isValidDate(dateString) { function isValidDate(dateString) {
const date = dayjs(dateString); return dayjs(dateString,'YYYY-MM-DD hh:mm:ss', true).isValid();
return date.isValid();
} }

@ -56,7 +56,7 @@ const { createMessage } = useMessage()
return new Promise((resolve) => { return new Promise((resolve) => {
resolve({ resolve({
data: res.data, data: res.data,
total: 10, total: res.count,
}) })
}) })
}, },

@ -94,8 +94,9 @@ export function BookingLabelList(parameter) {
export function BookingSlotDelete(parameter) { export function BookingSlotDelete(parameter) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/BookingSlotService/delete?ids=' + parameter, url: '/opApi/BookingSlotService/Delete',
method: 'post' method: 'post',
data: parameter
}) })
} }

@ -36,7 +36,7 @@ const sharedOnCell1 = (_, index) => {
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'SlotBookingNo', field: 'slotBookingNo',
label: '舱位提单号', label: '舱位提单号',
component: 'Input', component: 'Input',
colProps: { span: 4 }, colProps: { span: 4 },
@ -311,15 +311,16 @@ export const columns: BasicColumn[] = [
{ {
title: '标签', title: '标签',
align: 'center', align: 'center',
width: 100, width: 200,
dataIndex: 'labelList', dataIndex: 'labelList',
slots: { default: 'labelList' },
customCell: sharedOnCell, customCell: sharedOnCell,
}, },
{ {
title: '舱位提单号', title: '舱位提单号',
align: 'center', align: 'center',
width: 160, width: 160,
dataIndex: 'SlotBookingNo', dataIndex: 'slotBookingNo',
customCell: sharedOnCell, customCell: sharedOnCell,
}, },
{ {
@ -334,6 +335,8 @@ export const columns: BasicColumn[] = [
align: 'center', align: 'center',
width: 150, width: 150,
dataIndex: 'vessel', dataIndex: 'vessel',
showHeaderOverflow: true,
sortable: true,
customCell: sharedOnCell, customCell: sharedOnCell,
}, },
{ {
@ -463,14 +466,14 @@ export const columns: BasicColumn[] = [
title: '收货地', title: '收货地',
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'placereceipt', dataIndex: 'placeReceipt',
customCell: sharedOnCell, customCell: sharedOnCell,
}, },
{ {
title: '交货地', title: '交货地',
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'placedelivery', dataIndex: 'placeDelivery',
customCell: sharedOnCell, customCell: sharedOnCell,
}, },
{ {
@ -547,7 +550,7 @@ export const columns: BasicColumn[] = [
title: '航线', title: '航线',
align: 'center', align: 'center',
width: 100, width: 100,
dataIndex: 'lanename', dataIndex: 'laneName',
customCell: sharedOnCell, customCell: sharedOnCell,
}, },
{ {
@ -665,7 +668,7 @@ export const columns: BasicColumn[] = [
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
width: 130, width: 100,
dataIndex: 'action', dataIndex: 'action',
customCell: sharedOnCell, customCell: sharedOnCell,
fixed: 'right' fixed: 'right'
@ -855,10 +858,10 @@ export const detialForm: FormSchema[] = [
], ],
onChange: (e, obj) => { onChange: (e, obj) => {
if (obj) { if (obj) {
formModel.bookingSlotTypeName = obj.label formModel.carriageTypeName = obj.label
} }
if (!obj && !e) { if (!obj && !e) {
formModel.bookingSlotTypeName = '' formModel.carriageTypeName = ''
} }
}, },
} }

@ -3,22 +3,22 @@
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="handledbclick"> <BasicTable class="ds-table" @register="registerTable" @row-dbClick="handledbclick">
<template #tableTitle> <template #tableTitle>
<a-button type="link" size="mini" @click="handleLabel"> <a-button type="link" size="mini" @click="handleLabel">
<span class="iconfont icon-jiahao2fill"></span> <span class="iconfont icon-cengji"></span>
分配标签 分配标签
</a-button> </a-button>
<a-button :loading="sumload" type="link" size="mini" @click="handleSum"> <a-button :loading="sumload" type="link" size="mini" @click="handleSum">
<span class="iconfont icon-jiahao2fill"></span> <span class="iconfont icon-shujuyingshe"></span>
合票 合票
</a-button> </a-button>
<a-upload :customRequest="customRequest" :multiple="false" <a-upload :customRequest="customRequest" :multiple="false"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
:showUploadList="false" name="file"> :showUploadList="false" name="file">
<a-button size="mini" type="link"> <a-button size="mini" type="link">
<span class="iconfont icon-jiahao2fill"></span> <span class="iconfont icon-a-17Fdaoru"></span>
导入</a-button> 导入</a-button>
</a-upload> </a-upload>
<a-button type="link" @click="handleSuport" :loading="loadingExport" size="mini"> <a-button type="link" @click="handleSuport" :loading="loadingExport" size="mini">
<span class="iconfont icon-jiahao2fill"></span> <span class="iconfont icon-jiantouxia"></span>
导出 导出
</a-button> </a-button>
</template> </template>
@ -27,6 +27,12 @@
<span class="iconfont icon-jiahao2fill"></span> <span class="iconfont icon-jiahao2fill"></span>
新增 新增
</a-button> </a-button>
<a-popconfirm title="确定删除吗?" ok-text="" cancel-text="" @confirm="handleDeleteAll">
<a-button type="link" size="mini">
<span class="iconfont icon-shanchu2"></span>
删除
</a-button>
</a-popconfirm>
</template> </template>
<template v-slot:bodyCell="{ column, record }"> <template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'vessel'"> <template v-if="column.dataIndex == 'vessel'">
@ -50,6 +56,13 @@
<template v-if="column.dataIndex == 'isRecvBC'"> <template v-if="column.dataIndex == 'isRecvBC'">
<BulbFilled style="color: green; font-size: 16px" :title="record.lstRecvBCDate" v-if="record.isRecvBC" /> <BulbFilled style="color: green; font-size: 16px" :title="record.lstRecvBCDate" v-if="record.isRecvBC" />
</template> </template>
<template v-if="column.dataIndex == 'labelList'">
<div>
<a-tag style="color: black !important;font-weight: bold;cursor: pointer;" :color="item.color"
@click="handleLabelBind(record)" v-for="(item, index) in record.labelList" :key="index">{{ item.name
}}</a-tag>
</div>
</template>
<template v-if="column.dataIndex == 'isRecvBKCancel'"> <template v-if="column.dataIndex == 'isRecvBKCancel'">
<BulbFilled style="color: red; font-size: 16px" :title="record.lstRecvBCDate" v-if="record.isRecvBKCancel" /> <BulbFilled style="color: red; font-size: 16px" :title="record.lstRecvBCDate" v-if="record.isRecvBKCancel" />
</template> </template>
@ -108,7 +121,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { BookingSlotPage, BookingLabelList, BookingLabelBind, GetMergeList, ImportSlotFromFile, PrintOrder } from './api' import { BookingSlotPage, BookingLabelList, BookingLabelBind, GetMergeList, ImportSlotFromFile, PrintOrder, BookingSlotDelete } from './api'
import { reactive, ref, h, onMounted } from 'vue'; import { reactive, ref, h, onMounted } from 'vue';
import { columns, searchFormSchema, FeeStatus } from './columns' import { columns, searchFormSchema, FeeStatus } from './columns'
import { BulbFilled, CheckCircleFilled, BulbOutlined } from '@ant-design/icons-vue'; import { BulbFilled, CheckCircleFilled, BulbOutlined } from '@ant-design/icons-vue';
@ -122,7 +135,7 @@ const { createMessage } = useMessage()
const optionsStore = useOptionsStore() const optionsStore = useOptionsStore()
const go = useGo() const go = useGo()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps }] = useTable({ const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps, setSelectedRowKeys }] = useTable({
title: '', title: '',
api: async (p) => { api: async (p) => {
const res: API.DataResult = await BookingSlotPage(p) const res: API.DataResult = await BookingSlotPage(p)
@ -152,7 +165,7 @@ const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps }]
setProps({ setProps({
showIndexColumn: false, showIndexColumn: false,
}), }),
resolve({ data: arr, total: 10 }) resolve({ data: arr, total: res.count })
optionsStore.getOptionsByCode('GetClientPortSelectList') optionsStore.getOptionsByCode('GetClientPortSelectList')
}) })
}, },
@ -172,6 +185,7 @@ const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps }]
showTableSetting: true, showTableSetting: true,
bordered: true, bordered: true,
showIndexColumn: true, showIndexColumn: true,
rowKey: 'id',
indexColumnProps: { indexColumnProps: {
width: 60, width: 60,
}, },
@ -188,14 +202,14 @@ function handledbclick(record) {
} }
function handleDelete(row) { function handleDelete(row) {
setLoading(true); setLoading(true);
// mskDelete({ id: row.id }).then(res => { BookingSlotDelete([row.id]).then(res => {
// if (res.succeeded) { if (res.succeeded) {
// reload() reload()
// } else { } else {
// createMessage.error(res.message) createMessage.error(res.message)
// } }
// setLoading(false); setLoading(false);
// }) })
} }
const labelIdArray = ref([]) const labelIdArray = ref([])
const labelList = ref([]) as any const labelList = ref([]) as any
@ -221,6 +235,45 @@ function handleLabel() {
labelLoad.value = false labelLoad.value = false
}) })
} }
function handleDeleteAll() {
const select = getSelectRows()
const pkIdArr = select.map((item, index) => {
return item.id
})
if (pkIdArr.length === 0) {
createMessage.error('请选择要删除的数据')
return false
}
setLoading(true);
BookingSlotDelete(pkIdArr).then(res => {
if (res.succeeded) {
reload()
} else {
createMessage.error(res.message)
}
setLoading(false);
})
}
function handleLabelBind(row) {
visible.value = true
labelIdArray.value = []
labelLoad.value = true
setSelectedRowKeys([row.id])
BookingLabelList({ scope: 1 }).then(res => {
res.data.forEach(item => {
item.isActive = false
if (row.labelList) {
row.labelList.forEach(ite => {
if (ite.id === item.id) {
item.isActive = true
}
})
}
})
labelList.value = res.data
labelLoad.value = false
})
}
function customRequest(data) { function customRequest(data) {
const formData = new FormData() const formData = new FormData()
formData.append('file', data.file) formData.append('file', data.file)
@ -439,4 +492,8 @@ function handleSuport() {
} }
} }
} }
/deep/ .vben-basic-table-action button {
padding: 0 3px !important;
}
</style> </style>

@ -51,7 +51,7 @@ const [registerTable, { reload, getForm, getPaginationRef, getSelectRows, setPro
const res: API.DataResult = await GetParaContractNoPage(p) const res: API.DataResult = await GetParaContractNoPage(p)
return new Promise((resolve) => { return new Promise((resolve) => {
resolve({ resolve({
data: res.data, total: 10 data: res.data, total: res.count
}) })
}) })
}, },

@ -104,7 +104,7 @@ const [registerTable, { reload, getSelectRows, setLoading }] = useTable({
const res: API.DataResult = await mskGetPage(p) const res: API.DataResult = await mskGetPage(p)
return new Promise((resolve) => { return new Promise((resolve) => {
resolve({ resolve({
data: res.data, total: 10 data: res.data, total: res.count
}) })
}) })
}, },

@ -9,3 +9,11 @@ export function getAvailableCtnsBySlot(parameter) {
data: parameter data: parameter
}) })
} }
export function GetClientInfoWithContact(parameter) {
return request<DataResult>({
url: '/mainApi/ClientInfo/GetClientInfoWithContact',
method: 'post',
data: parameter
})
}

@ -6,8 +6,9 @@ import { GetCtnSelectList } from '/@/api/common'
import { getDictOption } from '/@/utils/dictUtil' import { getDictOption } from '/@/utils/dictUtil'
import { useOptionsStore } from '/@/store/modules/options' import { useOptionsStore } from '/@/store/modules/options'
import { getOptions } from '/@/hooks/dict' import { getOptions } from '/@/hooks/dict'
import { GetClientInfoWithContact } from './api'
import dayjs from 'dayjs'; import dayjs from 'dayjs';
const customerContactList = ref([]) const customerContactAllList = ref([]) //接口获取的联系人信息
//详情表单 //详情表单
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
@ -53,7 +54,13 @@ export const formSchema: FormSchema[] = [
onChange: (e, obj) => { onChange: (e, obj) => {
if (obj) { if (obj) {
formModel.customerName = obj.label formModel.customerName = obj.label
const data = {
"clientId": obj.id,
"isController": true
}
GetClientInfoWithContact(data).then(res=>{
customerContactAllList.value = res.data.clientContactList
})
} }
if (!obj && !e) { if (!obj && !e) {
formModel.customerName = '' formModel.customerName = ''
@ -69,11 +76,36 @@ export const formSchema: FormSchema[] = [
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
mode: "multiple", mode: "multiple",
options:customerContactList.value fieldNames:{
label:'shortName',
value: 'id',
},
options:customerContactAllList.value,
onChange: (e, obj) => {
if (obj) {
formModel.customerContactList = obj
}
if (!obj && !e) {
formModel.customerContactList = []
}
},
} }
}, },
colProps: { span: 12 }, colProps: { span: 12 },
}, },
{
field: 'customerContactList',
label: '联系人信息',
slot: 'customerContactList',
component: 'Input',
show: ({ values }) => {
console.log(values)
if(values.customerContactList && values.customerContactList.length>0){
return true
}
},
colProps: { span: 24 },
},
{ {
label: '销售', label: '销售',
field: 'saleId', field: 'saleId',
@ -91,7 +123,6 @@ export const formSchema: FormSchema[] = [
onChange: (e, obj) => { onChange: (e, obj) => {
if (obj) { if (obj) {
formModel.saleName = obj.label formModel.saleName = obj.label
} }
if (!obj && !e) { if (!obj && !e) {
formModel.saleName = '' formModel.saleName = ''

@ -1,9 +1,14 @@
<template> <template>
<BasicModal width="800px" v-bind="$attrs" :use-wrapper="true" title="标签详情" @register="registerModal" @ok="handleSave"> <BasicModal width="800px" v-bind="$attrs" :use-wrapper="true" title="生成方式选择" @register="registerModal" @ok="handleSave">
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<template #slotNo="{ model, field }"> <template #slotNo="{ model, field }">
<span>{{ model[field] }}</span> <span>{{ model[field] }}</span>
</template> </template>
<template #customerContactList="{ model, field }">
<span v-for="item in model.customerContactList" :key="item.id" style="margin-right: 10px;" >
{{ item.shortName }}{{ item.email }}
</span>
</template>
</BasicForm> </BasicForm>
<template #footer> <template #footer>
<a-button pre-icon="ant-design:close-outlined" type="warning" :loading="loading" ghost <a-button pre-icon="ant-design:close-outlined" type="warning" :loading="loading" ghost
@ -26,46 +31,41 @@ const [registerForm, { resetFields, setFieldsValue, getFieldsValue }] = useForm(
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
}) })
const [registerModal, { closeModal }] = useModalInner((data) => { const [registerModal, { setModalProps,closeModal }] = useModalInner((data) => {
console.log(data) console.log(data)
console.log(data.row) if(data.type==='init'){
setFieldsValue(data.row) init(data.row)
}) }
defineExpose({
init
}) })
const type = ref('') const type = ref('')
const CtnList = ref([])
const ctnListCopy = ref([])
const slotEdit = ref({})
const loading = ref(false) const loading = ref(false)
function init(row) { function init(row) {
type.value = 'cabin' type.value = 'cabin'
// this.userInfoList = [] setModalProps({ loading: true })
// this.$forceUpdate() getAvailableCtnsBySlot({ slotId: row.id }).then(res => {
// this.CreateData = {} if (res.successed) {
// this.CreateData.SALE_TIME = moment().format('YYYY-MM-DD HH:mm:ss') slotEdit.value = row
// this.SlotVisible = true if (res.data.length > 0) {
// this.spinning = true res.data.forEach(item => {
// getAvailableCtnsBySlot({ slotId: row.id }).then(res => { item.maxnum = item.ctnnum
// if (res.success) { })
// this.slotEdit = row CtnList.value = res.data
// if (res.data.length > 0) { ctnListCopy.value = JSON.parse(JSON.stringify(res.data))
// res.data.forEach(item => { } else {
// item.maxnum = item.ctnnum createMessage.error('可用箱子为空,请选择其它舱位生成订舱')
// }) CtnList.value = []
// this.$set(this.CreateData, 'CtnList', res.data) }
// this.ctnListCopy = JSON.parse(JSON.stringify(res.data)) } else {
// } else { createMessage.error(res.message)
// this.$message.error('') }
// this.$set(this.CreateData, 'CtnList', []) setModalProps({ loading: false })
// } })
// this.$forceUpdate()
// } else {
// this.$message.error(res.message)
// }
// this.spinning = false
// })
} }
function handleSave() { function handleSave() {
console.log(getFieldsValue())
} }
</script> </script>

@ -57,7 +57,7 @@ const [registerTable, { reload, setLoading, getPaginationRef, getSelectRows, set
const res: API.DataResult = await BookingLabelPageList(p) const res: API.DataResult = await BookingLabelPageList(p)
return new Promise((resolve) => { return new Promise((resolve) => {
resolve({ resolve({
data: res.data, total: 10 data: res.data, total: res.count
}) })
}) })
}, },

Loading…
Cancel
Save