Răsfoiți Sursa

门店管理

shish 3 ani în urmă
părinte
comite
dd55ae2f19
2 a modificat fișierele cu 197 adăugiri și 218 ștergeri
  1. 3 2
      pt/src/saas/shop/manage.vue
  2. 194 216
      pt/src/saas/shop/shop.vue

+ 3 - 2
pt/src/saas/shop/manage.vue

@@ -27,7 +27,7 @@
 								<el-button size="mini" type="text" @click="selfGetCancel(scope.row.id)">取消</el-button>
 								<el-button type="primary" size="mini" @click="noSendShipFn(scope.row)">确定</el-button>
 							</div>
-              <el-button type="text" size="small" slot="reference">删除</el-button>
+              				<el-button type="text" size="small" slot="reference">删除</el-button>
 						</el-popover>
 					</template>
 			</template>
@@ -125,7 +125,8 @@ export default {
 							label: '操作'
 						},
 						// 布局,请移步 `layout`
-						layout: ['slot-column-option']
+						//layout: ['slot-column-option']
+						layout: []
 					}
 				})
 				.set('layout', [

+ 194 - 216
pt/src/saas/shop/shop.vue

@@ -1,6 +1,5 @@
 <template>
     <div class="app-list-content">
-      
         <x-crud class="liu-crud-wrap" @load="onLoad">
             <!-- 余额 -->
             <template #table-column-balance="{scope}">
@@ -20,7 +19,7 @@
             </template>
             <!-- 充值 -->
             <template #slot-apply="{scope}">
-              <el-button type="text" @click="changeOnlyCg(scope.row)">调整仅采购</el-button>
+              <el-button type="text" @click="addStaff(scope.row)">添加员工</el-button>
             </template>
         </x-crud>
 
@@ -29,43 +28,21 @@
         
         <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-dialog :visible.sync="addYgPop" :close-on-click-modal="false" width="500px" >
+          <el-form :model="addStaffForm" :rules="ruleForm" ref="adForm" label-width="80px" class="demo-form" >
+            <el-form-item label="手机号" prop="mobile" style="text-align:left;" >
+              <el-input placeholder="请输入手机号" size="small" v-model="addStaffForm.mobile" ></el-input>
             </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 label="昵称" prop="nickName" style="text-align: left;" >
+              <el-input placeholder="请输入昵称" size="small" v-model="addStaffForm.nickName"></el-input>
             </el-form-item>
-            <el-form-item
-              label="登录密码"
-              prop="password"
-              style="text-align: left;"
-            >
-              <el-input
-                placeholder="请输入登录密码"
-                size="small"
-                v-model="topForm.password"
-                show-password
-              ></el-input>
+
+            <el-form-item label="超管" prop="super">
+              <el-select v-model="addStaffForm.superName" size="small" placeholder="请选择" @change="changeSuperFn">
+                <el-option v-for="(item, index) in superList" :key="index" :value="item.name" >{{ item.name }}</el-option>
+              </el-select>
             </el-form-item>
+
           </el-form>
           <div slot="footer" class="dialog-footer">
             <el-button size="small" @click="resetForm">取 消</el-button>
@@ -75,193 +52,194 @@
 
     </div>
 </template>
-
 <script>
-    import balanceDetail from './components/balance-detail';
-    import amountDetail from './components/amount-detail';
-    export default {
-        components:{balanceDetail,amountDetail},
-        data() {
-            return {
-                app: null,
-                showBalanceDetail: false,
-                showAmountDetail: false,
-                optionData: {},
-                wxPayDialog: false,
-                dialogTitle: '',
-                topForm: {
-                  shopId: '',
-                  amount: '',
-                  password: '',
-                },
-                ruleForm: {
-                  amount: [{ required: true, message: '请输入充值金额', trigger: 'blur' }],
-                  password: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
-                }
-            };
+import balanceDetail from './components/balance-detail';
+import amountDetail from './components/amount-detail';
+export default {
+    components:{balanceDetail,amountDetail},
+    data() {
+        return {
+            app: null,
+            showBalanceDetail: false,
+            showAmountDetail: false,
+            optionData: {},
+            addYgPop: false,
+            dialogTitle: '',
+            addStaffForm: {
+              mobile: '',
+              nickName: '',
+              super:1,
+              superName:'是',
+              shopId:0
+            },
+            ruleForm: {
+              mobile: [{ required: true, message: '请输入充值金额', trigger: 'blur' }],
+              nickName: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
+            },
+            superList:[{name:'是',id:1},{name:'否',id:0}]
+        };
+    },
+    mounted() {
+    },
+    methods: {
+        addStaff(shop) {
+          this.addYgPop = true
+          this.addStaffForm.shopId = shop.id
         },
-        mounted() {
+        changeSuperFn(val){
+          let index = this.superList.findIndex((e) => e.name == val);
+          this.addStaffForm.super = this.superList[index].id;
         },
-        methods: {
-            onLoad({ctx, app}) {
-                this.app = app;
-                ctx.service(this.$service.shop)
-                    .set('table', {
-                        columns: [
-                            {
-                                prop: 'id',
-                                label: 'ID',
-                                width: '70',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'merchantName',
-                                label: '商家',
-                                width: '120',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'shopName',
-                                label: '门店',
-                                width: '120',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'ptStyle',
-                                label: '类型',
-                                width: '100',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'balance',
-                                label: '余额',
-                                width: '100',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'totalIncome',
-                                label: '收入',
-                                width: '100',
-                                align: 'center'
-                            },
-                           {
-                                prop: 'totalExpend',
-                                label: '支出',
-                                width: '100',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'mobile',
-                                label: '手机号',
-                                width: '120',
-                                align: 'center'
-                            },
-                            {
-                                prop: 'province',
-                                label: '省',
-                                width: '90',
-                                align: 'center',
-                                emptyText: '-'
-                            },
-                            {
-                                prop: 'city',
-                                label: '市',
-                                align: 'center',
-                                width: '100',
-                                emptyText: '-'
-                            },
-                            {
-                                prop: 'dist',
-                                label: '区',
-                                align: 'center',
-                                width: '100',
-                                emptyText: '-'
-                            },
-                            {
-                                prop: 'fullAddress',
-                                label: '地址',
-                                align: 'center',
-                                emptyText: '-',
-                                width: '370'
-                            },
-                            {
-                                prop: 'gatheringCode',
-                                label: '收款二维码',
-                                align: 'center',
-                                width: '130'
-                            }
-                        ],
-                        op: {
-                          visible: true, // 是否显示
-                          props: {
-                            width: 120,
+        onLoad({ctx, app}) {
+            this.app = app;
+            ctx.service(this.$service.shop)
+                .set('table', {
+                    columns: [
+                        {
+                            prop: 'id',
+                            label: 'ID',
+                            width: '70',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'merchantName',
+                            label: '商家',
+                            width: '120',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'shopName',
+                            label: '门店',
+                            width: '120',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'ptStyle',
+                            label: '类型',
+                            width: '100',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'balance',
+                            label: '余额',
+                            width: '100',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'totalIncome',
+                            label: '收入',
+                            width: '100',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'totalExpend',
+                            label: '支出',
+                            width: '100',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'mobile',
+                            label: '手机号',
+                            width: '120',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'province',
+                            label: '省',
+                            width: '90',
+                            align: 'center',
+                            emptyText: '-'
+                        },
+                        {
+                            prop: 'city',
+                            label: '市',
+                            align: 'center',
+                            width: '100',
+                            emptyText: '-'
+                        },
+                        {
+                            prop: 'dist',
+                            label: '区',
                             align: 'center',
-                            fixed: 'right',
-                            label: '操作'
-                          },
-                          layout: ['slot-apply']
+                            width: '100',
+                            emptyText: '-'
+                        },
+                        {
+                            prop: 'fullAddress',
+                            label: '地址',
+                            align: 'center',
+                            emptyText: '-',
+                            width: '370'
                         }
-                    })
-                    .set('dict', {
-                      search: {
-                        keyWord: 'name',
-                      },
-                    })
-                    .set('search', {
-                      key: {
-                        placeholder: '请填写名称,支持拼音字母',
+                    ],
+                    op: {
+                      visible: true, // 是否显示
+                      props: {
+                        width: 120,
+                        align: 'center',
+                        fixed: 'right',
+                        label: '操作'
                       },
-                    })
-                    .set('pagination', {
-                      size: 50
-                    })
-                    .set('layout', [
-                        ['slot-tabs'],['search-key'],
-                        ['flex1', 'refresh-btn'],
-                        ['data-table'],
-                        ['flex1', 'pagination']
-                    ])
-                    .done();
-                app.refresh();
-            },
-            changeOnlyCg(item) {
-                  this.$service.saasShop.changeOnlyCg({id:item.id}).then(res => {
-                    this.$message.success('操作成功')
-                  })
-            },
-             resetForm () {
-              this.$refs['adForm'].resetFields();
-              this.wxPayDialog = false;
-            },
-            submitForm () {
-              this.$refs['adForm'].validate(valid => {
-                if (valid) {
-                  this.$service.saasShop.rechargeBalance(this.topForm).then(res => {
-                    this.$message.success('操作成功')
-                    this.wxPayDialog = false
-                    this.app.refresh()
-                  })
-                } else {
-                  console.log('error submit!!');
-                  return false;
+                      layout: ['slot-apply']
+                    }
+                })
+                .set('dict', {
+                  search: {
+                    keyWord: 'name',
+                  },
+                })
+                .set('search', {
+                  key: {
+                    placeholder: '请填写名称,支持拼音字母',
+                  },
+                })
+                .set('pagination', {
+                  size: 50
+                })
+                .set('layout', [
+                    ['slot-tabs'],['search-key'],
+                    ['flex1', 'refresh-btn'],
+                    ['data-table'],
+                    ['flex1', 'pagination']
+                ])
+                .done();
+            app.refresh();
+        },
+        resetForm () {
+          this.$refs['adForm'].resetFields();
+          this.addYgPop = false;
+        },
+        submitForm () {
+          this.$refs['adForm'].validate(valid => {
+            if (valid) {
+              this.$service.saasShop.rechargeBalance(this.addStaffForm).then(res => {
+                if(res.code == 1){
+                  this.$message.success('操作成功')
+                  this.addYgPop = false
+                  this.app.refresh()
                 }
-              });
-            },
-            detailShowFn(item){
-                this.optionData = item;
-                this.showBalanceDetail = true;
-                setTimeout(() => {
-                    this.$refs.balanceDetail.init();
-                });
-            },
-            AmountShowFn(item,type){
-                this.optionData = {...item,io: type}
-                console.log(this.optionData)
-                this.showAmountDetail = true;
-                setTimeout(() => {
-                    this.$refs.amountDetail.init();
-                });
+              })
+            } else {
+              console.log('error submit!!');
+              return false;
             }
+          });
+        },
+        detailShowFn(item){
+            this.optionData = item;
+            this.showBalanceDetail = true;
+            setTimeout(() => {
+                this.$refs.balanceDetail.init();
+            });
+        },
+        AmountShowFn(item,type){
+            this.optionData = {...item,io: type}
+            console.log(this.optionData)
+            this.showAmountDetail = true;
+            setTimeout(() => {
+                this.$refs.amountDetail.init();
+            });
         }
-    };
+    }
+};
 </script>