Ver Fonte

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

zhoux há 1 ano atrás
pai
commit
66fdf03d7a

+ 35 - 14
components/dkbase/dk-tip/dk-tip.js

@@ -1,24 +1,45 @@
 // components/dkbase/dk-tip/dk-tip.js
 Component({
 
-    /**
-     * 组件的属性列表
-     */
-    properties: {
-
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    showTip: { //是否显示tip
+      type: Boolean,
+      value: false
     },
+    tipContent: { //tip显示的内容
+      type: String,
+      value: ""
+    },
+  },
 
-    /**
-     * 组件的初始数据
-     */
-    data: {
+  /**
+   * 组件的初始数据
+   */
+  data: {
 
-    },
+  },
 
+  /**
+   * 组件的方法列表
+   */
+  methods: {
     /**
-     * 组件的方法列表
+     * @desc   : 显示tip
+     * @author : 王英杰
+     * @date   : 2024/4/25 11:46
      */
-    methods: {
-
-    }
+    showTip(e) {
+      this.setData({
+        showTip: true
+      })
+    },
+    setShowTipFlag(flag) {
+      this.setData({
+        showTip: flag
+      })
+    },
+  }
 })

+ 6 - 6
components/dkbase/dk-tip/dk-tip.wxml

@@ -1,7 +1,7 @@
  
-<view> 
-  <van-icon  name="question-o" data-tip="数据来源:销售订单" catchtap="showTip" />
-  <view class="tip" catchtap="clickTip">
-    <h5>我最帅 不接受反驳</h5>
-  </view>
-</view>
+<view class="container"> 
+  <van-icon  name="question-o"  catchtap="showTip" /> 
+</view>
+<view wx:if="{{showTip}}" class="tip" catchtap="clickTip">
+    {{tipContent}}
+  </view>

+ 11 - 7
components/dkbase/dk-tip/dk-tip.wxss

@@ -1,7 +1,5 @@
-.tip {
-
-  width: 272rpx;
-  min-height: 100rpx;
+.tip { 
+  min-height: 80rpx;
   color: white;
   display: flex;
   align-items: center;
@@ -9,7 +7,7 @@
   padding: 8rpx 16rpx;
   background: rgba(0, 0, 0, 0.8);
   position: absolute; 
-  border-radius: 12rpx;
+  border-radius: 12rpx; 
 }
 
 .tip:after {
@@ -22,6 +20,12 @@
   border-color:transparent transparent rgba(0, 0, 0, 0.8) transparent;
   position:absolute;
   z-index: 1;
-  top: -17rpx;
-  right: 19rpx;
+  top: -14rpx;
+  left: 10rpx;
+} 
+.container {  
+  display: flex;  
+  flex-direction: column; /* 设置为列方向,这样子元素会垂直排列 */  
+  align-items: center; /* 在交叉轴(这里是水平轴)上居中对齐 */  
+  justify-content: center; /* 在主轴(这里是垂直轴)上居中对齐 */   
 } 

+ 25 - 6
package-base-select/pages/select-goods/select-goods.js

@@ -20,6 +20,7 @@ Page({
   data: {
     // gradeCode: app.globalData.company.gradeCode,
     firstFlag: true,
+    pageFlag: true,
     orderBy: [{
         "text": "可售量升序",
         "value": 1
@@ -470,17 +471,16 @@ Page({
             center: 'right'
           },
           {
-            code: 'whId',
-            name: 'whName',
-            choosePopupType: '',
+            code: 'whName',
             title: mixins.$t("warehouseId"),
-            type: 'choose',
-            urlKey: 'openingInventory',
-          }, 
+            type: 'str',
+            readonly: true,
+          },
           {
             code: 'nonStdCode',
             title: mixins.$t("goodsBatch"),
             type: 'str',
+            readonly: true,
           },
         ]
       })
@@ -1435,4 +1435,23 @@ Page({
       }
     })
   },
+  
+    /**
+     * @desc : 页面上拉触底事件的处理函数
+     * @author : 周兴
+     * @date : 2022/8/1 12:16
+     */
+    scrollToLower() {
+      console.log('页面上拉触底事件的处理函数')
+      if (this.data.loading || this.data.noMore) {
+          return;
+      }
+      this.setData({
+          pageInfo: {
+              pageSize: this.data.pageInfo.pageSize,
+              currentPage: this.data.pageInfo.currentPage + 1
+          }
+      })
+      this.searchData('more')
+  },
 })

