修改场站映射

szh_zidingyibiaoti
sunzehua 2 years ago
parent d200493d5f
commit 60a52d3f36

@ -639,7 +639,7 @@ export default {
return false
}
}
if (this.hasTableRules) {
if (this.hasTableRules && this.editDetails.carrierid !== 'GGPX') {
if (this.editDetails.ctnInputs.length === 0) {
this.$message.error('保存失败,箱信息未填写')
return false

@ -40,6 +40,24 @@
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="船公司" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
show-search
placeholder="请选择船公司"
v-decorator="['carrierCode']"
@search="CarrierHandleSearch"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in carrierCodeData" :key="item.code" :value="item.code">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="映射名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
@ -69,6 +87,7 @@
<script>
import { CommondbAddorupdatemappingyard, commondbYardlist } from '@/api/modular/main/CommondbYardlist'
import { commondbCarrierlist } from '@/api/modular/main/CommondbCtnlist'
import { commondbModules } from '@/api/modular/main/ShippingCompanyMapping'
export default {
data() {
@ -94,7 +113,8 @@ export default {
confirmLoading: false,
form: this.$form.createForm(this),
CodeData: [],
ModulesData: []
ModulesData: [],
carrierCodeData: []
}
},
mounted() {},
@ -102,8 +122,13 @@ export default {
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
CarrierHandleSearch(data) {
commondbCarrierlist({ KeyWord: data }).then((res) => {
this.carrierCodeData = res.data
})
},
handleSearch(data) {
commondbYardlist({ KeyWord: data }).then(res => {
commondbYardlist({ KeyWord: data }).then((res) => {
this.CodeData = res.data
console.log(this.CodeData)
})
@ -111,12 +136,15 @@ export default {
//
add(record) {
this.visible = true
commondbYardlist().then(res => {
commondbYardlist().then((res) => {
this.CodeData = res.data
})
commondbModules().then(res => {
commondbModules().then((res) => {
this.ModulesData = res.data
})
commondbCarrierlist().then((res) => {
this.carrierCodeData = res.data
})
},
/**
* 提交表单
@ -134,7 +162,7 @@ export default {
}
}
CommondbAddorupdatemappingyard(values)
.then(res => {
.then((res) => {
if (res.success) {
this.$message.success('新增成功')
this.confirmLoading = false
@ -144,7 +172,7 @@ export default {
this.$message.error(`新增失败,${res.message}`)
}
})
.finally(res => {
.finally((res) => {
this.confirmLoading = false
})
} else {

@ -40,6 +40,24 @@
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="船公司" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
show-search
placeholder="请选择船公司"
v-decorator="['carrierCode']"
@search="CarrierHandleSearch"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in carrierCodeData" :key="item.code" :value="item.code">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="映射名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
@ -69,6 +87,7 @@
<script>
import { CommondbAddorupdatemappingyard, commondbYardlist } from '@/api/modular/main/CommondbYardlist'
import { commondbCarrierlist } from '@/api/modular/main/CommondbCtnlist'
import { commondbModules } from '@/api/modular/main/ShippingCompanyMapping'
export default {
data() {
@ -96,7 +115,8 @@ export default {
form: this.$form.createForm(this),
data: {},
CodeData: [],
ModulesData: []
ModulesData: [],
carrierCodeData: []
}
},
mounted() {},
@ -105,11 +125,16 @@ export default {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
handleSearch(data) {
commondbYardlist({ KeyWord: data }).then(res => {
commondbYardlist({ KeyWord: data }).then((res) => {
this.CodeData = res.data
console.log(this.CodeData)
})
},
CarrierHandleSearch(data) {
commondbCarrierlist({ KeyWord: data }).then((res) => {
this.carrierCodeData = res.data
})
},
//
edit(record) {
this.data = record
@ -117,19 +142,23 @@ export default {
this.visible = true
const typeOption = this.$options
this.typeData = typeOption.filters['dictData']('edi_type')
commondbYardlist().then(res => {
commondbYardlist().then((res) => {
this.CodeData = res.data
})
commondbModules().then(res => {
commondbModules().then((res) => {
this.ModulesData = res.data
})
commondbCarrierlist().then((res) => {
this.carrierCodeData = res.data
})
setTimeout(() => {
this.form.setFieldsValue({
code: record.code,
module: record.module,
mapName: record.mapName,
mapCode: record.mapCode,
remark: record.remark
remark: record.remark,
carrierCode: record.carrierCode
})
console.log(this.form.getFieldsValue())
}, 100)
@ -152,7 +181,7 @@ export default {
values.gid = this.data.gid
console.log(values)
CommondbAddorupdatemappingyard(values)
.then(res => {
.then((res) => {
if (res.success) {
this.$message.success('编辑成功')
this.confirmLoading = false
@ -162,7 +191,7 @@ export default {
this.$message.error(`编辑失败,${res.message}`)
}
})
.finally(res => {
.finally((res) => {
this.confirmLoading = false
})
} else {

@ -124,6 +124,12 @@ export default {
width: '80',
dataIndex: 'module'
},
{
title: '船公司',
align: 'center',
width: '80',
dataIndex: 'carrierCode'
},
{
title: '映射名称',
align: 'center',
@ -162,14 +168,14 @@ export default {
this.FnGetData()
},
handleSearch(data) {
commondbYardlist({ Name: data }).then(res => {
commondbYardlist({ Name: data }).then((res) => {
this.WCodeData = res.data
console.log(this.CodeData)
})
},
FnCode(data) {
let RData = ''
this.CodeData.forEach(item => {
this.CodeData.forEach((item) => {
if (data == item.code) {
RData = item.name
}
@ -178,7 +184,7 @@ export default {
},
FnModule(data) {
let RData = ''
this.ModulesData.forEach(item => {
this.ModulesData.forEach((item) => {
if (data == item.code) {
RData = item.name
}
@ -192,18 +198,18 @@ export default {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
commondbYardlist().then(res => {
commondbYardlist().then((res) => {
this.CodeData = res.data
this.WCodeData = res.data
})
commondbModules().then(res => {
commondbModules().then((res) => {
this.ModulesData = res.data
})
},
FnGetData() {
if (this.queryParam.module) {
this.loading = true
CommondbPageMappingyardlist(this.queryParam).then(res => {
CommondbPageMappingyardlist(this.queryParam).then((res) => {
if (res.code == 200) {
this.loadData = res.data.items
this.queryParam.totalCount = res.data.totalCount

Loading…
Cancel
Save