lilei 2 سال پیش
والد
کامیت
cc870756c0
5فایلهای تغییر یافته به همراه245 افزوده شده و 5 حذف شده
  1. 1 1
      public/version.json
  2. 28 3
      src/config/router.config.js
  3. 47 0
      src/core/directives/copyText.js
  4. 1 1
      src/core/use.js
  5. 168 0
      src/views/numsGoodsShelves/approveStore/list.vue

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1657873315407
+  "version": 1658300244473
 }

+ 28 - 3
src/config/router.config.js

@@ -317,7 +317,7 @@ export const asyncRouterMap = [
       // 数字货架
       {
         path: '/numsGoodsShelves',
-        redirect: '/numsGoodsShelves/settlementManagement',
+        redirect: '/numsGoodsShelves/shelfSet',
         component: PageView,
         meta: {
           title: '数字货架',
@@ -325,6 +325,32 @@ export const asyncRouterMap = [
           permission: 'M_numsGoodsShelves'
         },
         children: [
+          {
+            path: '/numsGoodsShelves/approveStore',
+            redirect: '/numsGoodsShelves/approveStore/list',
+            name: 'approveStore',
+            component: BlankLayout,
+            meta: {
+              title: '汽修厂认证审核',
+              icon: 'monitor',
+              permission: 'M_approveStore'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'approveStoreList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/approveStore/list.vue'),
+                meta: {
+                  title: '汽修厂认证审核',
+                  icon: 'monitor',
+                  replaceTab: true,
+                  hidden: true
+                  // permission: 'M_approveStore'
+                }
+              },
+            ]
+          },
           {
             path: '/numsGoodsShelves/shelfSet',
             redirect: '/numsGoodsShelves/shelfSet/list',
@@ -357,7 +383,6 @@ export const asyncRouterMap = [
                   icon: 'monitor',
                   hidden: true,
                   replaceTab: true
-                  // permission: 'M_salesQueryList'
                 }
               }
             ]
@@ -559,7 +584,7 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          }
+          },
           // {
           //   path: '/numsGoodsShelves/accountManagement',
           //   redirect: '/numsGoodsShelves/accountManagement/list',

+ 47 - 0
src/core/directives/copyText.js

@@ -0,0 +1,47 @@
+import Vue from "vue";
+import message from 'ant-design-vue/es/message';
+// 注册一个全局自定义复制指令 `v-copyText`
+Vue.directive("copyText", {
+  bind(el, { value }) {
+    el.$value = value;
+    el.handler = () => {
+      el.style.position = 'relative';
+      if (!el.$value) {
+        // 值为空的时候,给出提示
+        alert('无复制内容');
+        return
+      }
+      // 动态创建 textarea 标签
+      const textarea = document.createElement('textarea');
+      // 将该 textarea 设为 readonly 防止 iOS 下自动唤起键盘,同时将 textarea 移出可视区域
+      textarea.readOnly = 'readonly';
+      textarea.style.position = 'absolute';
+      textarea.style.top = '0px';
+      textarea.style.left = '-9999px';
+      textarea.style.zIndex = '-9999';
+      // 将要 copy 的值赋给 textarea 标签的 value 属性
+      textarea.value = el.$value
+      // 将 textarea 插入到 el 中
+      el.appendChild(textarea);
+      // 兼容IOS 没有 select() 方法
+      if (textarea.createTextRange) {
+        textarea.select(); // 选中值并复制
+      } else {
+        textarea.setSelectionRange(0, el.$value.length);
+        textarea.focus();
+      }
+      const result = document.execCommand('Copy');
+      if (result) message.info('复制成功');
+      el.removeChild(textarea);
+    }
+    el.addEventListener('click', el.handler); // 绑定点击事件
+  },
+  // 当传进来的值更新的时候触发
+  componentUpdated(el, { value }) {
+    el.$value = value;
+  },
+  // 指令与元素解绑的时候,移除事件绑定
+  unbind(el) {
+    el.removeEventListener('click', el.handler);
+  },
+});

+ 1 - 1
src/core/use.js

@@ -16,7 +16,7 @@ import PermissionHelper from '@/utils/helper/permission'
 // import '@/components/use'
 import './directives/hasPermission'
 import './directives/dragModal'
-
+import './directives/copyText'
 VueClipboard.config.autoSetContainer = true
 
 Vue.use(Antd)

+ 168 - 0
src/views/numsGoodsShelves/approveStore/list.vue

@@ -0,0 +1,168 @@
+<template>
+  <a-card size="small" :bordered="false" class="approveStore-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 提示 -->
+      <a-alert type="info" style="margin-bottom: 10px">
+        <div slot="message">我的邀请码:1A2B <a-button type="link" v-copyText="'1A2B'">复制</a-button></div>
+      </a-alert>
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="联系人手机">
+                <a-input allowClear placeholder="请输入联系人手机" v-model.tirm="queryParam.mobile"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="联系人姓名">
+                <a-input allowClear placeholder="请输入联系人姓名" v-model.tirm="queryParam.name"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="门店名称">
+                <a-input allowClear placeholder="请输入门店名称" v-model.tirm="queryParam.storeName"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="状态">
+                <v-select
+                  v-model="queryParam.status"
+                  ref="status"
+                  id="approveStore-status"
+                  code="FLAG"
+                  placeholder="请选择"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :offset="18" :sm="24" style="margin-bottom: 10px">
+              <div style="float: right;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="approveStore-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="approveStore-reset">重置</a-button>
+              </div>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-primary" @click="handleAudit(record,1)">通过</a-button>
+          <a-button size="small" type="link" class="button-primary" @click="handleAudit(record,0)">不通过</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { shelfList } from '@/api/shelf'
+export default {
+  components: { STable, VSelect },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      queryParam: {
+        name: '',
+        mobile: '',
+        storeName: '',
+        status: undefined
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '提交时间', dataIndex: 'shelfName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人手机', dataIndex: 'customerEntity.customerName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人姓名', dataIndex: 'shelfName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '门店名称', dataIndex: 'shelfName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '门店地址', dataIndex: 'shelfName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '门头照片', dataIndex: 'shelfName', width: '8%', align: 'center', scopedSlots: { customRender: 'storeImg' } },
+        { title: '营业执照', dataIndex: 'shelfName', width: '8%', align: 'center', scopedSlots: { customRender: 'storeImg' } },
+        { title: '状态', dataIndex: 'shelfName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'left' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return shelfList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false,
+      nowData: null
+    }
+  },
+  methods: {
+    // 审核
+    handleAudit () {
+
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.name = ''
+      this.queryParam.moblie = ''
+      this.queryParam.storeName = ''
+      this.queryParam.status = undefined
+      this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+        _this.resetSearchForm()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.setTableH()
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>