Browse Source

修改账号管理

zs 1 năm trước cách đây
mục cha
commit
1623d0d870

+ 3 - 18
src/views/platfinance/bill/index.vue

@@ -86,7 +86,7 @@ export default {
     await this.searchOther();
   },
   methods: {
-    ...shop({ shopQuery: 'query' }),
+    ...shop({ shopQuery: 'query', shopFetch: 'fetch' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     ...outBill({ outQuery: 'query', outCreate: 'create' }),
     // 查询
@@ -96,6 +96,8 @@ export default {
         condition[`start`] = _.head(condition.buy_time);
         condition[`end`] = _.last(condition.buy_time);
         delete condition.buy_time;
+        // 判断是否是个人店铺查询
+        if (this.user.role.code == 'shopAdmin') info.shop = this.user.shop._id || this.user.shop.id;
         let res = await this.query({ skip, limit, ...condition, ...info });
         if (this.$checkRes(res)) {
           this.$set(this, 'info', res.data);
@@ -147,23 +149,6 @@ export default {
       workbook.xlsx.writeBuffer().then((buffer) => {
         FileSaver.saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `对账单.xlsx`);
       });
-      // this.$confirm('是否确认对账?', '提示', {
-      //   confirmButtonText: '确定',
-      //   cancelButtonText: '取消',
-      //   type: 'warning',
-      // }).then(async () => {
-      //   let order = [];
-      //   for (const p1 of this.orderList) {
-      //     order.push(p1._id);
-      //   }
-      //   let afterSale = [];
-      //   for (const p1 of this.afterSaleList) {
-      //     afterSale.push(p1._id);
-      //   }
-      //   let res;
-      //   res = await this.outCreate({ order, afterSale });
-      //   if (this.$checkRes(res)) this.$message({ type: `success`, message: `对账成功` });
-      // });
     },
     // 查询其他信息
     async searchOther() {},

+ 4 - 2
src/views/platfinance/bill/parts/search-1.vue

@@ -16,7 +16,7 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :span="6" v-if="this.user.role.code != 'shopAdmin'">
             <el-form-item label="店铺名称" prop="type">
               <el-select
                 v-model="form.shop"
@@ -69,7 +69,9 @@ export default {
       this.$emit('toReset');
     },
   },
-  computed: {},
+  computed: {
+    ...mapState(['user']),
+  },
   metaInfo() {
     return { title: this.$route.meta.title };
   },