|
@@ -35,6 +35,11 @@
|
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="买家信息" name="2" class="add-order-item">
|
|
|
<by-form :propConfig="buyerInfoConfig" ref="infoform">
|
|
|
+ <template v-slot:shopBuyerId="{value}">
|
|
|
+ <el-input placeholder="请选择买家'" :value="value.shopBuyerId" @clear="clearBuyer" size="small" class="myinpuy-with-select" clearable>
|
|
|
+ <el-button slot="append" icon="el-icon-more" @click="showBuyer"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
<template v-slot:receiverProvinceCode_desc='{ value }'>
|
|
|
{{ value.receiverProvince + '-' + value.receiverCity + '-' + value.receiverDistrict + (value.receiverTown?'-'+value.receiverTown:'') }}
|
|
|
</template>
|
|
@@ -167,6 +172,8 @@
|
|
|
<shop-modal ref="shopModal" @shopSelect="shopSelect" />
|
|
|
<!-- 标签 -->
|
|
|
<labels-modal ref="labelsModal" @onChange="onChangeLabel" />
|
|
|
+ <!-- 买家 -->
|
|
|
+ <buyer-info-modal ref="buyerInfoModal" @confirm="confirmBuyerInfo" />
|
|
|
</template>
|
|
|
<template #footer v-if="!orderValue.id">
|
|
|
<div class="btn">
|
|
@@ -186,7 +193,8 @@ import AddProductModal from "./addProductModal.vue";
|
|
|
import EditProductModal from "./editProductModal.vue";
|
|
|
import LabelsModal from "./labelsModal.vue";
|
|
|
import ShopModal from "./shopModal.vue";
|
|
|
-@Component({components:{AddProductModal,EditProductModal,LabelsModal,ShopModal}})
|
|
|
+import BuyerInfoModal from "./buyerInfoModal.vue";
|
|
|
+@Component({components:{AddProductModal,EditProductModal,LabelsModal,ShopModal,BuyerInfoModal}})
|
|
|
export default class AddOrder extends Vue {
|
|
|
value=false;
|
|
|
num:any=0;
|
|
@@ -418,7 +426,7 @@ export default class AddOrder extends Vue {
|
|
|
size:'small',
|
|
|
itemCount:4,
|
|
|
rules:{
|
|
|
- buyerId:[{
|
|
|
+ shopBuyerId:[{
|
|
|
required: true, message: '买家账号不能为空!', trigger: 'blur'
|
|
|
}],
|
|
|
receiverDistrictCode:[{
|
|
@@ -437,9 +445,10 @@ export default class AddOrder extends Vue {
|
|
|
columns:[
|
|
|
[{
|
|
|
span:6,
|
|
|
- label:'买家账号',
|
|
|
- prop:'buyerId',
|
|
|
- component:'by-input',
|
|
|
+ label:'买家',
|
|
|
+ prop:'shopBuyerId',
|
|
|
+ slot:true,
|
|
|
+ // component:'by-input',
|
|
|
// compConfig:{
|
|
|
// attr:{
|
|
|
// type:'integer'
|
|
@@ -902,6 +911,9 @@ export default class AddOrder extends Vue {
|
|
|
setShow(v:boolean){
|
|
|
this.value = v;
|
|
|
}
|
|
|
+ showBuyer() {
|
|
|
+ (this.$refs.buyerInfoModal as any).setShow(true)
|
|
|
+ }
|
|
|
showShop(){
|
|
|
(this.$refs.shopModal as any).setShow(true);
|
|
|
}
|
|
@@ -917,6 +929,12 @@ export default class AddOrder extends Vue {
|
|
|
value.shopName = '';
|
|
|
(this.$refs.baseform as any).setValue(value);
|
|
|
}
|
|
|
+ clearBuyer(){
|
|
|
+ let value:any = (this.$refs.infoform as any).getValue();
|
|
|
+ value.buyerId = '';
|
|
|
+ value.shopBuyerId = '';
|
|
|
+ (this.$refs.infoform as any).setValue(value);
|
|
|
+ }
|
|
|
setDetail(data:any){
|
|
|
this.orderValue = data;
|
|
|
if(this.orderValue.isPay == 0 || this.orderValue.isPay == 1){
|
|
@@ -1004,7 +1022,7 @@ export default class AddOrder extends Vue {
|
|
|
payFormValue.orderId = this.orderValue.id;
|
|
|
payFormValue.sourceFrom = this.orderValue.sourceFrom;
|
|
|
payFormValue.isOrderPay = 1;
|
|
|
- payFormValue.buyerId = this.orderValue.buyerId;
|
|
|
+ payFormValue.shopBuyerId = this.orderValue.shopBuyerId;
|
|
|
payFormValue.shopId = this.orderValue.shopId;
|
|
|
payFormValue.shopName = this.orderValue.shopName;
|
|
|
payFormValue.status = this.orderValue.status;
|
|
@@ -1023,6 +1041,26 @@ export default class AddOrder extends Vue {
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+ // 买家信息
|
|
|
+ confirmBuyerInfo(data:any) {
|
|
|
+ let v:any = {}
|
|
|
+ v.shopBuyerId = data[0].name
|
|
|
+ v.buyerId = data[0].id
|
|
|
+ v.receiverName = data[0].contacts
|
|
|
+ v.receiverProvince = data[0].province
|
|
|
+ v.receiverProvinceCode = data[0].provinceCode
|
|
|
+ v.receiverCity = data[0].city
|
|
|
+ v.receiverCityCode = data[0].cityCode
|
|
|
+ v.receiverDistrict = data[0].region
|
|
|
+ v.receiverDistrictCode = data[0].regionCode
|
|
|
+ v.receiverTownCode = data[0].streetCode
|
|
|
+ v.receiverTown = data[0].street
|
|
|
+ v.receiverAddress = data[0].address
|
|
|
+ v.receiverMobile = data[0].telephone
|
|
|
+ if(this.$refs.infoform){
|
|
|
+ (this.$refs.infoform as any).setValue(v)
|
|
|
+ }
|
|
|
+ }
|
|
|
//添加商品
|
|
|
toolAddProduct(){
|
|
|
if(this.orderValue.id){
|
|
@@ -1095,7 +1133,7 @@ export default class AddOrder extends Vue {
|
|
|
(this.$refs.baseform as any).setValue(info);
|
|
|
//买家
|
|
|
let buyerInfo:any={};
|
|
|
- buyerInfo.buyerId = data.buyerId;
|
|
|
+ buyerInfo.shopBuyerId = data.shopBuyerId;
|
|
|
buyerInfo.receiverName = data.receiverName;
|
|
|
buyerInfo.receiverProvince=data.receiverProvince;//省
|
|
|
buyerInfo.receiverProvinceCode=data.receiverProvinceCode; //省编码
|