合并 冲突

dev
张同海 2 years ago
commit 123d1929cc

@ -4,4 +4,4 @@ VUE_APP_API_BASE_URL=http://60.209.125.238:25805
VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:25805
//VUE_APP_API_BASE_URL=http://127.0.0.1:5000
//VUE_APP_SOCKET_BASE_URL=http://127.0.0.1:5000
//VUE_APP_SOCKET_BASE_URL=http://127.0.0.1:5000

@ -206,14 +206,19 @@ export function GetFile(parameter) {
"file": "string"
}
*/
export function AddFile(parameter) {
export function AddFile(params) {
console.log(params)
return axios({
url: '/BookingOrder/addFile',
method: 'post',
data: parameter
data: params,
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'multipart/form-data'
}
})
}
/**
* 获取货运动态
* @params id

@ -110,7 +110,10 @@ export default {
watch: {
sedOrderList (nval, oval) {
if (nval.length > 0) {
// this.editDetails = nval[this.editIndex]
console.log(nval)
this.editDetails = nval[this.editIndex]
} else {
this.editDetails = null
}
},
editDetails: {
@ -129,6 +132,7 @@ export default {
},
methods: {
addSedOrder () {
debugger
if (this.isAdd) {
this.$message.error('请先保存主单')
return false

@ -1,13 +1,13 @@
<template>
<div class="booking-detail">
<a-tabs size="large" :tabBarStyle="tabBarStyle">
<a-tabs size="large" :tabBarStyle="tabBarStyle" :activeKey="tabActiveKey" @change="changeTab">
<a-tab-pane key="1" tab="主单信息">
<a-row :gutter="24">
<a-col :span="18">
<template v-if="!inPageLoading">
<operationArea :details="bookingDetails" @refresh="refreshPage" @save="saveFun" @rules="getRules"></operationArea>
<a-tabs type="card">
<a-tab-pane key="1" tab="基础信息">
<a-tab-pane key="1-1" tab="基础信息">
<div class="pane-box">
<!-- 基本信息 -->
<basicInfo :type="type" :details="bookingDetails" @changeDetail="changeDetailFun"></basicInfo>
@ -23,7 +23,7 @@
<goodsTable :details="bookingDetails" @changeDetail="changeDetailFun"></goodsTable>
</div>
</a-tab-pane>
<a-tab-pane key="2" tab="EDI补充信息">
<a-tab-pane key="2-2" tab="EDI补充信息">
<ediMore class="pane-box" :details="bookingDetails" @changeDetail="changeDetailFun" v-if="!inPageLoading"></ediMore>
</a-tab-pane>
</a-tabs>
@ -84,6 +84,8 @@ export default {
excuteRules: [],
isAdd: false,
moreStr: '',
tabActiveKey: '1',
historyData: []
}
},
watch: {
@ -100,15 +102,59 @@ export default {
},
methods: {
routerChange () {
console.log('路由变化')
if (this.inPageLoading) {
return false
}
this.id = this.$route.query.id
this.type = this.$route.query.type
this.isCopy = this.$route.query.isCopy || false
this.tabActiveKey = '1'
this.$forceUpdate()
this.init()
},
routerChange1 () {
const hisData = {
bookingDetails: this.bookingDetails,
excuteRules: this.excuteRules,
isAdd: this.isAdd,
tabActiveKey: this.tabActiveKey,
type: this.type,
isCopy: this.isCopy,
id: this.id
}
this.$set(this.historyData, this.id, hisData)
console.log('设置历史数据', this.historyData)
// if (this.$route.name !== 'booking_ledger') { return false }
const newId = this.$route.query.id
const newType = this.$route.query.type
const index = Object.keys(this.historyData).indexOf(newId)
console.log(Object.keys(this.historyData).includes(newId), newType === this.historyData[index].type)
if (Object.keys(this.historyData).includes(newId) && newType === this.historyData[index].type) {
console.log('获取到历史数据')
const $data = this.historyData[newId]
this.bookingDetails = $data.bookingDetails
this.excuteRules = $data.excuteRules
this.isAdd = $data.isAdd
this.tabActiveKey = $data.tabActiveKey
this.isCopy = $data.isCopy
this.$forceUpdate()
} else {
console.log('路由变化')
// if (this.inPageLoading) {
// return false
// }
this.id = this.$route.query.id
this.type = this.$route.query.type
this.isCopy = this.$route.query.isCopy || false
this.tabActiveKey = '1'
this.$forceUpdate()
this.init()
}
},
init() {
this.bookingDetails = {}
if (this.id) {
this.isAdd = false
this.getDetail()
} else {
this.isAdd = true
@ -247,18 +293,26 @@ export default {
return false
}
this.inPageLoading = true
this.$message.loading({ content: '加载中...' });
// this.$message.loading({ content: '...' });
BookingOrderGet({
id: this.id
})
.then((res) => {
this.inPageLoading = false
this.$message.destroy()
this.$message.success({ content: '加载完成' })
// this.$message.success({ content: '' })
if (this.isCopy) {
res.data.mblno = ''
this.isAdd = true
}
if (!res.data.bookingEDIExt) {
res.data.bookingEDIExt = {
weiTuoFang: '',
ediAttn: '',
ediAttnTel: '',
ediAttnMail: ''
}
}
this.$set(this, 'bookingDetails', res.data)
this.$forceUpdate()
})
@ -327,6 +381,11 @@ export default {
this.moreStr = str
},
changeTab (e) {
console.log(e)
this.tabActiveKey = e
},
//
refreshPage() {
this.init()

@ -23,14 +23,19 @@
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
<a-form-item class="from-label" label="船公司" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<auto-complete
<!-- <auto-complete
:allowClear="true"
:data-source="carrierDataArr"
v-model="details.carrier"
placeholder="请输入船公司"
@select="carrierSelect"
@change="carrierChange"
/>
/> -->
<a-select :default-value="details.carrier" @change="handleCarrierChange" show-search :dropdownMatchSelectWidth="false" :filter-option="filterOption">
<a-select-option v-for="(carrier, cindex) in carrierSelectData" :key="cindex" :value="cindex" >
{{ carrier.selectShowTab }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
@ -469,6 +474,7 @@ export default {
dataSource: ['Burns Bay Road', 'Downing Street', 'Wall Street'],
customerData: [], //
carrierData: [], //
carrierSelectData: [], //
vesselData: [], //
voynoinnerData: [], //
lanenameData: [], // 线
@ -789,7 +795,7 @@ export default {
// ==============================
init() {
// this.getCustomer()
// this.getCarrier()
this.getCarrier()
// this.getVessel()
// this.getVoynoinner()
// // this.getVoynoinner()
@ -846,11 +852,20 @@ export default {
// - start
getCarrier(name = '') {
GetCarrierlist({
CnName: name
CnName: name,
keyword: ''
})
.then(res => {
if (res.code === 200) {
this.carrierData = res.data
const arr = []
res.data.map((item, index) => {
arr.push({
...{ selectShowTab: item.cnName + ' / ' + item.code },
...item
})
})
this.carrierSelectData = arr
this.$forceUpdate()
}
})
@ -858,13 +873,26 @@ export default {
console.log(err)
})
},
//
carrierSelect(value) {
const index = this.carrierDataArr.indexOf(value)
this.details.carrier = value
this.details.carrierid = this.carrierData[index].code
},
//
carrierChange(value) {
this.getCarrier(value)
console.log(value)
// this.getCarrier(value)
},
handleCarrierChange (index) {
this.details.carrier = this.carrierSelectData[index].cnName
this.details.carrierid = this.carrierSelectData[index].code
console.log(this.details.carrier, this.details.carrierid)
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
// - end

@ -15,14 +15,26 @@
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
<!-- <auto-complete
:allowClear="true"
v-model="details.issuetype"
:data-source="issuetypeDataArr"
placeholder="请输入签单方式"
@select="issuetypeSelect"
@change="issuetypeChange"
/>
/> -->
<a-select
class="customer-input"
:default-value="details.issuetype"
@change="handleIssuetypeChange"
show-search
:filter-option="filterOption"
:dropdownMatchSelectWidth="false"
>
<a-select-option v-for="(issuetype, iIndex) in issuetypeSelectData" :key="iIndex" :value="iIndex" >
{{ issuetype.selectShowTab }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
@ -73,7 +85,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-select :default-value="details.nobill || 'THREE'" style="width: 120px" @change="handleChange">
<a-select :default-value="details.nobill || 'THREE'" @change="handleChange">
<a-select-option value="ONE"> ONE </a-select-option>
<a-select-option value="TWO"> TWO </a-select-option>
<a-select-option value="THREE"> THREE </a-select-option>
@ -95,7 +107,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-select :default-value="details.copynobilll || 'THREE'" style="width: 120px" @change="handleChange">
<a-select :default-value="details.copynobilll || 'THREE'" @change="handleChange">
<a-select-option value="ONE"> ONE </a-select-option>
<a-select-option value="TWO"> TWO </a-select-option>
<a-select-option value="THREE"> THREE </a-select-option>
@ -349,6 +361,7 @@ export default {
showKey: ['1'],
issuetypeData: [],
issueplaceData: [],
issuetypeSelectData: [],
prepardatData: [],
payableatData: [],
blfrtData: [],
@ -453,7 +466,7 @@ export default {
},
methods: {
init() {
// this.getIssuetypeList('')
this.getIssuetypeList('')
// this.getPortloadlist('', 'issueplace')
// this.getPortloadlist('', 'prepardat')
// this.getPortlist('', 'payableat')
@ -468,6 +481,14 @@ export default {
.then((res) => {
if (res.code === 200) {
this.issuetypeData = res.data
const arr = []
res.data.map((item, index) => {
arr.push({
...{ selectShowTab: item.cnName + ' / ' + item.enName },
...item
})
})
this.issuetypeSelectData = arr
this.$forceUpdate()
}
})
@ -482,6 +503,15 @@ export default {
issuetypeChange(value) {
this.getIssuetypeList(value)
},
handleIssuetypeChange (index) {
this.details.issuetype = this.issuetypeSelectData[index].enName
console.log(this.details.issuetype)
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
// - end
// - start

@ -5,7 +5,7 @@
<div class="left">
<a-button class="btn" type="primary" @click="addboxLine"></a-button>
<a-button class="btn" @click="removeLine"></a-button>
<a-button class="btn" type="primary" @click="openDialog" :disabled="tableData.length===0">多品名</a-button>
<a-button class="btn" type="primary" @click="openDialog" :disabled="tableData.length === 0">多品名</a-button>
<a-button class="btn" type="primary" @click="importYarn"></a-button>
<a-button class="btn" type="primary" @click="importWeight"></a-button>
</div>
@ -28,11 +28,9 @@
:checkbox-option="checkboxOption"
:clipboard-option="clipboardOption"
/>
<div class="table-no-data" v-if="tableData.length === 0">
暂无数据
</div>
<div class="table-no-data" v-if="tableData.length === 0"></div>
</div>
<div class="loading" v-else> ... </div>
<div class="loading" v-else> ...</div>
</a-card>
<a-modal
title="多品名维护"
@ -43,7 +41,7 @@
>
<div class="model-content">
<ve-table
style="width:100%"
style="width: 100%"
:columns="modelColumns"
:table-data="tableData"
:radio-option="radioOption"
@ -66,9 +64,7 @@
:checkbox-option="checkChildboxOption"
:clipboard-option="clipboardChildOption"
/>
<div class="table-no-data" v-if="childTableData.length === 0">
暂无数据
</div>
<div class="table-no-data" v-if="childTableData.length === 0"></div>
</div>
</div>
<template slot="footer">
@ -136,11 +132,9 @@ export default {
this.$forceUpdate()
}}
>
{
this.ctnList.map((item, index) => {
return (<a-select-option value={index}>{item.name}</a-select-option>)
})
}
{this.ctnList.map((item, index) => {
return <a-select-option value={index}>{item.name}</a-select-option>
})}
</a-select>
)
},
@ -195,14 +189,12 @@ export default {
this.$forceUpdate()
}}
>
{
this.packageList.map((item, index) => {
return (<a-select-option value={index}>{item.name}</a-select-option>)
})
}
{this.packageList.map((item, index) => {
return <a-select-option value={index}>{item.name}</a-select-option>
})}
</a-select>
)
}
},
},
{
field: 'kgs',
@ -256,7 +248,7 @@ export default {
key: 'weighkgs',
title: '称重重量',
align: 'left',
edit: true
edit: true,
},
],
modelColumns: [
@ -305,7 +297,7 @@ export default {
key: 'kindpkgs',
title: '包装',
align: 'left',
width: 130
width: 130,
},
{
field: 'weighkgs',
@ -359,21 +351,19 @@ export default {
this.$forceUpdate()
}}
>
{
this.packageList.map((item, index) => {
return (<a-select-option value={index}>{item.name}</a-select-option>)
})
}
{this.packageList.map((item, index) => {
return <a-select-option value={index}>{item.name}</a-select-option>
})}
</a-select>
)
}
},
},
{
field: 'weighkgs',
key: 'weighkgs',
title: '毛重',
align: 'left',
edit: true
edit: true,
},
{
field: 'cbm',
@ -408,13 +398,16 @@ export default {
tableData: [],
editOption: {
beforeCellValueChange: ({ row, column, changeValue }) => {
if (['pkgs', 'kgs', 'cbm', 'tareweight'].includes(column.field) && !/^\d+$/.test(changeValue)) {
if (
['pkgs', 'kgs', 'cbm', 'tareweight'].includes(column.field) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
) {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
});
maxCount: 3,
})
this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`)
row['cntrno'] = ''
setTimeout(() => {
@ -453,7 +446,8 @@ export default {
// }
// })
// this.tableData[nowIndex]['weighkgs'] = Number(this.tableData[nowIndex].kgs) + Number(this.tableData[nowIndex].tareweight)
row['weighkgs'] = Number(row['kgs']) + Number(row['tareweight'])
// row['weighkgs'] = Number(row['kgs']) + Number(row['tareweight'])
row['weighkgs'] = this.calc(Number(row['kgs']), Number(row['tareweight']), '+')
}
},
cellValueChange: ({ row, column }) => {
@ -462,13 +456,16 @@ export default {
},
editChildOption: {
beforeCellValueChange: ({ row, column, changeValue }) => {
if (['pkgs', 'kgs', 'cbm'].includes(column.field) && !/^\d+$/.test(changeValue)) {
if (
['pkgs', 'kgs', 'cbm'].includes(column.field) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
) {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
});
maxCount: 3,
})
this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`)
row['cntrno'] = ''
setTimeout(() => {
@ -537,74 +534,74 @@ export default {
cut: true,
delete: true,
beforeCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforeCopy');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforeCopy')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterCopy');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterCopy')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforePaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforePaste');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforePaste')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterPaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterPaste');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterPaste')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforeCut');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforeCut')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterCut');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterCut')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforeDelete');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforeDelete')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterDelete');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterDelete')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
},
clipboardChildOption:{
clipboardChildOption: {
copy: true,
paste: true,
cut: true,
delete: true,
beforeCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforeCopy');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforeCopy')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterCopy');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterCopy')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforePaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforePaste');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforePaste')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterPaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterPaste');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterPaste')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforeCut');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforeCut')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterCut');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterCut')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('beforeDelete');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('beforeDelete')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterDelete');
this.log({ data, selectionRangeIndexes, selectionRangeKeys });
console.log('afterDelete')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
},
tableLoaded: false,
@ -639,7 +636,7 @@ export default {
childTableData: [],
childModelSelect: null,
childModelSelectIndex: null,
selectChildArr: []
selectChildArr: [],
}
},
watch: {
@ -648,7 +645,7 @@ export default {
// console.log('detail', nval)
this.$emit('changeDetail', {
detail: nval,
type: 'goodsTable'
type: 'goodsTable',
})
},
deep: true,
@ -659,7 +656,7 @@ export default {
// console.log('table', nval)
},
deep: true,
}
},
},
created() {
@ -667,19 +664,19 @@ export default {
},
methods: {
init () {
init() {
if (Object.keys(this.details).length > 0) {
const arr = []
const totalCtnall = {}
this.details.ctnInputs.map((item, index) => {
arr.push({
...{ rowKey: index },
...item
...item,
})
if (!Object.keys(totalCtnall).includes(item.ctnall)) {
const cData = {
type: 'ctnall',
num: item.ctnnum
num: item.ctnnum,
}
this.$set(totalCtnall, item.ctnall, cData)
}
@ -698,29 +695,29 @@ export default {
this.getCtn()
this.getPackage()
},
getCtn () {
getCtn() {
GetCtn({
Name: ''
})
.then((res) => {
this.ctnList = res.data
})
.catch((err) => {
console.log(err)
Name: '',
})
.then((res) => {
this.ctnList = res.data
})
.catch((err) => {
console.log(err)
})
},
getPackage () {
getPackage() {
GetPackage({
Name: ''
})
.then((res) => {
this.packageList = res.data
})
.catch((err) => {
console.log(err)
Name: '',
})
.then((res) => {
this.packageList = res.data
})
.catch((err) => {
console.log(err)
})
},
enmuErrorLabel (val) {
enmuErrorLabel(val) {
switch (val) {
case 'cntrno':
return '箱型'
@ -749,11 +746,11 @@ export default {
tareweight: '',
weightype: '',
weighkgs: '',
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0,
}
this.tableData.push(data)
},
removeLine () {
removeLine() {
this.selectArr.map((item, index) => {
this.tableData.map((oitem, oindex) => {
if (item === oitem.rowKey) {
@ -769,9 +766,7 @@ export default {
this.moreVisible = true
},
//
handleModelSubmit() {
},
handleModelSubmit() {},
handleModelCancel() {
this.moreVisible = false
},
@ -780,14 +775,15 @@ export default {
this.$message.error('请选择数据')
}
const data = {
rowKey: this.childTableData.length > 0 ? Number(this.childTableData[this.childTableData.length - 1].rowKey) + 1 : 0,
rowKey:
this.childTableData.length > 0 ? Number(this.childTableData[this.childTableData.length - 1].rowKey) + 1 : 0,
pkgs: '',
kindpkgs: '',
weighkgs: '',
cbm: '',
hscode: this.details.hscode,
marks: this.details.marks,
description: this.details.marks
description: this.details.marks,
}
this.childTableData.push(data)
},
@ -810,55 +806,180 @@ export default {
},
//
importYarn () {
importYarn() {
if (!this.id) {
this.$message.error('请先保存订舱信息')
return false
}
GetYardData({
bookingId: this.id,
isWeb: false
})
.then((res) => {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
const _data = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: '',
cntrno: item.CNTRNO,
sealno: item.SEALNO,
pkgs: item.PKGS,
kindpkgs: item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: ''
}
addTable.push(_data)
})
this.tableData = [...this.tableData, ...addTable]
this.$forceUpdate()
} else {
this.$message.error(res.message)
}
})
.catch((err) => {
console.log(err)
isWeb: false,
})
.then((res) => {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
const _data = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: '',
cntrno: item.CNTRNO,
sealno: item.SEALNO,
pkgs: item.PKGS,
kindpkgs: item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: '',
}
addTable.push(_data)
})
this.tableData = [...this.tableData, ...addTable]
this.$forceUpdate()
} else {
this.$message.error(res.message)
}
})
.catch((err) => {
console.log(err)
})
},
importWeight () {
importWeight() {
if (!this.id) {
this.$message.error('请先保存订舱信息')
return false
}
GetYardData({
bookingId: this.id,
isWeb: false,
})
.then((res) => {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
const _data = {
rowKey: lastNum + index,
ctnall: '',
ctnnum: '',
cntrno: '',
sealno: '',
pkgs: '',
kindpkgs: '',
kgs: '',
cbm: '',
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: ''
}
addTable.push(_data)
})
this.tableData = [...this.tableData, ...addTable]
this.$forceUpdate()
} else {
this.$message.error(res.message)
}
})
.catch((err) => {
console.log(err)
})
},
log({ data, selectionRangeIndexes, selectionRangeKeys }) {
console.log('data::', data);
console.log('selectionRangeIndexes::', selectionRangeIndexes);
console.log('selectionRangeKeys::', selectionRangeKeys);
console.log('data::', data)
console.log('selectionRangeIndexes::', selectionRangeIndexes)
console.log('selectionRangeKeys::', selectionRangeKeys)
},
calc(num1, num2, calcStr) {
var str1, //
str2,
ws1 = 0, // ws1ws2 num
ws2 = 0, //
bigger, // biggersmaller0
smaller, // 1.001 + 2.03 2.0301001+2031.12*1.1112*111000112*11/1000=1.232
zeroCount, // 0
isExistDot1, //
isExistDot2,
sum,
beishu = 1
//
str1 = num1.toString()
str2 = num2.toString()
//
isExistDot1 = str1.indexOf('.') != -1 ? true : false
isExistDot2 = str2.indexOf('.') != -1 ? true : false
//
if (isExistDot1) {
ws1 = str1.split('.')[1].length
}
if (isExistDot2) {
ws2 = str2.split('.')[1].length
}
// ws1 ws2 num1 num2 ws1 ws2 undefined
// bigger smaller
bigger = ws1 > ws2 ? ws1 : ws2
smaller = ws1 < ws2 ? ws1 : ws2
switch (calcStr) {
// 0
// 1.001 + 2.03 2.0301001+203
case '+':
case '-':
case '/':
zeroCount = bigger - smaller
for (var i = 0; i < zeroCount; i++) {
if (ws1 == smaller) {
str1 += '0'
} else {
str2 += '0'
}
}
break
case '*':
//
bigger = bigger + smaller
break
default:
return '暂不支持的计算类型,现已支持的有加法、减法、乘法、除法'
break
}
//
str1 = str1.replace('.', '')
str2 = str2.replace('.', '')
// 1.001 1000 1001
for (var i = 0; i < bigger; i++) {
beishu *= 10 // beishu = beishu * 10;
}
num1 = parseInt(str1)
num2 = parseInt(str2)
//
switch (calcStr) {
case '+':
sum = (num1 + num2) / beishu
break
case '-':
sum = (num1 - num2) / beishu
break
case '*':
sum = (num1 * num2) / beishu
break
case '/':
sum = num1 / num2
/*
所以对数字进行放大对应倍数并进行补0操作后不用另对倍数做处理 */
break
default:
return '暂不支持的计算类型,现已支持的有加法、减法、乘法、除法'
}
return sum
},
},
}
@ -885,15 +1006,15 @@ export default {
}
}
.model-content{
.model-botton-box{
.model-content {
.model-botton-box {
margin: 40px 0;
.btn{
.btn {
margin-right: 10px;
}
}
}
.table-no-data{
.table-no-data {
width: 100%;
text-align: center;
line-height: 60px;

@ -117,7 +117,7 @@
style="overflow: visible"
>
<div class="yard-box" style="display: flex">
<auto-complete
<!-- <auto-complete
:allowClear="true"
v-model="details.yard"
class="customer-input"
@ -125,7 +125,20 @@
placeholder="请输入场站"
@select="yardSelect"
@change="yardChange"
/>
/> -->
<a-select
class="customer-input"
:default-value="details.yard"
@change="handleYardChange"
show-search
:filter-option="filterOption"
:dropdownMatchSelectWidth="false"
style="width:80px;"
>
<a-select-option v-for="(yard, yindex) in yardSelectData" :key="yindex" :value="yindex" >
{{ yard.selectShowTab }}
</a-select-option>
</a-select>
<i class="iconfont icon-touxiang" style="margin: 0 4px" @click="changeYard('content')"></i>
<i class="iconfont icon-bianji1" @click="changeYard('remark')"></i>
<div class="feeself">
@ -199,7 +212,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-date-picker format="YYYY-MM-DD HH:mm:ss" placeholder="预抵日期" v-model="details.eta">
<a-date-picker format="YYYY-MM-DD" placeholder="预抵日期" v-model="details.eta">
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
@ -212,7 +225,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-date-picker format="YYYY-MM-DD HH:mm:ss" placeholder="截港时间" v-model="details.closingdate">
<a-date-picker style="min-width:100px" show-time format="YYYY-MM-DD HH:mm:ss" placeholder="截港时间" v-model="details.closingdate">
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
@ -225,7 +238,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-date-picker format="YYYY-MM-DD HH:mm:ss" placeholder="截单时间" v-model="details.closedocdate">
<a-date-picker style="min-width:100px" show-time format="YYYY-MM-DD HH:mm:ss" placeholder="截单时间" v-model="details.closedocdate">
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
@ -238,7 +251,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-date-picker format="YYYY-MM-DD HH:mm:ss" placeholder="VGM时间" v-model="details.closevgmdate">
<a-date-picker style="min-width:100px" show-time format="YYYY-MM-DD HH:mm:ss" placeholder="VGM时间" v-model="details.closevgmdate">
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
@ -607,6 +620,7 @@ export default {
consigneeData: [], //
notifyData: [], //
yardData: [], //
yardSelectData: [],
portloadData: [], //
transportData: [], //
portdischargeData: [], //
@ -847,10 +861,10 @@ export default {
this.yardType = ''
},
init() {
this.getYardlist()
// this.getTemplate('', 'shipper')
// this.getTemplate('', 'consignee')
// this.getTemplate('', 'notify')
// this.getYardlist()
// this.getPortloadlist('', 'portload')
// this.getPortloadlist('', 'placereceipt')
// this.getPortlist('', 'transport')
@ -909,10 +923,19 @@ export default {
getYardlist(name = '') {
GetYardlist({
Name: name,
keyword: ''
})
.then((res) => {
if (res.code === 200) {
this.yardData = res.data
const arr = []
res.data.map((item, index) => {
arr.push({
...{ selectShowTab: item.name + ' / ' + item.code },
...item
})
})
this.yardSelectData = arr
this.$forceUpdate()
}
})
@ -927,7 +950,18 @@ export default {
this.details.yardid = this.yardData[index].code
},
yardChange(value) {
this.getYardlist(value)
// this.getYardlist(value)
},
handleYardChange (index) {
this.details.yard = this.yardSelectData[index].name
this.details.yardid = this.yardSelectData[index].code
console.log(this.details.yard, this.details.yardid)
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
// - end

@ -422,6 +422,10 @@ import {
BookingOrderPrint
} from '@/api/modular/main/BookingLedger'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN, DICT_TYPE_TREE_DATA } from '@/store/mutation-types'
export default {
props: {
details: {
@ -487,9 +491,15 @@ export default {
FnCilckTemplateType(type) {
BookingOrderPrint({ type, bookingId: this.id })
.then(res => {
if (res.success) {
this.$message.success('打印成功')
} else {
const exportName = new Date().getTime()
const link = document.createElement('a')
const blob = new Blob([res], { type: 'application/pdf' })
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.setAttribute('download', exportName + '.pdf')
document.body.appendChild(link)
link.click()
if (!res.success) {
this.$message.error(res.message)
}
})
@ -497,6 +507,7 @@ export default {
console.log(err)
})
},
refreshPage() {
this.$emit('refresh')
},
@ -889,7 +900,7 @@ export default {
}
}
.more-view {
width: 140px;
width: 150px;
.iconfont {
color: #2095f2;
}

@ -178,10 +178,7 @@
</div>
</template>
<script>
import { GetRemark, AddRemark, GetFile, GetBookingLog, GetLog } from '@/api/modular/main/BookingLedger'
import Vue from 'vue'
import { ACCESS_TOKEN, DICT_TYPE_TREE_DATA } from '@/store/mutation-types'
import axios from 'axios'
import { GetRemark, AddRemark, GetFile, GetBookingLog, GetLog, AddFile } from '@/api/modular/main/BookingLedger'
export default {
name: '',
@ -233,15 +230,8 @@ export default {
},
methods: {
getLocal() {
const dictTypeTree = Vue.ls.get(DICT_TYPE_TREE_DATA)
dictTypeTree.map((item, index) => {
if (item.code === 'booking_service_item') {
this.bookingServiceItem = item.children
}
if (item.code === 'booking_attach_type') {
this.bookingAttachType = item.children
}
})
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type')
},
// - start
getRemark() {
@ -341,28 +331,20 @@ export default {
formData.append('TypeCode', attachCode)
formData.append('TypeName', attachName)
this.uploading = true
const token = Vue.ls.get(ACCESS_TOKEN)
axios({
method: 'post',
url: process.env.VUE_APP_API_BASE_URL + '/BookingOrder/addFile',
headers: {
Authorization: 'Bearer ' + token,
'Content-Type': 'multipart/form-data',
},
data: formData,
})
AddFile(formData)
.then((res) => {
this.uploading = false
if (res.data.success) {
if (res.success) {
this.$message.success('上传成功')
this.getFile()
} else {
this.$message.error(res.data.message)
this.$message.error(res.message)
}
this.uploading = false
this.fileModelCancel()
})
.catch((err) => {
console.log(err)
this.$message.error(err.message)
})
},
// - end

Loading…
Cancel
Save