소스 검색

专业版商户注册

changhaoning 1 년 전
부모
커밋
1f73d4e130
6개의 변경된 파일429개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      src/api/pages/outh/outhActivity.js
  2. 7 0
      src/locale/lang/zh-CN.js
  3. 1 1
      src/router/index.js
  4. 10 0
      src/router/routers.js
  5. 11 1
      src/view/login/login-form.vue
  6. 398 0
      src/view/login/register.vue

+ 2 - 0
src/api/pages/outh/outhActivity.js

@@ -8,5 +8,7 @@ export default {
     prefix: 'oauth-server/activity/',
     prefix: 'oauth-server/activity/',
     // 查询轮播图
     // 查询轮播图
     getActivity: 'list_by',
     getActivity: 'list_by',
+    // 查询活动
+    selectActivityItems:'select_activity_items',
   },
   },
 }
 }

+ 7 - 0
src/locale/lang/zh-CN.js

@@ -167,6 +167,7 @@ export const columns = {
   hrStatuses: '人事状态',
   hrStatuses: '人事状态',
   agree: '同意',
   agree: '同意',
   refuse: '拒绝',
   refuse: '拒绝',
+  activityInformation:'套餐活动',
   essentialInformation: '基本信息',
   essentialInformation: '基本信息',
   staffRelation: '绑定员工',
   staffRelation: '绑定员工',
   goodsInformation: '商品信息',
   goodsInformation: '商品信息',
@@ -744,6 +745,12 @@ export const columns = {
   ingBoxPiece:'包装数量',
   ingBoxPiece:'包装数量',
   intoingBoxPiece:'入库在包装数量',
   intoingBoxPiece:'入库在包装数量',
   intoBoxPiece:'已入库包装数量',
   intoBoxPiece:'已入库包装数量',
+  cpName:'公司名称',
+  cpManager:'负责人',
+  cpPhone:'联系电话',
+  cpSize:'公司规模',
+  shopSize:'门店规模',
+  feedback:'沟通反馈',
 }
 }
 
 
 /**
 /**

+ 1 - 1
src/router/index.js

@@ -59,7 +59,7 @@ const router = new Router({
 // router.addRoutes(loadMenu())
 // router.addRoutes(loadMenu())
 
 
 
 
-const NO_AUTH_NAME = ['error_500', 'login', 'login_hegii', 'auth', 'test', 'qv-login', 'wx-print', 'approval_waiting_for_approval', 'approval_waiting_for_approval_detail', 'log_report_export']
+const NO_AUTH_NAME = ['error_500', 'login', 'login_hegii', 'auth', 'test', 'qv-login', 'wx-print', 'approval_waiting_for_approval', 'approval_waiting_for_approval_detail', 'log_report_export','register']
 
 
 const NO_APP_AUTH_NAME = ['app-login','test']
 const NO_APP_AUTH_NAME = ['app-login','test']
 router.beforeEach((to, from, next) => {
 router.beforeEach((to, from, next) => {

+ 10 - 0
src/router/routers.js

@@ -38,6 +38,16 @@ let menu = [
     component: () => import('@/view/login/qv-login.vue')
     component: () => import('@/view/login/qv-login.vue')
   },
   },
   {
   {
+    path: '/register',
+    name: 'register',
+    meta: {
+      title: 'register - 注册',
+      hideInMenu: true,
+      notCache: true  
+    },
+    component: () => import('@/view/login/register.vue')
+  },
+  {
     path: '/wx-print',
     path: '/wx-print',
     name: 'wx-print',
     name: 'wx-print',
     meta: {
     meta: {

+ 11 - 1
src/view/login/login-form.vue

@@ -19,6 +19,7 @@
       </Input>
       </Input>
     </FormItem>
     </FormItem>
     <Checkbox v-model="rememberMe" class="remember-me">&nbsp;&nbsp;记住用户名</Checkbox>
     <Checkbox v-model="rememberMe" class="remember-me">&nbsp;&nbsp;记住用户名</Checkbox>
+    <el-button type="text" @click="register">注册</el-button>
     <FormItem style="padding-top: 4px;margin-bottom: 10px !important;">
     <FormItem style="padding-top: 4px;margin-bottom: 10px !important;">
       <Button class="login-class" @click="handleSubmit" size="large" type="primary" long :disabled="loading">
       <Button class="login-class" @click="handleSubmit" size="large" type="primary" long :disabled="loading">
         <span v-if="!loading">{{ $t('login') }}</span>
         <span v-if="!loading">{{ $t('login') }}</span>
@@ -133,7 +134,16 @@ export default {
         this.form.userCode = sessionStorage.getItem('rememberMe')
         this.form.userCode = sessionStorage.getItem('rememberMe')
         this.rememberMe = true
         this.rememberMe = true
       }
       }
-    }
+    },
+
+    /**
+    * @desc   : 注册
+    * @author : 常皓宁
+    * @date   : 2024/8/5 17:18
+    */
+    register(){
+      this.$router.push('/register')
+    },
   },
   },
   created() {
   created() {
     //记住密码
     //记住密码

+ 398 - 0
src/view/login/register.vue

@@ -0,0 +1,398 @@
+<!-- @desc:注册  @auth:常皓宁  @time:2024/8/5 13:04 -->
+<template>
+  <div class="main-div" ref="mainDiv">
+    <!--加载中-->
+    <!--    基本信息-->
+    <loading :loading="loading" v-if="!modalVisible"></loading>
+    <DkCollapse @on-change="changeCollapse" ref="collapse">
+      <DkPanel prop="essentialInformation">
+        <!--  下拉区域  -->
+        <DkForm slot="content" ref="formInline" v-model="formData" :labelMaxWords=6>
+          <!--企业名称-->
+          <DkFormItem :required="true" prop="cpName">
+            <InputPop ref="cpName" v-model="formData.cpName"/>
+          </DkFormItem>
+          <!--负责人-->
+          <DkFormItem :required="true" prop="cpManager">
+            <InputPop ref="cpManager" v-model="formData.cpManager"/>
+          </DkFormItem>
+          <!--联系电话-->
+          <DkFormItem :required="true" prop="cpPhone">
+            <InputPop ref="cpPhone" v-model="formData.cpPhone" :telephone="true"/>
+          </DkFormItem>
+          <!--结束日期-->
+          <DkFormItem prop="endDate" :required="true" :data-type="$config.dataType.date">
+            <DatePickerPop v-model="formData.endDate" transfer
+                           :placeholder="$t('inputWords',{'search-name':$t('endDate')})"
+                           type="date" :short-cut-flag="true"/>
+          </DkFormItem>
+          <!--公司规模-->
+          <DkFormItem prop="cpSize">
+            <InputNumberPop ref="cpSize" v-model="formData.cpSize"/>
+          </DkFormItem>
+          <!--门店规模-->
+          <DkFormItem prop="shopSize">
+            <InputNumberPop ref="shopSize" v-model="formData.shopSize"/>
+          </DkFormItem>
+          <!--沟通反馈-->
+          <DkFormItem prop="feedback">
+            <InputPop ref="feedback" v-model="formData.feedback"/>
+          </DkFormItem>
+        </DkForm>
+      </DkPanel>
+    </DkCollapse>
+    <!--    套餐信息-->
+    <DkCollapse @on-change="changeCollapse" ref="activity">
+      <DkPanel prop="activityInformation">
+        <DkForm slot="content" ref="formInline" v-model="activityTableForm">
+          <!--套餐-->
+          <div style="width: 100%;height: auto;margin-bottom: 15px;margin-top: 15px; margin-left: 20px;">
+            <div style="display:flex;flex-wrap: wrap;">
+              <div :class="(curentAdItem && curentAdItem.itemId == item.itemId)?'func-card-selected':'func-card'"
+                   v-for="(item, index) in activityTable" :key="item.itemId" @click="chooseAdItem(item)">
+                <!-- 标题 -->
+                <div class="card-title">{{ item.activityItemName }}</div>
+                <!-- 价格-->
+                <div class="card-price">¥{{ item.stdPrice }}</div>
+                <!-- 描述-->
+                <div class="card-desc">{{ item.activityItemDescribe }}
+                </div>
+              </div>
+            </div>
+          </div>
+
+          <!--用户数-->
+          <div class="card-class" v-if="proFlag">
+            <!--用户数量-->
+            <div slot="title" style="display: flex;margin-left: 10px;color: #e00808">
+              <div>用户数量</div>
+              <div style="font-size: 10px;">(包含手机和电脑授权)</div>
+              <InputNumberPop style="width: 200px;margin-left: 10px;" v-model="staffCount.maxNum"
+                              @on-change="(e)=>changeStaffCount(e,'all')"></InputNumberPop>
+            </div>
+            <span style="width: 100%;margin-left: 10px;">额外购买授权</span>
+
+            <!--手机用户数-->
+            <div slot="title" style="display: flex;margin-left: 10px;color: #e00808">
+              <div>手机端授权</div>
+              <div v-if="curentAdItem && curentAdItem.wxPrice" style="display: flex;font-size: 10px;">
+                <div style="font-size: 10px;margin-left: 2.5px;color: #e00808;height: 25px;">
+                  (¥{{ curentAdItem.wxPrice }}/个)
+                </div>
+              </div>
+              <InputNumberPop style="width: 200px;margin-left: 10px;" v-model="staffCount.wxMaxNum"
+                              @on-change="(e)=>changeStaffCount(e,'wx')"></InputNumberPop>
+            </div>
+            <!--电脑用户数-->
+            <div slot="title" style="display: flex;margin-left: 10px;color: #e00808">
+              <div>电脑端授权</div>
+              <div v-if="curentAdItem && curentAdItem.webPrice" style="display: flex;font-size: 10px;">
+                <div style="font-size: 10px;margin-left: 2.5px;color: #e00808;height: 20px;">
+                  (¥{{ curentAdItem.webPrice }}/个)
+                </div>
+              </div>
+              <InputNumberPop style="width: 200px;margin-left: 10px;" v-model="staffCount.webMaxNum"
+                              @on-change="(e)=>changeStaffCount(e,'web')"></InputNumberPop>
+            </div>
+          </div>
+
+          <!--合计-->
+          <div class="summary-class" v-if="proFlag && curentAdItem">
+            <div class="summary-item-class">订单详情:</div>
+            <div class="summary-item-class">{{ summaryInfo.amountInfo }}</div>
+            <div class="summary-item-class">截止日期:{{ summaryInfo.endDate }}</div>
+            <div class="summary-item-class" v-if="staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum">
+              {{ summaryInfo.staffInfo }}
+            </div>
+            <div class="summary-item-class" style="display: flex;justify-content: flex-end;"
+                 v-if="staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum">
+              折合
+              <div style="font-size: 14px;left: 5px;font-weight: bold;height: 45px;color: #FF7B1A">
+                {{ summaryInfo.priceInfo }}
+              </div>
+              /天/授权
+            </div>
+          </div>
+        </DkForm>
+      </DkPanel>
+    </DkCollapse>
+
+    <span style="font-size: 16px;font-weight: bold;">
+              注册须知:
+            </span>
+    <span style="display: flex;padding-top: 10px;">
+              用于登录系统时显示公司信息。
+            </span>
+    <span style="display: flex">
+              联系电话:用于登录系统。
+            </span>
+    <span style="display: flex">
+              公司规模及门店规模:用于开通系统配置基础档案。
+            </span>
+
+    <!--      下部分按钮区域-->
+    <DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close"></DkSaveButton>
+  </div>
+</template>
+
+<script>
+import {formMixin} from "@/mixins/form";
+
+export default {
+  name: 'register',
+  components: {},
+  mixins: [formMixin],
+
+  data() {
+    return {
+      activityTableForm: {},
+      activityTable: [],//功能
+      proFlag: false,
+      curentAdItem: {},
+      summaryInfo: {},
+      staffCount: {
+        maxNum: 1,
+        webMaxNum: 0,
+        wxMaxNum: 0
+      },
+      buyBeginDate: null,
+      formData: {
+        cpId: null,
+        cpName: null,
+        cpManager: null,
+        cpPhone: null,
+        cpSize: null,
+        shopSize: null,
+        feedback: null,
+        webMaxNum: null,
+        wxMaxNum: null,
+        endDate: null,
+      },
+    }
+  },
+  methods: {
+    /**
+     * @desc   : 参数赋值
+     * @author : 常皓宁
+     * @date   : 2024/8/7 10:09
+     */
+    setParams() {
+      this.formData.gradeCode = 'PRO'
+      this.params = {...this.formData}
+      if (this.formData.endDate) {
+        this.params.endDate = this.formData.endDate.format('yyyy-MM-dd')
+      }
+    },
+
+    /**
+     * @desc   : desc
+     * @author : 常皓宁
+     * @date   : 2024/4/30 14:17
+     */
+    saveData() {
+      return this.excute(this.$service.companyService, this.$service.companyService.insertCompany, this.params)
+    },
+
+    /**
+     * @desc : 查询活动
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    getActivity() {
+      let params = {
+        appCode: 'CP-WXP',
+        activityTypeList: ['活动分类-版本', '活动分类-功能'],
+        gradeCode: 'PRO',
+      }
+      this.excute(this.$service.outhActivityService, this.$service.outhActivityService.selectActivityItems, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.activityTable = res.data;
+        } else {
+          this.$Message.warning(res.message)
+        }
+      });
+    },
+
+    /**
+     * @desc   : 选择套餐
+     * @author : 常皓宁
+     * @date   : 2024/8/7 11:14
+     */
+    chooseAdItem(item) {
+      this.proFlag = true
+      let summaryInfo = this.summaryInfo
+      // 计算截止日期
+      let months = item.validLong + item.extraLong
+      let endDate = new Date(this.buyBeginDate).addMonths(months)
+      summaryInfo.endDate = endDate.toDateStr();
+      this.curentAdItem = item
+      this.summaryInfo = summaryInfo
+      // 计算金额
+      this.countSummaryAmount(item);
+    },
+    /**
+     * @desc : 修改用户数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    changeStaffCount(e, type) {
+      let staffCount = this.staffCount
+      if (type == 'wx') {
+        staffCount.wxMaxNum = e
+      } else if (type == 'web') {
+        staffCount.webMaxNum = e
+      } else {
+        staffCount.maxNum = e
+      }
+      this.staffCount = staffCount
+      // 计算金额
+      this.countSummaryAmount();
+    },
+
+    /**
+     * @desc : 计算金额
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    countSummaryAmount() {
+      let item = this.curentAdItem;
+      let staffCount = this.staffCount;
+      let summaryInfo = this.summaryInfo
+      let amount = 0;
+      // 先清空
+      summaryInfo.amountInfo = '';
+      // 共通用户
+      if (staffCount.maxNum) {
+        summaryInfo.amountInfo = item.stdPrice + '(打包价格)*' + staffCount.maxNum
+        amount += item.stdPrice * staffCount.maxNum
+      }
+      // 手机端用户
+      if (staffCount.wxMaxNum) {
+        if (summaryInfo.amountInfo) {
+          summaryInfo.amountInfo += ' + '
+        }
+        summaryInfo.amountInfo += item.wxPrice + '(手机端价格)*' + staffCount.wxMaxNum
+        amount += item.wxPrice * staffCount.wxMaxNum
+      }
+      // 电脑端用户
+      if (staffCount.webMaxNum) {
+        if (summaryInfo.amountInfo) {
+          summaryInfo.amountInfo += ' + '
+        }
+        summaryInfo.amountInfo += item.webPrice + '(电脑端价格)*' + staffCount.webMaxNum
+        amount += item.webPrice * staffCount.webMaxNum
+      }
+      if (summaryInfo.amountInfo) {
+        summaryInfo.amountInfo += ' = ' + amount + '(元)'
+        summaryInfo.amount = amount;
+      }
+      this.summaryInfo = summaryInfo
+      // 统计两端用户数
+      this.countStaffInfo();
+    },
+    /**
+     * @desc : 统计电脑端和手机端的用户数
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    countStaffInfo() {
+      let summaryInfo = this.summaryInfo;
+      let staffCount = this.staffCount;
+      if (!staffCount) {
+        return;
+      }
+      let webNum = staffCount.webMaxNum + staffCount.maxNum
+      let wxNum = staffCount.wxMaxNum + staffCount.maxNum
+      summaryInfo.staffInfo = '可配置手机端授权' + wxNum + '个;电脑端授权' + webNum + '个(包含当前用户)'
+      summaryInfo.webMaxNum = webNum
+      summaryInfo.wxMaxNum = wxNum
+      let buyBeginDate = new Date(this.buyBeginDate);
+      summaryInfo.buyBeginDate = buyBeginDate.toDateStr();
+      summaryInfo.extendDays = Math.ceil(Math.abs(new Date(summaryInfo.endDate).getTime() - buyBeginDate.getTime()) / (1000 * 3600 * 24));
+      // 计算一授权一天的单价
+      let price = (summaryInfo.amount / (webNum + wxNum) / summaryInfo.extendDays).toFixed(2);
+      summaryInfo.priceInfo = price
+      this.summaryInfo = summaryInfo
+    },
+
+
+    /**
+     * @desc   : 加载数据
+     * @author : 常皓宁
+     * @date   : 2024/4/30 9:02
+     */
+    initData() {
+      this.getActivity()
+    },
+  },
+}
+</script>
+
+<style scoped>
+.func-card-selected {
+  margin: 15px 1.15%;
+  width: 10.5%;
+  height: 100px;
+  background: #FCF0DD;
+  border-radius: 19px;
+  border: 3px solid #CE9965;
+}
+
+.func-card {
+  margin: 15px 1.15%;
+  width: 10.5%;
+  height: 100px;
+  background: #EEEEEE;
+  border-radius: 19px;
+}
+
+.card-title {
+  margin-top: 10px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  color: #1B365D;
+  font-size: 16px;
+  font-weight: 600;
+}
+
+.card-desc {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  color: #95A8CB;
+  font-size: 11px;
+}
+
+.card-price {
+  font-size: 16px;
+  align-items: center;
+  justify-content: center;
+  color: #FF7B1A;
+  display: flex;
+  width: 100%;
+}
+
+.card-class {
+  margin: 0 30px;
+  border-radius: 16px;
+  background: #ffffff;
+  width: 100%;
+}
+
+.summary-class {
+  margin: 0 30px;
+  margin-top: 30px;
+  padding: 10px 20px;
+  border-radius: 16px;
+  background: #ffffff;
+  color: #CE9965;
+  font-size: 14px;
+}
+
+.summary-item-class {
+  margin: 8px 0;
+}
+</style>