更新舱位问题

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

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

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

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

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

@ -3,22 +3,22 @@
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="handledbclick">
<template #tableTitle>
<a-button type="link" size="mini" @click="handleLabel">
<span class="iconfont icon-jiahao2fill"></span>
<span class="iconfont icon-cengji"></span>
分配标签
</a-button>
<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-upload :customRequest="customRequest" :multiple="false"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
:showUploadList="false" name="file">
<a-button size="mini" type="link">
<span class="iconfont icon-jiahao2fill"></span>
<span class="iconfont icon-a-17Fdaoru"></span>
导入</a-button>
</a-upload>
<a-button type="link" @click="handleSuport" :loading="loadingExport" size="mini">
<span class="iconfont icon-jiahao2fill"></span>
<span class="iconfont icon-jiantouxia"></span>
导出
</a-button>
</template>
@ -27,6 +27,12 @@
<span class="iconfont icon-jiahao2fill"></span>
新增
</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 v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'vessel'">
@ -50,6 +56,13 @@
<template v-if="column.dataIndex == 'isRecvBC'">
<BulbFilled style="color: green; font-size: 16px" :title="record.lstRecvBCDate" v-if="record.isRecvBC" />
</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'">
<BulbFilled style="color: red; font-size: 16px" :title="record.lstRecvBCDate" v-if="record.isRecvBKCancel" />
</template>
@ -108,7 +121,7 @@
</template>
<script lang="ts" setup>
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 { columns, searchFormSchema, FeeStatus } from './columns'
import { BulbFilled, CheckCircleFilled, BulbOutlined } from '@ant-design/icons-vue';
@ -122,7 +135,7 @@ const { createMessage } = useMessage()
const optionsStore = useOptionsStore()
const go = useGo()
const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps }] = useTable({
const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps, setSelectedRowKeys }] = useTable({
title: '',
api: async (p) => {
const res: API.DataResult = await BookingSlotPage(p)
@ -152,7 +165,7 @@ const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps }]
setProps({
showIndexColumn: false,
}),
resolve({ data: arr, total: 10 })
resolve({ data: arr, total: res.count })
optionsStore.getOptionsByCode('GetClientPortSelectList')
})
},
@ -172,6 +185,7 @@ const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps }]
showTableSetting: true,
bordered: true,
showIndexColumn: true,
rowKey: 'id',
indexColumnProps: {
width: 60,
},
@ -188,14 +202,14 @@ function handledbclick(record) {
}
function handleDelete(row) {
setLoading(true);
// mskDelete({ id: row.id }).then(res => {
// if (res.succeeded) {
// reload()
// } else {
// createMessage.error(res.message)
// }
// setLoading(false);
// })
BookingSlotDelete([row.id]).then(res => {
if (res.succeeded) {
reload()
} else {
createMessage.error(res.message)
}
setLoading(false);
})
}
const labelIdArray = ref([])
const labelList = ref([]) as any
@ -221,6 +235,45 @@ function handleLabel() {
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) {
const formData = new FormData()
formData.append('file', data.file)
@ -439,4 +492,8 @@ function handleSuport() {
}
}
}
/deep/ .vben-basic-table-action button {
padding: 0 3px !important;
}
</style>

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

@ -9,3 +9,11 @@ export function getAvailableCtnsBySlot(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 { useOptionsStore } from '/@/store/modules/options'
import { getOptions } from '/@/hooks/dict'
import { GetClientInfoWithContact } from './api'
import dayjs from 'dayjs';
const customerContactList = ref([])
const customerContactAllList = ref([]) //接口获取的联系人信息
//详情表单
export const formSchema: FormSchema[] = [
{
@ -53,7 +54,13 @@ export const formSchema: FormSchema[] = [
onChange: (e, obj) => {
if (obj) {
formModel.customerName = obj.label
const data = {
"clientId": obj.id,
"isController": true
}
GetClientInfoWithContact(data).then(res=>{
customerContactAllList.value = res.data.clientContactList
})
}
if (!obj && !e) {
formModel.customerName = ''
@ -69,11 +76,36 @@ export const formSchema: FormSchema[] = [
componentProps: ({ formModel }) => {
return {
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 },
},
{
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: '销售',
field: 'saleId',
@ -91,7 +123,6 @@ export const formSchema: FormSchema[] = [
onChange: (e, obj) => {
if (obj) {
formModel.saleName = obj.label
}
if (!obj && !e) {
formModel.saleName = ''

@ -1,9 +1,14 @@
<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">
<template #slotNo="{ model, field }">
<span>{{ model[field] }}</span>
</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>
<template #footer>
<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,
showActionButtonGroup: false,
})
const [registerModal, { closeModal }] = useModalInner((data) => {
const [registerModal, { setModalProps,closeModal }] = useModalInner((data) => {
console.log(data)
console.log(data.row)
setFieldsValue(data.row)
})
defineExpose({
init
if(data.type==='init'){
init(data.row)
}
})
const type = ref('')
const CtnList = ref([])
const ctnListCopy = ref([])
const slotEdit = ref({})
const loading = ref(false)
function init(row) {
type.value = 'cabin'
// this.userInfoList = []
// this.$forceUpdate()
// this.CreateData = {}
// this.CreateData.SALE_TIME = moment().format('YYYY-MM-DD HH:mm:ss')
// this.SlotVisible = true
// this.spinning = true
// getAvailableCtnsBySlot({ slotId: row.id }).then(res => {
// if (res.success) {
// this.slotEdit = row
// if (res.data.length > 0) {
// res.data.forEach(item => {
// item.maxnum = item.ctnnum
// })
// this.$set(this.CreateData, 'CtnList', res.data)
// this.ctnListCopy = JSON.parse(JSON.stringify(res.data))
// } else {
// this.$message.error('')
// this.$set(this.CreateData, 'CtnList', [])
// }
// this.$forceUpdate()
// } else {
// this.$message.error(res.message)
// }
// this.spinning = false
// })
setModalProps({ loading: true })
getAvailableCtnsBySlot({ slotId: row.id }).then(res => {
if (res.successed) {
slotEdit.value = row
if (res.data.length > 0) {
res.data.forEach(item => {
item.maxnum = item.ctnnum
})
CtnList.value = res.data
ctnListCopy.value = JSON.parse(JSON.stringify(res.data))
} else {
createMessage.error('可用箱子为空,请选择其它舱位生成订舱')
CtnList.value = []
}
} else {
createMessage.error(res.message)
}
setModalProps({ loading: false })
})
}
function handleSave() {
console.log(getFieldsValue())
}
</script>

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

Loading…
Cancel
Save