修改问题

master
sunzehua 1 year ago
parent b3d01a7b61
commit ac4adae874

@ -1,7 +1,10 @@
<template>
<div class="main">
<div class="btn-list">
<a-button type="primary" v-if="details.bsstatus=='' || !details.bsstatus || details.bsstatus == '已录入' || details.bsstatus == '已驳回'" @click="handleSave"></a-button>
<a-button
type="primary"
v-if="details.bsstatus == '' || !details.bsstatus || details.bsstatus == '已录入' || details.bsstatus == '已驳回'"
@click="handleSave">保存</a-button>
<a-button type="primary" @click="handleCopy"></a-button>
<a-button type="primary">存为模板</a-button>
<a-button type="primary" v-if="details.bsstatus" @click="handleOpenStatus"></a-button>
@ -382,7 +385,7 @@
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cargoid" label="货物类型">
<selectView
type="cargoid"
:defaultVal="details.cargoid"
:defaultVal="details.cargoName"
searchApi="cargoData"
:searchQuery="{ name: '' }"
:showLabel="['name']"
@ -393,7 +396,14 @@
</a-col>
<a-col :span="12">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hscode" label="HS编码">
<a-input v-model="details.hscode" size="small" allow-clear placeholder="请输入HS编码" />
<a-input-number
:precision="1"
style="width: 115px;"
decimalSeparator="1"
v-model="details.hscode"
size="small"
allow-clear
placeholder="请输入HS编码" />
</a-form-item>
</a-col>
</a-row>
@ -407,7 +417,7 @@
has-feedback
prop="kgs">
<div class="line-box">
<a-input size="small" :allowClear="true" v-model="details.kgs" />
<a-input-number size="small" :allowClear="true" v-model="details.kgs" />
<i class="iconfont icon-bianji1 edit-icon" @click="editTextEntryModel('kgs')"></i>
<span class="unit">KGS</span>
</div>
@ -422,7 +432,7 @@
has-feedback
prop="cbm">
<div class="line-box">
<a-input size="small" :allowClear="true" v-model="details.cbm" />
<a-input-number size="small" :allowClear="true" v-model="details.cbm" />
<i class="iconfont icon-bianji1 edit-icon" @click="editTextEntryModel('cbm')"></i>
<span class="unit">CBM</span>
</div>
@ -458,7 +468,14 @@
has-feedback
prop="pkgs">
<div class="line-box">
<a-input :allowClear="true" size="small" v-model="details.pkgs" type="number" />
<a-input-number
:precision="1"
style="width: 115px;"
decimalSeparator="1"
:allowClear="true"
size="small"
v-model="details.pkgs"
type="number" />
<i class="iconfont icon-bianji1 edit-icon" @click="editTextEntryModel('pkgs')"></i>
</div>
</a-form-model-item>
@ -511,12 +528,7 @@
has-feedback
prop="tempset">
<div class="line-box">
<inputView
type="tempset"
:ishd="details.cargoid !== 'R'"
size="small"
:parentVal="details.tempset"
@getInputChange="inputChange" />
<a-input size="small" v-model="details.tempset" />
</div>
</a-form-model-item>
</a-col>
@ -542,7 +554,7 @@
:wrapperCol="wrapperCol"
has-feedback
prop="reeferf">
<inputView type="reeferf" size="small" :parentVal="details.reeferf" @getInputChange="inputChange" />
<a-input size="small" v-model="details.reeferf" />
</a-form-model-item>
</a-col>
</a-row>
@ -592,7 +604,42 @@
</a-form-model-item>
</a-col>
</a-row>
<a-row style="display: flex;" >
<a-row v-if="details.cargoid == 'O'">
<a-col :span="6">
<a-form-model-item
class="from-label"
label="长"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
prop="dunno">
<a-input size="small" v-model="details.dunno" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item
class="from-label"
label="宽"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
prop="dclass">
<a-input size="small" v-model="details.dclass" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item
class="from-label"
label="高"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
prop="linkman">
<a-input size="small" v-model="details.linkman" />
</a-form-model-item>
</a-col>
</a-row>
<a-row style="display: flex;">
<a-upload
:customRequest="customRequest"
:showUploadList="false"
@ -720,12 +767,7 @@
</div>
</div>
</a-modal>
<a-modal
title="状态历史"
:maskClosable="false"
:width="800"
:visible="statusFlag"
@cancel="statusFlag=false">
<a-modal title="状态历史" :maskClosable="false" :width="800" :visible="statusFlag" @cancel="statusFlag = false">
<div>
<vxe-table border ref="xTable" :data="statusList">
<vxe-column field="status" title="业务状态">
@ -754,6 +796,19 @@ import {
BookingCustomerOrderDelete, BookingCustomerOrderSubmit, BookingCustomerOrderCancelSubmit
} from '@/api/modular/main/BookingLedger'
import { mapGetters } from 'vuex'
const startDetails = {
shipper: '',
serviceList: [],
service: 'CY-CY',
portloadid: 'CNTAO',
portload: 'QINGDAO',
blfrt: 'FREIGHT PREPAID',
notifyparty: '',
consignee: '',
cargoid: '',
ctnList: [],
tempid: 'C'
}
export default {
components: {
XCard,
@ -835,6 +890,7 @@ export default {
modelconfirm: false,
modelVisible: false,
statusFlag: false,
saveFlag: false,
textEntryModalVisible: false,
textEntryModalTitle: '',
historyData: {},
@ -869,30 +925,16 @@ export default {
details: {
shipper: '',
serviceList: [],
service: 'CY-CY',
portloadid: 'CNTAO',
portload: 'QINGDAO',
blfrt: 'FREIGHT PREPAID',
notifyparty: '',
consignee: '',
cargoid: '',
ctnList: []
},
rules: {
linkman: [
{ required: true, message: '请输入', trigger: 'blur' }
],
dclass: [
{ required: true, message: '请输入', trigger: 'blur' }
],
dunno: [
{ required: true, message: '请输入', trigger: 'blur' }
],
tempset: [
{ required: true, message: '请输入', trigger: 'blur' }
],
tempid: [
{ required: true, message: '请选择', trigger: 'blur' }
],
reeferf: [
{ required: true, message: '请输入', trigger: 'blur' }
]
},
loading: false
@ -990,13 +1032,7 @@ export default {
this.getDetail()
} else {
this.isAdd = true
this.details = {
shipper: '',
serviceList: [],
notifyparty: '',
consignee: '',
ctnList: []
}
this.details = JSON.parse(JSON.stringify(startDetails))
this.fileList = []
}
},
@ -1043,6 +1079,20 @@ export default {
BookingCustomerOrderGet(data).then(res => {
if (res.success) {
this.loading = false
if (res.data.cargoid) {
if (res.data.cargoid === 'S') {
res.data.cargoName = 'S 普通货'
}
if (res.data.cargoid === 'R') {
res.data.cargoName = 'R 冻柜'
}
if (res.data.cargoid === 'D') {
res.data.cargoName = 'D 危险品'
}
if (res.data.cargoid === 'O') {
res.data.cargoName = 'O 超限箱'
}
}
this.details = res.data
if (this.details.serviceItemList && this.details.serviceItemList.length > 0) {
this.details.serviceList = this.details.serviceItemList.map(item => {
@ -1074,97 +1124,104 @@ export default {
})
},
handleSave() {
this.$refs.basicFrom.validate(valid => {
if (valid) {
const data = {
...this.details
}
if (!this.details.serviceList) {
this.details.serviceList = []
}
if (this.details.serviceList.length > 0) {
const arr = []
this.options.forEach(item => {
this.details.serviceList.forEach(ite => {
if (item.code === ite) {
arr.push({
code: item.code,
value: item.name
})
}
})
})
data.serviceItemList = arr
} else {
data.serviceItemList = []
}
if (!this.isCopy) {
const filesArr = []
const tempFileNamesArr = []
if (this.fileList.length > 0) {
this.fileList.forEach(item => {
if (item.id.indexOf('\\') != -1) {
tempFileNamesArr.push(item.id)
} else {
filesArr.push(item.id)
}
})
if (!this.saveFlag) {
this.$refs.basicFrom.validate(valid => {
if (valid) {
const data = {
...this.details
}
data.files = filesArr
data.tempFileNames = tempFileNamesArr
}
if (data.ctnList.length > 0) {
data.ctnList.forEach(item => {
delete item._X_ROW_KEY
delete item.oper
this.ctnallList.forEach(ite => {
if (ite.code === item.ctncode) {
item.ctnall = ite.name
}
if (!this.details.serviceList) {
this.details.serviceList = []
}
if (this.details.serviceList.length > 0) {
const arr = []
this.options.forEach(item => {
this.details.serviceList.forEach(ite => {
if (item.code === ite) {
arr.push({
code: item.code,
value: item.name
})
}
})
})
if (this.isCopy) {
delete item.id
data.serviceItemList = arr
} else {
data.serviceItemList = []
}
if (!this.isCopy) {
const filesArr = []
const tempFileNamesArr = []
if (this.fileList.length > 0) {
this.fileList.forEach(item => {
if (item.id.indexOf('\\') != -1) {
tempFileNamesArr.push(item.id)
} else {
filesArr.push(item.id)
}
})
}
})
}
if (data.files && Object.values(data.files).length === 0) {
delete data.files
}
if (!data.id && !this.isCopy) {
data.id = this.id
}
this.loading = true
BookingCustomerOrderSave(data).then(res => {
if (res.success) {
this.$message.success('保存成功')
this.loading = false
this.id = res.data.id
this.getDetail()
setTimeout(() => {
if (this.isCopy || this.isAdd) {
this.$router.replace({
name: 'BookingCustomerDetail',
query: {
id: res.data.id,
noOpenTab: true
data.files = filesArr
data.tempFileNames = tempFileNamesArr
}
if (data.ctnList.length > 0) {
data.ctnList.forEach(item => {
delete item._X_ROW_KEY
delete item.oper
this.ctnallList.forEach(ite => {
if (ite.code === item.ctncode) {
item.ctnall = ite.name
}
})
if (this.isCopy) {
this.isCopy = false
delete item.id
}
}
}, 500);
} else {
this.loading = false
this.$message.error(res.message)
})
}
})
} else {
this.$message.warning('请检查必填项')
}
console.log(valid)
})
if (data.files && Object.values(data.files).length === 0) {
delete data.files
}
if (!data.id && !this.isCopy) {
data.id = this.id
}
this.loading = true
this.saveFlag = true
BookingCustomerOrderSave(data).then(res => {
if (res.success) {
this.$message.success('保存成功')
setTimeout(() => {
this.saveFlag = false
}, 5000);
this.loading = false
this.id = res.data.id
this.getDetail()
setTimeout(() => {
if (this.isCopy || this.isAdd) {
this.$router.replace({
name: 'BookingCustomerDetail',
query: {
id: res.data.id,
noOpenTab: true
}
})
if (this.isCopy) {
this.isCopy = false
}
}
}, 500);
} else {
this.loading = false
this.saveFlag = false
this.$message.error(res.message)
}
})
} else {
this.$message.warning('请检查必填项')
this.saveFlag = false
}
})
}
},
handleDelete() {
BookingCustomerOrderDelete([this.id]).then(res => {
@ -1321,7 +1378,7 @@ export default {
this.$forceUpdate()
},
handlePushCtn() {
const data = { oper: '' }
const data = { oper: '', ctnnum: 1 }
this.details.ctnList.push(data)
},
filterOption1(input, option) {
@ -1406,7 +1463,34 @@ export default {
this.details.goodsname = res.goodsNameEN || ''
} else if (type === 'cargoid') {
this.details.cargoid = res.code || ''
console.log(res)
this.details.cargoName = res.name || ''
if (this.details.cargoid === 'D') {
this.rules = {
linkman: [
{ required: true, message: '请输入', trigger: 'blur' }
],
dclass: [
{ required: true, message: '请输入', trigger: 'blur' }
],
dunno: [
{ required: true, message: '请输入', trigger: 'blur' }
]
}
}
if (this.details.cargoid === 'R') {
this.rules = {
tempset: [
{ required: true, message: '请输入', trigger: 'blur' }
],
tempid: [
{ required: true, message: '请选择', trigger: 'blur' }
],
reeferf: [
{ required: true, message: '请输入', trigger: 'blur' }
]
}
}
this.$refs.basicFrom.clearValidate()
this.$forceUpdate()
} else if (type === 'carrierid') {
this.details.carrier = res.enName || ''

@ -488,7 +488,7 @@ export default {
ResetType: true,
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
advanced: false,
formData: formInitData,
formData: JSON.parse(JSON.stringify(initData.condAllData)),
formRes: {},
searchData: { multisort: [] },
formAllData: null,
@ -885,9 +885,6 @@ export default {
const $data = {}
res.data.map((item, index) => {
switch (item.type) {
case 'booking_customer_list_cond':
this.$set($data, 'booking_customer_list_cond', item)
break
case 'booking_customer_list_sort':
this.setSort(item)
break

@ -5,41 +5,30 @@ export default {
{
field: 'bsstatus',
label: 'bsstatus',
width: 160,
title: '业务状态',
showHeaderOverflow: true,
showOverflow: false,
sortable: true,
slots: { default: 'bsstatusname' }
},
{ field: 'bookingno', label: 'bookingno', width: 160, title: '订舱编号', showHeaderOverflow: true, sortable: true },
{ field: 'carrier', width: 120, title: '船公司', showHeaderOverflow: true, sortable: true },
{ field: 'bookingno', label: 'bookingno', title: '订舱编号', showHeaderOverflow: true, sortable: true },
{ field: 'carrier', title: '船公司', showHeaderOverflow: true, sortable: true },
{
field: 'cntrtotal',
label: 'CNTRTOTAL',
width: 120,
title: '箱型*箱量',
showHeaderOverflow: true,
sortable: true
},
{
field: 'bookstatus',
label: 'BOOKSTATUS',
minWidth: 140,
title: '运踪',
showHeaderOverflow: true,
slots: { default: 'bookstatus' }
},
{
field: 'etd',
label: 'ETD',
width: 110,
title: '开船日期',
showHeaderOverflow: true,
sortable: true,
slots: { default: 'etd' }
},
{ field: 'blfrt', label: 'BLFRT', width: 120, title: '付费方式', showHeaderOverflow: true, sortable: true },
{ field: 'blfrt', label: 'BLFRT', title: '付费方式', showHeaderOverflow: true, sortable: true },
{ field: 'cargoid', label: 'CARGOID', width: 120, title: '货物标识', showHeaderOverflow: true, sortable: true },
{ field: 'vessel', label: 'VESSEL', width: 120, title: '船名', showHeaderOverflow: true, sortable: true },
{ field: 'voyno', label: 'VOYNO', width: 120, title: '航次', showHeaderOverflow: true },
@ -477,49 +466,23 @@ export default {
],
// ==== 表单部分 ====
condAllData: [
{ title: '订舱编号', align: 'center', width: 160, label: 'bookingno', type: 'input' },
{
title: '船公司',
align: 'center',
width: 120,
label: 'CARRIER',
type: 'select',
showLabel: 'enName',
showLabel2: 'cnName'
},
{
title: '场站',
align: 'center',
width: 120,
label: 'YARDID',
type: 'select',
showLabel: 'code',
showLabel2: 'name'
},
{ title: '目的港', align: 'center', width: 120, label: 'DESTINATION', type: 'complete', showLabel: 'enName' },
{ title: '开船日期', align: 'center', width: 160, label: 'ETD', type: 'dateRange', resLabel: ['etdStart', 'etdEnd'] },
{ title: '订舱日期', align: 'center', width: 160, label: 'time', type: 'dateRange', resLabel: ['createdTimeStart', 'createdTimeEnd'] },
{ title: '船名', align: 'center', width: 120, label: 'VESSEL', type: 'complete', showLabel: 'name' },
{ title: '航次', align: 'center', width: 120, label: 'VOYNO', type: 'input' },
{ title: '订舱公司', align: 'center', width: 120, label: 'bookingTenantName', type: 'input' },
{
title: '业务状态',
align: 'center',
width: 160,
width: 120,
label: 'bsStatusList',
type: 'select',
showLabel: 'name',
data: [
{ name: 'ONE' },
{ name: 'TWO' },
{ name: 'THREE' },
{ name: 'FOUR' },
{ name: 'FIVE' },
{ name: 'SIX' },
{ name: 'SEVEN' },
{ name: 'EIGHT' },
{ name: 'NINE' },
{ name: 'TEN' }
{ name: '已审核' },
{ name: '已驳回' },
{ name: '已提交' },
{ name: '已录入' }
]
}
},
{ title: '订舱日期', align: 'center', width: 160, label: 'time', type: 'dateRange', resLabel: ['createdTimeStart', 'createdTimeEnd'] },
{ title: '开船日期', align: 'center', width: 160, label: 'ETD', type: 'dateRange', resLabel: ['etdStart', 'etdEnd'] },
{ title: '箱型', align: 'center', width: 120, label: 'CNTRTOTAL', type: 'select', showLabel: 'name' }
]
}

@ -275,10 +275,31 @@ export default {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
handleSelectChange(e) {
this.$emit('change', {
form: this.labelData,
value: this.dataList[e][this.labelData.showLabel]
})
if (e) {
if (this.labelData.label === 'bsStatusList') {
this.$emit('change', {
form: this.labelData,
value: [this.dataList[e][this.labelData.showLabel]]
})
} else {
this.$emit('change', {
form: this.labelData,
value: this.dataList[e][this.labelData.showLabel]
})
}
} else {
if (this.labelData.label === 'bsStatusList') {
this.$emit('change', {
form: this.labelData,
value: []
})
} else {
this.$emit('change', {
form: this.labelData,
value: ''
})
}
}
},
handleSelectChangeTree(e) {
this.$emit('change', {
@ -308,7 +329,8 @@ export default {
'taskCategory',
'taskSource',
'taskType',
'OP'
'OP',
'bsStatusList'
].includes(this.labelData.label)
) {
this.dataList = this.emnuData(this.labelData.label)
@ -347,6 +369,8 @@ export default {
return this.labelData.data
case 'taskCategory':
return this.labelData.data
case 'bsStatusList':
return this.labelData.data
case 'taskSource':
return this.labelData.data
case 'OrgSale':

Loading…
Cancel
Save