|
@@ -166,24 +166,31 @@
|
|
|
<el-button plain style="margin-left:10px;" icon="el-icon-plus" type="primary" @click="handleAddUser()" v-hasPermi="['his:user:addExternalUser']">添加外部订单用户</el-button>
|
|
<el-button plain style="margin-left:10px;" icon="el-icon-plus" type="primary" @click="handleAddUser()" v-hasPermi="['his:user:addExternalUser']">添加外部订单用户</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-table border style="margin-top:5px;" v-loading="userloading" :data="users">
|
|
|
|
|
- <el-table-column label="ID" align="center" prop="userId" />
|
|
|
|
|
- <el-table-column label="会员头像" align="center" width="80">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-popover placement="right" title="" trigger="hover">
|
|
|
|
|
- <img slot="reference" :src="scope.row.avatar" width="50" >
|
|
|
|
|
- <img :src="scope.row.avatar" style="max-width: 120px;">
|
|
|
|
|
- </el-popover>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="昵称" align="center" prop="nickName" />
|
|
|
|
|
- <el-table-column label="手机号" align="center" prop="phone" />
|
|
|
|
|
- <el-table-column label="状态" align="center" prop="status" >
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-tag prop="status" v-for="(item, index) in userStatusOptions" :key="index" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
|
|
+ <el-radio-group v-model="form.userId" style="width:100%" @change="handleUserChange">
|
|
|
|
|
+ <el-table border style="margin-top:5px;" v-loading="userloading" :data="users">
|
|
|
|
|
+ <el-table-column label="选择" align="center" width="80">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-radio :label="scope.row.userId"></el-radio>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="ID" align="center" prop="userId" />
|
|
|
|
|
+ <el-table-column label="会员头像" align="center" width="80">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-popover placement="right" title="" trigger="hover">
|
|
|
|
|
+ <img slot="reference" :src="scope.row.avatar" width="50" >
|
|
|
|
|
+ <img :src="scope.row.avatar" style="max-width: 120px;">
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="昵称" align="center" prop="nickName" />
|
|
|
|
|
+ <el-table-column label="手机号" align="center" prop="phone" />
|
|
|
|
|
+ <el-table-column label="状态" align="center" prop="status" >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag prop="status" v-for="(item, index) in userStatusOptions" :key="index" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="收货信息" prop="addressId">
|
|
<el-form-item label="收货信息" prop="addressId">
|
|
|
<el-row>
|
|
<el-row>
|
|
@@ -270,6 +277,9 @@
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="应收金额" prop="totalPrice">
|
|
|
|
|
+ <el-input v-model="form.totalPrice" placeholder="请输入应收金额" clearable size="small" style="width: 200px;" />
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="支付金额" prop="payMoney">
|
|
<el-form-item label="支付金额" prop="payMoney">
|
|
|
<el-input v-model="form.payMoney" placeholder="请输入支付金额" clearable size="small" style="width: 200px;" />
|
|
<el-input v-model="form.payMoney" placeholder="请输入支付金额" clearable size="small" style="width: 200px;" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -429,6 +439,7 @@ export default {
|
|
|
addressId: null,
|
|
addressId: null,
|
|
|
userId: null,
|
|
userId: null,
|
|
|
payType: null,
|
|
payType: null,
|
|
|
|
|
+ totalPrice: null,
|
|
|
payMoney: null,
|
|
payMoney: null,
|
|
|
products: []
|
|
products: []
|
|
|
},
|
|
},
|
|
@@ -437,6 +448,7 @@ export default {
|
|
|
selectedProducts: [],
|
|
selectedProducts: [],
|
|
|
rules: {
|
|
rules: {
|
|
|
addressId: [{ required: true, message: "请选择收货地址", trigger: "change" }],
|
|
addressId: [{ required: true, message: "请选择收货地址", trigger: "change" }],
|
|
|
|
|
+ userId: [{ required: true, message: "请选择会员", trigger: "change" }],
|
|
|
payType: [{ required: true, message: "支付方式不能为空", trigger: "change" }],
|
|
payType: [{ required: true, message: "支付方式不能为空", trigger: "change" }],
|
|
|
payMoney: [{ required: true, message: "支付金额不能为空", trigger: "blur" }]
|
|
payMoney: [{ required: true, message: "支付金额不能为空", trigger: "blur" }]
|
|
|
},
|
|
},
|
|
@@ -551,6 +563,7 @@ export default {
|
|
|
addressId: null,
|
|
addressId: null,
|
|
|
userId: null,
|
|
userId: null,
|
|
|
payType: null,
|
|
payType: null,
|
|
|
|
|
+ totalPrice: null,
|
|
|
payMoney: null,
|
|
payMoney: null,
|
|
|
products: []
|
|
products: []
|
|
|
};
|
|
};
|
|
@@ -572,6 +585,8 @@ export default {
|
|
|
this.userloading = true;
|
|
this.userloading = true;
|
|
|
this.users = [];
|
|
this.users = [];
|
|
|
this.address = [];
|
|
this.address = [];
|
|
|
|
|
+ this.form.userId = null;
|
|
|
|
|
+ this.form.addressId = null;
|
|
|
request({
|
|
request({
|
|
|
url: '/store/user/externalList',
|
|
url: '/store/user/externalList',
|
|
|
method: 'get',
|
|
method: 'get',
|
|
@@ -590,6 +605,14 @@ export default {
|
|
|
handleAddUser() {
|
|
handleAddUser() {
|
|
|
this.user.open = true;
|
|
this.user.open = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ handleUserChange(userId) {
|
|
|
|
|
+ this.form.addressId = null;
|
|
|
|
|
+ if (userId != null) {
|
|
|
|
|
+ this.getAddressList(userId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.address = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
addUser(phone) {
|
|
addUser(phone) {
|
|
|
this.user.open = false;
|
|
this.user.open = false;
|
|
|
this.phone = phone;
|
|
this.phone = phone;
|
|
@@ -673,14 +696,13 @@ export default {
|
|
|
return this.selectedProducts.some(item => item.productId === productId);
|
|
return this.selectedProducts.some(item => item.productId === productId);
|
|
|
},
|
|
},
|
|
|
handleQuantityChange() {
|
|
handleQuantityChange() {
|
|
|
- // 数量变化时自动计算总金额
|
|
|
|
|
let total = 0;
|
|
let total = 0;
|
|
|
this.selectedProducts.forEach(item => {
|
|
this.selectedProducts.forEach(item => {
|
|
|
const quantity = this.productQuantities[item.productId] || 1;
|
|
const quantity = this.productQuantities[item.productId] || 1;
|
|
|
const price = this.getDisplayProductPrice(item);
|
|
const price = this.getDisplayProductPrice(item);
|
|
|
total += price * quantity;
|
|
total += price * quantity;
|
|
|
});
|
|
});
|
|
|
- this.form.payMoney = total.toFixed(2);
|
|
|
|
|
|
|
+ this.form.totalPrice = total.toFixed(2);
|
|
|
},
|
|
},
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
@@ -703,6 +725,7 @@ export default {
|
|
|
addressId: this.form.addressId,
|
|
addressId: this.form.addressId,
|
|
|
userId: this.form.userId,
|
|
userId: this.form.userId,
|
|
|
payType: this.form.payType,
|
|
payType: this.form.payType,
|
|
|
|
|
+ totalPrice: parseFloat(this.form.totalPrice) || 0,
|
|
|
payMoney: parseFloat(this.form.payMoney) || 0,
|
|
payMoney: parseFloat(this.form.payMoney) || 0,
|
|
|
products: products
|
|
products: products
|
|
|
};
|
|
};
|