Преглед на файлове

feature:增加新建经销商功能,经销商和代理商的类型都改为50

liuzl преди 2 години
родител
ревизия
f9698ca586
променени са 6 файла, в които са добавени 175 реда и са изтрити 211 реда
  1. 1 5
      pages/distributor/components/followRecords.vue
  2. 9 84
      pages/distributor/create.vue
  3. 6 7
      pages/distributor/details.vue
  4. 42 3
      pages/distributor/index.vue
  5. 5 5
      pages/publicPages/follow.vue
  6. 112 107
      style/common.scss

+ 1 - 5
pages/distributor/components/followRecords.vue

@@ -45,10 +45,6 @@
         type: [String, Number],
         default: '0',
       },
-      targetType: {
-        type: [String, Number],
-        default: '0',
-      },
     },
     data() {
       return {
@@ -63,7 +59,7 @@
       async getRecords() {
         let params = {
           targetId: '' + this.targetId,
-          targetType: '' + (parseInt(this.targetType) + 40),
+          targetType: '50',
           DaysBeforeToday: 9999,
         }
         const [err, res] = await to(followApi.getListByDay(params))

+ 9 - 84
pages/distributor/create.vue

@@ -27,35 +27,7 @@
           </view>
           <u-input border="none" v-model="addForm.distName" placeholder="请输入名称"></u-input>
         </u-form-item>
-        <u-form-item prop="abbrName" customStyle="padding:40rpx 0 34rpx" borderBottom>
-          <view class="form-label flex_l">助记名</view>
-          <u-input border="none" v-model="addForm.abbrName" placeholder="请输入助记名"></u-input>
-        </u-form-item>
-        <u-form-item prop="distDesc" customStyle="padding:40rpx 0 34rpx" borderBottom>
-          <view class="form-label flex_l">说明</view>
-          <u-input border="none" maxlength="11" v-model="addForm.distDesc" placeholder="请输入说明"></u-input>
-        </u-form-item>
-        <u-form-item prop="distBoss" customStyle="padding:40rpx 0 34rpx" borderBottom>
-          <view class="form-label flex_l">
-            <view class="label-tag"></view>
-            负责人
-          </view>
-          <u-input border="none" v-model="addForm.distBoss" placeholder="请输入负责人"></u-input>
-        </u-form-item>
-        <u-form-item prop="distBossPhone" customStyle="padding:40rpx 0 34rpx" borderBottom>
-          <view class="form-label flex_l">
-            <view class="label-tag"></view>
-            电话
-          </view>
-          <u-input maxlength="11" border="none" v-model="addForm.distBossPhone" placeholder="请输入电话"></u-input>
-        </u-form-item>
-        <u-form-item prop="businessScope" customStyle="padding:40rpx 0 34rpx" borderBottom>
-          <view class="form-label flex_l">
-            <view class="label-tag"></view>
-            业务范围
-          </view>
-          <u-input border="none" v-model="addForm.businessScope" placeholder="请输入业务范围"></u-input>
-        </u-form-item>
+
         <u-form-item prop="provinceDesc" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showProvince = true">
           <view class="form-label flex_l">
             <view class="label-tag"></view>
@@ -71,30 +43,13 @@
             clearable
             customStyle="padding: 0 30rpx 0 12rpx"></u-input>
         </u-form-item>
-        <u-form-item prop="belongSale" borderBottom customStyle="padding:40rpx 0 30rpx" @click="openUser()">
+
+        <u-form-item prop="registerDistrict" customStyle="padding:40rpx 0 34rpx" borderBottom>
           <view class="form-label flex_l">
             <view class="label-tag"></view>
-            销售工程师
+            注册地
           </view>
-          <u-input
-            :readonly="true"
-            placeholder="请选择销售工程师"
-            v-model="addForm.belongSale"
-            border="none"
-            suffixIcon="arrow-down"
-            suffixIconStyle="color:#CDCDCD"
-            clearable
-            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-        </u-form-item>
-        <u-form-item prop="remark" customStyle="padding:40rpx 0 34rpx" borderBottom>
-          <view class="form-label flex_l">备注</view>
-          <u-textarea
-            v-model="addForm.remark"
-            placeholder="请输入备注"
-            maxlength="800"
-            height="190rpx"
-            count
-            customStyle="border-radius:16rpx"></u-textarea>
+          <u-input border="none" v-model="addForm.registerDistrict" placeholder="请输入备注"></u-input>
         </u-form-item>
       </u-form>
       <view class="center">
@@ -109,7 +64,6 @@
       @cancel="showProvince = false"
       @confirm="pickProvince"></u-picker>
     <!-- 选择销售 -->
-    <select-user ref="user" :query-params="{ roles: ['SalesEngineer','ProductLineManager'] }" @close="closeUser($event)"></select-user>
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
   </view>
@@ -129,38 +83,19 @@
         provinceColumns: [],
         addForm: {
           distName: '',
-          abbrName: '',
-          distDesc: '',
-          distBoss: '',
-          distBossPhone: '',
-          businessScope: '',
           provinceId: null,
           provinceDesc: '',
-          belongSale: '',
-          belongSaleId: 0,
-          remark: '',
+          registerDistrict: '',
+          distType: '10',
         },
         rules: {
           distName: [{ required: true, trigger: 'blur', message: '请输入名称' }],
-          distBoss: [{ required: true, trigger: 'blur', message: '请输入负责人' }],
-          distBossPhone: [
-            {
-              pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-              message: '请输入正确的手机号码',
-              trigger: 'blur',
-              required: true,
-            },
-          ],
-          businessScope: [{ required: true, trigger: 'blur', message: '请填写业务范围' }],
+          registerDistrict: [{ required: true, trigger: 'blur', message: '请输入注册地' }],
           provinceDesc: [{ required: true, trigger: 'blur', message: '请选择省份' }],
-          belongSale: [{ required: true, trigger: 'blur', message: '请填写归属销售' }],
         },
       }
     },
-    onLoad(option) {
-      this.addForm.custId = Number(option.id)
-      this.addForm.custName = option.name
-    },
+
     created() {
       const navData = uni.getMenuButtonBoundingClientRect()
       this.height = navData.height + 'px'
@@ -177,16 +112,6 @@
           })
           .catch((err) => console.log(err))
       },
