修改BUG

dev
lilu 2 years ago
parent 499cd94813
commit b1884866ee

@ -178,6 +178,8 @@ export default {
data.shipper = ''
data.consignee = ''
data.notifyparty = ''
data.pid = this.$route.query.id
data.id = 0
if (!data.bookingEDIExt) {
data.bookingEDIExt = {
weiTuoFang: '',
@ -211,7 +213,8 @@ export default {
// this.init()
},
saveFun () {
if (this.editDetails.id !== 0) {
debugger
if (this.editDetails.id !== 0 && Number(this.editDetails.id) !== Number(this.$route.query.id)) {
this.bookingOrderUpdate()
} else {
this.bookingOrderAdd()
@ -249,12 +252,18 @@ export default {
}
let data = JSON.parse(JSON.stringify(this.editDetails))
delete data.isNoSave
data.pid = this.$route.query.id
data.id = 0
data.ctnInputs.map((item, index) => {
item.id = 0
})
BookingOrderAdd(data)
.then((res) => {
if (res.success) {
this.sedOrderList[this.editIndex].isNoSave = false
this.editDetails.isNoSave = false
this.sedOrderList[this.editIndex].id = res.data
debugger
this.$message.success('保存成功')
this.$emit('changeHB', this.sedOrderList)
this.$forceUpdate()
@ -288,6 +297,8 @@ export default {
const _data = JSON.parse(JSON.stringify(this.editDetails))
_data.isNoSave = true
_data.hblno = ''
_data.pid = this.$route.query.id
_data.id = 0
if (!_data.bookingEDIExt) {
_data.bookingEDIExt = {
weiTuoFang: '',

@ -108,6 +108,7 @@ import {
BookingOrderAddOrUpdate
} from '@/api/modular/main/BookingLedger'
import { mapActions, mapGetters } from 'vuex'
import { string } from 'clipboard'
const initDetail = {
id: 0,
parentId: 0,
@ -571,7 +572,11 @@ export default {
// this.init()
this.$forceUpdate()
} else {
if (typeof (res.message) === 'string') {
this.$message.error(res.message)
} else {
this.$message.error('保存失败')
}
}
})
.catch(err => {
@ -598,7 +603,11 @@ export default {
})
this.$forceUpdate()
} else {
if (typeof (res.message) === 'string') {
this.$message.error(res.message)
} else {
this.$message.error('保存失败')
}
}
})
.catch(err => {
@ -923,7 +932,7 @@ export default {
// margin-top: 4px !important;
}
.ant-form-item-label{
line-height: 30px !important;
// line-height: 30px !important;
// border: 1px solid #f00;
}
.ant-form-item-control-wrapper{

@ -120,9 +120,8 @@ export default {
renderBodyCell: ({ row, column, rowIndex }, h) => {
return (
<a-select
show-search
value={row['ctnall']}
option-filter-prop="children"
allow-clear={true}
style="width: 120px"
on-change={val => {
const data = this.ctnList[val]
@ -177,8 +176,8 @@ export default {
renderBodyCell: ({ row, column, rowIndex }, h) => {
return (
<a-select
show-search
value={row['kindpkgs']}
allow-clear={true}
defaultValue={row['kindpkgs']}
option-filter-prop="children"
style="width: 120px"
on-change={val => {
@ -413,22 +412,63 @@ export default {
this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`)
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
return false
}
if (column.field === 'cntrno') {
const res = this.checkCntrno(changeValue)
if (res !== '') {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
})
this.$message.error(res)
row['cntrno'] = ''
// row['cntrno'] = ''
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
return false
}
}
},
afterCellValueChange: ({ row, column, changeValue }) => {
if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(column.field)) {
changeValue = changeValue + ''
const valIndex = changeValue.indexOf('.') + 1
const valCount = changeValue.length - valIndex
console.log(valCount)
// 4
if (valCount > 4) {
const height = document.body.clientHeight - 100
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3
})
this.$message.error('仅支持小数点后四位')
row[column.field] = changeValue.substr(0, valIndex + 4)
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
}
}
if (column.field === 'pkgs') {
let num = 0
this.tableData.map((item, index) => {
@ -460,8 +500,13 @@ 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'] = this.calc(Number(row['kgs']), Number(row['tareweight']), '+')
const kgsVal = row['weighkgs'] + ''
const kgsIndex = kgsVal.indexOf('.') + 1
const kgsCount = kgsVal.length - kgsIndex
if (kgsCount > 4) {
row['weighkgs'] = kgsVal.substr(0, kgsIndex + 4)
}
}
},
cellValueChange: ({ row, column }) => {
console.log('编辑', row, column)
@ -483,6 +528,11 @@ export default {
row['cntrno'] = ''
setTimeout(() => {
this.$message.destroy()
this.$message.config({
top: `100px`,
duration: 2,
maxCount: 3
})
}, 2000)
return false
}
@ -769,6 +819,7 @@ export default {
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
}
this.tableData.push(data)
console.log('== 新增 ==', this.tableData)
},
removeLine() {
this.selectArr.map((item, index) => {
@ -886,13 +937,33 @@ export default {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
const cntrnoArr = []
this.tableData.map((item, index) => {
if (!item.cntrno) {
delete this.tableData[index]
// delete this.tableData[index]
this.tableData.splice(index, 1)
} else {
cntrnoArr.push(item.cntrno)
}
})
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
if (cntrnoArr.includes(item.CNTRNO)) {
this.tableData[cntrnoArr.indexOf(item.CNTRNO)] = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
cntrno: item.CNTRNO,
sealno: item.SEALNO,
pkgs: item.PKGS,
kindpkgs: item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weightype,
weighkgs: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weighkgs
}
} else {
const _data = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
@ -908,6 +979,7 @@ export default {
weighkgs: ''
}
addTable.push(_data)
}
})
this.tableData = [...this.tableData, ...addTable]

@ -34,9 +34,10 @@
<div class="bottom">
<a-textarea
id="shipper-scroll"
v-model="details.shipper"
:defaultValue="details.shipper"
:auto-size="{ minRows: 2, maxRows: 5 }"
style="height: 100px"
@blur="textareaChange($event, 'shipper')"
/>
<div
class="line-count"
@ -72,9 +73,10 @@
<div class="bottom">
<a-textarea
id="consignee-scroll"
v-model="details.consignee"
:defaultValue="details.consignee"
:auto-size="{ minRows: 2, maxRows: 5 }"
style="height: 100px"
@blur="textareaChange($event, 'consignee')"
/>
<div
class="line-count"
@ -108,9 +110,10 @@
<div class="bottom">
<a-textarea
id="notifyparty-scroll"
v-model="details.notifyparty"
:defaultValue="details.notifyparty"
:auto-size="{ minRows: 2, maxRows: 5 }"
style="height: 100px"
@blur="textareaChange($event, 'notifyparty')"
/>
<div
class="line-count"
@ -123,7 +126,7 @@
</div>
</a-col>
<a-col :xs="24" :sm="24" :md="24" :lg="14" :xl="12">
<a-form>
<a-form :selfUpdate="true">
<a-row :gutter="16">
<a-col :span="12">
<a-form-item
@ -298,193 +301,193 @@
<a-col :span="12">
<a-form-item
class="from-label"
label="装货港"
label="收货代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.portload"
v-model="details.placereceiptid"
class="customer-input"
:data-source="portloadDataArr"
:data-source="placereceiptDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '300px'}"
@select="portloadSelect"
@change="portloadChange"
@focus="portloadChange"
@select="placereceiptSelect"
@change="placereceiptChange"
@focus="placereceiptChange"
></auto-complete>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="装货港代码"
label="收货地"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.portloadid" />
<a-input :allowClear="true" v-model="details.placereceipt" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="中转港"
label="装货港代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.transport"
v-model="details.portloadid"
class="customer-input"
:data-source="transportDataArr"
:data-source="portloadDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '300px'}"
@select="transportSelect"
@change="transportChange"
@focus="transportChange"
/>
@select="portloadSelect"
@change="portloadChange"
@focus="portloadChange"
></auto-complete>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="中转港代码"
label="装货港"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.transportid" />
<a-input :allowClear="true" v-model="details.portload" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="卸货港"
label="中转港代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.portdischarge"
v-model="details.transportid"
class="customer-input"
:data-source="portdischargeDataArr"
:data-source="transportDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '300px'}"
@select="portdischargeSelect"
@change="portdischargeChange"
@focus="portdischargeChange"
@select="transportSelect"
@change="transportChange"
@focus="transportChange"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="卸货港代码"
label="中转港"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.portdischargeid" />
<a-input :allowClear="true" v-model="details.transport" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="目的地"
label="卸货港代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.destination"
v-model="details.portdischargeid"
class="customer-input"
:data-source="destinationDataArr"
:data-source="portdischargeDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '300px'}"
@select="destinationSelect"
@change="destinationChange"
@focus="destinationChange"
@select="portdischargeSelect"
@change="portdischargeChange"
@focus="portdischargeChange"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="目的代码"
label="卸货港"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.destinationid" />
<a-input :allowClear="true" v-model="details.portdischarge" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="交货地"
label="目的代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.placedelivery"
v-model="details.destinationid"
class="customer-input"
:data-source="placedeliveryDataArr"
:data-source="destinationDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '300px'}"
@select="placedeliverySelect"
@change="placedeliveryChange"
@focus="placedeliveryChange"
@select="destinationSelect"
@change="destinationChange"
@focus="destinationChange"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="交货代码"
label="目的地"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.placedeliveryid" />
<a-input :allowClear="true" v-model="details.destination" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="收货地"
label="交货代码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<auto-complete
:allowClear="true"
v-model="details.placereceipt"
v-model="details.placedeliveryid"
class="customer-input"
:data-source="placereceiptDataArr"
:data-source="placedeliveryDataArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '300px'}"
@select="placereceiptSelect"
@change="placereceiptChange"
@focus="placereceiptChange"
></auto-complete>
@select="placedeliverySelect"
@change="placedeliveryChange"
@focus="placedeliveryChange"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
class="from-label"
label="收货代码"
label="交货地"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.placereceiptid" />
<a-input :allowClear="true" v-model="details.placedelivery" />
</a-form-item>
</a-col>
<a-col :span="12">
@ -495,7 +498,7 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.pkgs" />
<a-input :allowClear="true" v-model="details.pkgs" type="number"/>
</a-form-item>
</a-col>
<a-col :span="12">
@ -527,7 +530,9 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.kgs" />
<div class="line-box">
<a-input :allowClear="true" v-model="details.kgs" /><span class="unit">KGS</span>
</div>
</a-form-item>
</a-col>
<a-col :span="12">
@ -538,7 +543,9 @@
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :allowClear="true" v-model="details.cbm" />
<div class="line-box">
<a-input :allowClear="true" v-model="details.cbm" /><span class="unit">CBM</span>
</div>
</a-form-item>
</a-col>
</a-row>
@ -1395,6 +1402,10 @@ export default {
this.details[type] = subValue
this.$forceUpdate()
},
textareaChange (e, type) {
this.details[type] = e.target.value
console.log(type, this.details[type])
}
}
}
@ -1572,6 +1583,17 @@ export default {
border-bottom: none;
}
.line-box{
display: flex;
span.unit{
font-size: 12px;
color: #999;
display: inline-block;
text-align: center;
line-height: 28px;
padding-left: 5px;
}
}
@media (max-width: 1700px) {
.feeself{
top: 15px !important;

@ -69,7 +69,7 @@
<!-- 弹窗部分 start -->
<a-modal
:title="emnuHeader(modelType)"
:width="1200"
:width="['bookingSpace', 'cutOff'].includes(modelType) ? 600 : 1200"
:visible="bookingModelvisible"
:confirmLoading="bookingModelconfirm"
:maskClosable="false"
@ -79,7 +79,7 @@
<template v-if="['bookingSpace', 'cutOff'].includes(modelType)">
<a-form>
<a-row :gutter="16">
<a-col :span="11" class="book-model-box">
<a-col :span="24" class="book-model-box">
<a-checkbox class="book-check" @change="bookingCheckChange" />
<a-form-item
label="使用货代代码"
@ -90,17 +90,17 @@
<a-input :allowClear="true" v-model="bookingModelFrom.forwarderCode" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-col :span="24">
<a-form-item
label="货代称呼"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
<a-input :allowClear="true" v-model="bookingModelFrom.forwarderName" />
</a-form-item>
</a-col>
<a-col :span="10">
<a-col :span="24">
<a-form-item
label="文件功能"
:labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
@ -1449,7 +1449,7 @@ export default {
/deep/ .ant-form-file {
.ant-form-item-label {
margin-top: -5px;
margin-left: 12px;
margin-right: 12px;
}
}
/*弹窗按钮颜色修改 */

Loading…
Cancel
Save