Zory 3 tygodni temu
rodzic
commit
b62173b5dd

+ 14 - 0
src/api/model/merOrder.js

@@ -30,6 +30,20 @@ export default {
             return await http.post(this.url, params);
         },
     },
+    addressEdit: {
+        url: `${config.API_URL}/merchant/order/address/edit`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
+    addressDetail: {
+        url: `${config.API_URL}/merchant/order/address/detail`,
+        name: "-",
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+    },
     save: {
         url: `${config.API_URL}/merchant/order/save`,
         name: "-",

+ 3 - 1
src/components/imFloat/order.vue

@@ -39,7 +39,9 @@
                         <div class="status-desc" v-if="orderData.status == 4">已申请退款,钱款预计1-3个自然日到账</div>
                         <div class="status-desc" v-if="orderData.status == 5">订单已取消或已关闭</div>
                         <div class="status-desc" v-if="orderData.status == 6">部分退款中</div>
-                        <div class="status-desc" v-if="orderData.status == 7">货物运输中</div>
+                        <div class="status-desc" v-if="orderData.status == 7">
+                            {{ orderData.express_status == 2 ? '货物运输中' : '待发货' }}
+                        </div>
                         <div class="status-desc" v-if="orderData.status == 8">已发快递,等待审核拦截</div>
                         <div class="status-desc" v-if="orderData.status == 9">订单已完成核销,售后申请中</div>
                         

+ 2 - 3
src/views/manage/order/index/components/table.vue

@@ -84,8 +84,7 @@
                     <span>待使用</span>
                 </div>
                 <div class="order-name" v-if="scope.row.status == 2">
-                    <span v-if="scope.row.is_error == 1" style="color: #f00;">异常</span>
-                    <span v-else>已完成</span>
+                    <span>已核销</span>
                 </div>
                 <div class="order-name" v-if="scope.row.status == 3">
                     <span>已退款</span>
@@ -105,7 +104,7 @@
                 </div>
                 <div class="order-name" v-if="scope.row.status == 7">
                     <span>履约中</span>
-                    <span class="dec">货物运输中</span>
+                    <span class="dec">{{scope.row.express_status==2?'货物运输中':'等待发货'}}</span>
                 </div>
                 <!-- 发货后退款 -->
                 <div class="order-name" v-if="scope.row.status == 8">

+ 2 - 1
src/views/merchant/goods/off/components/table.vue

@@ -38,7 +38,8 @@
                         fit="cover"></el-image>
                     </div>
                     <div class="name">
-                        <span>{{ scope.row.goods.product_name }}</span>
+                        <span v-if="scope.row.goods.is_new == 1">{{scope.row.goods.price}}元代{{scope.row.goods.line_price}}元商场权益券{{ scope.row.goods.product_name }}</span>
+                        <span v-else>{{ scope.row.goods.product_name }}</span>
                         <span class="dec">商品ID:{{ scope.row.goods.goods_id }}</span>
                     </div>
                 </div>

+ 2 - 3
src/views/merchant/order/index/components/table.vue

@@ -63,8 +63,7 @@
                     <span>待使用</span>
                 </div>
                 <div class="order-name" v-if="scope.row.status == 2">
-                    <span v-if="scope.row.is_error == 1" style="color: #f00;">异常</span>
-                    <span v-else>已完成</span>
+                    <span>已核销</span>
                 </div>
                 <div class="order-name" v-if="scope.row.status == 3">
                     <span>已退款</span>
@@ -84,7 +83,7 @@
                 </div>
                 <div class="order-name" v-if="scope.row.status == 7">
                     <span>履约中</span>
-                    <span class="dec">货物运输中</span>
+                    <span class="dec">{{scope.row.express_status==2?'货物运输中':'等待发货'}}</span>
                 </div>
                 <!-- 发货后退款 -->
                 <div class="order-name" v-if="scope.row.status == 8">

+ 1 - 1
src/views/merchant/service/setting/index.vue

@@ -95,7 +95,7 @@ export default {
             this.getQuickData()
         },
         quickQs(){
-            if (this.quickTable.length >= 7) return this.$message.info("最多只能添加7个问题");
+            if (this.quickTable && this.quickTable.length >= 7) return this.$message.info("最多只能添加7个问题");
             this.$nextTick(() => {
                 this.$refs.quickMain.open()
             })

+ 266 - 0
src/views/service/chat/components/address.vue

@@ -0,0 +1,266 @@
+<template>
+    <el-drawer v-model="visible" size="500px" destroy-on-close :close-on-click-modal="false" :with-header="false">
+        <el-container class="flex-column">
+            <div class="drawer-detail-main">
+                <div class="drawer-detail-header">
+                    <div class="drawer-detail-header-body">
+                        <div class="drawer-detail-header-left">{{titleMap[mode]}}</div>
+                        <div class="drawer-detail-header-left">
+                            <el-button type="default" icon="el-icon-close" @click="visible=false"></el-button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <el-main class="nopadding" v-loading="loading">
+                <div class="order-detail">
+                    <div class="order-info">
+                        <div class="title-h">意向商品</div>
+                        <div class="goods-item" v-for="(item,indx) in doneGoods" :key="indx">
+                            <div class="item-goods" style="padding: 5px;background-color: #f8f8f8;">
+                                <div class="item-goods-body">
+                                    <div class="image">
+                                        <el-image style="width: 60px;height: 60px;" :src="item.image"></el-image>
+                                    </div>
+                                    <div class="info">
+                                        <div class="title">
+                                            <div class="name">{{ item.title }}</div>
+                                        </div>
+                                        <div class="tags">
+                                            <div></div>
+                                            <div class="price">x1</div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="goods-item-check" @click="selectGoods">{{doneGoods.length == 0 ? '请选择': '更换其他'}}</div>
+                    </div>
+
+                    <div class="order-info">
+                        <div class="title-h">地址信息</div>
+                        <el-form ref="dialogForm" :model="formData" :rules="rules" label-width="100px" label-position="top">
+                            <el-form-item label="姓名" prop="nickname">
+                                <el-input v-model="formData.nickname" clearable placeholder="请输入"></el-input>
+                                <div class="el-form-item-msg"></div>
+                            </el-form-item>
+                            <el-form-item label="手机号码" prop="mobile">
+                                <el-input v-model="formData.mobile" clearable placeholder="请输入"></el-input>
+                                <div class="el-form-item-msg"></div>
+                            </el-form-item>
+                            <el-form-item label="所属地区" prop="city">
+                                <el-cascader ref="cascaderRef" v-model="formData.city" :options="categoryData" :props="deptsProps" @change="getTemplate" clearable style="width: 100%;" />
+                                <div class="el-form-item-msg"></div>
+                            </el-form-item>
+                            <el-form-item label="详细地址" prop="address">
+                                <el-input type="textarea" rows="3" v-model="formData.address" clearable placeholder="请输入"></el-input>
+                                <div class="el-form-item-msg"></div>
+                            </el-form-item>
+                        </el-form>
+                    </div>
+                </div>
+            </el-main>
+            <el-footer style="text-align: right;">
+                <el-button @click="visible=false" size="large">取 消</el-button>
+                <el-button v-if="mode!='show'" size="large" type="primary" :loading="isSaveing" @click="submit()">确 认</el-button>
+            </el-footer>
+        </el-container>
+    </el-drawer>
+    <goodsMain ref="goodsMain" :multiple="false" @success="handleStore"></goodsMain>
+</template>
+
+<script>
+import goodsMain from './goodOff';
+export default {
+    components:{
+        goodsMain
+    },
+    data(){
+        return {
+            loading: false,
+            isSaveing: false,
+            mode:"add",
+            titleMap:{
+                add:"修改预约地址",
+                edit:"修改预约地址"
+            },
+            visible:false,
+            formData:{},
+            deptsProps:{
+                value: "value",
+                label: "text"
+            },
+            formOrder:null,
+            categoryData:[],
+            doneGoods:[],
+            rules:{
+                nickname: [
+                    {required: true, message: '请输入'}
+                ],
+                mobile: [
+                    {required: true, message: '请输入'}
+                ],
+                address: [
+                    {required: true, message: '请输入'}
+                ],
+                city: [
+                    {required: true, message: '请选择'}
+                ]
+            }
+        }
+    },
+    methods: {
+        open(mode = 'add'){
+            this.mode = mode;
+            this.visible = true;
+            this.doneGoods = [];
+            return this
+        },
+        selectGoods(){
+            this.$nextTick(() => {
+                this.$refs.goodsMain.open("add").setData(this.formOrder)
+            })
+        },
+        handleStore(data){
+            this.doneGoods = [];
+            this.doneGoods.push(data);
+        },
+        //表单注入数据
+        setData(data){
+            this.formOrder = JSON.parse(JSON.stringify(data));
+            this.getCityData()
+            this.getAddressDetail()
+        },
+        async getTemplate(v){
+            const nodes = this.$refs.cascaderRef.getCheckedNodes()
+            this.formData.cityLabel = nodes[0].pathLabels
+        },
+        async getCityData(){
+            var resp = await this.$API.merOrder.city.get();
+            this.categoryData = resp.data;
+        },
+        async getAddressDetail(){
+            this.loading = true;
+            var resp = await this.$API.merOrder.addressDetail.get({"order":this.formOrder.out_order_no});
+            this.loading = false;
+            if (resp.code == 0) {
+                this.$message.error(resp.msg);
+                this.visible = false;
+                return ;
+            }
+            this.formData = resp.data;
+            this.formData.city = resp.data.city_code;
+            this.doneGoods.push(resp.data.goods)
+        },
+        async submit(){
+            var validate = await this.$refs.dialogForm.validate().catch(()=>{});
+            if(!validate){ return false }
+            this.isSaveing = true;
+            let submitData = JSON.parse(JSON.stringify(this.formData));
+            submitData.goods = JSON.stringify(this.doneGoods);
+            var resp = await this.$API.merOrder.addressEdit.post(submitData);
+            this.isSaveing = false;
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.visible = false;
+            this.formData = {};
+            this.submitState = false;
+            this.$emit("success");
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.order-info{
+    border-radius: 10px;
+    background-color: #fff;padding: 10px;margin-top: 10px;
+    .title-h{
+        font-size: 16px;color: #333;font-weight: bold;margin-bottom: 10px;
+        span {
+            font-size: 14px;
+            color: #666;
+            font-weight: normal;
+            margin-left: 10px;
+        }
+    }
+}
+.goods-item-check{
+	border: 1px solid #475569;
+	height: 40px;
+	line-height: 40px;
+	text-align: center;
+	font-size: 14px;
+	color: #475569;
+	border-radius: 5px;
+    cursor: pointer;
+    margin-top: 10px;
+}
+.item-goods{
+    background-color: #fff;
+    margin-top: 10px;
+    border-radius: 10px;
+    padding: 10px;
+    .item-goods-body{
+        display: flex;
+        align-items: center;
+        gap: 10px;
+    }
+    .stock{
+        text-align: right;
+    }
+    .image {
+        height: 70px;
+        overflow: hidden;display: flex;align-items: center;min-width: 70px;
+        position: relative;
+        image {
+            width: 70px;
+            border-radius: 5px;
+            height: 100%;
+        }
+    }
+    .info{
+        flex: 1 1 0%;
+        overflow: hidden;
+        .title{
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            .name {
+                overflow: hidden;
+                text-overflow: ellipsis;
+                font-size: 16px;
+                display: -webkit-box;
+                -webkit-line-clamp: 2;
+                -webkit-box-orient: vertical;
+                color: #333;
+                font-weight: 900;
+            }
+        }
+        .price-right{
+            text-align: right;
+            color: #ff5a25;
+            margin-top: 10px;
+            font-size: 14px;
+            text {
+                font-size: 15px;
+                font-weight: 800;
+            }
+        }
+        .tags {
+            color: #94a3b8;
+            font-size: 12px;
+            margin: 5px 0;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            .price {
+                font-size: 14px;
+                color: #475569;
+                font-weight: 600;
+            }
+        }
+    }
+}
+</style>

+ 44 - 1
src/views/service/chat/components/asideRight.vue

@@ -43,6 +43,9 @@
                                 <div class="order-btn-group">
                                     <div class="status primary cus" @click="sendAddress(item)" v-if="item.status=='1' && userInfo.trade == '2'">发起预约</div>
                                     <div class="status info cus" @click="editAddress(item)" v-if="item.status=='1' && userInfo.trade == '2'">代客预约</div>
+                                    <div class="status info cus" @click="editAddress2(item)" v-if="item.status=='7' && userInfo.trade == '2'">修改地址</div>
+                                    <div class="status warn cus" @click="orderRefund(item)" v-if="item.status=='7' && userInfo.trade == '2'">发起退款</div>
+                                    <div class="status success cus" @click="doneOrder(item)" v-if="item.status=='7' && userInfo.trade == '2'">核销</div>
                                     <!-- <div class="status warn cus" v-if="item.product.product_type==11 && item.custom_price > 0 && item.custom_status ==0" @click="submitPrice(item)">补差价</div>
                                     <div class="status danger cus" v-if="item.product.product_type==11 && item.custom_price > 0 && item.custom_status ==0" @click="submitPrice(item)">改差价</div> -->
                                     <div class="status danger cus" @click="sendOrder(item)">发送订单</div>
@@ -140,15 +143,17 @@
     </div>
     <orderDetail ref="orderDetail" @success="orderSuccess"></orderDetail>
     <keepsMain ref="keepsMain" @success="orderSuccess"></keepsMain>
+    <addressMain ref="addressMain" @success="orderSuccess"></addressMain>
 </template>
 
 <script>
 import orderDetail from '@/components/imFloat/order';
 import keepsMain from './keeps';
+import addressMain from './address';
 export default {
     components:{
         orderDetail,
-        keepsMain
+        keepsMain,addressMain
     },
     data(){
         return {
@@ -183,6 +188,11 @@ export default {
         searchOrder(){
             this.getOrderList();
         },
+        editAddress2(data){
+            this.$nextTick(() => {
+                this.$refs.addressMain.open("add").setData(data)
+            })
+        },
         async getMsgOrder(){
             if (!this.chatData) return ;
             this.msgOrderLoad = true;
@@ -197,6 +207,39 @@ export default {
                 this.getOrderList()
             }
         },
+        orderRefund(data){
+            this.$confirm(`该操作退款为直接为订单申请退款,无需用户二次操作,如已发快递,请确保已拦截成功后再操作`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var loading = this.$loading();
+                var resp = await this.$API.merOrder.refundUser.post({"order":data.out_order_no,});
+                loading.close();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(() => {
+
+            })
+        },
+        doneOrder(data){
+            this.$confirm(`核销后,订单不再支持退款,确定要执行吗`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var resp = await this.$API.merOrder.doneMini.post({"order":data.out_order_no});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(() => {
+
+            })
+        },
+        orderSuccess(){
+            this.getOrderList()
+        },
         async getOrderList(){
             this.orderData.loading = true;
             // var resp = await this.$API.merOrder.list.get({"page":this.orderData.page,"pageSize":this.orderData.size,"order":this.orderData.order});

+ 23 - 5
src/views/service/chat/components/goodOff.vue

@@ -69,7 +69,8 @@
                                         fit="cover"></el-image>
                                     </div>
                                     <div class="name">
-                                        <span>{{ scope.row.goods.product_name }}</span>
+                                        <span v-if="scope.row.goods.is_new == 1">{{scope.row.goods.price}}元代{{scope.row.goods.line_price}}元商场权益券{{ scope.row.goods.product_name }}</span>
+                                        <span v-else>{{ scope.row.goods.product_name }}</span>
                                         <span class="dec">商品ID:{{ scope.row.goods.goods_id }}</span>
                                     </div>
                                 </div>
@@ -131,7 +132,8 @@
                                         fit="cover"></el-image>
                                     </div>
                                     <div class="name">
-                                        <span>{{ scope.row.goods.product_name }}</span>
+                                        <span v-if="scope.row.goods.is_new == 1">{{scope.row.goods.price}}元代{{scope.row.goods.line_price}}元商场权益券{{ scope.row.goods.product_name }}</span>
+                                        <span v-else>{{ scope.row.goods.product_name }}</span>
                                         <span class="dec">商品ID:{{ scope.row.goods.goods_id }}</span>
                                     </div>
                                 </div>
@@ -183,9 +185,7 @@ export default{
             visible: false,
             isSaveing: false,
             formData:{},
-            searchKey:{
-                status:1
-            },
+            searchKey:{},
             selectData:[]
         }
     },
@@ -245,6 +245,7 @@ export default{
         //表单注入数据
         setData(data){
             this.formData = data;
+            this.searchKey.goods = data.life_goods_id;
         },
     }
 }
@@ -319,4 +320,21 @@ export default{
     transition: transform .15s ease-in 50ms;
     transform-origin: center;
 }
+
+.goods-img{display: flex;gap: 5px;}
+.goods-img .name span{display: block;}
+.goods-img .name span.dec{color: #999;font-size: 12px;}
+.goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
+.goods-price .del{text-decoration: line-through;}
+.goods-price span{background-color: #fff !important;
+    border: 1px solid #d3d9e0 !important;
+    border-radius: 4px;
+    box-sizing: border-box;
+    color: #6c737a !important;
+    display: inline-flex;
+    flex: none;
+    font-size: 12px;
+    line-height: 18px !important;
+    padding: 1px 6px !important;text-decoration: none;}
+.flex{display: flex;align-items: center;gap: 5px;}
 </style>

+ 11 - 5
src/views/service/chat/components/keeps.vue

@@ -40,7 +40,7 @@
                                         </div>
                                         <div class="tags">
                                             <div></div>
-                                            <div class="price">x{{ item.number }}</div>
+                                            <div class="price">x1</div>
                                         </div>
                                     </div>
                                 </div>
@@ -77,7 +77,7 @@
             </el-footer>
         </el-container>
     </el-drawer>
-    <goodsMain ref="goodsMain" :multiple="false"></goodsMain>
+    <goodsMain ref="goodsMain" :multiple="false" @success="handleStore"></goodsMain>
 </template>
 
 <script>
@@ -129,9 +129,9 @@ export default {
             this.visible = true;
             return this
         },
-        selectGoods(data){
+        selectGoods(){
             this.$nextTick(() => {
-                this.$refs.goodsMain.open("add").setData(data)
+                this.$refs.goodsMain.open("add").setData(this.formOrder)
             })
         },
         async getCityData(){
@@ -142,6 +142,10 @@ export default {
             const nodes = this.$refs.cascaderRef.getCheckedNodes()
             this.formData.cityLabel = nodes[0].pathLabels
         },
+        handleStore(data){
+            this.doneGoods = [];
+            this.doneGoods.push(data);
+        },
         //表单注入数据
         setData(data){
             this.formOrder = JSON.parse(JSON.stringify(data));
@@ -164,8 +168,9 @@ export default {
             var validate = await this.$refs.dialogForm.validate().catch(()=>{});
             if(!validate){ return false }
             this.isSaveing = true;
-            this.formData.order = this.OrderData.out_order_no;
+            this.formData.order = this.orderData.out_order_no;
             let submitData = JSON.parse(JSON.stringify(this.formData));
+            submitData.goods = JSON.stringify(this.doneGoods);
             var resp = await this.$API.merOrder.address.post(submitData);
             this.isSaveing = false;
             if (resp.code == 0) {
@@ -204,6 +209,7 @@ export default {
 	color: #475569;
 	border-radius: 5px;
     cursor: pointer;
+    margin-top: 10px;
 }
 .item-goods{
     background-color: #fff;

+ 7 - 1
src/views/service/order/index/components/option.vue

@@ -2,7 +2,7 @@
     <div class="op-header-no">
         <div class="left-panel">
             <template v-if="trade==2">
-                <sc-file-import :apiObj="$API.system.tasks.import" title="导入快递单号" templateUrl="https://tran.jsshuita.cn/download/express-example.xlsx" accept=".xls, .xlsx" :maxSize="30" tip="请上传小于或等于 30M 的 .xls, .xlsx 格式文件" @success="importSuccess">
+                <sc-file-import ref="importMain" :apiObj="$API.system.tasks.import" title="导入快递单号" templateUrl="https://tran.jsshuita.cn/download/express-example.xlsx" accept=".xls, .xlsx" :maxSize="30" tip="请上传小于或等于 30M 的 .xls, .xlsx 格式文件" @success="importSuccess">
                     <template #default="{open}">
                         <el-button type="primary" icon="sc-icon-upload" @click="open">导入快递单号</el-button>
                     </template>
@@ -45,6 +45,12 @@ export default {
         table_add(){
             this.$router.push('/merchant/goods/add')
         },
+        importSuccess(data){
+            if (data.code == 200) {
+                this.$message.success(data.msg);
+            }
+            this.$refs.importMain.close()
+        },
         table_sync(){
             this.$confirm(`发起同步后,请耐心等待1-2分钟后再刷新当前数据列表`, '提示', {
                 type: 'warning'

+ 1 - 1
src/views/service/order/index/components/search.vue

@@ -20,7 +20,7 @@
                         <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
                             <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
                                 <el-option value="2" label="待使用"></el-option>
-                                <el-option value="3" label="已完成"></el-option>
+                                <el-option value="3" label="已核销"></el-option>
                                 <el-option value="4" label="已退款"></el-option>
                                 <el-option value="5" label="退款中"></el-option>
                                 <el-option value="7" label="部分退款"></el-option>

+ 3 - 4
src/views/service/order/index/components/table.vue

@@ -90,8 +90,7 @@
                     <span>待使用</span>
                 </div>
                 <div class="order-name" v-if="scope.row.status == 2">
-                    <span v-if="scope.row.is_error == 1" style="color: #f00;">异常</span>
-                    <span v-else>已完成</span>
+                    <span>已核销</span>
                 </div>
                 <div class="order-name" v-if="scope.row.status == 3">
                     <span>已退款</span>
@@ -111,7 +110,7 @@
                 </div>
                 <div class="order-name" v-if="scope.row.status == 7">
                     <span>履约中</span>
-                    <span class="dec">货物运输中</span>
+                    <span class="dec">{{scope.row.express_status==2?'货物运输中':'等待发货'}}</span>
                 </div>
                 <!-- 发货后退款 -->
                 <div class="order-name" v-if="scope.row.status == 8">
@@ -172,7 +171,7 @@
                     <el-button type="danger" size="small" text @click="table_done(scope.row)" v-if="scope.row.status==7 && scope.row.is_new==1">核销</el-button>
                 </el-button-group>
                 <el-button-group>
-                    <el-button type="primary" size="small" text @click="table_express(scope.row)" v-if="scope.row.status==1">发货</el-button>
+                    <el-button type="primary" size="small" text @click="table_express(scope.row)" v-if="scope.row.status==7 && scope.row.express_status==1">发货</el-button>
                     <el-button type="danger" size="small" text @click="table_black(scope.row)">拉黑</el-button>
                 </el-button-group>
             </template>

+ 7 - 0
src/views/service/order/refund/index.vue

@@ -0,0 +1,7 @@
+<template>
+
+</template>
+
+<script>
+
+</script>