船公司 模块 换下拉

szh_zidingyibiaoti
张同海 2 years ago
parent 28f4aa314c
commit 4a851c92bf

@ -20,10 +20,20 @@
</a-col>
<a-col :span="12">
<a-form-item label="船司代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入船司代码"
v-decorator="['carrierCode', { rules: [{ required: true, message: '请输入船司代码!' }] }]"
/>
<a-select
show-search
placeholder="请选择船公司"
v-decorator="['carrierCode', { rules: [{ required: true, message: '请选择船公司!' }] }]"
@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">
@ -36,10 +46,14 @@
</a-col>
<a-col :span="12">
<a-form-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入模块"
v-decorator="['module', { rules: [{ required: true, message: '请输入模块!' }] }]"
/>
<a-select
placeholder="请选择模块"
v-decorator="['module', { rules: [{ required: true, message: '请选择模块!' }] }]"
>
<a-select-option v-for="item in ModulesData" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
@ -54,7 +68,9 @@
</template>
<script>
import { commondbCarrierlist } from '@/api/modular/main/CommondbFrtlist'
import { CommondbSaveRelaPortCarrierLaneDto } from '@/api/modular/main/CommondbRelaPortCarrierLaneDto'
import { commondbModules } from '@/api/modular/main/ShippingCompanyMapping'
export default {
data() {
return {
@ -77,14 +93,27 @@ export default {
},
visible: false,
confirmLoading: false,
ModulesData: [],
carrierCodeData: [],
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
CarrierHandleSearch(data) {
commondbCarrierlist({ KeyWord: data }).then(res => {
this.carrierCodeData = res.data
})
},
//
add(record) {
this.visible = true
commondbModules().then(res => {
this.ModulesData = res.data
})
commondbCarrierlist().then(res => {
this.carrierCodeData = res.data
})
},
/**
* 提交表单

@ -20,10 +20,20 @@
</a-col>
<a-col :span="12">
<a-form-item label="船司代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入船司代码"
v-decorator="['carrierCode', { rules: [{ required: true, message: '请输入船司代码!' }] }]"
/>
<a-select
show-search
placeholder="请选择船公司"
v-decorator="['carrierCode', { rules: [{ required: true, message: '请选择船公司!' }] }]"
@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">
@ -36,10 +46,14 @@
</a-col>
<a-col :span="12">
<a-form-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入模块"
v-decorator="['module', { rules: [{ required: true, message: '请输入模块!' }] }]"
/>
<a-select
placeholder="请选择模块"
v-decorator="['module', { rules: [{ required: true, message: '请选择模块!' }] }]"
>
<a-select-option v-for="item in ModulesData" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
@ -54,6 +68,8 @@
</template>
<script>
import { commondbCarrierlist } from '@/api/modular/main/CommondbFrtlist'
import { commondbModules } from '@/api/modular/main/ShippingCompanyMapping'
import { CommondbSaveRelaPortCarrierLaneDto } from '@/api/modular/main/CommondbRelaPortCarrierLaneDto'
export default {
data() {
@ -77,16 +93,29 @@ export default {
},
visible: false,
confirmLoading: false,
ModulesData: [],
carrierCodeData: [],
form: this.$form.createForm(this)
}
},
mounted() {},
methods: {
CarrierHandleSearch(data) {
commondbCarrierlist({ KeyWord: data }).then(res => {
this.carrierCodeData = res.data
})
},
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
commondbModules().then(res => {
this.ModulesData = res.data
})
commondbCarrierlist().then(res => {
this.carrierCodeData = res.data
})
setTimeout(() => {
console.log(record)
this.form.setFieldsValue({

Loading…
Cancel
Save