Browse Source

门店审核

lilei 3 years ago
parent
commit
0e7005d467

+ 1 - 1
public/version.json

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

+ 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'
+  })
+}

+ 13 - 1
src/config/router.config.js

@@ -333,7 +333,7 @@ export const asyncRouterMap = [
             meta: {
               title: '汽修厂认证审核',
               icon: 'monitor',
-              permission: 'M_approveStore'
+              // permission: 'M_approveStore'
             },
             hideChildrenInMenu: true,
             children: [
@@ -349,6 +349,18 @@ export const asyncRouterMap = [
                   // 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
+                  // permission: 'M_approveStore'
+                }
+              },
             ]
           },
           {

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

@@ -0,0 +1,379 @@
+<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"
+                  @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"
+                  @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="30"
+                  v-model.trim="form.contactName"
+                  @change="filterEmpty"
+                  placeholder="请输入联系人姓名(最多30个字符)"
+                  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="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">
+              <a-form-model-item label="关联客户" prop="customerSn">
+                <custList ref="custList" :isEnabled="true" @change="custChange" v-model="form.customerSn"></custList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="授信额度" prop="creditLimit">
+                <a-input-number :min="100" 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 { commonMixin } from '@/utils/mixin'
+import { STable, VSelect, Upload } from '@/components'
+import { getArea } from '@/api/data'
+import custList from '@/views/common/custList.vue'
+import { xprhStoreApplyDetail, xprhStoreApplyAudit } from '@/api/approveStore'
+export default {
+  name: 'ApproveStoreAuthPass',
+  components: { STable, VSelect, custList, Upload },
+  mixins: [commonMixin],
+  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: '', //  授信额度
+        delearSn: undefined,
+        applySn: undefined,
+        auditStatus: 'PASS' // 通过
+      },
+      rules: {
+        storeName: [{ required: true, message: '请输入门店名称', trigger: 'blur' }],
+        contactMobile: [{ required: false, pattern: /^\d{30}$/, 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' }],
+        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
+    },
+    // 关联客户
+    custChange (obj, row) {
+      this.form.customerSn = row ? obj.key : undefined
+    },
+    //  图片上传
+    changeImage1 (file) {
+      this.form.storeImage = file
+    },
+    //  图片上传
+    changeImage2 (file) {
+      this.form.licenseImage = file
+    },
+    //  获取客户信息
+    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.addrDistrict) }
+          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: '审核通过后用户即可登录修配易码通,确认审核通过吗?',
+            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' })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.form.citySn = undefined
+      this.form.countySn = 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.countySn = 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' }
+      }
+      getArea(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;
+    }
+  }
+	.authPass-back {
+		margin-bottom: 10px;
+	}
+  .authPass-table-page-wrapper{
+    height: 100%;
+  }
+}
+</style>

+ 76 - 27
src/views/numsGoodsShelves/approveStore/list.vue

@@ -11,12 +11,12 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="联系人手机">
-                <a-input allowClear placeholder="请输入联系人手机" v-model.tirm="queryParam.mobile"/>
+                <a-input allowClear placeholder="请输入联系人手机" v-model.tirm="queryParam.contactPhone"/>
               </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-input allowClear placeholder="请输入联系人姓名" v-model.tirm="queryParam.contactName"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -27,10 +27,10 @@
             <a-col :md="4" :sm="24">
               <a-form-item label="状态">
                 <v-select
-                  v-model="queryParam.status"
-                  ref="status"
-                  id="approveStore-status"
-                  code="FLAG"
+                  v-model="queryParam.auditStatus"
+                  ref="auditStatus"
+                  id="approveStore-auditStatus"
+                  code="XPRH_STORE_APPLY_STATUS"
                   placeholder="请选择"
                   allowClear></v-select>
               </a-form-item>
@@ -56,10 +56,26 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
+        <!-- 图片 -->
+        <template slot="imageUrl" slot-scope="text, record">
+          <div v-if="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>
+            {{ record.addrProvinceName +'-'+ record.addrCityName +'-'+ record.addrDistrictName +'-'+ record.addrDetail }}
+          </div>
+        </template>
         <!-- 操作 -->
         <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>
+          <div v-if="record.auditStatus == 'WAIT'">
+            <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>
@@ -69,7 +85,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { shelfList } from '@/api/shelf'
+import { xprhStoreApplyQueryPage, xprhStoreApplyAudit } from '@/api/approveStore'
 export default {
   components: { STable, VSelect },
   mixins: [commonMixin],
@@ -79,28 +95,28 @@ export default {
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        name: '',
-        mobile: '',
+        contactName: '',
+        contactPhone: '',
         storeName: '',
-        status: undefined
+        auditStatus: 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' }
+        { title: '提交时间', dataIndex: 'applyTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人手机', dataIndex: 'contactPhone', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人姓名', dataIndex: 'contactName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '门店名称', dataIndex: 'storeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '门店地址', dataIndex: 'addrDetail', width: '16%', align: 'center', scopedSlots: { customRender: 'addr' }, ellipsis: true },
+        { title: '门头照片', dataIndex: 'storeImage', width: '8%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
+        { title: '营业执照', dataIndex: 'licenseImage', width: '8%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
+        { title: '状态', dataIndex: 'auditStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return shelfList(Object.assign(parameter, this.queryParam)).then(res => {
+        return xprhStoreApplyQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -119,16 +135,49 @@ export default {
     }
   },
   methods: {
+    inited (viewer) {
+      if (viewer.length) {
+        this.$viewerApi({
+          images: viewer
+        })
+      }
+    },
     // 审核
-    handleAudit () {
-
+    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.name = ''
-      this.queryParam.moblie = ''
+      this.queryParam.contactName = ''
+      this.queryParam.contactPhone = ''
       this.queryParam.storeName = ''
-      this.queryParam.status = undefined
+      this.queryParam.auditStatus = undefined
       this.$refs.table.refresh(true)
     },
     setTableH () {

+ 1 - 1
vue.config.js

@@ -211,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.215:8076/qpls-md',
+        target: 'http://192.168.0.102/qpls-md',
         // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,