zory 1 ماه پیش
والد
کامیت
f3052036e7

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

@@ -44,4 +44,18 @@ export default {
             return await http.post(this.url, data);
         },
     },
+    refund: {
+        url: `${config.API_URL}/mer/order/refund`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+    fail: {
+        url: `${config.API_URL}/mer/order/fail`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
 }

+ 2 - 2
src/views/manage/components/agent.vue

@@ -33,7 +33,7 @@
                             <div class="checkbox"></div>
                         </el-table-column>
                         <el-table-column label="店铺名称" width="200" fixed="left" prop="shop_name"></el-table-column>
-                        <el-table-column label="店铺编码" prop="agent_id" width="200"></el-table-column>
+                        <el-table-column label="店铺编码" prop="shop_id" width="200"></el-table-column>
                         <el-table-column label="营业时间" prop="agent" width="150">
                             <template #default="scope">
                                 <span v-if="scope.row.start_at">{{ scope.row.start_at }}-{{ scope.row.end_at }}</span>
@@ -86,7 +86,7 @@
                         <el-table-column type="selection" width="50" fixed="left"></el-table-column>
                         
                         <el-table-column label="店铺名称" width="200" fixed="left" prop="shop_name"></el-table-column>
-                        <el-table-column label="店铺编码" prop="agent_id" width="200"></el-table-column>
+                        <el-table-column label="店铺编码" prop="shop_id" width="200"></el-table-column>
                         <el-table-column label="营业时间" prop="agent" width="150">
                             <template #default="scope">
                                 <span v-if="scope.row.start_at">{{ scope.row.start_at }}-{{ scope.row.end_at }}</span>

+ 28 - 0
src/views/manage/member/index/components/search.vue

@@ -7,6 +7,16 @@
             <div class="search-form">
                 <div class="form-left">
                     <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="6">
+                            <el-input v-model="searchKey.shop" placeholder="请选择店铺" clearbale readonly :style="{width:'100%'}" @click="selectStore">
+                                <template #append>
+                                    <el-tooltip effect="dark" content="点这里,清除选择" placement="top-start">
+                                        <div class="remove-a" @click="clearStore">清除</div>
+                                    </el-tooltip>
+                                </template>
+                                <template #prepend>选择店铺</template>
+                            </el-input>
+                        </el-col>
                         <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
                             <el-input v-model="searchKey.orderid" placeholder="会员卡号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
                                 <template #prepend>会员卡号</template>
@@ -24,16 +34,34 @@
             </div>
         </el-form>
     </fieldset>
+    <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
 </template>
 
 <script>
+import storeData from '@/views/manage/components/store';
 export default {
+    components: {
+        storeData
+    },
     data(){
         return {
             searchKey:{}
         }
     },
     methods: {
+        selectStore(){
+            this.$nextTick(()=>{
+                this.$refs.storeData.open()
+            })
+        },
+        handleStore(data){
+            this.searchKey.shop = data.shop_id;
+            this.$emit("success",this.searchKey);
+        },
+        clearStore(){
+            this.searchKey.shop = "";
+            this.$emit("success",this.searchKey);
+        },
         searchForm(){
             this.$emit("success",this.searchKey);
         }

+ 6 - 0
src/views/manage/member/index/components/table.vue

@@ -3,6 +3,12 @@
         <el-table-column type="selection" width="50" fixed="left"></el-table-column>
         <el-table-column label="会员ID" prop="openid" width="220" fixed="left"></el-table-column>
         <el-table-column label="会员卡号" prop="card_no"></el-table-column>
+        <el-table-column label="所属店铺" prop="money">
+            <template #default="scope">
+                <span v-if="scope.row.shop">{{ scope.row.shop.shop_name }}</span>
+                <span v-else>-</span>
+            </template>
+        </el-table-column>
         <el-table-column label="总充值金额" prop="money">
             <template #default="scope">
                 <el-tag>{{ $TOOL.money(scope.row.total_balance) }}</el-tag>

+ 17 - 8
src/views/manage/order/index/components/detail.vue

@@ -44,7 +44,7 @@
                 <el-descriptions :column="2" size="large" direction="vertical" class="mt10" border>
                     <el-descriptions-item>
                         <template #label>支付金额(元)</template> 
-                        <div class="price" v-if="formData.discount > 0">
+                        <div class="price" v-if="formData.money > formData.discount">
                             {{ $TOOL.money(formData.discount) }}
                             <div class="del">{{ $TOOL.money(formData.money) }}</div>
                         </div>
@@ -63,7 +63,18 @@
                     </el-descriptions-item>
                 </el-descriptions>
                 <el-table :data="tableData" style="width: 100%" border class="mt10">
-                    <el-table-column label="文件名" prop="name" width="260" fixed="left"></el-table-column>
+                    <el-table-column label="文件名" prop="name" width="180" fixed="left"></el-table-column>
+                    <el-table-column label="状态" prop="name">
+                        <template #default="scope">
+                            <span v-if="scope.row.status==0">转码中</span>
+                            <span v-if="scope.row.status==1">待打印</span>
+                            <span v-if="scope.row.status==2">打印中</span>
+                            <span v-if="scope.row.status==3">已打印</span>
+                            <span v-if="scope.row.status==4">退款中</span>
+                            <span v-if="scope.row.status==5">退款失败</span>
+                            <span v-if="scope.row.status==6">已退款</span>
+                        </template>
+                    </el-table-column>
                     <el-table-column label="页数" prop="page" align="center"></el-table-column>
                     <el-table-column label="纸张" prop="paper_size"></el-table-column>
                     <el-table-column label="颜色" prop="name">
@@ -95,12 +106,7 @@
                     <el-table-column label="操作" width="160" align="right" fixed="right">
                         <template #default="scope">
                             <el-button-group>
-                                <el-button text type="warning" size="small" @click="table_edit(scope.row)">预览/下载</el-button>
-                                <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
-                                    <template #reference>
-                                        <el-button text type="danger" size="small">退款</el-button>
-                                    </template>
-                                </el-popconfirm>                    
+                                <el-button text type="warning" size="small" @click="table_edit(scope.row)">预览/下载</el-button>             
                             </el-button-group>
                         </template>
                     </el-table-column>
@@ -144,6 +150,9 @@ export default {
             this.formData = data;
             this.tableData = data.detail;
         },
+        table_edit(data){
+            console.log(data.path)
+        }
     }
 }
 </script>

+ 15 - 1
src/views/manage/order/index/components/table.vue

@@ -6,6 +6,11 @@
                 {{scope.row.order_sn}}
             </template>
         </el-table-column>
+        <el-table-column label="下单店铺" prop="openid" width="180">
+            <template #default="scope">
+                {{ scope.row.shop?scope.row.shop.shop_name:'-' }}
+            </template>
+        </el-table-column>
         <el-table-column label="下单用户" prop="openid" width="220"></el-table-column>
         <el-table-column label="订单状态" prop="certificate_id" width="120">
             <template #default="scope">
@@ -30,7 +35,7 @@
         </el-table-column>
         <el-table-column label="支付类型" prop="money" width="120">
             <template #default="scope">
-                <el-tag>{{ payStatus[scope.row.status] }}</el-tag>
+                <el-tag>{{ payStatus[scope.row.pay_type] }}</el-tag>
             </template>
         </el-table-column>
         <el-table-column label="打印机" prop="money" width="180">
@@ -67,6 +72,7 @@
         <el-table-column label="操作" width="160" align="right" fixed="right">
             <template #default="scope">
                 <el-button-group>
+                    <el-button text type="info" size="small" v-if="scope.row.status==1" @click="table_fail(scope.row)">失败</el-button>
                     <el-button text type="warning" size="small" @click="table_edit(scope.row)">详情</el-button>
                     <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
                         <template #reference>
@@ -112,6 +118,14 @@ export default {
                 this.$emit("total",resp.data.total,this.searchKey);
             }
         },