-      openUser() {
-        this.$refs.user.open()
-      },
-      // 关闭选择销售
-      closeUser(user) {
-        if (user) {
-          this.addForm.belongSaleId = user.id
-          this.addForm.belongSale = user.label
-        }
-      },
       // 省份选择
       pickProvince(e) {
         this.addForm.provinceId = e.value[0].id

+ 6 - 7
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>{{ distType == '10' ? '经销商' : '代理商' }}</text>
+          <text>{{ distrType == '10' ? '经销商' : '代理商' }}</text>
         </view>
       </view>
     </view>
@@ -33,7 +33,7 @@
               <u-row>
                 <u-col span="6">
                   <view class="flex_l">
-                    <view class="info-label">{{ distType == '10' ? '经销商' : '代理商' }}编码:</view>
+                    <view class="info-label">{{ distrType == '10' ? '经销商' : '代理商' }}编码:</view>
                     <text class="info-txt">{{ distrInfo.distCode }}</text>
                   </view>
                 </u-col>
@@ -85,7 +85,7 @@
           v-if="curTabIndex == 0"
           ref="follow"
           :targetId="distrId"
-          :targetType="distType"></follow-records>
+          :targetType="distrType"></follow-records>
         <!-- 详情 -->
         <distr-detail v-if="curTabIndex == 1" :detail="distrInfo"></distr-detail>
       </view>
@@ -128,12 +128,12 @@
         paddingTop: '',
         distrInfo: {},
         distrId: 0, //客户id
-        distType: '10',
+        distrType: '10',
       }
     },
     onLoad(option) {
       this.distrId = parseInt(option.id)
-      this.distType = option.distrType
+      this.distrType = option.distrType
     },
     created() {
       const navData = uni.getMenuButtonBoundingClientRect()
@@ -162,11 +162,10 @@
       },
       // 打开转移
       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,
+          url: '/pages/publicPages/follow?targetType=50&id=' + this.distrInfo.id,
         })
       },
       goBack() {

+ 42 - 3
pages/distributor/index.vue

@@ -85,9 +85,14 @@
       </scroll-view>
     </view>
     <!-- 新增按钮 -->
-    <!-- <view class="fixed-btn center" @click="openAdd()">
-      <u-icon name="plus" color="#fff" size="20"></u-icon>
-    </view> -->
+    <view class="fixed-btn-group" :style="{ width: openBtnWidth ? '180rpx' : '90rpx' }">
+      <view class="flex1" v-if="openBtnWidth">
+        <view class="btn center" @click="addDistr">增</view>
+      </view>
+      <view class="btn center" @click="openBtnWidth = !openBtnWidth">
+        <u-icon name="plus" color="#fff" size="20"></u-icon>
+      </view>
+    </view>
     <!-- 消息提示 -->
     <u-toast ref="uToast"></u-toast>
   </view>
@@ -100,6 +105,7 @@
     components: {},
     data() {
       return {
+        openBtnWidth: false,
         lineBg: require('@/static/images/up.png'),
         curTabIndex: 0,
         distrType: '10',
@@ -208,6 +214,13 @@
           url: '/pages/distributor/details?id=' + v.id + '&distrType=' + this.distrType,
         })
       },
