|
|
|
@ -171,7 +171,7 @@
|
|
|
|
|
v-model="details.etd"
|
|
|
|
|
@change="changeEtd"
|
|
|
|
|
>
|
|
|
|
|
<a-icon slot="suffixIcon" type="time" style="display: none;" />
|
|
|
|
|
<a-icon slot="suffixIcon" type="time" style="display: none;"/>
|
|
|
|
|
</a-date-picker>
|
|
|
|
|
<span class="week" v-if="etdWeek">W{{ etdWeek || '--' }}</span>
|
|
|
|
|
</div>
|
|
|
|
@ -194,7 +194,7 @@
|
|
|
|
|
placeholder="实际开船"
|
|
|
|
|
v-model="details.atd"
|
|
|
|
|
>
|
|
|
|
|
<a-icon slot="suffixIcon" type="time" style="display: none;" />
|
|
|
|
|
<a-icon slot="suffixIcon" type="time" style="display: none;"/>
|
|
|
|
|
</a-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
@ -348,26 +348,20 @@
|
|
|
|
|
import { XCard } from '@/components'
|
|
|
|
|
import { AutoComplete } from 'ant-design-vue'
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
DjyCustomerpage,
|
|
|
|
|
GetCarrierlist,
|
|
|
|
|
GetVessellist,
|
|
|
|
|
GetSysUserPage,
|
|
|
|
|
GetForwarderlist
|
|
|
|
|
} from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { DjyCustomerpage, GetCarrierlist, GetVessellist, GetSysUserPage, GetForwarderlist } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'BookingDetail',
|
|
|
|
|
components: {
|
|
|
|
|
XCard,
|
|
|
|
|
AutoComplete
|
|
|
|
|
AutoComplete,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
details: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: () => {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
ishd: {
|
|
|
|
|
type: Boolean,
|
|
|
|
@ -380,12 +374,12 @@ export default {
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 8 },
|
|
|
|
|
md: { span: 10 }
|
|
|
|
|
md: { span: 10 },
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 15 },
|
|
|
|
|
md: { span: 13 }
|
|
|
|
|
md: { span: 13 },
|
|
|
|
|
},
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
dataSource: ['Burns Bay Road', 'Downing Street', 'Wall Street'],
|
|
|
|
@ -406,14 +400,14 @@ export default {
|
|
|
|
|
customerModelconfirm: false,
|
|
|
|
|
rowStyleOption: {
|
|
|
|
|
clickHighlight: false,
|
|
|
|
|
hoverHighlight: false
|
|
|
|
|
hoverHighlight: false,
|
|
|
|
|
},
|
|
|
|
|
cellAutofillOption: true,
|
|
|
|
|
editOption: {
|
|
|
|
|
// cell value change
|
|
|
|
|
cellValueChange: ({ row, column }) => {
|
|
|
|
|
console.log('编辑', row, column)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
checkboxOption: {
|
|
|
|
|
hideSelectAll: false,
|
|
|
|
@ -424,7 +418,7 @@ export default {
|
|
|
|
|
// 全选改变事件
|
|
|
|
|
selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
|
|
|
console.log('全选', isSelected, selectedRowKeys)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
@ -434,7 +428,7 @@ export default {
|
|
|
|
|
title: '',
|
|
|
|
|
width: 50,
|
|
|
|
|
operationColumn: true,
|
|
|
|
|
align: 'center'
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{ field: 'col1', key: 'col1', title: '联系人', edit: true },
|
|
|
|
|
{ field: 'col2', key: 'col2', title: '邮箱', edit: true },
|
|
|
|
@ -449,12 +443,12 @@ export default {
|
|
|
|
|
return (
|
|
|
|
|
<a-checkbox
|
|
|
|
|
value={row['BC']}
|
|
|
|
|
on-change={val => {
|
|
|
|
|
on-change={(val) => {
|
|
|
|
|
console.log(val)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'col6',
|
|
|
|
@ -465,12 +459,12 @@ export default {
|
|
|
|
|
return (
|
|
|
|
|
<a-checkbox
|
|
|
|
|
value={row['col6']}
|
|
|
|
|
on-change={val => {
|
|
|
|
|
on-change={(val) => {
|
|
|
|
|
console.log(val)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'col7',
|
|
|
|
@ -481,16 +475,16 @@ export default {
|
|
|
|
|
return (
|
|
|
|
|
<a-checkbox
|
|
|
|
|
value={row['col7']}
|
|
|
|
|
on-change={val => {
|
|
|
|
|
on-change={(val) => {
|
|
|
|
|
console.log(val)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
tableData: [],
|
|
|
|
|
etdWeek: ''
|
|
|
|
|
etdWeek: '',
|
|
|
|
|
// 选择客户 / 关系人弹窗 - end
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -640,7 +634,7 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
details: {
|
|
|
|
@ -648,11 +642,11 @@ export default {
|
|
|
|
|
// console.log('数据改变', nval)
|
|
|
|
|
this.$emit('changeDetail', {
|
|
|
|
|
detail: nval,
|
|
|
|
|
type: 'baseInfo'
|
|
|
|
|
type: 'baseInfo',
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
deep: true
|
|
|
|
|
}
|
|
|
|
|
deep: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.init()
|
|
|
|
@ -679,7 +673,7 @@ export default {
|
|
|
|
|
SearchValue: name,
|
|
|
|
|
PropString: key
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
// this.customerData = res.data.rows
|
|
|
|
|
this[`${type}Data`] = res.data.rows
|
|
|
|
@ -687,7 +681,7 @@ export default {
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -712,15 +706,15 @@ export default {
|
|
|
|
|
// 船公司 - start
|
|
|
|
|
getCarrier(name = '') {
|
|
|
|
|
GetCarrierlist({
|
|
|
|
|
CnName: name
|
|
|
|
|
CnName: name,
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.carrierData = res.data
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -737,15 +731,15 @@ export default {
|
|
|
|
|
// 船代 - start
|
|
|
|
|
getForwarderlist(name = '') {
|
|
|
|
|
GetForwarderlist({
|
|
|
|
|
Name: name
|
|
|
|
|
Name: name,
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.shipagencyData = res.data
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -761,15 +755,15 @@ export default {
|
|
|
|
|
// 船名 - start
|
|
|
|
|
getVessel(name = '') {
|
|
|
|
|
GetVessellist({
|
|
|
|
|
Name: name
|
|
|
|
|
Name: name,
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.vesselData = res.data
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -814,9 +808,9 @@ export default {
|
|
|
|
|
// 团队成员 - start
|
|
|
|
|
getUserList(name = '', type) {
|
|
|
|
|
GetSysUserPage({
|
|
|
|
|
SearchValue: name
|
|
|
|
|
SearchValue: name,
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
if (type === 'sale') {
|
|
|
|
|
this.saleUserList = res.data.rows
|
|
|
|
@ -829,7 +823,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -878,13 +872,8 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 关系人弹窗 - start
|
|
|
|
|
changeCustomer(type) {
|
|
|
|
|
if (type == 'add') {
|
|
|
|
|
this.$router.push({ name: 'CustomerInformationManagementAdd' })
|
|
|
|
|
localStorage.setItem('CustomerInformationManagementAdd', 'new')
|
|
|
|
|
} else {
|
|
|
|
|
this.customerType = type
|
|
|
|
|
this.customerVisible = true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleModelSubmit() {
|
|
|
|
|
this.handleModelCancel()
|
|
|
|
@ -899,35 +888,21 @@ export default {
|
|
|
|
|
this.etdWeek = this.getWeek(dateString)
|
|
|
|
|
},
|
|
|
|
|
getWeek(dateTime) {
|
|
|
|
|
// 获取从1970年到现在的时间毫秒数
|
|
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
|
const temp_ms = new Date(dateTime).getTime()
|
|
|
|
|
const temptTime = new Date(temp_ms)
|
|
|
|
|
// 今天周几,如果是周日,则设为7
|
|
|
|
|
const weekday = temptTime.getDay() & 7
|
|
|
|
|
// 周1+5天=周六,得到本周6的日期,之所以以每周末的日期为基准,不能用每周日的日期为基准来计算
|
|
|
|
|
// 当前日期的周六的日期
|
|
|
|
|
temptTime.setDate(temptTime.getDate() - weekday + 1 + 5)
|
|
|
|
|
// 每年的第一天,年/1/1,参数之中,0代表月份,介于0(1月) ~11(12月)之间的整数,getDay获取星期几同理
|
|
|
|
|
// 第一天的日期
|
|
|
|
|
let firstDay = new Date(temptTime.getFullYear(), 0, 1)
|
|
|
|
|
const dayOfWeek = firstDay.getDay()
|
|
|
|
|
let spendDay = 1
|
|
|
|
|
// 如果第一天不是星期日,那么就找到下一个星期日作为开始
|
|
|
|
|
if (dayOfWeek !== 0) {
|
|
|
|
|
spendDay = 7 - dayOfWeek + 1
|
|
|
|
|
}
|
|
|
|
|
const yearOfW = temptTime.getFullYear()
|
|
|
|
|
firstDay = new Date(yearOfW, 0, 1 + spendDay)
|
|
|
|
|
/*
|
|
|
|
|
1.Math.ceil 取大于等于所给值的最小整数
|
|
|
|
|
2.86400000是换算到天的基数,js的时间差值为时间戳,即毫秒数
|
|
|
|
|
1000毫秒 * 60秒 * 60分钟* 24小时 = 86400000
|
|
|
|
|
3.temptTime是当前日期,firstDay是当年第一天,周数计算公式就是(当前日期-第一天天数)/7 就是本年的第几周
|
|
|
|
|
4.d是差距天数,res是周数
|
|
|
|
|
*/
|
|
|
|
|
const d = Math.ceil((temptTime.valueOf() - firstDay.valueOf()) / 86400000)
|
|
|
|
|
const res = Math.ceil(d / 7) + 1
|
|
|
|
|
// const weekOfNow = firstDay.getFullYear().toString() + res.toString()
|
|
|
|
|
const weekOfNow = res.toString()
|
|
|
|
|
return weekOfNow
|
|
|
|
|
},
|
|
|
|
|