zory 1 неделя назад
Родитель
Сommit
9fb4be2925

+ 7 - 0
src/api/model/merGoods.js

@@ -37,6 +37,13 @@ export default {
             return await http.post(this.url, params);
             return await http.post(this.url, params);
         },
         },
     },
     },
+    off: {
+        url: `${config.API_URL}/merchant/goods/off`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
     batch: {
     batch: {
         url: `${config.API_URL}/merchant/goods/batch`,
         url: `${config.API_URL}/merchant/goods/batch`,
         name: "-",
         name: "-",

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

@@ -16,4 +16,11 @@ export default {
             return await http.get(this.url, params);
             return await http.get(this.url, params);
         },
         },
     },
     },
+    done: {
+        url: `${config.API_URL}/merchant/order/done`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
 }
 }

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

@@ -128,7 +128,7 @@
                 </div>
                 </div>
             </el-main>
             </el-main>
             <el-footer v-if="orderData && orderData.status == 1">
             <el-footer v-if="orderData && orderData.status == 1">
-                <el-button size="large" type="primary" @click="submit()">手动核销订单</el-button>
+                <el-button size="large"  :loading="isDoneing" type="primary" @click="doneOrder()">手动核销订单</el-button>
             </el-footer>
             </el-footer>
         </el-container>
         </el-container>
     </el-drawer>
     </el-drawer>
@@ -140,6 +140,7 @@ export default {
         return {
         return {
             loading: false,
             loading: false,
             isSaveing: false,
             isSaveing: false,
+            isDoneing:false,
             mode:"add",
             mode:"add",
             titleMap:{
             titleMap:{
                 add:"订单详情",
                 add:"订单详情",
@@ -161,6 +162,21 @@ export default {
             this.formData = JSON.parse(JSON.stringify(data));
             this.formData = JSON.parse(JSON.stringify(data));
             this.getOrderDetail()
             this.getOrderDetail()
         },
         },
+        doneOrder(){
+            this.$confirm(`手动核销订单后,该订单不支持线上退款,如需退款请线下沟通后进行`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                this.isDoneing = true;
+                var resp = await this.$API.merOrder.done.post({"id":this.orderData.order_sn});
+                this.isDoneing = false;
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.visible = false;
+                this.$emit("success");
+            }).catch(()=>{})
+        },
         async getOrderDetail(){
         async getOrderDetail(){
             var resp = await this.$API.merOrder.detail.get({"order":this.formData.order});
             var resp = await this.$API.merOrder.detail.get({"order":this.formData.order});
             if (resp.code == 0) {
             if (resp.code == 0) {

+ 16 - 1
src/views/merchant/goods/index/components/table.vue

@@ -51,8 +51,11 @@
             </template>
             </template>
         </el-table-column>
         </el-table-column>
         <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
         <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
-        <el-table-column label="操作" width="140" align="left" fixed="right">
+        <el-table-column label="操作" width="180" align="left" fixed="right">
             <template #default="scope">
             <template #default="scope">
+                <el-button-group>
+                    <el-button size="warning" text @click="table_life(scope.row)">来客下架</el-button>
+                </el-button-group>
                 <el-button-group>
                 <el-button-group>
                     <el-button size="small" text @click="table_view(scope.row)">编辑</el-button>
                     <el-button size="small" text @click="table_view(scope.row)">编辑</el-button>
                     <el-button type="danger" text size="small" @click="table_del(scope.row)">删除</el-button>
                     <el-button type="danger" text size="small" @click="table_del(scope.row)">删除</el-button>
@@ -86,6 +89,18 @@ export default {
                 this.$refs.comboMain.open("edit").setData(data)
                 this.$refs.comboMain.open("edit").setData(data)
             })
             })
         },
         },
+        table_life(data){
+            this.$confirm(`来客下架成功后,在小程序中将不展示该商品,同时也将无法二次上架`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var resp = await this.$API.merGoods.off.post({"id":data.id});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(()=>{})
+        },
         table_view(data){
         table_view(data){
             this.$router.push({path:"/merchant/goods/edit",query:{"product_id":data.product_id,"id":data.id,"spm":(new Date()).getTime()}})
             this.$router.push({path:"/merchant/goods/edit",query:{"product_id":data.product_id,"id":data.id,"spm":(new Date()).getTime()}})
         },
         },

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

@@ -137,6 +137,9 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
+        orderSuccess(){
+            this.$refs.table.refresh()
+        },
         table_view(data){
         table_view(data){
             this.$nextTick(() => {
             this.$nextTick(() => {
                 data.order = data.out_order_no
                 data.order = data.out_order_no