修改场站映射

szh_zidingyibiaoti
sunzehua 2 years ago
parent d200493d5f
commit 60a52d3f36

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

@ -40,6 +40,24 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </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-col :span="12">
<a-form-item label="映射名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="映射名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-input
@ -69,6 +87,7 @@
<script> <script>
import { CommondbAddorupdatemappingyard, commondbYardlist } from '@/api/modular/main/CommondbYardlist' import { CommondbAddorupdatemappingyard, commondbYardlist } from '@/api/modular/main/CommondbYardlist'
import { commondbCarrierlist } from '@/api/modular/main/CommondbCtnlist'
import { commondbModules } from '@/api/modular/main/ShippingCompanyMapping' import { commondbModules } from '@/api/modular/main/ShippingCompanyMapping'
export default { export default {
data() { data() {
@ -94,7 +113,8 @@ export default {
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
CodeData: [], CodeData: [],
ModulesData: [] ModulesData: [],
carrierCodeData: []
} }
}, },
mounted() {}, mounted() {},
@ -102,8 +122,13 @@ export default {
filterOption(input, option) { filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
CarrierHandleSearch(data) {
commondbCarrierlist({ KeyWord: data }).then((res) => {
this.carrierCodeData = res.data
})
},
handleSearch(data) { handleSearch(data) {
commondbYardlist({ KeyWord: data }).then(res => { commondbYardlist({ KeyWord: data }).then((res) => {
this.CodeData = res.data this.CodeData = res.data
console.log(this.CodeData) console.log(this.CodeData)
}) })
@ -111,12 +136,15 @@ export default {
// //
add(record) { add(record) {
this.visible = true this.visible = true
commondbYardlist().then(res => { commondbYardlist().then((res) => {
this.CodeData = res.data this.CodeData = res.data
}) })
commondbModules().then(res => { commondbModules().then((res) => {
this.ModulesData = res.data this.ModulesData = res.data
}) })
commondbCarrierlist().then((res) => {
this.carrierCodeData = res.data
})
}, },
/** /**
* 提交表单 * 提交表单
@ -134,7 +162,7 @@ export default {
} }
} }
CommondbAddorupdatemappingyard(values) CommondbAddorupdatemappingyard(values)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.$message.success('新增成功') this.$message.success('新增成功')
this.confirmLoading = false this.confirmLoading = false
@ -144,7 +172,7 @@ export default {
this.$message.error(`新增失败,${res.message}`) this.$message.error(`新增失败,${res.message}`)
} }
}) })
.finally(res => { .finally((res) => {
this.confirmLoading = false this.confirmLoading = false
}) })
} else { } else {

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

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

Loading…
Cancel
Save