浏览代码

优化了部分代码

wzy 10 月之前
父节点
当前提交
0422ff71f0

+ 19 - 0
src/api/business.js

@@ -247,4 +247,23 @@ export function getAllCategoryClassTree(data) {
     data,
     method: "get"
   })
+}
+
+
+//  分页查询商家的收款码
+export function getAllPaymentCode(data) {
+  return request({
+    url: "/paymentCode/getAll",
+    data,
+    method: "post"
+  })
+}
+
+//  禁用该收款码
+export function disablePaymentCode(data) {
+  return request({
+    url: "/paymentCode/handle",
+    data,
+    method: "post"
+  })
 }

+ 8 - 0
src/api/order.js

@@ -54,4 +54,12 @@ export function halfOrder(data){
     method: 'post',
     data,
   })
+}
+
+//  重新提交半子订单
+export function halfOrderRe(id){
+  return request({
+    url:"/order/reSubmitBanziOrder/"+id,
+    method: 'put',
+  })
 }

+ 6 - 0
src/views/brandFactory/factoryList/index.vue

@@ -223,6 +223,9 @@
                   <el-input :disabled="disabled" autosize maxlength="250" show-word-limit type="textarea"
                     placeholder="请输入商家简介" v-model="ruleForm.shopBrief" closeable></el-input>
                 </el-form-item>
+                <el-form-item label="惠市宝商家编号">
+                  <el-input ref="addressCls" v-model="ruleForm.hsbMrchId" maxlength="60" :disabled="disabled" />
+                </el-form-item>
 
                 <el-form-item prop="label" label="描述标签">
                   <el-input :disabled="disabled" autosize maxlength="250" show-word-limit type="textarea"
@@ -230,6 +233,7 @@
                     closeable></el-input>
                 </el-form-item>
 
+
                 <el-form-item prop="advertisement" label="广告图">
                   <el-upload :disabled="disabled" class="avatar-uploader" list-type="picture-card"
                     :file-list="advertisementList" :action="action" :on-success="handleAvatarSuccess"
