Browse Source

设计师招募

zhujindu 5 months ago
parent
commit
9211b19576
5 changed files with 239 additions and 1 deletions
  1. 2 0
      src/main.js
  2. 6 0
      src/router/index.js
  3. 28 0
      src/utils/index.js
  4. 191 0
      src/views/storeManagement/addDesignerPage.vue
  5. 12 1
      src/views/week/index.vue

+ 2 - 0
src/main.js

@@ -16,6 +16,7 @@ import {
   weeklyTimeDivision,
   gcj02BD,
   verifyStoreType,
+  validatePhone,
 } from '@/utils/index';
 import { toastLoading } from '@/utils/commonVant';
 import '@vant/touch-emulator';
@@ -60,6 +61,7 @@ Vue.prototype.wx = wx;
 Vue.prototype.parseTimeParagraph = parseTimeParagraph;
 Vue.prototype.Micrometer = Micrometer;
 Vue.prototype.verifyStoreType = verifyStoreType;
+Vue.prototype.validatePhone = validatePhone;
 Vue.prototype.Toast = Toast;
 Vue.prototype.notify = Notify;
 var clipboard = new ClipboardJS('.btn');

+ 6 - 0
src/router/index.js

@@ -125,6 +125,12 @@ const router = new VueRouter({
           name: 'chainMaintain',
           component: () => import('@/views/storeManagement/chainMaintain.vue'),
         },
+        {
+          path: '/addDesignerPage',
+          name: 'addDesignerPage',
+          component: () => import('@/views/storeManagement/addDesignerPage.vue'),
+          meta: { title: '设计师招募', keepAlive: true },
+        },
       ],
     },
     {

+ 28 - 0
src/utils/index.js

@@ -1,4 +1,6 @@
 import store from '../store';
+import { Toast } from 'vant';
+import { phoneCheck } from '@/api/index';
 
 // 日期格式化
 export function parseTime(time, pattern) {
@@ -255,3 +257,29 @@ export function getMonthCommon() {
   }
   return timeData;
 }
+
+// 手机号校验
+
+export function validatePhone(telephone) {
+  return new Promise((resolve, reject) => {
+    if (telephone == '' || !telephone) reject();
+    var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+    if (telephone.trim() == '') {
+      reject();
+    } else if (!telrg.test(telephone)) {
+      Toast('手机号格式错误');
+      reject();
+    } else {
+      Toast.loading('验证中...');
+      phoneCheck({ phoneNumber: telephone }).then((res) => {
+        Toast.clear();
+        if (res.code == 200) {
+          resolve();
+        } else {
+          Toast('手机号格式错误');
+          reject();
+        }
+      });
+    }
+  });
+}

+ 191 - 0
src/views/storeManagement/addDesignerPage.vue

@@ -0,0 +1,191 @@
+<template>
+  <div class="addDesignerPage">
+    <div class="header">
+      <van-nav-bar class="navBar" title="设计师招募" left-arrow @click-left="onClickLeft" />
+    </div>
+    <div class="content">
+      <van-form ref="tabstoreVal" @submit="onSubmit" :scroll-to-error="true" :show-error="false">
+        <van-field readonly :value="fromData.storeCode" label="客户编号">
+          <template #left-icon>
+            <span class="van-f-red"></span>
+          </template>
+        </van-field>
+        <van-field
+          v-model="fromData.storeName"
+          label="设计师名称"
+          placeholder="请输入设计师名称"
+          :rules="[{ required: true, message: '请输入设计师名称' }]">
+          <template #left-icon>
+            <span class="van-f-red">*</span>
+          </template>
+        </van-field>
+        <van-field
+          type="tel"
+          v-model="fromData.telephone"
+          label="手机号"
+          placeholder="请输入手机号"
+          :rules="[
+            {
+              required: true,
+              validator: validatePhone,
+              message: '请输入手机号',
+            },
+          ]">
+          <template #left-icon>
+            <span class="van-f-red">*</span>
+          </template>
+        </van-field>
+        <van-row style="border-bottom: 1px solid #ebedf0">
+          <van-col span="20">
+            <van-field
+              rows="1"
+              autosize
+              type="textarea"
+              readonly
+              clickable
+              name="picker"
+              :value="fromData.chainName"
+              label="经销商名称"
+              placeholder="点击选择经销商名称"
+              @click="showPickerChainsList = true">
+              <template #left-icon>
+                <span class="van-f-red">*</span>
+              </template>
+            </van-field>
+          </van-col>
+          <van-col span="4">
+            <van-button
+              size="small"
+              type="info"
+              style="margin-top: 6px"
+              native-type="button"
+              @click="moreTypeShowfn">
+              <van-icon name="list-switching" />更多
+            </van-button>
+          </van-col>
+        </van-row>
+      </van-form>
+    </div>
+    <!--经销商-->
+    <van-popup
+      v-model="showPickerChainsList"
+      position="bottom"
+      class="agencyBox"
+      :close-on-click-overlay="false">
+      <van-picker
+        show-toolbar
+        :columns="ChainsList"
+        value-key="chainName"
+        @confirm="onConfirmChainsList"
+        @cancel="showPickerChainsList = false" />
+    </van-popup>
+    <!-- 搜索更多经销商 -->
+    <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%; font-size: 14px">
+      <van-row style="background-color: #f5f5f5">
+        <van-col span="20">
+          <van-field
+            left-icon="search"
+            style="margin-top: 2px; border-radius: 6px; overflow: hidden"
+            v-model="searchChainName"
+            label=""
+            placeholder="请输入关键词"
+            clearable />
+        </van-col>
+        <van-col
+          span="4"
+          style="text-align: center; line-height: 48px"
+          @click="getChainsByDeptCodesearch">
+          <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
+        >
+      </van-row>
+      <van-picker
+        show-toolbar
+        :columns="chainsData"
+        value-key="chainName"
+        @confirm="onConfirmChainsList"
+        @cancel="moreTypeShow = false" />
+    </van-popup>
+  </div>
+</template>
+
+<script>
+import {
+  getStoreTypeList,
+  addStore,
+  beforeAdd,
+  streetQuery,
+  getTCFXList,
+  phoneCheck,
+  getChainsByDeptCode,
+  getSJSList,
+  getQGJZist,
+  checkVisit,
+  getbrands,
+  getCustomerInfoList,
+  getManagementModelList,
+  getMainRelationList,
+  getMainProjectList,
+  getCustomerNatureList,
+  getpotentialCustomerTypeList,
+} from '@/api/index';
+import { validatePhone } from '@/utils';
+export default {
+  data() {
+    return {
+      fromData: {
+        storeName: '',
+        telephone: '',
+        chainName: '',
+      },
+      showPickerChainsList: false, //经销商列表弹框
+      ChainsList: [], //经销商列表
+      chainsData: [],
+      moreTypeShow: false,
+      searchChainName: '',
+    };
+  },
+  methods: {
+    moreTypeShowfn() {
+      this.chainsData = [];
+      this.moreTypeShow = true;
+    },
+    getChainsByDeptCodesearch(chainName) {
+      this.chainsData = [];
+      getChainsByDeptCode({
+        chainName: this.searchChainName,
+        // cityName: this.fromData.cityNameOld,
+        // districtName: this.fromData.districtNameOld,
+        // deptId: this.fromData.orgId,
+        // ifJzStoreType: this.fromData.ifJzStoreType,
+        // storeCategory: this.fromData.storeCategory,
+      }).then((res) => {
+        this.chainsData = res.data.sfaChains;
+        this.chainsData.push({});
+        this.chainsData.pop();
+      });
+    },
+    onConfirmChainsList(value) {
+      this.fromData.chainName = value.chainName;
+      this.fromData.chainCode = value.chainCode;
+      this.showPickerChainsList = false;
+      this.moreTypeShow = false;
+    },
+    onSubmit() {},
+    onClickLeft() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.addDesignerPage {
+  display: flex;
+  flex-direction: column;
+  .header {
+    height: 46px;
+  }
+  .content {
+    flex: 1;
+  }
+}
+</style>

+ 12 - 1
src/views/week/index.vue

@@ -22,7 +22,16 @@
       <!--        主体内容-->
       <div class="container">
         <!--      门店及拜访-->
-        <van-cell-group inset class="mtb10">
+        <van-cell-group inset class="mtb10" v-if="reportInfo">
+          <van-cell
+            title="设计师招募"
+            is-link
+            to="/addDesignerPage"
+            v-if="reportInfo.designerRecruitButton">
+            <template #icon>
+              <van-icon :name="addShop" class="zicon" />
+            </template>
+          </van-cell>
           <van-cell :title="addBTN" is-link @click="onSelect('B')" v-if="addShow">
             <template #icon>
               <van-icon :name="addShop" class="zicon" />
@@ -292,6 +301,7 @@ export default {
       summaryApprovalButton: false,
       summaryPendingApprovalNum: 0,
       summaryApprovalFeedbackNum: 0,
+      reportInfo: null,
     };
   },
   watch: {
@@ -361,6 +371,7 @@ export default {
       this.getSelectAllocationPermission();
       getReportInfo({ isContent: false }).then((res) => {
         loading1.clear();
+        this.reportInfo = res.data;
         this.list = res.data.summaryTasks;
         this.historyButton = res.data.historyButton;
         localStorage.setItem('powerGrade', res.data.positionId);