瀏覽代碼

组件修改

于继渤 2 年之前
父節點
當前提交
040ae3889b

+ 1 - 0
components/dkbase/dk-form/dk-form.js

@@ -466,6 +466,7 @@ Component({
           errMsg: errMsg
         })
       }
+      this.triggerEvent('changePhoneblur', e)
     },
     /**
      * @desc : 小程序地图调用

+ 83 - 31
package-basic-data/pages/customer-reception/add/add.js

@@ -20,51 +20,102 @@ Page({
     radioFollowUp: '1',
     routeObjName: 'cusFollow',
     cardList: ['main'],
-    buttonSaveList:[{code:'add',title:mixins.$t('save'),width:'120rpx'}],
+    buttonSaveList: [{ code: 'add', title: mixins.$t('save'), width: '120rpx' }],
     contentObj: {
       main: [
         { code: 'cusName', type: 'str', required: true, title: mixins.$t('customerName') },
-        { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone') , required: true },
-        { code: 'addressFull', type: 'address', title: mixins.$t('addressFull') , required: false },
-        { code: 'addressNo', type: 'str', required: false, title: mixins.$t('addressNo')  },
-        { code: 'intention', name: 'intentionName', type: 'drop', required: true, dropType: 'customerIntention', title:  mixins.$t('intention')  },
-        { code: 'remarks', type: 'textarea', rows: '5', required: true, showWordLimit: true, title: mixins.$t('followData')  },
+        { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
+        { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: false },
+        { code: 'addressNo', type: 'str', required: false, title: mixins.$t('addressNo') },
+        { code: 'intention', name: 'intentionName', type: 'drop', required: true, dropType: 'customerIntention', title: mixins.$t('intention') },
+        { code: 'remarks', type: 'textarea', rows: '5', required: true, showWordLimit: true, title: mixins.$t('followData') },
         { code: 'nextFollowTime', type: 'dateTime', required: true, title: mixins.$t('nextFollowTime') },
-        { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen') , dropType: 'storeRetentionTime', type: 'drop', }
+        { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen'), dropType: 'storeRetentionTime', type: 'drop', }
       ]
     },
-
-    followStatus:mixins.$t('followStatusReporting')
+    table: Constants.tables.cusFollow,
+    customerService: app.globalData['customerService'],
+    followStatus: mixins.$t('followStatusReporting')
   },
 
 
- /**
-  * @desc : 设置保存参数
-  * @date : 2024/2/1 15:49
-  * @author : 于继渤
-  */
- setParams(params) {
-  params.followStatus = this.data.followStatus
-  params.followOrg =  app.globalData.user.orgId
-  return params
-},
-/**
- * @desc : 保存数据服务
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
-saveData() {
+  /**
+   * @desc : 设置保存参数
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  setParams(params) {
+    params.followStatus = this.data.followStatus
+    params.followOrg = app.globalData.user.orgId
+    return params
+  },
+  /**
+   * @desc : 保存数据服务
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  saveData() {
     return this.excute(this.data.service, this.data.service.insert, this.data.params);
-},
-
-
+  },
+  /**
+   * @desc : 手机号离开焦点事件
+   * @date : 2024/4/8 15:49
+   * @author : 于继渤
+   */
+  changePhoneblur(e) {
+    let phone = e.detail.detail.detail.value
+    if (phone) {
+      //查询客户信息
+      this.getCustomerData({ cusPhone: phone })
+    }
+  },
 
+  /**
+   * @desc : 查询客户信息
+   * @author : 于继渤
+   * @date : 2024/1/23 9:16
+   */
+  getCustomerData(params) {
+    return this.excute(this.data.customerService, this.data.customerService.selectByCondNoPage, params).then(res => {
+      if (res.data.code == 200) {
+        if (res.data.data.length > 0) {
+          let formData = JSON.parse(this.data.formData)
+          let item = res.data.data[0]
+          formData.cusCode = item.cusCode
+          formData.cusId = item.cusId
+          formData.cusName = item.cusName
+          formData.cusFromName = item.cusFromName
+          //处理地址
+          formData.address = {
+            address: item.addressFull,
+            addressFull: item.addressFull,
+            addressArea: item.addressArea,
+            addressGcj02: item.addressGcj02,
+            addressName: item.addressName,
+          }
+          formData.addressArea = item.addressArea
+          formData.addressFull = item.addressFull
+          formData.addressGcj02 = item.addressGcj02
+          formData.addressName = item.addressName
+          formData.addressNo = item.addressNo
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+        }
+      }
+    });
+  },
+  /**
+    * @desc : 顶部切换
+    * @date : 2024/4/8 15:49
+    * @author : 于继渤
+    */
   onRadioFollowUp(e) {
     let detail = e.detail
     this.setFormContent(detail)
     this.setData({
       radioFollowUp: detail,
-      formData:null
+      formData: null
     })
     console.log('onRadioFollowUp', e.detail)
   },
