Prechádzať zdrojové kódy

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

姜永辉 2 rokov pred
rodič
commit
1c39218759

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

@@ -32,7 +32,12 @@ module.exports = {
       chooseStorageOutReason: { key: 'chooseStorageOutReason', url:'/package-base-select/pages/select-data/select-data',type:'dictionary',dictCode:'基础资料-出库'  },
       selectSourceSaleOrder:{
         key:'selectSourceSaleOrder',url:'/package-base-select/pages/select-source-sale-order/select-source-sale-order'
-      }
+      },
+
+ 
+      
+      selectCustomers: { key: 'selectCustomers', url: '/package-base-select/pages/select-customers/select-customers' },
+      selectInventorySku:{ key: 'selectInventorySku', url: '/package-base-select/pages/select-data/select-data',type:'inventorySku'  },
     }
   }
 };

+ 5 - 1
api/pages/ivt/saleOutBound.js

@@ -11,15 +11,19 @@ module.exports = {
   saleOutBoundService: {
     // 前缀
     prefix: 'mdm-server/ivt/outbound_sale_order/',
-    outboundInsert: 'outbound_insert'
+    outboundInsert: 'outbound_insert',
+    outboundUpdate: 'outbound_update',
+    handleOutbound: 'handle_outbound'
   },
 
   routeUrl: {
     saleOutBound: { 
       add:{key:'add',url:'/package-sales/pages/sales-outbound/add/add'},
+      edit:{key:'edit',url:'/package-sales/pages/sales-outbound/add/add',idKey:'outId',formType:'detail'},
       selectSourceSaleOrder:{
         key:'selectSourceSaleOrder',url:'/package-base-select/pages/select-source-sale-order/select-source-sale-order'
       },
+      
       selectCustomers: { key: 'selectCustomers', url: '/package-base-select/pages/select-customers/select-customers' },
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-data/select-data',type:'warehouse'  },
       selectInventorySku:{ key: 'selectInventorySku', url: '/package-base-select/pages/select-data/select-data',type:'inventorySku'  },

+ 4 - 4
components/dkbase/dk-dropdown-date/dk-dropdown-date.js

@@ -130,10 +130,10 @@ Component({
 
         let date = []
         if (item.value == 1) {
-          date = [util.formatTime(new Date()).substring(0, 10), util.formatTime(new Date()).substring(0, 10)]
+          date = [util.formatDataTime(new Date()).substring(0, 10), util.formatDataTime(new Date()).substring(0, 10)]
         }
         else if (item.value == 2) {
-          date = [util.formatTime(util.getCurrentWeek(0)).substring(0, 10), util.formatTime(util.getCurrentWeek(-6)).substring(0, 10)]
+          date = [util.formatDataTime(util.getCurrentWeek(0)).substring(0, 10), util.formatDataTime(util.getCurrentWeek(-6)).substring(0, 10)]
         }
         else if (item.value == 3) {
           date = util.getCurrentMonth();
@@ -142,8 +142,8 @@ Component({
           let startYear = util.getYear("s", 0)
           let endYear = util.getYear("e", 0)
           //本年
-          date = [util.formatTime(new Date(startYear)).substring(0, 10),
-          util.formatTime(new Date(endYear)).substring(0, 10)]
+          date = [util.formatDataTime(new Date(startYear)).substring(0, 10),
+          util.formatDataTime(new Date(endYear)).substring(0, 10)]
         }
         else if (item.value == 6) {
           //近30天

+ 11 - 4
components/dkbusiness/dk-dropdown-menu/dk-dropdown-menu.js

@@ -177,8 +177,11 @@ Component({
      * @date : 2024/1/26 12:16
      */
     onSearchText(e) {
+      let form = this.data.form
+      form.searchText = e.detail
       this.setData({
-        searchText: e.detail,
+        form:form,
+        value:JSON.stringify(form),
         searchTextFlag: e.detail ? true : false//TOP搜索输入标识
       })
     },
@@ -191,13 +194,15 @@ Component({
       let form = null;
       // 大查询
       if (this.data.searchTextFlag) {
-        form = {
-          searchText: this.data.searchText
-        }
+        // form = {
+        //   searchText: this.data.searchText
+        // }
+        form = this.data.form
       } else {
         form = this.data.form
         form.searchText = undefined
       }
+      console.log('form',form);
       this.setData({
         form: form,
         value: JSON.stringify(form)
@@ -215,6 +220,7 @@ Component({
       let form = this.data.form
       form[code + 'Start'] = data[0]
       form[code + 'End'] = data[1]
+      console.log('rrr',data[0],typeof data[0],form);
       let menuList = this.data.menuList
       let dateDefault = e.detail.dateDefault
       if (this.data.index || this.data.index == 0) {
@@ -351,6 +357,7 @@ Component({
       form[this.data.dropDateCode] = date
       form[this.data.dropDateCode + 'Start'] = e.detail.date[0];
       form[this.data.dropDateCode + 'End'] = e.detail.date[1];
+      console.log('rre',e.detail.date[0]);
       this.setData({
         form: form,
         value: JSON.stringify(form)

+ 1 - 1
components/dkbusiness/dk-dropdown-menu/dk-dropdown-menu.wxml

@@ -1,5 +1,5 @@
 <view>
-  <van-search wx:if="{{flgSearchText}}" model:value="{{ searchText }}" bind:change="onSearchText" bind:search="doSearch" use-action-slot placeholder="{{searchTextPlaceholder}}">
+  <van-search wx:if="{{flgSearchText}}" model:value="{{ form.searchText }}" bind:change="onSearchText" bind:search="doSearch" use-action-slot placeholder="{{searchTextPlaceholder}}">
   </van-search>
   <van-dropdown-menu active-color="#1B365D" wx:if="{{menuList.length > 0}}">
     <!--查询条件-->

+ 8 - 0
mixins/index.js

@@ -178,6 +178,7 @@ module.exports = {
     }
     // 如果需要分页
     if (this.data.pageFlag) {
+      console.log("zhehsisha",this.data.pageInfo,params,this.data.searchForm);
       params.pageSize = this.data.pageInfo.pageSize;
       params.currentPage = this.data.pageInfo.currentPage;
     }
@@ -278,6 +279,7 @@ module.exports = {
         if(e.detail.customUrl){
           url = e.detail.customUrl
         }
+   
         let _this = this;
         wx.navigateTo({
           url: url,
@@ -290,6 +292,7 @@ module.exports = {
           },
           success: function (res) {
             let data = {}
+            console.log('success',item)
             if (item && item.button && item.button.idKey) {
               data['id'] = item[item.button.idKey]
             }
@@ -299,6 +302,8 @@ module.exports = {
             if (item && item.button && item.button.formMode) {
               data['formMode'] = item.button.formMode
             }
+            console.log('routeUrl111111',routeUrl)
+
             //api 上的优先
             if(_this.data.route[name].formMode){
               data['formMode'] = _this.data.route[name].formMode
@@ -310,6 +315,9 @@ module.exports = {
             if (item && item.button && item.button.formType) {
               data['formType'] = item.button.formType
             }
+            if(routeUrl.formType){
+              data['formType'] = routeUrl.formType
+            }
             // 新建增加默认的新建formMode
             if(name === 'add'){
               data['formMode'] = Constants.formMode.add;

+ 1 - 1
package-base-select/pages/select-customers/select-customers.wxml

@@ -26,7 +26,7 @@
       <van-field label-class="nomal-label" value="{{ item.cusPhone }}" input-align="left" label="客户电话" placeholder="" data-type='name' readonly="{{true}}" autosize border="{{ false }}">
       </van-field>
 
-      <van-field label-class="nomal-label" value="{{ item.receivableResidue ? item.receivableResidue : 0}}" input-align="left" label="应收收款" placeholder="" data-type='name' readonly="{{true}}" autosize border="{{ false }}">
+      <van-field label-class="nomal-label" value="{{ item.receivableResidue ? item.receivableResidue : 0}}" input-align="left" label="应收余额" placeholder="" data-type='name' readonly="{{true}}" autosize border="{{ false }}">
       </van-field>
     </view>
   </view>

+ 13 - 3
package-purchase/pages/purchase-receipt/add/add.js

@@ -198,7 +198,9 @@ Page({
        
         }
         if (code == "sourceNo") { //来源单  
-            this.calculateTotal(data.chooosepurchaseItemResponseList)
+           
+            this.calculateTotal(data.chooosepurchaseItemResponseList) 
+
             return
         }
 
@@ -313,6 +315,7 @@ Page({
         let purIdArray_ = this.data.purIdArray //来源单id
         let cardList_ = this.data.cardList
         let contentList_ = this.data.contentList //底部按钮上的合计金额
+        let contentObj_ = this.data.contentObj
         formData.goodsList = choooseItemList
         // 提取purNo字段为数组,并去重
         const purNoArray = [...new Set(formData.goodsList.map(item => item.purNo))];
@@ -320,7 +323,7 @@ Page({
         // 将数组元素转换为逗号分隔的字符串
         formData.fromNo = purNoArray.join(','); //来源单号
         purIdArray_ = purIdArray.join(',');
-
+    
         formData.goodsList.forEach(element => {
             element.intoingAmt = element.itemAmt
             element.intoingQty = element.itemQty
@@ -349,11 +352,18 @@ Page({
             if (card.code === 'amount') {
                 card.content = formData.goodsList.sum("sumAmt")
             }
-        })
+        }) 
+            contentObj_["relation"].forEach(element => {
+               if(element.code == "sourceNo"){ //来源单号
+                element.purNo = purNoArray.join(',')
+                element.chooseList =  formData.goodsList
+               }
+            }); 
         this.setData({
             contentList: contentList_,
             purIdArray: purIdArray_,
             cardList: cardList_,
+            contentObj:contentObj_,
             formData: JSON.stringify(formData)
         })
     },

+ 107 - 49
package-purchase/pages/purchase-receipt/choose-purchase-order/choose-purchase-order.js

@@ -7,20 +7,22 @@ Page({
    * 页面的初始数据
    */
   data: {
-       // 弹出按钮
-       buttonList: [{
-        name: 'merge',
-        title: mixins.$t("confirm"), //'保存'
+    // 弹出按钮
+    buttonList: [{
+      name: 'merge',
+      title: mixins.$t("confirm"), //'保存'
     }],
-    contentList: [{
-        code: 'flag',
-        title: mixins.$t("allChoose"), //'全选',
-        type: 'checkbox'
-    },  {
-        code: 'amount',
-        content: 0,
-        title: mixins.$t("totalAmount"), //'合计金额',
-        type: 'number'
+    contentList: [
+    //   {
+    //   code: 'flag',
+    //   title: mixins.$t("allChoose"), //'全选',
+    //   type: 'checkbox'
+    // },
+     {
+      code: 'amount',
+      content: 0,
+      title: mixins.$t("totalAmount"), //'合计金额',
+      type: 'number'
     }],
     btnFormData: null,
     returnTotalAmount: 0,
@@ -29,6 +31,7 @@ Page({
     routeObjName: 'purchase',
     tableData: [],
     chooosepurchaseItemResponseList: [],
+    isfirst: true,
   },
   /**
    * @desc :   加载数据源
@@ -38,7 +41,7 @@ Page({
   getData(params) {
     return this.excute(this.data.service, this.data.service.selectListByItem, params);
   },
-   
+
 
   /**
    * @desc :   父级商品信息选择
@@ -81,13 +84,13 @@ Page({
   },
 
   /**
-    * @desc :  全退
-    * @date : 2024/2/1 15:49
-    * @author : 王英杰
-    */
+   * @desc :  全退
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
   onCheckboxChange(e) {
     let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
-    let checked =  btnFormData ? btnFormData.flag : false
+    let checked = btnFormData ? btnFormData.flag : false
     let tableData = this.data.tableData
     tableData.forEach(res => {
       res.checked = checked
@@ -104,10 +107,10 @@ Page({
   },
 
   /**
-    * @desc :   计算金额/过滤出已选数据
-    * @date : 2024/2/1 15:49
-    * @author : 王英杰
-    */
+   * @desc :   计算金额/过滤出已选数据
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
   calculateTotal() {
     let tableData = this.data.tableData
     let chooosepurchaseItemResponseList = []
@@ -117,7 +120,6 @@ Page({
       if (res.purchaseItemResponseList && res.purchaseItemResponseList.length > 0) {
         res.purchaseItemResponseList.forEach(item => {
           if (item.checked) {
-        
             chooosepurchaseItemResponseList.push(item)
           }
         })
@@ -125,41 +127,97 @@ Page({
     })
     if (chooosepurchaseItemResponseList && chooosepurchaseItemResponseList.length > 0) {
       chooosepurchaseItemResponseList.forEach(res => {
-        returnTotalAmount += Number(res.itemAmt)
+        returnTotalAmount += (Number(res.itemAmt*res.itemQty))
       })
-    } 
- let contentList = this.data.contentList
- contentList.forEach(element => {
-    if(element.code == 'amount'){
-      element.content = returnTotalAmount
     }
-   });
+    let contentList = this.data.contentList
+    contentList.forEach(element => {
+      if (element.code == 'amount') {
+        element.content = returnTotalAmount
+      }
+    });
     this.setData({
       chooosepurchaseItemResponseList: chooosepurchaseItemResponseList,
       returnTotalAmount: returnTotalAmount,
-      contentList:contentList
+      contentList: contentList
     })
   },
   /**
-  * @desc :   跳转回到新建入库
-  * @date : 2024/2/1 15:49
-  * @author : 王英杰
-  */
+   * @desc :   跳转回到新建入库
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
   toAdd() {
-    let chooosepurchaseItemResponseList = this.data.chooosepurchaseItemResponseList
+    let chooosepurchaseItemResponseList = this.data.chooosepurchaseItemResponseList 
     let that = this
-   let formData = that.data.formData
-   let item = that.data.item
- 
-   const eventChannel = this.getOpenerEventChannel(); 
-   eventChannel.emit('bindData', { data: {chooosepurchaseItemResponseList:chooosepurchaseItemResponseList} })
-   wx.navigateBack({
-     delta: 1
-   }) 
- 
-  },
-
- 
+    let formData = that.data.formData
+    let item = that.data.item 
+    const eventChannel = this.getOpenerEventChannel();
+    eventChannel.emit('bindData', {
+      data: {
+        chooosepurchaseItemResponseList: chooosepurchaseItemResponseList
+      }
+    })
+    wx.navigateBack({
+      delta: 1
+    })
 
+  },
+  /**
+   * @desc :设置查询参数
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  setSearchParams(params) {
+    console.log('ddd', this.data.item);
+    let item = this.data.item
+    let isfirst = this.data.isfirst
+    if (isfirst) { //第一次进入 取传过来的  
+      let searchForm = this.data.searchForm ? JSON.parse(this.data.searchForm) : {}
+      searchForm.searchText = item.purNo||''
+      this.setData({
+        chooseList: item.chooseList||[],
+        searchForm: JSON.stringify(searchForm),
+        searchText: item.purNo ||'',
+      })
+      params.searchForm = JSON.stringify(searchForm)
+      params.searchText = item.purNo
+    }
+    this.setData({
+      isfirst: false
+    })  
+    return params 
+  },
+   /**
+     * @desc :   处理接口返回数据 (根据入库页面传过来的已选商品 回显)
+     * @date : 2024年3月8日
+     * @author : 王英杰
+     */
+    handleSearchData(tableData) { 
+      let  chooseList = this.data.chooseList||[]
+      if(chooseList.length>0){
+        let tableData = this.data.tableData
+        let chooseNum = 0
+        tableData.forEach(element => {
+           if(element.purNo == chooseList[0].purNo){
+            element.purchaseItemResponseList.forEach(item => { 
+              chooseList.forEach(chooseitem => { 
+                if(item.itemId==chooseitem.itemId){
+                  item.checked = true
+                  chooseNum++
+                }
+               });
+             });
+             if(chooseNum ==  element.purchaseItemResponseList.length){
+              element.checked = true
+             }
+           }
+        });
+        this.setData({
+          tableData
+        })
+        this.calculateTotal()
+      }  
+    },
 
 })

+ 2 - 1
package-purchase/pages/purchase-receipt/choose-purchase-order/choose-purchase-order.wxml

@@ -3,7 +3,8 @@
 
 <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 model:value="{{searchForm}}" searchText
+  ='{{searchText}}' menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['orderNo'])}}">
   </dk-dropdown-menu>
  
 </van-sticky>

+ 0 - 0
package-sales/1.txt


+ 48 - 1161
package-sales/pages/inventory/inventory.js

@@ -1,1179 +1,66 @@
-const app = getApp();
-const api = require('../../../utils/api.js');
-const Constants = require('../../../utils/Constants.js');
+// package-sales/pages/inventory/inventory.js
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    LINK_PSI_SYSTEM: "WANWEI-PSI",
-    NOINVERTORY_Flag: true,
-    form: {
-      "whId": 552,
-      "whName": "钦州运营仓"
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
     },
-    goodsList: [
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 181,
-        "brandName": "恒洁卫浴",
-        "code": "CE551AS2200B01",
-        "codeName": "电控一体机HQ551\\地排\\305坑距",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 193,
-        "ivtId": 217,
-        "ivtQty": 193,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
-        "opCreateTime": "2023-11-11 14:50:44",
-        "opCreateUserId": 937,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"175.172.202.7\"}",
-        "opTimestamp": "2023-12-11 09:16:53",
-        "opUpdateTime": "2023-12-11 09:16:53",
-        "opUpdateUserId": 643,
-        "outGoingQty": 12,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 3,
-        "skuCode": "CE551AS2200B01",
-        "skuId": 9611250,
-        "skuModel": "HQ551",
-        "skuName": "电控一体机HQ551\\地排\\305坑距",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\电控坐便器",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 181,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 138,
-        "brandName": "恒洁卫浴",
-        "code": "EE920A00200B01",
-        "codeName": "【已淘汰】智能盖板HE920",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 150,
-        "ivtId": 198,
-        "ivtQty": 150,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
-        "opCreateTime": "2023-11-07 09:13:13",
-        "opCreateUserId": 254,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
-        "opTimestamp": "2024-01-12 13:51:58",
-        "opUpdateTime": "2024-01-12 13:51:58",
-        "opUpdateUserId": 968,
-        "outGoingQty": 12,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 20,
-        "skuCode": "EE920A00200B01",
-        "skuId": 9537580,
-        "skuModel": "HE920",
-        "skuName": "【已淘汰】智能盖板HE920",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能盖板",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 138,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 134,
-        "brandName": "恒洁卫浴",
-        "code": "EE604A00200B01",
-        "codeName": "【已淘汰】智能盖板HE604A",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 134,
-        "ivtId": 269,
-        "ivtQty": 134,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
-        "opCreateTime": "2023-11-20 09:15:59",
-        "opCreateUserId": 643,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.142.137\"}",
-        "opTimestamp": "2024-01-09 13:09:40",
-        "opUpdateTime": "2024-01-09 13:09:40",
-        "opUpdateUserId": 937,
-        "outGoingQty": 0,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "EE604A00200B01",
-        "skuId": 9479830,
-        "skuModel": "HE604A",
-        "skuName": "【已淘汰】智能盖板HE604A",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能盖板",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 134,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 107,
-        "brandName": "恒洁卫浴",
-        "code": "CT962EN2200B01",
-        "codeName": "智能一体机陶瓷体HC0962\\地排305",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 114,
-        "ivtId": 257,
-        "ivtQty": 114,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
-        "opCreateTime": "2023-11-16 16:23:28",
-        "opCreateUserId": 1005,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.142.137\"}",
-        "opTimestamp": "2024-01-09 11:48:56",
-        "opUpdateTime": "2024-01-09 11:48:56",
-        "opUpdateUserId": 1005,
-        "outGoingQty": 7,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 15,
-        "skuCode": "CT962EN2200B01",
-        "skuId": 9553940,
-        "skuModel": "HC0962",
-        "skuName": "智能一体机陶瓷体HC0962\\地排305",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能一体机陶瓷体",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 107,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 102,
-        "brandName": "恒洁卫浴",
-        "code": "EE605B00200B01",
-        "codeName": "【已淘汰】智能盖板HE605B",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 102,
-        "ivtId": 273,
-        "ivtQty": 102,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
-        "opCreateTime": "2023-11-20 10:58:51",
-        "opCreateUserId": 643,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
-        "opTimestamp": "2023-12-20 10:37:24",
-        "opUpdateTime": "2023-12-20 10:37:24",
-        "opUpdateUserId": 1005,
-        "outGoingQty": 0,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "EE605B00200B01",
-        "skuId": 9446520,
-        "skuModel": "HE605B",
-        "skuName": "【已淘汰】智能盖板HE605B",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能盖板",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 102,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 101,
-        "brandName": "恒洁卫浴",
-        "code": "EE923A00200B01",
-        "codeName": "【已淘汰】智能盖板HE923",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 101,
-        "ivtId": 272,
-        "ivtQty": 101,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
-        "opCreateTime": "2023-11-20 10:58:51",
-        "opCreateUserId": 643,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.233.176.125\"}",
-        "opTimestamp": "2023-11-23 11:13:50",
-        "opUpdateTime": "2023-11-23 11:13:50",
-        "opUpdateUserId": 937,
-        "outGoingQty": 0,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "EE923A00200B01",
-        "skuId": 9473520,
-        "skuModel": "B923",
-        "skuName": "【已淘汰】智能盖板HE923",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能盖板",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 101,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 100,
-        "brandName": "恒洁卫浴",
-        "code": "CT978EN2100B02",
-        "codeName": "智能一体机陶瓷体HC0978A\\地排305\\不含直冲阀(通用)",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 100,
-        "ivtId": 672,
-        "ivtQty": 100,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
-        "opCreateTime": "2023-12-22 10:59:54",
-        "opCreateUserId": 1005,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.168.193\"}",
-        "opTimestamp": "2023-12-22 10:59:55",
-        "opUpdateTime": "2023-12-22 10:59:54",
-        "opUpdateUserId": 1005,
-        "outGoingQty": 0,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "CT978EN2100B02",
-        "skuId": 9694350,
-        "skuModel": "HC0978A",
-        "skuName": "智能一体机陶瓷体HC0978A\\地排305\\不含直冲阀(通用)",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能一体机陶瓷体",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 100,
-        "warehouseName": "无库无ERP00002仓",
-        "whId": 645,
-        "whName": "无库无ERP00002仓"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 100,
-        "brandName": "恒洁卫浴",
-        "code": "CT978EN4100B02",
-        "codeName": "智能一体机陶瓷体HC0978A\\地排400\\不含直冲阀(通用)",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 100,
-        "ivtId": 669,
-        "ivtQty": 100,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
-        "opCreateTime": "2023-12-22 10:59:54",
-        "opCreateUserId": 1005,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"113.225.168.193\"}",
-        "opTimestamp": "2023-12-22 10:59:55",
-        "opUpdateTime": "2023-12-22 10:59:54",
-        "opUpdateUserId": 1005,
-        "outGoingQty": 0,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "CT978EN4100B02",
-        "skuId": 9694360,
-        "skuModel": "HC0978A",
-        "skuName": "智能一体机陶瓷体HC0978A\\地排400\\不含直冲阀(通用)",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能一体机陶瓷体",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 100,
-        "warehouseName": "无库无ERP00002仓",
-        "whId": 645,
-        "whName": "无库无ERP00002仓"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 10,
-        "brandName": "恒洁卫浴",
-        "code": "EE931A00200B01",
-        "codeName": "【已淘汰】智能盖板HE931A",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 11,
-        "ivtId": 220,
-        "ivtQty": 11,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "48849faf-8bbb-4a29-9548-0ba1c3df963f",
-        "opCreateTime": "2023-11-11 16:31:02",
-        "opCreateUserId": 254,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"175.172.202.7\"}",
-        "opTimestamp": "2023-11-28 09:51:30",
-        "opUpdateTime": "2023-11-28 09:51:30",
-        "opUpdateUserId": 254,
-        "outGoingQty": 1,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "EE931A00200B01",
-        "skuId": 9497070,
-        "skuModel": "HE931A",
-        "skuName": "【已淘汰】智能盖板HE931A",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能盖板",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 10,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      },
-      {
-        "ascpId": 29195,
-        "balanceQuantity": 10,
-        "brandName": "恒洁卫浴",
-        "code": "EE923C00200B01",
-        "codeName": "【已淘汰】智能盖板HE923C",
-        "colorNumber": "-",
-        "cpId": 20760,
-        "cpName": "无库无ERP00001",
-        "flgValid": true,
-        "iconPathType": null,
-        "iconThumPath": null,
-        "inventoryQuantity": 20,
-        "ivtId": 207,
-        "ivtQty": 20,
-        "nonStdCode": "-",
-        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
-        "opAppId": "e8d25036-4b95-48d6-a77b-1cfb077dd3e6",
-        "opCreateTime": "2023-11-08 16:55:25",
-        "opCreateUserId": 254,
-        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
-        "opTimestamp": "2024-01-09 10:00:48",
-        "opUpdateTime": "2024-01-09 10:00:48",
-        "opUpdateUserId": 937,
-        "outGoingQty": 10,
-        "purNonEntry": 0,
-        "remarks": null,
-        "sale1Id": 20760,
-        "sale2Id": 29195,
-        "saleNonEntry": null,
-        "saleNonOut": 0,
-        "skuCode": "EE923C00200B01",
-        "skuId": 9462290,
-        "skuModel": "HE923C",
-        "skuName": "【已淘汰】智能盖板HE923C",
-        "specsList": [],
-        "specsValues": null,
-        "spuCategoryLevelName": "智能马桶\\智能盖板",
-        "spuId": null,
-        "titleTag": null,
-        "usableQty": 10,
-        "warehouseName": "无库无ERP00001",
-        "whId": 616,
-        "whName": "无库无ERP00001"
-      }
-    ],
-    loading: false,
-    noMore: false,
-    orderBy: [
-      {
-        "text": "可售量升序",
-        "value": "balanceAsc"
-      },
-      {
-        "text": "可售量降序",
-        "value": "balanceDesc"
-      },
-      {
-        "text": "库存量升序",
-        "value": "inventoryAsc"
-      },
-      {
-        "text": "库存量降序",
-        "value": "inventoryDesc"
-      }
-    ],
-    "pageInfo": {
-      "currentPage": 1,
-      "pageSize": 10
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
     },
-    searchText: "",
-    sideKey: 1,
-    sidebarFlag: true,
-    typeList: [
-      {
-        "id": "",
-        "name": "全部分类"
-      },
-      {
-        "id": 51,
-        "name": "智能马桶"
-      },
-      {
-        "id": 52,
-        "name": "智能盖板"
-      },
-      {
-        "id": 53,
-        "name": "智能一体机"
-      },
-      {
-        "id": 84,
-        "name": "电控坐便器"
-      },
-      {
-        "id": 103,
-        "name": "智能一体机陶瓷体"
-      },
-      {
-        "id": 54,
-        "name": "陶瓷类"
-      },
-      {
-        "id": 55,
-        "name": "坐便器"
-      },
-      {
-        "id": 108,
-        "name": "电控坐便器"
-      },
-      {
-        "id": 56,
-        "name": "蹲便器"
-      },
-      {
-        "id": 57,
-        "name": "小便器"
-      },
-      {
-        "id": 58,
-        "name": "洗面器"
-      },
-      {
-        "id": 59,
-        "name": "其它陶瓷"
-      },
-      {
-        "id": 60,
-        "name": "浴室柜"
-      },
-      {
-        "id": 66,
-        "name": "定制浴室柜"
-      },
-      {
-        "id": 107,
-        "name": "轻定制浴室柜"
-      },
-      {
-        "id": 110,
-        "name": "定制柜非标组件"
-      },
-      {
-        "id": 63,
-        "name": "金属柜"
-      },
-      {
-        "id": 62,
-        "name": "生态实木柜"
-      },
-      {
-        "id": 61,
-        "name": "实木柜"
-      },
-      {
-        "id": 87,
-        "name": "金属柜镜柜"
-      },
-      {
-        "id": 119,
-        "name": "铝镜柜和智能镜"
-      },
-      {
-        "id": 65,
-        "name": "浴室柜配套品"
-      },
-      {
-        "id": 64,
-        "name": "柜盆"
-      },
-      {
-        "id": 97,
-        "name": "金属柜主柜"
-      },
-      {
-        "id": 102,
-        "name": "金属柜其它部件"
-      },
-      {
-        "id": 96,
-        "name": "生态实木柜主柜"
-      },
-      {
-        "id": 100,
-        "name": "生态实木柜镜柜"
-      },
-      {
-        "id": 101,
-        "name": "生态实木柜其它部件"
-      },
-      {
-        "id": 95,
-        "name": "实木柜主柜"
-      },
-      {
-        "id": 98,
-        "name": "实木柜镜柜"
-      },
-      {
-        "id": 99,
-        "name": "实木柜其它部件"
-      },
-      {
-        "id": 82,
-        "name": "花洒"
-      },
-      {
-        "id": 93,
-        "name": "明装花洒类"
-      },
-      {
-        "id": 123,
-        "name": "明装花洒类"
-      },
-      {
-        "id": 124,
-        "name": "暗装花洒类"
-      },
-      {
-        "id": 94,
-        "name": "暗装花洒类"
-      },
-      {
-        "id": 83,
-        "name": "龙头类"
-      },
-      {
-        "id": 67,
-        "name": "小五金类"
-      },
-      {
-        "id": 70,
-        "name": "挂件"
-      },
-      {
-        "id": 88,
-        "name": "地漏"
-      },
-      {
-        "id": 115,
-        "name": "地漏"
-      },
-      {
-        "id": 116,
-        "name": "角阀"
-      },
-      {
-        "id": 90,
-        "name": "角阀"
-      },
-      {
-        "id": 92,
-        "name": "下水器"
-      },
-      {
-        "id": 117,
-        "name": "下水器"
-      },
-      {
-        "id": 91,
-        "name": "水槽"
-      },
-      {
-        "id": 118,
-        "name": "水槽"
-      },
-      {
-        "id": 71,
-        "name": "其它小五金"
-      },
-      {
-        "id": 72,
-        "name": "淋浴房"
-      },
-      {
-        "id": 85,
-        "name": "定制淋浴房"
-      },
-      {
-        "id": 86,
-        "name": "标准淋浴房"
-      },
-      {
-        "id": 113,
-        "name": "定制淋浴房"
-      },
-      {
-        "id": 114,
-        "name": "标准淋浴房"
-      },
-      {
-        "id": 104,
-        "name": "功能型淋浴房"
-      },
-      {
-        "id": 105,
-        "name": "淋浴房石基"
-      },
-      {
-        "id": 73,
-        "name": "浴缸"
-      },
-      {
-        "id": 74,
-        "name": "配件"
-      },
-      {
-        "id": 75,
-        "name": "智能类配件"
-      },
-      {
-        "id": 76,
-        "name": "陶瓷类配件"
-      },
-      {
-        "id": 77,
-        "name": "浴室柜配件"
-      },
-      {
-        "id": 78,
-        "name": "五金类配件"
-      },
-      {
-        "id": 79,
-        "name": "休闲类配件"
-      },
-      {
-        "id": 80,
-        "name": "周边物料"
-      },
-      {
-        "id": 111,
-        "name": "赠品物料"
-      },
-      {
-        "id": -1,
-        "name": "广宣大类"
-      },
-      {
-        "id": -2,
-        "name": "广宣类"
-      },
-      {
-        "id": -3,
-        "name": "广告物料"
-      },
-      {
-        "id": -4,
-        "name": "礼品赠品"
-      },
-      {
-        "id": -5,
-        "name": "费用大类"
-      },
-      {
-        "id": -6,
-        "name": "费用类"
-      },
-      {
-        "id": -7,
-        "name": "虚拟产品"
-      }
-    ],
-    value: "balanceDesc",
-    windowHeight: 504,
-    windowWidth: 320,
-    specsId: 51,
-    whFlag: false
-    
-  },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {  },
- //获取库区数据源
- getWhName(){
-    let that = this
-   let param = {}
-   param.dataSourceCode = "warehouse" 
-   param.orgId = app.globalData.user.orgId
-   param.ascpId = app.globalData.user.ascpId
-   param.cpId = app.globalData.user.cpId
-   param.sale2OpeMode = app.globalData.user.sale2OpeMode 
-  api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
-    if (res.data.code === 200) {
-      let list = res.data.data||[] 
-        if(list.length>0){
-          let form = this.data.form
-          list.forEach(it=>{
-            if(it.defId == it.id){
-              form.whId = it.id
-              form.whName = it.name
-            }
-          })
-        
-      
-          this.setData({
-           form
-          }) 
-            //that.doSearch()
-            
-        }
-    }
-  })
- },
-  /**
-   * @desc : 分类切换
-   * @author : 于继渤
-   * @date : 2022/5/26 20:16
-   */
-  changeSidebar(e) {
-    let id = this.data.typeList[e.detail].id
-    if (id == "" && typeof (id) != 'number') {
-      this.setData({
-        sideKey: null,
-        specsId: null
-      })
-    } else {
-      this.setData({
-        sideKey: e.detail,
-        specsId: id
-      })
-    }
-    this.setData({
-      searchText: ''
-    })
-    // 查询
-    this.doSearch()
-  },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
 
-  /**
-   * @desc : 加载商品分类
-   * @date : 2022/5/15 16:49
-   * @author : 于继渤
-   */
-  getGoodsClassification() {
-    let param = {
-      dataSourceCode: 'hgSpuCategory',
-      cpId: app.globalData.user.cpId,
-    }
-    api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
-      if (res.data.code === 200) {
-        let typeList = this.data.typeList
-        let list = res.data.data
-        list.forEach(item2 => {
-          let item = {
-            id: item2.categoryId,
-            name: item2.categoryName,
-          }
-          typeList.push(item)
-        })
-        this.setData({
-          typeList: typeList
-        })
-      }
-    })
-  },
+    },
 
-  /**
-   * @desc : 排序选择事件
-   * @author : 于继渤
-   * @date : 2022/9/3 9:24
-   */
-  onSwitchChange(e) {
-    this.setData({
-      value: e.detail
-    })
-    console.log( e.detail)
-    this.doSearch()
-  },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
 
-  /**
-   * @desc : 下拉多选事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  dropdowncommit(e) {
-    this.setData({
-      whFlag: true
-    })
-  },
-  dropdowncommitErp(){
-    this.setData({
-      whFlagErp: true
-    })
-  },
-  /**
-   * @desc : 下拉多选确定
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  mutiSearch(e) {
-    let id = e.target.id
-    let form = this.data.form
-    console.log(e)
-    if (id === 'warehouse') {
-      form.whId = e.detail.id
-      form.whName = e.detail.name
-      this.setData({
-        whFlag: false,
-        whFlagErp: false,
-        form: form
-      })
-      // this.selectComponent("#statusItemWareHouse").toggle(false)
-      if(this.data.LINK_PSI_SYSTEM !='WANWEI-PSI'){
-        this.selectComponent("#statusItemWareHouseErp").toggle(false)
-      }else{
-        this.selectComponent("#statusItemWareHouse").toggle(false)
-      }
-      
-      this.doSearch()
-    }
+    },
 
-    if (id === 'warehouse-orther') {
-      form.whId = e.detail.id
-      form.whName = e.detail.name
-      this.setData({
-        whFlag: false,
-        whFlagErp: false,
-        form: form
-      })
-      // this.selectComponent("#statusItemWareHouse").toggle(false)
-      if(this.data.LINK_PSI_SYSTEM !='WANWEI-PSI'){
-        this.selectComponent("#statusItemWareHouseErp").toggle(false)
-      }else{
-        this.selectComponent("#statusItemWareHouse").toggle(false)
-      }
-      
-      this.doSearch()
-    }
-  },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
 
-  /**
- * @desc : 下拉多选关闭
- * @author : 于继渤
- * @date : 2022/5/26 12:16
- */
-  muticlose(e) {
-    let id = e.currentTarget.id
-    if (id === 'warehouse') {
-      this.setData({
-        whFlag: false
-      })
-    }
-    if(this.data.LINK_PSI_SYSTEM !='WANWEI-PSI'){
-      this.selectComponent("#statusItemWareHouseErp").toggle(false)
-    }else{
-      this.selectComponent("#statusItemWareHouse").toggle(false)
-    }
-  },
+    },
 
-  /**
-   * @desc : 查询
-   * @author : 于继渤
-   * @date : 2022/5/24 08:49
-   */
-  doSearch() {
-    let pageInfo = this.data.pageInfo;
-    pageInfo.pageSize = 10;
-    pageInfo.currentPage = 1;
-    this.setData({
-      whFlag: false,
-      pageInfo: pageInfo,
-      goodsList: []
-    })
-    this.getData()
-  },
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
 
-  /**
-   * @desc : 小程序库存明查询
-   * @author : 于继渤
-   * @date : 2022/9/1 8:53
-   */
-  getData(e) {
-    //查询前的校验
-    if (this.data.sidebarFlag) {
-      //分销用户 无ERP:动销数据,库存管理中库存明细表
-      this.getInventoryItem()
-    } else {
-      let flag = this.beforeSaveCheck()
-      if (flag) {
-        let param = {}
-        param.searchText = this.data.searchText ? this.data.searchText : '' //查询条件
-        param.warehouseName = this.data.form.whName//仓库名称
-        param.sort = this.data.value//排序方式
-        param.orgId = app.globalData.user.orgId
-        param.cpId = app.globalData.user.cpId
-        param.erpUserCode = app.globalData.user.erpUserCode
-        param.pageSize = this.data.pageInfo.pageSize
-        param.currentPage = this.data.pageInfo.currentPage
-        let linkPsiSystem = app.globalData.user.linkPsiSystem
-        this.setData({
-          loading: true
-        })
-        api.request(Constants.SALE_ORDER_SELECT_STOCK + 'select_stock', 'POST', param).then(res => {
-          this.setData({
-            loading: false
-          })
+    },
 
-          if (res.data.code === 200) {
-            let BigLlst = res.data.data
-            let list = [] //后台返回先定义[]
-            let goodsList = this.data.goodsList
-            if (linkPsiSystem == 'DK-IBOSS') {
-              list = BigLlst.datainfo
-            } else if (linkPsiSystem == 'WANWEI-PSI') {
-              list = BigLlst.data.details
-            } else {
-              list = []
-            }
-            if (!list || list.length == 0) {
-              // 如果不是翻页,需要清空
-              if (e != 'more') {
-                this.setData({
-                  list: [],
-                  noMore: false
-                })
-              } else {
-                this.setData({
-                  noMore: true
-                })
-              }
-              return
-            }
-            if (list.length < this.data.pageInfo.pageSize) {
-              this.setData({
-                noMore: false
-              })
-            }
-            goodsList = goodsList.concat(list)
-            this.setData({
-              goodsList: goodsList
-            })
-          }
-        })
-      }
-    }
-  },
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
 
-  /**
-  * @desc :分销用户 无ERP:动销数据,库存管理中库存明细表
-  * @author : 于继渤
-  * @date : 2023/10/08 10:49
-  */
-  getInventoryItem(e) {
-    //有分类模式
-    let param = {}
-    param.ascpId = app.globalData.user.ascpId
-    param.sort = this.data.value//排序方式
-    // param.customerId = app.globalData.user.sale2CustomerId
-    // param.orgId = app.globalData.user.sale2OrgId
-    param.searchText = this.data.searchText ? this.data.searchText  : ''
-    param.pageSize = this.data.pageInfo.pageSize
-    param.currentPage = this.data.pageInfo.currentPage
-    param.categoryId = this.data.specsId
-    this.setData({
-      loading: true
-    })
-    api.request(Constants.ORDER_REPORT + 'Inventory_item', 'POST', param).then(res => {
-      this.setData({
-        loading: false
-      })
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
 
-      if (res.data.code === 200) {
-        let list = res.data.data.list
-        console.log(res)
-        list.forEach(item => {
-          item.code = item.skuCode
-          item.codeName = item.skuName
-          item.colorNumber = item.nonStdCode
-          item.warehouseName = item.whName
-          item.inventoryQuantity = item.ivtQty
-          item.balanceQuantity = item.usableQty
-        })
-        let goodsList = this.data.goodsList
-        if (!list || list.length == 0) {
-          // 如果不是翻页,需要清空
-          if (e != 'more') {
-            this.setData({
-              list: [],
-              noMore: false
-            })
-          } else {
-            this.setData({
-              noMore: true
-            })
-          }
-          return
-        }
-        if (list.length < this.data.pageInfo.pageSize) {
-          this.setData({
-            noMore: false
-          })
-        }
-        goodsList = goodsList.concat(list)
-        this.setData({
-          goodsList: goodsList
-        })
-      }
-    })
-  },
+    },
 
-  /**
-  * @desc : 页面上拉触底事件的处理函数
-  * @author : 于继渤
-  * @date : 2022/5/24 08:49
-  */
-  onReachBottom: function () {
-    if (this.data.loading || this.data.noMore) {
-      return;
-    }
-    this.setData({
-      pageInfo: {
-        pageSize: this.data.pageInfo.pageSize,
-        currentPage: this.data.pageInfo.currentPage + 1
-      }
-    })
-    this.getData('more')
-  },
-  /**
- * @desc : 保存前校验
- * @author : 于继渤
- * @date : 2022/9/1 9:00
- */
-  beforeSaveCheck() {
-    let erpUserCode = app.globalData.user.erpUserCode
-    if (!erpUserCode && !this.data.ErpFlag) {
-      wx.showToast({
-        title: '用户未绑定ERP编码',
-        icon: 'none'
-      })
-      return false
-    }
-    return true
-  },
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
 
-  /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
-  onPullDownRefresh: function () {
-    let that = this
-    //调用刷新时将执行的方法
-    that.setData({
-      loadingShow: true,
-    })
-    this.doSearch()
-    //隐藏导航条加载动画
-    wx.hideNavigationBarLoading();
-    setTimeout(function () {
-      that.setData({
-        loadingShow: false,
-      })
-      //停止下拉刷新
-      wx.stopPullDownRefresh();
-    }, 800)
-  },
+    }
 })

+ 0 - 6
package-sales/pages/inventory/inventory.json

@@ -1,6 +0,0 @@
-{
-    "usingComponents": {},
-    "navigationBarTitleText":"库存明细",
-    "enablePullDownRefresh": true,
-    "backgroundTextStyle": "light"
-  }

+ 2 - 135
package-sales/pages/inventory/inventory.wxml

@@ -1,135 +1,2 @@
-<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
-
-
-<van-sticky scroll-top="0">
-  <view style="display:flex;">
-    <view style="width:75%;    padding-left: 23rpx;">
-      <van-search bind:search="doSearch" custom-class="search-class" model:value="{{ searchText }}" placeholder="商品名称/商品型号" use-right-icon-slot="{{true}}" placeholder-style="color:#95A8CB">
-      </van-search>
-    </view>
-    <view style="width:25%; background:#F8F9FD;">
-      <view class="scan-class">
-        <image class="scan-image" fit="fill" src="/static/img/Group.png"></image>
-      </view>
-    </view>
-
-  </view>
-  <van-dropdown-menu active-color="#1B365D" style=" width: calc(100% ) !important; ">
-
-      <!-- 库区 -->
-      <van-dropdown-item wx:if="{{!sidebarFlag && !NOINVERTORY_Flag && LINK_PSI_SYSTEM != 'WANWEI-PSI'}}" id="statusItemWareHouseErp" title="{{ form.whName ? form.whName:'仓库' }}" bind:open="dropdowncommitErp">
-    </van-dropdown-item>
-    <!-- 库区 -->
-    <van-dropdown-item wx:if="{{sidebarFlag && !NOINVERTORY_Flag || LINK_PSI_SYSTEM == 'WANWEI-PSI'}}" id="statusItemWareHouse" title="{{ form.whName ? form.whName:'仓库' }}" bind:open="dropdowncommit">
-    </van-dropdown-item>
-
-
-
-
-    <!-- 可售量排序 -->
-    <van-dropdown-item title="{{ orderBy.text }}" value="{{value}}" options="{{ orderBy }}" bind:change="onSwitchChange">
-    </van-dropdown-item>
-
-  </van-dropdown-menu>
-</van-sticky>
-
-<!-- 列表 -->
-<view wx:for="{{goodsList}}" data-item="{{item}}" wx:key="index" class="main-class" style="{{ sidebarFlag ? 'margin-left: 166rpx;' : ''}}">
-
-  <view class="main-foot" style="border-radius:15rpx;">
-    <view>
-      <view class="table-content-row">
-        <view style="display:flex;width:100%;">
-          <view data-item="{{item}}" style="display:flex;font-size: 15px;">
-            <dk-text style="font-size:30rpx;" fontWeight="nomal" value="{{item.code}}"></dk-text>
-          </view>
-
-        </view>
-      </view>
-
-      <!-- 商品名称 -->
-      <view class="table-row">
-        <view class="table-content-row">
-          <view style="display: flex;">
-            <view class="table-content-row-font">
-              <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="商品名称" copyValue="{{item.codeName}}"></dk-text>
-            </view>
-            <view class="table-content-class">
-              {{item.codeName?item.codeName:''}}
-            </view>
-          </view>
-        </view>
-      </view>
-
-
-      <!-- 库区色号 -->
-      <view class="table-content-row">
-        <view style="display: flex;">
-          <view class="table-content-row-font">
-            <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库区" copyValue="{{item.warehouseName}}"></dk-text>
-          </view>
-          <view class="table-content-class">
-            {{item.warehouseName}}{{item.colorNumber ? item.colorNumber + ' | 色号 ' : ''}}
-          </view>
-        </view>
-      </view>
-
-      <!-- 分割线 -->
-      <dk-divider marginTop="20rpx"></dk-divider>
-      <!-- 下半部分 -->
-      <view class="table-content-row">
-        <view style="display: flex;justify-content:space-between">
-          <view style="display: flex;">
-            <view class="table-content-row-font">
-              <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库存量"></dk-text>
-            </view>
-            <view style="font-size: 13px;color: #CAA977;">
-              {{item.inventoryQuantity}}
-            </view>
-          </view>
-
-          <view style="display: flex;">
-            <view class="table-content-row-font">
-              <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="可售量"></dk-text>
-            </view>
-            <view style="font-size: 13px;color: #CAA977;">
-              {{item.balanceQuantity }}
-            </view>
-          </view>
-        </view>
-      </view>
-
-
-    </view>
-  </view>
-</view>
-
-<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">到底了~</van-divider>
-<van-cell wx:if="{{goodsList.length==0}}" border="{{ false }}">
-  <view style="width:100%;height:100%">
-    <van-empty description="暂无库存" />
-  </view>
-</van-cell>
-
-<view style="height: 20rpx;"></view>
-
-
-
-
-
-
-
-
-
-<van-sidebar wx:if="{{sidebarFlag}}" activeKey="{{sideKey}}" bindchange="changeSidebar" custom-class="left-class">
-  <view style="height:calc({{windowHeight+'px'}} - {{'200rpx'}});overflow: scroll;">
-    <van-sidebar-item wx:key="index" custom-class="{{sideKey - 1 == index? 'sidebar-item-before': (sideKey + 1 == index?'sidebar-item-next':'sidebar-item')}}" title="{{item.name}}" data-id="{{item.id}}" wx:for="{{typeList}}" />
-  </view>
-</van-sidebar>
-<!-- 仓库 -->
-<dk-single-dropdown-item show="{{whFlag}}" content="{{form.whName}}" id='warehouse-orther' typeName='warehouse-orther' bind:muticommit='mutiSearch' bind:muticlose='muticlose'>
-</dk-single-dropdown-item>
-
-<dk-single-dropdown-item show="{{whFlagErp}}" erpUserCode="true" content="{{form.whName}}" id='warehouse' typeName='erpWarehouse'
-    bind:muticommit='mutiSearch'  bind:muticlose='muticlose'>
-</dk-single-dropdown-item>
+<!--package-sales/pages/inventory/inventory.wxml-->
+<text>package-sales/pages/inventory/inventory.wxml</text>

+ 0 - 94
package-sales/pages/inventory/inventory.wxss

@@ -1,94 +0,0 @@
-/* package-sales/pages/inventory/inventory.wxss */page{
-  background-color: white;
-}
-.search-class {
-  height: 78rpx;
-}
-.left-class{
-  color:#0072ff;
-  position: fixed;
-  left:20rpx;
-  top: 196rpx;
-  width:130rpx !important;
-
-}
-
-.sidebar-item{
-  padding: 30rpx 25rpx 20rpx 35rpx !important;
-  font-size:13px !important;
-  background: #ECF2FF !important;
-  color: #95A8CB !important;
-}
-
-.sidebar-item-before{
-  padding: 30rpx 25rpx 20rpx 35rpx !important;
-  font-size:13px !important;
-  background: #ECF2FF !important;
-  border-bottom-right-radius: 30rpx;
-  color: #95A8CB !important;
-}
-
-.sidebar-item-next{
-  padding: 30rpx 25rpx 20rpx 35rpx !important;
-  font-size:13px !important;
-  background: #ECF2FF !important;
-  border-top-right-radius: 30rpx;
-  color: #95A8CB !important;
-}
-
-.van-sidebar-item--selected{
-  position: relative;
-  background: #fff !important;
-  border-radius: 15rpx 30rpx 30rpx 15rpx !important;
-  border: 0 !important;
-  color: black  !important;
-  /* border-top-left-radius: 0;
-  border-top-right-radius: 30rpx;
-  border-bottom-left-radius: 0;
-  border-bottom-right-radius: 30rpx; */
-}
-
-/**左侧字体样式*/
-.van-sidebar-item__text{
-  width: 70rpx !important;
-}
-
-.van-sidebar-item--selected::after{
-  content: '';
-  position: absolute;
-  left: 0;
-  height: 40rpx;
-  width: 6rpx;
-  background-color: #1B365D;
-  top: calc((100% - 40rpx)/2);
-}
-/**扫一扫**/
-.scan-class {
-  position: fixed;
-  top: 9rpx;
-  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 {
-  background: #F8F9FD !important;
-  padding-left: 0 !important;
-}
-
-.customer-and-status {
-  display: flex;
-  width: 100%;
-  justify-content: space-around;
-}

+ 38 - 1
package-sales/pages/order-billing/add/add.js

@@ -86,7 +86,44 @@ Page({
      * @date : 2024/1/23 9:16
      */
     getCustomerData(params) {
-      return this.excute(this.data.customerService, this.data.customerService.selectByCondNoPage, params);
+      return this.excute(this.data.customerService, this.data.customerService.selectByCondNoPage, params).then(res=>{
+        if(res.data.code == 200){
+          if(res.data.data.length > 0){
+            console.log('res',res)
+            let formData = JSON.parse(this.data.formData) 
+            let item  = res.data.data[0]
+            formData.cusCode = item.cusCode
+            formData.cusId = item.cusId
+            formData.cusName = item.cusName
+            // formData.cusPhone = item.cusPhone
+            formData.cusFromName = item.cusFromName
+            formData.cusFrom = item.cusFrom
+            //处理地址
+            formData.address = {
+              address: item.addressFull,
+              addressFull: item.addressFull,
+              addressArea: item.addressArea,
+              addressGcj02: item.addressGcj02,
+              addressName: item.addressName,
+            }
+            formData.addressArea = item.addressArea
+            formData.addressFull = item.addressFull
+            formData.addressGcj02 = item.addressGcj02
+            formData.addressName = item.addressName
+            formData.addressNo = item.addressNo
+            //订单销售渠道 ,默认取的部门的渠道
+            // formData.salesChannel = item.channelId
+            // formData.channelId = item.channelId
+            // formData.channelName = item.channelName
+            formData.contactPhone = item.contactPhone
+            formData.contactPhone = item.contactPhone
+
+            this.setData({
+              formData: JSON.stringify(formData)
+            })
+          }
+        }
+      });
     },
   /**
    * @desc   : 选择回调

+ 183 - 126
package-sales/pages/sales-outbound/add/add.js

@@ -9,9 +9,10 @@ Page({
    */
   data: {
     // 路由
-    routeObjName: 'saleOutBound',
+    routeObjName: 'outbound',
     table: Constants.tables.order,
     orderService: app.globalData['orderService'],
+    saleOutBoundService: app.globalData['saleOutBoundService'],
     btnFormData: JSON.stringify({ flag: true }),
     cardList: [
       { name: 'main', title: mixins.$t("customerInformation") },
@@ -58,17 +59,32 @@ Page({
       { code: 'receivable', content: 0, type: 'number' }
     ],
     popContent: [
-      { code: 'orderQty', type: 'step', title: mixins.$t("count"), required: true },
+      { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true },
       { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true },
       {
-        code: 'whId', name: 'whName', choosePopupType:'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
+        code: 'whId', name: 'whName', choosePopupType: 'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
       },
       { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
       { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', },
     ],
   },
 
-
+  toEdit() {
+    let this_ = this
+    wx.navigateTo({
+      url: this_.data.route.add.url,
+      events: {
+        // 保存成功后刷新页面
+        refresh: function (data) {
+        }
+      },
+      success: function (res) {
+        res.eventChannel.emit('params', {
+          formMode:'edit',id:this_.data.id
+        });
+      }
+    })
+  },
 
   /**
      * @desc :   自动办理事件
@@ -91,79 +107,8 @@ Page({
     }
   },
 
-  /**
-   * @desc   : 选择回调
-   * @author : 于继渤
-   * @date   : 2024/1/26 11:46
-   */
-  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.objectId = item.cusId
-      formData.cusName = item.cusName
-      formData.cusPhone = item.cusPhone
-      formData.cusFromName = item.cusFromName
-      formData.cusFrom = item.cusFrom
-      //处理地址
-      formData.address = this.setAddress(item)
-      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 (code == 'staff') {
-      formData.staff = item.staffItem
-      formData['staffId'] = item.staffMain.staffId
-      formData['staffName'] = item.staffMain.staffName
-      formData['staffList'] = item.staffList
-      console.log(item.staffList)
-    }
-    ///设置主从业务部门
-    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
-    }
-    //选择源单
-    if (code == 'fromNo') {
-      if (item.itemList && item.itemList.length > 0) {
-        //处理商品明细
-        // item.itemList.forEach(res => {
-        //   res.priceOut = res.sale
-        // })
-        formData.goodsList = item.itemList
-
-
 
 
-        formData.fromNo = item.fromNo
-        this.calculateAmount(formData)
-      }
-    }
-
-
-    this.setData({
-      formData: JSON.stringify(formData)
-    })
-
-  },
-
   /**
     * @desc : 底部按钮事件
     * @date : 2024/2/1 15:49
@@ -185,12 +130,9 @@ Page({
     * @author : 于继渤
     */
   setParams(params) {
-
-    // params.goodsList.forEach(res=>{
-    //   res.orderQty
-    // })
-
-
+    params.goodsList.forEach(res=>{
+        console.log(res)
+    })
     params.itemList = params.goodsList //明细
     params.makeStaff = app.globalData.user.staffId
     // params.deleteItemList = params.deleteList ? params.deleteList : []
@@ -210,10 +152,12 @@ Page({
    * @author : 于继渤
    */
   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.outboundInsert, this.data.params);
+    if (this.data.formMode == Constants.formMode.edit  && this.data.formType !== Constants.formMode.detail) { //编辑
+      return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.outboundUpdate, this.data.params);
+    } else if(this.data.formMode == Constants.formMode.add && this.data.formType !== Constants.formMode.detail){ //新建
+      return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.outboundInsert, this.data.params);
+    }else if(this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail){ //办理
+      return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.handleOutbound, this.data.params);
     }
 
   },
@@ -270,45 +214,79 @@ Page({
       cardList: cardList,
       formData: JSON.stringify(data)
     })
-    //查询商品明细
-    this.getItemDetal(data.orderId)
-
-
+    if (this.data.formMode == 'edit') { //编辑  办理页
+      //处理商品
+      this.calculateAmount(data)
+    } else {
+      //查询商品明细
+      this.getItemDetal(data.orderId)
+    }
   },
 
-
-
-  // 设置参数
-
-
   /**
-    * @desc : 设置表单 为只读状态
-    * @date : 2024/2/1 15:49
-    * @author : 于继渤
-    */
-  setFormMain() {
-    let contentObj = this.data.contentObj
-    contentObj.main = [
-      { code: 'cusName', type: 'str', readonly: true, required: true, title: mixins.$t('customerName') },
-      { code: 'cusPhone', type: 'str', readonly: true, required: true, title: mixins.$t('cusPhone') },
-      { code: 'addressFull', type: 'str', readonly: true, required: true, title: mixins.$t('addressFull') },
-      { code: 'addressNo', type: 'str', readonly: true, required: true, title: mixins.$t('addressNo') },
-      { code: 'channelName', type: 'str', readonly: true, required: true, title: mixins.$t('saleChannel') },
-      { code: 'cusFromName', type: 'str', readonly: true, required: false, title: mixins.$t('customerSource') },
-    ]
-    contentObj.relation = [{
-      code: 'fromNo',
-      type: 'str',
-      title: mixins.$t("sourceOrder"),//'关联源单'
-      readonly: true,
-    }],
-      this.setData({
-        contentObj: contentObj
-      })
+   * @desc   : 选择回调
+   * @author : 于继渤
+   * @date   : 2024/1/26 11:46
+   */
+  chooseData(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.objectId = item.cusId
+      formData.cusName = item.cusName
+      formData.cusPhone = item.cusPhone
+      formData.cusFromName = item.cusFromName
+      formData.cusFrom = item.cusFrom
+      //处理地址
+      formData.address = this.setAddress(item)
+      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 (code == 'staff') {
+      formData.staff = item.staffItem
+      formData['staffId'] = item.staffMain.staffId
+      formData['staffName'] = item.staffMain.staffName
+      formData['staffList'] = item.staffList
+      console.log(item.staffList)
+    }
+    ///设置主从业务部门
+    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
+    }
+    //选择源单
+    if (code == 'fromNo') {
+      if (item.itemList && item.itemList.length > 0) {
+        formData.goodsList = item.itemList
+        formData.fromNo = item.fromNo
+        this.calculateAmount(formData)
+      }
+    }
+    this.setData({
+      formData: JSON.stringify(formData)
+    })
 
   },
 
 
+
   /**
     * @desc : 处理地址
     * @date : 2024/2/1 15:49
@@ -338,10 +316,9 @@ Page({
     formData.goodsList.forEach(item => {
       //标价合计 =  商品标价 x  商品数量
       sumStandard += item.amtStd
-      item['outingAmt'] = item.orderQty * item.priceOut 
-     
-      sumAmount += item.orderQty * item.priceOut //没有售价默认取标价
-      sumQuantity += item.orderQty //数量
+      item.outingAmt = item.outingQty * item.priceOut
+      sumAmount += item.outingQty * item.priceOut //没有售价默认取标价
+      sumQuantity += item.outingQty //数量
     })
     formData.sumStandard = sumStandard
     formData.saleDiscount = Number((sumAmount / sumStandard) * 100).toFixed(2)
@@ -355,7 +332,13 @@ Page({
     cardList[2].sumStandard = formData.sumStandard
     cardList[2].sumQuantity = formData.sumQuantity
     cardList[2].saleDiscount = formData.saleDiscount
-    contentSaveList[2].content = formData.sumAmount
+    //详情 办理
+    if (this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail) {
+      contentSaveList[1].content = formData.sumAmount
+    } else {
+      contentSaveList[2].content = formData.sumAmount
+    }
+
     this.setData({
       cardList: cardList,
       contentSaveList: contentSaveList,
@@ -369,17 +352,14 @@ Page({
    * @author : 于继渤
    */
   setGoods(e) {
-    console.log('设置商品', e)
     //设置需收款
     let formData = JSON.parse(this.data.formData)
     let index = 0
     formData.goodsList.forEach(res => {
       //处理出库字段
       res.priceOut = res.priceSale
-      res.orderQty = res.itemQty
       res.outingQty = res.itemQty
       res.itemIndex = index++
-
     })
     this.setData({
       formData: JSON.stringify(formData)
@@ -406,7 +386,72 @@ Page({
 
 
 
+  /**
+      * @desc : 设置表单 
+      * @date : 2024/2/1 15:49
+      * @author : 于继渤
+      */
+  setFormMain() {
+    let contentObj = this.data.contentObj
+    let cardList = this.data.cardList
+    let buttonSaveList = this.data.buttonSaveList
+    let contentSaveList = this.data.contentSaveList
+    let popContent = this.data.popContent
+    contentObj.main = [
+      { code: 'cusName', type: 'str', readonly: true, required: false, title: mixins.$t('customerName') },
+      { code: 'cusPhone', type: 'str', readonly: true, required: false, title: mixins.$t('cusPhone') },
+      { code: 'addressFull', type: 'str', readonly: true, required: false, title: mixins.$t('addressFull') },
+      { code: 'addressNo', type: 'str', readonly: true, required: false, title: mixins.$t('addressNo') },
+      { code: 'channelName', type: 'str', readonly: true, required: false, title: mixins.$t('saleChannel') },
+      { code: 'cusFromName', type: 'str', readonly: true, required: false, title: mixins.$t('customerSource') },
+    ]
+    contentObj.relation = [{
+      code: 'fromNo',
+      type: 'str',
+      title: mixins.$t("sourceOrder"),//'关联源单'
+      readonly: true,
+    }],
+
+      contentObj.other = [
+        { code: 'contractNo', type: 'str', readonly: true, required: false, title: mixins.$t('contractNumber') },
+        { code: 'deliveryDate', type: 'str', readonly: true, required: false, title: mixins.$t('delivery_Time') },
+        { code: 'remarks', type: 'str', readonly: true, required: false, title: mixins.$t('remarks') },
+        { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
+      ]
+
+    cardList = [
+      { name: 'main', title: mixins.$t("customerInformation") },
+      { name: 'relation' },
+      { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: false, itemAmt: '', displayNum: 2 },
+      { name: 'other', title: mixins.$t("otherInfo") }
+    ]
+    //详情(办理)
+    if (this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail) {
+      //按钮
+      buttonSaveList = [
+        { code: 'save', title: mixins.$t("outProcessing"), width: '120rpx', color: '#1B365D' }
+      ]
+      contentSaveList = [
+        { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
+        { code: 'receivable', content: 0, type: 'number' }
+      ]
+      popContent = [
+        { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
+        { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true, readonly: true },
+
+        { code: 'whName', title: mixins.$t("warehouseId"), type: 'str', readonly: true, readonly: true },
+        { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', readonly: true },
+      ]
+    }
+    this.setData({
+      contentObj: contentObj,
+      cardList: cardList,
+      popContent: popContent,
+      contentSaveList: contentSaveList,
+      buttonSaveList: buttonSaveList,
+    })
 
+  },
 
 
   /**
@@ -414,7 +459,7 @@ Page({
    */
   loadInit() {
     let formData = JSON.parse(this.data.formData)
-
+    console.log(this.data.formMode)
     if (this.data.formMode == Constants.formMode.other) { //转出库
       //查询可出库销售订单/商品
       this.setFormMain()
@@ -426,6 +471,18 @@ Page({
       eventChannel.on('params', function (data) {
         console.log('新建', data)
       })
+    } else if (this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail) { //详情
+      //详情办理
+      wx.setNavigationBarTitle({
+        title: '销售出库详情'
+      })
+      //设置只读
+      this.setFormMain()
+    } else if (this.data.formMode == Constants.formMode.edit && !this.data.formType) {
+      //编辑
+      wx.setNavigationBarTitle({
+        title: '编辑销售出库'
+      })
     }
     this.setData({
       formData: JSON.stringify(formData)

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

@@ -3,11 +3,20 @@
 <loading wx:if="{{loading}}"></loading>
 
 
-<dk-form-bill type="saleOut" id="dk-form-bill" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode"  subCol="skuCode" descCol="skuModel" priceCol="priceOut" quantityCol="orderQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}"
+<dk-form-bill type="saleOut" id="dk-form-bill" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode"  subCol="skuCode" descCol="skuModel" priceCol="priceOut" quantityCol="outingQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}"
 bind:editItems="editItems"  bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList"
 bind:customersChoose="customersChoose"   popType="sale" priceTitle="标价:" staff="staff" org="org">
 </dk-form-bill>
 <van-dialog id="van-dialog" />
 <view style="height: 200rpx;"></view>
+
+<!-- 底部加号 -->
+<view style="position: fixed;bottom: 230rpx;right: 30rpx;" wx:if="{{formMode == 'edit' && formType =='detail'}}">
+  <view bind:tap="toEdit" class="btn-add-class">
+    <van-icon name="edit" color="#FFFFFF" size="60rpx" />
+  </view>
+</view>
+
+
 <!--  保存 -->
 <dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="saveButton" bind:change="saveChange"></dk-save-button>

+ 9 - 0
package-sales/pages/sales-outbound/add/add.wxss

@@ -436,3 +436,12 @@ page {
   color: #95A8CB !important;
   font-size: 12px !important;
 }
+.btn-add-class {
+	background: #8091A9;
+	border-radius: 50%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	padding: 20rpx;
+	box-shadow: 0px 17px 22px 0px #1B365D33;
+}