Przeglądaj źródła

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

zhoux 2 lat temu
rodzic
commit
aa7fbe006c
45 zmienionych plików z 1772 dodań i 4393 usunięć
  1. 1 0
      api/pages/common/common.js
  2. 3 0
      api/pages/ivt/outbound.js
  3. 24 0
      api/pages/ivt/saleOutBound.js
  4. 1 0
      api/pages/mac/account.js
  5. 1 0
      api/pages/mac/receiptPayment.js
  6. 4 1
      api/pages/mst/customer.js
  7. 3 0
      api/pages/sale/order.js
  8. 2 1
      app.js
  9. 2 1
      app.json
  10. 2 2
      components/dkbase/dk-form-bill/dk-form-bill.js
  11. 3 0
      components/dkbase/dk-form-bill/dk-form-bill.wxml
  12. 2 0
      components/dkbase/dk-form-more-items/dk-form-more-items.js
  13. 1 1
      components/dkbase/dk-form-more-items/dk-form-more-items.wxml
  14. 14 4
      i18n/zh-CN.js
  15. 1 1
      package-accounts-manage/pages/other-receipt/add/add.wxml
  16. 116 40
      package-accounts-manage/pages/receipt/add/add.js
  17. 4 2
      package-accounts-manage/pages/receipt/add/add.wxml
  18. 9 9
      package-base-select/pages/select-bill/select-bill.js
  19. 189 1276
      package-base-select/pages/select-collection_confirm/select-collection_confirm.js
  20. 35 40
      package-base-select/pages/select-collection_confirm/select-collection_confirm.wxml
  21. 1 1
      package-base-select/pages/select-goods/select-goods.js
  22. 36 6
      package-base-select/pages/select-income-category/select-income-category.js
  23. 1 1
      package-base-select/pages/select-income-category/select-income-category.wxml
  24. 3 25
      package-base-select/pages/select-income-category/select-income-category.wxss
  25. 5 2
      package-base-select/pages/select-source-purchase-order/select-source-purchase-order.js
  26. 5 3
      package-base-select/pages/select-source-purchase-order/select-source-purchase-order.wxml
  27. 170 0
      package-base-select/pages/select-source-sale-order/select-source-sale-order.js
  28. 4 0
      package-base-select/pages/select-source-sale-order/select-source-sale-order.json
  29. 70 0
      package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml
  30. 70 0
      package-base-select/pages/select-source-sale-order/select-source-sale-order.wxss
  31. 30 7
      package-basic-data/pages/customer-list/add/add.js
  32. 28 11
      package-inventory/pages/outbound-processing/detail/detail.js
  33. 21 7
      package-inventory/pages/warehousing-processing/detail/detail.js
  34. 42 31
      package-purchase/pages/purchase-return/add/add.js
  35. 5 3
      package-purchase/pages/purchase-return/add/add.wxml
  36. 11 11
      package-purchase/pages/purchase-return/detail/detail.js
  37. 12 10
      package-purchase/pages/purchase-return/purchase-return.js
  38. 1 1
      package-purchase/pages/purchase-return/purchase-return.wxml
  39. 18 18
      package-sales/pages/order-billing/add/add.js
  40. 39 52
      package-sales/pages/order-billing/order-billing.js
  41. 287 1989
      package-sales/pages/sales-outbound/add/add.js
  42. 9 412
      package-sales/pages/sales-outbound/add/add.wxml
  43. 435 89
      package-sales/pages/sales-outbound/add/add.wxss
  44. 48 330
      package-sales/pages/sales-outbound/sales-outbound.js
  45. 4 6
      package-sales/pages/sales-outbound/sales-outbound.wxml

+ 1 - 0
api/pages/common/common.js

@@ -28,6 +28,7 @@ module.exports = {
         getOrg: 'get_org', //业务部门
         getGoodsCategoryNoPage: 'get_goods_category_no_page', //商品种类不带分页 
         getSupplierAndCustomerData: 'get_supplier_and_customer_by_page',
+        getGoodsForOrderByPage: 'get_goods_for_order_by_page', //商品列表
 
     },
     routeUrl: {

+ 3 - 0
api/pages/ivt/outbound.js

@@ -26,6 +26,9 @@ module.exports = {
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-warehouse/select-warehouse'  },
       chooseStorageObject: { key: 'chooseStorageObject', url: '/package-base-select/pages/select-storage-object/select-storage-object'  },
       chooseStorageOutReason: { key: 'chooseStorageOutReason', url: '/package-base-select/pages/select-data-dictionary/select-data-dictionary'  },
+      selectSourceSaleOrder:{
+        key:'selectSourceSaleOrder',url:'/package-base-select/pages/select-source-sale-order/select-source-sale-order'
+      }
     }
   }
 };

+ 24 - 0
api/pages/ivt/saleOutBound.js

@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:入库
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		于继渤		  	     2024-1-19       			1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+  saleOutBoundService: {
+    // 前缀
+    prefix: 'mdm-server/ivt/outbound/'
+  },
+
+  routeUrl: {
+    saleOutBound: { 
+      add:{key:'add',url:'/package-sales/pages/sales-outbound/add/add'},
+      selectSourceSaleOrder:{
+        key:'selectSourceSaleOrder',url:'/package-base-select/pages/select-source-sale-order/select-source-sale-order'
+      }
+    }
+  }
+};

+ 1 - 0
api/pages/mac/account.js

@@ -13,6 +13,7 @@ module.exports = {
 		prefix: 'mdm-server/mac/account/',
 		getAccount:'get_account/',
 		getReceivableAccountItem:'get_receivable_account_item/',
+		getReceivableAccountItemCount:'get_account_item_count/',
 	},
 
 	routeUrl: {

+ 1 - 0
api/pages/mac/receiptPayment.js

@@ -11,6 +11,7 @@ module.exports = {
 	receiptPaymentService: {
 		// 前缀
 		prefix: 'mdm-server/mac/recPay/',
+		insertReceivableReceipt:'insert_receivable_receipt',
 	},
 
 	routeUrl: {

+ 4 - 1
api/pages/mst/customer.js

@@ -33,7 +33,10 @@ module.exports = {
       },
       measureTo:{
         key: 'measureTo', url: '/package-basic-data/pages/customer-reception/measure-to/measure-to'
-      }
+      },
+
+      chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-choose-staff/select-choose-staff'  },
+      chooseOrg: { key: 'chooseOrg',url: '/package-base-select/pages/select-choose-org/select-choose-org' }, 
     }
   }
 };

+ 3 - 0
api/pages/sale/order.js

@@ -14,6 +14,7 @@ module.exports = {
     purSaleListBy: 'purchase_based_on_sales_list_by',
     getOrderForUpdate: 'get_order_for_update',
     selectOrderInfoById: 'select_order_info_by_id',
+    selectTotalSingleTapeDetailPage:'select_total_single_tape_detail_page' //总单带明显
   },
 
   routeUrl: {
@@ -24,6 +25,8 @@ module.exports = {
       selectCustomers: { key: 'add', url: '/package-base-select/pages/select-customers/select-customers' },
       edit: { key: 'edit', url: '/package-sales/pages/order-billing/detail/detail' ,formMode:'other' ,idKey:'orderId'},
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-warehouse/select-warehouse'  },
+      saleOutBound: { key: 'saleOutBound', url: '/package-sales/pages/sales-outbound/add/add'  },
+
     }
 
   }

+ 2 - 1
app.js

@@ -57,10 +57,11 @@ const cusFollow = require('./api/pages/mst/cusFollow.js');
 const transfer = require('./api/pages/mac/transfer.js');
 const order = require('./api/pages/sale/order.js');
 const income = require('./api/pages/mac/income.js');
+const saleOutBound = require('./api/pages/ivt/saleOutBound.js');
 
 // api服务路由文件
 var apiList = [common, oauth,setting, company, wechatPay,user, staff, staffRight, staffPurview, settingValue, customer, role, roleFun, org, roleSensitive, goodsBrand, goodsCategory, goodsSeries, unit, supplier, warehouse, saleChannel, goodsSku, basicData,customerMst,purchase,account,
-  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income]
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income,saleOutBound]
 
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 2 - 1
app.json

@@ -211,7 +211,8 @@
                 "pages/select-warehouse/select-warehouse",
                 "pages/select-account-category/select-account-category",
                 "pages/select-fund-account/select-fund-account",
-                "pages/select-income-category/select-income-category" 
+                "pages/select-income-category/select-income-category" ,
+                "pages/select-source-sale-order/select-source-sale-order" 
             ]
         }
     ],

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