+ 4 - 6
package-base-select/pages/select-goods/select-goods.wxml

@@ -108,8 +108,7 @@
   </scroll-view>
 
   <!--出库商品 列表 走库存-->
-  <view wx:if="{{active == 0 && (billType == 'out' ||  billType =='purReturn' ||  billType =='inventory')}}" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;">
-    <scroll-view scroll-y='{{true}}' bindscrolltolower='scrollToLower' lower-threshold='100'>
+  <scroll-view scroll-y='{{true}}' wx:if="{{active == 0 && (billType == 'out' ||  billType =='purReturn' ||  billType =='inventory')}}" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;" bindscrolltolower='scrollToLower' lower-threshold='100'>
       <view wx:for="{{tableData}}" wx:key="index" catch:tap="openAddItemInfo" data-item="{{item}}" class="main-class" style="width: 75%;margin-left: 166rpx;">
         <view class="main-foot" style="border-radius:15rpx;">
           <view>
@@ -196,12 +195,10 @@
       </view>
       <view style="height:200rpx"></view>
     </scroll-view>
-
-  </view>
 </view>
 
 <!--已选列表-->
-<view wx:if="{{active == 1&& (billType != 'out')}}" class="goods-selected-class">
+<view wx:if="{{active == 1}}" class="goods-selected-class">
   <view class="goods-class" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;"></view>
   <van-cell-group style="display: flex;justify-content: flex-end;width: calc({{windowWidth+'px'}} - 20rpx);" custom-class="width-80">
     <van-cell wx:if="{{choosedGoodsList.length==0}}" border="{{ false }}">
@@ -266,7 +263,8 @@
 
 
 <!--已选列表 库存盘点-->
-<view wx:if="{{active == 1 && (billType == 'out')}}" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;">
+
+<view wx:if="{{false}}" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;">
   <scroll-view scroll-y='{{true}}' bindscrolltolower='scrollToLower' lower-threshold='100'>
     <view wx:for="{{choosedGoodsList}}" wx:key="index" catch:tap="openAddItemInfo" data-item="{{item}}" class="main-class">
       <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" async-close bind:close="delChoosedGoodsItem">

+ 9 - 0
package-basic-data/pages/customer-list/detail/detail.js

@@ -94,6 +94,15 @@ Page({
         util.showToast(tip);
       }
     },
