Sfoglia il codice sorgente

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

姜永辉 2 anni fa
parent
commit
157f8336bf

+ 6 - 0
api/pages/ivt/inboundReturn.js

@@ -29,6 +29,12 @@ module.exports = {
         key:'detail',url:'/package-purchase/pages/purchase-return/detail/detail'
       },
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-data/select-data',type:'warehouse'  },
+      add:{
+        key:'add',url:'/package-purchase/pages/purchase-return/add/add'
+      },
+      chooseSupplier: { key: 'chooseSupplier', url: '/package-base-select/pages/select-data/select-data',type:'supplier'  },
+      chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-data/select-data',type:'staff'  },
+      chooseOrg: { key: 'chooseOrg',url: '/package-base-select/pages/select-data/select-data',type:'org' }, 
     }
   } 
 };

+ 26 - 0
api/pages/ivt/saleOutBoundReturn.js

@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:入库
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		于继渤		  	     2024-1-19       			1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+  saleOutBoundReturnService: {
+    // 前缀
+    prefix: 'mdm-server/ivt/outbound_sale_return/'
+  },
+
+  routeUrl: {
+    saleOutBoundReturn: { 
+      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'
+      },
+      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'  },
+    }
+  }
+};

+ 23 - 0
api/pages/mst/comMenu.js

@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:常用功能查询方法
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		周兴		    2024-3-28     1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+
+  comMenuService: {
+    // 前缀
+    prefix: 'mdm-server/mst/comMenu/',
+    // 保存常用功能
+    save:'save'
+  },
+
+  routeUrl: {
+    comMenu: {
+    }
+  }
+};

+ 3 - 1
app.js

@@ -62,10 +62,12 @@ const inboundReturn = require('./api/pages/ivt/inboundReturn.js');
 const cusReceiptPayment = require('./api/pages/mac/cusReceiptPayment.js');
 const menuFrequency = require('./api/pages/mst/menuFrequency.js');
 const userMenuFrequency = require('./api/pages/mst/userMenuFrequency.js');
