wangning 5 роки тому
батько
коміт
fd1641111e
2 змінених файлів з 100 додано та 11 видалено
  1. 91 11
      pt/src/saas/shop/shop.vue
  2. 9 0
      pt/src/service/saas/shop/index.js

+ 91 - 11
pt/src/saas/shop/shop.vue

@@ -17,10 +17,56 @@
             <template #table-column-gatheringCode="{scope}">
             <template #table-column-gatheringCode="{scope}">
                 <el-button type="text" @click="gotoPage(1,scope.row)">查看</el-button>
                 <el-button type="text" @click="gotoPage(1,scope.row)">查看</el-button>
             </template>
             </template>
+            <!-- 充值 -->
+            <template #slot-apply="{scope}">
+              <el-button type="text" @click="topUp(scope.row.shopName, scope.row.id)">充值</el-button>
+            </template>
         </x-crud>
         </x-crud>
         <!-- 用户详情 -->
         <!-- 用户详情 -->
         <balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
         <balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
         <amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
         <amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
+        <el-dialog :visible.sync="wxPayDialog" :close-on-click-modal="false" width="500px" >
+        <el-form
+          :model="topForm"
+          :rules="ruleForm"
+          ref="adForm"
+          label-width="80px"
+          class="demo-form"
+        >
+        <el-form-item
+            label="充值门店"
+            style="text-align: left;"
+          >
+            <span>{{dialogTitle}}</span>
+          </el-form-item>
+          <el-form-item
+            label="充值金额"
+            prop="amount"
+            style="text-align: left;"
+          >
+            <el-input
+              placeholder="请输入充值金额"
+              size="small"
+              v-model="topForm.amount"
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            label="登录密码"
+            prop="password"
+            style="text-align: left;"
+          >
+            <el-input
+              placeholder="请输入登录密码"
+              size="small"
+              v-model="topForm.password"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button size="small" @click="resetForm">取 消</el-button>
+            <el-button type="primary" size="small" @click="submitForm">确认</el-button>
+          </div>
+        </el-dialog>
     </div>
     </div>
 </template>
 </template>
 
 
@@ -36,6 +82,17 @@
                 showBalanceDetail: false,
                 showBalanceDetail: false,
                 showAmountDetail: false,
                 showAmountDetail: false,
                 optionData: {},
                 optionData: {},
+                wxPayDialog: false,
+                dialogTitle: '',
+                topForm: {
+                  shopId: '',
+                  amount: '',
+                  password: '',
+                },
+                ruleForm: {
+                  amount: [{ required: true, message: '请输入充值金额', trigger: 'blur' }],
+                  password: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
+                }
             };
             };
         },
         },
         mounted() {
         mounted() {
@@ -129,16 +186,16 @@
                         ],
                         ],
                         // 操作列
                         // 操作列
                         op: {
                         op: {
-                            visible: true, // 是否显示
-                            // 同 element-ui Table-column Attributes
-                            props: {
-                                width: 150,
-                                align: 'center',
-                                fixed: 'right',
-                                label: '操作'
-                            },
-                            // 布局,请移步 `layout`
-                            layout: []
+                          visible: true, // 是否显示
+                          // 同 element-ui Table-column Attributes
+                          props: {
+                            width: 100,
+                            align: 'center',
+                            fixed: 'right',
+                            label: '操作'
+                          },
+                          // 布局,请移步 `layout`
+                          layout: ['slot-apply']
                         }
                         }
                     })
                     })
                     .set('layout', [
                     .set('layout', [
@@ -150,7 +207,30 @@
                     .done();
                     .done();
                 app.refresh();
                 app.refresh();
             },
             },
-
+            // 充值
+            topUp(name, id) {
+              this.dialogTitle = name
+              this.topForm.shopId = id
+              this.wxPayDialog = true
+            },
+             resetForm () {
+              this.$refs['adForm'].resetFields();
+              this.wxPayDialog = false;
+            },
+            submitForm () {
+              this.$refs['adForm'].validate(valid => {
+                if (valid) {
+                  console.log(1111)
+                  console.log(this.topForm)
+                  this.$service.saasShop.rechargeBalance(res => {
+                    console.log(res)
+                  })
+                } else {
+                  console.log('error submit!!');
+                  return false;
+                }
+              });
+            },
             detailShowFn(item){
             detailShowFn(item){
                 this.optionData = item;
                 this.optionData = item;
                 this.showBalanceDetail = true;
                 this.showBalanceDetail = true;

+ 9 - 0
pt/src/service/saas/shop/index.js

@@ -90,6 +90,15 @@ export class ShopService extends BaseService {
 			data,
 			data,
 			method: 'POST'
 			method: 'POST'
 		});
 		});
+  }
+  
+  // 门店充值 w
+	rechargeBalance(data) {
+		return this.request({
+			url: '/recharge/balance',
+			data,
+			method: 'POST'
+		});
 	}
 	}
 }
 }