+      /**
+   * @desc : 关闭所有的tip
+   * @date : 2024/5/24 15:49
+   * @author : 王英杰
+   */
+    handleTap(){
+      this.selectComponent('#dk-tip1').setShowTipFlag(false)
+      this.selectComponent('#dk-tip2').setShowTipFlag(false)
+    },
   /**
    * @desc : 收款单保存后重新刷新数据
    * @date : 2024/5/24 15:49

+ 7 - 3
package-basic-data/pages/customer-list/detail/detail.wxml

@@ -1,6 +1,7 @@
 <!-- 前台导入wxmlUtil.wxs -->
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
 <loading wx:if="{{loading}}"></loading>
+<view bindtap="handleTap">
 <view class="detail-top" data-item="{{item}}">
   <image class="scan-image" fit="fill" src="{{imageUrl+'/customer_detail_04.png'}}"></image>
   <view class="detail-top-sup" style="display: flex;">
@@ -47,8 +48,8 @@
         </view>
         <view class="oreder-summary-detail">
           <text style="margin-right: 4px;"> 订单({{item.orderQuantity}}单)</text>
-          <van-icon slot="label-icon" name="question-o" data-tip="数据来源:销售订单" catchtap="showTip" />
-          <!-- <dk-tip></dk-tip> -->
+          <!-- <van-icon slot="label-icon" name="question-o" data-tip="数据来源:销售订单" catchtap="showTip" /> -->
+          <dk-tip id="dk-tip1" tipContent='数据来源:销售订单'></dk-tip>
      
         </view>
       </view>
@@ -58,7 +59,8 @@
         </view>
         <view class="oreder-summary-detail">
           <text style="margin-right: 4px;"> 退货({{item.outboundReturnQuantity}}单)</text>
-          <van-icon slot="label-icon" name="question-o" data-tip="数据来源:销售退货" catchtap="showTip" />
+          <!-- <van-icon slot="label-icon" name="question-o" data-tip="数据来源:销售退货" catchtap="showTip" /> --> 
+          <dk-tip id="dk-tip2" tipContent='数据来源:销售退货'></dk-tip>
         </view>
       </view>
     </view>
@@ -760,4 +762,6 @@
   <view bind:tap="toBuy" class="btn-add-class">
     <van-icon name="cart-o" color="#FFFFFF" size="60rpx" />
   </view>
+</view>
+
 </view>

+ 43 - 2
package-purchase/pages/purchase-order/add/add.js

@@ -379,6 +379,9 @@ Page({
     data.fromIds = this.isArrayWithSingleNull(orderIdArray) ? [] : orderIdArray.join(',').split(',') //来源单id
     data.fromNo = orderNoArray.join(',');
     data.goodsList.forEach(element => {
+      element.itemQty = Number(element.itemQty) - Number(element.returnQty)
+      element.itemAmt = Number(element.itemAmt) - Number(element.returnAmt)
+      element.eidtFlag = true 
       element.chooseFlg = "biu" //辨别选品标识
       element.priceStd = element.priceStandard
       element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
@@ -404,7 +407,7 @@ Page({
       element.sumPrice = element.pricePur * element.itemQty
       // 原仓库ID 240701
       element.whIdPri = element.whId || ''
-      element.nonStdCodePri = element.nonStdCode || ''
+      element.nonStdCodePri = element.nonStdCode || '' 
     });
     data.supName = data.supplierName
     let cardList_ = this.data.cardList
@@ -501,6 +504,7 @@ Page({
    */
   setParams(params) {
     let formData = JSON.parse(this.data.formData)
+    Object.assign(formData, this.recalculation(formData));
     let totalAmout = Number(0)
     formData.goodsList.forEach((element, index) => {
       element.itemId = (this.data.formMode == Constants.formMode.add) ? null : element.itemId
@@ -561,7 +565,44 @@ Page({
     delete params['goodsList']
     return params
   },
-
+ /**
+   * 编辑时数量要减少退货数量 但只做显示 
+   * 计算的时候还是要已订单行的数量为准保存
+   * 所以此方法调用是在保存的时候 把减去的量加回来
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  recalculation(params) {   
+    let totalAmout = Number(0)
+    // 各个明细的金额数量
+    params.goodsList.forEach(element => { //循环出商品总共价格   
+      if (element.eidtFlag) { //编辑查询出的数据    设置明细                  
+        element.itemQty = Number(element.itemQty) + Number(element.returnQty)
+        element.itemAmt = Number(element.itemAmt) + Number(element.returnAmt) 
+        element.priceStd = element.priceStandard
+        element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
+        element.itemAmt = element.pricePur * element.itemQty
+        element.amtStd = element.priceStd * element.itemQty
+        element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;
+        totalAmout += Number(element.pricePur * element.itemQty)
+        element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
+        element.sumPricePur = element.pricePur * element.itemQty
+        element.sumPrice = element.pricePur * element.itemQty
+      }else{
+        element.priceStd = element.priceStandard
+        element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
+        element.itemAmt = element.pricePur * element.itemQty
+        element.amtStd = element.priceStd * element.itemQty
+        element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;
+        totalAmout += Number(element.pricePur * element.itemQty)
+        element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
+        element.sumPricePur = element.pricePur * element.itemQty
+        element.sumPrice = element.pricePur * element.itemQty
+      } 
+    })  
+   
+    return params
+  },
   /**
    * @desc : 对比 附件是否相同     
    * @date : 2024/2/1 15:49

+ 1 - 1
package-purchase/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxml

@@ -93,7 +93,7 @@
 </view>
 
 <!-- 商品信息 和 其他信息 -->
-<dk-form-bill id="{{formName}}" titleTagCol="brandName" type="pur" routeObjName="{{routeObjName}}" readonly="{{true}}" cardList="{{cardList}}" titleCol="skuModel" descCol="skuName" subCol="calculationFormula" priceCol="pricePur" pupPriceCol="sumPrice" quantityCol="itemQty" iconCol="imagesUrl" sumAmountCol="itemAmt" sumQuantityCol="itemQty" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale">
+<dk-form-bill id="{{formName}}" titleTagCol="brandName" type="pur" routeObjName="{{routeObjName}}" readonly="{{true}}" cardList="{{cardList}}" titleCol="skuModel" descCol="skuName" subCol="calculationFormula" priceCol="pricePur" pupPriceCol="sumPrice" quantityCol="itemQty" iconCol="imagesUrl" sumAmountCol="itemAmt" sumQuantityCol="itemQty" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale"  isShowOutQty="{{true}}" outQtyKey="outQty" returnQtyKey="returnQty" >
 </dk-form-bill>
 
 <view style="height: 200rpx;"></view>

+ 58 - 1
package-purchase/pages/purchase-return/add/add.js

@@ -187,7 +187,7 @@ Page({
     let itemIndex = 0
     let formData = JSON.parse(this.data.formData)
     params.fromNo = (params.fromNo && params.fromNo.length > 0) ? params.fromNo[0] : null
-    let item = this.data.item ? JSON.parse(this.data.item)  : null
+    let item = this.data.item ? JSON.parse(this.data.item) : null
     //采购订单ID
     params.fromId = item ? (item.fromId ? item.fromId : null) : null
     params.sPurId = item ? (item.sPurId ? item.sPurId : null) : null
@@ -461,7 +461,64 @@ Page({
       })
     }
   },
+  handleSaveData() {
+    let cardList = this.data.cardList
+    let contentSaveList = this.data.contentSaveList
+    cardList.forEach(res => {
+      if (res.name == 'items') {
+        res.sumAmount = 0
+        res.sumQuantity = 0
+        res.chooseGoodsFlag = true
+      }
+    })
+    contentSaveList.forEach(res => {
+      if (res.code == 'sumAmount') {
+        res.content = 0
+      }
+    })
 
+    let formData = {}
+    formData.intoDate = utils.formatDayTime(new Date())
+    formData['staff'] = {
+      text: app.globalData.user.staffName,
+      value: [app.globalData.user.staffId]
+    }
+    formData['org'] = {
+      text: app.globalData.user.orgName,
+      value: [app.globalData.user.orgId]
+    }
+    formData.orgId = app.globalData.user.orgId
+    formData.orgList = [
+      {
+        orgId: app.globalData.user.orgId,
+        orgName: app.globalData.user.orgName,
+        ownerFlag: true,
+        allocationRatio: 100,
+      }
+    ]
+    formData.staffId = app.globalData.user.staffId
+    formData.staffList = [
+      {
+        staffId: app.globalData.user.staffId,
+        staffName: app.globalData.user.staffName,
+        ownerFlag: true,
+        allocationRatio: 100
+      }
+    ]
+    this.setData({
+      cardList: cardList,
+      formData:JSON.stringify(formData),
+      contentSaveList: contentSaveList
+    })
+
+    if (this.data.formMode == Constants.formMode.edit) { //编辑
+      var pages = getCurrentPages();
+      var prevPage = pages[pages.length - 2]; //上一个页面
+      prevPage.setData({
+        refreshByAdd: true
+      })
+    }
+  },
   //展开
   collapseFlagChange(e) {
     this.setData({

+ 16 - 0
package-purchase/pages/purchase-return/detail/detail.js

@@ -129,6 +129,22 @@ Page({
     let formData = JSON.parse(this.data.formData)
     formData = data.data
     let sItemAmt = Number(0)
+
+    //处理跳转源单
+    if(this.data.formReturnMode == 'supplier'){
+      
+      let item = {}
+      item.supName = formData.supName
+      item.staffName = formData.staffName
+      item.orgName = formData.orgName
+      item.returnAddress = formData.returnAddress
+
+      this.setData({
+        item:item
+      })
+    }
+
+
     data.dataItem.forEach(item => {
       if(item.sitemAmt){
         sItemAmt+=item.sitemAmt

+ 65 - 3
package-sales/pages/customer-collection/add/add.js

@@ -39,10 +39,16 @@ Page({
         code: 'addressFull',
         type: 'address',
         title: mixins.$t('adddressFull'),
-        required: false,
+        required: true,
         readonly: true,
       },
       {
+        code: 'addressNo',
+        type: 'str',
+        required: true,
+        title: mixins.$t('addressNo')
+      },
+      {
         code: 'staffId',
         name: 'staffName',
         title: mixins.$t('staffId'),
@@ -101,6 +107,7 @@ Page({
     }],
     routeObjName: 'cusReceiptPayment',
     accountService: app.globalData['accountService'],
+    customerService: app.globalData['customerService'],
   },
   /**
    * @desc : 计算需收款
@@ -492,7 +499,7 @@ Page({
       // 控制客户名称和电话不能修改
       let contentObj = this.data.contentObj
       contentObj.main.forEach(it=>{
-        if(it.code == 'cusName' || it.code == 'cusPhone' || it.code == 'addressFull'){
+        if(it.code == 'cusName' || it.code == 'cusPhone' || it.code == 'addressFull'|| it.code == 'addressNo'){
           it.readonly = true
           it.readonlyItem = true
         }
@@ -539,6 +546,61 @@ Page({
     })
 
   },
+/**
+   * @desc   : 手机号离焦事件
+   * @author : 于继渤
+   * @date   : 2024/1/26 11:46
+   */
+  changePhoneblur(e) {
+    let formData = JSON.parse(this.data.formData)
+    if (formData.cusPhone) {
+      this.getCustomerData({
+        cusPhone: formData.cusPhone
+      })
+    } 
+  },
+/**
+   * @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.cusPhone = item.cusPhone
+          formData.cusFromName = item.cusFromName
+          formData.cusFrom = item.cusFrom
+          //处理地址
+          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
+          //订单销售渠道 ,默认取的部门的渠道
+          // formData.salesChannel = item.channelId
+          // formData.channelId = item.channelId
+          // formData.channelName = item.channelName
+          formData.contactPhone = item.contactPhone
+          formData.contactPhone = item.contactPhone
 
-
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+        }
+      }
+    });
+  },
 })

+ 1 - 1
package-sales/pages/customer-collection/add/add.wxml

@@ -3,7 +3,7 @@
 <!-- 添加模版 -->
 <!-- <import src="/utils/template.wxml" />
 <template is="myTemplate" /> -->
-<dk-form-bill type="sale" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleCol="skuCode" descCol="skuModel" priceCol="priceStandard" quantityCol="itemQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" saleStaffAndOrgFlag="{{false}}" bind:chooseData="chooseData" bind:setGoods="setGoods" bind:editItems="editItems" bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList" bind:customersChoose="customersChoose" popType="sale" staff="staff" org="org" bind:changeNumberBlur="changeNumberBlur" bind:clickAttach="clickAttach" bind:uploadSucess="uploadSucess" bind:uploadError="uploadError"
+<dk-form-bill type="sale" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleCol="skuCode" descCol="skuModel" priceCol="priceStandard" quantityCol="itemQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" saleStaffAndOrgFlag="{{false}}" bind:chooseData="chooseData" bind:setGoods="setGoods" bind:editItems="editItems" bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList" bind:customersChoose="customersChoose" popType="sale" staff="staff" org="org" bind:changeNumberBlur="changeNumberBlur" bind:clickAttach="clickAttach" bind:uploadSucess="uploadSucess" bind:uploadError="uploadError"bind:changePhoneblur="changePhoneblur" 
 saleStaffAndOrgFlag="{{false}}" 
 >
 </dk-form-bill>

+ 1 - 0
package-sales/pages/customer-collection/detail/detail.js

@@ -26,6 +26,7 @@ Page({
         { code: 'cusName', type: 'str', urlKey: 'selectCustomers', readonly: true, title: mixins.$t('customerName') },
         { code: 'cusPhone', type: 'str', title: mixins.$t('cusPhone'), readonly: true, },
         { code: 'addressFull', type: 'str', title: mixins.$t('adddressFull'), readonly: true, },
+        { code: 'addressNo', type: 'str',  readonly: true, title: mixins.$t('addressNo') },
         { code: 'sumAmtRec', type: 'number', title: mixins.$t("amountCollected"), readonly: true },
         { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: true },
         { code: 'file', type: 'uploader', title: mixins.$t("uploader") ,readonly: true }

+ 58 - 0
package-sales/pages/order-return/add/add.js

@@ -184,6 +184,7 @@ Page({
       },
       ]
     },
+    customerService: app.globalData['customerService'],
   },
 
   /**
@@ -257,6 +258,63 @@ Page({
       }
     }
   },
+  /**
+   * @desc   : 手机号离焦事件
+   * @author : 于继渤
+   * @date   : 2024/1/26 11:46
+   */
+  changePhoneblur(e) {
+    let formData = JSON.parse(this.data.formData)
+    if (formData.cusPhone) {
+      this.getCustomerData({
+        cusPhone: formData.cusPhone
+      })
+    } 
+  },
+  /**
+   * @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.cusPhone = item.cusPhone
+          formData.cusFromName = item.cusFromName
+          formData.cusFrom = item.cusFrom
+          //处理地址
+          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
+          //订单销售渠道 ,默认取的部门的渠道
+          // formData.salesChannel = item.channelId
+          // formData.channelId = item.channelId
+          // formData.channelName = item.channelName
+          formData.contactPhone = item.contactPhone
+          formData.contactPhone = item.contactPhone
+
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+        }
+      }
+    });
+  },
   //计算可售量相关
   calculationSalesUsableQty() {
     let formData = JSON.parse(this.data.formData)

+ 1 - 1
package-sales/pages/order-return/add/add.wxml

@@ -3,7 +3,7 @@
 <loading wx:if="{{loading}}"></loading>
 <van-dialog id="van-dialog" />
 <!-- priceStd -->
-<dk-form-bill type="saleOutReturn" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}"  titleCol="skuModel" subCol="calculationFormula" descCol="skuName" priceCol="priceOut" quantityCol="outingQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" pupPriceCol="sumPrice" contentObj="{{contentObj}}" iconCol="imagesUrl" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods" table="{{table}}" bind:editItems="setGoods" readonly="{{formMode == 'detail' && formType =='detail'}}" bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList" bind:customersChoose="customersChoose" popType="sale" priceTitle="" satffAndOrgReadonly="{{satffAndOrgReadonly}}" staff="staff" org="org" popupTopObj="{{popupTopObj}}" cardContentList="{{cardContentList}}" quantityRedTitle="可售量:" quantityRedCol="usableQty" quantityRedColFlagKey="usableQtyInsufficientFlag" goodsTagText="{{goodsTagText}}" goodsTagColor="{{goodsTagColor}}" titpsFlag="{{titpsFlag}}" titpsItemColorFlagKey="titpsItemColorFlagKey" titpsLabel="titpsLabel"titleTagCol="brandName">
+<dk-form-bill type="saleOutReturn" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}"  titleCol="skuModel" subCol="calculationFormula" descCol="skuName" priceCol="priceOut" quantityCol="outingQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" pupPriceCol="sumPrice" contentObj="{{contentObj}}" iconCol="imagesUrl" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods" table="{{table}}" bind:editItems="setGoods" readonly="{{formMode == 'detail' && formType =='detail'}}" bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList" bind:customersChoose="customersChoose" popType="sale" priceTitle="" satffAndOrgReadonly="{{satffAndOrgReadonly}}" staff="staff" org="org" popupTopObj="{{popupTopObj}}" cardContentList="{{cardContentList}}" quantityRedTitle="可售量:" quantityRedCol="usableQty" quantityRedColFlagKey="usableQtyInsufficientFlag" goodsTagText="{{goodsTagText}}" goodsTagColor="{{goodsTagColor}}" titpsFlag="{{titpsFlag}}" titpsItemColorFlagKey="titpsItemColorFlagKey" titpsLabel="titpsLabel"titleTagCol="brandName"bind:changePhoneblur="changePhoneblur" >
 </dk-form-bill> 
  
 <view style="height: 200rpx;"></view>

+ 58 - 0
package-sales/pages/sales-outbound/add/add.js

@@ -313,6 +313,64 @@ Page({
       negativeNumber: true
     },
     ],
+    customerService: app.globalData['customerService'],
+  },
+  /**
+   * @desc   : 手机号离焦事件
+   * @author : 于继渤
+   * @date   : 2024/1/26 11:46
+   */
+  changePhoneblur(e) {
+    let formData = JSON.parse(this.data.formData)
+    if (formData.cusPhone) {
+      this.getCustomerData({
+        cusPhone: formData.cusPhone
+      })
+    } 
+  },
+  /**
+   * @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.cusPhone = item.cusPhone
+          formData.cusFromName = item.cusFromName
+          formData.cusFrom = item.cusFrom
+          //处理地址
+          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
+          //订单销售渠道 ,默认取的部门的渠道
+          // formData.salesChannel = item.channelId
+          // formData.channelId = item.channelId
+          // formData.channelName = item.channelName
+          formData.contactPhone = item.contactPhone
+          formData.contactPhone = item.contactPhone
+
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+        }
+      }
+    });
   },
   /**
    * @desc :  打开反算逻辑pop

+ 1 - 1
package-sales/pages/sales-outbound/add/add.wxml

@@ -5,7 +5,7 @@
 
  
 <dk-form-bill type="saleOut" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}"  titleCol="skuModel" subCol="calculationFormula" descCol="skuName"     priceCol="factPrice" quantityCol="outingQty" sumAmountCol="sumAmount" iconCol="imagesUrl" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}" pupPriceCol="factAmt"  bind:editItems="editItems" bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList"  bind:onCloseDel="deleteItemList" bind:customersChoose="customersChoose" popType="sale"   staff="staff" org="org" popupTopObj="{{popupTopObj}}" cardContentList="{{cardContentList}}" quantityRedTitle="可售量:" quantityRedCol="usableQty" quantityRedColFlagKey="usableQtyInsufficientFlag" goodsTagText="{{goodsTagText}}" goodsTagColor="{{goodsTagColor}}" titpsFlag="{{titpsFlag}}" titpsItemColorFlagKey="titpsItemColorFlagKey" titpsLabel="titpsLabel" readonly="{{isDetailFlag}}" isDetailFlag="{{isDetailFlag}}"dataTime="{{dataTime}}"minDate="{{dataTime}}"titleTagCol="brandName" bind:openReverseCalculationPop="openReverseCalculationPop1" reverseCalculationFlag="{{false}}"wholeOrderDiscountCol="discount"discountAmountCol="discAmt" sumAmountColTitle="折后金额"
-bind:clickAttach="clickAttach" bind:uploadSucess="uploadSucess" bind:uploadError="uploadError" 
+bind:clickAttach="clickAttach" bind:uploadSucess="uploadSucess" bind:uploadError="uploadError" bind:changePhoneblur="changePhoneblur"
 >
  
 </dk-form-bill>