+const comMenu = require('./api/pages/mst/comMenu.js');
+const saleOutBoundReturn = require('./api/pages/ivt/saleOutBoundReturn.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,saleOutBound,inboundReturn,cusReceiptPayment,menuFrequency,userMenuFrequency]
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income,saleOutBound,inboundReturn,cusReceiptPayment,menuFrequency,userMenuFrequency,comMenu,saleOutBoundReturn]
 
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 87 - 47
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -112,7 +112,7 @@ Component({
     quantityMin: { //步进器 最小值
       type: String,
     },
-    quantityMax:{
+    quantityMax: {
       type: String
     },
     showPopFlag: { //弹窗标识  true 不弹窗
@@ -153,46 +153,50 @@ Component({
     delValidFlag: {
       type: Boolean,
     },
-      // 对象取值列
-      objCol: {
-        type: String
-      },
-      // 对象列名
-      objLabel: {
-        type: String
-      },
-      // 对象类型(客户customer;供应商supplier)
-      objType: {
-        type: String
-      },
-      // 对象标题
-      objTitle: {
-        type: String,
-        value: 'cusName'
-      },
-      // 对象副标题
-      objSubTitle: {
-        type: String,
-        value: 'cusPhone'
-      },
-      // 金额标题
-      amountTitle: {
-        type: String,
-        value: '应收金额'
-      },
-      // 金额列
-      amountCol: {
-        type: String,
-        value: 'receivableResidue'
-      },
-      // 对象Id列
-      objIdCol: {
-        type: String,
-        value: 'cusId'
-      },
-      chooseText:{
-        type: String,
-      },
+    // 对象取值列
+    objCol: {
+      type: String
+    },
+    // 对象列名
+    objLabel: {
+      type: String
+    },
+    // 对象类型(客户customer;供应商supplier)
+    objType: {
+      type: String
+    },
+    // 对象标题
+    objTitle: {
+      type: String,
+      value: 'cusName'
+    },
+    // 对象副标题
+    objSubTitle: {
+      type: String,
+      value: 'cusPhone'
+    },
+    // 金额标题
+    amountTitle: {
+      type: String,
+      value: '应收金额'
+    },
+    // 金额列
+    amountCol: {
+      type: String,
+      value: 'receivableResidue'
+    },
+    // 对象Id列
+    objIdCol: {
+      type: String,
+      value: 'cusId'
+    },
+    chooseText: {
+      type: String,
+    },
+
+    goodsTagColor: { //标签颜色
+      type: String,
+    },
     // 结果集
     value: {
       type: String,
@@ -241,7 +245,7 @@ Component({
       if (this.data.type == Constants.billType.sale ||
         this.data.type == Constants.billType.pur
         ||
-        this.data.type == Constants.billType.out) {
+        this.data.type == Constants.billType.out || this.data.type == Constants.billType.purReturn) {
         this.setData({
           selectGoodsUrl: '/package-base-select/pages/select-goods/select-goods'
         })
@@ -1037,6 +1041,10 @@ Component({
         if (this.data.type == Constants.billType.sale) {
           this.setGoodsAmount(e.data);
         }
+
+        if (this.data.type == Constants.billType.purReturn) { //采购退货
+          this.setReturnGoodsAmount(e.data);
+        }
         if (this.data.type == Constants.billType.pur) {
           // this.setPurGoodsAmount(e.data);
         }
@@ -1060,20 +1068,20 @@ Component({
       let deleteFlag = true;
       let item = e.currentTarget.dataset.item
       // 判断删除前是否需要判断
-      if(this.data.delValidFlag){
+      if (this.data.delValidFlag) {
         // 行不允许删除
-        if(item.deleteFlag == false){
+        if (item.deleteFlag == false) {
           deleteFlag = false;
         }
       }
       // 不允许删除给出提示信息
-      if(!deleteFlag){
+      if (!deleteFlag) {
         wx.showToast({
-          title: item.message?item.message:'不满足删除条件',
+          title: item.message ? item.message : '不满足删除条件',
           image: '/static/image/warning.png',
           duration: 2000
         })
-      }else{
+      } else {
         const { instance } = e.detail;
         let index = e.currentTarget.dataset.index
         // 删除明细
@@ -1204,6 +1212,38 @@ Component({
       })
     },
     /**
+  * @desc : 设置商品明细金额相关信息 TODO 
+  * @author : 周兴
+  * @date : 2024/1/19
+  */
+    setReturnGoodsAmount(data) {
+      let cardList = this.data.cardList
+      let form = this.data.form
+      let index = cardList.findIndex(it => it.name == 'items');
+      if (form.goodsList && form.goodsList.length > 0) {
+        let sumReturnAmt = Number(0) //合计金额
+        let sumReturnQty = Number(0)
+        form.goodsList.forEach(item => {
+          item.priceReturn = item.priceStandard * -1
+          item.priceInto = item.priceStandard 
+          item.itemAmt = Number(item.priceReturn * item.itemQty)
+          item.itemQtyMax = -1
+          item.itemQtyMin = item.usableQty * -1
+          // sumReturnAmt += item.priceReturn * item.itemQty
+          // sumReturnQty += item.itemQty
+          item.itemQty = item.itemQty * -1
+        })
+        // form.sumReturnQty = sumReturnQty
+        // form.sumReturnAmt = sumReturnAmt
+        // cardList[index].sumReturnAmt = sumReturnAmt
+      }
+      console.log('form', form)
+      this.setData({
+        cardList: cardList,
+        form: form
+      })
+    },
+    /**
      * @desc : 上传附件超出大小
      * @author : 周兴
      * @date : 2024/3/27 16:16

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

@@ -23,7 +23,7 @@
         <!--明细,增加选择商品按钮-->
         <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>
+        <dk-tag wx:if="{{card.name == 'items' && goodsTagText}}" type="primary" padding="0 20rpx" height="40rpx" color="{{goodsTagColor ? goodsTagColor:'#77C5D5'}}" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{goodsTagText}}" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
 
       </view>
     </view>

+ 0 - 4
components/dkbase/dk-number-input/dk-number-input.js

@@ -192,9 +192,7 @@ Component({
     * @date : 2022/6/30 16:16
     */
     bindFocus(e){
-
       if(isNaN(this.data.inputValue)){
-        console.log('ttt',this.data.inputValue,isNaN(this.data.inputValue));
         this.setData({
           inputValue:0
         })
@@ -206,7 +204,6 @@ Component({
     * @date : 2022/6/30 16:16
     */
     bindInput(e) {
-      console.log('ddd1',e,this.data.inputValue);
       let flag = true;
       let values = e.detail.split('.')
       // 如果输入的是小数点,那么需要判断是否已经有小数点
@@ -328,7 +325,6 @@ Component({
       //添加判断条件,当用户输入空数据问题会出现NaN  于继渤2022/06/30 
       if (inputValue != undefined && inputValue && inputValue != 0) {
         // 判断是否有千分位
-        console.log('ttt',this.data.formatThousandth);
         if (this.data.formatThousandth) {
           displayValue = common.toThousandCents(inputValue);
         }

+ 1 - 1
components/dkbase/dk-number-input/dk-number-input.wxml

@@ -13,7 +13,7 @@
   </view> -->
   <!--文本框-->
   <view wx:else style="padding-top: 2rpx; padding-bottom: 2rpx;">
-    <van-field label-class="input-title-class" style="--color--:{{titleColor}};--fontSize--:{{fontSize + 'px'}};--width--:{{titleWidth}};--fontWeight--:{{titleFontWeight}}" value="{{inputValue?inputValue:undefined}}" input-align="left" label="{{titleValue}}" placeholder="{{placeholder}}" autosize auto-focus clearable border="{{ false }}" input-class="dk-cell-value-class" type="number" bind:focus="bindFocus" bind:change="bindInput" bind:blur="bindBlur">
+    <van-field label-class="input-title-class" style="--color--:{{titleColor}};--fontSize--:{{fontSize + 'px'}};--width--:{{titleWidth}};--fontWeight--:{{titleFontWeight}}" value="{{inputValue?inputValue:undefined}}" input-align="left" label="{{titleValue}}" placeholder="{{placeholder}}" autosize auto-focus clearable border="{{ false }}" input-class="dk-cell-value-class" type="text" inputMode="decimal" bind:focus="bindFocus" bind:change="bindInput" bind:blur="bindBlur">
     </van-field>
   </view>
 </view>

+ 1 - 1
config/config.js

@@ -3,7 +3,7 @@ const profiles = 'dev';
 const configListObj = {
   // 北京东科企信软件有限公司 本地开发
   dev: {
-    server_add: 'http://192.168.0.57',     server_port: '7001',
+    server_add: 'http://192.168.0.90',     server_port: '7001',
     upload_url:'https://s.dev01.dkiboss.com:7000/api/mdm-server/file/upload',
     image_url:'https://s.dev01.dkiboss.com:7000/file',
     corpid: 'ww796c5d1684937b2f', //企业微信corpid

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

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

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

@@ -72,7 +72,7 @@
   </scroll-view>
 
   <!--出库商品 列表 -->
-  <view wx:if="{{active == 0 && billType == 'out'}}" catch:tap="openAddItemInfo" wx:for="{{tableData}}" data-item="{{item}}" wx:key="index" class="main-class" style="width: 75%;margin-left: 166rpx; ">
+  <view wx:if="{{active == 0 && (billType == 'out' ||  billType =='purReturn')}}" catch:tap="openAddItemInfo" wx:for="{{tableData}}" data-item="{{item}}" wx:key="index" class="main-class" style="width: 75%;margin-left: 166rpx; ">
     <view class="main-foot" style="border-radius:15rpx;">
       <view>
         <view class="table-content-row">

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

@@ -114,7 +114,8 @@ Page({
         res.inboundItemList.forEach(item => {
           if (item.checked) {
             item.itemQty = Number(item.rejectQty * -1)
-            item.itemQtyMax = Number(item.rejectQty * -1)
+            item.itemQtyMin = Number(item.rejectQty * -1)
+            item.itemQtyMax = Number(-1)
             item.priceReturn = Number(item.priceInto * -1)
             item.itemAmt = Number(item.rejectQty * item.priceInto * -1)
             choooseInboundItemList.push(item)
@@ -131,6 +132,7 @@ Page({
     contentSaveList[2]['content'] = returnTotalAmount.toFixed(2)
 
     this.setData({
+      returnTotalAmount:returnTotalAmount,
       choooseInboundItemList: choooseInboundItemList,
       contentSaveList: contentSaveList,
     })
@@ -154,7 +156,7 @@ Page({
         res.eventChannel.emit('params', {
           formMode:'add',
           choooseInboundItemList: choooseInboundItemList,
-          goodsRejectedAmount: that.data.returnTotalAmount,
+          beforeSumAmount: that.data.returnTotalAmount * -1,
           item: JSON.stringify(item)
         })
       }

+ 0 - 1
package-basic-data/pages/basic-data/basic-data-sort/basic-data-sort.js

@@ -52,7 +52,6 @@ Page({
       */
   setSearchParams(params) {
     params.dictCode = this.data.formType
-    params.cpId = 1
     return params
   },
 

+ 112 - 21
package-purchase/pages/purchase-return/add/add.js

@@ -2,6 +2,7 @@ const Constants = require('@/utils/Constants.js');
 import Dialog from '@/dist/dialog/dialog.js';
 const mixins = require('@/mixins/index.js')
 const app = getApp()
+const utils = require('@/utils/util')
 Page({
   mixins: [mixins],
   /**
@@ -17,7 +18,7 @@ Page({
     showPopFlag: true,
     stepperFlag: true,
     cardList: [
-      { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: '', sumReturnAmt: 0, displayNum: 2 },
+      { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: false, sumReturnAmt: 0, displayNum: 2 },
       { name: 'other', title: mixins.$t("otherInfo") }
     ],
 
@@ -26,6 +27,15 @@ Page({
     ],
 
     contentObj: {
+      main: [
+        { code: 'supId', name: 'supName', title: mixins.$t("supplier"), type: 'choose', required: true, urlKey: 'chooseSupplier' },
+        {
+          code: 'staffId', name: 'staffName', title: mixins.$t("procureStaff"), type: 'choose', urlKey: 'chooseStaff'
+        },
+        {
+          code: 'orgId', name: 'orgName', title: mixins.$t("procureOrg"), type: 'choose', urlKey: 'chooseOrg'
+        }
+      ],
       other: [{
         code: 'remarks',
         type: 'textarea',
@@ -54,16 +64,49 @@ Page({
       type: 'number'
     }],
   },
+  /**
+   * @desc   : 绑定数据
+   * @author : 于继渤
+   * @date   : 2024年3月12日
+   */
+  chooseData(e) {
+    console.log("t", e, this.data.formData);
+    let formData = JSON.parse(this.data.formData)
+    let code = e.detail.code
+    let data = e.detail.data.data
+    if (code == "supId") { //供应商
+      formData.supId = data.id
+      formData.supName = data.name
+    }
+    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)
+    })
+  },
   /**
 * @desc : 设置保存参数
 * @date : 2024/3/19 15:49
 * @author : 于继渤
 */
   setParams(params) {
-    if (this.data.formMode !== 'edit') {
+    if (this.data.formMode !== 'edit' && this.data.formType !== 'add') {
       params.fromId = this.data.item.purId ? this.data.item.purId : params.purId //采购订单id
       params.fromNo = this.data.item.purNo ? this.data.item.purNo : params.purNo //采购订单id
+      params.supId = this.data.item.supId
+    } else {
+      //没源单的明细
+      let itemIndex = 0
+      params.goodsList.forEach(res => {
+        res.itemIndex = itemIndex++
+      })
     }
 
     let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
@@ -73,7 +116,8 @@ Page({
     params.orgId = app.globalData.user.orgId
     params.staffId = app.globalData.user.staffId
     params.makeStaff = app.globalData.user.staffId
-    params.supId = this.data.item.supId
+
+    params.intoDate = utils.formatDayTime(new Date())
     delete params['goodsList']
     delete params['sumReturnAmt']
     delete params['sumReturnQty']
@@ -128,7 +172,31 @@ Page({
     this.calculateTotal()
   },
 
-
+  /**
+     * @desc : 外露设置产品方法 
+     * @date : 2024/2/1 15:49
+     * @author : 于继渤
+     */
+  setGoods(e) {
+    console.log('外露设置产品方法', e)
+    // let formData = JSON.parse(this.data.formData)
+    // let goodsList = e.detail.data
+    // let sumReturnAmt = Number(0) //合计金额
+    // let sumReturnQty = Number(0)
+    // goodsList.forEach(res => {
+    //   res.priceReturn = res.priceStandard * -1
+    //   sumReturnAmt += res.priceReturn * res.itemQty
+    //   res.itemAmt = Number(res.priceReturn * res.itemQty)
+    //   res.itemQtyMax = res.usableQty * -1
+    //   res.itemQtyMin = -1
+    //   res.itemQty = res.itemQty * -1
+    // })
+    // formData.sumReturnAmt = sumReturnAmt.toFixed(2)
+    // this.setData({
+    //   formData: JSON.stringify(formData)
+    // })
+    this.calculateTotal()
+  },
   /**
 * @desc :计算金额
 * @date : 2024/2/1 15:49
@@ -143,7 +211,7 @@ Page({
       if (this.data.formMode != 'edit') {
         res.returnQty = res.itemQty
       }
-      res.returnAmt  = Number(res.returnQty * res.priceReturn * -1)
+      res.returnAmt = Number(res.returnQty * res.priceReturn * -1)
       sumReturnAmt += res.returnAmt
       sumReturnQty += res.returnQty
     })
@@ -151,20 +219,24 @@ Page({
     formData.returnQty = sumReturnQty
     let cardList = this.data.cardList
     let contentList = this.data.contentList
-    cardList[0].sumReturnAmt = sumReturnAmt.toFixed(2)
+    cardList[1].sumReturnAmt = sumReturnAmt.toFixed(2)
     if (contentList.length > 0) {
       contentList[2].content = sumReturnAmt.toFixed(2)
     }
     let beforeSumAmount = this.data.beforeSumAmount
     let afterSumAmount = beforeSumAmount - sumReturnAmt
+
+    console.log('sumReturnAmt', sumReturnAmt)
     this.setData({
-      afterSumAmount:afterSumAmount,
+      afterSumAmount: afterSumAmount,
       cardList: cardList,
       contentList: contentList,
       formData: JSON.stringify(formData),
       sumReturnAmt: sumReturnAmt.toFixed(2),
       sumReturnQty: sumReturnQty,
     })
+
+    this.calculationSalesUsableQty()
   },
   /**
    * @desc :   自动办理事件
@@ -210,12 +282,28 @@ Page({
   },
 
 
-
-
-
-
-
-
+  //计算可售量相关
+  calculationSalesUsableQty() {
+    let formData = JSON.parse(this.data.formData)
+    formData.goodsList.forEach(res => {
+      //选择的数量大于可售量
+      if (Math.abs(res.itemQty) > res.usableQty) {
+        res['usableQtyInsufficientFlag'] = true  //可售量不足
+        res['usableQty'] = res.usableQty  //可售量
+      } else {
+        res['usableQtyInsufficientFlag'] = false  //可售量不足
+        res['usableQty'] = res.usableQty  //可售量
+      }
+    })
+    let usableQtyInsufficientFlagList = formData.goodsList.filter(item => {
+      return item.usableQtyInsufficientFlag
+    })
+    this.setData({
+      formData: JSON.stringify(formData),
+      goodsTagText: usableQtyInsufficientFlagList.length > 0 ? '备货不足' : '备货齐套', //
+      goodsTagColor: usableQtyInsufficientFlagList.length > 0 ? '#E4002B' : null  //设置颜色
+    })
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -224,18 +312,12 @@ Page({
     let that = this
     const eventChannel = this.getOpenerEventChannel()
     eventChannel.on('params', function (data) {
-
-      // data.choooseInboundItemList.forEach(res=>{
-      //   res['usableQtyInsufficientFlag'] = true  //可售量不足
-      //   res['usableQty'] = 0  //可售量
-      // })
-
-
-      if (that.data.formMode != Constants.formMode.edit) {
+      if (that.data.formMode != Constants.formMode.edit && that.data.formType != Constants.formMode.add) {
         let formData = that.data.formData
         formData = {
           goodsList: data.choooseInboundItemList
         }
+        console.log('data', data)
         that.setData({
           formData: JSON.stringify(formData),
           beforeSumAmount: Number(data.beforeSumAmount),
@@ -243,6 +325,15 @@ Page({
           item: JSON.parse(data.item)
         })
         that.calculateTotal()
+      } else if (that.data.formMode == Constants.formMode.add && that.data.formType == Constants.formMode.add) {
+        let cardList = that.data.cardList
+        that.setData({
+          cardList: [
+            { name: 'main' },
+            { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: true },
+            { name: 'other', title: mixins.$t("otherInfo") }
+          ]
+        })
       }
 
     })

+ 10 - 10
package-purchase/pages/purchase-return/add/add.wxml

@@ -1,10 +1,9 @@
-<wxs src='../../../../utils/numberFormat.wxs' module="numberFormat"></wxs>
-<wxs src='../../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+
 <van-dialog id="van-dialog" />
-<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<loading wx:if="{{loading}}" ></loading>
 
 <!-- 客户信息组件 -->
-<view class="return-style-blue">
+<view class="return-style-blue" wx:if="{{formType !== 'add'}}">
   <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="padding-right: 32rpx;padding-bottom: 15rpx;">
       <!-- 供应商 -->
@@ -47,7 +46,7 @@
 </view>
 
 <!--收款金额  -->
-<view class="return-style">
+<view class="return-style"  wx:if="{{formType !== 'add'}}">
   <view style="display: flex;  margin-bottom: 3vw;">
     <view style="width:50%;color:#1B365D;text-align: center;font-size:4vw; border-right: 1rpx lightgray solid ;" bindtap="toChooseGoods">
       <view style="font-weight:bold;font-size:15px; margin-bottom: -11px;">
@@ -67,11 +66,11 @@
 </view>
 
 
-<dk-form-bill id="dk-form-bill"  routeObjName="{{routeObjName}}"  
-cardList="{{cardList}}"  titleTagCol ="shortName"  titleCol ="skuCode"   showPopFlag="{{showPopFlag}}"
-descCol = "skuModel" priceCol ="priceReturn" quantityCol ="itemQty"   sumAmountCol ="sumReturnAmt"
+<dk-form-bill id="dk-form-bill"  routeObjName="{{routeObjName}}"   type="purReturn"
+cardList="{{cardList}}"  titleTagCol="shortName"  titleCol="skuCode"   showPopFlag="{{showPopFlag}}"
+descCol="skuModel" priceCol="priceReturn" quantityCol ="itemQty"   quantityMin="itemQtyMin" quantityMax="itemQtyMax" sumAmountCol="sumReturnAmt"  bind:chooseData="chooseData"
 contentObj="{{contentObj}}" model:value="{{formData}}"
-popType = "sale" 
+popType= "sale"   bind:setGoods="setGoods"
 
 bind:onStepper="onChangeStepper"
 quantityMin="itemQtyMin" 
@@ -85,7 +84,8 @@ quantityRedTitle="可售量:"
 quantityRedCol="usableQty"
 quantityRedColFlagKey="usableQtyInsufficientFlag"
 
-goodsTagText="备货齐套"
+goodsTagText="{{goodsTagText}}"
+goodsTagColor="{{goodsTagColor}}"
  >
 </dk-form-bill>
 

+ 22 - 2
package-purchase/pages/purchase-return/purchase-return.js

@@ -32,6 +32,7 @@ Page({
         name: [{ name: 'orgName', title: '' },
         { name: 'staffName', title: mixins.$t("staffId") }], title: mixins.$t("storeInformation")
       }],
+    
     // 弹出按钮
     buttonList: [{ name: 'cancel', title: mixins.$t("invaidOrder") }],
     // 路由
@@ -40,7 +41,7 @@ Page({
     tableData: [],
     active: 0,
     tabsActive: 0,
-    buttonSaveList:[],
+    buttonSaveList: [{ code: 'add', title: mixins.$t("add") }],
     contentSaveList:[{code:'need',title:mixins.$t("totalAmount"),type:'str'},{code:'amount',content:2000,type:'number'}]
   },
 
@@ -113,9 +114,28 @@ Page({
    */
   open(e){
     console.log(e)
+    let item = e.detail.item
     if(e.detail && e.detail.name == 'cancel'){
         //调用作废接口
-        this.cancel(e.detail.item.intoId)
+        this.cancel(item.intoId)
+    }else{
+      wx.navigateTo({
+        url: this.data.route.add.url,
+        events: {
+          // 保存成功后刷新页面
+          refresh: function (data) {
+            // 刷新一览界面
+            _this.searchData();
+          }
+        },
+        success: function (res) {
+          let data = {
+            formMode: Constants.formMode.add,
+            formType: Constants.formMode.add,
+          }
+          res.eventChannel.emit('params', data);
+        }
+      })
     }
   },
    /**

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

@@ -135,7 +135,7 @@ Page({
    */
   loadInit() {
     //客户退款
-    if (this.data.functionCode == Constants.CUSTOMER_EFUND_FUNCTIONCODE) {
+    if (this.data.menuUuid == Constants.CUSTOMER_EFUND_FUNCTIONCODE) {
       wx.setNavigationBarTitle({
         title: '客户退款'
       })

+ 32 - 232
package-sales/pages/order-return/order-return.js

@@ -5,10 +5,10 @@
  *		2.销售退货列表
  * 编辑履历:
  *		作者				日期					版本				修改内容
- *		王英杰		        2022-0-12	            1.00		   	    
+ *		于继渤		        2022-0-12	            1.00		   	    
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
-const util = require('@/utils/util.js') 
+const util = require('@/utils/util.js')
 const mixins = require('@/mixins/index.js')
 Page({
   mixins: [mixins],
@@ -16,15 +16,15 @@ Page({
    * 页面的初始数据 
    */
   data: {
-    tagList:[{title:"全部单据"},{title:"待出库"},{title:"已出库"}],
-    
-     // 查询条件
-     searchContent: [{
+    tagList: [{ title: "全部单据" }, { title: "待出库" }, { title: "已出库" }],
+
+    // 查询条件
+    searchContent: [{
       code: 'createtime',
       title: '近30天',
       defaultValue: 5,
       searchType: Constants.searchType.date
-    } , {
+    }, {
       code: 'choose',
       title: '筛选',
       searchType: Constants.searchType.pick
@@ -56,80 +56,35 @@ Page({
       dataType: 'date'
     }],
 
-    // 假数据
-    dataList: [{
-      salesChannelName: '',
-      customerId: 11,
-      customerName: '张三',
-      displayStatus: '待入库',
-      backgroundColor:'red',
-      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: '已入库', 
-      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' 
-    }],
+
 
     // 列表区(脚部金额)
     footerAmount: {
-      name: 'tsumAmount',
-      title: '共计金额'
+      name: 'outAmt',
+      title: '退货金额'
     },
     // 列表区(脚部信息)
     footerInfo: [{
       name: 'categoryQuantity',
       title: '共计'
     }, {
-      name: 'tsumQuantity',
+      name: 'outQty',
       title: '件'
     }],
     // 列表区(内容)
-    contentList: [{
-      name: 'orderNo',
-      title: '订单编号'
-    }, {
-      name: [{
-        name: 'staffName',
-        title: ''
-      },{
-        name: 'customerPhone',
-        title: ''
-      }, ],
-      title: '收获信息'
-    }, {
-      name: 'addressFull',
-      title: '客户地址'
-    },  {
-      name: 'makeTime',
-      title: '预计收获日期'
-    },],
-
+    contentList: [
+      { name: 'outNo', title: '订单编号' },
+      { name: 'cusPhone', title: '客户电话' },
+      { name: 'addressFull', title: '客户地址' },
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId')  }], title: mixins.$t('storeInformation') }
+    ],
+    buttonSaveList: [{ code: 'add', title: mixins.$t("add") }],
+    contentSaveList: [{ code: 'need', title: mixins.$t("totalAmount"), type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
     contentObj: {
       '成交': [{
         name: 'orderNo',
         title: '订单单号'
-      } , {
+      }, {
         name: [{
           name: 'orgName',
           title: ''
@@ -161,178 +116,23 @@ Page({
     buttonList: [{
       name: 'warehousingProcessing',
       title: '入库办理'
-      }, , {
-        name: 'salesReturnReversal',
-        title: '销售退货冲正'
-      } 
-     
-    ],
+    }, , {
+      name: 'salesReturnReversal',
+      title: '销售退货冲正'
+    }
 
-    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, 
-    })
-     
-  },
-  /**
-   * 跳转客户详细
-   */
-  toDetail(e) {
-    
-    
-      wx.navigateTo({
-        url: './detail/detail?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=outbound-processing',
-      })
-   
-  },
-  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: './select-original-order/select-original-order',
-    })
-  },
-  /**
-   * @desc : 右上角三个小点 点击回调事件
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
-   */
-  open(e) {
-     let name = e.detail.name
-     let item = e.detail.item 
-     if(name == 'warehousingProcessing'){  //入库办理
-      wx.navigateTo({
-        url: '/package-sales/pages/sales-return-reversal/sales-return-reversal?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=sales-return-reversal-add',
-      })
-     }
-     if(name == 'salesReturnReversal'){  //salesReturnReversal
-   
-     }
-   
-       
-  
-  },
-  /**
-   * @desc : 校验
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
-  openValidData(item, name) {
-    console.log('item', item, name, item.customerId);
-    if (!item.customerId) {
-      wx.showToast({
-        title: '无此联系人,或陌生接待',
-        icon: 'none'
-      })
-      return false;
-    }
-    return true;
+    routeObjName: 'saleOutBoundReturn',
+    active: 0
   },
-
   /**
-   * @desc : 查询
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
+     * @desc : 加载数据
+     * @author : 于继渤
+     * @date : 2024/1/23 9:16
+     */
   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
-
-    })
-
-
-
-
-    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()
-    }
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
 })

+ 4 - 8
package-sales/pages/order-return/order-return.wxml

@@ -1,6 +1,6 @@
 <!-- 前台导入wxmlUtil.wxs -->
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
-<loading wx:if="{{loading}}" loadingName="{{$t['loading']}}" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<loading wx:if="{{loading}}" ></loading>
 <van-sticky scroll-top="0">
   <!-- 查询条件 -->
   <dk-dropdown-menu model:searchForm="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['customerName','orderNo','telephone','adddress','contractNumber'])}}">
@@ -9,16 +9,12 @@
   <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>
-
-<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>
-<view style="height: 135rpx;"></view>
+<dk-list  list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="salesChannel" title="cusName" collectCol="collectAmount"  status="outStatusName" 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>
 
+<view style="height: 200rpx;"></view>
 
 
 <!-- 新建按钮 -->
-<dk-save-bottom flagTypeName="order-add" selectTotallength="{{selectTotallength}}" selectlength="{{selectlength}}" totallength="{{numberFormat.toThousandCents(totallength)}}" bind:submit="toAdd"   submitFlag="{{true}}" />
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>

+ 17 - 8
package-sales/pages/sales-outbound/add/add.js

@@ -34,7 +34,7 @@ Page({
         type: 'choose',
         controlChooseFlag: true,
         title: mixins.$t("sourceOrder"),//'关联源单'
-        urlKey: 'chooseSaleOrder'
+        urlKey: 'selectSourceSaleOrder'
       }],
       items: [
         { code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },
@@ -142,7 +142,15 @@ Page({
     //选择源单
     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)
       }
@@ -181,6 +189,7 @@ Page({
     let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
     params.flgAutoHandle = btnFormData ? btnFormData.flag : false //自动出库标识 
     params.addressName = params.address.addressName
+    params.objectId = params.cusId
     delete params['goodsList']
     delete params['orderItemResponseList']
     console.log('params', params)
@@ -275,7 +284,7 @@ Page({
       { 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: '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') },
     ]
@@ -283,11 +292,11 @@ Page({
       code: 'fromNo',
       type: 'str',
       title: mixins.$t("sourceOrder"),//'关联源单'
-      readonly: true, 
+      readonly: true,
     }],
-    this.setData({
-      contentObj: contentObj
-    })
+      this.setData({
+        contentObj: contentObj
+      })
 
   },
 
@@ -350,11 +359,11 @@ Page({
    * @author : 于继渤
    */
   setGoods(e) {
-    console.log('设置商品',e)
+    console.log('设置商品', e)
     //设置需收款
     let formData = JSON.parse(this.data.formData)
     let index = 0
-    formData.goodsList.forEach(res=>{
+    formData.goodsList.forEach(res => {
       //处理出库字段
       res.priceOut = res.priceSale
       res.orderQty = res.itemQty

+ 151 - 6
pages/index/index.js

@@ -19,6 +19,10 @@ Page({
    * 页面的初始数据
    */
   data: {
+    showMore: false,
+    editFlag: false, // 编辑模式
+    comMenuList: [], // 常用功能
+    comMenuListForCheck:[] ,// 常用功能(简单数组)用于判断
     allCondition: '',//搜索菜单
     noticeShowFlag: true,// 是否显示通知的
     loadingShow: false,
@@ -341,8 +345,8 @@ Page({
         ImageUri: '/static/img/collection.png',
         PFunctionCode: '05',
         FunctionCode: '0509'
-      }, 
-      { 
+      },
+      {
         FunctionName: '资金账户',
         FormName: '/package-accounts-manage/pages/fund-account/fund-account',
         ImageUri: '/static/img/collection.png',
@@ -459,7 +463,86 @@ Page({
 
     ],
   },
+  /**
+   * @desc   : 展开收缩
+   * @author : 周兴
+   * @date   : 2024/1/26 11:46
+   */
+  expand() {
+    let showMore = this.data.showMore;
+    this.setData({
+      showMore: !showMore
+    })
+  },
+  /**
+  * @desc : 进入编辑模式
+  * @author : 周兴
+  * @date : 2024/3/29
+  */
+  toEdit() {
+    let editFlag = this.data.editFlag
+    // 变为编辑模式
+    if(!editFlag){
+      editFlag = !editFlag;
+      let showMore = this.data.showMore
+      if (editFlag) {
+        showMore = true;
+      }
+      this.setData({
+        showMore: showMore,
+        editFlag: editFlag
+      })
+    }else{
+      // 保存常用功能
+      this.saveComMenu();
+    }
+  },
+  /**
+  * @desc : 保存常用功能
+  * @author : 周兴
+  * @date : 2024/3/29
+  */
+  saveComMenu(){
+    let comMenuList = this.data.comMenuList || []
+    comMenuList.forEach((it,index)=>{
+      it.staffId =  app.globalData.user.staffId,
+      it.appCode = Constants.APP_CODE,
+      it.displayNo = index
+    })
 
+    let service = app.globalData['comMenuService']
+    api.request(service.prefix + service.save, 'POST', comMenuList).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        wx.showToast({
+          title: "保存成功",
+          image: '/static/image/success.png',
+          duration: 1000
+        })
+      }
+    });
+  },
+  /**
+  * @desc : 查询常用应用
+  * @author : 周兴
+  * @date : 2024/3/29
+  */
+  getComMenu() {
+    let params = {
+      staffId: app.globalData.user.staffId,
+      appCode: Constants.APP_CODE,
+    }
+    let service = app.globalData['comMenuService']
+    api.request(service.prefix + service.selectByCond, 'POST', params).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        let comMenuList = res.data.data
+        let comMenuListForCheck = comMenuList.map(it=>it.menuUuid)
+        this.setData({
+          comMenuList: comMenuList,
+          comMenuListForCheck:comMenuListForCheck
+        })
+      }
+    });
+  },
   /**
  * 过滤菜单
  */
@@ -636,11 +719,25 @@ Page({
    */
   onLoad: function (options) {
     // 调用权限时候放开
-    this.filterFunction()
+    this.filterFunction();
+    // 查询常用功能
+    this.getComMenu();
   },
 
   /* 点击icon事件 */
   toApp(e) {
+    // 编辑模式不跳页
+    if (this.data.editFlag) {
+      let comFlag = e.currentTarget.dataset.com
+      // 删除常用功能
+      if(comFlag){
+        this.delCom(e.currentTarget.dataset.item);
+      }else{
+        // 增加到常用功能
+        this.addToCom(e.currentTarget.dataset.item);
+      }
+      return;
+    }
     let url = e.currentTarget.dataset.url
     let code = e.currentTarget.dataset.code
     if (!url) {
@@ -655,12 +752,60 @@ Page({
     // 调转页面
     wx.navigateTo({
       url: url,
-      success: function(res) {
-        res.eventChannel.emit('params', { formMode:'index',functionCode:e.currentTarget.dataset.code })
+      success: function (res) {
+        res.eventChannel.emit('params', { formMode: 'index', menuUuid: code })
       }
     })
   },
-
+  /**
+   * @desc : 删除常用应用
+   * @author : 周兴
+   * @date : 2024/3/29 9:16
+   */
+  delCom(item){
+    let comMenuList = this.data.comMenuList
+    let comMenuListForCheck = this.data.comMenuListForCheck
+    comMenuList = comMenuList.filter(it=>it.menuUuid != item.menuUuid)
+    comMenuListForCheck = comMenuListForCheck.filter(it=>it != item.menuUuid)
+    this.setData({
+      comMenuList:comMenuList,
+      comMenuListForCheck:comMenuListForCheck
+    })
+  },
+  /**
+   * @desc : 添加到常用应用中
+   * @author : 周兴
+   * @date : 2024/3/29 9:16
+   */
+  addToCom(item) {
+    let comMenuList = this.data.comMenuList
+    let comMenuListForCheck = this.data.comMenuListForCheck
+    let it = {}
+    it.menuUuid = item.FunctionCode
+    it.objectPath = item.FormName
+    let imageUri = item.ImageUri + ''
+    it.objectIcon = imageUri ? (imageUri.substring(imageUri.lastIndexOf('/') + 1)) : ''
+    it.menuName = item.FunctionName
+
+    console.log('er', it, comMenuList);
+    let filters = comMenuList.filter(t => t.menuUuid == it.menuUuid);
+    if (!filters || filters.length == 0) {
+      if (comMenuList && comMenuList.length >= 9) {
+        wx.showToast({
+          title: '常用应用不超过9个',
+          image: '/static/image/warning.png',
+          duration: 1000
+        })
+        return
+      }
+      comMenuList.push(it);
+      comMenuListForCheck.push(it.menuUuid)
+    }
+    this.setData({
+      comMenuList: comMenuList,
+      comMenuListForCheck:comMenuListForCheck
+    })
+  },
 
   /**
      * 页面相关事件处理函数--监听用户下拉动作

+ 1 - 1
pages/index/index.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText":"应用",
+  "navigationBarTitleText":"应用中心",
   "enablePullDownRefresh": true,
   "backgroundColor": "#F8F9FD"
 }

+ 88 - 44
pages/index/index.wxml

@@ -1,58 +1,102 @@
 <wxs module="m1">
-	var hasAuth = function (array, auth) {
-		return array.indexOf(auth) !== -1;
-	}
-	module.exports.hasAuth = hasAuth;
+  var hasAuth = function (array, auth) {
+    return array.indexOf(auth) !== -1;
+  }
+  module.exports.hasAuth = hasAuth;
 
-	var defineIndexOf = function (str, val) {
-		if (str != null) {
-			return str.indexOf(val);
-		}
-	}
-	module.exports.defineIndexOf = defineIndexOf;
+  var defineIndexOf = function (str, val) {
+    if (str != null) {
+      return str.indexOf(val);
+    }
+  }
+  module.exports.defineIndexOf = defineIndexOf;
 
-	var getInfoNum = function (array, infos, val) {
-		var num;
-		if (array.indexOf(val) >= 0) {
-			for (var i = 0; i < infos.length; i++) { if (infos[i].code === val) { num = infos[i].num; break; } }
-		} return num
-	}
-	module.exports.getInfoNum = getInfoNum; 
+  var getInfoNum = function (array, infos, val) {
+    var num;
+    if (array.indexOf(val) >= 0) {
+      for (var i = 0; i < infos.length; i++) { if (infos[i].code === val) { num = infos[i].num; break; } }
+    } return num
+  }
+  module.exports.getInfoNum = getInfoNum; 
 </wxs>
-
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
 <!-- loading -->
 <van-notify id="van-notify" />
 <loading wx:if="{{loadingShow}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
 <!--选择功能分区-->
 <van-sticky scroll-top="0">
-	<view class="menu-box">
-		<view style="width:32%;background:white;">
-			<van-dropdown-menu>
-				<van-dropdown-item id="functionItem" title-class="title-class" title="{{ functionItem.text }}">
-					<dk-dropdown-switch dataList="{{functionRegion}}" bind:commit='dropdowncommit'></dk-dropdown-switch>
-				</van-dropdown-item>
-			</van-dropdown-menu>
-		</view>
-		<view style="width:69%;background:white;display:flex; align-items: center;">
-			<van-search field-class="field-class" custom-class="custom-class" model:value="{{ allCondition }}" bind:change="filterFunction" use-action-slot input-align="center" placeholder="搜索菜单" />
-		</view>
-	</view>
-
+  <view class="menu-box">
+    <view style="width:32%;background:white;">
+      <van-dropdown-menu>
+        <van-dropdown-item id="functionItem" title-class="title-class" title="{{ functionItem.text }}">
+          <dk-dropdown-switch dataList="{{functionRegion}}" bind:commit='dropdowncommit'></dk-dropdown-switch>
+        </van-dropdown-item>
+      </van-dropdown-menu>
+    </view>
+    <view style="width:69%;background:white;display:flex; align-items: center;">
+      <van-search field-class="field-class" custom-class="custom-class" model:value="{{ allCondition }}" bind:change="filterFunction" use-action-slot input-align="center" placeholder="搜索菜单" />
+    </view>
+  </view>
 </van-sticky>
 
+<!-- 常用应用 -->
+<view wx:if="{{bingFlag == 0 }}">
+  <view class="panel-class">
+    <view class="app-name" style="display: flex;justify-content: space-between;line-height: 30rpx;">
+      <view style="display: flex;width: 100%;">
+        <view>常用应用 </view>
+        <!--图标-->
+        <view style="display: flex;width: 75%;" bindtap='expand'>
+          <view wx:if="{{!showMore}}" style="display: flex;margin-left: 10rpx;">
+            <view style="margin-left: 2rpx;" wx:for="{{comMenuList}}" wx:for-item="item" data-code="{{item.menuUuid}}" data-url="{{item.objectPath}}" wx:key="i">
+              <image src="{{item.objectIcon?('/static/img/' + item.objectIcon):''}}" style="height: 30rpx;width:30rpx;"></image>
+            </view>
+          </view>
+          <view wx:if="{{showMore}}" class="expand-class">
+            <van-icon size="12px" name="arrow-up" />
+          </view>
+          <view wx:else class="expand-class">
+            <van-icon size="12px" name="arrow-down" />
+          </view>
+        </view>
+      </view>
+      <dk-tag type="primary" padding="0 20rpx" height="40rpx" color="#1E90FF" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{editFlag?'保存':'编辑'}}" catchtap="toEdit"></dk-tag>
+    </view>
+    <view wx:if="{{showMore}}" style="background: #fff;border-radius: 15rpx;">
+      <view  style="display: flex;flex-wrap: wrap;padding: 43rpx 0;align-items: center;">
+        <view class="app-item "  
+        style="width:25%;text-align: center;" wx:for="{{comMenuList}}" wx:for-item="item" data-item="{{item}}" data-code="{{item.menuUuid}}" data-url="{{item.objectPath}}" data-com="{{true}}" bindtap="toApp" wx:key="i" >
+          <view style="display: flex;justify-content: center;">
+            <image src="{{item.objectIcon?('/static/img/' + item.objectIcon):''}}" style="height: 80rpx;width:80rpx;margin-bottom: 11rpx;"></image>
+            <view style="margin-left: -6rpx; margin-top: -20rpx" wx:if="{{editFlag  }}">
+              <van-icon size="15px" name="clear" color="#D3D3D3" />
+            </view>
+          </view>
+          <view class="index-grid-item-text-class">{{item.menuName}}</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>
+
 <!-- 应用集合 -->
 <view wx:if="{{bingFlag == 0 }}">
-	<view class="panel-class" wx:for="{{regions}}" data-item="{{item}}" wx:key="index" title="{{item.FunctionName}}" wx:if="{{m1.hasAuth(functionRegions,item.FunctionName)}}">
-		<view class="app-name">{{item.FunctionName}}
-			<image wx:if="{{item.FunctionName == '资金管理' || item.FunctionName == '经营分析'}}" src="/static/img/diamond.png" class="icon-title_diamond" />
-		</view>
-		<view style="background: #fff;border-radius: 15rpx;">
-			<view style="display: flex;flex-wrap: wrap;padding: 43rpx 0;align-items: center;">
-				<view class="app-item" style="width:25%;text-align: center;" icon-class="index-grid-item-icon-class" text-class="index-grid-item-text-class" content-class="index-grid-item-class" wx:for="{{functionItems}}" wx:for-item="item2" data-code="{{item2.FunctionCode}}" wx:if="{{item.FunctionCodeOrder==item2.PFunctionCode}}" data-url="{{item2.FormName}}" bindtap="toApp" wx:key="i" info="{{m1.getInfoNum(infocodes,infos,item2.FunctionCode)}}">
-					<image src="{{item2.ImageUri}}" style="height: 80rpx;width:80rpx;margin-bottom: 11rpx;"></image>
-					<view class="index-grid-item-text-class">{{item2.FunctionName}}</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="panel-class" wx:for="{{regions}}" data-item="{{item}}" wx:key="index" title="{{item.FunctionName}}" wx:if="{{m1.hasAuth(functionRegions,item.FunctionName)}}">
+    <view class="app-name">{{item.FunctionName}}
+      <image wx:if="{{item.FunctionName == '资金管理' || item.FunctionName == '经营分析'}}" src="/static/img/diamond.png" class="icon-title_diamond" />
+    </view>
+    <view style="background: #fff;border-radius: 15rpx;">
+      <view style="display: flex;flex-wrap: wrap;padding: 43rpx 0;align-items: center;">
+        <view class="app-item" style="width:25%;text-align: center;" icon-class="index-grid-item-icon-class" text-class="index-grid-item-text-class" content-class="index-grid-item-class" wx:for="{{functionItems}}" wx:for-item="item2" data-code="{{item2.FunctionCode}}" wx:if="{{item.FunctionCodeOrder==item2.PFunctionCode}}" data-url="{{item2.FormName}}" data-item="{{item2}}" bindtap="toApp" wx:key="i" info="{{m1.getInfoNum(infocodes,infos,item2.FunctionCode)}}">
+          <view style="display: flex;justify-content: center;">
+            <image src="{{item2.ImageUri}}" style="height: 80rpx;width:80rpx;margin-bottom: 11rpx;"></image>
+            <view style="margin-left: -6rpx; margin-top: -20rpx" wx:if="{{editFlag && !m1.hasAuth(comMenuListForCheck,item2.FunctionCode) }}">
+              <van-icon size="15px" name="add" color="#1E90FF" />
+            </view>
+          </view>
+          <view class="index-grid-item-text-class" style="margin-left: -28rpx;">{{item2.FunctionName}}</view>
+        </view>
+      </view>
+    </view>
+  </view>
 </view>

+ 8 - 1
pages/index/index.wxss

@@ -17,7 +17,9 @@ page {
   display: flex;
 }
 
-
+.expand-class{
+  margin-left: 10rpx;
+}
 
 .panel-class {
   margin-top: 44rpx;
@@ -104,6 +106,11 @@ page {
   margin-bottom: 21rpx;
 }
 
+/* .app-item{
+  display: flex;
+  justify-content: center;
+} */
+
 .app-item:nth-child(n+5) {
   margin-top: 50rpx;
 }

+ 1 - 0
utils/Constants.js

@@ -223,6 +223,7 @@ module.exports = {
     // 采购订单
     pur: 'pur',
     out: 'out',
+    purReturn: 'purReturn',
   },
 
   // 收款状态