فهرست منبع

Merge commit '9772b1ad27913953437fdd3e3e6b4a1ba045e797' into HEAD

gitadmin 2 سال پیش
والد
کامیت
58e240b1de

+ 29 - 0
src/api/approveStore.js

@@ -0,0 +1,29 @@
+import { axios } from '@/utils/request'
+
+//  客户类型列表  分页
+export const xprhStoreApplyQueryPage = (params) => {
+  const url = `/xprhStoreApply/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 审核
+export const xprhStoreApplyAudit = (params) => {
+  const url = `/xprhStoreApply/audit`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 门店认证详情
+export const xprhStoreApplyDetail = (params) => {
+  return axios({
+    url: `/xprhStoreApply/findBySn/${params.sn}`,
+    method: 'get'
+  })
+}

+ 21 - 0
src/api/data.js

@@ -127,3 +127,24 @@ export const getDistrictByCity = params => {
     method: 'post'
   })
 }
+
+// 查询省/市/区
+export const getArea = (params) => {
+  if(params.type == '2' || params.parentId){
+    return axios({
+      url: `/area/queryList`,
+      data: params,
+      method: 'post'
+    })
+  }
+}
+// 查询省/市/区 兼容小程序数据
+export const getAreaCgj = (params) => {
+  if(params.type == '2' || params.parentId){
+    return axios({
+      url: `/areaCgj/queryList`,
+      data: params,
+      method: 'post'
+    })
+  }
+}

+ 23 - 1
src/api/dealer.js

@@ -1,5 +1,5 @@
 import { axios } from '@/utils/request'
-//  经销商 列表 有分页
+//  商户列表 有分页
 export const dealerList = (params) => {
   const url = `/dealer/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
@@ -10,3 +10,25 @@ export const dealerList = (params) => {
     method: 'post'
   })
 }
