Browse Source

feature:打卡增加经销商代理商类型、合作伙伴增加代理商经销商列表、增加经销商代理商的打卡功能

liuzl 2 years ago
parent
commit
400e6d39b6

+ 4 - 0
api/base/distr.js

@@ -30,4 +30,8 @@ export default {
   getEntity(query) {
     return micro_request.postRequest(basePath, 'Distributor', 'GetEntityById', query)
   },
+  // 获取经销商代理商联系人列表
+  getContactList(query) {
+    return micro_request.postRequest(basePath, 'DistributorContact', 'List', query)
+  },
 }

+ 2 - 2
components/CustomerContact.vue

@@ -52,8 +52,8 @@
         queryForm: {
           custId: 0,
           keyword: '',
-          pageNum: 1,
-          pageSize: 10,
+          // pageNum: 1,
+          // pageSize: 10,
           type: '全部客户',
         },
         // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中

+ 126 - 0
components/DistrContact.vue

@@ -0,0 +1,126 @@
+<!--
+  * @Author: liuzhenlin 461480418@qq.ocm
+  * @Date: 2023-02-15 10:34:49
+ * @LastEditors: liuzhenlin
+ * @LastEditTime: 2023-05-22 17:32:58
+  * @Description: file content
+ * @FilePath: \oms\components\DistrContact.vue
+ -->
+<template>
+  <view>
+    <u-popup :show="selectVisible" @close="close">
+      <view class="select-header">
+        <view class="tit">选择{{ distrType == '50' ? '经销商' : '代理商' }}联系人</view>
+        <view class="save-btn" @click="close()">保存</view>
+      </view>
+      <view class="search-container">
+        <view class="search-input">
+          <u-input
+            clearable
+            placeholderStyle="font-size:26rpx"
+            :customStyle="{ height: '66rpx' }"
+            v-model="name"
+            prefixIcon="search"
+            prefixIconStyle="font-size: 22px;color: #909399"
+            placeholder="请输入联系人名称"
+            shape="circle"
+            @input="getUserList()"
+            border="surround"></u-input>
+        </view>
+      </view>
+      <u-empty mode="list" v-if="userList.length == 0"></u-empty>
+      <view class="concat-list" v-else>
+        <u-radio-group v-model="userValue" placement="column">
+          <view class="radio-item" v-for="item in userList" :key="item.id">
+            <u-radio :label="item.name" :name="item.id" @change="radioChange"></u-radio>
+          </view>
+        </u-radio-group>
+      </view>
+    </u-popup>
+  </view>
+</template>
+
+<script>
+  import distrApi from '@/api/base/distr'
+  import to from 'await-to-js'
+  export default {
+    name: 'OmsCustomerContact',
+    props: {
+      distrType: {
+        type: String | Number,
+        required: true,
+      },
+    },
+    data() {
+      return {
+        selectVisible: false,
+        userList: [],
+        // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
+        userValue: null,
+        selected: null,
+        distId: 0,
+        name: '',
+      }
+    },
+
+    methods: {
+      async getUserList() {
+        const params = {
+          distId: this.distId,
+          name: this.name,
+        }
+        const [err, res] = await to(distrApi.getContactList(params))
+        if (err) return
+        if (res.code == 200) {
+          this.userList = res.data.list
+        }
+      },
+      open(id) {
+        console.log(111111)
+        this.distId = id
+        this.selectVisible = true
+        this.getUserList()
+      },
+      close() {
+        this.selectVisible = false
+        this.$emit('close', this.selected)
+      },
+      radioChange(n) {
+        this.selected = this.userList.find((item) => item.id == n)
+      },
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  .search-container {
+    padding: 30rpx 30rpx 0 30rpx;
+    display: flex;
+    align-items: center;
+    .search-input {
+      flex: 1;
+    }
+    .search-btn {
+      text-align: center;
+      line-height: 60rpx;
+      border-radius: 12rpx;
+      width: 100rpx;
+      height: 60rpx;
+      font-size: 26rpx;
+      margin: 0 0 0 12rpx;
+      background: $u-primary;
+      color: #ffffff;
+    }
+  }
+  .concat-list {
+    padding: 0 0 20rpx 0;
+    width: 100%;
+    height: 900rpx;
+    overflow: auto;
+    margin-top: 30rpx;
+    .radio-item {
+      padding: 20rpx 30rpx;
+      border-bottom: 1px solid #ccc;
+    }
+  }
+</style>

+ 2 - 2
components/ProjectContact.vue

@@ -53,8 +53,8 @@
           busId: 0,
           custId: 0,
           keyword: '',
-          pageNum: 1,
-          pageSize: 10,
+          // pageNum: 1,
+          // pageSize: 10,
         },
         // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
         userValue: null,

+ 24 - 5
components/SelectDealer.vue

@@ -2,15 +2,15 @@
  * @Author: liuzhenlin 461480418@qq.ocm
  * @Date: 2023-02-15 10:34:49
  * @LastEditors: liuzhenlin
- * @LastEditTime: 2023-02-20 15:15:45
+ * @LastEditTime: 2023-05-22 11:14:36
  * @Description: file content
- * @FilePath: \frontend_mobile\components\SelectDealer.vue
+ * @FilePath: \oms\components\SelectDealer.vue
 -->
 <template>
   <view>
     <u-popup :show="selectVisible" @close="close">
       <view class="select-header">
-        <view class="tit">选择经销商/代理商</view>
+        <view class="tit">选择{{ distrLabel }}</view>
         <view class="save-btn" @click="close()">保存</view>
       </view>
       <view class="search-container">
@@ -28,7 +28,7 @@
             border="surround"></u-input>
         </view>
       </view>
-      <view class="tit">经销商名称/助记名/所在省份/归属销售/负责人</view>
+      <view class="tit">{{ distrLabel }}/助记名/所在省份/归属销售/负责人</view>
       <u-empty mode="list" v-if="userList.length == 0"></u-empty>
       <view class="concat-list" v-else>
         <u-radio-group v-model="userValue" placement="column">
@@ -46,6 +46,12 @@
   import to from 'await-to-js'
   export default {
     name: 'OmsCustomerContact',
+    props: {
+      distrId: {
+        type: String | Array,
+        default: () => null,
+      },
+    },
     data() {
       return {
         selectVisible: false,
@@ -60,10 +66,23 @@
         selected: null,
       }
     },
-
+    computed: {
+      distrLabel: function () {
+        let str = ''
+        if (this.distrId) {
+          str = this.distrId == '30' ? '经销商' : '代理商'
+        } else {
+          str = '经销商/代理商'
+        }
+        return str
+      },
+    },
     methods: {
       async getList() {
         let params = this.queryForm
+        if (this.distrId) {
+          params.distType = parseInt(this.distrId) - 20 + ''
+        }
         const [err, res] = await to(distrApi.getList(params))
         if (err) return
         if (res.code == 200) {

+ 78 - 33
pages/customer/add.vue

@@ -12,7 +12,7 @@
       <view :style="{ paddingTop }">
         <view class="title" :style="[{ height }, { lineHeight: height }]">
           <view class="back" @click="goBack()">
-            <u-icon custName="arrow-left" color="#ffffff" size="22"></u-icon>
+            <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
           </view>
           <text>新增客户</text>
         </view>
@@ -25,17 +25,29 @@
             <view class="label-tag"></view>
             客户名称
           </view>
-          <u-input placeholder="输入客户名称" v-model="addForm.custName" border="none" suffixIcon="account"
-            suffixIconStyle="color:#CDCDCD" clearable customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+          <u-input
+            placeholder="输入客户名称"
+            v-model="addForm.custName"
+            border="none"
+            suffixIcon="account"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
         <u-form-item prop="industry" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showIndustry = true">
           <view class="form-label flex_l">
             <view class="label-tag"></view>
             客户行业
           </view>
-          <u-input :readonly="true" placeholder="请选择客户行业" v-model="addForm.industry" border="none"
-            suffixIcon="arrow-down" suffixIconStyle="color:#CDCDCD" clearable customStyle="padding: 0 30rpx 0 12rpx">
-          </u-input>
+          <u-input
+            :readonly="true"
+            placeholder="请选择客户行业"
+            v-model="addForm.industry"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
         <!-- <u-form-item prop="level" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showLevel = true">
           <view class="form-label flex_l">
@@ -57,30 +69,49 @@
             <view class="label-tag"></view>
             客户来源
           </view>
-          <u-input :readonly="true" placeholder="请选择客户来源" v-model="addForm.custSource" border="none"
-            suffixIcon="arrow-down" suffixIconStyle="color:#CDCDCD" clearable customStyle="padding: 0 30rpx 0 12rpx">
-          </u-input>
+          <u-input
+            :readonly="true"
+            placeholder="请选择客户来源"
+            v-model="addForm.custSource"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
         <u-form-item prop="area" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showArea = true">
           <view class="form-label flex_l">
             <view class="label-tag"></view>
             所在地区
           </view>
-          <u-input :readonly="true" placeholder="请选择所在地区" v-model="addForm.area" border="none" suffixIcon="arrow-down"
-            suffixIconStyle="color:#CDCDCD" clearable customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+          <u-input
+            :readonly="true"
+            placeholder="请选择所在地区"
+            v-model="addForm.area"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
         <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-          <view class="form-label flex_l">
-            备注
-          </view>
-          <u-input placeholder="输入备注" v-model="addForm.remark" border="none" clearable
+          <view class="form-label flex_l">备注</view>
+          <u-input
+            placeholder="输入备注"
+            v-model="addForm.remark"
+            border="none"
+            clearable
             customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
       </u-form>
       <view class="save" @click="handleAdd">保存</view>
     </view>
     <!-- 选择客户行业 -->
-    <u-picker :show="showIndustry" :columns="industryColumns" keyName="value" @cancel="showIndustry = false"
+    <u-picker
+      :show="showIndustry"
+      :columns="industryColumns"
+      keyName="value"
+      @cancel="showIndustry = false"
       @confirm="pickIndustry"></u-picker>
     <!-- 选择客户级别 -->
     <!-- <u-picker
@@ -90,12 +121,26 @@
       @cancel="showLevel = false"
       @confirm="pickLevel"></u-picker> -->
     <!-- 选择客户来源 -->
-    <u-picker :show="showSource" :columns="sourceColumns" keyName="value" @cancel="showSource = false"
+    <u-picker
+      :show="showSource"
+      :columns="sourceColumns"
+      keyName="value"
+      @cancel="showSource = false"
       @confirm="pickSource"></u-picker>
     <!-- 选择地区 -->
-    <u-picker :show="showArea" @cancel="showArea = false" @close="showArea = false" :columns="addressColumns"
-      @confirm="localConfirm" title="请选择所在地" keyName="distName" itemHeight="80" closeOnClickOverlay ref="areaPicker"
-      @change="changeHandler" immediateChange></u-picker>
+    <u-picker
+      :show="showArea"
+      @cancel="showArea = false"
+      @close="showArea = false"
+      :columns="addressColumns"
+      @confirm="localConfirm"
+      title="请选择所在地"
+      keyName="distName"
+      itemHeight="80"
+      closeOnClickOverlay
+      ref="areaPicker"
+      @change="changeHandler"
+      immediateChange></u-picker>
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
   </view>
@@ -129,7 +174,7 @@
           // levelId: null,
           custSource: '', //来源
           custSourceId: null,
-          area: "",
+          area: '',
           CustProvinceId: null, //省
           CustProvince: '',
           CustCityId: null, //市
@@ -184,11 +229,11 @@
       // 获取字典数据
       getOptions() {
         Promise.all([
-            distrApi.getProvinceInfo(), //省市区
-            // this.getDicts('cust_level'), //级别
-            this.getDicts('cust_idy'), //行业
-            this.getDicts('cust_source'), //来源
-          ])
+          distrApi.getProvinceInfo(), //省市区
+          // this.getDicts('cust_level'), //级别
+          this.getDicts('cust_idy'), //行业
+          this.getDicts('cust_source'), //来源
+        ])
           .then(([province, industry, source]) => {
             this.areaColumns = province.data.list || []
             // this.levelColumns = [level.data.values] || []
@@ -224,21 +269,21 @@
         this.areaColumns.forEach((item) => {
           sheng.push({
             distName: item.distName,
-            id: item.id
+            id: item.id,
           })
           // 设置初始化的数据
           if (item.distName == '北京市') {
             item.children.forEach((child) => {
               shi.push({
                 distName: child.distName,
-                id: child.id
+                id: child.id,
               })
 
               if (child.distName == '北京市') {
                 child.children.forEach((el) => {
                   qu.push({
                     distName: el.distName,
-                    id: el.id
+                    id: el.id,
                   })
                 })
               }
@@ -272,7 +317,7 @@
                 item.children.forEach((val, ol) => {
                   shi.push({
                     distName: val.distName,
-                    id: val.id
+                    id: val.id,
                   })
                   if (shi[0].distName == flag) {
                     //设置默认开关(选择省份后设置默认城市)
@@ -281,7 +326,7 @@
                     val.children.forEach((vol) => {
                       qu.push({
                         distName: vol.distName,
-                        id: vol.id
+                        id: vol.id,
                       })
                     })
                     picker.setColumnValues(2, qu)
@@ -303,14 +348,14 @@
               item.children.forEach((val, ol) => {
                 shi.push({
                   distName: val.distName,
-                  id: val.id
+                  id: val.id,
                 })
                 if (value[1].distName == val.distName) {
                   let qu = []
                   val.children.forEach((vol) => {
                     qu.push({
                       distName: vol.distName,
-                      id: vol.id
+                      id: vol.id,
                     })
                   })
                   picker.setColumnValues(2, qu)

+ 363 - 44
pages/distributor/components/distrDetail.vue

@@ -2,51 +2,299 @@
  * @Author: liuzhenlin 461480418@qq.ocm
  * @Date: 2023-02-15 16:25:58
  * @LastEditors: liuzhenlin
- * @LastEditTime: 2023-02-16 11:17:12
+ * @LastEditTime: 2023-05-22 16:10:29
  * @Description: file content
- * @FilePath: \oms\pages\customer\components\customerDetail.vue
+ * @FilePath: \oms\pages\distributor\components\distrDetail.vue
 -->
 <template>
   <view>
-    <view class="info-item">
-      <u-row justify="space-between" gutter="10">
-        <u-col span="12">
-          <view class="flex_l">
-            <view class="label">助记名::</view>
-            <view class="desc">{{ detail.abbrName }}</view>
-          </view>
-        </u-col>
-      </u-row>
+    <!-- 经销商 -->
+    <view v-if="detail.distType == '10'">
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">经销商名称:</view>
+              <view class="desc">{{ detail.distName }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row>
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">助记名称:</view>
+              <view class="desc">{{ detail.abbrName }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row>
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">业务范围:</view>
+              <view class="desc">{{ detail.businessScope }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">注册资金:</view>
+              <view class="desc">{{ detail.capital }}万元</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">注册地:</view>
+              <view class="desc">{{ detail.registerDistrict }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">授权客户类型:</view>
+              <view class="desc">{{ setCustomerType(detail.customerType) }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">ABC项目出货总金额:</view>
+              <view class="desc"><u-text mode="price" :text="detail.allProductAmount"></u-text></view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">未回款金额:</view>
+              <view class="desc"><u-text mode="price" :text="detail.unpaidAmount"></u-text></view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">已有代理品牌和产品:</view>
+              <view class="desc">{{ detail.existedProduct }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">历史合作终端客户名称:</view>
+              <view class="desc">{{ detail.historyCustomer }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">归属销售:</view>
+              <view class="desc">{{ detail.belongSale }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">销售人数:</view>
+              <view class="desc">{{ detail.saleNum }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">创建时间:</view>
+              <view class="desc">{{ parseTime(detail.createdTime, '{y}-{m}-{d}') }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">更新时间:</view>
+              <view class="desc">{{ parseTime(detail.updatedTime, '{y}-{m}-{d}') }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
     </view>
-    <view class="info-item">
-      <u-row>
-        <u-col span="12">
-          <view class="flex_l">
-            <view class="label">负责人电话::</view>
-            <view class="desc">{{ detail.distBossPhone }}</view>
-          </view>
-        </u-col>
-      </u-row>
-    </view>
-    <view class="info-item">
-      <u-row>
-        <u-col span="12">
-          <view class="flex_l">
-            <view class="label">业务范围::</view>
-            <view class="desc">{{ detail.businessScope }}</view>
-          </view>
-        </u-col>
-      </u-row>
-    </view>
-    <view class="info-item">
-      <u-row justify="space-between" gutter="10">
-        <u-col span="12">
-          <view class="flex_l">
-            <view class="label">创建人::</view>
-            <view class="desc">{{ detail.createdName }}</view>
-          </view>
-        </u-col>
-      </u-row>
+    <!-- 代理商 -->
+    <view v-if="detail.distType == '20'">
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">代理商名称:</view>
+              <view class="desc">{{ detail.distName }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">助记名称:</view>
+              <view class="desc">{{ detail.abbrName }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">所在省份:</view>
+              <view class="desc">{{ detail.provinceDesc }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">业务范围:</view>
+              <view class="desc">{{ detail.businessScope }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">注册资金:</view>
+              <view class="desc">{{ detail.capital }}万元</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">注册地:</view>
+              <view class="desc">{{ detail.registerDistrict }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">现有销售人数::</view>
+              <view class="desc">{{ detail.saleNum }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">授权客户类型:</view>
+              <view class="desc">{{ setCustomerType(detail.customerType) }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">授权区域代理:</view>
+              <view class="desc">{{ detail.proxyDistrict }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">代理合同:</view>
+              <view class="desc" @click="downloadFile(detail.contractUrl)">
+                <u-text type="primary" text="附件"></u-text>
+              </view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">ABC项目出货总金额:</view>
+              <view class="desc"><u-text mode="price" :text="allProductAmount"></u-text></view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">未回款金额:</view>
+              <view class="desc"><u-text mode="price" :text="unpaidAmount"></u-text></view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">已有代理品牌和产品:</view>
+              <view class="desc">{{ detail.existedProduct }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
+      <view class="info-item">
+        <u-row justify="space-between" gutter="10">
+          <u-col span="12">
+            <view class="flex_l">
+              <view class="label">历史合作终端客户名称:</view>
+              <view class="desc">{{ detail.historyCustomer }}</view>
+            </view>
+          </u-col>
+        </u-row>
+      </view>
     </view>
   </view>
 </template>
@@ -61,12 +309,82 @@
       },
     },
     data() {
-      return {}
+      return {
+        customerOptions: [],
+      }
     },
 
-    mounted() {},
+    mounted() {
+      this.getOptions()
+    },
 
-    methods: {},
+    methods: {
+      //通用下载文件方法
+      downloadFile(attachLink) {
+        uni.downloadFile({
+          url: attachLink, //下载地址,后端接口获取的链接
+          success: (data) => {
+            console.log(data.tempFilePath)
+            console.log(JSON.stringify(data))
+            if (data.statusCode === 200) {
+              uni.saveFile({
+                //文件保存到本地
+                tempFilePath: data.tempFilePath, //临时路径
+                success: function (res) {
+                  console.log('下载成功' + res.savedFilePath)
+                  console.log(JSON.stringify(res))
+                  uni.showToast({
+                    icon: 'none',
+                    mask: true,
+                    title: '文件已保存!',
+                    duration: 3000,
+                  })
+                  uni.openDocument({
+                    //fileType: 'docx',
+                    showMenu: true, //关键点,可以转发到微信
+                    filePath: res.savedFilePath,
+                    success: function (res) {
+                      console.log('打开文档成功')
+                    },
+                  })
+                },
+              })
+            }
+          },
+          fail: (err) => {
+            console.log(err)
+            uni.showToast({
+              icon: 'none',
+              mask: true,
+              title: '失败请重新下载',
+            })
+          },
+        })
+      },
+      setCustomerType(type) {
+        if (this.customerOptions.length == 0) return
+        if (!type) return
+        let arr = []
+        let typeArr = type.split(',')
+        console.log(type)
+        console.log(this.customerOptions)
+        typeArr.map((item) => {
+          console.log(item)
+          arr.push(this.customerOptions.find((e) => e.key == item).value)
+        })
+        return arr.join(',')
+      },
+      getOptions() {
+        Promise.all([this.getDicts('cust_idy')])
+          .then(([data]) => {
+            this.customerOptions = data.data.values
+            // data.data.values.filter((i) => {
+            //   this.customerOptions[i.key] = i.value
+            // })
+          })
+          .catch((err) => console.log(err))
+      },
+    },
   }
 </script>
 
@@ -74,12 +392,13 @@
   .info-item {
     padding: 20rpx;
     .label {
+      width: 160rpx;
       color: #646464;
       font-size: 26rpx;
     }
     .desc {
       font-size: 26rpx;
-      text-indent: 20rpx;
+      margin-left: 20rpx;
     }
   }
 </style>

+ 7 - 3
pages/distributor/components/followRecords.vue

@@ -41,7 +41,11 @@
   export default {
     name: 'OmsCustomerDetail',
     props: {
-      customerId: {
+      targetId: {
+        type: [String, Number],
+        default: '0',
+      },
+      targetType: {
         type: [String, Number],
         default: '0',
       },
@@ -51,7 +55,6 @@
         followList: [],
       }
     },
-
     mounted() {
       this.getRecords()
     },
@@ -59,7 +62,8 @@
     methods: {
       async getRecords() {
         let params = {
-          custId: '' + this.customerId,
+          targetId: '' + this.targetId,
+          targetType: '' + (parseInt(this.targetType) + 40),
           DaysBeforeToday: 9999,
         }
         const [err, res] = await to(followApi.getListByDay(params))

+ 39 - 12
pages/distributor/details.vue

@@ -14,7 +14,7 @@
           <view class="back" @click="goBack()">
             <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
           </view>
-          <text>经销商详情</text>
+          <text>{{ distType == '10' ? '经销商' : '代理商' }}</text>
         </view>
       </view>
     </view>
@@ -31,29 +31,29 @@
           <view class="info">
             <view class="info-item">
               <u-row>
-                <u-col span="7">
+                <u-col span="6">
                   <view class="flex_l">
-                    <view class="info-label">客户编码:</view>
+                    <view class="info-label">{{ distType == '10' ? '经销商' : '代理商' }}编码:</view>
                     <text class="info-txt">{{ distrInfo.distCode }}</text>
                   </view>
                 </u-col>
-                <u-col span="5">
+                <u-col span="6">
                   <view class="flex_l">
-                    <view class="info-label">负责人:</view>
-                    <text class="info-txt">{{ distrInfo.distBoss }}</text>
+                    <view class="info-label">现有销售人数:</view>
+                    <text class="info-txt">{{ distrInfo.saleNum }}</text>
                   </view>
                 </u-col>
               </u-row>
             </view>
             <view class="info-item">
               <u-row justify="space-between">
-                <u-col span="7">
+                <u-col span="6">
                   <view class="flex_l">
-                    <view class="info-label">销售人:</view>
+                    <view class="info-label">归属人员:</view>
                     <text class="info-txt">{{ distrInfo.belongSale }}</text>
                   </view>
                 </u-col>
-                <u-col span="5">
+                <u-col span="6">
                   <view class="flex_l">
                     <view class="info-label">归属省份:</view>
                     <text class="info-txt">{{ distrInfo.provinceDesc }}</text>
@@ -80,10 +80,23 @@
       </view>
       <view class="data-list">
         <!-- 跟进记录 -->
-        <follow-records v-if="curTabIndex == 0" ref="follow" :customerId="customerId"></follow-records>
+        <follow-records
+          v-if="curTabIndex == 0"
+          ref="follow"
+          :targetId="distrId"
+          :targetType="distType"></follow-records>
         <!-- 详情 -->
         <distr-detail v-if="curTabIndex == 1" :detail="distrInfo"></distr-detail>
       </view>
+      <!-- 新增按钮 -->
+      <view class="fixed-btn-group" :style="{ width: openBtnWidth ? '180rpx' : '90rpx' }">
+        <view class="flex1" v-if="openBtnWidth">
+          <view class="btn center" @click="openFollow()">跟</view>
+        </view>
+        <view class="btn center" @click="openBtnWidth = !openBtnWidth">
+          <u-icon name="plus" color="#fff" size="20"></u-icon>
+        </view>
+      </view>
     </view>
   </view>
 </template>
@@ -98,7 +111,7 @@
     data() {
       return {
         openBtnWidth: false,
-        curTabIndex: 0,
+        curTabIndex: -1,
         fllowList: [], //跟进数据
         list: [
           {
@@ -114,10 +127,13 @@
         paddingTop: '',
         distrInfo: {},
         distrId: 0, //客户id
+        distType: '10',
       }
     },
     onLoad(option) {
       this.distrId = parseInt(option.id)
+      this.distType = option.distrType
+      console.log(this.distType)
     },
     created() {
       const navData = uni.getMenuButtonBoundingClientRect()
@@ -125,6 +141,8 @@
       this.paddingTop = navData.top + 'px'
     },
     onShow() {
+      this.curTabIndex = 0
+      console.log(this.curTabIndex)
       this.openBtnWidth = false
       this.getDistrDetail()
     },
@@ -140,6 +158,15 @@
       changeTabs(data) {
         this.curTabIndex = data.index
       },
+      // 打开转移
+      openFollow() {
+        let targetType = '' + (parseInt(this.distrInfo.distType) + 40)
+        // this.$store.commit('setDetails', this.projectData)
+        uni.navigateTo({
+          //保留当前页面,跳转到应用内的某个页面
+          url: '/pages/publicPages/follow?targetType=' + targetType + '&id=' + this.distrInfo.id,
+        })
+      },
       goBack() {
         uni.navigateBack({
           //关闭当前页面,返回上一页面或多级页面。
@@ -221,7 +248,7 @@
           .info-item {
             margin-top: 18rpx;
             .info-label {
-              width: 116rpx;
+              width: 162rpx;
               text-align: left;
               font-size: 24rpx;
               color: #646464;

+ 52 - 11
pages/distributor/index.vue

@@ -2,7 +2,7 @@
  * @Author: liuzhenlin 461480418@qq.ocm
  * @Date: 2023-01-12 11:57:48
  * @LastEditors: liuzhenlin
- * @LastEditTime: 2023-02-27 17:46:12
+ * @LastEditTime: 2023-05-22 15:31:58
  * @Description: file content
  * @FilePath: \oms\pages\distributor\index.vue
 -->
@@ -19,6 +19,26 @@
       </view>
     </view>
     <view class="main">
+      <!-- tabs -->
+      <view class="tabs">
+        <u-tabs
+          @change="changeTabs"
+          lineWidth="8"
+          :current="curTabIndex"
+          lineHeight="8"
+          :scrollable="false"
+          :list="list"
+          :lineColor="`url(${lineBg}) 100% 100%`"
+          :activeStyle="{
+            color: '#3E7EF8',
+            fontWeight: 'bold',
+          }"
+          :inactiveStyle="{
+            color: '#969696',
+          }"
+          itemStyle="height: 90rpx;"></u-tabs>
+      </view>
+      <!-- 搜索 -->
       <view class="query-wrap">
         <view class="search-container">
           <view class="search-input">
@@ -29,7 +49,7 @@
               v-model="distName"
               prefixIcon="search"
               prefixIconStyle="font-size: 22px;color: #909399"
-              placeholder="请输入经销商名称"
+              placeholder="请输入名称"
               shape="circle"
               border="surround"></u-input>
           </view>
@@ -65,9 +85,9 @@
       </scroll-view>
     </view>
     <!-- 新增按钮 -->
-    <view class="fixed-btn center" @click="openAdd()">
+    <!-- <view class="fixed-btn center" @click="openAdd()">
       <u-icon name="plus" color="#fff" size="20"></u-icon>
-    </view>
+    </view> -->
     <!-- 消息提示 -->
     <u-toast ref="uToast"></u-toast>
   </view>
@@ -80,6 +100,21 @@
     components: {},
     data() {
       return {
+        lineBg: require('@/static/images/up.png'),
+        curTabIndex: 0,
+        distrType: '10',
+        list: [
+          {
+            name: '经销商',
+            index: 0,
+            type: '10',
+          },
+          {
+            name: '代理商',
+            index: 1,
+            type: '20',
+          },
+        ],
         height: '',
         paddingTop: '',
         pageNum: 0,
@@ -100,12 +135,18 @@
       this.searchList()
     },
     methods: {
-      openAdd() {
-        uni.navigateTo({
-          //保留当前页面,跳转到应用内的某个页面
-          url: '/pages/distributor/create',
-        })
+      // 改变tab
+      changeTabs(data) {
+        this.distrType = data.type
+        this.curTabIndex = data.index
+        this.searchList()
       },
+      // openAdd() {
+      //   uni.navigateTo({
+      //     //保留当前页面,跳转到应用内的某个页面
+      //     url: '/pages/distributor/create',
+      //   })
+      // },
       getOptions() {
         Promise.all([this.getDicts('cust_idy')])
           .then(([industry]) => {
@@ -133,6 +174,7 @@
         this.loadStatus = 'loading'
         this.pageNum++
         let params = {
+          distType: this.distrType,
           distName: this.distName,
           pageNum: this.pageNum,
           pageSize: this.pageSize,
@@ -163,7 +205,7 @@
       toDetails(v) {
         uni.navigateTo({
           //保留当前页面,跳转到应用内的某个页面
-          url: '/pages/distributor/details?id=' + v.id,
+          url: '/pages/distributor/details?id=' + v.id + '&distrType=' + this.distrType,
         })
       },
     },
@@ -210,7 +252,6 @@
       box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
       border-radius: 31rpx 31rpx 0 0;
       padding: 0 32rpx;
-      overflow: auto;
       padding-bottom: 64rpx;
       .query-wrap {
         padding-top: 20rpx;

+ 57 - 33
pages/home/checkIn.vue

@@ -31,18 +31,34 @@
               <view class="label-tag"></view>
               打卡类型
             </view>
-            <u-input :readonly="true" placeholder="请选择销售模式" v-model="form.punchVal" border="none"
-              suffixIcon="arrow-down" suffixIconStyle="color:#CDCDCD" clearable customStyle="padding: 0 30rpx 0 12rpx">
-            </u-input>
+            <u-input
+              :readonly="true"
+              placeholder="请选择销售模式"
+              v-model="form.punchVal"
+              border="none"
+              suffixIcon="arrow-down"
+              suffixIconStyle="color:#CDCDCD"
+              clearable
+              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item prop="targetName" borderBottom customStyle="padding:40rpx 0 30rpx" v-if="form.punchType > 10"
+          <u-form-item
+            prop="targetName"
+            borderBottom
+            customStyle="padding:40rpx 0 30rpx"
+            v-if="form.punchType > 10"
             @click="openSelectUser()">
             <view class="form-label flex_l">
               <view class="label-tag"></view>
-              {{ form.punchType == 20 ? '客户' : '经销商' }}
+              {{ form.punchType == 20 ? '客户' : form.punchType == 30 ? '经销商' : '代理商' }}
             </view>
-            <u-input :readonly="true" :placeholder="`请选择${form.punchType == 20 ? '客户' : '经销商'}`"
-              v-model="form.targetName" border="none" suffixIcon="arrow-down" suffixIconStyle="color:#CDCDCD" clearable
+            <u-input
+              :readonly="true"
+              :placeholder="`请选择${form.punchType == 20 ? '客户' : form.punchType == 30 ? '经销商' : '代理商'}`"
+              v-model="form.targetName"
+              border="none"
+              suffixIcon="arrow-down"
+              suffixIconStyle="color:#CDCDCD"
+              clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
         </u-form>
@@ -70,10 +86,14 @@
       </view>
     </uni-file-picker> -->
     <!-- 打卡类型 -->
-    <u-picker :show="showCheckType" :columns="[checkTypeColumns]" keyName="value" @cancel="showCheckType = false"
+    <u-picker
+      :show="showCheckType"
+      :columns="[checkTypeColumns]"
+      keyName="value"
+      @cancel="showCheckType = false"
       @confirm="pickCheckType"></u-picker>
     <!-- 选择经销商 -->
-    <select-dealer ref="dealer" @close="closeDealer($event)"></select-dealer>
+    <select-dealer ref="dealer" :distrId="form.punchType" dist @close="closeDealer($event)"></select-dealer>
     <!-- 选择客户 -->
     <select-customer ref="cust" @close="closeCust($event)"></select-customer>
     <u-notify ref="uNotify"></u-notify>
@@ -81,9 +101,7 @@
 </template>
 
 <script>
-  import {
-    mapGetters
-  } from 'vuex'
+  import { mapGetters } from 'vuex'
   import to from 'await-to-js'
   import api from '@/api/system'
   import SelectDealer from 'components/SelectDealer'
@@ -91,7 +109,7 @@
   export default {
     components: {
       SelectDealer,
-      SelectCustomer
+      SelectCustomer,
     },
     data() {
       return {
@@ -118,31 +136,36 @@
           pageSize: 10,
         },
         total: 0,
-        checkTypeColumns: [{
+        checkTypeColumns: [
+          {
             key: '10',
-            value: '居家'
+            value: '居家',
           },
           {
             key: '20',
-            value: '客户'
+            value: '客户',
           },
           {
             key: '30',
-            value: '经销商'
+            value: '经销商',
           },
-          // { key: 40, value: '代理商' },
+          { key: '40', value: '代理商' },
         ],
         rules: {
-          punchVal: [{
-            required: true,
-            trigger: ['blur', 'change'],
-            message: '请选择打卡类型'
-          }],
-          targetName: [{
-            required: true,
-            trigger: ['blur', 'change'],
-            message: `请选择用户`,
-          }, ],
+          punchVal: [
+            {
+              required: true,
+              trigger: ['blur', 'change'],
+              message: '请选择打卡类型',
+            },
+          ],
+          targetName: [
+            {
+              required: true,
+              trigger: ['blur', 'change'],
+              message: `请选择用户`,
+            },
+          ],
         },
       }
     },
@@ -183,10 +206,10 @@
         }
       },
       openSelectUser() {
-        if (this.form.punchType == 30) {
-          this.$refs.dealer.open()
-        } else {
+        if (this.form.punchType == '20') {
           this.$refs.cust.open()
+        } else {
+          this.$refs.dealer.open()
         }
       },
       getLocation() {
@@ -194,14 +217,15 @@
         const _this = this
         uni.getLocation({
           type: 'wgs84',
-          success: function(res) {
+          success: function (res) {
             const latitude = res.latitude.toString()
             const longitude = res.longitude.toString()
             uni.request({
               header: {
                 'Content-Type': 'application/text',
               },
-              url: process.uniEnv.VUE_APP_PROTOCOL +
+              url:
+                process.uniEnv.VUE_APP_PROTOCOL +
                 'apis.map.qq.com/ws/geocoder/v1/?location=' +
                 latitude +
                 ',' +

+ 37 - 10
pages/publicPages/follow.vue

@@ -2,7 +2,7 @@
  * @Author: liuzhenlin 461480418@qq.ocm
  * @Date: 2023-01-12 11:57:48
  * @LastEditors: liuzhenlin
- * @LastEditTime: 2023-03-01 16:17:37
+ * @LastEditTime: 2023-05-22 17:37:35
  * @Description: file content
  * @FilePath: \oms\pages\publicPages\follow.vue
 -->
@@ -21,7 +21,10 @@
     <view class="main">
       <u-form :model="addForm" :rules="rules" ref="addForm" label-width="0">
         <u-form-item prop="content" customStyle="padding:40rpx 0 34rpx">
-          <view class="form-label flex_l">跟进内容</view>
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            跟进内容
+          </view>
           <u-textarea
             v-model="addForm.content"
             placeholder="请输入跟进内容"
@@ -67,7 +70,7 @@
           </view>
           <u-input
             :readonly="true"
-            placeholder="请选择客户联系人"
+            placeholder="请选择联系人"
             v-model="addForm.contactsName"
             border="none"
             suffixIcon="arrow-down"
@@ -108,21 +111,26 @@
     <customer-contact ref="concat" @close="closeConcat"></customer-contact>
     <!-- 项目联系人 -->
     <project-contact ref="projectConcat" @close="closeConcat"></project-contact>
+    <!-- 经销商代理商联系人 -->
+    <distr-contact ref="distrConcat" @close="closeConcat" :distrType="targetType"></distr-contact>
   </view>
 </template>
 <script>
-  import { mapGetters } from 'vuex'
+  // import { mapGetters } from 'vuex'
   import to from 'await-to-js'
   import followApi from '../../api/follow'
+  import distrApi from '../../api/base/distr'
   import custApi from '../../api/customer'
   import prodApi from '../../api/project'
-  import ProjectContact from '../../components/ProjectContact'
-  import CustomerContact from '../../components/CustomerContact'
+  import ProjectContact from '@/components/ProjectContact'
+  import CustomerContact from '@/components/CustomerContact'
+  import DistrContact from '@/components/DistrContact'
   export default {
     name: 'omsIndex',
     components: {
       CustomerContact,
       ProjectContact,
+      DistrContact,
     },
     data() {
       return {
@@ -158,7 +166,7 @@
           contactsName: '', //联系人
           contactsId: 0, //联系人ID
         },
-        targetType: 0, //跟进对象类型(10客户,20项目,30合同,40回款)
+        targetType: 0, //跟进对象类型(10客户,20项目,30合同,40回款,50经销商,60代理商)
         rules: {
           content: {
             type: 'string',
@@ -229,14 +237,23 @@
           if (res && res.code == 200) {
             this.details = res.data
           }
+        } else if (this.targetType == '50' || this.targetType == '60') {
+          const [err, res] = await to(distrApi.getEntity({ id: this.curId }))
+          if (err) return
+          if (res && res.code == 200) {
+            this.details = res.data.list
+          }
         }
       },
-      // 打开客户联系人
+      // 打开联系人
       open() {
         if (this.targetType == '10') {
           this.$refs.concat.open(this.details.id)
         } else if (this.targetType == '20') {
           this.$refs.projectConcat.open(this.details.id, this.details.custId)
+        } else if (this.targetType == '50' || this.targetType == '60') {
+          console.log(this.details.id)
+          this.$refs.distrConcat.open(this.details.id)
         }
       },
       // 行业选择
@@ -254,8 +271,13 @@
       // 关闭选择用户
       closeConcat(user) {
         if (user) {
-          this.addForm.contactsName = user.label
-          this.addForm.contactsId = user.id
+          if (this.targetType == '50' || this.targetType == '60') {
+            this.addForm.contactsName = user.name
+            this.addForm.contactsId = user.id
+          } else {
+            this.addForm.contactsName = user.label
+            this.addForm.contactsId = user.id
+          }
         }
       },
       handleAdd() {
@@ -277,6 +299,11 @@
                 targetId: this.details.id,
                 targetName: this.details.nboName,
               }
+            } else if (this.targetType == '50' || this.targetType == '60') {
+              idParams = {
+                targetId: this.details.id,
+                targetName: this.details.distName,
+              }
             }
             let params = Object.assign(
               {