Commit f975bcb8 authored by dragondean@qq.com's avatar dragondean@qq.com

完善订单创建重构

parent 4cadf59e
<script setup>
import UniPopup from "@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
export default {
props:{
value:{
type:Array,
default:[]
}
},
data(){
return {
customDraweeList:[]
}
},
onMounted() {
console.log('drawee')
},
methods: {
open(){
this.$refs.popup.open()
if(!this.customDraweeList.length){
this.loadDictData()
}
},
loadDictData() {
this.$request.getConfig('custom_drawee').then(res => {
if(res.code==0&&res.data&&res.data.list.length>0){
res.data.list.forEach(item => {
const old = this.value ? this.value.find(it => it.name == item.value) : null
this.customDraweeList.push({
name: item.value,
label: this.$lang.locale === 'zh' ? item.label : item.labelEn,
value: old ? old.value : 1
})
})
}
})
},
changeDrawee(field, e){
const index = this.customDraweeList.findIndex(item => item.name == field)
if(index < 0) return
this.customDraweeList[index].value = e.detail.value
},
submit(){
this.$refs.popup.close()
this.$emit("confirm", this.customDraweeList)
},
close(){
this.$refs.popup.close()
},
}
}
</script>
<template>
<uni-popup ref="popup" type="center" :mask-click="false">
<view class="content">
<view v-for="item in customDraweeList" :key="item.id" class="flex item">
<view class="name">{{item.label}}</view>
<radio-group @change="changeDrawee(item.name, $event)" class="flex">
<label class="flex">
<view class="checkbox-item">
<radio value="1" :checked="item.value == 1" style="transform:scale(0.8)"/>
</view>
<view>{{$lang.lang.create.consignee}}</view>
</label>
<label class="flex">
<view class="checkbox-item">
<radio value="2" :checked="item.value == 2" style="transform:scale(0.8)"/>
</view>
<view>{{$lang.lang.create.consignor}}</view>
</label>
</radio-group>
</view>
<view class="flex action">
<button @click="close">{{$lang.lang.create.cancel}}</button>
<button @click="submit" type="primary">{{$lang.lang.create.submit}}</button>
</view>
</view>
</uni-popup>
</template>
<style scoped lang="scss">
.content{
width: 80vw;
background-color: #fff;
padding: 10px;
.item{
padding: 5px;
&:nth-child(2n){
background: #f8f8f8;
}
.name{
width: 100px;
}
}
.action{
margin-top: 20px;
}
}
</style>
This diff is collapsed.
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
"noCotrol": "非控货订单代收货款", "noCotrol": "非控货订单代收货款",
"startCity": "始发城市", "startCity": "始发城市",
"endCity": "目的城市", "endCity": "目的城市",
"dstCountry": "目的国家",
"method": "运输方式", "method": "运输方式",
"channel": "出货渠道", "channel": "出货渠道",
"info": "商品", "info": "商品",
...@@ -116,4 +117,8 @@ export default { ...@@ -116,4 +117,8 @@ export default {
"choose": "请选择", "choose": "请选择",
"needCollectionAmount": "请设置代收货款金额", "needCollectionAmount": "请设置代收货款金额",
"needCollectionCurrency": "请选择代收货币单位", "needCollectionCurrency": "请选择代收货币单位",
"customDrawee": "自定义",
"billLadingPrice": "提单是否显示价格",
"displayBillLadingPrice": "显示",
"hideBillLadingPrice": "不显示",
} }
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