+// 经销商 列表
+export const dealerQueryPageList = (params) => {
+  const url = `/dealer/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 客户查询接口 
+export const customerQueryPageList = (params) => {
+  const url = `/customer/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 108 - 40
src/components/UploadFile/index.vue

@@ -4,11 +4,13 @@
       :action="action"
       :listType="listType"
       :fileList="fileList"
+      :disabled="disabled"
       @preview="handlePreview"
       @change="handleChange"
+      :remove="handleRemove"
       :beforeUpload="beforeUpload"
-      :preview-file="previewFile"
       :data="params"
+      :headers="headers"
       :value="comVal"
     >
       <div v-if="fileList.length < maxNums && listType=='picture-card'">
@@ -19,7 +21,13 @@
         <a-button> <a-icon type="upload" /> {{ upText }} </a-button>
       </div>
     </a-upload>
-    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
+    <a-modal
+      :visible="previewVisible"
+      title="图片预览"
+      :footer="null"
+      centered
+      :maskClosable="true"
+      @cancel="handleCancel">
       <video v-if="fileType=='video/mp4'" controls="controls" style="width: 100%" :src="previewImage" />
       <img v-else alt="example" style="width: 100%" :src="previewImage" />
     </a-modal>
@@ -43,9 +51,7 @@ export default {
     },
     previewFile: {
       type: Function,
-      default: function () {
-
-      }
+      default: function () {}
     },
     action: {
       type: String,
@@ -57,7 +63,7 @@ export default {
     },
     upText: {
       type: String,
-      default: '上传'
+      default: ''
     },
     value: {
       type: String
@@ -66,14 +72,21 @@ export default {
       type: Object,
       default: function () {
         return {
-          savePathType: 'ali' // 存储类型 local 服务器本地,ali 阿里云
+          savePathType: 'ali' // 存储类型 local 服务器本地,ali 阿里云, web
         }
       }
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    },
+    uploadType: { //  上传类型  img图片;attach附件;import导入
+      type: String,
+      default: 'img'
     }
   },
   watch: {
     value (a, b) {
-      console.log(a, '=--====')
       this.comVal = a || ''
       if (a == undefined) {
         this.fileList = []
@@ -86,26 +99,47 @@ export default {
       previewImage: '',
       fileList: [],
       comVal: this.value,
-      params: this.uploadParams
+      params: this.uploadParams,
+      headers: {
+        'access-token': this.$store.getters.token
+      }
     }
   },
   methods: {
     setFileList (a) {
       const temp = []
       if (a && a.length > 0) {
-        a.split(',').map((item, index) => {
-          if (item) {
-            temp.push({
-              uid: index,
-              name: item,
-              status: 'done',
-              url: item,
-              response: {
-                data: item
-              }
-            })
-          }
-        })
+        if (this.uploadType == 'img' || this.uploadType == 'import') { // 图片/导入
+          a.split(',').map((item, index) => {
+            if (item) {
+              temp.push({
+                uid: index,
+                name: item,
+                status: 'done',
+                url: item,
+                response: {
+                  data: item
+                }
+              })
+            }
+          })
+        } else if (this.uploadType == 'attach') { // 附件
+          a.map((item, index) => {
+            if (item) {
+              const arr = []
+              arr.push(item) //  包裹成与新上传文件数据返回结构一致
+              temp.push({
+                uid: index,
+                name: item.fileName,
+                status: 'done',
+                url: item.filePath,
+                response: {
+                  data: arr
+                }
+              })
+            }
+          })
+        }
       }
       this.fileList = temp
     },
@@ -116,39 +150,59 @@ export default {
       if (this.listType == 'text') {
         return
       }
-      console.log(file, '8888888888')
       this.previewImage = file.url || file.thumbUrl
-      // this.previewImage = file.response.data
       this.previewVisible = true
     },
+    handleRemove (file) {
+      this.$emit('remove')
+    },
     handleChange ({ file, fileList }) {
-      if (file.status == 'error') {
-        this.$message.error('上传失败,请重试!')
-        return
+      if (!file.response || file.response && (file.response.status == 500 || file.response.status == 900 || file.response.status == 404)) {
+        if (file.status == 'error' || file.status == 'done') {
+          this.$message.error(file.response && file.response.message || '上传失败,请重试!')
+          this.$emit('remove')
+          return
+        }
       }
       this.fileList = this.validaFile(file, fileList)
       this.$emit('change', this.formatFile())
+      this.$emit('input', this.formatFile())
     },
     // 格式化文件列表数据,给表单
     formatFile () {
+      const _this = this
       const a = this.fileList
-      const temp = []
+      let temp = []
+      let obj = null
       if (a && a.length) {
-        a.map(item => {
-          if (item.response && item.status == 'done') {
-            temp.push(item.response.data)
-          }
-        })
+        if (this.uploadType == 'img' || this.uploadType == 'import') { // 图片/导入    将接口的返回图片地址逗号拼接后返回页面
+          a.map(item => {
+            if (item.response && item.status == 'done') {
+              temp.push(item.response.data)
+            }
+          })
+          obj = temp.join(',')
+        } else if (this.uploadType == 'attach') { // 附件    将接口的返回数据返回页面
+          a.map(item => {
+            if (item.response && item.status == 'done') {
+              if (_this.maxNums == 1) {
+                temp = [item.response.data]
+              } else {
+                temp = [...temp, ...item.response.data]
+              }
+            }
+          })
+          obj = JSON.stringify(temp)
+        }
       }
-      return temp.join(',')
+      return obj
     },
     // 文件校验
     validaFile (file, filesList) {
       if (filesList.length == 0) {
         return []
       }
-
-      console.log(file, filesList, this.beforeUpload(file, 0))
+      // console.log(file, filesList, this.beforeUpload(file, 0))
       if (!this.beforeUpload(file, 0) && file.status != 'removed') {
         const index = filesList.findIndex(item => item.uid == file.uid)
         filesList.splice(index, 1)
@@ -159,17 +213,24 @@ export default {
     beforeUpload (file, tip) {
       // 不限制
       if (this.fileType == '*') {
+        // 文件大小
+        const isLt2M = file.size / 1024 / 1024 < this.fileSize
+        if (!isLt2M) {
+          if (tip != 0) {
+            this.$message.error('上传文件不能超过 ' + this.fileSize + 'MB!')
+          }
+          return isLt2M
+        }
         return true
       }
-
       const isType = this.fileType.indexOf(file.type) >= 0 && file.type != ''
-      if (!isType) {
+      // 文件格式限制为.xls、.xlsx时,上传.csv文件的type为application/vnd.ms-excel,与.xls一致,无法限制,因此更改为:
+      if (!isType || file.name.indexOf('.csv') >= 0) {
         if (tip != 0) {
           this.$message.error('请上传正确的格式!')
         }
-        return isType
+        return isType && !(file.name.indexOf('.csv') >= 0)
       }
-
       // 文件大小
       const isLt2M = file.size / 1024 / 1024 < this.fileSize
       if (!isLt2M) {
@@ -192,10 +253,12 @@ export default {
   .upload-file{
     float: left;
     overflow: hidden;
+    height: 80px;
     /* you can make up upload button and sample style by using stylesheets */
     .ant-upload-select-picture-card i {
       font-size: 32px;
       color: #999;
+      margin-top: 9px;
     }
     .ant-upload-select-picture-card .ant-upload-text {
       margin-top: 8px;
@@ -207,11 +270,16 @@ export default {
         padding: 4px 0;
       }
     }
+    .ant-upload-list-picture-card-container{
+      height: 80px;
+      width: 80px;
+    }
     .ant-upload.ant-upload-select-picture-card,
     .ant-upload-list-picture-card .ant-upload-list-item{
       width:80px;
       height:80px;
       padding: 4px;
+      margin: 0;
     }
     .ant-upload-list-item-info{
       padding: 0 22px 0 4px;

+ 50 - 0
src/config/router.config.js

@@ -48,6 +48,56 @@ export const asyncRouterMap = [
         },
         hidden: true
       },
+      // 数字货架管理
+      {
+        path: '/numsGoodsShelves',
+        redirect: '/numsGoodsShelves/approveStore',
+        component: PageView,
+        meta: {
+          title: '数字货架管理',
+          icon: 'hdd',
+          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: 'authPass/:sn',
+                 name: 'approveStoreAuthPass',
+                 component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/approveStore/authPass.vue'),
+                 meta: {
+                   title: '审核通过',
+                   icon: 'monitor',
+                   replaceTab: true,
+                   hidden: true
+                 }
+               },
+             ]
+           },
+        ]
+      },
       // 连锁组管理
       {
         path: '/chainGroupManagement',

+ 0 - 2
src/views/appSetting/versionSettings/editModal.vue

@@ -69,7 +69,6 @@
               :maxNums="1"
               :fileSize="100"
               fileType="application/vnd.android.package-archive"
-              :action="attachAction"
               :uploadParams="uploadParams"
               @change="changeImport"
               upText="附件上传"></Upload>
@@ -126,7 +125,6 @@ export default {
         upgradeContent: [ { required: true, message: '请输入升级内容', trigger: 'blur' } ],
         attachment: [ { required: true, message: '请上传app安装文件', trigger: 'change' } ]
       },
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
       uploadParams: {
         savePathType: 'ali'
       }

+ 67 - 0
src/views/common/customeList.vue

@@ -0,0 +1,67 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :value="customerName"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.customerSn" :value="item.customerSn">
+      {{ item.customerName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { customerQueryPageList } from '@/api/dealer'
+export default {
+  props: {
+    tenantId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      customerName: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (customerName) {
+      console.log('fetching user', customerName)
+      if (customerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      customerQueryPageList({ 'customerName': customerName, tenantId: this.tenantId, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data.list || []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      Object.assign(this, {
+        customerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value)
+    },
+    resetForm () {
+      this.customerName = []
+    }
+  }
+}
+</script>

+ 63 - 0
src/views/common/dealerList.vue

@@ -0,0 +1,63 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :value="dealerName"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.dealerSn" :value="item.dealerSn">
+      {{ item.dealerName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { dealerQueryPageList } from '@/api/dealer'
+export default {
+  props: {
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      dealerName: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      console.log('fetching user', dealerName)
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      dealerQueryPageList({ 'dealerName': dealerName, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data.list || []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value)
+    },
+    resetForm () {
+      this.dealerName = []
+    }
+  }
+}
+</script>

+ 409 - 0
src/views/numsGoodsShelves/approveStore/authPass.vue

@@ -0,0 +1,409 @@
+<template>
+  <div class="authPass-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="authPass-back">
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="authPass-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+      </template>
+    </a-page-header>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card size="small" :bordered="false" class="authPass-table-page-wrapper">
+        <a-form-model
+          id="authPass-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row :gutter="15">
+            <a-col :span="12">
+              <a-form-model-item label="门头照片" prop="storeImage">
+                <Upload
+                  class="upload"
+                  id="noticeEdit-imgPaths"
+                  v-model="form.storeImage"
+                  ref="storeImage"
+                  :fileSize="10"
+                  :maxNums="1"
+                  @remove="removeImage1"
+                  @change="changeImage1"
+                  listType="picture-card"></Upload>
+                <div class="upload-desc">说明:单张大小小于10Mb,最多1张。</div>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="营业执照" prop="licenseImage">
+                <Upload
+                  class="upload"
+                  id="noticeEdit-imgPaths"
+                  v-model="form.licenseImage"
+                  ref="licenseImage"
+                  :fileSize="10"
+                  :maxNums="1"
+                  @remove="removeImage2"
+                  @change="changeImage2"
+                  listType="picture-card"></Upload>
+                <div class="upload-desc">说明:单张大小小于10Mb,最多1张。</div>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="门店名称" prop="storeName">
+                <a-input id="authPass-storeName" :maxLength="30" v-model.trim="form.storeName" placeholder="请输入门店名称(最多30个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="12">
+              <a-form-model-item label="客户地址" required style="margin: 0;">
+                <a-row :gutter="15">
+                  <!-- 客户地址 -->
+                  <a-col span="6">
+                    <a-form-model-item prop="addrProvince">
+                      <a-select id="authPass-addrProvince" allowClear @change="getCityList" v-model="form.addrProvince" placeholder="请选择省">
+                        <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="6">
+                    <a-form-model-item prop="addrCity">
+                      <a-select id="authPass-addrCity" allowClear @change="getAreaList" v-model="form.addrCity" placeholder="请选择市">
+                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="6">
+                    <a-form-model-item prop="addrDistrict">
+                      <a-select id="authPass-addrDistrict" allowClear @change="areaCharged" v-model="form.addrDistrict" placeholder="请选择区/县">
+                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="详细地址" prop="addrDetail">
+                <a-textarea id="authPass-addrDetail" :maxLength="100" v-model.trim="form.addrDetail" placeholder="请输入详细地址(最多100个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="12">
+              <a-form-model-item label="联系人姓名" prop="contactName">
+                <a-input
+                  id="authPass-contactName"
+                  :maxLength="20"
+                  v-model.trim="form.contactName"
+                  @change="filterEmpty"
+                  placeholder="请输入联系人姓名(最多20个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="联系人手机" prop="contactPhone">
+                <a-input
+                  id="authPass-contactPhone"
+                  :maxLength="30"
+                  disabled
+                  v-model.trim="form.contactPhone"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="绑定汽配商" prop="delearSn">
+                <dealerList ref="dealerList" @change="dealerChange" v-model="form.delearSn"></dealerList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="关联客户" prop="customerSn">
+                <customeList ref="customeList" v-if="form.delearSn" :tenantId="form.delearSn" @change="custChange" v-model="form.customerSn"></customeList>
+                <span v-else>请先选择绑定汽配商</span>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="结算方式" prop="settleType">
+                <v-select
+                  code="SHELF_SETTLE_TYPE"
+                  id="authPass-settleType"
+                  v-model="form.settleType"
+                  allowClear
+                  placeholder="请选择结算方式"
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12" v-if="form.settleType == 'CREDIT'">
+              <a-form-model-item label="授信额度" prop="creditLimit">
+                <a-input-number
+                  :min="100"
+                  :max="9999999"
+                  style="width:100%"
+                  :precision="2"
+                  v-model="form.creditLimit"
+                  placeholder="请输入大于100的数字(最多允许两位小数)"></a-input-number>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 30px;">
+            <a-button type="primary" @click="saveForm" size="large" id="authPass-btn-submit" style="padding: 0 60px;">审核通过</a-button>
+          </a-form-model-item>
+        </a-form-model>
+      </a-card>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect, Upload } from '@/components'
+import { getAreaCgj } from '@/api/data'
+import dealerList from '@/views/common/dealerList.vue'
+import customeList from '@/views/common/customeList.vue'
+import { xprhStoreApplyDetail, xprhStoreApplyAudit } from '@/api/approveStore'
+export default {
+  name: 'ApproveStoreAuthPass',
+  components: { STable, VSelect, dealerList, customeList, Upload },
+  data () {
+    return {
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        storeName: '', // 门店名称
+        contactPhone: '', //  联系手机
+        contactName: '', //  联系人
+        addrProvince: undefined, //  省
+        addrProvinceName: '',
+        addrCity: undefined, // 市
+        addrCityName: '',
+        addrDistrict: undefined, // 区
+        addrDistrictName: '',
+        addrDetail: '', //  详细地址
+        storeImage: '', // 门头照片
+        licenseImage: '', // 营业执照
+        settleType: '', //  结算方式
+        customerSn: undefined, //  关联客户
+        creditLimit: undefined, //  授信额度
+        delearSn: undefined,
+        applySn: undefined,
+        auditStatus: 'PASS' // 通过
+      },
+      rules: {
+        storeImage: [{ required: true, message: '请上传门头照片', trigger: 'change' }],
+        storeName: [{ required: true, message: '请输入门店名称', trigger: 'blur' }],
+        addrProvince: [{ required: true, message: '请选择省', trigger: 'change' }],
+        addrCity: [{ required: true, message: '请选择市', trigger: 'change' }],
+        addrDistrict: [{ required: true, message: '请选择区/县', trigger: 'change' }],
+        addrDetail: [{ required: true, message: '请输入详细地址', trigger: 'change' }],
+        contactName: [{ required: true, message: '请输入联系人姓名', trigger: 'change' }],
+        settleType: [{ required: true, message: '请选择收结算方式', trigger: 'change' }],
+        delearSn: [{ required: true, message: '请选择绑定汽配商', trigger: 'change' }],
+        customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
+        creditLimit: [{ required: true, message: '请输入授信额度', trigger: 'change' }]
+      },
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [], //  区下拉
+      settleStyleList: [] //  收款方式  下拉数据
+    }
+  },
+  methods: {
+    filterEmpty () {
+      let str = this.form.storeName
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.storeName = str
+    },
+    // 经销商
+    dealerChange (value) {
+      this.form.delearSn = value ? value.key : undefined
+    },
+    // 关联客户
+    custChange (value) {
+      this.form.customerSn = value ? value.key : undefined
+    },
+    //  图片上传
+    changeImage1 (file) {
+      this.form.storeImage = file
+    },
+    removeImage1 () {
+      this.form.storeImage = ''
+      this.$refs.storeImage.setFileList('')
+    },
+    //  图片上传
+    changeImage2 (file) {
+      this.form.licenseImage = file
+    },
+    removeImage2 () {
+      this.form.licenseImage = ''
+      this.$refs.licenseImage.setFileList('')
+    },
+    //  获取客户信息
+    getDetail () {
+      xprhStoreApplyDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          if (res.data.addrProvince) { this.getArea('city', res.data.addrProvince) }
+          if (res.data.addrDistrict) { this.getArea('district', res.data.addrCity) }
+          this.form = Object.assign(this.form, res.data)
+          this.$refs.storeImage.setFileList(res.data.storeImage)
+          this.$refs.licenseImage.setFileList(res.data.licenseImage)
+          this.form.auditStatus = 'PASS' // 通过
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+      })
+    },
+    //  保存
+    saveForm () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$confirm({
+            title: '操作提示',
+            content: <div><div>审核通过后,即可成为认证门店,</div><div>确认审核通过吗?</div></div>,
+            centered: true,
+            closable: true,
+            onOk () {
+              _this.handleSubmit()
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleSubmit (e) {
+      const _this = this
+      _this.spinning = true
+      xprhStoreApplyAudit(_this.form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.handleBack()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ name: 'approveStoreList', query: { closeLastOldTab: true } })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      console.log(val)
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.form.addrCity = undefined
+      this.form.addrDistrict = undefined
+      if (val) {
+        this.getArea('city', val)
+        this.form.addrProvinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.addrProvinceName = ''
+      }
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.form.addrDistrict = undefined
+      if (val) {
+        this.getArea('district', val)
+        this.form.addrCityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.addrCityName = ''
+      }
+    },
+    // 区县变更
+    areaCharged (val) {
+      if (val) {
+        this.form.addrDistrictName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.addrDistrictName = ''
+      }
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getAreaCgj(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    },
+    // 获取基础数据
+    getBaseData () {
+      this.getArea('province') //  省市区
+      this.$refs.ruleForm.resetFields()
+    },
+    initPage () {
+      this.getBaseData()
+      //  编辑页
+      if (this.$route.params.sn) {
+        this.getDetail()
+      }
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.initPage()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.initPage()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+.authPass-wrap {
+  height: 100%;
+  >.ant-spin-nested-loading{
+    height: calc(100% - 52px);
+	  overflow-y: auto;
+    .ant-spin-container{
+      height: 100%;
+    }
+    .upload-desc {
+      color:#999;
+      clear:both;
+    }
+  }
+  .ant-form-item-children{
+    display:block;
+  }
+	.authPass-back {
+		margin-bottom: 10px;
+	}
+  .authPass-table-page-wrapper{
+    height: 100%;
+  }
+}
+</style>

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

@@ -0,0 +1,217 @@
+<template>
+  <a-card size="small" :bordered="false" class="approveStore-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <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="4" :sm="24">
+              <a-form-item label="联系人手机">
+                <a-input allowClear placeholder="请输入联系人手机" v-model.tirm="queryParam.contactPhone"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="联系人姓名">
+                <a-input allowClear placeholder="请输入联系人姓名" v-model.tirm="queryParam.contactName"/>
+              </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.auditStatus"
+                  ref="auditStatus"
+                  id="approveStore-auditStatus"
+                  code="XPRH_STORE_APPLY_STATUS"
+                  placeholder="请选择审核状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <div>
+                <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="imageUrl" slot-scope="text, record">
+          <div v-if="text&&text.length">
+            <img :src="text" width="30" height="30" class="imageUrl" @click="inited(text)" />
+          </div>
+          <span v-else>--</span>
+        </template>
+        <!-- 地址 -->
+        <template slot="addr" slot-scope="text, record">
+          <div style="word-break:break-all;">
+            <div>{{ record.addrProvinceName +'-'+ record.addrCityName +'-'+ record.addrDistrictName }}</div>
+            <div>{{ record.addrDetail }}</div>
+          </div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <div v-if="record.auditStatus == 'WAIT'&&!record.inviteCode">
+            <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>
+          </div>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { xprhStoreApplyQueryPage, xprhStoreApplyAudit } from '@/api/approveStore'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      queryParam: {
+        contactName: '',
+        contactPhone: '',
+        storeName: '',
+        auditStatus: undefined
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '提交时间', dataIndex: 'applyTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人手机', dataIndex: 'contactPhone', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人姓名', dataIndex: 'contactName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '门店名称', dataIndex: 'storeName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '门店地址', dataIndex: 'addrDetail', width: '14%', align: 'center', scopedSlots: { customRender: 'addr' } },
+        { title: '汽配商邀请码', dataIndex: 'inviteCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '邀请码关联汽配商', dataIndex: 'dealerName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '门头照片', dataIndex: 'storeImage', width: '6%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
+        { title: '营业执照', dataIndex: 'licenseImage', width: '6%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
+        { title: '状态', dataIndex: 'auditStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return xprhStoreApplyQueryPage(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: {
+    inited (viewer) {
+      if (viewer && viewer.length) {
+        this.$info({
+          title: '图片预览',
+          okText: '关闭',
+          width: '600px',
+          content: (h) => { return h('img', { attrs: { src: viewer }, style: { width: '100%' } }) }
+        })
+      }
+    },
+    // 审核
+    handleAudit (row, type) {
+      // 审核通过
+      if (type == 1) {
+        this.$router.push({ name: 'approveStoreAuthPass', params: { sn: row.applySn } })
+      } else {
+        const _this = this
+        this.$confirm({
+          title: '提示',
+          content: '确认审核不通过吗?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.spinning = true
+            xprhStoreApplyAudit({
+              applySn: row.applySn,
+              auditStatus: 'REFUSE'
+            }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$refs.table.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
+              }
+            })
+          }
+        })
+      }
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.contactName = ''
+      this.queryParam.contactPhone = ''
+      this.queryParam.storeName = ''
+      this.queryParam.auditStatus = 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>

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.103:8501/qpls-it',
+        // target: 'http://192.168.0.102:8501/qpls-it',
         target: 'http://p.it.360arrow.com/qpls-it',
         ws: false,
         changeOrigin: true,