@@ -137,9 +137,9 @@ Component({
       type: String,
       value: '可售量:'
     },
-    quantityRedTitle:{  //右侧显示文字
+    goodsTagText:{ //自定义tag
       type: String,
-      value: '可售量:'
+      value: ''
     },
     // 结果集
     value: {

+ 3 - 0
components/dkbase/dk-form-bill/dk-form-bill.wxml

@@ -22,6 +22,9 @@
         <dk-tag wx:if="{{card.expandFlag}}" type="primary" padding="0 20rpx" height="40rpx" color="#9FAEE5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{!card.expand?'展开':'收起'}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
         <!--明细,增加选择商品按钮-->
         <dk-tag wx:if="{{card.name == 'items' && !readonly && chooseVisible && ( card.chooseGoodsFlag == undefined || card.chooseGoodsFlag)}}" type="primary" padding="0 20rpx" height="40rpx" color="#77C5D5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="选商品" catchtap="openChooseItems" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
+        <!-- 自定义tag -->
+        <dk-tag wx:if="{{card.name == 'items' && goodsTagText}}" type="primary" padding="0 20rpx" height="40rpx" color="#77C5D5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{goodsTagText}}"  data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
+
       </view>
     </view>
     <view wx:if="{{card.expandFlag && card.expand || !card.expandFlag}}">

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

@@ -697,6 +697,7 @@ Component({
  * @date   : 2024/1/26 11:46
  */
     onChange(e) {
+      console.log("onChange", e);
       // 只读
       if (this.data.readonly) {
         return;
@@ -709,6 +710,7 @@ Component({
         value: JSON.stringify(form),
         form: form
       })
+      this.triggerEvent("onCheckChange", { data: form, })
     },
     /**
      * @desc   : 清空输入框的值

+ 1 - 1
components/dkbase/dk-form-more-items/dk-form-more-items.wxml

@@ -110,7 +110,7 @@
       <!--核销-->
       <van-field wx:if="{{item.type=='cancel'}}" input-width="200rpx" input-class="dk-cell-nomal-class" label-class="nomal-label" input-align="left" value="{{ item.title?item.title:$t[item.code] }}{{item.bill?(' 已选' + item.bill + '单,共' + item.amount + '元'):''}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
         <view slot="inputbefor" class="cancel-class" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" catchtap="onChange">
-          <van-checkbox shape="round" value="{{form[item.code]}}" />
+          <van-checkbox shape="round" value="{{form[item.code]}}" /> 
         </view>
       </van-field>
       <!--客户地址-->

+ 14 - 4
i18n/zh-CN.js

@@ -250,8 +250,21 @@ const saleOrder = {
 
   delivery_Time: '送货日期',
   orderNo: '单号',
+  saleOrderNo: '订单单号',
   adddress: '地址',
   contractNumber: '合同号',
+  priceSale: '销售价格',
+  saleReturn: '销售退货',
+  flgGift: '赠品标识',
+  makeOrder: '成交订单',
+  saleOutBoundFlag: '开单并出库办理',
+  saleCollection: '需收款',
+  customerInformation: '客户信息',
+  printedBill: '打印票据',
+  totalReturn: '退货总额',
+  outOfStorage: '出库中',
+  handleWithdrawal: '办理撤回',
+  saleOutBoundInfo: '取消自动出库办理,需要在“出库办理”功能进行手工出货办理。',
 }
 //资金管理
 const accountsManage = {
@@ -401,9 +414,6 @@ const fund = {
   editFundAccount: "编辑资金账户",
 }
 const pur = {
-  inStorage : "入库中",
-  received : "已入库",
-  saleOrderNo : "订单编号",
   purInfo : "采购信息",     
   inStorage : "入库中",
   received : "已入库",
@@ -425,7 +435,7 @@ const pur = {
   purchaseReturnReversal : "采购退货冲正",
   reverseAndReopen : "冲正重开",
   purchaseCancellation : "采购作废",
-  staging : "采购作废",
+  staging : "暂存",
   deal : "成交",
   sumTotalAmount : "共计金额",
   receivingDate : "收货日期",

+ 1 - 1
package-accounts-manage/pages/other-receipt/add/add.wxml

@@ -9,4 +9,4 @@
 <view style="height: 220rpx;"></view>
 
 <!-- 新建按钮 -->
-<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="save"></dk-save-button>
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="open"></dk-save-button>

+ 116 - 40
package-accounts-manage/pages/receipt/add/add.js

@@ -43,11 +43,11 @@ Page({
 
       ],
       bill: [
-        { code: 'cancelAmount', type: 'cancel', title: '核销应收', bill: 3, amount: 500 },
-        { code: 'receivableWaive', type: 'number', title: '待核销金额', readonly: true, },
+        { code: 'cancelAmount', type: 'cancel', title: '核销应收', bill: 4, amount: 500 },
+        { code: 'receivableResidue', type: 'number', title: '待核销金额', readonly: true, },
         { code: 'receiptResidue', type: 'number', title: '使用预存', },
         { code: 'sumWaiveAmt', type: 'number', title: '优惠金额', },
-        { code: 'currentReceivableWaive', type: 'number', title: '本次核销', required: true },
+        { code: 'currentReceivableResidue', type: 'number', title: '本次核销', required: true },
       ],
       file: [{
         code: 'remarks', type: 'textarea', title: '备注'
@@ -71,6 +71,10 @@ Page({
     btnFormData: null,
     routeObjName: 'receiptPayment',
     accountService: app.globalData['accountService'],
+    receivableResidue: 0,
+    receiptResidue: 0,
+    bill: 0,
+    objInfo: {},
   },
 
   /**
@@ -82,6 +86,7 @@ Page({
     console.log("chooseData", e, this.data.formData);
     let formData = JSON.parse(this.data.formData)
     let cardList_ = this.data.cardList
+    let contentObj = this.data.contentObj
     let code = e.detail.code
     let data = e.detail.data.data
     if (code == "supId") { //供应商
@@ -96,12 +101,16 @@ Page({
       formData.orgId = data.id
       formData.orgName = data.name
     }
-    if (code == "bill") { //选取应收的返回值
-      formData.orgId = data.id
-      formData.orgName = data.name
+    if (code == "bill") { //选取应收的返回值     
+      _this.setData({
+        objInfo: data.objInfo,
+        receivableResidue: data.receivableResidue,
+        receiptResidue: data.receiptResidue,
+        bill: data.itemLists.length,
+      })
+      this.setForm(formData, contentObj, data.receivableResidue, data.receiptResidue, data.itemLists.length)
+      return
     }
-
-
     this.setData({
       cardList: cardList_,
       formData: JSON.stringify(formData)
@@ -114,39 +123,73 @@ Page({
    * @author : 姜永辉
    */
   chooseObjTypeData(e) {
+    let _this = this
     console.log("chooseObjTypeData", e, this.data.formData);
     let formData = JSON.parse(this.data.formData)
+    let contentObj = this.data.contentObj
     let objInfo = e.detail.data.objInfo
     let cusId = e.detail.data.cusId
     let params = {
-      objectId: cusId
+      objectId: cusId,
+      accItemType: '账款类型-应收',
+      amtResidueFlg: true,
     }
-    this.excute(this.data.accountService, this.data.service.getReceivableAccountItem, params).then(res => {
-      console.log("chooseObjTypeData-res", res);
-      this.setData({
-        objectItem: res.data.data
+    this.excute(this.data.accountService, this.data.accountService.getReceivableAccountItemCount, params).then(res => {
+      formData.cancelAmount = true
+      _this.setForm(formData, contentObj, objInfo.receivableResidue,
+        objInfo.receiptResidue, res.data.data)
+      _this.setData({
+        objInfo,
+        receivableResidue: objInfo.receivableResidue,
+        receiptResidue: objInfo.receiptResidue,
+        bill: res.data.data
       })
+
     })
+  },
 
+  /**
+ * @desc : 设置表单的数据
+ * @date : 2024/2/1 15:49
+ * @author : 姜永辉
+ */
+  onCheckChange(e) {
+    let cancelAmount = e.detail.data.cancelAmount
+    let formData = JSON.parse(this.data.formData)
+    let contentObj = this.data.contentObj
+    if (cancelAmount) {
+      this.setForm(formData, contentObj, this.data.receivableResidue, this.data.receiptResidue, this.data.bill)
+    } else {
+
+      this.setForm(formData, contentObj, 0, 0, 0)
+    }
   },
 
   /**
-   * @desc : 保存数据服务--校验
+   * @desc : 设置表单的数据
    * @date : 2024/2/1 15:49
    * @author : 姜永辉
    */
-  validData() {
-    let formData = JSON.parse(this.data.formData)
-    if (formData.goodsList == null || formData.goodsList.length == 0) {
-      wx.showToast({
-        title: mixins.$t("chooseGoodsInfo"),
-        icon: 'none'
-      })
-      return false
-    }
-    return true
+  setForm(formData, contentObj, receivableResidue, receiptResidue, bill) {
+    formData.receivableResidue = receivableResidue  // 总剩余应收
+    formData.currentReceivableResidue = receivableResidue  // 总剩余应收
+    formData.sumAmount = receivableResidue  // 总剩余应收
+    formData.receiptResidue = receiptResidue  // 预存 
+    contentObj['bill'].forEach(itcard => {
+      if (itcard.code === 'cancelAmount') {
+        //单数和金额
+        itcard.bill = bill
+        itcard.amount = receivableResidue //总应收
+      }
+    })
+    this.setData({
+      contentObj,
+      formData: JSON.stringify(formData)
+    })
   },
 
+   
+
   /**
    * @desc : 保存的參數設置
    * @date : 2024/2/1 15:49
@@ -161,22 +204,22 @@ Page({
     params.orgId = formData.orgId  //组织部门
     params.staffId = formData.staffId  // 员工
     //  // 供应商1 客户2 所有 传空
-    if (formData.objType == 1) {
-      params.supId = formData.outObject  // 供应商
-    }
-    if (formData.objType == 2) {
-      params.cusId = formData.outObject  // 客户
-    }
-    // params.whId = formData.whId  // 仓库
+    params.objectId = this.data.objInfo.cusId  // 客户
+    // 收款金额					
+    params.sumAmtRec = 0
+    // 合计应收冲抵金额								
+    params.sumAmtReceivableHandle = formData.sumAmount
+    // 合计优惠金额
+    params.sumWaiveAmt = 0
+    params.annexPaths = {}
+    // params.biznisType = null
+    // params.biznisId	 = null
+    // params.biznisNo	= null	 
+    params.accDate = formData.accDate  // 
     params.remarks = formData.remarks  // 备注
     params.makeStaff = app.globalData.user.staffId  // 制单人
-    // 明细的顺序
-    let i = 0
-    formData.goodsList.forEach(it => {
-      it.itemIndex = (i++)
-    })
-    params.itemList = formData.goodsList //商品明细
-    console.log("setParams", params);
+ 
+    params.itemList = [] //明细 
     return params
   },
 
@@ -185,8 +228,41 @@ Page({
   * @date : 2024/2/1 15:49
   * @author : 姜永辉
   */
-  saveData() {
-    return this.excute(this.data.service, this.data.service.save, this.data.params)
+  saveData() {   
+    let formData = JSON.parse(this.data.formData)
+
+    if (formData.currentReceivableResidue == 0) {
+      return this.excute(this.data.service, this.data.service.insertReceivableReceipt, this.data.params)
+    } else {
+      this.open()
+    }
+    
   },
 
+
+  /**
+  * @desc : 保存数据服务-跳转收款页面
+  * @date : 2024/2/1 15:49
+  * @author : 姜永辉
+  */
+  open(e) {
+    let _this = this
+    wx.navigateTo({
+      url: '/package-base-select/pages/select-collection_confirm/select-collection_confirm',
+      events: {
+        // 回调后
+        bindData: function (data) {
+          // 保存成功后 回调
+          wx.navigateBack({
+            data: 1
+          })
+        }
+      },
+      success: function (res) {
+        // 通过eventChannel向被打开页面传送数据 
+        res.eventChannel.emit('params', { item: _this.data.formData,  formType: 1 })
+      }
+    })
+  }
+
 })

+ 4 - 2
package-accounts-manage/pages/receipt/add/add.wxml

@@ -3,10 +3,12 @@
 
 <loading wx:if="{{loading}}"></loading>
 
-<dk-form-more-items id="{{formName}}" routeObjName="{{routeObjName}}" objCol="customerId" objLabel="客户名称" objType="customer"  cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData" bind:chooseObjTypeData="chooseObjTypeData" >
+<dk-form-more-items id="{{formName}}" routeObjName="{{routeObjName}}" objCol="customerId" objLabel="客户名称" objType="customer"  cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData" bind:chooseObjTypeData="chooseObjTypeData" 
+bind:onCheckChange="onCheckChange" 
+>
 </dk-form-more-items>
 
 <view style="height: 220rpx;"></view>
 
 <!-- 新建按钮 -->
-<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="save"></dk-save-button>
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="open"></dk-save-button>

+ 9 - 9
package-base-select/pages/select-bill/select-bill.js

@@ -15,9 +15,9 @@ Page({
    * 页面的初始数据
    */
   data: {
-    returnTotalAmount: 0,
+    totalAmount: 0,
     allChecked: false,
-    objectItem: {},
+    objInfo: {},
 
     tableData: [
       {
@@ -318,7 +318,7 @@ Page({
     this.excute(this.data.service, this.data.service.getAccount + this.data.item.cusId, null).then(res => {
       console.log("loadInit", res);
       this.setData({
-        objectItem: res.data.data
+        objInfo: res.data.data
       })
 
     })
@@ -383,15 +383,15 @@ Page({
     */
   calculateTotal() {
     let tableData = this.data.tableData
-    let returnTotalAmount = Number(0)
+    let totalAmount = Number(0)
     //过滤出已选数据
     tableData.forEach(item => {
       if (item.checked) {
-        returnTotalAmount += Number(item.amtResidue)
+        totalAmount += Number(item.amtResidue)
       }
     })
     this.setData({
-      returnTotalAmount: returnTotalAmount.toFixed(2),
+      totalAmount: totalAmount.toFixed(2),
     })
   },
   /**
@@ -416,9 +416,9 @@ Page({
     eventChannel.emit('bindData', {
       data: {
         itemLists: itemLists,
-        receivableWaive: that.data.returnTotalAmount,
-        currentReceivableWaive: that.data.returnTotalAmount,
-        receiptResidue: that.data.objectItem.receiptResidue, //剩余预存
+        objInfo: that.data.objInfo,
+        receivableResidue: that.data.totalAmount,
+        receiptResidue: that.data.objInfo.receiptResidue, //剩余预存
       }
     })
     wx.navigateBack({

+ 189 - 1276
package-base-select/pages/select-collection_confirm/select-collection_confirm.js

@@ -7,285 +7,168 @@
  *		作者				日期					版本				修改内容
  *		jyh		     2022-5-25		        1.00		   	    新建
  *******************************************************************************/
-const api = require('@/utils/api');
 const app = getApp()
 const Constants = require('@/utils/Constants');
-const util = require('@/utils/util.js')
-const config = require('@/config/config.js');
-import Dialog from '@/dist/dialog/dialog.js'; 
-Page({
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        active: 0,
-        activeNames: [
-          "1"
-        ],
-        annexPaths: [],
-        btnTitle: "收款成交",
-        dealFalg: "true",
-        disabledSave: true,
-        fileList: [],
-        form: {
-          balanceAmount: 0,
-          customer: {
-            addressFull: "辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1",
-            addressName: "沈阳市浑南区人民政府(新聪街西)",
-            bankAccount: "",
-            customerName: "ZHANGZAHNG",
-            customerPhone: "13512341234"
-          },
-          fileList: [],
-          order: {},
-          orderDetail: [],
-          orderId: "",
-          orgCode: "",
-          receivable: 0,
-          remarks: "",
-          staffCode: "",
-          sumAmount: "99990"
+const util = require('@/utils/util');
+const mixins = require('@/mixins/index.js')
+mixins: [mixins],
+    Page({
+        mixins: [mixins],
+        /**
+         * 页面的初始数据
+         */
+        data: {
+            annexPaths: [],
+            dealFalg: "true",
+            disabledSave: true,
+            fileList: [],
+
+            guId: "474fd125-7b97-4c30-88f2-5dd731fd111b",
+            page: "orderBillingAdd",
+            pageIndex: "undefined",
+            routeObjName: 'receiptPayment',
+            moneyAccountService: app.globalData['moneyAccountService'],
         },
-        guId: "474fd125-7b97-4c30-88f2-5dd731fd111b",
-        guid: "",
-        page: "orderBillingAdd",
-        pageIndex: "undefined",
-        settlementTypeFlag: true,
-        settlementTypeList: [
-            {
-                accountType: "收款账户类型-现金",
-                accountname: "现金",
-                addressFull: null,
-                ascpId: null,
-                categoryCode: null,
-                categoryId: null,
-                categoryName: null,
-                channelId: null,
-                checked: true,
-                code: null,
-                contactName: null,
-                deliveryPhone: null,
-                cpId: null,
-                customerPhone: null,
-                defSettlementType: 516,
-                defWhId: null,
-                erpOrgCode: null,
-                erpStaffCode: null,
-                flgStore: false,
-                flgValid: null,
-                id: null,
-                imageReceiptCode: null,
-                imageReceiptCode_ping: "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/null",
-                jobId: 0,
-                keyWords: null,
-                name: null,
-                objCode: null,
-                objId: null,
-                objName: null,
-                objType: null,
-                objTypeName: null,
-                orgAscpId: null,
-                orgAscpName: null,
-                orgCode: null,
-                orgId: null,
-                orgName: null,
-                orgSale2Id: null,
-                orgSale2Name: null,
-                orgSalesChannel: null,
-                orgSalesChannelName: null,
-                parentId: null,
-                phone: null,
-                postId: null,
-                postName: null,
-                qvUserid: null,
-                remarks: null,
-                sale1Id: null,
-                sale2Id: null,
-                salesChannel: null,
-                salesChannelName: null,
-                sumAmount: "70000",
-                toiletsNum: null,
-                typeId: 516,
-                typeName: "无库无ERP00001",
-                whId: null,
-                whName: null
-            },
-            {
-                accountType: "收款账户类型-现金",
-                accountname: "现金",
-                addressFull: null,
-                ascpId: null,
-                categoryCode: null,
-                categoryId: null,
-                categoryName: null,
-                channelId: null,
-                code: null,
-                contactName: null,
-                deliveryPhone: null,
-                cpId: null,
-                customerPhone: null,
-                defSettlementType: 516,
-                defWhId: null,
-                erpOrgCode: null,
-                erpStaffCode: null,
-                flgStore: false,
-                flgValid: null,
-                id: null,
-                imageReceiptCode: null,
-                imageReceiptCode_ping: "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/null",
-                jobId: 0,
-                keyWords: null,
-                name: null,
-                objCode: null,
-                objId: null,
-                objName: null,
-                objType: null,
-                objTypeName: null,
-                orgAscpId: null,
-                orgAscpName: null,
-                orgCode: null,
-                orgId: null,
-                orgName: null,
-                orgSale2Id: null,
-                orgSale2Name: null,
-                orgSalesChannel: null,
-                orgSalesChannelName: null,
-                parentId: null,
-                phone: null,
-                postId: null,
-                postName: null,
-                qvUserid: null,
-                remarks: null,
-                sale1Id: null,
-                sale2Id: null,
-                salesChannel: null,
-                salesChannelName: null,
-                sumAmount: 0,
-                toiletsNum: null,
-                typeId: 548,
-                typeName: "无库无ERP00002",
-                whId: null,
-                whName: null
-            }
-        ]    
-      
-      },
-
 
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-      
-    },
+        /**
+        * @desc : 设置查询参数
+        * @date : 2024年3月8日
+        * @author : 姜永辉
+        */
+        setSearchParams(params) {
+            return params;
+        },
 
-    /**
-     * 显示放大图片
-     * @param {*} e 
-     */
-    previewImg: function (e) {
-        let imgs = [e.currentTarget.dataset.imgurl]
-        wx.previewImage({
-            urls: imgs,
-            current: e.currentTarget.dataset.imgurl, //当前图片地址
-            success: function (res) { },
-            fail: function (res) { },
-            complete: function (res) { },
-        })
-    },
+        /** 
+         * @desc : 查询 入库单
+         * @date : 2024年3月8日
+         * @author : 姜永辉
+         */
+        getData(params) {
+            return this.excute(this.data.moneyAccountService, this.data.moneyAccountService.selectByCond, params);
+        },
 
-    /**
-     *得到初始化数据
-     */
-    getinitdata(orgId) {
-        let param = { 
-        }
-        //按单据的部门获取默认结算方式
-        if (this.data.page == 'orderBillingAdd' || this.data.page == 'orderBilling') {
-            param.orgId = this.data.typeForm.orgId
-        }
+        /**
+         * @desc :   处理接口返回数据
+         * @date : 2024年3月8日
+         * @author : 姜永辉
+         */
+        handleSearchData(tableData) {
+            let formData = JSON.parse(this.data.item)
 
+            this.setData({
+                formData: this.data.item,
+                form: formData,
+            })
+        },
 
 
+        /**
+         * @desc : 保存数据服务--校验
+         * @date : 2024/2/1 15:49
+         * @author : 姜永辉
+         */
+        validData() {
+            let msgError = null
+           
+            // 请选择支付方式
+            if (this.data.settlementTypeListLength == null || this.data.settlementTypeListLength == 0) {
+                msgError = '请选择支付方式'
+            } 
+            let sumAmount = Number(0)
+            this.data.tableData.forEach(item => {
+                if (item.checked && item.balance < item.sumAmount) { 
+                    sumAmount += Number(item.sumAmount)
+                }
+            })            
+
+            if (msgError != null) {
+                wx.showToast({
+                    title: msgError,
+                    icon: 'none'
+                })
+                return false
+            }
+            if (sumAmount != form.sumAmount) {
+                wx.showToast({
+                    title: '输入收款金额不正确',
+                    icon: 'none'
+                })
+                return false
+            }
 
-        api.request(Constants.BASIC_COMMON_API + 'select_settlement_by_org', 'POST', param).then(res => {
-            if (res.data.code === 200) {
-                let list = res.data.data
-                if (list && list.length > 0) {
-                    list.forEach(element => {
-                        element.sumAmount = 0
-                        if (element.typeId == element.defSettlementType) { //根据组织机构中得默认结算方式id 勾选出默认得
-                            element.checked = true
-                            element.sumAmount = this.data.form.sumAmount
-                        }
-                        element.typeName = element.typeName ? element.typeName : ''
-                        element.typeId = element.typeId ? element.typeId : null
-                        element.imageReceiptCode_ping = config.server_img_http + element.imageReceiptCode
-                    });
-                    list.forEach(res => {
-                        if (res.accountType) {
-                            let accountTypeList = res.accountType.split('-')
-                            res.accountname = accountTypeList[1]
-                        }
+            return true
+        },
 
-                    })
-                } else {
-                    //没有结算方式 设置变量 点击收款按钮返回 提示:当前没有结算方式
-                    this.setData({
-                        settlementTypeFlag: false
-                    })
-                }
+        /**
+         * @desc : 保存的參數設置
+         * @date : 2024/2/1 15:49
+         * @author : 姜永辉
+         */
+        setParams(params) { 
+            let form = this.data.form
+            //收付款类型-收款的查询参数
+            params.rpType = Constants.rpType.receipt
+            params.orgId = form.orgId  //组织部门
+            params.staffId = form.staffId  // 员工
+            //  // 供应商1 客户2 所有 传空
+            params.objectId = this.data.objInfo.cusId  // 客户
+            // 收款金额					
+            params.sumAmtRec = 0
+            // 合计应收冲抵金额								
+            params.sumAmtReceivableHandle = form.sumAmount
+            // 合计优惠金额
+            params.sumWaiveAmt = 0
+            params.annexPaths = {}
+            params.accDate = form.accDate  // 
+            params.remarks = form.remarks  // 备注
+            params.makeStaff = app.globalData.user.staffId  // 制单人
+            params.itemList = [] //明细 
+            return params
+        },
 
-                this.setData({
-                    settlementTypeList: list
-                })
-            }
-        })
-    },
+        /**
+        * @desc : 收款保存
+        * @date : 2024/2/1 15:49
+        * @author : 姜永辉
+        */
+        saveData() {
+            return this.excute(this.data.service, this.data.service.insertReceivableReceipt, this.data.params)
+        },
 
-    /**
-     * @desc : checkbox点击事件 
-     * @date : 2022/5/23 15:16
-     */
-    catchtapCheck(e) {
-        let item = e.currentTarget.dataset.item
-        let list = this.data.settlementTypeList
-        let form = this.data.form
-        let index = e.target.dataset.index
+        /**
+         * 显示放大图片
+         * @param {*} e 
+         */
+        previewImg: function (e) {
+            let imgs = [e.currentTarget.dataset.imgurl]
+            wx.previewImage({
+                urls: imgs,
+                current: e.currentTarget.dataset.imgurl, //当前图片地址
+                success: function (res) { },
+                fail: function (res) { },
+                complete: function (res) { },
+            })
+        },
 
 
-        if (list && list.length > 0) {
-            if (this.data.type == 0 || this.data.type == 4 || this.data.type == 3 || (this.data.page == 'orderBilling' && this.data.type == 1)) {
-                //客户收款结算方式单选
-                list.forEach(item => {
-                    item.checked = false
-                })
-                list.forEach(res => {
-                    if (res.typeId === item.typeId) {
-                        res.checked = !res.checked
-                    }
-                })
-                let settlementTypeListLength = list.filter(item => {
-                    return item.checked
-                })
-                if (settlementTypeListLength.length == 1) {
-                    list.forEach(res => {
-                        if (res.checked) {
-                            res.sumAmount = form.sumAmount
-                        }
-                    })
-                }
-                this.setData({
-                    settlementTypeList: list,
-                    settlementTypeListLength: settlementTypeListLength.length //已选数量
-                })
-            } else {
+        /**
+         * @desc : checkbox点击事件 
+         * @date : 2022/5/23 15:16
+         */
+        catchtapCheck(e) {
+            let item = e.currentTarget.dataset.item
+            let list = this.data.tableData
+            let form = this.data.form
+            let index = e.target.dataset.index
+            if (list && list.length > 0) {
+                // formType :1 收款单 ,2 付款单,
                 //客户收款结算方式多选
                 if (list[index].checked) {
                     list[index].sumAmount = Number(0)
                 }
                 list.forEach(res => {
-                    if (res.typeId === item.typeId) {
+                    if (res.macId === item.macId) {
                         res.checked = !res.checked
                     }
                 })
@@ -297,1045 +180,75 @@ Page({
                 if (settlementTypeListLength.length == 1) {
                     list.forEach(res => {
                         if (res.checked) {
-                            res.sumAmount = form.sumAmount
+                            res.sumAmount = form.receivableResidue
                         }
                     })
                 }
-                let sumAmountFlag = true
-                if (settlementTypeListLength.length == 0) {
-                    form.sumAmount = form.sumTempAmount
-                    sumAmountFlag = false
-                    this.setData({
-                        sumAmountFlag: false
-                    })
-
-                } else {
-                    sumAmountFlag = true
-                    this.setData({
-                        sumAmountFlag: true
-                    })
-                }
-
+                console.log(list);
                 this.setData({
-                    form: form,
-                    settlementTypeList: list,
+                    tableData: list,
                     settlementTypeListLength: settlementTypeListLength.length //已选数量
                 })
-                if (sumAmountFlag) {
-                    this.getSumAmount(list)
-                }
 
             }
-        }
-    },
-
-
-    /**
-     * 结算方式金额输入事件
-     * @param {*} e 
-     */
-    sumAmountBindValue(e) {
+        },
 
-        let settlementTypeList = this.data.settlementTypeList
-        let value = e.detail.value ? Number(e.detail.value) : 0
-        let index = e.currentTarget.dataset.index
-        settlementTypeList[index].sumAmount = value
-        this.setData({
-            settlementTypeList: settlementTypeList
-        })
-        this.getSumAmount(settlementTypeList)
-    },
 
-    getSumAmount(settlementTypeList) {
-        let form = this.data.form
-        let sumAmountTemp = Number(0)
-        if (settlementTypeList && settlementTypeList.length > 0) {
-            settlementTypeList.forEach(res => {
-                if (res.checked) {
-                    sumAmountTemp = util.AddNumber(sumAmountTemp, res.sumAmount ? res.sumAmount : 0)
-                }
-            })
-            form.sumAmount = sumAmountTemp
+        /**
+         * 结算方式金额输入事件
+         * @param {*} e 
+         */
+        sumAmountBindValue(e) {
+            let tableData = this.data.tableData
+            let value = e.detail.value ? Number(e.detail.value) : 0
+            let index = e.currentTarget.dataset.index
+            tableData[index].sumAmount = value
             this.setData({
-                form: form
+                tableData: tableData
             })
-        }
-
-    },
-
-    /**
-     * @desc : 销售价格编辑
-     * @author : 常皓宁
-     * @date : 2022/5/31 14:45
-     */
-    changeSalesPriceField(e) {
-        let form = this.data.form
-        form.sumAmount = e.detail.value;
-        let settlementTypeList = this.data.settlementTypeList
-        if (settlementTypeList && settlementTypeList.length > 0) {
-            settlementTypeList.forEach(res => {
-                if (res.checked) {
-                    res.sumAmount = Number(e.detail.value ? e.detail.value : 0);
-                }
-            })
-        }
-
-        this.setData({
-            settlementTypeList: settlementTypeList,
-            form
-        })
-    },
-
-
-    /**
-     * @desc : checkbox点击事件 
-     * @date : 2022/5/23 15:16
-     */
-    onChangeFlag(e) {
-        let item = e.currentTarget.dataset.item
-        let list = this.data.settlementTypeList
-        list.forEach(res => {
-            if (res.settlementTypeId === item.settlementTypeId) {
-                res.checked = true
-            } else {
-                res.checked = false
-            }
-        })
-        this.setData({
-            settlementTypeList: list
-        })
-    },
-
-    /**
-     * @desc : 手风琴展开事件
-     * @author : 于继渤
-     * @date : 2022/5/26 12:16
-     */
-    onChange(event) {
-        this.setData({
-            activeNames: event.detail,
-        });
-    },
-    
-    /* 客户收款-表单校验 */
-    checkForm() {
-        let form = this.data.form
-        if (!form.staffID) {
-            return {
-                flag: false,
-                msg: '请选择业务员'
-            };
-        }
-        if (!form.orgID) {
-            return {
-                flag: false,
-                msg: '请选择业务部门'
-            };
-        }
-        if (!form.salesChannelID) {
-            return {
-                flag: false,
-                msg: '请选择销售渠道'
-            };
-        }
-        if (!form.customer.customerId) {
-            return {
-                flag: false,
-                msg: '请选择客户'
-            };
-        }
-
-        return {
-            flag: true,
-            msg: '表单校验通过'
-        }
-    },
-
-    /**
-     * 收款保存
-     * @param {*} e 
-     */
-    btnOK(e) {
-        if (this.data.type == '0') {
-            if (this.data.form.sumAmount < 0) {
-                Dialog.confirm({
-                    title: '提示信息',
-                    showCancelButton: false,
-                    message: '收款不能为负数,如需退款请使用退款申请',
-                })
-                return
-            }
-        }
-        if (this.data.page == 'orderBilling' && (this.data.type == '1' || this.data.type == '0')) {
-            if (this.data.form.sumAmount < 0) {
-                Dialog.confirm({
-                    title: '提示信息',
-                    showCancelButton: false,
-                    message: '收款不能为负数,如需退款请使用退款申请',
-                })
-                return
-            }
+        },
 
-        }
-        this.setData({
-            loadingButtonFlag: true
-        })
-        if (this.data.settlementTypeList && this.data.settlementTypeList.length == 0) {
-            wx.showToast({
-                title: '当前没有结算方式',
-                icon: 'none',
-                duration: 1000
-            })
-            this.setData({
-                loadingButtonFlag: false
-            })
-            return
-        }
-        let settlementTypeListTempLength = this.data.settlementTypeList.filter(item => {
-            return item.checked
-        })
-        if (settlementTypeListTempLength.length == 0) {
-            wx.showToast({
-                title: '请选择结算方式',
-                icon: 'none',
-                duration: 1000
-            })
-            this.setData({
-                loadingButtonFlag: false
-            })
-            return
-        }
-        if (!this.data.sumAmountFlag) {
-            wx.showToast({
-                title: '当前没有结算方式',
-                icon: 'none',
-                duration: 1000
-            })
-            this.setData({
-                loadingButtonFlag: false
-            })
-            return
-        }
-        //没有结算方式 设置变量 点击收款按钮返回 提示:当前没有结算方式
-        if (!this.data.settlementTypeFlag) {
-            wx.showToast({
-                title: '当前没有结算方式',
-                icon: 'none',
-                duration: 1000
-            })
-            this.setData({
-                loadingButtonFlag: false
-            })
-            return
-        }
-        //表单提交分支
-        // 0: 无订单的客户收款  1:订单收款 2 退换补收款 3 销售退货收款 4 客户退款
-        if (this.data.type == 0) {
-            let result = this.checkForm();
-            if (!result.flag) {
-                wx.showToast({
-                    title: result.msg,
-                    image: '/static/image/warning.png',
-                    duration: 1000
-                })
-                this.setData({
-                    loadingButtonFlag: false
-                })
-                return
-            }
-            let settlementTypeList = this.data.settlementTypeList
-            let settlementTypeID = ''
-            let settlementTypeName = ''
-            settlementTypeList.forEach(element => {
-                if (element.checked) {
-                    settlementTypeID = element.typeId
-                    settlementTypeName = element.typeName
-                }
-            });
-            if (settlementTypeID == '') {
-                wx.showToast({
-                    title: "请选择收款方式",
-                    image: '/static/image/warning.png',
-                    duration: 1000
-                })
-                this.setData({
-                    loadingButtonFlag: false
-                })
-                return
-            }
-            this.setData({
-                loading: true,
-                loadingButtonFlag: true
-            })
+        /**
+         * @desc : 销售价格编辑
+         * @author : 姜永辉
+         * @date : 2022/5/31 14:45
+         */
+        changeSalesPriceField(e) {
             let form = this.data.form
-
-            let param = {}
-            let fileList_ = this.data.fileList
-            let fileList = []
-            fileList_.forEach(item => {
-                fileList.push(
-                    {
-                        url: item.FilePath,
-                        type: 'image',
-                        name: '',
-                        createTime: util.formatDataTime(new Date())
-                    })
-            })
-            param.annexPaths = fileList
-
-            // 跟进附件 20220613
-            if (form.editTime) {
-                param.editTime = form.editTime
-            }
-            param.staffId = Number(form.staffID) // 业务员
-            param.orgId = Number(form.orgID) // 业务部门
-            param.salesChannel = Number(form.salesChannelID) // 渠道
-            param.customerId = form.customer.customerId //客户
-            //收款 
-            if (form.customerForm && form.customerForm.deliveryPhone && (form.customerForm.deliveryPhone.indexOf(',') != -1 || form.customerForm.deliveryPhone instanceof Array)) {
-                param.deliveryPhone = form.customerForm.deliveryPhone ? form.customerForm.deliveryPhone.join(",") : null
-            }
-            param.settlementType = settlementTypeID //结算方式
-            param.sumAmount = form.sumAmount
-            param.receiptDirection = 1
-            param.docCode = "客户收款"
-            param.ascpId = app.globalData.user.ascpId
-            param.sale1Id = app.globalData.user.sale1Id
-            param.userCode = app.globalData.user.userCode
-            param.makingUser = app.globalData.user.userId
-            param.makingTime = util.formatDataTime(new Date())
-            param.userName = app.globalData.user.userName
-            param.balanceAmount = form.receivable ? ((form.sumAmount - form.receivable) > 0 ? (form.sumAmount - form.receivable) : 0) : form.sumAmount
-            //如果关联了订单  剩余可用(可用余额) =  本次收款-应收 
-            param.sumRefundAmount = 0 //使用额
-            param.cpId = app.globalData.user.cpId,
-                param.orderId = form.orderId
-            let SAVE_API = 'insert'
-            //判断是否关联了订单 关联走下面的接口
-            if (param.orderId) {
-                SAVE_API = 'insert_deposit'
-            }
-            //2023/11/06 于继渤  微信小程序 收款网络异常重复提交问题
-            param.wxGuId = this.data.guId
-            // iboss用到的参数 下面
-            param.addressFull = form.addressFull //详细地址
-            param.salesChannelName = form.salesChannelName //渠道
-            param.organizationCode = form.orgCode //组织结构编码
-            param.staffCode = form.staffCode //业务员编码
-            param.settlementTypeName = settlementTypeName //结算方式
-            param.decisionMakerName = form.customer.decisionMakerName  //决策者
-            param.decorationStyleName = form.customer.fitupStyleName  //风格
-            param.customerAgeGroupName = form.customer.ageCompositionName  //年龄 (80后)
-            param.homeHouseTypeName = form.customer.houseTypeName //房屋类型    
-            param.customerCode = form.customer.customerCode //客户编码
-            param.customerName = form.customer.customerName
-            param.customerTelephone = form.customer.customerCode //客户编码
-            param.customerFromName = form.customer.customerFromName
-            param.remarks = form.remarks ? form.remarks : ''
-            param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
-            // 用户erpUserCode20220820
-            param.erpUserCode = app.globalData.user.erpUserCode//iboss用户
-
-            if (!param.remarks) {
-                param.remarks = ''
-            }
-            if (!param.annexPaths || param.annexPaths.length == 0) {
-                param.annexPaths = []
-            }
-            api.request(Constants.ORDER_RECEIPT_PC_API + SAVE_API, 'POST', param).then(res => {
-                this.setData({
-                    loading: false
-                })
-                if (res.data.code === 200) {
-                    wx.showToast({
-                        title: '保存成功',
-                        image: '/static/image/success.png',
-                        duration: 1000
-                    })
-                    var pages = getCurrentPages();
-                    var prevPage = pages[pages.length - 2];
-
-                    setTimeout(function () {
-                        wx.navigateBack({
-                            delta: 2
-                        })
-                    }, 1500)
-                } else {
-                    this.setData({
-                        loadingButtonFlag: false
-                    })
-                }
-            })
-        } else if (this.data.type == 1) {
-            //订单收款
-            this.setData({
-                loading: true,
-                loadingButtonFlag: true
-            })
-            let that = this
-            let param = this.data.typeForm
-            if (this.data.page == 'orderBilling' && this.data.form.sumAmount < 0) {
-                param.bankAccount = this.data.form.customer.bankAccount
-            }
-            let settlementTypeList = this.data.settlementTypeList
-            let tempOBJ = {}
-            settlementTypeList.forEach(res => {
-                if (res.checked) {
-                    tempOBJ = res
-                }
-            })
-            param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
-            let tsumAmount = param.sumAmount //合计金额
-            //收款金额 (输入的)
-            let sumAmount = that.data.form.sumAmount
-            if (this.data.page === 'orderBilling') {
-                param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
-                //客户收款 定金 
-                param.receiptVOList = []
-                tsumAmount = param.receivable
-            } else {
-                // 剩余应收=合计金额-收款金额
-                param.receivable = Number(tsumAmount - sumAmount - Number(param.sumUsePrestore ? param.sumUsePrestore : 0)) ? Number(tsumAmount - sumAmount - Number(param.sumUsePrestore ? param.sumUsePrestore : 0)) : 0
-
-            }
-            if (this.data.settlementTypeList && this.data.settlementTypeList.length > 0) {
-                let settlementTypeList = this.data.settlementTypeList.filter(item => {
-                    return item.checked
-                })
-                settlementTypeList.forEach(res => {
-                    if (isNaN(res.sumAmount)) {
-                        res.sumAmount = 0
+            form.sumAmount = e.detail.value;
+            let tableData = this.data.tableData
+            if (tableData && tableData.length > 0) {
+                tableData.forEach(res => {
+                    if (res.checked) {
+                        res.sumAmount = Number(e.detail.value ? e.detail.value : 0);
                     }
-                    let OBJ = {
-                        //结算方式
-                        settlementType: res.typeId,
-                        sumAmount: res.sumAmount ? Number(res.sumAmount) : 0,
-                        settlementTypeName: res.typeName,
-                        typeName: res.typeName,
-                        typeId: res.typeId,
-                    }
-                    if (app.globalData.user.sale1Id) {
-                        OBJ['sale1Id'] = app.globalData.user.sale1Id
-                    }
-                    if (app.globalData.user.sale2Id) {
-                        OBJ['sale2Id'] = app.globalData.user.sale2Id
-                    }
-                    if (app.globalData.user.ascpId) {
-                        OBJ['ascpId'] = app.globalData.user.ascpId
-                    }
-                    if (app.globalData.user.userId) {
-                        OBJ['makingUser'] = app.globalData.user.userId
-                    }
-
-
-
-                    OBJ['makingTime'] = util.formatDataTime(new Date())
-                    let annexPaths = []
-                    // if(this.data.annexPaths && this.data.annexPaths.length > 0){
-                    //     annexPaths.push({
-                    //         url: data.data.relativePath,
-                    //         type: 'image',
-                    //         docType:'客户收款',
-                    //         name: file[file.length - 1],
-                    //         createTime: util.formatDataTime(new Date())
-                    //       })
-                    // }
-                    OBJ['annexPaths'] = this.data.annexPaths
-                    //收款数组
-                    param.receiptVOList.push(OBJ)
                 })
             }
-            let numOne = util.numSub(tsumAmount, Number(param.sumUsePrestoreTemp ? param.sumUsePrestoreTemp : 0))
-            // 收款状态
-            if (Number(sumAmount) == 0 && Number(sumAmount) != Number(numOne)) {
-                //未收款
-                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_UNCOLLECTED;
-            }
-            else if (Number(sumAmount) < Number(numOne)) {
-                //部分收款
-                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_PART;
-            } else if (Number(sumAmount) > Number(numOne)) {
-                //部分收款
-                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_PART;
-            }
-            else {
-                //收款完成
-                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_COMPLETE;
-            }
-            let SAVE_API = 'insert'
-            // //收款成交
-            if (this.data.dealFalg) {
-                //送货日期
-                param.deliveryTime = param.deliveryTime ? param.deliveryTime.replaceAll("/", "-") : util.formatDataTime(new Date())
-                SAVE_API = 'insert'
-            } else {
-                //订单收款,修改总单信息
-                SAVE_API = 'update'
-            }
-            let API = Constants.SALE_ORDER_API
-            if (this.data.page === 'orderBilling') {
-                param.sumReceiptAmount = Number(sumAmount) + Number(param.sumReceiptAmount)
-                param.sumCollectedAmount = Number(sumAmount)
-                param.sumAmount = Number(sumAmount)
-                param.settlementType = tempOBJ.typeId
-                param.settlementTypeName = tempOBJ.typeName,
-                    param.typeName = tempOBJ.typeName
-                param.makingUser = app.globalData.user.userId
-                //2023/11/06 于继渤  微信小程序 收款网络异常重复提交问题
-                param.wxGuId = this.data.guId
-                if (param.editTimeFlag) {
-                    param.editTime = util.formatTime(new Date(param.editTime)).replaceAll('/', '-')
-                } else {
-                    if (param.editTime.indexOf('/') != -1) {
-                        param.editTime = param.editTime.replaceAll('/', '-')
-                    } else {
-                        if (param.editTime.indexOf('T') != -1) {
-                            param.editTime = util.formatDataTime(new Date(param.editTime))
-                        }
-                    }
-
-                }
-                SAVE_API = 'insert_deposit'
-                API = Constants.ORDER_RECEIPT_PC_API
-
-            } else {
-                //2023/11/06 于继渤  微信小程序 收款网络异常重复提交问题
-                param.wxGuId = this.data.guId
-                //收款合计
-                param.sumReceiptAmount = util.AddNumber(Number(sumAmount ? sumAmount : 0), Number(param.sumReceiptAmount))
-                param.sumCollectedAmount = util.AddNumber(Number(param.sumUsePrestore), Number(param.sumReceiptAmount))
-            }
-            if (this.data.form.remarks != '') {
-                param.remarks = this.data.form.remarks
-            }
-            param.tSumGoodsAmount = Number(param.tSumGoodsAmount)
-            if (!param.remarks) {
-                param.remarks = ''
-            }
-            if (!param.annexPaths || param.annexPaths.length == 0) {
-                param.annexPaths = []
-            }
-            if (this.data.noConfirm && this.data.noConfirm == '1') {
-                delete param['sumReceipt']
-            }
-
-
-            this.getNetwork().then(res=>{
-                if (!res) {
-                    that.setData({
-                        loading: false,
-                        disabledSave: false
-                    })
-                    wx.showToast({
-                        title: '网络不可用!',
-                        icon: 'none'
-                    })
-    
-                    return
-                }
-            })
-   
-          
-            // console.log('param', param)
-       
-            api.request(API + SAVE_API, 'POST', param).then(res => {
-                that.setData({
-                    loading: false,
-                })
-                if (res.data.code === 200) {
-                    wx.showToast({
-                        title: '保存成功',
-                        image: '/static/image/success.png',
-                        duration: 1000
-                    })
-                    this.setData({
-                        disabledSave: false,
-                        loadingButtonFlag: true,
-                    })
-
-                    //首页购物车跳转列表页
-                    if (this.data.pageIndex == 'shopping') {
-                        setTimeout(function () {
-                            wx.reLaunch({
-                                url: '/pages/home-page/home-page?pageType=1',
-                            })
-                        }, 1000)
-                        return
-                    }
-                    if (this.data.pageIndex == 'receiveCustomers') {
-
-                        wx.navigateBack({
-                            delta: 4
-                        })
-
-                        return
-
-                    }
-                    var pages = getCurrentPages();
-                    // debugger
-                    if (this.data.page == 'orderBilling' && this.data.dealFalg == 'false') {
-                        //返回一览页面
-                        var prevPage = pages[pages.length - 2];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 1
-                            })
-                        }, 1000)
-                        return
-                    }
-                    if (this.data.page == 'orderBilling' && this.data.dealFalg == 'true') {
-                        //返回一览页面
-                        var prevPage = pages[pages.length - 3];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 2
-                            })
-                        }, 1000)
-                        return
-                    } if (this.data.page == 'orderBillingDeal') {
-                        //返回列表页面
-                        var prevPage = pages[pages.length - 3];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 2
-                            })
-                        }, 1000)
-                        return
-                    } if ((this.data.page == 'orderBillingAdd') && this.data.typeForm.orderId) {
-                        //返回列表页面
-                        var prevPage = pages[pages.length - 5];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 4
-                            })
-                        }, 1000)
-                        return
-                    } if ((this.data.page == 'orderBillingAdd') && this.data.noConfirm) {
-                        //返回列表页面
-                        var prevPage = pages[pages.length - 5];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 4
-                            })
-                        }, 1000)
-                        return
-                    } if ((this.data.page == 'orderBillingAdd') && this.data.noConfirm == '1') {
-                        //返回列表页面
-                        var prevPage = pages[pages.length - 5];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 4
-                            })
-                        }, 1000)
-                        return
-                    } if ((this.data.page == 'orderBillingAdd') && !this.data.typeForm.orderId) {
-                        //返回列表页面
-                        var prevPage = pages[pages.length - 6];
-                        if (prevPage) {
-                            prevPage.setData({
-                                orderAddFlag: true
-                            })
-                        }
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 5
-                            })
-                        }, 1000)
-                        return
-                    } if (this.data.noConfirm == '1' && this.data.page != 'orderBillingAdd') {
-                        //返回一览页面
-                        var prevPage = pages[pages.length - 3];
-                        prevPage.setData({
-                            orderAddFlag: true
-                        })
-                        setTimeout(function () {
-                            wx.navigateBack({
-                                delta: 2
-                            })
-                        }, 1000)
-                    }
-                } else {
-                    this.setData({
-                        loadingButtonFlag: false
-                    })
-                }
-            })
-        } else if (this.data.type == 2) {
-            //退换补
             this.setData({
-                loading: true,
-                loadingButtonFlag: true
-            })
-            let param = this.data.typeForm
-            let settlementTypeList = this.data.settlementTypeList
-            let tempOBJ = {}
-            param.receiptVOList = []
-            settlementTypeList.forEach(res => {
-                if (res.checked) {
-                    tempOBJ = res
-                }
-            })
-            //收款金额 (输入的)
-            let sumAmount = this.data.form.sumAmount
-            //收款数组
-            if (this.data.settlementTypeList && this.data.settlementTypeList.length > 0) {
-                let settlementTypeList = this.data.settlementTypeList.filter(item => {
-                    return item.checked
-                })
-                settlementTypeList.forEach(res => {
-                    let OBJ = {
-                        //结算方式
-                        settlementType: res.typeId,
-                        sumAmount: Number(res.sumAmount),
-                        settlementTypeName: res.typeName,
-                        typeName: res.typeName,
-                        typeId: res.typeId,
-                    }
-                    if (app.globalData.user.sale1Id) {
-                        OBJ['sale1Id'] = app.globalData.user.sale1Id
-                    }
-                    if (app.globalData.user.sale2Id) {
-                        OBJ['sale2Id'] = app.globalData.user.sale2Id
-                    }
-                    if (app.globalData.user.ascpId) {
-                        OBJ['ascpId'] = app.globalData.user.ascpId
-                    }
-                    if (app.globalData.user.userId) {
-                        OBJ['makingUser'] = app.globalData.user.userId
-                    }
-                    OBJ['makingTime'] = util.formatDataTime(new Date())
-                    OBJ['annexPaths'] = this.data.annexPaths
-                    //收款数组
-                    param.receiptVOList.push(OBJ)
-                })
-            }
-
-            let tsumAmount = param.sumAmount //合计金额
-            //服务费用 - 原单服务费用
-            param.sumFeeAmount = Number(param.sumFeeAmount - param.sumFeeAmountTemp)
-            param.cpId = app.globalData.user.cpId
-       
-            param.sumReceiptAmount = sumAmount
-            param.sumCollectedAmount = Number(param.sumReceiptAmount)
-
-            param.sumAmount = Number(sumAmount)
-            let receivableTemp = Number(param.receivable) - Number(sumAmount);
-
-            param.sumUsePrestore = Number(0)
-            param.sumReceiptAmount = Number(param.sumReceiptAmount)
-            param.receivable = Number(receivableTemp)
-            delete param['sumAmount']
-            delete param['tSumBackGoodsAmount']
-            delete param['tSumEndGoodsAmount']
-            delete param['sumReceipt']
-            delete param['usablePrestore']
-
-            delete param['sumAmount']
-            delete param['makingTime']
-            delete param['sumGoodsAmount']
-            delete param['sumOutAmount']
-            delete param['sumPromotion']
-            delete param['sumQuantity']
-            delete param['sumStandard']
-            delete param['sumRejectAmount']
-
-            api.request(Constants.SALE_ORDER_API + 'operation', 'POST', param).then(res => {
-                this.setData({
-                    loading: false
-                })
-                if (res.data.code === 200) {
-                    if (res.data.data.message === '操作成功') {
-                        wx.showToast({
-                            title: '保存成功',
-                            image: '/static/image/success.png',
-                            duration: 1000
-                        })
-                        var pages = getCurrentPages();
-                        var prevPage = pages[pages.length - 3];
-                        prevPage.setData({
-                            orderAddFlag: true
-                        })
-                        setTimeout(function () {
-
-                            wx.navigateBack({
-                                delta: 2
-                            })
-                        }, 1000)
-                    } else {
-                        this.setData({
-                            loadingButtonFlag: false
-                        })
-                        wx.showToast({
-                            title: res.data.data.message,
-                            icon: 'none',
-                            duration: 1500
-                        })
-                    }
-                }
+                tableData: tableData,
+                form
             })
+        },
 
-        } else if (this.data.type == 3) {
-            this.setData({
-                loading: true,
-                loadingButtonFlag: true
-            })
-            let settlementTypeList = this.data.settlementTypeList
-            let receiptVOList = []
-            let form = this.data.form
-            if (settlementTypeList && settlementTypeList.length > 0) {
-                let settlementTypeList = this.data.settlementTypeList.filter(item => {
-                    return item.checked
-                })
-                settlementTypeList.forEach(res => {
-                    let OBJ = {
-                        //结算方式
-                        settlementType: res.typeId,
-                        sumAmount: Number(res.sumAmount),
-                        itemAmount: Number(res.sumAmount),
-                        settlementTypeName: res.typeName,
-                        typeName: res.typeName,
-                        typeId: res.typeId,
-                    }
-                    if (app.globalData.user.sale1Id) {
-                        OBJ['sale1Id'] = app.globalData.user.sale1Id
-                    }
-                    if (app.globalData.user.sale2Id) {
-                        OBJ['sale2Id'] = app.globalData.user.sale2Id
-                    }
-                    if (app.globalData.user.ascpId) {
-                        OBJ['ascpId'] = app.globalData.user.ascpId
-                    }
-                    if (app.globalData.user.userId) {
-                        OBJ['makingUser'] = app.globalData.user.userId
+        /**
+         * 是否有网络 
+         * @param {*} e 
+         */
+        getNetwork() {
+            return new Promise((resolve, reject) => {
+                wx.getNetworkType({
+                    success(res) {
+                        const networkType = res.networkType; if (networkType === 'none') {
+                            console.log('无网络,返回false')
+                            resolve(false)
+                        } else {
+                            console.log('有网络,返回true')
+                            resolve(true)
+                        }
                     }
-                    OBJ['makingTime'] = util.formatDataTime(new Date())
-                    //收款数组
-                    receiptVOList.push(OBJ)
                 })
-            }
-            let sumAmount = this.data.form.sumAmount
-            let param = this.data.typeForm
-            delete param['tdiscountPromotion']
-            delete param['tdiscountStandard']
-            delete param['toiletCount']
-            delete param['toiletCountName']
-            delete param['tsumAmount']
-            delete param['tsumGoodsAmount']
-            delete param['tsumPromotion']
-            delete param['tsumQuantity']
-            delete param['tsumStandard']
-            delete param['merOrderType']
-            delete param['merOrderTypeName']
-            delete param['sumOutAmount']
-            delete param['receiptStatus']
-            delete param['outStatus']
-            param.editTime = param.editTimeTemp
-            param.cpId = app.globalData.user.cpId
-            param.receiptVOList = receiptVOList
-            param.rejectReason = this.data.form.mReasonForReturn  //退货原因
-            param.receivable = Number(param.receivable) - Number(sumAmount)
-            param.refundAccount = this.data.form.mRefundAccountNumber //退款账号
-            param.staffList = []
-            param.orgList = []
-            param.sumCollectedAmount = Number(sumAmount)
-            param.sumAmount = Number(sumAmount)
-            param.sumReceiptAmount = Number(sumAmount)
-            param.orderOutRejectItemVOList = this.data.typeForm.orderOutRejectItemVOList
-            api.request(Constants.ORDER_OUT_REJECT_PC_API + 'insert', 'POST', param).then(res => {
-                this.setData({
-                    loading: false
-                })
-                if (res.data.code === 200) {
-                    wx.showToast({
-                        title: '保存成功',
-                        image: '/static/image/success.png',
-                        duration: 1000
-                    })
-                    this.setData({
-                        disabledSave: false
-                    })
-                    var pages = getCurrentPages();
-                    var prevPage = pages[pages.length - 4];
-                    // prevPage.setData({
-                    //   orderAddFlag: true
-                    // })
-                    setTimeout(function () {
-                        wx.navigateBack({
-                            delta: 3
-                        })
-                    }, 1500)
-                } else {
-                    this.setData({
-                        loadingButtonFlag: false
-                    })
-                }
             })
 
-        } else if (this.data.type == 4) {
-            let result = this.checkForm();
-            if (!result.flag) {
-                wx.showToast({
-                    title: result.msg,
-                    image: '/static/image/warning.png',
-                    duration: 1000
-                })
-                return
-            }
-            let settlementTypeList = this.data.settlementTypeList
-            let settlementTypeID = ''
-            let settlementTypeName = ''
-
-            settlementTypeList.forEach(element => {
-                if (element.checked) {
-                    settlementTypeID = element.typeId
-                    settlementTypeName = element.typeName
-                }
-            });
-            if (settlementTypeID == '') {
-                wx.showToast({
-                    title: "请选择收款方式",
-                    image: '/static/image/warning.png',
-                    duration: 1000
-                })
-                this.setData({
-                    loadingButtonFlag: false
-                })
-                return
-            }
-
-            this.setData({
-                loading: true,
-                loadingButtonFlag: true
-            })
-            let form = this.data.form
-            let param = {}
-            let fileList_ = this.data.fileList
-            let fileList = []
-            fileList_.forEach(item => {
-                fileList.push(
-                    {
-                        url: item.FilePath,
-                        type: 'image',
-                        name: '',
-                        createTime: util.formatDataTime(new Date())
-                    })
-            })
-            param.annexPaths = fileList
-            param.staffId = Number(form.staffID) // 业务员
-            param.orgId = Number(form.orgID) // 业务部门
-            param.salesChannel = Number(form.salesChannelID)// 渠道
-            param.customerId = form.customer.customerId //客户
-            //收款
-            param.sReceiptId = Number(form.sreceiptId)
-            param.sReceiptNo = form.sreceiptNo
-            param.settlementType = settlementTypeID
-            param.customerCode = form.customer.customerCode
-            param.customerName = form.customer.customerName
-            param.sumAmount = -1 * form.sumAmount
-            param.receiptDirection = -1
-            param.docCode = "客户取款"
-            param.balanceSumAmount = form.balanceSumAmount ? form.balanceSumAmount : 0
-            param.balanceAmount = ((form.balanceAmount + form.sumAmount) > 0 ? (form.balanceAmount + form.sumAmount) : 0)  //剩余可用 - 之前可用加上本次退款(退款是负的 故相加)
-            param.sumRefundAmount = -1 * form.sumAmount //使用额
-            param.cpId = app.globalData.user.cpId,
-                param.addressFull = form.customer.addressFull //详细地址
-            param.salesChannelName = form.salesChannelName //渠道
-            param.refundAccount = form.refundAccount //退款账号
-            param.organizationCode = form.orgCode //组织结构编码
-            param.staffCode = form.staffCode //业务员编码
-            param.decisionMakerName = form.customer.decisionMakerName  //决策者
-            param.decorationStyleName = form.customer.fitupStyleName  //风格
-            param.customerAgeGroupName = form.customer.ageCompositionName  //年龄 (80后)
-            param.settlementTypeName = settlementTypeName //结算方式
-            param.homeHouseTypeName = form.customer.houseTypeName //房屋类型    
-            param.customerCode = form.customer.customerCode //客户编码
-            param.customerTelephone = form.customer.customerCode //客户编码
-            param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
-            param.remarks = form.remarks
-            param.editTime = form.editTime ? form.editTime : null
-            param.receiptId = Number(form.receiptId) ? Number(form.receiptId) : null
-
-            api.request(Constants.ORDER_RECEIPT_PC_API + 'insert', 'POST', param).then(res => {
-                this.setData({
-                    loading: false
-                })
-                if (res.data.code === 200) {
-                    wx.showToast({
-                        title: '保存成功',
-                        image: '/static/image/success.png',
-                        duration: 1000
-                    })
-                    this.setData({
-                        disabledSave: false
-                    })
-                    var pages = getCurrentPages();
-                    var prevPage = pages[pages.length - 2];
-
-                    setTimeout(function () {
-                        wx.navigateBack({
-                            delta: 2
-                        })
-                    }, 1500)
-                } else {
-                    this.setData({
-                        loadingButtonFlag: false
-                    })
-                }
-            })
-        }
-    },
-
-    getNetwork() {
-        return new Promise((resolve, reject) => {
-            wx.getNetworkType({
-                success(res) {
-                    const networkType = res.networkType; if (networkType === 'none') {
-                        console.log('无网络,返回false')
-                        resolve(false)
-                    } else {
-                        console.log('有网络,返回true')
-                        resolve(true)
-                    }
-                }
-            })
-        })
-       
-    }, 
-   
+        },
 
-     
-})
+    })

+ 35 - 40
package-base-select/pages/select-collection_confirm/select-collection_confirm.wxml

@@ -1,13 +1,8 @@
 <wxs src='/utils/numberFormat.wxs' module="numberFormat"></wxs>
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
-<loading wx:if="{{loading}}" ></loading>
+<loading wx:if="{{loading}}"></loading>
 <!-- 客户资料 -->
-<!-- 客户信息组件 -->
-<!-- <dk-customer-detail customerName="{{form.customer.customerName}}" textColor="black" backgroundColor="white,white,white"
- customerPhone="{{form.customer.customerPhone}}"  
- addressFull="{{form.customer.addressFull}}"></dk-customer-detail> -->
- <van-dialog id="van-dialog" />
-
+<van-dialog id="van-dialog" />
 <!-- 客户信息 -->
 <view style="margin: 42rpx 34rpx 0rpx 34rpx;border-radius: 15rpx;box-shadow:2px 2px 5px #e5e5e6;">
   <view style="flex-direction: column;justify-content: center;align-items: flex-start;background: linear-gradient(90.12deg, #718AC6 0.84%, #4A5E98 99.43%);border-radius: 15rpx;">
@@ -21,61 +16,61 @@
       </view>
       <!-- 客户名称 供应商名称  -->
       <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
-        {{form.customer.customerName}}
+        {{form.objInfo.cusName}}
       </view>
       <!-- 客户电话 供应商电话  -->
       <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
-        {{form.customer.customerPhone}}
+        {{form.objInfo.cusPhone}}
       </view>
     </view>
-     <!-- 地址  -->
+    <!-- 地址  -->
     <view style="display: flex;padding-right: 32rpx;padding-bottom: 15rpx;">
       <view style="padding-left: 32rpx;padding-top: 15rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
-        {{wxmlUtil.addressToIndexOf(form.customer.addressFull)}}
+        {{wxmlUtil.addressToIndexOf(form.objInfo.addressFull)}}
       </view>
     </view>
 
- 
+
   </view>
 </view>
- 
+
 
 <!-- 收款方式 -->
-<view   style="margin: 24rpx 34rpx 26rpx 34rpx;">
-  <scroll-view scroll-y="true" style="height:775rpx;" bindscrolltolower="paging" scroll-top="{{topNum}}">
-    <view wx:for="{{settlementTypeList}}" style="width: 100%;">
-    <view class="choose-item {{(item.checked == true && item.imageReceiptCode_ping) ? 'choose-item-select' : 'choose-item-unchecked'}}">
-      <view class="thick-line" wx:if="{{item.checked}}"></view>
-      <view style="width:40rpx;place-self: center;padding-left: 34rpx;">
+<view style="margin: 24rpx 34rpx 26rpx 34rpx;">
+  <scroll-view scroll-y="true" style="height:860rpx;" bindscrolltolower="paging" scroll-top="{{topNum}}">
+    <view wx:for="{{tableData}}" style="width: 100%;">
+      <view class="choose-item {{(item.checked == true && item.imageReceiptCode_ping) ? 'choose-item-select' : 'choose-item-unchecked'}}">
+        <view class="thick-line" wx:if="{{item.checked}}"></view>
+        <view style="width:40rpx;place-self: center;padding-left: 34rpx;">
 
-        <view style="position: relative;">
-          <van-checkbox value="{{item.checked}}" data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck"  checked-color="#1989FA" />
+          <view style="position: relative;">
+            <van-checkbox value="{{item.checked}}" data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck" checked-color="#1989FA" />
+          </view>
         </view>
-      </view>
 
-      <view class="choose-item-two" style="{{(item.checked == true && item.imageReceiptCode_ping) ? 'padding-top:63rpx;' : 'display: flex;  align-items: center;'}}">
+        <view class="choose-item-two" style="{{(item.checked == true && item.imageReceiptCode_ping) ? 'padding-top:63rpx;' : 'display: flex;  align-items: center;'}}">
 
-        <view class="type-name">
-          {{item.typeName ? item.typeName : ''}}
-        </view>
+          <view class="type-name">
+            {{item.macTypeName ? item.macTypeName : ''}}
+          </view>
 
 
-        <view style="margin-left:{{item.checked == true ? '0rpx' : '27rpx'}}; ">
-          <dk-van-tag color="#EAF1FF" textColor="#606EB2" radius="3rpx" roundFlag="{{true}}" value="{{item.accountname ? item.accountname : ''}}账户"></dk-van-tag>
+          <view style="margin-left:{{item.checked == true ? '0rpx' : '27rpx'}}; ">
+            <dk-tag border="1rpx solid #606EB2" height="35rpx" color="transparent" textColor="#606EB2" radius="5rpx" roundFlag="{{true}}" size="large" value="{{item.macName ? item.macName : ''}}"></dk-tag>
+          </view>
+       
+          <view wx:if="{{item.checked && settlementTypeListLength > 1 }}" style="text-align:left;padding-top: 10rpx;">
+            <dk-number-input negative="{{form.sumTempAmount < 0 ?true:false}}" signSize="11px" center="left" fontSize="15" inputColor="#CAA977;" fontWeight="500" data-key="priceSale" inputValue="{{item.sumAmount ? item.sumAmount : 0}}" data-value="{{item.sumAmount}}" data-index="{{index}}" bind:triggerBindValue="sumAmountBindValue" bind:triggerBindBlur=""></dk-number-input>
+          </view>
         </view>
-
-        <view wx:if="{{item.checked && settlementTypeListLength > 1 }}" style="text-align:left;padding-top: 10rpx;">
-          <dk-number-input  negative="{{form.sumTempAmount < 0 ?true:false}}"  signSize="11px" center="left" fontSize="15" inputColor="#CAA977;" fontWeight="500" data-key="priceSale"  inputValue="{{item.sumAmount ? item.sumAmount : 0}}" data-value="{{item.sumAmount}}" data-index="{{index}}" bind:triggerBindValue="sumAmountBindValue" bind:triggerBindBlur=""></dk-number-input>
+        <view class="image-code" wx:if="{{item.checked && item.imageReceiptCode && item.imageReceiptCode_ping}}" style="margin-top: 32rpx;margin-right: 40rpx;margin-bottom: 26rpx;border: 1rpx solid #000000;border-radius: 15rpx;">
+          <image wx:if="{{item.imageReceiptCode && item.imageReceiptCode_ping}}" style="height:166rpx;width:166rpx;border-radius: 15rpx;" src="{{item.imageReceiptCode_ping}}" bindtap="previewImg" data-imgUrl="{{item.imageReceiptCode_ping}}" />
         </view>
       </view>
-      <view class="image-code" wx:if="{{item.checked && item.imageReceiptCode && item.imageReceiptCode_ping}}" style="margin-top: 32rpx;margin-right: 40rpx;margin-bottom: 26rpx;border: 1rpx solid #000000;border-radius: 15rpx;">
-        <image wx:if="{{item.imageReceiptCode && item.imageReceiptCode_ping}}" style="height:166rpx;width:166rpx;border-radius: 15rpx;" src="{{item.imageReceiptCode_ping}}" bindtap="previewImg" data-imgUrl="{{item.imageReceiptCode_ping}}" />
-      </view>
     </view>
-  </view>
-  <view style="height: 180rpx;"></view>
+    <view style="height: 90rpx;"></view>
   </scroll-view>
-</view> 
+</view>
 
 <!-- 确认收款 -->
 <view style="position:fixed;bottom:0;width:100%;z-index: 10; ">
@@ -88,13 +83,13 @@
     </view>
     <view style="padding-top: 10rpx; text-align:center; display: flex; justify-content: center;">
 
-      <dk-number-input readonly="{{settlementTypeListLength > 1}}" negative="{{form.sumTempAmount < 0 ?true:false}}" signSize="15px" fontSize="27" color fontWeight="600" data-key="priceSale"  inputValue="{{form.sumAmount}}" data-value="{{form.sumAmount}}" bind:triggerBindValue="changeSalesPriceField" bind:triggerBindBlur="sumAmountBindinputBlur"></dk-number-input>
+      <dk-number-input readonly="{{settlementTypeListLength > 1}}" negative="{{form.sumAmount < 0 ?true:false}}" signSize="15px" fontSize="27" color fontWeight="600" data-key="priceSale" inputValue="{{form.sumAmount}}" data-value="{{form.sumAmount}}" bind:triggerBindValue="changeSalesPriceField" ></dk-number-input>
     </view>
 
     <view style="z-index: 12;margin-top:40rpx;box-shadow: 0px 4rpx 16rpx rgba(190, 144, 73, 0.5);border-radius: 15rpx;">
 
-      <van-button round size="large" disabled="{{loadingButtonFlag}}" loading="{{loadingButtonFlag}}" color="#CAA977" custom-style="width:100%;" bind:click="btnOK" type="info">确认收款
-        </van-button>
+      <van-button round size="large" disabled="{{loadingButtonFlag}}" loading="{{loadingButtonFlag}}" color="#CAA977" custom-style="width:100%;" bind:click="save" type="info">确认收款
+      </van-button>
     </view>
   </view>
 

+ 1 - 1
package-base-select/pages/select-goods/select-goods.js

@@ -63,7 +63,7 @@ Page({
    */
   getData(params) {
     if (this.data.item == Constants.billType.sale) {
-      return this.excute(this.data.service, this.data.service.selectByCond, params);
+      return this.excute(this.data.commonService, this.data.commonService.getGoodsForOrderByPage, params);
     } else if (this.data.item == Constants.billType.out) {
       return this.excute(this.data.inventoryService, this.data.inventoryService.selectByCond, params);
     } else {

+ 36 - 6
package-base-select/pages/select-income-category/select-income-category.js

@@ -17,10 +17,12 @@ Page({
   data: {
         // 弹出按钮
         buttonList: [{
+          code: "add",
           name: 'merge',
           color:'#C7A974',
           title: '新建'
         },{
+          code: "save",
           name: 'merge',
           title: '确定'
         }],
@@ -465,12 +467,40 @@ changeTag(e) {
     })
 
   },
-
   /**
-    * 生命周期函数--监听页面加载
-    */
-  onLoad(options) {
-    console.log("onLoad");
-  },
+   * @desc : 按钮点击事件回调
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  open(e) {
+    let that = this
+     let code = e.detail.name
+     if (code == "add") { //新建事件
+   
+     }
+     if (code == "save") { //选择确定
+       let  list = this.data.tableData
+       let chooseList = [] //
+       let alreadyList =  this.data.alreadyList //之前已经选择的  
+       let tempList = list.filter(itt => {
+        return itt.checked
+      })
+      chooseList = alreadyList.concat(tempList)
+    
+       if (!(chooseList && chooseList.length > 0)) {
+         wx.showToast({
+           title: mixins.$t('pleaseChoose'),//"请至少选择一件商品" ,
+           icon: 'none'
+         })
+       }
+       wx.navigateTo({
+        url: that.data.route.openPurchase.url,   
+        success: function (res) { 
+          res.eventChannel.emit('params', {choooseItemList: chooseList })
+        }
+      })
+     }
+ 
+   },
 
 })

+ 1 - 1
package-base-select/pages/select-income-category/select-income-category.wxml

@@ -41,4 +41,4 @@
 
 <view style="height: 200rpx;"></view>
 <!-- 新建按钮 -->
-<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}"   buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="save"></dk-save-button>
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}"   buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="open"></dk-save-button>

+ 3 - 25
package-base-select/pages/select-income-category/select-income-category.wxss

@@ -20,23 +20,8 @@
   left: 34rpx;
   height: 78rpx;
 }
-/**扫一扫**/
-.scan-class{
-  position: fixed;
-  top: 107rpx;
-  right: 34rpx;
-  width: 122rpx;
-  height: 65rpx;
-  background: #1B365D;
-  border-radius: 15rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-}
-.scan-image{
-  width: 48rpx;
-  height: 36rpx;
-}
+ 
+ 
 
 /** 查询**/
 .van-search {
@@ -230,14 +215,7 @@
 }
 
 
-/**产品条目的样式**/
-.goods-item-class{
-  background: #FBF6EF;
-  border-radius: 15rpx ;
-  display: flex;
-  text-align: left;
-  width: 100%;
-}
+ 
 
 .goods-item-selected-cell-class{
   padding-right: 10rpx !important;

+ 5 - 2
package-base-select/pages/select-source-purchase-order/select-source-purchase-order.js

@@ -13,6 +13,8 @@ Page({
     routeObjName: 'inbound',
     tableData: [],
     choooseInboundItemList: [],
+    buttonSaveList: [{ code: 'add', title:  mixins.$t('confirm'), width: '120rpx', color: '#1B365D' }],
+    contentSaveList: [{code:'flag',title:'全退',type:'checkbox'},{code:'need',title:'退货总额',type:'str'},{code:'amount',content:0,type:'number'}],
   },
   /**
    * @desc :   加载数据源
@@ -103,6 +105,7 @@ Page({
     */
   calculateTotal() {
     let tableData = this.data.tableData
+    let contentSaveList = this.data.contentSaveList
     let choooseInboundItemList = []
     let returnTotalAmount = Number(0)
     //过滤出已选数据
@@ -125,11 +128,11 @@ Page({
       })
     }
 
-
+    contentSaveList[2]['content'] = returnTotalAmount.toFixed(2)
 
     this.setData({
       choooseInboundItemList: choooseInboundItemList,
-      returnTotalAmount: returnTotalAmount.toFixed(2),
+      contentSaveList: contentSaveList,
     })
   },
   /**

+ 5 - 3
package-base-select/pages/select-source-purchase-order/select-source-purchase-order.wxml

@@ -32,12 +32,12 @@
             {{item.contactName}}
           </view>
           <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #FFFFFF;">
-            {{item.deliveryPhone}}
+            {{item.contactPhone}}
           </view>
         </view>
         <view style="display: flex;padding-right: 32rpx;">
           <view style="padding-left: 32rpx;padding-top: 15rpx;font-size: 26rpx;line-height: 36rpx;color: #FFFFFF;">
-            {{ wxmlUtil.addressToIndexOf(item.addressFull)}}
+            {{ item.returnAddress}}
           </view>
         </view>
       </view>
@@ -103,4 +103,6 @@
 
 <view style="height: 200rpx;"></view>
 <!--  底部工具栏-保存 -->
-<dk-save-bottom checked="{{allChecked}}" totallength="{{returnTotalAmount}}" flagTypeName="select-source-purchase-order" bottomClass="{{true}}" bind:onCheckboxChange="onCheckboxChange" bind:allClean="toAdd" />
+<!-- <dk-save-bottom checked="{{allChecked}}" totallength="{{returnTotalAmount}}" flagTypeName="select-source-purchase-order" bottomClass="{{true}}" bind:onCheckboxChange="onCheckboxChange" bind:allClean="toAdd" /> -->
+
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="toAdd"></dk-save-button>

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

@@ -0,0 +1,170 @@
+const Constants = require('@/utils/Constants.js');
+const app = getApp()
+const mixins = require('@/mixins/index.js')
+
+Page({
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    returnTotalAmount: 0,
+    allChecked: false,
+    // 路由
+    routeObjName: 'saleOutBound',
+    orderService: app.globalData['orderService'],
+    tableData: [],
+    choooseInboundItemList: [],
+    buttonSaveList: [{ code: 'add', title:  mixins.$t('confirm'), width: '120rpx', color: '#1B365D' }],
+    contentSaveList: [{code:'flag',title:'全出',type:'checkbox'},{code:'need',title:'合计金额',type:'str'},{code:'amount',content:0,type:'number'}],
+  },
+  /**
+   * @desc :   加载数据源
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  getData(params) {
+    return this.excute(this.data.orderService, this.data.orderService.selectTotalSingleTapeDetailPage, params);
+  },
+
+  /**
+  * @desc :   设置查询参数
+  * @date : 2024/2/1 15:49
+  * @author : 于继渤
+  */
+  setSearchParams(params) {
+
+    return params
+  },
+  /**
+   * @desc :   父级商品信息选择
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  onListItemChange(e) {
+    let tableData = this.data.tableData
+    let index = e.currentTarget.dataset.index
+    tableData[index].checked = !tableData[index].checked
+    let orderItemResponseList = tableData[index].orderItemResponseList
+    if (orderItemResponseList && orderItemResponseList.length > 0) {
+      orderItemResponseList.forEach(res => {
+        res.checked = tableData[index].checked
+      })
+    }
+
+    this.setData({
+      tableData: tableData
+    })
+    this.calculateTotal()
+  },
+  /**
+   * @desc :   子级商品信息选择
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  onChangeItemCheckbox(e) {
+    let tableData = this.data.tableData
+    let index = e.currentTarget.dataset.index
+    let index_ = e.currentTarget.dataset.index_
+    console.log(index, index_)
+    tableData[index].orderItemResponseList[index_].checked = !tableData[index].orderItemResponseList[index_].checked
+
+    this.setData({
+      tableData: tableData
+    })
+
+    this.calculateTotal()
+  },
+
+  /**
+    * @desc :  全退
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  onCheckboxChange(e) {
+    console.log(e.detail.checked)
+    let checked = e.detail.checked
+    let tableData = this.data.tableData
+    tableData.forEach(res => {
+      res.checked = checked
+      if (res.orderItemResponseList && res.orderItemResponseList.length > 0) {
+        res.orderItemResponseList.forEach(item => {
+          item.checked = checked
+        })
+      }
+    })
+    this.setData({
+      tableData: tableData
+    })
+    this.calculateTotal()
+  },
+
+  /**
+    * @desc :   计算金额/过滤出已选数据
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  calculateTotal() {
+    let tableData = this.data.tableData
+    let contentSaveList = this.data.contentSaveList
+    let choooseInboundItemList = []
+    let returnTotalAmount = Number(0)
+    //过滤出已选数据
+    tableData.forEach(res => {
+      if (res.orderItemResponseList && res.orderItemResponseList.length > 0) {
+        res.orderItemResponseList.forEach(item => {
+          if (item.checked) {
+            item.itemQty = Number(item.rejectQty * -1)
+            item.itemQtyMax = Number(item.rejectQty * -1)
+            item.priceReturn = Number(item.priceInto * -1)
+            item.itemAmt = Number(item.rejectQty * item.priceInto * -1)
+            choooseInboundItemList.push(item)
+          }
+        })
+      }
+    })
+    if (choooseInboundItemList && choooseInboundItemList.length > 0) {
+      choooseInboundItemList.forEach(res => {
+        returnTotalAmount += Number(res.rejectQty * res.priceInto)
+      })
+    }
+
+    contentSaveList[2]['content'] = returnTotalAmount.toFixed(2)
+
+    this.setData({
+      choooseInboundItemList: choooseInboundItemList,
+      contentSaveList: contentSaveList,
+    })
+  },
+  /**
+  * @desc :   跳转退货页
+  * @date : 2024/2/1 15:49
+  * @author : 于继渤
+  */
+  toAdd() {
+    let choooseInboundItemList = this.data.choooseInboundItemList
+    let that = this
+    let formData = that.data.formData
+    let item = that.data.item
+    wx.navigateTo({
+      url: this.data.route.add.url,
+      success: function (res) {
+        res.eventChannel.emit('params', {
+          formMode:'add',
+          choooseInboundItemList: choooseInboundItemList,
+          goodsRejectedAmount: that.data.returnTotalAmount,
+          item: JSON.stringify(item)
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+
+})

+ 4 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "选择源单"
+}

+ 70 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml

@@ -0,0 +1,70 @@
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<loading wx:if="{{loading}}" loadingName="加载中" 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,['roleName','roleCode'])}}">
+  </dk-dropdown-menu>
+
+</van-sticky>
+
+
+
+<view wx:for="{{tableData}}" data-item="{{item}}" wx:key="index" class="main-class">
+  <view class="main-foot" style="border-radius: 15rpx;">
+    <view class="table-content" data-item="{{item}}">
+      <view style="padding:16rpx;">
+        <view style="display:flex;justify-content: left;align-items: center;">
+          <view style="width: 20%;display: flex;">
+            <van-checkbox checked-color="#E4002B" value="{{ item.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onListItemChange"></van-checkbox> <view style="color:#95A8CB;font-size:13px;padding-left: 6px;">全出</view>
+          </view>
+          <view style="width: 60%;">
+            <view style="font-size: 26rpx;color:#1B365D">{{item.orderNo}}</view>
+            <view style="font-size: 24rpx;color:#95A8CB;padding-top:10rpx"> {{item.makeTime ? wxmlUtil.format(item.makeTime) : ''}}</view>
+          </view>
+          <view style="width: 20%;text-align: right;font-size: 26rpx;color:#1B365D">销售订单</view>
+        </view>
+      </view>
+      <view wx:for="{{item.orderItemResponseList}}" wx:for-item="item_" wx:for-index="index_">
+        <view style="display: flex;" data-index="{{index}}" data-index_="{{index_}}">
+          <view style="place-self: center;padding-left: 15rpx;padding-right: 15rpx;">
+            <view style="display: flex;padding-left: 10rpx;">
+              <van-checkbox checked-color="#E4002B" value="{{ item_.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onChangeItemCheckbox" checked-color="#E4002B"></van-checkbox>
+              <view class="red-checkbox" style="{{item_.checked ? 'color:#E4002B;' : ''}}">出</view>
+            </view>
+          </view>
+          <view class="border-solid" style="{{index_ === 0 ? (item.orderItemResponseList.length  == 1 ? 'margin-top:30rpx;margin-bottom:30rpx;' : 'margin-top:30rpx;') : index_ ===(item.orderItemResponseList.length -1) ? 'margin-bottom:30rpx;': ''}}"></view>
+          <view style="display: flex;width: 100%;">
+            <view style="padding:20rpx;">
+              <van-image radius="5px" width="80" height="80" src="{{item_.skuImages? item_.skuImages.path : ''}}" />
+            </view>
+            <view style="width: 100%;padding:20rpx;padding-left: 10rpx;">
+              <view>
+                <dk-title titleTag="{{'HEGII'}}" title="{{item_.skuCode}}"></dk-title>
+              </view>
+              <view>
+                <view style="width: 100%;margin-top: 10rpx;" class="font">{{item_.skuName}}</view>
+              </view>
+              <view style="display: flex;width: 100%;margin-top: 40rpx;position: absolute;">
+                <view style="width: 40%;">
+                  <dk-cell contentFontSize="15" height="25rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="" content="{{ item_.priceSale ? item_.priceSale : 0}}"></dk-cell>
+                </view>
+                <view style="width: 60%;font-size:24rpx;color: #95A8CB;line-height: 34rpx;">{{ ' x ' + (item_.itemQty ? item_.itemQty : 0)}}</view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view wx:if="{{index_ !== (item.orderItemResponseList.length -1)  && item.orderItemResponseList.length > 1}}" style="text-align: center;margin-left: 30rpx;margin-right: 30rpx;">
+          <view style="border: solid 1rpx #D3D3D3;"></view>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>
+
+<van-empty wx:if="{{!tableData[0].orderItemResponseList || tableData[0].orderItemResponseList.length ==0}}" description="暂无出库单" />
+
+<view style="height: 200rpx;"></view>
+
+
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="toAdd"></dk-save-button>

+ 70 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.wxss

@@ -0,0 +1,70 @@
+.fontSizeStyle {
+  font-size: 15px;
+}
+
+
+
+
+.choose-item {
+  display: flex;
+  background: #FFFFFF;
+  box-shadow: 0px 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx;
+  margin-top: 25rpx;
+}
+
+/* 选中的样式 */
+.choose-item-select {
+  height: 255rpx;
+  background: #FFFFFF;
+  border: 2rpx solid #606EB2;
+  box-shadow: 0px 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx;
+}
+
+
+/* 没有选中的样式 */
+.choose-item-unchecked {
+  height: 255rpx;
+}
+
+
+
+.red-checkbox {
+  color: #95A8CB;
+  font-size: 28rpx;
+  padding-left: 10rpx;
+}
+
+.border-solid {
+  border: solid 1rpx #D3D3D3;
+}
+
+
+.van-card {
+  width: 100% !important;
+}
+
+.font {
+  font-family: PingFang HK;
+  font-size: 28rpx;
+  font-weight: 600;
+  line-height: 34rpx;
+  letter-spacing: 0em;
+  text-align: left;
+
+}
+.top-class{
+ margin: 10px 32rpx 10px 32rpx;
+ margin-top: 15rpx;
+ border-radius: 15rpx;
+ box-shadow:2px 2px 5px #bbb7b7;
+}
+
+.top-class-2{
+ flex-direction: column;
+ justify-content: center;
+ align-items: flex-start;
+ background: linear-gradient(90.12deg, #718AC6 0.84%, #4A5E98 99.43%);
+ border-radius: 15rpx;
+}

+ 30 - 7
package-basic-data/pages/customer-list/add/add.js

@@ -18,22 +18,24 @@ Page({
   data: {
     routeObjName: 'customer',
     cardList: ['main', 'center', 'remarks'],
-    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: true },
+        { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
+        { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
         { code: 'addressNo', type: 'str', required: true, title: mixins.$t('addressNo') },
         { code: 'cusFrom', name: 'cusFromName', type: 'drop', required: true, dropType: 'customerFrom', title: mixins.$t('customerSource') },
-        { code: 'contactName', type: 'str', required: false, title:  mixins.$t('contactName') },
+        { code: 'contactName', type: 'str', required: false, title: mixins.$t('contactName') },
         { code: 'contactPhone', type: 'str', title: mixins.$t('cpPhone'), required: false },
       ],
       center: [
-        { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel', title: mixins.$t('saleChannel') },
-        { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: mixins.$t('saleStaff') },
-        { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org', title: mixins.$t('saleOrg') },
+        { code: 'channelId', name: 'channelName', type: 'choose', required: true, title: mixins.$t('saleChannel') },
+        { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
+        { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
         { code: 'initialDebt', type: 'number', required: false, title: mixins.$t('initialDebtOwed') },
+
+
       ],
       remarks: [
         { code: 'remarks', type: 'textarea', title: mixins.$t('remarks') }
@@ -41,7 +43,28 @@ Page({
     },
   },
 
+  /**
+* @desc : 选择数据源
+* @date : 2024/2/1 15:49
+* @author : 于继渤
+*/
+  chooseData(e) {
+    let formData = JSON.parse(this.data.formData)
+    let code = e.detail.code
+    let data = e.detail.data.data
 
+    if (code == "staffId") { //员工
+      formData.staffId = data.id
+      formData.staffName = data.name
+    }
+    if (code == "orgId") { //部门
+      formData.orgId = data.id
+      formData.orgName = data.name
+    }
+    this.setData({
+      formData: JSON.stringify(formData)
+    })
+  },
 
 
   /**

+ 28 - 11
package-inventory/pages/outbound-processing/detail/detail.js

@@ -152,8 +152,8 @@ Page({
     // 明细的最大出库办理的量
     data.goodsList.forEach(element => {
       element.outingQtyMax = element.outingQty
-        // 显示库区和可售量开关
-        element.usableQtyInsufficientFlag = true
+      // 显示库区和可售量开关
+      element.usableQtyInsufficientFlag = true
     })
 
     // 刷新商品明细 显示 查看更多
@@ -185,8 +185,8 @@ Page({
     formData.goodsList.forEach(element => {  //循环出商品总共价格   
       element.outingAmt = element.priceOut * element.outingQty
       totalAmout += Number(element.priceOut * element.outingQty)
-       // 显示库区和可售量开关
-       element.usableQtyInsufficientFlag = true
+      // 显示库区和可售量开关
+      element.usableQtyInsufficientFlag = true
     })
     // 左下角的合计金额
     contentList_.forEach(card => {
@@ -263,12 +263,9 @@ Page({
   setParams(params) {
     let formData = JSON.parse(this.data.formData)
     params.allEdit = true //大编辑
-    params.deleteItemList = []
-    // 总单的 出库中数量和金额合计
-    params.outingAmt = formData.goodsList.sum("outingAmt")   //金额
-    params.outingQty = formData.goodsList.sum("outingQty")     //一共的商品数量
-    params.outAmt = 0     //  已出库金额
-    params.outQty = 0     //  已出库数量          
+    // 由于办理后直接生成出库单,将画面的删除的数据放入deleteItemList数组中
+    params.deleteItemList = formData.deleteList  || []
+
     params.fromId = formData.fromId  //来源id
     params.fromNo = formData.fromNo  //来源单号
     params.orgId = formData.orgId  //组织部门
@@ -283,8 +280,28 @@ Page({
     }
     params.whId = formData.whId  // 仓库
     params.remarks = formData.remarks  // 备注
-    params.makeStaff = app.globalData.user.staffId  // 制单人      
+    params.makeStaff = app.globalData.user.staffId  // 制单人  
+    // 退货出库传负值
+    if (this.data.item.outType == Constants.outType.purReturn) {
+      // 总单的 出库中数量和金额合计
+
+      params.outingAmt = -1 * Math.abs(formData.goodsList.sum("outingAmt"))   //金额
+      params.outingQty = -1 * Math.abs(formData.goodsList.sum("outingQty"))     //一共的商品数量
+      params.outAmt = 0     //  已出库金额
+      params.outQty = 0     //  已出库数量   
+      formData.goodsList.forEach(item => {
+        item.outingAmt = -1 * Math.abs(item.outingAmt)
+        item.outingQty = -1 * Math.abs(item.outingQty)
+      })
+    } else {
+      // 总单的 出库中数量和金额合计
+      params.outingAmt = formData.goodsList.sum("outingAmt")   //金额
+      params.outingQty = formData.goodsList.sum("outingQty")     //一共的商品数量
+      params.outAmt = 0     //  已出库金额
+      params.outQty = 0     //  已出库数量   
+    }
     params.itemList = formData.goodsList //商品明细
+
     console.log("setParams", params);
     return params
   },

+ 21 - 7
package-inventory/pages/warehousing-processing/detail/detail.js

@@ -255,12 +255,9 @@ Page({
     setParams(params) {
         let formData = JSON.parse(this.data.formData)
         params.allEdit = true //大编辑
-        params.deleteItemList = []
-        // 总单的 入库中数量和金额合计
-        params.intoingAmt = formData.goodsList.sum("intoingAmt")   //金额
-        params.intoingQty = formData.goodsList.sum("intoingQty")     //一共的商品数量
-        params.intoAmt = 0     //  已入库金额
-        params.intoQty = 0     //  已入库数量          
+        // 由于办理后直接生成出库单,将画面的删除的数据放入deleteItemList数组中
+        params.deleteItemList = formData.deleteList  || []
+
         params.fromId = formData.fromId  //来源id
         params.fromNo = formData.fromNo  //来源单号
         params.orgId = formData.orgId  //组织部门
@@ -276,7 +273,24 @@ Page({
         params.whId = formData.whId  // 仓库
         params.remarks = formData.remarks  // 备注
         params.makeStaff = app.globalData.user.staffId  // 制单人
-      
+
+        if (this.data.item.intoType == Constants.intoType.saleReturn) {
+            params.intoingAmt = -1 * Math.abs(formData.goodsList.sum("intoingAmt"))   //金额
+            params.intoingQty = -1 * Math.abs(formData.goodsList.sum("intoingQty"))     //一共的商品数量
+            params.intoAmt = 0     //  已入库金额
+            params.outQty = 0     //  已入库数量   
+            formData.goodsList.forEach(item => {
+                item.intoingAmt = -1 * Math.abs(item.intoingAmt)
+                item.intoingQty = -1 * Math.abs(item.intoingQty)
+            })
+        } else {
+            // 总单的 入库中数量和金额合计
+            params.intoingAmt = formData.goodsList.sum("intoingAmt")   //金额
+            params.intoingQty = formData.goodsList.sum("intoingQty")     //一共的商品数量
+            params.intoAmt = 0     //  已入库金额
+            params.intoQty = 0     //  已入库数量          
+        }
+
         params.itemList = formData.goodsList //商品明细
         console.log("setParams", params);
         return params

+ 42 - 31
package-purchase/pages/purchase-return/add/add.js

@@ -1,5 +1,5 @@
 const Constants = require('@/utils/Constants.js');
-const util = require('@/utils/util.js')
+import Dialog from '@/dist/dialog/dialog.js';
 const mixins = require('@/mixins/index.js')
 Page({
   mixins: [mixins],
@@ -15,31 +15,24 @@ Page({
     flgAutoIvt: false,
     showPopFlag: true,
     stepperFlag: true,
-    cardList: [{
-      name: 'items',
-      title: '商品明细',
-      chooseGoodsFlag: '',
-      sumAmount: 0,
-      displayNum: 2
-    }, {
-      name: 'other',
-      title: '其他信息'
-    }],
+    cardList: [
+      {name: 'items',title: mixins.$t("goodsDetail"), chooseGoodsFlag: '',sumAmount: 0,displayNum: 2},
+       {name: 'other',title: mixins.$t("otherInfo")}
+      ],
 
     cardContentList: [
-      { code: 'whId', name: 'whName', title: '库区', type: 'choose', urlKey: 'openingInventory' }
+      { code: 'whId', name: 'whName', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'openingInventory' }
     ],
 
     contentObj: {
-
       other: [{
         code: 'remarks',
         type: 'textarea',
-        title: '备注'
+        title: mixins.$t("remarks")
       }, {
         code: 'file',
         type: 'uploader',
-        title: '附件'
+        title: mixins.$t("uploader")
       }]
     },
     buttonList: [{
@@ -52,7 +45,7 @@ Page({
       type: 'checkbox'
     }, {
       code: 'need',
-      title: '退货总额',//'合计金额',
+      title: mixins.$t("totalReturn"),//'合计金额',
       type: 'str'
     }, {
       code: 'sumAmount',
@@ -86,21 +79,21 @@ Page({
     if (this.data.formMode == Constants.formMode.edit) {
       let params = this.data.params
       return this.excute(this.data.service, this.data.service.update, {
-        returnId:params.returnId,
-        remarks:params.remarks ? params.remarks : '',
-        returnId:params.returnId,
+        returnId: params.returnId,
+        remarks: params.remarks ? params.remarks : '',
+        returnId: params.returnId,
       });
     } else {
       return this.excute(this.data.service, this.data.service.insert, this.data.params);
     }
   },
 
-    /**
-  * @desc :处理保存后续
-  * @date : 2024/2/1 15:49
-  * @author : 于继渤
-  */
-  handleData(){
+  /**
+* @desc :处理保存后续
+* @date : 2024/2/1 15:49
+* @author : 于继渤
+*/
+  handleData() {
     wx.navigateBack({
       data: 1
     })
@@ -152,9 +145,9 @@ Page({
     console.log('formData', formData)
     let cardList = this.data.cardList
     let contentList = this.data.contentList
-    
+
     cardList[0].sumAmount = sumAmount.toFixed(2)
-    if(contentList.length > 0){
+    if (contentList.length > 0) {
       contentList[2].content = sumAmount.toFixed(2)
     }
     this.setData({
@@ -194,8 +187,26 @@ Page({
       }
     })
   },
-
-
+  /**
+   * @desc :   自动办理事件
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  saveChange(e) {
+    let btnFormData = JSON.parse(this.data.btnFormData)
+    let that = this
+    if (!btnFormData.flag) {
+      //提示
+      Dialog.confirm({
+        message: mixins.$t("saleOutBoundInfo"),
+      }).then(() => { }).catch(() => {
+        btnFormData.flag = true
+        that.setData({
+          btnFormData: JSON.stringify(btnFormData)
+        })
+      });
+    }
+  },
 
   /**
    * 生命周期函数--监听页面加载
@@ -211,10 +222,10 @@ Page({
       //   res['usableQty'] = 0  //可售量
       // })
 
- 
+
       if (that.data.formMode == Constants.formMode.edit) {
         that.setData({
-          contentList:[],
+          contentList: [],
           showPopFlag: false,
           stepperFlag: false
         })

+ 5 - 3
package-purchase/pages/purchase-return/add/add.wxml

@@ -39,7 +39,7 @@
       <!-- 地址 -->
       <view style="display: flex;padding-right: 32rpx;">
         <view style="padding-left: 32rpx;padding-top: 15rpx;font-size: 26rpx;line-height: 36rpx;color: #FFFFFF;">
-          {{item.addressFull}}
+          {{item.returnAddress}}
         </view>
       </view>
     </view>
@@ -83,6 +83,8 @@ cardContentList="{{cardContentList}}"
 quantityRedTitle="可售量:"
 quantityRedCol="usableQty"
 quantityRedColFlagKey="usableQtyInsufficientFlag"
+
+goodsTagText="备货齐套"
  >
 </dk-form-bill>
 
@@ -109,9 +111,9 @@ quantityRedColFlagKey="usableQtyInsufficientFlag"
 
   </van-cell-group>
 </van-popup>
-
+<van-dialog id="van-dialog" />
 <!-- 新建按钮 -->
-<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="save"></dk-save-button>
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="save" bind:change="saveChange"></dk-save-button>
 
 
 

+ 11 - 11
package-purchase/pages/purchase-return/detail/detail.js

@@ -16,33 +16,33 @@ Page({
     routeObjName: 'intoReturnItem',
     cardList: [{
       name: 'items',
-      title: '商品明细',
+      title: mixins.$t("goodsDetail"),
       chooseGoodsFlag: false,
       sumAmount: 0,
-      info: '(' + '出库中' + ')',
+      info: '(' + mixins.$t("outOfStorage") + ')',
       color: '#E4002B',
       displayNum: 2
     }, {
       name: 'other',
-      title: '其他信息'
+      title: mixins.$t("otherInfo")
     }],
     contentObj: {
       other: [{
         code: 'remarks',
         type: 'textarea',
-        title: '备注'
+        title: mixins.$t("remarks")
       }, {
         code: 'file',
         type: 'uploader',
-        title: '附件'
+        title: mixins.$t("uploader")
       }]
     },
 
     buttonList: [
-      { name: 'merge', title: '出库办理', }
+      { name: 'merge', title: mixins.$t("outProcessing"), }
     ],
     contentList: [
-      { code: 'need', title: '退货总额', type: 'str' },
+      { code: 'need', title: mixins.$t("totalReturn"), type: 'str' },
       { code: 'sumAmount', content: 0, type: 'number' }
     ],
   },
@@ -88,13 +88,13 @@ Page({
     let item = this.data.item
     let buttonList = this.data.buttonList
     let cardList = this.data.cardList
-    if (item.outStatus == '出库状态-出库中' || item.outStatus == '出库状态-待出库') {
-      cardList[0].info = '(' + '出库中' + ')'
+    if (item.outStatus == mixins.$t("outBoundingOutStatus") || item.outStatus == mixins.$t("unOutBoundOutStatus")) {
+      cardList[0].info = '(' + mixins.$t("outOfStorage") + ')'
       cardList[0].color = '#E4002B'
     }
-    if (item.outStatus == '出库状态-已出库') {
+    if (item.outStatus == mixins.$t("outBoundedOutStatus")) {
       buttonList = [
-        { name: 'merge', title: '办理撤回', }
+        { name: 'merge', title: mixins.$t("handleWithdrawal"), }
       ]
       cardList[0].info = '(' + item.outStatusName + ')'
       cardList[0].color = ''

+ 12 - 10
package-purchase/pages/purchase-return/purchase-return.js

@@ -8,7 +8,7 @@ Page({
    */
   data: {
     // 查询条件
-    searchContent: [{ code: 'createtime', title: '近30天', defaultValue: 5, searchType: Constants.searchType.date }, { code: 'choose', title: '筛选', searchType: Constants.searchType.pick }],
+    searchContent: [{ code: 'createtime', title: mixins.$t("pastThirthtyDays"), defaultValue: 5, searchType: Constants.searchType.date }, { code: 'choose', title: mixins.$t("choose"), searchType: Constants.searchType.pick }],
     // 查询条件-筛选
     pullMenuList: [{ code: 'purchaseStatus', pullType: 'mSelect', typeName: 'purchaseStatus' },
     { code: 'contactName', dataType: '' },
@@ -16,28 +16,30 @@ Page({
     { code: 'addressFull', dataType: '' },
     { code: 'makingTime', dataType: 'date' }, { code: 'deliveryTime', dataType: 'date' }],
     // 列表区(脚部金额)
-    footerAmount: { name: 'sumAmount', title: '共计金额' },
+    footerAmount: { name: 'sumAmount', title: mixins.$t("totalAmount") },
     // 列表区(脚部信息)
-    footerInfo: [{ name: 'sumQuantity', title: ' 件', prefix: '共计', }],
+    footerInfo: [{ name: 'sumQuantity', title: mixins.$t("piece"), prefix: mixins.$t("together"), }],
     // 列表区(内容)
     contentList: [
-      { name: 'purNo', title: '订单编号' },
+      { name: 'purNo', title: mixins.$t("saleOrderNo") },
       {
         name: [{ name: 'contactName', title: '' },
-        { name: 'contactPhone', title: '' }], title: '退货信息'
+        { name: 'contactPhone', title: '' }], title: mixins.$t("returnInfo")
       },
-      { name: 'returnAddress', title: '退货地址' },
+      { name: 'returnAddress', title: mixins.$t("returnAddress") },
       {
         name: [{ name: 'orgName', title: '' },
-        { name: 'staffName', title: '业务员 ' }], title: '门店信息'
+        { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation")
       }],
     // 弹出按钮
-    buttonList: [{ name: 'cancel', title: '作废' }],
+    buttonList: [{ name: 'cancel', title: mixins.$t("invaidOrder") }],
     // 路由
     routeObjName: 'intoReturn',
     tableData: [],
     active: 0,
     tabsActive: 0,
+    buttonSaveList:[],
+    contentSaveList:[{code:'need',title:mixins.$t("totalAmount"),type:'str'},{code:'amount',content:2000,type:'number'}]
   },
 
   /**
@@ -71,9 +73,9 @@ Page({
     if (tabsActive == 0) { //出库状态
       params.outStatus = ''
     } else if (tabsActive == 1) {
-      params.outStatus = '出库状态-待出库'
+      params.outStatus = mixins.$t("outBoundingOutStatus")
     } else if (tabsActive == 2) {
-      params.outStatus = '出库状态-已出库'
+      params.outStatus = mixins.$t("outBoundedOutStatus")
     }
     return params
   },

+ 1 - 1
package-purchase/pages/purchase-return/purchase-return.wxml

@@ -27,4 +27,4 @@
 
 
 <!-- 新建按钮 -->
-<dk-save-bottom flagTypeName="purchase-return-add" selectlength="{{selectlength}}" totallength="{{numberFormat.toThousandCents(totallength)}}" bind:submit="toAdd" submitFlag="{{false}}" />
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>

+ 18 - 18
package-sales/pages/order-billing/add/add.js

@@ -11,9 +11,9 @@ Page({
     // 路由
     routeObjName: 'order',
     cardList: [
-      { name: 'main', title: '客户信息' },
-      { name: 'items', title: '商品明细', chooseGoodsFlag: true, itemAmt: '', displayNum: 2 },
-      { name: 'other', title: '其他信息' }
+      { name: 'main', title: mixins.$t("customerInformation") },
+      { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: true, itemAmt: '', displayNum: 2 },
+      { name: 'other', title: mixins.$t("otherInfo") }
     ],
     contentObj: {
       main: [
@@ -26,34 +26,34 @@ Page({
       ],
       items: [
         { code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },
-        { code: 'collectAmount', type: 'number', title: '收款金额', required: true }
+        { code: 'collectAmount', type: 'number', title: mixins.$t("amountCollected"), required: true }
       ],
       other: [
-        { code: 'contractNo', type: 'textarea', title: '合同号', readonly: false },
-        { code: 'deliveryDate', type: 'date', required: false, title: '送货日期', required: true },
-        { code: 'remarks', type: 'textarea', title: '备注', readonly: false },
-        { code: 'file', type: 'uploader', title: '附件' }
+        { code: 'contractNo', type: 'textarea', title: mixins.$t("contractNumber"), readonly: false },
+        { code: 'deliveryDate', type: 'date', required: false, title: mixins.$t("delivery_Time"), required: true },
+        { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: false },
+        { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
       ]
     },
     //按钮
     buttonSaveList: [
-      { code: 'collection', title: '收款', width: '120rpx', color: '#CAA977' },
-      { code: 'save', title: '保存', width: '120rpx', color: '#1B365D' }
+      { code: 'collection', title: mixins.$t("collection"), width: '120rpx', color: '#CAA977' },
+      { code: 'save', title: mixins.$t("save"), width: '120rpx', color: '#1B365D' }
     ],
     contentSaveList: [
-      { code: 'flag', title: '开单并出库办理', type: 'checkbox' },
-      { code: 'need', title: '需收款', type: 'str' },
+      { code: 'flag', title: mixins.$t("saleOutBoundFlag"), type: 'checkbox' },
+      { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
       { code: 'receivable', content: 0, type: 'number' }
     ],
     popContent: [
-      { code: 'itemQty', type: 'step', title: '数量', required: true },
-      { code: 'priceSale', type: 'number', title: '销售价格', required: true },
-      // { code: 'whId', name: 'whName', title: '库区', type: 'drop', dropType: 'warehouse', required: true },
+      { code: 'itemQty', type: 'step', title: mixins.$t("count"), required: true },
+      { code: 'priceSale', type: 'number', title: mixins.$t("priceSale"), required: true },
+      // { code: 'whId', name: 'whName', title: mixins.$t("warehouseId"), type: 'drop', dropType: 'warehouse', required: true },
       {
-        code: 'whId', name: 'whName', title: '库区', type: 'choose', urlKey: 'openingInventory',
+        code: 'whId', name: 'whName', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'openingInventory',
       },
-      { code: 'nonStdCode', title: '商品批次', type: 'str', },
-      { code: 'flgGift', title: '赠品标识', type: 'checkbox', },
+      { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
+      { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', },
     ],
   },
   /**

+ 39 - 52
package-sales/pages/order-billing/order-billing.js

@@ -19,8 +19,8 @@ Page({
     routeObjName: 'order',
     // 查询条件
     searchContent: [
-      { code: 'createtime', title: '近30天', defaultValue: 5, searchType: Constants.searchType.date },
-      { code: 'staff', title: '业务员', dropType: 'staff' },
+      { code: 'createtime', title: mixins.$t("pastThirthtyDays"), defaultValue: 5, searchType: Constants.searchType.date },
+      { code: 'staff', title: mixins.$t("staffId"), dropType: 'staff' },
       {
         code: 'orderStatus', title: '审批状态', searchType: Constants.searchType.switch,
         list: [
@@ -57,111 +57,98 @@ Page({
         ]
       },
       {
-        code: 'choose', title: '筛选', searchType: Constants.searchType.pick
+        code: 'choose', title: mixins.$t("choose"), searchType: Constants.searchType.pick
       }
     ],
-
     // 查询条件-筛选
-    pullMenuList: [{
-      code: 'outStatus',
-      pullType: 'mSelect',
-      typeName: 'outStatus'
-    }, {
-      code: 'receiveStatus',
-      pullType: 'mSelect',
-      typeName: 'receiveStatus'
-    }, {
-      code: 'designStatus',
-      pullType: 'mSelect',
-      typeName: 'designStatus'
-    }, {
-      code: 'customerFrom',
-      pullType: 'mSelect',
-      typeName: 'customerFrom'
-    }, {
-      code: 'keyType',
-      pullType: 'mSelect',
-      typeName: 'keyType'
-    }, {
-      code: 'delivery_Time',
-      dataType: 'date'
-    }],
+    pullMenuList: [
+      { code: 'outStatus', pullType: 'mSelect', typeName: 'outStatus' },
+      { code: 'receiveStatus', pullType: 'mSelect', typeName: 'receiveStatus' },
+      { code: 'designStatus', pullType: 'mSelect', typeName: 'designStatus' },
+      { code: 'customerFrom', pullType: 'mSelect', typeName: 'customerFrom' },
+      { code: 'keyType', pullType: 'mSelect', typeName: 'keyType' },
+      { code: 'delivery_Time', dataType: 'date' }
+    ],
 
     // 列表区(脚部金额)
-    footerAmount: { name: 'sumAmount', title: '共计金额' },
+    footerAmount: { name: 'sumAmount', title: mixins.$t("totalAmount") },
     // 列表区(脚部信息)
-    footerInfo: [{ name: 'sumQuantity', title: ' 件', prefix: '共计', }],
+    footerInfo: [{ name: 'sumQuantity', title: mixins.$t("piece"), prefix: mixins.$t("together"), }],
     // 列表区(内容)
     contentList: [
-      { name: 'orderNo', title: '订单单号' },
-      { name: 'cusPhone', title: '客户电话' },
-      { name: 'addressFull', title: '客户地址' },
-      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '门店信息' }
+      { name: 'orderNo', title: mixins.$t("saleOrderNo") },
+      { name: 'cusPhone', title: mixins.$t("cusPhone") },
+      { name: 'addressFull', title: mixins.$t("adddressFull") },
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation") }
     ],
 
     contentObj: {
       '成交': [{
         name: 'orderNo',
-        title: '订单单号'
+        title: mixins.$t("saleOrderNo")
       }, {
         name: 'customerPhone',
-        title: '客户电话'
+        title: mixins.$t("cusPhone")
       }, {
         name: 'addressFull',
-        title: '客户地址'
+        title: mixins.$t("adddressFull")
       }, {
         name: [{
           name: 'orgName',
           title: ''
         }, {
           name: 'staffName',
-          title: '业务员'
+          title: mixins.$t("staffId")
         }],
-        title: '客户地址'
+        title: mixins.$t("adddressFull")
       }],
       '未成交': [{
         name: 'orderNo',
-        title: '订单单号'
+        title: mixins.$t("saleOrderNo")
       }, {
         name: 'customerPhone',
-        title: '客户电话'
+        title: mixins.$t("cusPhone")
       }, {
         name: [{
           name: 'orgName',
           title: ''
         }, {
           name: 'staffName',
-          title: '业务员'
+          title: mixins.$t("staffId")
         }],
-        title: '客户地址'
+        title: mixins.$t("adddressFull")
       }]
     },
 
     // 弹出按钮
     buttonList: [{
       name: 'closingOrder',
-      title: '成交订单'
+      title: mixins.$t("makeOrder")
     }, {
-      name: 'salesOutbound',
-      title: '销售出库'
+      name: 'saleOutBound',
+      title: mixins.$t("saleOutBound"),
+      formMode: Constants.formMode.other,
+      other: {
+        idKey: 'orderId'
+      },
     }, {
       name: 'saleReturn',
-      title: '销售退货'
+      title: mixins.$t("saleReturn")
     },
     {
       name: 'collection',
-      title: '客户收款'
+      title: mixins.$t("cusCollection")
     }, {
       name: 'merge',
-      title: '打印票据'
+      title: mixins.$t("printedBill")
     }, {
       name: '',
-      title: '作废'
+      title: mixins.$t("invaidOrder")
     }
     ],
 
-    buttonSaveList:[{code:'add',title:'新建'}],
-    contentSaveList:[{code:'need',title:'合计金额',type:'str'},{code:'amount',content:2000,type:'number'}]
+    buttonSaveList: [{ code: 'add', title: mixins.$t("add") }],
+    contentSaveList: [{ code: 'need', title: mixins.$t("totalAmount"), type: 'str' }, { code: 'amount', content: 2000, type: 'number' }]
 
   },
 

+ 287 - 1989
package-sales/pages/sales-outbound/add/add.js

@@ -1,2075 +1,373 @@
+const Constants = require('@/utils/Constants.js');
+import Dialog from '@/dist/dialog/dialog.js';
+const mixins = require('@/mixins/index.js')
 const app = getApp()
-const Constants = require('../../../../utils/Constants.js');
-const api = require('../../../../utils/api.js');
-import Dialog from '../../../../dist/dialog/dialog.js'
-const util = require('../../../../utils/util.js')
-const common = require('../../../../utils/common.js')
-const config = require('../../../../config/config.js')
 Page({
-
+  mixins: [mixins],
   /**
    * 页面的初始数据
    */
   data: {
-    annexPaths: [],
-    barList: [],
-    checked: false,
-    fileList: [],
-    flgToErp: false,
-    form: {
-      "orderType": 2,
-      "deliveryPhone": "",
-      "discountPromotion": 431.39,
-      "orderId": 11981,
-      "cpType": 4,
-      "tDiscountStandard": 299.14,
-      "sumRejectAmount": 0,
-      "editTime": "2024-01-29T10:09:46.214203+08:00",
-      "customerFrom": -1,
-      "salesChannel": 1,
-      "ascpId": 29195,
-      "salesChannelCode": "10",
-      "sale1Id": 20760,
-      "sumReceiptAmount": 0,
-      "sumGoodsAmount": 408752,
-      "addressGcj02": {
-        "latitude": 41.803274,
-        "longitude": 123.408179
-      },
-      "orderSumOutAmount": 0,
-      "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-      "orgName": "北海富安居店",
-      "contactName": "",
-      "sumUsePrestore": 0,
-      "sumCollectedAmount": 0,
-      "docCode": "销售订单",
-      "fitupType": 87,
-      "customerName": "1211代送客户测试001",
-      "sumStandard": 136641,
-      "linkPsiSystem": "DK-IBOSS",
-      "orderCanOutList": [
-        {
-          "activityId": 84,
-          "activityName": "零售活动方案",
-          "canOutQuantity": 1,
-          "cpId": 20760,
-          "discountPromotion": 100,
-          "discountStandard": 11.24,
-          "flgDesign": false,
-          "flgGift": false,
-          "flgNonStandardType": 0,
-          "hasChild": 0,
-          "iconThumPath": "haip/2023-04-21/19ae78a2639547d9aa961b58d20dbdbd.png",
-          "id": "1479b100-c70c-437b-9039-3e598cdb0522",
-          "itemAmount": 999,
-          "itemIndex": 1,
-          "ivtQty": 3,
-          "nonStandardArea": 1,
-          "nonStandardCode": "-",
-          "orderAmount": 999,
-          "orderId": 11981,
-          "orderItemId": 36176,
-          "orderItemQuantity": 1,
-          "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-          "orderPriceSale": 999,
-          "orderQuantity": 1,
-          "outGoingAmount": 999,
-          "outGoingQty": 3,
-          "outGoingQuantity": 1,
-          "outQuantity": 0,
-          "outStatus": 2,
-          "outStatusString": "未出库",
-          "pricePromotion": 999,
-          "priceStandard": 8888,
-          "promotionId": 211,
-          "promotionItemId": 22944,
-          "promotionName": "1",
-          "promotionPriceType": 77,
-          "promotionPriceTypeName": "爆款产品",
-          "promotionType": 1,
-          "promotionTypeName": "单品促销",
-          "rejectQuantity": 0,
-          "skuCode": "EE920A00200B01",
-          "skuId": 9537580,
-          "skuModel": "HE920",
-          "skuName": "【已淘汰】智能盖板HE920",
-          "skuSpecs": " ",
-          "skuType": 0,
-          "skuTypeName": "",
-          "skuVolume": 0.05,
-          "skuWeight": 0,
-          "spuCode": "HE920",
-          "spuId": 65410,
-          "standardId": 308,
-          "tItemAmount": 999,
-          "tItemQuantity": 1,
-          "titleTag": "HEGII",
-          "unitName": "PCS",
-          "usableQty": 0,
-          "whId": 552,
-          "whName": "钦州运营仓"
-        },
-        {
-          "bomSkuCode": "CY901DT2200B01",
-          "bomSkuId": 161052,
-          "canOutQuantity": 1,
-          "cpId": 20760,
-          "discountPromotion": 100,
-          "discountStandard": 100,
-          "flgDesign": false,
-          "flgGift": false,
-          "flgNonStandardType": 0,
-          "hasChild": 0,
-          "id": "5ea261c3-1f36-4a69-b898-940979b805f5",
-          "itemAmount": 3303,
-          "itemIndex": 2,
-          "nonStandardCode": "-",
-          "orderAmount": 3303,
-          "orderId": 11981,
-          "orderItemId": 36177,
-          "orderItemQuantity": 1,
-          "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-          "orderPriceSale": 3303,
-          "orderQuantity": 1,
-          "outGoingAmount": 3303,
-          "outGoingQuantity": 1,
-          "outQuantity": 0,
-          "outStatus": 2,
-          "outStatusString": "未出库",
-          "parentId": "70eab86b-9eb3-44c1-9f6b-7feb444904bd",
-          "pricePromotion": 3303,
-          "priceStandard": 3303,
-          "promotionName": "",
-          "promotionPriceType": -2,
-          "promotionPriceTypeName": "正价产品",
-          "promotionType": 0,
-          "promotionTypeName": "正常品",
-          "rejectQuantity": 0,
-          "skuCode": "CT901DT2200B01",
-          "skuId": 9605810,
-          "skuName": "落地式坐便器HC0901DT\\地排305\\无盖板",
-          "skuSpecs": " ",
-          "skuType": 0,
-          "skuTypeName": "",
-          "skuVolume": 0.235,
-          "skuWeight": 0,
-          "standardId": 308,
-          "standardItemId": 213129,
-          "tItemAmount": 3303,
-          "tItemQuantity": 1,
-          "titleTag": "HEGII",
-          "unitName": "PCS",
-          "whId": 552,
-          "whName": "钦州运营仓"
-        },
-        {
-          "bomSkuCode": "CY901DT2200B01",
-          "bomSkuId": 161052,
-          "canOutQuantity": 1,
-          "cpId": 20760,
-          "discountPromotion": 100,
-          "discountStandard": 100,
-          "flgDesign": false,
-          "flgGift": false,
-          "flgNonStandardType": 0,
-          "hasChild": 0,
-          "id": "bac1205c-a2de-4ed7-808c-b9be59070153",
-          "itemAmount": 4450,
-          "itemIndex": 3,
-          "nonStandardCode": "-",
-          "orderAmount": 4450,
-          "orderId": 11981,
-          "orderItemId": 36178,
-          "orderItemQuantity": 1,
-          "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-          "orderPriceSale": 4450,
-          "orderQuantity": 1,
-          "outGoingAmount": 4450,
-          "outGoingQuantity": 1,
-          "outQuantity": 0,
-          "outStatus": 2,
-          "outStatusString": "未出库",
-          "parentId": "70eab86b-9eb3-44c1-9f6b-7feb444904bd",
-          "pricePromotion": 4450,
-          "priceStandard": 4450,
-          "promotionName": "",
-          "promotionPriceType": -2,
-          "promotionPriceTypeName": "正价产品",
-          "promotionType": 0,
-          "promotionTypeName": "正常品",
-          "rejectQuantity": 0,
-          "skuCode": "CQ501000000N01",
-          "skuId": 9607630,
-          "skuName": "电控盖板HQ501",
-          "skuSpecs": " ",
-          "skuType": 0,
-          "skuTypeName": "",
-          "skuVolume": 0.063,
-          "skuWeight": 0,
-          "standardId": 308,
-          "standardItemId": 213130,
-          "tItemAmount": 4450,
-          "tItemQuantity": 1,
-          "titleTag": "HEGII",
-          "unitName": "PCS",
-          "whId": 552,
-          "whName": "钦州运营仓"
-        },
-        {
-          "activityId": 84,
-          "activityName": "零售活动方案",
-          "canOutQuantity": 10,
-          "combinedSpecsId": 68,
-          "combinedTypeId": 462,
-          "cpId": 20760,
-          "discountPromotion": 465.12,
-          "discountStandard": 186.05,
-          "flgDesign": false,
-          "flgGift": false,
-          "flgNonStandardType": 0,
-          "hasChild": 0,
-          "iconThumPath": "haip/2023-10-04/ded5bc0e7a9446cc831dd831b6b6bc47.png",
-          "id": "b7558b1f-0b9e-4dce-9846-c5e6ea993e96",
-          "itemAmount": 27907,
-          "itemIndex": 4,
-          "nonStandardCode": "-",
-          "orderAmount": 27907,
-          "orderId": 11981,
-          "orderItemId": 36180,
-          "orderItemQuantity": 1,
-          "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-          "orderPriceSale": 2790.7,
-          "orderQuantity": 10,
-          "outGoingAmount": 27907,
-          "outGoingQuantity": 10,
-          "outQuantity": 0,
-          "outStatus": 2,
-          "outStatusString": "未出库",
-          "parentId": "bcad8226-2f13-460a-aa56-a2904e9be29c",
-          "pricePromotion": 600,
-          "priceStandard": 1500,
-          "promotionId": 273,
-          "promotionItemId": 598,
-          "promotionName": "1115新活动",
-          "promotionPriceType": -2,
-          "promotionPriceTypeName": "正价产品",
-          "promotionType": 2,
-          "promotionTypeName": "组合促销",
-          "rejectQuantity": 0,
-          "skuCode": "FF1016000CHB0A",
-          "skuId": 9418430,
-          "skuModel": "HMF101-150",
-          "skuName": "【已淘汰】面盆龙头HMF101-150\\壁式暗装\\单柄双控\\翻板式下水器",
-          "skuSpecs": " ",
-          "skuType": 0,
-          "skuTypeName": "",
-          "skuVolume": 0.05,
-          "skuWeight": 128,
-          "spuCode": "HMF101-150",
-          "spuId": 6938,
-          "standardId": 308,
-          "standardItemId": 213154,
-          "tItemAmount": 27907,
-          "tItemQuantity": 10,
-          "titleTag": "HEGII",
-          "unitName": "PCS",
-          "whId": 552,
-          "whName": "钦州运营仓"
-        },
-        {
-          "activityId": 84,
-          "activityName": "零售活动方案",
-          "canOutQuantity": 10,
-          "combinedSpecsId": 67,
-          "combinedTypeId": 457,
-          "cpId": 20760,
-          "discountPromotion": 465.12,
-          "discountStandard": 372.09,
-          "flgDesign": false,
-          "flgGift": false,
-          "flgNonStandardType": 0,
-          "hasChild": 0,
-          "id": "32a7c7ba-5572-485e-a895-96b6ddf18219",
-          "itemAmount": 93023.3,
-          "itemIndex": 5,
-          "nonStandardCode": "-",
-          "orderAmount": 93023.3,
-          "orderId": 11981,
-          "orderItemId": 36181,
-          "orderItemQuantity": 1,
-          "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-          "orderPriceSale": 9302.33,
-          "orderQuantity": 10,
-          "outGoingAmount": 93023.3,
-          "outGoingQuantity": 10,
-          "outQuantity": 0,
-          "outStatus": 2,
-          "outStatusString": "未出库",
-          "parentId": "bcad8226-2f13-460a-aa56-a2904e9be29c",
-          "pricePromotion": 2000,
-          "priceStandard": 2500,
-          "promotionId": 273,
-          "promotionItemId": 587,
-          "promotionName": "1115新活动",
-          "promotionPriceType": -2,
-          "promotionPriceTypeName": "正价产品",
-          "promotionType": 2,
-          "promotionTypeName": "组合促销",
-          "rejectQuantity": 0,
-          "skuCode": "FB1033000CHB0A",
-          "skuId": 9571300,
-          "skuName": "【已淘汰】淋浴大花洒HMF103-333M\\壁式明装\\三功能",
-          "skuSpecs": " ",
-          "skuType": 0,
-          "skuTypeName": "",
-          "skuVolume": 0.6,
-          "skuWeight": 187,
-          "standardId": 308,
-          "standardItemId": 213151,
-          "tItemAmount": 93023.3,
-          "tItemQuantity": 10,
-          "titleTag": "HEGII",
-          "unitName": "PCS",
-          "whId": 552,
-          "whName": "钦州运营仓"
-        },
-        {
-          "activityId": 84,
-          "activityName": "零售活动方案",
-          "canOutQuantity": 10,
-          "combinedSpecsId": 64,
-          "combinedTypeId": 456,
-          "cpId": 20760,
-          "discountPromotion": 465.12,
-          "discountStandard": 348.84,
-          "flgDesign": false,
-          "flgGift": false,
-          "flgNonStandardType": 0,
-          "hasChild": 0,
-          "id": "e4b95f3f-6a46-416f-a817-8c1176cbe541",
-          "itemAmount": 279069.7,
-          "itemIndex": 6,
-          "nonStandardCode": "-",
-          "orderAmount": 279069.7,
-          "orderId": 11981,
-          "orderItemId": 36182,
-          "orderItemQuantity": 1,
-          "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-          "orderPriceSale": 27906.97,
-          "orderQuantity": 10,
-          "outGoingAmount": 279069.7,
-          "outGoingQuantity": 10,
-          "outQuantity": 0,
-          "outStatus": 2,
-          "outStatusString": "未出库",
-          "parentId": "bcad8226-2f13-460a-aa56-a2904e9be29c",
-          "pricePromotion": 6000,
-          "priceStandard": 8000,
-          "promotionId": 273,
-          "promotionItemId": 586,
-          "promotionName": "1115新活动",
-          "promotionPriceType": -2,
-          "promotionPriceTypeName": "正价产品",
-          "promotionType": 2,
-          "promotionTypeName": "组合促销",
-          "rejectQuantity": 0,
-          "skuCode": "CT962EN2200B01",
-          "skuId": 9553940,
-          "skuModel": "HC0962",
-          "skuName": "智能一体机陶瓷体HC0962\\地排305",
-          "skuSpecs": " ",
-          "skuType": 0,
-          "skuTypeName": "",
-          "skuVolume": 2.09,
-          "skuWeight": 0,
-          "spuCode": "HC0962",
-          "spuId": 27537,
-          "standardId": 308,
-          "standardItemId": 213149,
-          "tItemAmount": 279069.7,
-          "tItemQuantity": 10,
-          "titleTag": "HEGII",
-          "unitName": "PCS",
-          "whId": 552,
-          "whName": "钦州运营仓"
-        }
+    // 路由
+    routeObjName: 'order',
+    btnFormData: JSON.stringify({ flag: true }),
+    cardList: [
+      { name: 'main', title: mixins.$t("customerInformation") },
+      { name: 'relation' },
+      { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: true, itemAmt: '', displayNum: 2 },
+      { name: 'other', title: mixins.$t("otherInfo") }
+    ],
+    contentObj: {
+      main: [
+        { code: 'cusName', type: 'selectIcon', urlKey: 'selectCustomers', required: true, readonly: false, title: mixins.$t('customerName') },
+        { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
+        { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
+        { code: 'addressNo', type: 'str', required: true, title: mixins.$t('addressNo') },
+        { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel', title: mixins.$t('saleChannel') },
+        { code: 'cusFrom', name: 'cusFromName', type: 'drop', required: false, dropType: 'customerFrom', title: mixins.$t('customerSource') },
       ],
-      "toiletCount": 2,
-      "designStatus": "设计状态-无需",
-      "tSumPromotion": 94752,
-      "addressFull": "辽宁省沈阳市和平区辽宁省林业和草原局1211代送客户测试001",
-      "merOrderType": 0,
-      "deliveryTime": "2024-01-30T08:00:00+08:00",
-      "sumQuantity": 6,
-      "cpId": 20760,
-      "sumWeight": 315,
-      "orderStatus": "订单状态-通过",
-      "orgId": 32402,
-      "sumAmount": 408752,
-      "customerPhone": "68888184848",
-      "sale2Id": 29195,
-      "sale2OpeMode": "分销模式-代送",
-      "customerId": 3892,
-      "staffName": "王英杰",
-      "tSumGoodsAmount": 408752,
-      "makingUser": 1005,
-      "makingTime": "2024-01-29T10:09:46.288+08:00",
-      "customerFromName": "自然客流",
-      "tSumStandard": 136641,
-      "discountStandard": 299.14,
-      "tSumAmount": 408752,
-      "flgToErp": false,
-      "sumFeeAmount": 0,
-      "orderAnnexPaths": [],
-      "receivable": 408752,
-      "usablePrestore": 0,
-      "makingUserName": "无库无ERP00001",
-      "tDiscountPromotion": 431.39,
-      "addressNo": "1211代送客户测试001",
-      "salesChannelName": "零售",
-      "tSumQuantity": 33,
-      "addressName": "辽宁省林业和草原局",
-      "sumVolume": 2.79,
-      "staffId": 643,
-      "addressArea": {
-        "city": "沈阳市",
-        "district": "和平区",
-        "province": "辽宁省"
-      },
-      "sumPromotion": 94752,
-      "serviceType": 1,
-      "serviceTypeName": "送安一体",
-      "autoOutFlg": false,
-      "sumOutGoingAmount": 408752,
-      "sumOutGoingQuantity": 33,
-      "categoryQuantity": 1
+      relation: [{
+        code: 'orderNo',
+        name: 'orderNo',
+        type: 'choose',
+        controlChooseFlag: true,
+        title: mixins.$t("sourceOrder"),//'关联源单'
+        urlKey: 'choosePurchaseOrder'
+      }],
+      items: [
+        { code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },
+        { code: 'collectAmount', type: 'number', title: mixins.$t("amountCollected"), required: true }
+      ],
+      other: [
+        { code: 'contractNo', type: 'textarea', title: mixins.$t("contractNumber"), readonly: false },
+        { code: 'deliveryDate', type: 'date', required: false, title: mixins.$t("delivery_Time"), required: true },
+        { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: false },
+        { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
+      ]
     },
-    goodsList: [
-      {
-        "activityId": 84,
-        "activityName": "零售活动方案",
-        "canOutQuantity": 1,
-        "cpId": 20760,
-        "discountPromotion": 100,
-        "discountStandard": 11.24,
-        "flgDesign": false,
-        "flgGift": false,
-        "flgNonStandardType": 0,
-        "hasChild": 0,
-        "iconThumPath": "haip/2023-04-21/19ae78a2639547d9aa961b58d20dbdbd.png",
-        "id": "1479b100-c70c-437b-9039-3e598cdb0522",
-        "itemAmount": 999,
-        "itemIndex": 1,
-        "ivtQty": 3,
-        "nonStandardArea": 1,
-        "nonStandardCode": "-",
-        "orderAmount": 999,
-        "orderId": 11981,
-        "orderItemId": 36176,
-        "orderItemQuantity": 1,
-        "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-        "orderPriceSale": 999,
-        "orderQuantity": 1,
-        "outGoingAmount": 999,
-        "outGoingQty": 3,
-        "outGoingQuantity": 1,
-        "outQuantity": 0,
-        "outStatus": 2,
-        "outStatusString": "未出库",
-        "pricePromotion": 999,
-        "priceStandard": 8888,
-        "promotionId": 211,
-        "promotionItemId": 22944,
-        "promotionName": "1",
-        "promotionPriceType": 77,
-        "promotionPriceTypeName": "爆款产品",
-        "promotionType": 1,
-        "promotionTypeName": "单品促销",
-        "rejectQuantity": 0,
-        "skuCode": "EE920A00200B01",
-        "skuId": 9537580,
-        "skuModel": "HE920",
-        "skuName": "【已淘汰】智能盖板HE920",
-        "skuSpecs": " ",
-        "skuType": 0,
-        "skuTypeName": "",
-        "skuVolume": 0.05,
-        "skuWeight": 0,
-        "spuCode": "HE920",
-        "spuId": 65410,
-        "standardId": 308,
-        "tItemAmount": 999,
-        "tItemQuantity": 1,
-        "titleTag": "HEGII",
-        "unitName": "PCS",
-        "usableQty": 0,
-        "whId": 552,
-        "whName": "钦州运营仓"
-      },
-      {
-        "bomSkuCode": "CY901DT2200B01",
-        "bomSkuId": 161052,
-        "canOutQuantity": 1,
-        "cpId": 20760,
-        "discountPromotion": 100,
-        "discountStandard": 100,
-        "flgDesign": false,
-        "flgGift": false,
-        "flgNonStandardType": 0,
-        "hasChild": 0,
-        "id": "5ea261c3-1f36-4a69-b898-940979b805f5",
-        "itemAmount": 3303,
-        "itemIndex": 2,
-        "nonStandardCode": "-",
-        "orderAmount": 3303,
-        "orderId": 11981,
-        "orderItemId": 36177,
-        "orderItemQuantity": 1,
-        "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-        "orderPriceSale": 3303,
-        "orderQuantity": 1,
-        "outGoingAmount": 3303,
-        "outGoingQuantity": 1,
-        "outQuantity": 0,
-        "outStatus": 2,
-        "outStatusString": "未出库",
-        "parentId": "70eab86b-9eb3-44c1-9f6b-7feb444904bd",
-        "pricePromotion": 3303,
-        "priceStandard": 3303,
-        "promotionName": "",
-        "promotionPriceType": -2,
-        "promotionPriceTypeName": "正价产品",
-        "promotionType": 0,
-        "promotionTypeName": "正常品",
-        "rejectQuantity": 0,
-        "skuCode": "CT901DT2200B01",
-        "skuId": 9605810,
-        "skuName": "落地式坐便器HC0901DT\\地排305\\无盖板",
-        "skuSpecs": " ",
-        "skuType": 0,
-        "skuTypeName": "",
-        "skuVolume": 0.235,
-        "skuWeight": 0,
-        "standardId": 308,
-        "standardItemId": 213129,
-        "tItemAmount": 3303,
-        "tItemQuantity": 1,
-        "titleTag": "HEGII",
-        "unitName": "PCS",
-        "whId": 552,
-        "whName": "钦州运营仓"
-      },
-      {
-        "bomSkuCode": "CY901DT2200B01",
-        "bomSkuId": 161052,
-        "canOutQuantity": 1,
-        "cpId": 20760,
-        "discountPromotion": 100,
-        "discountStandard": 100,
-        "flgDesign": false,
-        "flgGift": false,
-        "flgNonStandardType": 0,
-        "hasChild": 0,
-        "id": "bac1205c-a2de-4ed7-808c-b9be59070153",
-        "itemAmount": 4450,
-        "itemIndex": 3,
-        "nonStandardCode": "-",
-        "orderAmount": 4450,
-        "orderId": 11981,
-        "orderItemId": 36178,
-        "orderItemQuantity": 1,
-        "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-        "orderPriceSale": 4450,
-        "orderQuantity": 1,
-        "outGoingAmount": 4450,
-        "outGoingQuantity": 1,
-        "outQuantity": 0,
-        "outStatus": 2,
-        "outStatusString": "未出库",
-        "parentId": "70eab86b-9eb3-44c1-9f6b-7feb444904bd",
-        "pricePromotion": 4450,
-        "priceStandard": 4450,
-        "promotionName": "",
-        "promotionPriceType": -2,
-        "promotionPriceTypeName": "正价产品",
-        "promotionType": 0,
-        "promotionTypeName": "正常品",
-        "rejectQuantity": 0,
-        "skuCode": "CQ501000000N01",
-        "skuId": 9607630,
-        "skuName": "电控盖板HQ501",
-        "skuSpecs": " ",
-        "skuType": 0,
-        "skuTypeName": "",
-        "skuVolume": 0.063,
-        "skuWeight": 0,
-        "standardId": 308,
-        "standardItemId": 213130,
-        "tItemAmount": 4450,
-        "tItemQuantity": 1,
-        "titleTag": "HEGII",
-        "unitName": "PCS",
-        "whId": 552,
-        "whName": "钦州运营仓"
-      },
-      {
-        "activityId": 84,
-        "activityName": "零售活动方案",
-        "canOutQuantity": 10,
-        "combinedSpecsId": 68,
-        "combinedTypeId": 462,
-        "cpId": 20760,
-        "discountPromotion": 465.12,
-        "discountStandard": 186.05,
-        "flgDesign": false,
-        "flgGift": false,
-        "flgNonStandardType": 0,
-        "hasChild": 0,
-        "iconThumPath": "haip/2023-10-04/ded5bc0e7a9446cc831dd831b6b6bc47.png",
-        "id": "b7558b1f-0b9e-4dce-9846-c5e6ea993e96",
-        "itemAmount": 27907,
-        "itemIndex": 4,
-        "nonStandardCode": "-",
-        "orderAmount": 27907,
-        "orderId": 11981,
-        "orderItemId": 36180,
-        "orderItemQuantity": 1,
-        "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-        "orderPriceSale": 2790.7,
-        "orderQuantity": 10,
-        "outGoingAmount": 27907,
-        "outGoingQuantity": 10,
-        "outQuantity": 0,
-        "outStatus": 2,
-        "outStatusString": "未出库",
-        "parentId": "bcad8226-2f13-460a-aa56-a2904e9be29c",
-        "pricePromotion": 600,
-        "priceStandard": 1500,
-        "promotionId": 273,
-        "promotionItemId": 598,
-        "promotionName": "1115新活动",
-        "promotionPriceType": -2,
-        "promotionPriceTypeName": "正价产品",
-        "promotionType": 2,
-        "promotionTypeName": "组合促销",
-        "rejectQuantity": 0,
-        "skuCode": "FF1016000CHB0A",
-        "skuId": 9418430,
-        "skuModel": "HMF101-150",
-        "skuName": "【已淘汰】面盆龙头HMF101-150\\壁式暗装\\单柄双控\\翻板式下水器",
-        "skuSpecs": " ",
-        "skuType": 0,
-        "skuTypeName": "",
-        "skuVolume": 0.05,
-        "skuWeight": 128,
-        "spuCode": "HMF101-150",
-        "spuId": 6938,
-        "standardId": 308,
-        "standardItemId": 213154,
-        "tItemAmount": 27907,
-        "tItemQuantity": 10,
-        "titleTag": "HEGII",
-        "unitName": "PCS",
-        "whId": 552,
-        "whName": "钦州运营仓"
-      },
+    //按钮
+    buttonSaveList: [
+      { code: 'collection', title: mixins.$t("collection"), width: '120rpx', color: '#CAA977' },
+      { code: 'save', title: mixins.$t("save"), width: '120rpx', color: '#1B365D' }
+    ],
+    contentSaveList: [
+      { code: 'flag', title: mixins.$t("saleOutBoundFlag"), type: 'checkbox' },
+      { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
+      { code: 'receivable', content: 0, type: 'number' }
+    ],
+    popContent: [
+      { code: 'itemQty', type: 'step', title: mixins.$t("count"), required: true },
+      { code: 'priceSale', type: 'number', title: mixins.$t("priceSale"), required: true },
       {
-        "activityId": 84,
-        "activityName": "零售活动方案",
-        "canOutQuantity": 10,
-        "combinedSpecsId": 67,
-        "combinedTypeId": 457,
-        "cpId": 20760,
-        "discountPromotion": 465.12,
-        "discountStandard": 372.09,
-        "flgDesign": false,
-        "flgGift": false,
-        "flgNonStandardType": 0,
-        "hasChild": 0,
-        "id": "32a7c7ba-5572-485e-a895-96b6ddf18219",
-        "itemAmount": 93023.3,
-        "itemIndex": 5,
-        "nonStandardCode": "-",
-        "orderAmount": 93023.3,
-        "orderId": 11981,
-        "orderItemId": 36181,
-        "orderItemQuantity": 1,
-        "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-        "orderPriceSale": 9302.33,
-        "orderQuantity": 10,
-        "outGoingAmount": 93023.3,
-        "outGoingQuantity": 10,
-        "outQuantity": 0,
-        "outStatus": 2,
-        "outStatusString": "未出库",
-        "parentId": "bcad8226-2f13-460a-aa56-a2904e9be29c",
-        "pricePromotion": 2000,
-        "priceStandard": 2500,
-        "promotionId": 273,
-        "promotionItemId": 587,
-        "promotionName": "1115新活动",
-        "promotionPriceType": -2,
-        "promotionPriceTypeName": "正价产品",
-        "promotionType": 2,
-        "promotionTypeName": "组合促销",
-        "rejectQuantity": 0,
-        "skuCode": "FB1033000CHB0A",
-        "skuId": 9571300,
-        "skuName": "【已淘汰】淋浴大花洒HMF103-333M\\壁式明装\\三功能",
-        "skuSpecs": " ",
-        "skuType": 0,
-        "skuTypeName": "",
-        "skuVolume": 0.6,
-        "skuWeight": 187,
-        "standardId": 308,
-        "standardItemId": 213151,
-        "tItemAmount": 93023.3,
-        "tItemQuantity": 10,
-        "titleTag": "HEGII",
-        "unitName": "PCS",
-        "whId": 552,
-        "whName": "钦州运营仓"
+        code: 'whId', name: 'whName', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'openingInventory',
       },
-      {
-        "activityId": 84,
-        "activityName": "零售活动方案",
-        "canOutQuantity": 10,
-        "combinedSpecsId": 64,
-        "combinedTypeId": 456,
-        "cpId": 20760,
-        "discountPromotion": 465.12,
-        "discountStandard": 348.84,
-        "flgDesign": false,
-        "flgGift": false,
-        "flgNonStandardType": 0,
-        "hasChild": 0,
-        "id": "e4b95f3f-6a46-416f-a817-8c1176cbe541",
-        "itemAmount": 279069.7,
-        "itemIndex": 6,
-        "nonStandardCode": "-",
-        "orderAmount": 279069.7,
-        "orderId": 11981,
-        "orderItemId": 36182,
-        "orderItemQuantity": 1,
-        "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-        "orderPriceSale": 27906.97,
-        "orderQuantity": 10,
-        "outGoingAmount": 279069.7,
-        "outGoingQuantity": 10,
-        "outQuantity": 0,
-        "outStatus": 2,
-        "outStatusString": "未出库",
-        "parentId": "bcad8226-2f13-460a-aa56-a2904e9be29c",
-        "pricePromotion": 6000,
-        "priceStandard": 8000,
-        "promotionId": 273,
-        "promotionItemId": 586,
-        "promotionName": "1115新活动",
-        "promotionPriceType": -2,
-        "promotionPriceTypeName": "正价产品",
-        "promotionType": 2,
-        "promotionTypeName": "组合促销",
-        "rejectQuantity": 0,
-        "skuCode": "CT962EN2200B01",
-        "skuId": 9553940,
-        "skuModel": "HC0962",
-        "skuName": "智能一体机陶瓷体HC0962\\地排305",
-        "skuSpecs": " ",
-        "skuType": 0,
-        "skuTypeName": "",
-        "skuVolume": 2.09,
-        "skuWeight": 0,
-        "spuCode": "HC0962",
-        "spuId": 27537,
-        "standardId": 308,
-        "standardItemId": 213149,
-        "tItemAmount": 279069.7,
-        "tItemQuantity": 10,
-        "titleTag": "HEGII",
-        "unitName": "PCS",
-        "whId": 552,
-        "whName": "钦州运营仓"
-      }
+      { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
+      { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', },
     ],
-    isStockUp: false,
-    item: {
-      "addressArea": {
-        "city": "沈阳市",
-        "district": "和平区",
-        "province": "辽宁省"
-      },
-      "addressFull": "辽宁省沈阳市和平区辽宁省林业和草原局1211代送客户测试001",
-      "addressGcj02": {
-        "latitude": 41.803274,
-        "longitude": 123.408179
-      },
-      "addressName": "辽宁省林业和草原局",
-      "addressNo": "1211代送客户测试001",
-      "ageComposition": null,
-      "ageCompositionName": null,
-      "apvResult": "审-通过",
-      "apvResultName": "通过",
-      "apvSubmitId": null,
-      "apvUserIds": [],
-      "ascpId": 29195,
-      "bankAccount": null,
-      "bankDeposit": null,
-      "categoryQuantity": 1,
-      "channelName": null,
-      "contactName": "",
-      "deliveryPhone": "",
-      "contractNo": null,
-      "cpId": 20760,
-      "crmOrderNo": null,
-      "customerCode": "68888184848-100304",
-      "customerFrom": -1,
-      "customerFromName": null,
-      "customerId": 3892,
-      "customerName": "1211代送客户测试001",
-      "customerPhone": "68888184848",
-      "customerType": null,
-      "customerTypeName": null,
-      "decisionMaker": null,
-      "decisionMakerName": null,
-      "deliveryTime": "2024-01-30 08:00:00",
-      "deliveryTypeName": null,
-      "designRemarks": null,
-      "designStatus": "设计状态-无需",
-      "designStatusName": "不需要设计",
-      "designUser": null,
-      "designUserName": null,
-      "discountPromotion": 431.39,
-      "discountStandard": 299.14,
-      "displayStatus": "成交",
-      "docCode": "销售订单",
-      "earnestAmount": null,
-      "editTime": "2024-01-29 10:09:46",
-      "entryStatus": "入库状态-未入",
-      "entryTime": null,
-      "erpOrgCode": "",
-      "erpPushResult": null,
-      "erpPushStatus": 2,
-      "estateId": null,
-      "estateName": null,
-      "fitupStyle": null,
-      "fitupStyleName": null,
-      "fitupType": null,
-      "fitupTypeName": null,
-      "flgValid": true,
-      "houseType": null,
-      "houseTypeName": null,
-      "kujialeDesignId": null,
-      "kujialeNo": null,
-      "kujialePricePaths": null,
-      "makingTime": "2024/01/29",
-      "makingTimeConvert": "2024-01-29 10:09:46",
-      "makingUser": 1005,
-      "makingUserName": "无库无ERP00001",
-      "merOrderType": 0,
-      "merOrderTypeName": "非跟单",
-      "orderId": 11981,
-      "orderItemVOList": null,
-      "orderNo": "SA-QZHJ-BFJ-202401290SAY",
-      "orderStatus": "订单状态-通过",
-      "orderStatusName": "成交",
-      "orderType": 2,
-      "orgCode": "GXBH1002",
-      "orgId": 32402,
-      "orgList": null,
-      "orgName": "北海富安居店",
-      "outStatus": "出库状态-未出",
-      "outStatusName": "未出库",
-      "receiptStatus": "收款状态-未收",
-      "receiptStatusName": "未收款",
-      "receivable": 408752,
-      "rejectStatusString": null,
-      "remarks": null,
-      "sale1Id": 20760,
-      "sale2Id": 29195,
-      "sale2OpeMode": "分销模式-代送",
-      "salesChannel": 1,
-      "salesChannelName": "零售",
-      "sorderId": null,
-      "sorderNo": null,
-      "staffCode": "12222222222@QZHJ",
-      "staffId": 1005,
-      "staffList": null,
-      "staffName": "无库无ERP00001",
-      "storeCode": "GXBH1002",
-      "storeId": 4421,
-      "storeName": "北海富安居店",
-      "storeType": null,
-      "storeTypeName": "直营门店",
-      "sumAmount": 408752,
-      "sumCollectedAmount": 0,
-      "sumFeeAmount": 0,
-      "sumGoodsAmount": 408752,
-      "sumOutAmount": 0,
-      "sumPromotion": 94752,
-      "sumQuantity": 33,
-      "sumReceiptAmount": 0,
-      "sumRejectAmount": 0,
-      "sumStandard": 136641,
-      "sumUsePrestore": 0,
-      "sumVolume": 2.79,
-      "sumWeight": 315,
-      "supplierCode": null,
-      "supplierId": null,
-      "supplierName": null,
-      "tdiscountPromotion": 431.39,
-      "tdiscountStandard": 299.14,
-      "toiletCount": null,
-      "toiletCountName": null,
-      "tsumAmount": 408752,
-      "tsumGoodsAmount": 408752,
-      "tsumPromotion": 94752,
-      "tsumQuantity": 33,
-      "tsumStandard": 136641
-    },
-    orgItem: {
-      "text": "",
-      "value": null
-    },
-    showcheckbox: false,
-    staffItem: {
-      "text": "选择业务员",
-      "value": null
-    },
-    tags: [],
-    whNameFlag: false,
-    loading: false,
-    orderAnnexPaths: [],
-    orderfileList: []
-  },
-  /**
-   * @desc : 输入事件监听
-   * @author : 王英杰
-   * @date : 2023年9月12日
-   */
-  changeField(e) {
-    let key = e.currentTarget.dataset.key
-    let form = this.data.form
-    form[key] = e.detail
-    this.setData({
-      form,
-    })
-  },
-  /** 跳转选择库区*/
-  toChooseWhName(e) {
-    if (this.data.form.sale2OpeMode == "分销模式-代送") {
-      return
-    }
-    wx.navigateTo({
-      url: '/package6/pages/choose-product/choose-product?sourcePage=' + 'sales-outbound-detail' + '&title=新建销售出库' + "&item=" + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + "&ascpId=" + this.data.form.ascpId,
-    })
   },
   /**
-   * @desc : 商品数量编辑
-   * @author : 王英杰
-   * @date : 2023年10月24日
-   */
-  changeAllreadyChooseQuantityPop(e) {
-    let currentChoosedItem = this.data.currentChoosedItem
-    currentChoosedItem.outGoingQuantity = e.detail
-    //非标品 带面积的 要成面积
-    if (currentChoosedItem.nonStandardArea) {
-      currentChoosedItem.itemAmount = Number(currentChoosedItem.orderPriceSale * currentChoosedItem.outGoingQuantity * res.nonStandardArea).toFixed(2)
-    } else {
-      currentChoosedItem.itemAmount = Number(currentChoosedItem.orderPriceSale * currentChoosedItem.outGoingQuantity).toFixed(2)
-    }
-    this.setData({
-      currentChoosedItem: currentChoosedItem
-    })
-  },
-  /**
-   * @desc : 选择送货人
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  changeDeliveryMan() {
-    // this.getContactData()
-    this.setData({
-      DeliveryManFlag: true
-    })
-  },
-  /**
-   * @desc : 选择安装员
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  changeInstaller() {
-    // this.getContactData()
-    this.setData({
-      InstallerFlag: true
-    })
-  },
-  /**
-   * @desc : 确定修改
+   * @desc   : 打开商品事件
    * @author : 于继渤
-   * @date : 2022/5/26 12:16
+   * @date   : 2024/1/26 11:46
    */
-  updateToChooseList(e) {
-    var goodsList = this.data.goodsList
-    var index = this.data.ProductIndex
-    var currentChoosedItem = this.data.currentChoosedItem
-    goodsList[index].nonGlassList = []
-    goodsList[index].nonGlassListShow = ''
-
-    //校验商品数量
-    if (currentChoosedItem.outGoingQuantity <= 0) {
-      wx.showToast({
-        title: '待出库数量不能为0',
-        icon: 'none'
-      })
-      return
-    }
-    if (currentChoosedItem.outQuantity > currentChoosedItem.outGoingQuantity) {
-      wx.showToast({
-        title: '本次出库量不能大于待出库量',
-        icon: 'none'
-      })
-      return
-    }
-    if (this.data.form.sale2OpeMode != "分销模式-代送") {
-      if (currentChoosedItem.usableQty < currentChoosedItem.outGoingQuantity) {
-        wx.showToast({
-          title: "当前商品库存可售量不足,无法出库",
-          icon: 'none'
-        })
-        return
-      }
-    }
-    //非标定制品标价参数赋值
-    if (currentChoosedItem.nonStandardList && currentChoosedItem.nonStandardList.length > 0) {
-      let nonStandardList = util.copyObj(currentChoosedItem.nonStandardList)
-      let nonStandardObjList = []
-      nonStandardList.forEach(res => {
-        let nonStandardObj = {
-          fieldId: null,
-          fieldCode: null,
-          fieldName: null,
-          optionCode: null,
-          optionName: null,
-        }
-        nonStandardObj.fieldId = res.fieldId
-        nonStandardObj.fieldCode = res.fieldCode
-        nonStandardObj.fieldName = res.fieldName
-        nonStandardObj.isScope = res.isScope
-        //判断是否是范围值
-        if (res.isScope == 1) {
-          nonStandardObj.optionCode = res.optionCode
-          nonStandardObj.optionName = res.optionName
-        }
-        if (res.options && res.options.length > 0) {
-          res.options.forEach(it => {
-            if (it.infotype == 'info') {
-              nonStandardObj.optionCode = it.code
-              nonStandardObj.optionName = it.name
-            }
-          })
-        }
-        //没有选择的参数不会设置
-        if (nonStandardObj.optionCode) {
-          nonStandardObjList.push(nonStandardObj)
-        }
-
-      })
-
-      currentChoosedItem.nonGlassList = nonStandardObjList //订单明细字段
-
-      goodsList[index].nonGlassList = nonStandardObjList
-      //设置显示非标参数 (展示非标text)
-      if (nonStandardObjList && nonStandardObjList.length > 0) {
-        let nonGlassListShowTemp = []
-        nonStandardObjList.forEach(it => {
-          nonGlassListShowTemp.push(it.fieldName + ':' + it.optionName)
-        })
-        //非标参数显示/匹配命中标价的数据
-        // currentChoosedItem.nonGlassListShow =[]
-        currentChoosedItem.nonGlassListShow = nonGlassListShowTemp.join(',')
-        goodsList[index].nonGlassListShow = nonGlassListShowTemp.join(',')
-      }
-
-
-
-      goodsList[index].nonStandardList = currentChoosedItem.nonStandardList
-      goodsList[index].priceStandard = currentChoosedItem.priceStandard
-    }
-    goodsList[index].outGoingQuantity = currentChoosedItem.outGoingQuantity
-    goodsList[index].itemQuantity = currentChoosedItem.itemQuantity //商品数量
-    goodsList[index].outQuantity = currentChoosedItem.outQuantity
-    goodsList[index] = Object.assign({}, goodsList[index], currentChoosedItem); //2023年10月30日  把选择得商品 覆盖当前商品对应得值 
-    if (currentChoosedItem.flgNonStandardType == 1 || currentChoosedItem.flgNonStandardType == 2) {
-      goodsList[index].nonStandardArea = currentChoosedItem.nonStandardArea //面积
-    }
-
-    goodsList[index].usedLocation = currentChoosedItem.usedLocation //使用位置
-    goodsList[index].orderPriceSalet = currentChoosedItem.orderPriceSalet //销售价格
-    goodsList[index].flgGift = currentChoosedItem.flgGift //赠品标识
-    goodsList[index].nonstandardRemarks = currentChoosedItem.nonstandardRemarks //非标备注
-    goodsList[index].remarks = currentChoosedItem.remarks //备注
-    goodsList[index].itemAmount = currentChoosedItem.itemAmount //销售金额
-    goodsList[index].discountPromotion = currentChoosedItem.discountPromotion //标准售价折扣
-    goodsList[index].discountStandard = currentChoosedItem.discountStandard //标价折扣
-    if (goodsList[index].goodsSkuList && goodsList[index].goodsSkuList.length > 0) {
-
-      goodsList[index].goodsSkuList.forEach(res => {
-        if (currentChoosedItem.flgGift) {
-          res.orderPriceSalet = 0
-        }
-        res.warehouseId = currentChoosedItem.warehouseId ? currentChoosedItem.warehouseId : null
-        res.warehouseName = currentChoosedItem.warehouseName ? currentChoosedItem.warehouseName : null
-        res.whId = currentChoosedItem.whId ? currentChoosedItem.whId : null
-        res.whId_Name = currentChoosedItem.warehouseName ? currentChoosedItem.warehouseName : null
-        res.itemQuantity = currentChoosedItem.itemQuantity * res.orderItemQuantity
-      })
-
-    }
-
-    //使用位置标签功能↓↓↓↓↓
-    let tags = this.data.tags
-    for (let i = 0; i < tags.length; i++) {
-      if (tags[i].usedLocation === currentChoosedItem.usedLocation) {
-        tags.splice(i, 1)
-      }
-    }
-    if (currentChoosedItem.usedLocation) {
-      currentChoosedItem.usedLocation.replace(/\s*/g, "");
-    }
-    if (goodsList[index].usedLocation == undefined || goodsList[index].usedLocation == '' || currentChoosedItem.usedLocation.trim() == '') {
-
-    } else {
-      tags.push({
-        usedLocation: currentChoosedItem.usedLocation
-      })
-      for (let i = 0; i < goodsList.length; i++) {
-        //列表后五个
-        if (i >= index && goodsList[i].usedLocation == undefined) {
-          goodsList[i].usedLocation = currentChoosedItem.usedLocation
-        }
-      }
-    }
-    if (currentChoosedItem.outQuantity == currentChoosedItem.outGoingQuantity) {
-      goodsList[index].checked = true
-    } else {
-      goodsList[index].checked = false
-    }
-    //使用位置标签功能↑↑↑↑↑↑↑
-    this.setData({
-      tags: tags,
-      goodsList: goodsList,
-      showEditProduct: false
-    })
-    if (!currentChoosedItem.flgGift) {
-      this.handleData(goodsList)
-    }
-
-    this.setData({
-      EditProduct_priceSale_temp: null
-    })
-    setTimeout(() => {
-      // 更新组合中的隐藏的bom信息
-      this.updateBomCombined(goodsList[index].goodsSkuList, currentChoosedItem)
-      let num = 0
-      this.data.goodsList.forEach(function (res, index) {
-        if ((!res.usableQty) || (res.usableQty && (res.usableQty < res.outGoingQuantity))) {
-          num++
-        }
-      })
-      if (num > 0) {
-        this.setData({
-          isStockUp: false
-        })
-      } else {
-        this.setData({
-          isStockUp: true
-        })
-      }
-      this.countGoodsList(goodsList)
-    }, 300)
-  },
-  /**
-   * @desc : 更新组合中BOM数量等
-   * @author : 周兴
-   * @date : 2022/9/20 18:16
-   */
-  updateBomCombined(goodsSkuList, pRow) {
-    if (goodsSkuList && goodsSkuList.length > 0) {
-      let filterRows = goodsSkuList.filter(it => it.bomSkuCombined && it.bomSkuCombined.length > 0);
-      if (filterRows && filterRows.length > 0) {
-        filterRows.forEach(it => {
-          // 数量
-          it.itemQuantity = Number(pRow.itemQuantity) * Number(it.orderItemQuantity)
-          let bomSkuCombined = it.bomSkuCombined;
-          let itemAmount = 0;
-          let sumVolume = 0;
-          let sumWeight = 0;
-          let skuVolume = 0;
-          let skuWeight = 0;
-          bomSkuCombined.forEach(t => {
-            let rows = goodsSkuList.filter(row => row.id == t);
-            if (rows && rows.length > 0) {
-              skuVolume = Number(rows[0].skuVolume) * Number(rows[0].itemQuantity);
-              sumVolume += skuVolume;
-              skuWeight = Number(rows[0].skuWeight) * Number(rows[0].itemQuantity);
-              sumWeight += skuWeight;
-              if (rows[0].itemQuantity && rows[0].priceSale) {
-                itemAmount += Number(rows[0].itemQuantity) * Number(rows[0].priceSale);
-              }
-            }
-          })
-          it.skuVolume = sumVolume;
-          it.skuWeight = sumWeight;
-          it.itemAmount = itemAmount;
-          it.priceSale = it.itemQuantity == 0 ? 0 : (itemAmount / it.itemQuantity).toFixed(2)
-          it.discountPromotion = it.pricePromotion == 0 ? 0 : Number((it.priceSale * 100 / it.pricePromotion).toFixed(2));
-          it.discountStandard = it.priceStandard == 0 ? 0 : Number((it.priceSale * 100 / it.priceStandard).toFixed(2));
-        })
-      }
-    }
+  openChoosedItemInfo(e) {
+    console.log('openChoosedItemInfo', e)
   },
-  /**
-   * @desc : 处理数据
-   * @author : 于继渤
-   * @date : 2022/5/31 18:16
-   */
-  handleData(goodsList) {
-    let followFlag = this.data.followFlag;
-    if (goodsList != null && goodsList.length > 0) {
-      goodsList.forEach(it => {
-        // 跟单处理为实际量
-        if (followFlag) {
-          it.tItemQuantity = it.itemQuantity
-          it.tItemAmount = it.itemAmount
-        }
-        // ***如果有子级,需要处理子级的数据
-        if (it.bomItems != null && it.bomItems.length > 0) {
-
-          it.bomItems.forEach(row => {
-            row.warehouseId = it.warehouseId ? it.warehouseId : null
-            row.warehouseName = it.warehouseName ? it.warehouseName : null
-            row.whId_Name = it.warehouseName ? it.warehouseName : null
-            row.whId = it.whId ? it.whId : null
-            // 数量的处理
-            if (followFlag) {
-              row.tItemQuantity = it.itemQuantity * row.orderItemQuantity
-            } else {
-              row.itemQuantity = it.itemQuantity * row.orderItemQuantity
-            }
-            // 如果单品促销
-            if (it.promotionType == Constants.PROMOTION_TYPE.PRMOTION ||
-              it.promotionType == Constants.PROMOTION_TYPE.COMBINED) {
-              it.pricePromotion = it.pricePromotion ? it.pricePromotion : 0;
-              if (it.pricePromotion == 0) {
-                row.priceSale = 0
-              } else {
-                // 销售价(子级)= 销售价(父级)/ 标售售价(父级)* 标售售价(子级)
-                row.priceSale = Number(it.priceSale / it.pricePromotion * row.pricePromotion).toFixed(2)
-              }
-            } else {
-              it.priceStandard = it.priceStandard ? it.priceStandard : 0;
-              // 正常品
-              if (it.priceStandard == 0) {
-                row.priceSale = 0
-              } else {
-                // 销售价(子级)= 销售价(父级)/ 标售售价(父级)* 标售售价(子级)
-                row.priceSale = Number(it.priceSale / it.priceStandard * row.priceStandard).toFixed(2)
-              }
-            }
-            if (followFlag) {
-              row.tItemAmount = Number(row.priceSale * row.tItemQuantity).toFixed(2)
-            } else {
-              row.itemAmount = Number(row.priceSale * row.itemQuantity).toFixed(2)
-            }
-
-          })
-          it.goodsSkuList = it.bomItems
-        }
-        // **** 如果有组合促销,需要进行数据的处理
-        if (it.combinedList != null && it.combinedList.length > 0) {
-          it.hasChild = 1; // 说明有子级
-          it.goodsSkuList = []
-          it.combinedList.forEach(row => {
-            row.warehouseId = it.warehouseId ? it.warehouseId : null
-            row.warehouseName = it.warehouseName ? it.warehouseName : null
-            row.whId_Name = it.warehouseName ? it.warehouseName : null
-            row.whId = it.whId ? it.whId : null
-            // 如果没有bom,直接加入到goodsSkuList
-            if (row.bomItems == null || row.bomItems.length == 0) {
-              if (!row.cpFlgGift) {
-                // 重新计算价格
-                row.priceSale = this.getCombinedSalePrice(it, row);
-                // 重新计算折扣
-                this.getCombinedDiscount(row);
-                // 计算数量
-                row.itemQuantity = Number(it.itemQuantity) * Number(row.orderItemQuantity)
-                row.itemAmount = Number(row.itemQuantity) * Number(row.priceSale)
-                // 跟单处理为实际量
-                if (followFlag) {
-                  row.tItemQuantity = row.itemQuantity
-                  row.tItemAmount = row.itemAmount
-                }
-              }
-
-              it.goodsSkuList.push(row);
-            } else {
-              row.bomItems.forEach(ott => {
-                ott.warehouseId = it.warehouseId ? it.warehouseId : null
-                ott.warehouseName = it.warehouseName ? it.warehouseName : null
-                ott.whId_Name = it.warehouseName ? it.warehouseName : null
-                ott.whId = it.whId ? it.whId : null
-              })
-
-
-
-              if (!row.cpFlgGift) {
-                row.bomItems.forEach(bRow => {
 
-                  // 重新计算价格
-                  bRow.priceSale = this.getCombinedSalePrice(it, bRow);
-                  // 重新计算折扣
-                  this.getCombinedDiscount(bRow);
-                  // 数量的处理
-                  bRow.itemQuantity = Number(it.itemQuantity) * Number(bRow.orderItemQuantity)
-                  bRow.itemAmount = Number(bRow.priceSale) * Number(bRow.itemQuantity).toFixed(2)
-                  if (followFlag) {
-                    bRow.tItemQuantity = bRow.itemQuantity
-                    bRow.tItemAmount = bRow.itemAmount
-                  }
-
-                  it.goodsSkuList.push(bRow);
-                })
-              }
-
-            }
-
-          })
-        }
-      })
-      // 重新计算最后一条数据的金额,用父级金额-其他条金额合计
-      common.countLastAmount(goodsList, false);
 
-    }
-    this.setData({
-      goodsList: goodsList
-    })
-  },
-  /**
-   * @desc : 编辑商品关闭编辑备注事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  closeChoosedItemInfo_remark() {
-    this.setData({
-      remarkFlag: false
-    })
-  },
   /**
-   * @desc : 关闭产品
+   * @desc   : 计算金额
    * @author : 于继渤
-   * @date : 2022/5/26 12:16
+   * @date   : 2024/1/26 11:46
    */
-  closeChoosedItemInfo() {
-    this.setData({
-      showEditProduct: false,
-      currentChoosedItem: []
-    })
-  },
-  /**
-   * @desc : 打开商品
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  openChoosedItemInfo(e) {
-
-    let item = e.currentTarget.dataset.item
-    console.log("weisha a ", item)
-    item.itemQuantity = item.outGoingQuantity
-    item.usableQty = item.usableQty
-    let index = e.currentTarget.dataset.index
-    this.setData({
-      usedLocation: item.usedLocation,
-      ProductIndex: index,
-      currentChoosedItem: item,
-      showEditProduct: true,
-      EditProduct_priceSale_temp: item.itemAmount
-    })
+  calculateAmount(goodsItem, index) {
+    let formData = JSON.parse(this.data.formData)
+    if (goodsItem) {
+
+      //设置商品信息
+      goodsItem.amtStd = Number(goodsItem.priceStd * goodsItem.itemQty) //合计标价金额
+      goodsItem.itemAmt = goodsItem.priceSale * goodsItem.itemQty //商品金额
+      goodsItem.priceDiscount = Number((goodsItem.priceSale / goodsItem.priceStd) * 100).toFixed(2)//售价折扣
+      formData.goodsList[index] = goodsItem
+
+      ///设置总单信息
+      let sumStandard = Number(0)
+      let sumAmount = Number(0)
+      let sumQuantity = Number(0)
+      formData.goodsList.forEach(item => {
+        //标价合计 =  商品标价 x  商品数量
+        sumStandard += item.amtStd
+        sumAmount += item.itemAmt //没有售价默认取标价
+        sumQuantity += item.itemQty //数量
 
-    //非标淋浴房
-    if ((item.flgNonStandardType == 1 || item.flgNonStandardType == 2) || (item.nonGlassList && item.nonGlassList.length > 0)) {
-      // item.nonStandardList = []
-      //加载默认spu非标参数数据
-      let copyItem = util.copyObj(item)
-      this.getFlgNonStandardList(copyItem)
-      this.setData({
-        show7: true
       })
-
-      this.getSkuBySpuId(copyItem.spuId)
-      this.setData({
-        show6: true
-      })
-    } else {
+      formData.sumStandard = sumStandard
+      formData.saleDiscount = Number((sumAmount / sumStandard) * 100).toFixed(2)
+      formData.sumAmount = sumAmount
+      formData.canUseCollect = 0
+      formData.useCollect = 0
+      formData.sumQuantity = sumQuantity
+      console.log('formData', formData)
       this.setData({
-        show6: false,
-        show7: false
+        formData: JSON.stringify(formData)
       })
     }
   },
-  getSkuBySpuId(spuId) {
-    let param = {}
-    param.spuId = spuId
-    param.cpId = app.globalData.user.cpId;
-    param.orgId = app.globalData.user.orgId;
-    api.request(Constants.GOODS_SPU_SPECS + 'select_sku_by_spu_id', 'POST', param).then(res => {
-      if (res.data.code === 200) {
-        if (res.data.data.skuData && res.data.data.skuData.length > 0) {
-          let list = util.copyObj(res.data.data.skuData)
-          let currentChoosedItem = this.data.currentChoosedItem
-          list.forEach(it => {
-            if (it.skuId == currentChoosedItem.skuId) {
-              it.infotype = 'info'
-            }
-          })
-          this.setData({
-            skuData: list,
 
-          })
-        }
-      }
-    })
-  },
   /**
-   * @desc : 根据spuid查询非标参数
+   * @desc   : 选择回调
    * @author : 于继渤
-   * @date : 2022/8/24 13:16
-   */
-  getFlgNonStandardList(item) {
-    let param = {
-      spuId: item.spuId,
-      cpId: app.globalData.user.cpId
-    }
-    api.request(Constants.GOODS_SPU_API + 'get_flg_non_standard_list', 'POST', param).then(res => {
-
-      if (res.data.code == 200) {
-        let data = res.data.data
-        if (data && data.length > 0) {
-          data.forEach(item => {
-            if (item.options && item.options.value && item.options.value != '[]') {
-              item.options = JSON.parse(item.options.value)
-              item.options.forEach(it => {
-                it.infotype = 'default'
-              })
-            }
-          })
-        }
-        let dataTemp = util.copyObj(data) //拷贝数据
-        let data_nonStandardList = [...data]
-        item.nonStandardList = data_nonStandardList
-        this.setData({
-          nonStandardList: dataTemp
-        })
-        if (this.data.orderEdit_type == 1) {
-          this.setData({
-            currentChoosedItem: item,
-          })
-          //显示查询的参数
-          this.setDefault(item)
-        } else {
-
-          item.nonGlassListShow = ''
-          item.nonGlassList = []
-        }
-      }
-    })
-  },
-  /**
-   * @desc : 选择业务员
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  openStaffDropdown() {
-
-    return
-
-    this.setData({
-      staffFlag: true
-    })
-  },
-  /**
-   * @desc : 选择业务部门
-   * @author : 王英杰
-   * @date : 2023年10月8日
+   * @date   : 2024/1/26 11:46
    */
-  openOrgDropdown() {
-    return
-    this.setData({
-      orgFlag: true
-    })
-
-
-  },
-  /**
-   * @desc : 入库处理/入库回退
-   * @author : 常皓宁
-   * @date : 2023/9/5 8:44
-   */
-  deal() {
-    let data = this.data.item
-    Dialog.confirm({
-      message: '确认要进行该操作吗?',
-    }).then(() => {
-      let param = {
-        cpId: app.globalData.user.cpId,
-        entryId: data.entryId,
-        entryWhId: this.data.form.whId,
+  chooseData(e) {
+    console.log('eee1', e);
+    let item = e.detail.data
+    let code = e.detail.code
+    let formData = JSON.parse(this.data.formData)
+    //设置客户信息
+    if (code == 'cusName') {
+      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,
       }
-      if (data.entryStatus == 3) {
-        api.request(Constants.ORDER_ENTRY_API + 'complete_revocation_entry', 'POST', param).then(res => {
-          if (res.data.code == 200) {
-            wx.showToast({
-              title: '提交成功',
-              image: '/static/image/success.png',
-              duration: 1000
-            })
-            wx.navigateBack({
-              delta: 1
-            })
-            var pages = getCurrentPages();
-            var prevPage = pages[pages.length - 2];
-            prevPage.setData({
-              entryFlag: true
-            })
-          }
-        })
-      } else {
-        api.request(Constants.ORDER_ENTRY_API + 'purcase_entry_completed', 'POST', param).then(res => {
-          if (res.data.code == 200) {
-            wx.showToast({
-              title: '提交成功',
-              image: '/static/image/success.png',
-              duration: 1000
-            })
-            wx.navigateBack({
-              delta: 1
-            })
-            var pages = getCurrentPages();
-            var prevPage = pages[pages.length - 2];
-            prevPage.setData({
-              entryFlag: true
-            })
-          }
-        })
-      }
-    }).catch(() => {});
-  },
-  /**
-   * @desc : 组件单选确定
-   * @author : 王英杰
-   * @date : 2023年9月5日
-   */
-  mutiSearch(e) {
-    let id = e.target.id
-    let form = this.data.form
-    if (id === 'staff') { //责任人
-      form.staffName = e.detail.name
-      form.staffId = e.detail.id
+      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
     }
-    if (id === 'org') { //部门
-      form.orgName = e.detail.name
-      form.orgId = e.detail.id
+    ///设置主从业务员
+    if (code == 'staff') {
+      formData.staff = item.staffItem
+      formData['staffId'] = item.staffMain.staffId
+      formData['staffName'] = item.staffMain.staffName
+      formData['staffList'] = item.staffList
+      console.log(item.staffList)
     }
-
-    this.setData({
-      form,
-      staffFlag: false,
-      orgFlag: false,
-    })
-  },
-  /**
-   * @desc : 服务类型单选下拉打开事件
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  openServiceTypeEvent(e) {
-    let type = e.currentTarget.dataset.type
-    if (type === 'ServiceType') {
-      this.setData({
-        serviceTypeFlag: true
-      })
+    ///设置主从业务部门
+    if (code == 'org') {
+      console.log('item', item)
+      formData.org = item.orgItem
+      formData['orgId'] = item.orgMain.orgId
+      formData['orgName'] = item.orgMain.orgName
+      formData['orgList'] = item.orgList
     }
-  },
-  /**
-   * @desc : 安装员下拉单选确定
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  mutiSearchInstaller(e) {
-    let id = e.detail.id
-    let name = e.detail.name
-    let form = this.data.form
-    form.installUser = id
-    form.installUserName = name
-    this.setData({
-      form
-    })
-  },
-  /**
-   * @desc : 送装员下拉单选确定
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  mutiSearchDeliveryMan(e) {
-    let id = e.detail.id
-    let name = e.detail.name
-    let form = this.data.form
-    form.deliveryUser = id
-    form.deliveryUserName = name
     this.setData({
-      form
+      formData: JSON.stringify(formData)
     })
+
   },
+
   /**
-   * @desc : 服务类型下拉单选确定
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  mutiSearchserviceType(e) {
-    console.log("dashabzxi", e)
-    let id = e.detail.id
+    * @desc : 底部按钮事件
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  saveButton(e) {
+    console.log(e)
     let name = e.detail.name
-    let form = this.data.form
-    form.serviceType = id
-    form.serviceTypeName = name
-    this.setData({
-      form
-    })
+    if (name == 'save') { //保存
+      this.save({})
+    } else if (name == 'collection') { //收款
+
+    }
   },
-  /**
-   * @desc : 下拉多选关闭
-   * @author : 王英杰
-   * @date : 2023年10月8日
-   */
-  muticlose(e) {
 
+  /**
+    * @desc : 设置保存参数
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  setParams(params) {
+    //保存接口并没有计算,因此前台计算
+    let list = this.setItemList(params.goodsList)
+    params.itemList = list //明细
+    params.orderStatus = Constants.orderStatus.STATUS_DEAL //订单状态
+    params.outStatus = Constants.outStatus.unOutBound //出库状态
+    params.makeStaff = app.globalData.user.staffId //制单人
+    params.amtResidue = params.amtReceivable //剩余应收 = 应收金额 
+
+    params.deleteItemList = params.deleteList ? params.deleteList : []
+    // params.addressName= params.address.addressName
+    delete params['goodsList']
+    return params
   },
   /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {  },
-  getCpId() {
-    api.request(Constants.SYS_USER_COMPANY_API + "select_company/" + app.globalData.user.sale2Id, 'POST', {}).then(res => {
-      if (res.data.code === 200) {
-        this.setData({
-          flgToErp: res.data.data.flgToErp
-        })
-      }
-    })
+    * @desc : 明细,保存接口并没有计算,因此前台计算
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  setItemList(list) {
+    for (let i = 0; i < list.length; i++) {
+      list[i].itemIndex = i + 1 //序号
+    }
+    return list
   },
   /**
-   * @desc : 删除图片
+   * @desc : 设置商品
+   * @date : 2024/2/1 15:49
    * @author : 于继渤
-   * @date : 2022/5/31 18:16
    */
-  deleteImg(e) {
-    let index = e.detail.index;
-    let arr = this.data.fileList;
-    arr.splice(index, 1);
+  setGoods(e) {
+    //设置需收款
+    let contentSaveList = this.data.contentSaveList
+    let formData = JSON.parse(this.data.formData)
+    //需收款 = 合计金额 - 使用预存
+    let amtReceivable = Number(formData.sumAmount - formData.useCollect)
+    //组件显示 需收款
+    contentSaveList[2]['content'] = amtReceivable
+    //设置应收金额
+    formData['amtReceivable'] = amtReceivable
     this.setData({
-      fileList: arr
+      formData: JSON.stringify(formData),
+      contentSaveList: contentSaveList
     })
   },
 
   /**
-   * @desc : 图片上传
+   * @desc : 保存数据服务
+   * @date : 2024/2/1 15:49
    * @author : 于继渤
-   * @date : 2022/5/31 18:16
    */
-  afterRead(event) {
-    const _this = this;
-    const {
-      file
-    } = event.detail;
-    let annexPaths = _this.data.annexPaths || []
-    let arr = _this.data.fileList;
-    file.forEach(res => {
-      // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
-      wx.uploadFile({
-        url: `${config.server_add}:${config.server_port}` + '/basic-server/file/upload',
-        filePath: res.path,
-        name: 'file',
-        formData: {
-          'folder': 't_order/annex_paths'
-        },
-        header: {
-          'Authorization': 'Bearer ' + app.globalData.token
-        },
-        success(res) {
-          let data = JSON.parse(res.data)
-          if (data.code === 200) {
-
-            arr.push({
-              url: data.data.absolutelyPath,
-              FilePath: data.data.relativePath,
-              deletable: true
-            })
-            let file = data.data.relativePath.split('/')
-            annexPaths.push({
-              url: data.data.relativePath,
-              type: 'image',
-              name: file[file.length - 1],
-              createTime: util.formatDataTime(new Date())
-            })
-            _this.setData({
-              fileList: arr,
-              annexPaths: annexPaths
-            })
-          }
-        },
-      })
-    })
+  saveData() {
+    if (this.data.formMode == Constants.formMode.edit) { //编辑
+      return this.excute(this.data.service, this.data.service.update, this.data.params);
+    } else { //新建
+      return this.excute(this.data.service, this.data.service.insert, this.data.params);
+    }
 
   },
   /**
-   * @desc : 打开编辑商品备注事件
-   * @author : 王英杰
-   * @date : 2023年10月25日
-   */
-  openRemark(e) {
-    this.setData({
-      remarksIndex: e.currentTarget.dataset.index,
-      remarkFlag: true
-    })
-  },
-  //自动出库办理监听
-  onCheckboxChange(event) {
-    console.log("onCheckboxChange", event)
-    let form = this.data.form
-    form.autoOutFlg = event.detail.checked
+     * @desc : 给表单赋值
+     * @date : 2024/2/1 15:49
+     * @author : 于继渤
+     */
+  setValuesByEdit(data) {
+    let cardList = this.data.cardList
+    //处理地址
+    data.address = {
+      address: data.addressFull,
+      addressFull: data.addressFull,
+      addressArea: data.addressArea,
+      addressGcj02: data.addressGcj02,
+      addressName: data.addressName,
+    }
+    cardList[1].sumAmount = data.sumAmount
+    cardList[1].sumStandard = data.sumStandard
+    cardList[1].sumQuantity = data.sumQuantity
+    cardList[1].saleDiscount = data.saleDiscount
     this.setData({
-      form
+      cardList: cardList,
+      formData: JSON.stringify(data)
     })
-  },
-  /**计算商品相关的属性 */
-  countGoodsList(List) {
-    let goodsList = []
-    let sumOutGoingAmount = 0
-    let sumOutGoingQuantity = 0
-    let that = this
-    // 
-    List.forEach(function (res, index) {
-      if (res.bomItems) { //bom品进入   todo先排除这种情况
-        res.bomItems.forEach(item => {
-          item.itemQuantity = item.bomItemQuantity //入库中数量
-          item.outGoingQuantity = item.bomItemQuantity //入库中数量
-          item.whId = res.whId //仓库
-          item.whName = res.whName //仓库
-          item.orderPriceSale = item.orderPriceSale ? item.orderPriceSale : 0 //入库单价
-    
-          //非标品 带面积的 要成面积
-          if (item.nonStandardArea) {
-            item.itemAmount = Number(item.orderPriceSale * item.outGoingQuantity * res.nonStandardArea) 
-          } else {
-            item.itemAmount = Number(item.orderPriceSale * item.outGoingQuantity) 
-          }
-          debugger
-          sumOutGoingAmount += item.itemAmount
-          sumEntryGoingQuantity += item.outGoingQuantity
+    //查询商品明细
+    this.getItemDetal(data.orderId)
 
-          goodsList.push(item)
-        })
-      } else { //正常品进入 
-
-        if (res.nonStandardArea) {
-          res.itemAmount = Number(res.orderPriceSale * res.outGoingQuantity * res.nonStandardArea)
-        } else {
-          res.itemAmount = Number(res.orderPriceSale * res.outGoingQuantity)
-        }
-        sumOutGoingAmount += res.itemAmount
-        sumOutGoingQuantity += res.outGoingQuantity
-        //根据 可售量和出库量的关系 显示 备足齐套还是备货不足 isStockUp 控制的
-        if ((!res.usableQty) || (res.usableQty && (res.usableQty < res.outGoingQuantity))) {
-          that.setData({
-            isStockUp: false
-          })
-        }
-        goodsList.push(res)
-      }
-
-    })
-    let form = this.data.form
-    form.sumOutGoingAmount = sumOutGoingAmount
-    form.sumOutGoingQuantity = sumOutGoingQuantity
-    form.categoryQuantity = common.getCategoryQuantity(goodsList); // 计算品类数
-    form.sumQuantity = goodsList.length
-    this.setData({
-      form: form,
-    })
 
   },
-  onChange(event) {
-    this.setData({
-      activeNames: event.detail,
+  /**
+     * @desc : 查询商品明细
+     * @date : 2024/2/1 15:49
+     * @author : 于继渤
+     */
+  getItemDetal(orderId) {
+    return this.excute(this.data.service, this.data.service.selectOrderInfoById + '/' + orderId, {}).then(res => {
+      if (res.data.code == 200) {
+        let formData = JSON.parse(this.data.formData)
+        formData.goodsList = res.data.data.orderItem
+        this.setData({
+          formData: JSON.stringify(formData)
+        })
+      }
     });
   },
-  //展开
-  collapseFlagChange(e) {
-    console.log(e.currentTarget.dataset.index)
-
-    this.setData({
-      collapseFlag: !this.data.collapseFlag
-    })
-  },
-  onClickScan(e) {
-    let barList = this.data.barList
-    barList[e.currentTarget.dataset.index].checked = !barList[e.currentTarget.dataset.index].checked
-    this.setData({
-      barList: barList
-    })
-  },
 
-  closeChoosedItemInfo_scan() {
-    this.setData({
-      sacnFlag: false
-    })
-  },
-  formatDate_hours_minutes_seconds(timestamp) {
-    // 创建一个新的Date对象
-    var date = new Date(timestamp);
 
-    // 获取年、月、日、时、分、秒
-    var year = date.getFullYear();
-    var month = ('0' + (date.getMonth() + 1)).slice(-2);
-    var day = ('0' + date.getDate()).slice(-2);
-    var hours = ('0' + date.getHours()).slice(-2);
-    var minutes = ('0' + date.getMinutes()).slice(-2);
-    var seconds = ('0' + date.getSeconds()).slice(-2);
 
-    // 组合成YY-MM-DD HH:mm:ss格式
-    return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
-  },
-  formatDate(dateString) {
-    var date = new Date(dateString);
-    var year = date.getFullYear();
-    var month = ("0" + (date.getMonth() + 1)).slice(-2);
-    var day = ("0" + date.getDate()).slice(-2);
 
-    return year + "-" + month + "-" + day;
-  },
-  /**
-   * @desc : 备注弹窗编辑事件
-   * @author : 王英杰
-   * @date : 2023年10月25日
-   */
-  changeRemarksField(e) {
-    this.setData({
-      remarks: e.detail
-    })
-  },
-  /**
-   * @desc : 编辑商品关闭确定编辑备注事件
-   * @author : 王英杰
-   * @date : 2023年10月25日
-   */
-  updateToChooseList_remark(e) {
-    let goodsList = this.data.goodsList
-    goodsList[this.data.remarksIndex].remarks = this.data.remarks
-    this.setData({
-      goodsList: goodsList,
-      remarkFlag: false
-    })
-  },
-  /**
-   * @desc : 保存前校验
-   * @author : 王英杰
-   * @date : 2023年9月5日
-   */
-  beforeSaveCheck(type) {
-    let goodsList = this.data.goodsList
-    // for (let i = 0; i < goodsList.length; i++) {
-    //   if (goodsList[i].outGoingQuantity > goodsList[i].usableQty) {
-    //     wx.showToast({
-    //       title: '【' + goodsList[i].skuName + '】 的可售量不足',
-    //       icon: 'none'
-    //     });
-    //     return false
-    //   }
-    // }
-    if (!this.data.isStockUp) {
-      wx.showToast({
-        title: '有商品备货不足',
-        icon: 'none'
-      })
-      return false
-    }
-    return true
 
-  },
   /**
-   * @desc : 出库-保存
-   * @author : 王英杰
-   * @date : 2023年8月25日
+   * 生命周期函数--监听页面加载
    */
-  submit(e) {
-    if (this.data.loading) {
-      return
-    }
-    let goodsList = this.data.goodsList
-    if (goodsList.length < 0) {
-      wx.showToast({
-        title: '暂无可出库数据',
-        icon: 'none'
-      })
-      return
-    }
-    let that = this
-    let form = this.data.form
-    let sale2OpeMode = form.sale2OpeMode
-    let flag = false
-    // 校验
-    if (sale2OpeMode != '分销模式-代送') {
-      flag = this.beforeSaveCheck(e.type)
-    } else {
-      flag = true
-    }
-    if (flag) {
-      //保存前校验 
-      let objItem = this.data.form
-      let param = {}
-      param.sale2OpeMode = sale2OpeMode
-      param.customerId = objItem.customerId //客户ID
-      param.customerName = objItem.customerName //客户名称
-      param.customerPhone = objItem.customerPhone //客户电话
-      param.contactName = objItem.contactName //联系人
-      param.deliveryPhone = objItem.deliveryPhone //联系电话 
-      param.salesChannel = objItem.salesChannel //销售渠道
-      param.orgId = objItem.orgId //主业务部门   
-      param.staffId = objItem.staffId //业务员   
-      param.orderId = objItem.orderId //订单ID   
-      param.orderNo = objItem.orderNo //订单号
-      param.outStatus = 2 //出库状态  2:出库中 3:已出库 4:出库暂存
-      param.sumOutGoingQuantity = objItem.sumOutGoingQuantity //合计出库中数量
-      param.sumOutGoingAmount = objItem.sumOutGoingAmount //合计出库中金额
-      param.sumOutQuantity = objItem.autoOutFlg ? objItem.sumOutGoingQuantity : 0 //合计已出库数量
-      param.sumOutAmount = objItem.autoOutFlg ? objItem.sumOutGoingAmount : 0 //合计已出库金额
-      param.remarks = objItem.remarks || "" //备注
-      param.remarksInside = objItem.remarksInside || "" //内部备注
-      param.cpId = objItem.cpId //账套
-      param.sale1Id = objItem.sale1Id //经销商ID
-      param.sale2Id = objItem.sale2Id //分销商ID
-      param.ascpId = objItem.ascpId //所属公司ID
-      param.supplierId = "" //供应商ID
-      param.outKind = "出库类型-销售" //出库类型 
-      param.outDate = this.formatDate(Date.now()) //出库日期
-      param.categoryQuantity = objItem.categoryQuantity //品类数量 
-      param.makingUser = app.globalData.user.userId //制单人
-      param.makingTime = this.formatDate_hours_minutes_seconds(Date.now()) //制单时间
-      param.doneUser = app.globalData.user.userId //办理人
-      param.doneTime = this.formatDate_hours_minutes_seconds(Date.now()) //办理时间 
-      param.salesChannelCode = objItem.salesChannelCode //销售渠道编码 
-      param.annexPaths = this.data.annexPaths //附件  tt
-      param.deliveryUser = objItem.deliveryUser || "" //送货员   
-      param.installUser = objItem.installUser || "" //安装员    
-      param.autoOutFlg = objItem.autoOutFlg || false //自动出库标识
-      param.orderOutItemVOList = this.data.goodsList //商品明细
-      param.contractNo = objItem.contractNo //合同号 
+  loadInit() {
+    if (this.data.formMode == Constants.formMode.other) {
+      let formData = JSON.parse(this.data.formData)
+      formData = this.data.item
       this.setData({
-        loading: true
+        formData:JSON.stringify(formData)
       })
-      if (sale2OpeMode == '分销模式-代送') {
-        api.request(Constants.SALES_OUTBOUND + 'insert', 'POST', param).then(res => {
-          this.setData({
-            loading: false
-          })
 
-          if (res.data.code === 200) {
-            this.cancellation()
-          }
-        })
-      } else if (sale2OpeMode == '分销模式-自营') {
-        api.request(Constants.SALES_OUTBOUND + 'sale_out_insert_no_erp', 'POST', param).then(res => {
-          this.setData({
-            loading: false
-          })
 
-          if (res.data.code === 200) {
-            this.cancellation()
-          }
-        })
-      } else {
-        wx.showToast({
-          title: '该单据应该在erp系统中进行销售出库操作',
-          icon: 'none'
-        })
-        this.setData({
-          loading: false
-        })
-      }
 
 
+    } else {
+      let formData = JSON.parse(this.data.formData)
+      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({
+        formData: JSON.stringify(formData)
+      })
     }
-  },
-  /**关闭 新建销售出库界面 */
-  cancellation() {
-    var pages = getCurrentPages();
-    var prevPage = pages[pages.length - 2]; //上一个页面
-    prevPage.setData({
-      showShare: false,
-    })
-    wx.navigateBack({
-      delta: 1
-    })
-  },
 
+  },
   /**
-   * @desc : 删除
+   * @desc :   自动办理事件
+   * @date : 2024/2/1 15:49
    * @author : 于继渤
-   * @date : 2022/5/31 18:16
    */
-  onCloseDel(event) {
-    let indexdata = event.currentTarget.dataset.index
-    let form = this.data.form
-    let arr = this.data.goodsList
-
-    Dialog.confirm({
-      message: '确定删除吗?',
-    }).then(() => {
-      // if (arr[indexdata].itemId) {
-      //   let orderItemDeleteVOListIds = []
-      //   //包含所有明细id
-      //   orderItemDeleteVOListIds.push(arr[indexdata].itemId)
-      //   if (arr[indexdata].goodsSkuList && arr[indexdata].goodsSkuList.length > 0) {
-      //     arr[indexdata].goodsSkuList.forEach(it => {
-      //       orderItemDeleteVOListIds.push(it.itemId)
-      //     })
-      //   }
-      //   form.orderItemDeleteVOList = form.orderItemDeleteVOList.concat(orderItemDeleteVOListIds)
-      // }
-      arr.splice(indexdata, 1)
-      this.setData({
-        goodsList: arr,
-        form: form
-      })
-
-      let num = 0
-      this.data.goodsList.forEach(function (res, index) {
-        if ((!res.usableQty) || (res.usableQty && (res.usableQty < res.outGoingQuantity))) {
-          num++
-        }
-      })
-      //根据 可售量和出库量的关系 显示 备足齐套还是备货不足 isStockUp 控制的
-      if (num > 0) {
-        this.setData({
-          isStockUp: false
-        })
-      } else {
-        this.setData({
-          isStockUp: true
+  saveChange(e) {
+    let btnFormData = JSON.parse(this.data.btnFormData)
+    let that = this
+    if (!btnFormData.flag) {
+      //提示
+      Dialog.confirm({
+        message: mixins.$t("saleOutBoundInfo"),
+      }).then(() => { }).catch(() => {
+        btnFormData.flag = true
+        that.setData({
+          btnFormData: JSON.stringify(btnFormData)
         })
-      }
-      //计算
-      this.countGoodsList(arr)
-    })
+      });
+    }
   },
-
 })

+ 9 - 412
package-sales/pages/sales-outbound/add/add.wxml

@@ -1,415 +1,12 @@
 <!-- 前台导入wxmlUtil.wxs -->
-<wxs src='../../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
-<wxs src='../../../../utils/numberFormat.wxs' module="numberFormat"></wxs>
-<van-dialog id="van-dialog" />
-<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
-
-<!-- 主从业务员业务部门  -->
-<view style="display:flex;">
-  <!-- 主从业务员  -->
-  <view style="width: 50%;">
-    <van-cell id="staffItem" catchtap="openStaffDropdown" title="{{ form.staffName }}" value-width="1rpx" title-class="cell-value-staff-org" arrow-direction="down" is-link value="" />
-  </view>
-  <!-- 主从业务部门 -->
-  <view style="width: 50%;">
-    <van-cell title-class="staff-org" id="orgItem" catchtap="openOrgDropdown" title="{{form.orgName }}" value-width="1rpx" title-class="cell-value-staff-org" arrow-direction="down" is-link value="" />
-  </view>
-</view>
-
-<!-- 蓝色信息相关 -->
-<view style="margin: 0px 34rpx 0rpx 34rpx; box-shadow:2px 2px 5px #e5e5e6;">
-  <view style="flex-direction: column;justify-content: center;align-items: flex-start;background: linear-gradient(90.12deg, #718AC6 0.84%, #4A5E98 99.43%);border-radius: 15rpx 15rpx 0rpx 0rpx;">
-    <!-- 收货人 -->
-    <view style="display: flex;padding-right: 32rpx;">
-
-      <view style="padding-left: 32rpx;padding-top: 19rpx;width: 39rpx;">
-        <view catchtap="toCustomer" style="width: 39rpx;height: 39rpx;background-color: #95A8CB;border-radius:50%;">
-          <view style="width: 39rpx; height: 39rpx;text-align: center;">
-            <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
-          </view>
-        </view>
-      </view>
-      <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #FFFFFF;">
-        {{form.customerName}}
-      </view>
-
-      <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #FFFFFF;">
-        {{form.customerPhone}}
-      </view>
-
-
-    </view>
-    <!-- 地址 -->
-    <view style="display: flex;padding-right: 32rpx;">
-      <view style="padding-left: 32rpx;padding-top: 15rpx;font-size: 26rpx;line-height: 36rpx;color: #FFFFFF;">
-        {{ wxmlUtil.addressToIndexOf(form.addressFull)}}
-      </view>
-    </view>
-
-    <view style="display: flex;padding-left: 32rpx;padding-top: 16rpx;padding-bottom: 15rpx;padding-right: 32rpx;">
-      <view style="display: flex; width: 50%;line-height: 36rpx;" data-type='deliveryType'>
-        <!-- 配送方式 -->
-        <view wx:if="{{ form.deliveryTypeName }}" style="font-size: 24rpx;line-height: 36rpx;color: #FFFFFF;">
-          {{ form.deliveryTypeName }} >
-        </view>
-      </view>
-      <view style="display: flex; width: 50%;line-height: 36rpx;" data-key="DeliveryFlag" catchtap="openData">
-        <view style="font-size: 24rpx;line-height: 36rpx;color: #FFFFFF;">
-          送货日期:{{ form.deliveryTime?wxmlUtil.format(form.deliveryTime):'' }}
-        </view>
-      </view>
-    </view>
-  </view>
-</view>
-
-<!-- 服务信息 -->
-<view style="margin: 0rpx 34rpx 26rpx 34rpx;border-radius:0rpx 0rpx 15rpx 15rpx ;box-shadow:2px 2px 5px #e5e5e6;padding:10rpx;background-color: white;">
-  <view style="padding: 10px 32rpx 10px 32rpx;color: #1B365D;font-size: 32rpx;display: flex;">
-    <view style="width: 50%;font-weight: bold;display: flex;">
-      <view>服务信息</view>
-    </view>
-  </view>
-  <van-field input-width="200rpx" input-class="dk-cell-value-class" label-class="normal-label" input-align="left" data-key="gender" maxlength="25" type="text" value="{{ form.serviceTypeName }}" label="服务类型:" placeholder="仅安装" autosize border="{{ false }}" right-icon="arrow" color="#95A8CB" data-type='ServiceType' catchtap="openServiceTypeEvent" readonly="{{true}}">
-  </van-field>
-  <!-- 送货员 -->
-  <van-field wx:if="{{(form.serviceTypeName=='送安一体')||(form.serviceTypeName=='仅送货')}}" input-width="200rpx" input-class="dk-cell-value-class" disabled input-align="left" label-class="nomal-label" data-key="staffName" maxlength="50" value="{{ form.deliveryUserName }}" input-align="right" label="送货员" placeholder="请选择送货员" autosize border="{{ false }}" catchtap="catchtapStaff">
-    <view catchtap="changeDeliveryMan" slot="icon" style="width: 39rpx;height: 39rpx;background-color: #77C5D5;border-radius:50%;margin-top: 5rpx;">
-      <view style="width: 39rpx; height: 39rpx;text-align: center;">
-        <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
-      </view>
-    </view>
-  </van-field>
-  <!-- 安装员 -->
-  <van-field wx:if="{{(form.serviceTypeName=='送安一体')||(form.serviceTypeName=='仅安装')}}" input-width="200rpx" input-class="dk-cell-value-class" disabled input-align="left" label-class="nomal-label" data-key="staffName" maxlength="50" value="{{ form.installUserName }}" input-align="right" label="安装员" placeholder="请选择安装员" autosize border="{{ false }}" catchtap="catchtapStaff">
-    <view catchtap="changeInstaller" slot="icon" style="width: 39rpx;height: 39rpx;background-color: #77C5D5;border-radius:50%;margin-top: 5rpx;">
-      <view style="width: 39rpx; height: 39rpx;text-align: center;">
-        <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
-      </view>
-    </view>
-  </van-field>
-</view>
-
-
-<!-- 商品信息 -->
-<view style="margin: 26rpx 34rpx 26rpx 34rpx;box-shadow:2px 2px 5px #e5e5e6;">
-  <view style="background: #FFFFFF;box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);border-radius: 15rpx 15rpx 0rpx 0rpx;">
-    <view style="padding: 10px 32rpx 10px 32rpx;color: #1B365D;font-size: 32rpx;display: flex;">
-      <view style="width: 70%;font-weight: bold;display: flex;">
-        <view>商品明细</view>
-
-      </view>
-      <view style="width: 30%; padding-right: 3%; background: white; display: flex; justify-content: center; align-items: center; border-radius: 8rpx;">
-        <view wx:if="{{(form.sale2OpeMode != '分销模式-代送')&&(!flgToErp)}}">
-          <view wx:if="{{isStockUp}}" class="choose-goods" style="  width: 111%; border-radius: 8rpx;">
-            <view class="choose-goods-text">备货齐套</view>
-          </view>
-          <view wx:else class="choose-goods" style=" width: 111%; border-radius: 8rpx;background-color: red;">
-            <view class="choose-goods-text">备货不足</view>
-          </view>
-        </view>
-      </view>
-    </view>
-    <van-cell wx:if="{{goodsList.length==0}}" border="{{ false }}" style="border-radius: 15rpx;">
-      <van-empty description="暂无明细" />
-    </van-cell>
-    <view wx:for="{{goodsList}}" data-item="{{item}}" data-index="{{index}}" wx:for-item="item" wx:key="index" border="{{ true }}">
-      <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" async-close bind:close="onCloseDel">
-        <van-card wx:if="{{index < 2  || collapseFlag}}" data-item="{{item}}" data-index="{{index}}" bindtap="openChoosedItemInfo">
-          <view slot="thumb">
-            <van-image radius="5px" width="80" height="80" src="{{item.iconThumPath }}" />
-          </view>
-          <view slot="title" style="display: flex;">
-            <!-- 标题 -->
-            <view style="display: flex;">
-              <dk-title titleTag="{{item.titleTag}}" title="{{item.skuModel}}"></dk-title>
-            </view>
-
-          </view>
-          <!-- 描述 -->
-          <view slot="desc">
-            <view style="padding-top: 15rpx; padding-bottom: 12rpx; width: 100%;">
-              <dk-text fontWeight="nomal" value="{{item.skuName}}"></dk-text>
-            </view>
-
-          </view>
-          <view slot="price">
-            <view style="display: flex;width: 100%;flex-direction: row; ">
-              <view style="width: 100%;">
-                <dk-cell contentFontSize="16" height="45rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="" content="{{item.orderPriceSale}}"></dk-cell>
-              </view>
-              <view style="width: 100%;text-align: right;font-size:24rpx;color: #95A8CB;line-height: 34rpx;">x {{item.outGoingQuantity }}{{item.flgNonStandardType == 1 ? (' * ' + item.nonStandardArea + 'm²'): ''}}</view>
-            </view>
-          </view>
-
-          <!-- 底部明细 -->
-          <view slot="footer">
-            <view style="margin-top: 15rpx;" wx:if="{{item.goodsSkuList.length > 0  || item.combinedList.length > 0}}">
-              <view style="width: 100%;display: flex;">
-                <view style="font-size:12px;color: #95A8CB;width: 50%;text-align: left;">
-                  明细
-                </view>
-                <view style="font-size:12px;color: #95A8CB;width: 50%;text-align: right;" data-item="{{item}}" data-index="{{index}}" catchtap="onChangeOpenGoodsList">
-                  {{item.packageDetailsFlag ? '收起' :'展开'}}
-                  <van-icon name="{{item.packageDetailsFlag ? 'arrow-up' :'arrow-down' }}" />
-                </view>
-              </view>
-
-              <!--子件-->
-              <view class="goods-class" wx:if="{{item.packageDetailsFlag}}">
-                <view wx:for="{{item.goodsSkuList}}" data-item="{{item2}}" wx:for-item="item2" wx:key="index2">
-                  <view class="goods-item-class" wx:if="{{item2.hasChild == 0}}">
-                    <view>
-                      <van-image radius="15rpx" custom-class="goods-item-image" fit="fill" src="{{item2.iconThumPath }}" />
-                    </view>
-                    <view class="goods-item-tag">
-                      <view style="display: flex;">
-                        <view class="{{(item2.replaceableSku && item2.replaceableSku.length > 0)?'goods-item-title-replace':''}}">
-                          <dk-title titleTag="{{item2.titleTag}}" title="{{item2.skuModel}}"></dk-title>
-                        </view>
-
-                      </view>
-                      <view style="width: 100%;display: flex;">
-                        <dk-text fontWeight="normal" value="{{item2.skuName}}"></dk-text>
-                      </view>
-                      <!--子级明细价格-->
-                      <view style="display: flex;width: 100%;flex-direction: row;">
-                        <view style="width: 90%;">
-                          <dk-cell contentFontSize="12" height="45rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="" content="{{ item2.orderPriceSalet}}"></dk-cell>
-                        </view>
-                        <view style="width: 10%">
-                          <dk-text fontWeight="nomal" color="#95A8CB" value="x {{item2.tItemQuantity }}"></dk-text>
-                        </view>
-
-                      </view>
-                    </view>
-                  </view>
-                </view>
-              </view>
-            </view>
-          
-            <view  wx:if="{{(form.sale2OpeMode != '分销模式-代送')&&(!flgToErp)}}" class="hr" >
-              <view wx:if="{{((!item.usableQty)||(item.usableQty&&(item.usableQty<item.outGoingQuantity)))}}" style="display: flex;margin: 1vw;font-size: 13px;">
-                <view style="color: #95A8CB; width: 20vw;align-self: center;text-align: -webkit-center;">仓库
-                </view>
-                <view style="color: #1B365D;width: 55vw;align-self: center;text-align: -webkit-center;">{{item.whName}} >
-                </view>
-
-                <view style="color: red;width: 25vw;align-self: center;text-align: -webkit-center;">可售量:{{item.usableQty?item.usableQty:0}}
-                </view>
-              </view>
-            </view>
-
-            <view style="display: flex;width: 100%;align-items: center;height: 60rpx;" data-index="{{index}}" catchtap="openRemark">
-              <view style="width: 50%;text-align: left;font-size:12px;color: #95A8CB;">
-                <van-image width="19rpx" height="20rpx" src="/static/img/remerk-edit.png" />
-                备注:<span style="line-height:56rpx;">{{item.remarks ? item.remarks : '请输入内容'}}</span>
-              </view>
-
-            </view>
-            <view class="divide-class"></view>
-          </view>
-        </van-card>
-        <view slot="right">删除</view>
-      </van-swipe-cell>
-
-
-    </view>
-
-    <view catchtap="collapseFlagChange" data-index="{{index}}" wx:if="{{goodsList.length > 2}}" style="padding: 30rpx 32rpx 30rpx 32rpx;border-radius: 16rpx;color:#95A8CB;text-align: center;font-size: 26rpx;display: flex;justify-content: center;">
-      <view>{{!collapseFlag ? '展开查看更多' : '收起查看更多'}}</view>
-      <view style="padding-left: 10rpx;">
-        <van-icon name="{{!collapseFlag ? 'arrow-down':'arrow-up'}}" size="24rpx" />
-      </view>
-    </view>
-
-  </view>
-
-
-  <view style="background: #FFFFFF;box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);border-radius:0rpx 0rpx 15rpx 15rpx;">
-
-
-    <view style="display:flex;;margin-right: 24rpx;">
-      <view style="width: 48%;">
-        <view style="padding-left: 30rpx;padding-top: 25rpx;">
-          <text style="color: #95A8CB;font-size: 32rpx;">{{form.categoryQuantity ? form.categoryQuantity : 0}}品类 共计{{form.sumOutGoingQuantity ? form.sumOutGoingQuantity : 0}}件</text>
-        </view>
-      </view>
-
-      <view style="width: 52%;">
-        <dk-cell fontSize="13" contentColor="#CAA977" titleColor="#1B365D;" contentRight="right" fontWeight="bold" title="合计金额:" content="{{form.sumOutGoingAmount}}"></dk-cell>
-      </view>
-    </view>
-
-
-  </view>
-
-</view>
-
-
-
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<loading wx:if="{{loading}}"></loading>
 
 
-
-
-<!-- 其他信息 -->
-<view style="margin: 10px 32rpx 10px 32rpx;margin-top: 41rpx;border-radius: 15rpx;box-shadow:2px 2px 5px #e5e5e6;">
-  <view style="background: #FFFFFF;box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);border-radius:15rpx;">
-    <view style=" padding: 10px 32rpx 10px 32rpx;color: #1B365D;font-size: 32rpx;">其他信息</view>
-
-    <van-field disabled label="合同号" border="{{ false }}" label-class="van-title-cell" value="{{ form.contractNo }}" data-key="contractNo" bind:change="changeField"></van-field>
-
-    <van-field label="备注" border="{{ false }}" label-class="van-title-cell" value="{{ form.remarks }}" data-key="remarks" bind:change="changeField"></van-field>
-
-    <van-field label="内部备注" border="{{ false }}" label-class="van-title-cell" value="{{ form.remarksInside }}" data-key="remarksInside" bind:change="changeField"></van-field>
-
-    <view style="display:flex;width:100%;margin: 1vw;padding-top:20rpx;">
-      <view style="width: 15%; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;white-space: nowrap;">出库附件</view>
-      <view style="width: 85%;text-align: left;">
-        <van-uploader max-count="5" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ fileList }}" multiple="false" imageFit="aspectFit" bind:delete="deleteImg" bind:after-read="afterRead" />
-      </view>
-    </view>
-    <view style="display:flex;width:100%;margin: 1vw;padding-top:20rpx;">
-      <view style="width: 15%; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;white-space: nowrap;">订单附件</view>
-      <view style="width: 85%;text-align: left;">
-        <van-uploader disabled max-count="5" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ orderfileList }}" multiple="false" imageFit="aspectFit" />
-      </view>
-    </view>
-  </view>
-
-</view>
-
-<view style="height: 200rpx;"></view>
-
-<dk-save-bottom flagTypeName="add-sales-outbound" item="{{item}}" bind:submit="submit" bind:allClean="cancellation" bind:onCheckboxChange="onCheckboxChange" checked="{{form.autoOutFlg}}" showcheckbox="{{showcheckbox}}" totallength="{{form.sumOutGoingAmount}}"></dk-save-bottom>
-
-
-
-<!-- 业务部门 -->
-<dk-single-dropdown-item show="{{orgFlag}}" id='org' typeName='org' contentID="{{form.orgId}}" bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>
-
-<!-- 业务员 -->
-<dk-single-dropdown-item show="{{staffFlag}}" id='staff' typeName='staff' contentID="{{form.staffId}}" bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>
-
-<!-- 安装员 -->
-<dk-single-dropdown-item show="{{InstallerFlag}}" id='staff' typeName='staff' bind:muticommit='mutiSearchInstaller' bind:muticlose='muticlose'></dk-single-dropdown-item>
-<!-- 送货员 -->
-<dk-single-dropdown-item show="{{DeliveryManFlag}}" id='staff' typeName='staff' bind:muticommit='mutiSearchDeliveryMan' bind:muticlose='muticlose'></dk-single-dropdown-item>
-<!-- 服务类型 -->
-<dk-single-dropdown-item show="{{serviceTypeFlag}}" id='serviceType' typeName='serviceType' bind:muticommit='mutiSearchserviceType' contentID="{{form.serviceType}}" bind:muticlose='muticlose'></dk-single-dropdown-item>
-
-<!--编辑商品-->
-<van-popup custom-class="dk-popup" show="{{ showEditProduct }}" round="{{true}}" position="bottom" bind:close="closeChoosedItemInfo">
-  <view style="  position:relative; top:280rpx;background-color: transparent; height: 44rpx;"></view>
-
-  <view class="special-topic">
-    <view class="special-topic-content">
-      <van-image radius="15rpx" custom-class="goods-pop-image" fit="fill" src="{{ currentChoosedItem.iconThumPath }}">
-      </van-image>
-      <!--  -->
-    </view>
-    <view class="special-topic-title">
-      <dk-title id="titleTagPop" titleTag="{{currentChoosedItem.titleTag}}" title="{{currentChoosedItem.skuModel}}"></dk-title>
-      <view style="padding-top: 10rpx;white-space: nowrap;">
-        <dk-text fontWeight="" value="{{currentChoosedItem.skuName}}"> </dk-text>
-      </view>
-      <dk-cell contentFontSize="12" height="45rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="标价:" content="{{currentChoosedItem.orderPriceSale}}"></dk-cell>
-      <!--sku编码-->
-      <view  wx:if="{{(form.sale2OpeMode != '分销模式-代送')&&(!flgToErp)}}" style="padding-top:3px !important;display:flex;font-size: 14px;color: #1B365D;justify-content: flex-end; margin-right: 14vw;margin-top: -2vw;">
-        <view style="margin: 1vw;">库存量:{{currentChoosedItem.ivtQty?currentChoosedItem.ivtQty:0}}</view>
-        <view style="margin: 1vw;">可售量:{{currentChoosedItem.usableQty?currentChoosedItem.usableQty:0}}</view>
-      </view>
-
-    </view>
-  </view>
-  <view class="pop-content-class">
-    <van-cell-group>
-      <view style="height:calc({{windowHeight+'px'}} - 676rpx);overflow-y: scroll;overflow-x: hidden;">
-        <!-- 正常品 -->
-        <view>
-
-          <!-- 就一个商品 -->
-          <view wx:if="{{currentChoosedItem.specsList.length == 0}}" style="display: flex;justify-content: space-between;">
-            <view style="width: 30%;">
-            </view>
-            <!--显示已选商品编码-->
-            <view style="align-items: center; padding-top: 12rpx;">
-              <dk-text fontSize="10px" fontWeight="" value="编码:{{currentChoosedItem.skuCode}}"> </dk-text>
-            </view>
-          </view>
-
-          <view wx:for="{{currentChoosedItem.specsList}}" wx:key="index" wx:for-item="itemspecs">
-            <view style="display: flex;justify-content: space-between;">
-              <view style="width: 30%;">
-                <dk-text fontSize="13px" value="{{itemspecs.specsName}}"></dk-text>
-              </view>
-              <!--显示已选商品编码-->
-              <view style="align-items: center; padding-top: 12rpx;" wx:if="{{currentChoosedItem.skuCode && index == 0}}">
-                <dk-text fontSize="10px" fontWeight="" value="编码:{{currentChoosedItem.skuCode}}"> </dk-text>
-              </view>
-            </view>
-            <view class="tags">
-              <view class="tag-bom-item" wx:key="indext" wx:for="{{itemspecs.specsValues}}" wx:for-index="indext" wx:for-item="itemt">
-                <van-button size="small" custom-class="button-selected-class">
-                  <view style="display: flex;  justify-content: center;  align-items: center; height: 100%;"> {{ itemt }} </view>
-                </van-button>
-
-              </view>
-            </view>
-          </view>
-        </view>
-
-
-        <van-cell border="{{ false }}" title="数量" title-class="red-label">
-          <van-stepper value="{{currentChoosedItem.outGoingQuantity}}" integer="{{true}}" data-index="{{index}}" min="0" max="999999999" data-type="待出库量" bind:change="changeAllreadyChooseQuantityPop" />
-        </van-cell>
-
-        <van-field wx:if="{{currentChoosedItem.flgNonStandardType!=0}}" disabled label-class="nomal-label" label="面积" value="{{currentChoosedItem.skuArea}}" input-align="right" border="{{ false }}" />
-
-        <van-field disabled label-class="nomal-label" label="销售价格" value="{{currentChoosedItem.orderPriceSale}}" input-align="right" border="{{ false }}" />
-
-        <van-field disabled label-class="red-label" label="库区" data-item="{{currentChoosedItem}}" value="{{currentChoosedItem.whName}}" is-link input-align="right" border="{{ false }}" bindtap="toChooseWhName" />
-
-        <van-field disabled label-class="nomal-label" label="使用位置" value="{{currentChoosedItem.usedLocation}}" input-align="right" border="{{ false }}" />
-
-        <!--赠品标识-->
-        <van-cell title-class="nomal-label" title="赠品标识" border="{{ false }}" value-class="value-class">
-          <van-checkbox shape="round" value="{{ currentChoosedItem.flgGift}}" data-index="{{index}}" data-key="flgGift" bind:change="changeAllReadyCheckBox" />
-        </van-cell>
-
-        <view style="height: 100rpx;"></view>
-      </view>
-      <van-cell value-class="button-pop-cell-class">
-        <view style="text-align: center;">
-          <van-button round size="large" color="#1B365D" custom-style="height:88rpx;width:640rpx;" type="info" data-item="{{currentChoosedItem}}" size="small" bindtap="updateToChooseList">确定</van-button>
-        </view>
-      </van-cell>
-    </van-cell-group>
-  </view>
-</van-popup>
-
-
-<!--备注-->
-<van-popup show="{{ remarkFlag }}" style="z-index: 999;" round="{{true}}" position="bottom" bind:close="closeChoosedItemInfo_remark">
-
-  <van-cell-group>
-    <van-cell border="{{ false }}">
-      <view style="display: flex;">
-        <view style="width:80%;font-size:16px;color:#34495e;text-align:left;">
-          备注修改
-        </view>
-        <view style="text-align: right; width:20%; ">
-        </view>
-      </view>
-    </van-cell>
-    <van-divider />
-    <van-field rows="5" autosize label="备注" value="{{goodsList[remarksIndex].remarks}}" type="textarea" maxlength="1000" placeholder="请输入备注" data-item="{{goodsList[remarksIndex].remarks}}" data-key="remarks" input-class="input-class" bind:change="changeRemarksField" border="{{ false }}" />
-
-    <view style="height: 450rpx;"></view>
-
-
-    <view style="text-align: center;">
-      <van-button round size="large" color="#1B365D" custom-style="height:88rpx;width:640rpx;" type="info" size="small" bindtap="updateToChooseList_remark">确定</van-button>
-    </view>
-    <view style="height: 40rpx;"></view>
-  </van-cell-group>
-</van-popup>
+<dk-form-bill type="sale" id="dk-form-bill" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode" descCol="skuModel" priceCol="priceStandard" quantityCol="itemQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods" 
+bind:editItems="editItems"  bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList"
+bind:customersChoose="customersChoose"   popType="sale" priceTitle="售价:" staff="staff" org="org">
+</dk-form-bill>
+<van-dialog id="van-dialog" />
+<!--  保存 -->
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="saveButton" bind:change="saveChange"></dk-save-button>

+ 435 - 89
package-sales/pages/sales-outbound/add/add.wxss

@@ -1,92 +1,438 @@
-.statistics{
-    margin-left:15rpx; 
-    margin-right:15rpx; 
-    width: 209rpx;
-    height: 98rpx;  
-    background: #ECD9B8;
-    box-shadow: 0px 10px 15px rgba(225, 229, 238, 0.6);
-    border-radius: 15rpx;
-    display: flex;
-    justify-content: center;
-    align-items: center;
+page {
+  background: #F5F5F5;
+}
+
+.tab-h {
+  height: 75rpx;
+  width: 100%;
+  box-sizing: border-box;
+  overflow: hidden;
+  line-height: 75rpx;
+  background: #F7F7F7;
+  font-size: 30rpx;
+  white-space: nowrap;
+  top: 0;
+  left: 0;
+  z-index: 99;
+  background-color: white !important;
+}
+
+.tab-item {
+  margin: 0 27rpx;
+  display: inline-block;
+  font-size: 25rpx;
+}
+
+.tab-item.active {
+  color: #1989FA;
+  position: relative;
+}
+
+.tab-item.active:after {
+  content: "";
+  display: block;
+  height: 8rpx;
+  width: 88rpx;
+  background: #1989FA;
+  position: absolute;
+  bottom: 0;
+  left: 5rpx;
+  border-radius: 16rpx;
+}
+
+.page-group {
+  display: table;
+  width: 100%;
+  table-layout: fixed;
+  position: relative;
+  top: 0;
+  left: 0;
+  z-index: 999;
+
+  /*这个设置在原生组件中用于置顶导航条*/
+}
+
+.hiddenmore .more-item {
+  display: none;
+}
+
+.showmore .more-item {
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: flex;
+}
+
+.flex-class {
+  display: flex;
+  justify-content: space-around;
+}
+
+.hr {
+  width: 100%;
+  height: 3rpx;
+  margin-top: 15rpx;
+  /* margin-left: 37.5rpx; */
+  background-color: #dfdedd;
+}
+
+.value-class {
+  flex: none !important;
+}
+
+.right-field-css {
+  text-align: right !important;
+}
+
+.add-btn {
+  margin-top: 10rpx;
+}
+
+.list-msg {
+  padding: 0 20rpx;
+  background-color: #fff;
+  position: relative;
+}
+
+.list-msg1 {
+  height: 60rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.list-msg .list-msg2 {
+  height: 60rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  border: 1px solid #ccc;
+  padding: 0 10rpx;
+}
+
+.select_box {
+  background-color: #eee;
+  padding: 0 10rpx;
+  width: 93%;
+  position: absolute;
+  top: 130rpx;
+  z-index: 1;
+  overflow: hidden;
+  animation: myfirst 0.5s;
+}
+
+@keyframes myfirst {
+  from {
+    height: 0rpx;
   }
-  
-  .statistics-title{
-    color: #1B365D;
-    font-size: 24rpx;
-    text-align: center;
-  }
-  .statistics-value{
-    color:#1B365D;
-    font-size: 34rpx;
-    font-weight: bold;
-    text-align: center;
-    padding-top: 4rpx;
-  }
-  
-   /**选择商品*/
-  .choose-goods{
-    text-align: center; 
-    display: flex; 
-    justify-content: center; 
-    align-items: center;width: 330rpx;
-    border-radius: 15rpx; 
-    background-color: #00A7B5;
-  }
-  
-  /**选择商品文字*/
-  .choose-goods-text{
-    color: #FFFFFF;
-    font-size: 14px; 
-  }
-  
-  .van-title-cell {
-    color: #95A8CB !important;
-    font-size: 28rpx !important;
-  }
-  /* 收货仓库 */
-  .dk-value{
-    text-align: left !important;
-    color:#1B365D !important;
-  }
-  
-  .dk-title{
-    color:#E4002B !important;
-    width: 100rpx !important;
-  }
-  .van-card{
-    background-color: white !important;
-  }
-  
-  
-  .dk-collapse-item{
-    border-radius: 15rpx !important;
-    background-color: #DEE2ED !important;
-    font-size: 30rpx !important;
+
+  to {
+    height: 210rpx;
   }
-  .test{
-    overflow:hidden
-  }
-  .dk-value-class{
-    width: 80rpx !important;
-  }
-  
+}
+
+.select_one {
+  height: 60rpx;
+  line-height: 60rpx;
+  border-bottom: 1px solid #ccc;
+}
+
+/**客户信息**/
+.content-customer-info{
+  padding: 20rpx 32rpx 20rpx 32rpx;
+  color: #1B365D;
+  font-size: 16px;
+  font-weight: bold;
+}
+
+/**客户信息**/
+.content-goods-info{
+  padding: 10px 32rpx 10px 32rpx;
+  color: #1B365D;
+  font-size: 16px;
+  font-weight: bold;
+}
+
+/**分割线*/
+.divide-class{
+  margin-top:19rpx;
+  width: 617rpx;
+  border: 1rpx solid #E9F0FE;
+  flex: none;
+  order: 1;
+  flex-grow: 0;
+  z-index: 1;
+}
+
+
+.right-field-css {
+  color: black;
+}
+
+/* .van-cell__title {
+  color: #646566;
+} */
+
+
+/**收缩样式*/
+.expand-class{
+  border-radius: 15rpx;
+  text-align: center;
+  padding-top:23rpx;
+  padding-bottom: 23rpx; 
+  color: #95A8CB;
+  background-color: #FFFFFF;
+  font-size: 12px;
+}
+
+/**选择商品*/
+.choose-goods{
+  text-align: center; 
+  display: flex; 
+  justify-content: center; 
+  align-items: center;width: 330rpx;
+  box-shadow: 0px 13px 10px rgba(68, 85, 166, 0.15);
+  border-radius: 15rpx; 
+  background-color: #00A7B5;
+}
+
+/**选择商品图标*/
+.choose-goods-image{
+  width:31.96rpx;
+  height:33.93rpx; 
+  padding-right: 29rpx;
+}
+
+/**选择商品文字*/
+.choose-goods-text{
+  color: #FFFFFF;
+  font-size: 16px;
+  font-weight: bold;
+}
+
+/**扫码*/
+.scan-goods{
+  text-align: center; 
+  display: flex; 
+  justify-content: center; 
+  align-items: center;
+  width: 330rpx;
+  box-shadow: 0px 13px 10px rgba(68, 85, 166, 0.15);
+  border-radius: 15rpx; 
+  background-color: #606EB2;
+}
+
+.tags {
+  display: flex;
+  flex-wrap: wrap;
+  align-content: stretch;
+  width: 100%;
+  flex-direction: row; 
+  justify-content: flex-start;
+  background: white; 
+  align-items: center;
+  margin-bottom: 5rpx;
+  margin-top: 10rpx;
+}
+
+.designGraphics-class {
+  text-align: right !important;
+  padding-left: 185rpx;
+}
+
+
+.cell-value-staff-org {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  text-align: center;
+  color: #1B365D !important;
+  font-size: 13px !important;
+  font-weight: bold !important;
+}
+
+.input {
+  text-align: left !important;
+  font-size: 26rpx !important;
+  color: #1B365D !important;
+}
+
+/**非必输项label*/
+.dk-cell-title {
+  color: #95A8CB !important;
+  font-size: 14px !important;
+}
+
+.dk-cell-value {
+  color: #CAA977 !important;
+  font-size: 26rpx;
+}
+
+.van-card {
+  background-color: #FFFFFF !important;
+}
+
+.van-card__content{
+  justify-content: space-around !important;
+}
+
+
+
+/**产品明细的样式**/
+.goods-class{
+  width: 100% !important;
+  background: #FBF6EF !important;
+  border-radius: 15rpx !important;
+  padding: 10rpx;
+}
+
+/**产品条目的样式**/
+.goods-item-class{
+  text-align: left;
+  background: #FFFFFF;
+  border: 2rpx solid #606EB2;
+  border-radius: 15rpx;
+  margin: 10rpx 10rpx 20rpx 10rpx !important;
+  display: flex;
+}
+
+.goods-item-image{
+  width: 116rpx;
+  height: 116rpx;
+  left: 16rpx;
+  top: calc((100% - 116rpx)/2);
+}
+
+/**包含替换品时的样式*/
+.goods-item-title-replace{
+  width: 85%;
+}
+
+/**子件标题tag样式*/
+.goods-item-tag{
+  margin: 10rpx 10rpx 10rpx 26rpx;
+  width: 100%;
+}
+
+.price-pop-class{
+  width: 75%;
+}
+
+.label-bule{
+  color: #95A8CB  ;
+  font-size: 14px ;
+}
+
+.placeholder-class{
+  color: #95A8CB;
+}
+
+.button-class{
+  height: 85rpx !important;
+  background: #F8F9FD !important;
+  color: #95A8CB !important;
+  border: 2rpx solid #95A8CB;
+  border-radius: 10rpx !important;
+  text-align: left !important;
+  margin-bottom: 10rpx;
+  z-index: 999 !important;
+}
+
+.button-selected-class{
+  height: 85rpx !important;
+  background: #606EB2 !important;
+  color: #fff !important;
+  border: 2rpx solid #606EB2;
+  border-radius: 10rpx !important;
+  text-align: left !important;
+  margin-bottom: 10rpx;
+  z-index: 999 !important;
+  /* overflow: hidden !important;
+  text-overflow: ellipsis !important;
+  white-space: nowrap !important; */
+}
+.tag-text{
+  overflow: hidden !important;
+  text-overflow: ellipsis !important;
+  white-space: nowrap;
+  word-wrap: break-all;
+  width: 100%;
+  height: 44rpx;
+  margin-top: -10rpx;
+  margin-bottom: -10rpx;
+}
+
+.tag-bom-item{
+  padding-right: 20rpx;
+  flex-direction: column;
+}
+
+
+
+
+
+
+
+
+
+.contents{
+  width:100%;
+  min-height: 100%;
   
-  .goods-detail-title{
-    display:flex;
-    justify-content:center;
-    align-items: center;
-    padding-left:10rpx;
-  }
-  .value-class {
-    flex: none !important;
-  }
-  .cell-value-staff-org {
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    text-align: center;
-    color: #1B365D !important;
-    font-size: 13px !important;
-    font-weight: bold !important;
-  }
+}
+.touch-item {
+  height: 130rpx;
+  width: 100%;
+  background: #fff;
+  border-bottom: 1rpx solid #eee;
+  display: flex;
+  /* //均匀排布每个元素 */
+  justify-content: space-between;
+  width: 100%;
+  overflow: hidden;
+}
+.content {
+ width: 100%;
+ padding: 0 30rpx;
+ /* margin-right:0; */
+ -webkit-transition: all 0.4s;
+ transition: all 0.4s;
+ -webkit-transform: translateX(150rpx);
+ transform: translateX(150rpx);
+ margin-left: -150rpx;
+ box-sizing: border-box;
+}
+.del {
+  width: 150rpx;  
+  height: 100%;  
+  background-color: red; 
+  color: white; 
+  display: flex;  
+  justify-content: center;  
+  align-items: center;  
+  -webkit-transform: translateX(90px);
+  transform: translateX(90px);
+  -webkit-transition: all 0.4s;
+  transition: all 0.4s;
+}
+.content_name{
+  font-size: 28rpx;
+  color: #333;
+  line-height: 30rpx;
+  margin: 30rpx 0 28rpx;
+}
+.content_time{
+  color: rgb(153,153,153);
+  font-size: 20rpx;
+  line-height: 20rpx;
+}
+.touch-move-active .content,
+.touch-move-active .del {
+ -webkit-transform: translateX(0);
+ transform: translateX(0);
+}
+.input-class {
+  text-align: left !important;
+  height: 100px !important;
+  color: #95A8CB !important;
+  font-size: 12px !important;
+}

+ 48 - 330
package-sales/pages/sales-outbound/sales-outbound.js

@@ -5,10 +5,8 @@
  *		2.销售出库列表
  * 编辑履历:
  *		作者				日期					版本				修改内容
- *		王英杰		        2022-0-12	            1.00		   	    
+ *		于继渤		 2024-3-25	    1.00		   	    
  *******************************************************************************/
-const Constants = require('@/utils/Constants.js');
-const util = require('@/utils/util.js') 
 const mixins = require('@/mixins/index.js')
 Page({
   mixins: [mixins],
@@ -16,353 +14,73 @@ Page({
    * 页面的初始数据 
    */
   data: {
-    tagList:[{title:"待出库"},{title:"已出库"}],
-    // 查询条件
-    searchContent: [{
-      code: 'createtime',
-      title: '近30天',
-      defaultValue: 5,
-      searchType: Constants.searchType.date
-    }, {
-      code: 'staff',
-      title: '业务员',
-      dropType: 'staff'
-    }, {
-      code: 'orderStatus',
-      title: '状态',
-      searchType: Constants.searchType.switch,
-      list: [
-        {
-          checked: true,
-          text: "客户收款",
-          value: "0"
-        },
-        {
-          checked: false,
-          text: "使用收款",
-          value: "1"
-        },
-      ]
-      
-    }, {
-      code: 'choose',
-      title: '类型',
-      searchType: Constants.searchType.switch,
-   
-    }],
-
-    // 查询条件-筛选
-    pullMenuList: [{
-      code: 'outStatus',
-      pullType: 'mSelect',
-      typeName: 'outStatus'
-    }, {
-      code: 'receiveStatus',
-      pullType: 'mSelect',
-      typeName: 'receiveStatus'
-    }, {
-      code: 'designStatus',
-      pullType: 'mSelect',
-      typeName: 'designStatus'
-    }, {
-      code: 'customerFrom',
-      pullType: 'mSelect',
-      typeName: 'customerFrom'
-    }, {
-      code: 'keyType',
-      pullType: 'mSelect',
-      typeName: 'keyType'
-    }, {
-      code: 'delivery_Time',
-      dataType: 'date'
-    }],
-
-    // 假数据
-    dataList: [{
-      salesChannelName: '',
-      customerId: 11,
-      customerName: '张三',
-      displayStatus: '已收款',
-      orderNo: 'SA-LWYD-ZOO-202401300SBG',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 3000,
-      categoryQuantity: '',
-      tsumQuantity: 1,
-      data:'2024-03-12',
-      amont:1009,
-      makeTime: '2024-03-12' 
-    }, {
-      salesChannelName: '',
-      customerName: '李四',
-      displayStatus: '取消',
-      backgroundColor:'red',
-      orderNo: 'SA-LWYD-ZOO-202401300SBD',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)2',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 4000,
-      categoryQuantity: '',
-      tsumQuantity: 2,
-      data:'2024-03-12',
-      amont:1009,
-      makeTime: '2024-03-12' 
-    }],
-
+    tagList: [{ title: "全部" }, { title: "待出库" }, { title: "已出库" }],
     // 列表区(脚部金额)
-    footerAmount: {
-      name: 'tsumAmount',
-      title: '共计金额'
-    },
+    footerAmount: { name: 'outAmt', title: mixins.$t("totalAmount") },
     // 列表区(脚部信息)
-    footerInfo: [{
-      name: 'categoryQuantity',
-      title: '共计'
-    }, {
-      name: 'tsumQuantity',
-      title: '件'
-    }],
+    footerInfo: [{ name: 'outQty', title: mixins.$t("piece"), prefix: mixins.$t("together"), }],
     // 列表区(内容)
-    contentList: [{
-      name: 'orderNo',
-      title: '出库单号'
-    },{
-      name: 'customerPhone',
-      title: '客户电话'
-    }, {
-      name: 'addressFull',
-      title: '客户地址'
-    }, {
-      name: [{
-        name: 'orgName',
-        title: ''
-      }, {
-        name: 'staffName',
-        title: '业务员'
-      }],
-      title: '门店信息'
-    }, ],
-
+    contentList: [
+      { name: 'outNo', title: mixins.$t("outOrderNo") },
+      { name: 'cusPhone', title: mixins.$t("cusPhone") },
+      { name: 'addressFull', title: mixins.$t("adddressFull") },
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation") }
+    ],
     contentObj: {
-      '成交': [{
-        name: 'orderNo',
-        title: '订单单号'
-      } , {
-        name: [{
-          name: 'orgName',
-          title: ''
-        }, {
-          name: 'staffName',
-          title: '业务员'
-        }],
-        title: '客户地址'
-      }],
-      '未成交': [{
-        name: 'orderNo',
-        title: '订单单号'
-      }, {
-        name: 'customerPhone',
-        title: '客户电话'
-      }, {
-        name: [{
-          name: 'orgName',
-          title: ''
-        }, {
-          name: 'staffName',
-          title: '业务员'
-        }],
-        title: '客户地址'
-      }]
+      '待出库': [
+        { name: 'outNo', title: mixins.$t("outOrderNo") },
+        { name: 'cusPhone', title: mixins.$t("cusPhone") },
+        { name: 'addressFull', title: mixins.$t("adddressFull") },
+        { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation") }
+      ],
+      '出库中': [
+        { name: 'outNo', title: mixins.$t("outOrderNo") },
+        { name: 'cusPhone', title: mixins.$t("cusPhone") },
+        { name: 'addressFull', title: mixins.$t("adddressFull") },
+        { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation") }
+      ],
+      '已出库': [
+        { name: 'outNo', title: mixins.$t("outOrderNo") },
+        { name: 'cusPhone', title: mixins.$t("cusPhone") },
+        { name: 'addressFull', title: mixins.$t("adddressFull") },
+        { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation") }
+      ],
     },
+    buttonSaveList: [{ code: 'selectSourceSaleOrder', title: mixins.$t("add") }],
+    contentSaveList: [{ code: 'need', title: mixins.$t("totalAmount"), type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
 
     // 弹出按钮
-    buttonList: [{
-      name: 'customerRefund',
-      title: '出库办理'
-      }, {
-        name: 'customerRefundList',
-        title: '作废'
-      } , {
-        name: 'customerRefundList',
-        title: '打印票据'
-      } 
-     
+    buttonList: [
+      { name: 'salesOutbound', title: mixins.$t("outProcessing") },
+      { name: 'merge', title: mixins.$t("printedBill") },
+      { name: '', title: mixins.$t("invaidOrder") }
     ],
-
-    totallength: 0, //视图下方提醒数量
-
     // 路由
-    routeObjName: 'customer',
-    active:0
-  },
-   /**
-   * 切换 已出库 未出库
-   */
-  onChangeTabs(e) {
-      let index =   e.detail.detail.index
-      console.log("qeaqwewa", index)
-    console.log("qeaqwewa", e)
-    this.setData({
-      active:index, 
-    })
-     
+    routeObjName: 'saleOutBound',
+    active: 0
   },
   /**
-   * 跳转客户详细
-   */
-  toDetail(e) {
-    if (this.data.active == 0) { // 待出库 明细今入
-    
-      wx.navigateTo({
-        url: './detail/not-outbound-detail?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=outbound-processing',
-      })
-    } else { //已出库明细
-      wx.navigateTo({
-        url: './detail/outbound-detail?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)),
-      })
-    }
-  },
-  toTitle(e) {
-    console.log('t1', e);
-  },
-  toStatus(e) {
-    console.log('t2', e);
-  },
-  toPoint(e) {
-    console.log('t3', e);
-    this.setData({
-      showShare: true
-    })
-  },
-  toAdd() {
-    wx.navigateTo({
-      url: './add/add',
-    })
-  },
-  /**
-   * @desc : 右上角三个小点 点击回调事件
+   * @desc : 查询
    * @date : 2024/2/1 15:49
-   * @author : 王英杰
+   * @author : 于继渤
    */
-  open(e) {
-     let name = e.detail.name
-     let item = e.detail.item 
-     if(name == 'customerRefund'){  //出库办理
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection-refund/customer-collection-refund?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection' + '&pageIndex=customer-collection',
-      })
-     }
-     if(name == 'customerRefundList'){  //客户退款
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection/refund-record/refund-record?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection',
-      })
-     }
-   
-       
-  
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
   /**
-   * @desc : 校验
+   * @desc : 处理查询数据
    * @date : 2024/2/1 15:49
-   * @author : 周兴
+   * @author : 于继渤
    */
-  openValidData(item, name) {
-    console.log('item', item, name, item.customerId);
-    if (!item.customerId) {
-      wx.showToast({
-        title: '无此联系人,或陌生接待',
-        icon: 'none'
+  handleSearchData(tableData) {
+    if (tableData && tableData.length > 0) {
+      tableData.forEach(res => {
+        res.collectStatus = 'noCollect'
       })
-      return false;
     }
-    return true;
-  },
-
-  /**
-   * @desc : 查询
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
-  getData(params) {
-    console.log('fff', params);
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    //按钮权限
-
-    // let Customer_Follow = common.hasButtonRight(Constants.Customer_Follow) //跟进
-    // let Customer_Follow_Task = common.hasButtonRight(Constants.Customer_Follow_Task) //跟进任务
-    // let Customer_Order = common.hasButtonRight(Constants.Customer_Order) //销售订单
-    // let Customer_Receive = common.hasButtonRight(Constants.Customer_Receive) //客户收款
-    // let Customer_Add = common.hasButtonRight(Constants.Customer_Add) //客户新建
-
     this.setData({
-      Customer_Follow: true,
-      Customer_Follow_Task: true,
-      Customer_Order: true,
-      Customer_Receive: true,
-      Customer_Add: true
-
+      tableData: tableData
     })
+  }
 
-
-
-
-    if (JSON.stringify(options) !== '{}') {
-
-      if (options.frommine) {
-
-        let frommine = JSON.parse(options.frommine)
-        var createtime = this.selectComponent('#createtime');
-        createtime.data.dataDefaultSearch = util.jumpPageDate(frommine.date.value)
-        createtime.data.createTimeType = frommine.date
-
-        let keyType = this.selectComponent('#keyType')
-        let keyTypeList = keyType.data.moreList
-        keyTypeList.forEach(kIt => {
-          if (frommine.keyTypeList) {
-            if (frommine.keyTypeList.some(it => kIt.id === it)) {
-              kIt.infotype = 'info'
-            }
-          }
-        })
-        keyType.setData({
-          moreList: keyTypeList
-        })
-
-        let searchForm = {
-          ...this.data.searchForm
-        }
-        searchForm.keyTypeList = frommine.keyTypeNameList
-
-        this.setData({
-          active: frommine.active,
-          createTimeType: frommine.date,
-          searchForm: searchForm,
-          searchFormNumber: (frommine.keyTypeNameList && frommine.keyTypeNameList.length > 0) ? 1 : null,
-          createTimeSearch: util.jumpPageDate(frommine.date.value),
-          staffIds: frommine.staffId ? [frommine.staffId] : [],
-          staffNames: frommine.staffNames,
-        })
-
-        createtime.init()
-      }
-    } else {
-      // this.searchData()
-    }
-  },
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-    if (this.data.selectflag) {
-      // this.searchData()
-    }
-  },
 })

+ 4 - 6
package-sales/pages/sales-outbound/sales-outbound.wxml

@@ -9,16 +9,14 @@
   <dk-tabs active="{{active}}" list="{{tagList}}" bind:onChange="onChangeTabs">    </dk-tabs>
 </van-sticky>
 
-<!-- 暂无数据 -->
-<van-empty wx:if="{{dataList.length<=0}}" description="{{$t['nodata']}}" />
 
 <!-- 列表区 -->
-<dk-list  list="{{dataList}}" titleCorner="salesChannelName" title="customerName"collectCol="collectAmount"  status="displayStatus" subTitle="makeTime" content="{{contentList}}" contentObj="{{contentObj}}"  footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+<dk-list  list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="salesChannelName" title="cusName" collectCol="outAmt"  status="outStatusName" subTitle="makeTime" 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>
 
-<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>
-<view style="height: 135rpx;"></view>
+
+<view style="height: 200rpx;"></view>
 
 
 
 <!-- 新建按钮 -->
-<dk-save-bottom   flagTypeName="customer-collection" totallength="{{totallength}}" bind:submit="toAdd" />
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>