@@ -88,7 +139,8 @@ saveData() {
     let radioFollowUpTwolist = [
       { code: 'intention', name: 'intentionName', type: 'drop', required: true, dropType: 'customerIntention', title: mixins.$t('intention') },
       { code: 'remarks', type: 'textarea', rows: '5', required: true, showWordLimit: true, title: mixins.$t('followData') },
-      { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen'), dropType: 'storeRetentionTime', type: 'drop', }
+      { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen'), dropType: 'storeRetentionTime', type: 'drop', },
+      { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
     ]
 
     let contentObj = this.data.contentObj
@@ -103,7 +155,7 @@ saveData() {
     }
 
     this.setData({
-      followStatus,followStatus,
+      followStatus, followStatus,
       contentObj: contentObj
     })
   }

+ 1 - 1
package-basic-data/pages/customer-reception/add/add.wxml

@@ -25,7 +25,7 @@
 </view>
 
 
-<dk-form id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData">
+<dk-form id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:changePhoneblur="changePhoneblur" bind:chooseData="chooseData" table="{{table}}">
 </dk-form>
 
 <!-- 购物车 -->

+ 31 - 1
package-sales/pages/order-billing/order-billing.js

@@ -16,6 +16,7 @@ Page({
    * 页面的初始数据 
    */
   data: {
+    tagList: [{ title: "全部", code: '' }, { title: "待出库", code: ['出库状态-待出库', '出库状态-出库中'] }, { title: "已出库", code: ['出库状态-已出库'] }],
     routeObjName: 'order',
     // 查询条件
     searchContent: [
@@ -136,7 +137,8 @@ Page({
       code: 'count',
       bill: 0,
       quantity: 0
-    }]
+    }],
+    outStatus: []
 
   },
   /**
@@ -176,6 +178,34 @@ Page({
       }
     })
   },
+
+
+  /**
+ * @desc : 切换
+ * @date : 2024/2/1 15:49
+ * @author : 于继渤
+ */
+  onChangeTabs(e) {
+    let code = e.detail.detail.code
+    this.setData({
+      outStatus: code,
+      pageInfo: {
+        currentPage: 1,
+        pageSize: 5
+      }
+    })
+    this.searchData()
+  },
+  /**
+* @desc : 设置查询参数
+* @date : 2024/2/1 15:49
+* @author : 于继渤
+*/
+  setSearchParams(params) {
+    //销售状态
+    params.outStatusList = this.data.outStatus == 'all' ? [] : this.data.outStatus
+    return params
+  },
   /**
      * @desc : 加载数据
      * @author : 于继渤

+ 2 - 1
package-sales/pages/order-billing/order-billing.wxml

@@ -1,12 +1,13 @@
 <!-- 前台导入wxmlUtil.wxs -->
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
-<loading wx:if="{{loading}}"  loadingName="{{$t['loading']}}"  backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<loading wx:if="{{loading}}" loadingName="{{$t['loading']}}" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
 <van-sticky scroll-top="0">
   <!-- 查询条件 -->
 
 
   <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['customerName','orderNo','telephone','adddress','contractNumber'])}}">
   </dk-dropdown-menu>
+  <dk-tabs active="{{active}}" list="{{tagList}}" bind:onChange="onChangeTabs"></dk-tabs>
 </van-sticky>
 
 

+ 1 - 0
utils/Constants.js

@@ -315,6 +315,7 @@ module.exports = {
     income: 't_mac_other_receivable',
     // 其他支出单
     outlay: 't_mac_other_payable',
+    cusFollow: 't_crm_cus_follow',
   },
 
   /**