+      // 增加经销商
+      addDistr() {
+        uni.navigateTo({
+          //保留当前页面,跳转到应用内的某个页面
+          url: '/pages/distributor/create',
+        })
+      },
     },
   }
 </script>
@@ -380,5 +393,31 @@
         }
       }
     }
+
+    .fixed-btn-group {
+      position: fixed;
+      display: flex;
+      justify-content: space-around;
+      align-items: center;
+      width: 90rpx;
+      height: 90rpx;
+      bottom: 50rpx;
+      right: 50rpx;
+      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+      border-radius: 20px;
+      transition: all 0.2s;
+      background: #fff;
+
+      .btn {
+        width: 60rpx;
+        height: 60rpx;
+        background: #3e7ef8;
+        border-radius: 50%;
+        margin: 10rpx;
+        font-size: 26rpx;
+        font-weight: bold;
+        color: #ffffff;
+      }
+    }
   }
 </style>

+ 5 - 5
pages/publicPages/follow.vue

@@ -166,7 +166,7 @@
           contactsName: '', //联系人
           contactsId: 0, //联系人ID
         },
-        targetType: 0, //跟进对象类型(10客户,20项目,30合同,40回款,50经销商,60代理商)
+        targetType: 0, //跟进对象类型(10客户,20项目,30合同,40回款,50经销商,50代理商)
         rules: {
           content: {
             type: 'string',
@@ -237,7 +237,7 @@
           if (res && res.code == 200) {
             this.details = res.data
           }
-        } else if (this.targetType == '50' || this.targetType == '60') {
+        } else if (this.targetType == '50') {
           const [err, res] = await to(distrApi.getEntity({ id: this.curId }))
           if (err) return
           if (res && res.code == 200) {
@@ -251,7 +251,7 @@
           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') {
+        } else if (this.targetType == '50') {
           this.$refs.distrConcat.open(this.details.id)
         }
       },
@@ -270,7 +270,7 @@
       // 关闭选择用户
       closeConcat(user) {
         if (user) {
-          if (this.targetType == '50' || this.targetType == '60') {
+          if (this.targetType == '50') {
             this.addForm.contactsName = user.name
             this.addForm.contactsId = user.id
           } else {
@@ -298,7 +298,7 @@
                 targetId: this.details.id,
                 targetName: this.details.nboName,
               }
-            } else if (this.targetType == '50' || this.targetType == '60') {
+            } else if (this.targetType == '50') {
               idParams = {
                 targetId: this.details.id,
                 targetName: this.details.distName,

+ 112 - 107
style/common.scss

@@ -1,228 +1,233 @@
 /* flex */
 
 .center {
-    display: flex;
-    justify-content: center;
-    align-items: center;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 
 .flex1 {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
 }
 
 .flex_l {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
 }
 
 .flex_r {
-    display: flex;
-    justify-content: flex-end;
-    align-items: center;
+  display: flex;
+  justify-content: flex-end;
+  align-items: center;
 }
 
 .flex {
-    display: flex;
+  display: flex;
 }
 
 .flex-center {
-    justify-content: center;
+  justify-content: center;
 }
 
 .flex-around {
-    justify-content: space-around;
+  justify-content: space-around;
 }
 
 .flex-between {
-    justify-content: space-between;
+  justify-content: space-between;
 }
 
 .flex-top {
-    align-items: flex-start;
+  align-items: flex-start;
 }
 
 .flex-middle {
-    align-items: center;
+  align-items: center;
 }
 
 .flex-bottom {
-    align-items: flex-end;
+  align-items: flex-end;
 }
 
 .flex-column {
-    flex-direction: column;
+  flex-direction: column;
 }
 
 .flex-wrap {
-    flex-wrap: wrap;
+  flex-wrap: wrap;
 }
 
 .flex_1 {
-    flex: 1;
+  flex: 1;
 }
 
 
 /* 其他 */
 
 .relative {
-    position: relative;
+  position: relative;
 }
 
 .absolute {
-    position: absolute;
+  position: absolute;
 }
 
 .fixed {
-    position: fixed;
+  position: fixed;
 }
 
 .fixed-bottom {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
 }
 
 .block {
-    display: block;
+  display: block;
 }
 
 .hide {
-    display: none;
+  display: none;
 }
 
 .show {
-    display: block;
+  display: block;
 }
 
 .autowrap {
-    word-wrap: break-word;
-    word-break: normal;
+  word-wrap: break-word;
+  word-break: normal;
 }
 
 .text-left {
-    text-align: left;
+  text-align: left;
 }
 
 .text-center {
-    text-align: center;
+  text-align: center;
 }
 
 .text-right {
-    text-align: right;
+  text-align: right;
 }
 
 .bold {
-    font-weight: 600;
+  font-weight: 600;
 }
 
 .over-hidden {
-    overflow: hidden;
+  overflow: hidden;
 }
 
 .bold {
-    font-weight: 700;
+  font-weight: 700;
 }
 
 .right {
-    float: right;
+  float: right;
 }
 
 .left {
-    float: left;
+  float: left;
 }
 
 view {
-    box-sizing: border-box;
+  box-sizing: border-box;
 }
 
 .text-ellipsis {
-    white-space: nowrap;
-    /*把文本强制显示在一行*/
-    overflow: hidden;
-    /*隐藏超出部分的文字*/
-    text-overflow: ellipsis;
-    /*超出显示省略号*/
+  white-space: nowrap;
+  /*把文本强制显示在一行*/
+  overflow: hidden;
+  /*隐藏超出部分的文字*/
+  text-overflow: ellipsis;
+  /*超出显示省略号*/
 }
 
 .fixed-btn {
-    position: fixed;
-    width: 90rpx;
-    height: 90rpx;
-    bottom: 50rpx;
-    right: 50rpx;
-    background: #3e7ef8;
-    border-radius: 50%;
-    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  position: fixed;
+  width: 90rpx;
+  height: 90rpx;
+  bottom: 50rpx;
+  right: 50rpx;
+  background: #3e7ef8;
+  border-radius: 50%;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
 }
 
 .mr20 {
-    margin-right: 20rpx;
+  margin-right: 20rpx;
 }
 
 // 选择组件
 .select-header {
-    line-height: 50rpx;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    padding: 0px 30rpx;
-    .tit {
-        font-size: 26rpx;
-        font-weight: bold;
-        padding: 30rpx 0 0 30rpx;
-    }
-    .save-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;
-    }
+  line-height: 50rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0px 30rpx;
+
+  .tit {
+    font-size: 26rpx;
+    font-weight: bold;
+    padding: 30rpx 0 0 30rpx;
+  }
+
+  .save-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;
+  }
 }
 
 .form-item {
-    padding-bottom: 30rpx;
-    .form-label {
-        font-size: 30rpx;
-        font-weight: bold;
-        color: #323232;
-        padding-bottom: 18rpx;
-        .label-tag {
-            width: 15rpx;
-            height: 15rpx;
-            background: #ff4d4f;
-            border-radius: 50%;
-            margin-right: 10rpx;
-        }
+  padding-bottom: 30rpx;
+
+  .form-label {
+    font-size: 30rpx;
+    font-weight: bold;
+    color: #323232;
+    padding-bottom: 18rpx;
+
+    .label-tag {
+      width: 15rpx;
+      height: 15rpx;
+      background: #ff4d4f;
+      border-radius: 50%;
+      margin-right: 10rpx;
     }
+  }
 }
 
 .data-list {
-    .info-item {
-        .label {
-            min-width: 130rpx;
-        }
+  .info-item {
+    .label {
+      min-width: 130rpx;
     }
+  }
 }
 
 .form-label {
-    font-size: 30rpx;
-    font-weight: bold;
-    color: #323232;
-    padding-bottom: 18rpx;
-    .label-tag {
-        width: 15rpx;
-        height: 15rpx;
-        background: #ff4d4f;
-        border-radius: 50%;
-        margin-right: 10rpx;
-    }
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #323232;
+  padding-bottom: 18rpx;
+
+  .label-tag {
+    width: 15rpx;
+    height: 15rpx;
+    background: #ff4d4f;
+    border-radius: 50%;
+    margin-right: 10rpx;
+  }
 }