+        async table_fail(data){
+            var resp = await this.$API.mOrder.fail.post({order:data.order_sn});
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg)
+            }
+            this.$message.success(resp.msg)
+            this.$refs.table.refresh()
+        },
         table_edit(data){
             this.$nextTick(() => {
                 this.$refs.formMain.open("edit",this.type).setData(data)

+ 5 - 1
src/views/manage/order/qrcode/components/table.vue

@@ -1,7 +1,11 @@
 <template>
     <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
         <el-table-column type="selection" width="50" fixed="left"></el-table-column>
-        
+        <el-table-column label="下单店铺" prop="openid" width="180">
+            <template #default="scope">
+                {{ scope.row.shop?scope.row.shop.shop_name:'-' }}
+            </template>
+        </el-table-column>
         <el-table-column label="订单编号" prop="order_sn">
             <template #default="scope">
                 {{scope.row.order_sn}}

+ 7 - 0
src/views/manage/setting/basic/index.vue

@@ -24,6 +24,10 @@
                                 <el-input v-model="sys.copyright" placeholder="请输入" clearable />
                                 <div class="el-form-item-msg"></div>
                             </el-form-item>
+                            <el-form-item label="软件版本号" prop="version" class="label-item">
+                                <el-input v-model="sys.version" placeholder="请输入" clearable />
+                                <div class="el-form-item-msg">请勿乱改,否则影响打印软件的正常运行</div>
+                            </el-form-item>
                             <el-form-item label="隐私协议" prop="privacy" class="label-item">
                                 <sc-editor v-model="sys.privacy" placeholder="请输入" :height="400"></sc-editor>
                                 <div class="el-form-item-msg"></div>
@@ -147,6 +151,9 @@ export default {
                 title: [
                     { required: true, message: '请输入' }
                 ],
+                version: [
+                    { required: true, message: '请输入' }
+                ],
                 tel: [
                     { required: true, message: '请输入' }
                 ],

+ 1 - 1
src/views/manage/shop/index/components/combo.vue

@@ -60,7 +60,7 @@ export default {
             var validate = await this.$refs.dialogForm.validate().catch(()=>{});
             if(!validate){ return false }
             this.isSaveing = true;
-            this.submitData.shop_id = this.formData.agent_id;
+            this.submitData.shop_id = this.formData.shop_id;
             var resp = await this.$API.shop.combo.post(this.submitData);
             this.isSaveing = false;
             if (resp.code == 0) {

+ 5 - 0
src/views/manage/shop/index/components/table.vue

@@ -40,6 +40,11 @@
                 <span class="status-danger" v-else>未设置</span>
             </template>
         </el-table-column>
+        <el-table-column label="账户余额" prop="balance" width="200">
+            <template #default="scope">
+                {{ $TOOL.money(scope.row.balance) }}
+            </template>
+        </el-table-column>
         <el-table-column label="状态" prop="status" width="120" align="center">
             <template #default="scope">
                 <div class="status-success" v-if="scope.row.status==0"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>

+ 1 - 1
src/views/manage/shop/user/components/form.vue

@@ -106,7 +106,7 @@ export default {
     },
     methods:{
         handleSuccess(data){
-            this.formData.agent_id = data.agent_id;
+            this.formData.agent_id = data.shop_id;
         },
         clearUser(){
             this.formData.agent_id = "";

+ 18 - 4
src/views/merchant/order/index/components/detail.vue

@@ -44,7 +44,7 @@
                 <el-descriptions :column="2" size="large" direction="vertical" class="mt10" border>
                     <el-descriptions-item>
                         <template #label>支付金额(元)</template> 
-                        <div class="price" v-if="formData.discount > 0">
+                        <div class="price" v-if="formData.money > formData.discount">
                             {{ $TOOL.money(formData.discount) }}
                             <div class="del">{{ $TOOL.money(formData.money) }}</div>
                         </div>
@@ -92,15 +92,26 @@
                             {{ $TOOL.money(scope.row.money) }}
                         </template>
                     </el-table-column>
-                    <el-table-column label="操作" width="160" align="right" fixed="right">
+                    <el-table-column label="状态" prop="name">
+                        <template #default="scope">
+                            <span v-if="scope.row.status==0">转码中</span>
+                            <span v-if="scope.row.status==1">待打印</span>
+                            <span v-if="scope.row.status==2">打印中</span>
+                            <span v-if="scope.row.status==3">已打印</span>
+                            <span v-if="scope.row.status==4">退款中</span>
+                            <span v-if="scope.row.status==5">退款失败</span>
+                            <span v-if="scope.row.status==6">已退款</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="操作" width="120" align="right" fixed="right">
                         <template #default="scope">
                             <el-button-group>
                                 <el-button text type="warning" size="small" @click="table_edit(scope.row)">预览/下载</el-button>
-                                <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
+                                <!-- <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
                                     <template #reference>
                                         <el-button text type="danger" size="small">退款</el-button>
                                     </template>
-                                </el-popconfirm>                    
+                                </el-popconfirm>                     -->
                             </el-button-group>
                         </template>
                     </el-table-column>
@@ -144,6 +155,9 @@ export default {
             this.formData = data;
             this.tableData = data.detail;
         },
+        table_edit(data){
+            console.log(data.path)
+        }
     }
 }
 </script>

+ 10 - 6
src/views/merchant/order/index/components/table.vue

@@ -28,9 +28,9 @@
                 {{ $TOOL.money(scope.row.extra_money) }}
             </template>
         </el-table-column>
-        <el-table-column label="支付类型" prop="money" width="120">
+        <el-table-column label="支付方式" prop="money">
             <template #default="scope">
-                <el-tag>{{ payStatus[scope.row.status] }}</el-tag>
+                <el-tag>{{ payStatus[scope.row.pay_type] }}</el-tag>
             </template>
         </el-table-column>
         <el-table-column label="打印机" prop="money" width="180">
@@ -68,11 +68,12 @@
             <template #default="scope">
                 <el-button-group>
                     <el-button text type="warning" size="small" @click="table_edit(scope.row)">详情</el-button>
-                    <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
+                    <el-button text type="danger" size="small" @click="table_del(scope.row, scope.$index)">退款</el-button>
+                    <!-- <el-popconfirm title="确定要退款吗?" @confirm="table_del(scope.row, scope.$index)" v-if="scope.row.status > 0">
                         <template #reference>
                             <el-button text type="danger" size="small">退款</el-button>
                         </template>
-                    </el-popconfirm>                    
+                    </el-popconfirm>     -->                
                 </el-button-group>
             </template>
         </el-table-column>
@@ -83,6 +84,9 @@
 <script>
 import formMain from "./detail";
 export default {
+    components: {
+        formMain
+    },
     props: {
         type: { type: String, default: "1" }
     },
@@ -118,8 +122,8 @@ export default {
             })
         },
         table_del(data){
-            this.$confirm("确定要删除该数据吗?","删除确认",{type: 'warning'}).then(async ()=>{
-                var resp = await this.$API.mPrice.del.post({"id":data.id,"type":""});
+            this.$confirm("确定要对整笔订单进行退款吗","退款确认",{type: 'warning'}).then(async ()=>{
+                var resp = await this.$API.mOrder.refund.post({"id":data.id});
                 if (resp.code == 0) {
                     return this.$message.error(resp.msg)
                 }