Commit 0e82810f authored by dcy's avatar dcy

特殊需求修改

parent ffcacc51
......@@ -6,20 +6,16 @@
<div class="content">
<el-form label-width="180px" label-position="left">
<el-form-item label="特殊要求">
<dict-selector v-if="show" v-model="form.advanceType" multiple formType="checkbox" :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" ></dict-selector>
<dict-selector v-if="show" v-model="advanceType" multiple formType="checkbox" :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" ></dict-selector>
</el-form-item>
<el-form-item label="特殊要求备注"><el-input type="textarea" style="width: 300px;" v-model="form.todoDetail"></el-input></el-form-item>
<el-form-item label="内陆运费垫付预计金额" v-if="form.advanceType.indexOf('6') > -1">
<el-input style="width: 300px;" v-model="form.transFee">
<el-form-item label="特殊要求备注"><el-input type="textarea" style="width: 300px;" v-model="todoDetail"></el-input></el-form-item>
<el-form-item v-for="(item,index) in this.getDictDatas(this.DICT_TYPE.ORDER_SPECIAL_NEEDS)" v-if="advanceType.indexOf(item.value) > -1" :key="item.value" :label="item.label + '预计金额'">
<el-input style="width: 300px;" v-model="specialNeedsList[index].transFee">
<div style="width: 100px;" slot="append" >
<dict-selector v-model="form.transCurrency" :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" ></dict-selector>
<dict-selector v-model="specialNeedsList[index].transCurrency" :type="DICT_TYPE.COMMISSION_CURRENCY_TYPE" ></dict-selector>
</div>
</el-input>
</el-form-item>
<el-form-item label="付款类型" v-if="form.advanceType.indexOf('6') > -1">
<div style="width: 300px;">
<dict-selector v-model="form.payType" :type="DICT_TYPE.PAYMENT_TYPE" ></dict-selector>
</div>
<dict-selector placeholder="请选择付款类型" style="margin-left: 20px;" v-model="specialNeedsList[index].payType" :type="DICT_TYPE.PAYMENT_TYPE" ></dict-selector>
</el-form-item>
</el-form>
</div>
......@@ -36,9 +32,6 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {specialNeedCreate} from "@/api/ecw/order";
export default {
name: "specialNeeds",
created() {
this.clearFrom()
},
props:{
orderId:{
type:[String,Number],
......@@ -50,23 +43,17 @@ export default {
getDictDatas,
DICT_TYPE,
form:{},
advanceType:[],
specialNeedsList:[],
todoDetail:''
}
},
methods:{
clearFrom(){
this.form = {
advanceType:[],
advanceWho: undefined,
payType: undefined,
todoDetail: undefined,
transCurrency: undefined,
transFee: undefined
}
},
submit(){
specialNeedCreate([{orderId:this.orderId, ...this.form}]).then(r=>{
this.specialNeedsList.forEach(i => i.todoDetail = this.todoDetail)
let p = this.specialNeedsList.filter(i => this.advanceType.indexOf(i.advanceType) > -1)
specialNeedCreate(p).then(r=>{
if(r.code === 0){
this.clearFrom();
this.$emit('update:show',false)
this.$emit('determine')
this.$message.success('提交成功');
......@@ -75,10 +62,21 @@ export default {
},
},
watch:{
'form.advanceType'(val){
this.form.transFee = undefined;
this.form.transCurrency = undefined;
this.form.payType = undefined;
show(val){
if(val){
this.getDictDatas(this.DICT_TYPE.ORDER_SPECIAL_NEEDS).forEach(r => {
this.specialNeedsList.push({
advanceType:r.value,
orderId:this.orderId,
payType:'',//付款类型
transFee:'',//预计金额
transCurrency:'',//运输费币种
})
})
}else {
this.specialNeedsList = []
this.advanceType = []
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment