Jelajahi Sumber

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

王英杰 1 tahun lalu
induk
melakukan
ee6e434210

+ 1 - 1
api/pages/ivt/outbound.js

@@ -11,7 +11,7 @@ module.exports = {
   outboundService: {
     // 前缀
     prefix: 'mdm-server/ivt/outbound/',
-    outboundRepeal: 'repeal/',
+    outboundRepeal: 'repeal/'
   },
 
   routeUrl: {

+ 4 - 2
api/pages/ivt/saleOutBound.js

@@ -16,7 +16,9 @@ module.exports = {
     handleOutbound: 'handle_outbound',
     getOutboundForUpdate:'get_outbound_for_update',
     repeal:'repeal',
-    selectByCondDetail:'select_by_cond_detail' //总单带明细
+    selectByCondDetail:'select_by_cond_detail', //总单带明细
+    
+    saleOrderOutboundCancel: 'sale_order_outbound_cancel',
   },
 
   routeUrl: {
@@ -32,7 +34,7 @@ module.exports = {
       selectInventorySku:{ key: 'selectInventorySku', url: '/package-base-select/pages/select-data/select-data',type:'inventorySku'  },
       invalid: { key: 'invalid', method: 'invalid', primaryKey: 'outId' , image:'btn-void.png'},
       editInto: { key: 'editInto', method: 'editInto', primaryKey: 'outId', image: 'btn-edit.png'}, //编辑
-
+      salesOutbound:{ key: 'salesOutbound', method: 'toDetail', primaryKey: 'outId' , image:'btn-outbound-processing.png'},
       printedBill:{ key: 'printedBill', method:'printedBill', formMode: 'index', idKey: 'cusId',image:'btn-printing.png' }
     }
   }

+ 1 - 1
app.wxss

@@ -582,7 +582,7 @@ end
   width: 100%;
 }
 .table-content-row{
-  padding: 10rpx 32rpx 10rpx 32rpx;
+  padding: 15rpx 32rpx;
 }
 .table-content-row-font{
   font-size: 14px;

+ 33 - 7
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -110,11 +110,15 @@ Component({
       type: String,
       value: 'discountStandard'
     },
+    sumQuantityCol: {
+      type: String,
+      value: 'sumQuantity'
+    },
     sumAmountCol: {
       type: String,
       value: 'sumAmount'
     },
-    swipeDisabled:{
+    swipeDisabled: {
       type: String,
     },
     sumAmountColFlag: {
@@ -324,6 +328,8 @@ Component({
     },
     detached: function () {
       // 在组件实例被从页面节点树移除时执行
+      // 清空地址信息
+      chooseLocation.setLocation(null);
     },
   },
   pageLifetimes: {
@@ -555,7 +561,7 @@ Component({
           // 是否弹出询问框
           Dialog.confirm({
             message: item.item.titpsMessage, //提示信息
-          }).then(() => {}).catch(() => {})
+          }).then(() => { }).catch(() => { })
           return
         }
         // 跳转链接
@@ -683,7 +689,7 @@ Component({
       if (this.data.readonly) {
         return;
       }
-      console.log('openMulti',this.data.form)
+      console.log('openMulti', this.data.form)
       let type = e.currentTarget.dataset.type
       let _this = this
       // 选择主从业务员
@@ -702,7 +708,7 @@ Component({
           success: function (res) {
             // 通过eventChannel向被打开页面传送数据
             res.eventChannel.emit('params', {
-              id: _this.data.form.staff.value,formMode:'index'
+              id: _this.data.form.staff.value, formMode: 'index'
             })
           }
         })
@@ -722,7 +728,7 @@ Component({
           success: function (res) {
             // 通过eventChannel向被打开页面传送数据
             res.eventChannel.emit('params', {
-              id: _this.data.form.org.value,formMode:'index'
+              id: _this.data.form.org.value, formMode: 'index'
             })
           }
         })
@@ -959,7 +965,7 @@ Component({
     blurField(e) {
       let ds = e.currentTarget.dataset
       this.setData({
-        value:JSON.stringify(this.data.form)
+        value: JSON.stringify(this.data.form)
       })
       this.triggerEvent("changeField", {
         code: ds.key
@@ -1238,7 +1244,7 @@ Component({
      */
     setAddress() {
       const location = chooseLocation.getLocation();
-      // console.log('loc', location);
+      console.log('loc', location,this.data.form);
       let form = this.data.form
       if (location) {
         form['address'] = location;
@@ -1345,6 +1351,11 @@ Component({
         }
         instance.close();
       }
+      // 外露setGoods方法
+      this.triggerEvent("onCloseDel", {
+
+      })
+
     },
     /**
      * @desc : 根据选品控制来源单
@@ -1656,6 +1667,21 @@ Component({
       util.showToast('文件超出' + Constants.uploadFileConfig.maxSizeMB);
     },
     /**
+   * @desc : 删除图片
+   * @author : 周兴
+   * @date : 2024/4/29 18:16
+   */
+    deleteImg(e) {
+      let form = this.data.form;
+      let index = e.detail.index;
+      let arr = form['annexPaths']
+      arr.splice(index, 1);
+      this.setData({
+        form: form,
+        value:JSON.stringify(form)
+      })
+    },
+    /**
      * @desc : 上传附件
      * @author : 周兴
      * @date : 2024/3/27 16:16

+ 1 - 1
components/dkbase/dk-form-bill/dk-form-bill.wxml

@@ -136,7 +136,7 @@
         </view> 
         <view wx:if="{{sumAmountColFlag}}" class="amount-item-class">
           <!--条数-->
-          <dk-cell titleColor="#95A8CB;" title="{{$t['together'] + (form[itemName]?form[itemName].length:0) + $t['piece']}}" amount="{{false}}"></dk-cell>
+          <dk-cell titleColor="#95A8CB;" title="{{$t['together'] + (card[sumQuantityCol]?card[sumQuantityCol]:0) + $t['piece']}}" amount="{{false}}"></dk-cell>
           <!--标价折扣-->
           <dk-cell fontSize="16" fontWeight="bold" contentFontWeight="700" contentColor="#FF7B1A" titleColor="#1B365D;" title="合计金额" content="{{card[sumAmountCol]?card[sumAmountCol]:0}}"></dk-cell>
         </view>

+ 17 - 0
components/dkbase/dk-form-more-items/dk-form-more-items.js

@@ -192,6 +192,8 @@ Component({
     },
     detached: function () {
       // 在组件实例被从页面节点树移除时执行
+      // 清空地址信息
+      chooseLocation.setLocation(null);
     },
   },
   pageLifetimes: {
@@ -702,6 +704,21 @@ Component({
       util.showToast('文件超出' + Constants.uploadFileConfig.maxSizeMB);
     },
     /**
+   * @desc : 删除图片
+   * @author : 周兴
+   * @date : 2024/4/29 18:16
+   */
+  deleteImg(e) {
+    let form = this.data.form;
+    let index = e.detail.index;
+    let arr = form['annexPaths']
+    arr.splice(index, 1);
+    this.setData({
+      form: form,
+      value:JSON.stringify(form)
+    })
+  },
+    /**
      * @desc : 上传附件
      * @author : 周兴
      * @date : 2024/3/27 16:16

+ 17 - 2
components/dkbase/dk-form/dk-form.js

@@ -404,7 +404,7 @@ Component({
       }
       this.setData({
         form: form,
-        contentObj:contentObj
+        contentObj: contentObj
       })
     },
     /**
@@ -414,7 +414,7 @@ Component({
      */
     blurField(e) {
       this.setData({
-        value:JSON.stringify(this.data.form)
+        value: JSON.stringify(this.data.form)
       })
     },
     /**
@@ -687,6 +687,21 @@ Component({
       util.showToast('文件超出' + Constants.uploadFileConfig.maxSizeMB);
     },
     /**
+   * @desc : 删除图片
+   * @author : 周兴
+   * @date : 2024/4/29 18:16
+   */
+    deleteImg(e) {
+      let form = this.data.form;
+      let index = e.detail.index;
+      let arr = form['annexPaths']
+      arr.splice(index, 1);
+      this.setData({
+        form: form,
+        value: JSON.stringify(form)
+      })
+    },
+    /**
      * @desc : 上传附件
      * @author : 周兴
      * @date : 2024/3/27 16:16

+ 9 - 6
package-base-select/pages/select-collection_confirm/select-collection_confirm.js

@@ -216,7 +216,7 @@ mixins: [mixins],
       if (this.data.formType == 1) {
         params.rpType = Constants.rpType.receipt
         // 1 收款单
-        params.objectId = this.data.form.objInfo.objectId  // 客户
+        params.objectId = this.data.form.objInfo.cusId  // 客户
         // 收款金额					
         params.sumAmtRec = Number(form.sumAmount)
         // 合计应收冲抵金额								
@@ -224,9 +224,9 @@ mixins: [mixins],
         // 合计优惠金额
         params.sumWaiveAmt = form.sumWaiveAmt
         // 预存抵扣
-        params.sumUseReceiptResidue = formData.receiptResidue
+        params.sumUseReceiptResidue = form.receiptResidue
         // 待核销金额
-        params.sumShouldHandle = formData.receivableResidue
+        params.sumShouldHandle = form.receivableResidue
 
         let rlsit = this.setReturnReceivableList(form.receivableList || [], form.sumWaiveAmt, form.currentReceivableResidue, form.receivableResidue)
         params.receivableList = rlsit //应收收款的明细 
@@ -330,9 +330,9 @@ mixins: [mixins],
         // 合计优惠金额
         params.sumWaiveAmt = form.sumWaiveAmt
         // 预存抵扣
-        params.sumUseReceiptResidue = formData.receiptResidue
+        params.sumUseReceiptResidue = form.receiptResidue
         // 待核销金额
-        params.sumShouldHandle = formData.receivableResidue
+        params.sumShouldHandle = form.receivableResidue
         let rlsit = this.setReturnReceivableList(form.receivableList || [], form.sumWaiveAmt, form.currentReceivableResidue, form.receivableResidue)
         params.receivableList = rlsit //应收收款的明细 
         tableData.forEach(item => {
@@ -417,10 +417,11 @@ mixins: [mixins],
       } else if (this.data.formType == 8) { //订单开单收款
         let formData = JSON.parse(this.data.formData)
         params.sumAmtRec = Number(params.sumAmtRec)
-
+        let itemIndex = Number(1)
         tableData.forEach(item => {
           itemList.push(
             {
+              itemIndex:itemIndex++,
               amtRec: item.sumAmount,
               balance: item.balance,
               macCode: item.macCode,
@@ -434,6 +435,8 @@ mixins: [mixins],
         console.log('formData',formData)
         params.sumAmtPay = formData.sumAmount
         console.log('params', params)
+        delete params['sumAmtPay']
+        delete params['sumAmtRec']
       } else if (this.data.formType == 9) { //其他支出
         let formData = JSON.parse(this.data.formData)
         //收付款类型-收款的查询参数

+ 23 - 2
package-base-select/pages/select-goods/select-goods.js

@@ -423,13 +423,26 @@ Page({
     if (this.data.item == Constants.billType.saleOut || this.data.item == Constants.billType.saleOutReturn) { //跟进仓库批次号cpid 查询库存
       console.log('globalData', app.globalData)
       item.nonStdCode = item.nonStdCode ? item.nonStdCode : '-'
-      item.priceSale = item.priceStandard
+      item.priceOut = item.priceStandard
       console.log(app.globalData)
       this.getInventory({
         skuId: item.skuId,
         cpId: app.globalData.company.cpId,
         nonStdCode: item.nonStdCode,
+      }).then(it=>{
+        if(it.length > 0){
+          console.log('invId',it[0].invId)
+          console.log('invQty',it[0].invQty)
+          item.invId = it[0].invId
+          item.invQty = it[0].invQty
+          item.usableQty = it[0].usableQty
+          this.setData({
+            dataItem: JSON.stringify(item)
+          })
+        }
+      
       })
+      console.log('item',item)
     }
     if (this.data.item == Constants.billType.sale) {
       item.nonStdCode = item.nonStdCode ? item.nonStdCode : '-'
@@ -449,7 +462,15 @@ Page({
    * @author : 于继渤
    */
   getInventory(params) {
-    return this.excute(this.data.commonService, this.data.commonService.getInventory, params);
+    return new Promise((resolve, reject) => {
+      this.excute(this.data.commonService, this.data.commonService.getInventory, params).then(res => {
+        if (res.data.code == 200) {
+          console.log(res.data.data)
+          resolve(res.data.data)
+
+        }
+      })
+    })
   },
   /**
    * @desc : 商品确认事件

+ 1 - 1
package-base-select/pages/select-source-sale-order/select-source-sale-order.js

@@ -185,7 +185,7 @@ Page({
   toAdd() {
     let itemList = this.data.choooseInboundItemList
     const eventChannel = this.getOpenerEventChannel();
-    eventChannel.emit('bindData', { itemList: itemList, fromNo: itemList[0].orderNo })
+    eventChannel.emit('bindData', { itemList: itemList, fromNo: itemList[0].orderNo ,fromId: itemList[0].orderId })
     wx.navigateBack({
       data: 1
     })

+ 20 - 9
package-basic-data/pages/org/choose-org/choose-org.js

@@ -24,7 +24,6 @@ Page({
   },
 
 
-
   /**
    * @desc : 设置查询参数
    * @date : 2024/2/1 15:49
@@ -52,10 +51,22 @@ Page({
    * @author : 王英杰
    */
   handleSearchData(data) {
+    let tableData = []
+    // 先获取二级
+    let filters = data.filter(it=>it.levelNo == 2);
+    let childs = []
+    if(filters && filters.length > 0){
+      filters.forEach(it=>{
+        // 再获取二级的子级,根据levelCode过滤
+        childs = data.filter(t=>t.levelCode.startsWith(it.levelCode) && t.levelNo > 2);
+        it.children = childs
+        tableData.push(it);
+      })
+    }
+    console.log('etableData',tableData);
     this.setData({
-      tableData: this.dataHandling(data),
+      tableData: tableData,
     })
- 
   },
    /**
    * @desc : 重新排列下数据
@@ -63,6 +74,7 @@ Page({
    * @author : 王英杰
    */
   dataHandling(dataList) {
+    console.log('dataList',dataList);
     // 初始化data  
     let data = []; 
     // 初始化一个临时列表来存放当前level no等于2以及之后相连的数据  
@@ -91,12 +103,12 @@ Page({
     return data
   },
   /**
-   * @desc : dk-tree 控件回调点击事件
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
+   * @desc : 选择数据
+   * @date : 2024/4/29 15:49
+   * @author : 周兴
    */
-  clickName(e) {     
-    console.log("eee",e);
+  chooseData(e) { 
+    console.log('teee',e);    
     let item = e.currentTarget.dataset.item
     const eventChannel = this.getOpenerEventChannel();
     eventChannel.emit('bindData', {
@@ -105,7 +117,6 @@ Page({
         name: item.orgName
       }
     })
-     
     wx.navigateBack({
       delta: 1
     })

+ 27 - 19
package-basic-data/pages/org/choose-org/choose-org.wxml

@@ -4,32 +4,40 @@
 <loading wx:if="{{loading}}"></loading>
 <!-- 粘性布局的查询条件 -->
 <van-sticky scroll-top="0">
-    <van-search model:value="{{ searchText }}" bind:change="onSearchText" bind:search="doSearch" use-action-slot placeholder="搜索 客户名称/地址/标签/电话/备注">
+    <van-search model:value="{{ searchText }}" bind:change="onSearchText" bind:search="doSearch" use-action-slot placeholder="搜索">
     </van-search>
-    <view style="display: flex; padding: 4vw; background: white;">
-        <view class="image-frame">
-            <van-image round width="20rpx" height="24rpx" src="/static/image/Vector.png" />
+</van-sticky>
+
+<!-- 内容列表 -->
+<view style="width: 100%;">
+    <view wx:for="{{tableData}}" wx:for-item="item"  wx:key="index" class="main-class">
+        <view class="table-content">
+            <view class="table-title-row" data-item="{{item}}" catchtap="chooseData">
+                <view style="font-size: 16px;font-weight: 500;width: 100%;">
+                    {{item.orgName}}
+                </view>
+            </view>
+            <view class="table-content-row" wx:for="{{item.children}}" wx:for-item="cItem" data-item="{{cItem}}" bindtap="chooseData">
+                <view style="font-size: 14px;">{{cItem.orgName}}</view>
+            </view>
         </view>
-        <view>沈阳蒙娜丽莎红星美凯龙专营店</view>
+
     </view>
-</van-sticky>
+</view>
 
 <!-- 暂无数据 -->
 <van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />
 
-<!-- 列表 --> 
-<view wx:for="{{tableData}}" style="margin:10px;background:white;border-radius:15rpx;padding: 10px;"> 
-  <view wx:for="{{item}}" wx:for-item="item_" wx:for-index="index_" >
-    <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;"data-item="{{item_}}"   bindtap="clickName"> 
-            <view style="margin-left: 5vw;font-size: 14px;" >
+<!-- 列表
+<view wx:for="{{tableData}}" style="margin:10px;background:white;border-radius:15rpx;padding: 10px;">
+    <view wx:for="{{item}}" wx:for-item="item_" wx:for-index="index_">
+        <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;" data-item="{{item_}}" bindtap="clickName">
+            <view style="margin-left: 5vw;font-size: 14px;">
                 {{item_.orgName}}
-            </view> 
+            </view>
         </view>
-  </view> 
-</view>
- 
- <van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}</van-divider>
-<view style="height: 135rpx;"></view>
+    </view>
+</view> -->
 
- 
- 
+<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}</van-divider>
+<view style="height: 135rpx;"></view>

+ 7 - 4
package-basic-data/pages/org/choose-org/choose-org.wxss

@@ -23,8 +23,11 @@
     box-shadow: 0px -8rpx 24rpx rgba(0, 16, 39, 0.1);
     border-radius: 30rpx 30rpx 0rpx 0rpx;
   }
-  /* .v-button{
-     background: #20365E;
-     
-  } */
+  .table-title-row{
+    background: linear-gradient(95.33deg, #ADC6FF -2.27%, #F0F5FF 60.66%),
+      linear-gradient(0deg, #F4F8FF, #F4F8FF),
+      radial-gradient(58.28% 235.72% at 10.78% 50%, rgba(191, 213, 255, 0.6) 0%, rgba(216, 229, 255, 0) 56.69%); 
+      padding: 30rpx 20rpx;
+      border-radius: 15rpx 15rpx 0  0 ;
+  }
  

+ 4 - 4
package-basic-data/pages/org/org.wxml

@@ -7,7 +7,7 @@
     <!-- 查询条件 -->
     <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['orgId'])}}">
     </dk-dropdown-menu>
-    <view style="display: flex; padding: 4vw; background: white;">
+    <view style="display: flex; padding: 4vw; background: white;font-weight: 500;">
         <view class="image-frame">
             <van-image round width="39rpx" height="39rpx" fit="fill" src="{{imageUrl + 'org-img.png'}}" />
         </view>
@@ -24,7 +24,7 @@
     <view style="display: flex;padding:3vw;   border-radius: 15rpx 15rpx 0 0 " class="tile-class" data-open="{{item.open}}" data-item="{{item}}" data-index="{{index}}" bindtap="onchange">
         <view style="display: flex;flex: 1;">
             <van-image round width="39rpx" height="39rpx" fit="fill" src="/static/image/ghxk.png" />
-            <view style="margin-left:5vw;font-size: 16px;">{{item.orgName}}</view>
+            <view style="margin-left:5vw;font-size: 16px;font-weight: 500;">{{item.orgName}}</view>
         </view>
         <view style=" text-align: right;">
             <van-icon wx:if="{{ item.open }}" color="#bdb7b7" name="arrow-down" style="font-size: 16px;" />
@@ -34,8 +34,8 @@
     <!-- 列表下半部分 -->
     <view wx:if="{{ !item.open}}" wx:for="{{item.children}}" wx:for-item="item_" wx:for-index="index_" class="list-below-item">
         <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;">
-            <view class="tree_left">
-                <van-image round width="40rpx" height="40rpx" fit="fill" src="/static/image/tree.png" />
+            <view  >
+                <van-image src="{{imageUrl + 'tree.png'}}"  width="25rpx" height="25rpx" fit="heightFix"/>
             </view>
             <view style="margin-left: 5vw;font-size: 14px;" data-item="{{item_}}" data-type="sub" data-open="{{item.open}}" bindtap="clickName">
                 {{item_.orgName}}

+ 5 - 0
package-basic-data/pages/org/org.wxss

@@ -55,4 +55,9 @@
   align-items: center;
   padding: 20rpx;
   box-shadow: 0px 17px 22px 0px #1B365D33;
+}
+
+.image-class{
+  width: 30rpx;
+  height: 30rpx;
 }

+ 2 - 0
package-basic-data/pages/org/sub-org-choose/sub-org-choose.js

@@ -8,6 +8,7 @@
  *		王英杰		   2024-2-12	    1.00		   	    
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
+const config = require('@/config/config.js');
 const mixins = require('@/mixins/index.js')
 const util = require('@/utils/util.js')
 const app = getApp()
@@ -17,6 +18,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    imageUrl: config.image_url + '/static/img/',
     readonly: false,
     // 查询条件
     searchContent: [],

+ 3 - 3
package-basic-data/pages/org/sub-org-choose/sub-org-choose.wxml

@@ -9,7 +9,7 @@
     </dk-dropdown-menu>
     <view style="display: flex; padding: 4vw; background: white;">
         <view class="image-frame">
-            <van-image round width="20rpx" height="24rpx" src="/static/image/Vector.png" />
+            <van-image round width="39rpx" height="39rpx" fit="fill" src="{{imageUrl + 'org-img.png'}}" />
         </view>
         <view>{{item.chooseOrgSort}}</view>
     </view>
@@ -22,8 +22,8 @@
 <view  class="Outer-frame"> 
     <view  wx:for="{{tableData}}"  class="list-below-item">
         <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;">
-            <view class="tree_left">
-                <van-image round width="40rpx" height="40rpx" src="/static/image/tree.png" />
+            <view >
+                <van-image src="{{imageUrl + 'tree.png'}}"  width="25rpx" height="25rpx" fit="heightFix"/>
             </view>
             <view style="margin-left: 5vw;font-size: 14px;" data-item="{{item}}"   bindtap="clickName">
                 {{item.orgName}}

+ 4 - 2
package-basic-data/pages/org/sub-org-choose/sub-org-choose.wxss

@@ -1,10 +1,12 @@
 .image-frame {
-    width: 39rpx;
-    height: 39rpx;
+    width: 39rpx;height: 39rpx;
+    text-align: center;
     background-color: #95A8CB;
     border-radius: 50%;
     margin-top: 5rpx;
     margin-right: 3vw;
+    display: flex;
+    justify-content: center;
 }
 
 .list-below-item {

+ 58 - 11
package-sales/pages/order-billing/add/add.js

@@ -158,16 +158,16 @@ Page({
       formData.channelName = item.channelName
       formData.contactPhone = item.contactPhone
       formData.contactPhone = item.contactPhone
-     
-      formData.collectAmount =  item.receiptResidue
+
+      formData.collectAmount = item.receiptResidue
       let cardList = this.data.cardList
-      cardList[1].canUseCollect =   item.receiptResidue  //可用
-      cardList[1].useCollect =   item.receiptResidue  //可用
-    
-      formData.canUseCollect =  item.receiptResidue  //可用
-      formData.useCollect =  item.receiptResidue  //使用
+      cardList[1].canUseCollect = item.receiptResidue  //可用
+      cardList[1].useCollect = item.receiptResidue  //可用
+
+      formData.canUseCollect = item.receiptResidue  //可用
+      formData.useCollect = item.receiptResidue  //使用
       this.setData({
-        cardList:cardList
+        cardList: cardList
       })
     }
     ///设置主从业务员
@@ -225,7 +225,7 @@ Page({
       formData.orderStatus = Constants.orderStatus.STATUS_DEAL //订单状态
       formData.outStatus = Constants.outStatus.unOutBound //出库状态
       formData.makeStaff = app.globalData.user.staffId //制单人
-      formData.amtResidue = formData.amtReceivable //剩余应收 = 应收金额 
+      // formData.amtResidue = formData.amtReceivable //剩余应收 = 应收金额 
       formData.deleteItemList = formData.deleteList ? formData.deleteList : []
       formData.salesChannel = formData.channelId
       delete formData['goodsList']
@@ -273,6 +273,7 @@ Page({
     params.deleteItemList = params.deleteList ? params.deleteList : []
     params.salesChannel = params.channelId
     delete params['goodsList']
+    // return
     return params
   },
   /**
@@ -368,10 +369,56 @@ Page({
      * @author : 于继渤
      */
   getItemDetal(orderId) {
-    return this.excute(this.data.service, this.data.service.selectOrderInfoById + '/' + orderId, {}).then(res => {
+    return this.excute(this.data.service, this.data.service.getOrderForUpdate + '/' + orderId, {}).then(res => {
       if (res.data.code == 200) {
         let formData = JSON.parse(this.data.formData)
-        formData.goodsList = res.data.data.orderItem
+        formData.goodsList = res.data.data.dataItem
+        //处理主从业务员业务部门
+        if (res.data.data.staffList) {
+          let staffIds = []
+          let staffList = []
+          let staffNames = []
+          res.data.data.staffList.forEach(it => {
+            if (it.ownerType == '归属类型-主员工') {
+              formData.staffId = it.staffId
+            }
+            staffList.push({
+              staffId: it.staffId,
+              staffName: it.staffName,
+              ownerFlag: it.ownerType == '归属类型-主员工' ? true :false,
+              allocationRatio: it.allocationRatio
+            })
+            staffIds.push(it.staffId)
+            staffNames.push(it.staffName)
+          })
+          formData['staff'] = {
+            text: staffNames.join(","),
+            value: staffIds
+          }
+        }
+        if (res.data.data.orgList) {
+
+          let orgIds = []
+          let orgList = []
+          let orgNames = []
+          res.data.data.orgList.forEach(it => {
+            if (it.ownerType == '归属类型-主部门') {
+              formData.orgId = it.orgId
+            }
+            orgList.push({
+              orgId: it.orgId,
+              orgName: it.orgName,
+              ownerFlag: it.ownerType == '归属类型-主部门' ? true :false,
+              allocationRatio: it.allocationRatio
+            })
+            orgIds.push(it.orgId)
+            orgNames.push(it.orgName)
+          })
+          formData['org'] = {
+            text: orgNames.join(","),
+            value: orgIds
+          }
+        }
         this.setData({
           formData: JSON.stringify(formData)
         })

+ 30 - 0
package-sales/pages/order-billing/detail/detail.js

@@ -90,6 +90,36 @@ Page({
     })
   },
 
+  saveButton(){
+    let formData = JSON.parse(this.data.formData)
+    let item = {}
+    item.objInfo = {}
+    item.objInfo['cusPhone'] = formData.cusPhone
+    item.objInfo['cusName'] = formData.cusName
+    item.objInfo['objectId'] = formData.cusId
+    item.objInfo['addressFull'] = formData.addressFull
+
+
+    let _this = this
+    wx.navigateTo({
+      url: this.data.route.selectCollectionConfirm.url,
+      events: {
+        // 回调后
+        bindData: function (data) {
+          // 保存成功后 回调
+          wx.navigateBack({
+            data: 1
+          })
+        }
+      },
+      success: function (res) {
+        //设置参数
+        //let item = _this.setSaveData()
+        res.eventChannel.emit('params', { item: JSON.stringify(item), formType: 8 })
+      }
+    })
+  },
+
 
   /**
      * @desc : 加载数据

+ 78 - 32
package-sales/pages/sales-outbound/add/add.js

@@ -15,7 +15,6 @@ Page({
     orderService: app.globalData['orderService'],
     saleOutBoundService: app.globalData['saleOutBoundService'],
     commonService: app.globalData['commonService'],
-    btnFormData: JSON.stringify({ flag: true }),
     cardList: [
       { name: 'main', title: mixins.$t("customerInformation") },
       { name: 'relation' },
@@ -39,8 +38,8 @@ Page({
         code: 'fromNo',
         name: 'fromNo',
         type: 'choose',
-        titpsKey:'cusId',
-        titpsMessage:'请选择客户',
+        titpsKey: 'cusId',
+        titpsMessage: '请选择客户',
         controlChooseFlag: true,
         title: mixins.$t("sourceOrder"),//'关联源单'
         urlKey: 'selectSourceSaleOrder'
@@ -58,7 +57,7 @@ Page({
     },
     //按钮
     buttonSaveList: [
-      { code: 'save', title: mixins.$t("save"), width: '120rpx' }
+      { code: 'save', title: mixins.$t("save") }
     ],
     contentSaveList: [
       { code: 'flag', title: mixins.$t("autoSaleOutBoundFlag"), type: 'checkbox' },
@@ -75,7 +74,7 @@ Page({
     popupTopObj: [{ leftTitle: '库存量', leftCode: 'usableQty', rightTitle: '可售量', rightCode: 'invQty' }],
     titpsFlag: true,
     // 系统参数
-    flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001]  == "true" ? true : false 
+    flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false
   },
   /**
      * @desc :   编辑
@@ -136,20 +135,6 @@ Page({
 
 
 
-  /**
-    * @desc : 底部按钮事件
-    * @date : 2024/2/1 15:49
-    * @author : 于继渤
-    */
-  saveButton(e) {
-    console.log(e)
-    let name = e.detail.name
-    if (name == 'save') { //保存
-      this.save({})
-    } else if (name == 'collection') { //收款
-
-    }
-  },
 
   /**
     * @desc : 设置保存参数
@@ -227,13 +212,13 @@ Page({
         // return
         formData = res.data.data.data
         //销售订单列表转出库
-        formData.fromNo = formData.orderNo
+        formData.fromNo =  formData.fromNo ?  formData.fromNo : formData.orderNo
         //处理地址
         formData.address = this.setAddress(formData)
         //处理明细
         let listData = res.data.data.dataItem
         if (listData && listData.length > 0) {
-       
+
           if (this.data.formMode == 'other') {
             //过滤可出库量为0的
             listData = listData.filter(item => {
@@ -242,28 +227,48 @@ Page({
           }
           let list = []
           listData.forEach(item => {
+            console.log('Service',Service)
             if (this.data.formMode == 'detail' && Service !== 'saleOutBoundService') {
               item.outingQty = item.outQty
               item.outingAmt = Number(item.outingQty * item.priceOut)
-            } else if(this.data.formMode == 'other'){
+            } else if (this.data.formMode == 'other') {
               item.outingQty = item.canOutingQty
               item.outingAmt = Number(item.outingQty * item.priceOut)
             }
+            // if (this.data.formMode == 'detail' && Service == 'saleOutBoundService') {
+            //   item.outingQty = item.outQty
+            //   item.outingAmt = Number(item.outingQty * item.priceOut)
+            // }
             //出库中 办理详情页
-            if(this.data.formMode == 'other' && Service == 'saleOutBoundService'){
-
+            if (this.data.formMode == 'other' && Service == 'saleOutBoundService') {
+              item.outingQty = item.outQty
+              item.outingAmt = Number(item.outingQty * item.priceOut)
+            }
+            //处理图片
+            if (item.skuImages) {
+              item['imagesUrl'] = item.skuImages.length > 0 ? item.skuImages[0].url : null
             }
 
-            item.outingQtyMax = item.canOutingQty //可出库最大值
-            item.outingQtyMin = 1  //可出库最小值
+            item.outingQty_max = item.canOutingQty  ? item.canOutingQty : item.invQty //可出库最大值
+            item.outingQty_min = 1  //可出库最小值
             list.push({
               skuId: item.skuId,
               nonStdCode: item.nonStdCode,
               whId: item.whId
             })
           })
-          console.log('listData',listData)
-          let that =  this
+          //处理按钮
+          if (res.data.data.data && res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus")) {
+            let buttonSaveList  = this.data.buttonSaveList
+            buttonSaveList = [
+              { name: 'merge', title: mixins.$t("handleWithdrawal"), }
+            ]
+            this.setData({
+              buttonSaveList:buttonSaveList
+            })
+          }
+          console.log('listData', listData)
+          let that = this
           //批量查库存
           this.getInventory({ skuIdNonStdCodeWhIdList: list }).then(item => {
             listData.forEach(res => {
@@ -277,13 +282,13 @@ Page({
                 })
               }
 
-      
+
             })
             formData.goodsList = listData
             this.setData({
               formData: JSON.stringify(formData)
             })
-    
+
             //处理库存量
             this.calculationSalesUsableQty()
           })
@@ -303,6 +308,46 @@ Page({
       }
     });
   },
+    /**
+    * @desc : 底部按钮事件
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+   saveButton(e) {
+    let name = e.detail.name
+    console.log(e)
+    if (name == 'save') { //保存
+      this.save({})
+    } else  { //撤回
+      this.handleWarehousing()
+    }
+  },
+
+   /**
+   * @desc : 撤回
+   * @date : 2024/2/1 15:49
+   * @author : 于
+   */
+  handleWarehousing(e) {
+    let item = {}
+    item.outId = this.data.id
+    this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.saleOrderOutboundCancel, item).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        // 重新查询
+        this.searchData()
+      }
+    })
+  },
+  /**
+     * @desc : 删除明细
+     * @date : 2024/2/1 15:49
+     * @author : 于继渤
+     */
+  deleteItemList() {
+    console.log('deleteItemList')
+    let formData = JSON.parse(this.data.formData)
+    this.calculateAmount(formData)
+  },
   /**
      * @desc : 给表单赋值
      * @date : 2024/2/1 15:49
@@ -512,6 +557,7 @@ Page({
         })
         formData.goodsList = item.itemList
         formData.fromNo = item.fromNo
+        formData.fromId = item.fromId
         this.calculateAmount(formData)
       }
     }
@@ -645,14 +691,14 @@ Page({
     if (this.data.formMode == Constants.formMode.detail) {
       //按钮
       buttonSaveList = [
-        { code: 'save', title: mixins.$t("outProcessing"), width: '120rpx', color: '#1B365D' }
+        { code: 'save', title: mixins.$t("outProcessing") }
       ]
       contentSaveList = [
         // { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
         { code: 'receivable', content: 0, type: 'number', title: mixins.$t("saleCollection") }
       ]
       popContent = [
-        { code: 'outQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
+        { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
         { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true, readonly: true },
 
         { code: 'whName', title: mixins.$t("warehouseId"), type: 'str', readonly: true, readonly: true },

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

@@ -3,9 +3,9 @@
 <loading wx:if="{{loading}}"></loading>
 
 
-<dk-form-bill type="saleOut" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode"  subCol="skuCode" descCol="skuModel" priceCol="priceOut" quantityCol="outingQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}"
-bind:editItems="editItems"  bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList"
-bind:customersChoose="customersChoose"   popType="sale" priceTitle="价:" staff="staff" org="org"
+<dk-form-bill type="saleOut" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="brandName" titleCol="skuModel"  subCol="skuCode" descCol="skuName" priceCol="priceOut" quantityCol="outingQty" sumAmountCol="sumAmount" iconCol="imagesUrl" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}" pupPriceCol="priceStd"
+bind:editItems="editItems"  bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList" bind:onCloseDel="deleteItemList"
+bind:customersChoose="customersChoose"   popType="sale" priceTitle="销售价:" staff="staff" org="org"
 popupTopObj="{{popupTopObj}}"
 cardContentList="{{cardContentList}}"
 quantityRedTitle="可售量:"

+ 4 - 3
package-sales/pages/sales-outbound/sales-outbound.js

@@ -18,9 +18,9 @@ Page({
   data: {
     tagList: [{ title: "全部", code: '' }, { title: "待出库", code: '出库状态-待出库' }, { title: "已出库", code: '出库状态-已出库' }],
     // 列表区(脚部金额)
-    footerAmount: { name: 'outAmt', title: mixins.$t("totalAmount") },
+    footerAmount: { name: 'sumOutAmt', title: mixins.$t("totalAmount") },
     // 列表区(脚部信息)
-    footerInfo: [{ name: 'outQty', title: mixins.$t("piece"), prefix: mixins.$t("together"), }],
+    footerInfo: [{ name: 'sumOutQty', title: mixins.$t("piece"), prefix: mixins.$t("together"), }],
     // 列表区(内容)
     contentList: [
       { name: 'outNo', title: mixins.$t("outOrderNo") },
@@ -190,7 +190,8 @@ Page({
 
 
   toDetail(e) {
-    let outId = e.detail.item.outId
+    console.log(e)
+    let outId = e.outId? e.outId : e.detail.item.outId 
     wx.navigateTo({
       url: this.data.route.edit.url,
       success: function (res) {

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

@@ -11,7 +11,7 @@
 
 
 <!-- 列表区 -->
-<dk-list  list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="salesChannelName" title="cusName" collectCol="outAmt"  status="outStatusName" content="{{contentList}}" contentObj="{{contentObj}}"  footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" collectName="收款"  bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+<dk-list  list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="salesChannelName" title="cusName" collectCol="sumOutAmt"  status="outStatusName" content="{{contentList}}" contentObj="{{contentObj}}"  footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" collectName="收款"  bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
 
 
 <view style="height: 200rpx;"></view>