|
@@ -16,27 +16,27 @@
|
|
|
@submit="handleSubmit">
|
|
|
<a-form-item label="快递公司" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-select
|
|
|
- id="logistics-company"
|
|
|
+ id="logistics-expressName"
|
|
|
allowClear
|
|
|
v-decorator="[
|
|
|
- 'formData.company',
|
|
|
- { initialValue: formData.company,
|
|
|
+ 'formData.expressName',
|
|
|
+ { initialValue: formData.expressName,
|
|
|
rules: [{ required: true, message: '请选择快递公司' }] },
|
|
|
]"
|
|
|
placeholder="请选择快递公司"
|
|
|
>
|
|
|
- <a-select-option v-for="(item,index) in expressCompany" :key="index" :value="item.deliveryTimeRuleNo">
|
|
|
- {{ item.name }}
|
|
|
+ <a-select-option v-for="(item,index) in expressCompany" :key="index" :value="item.expressName">
|
|
|
+ {{ item.expressName }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="运单编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-input
|
|
|
- id="logistics-orderNo"
|
|
|
+ id="logistics-expressNum"
|
|
|
:maxLength="30"
|
|
|
v-decorator="[
|
|
|
- 'formData.orderNo',
|
|
|
- { initialValue: formData.orderNo, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入运单编号' }] }
|
|
|
+ 'formData.expressNum',
|
|
|
+ { initialValue: formData.expressNum, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入运单编号' }] }
|
|
|
]"
|
|
|
placeholder="请输入运单编号(最多30个字符)"
|
|
|
allowClear />
|
|
@@ -59,10 +59,6 @@ export default {
|
|
|
openModal: { // 弹框显示状态
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- },
|
|
|
- orderNo: {
|
|
|
- type: [Number, String],
|
|
|
- default: ''
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
@@ -73,28 +69,23 @@ export default {
|
|
|
wrapperCol: { span: 16 }
|
|
|
},
|
|
|
formData: {
|
|
|
- company: null, // 快递公司
|
|
|
- orderNo: '' // 运单编号
|
|
|
+ expressName: undefined, // 快递公司
|
|
|
+ expressNum: '' // 运单编号
|
|
|
},
|
|
|
isShow: this.openModal, // 是否填写物流信息
|
|
|
expressCompany: [] // 快递公司
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.getExpressCompany()
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 物流信息 保存
|
|
|
handleSubmit (e) {
|
|
|
e.preventDefault()
|
|
|
- const _this = this
|
|
|
this.form.validateFields((err, values) => {
|
|
|
if (!err) {
|
|
|
- const formData = values.formData
|
|
|
- // expressCompanyQuery(formData).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.$message.success(res.message)
|
|
|
- // this.$emit('success')
|
|
|
- // this.isShow = false
|
|
|
- // }
|
|
|
- // })
|
|
|
+ this.$emit('submit', values.formData)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -118,11 +109,8 @@ export default {
|
|
|
isShow (val) {
|
|
|
if (!val) {
|
|
|
this.$emit('close')
|
|
|
- }
|
|
|
- },
|
|
|
- orderNo (newValue, oldValue) {
|
|
|
- if (this.isShow && newValue) {
|
|
|
- this.getExpressCompany()
|
|
|
+ } else {
|
|
|
+ this.form.resetFields()
|
|
|
}
|
|
|
}
|
|
|
}
|