@@ -346,6 +350,7 @@ export default {
         advertisement: '',
         classificationId: null, // 商家分类id
         startTime: "",
+        hsbMrchId:'',  // 惠市宝商家编号,不是必填
         endTime: "",
         shopBrief: '', // 商家簡介
         annualLimit: '', // 经营年限 
@@ -591,6 +596,7 @@ export default {
         shopPassword: '', // 密码
         advertisement: '', // 广告图
         areaId: '', // 区域id
+        hsbMrchId:'',
         longitude: '', // 经纬度
         latitude: '', // 经纬度
         annualLimit: '', // 经营年限

+ 5 - 0
src/views/business/businessList/index.vue

@@ -235,6 +235,9 @@
                     <template slot="append">%</template>
                   </el-input>
                 </el-form-item>
+                <el-form-item label="惠市宝商家编号">
+                  <el-input ref="addressCls" v-model="ruleForm.hsbMrchId" maxlength="60" :disabled="disabled" />
+                </el-form-item>
                 <el-form-item label="直播间审核" prop="auditLive">
                   <el-radio-group v-model="ruleForm.auditLive">
                     <el-radio :disabled="disabled" :label="1">
@@ -381,6 +384,7 @@ export default {
         effectiveDate: '', // 生效日期
         effectiveYear: '', // 生效年限
         contractState: 1, // 合同状态 1-有效 0-无效
+        hsbMrchId:'',  // 惠市宝商家编号,不是必填
         auditLive: 1,
         isBeeCoin:2,
         auditLiveProduct: 1,
@@ -535,6 +539,7 @@ export default {
         shopPassword: '', // 密码
         advertisement: '', // 广告图
         areaId: '', // 区域id
+        hsbMrchId:'',
         longitude: '', // 经纬度
         latitude: '', // 经纬度
       }

+ 148 - 0
src/views/business/paymentCode/index.vue

@@ -0,0 +1,148 @@
+<template>
+    <div class="paymentCode">
+        <div class="paymentCode-select">
+            <el-form :inline="true" :model="payQuery">
+                <el-form-item label="收款码状态">
+                    <el-select v-model="payQuery.state" placeholder="请选择">
+                        <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" @click="getAllPay()">查询</el-button>
+                </el-form-item>
+            </el-form>
+           
+        </div>
+        <div class="paymentCode-table">
+            <el-table ref="multipleTable" :data="tableData" border
+                :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark"
+                style="width: 100%" v-loading="loading">
+                <el-table-column label="商家名称" width="220" align="center">
+                    <template slot-scope="scope">{{ scope.row.shopName }}</template>
+                </el-table-column>
+                <el-table-column prop="codeImage" label="商家收款码" align="center">
+                    <template slot-scope="scope">
+                        <img :src="scope.row.codeImage" alt="" style="width: 120px; height: 120px;">
+                    </template>
+                </el-table-column>
+                <el-table-column prop="state" label="收款码状态" align="center">
+                    <template slot-scope="scope">{{ scope.row.state == 1 ? '已启用' : '已禁用' }}</template>
+                </el-table-column>
+                <el-table-column prop="createTime" label="创建时间" align="center" />
+                <el-table-column label="操作" align="center" show-overflow-tooltip>
+                    <template slot-scope="scope">
+                        <div class="btnList">
+                            <template v-if="scope.row.state == 1">
+                                <el-button type="text" @click="handleDel(scope.row, 2)">禁用该收款码</el-button>
+                            </template>
+                            <template v-if="scope.row.state == 2">
+                                <el-button type="text" @click="handleDel(scope.row, 1)">启用该收款码</el-button>
+                            </template>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <div class="fenye">
+            <el-pagination :current-page="payQuery.page" :page-sizes="[5, 10, 15, 20]" :page-size="10"
+                layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
+                @current-change="handleCurrentChange" />
+        </div>
+    </div>
+</template>
+
+<script>
+import { getAllPaymentCode, disablePaymentCode } from '@/api/business'
+export default {
+    created() {
+        this.getAllPay()
+    },
+    data() {
+        return {
+            tableData: [],
+            total: null,
+            //  获取收款码的参数
+            payQuery: {
+                codeType: '',
+                state: '',
+                page: 1,
+                pageSize: 5
+            },
+            typeList:[
+                {
+                    label:'全部',
+                    value:''
+                },
+                {
+                    label:'启用',
+                    value:1
+                },
+                {
+                    label:'禁用',
+                    value:2
+                }
+            ],
+            loading: false
+        }
+    },
+    methods: {
+        async getAllPay() {
+            this.loading = true
+            try {
+                let res = await getAllPaymentCode(this.payQuery)
+                this.tableData = res.data.list
+                this.total = res.data.total
+            } catch (error) {
+                console.log(error);
+            } finally {
+                this.loading = false
+            }
+
+        },
+        handleSizeChange(val) {
+            this.payQuery.pageSize = val
+            this.getAllPay()
+        },
+        handleCurrentChange() {
+            this.payQuery.page = val
+            this.getAllPay()
+        },
+        //  启用禁用收款码
+        handleDel(row, state) {
+            this.$confirm('此操作将操作该收款码, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(async () => {
+                let result = await disablePaymentCode({ codeId: row.codeId, state: state })
+                if (result.code == '') {
+                    this.$message({
+                        type: 'success',
+                        message: '操作成功!'
+                    });
+                    this.getAllPay()
+                }
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '已取消操作'
+                });
+            });
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.paymentCode {
+    padding: 50px;
+
+    .fenye {
+        margin: 30px auto;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+    }
+}
+</style>

+ 77 - 23
src/views/order/halfSon/index.vue

@@ -14,8 +14,9 @@
         </div>
         <!-- 表格 -->
         <div class="tableBox">
-            <el-table ref="multipleTable" v-loading="tableLoading" :data="tableData" border stripe :header-cell-style="{ background: '#EEF3FF', color: '#333333' }"
-          tooltip-effect="dark" style="width: 100%">
+            <el-table ref="multipleTable" v-loading="tableLoading" :data="tableData" border stripe
+                :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark"
+                style="width: 100%">
                 <el-table-column prop="orderId" label="订单id" width="150">
                 </el-table-column>
                 <el-table-column label="消息状态" width="250">
@@ -26,6 +27,16 @@
                         <span v-if="scope.row.code == -2">退款中</span>
                     </template>
                 </el-table-column>
+                <el-table-column label="半子消息状态" width="250">
+                    <template slot-scope="scope">
+                        <span v-if="scope.row.code == 1">下单成功</span>
+                        <span v-else-if="scope.row.code == -1">下单中</span>
+                        <span v-else-if="scope.row.code == -2">退款中</span>
+                        <span v-else-if="scope.row.code == 2">已退款</span>
+                        <span v-else-if="scope.row.code == 3">下单失败</span>
+                        <span v-else-if="scope.row.code == 5">已取消</span>
+                    </template>
+                </el-table-column>
                 <el-table-column prop="msg" label="消息" width="250">
                 </el-table-column>
                 <el-table-column prop="systemErro" label="系统错误" width="250">
@@ -34,64 +45,106 @@
                 </el-table-column>
                 <el-table-column prop="updateTime" label="订单更新时间" width="300">
                 </el-table-column>
+                <el-table-column label="操作">
+                    <template slot-scope="scope">
+                        <!-- <div v-if="scope.row.code == 3"> -->
+                        <el-button type="primary" v-if="scope.row.code == 3" plain
+                            @click="resubmit(scope.row.id)">重新提交半子订单</el-button>
+                        <!-- </div> -->
+                    </template>
+                </el-table-column>
             </el-table>
             <div class="fenye">
-          <el-pagination :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
-            @current-change="handleCurrentChange" />
-        </div> 
+                <el-pagination :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10"
+                    layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange" />
+            </div>
         </div>
     </div>
 </template>
 
 <script>
-import { halfOrder } from "@/api/order"
+import { halfOrder, halfOrderRe } from "@/api/order"
 export default {
     data() {
         return {
             tableData: [],
-            formInline:{
-                orderId:"",
-                page:1,
-                pageSize:10
+            formInline: {
+                orderId: "",
+                page: 1,
+                pageSize: 10
             },
-            total:0,
-            tableLoading:false
+            total: 0,
+            tableLoading: false
         }
     },
-    created(){
+    created() {
         this.getHalfOrder()
     },
     methods: {
         //  请求数据的函数
-        async getHalfOrder(){
+        async getHalfOrder() {
+            console.log("执行到这里了");
             //  开始加载状态
             this.tableLoading = true
             let res = await halfOrder(this.formInline);
             const { data } = res
             this.tableData = data.records
-            this.total = data.records.length
+            this.total = data.total
             this.tableLoading = false
         },
         //  条数的改变事件
-        handleSizeChange(val){
+        handleSizeChange(val) {
             this.formInline.pageSize = val
             this.getHalfOrder()
         },
-        
+
         //  分页的点击事件
-        handleCurrentChange(val){
+        handleCurrentChange(val) {
             this.formInline.page = val
             this.getHalfOrder()
         },
         //  查询订单
-        searchOrder(){
+        searchOrder() {
             this.getHalfOrder()
         },
         //  重置订单
-        resetData(){
+        resetData() {
             this.formInline.orderId = ""
             this.getHalfOrder()
+        },
+        //  重新提交半子订单
+        resubmit(id) {
+            this.$confirm('此操作将重新提交半子订单, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(async () => {
+                // let res = await;
+                await halfOrderRe(id).then(res=>{
+                    console.log(res);
+                    if(res.code == ''){
+                        this.$message({
+                            type: 'success',
+                            message: '半子订单提交成功!'
+                        }); 
+                    }
+                }).catch(err=>{
+                    // console.log(err,6666);
+                })
+                this.getHalfOrder()
+                
+                // console.log(res);
+                // this.$message({
+                //         type: 'success',
+                //         message: '半子订单提交成功!'
+                //     });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '已经取消重新提交'
+                });
+            });
         }
     },
 }
@@ -104,7 +157,8 @@ export default {
     .formSearch {
         margin-bottom: 30px;
     }
-    .fenye{
+
+    .fenye {
         display: flex;
         align-items: center;
         justify-content: center;
@@ -112,7 +166,7 @@ export default {
     }
 }
 
-::v-deep .el-table__cell{
+::v-deep .el-table__cell {
     text-align: center;
 }
 </style>

+ 6 - 0
src/views/order/pending/index.vue

@@ -69,6 +69,12 @@
           </el-table-column>
           <el-table-column prop="number" label="商品数量" width="100" />
           <el-table-column prop="orderFormid" label="订单编号" width="220" />
+          <el-table-column prop="scanType" label="订单类型" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span v-if="scope.row.scanType == 1">常规订单</span>
+              <span v-if="scope.row.scanType == 2">收款码订单</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="shopName" label="商户名称" width="220" show-overflow-tooltip />
           <el-table-column prop="customerName" label="下单账户" show-overflow-tooltip />
           <el-table-column prop="receiveName" label="收件人" show-overflow-tooltip />