|
@@ -21,6 +21,7 @@
|
|
|
<el-button size="mini" @click="handleEditAddress()" v-if="order.status==0||order.status==1" v-hasPermi="['store:storeOrder:editAddress']" >修改收货地址</el-button>
|
|
<el-button size="mini" @click="handleEditAddress()" v-if="order.status==0||order.status==1" v-hasPermi="['store:storeOrder:editAddress']" >修改收货地址</el-button>
|
|
|
<el-button size="mini" @click="handleBindCustomer()" v-hasPermi="['store:storeOrder:bindCustomer']" >关联客户</el-button>
|
|
<el-button size="mini" @click="handleBindCustomer()" v-hasPermi="['store:storeOrder:bindCustomer']" >关联客户</el-button>
|
|
|
<el-button size="mini" @click="editOrder()" v-hasPermi="['store:storeOrder:edit']" >修改订单</el-button>
|
|
<el-button size="mini" @click="editOrder()" v-hasPermi="['store:storeOrder:edit']" >修改订单</el-button>
|
|
|
|
|
+ <el-button size="mini" @click="editOfflinePay()" v-hasPermi="['store:storeOrder:edit']" >修改线下支付金额</el-button>
|
|
|
<!-- <el-button size="mini" @click="handleEditUser()" v-hasPermi="['users:user:edit']" >修改会员修改</el-button> -->
|
|
<!-- <el-button size="mini" @click="handleEditUser()" v-hasPermi="['users:user:edit']" >修改会员修改</el-button> -->
|
|
|
<el-button size="mini" v-if="order.customerId!=null&&order.customerId>0" @click="handleCustomer()" >查看客户详情</el-button>
|
|
<el-button size="mini" v-if="order.customerId!=null&&order.customerId>0" @click="handleCustomer()" >查看客户详情</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -178,11 +179,16 @@
|
|
|
<p>¥{{(scope.row.originalPrice ? scope.row.originalPrice.toFixed(2) : JSON.parse(scope.row.jsonInfo).price.toFixed(2))}}</p>
|
|
<p>¥{{(scope.row.originalPrice ? scope.row.originalPrice.toFixed(2) : JSON.parse(scope.row.jsonInfo).price.toFixed(2))}}</p>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="单价" width="240" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="线上单价" width="200" align="center">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<p>¥{{JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}</p>
|
|
<p>¥{{JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}</p>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column label="线下单价" width="200" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <p>¥{{(scope.row.offlinePrice || 0).toFixed(2)}}</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="规格" width="240" align="center">
|
|
<el-table-column label="规格" width="240" align="center">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
{{JSON.parse(scope.row.jsonInfo).sku}}
|
|
{{JSON.parse(scope.row.jsonInfo).sku}}
|
|
@@ -195,14 +201,14 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="小计" align="center">
|
|
<el-table-column label="小计" align="center">
|
|
|
<template slot-scope="scope" >
|
|
<template slot-scope="scope" >
|
|
|
- ¥{{scope.row.num*JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}
|
|
|
|
|
|
|
+ ¥{{((JSON.parse(scope.row.jsonInfo).price + (scope.row.offlinePrice || 0)) * scope.row.num).toFixed(2)}}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<div style="float: right;margin: 20px" v-if="order!=null">
|
|
<div style="float: right;margin: 20px" v-if="order!=null">
|
|
|
<span style="color: #909399;text-decoration: line-through;">原价合计:¥{{originalTotal.toFixed(2)}}</span>
|
|
<span style="color: #909399;text-decoration: line-through;">原价合计:¥{{originalTotal.toFixed(2)}}</span>
|
|
|
|
|
|
|
|
- 合计:<span class="color-danger">¥{{order.totalPrice.toFixed(2)}}</span>
|
|
|
|
|
|
|
+ 合计:<span class="color-danger">¥{{newTotal.toFixed(2)}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div style="margin: 60px 0px 20px 0px">
|
|
<div style="margin: 60px 0px 20px 0px">
|
|
@@ -368,18 +374,6 @@
|
|
|
<el-form-item label="订单手机号" prop="userPhone" >
|
|
<el-form-item label="订单手机号" prop="userPhone" >
|
|
|
<el-input v-model="editForm.userPhone" placeholder="请输入手机号" style="width:200px"/>
|
|
<el-input v-model="editForm.userPhone" placeholder="请输入手机号" style="width:200px"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <!-- 线下支付金额 -->
|
|
|
|
|
- <el-form-item label="线下支付金额" prop="offlinePayAmount" >
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model.number="editForm.offlinePayAmount"
|
|
|
|
|
- type="number"
|
|
|
|
|
- step="0.01"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- @blur="formatAmount"
|
|
|
|
|
- style="width:200px"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="mark" >
|
|
<el-form-item label="备注" prop="mark" >
|
|
|
<el-input v-model="editForm.mark" placeholder="请输入备注" />
|
|
<el-input v-model="editForm.mark" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -388,6 +382,56 @@
|
|
|
<el-button type="primary" @click="submitEditForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitEditForm">确 定</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog title="修改线下支付金额" :visible.sync="offlinePayDialog.open" width="900px" append-to-body>
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ border
|
|
|
|
|
+ v-if="items!=null && items.length>0"
|
|
|
|
|
+ :data="items"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%" >
|
|
|
|
|
+ <el-table-column label="商品图片" width="100" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <img :src="JSON.parse(scope.row.jsonInfo).image" style="height: 50px">
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="商品名称" min-width="200" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <p>{{JSON.parse(scope.row.jsonInfo).productName}}</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="线下支付单价" width="180" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ v-model="scope.row.offlinePrice"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ style="width:140px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="数量" width="100" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{scope.row.num}}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="小计" width="150" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span class="color-danger">
|
|
|
|
|
+ ¥{{((scope.row.offlinePrice || 0) * scope.row.num).toFixed(2)}}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <div style="text-align: right; margin-top: 15px; margin-bottom: 10px; clear: both" v-if="items!=null && items.length>0">
|
|
|
|
|
+ 线下合计:<span class="color-danger">¥{{offlineTotal.toFixed(2)}}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitOfflinePayForm" :loading="offlineSaving">保 存</el-button>
|
|
|
|
|
+ <el-button @click="offlinePayDialog.open = false">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
<el-dialog :title="editUser.title" :visible.sync="editUser.open" width="600px" append-to-body>
|
|
<el-dialog :title="editUser.title" :visible.sync="editUser.open" width="600px" append-to-body>
|
|
|
<el-form ref="editUserForm" :model="editUserForm" :rules="editUserRules" label-width="100px">
|
|
<el-form ref="editUserForm" :model="editUserForm" :rules="editUserRules" label-width="100px">
|
|
|
<el-form-item label="进线时间" prop="registerDate">
|
|
<el-form-item label="进线时间" prop="registerDate">
|
|
@@ -549,7 +593,7 @@ import { getTcmScheduleList } from "@/api/company/tcmScheduleReport";
|
|
|
import {getCustomerListBySearch } from "@/api/crm/customer";
|
|
import {getCustomerListBySearch } from "@/api/crm/customer";
|
|
|
import ImageUpload from '@/components/ImageUpload'
|
|
import ImageUpload from '@/components/ImageUpload'
|
|
|
import Material from '@/components/Material'
|
|
import Material from '@/components/Material'
|
|
|
-import {bindCustomer,getExpress, listStoreOrder, getStoreOrder, delStoreOrder, addStoreOrder, updateStoreOrder, exportStoreOrder,uploadCredentials, getStoreOrderAddress,getUserPhone} from "@/api/hisStore/storeOrder";
|
|
|
|
|
|
|
+import {bindCustomer,getExpress, listStoreOrder, getStoreOrder, delStoreOrder, addStoreOrder, updateStoreOrder, exportStoreOrder,uploadCredentials, getStoreOrderAddress,getUserPhone, saveOfflinePayAmount} from "@/api/hisStore/storeOrder";
|
|
|
import {getCitys} from "@/api/hisStore/city";
|
|
import {getCitys} from "@/api/hisStore/city";
|
|
|
import customerDetails from '../../crm/components/customerDetails.vue';
|
|
import customerDetails from '../../crm/components/customerDetails.vue';
|
|
|
import addSms from '../../crm/components/addSms.vue';
|
|
import addSms from '../../crm/components/addSms.vue';
|
|
@@ -647,6 +691,9 @@ export default {
|
|
|
offlinePayAmount: 0.00,
|
|
offlinePayAmount: 0.00,
|
|
|
orderMedium:null,
|
|
orderMedium:null,
|
|
|
},
|
|
},
|
|
|
|
|
+ offlinePayDialog:{
|
|
|
|
|
+ open:false,
|
|
|
|
|
+ },
|
|
|
editRules: {
|
|
editRules: {
|
|
|
userPhone: [
|
|
userPhone: [
|
|
|
{ required: false, message: '请输入手机号', trigger: 'blur' },
|
|
{ required: false, message: '请输入手机号', trigger: 'blur' },
|
|
@@ -667,7 +714,8 @@ export default {
|
|
|
express:[],
|
|
express:[],
|
|
|
traces:[],
|
|
traces:[],
|
|
|
payments:[],
|
|
payments:[],
|
|
|
- auditLogs: []
|
|
|
|
|
|
|
+ auditLogs: [],
|
|
|
|
|
+ offlineSaving: false,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -707,13 +755,22 @@ export default {
|
|
|
const price = item.originalPrice != null ? item.originalPrice : info.price;
|
|
const price = item.originalPrice != null ? item.originalPrice : info.price;
|
|
|
return sum + (price * item.num);
|
|
return sum + (price * item.num);
|
|
|
}, 0);
|
|
}, 0);
|
|
|
|
|
+ },
|
|
|
|
|
+ offlineTotal() {
|
|
|
|
|
+ if (!this.items) return 0;
|
|
|
|
|
+ return this.items.reduce((sum, item) => {
|
|
|
|
|
+ return sum + ((item.offlinePrice || 0) * item.num);
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+ },
|
|
|
|
|
+ newTotal() {
|
|
|
|
|
+ if (!this.items) return 0;
|
|
|
|
|
+ return this.items.reduce((sum, item) => {
|
|
|
|
|
+ const info = JSON.parse(item.jsonInfo);
|
|
|
|
|
+ return sum + ((info.price + (item.offlinePrice || 0)) * item.num);
|
|
|
|
|
+ }, 0);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- methods: {formatAmount() {
|
|
|
|
|
- if (typeof this.editForm.offlinePayAmount === 'number') {
|
|
|
|
|
- this.editForm.offlinePayAmount = parseFloat(this.editForm.offlinePayAmount.toFixed(2));
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ methods: {
|
|
|
closeSms(){
|
|
closeSms(){
|
|
|
this.addSms.open=false;
|
|
this.addSms.open=false;
|
|
|
},
|
|
},
|
|
@@ -946,6 +1003,33 @@ export default {
|
|
|
this.editForm.orderVisit = this.order.orderVisit;
|
|
this.editForm.orderVisit = this.order.orderVisit;
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ editOfflinePay(){
|
|
|
|
|
+ this.offlinePayDialog.open = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ submitOfflinePayForm(){
|
|
|
|
|
+ const list = this.items.map(item => ({
|
|
|
|
|
+ itemId: item.itemId,
|
|
|
|
|
+ offlinePrice: item.offlinePrice || 0
|
|
|
|
|
+ }));
|
|
|
|
|
+ this.offlineSaving = true;
|
|
|
|
|
+ saveOfflinePayAmount({
|
|
|
|
|
+ orderId: this.order.id,
|
|
|
|
|
+ offlinePayAmount: this.offlineTotal,
|
|
|
|
|
+ items: list
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ this.msgSuccess('保存成功');
|
|
|
|
|
+ this.offlinePayDialog.open = false;
|
|
|
|
|
+ this.getOrder(this.order.id);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(response.msg || '保存失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ this.offlineSaving = false;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.msgError('保存失败');
|
|
|
|
|
+ this.offlineSaving = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
getOrder(orderId){
|
|
getOrder(orderId){
|
|
|
this.orderId=orderId;
|
|
this.orderId=orderId;
|
|
|
this.certificates = null;
|
|
this.certificates = null;
|