Просмотр исходного кода

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

# Conflicts:
#	utils/common.js
wangyingjie 2 лет назад
Родитель
Сommit
1ae83f7ff7
56 измененных файлов с 1490 добавлено и 213 удалено
  1. 20 1
      app.json
  2. 15 0
      components/dkbase/dk-save-bottom/dk-save-bottom.wxml
  3. 10 4
      mixins/index.js
  4. 66 0
      package5/pages/purchase-based-sales/purchase-based-sales.js
  5. 4 0
      package5/pages/purchase-based-sales/purchase-based-sales.json
  6. 2 0
      package5/pages/purchase-based-sales/purchase-based-sales.wxml
  7. 1 0
      package5/pages/purchase-based-sales/purchase-based-sales.wxss
  8. 66 0
      package5/pages/purchase-details/purchase-details.js
  9. 4 0
      package5/pages/purchase-details/purchase-details.json
  10. 2 0
      package5/pages/purchase-details/purchase-details.wxml
  11. 1 0
      package5/pages/purchase-details/purchase-details.wxss
  12. 66 0
      package5/pages/purchase-order/add/add.js
  13. 3 0
      package5/pages/purchase-order/add/add.json
  14. 2 0
      package5/pages/purchase-order/add/add.wxml
  15. 1 0
      package5/pages/purchase-order/add/add.wxss
  16. 66 0
      package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.js
  17. 3 0
      package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.json
  18. 2 0
      package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxml
  19. 1 0
      package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxss
  20. 66 0
      package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.js
  21. 3 0
      package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.json
  22. 2 0
      package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxml
  23. 1 0
      package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxss
  24. 66 0
      package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.js
  25. 3 0
      package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.json
  26. 2 0
      package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxml
  27. 1 0
      package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxss
  28. 66 0
      package5/pages/purchase-order/purchase-order.js
  29. 4 0
      package5/pages/purchase-order/purchase-order.json
  30. 2 0
      package5/pages/purchase-order/purchase-order.wxml
  31. 1 0
      package5/pages/purchase-order/purchase-order.wxss
  32. 66 0
      package5/pages/purchase-receipt/purchase-receipt.js
  33. 4 0
      package5/pages/purchase-receipt/purchase-receipt.json
  34. 2 0
      package5/pages/purchase-receipt/purchase-receipt.wxml
  35. 1 0
      package5/pages/purchase-receipt/purchase-receipt.wxss
  36. 66 0
      package5/pages/purchase-return/purchase-return.js
  37. 4 0
      package5/pages/purchase-return/purchase-return.json
  38. 2 0
      package5/pages/purchase-return/purchase-return.wxml
  39. 1 0
      package5/pages/purchase-return/purchase-return.wxss
  40. 66 0
      package5/pages/purchase-tracking/purchase-tracking.js
  41. 4 0
      package5/pages/purchase-tracking/purchase-tracking.json
  42. 2 0
      package5/pages/purchase-tracking/purchase-tracking.wxml
  43. 1 0
      package5/pages/purchase-tracking/purchase-tracking.wxss
  44. 66 0
      package5/pages/supplier-list/add/add.js
  45. 3 0
      package5/pages/supplier-list/add/add.json
  46. 2 0
      package5/pages/supplier-list/add/add.wxml
  47. 1 0
      package5/pages/supplier-list/add/add.wxss
  48. 122 0
      package5/pages/supplier-list/supplier-list.js
  49. 4 0
      package5/pages/supplier-list/supplier-list.json
  50. 133 0
      package5/pages/supplier-list/supplier-list.wxml
  51. 1 0
      package5/pages/supplier-list/supplier-list.wxss
  52. 23 7
      pages/index/index.js
  53. 135 1
      utils/common.js
  54. 101 141
      utils/prototype/prototypeArray.js
  55. 117 10
      utils/prototype/prototypeDatetime.js
  56. 11 49
      utils/prototype/prototypeObject.js

+ 20 - 1
app.json

@@ -44,7 +44,26 @@
             "root": "package4",
             "name": "package4",
             "pages": []
-        }
+        },
+        {
+          "root": "package5",
+          "name": "package5",
+          "pages": [
+              "pages/purchase-order/purchase-order",
+              "pages/purchase-order/add/add",
+              "pages/purchase-order/purchase-order-detail/purchase-order-detail",
+              "pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods",
+              "pages/purchase-order/purchase-order-sales/purchase-order-sales",
+              "pages/purchase-return/purchase-return",
+              "pages/purchase-receipt/purchase-receipt",
+              "pages/purchase-based-sales/purchase-based-sales",
+              "pages/purchase-details/purchase-details",
+              "pages/purchase-tracking/purchase-tracking",
+              "pages/supplier-list/supplier-list",
+              "pages/supplier-list/add/add"
+          ]
+      }
+        
     ],
     "window": {
         "backgroundTextStyle": "light",

+ 15 - 0
components/dkbase/dk-save-bottom/dk-save-bottom.wxml

@@ -441,4 +441,19 @@
       </van-button>
     </view>
   </view>
+
+  <view wx:if="{{flagTypeName ==='supplier-list'}}" style="display: flex; padding:35rpx 34rpx 62rpx 34rpx;justify-content: center;align-items: center;">
+    <view style="width:48%">
+      <view style="display: flex;justify-content: left;align-items: center;">
+        <van-checkbox value="{{checked}}" data-index="{{index}}" checked-color="#1989FA" />
+        <view style="color: #1B365D;font-size: 13px;margin-left: 20rpx;">启动</view>
+      </view>
+    </view>
+    <view style="width: 4%;"></view>
+    <view style="width:48%;">
+      <van-button size="large" round color="#1B365D" custom-style="height:88rpx;" bind:click="allClean" type="default">新建
+      </van-button>
+    </view>
+  </view>
+
 </view>

+ 10 - 4
mixins/index.js

@@ -21,6 +21,8 @@ module.exports = {
         routeObjName:null,
         // 主键Id
         primaryKey:null,
+        // 是否分页
+        pageFlag:true,
         // 分页
         pageInfo: {
             pageSize: Constants.PAGE_SIZE,
@@ -110,8 +112,11 @@ module.exports = {
      */
     _setSearchParams(){
         let params = this.data.searchForm?this.data.searchForm:{};
-        params.pageSize = this.data.pageInfo.pageSize;
-        params.currentPage = this.data.pageInfo.currentPage;
+        // 如果需要分页
+        if(this.data.pageFlag){
+            params.pageSize = this.data.pageInfo.pageSize;
+            params.currentPage = this.data.pageInfo.currentPage;
+        }
         if(this.setSearchParams){
             // 调用参数赋值
             params = this.setSearchParams(params);
@@ -326,8 +331,9 @@ module.exports = {
    * @author : 于继渤
    * @date : 2022/5/24 12:16
    */
-    onReachBottom: function () {
-    if (this.data.loading || this.data.noMore) {
+   onReachBottom: function () {
+    // 不分页也不能进行下翻
+    if (!this.data.pageFlag || this.data.loading || this.data.noMore) {
       return;
     }
     this.setData({

+ 66 - 0
package5/pages/purchase-based-sales/purchase-based-sales.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-based-sales/purchase-based-sales.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
package5/pages/purchase-based-sales/purchase-based-sales.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "以销定采"
+}

+ 2 - 0
package5/pages/purchase-based-sales/purchase-based-sales.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-based-sales/purchase-based-sales.wxml-->
+<text>package5/pages/purchase-based-sales/purchase-based-sales.wxml</text>

+ 1 - 0
package5/pages/purchase-based-sales/purchase-based-sales.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-based-sales/purchase-based-sales.wxss */

+ 66 - 0
package5/pages/purchase-details/purchase-details.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-details/purchase-details.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
package5/pages/purchase-details/purchase-details.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "采购明细"
+}

+ 2 - 0
package5/pages/purchase-details/purchase-details.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-details/purchase-details.wxml-->
+<text>package5/pages/purchase-details/purchase-details.wxml</text>

+ 1 - 0
package5/pages/purchase-details/purchase-details.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-details/purchase-details.wxss */

+ 66 - 0
package5/pages/purchase-order/add/add.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-order/add/add.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
package5/pages/purchase-order/add/add.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
package5/pages/purchase-order/add/add.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-order/add/add.wxml-->
+<text>package5/pages/purchase-order/add/add.wxml</text>

+ 1 - 0
package5/pages/purchase-order/add/add.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-order/add/add.wxss */

+ 66 - 0
package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxml-->
+<text>package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxml</text>

+ 1 - 0
package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxss */

+ 66 - 0
package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxml-->
+<text>package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxml</text>

+ 1 - 0
package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-order/purchase-order-sales/purchase-order-sales.wxss */

+ 66 - 0
package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxml-->
+<text>package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxml</text>

+ 1 - 0
package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods.wxss */

+ 66 - 0
package5/pages/purchase-order/purchase-order.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-order/purchase-order.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
package5/pages/purchase-order/purchase-order.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "采购记录"
+}

+ 2 - 0
package5/pages/purchase-order/purchase-order.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-order/purchase-order.wxml-->
+<text>package5/pages/purchase-order/purchase-order.wxml</text>

+ 1 - 0
package5/pages/purchase-order/purchase-order.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-order/purchase-order.wxss */

+ 66 - 0
package5/pages/purchase-receipt/purchase-receipt.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-receipt/purchase-receipt.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
package5/pages/purchase-receipt/purchase-receipt.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "采购入库"
+}

+ 2 - 0
package5/pages/purchase-receipt/purchase-receipt.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-receipt/purchase-receipt.wxml-->
+<text>package5/pages/purchase-receipt/purchase-receipt.wxml</text>

+ 1 - 0
package5/pages/purchase-receipt/purchase-receipt.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-receipt/purchase-receipt.wxss */

+ 66 - 0
package5/pages/purchase-return/purchase-return.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-return/purchase-return.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
package5/pages/purchase-return/purchase-return.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "采购退货"
+}

+ 2 - 0
package5/pages/purchase-return/purchase-return.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-return/purchase-return.wxml-->
+<text>package5/pages/purchase-return/purchase-return.wxml</text>

+ 1 - 0
package5/pages/purchase-return/purchase-return.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-return/purchase-return.wxss */

+ 66 - 0
package5/pages/purchase-tracking/purchase-tracking.js

@@ -0,0 +1,66 @@
+// package5/pages/purchase-tracking/purchase-tracking.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
package5/pages/purchase-tracking/purchase-tracking.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "采购跟踪"
+}

+ 2 - 0
package5/pages/purchase-tracking/purchase-tracking.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/purchase-tracking/purchase-tracking.wxml-->
+<text>package5/pages/purchase-tracking/purchase-tracking.wxml</text>

+ 1 - 0
package5/pages/purchase-tracking/purchase-tracking.wxss

@@ -0,0 +1 @@
+/* package5/pages/purchase-tracking/purchase-tracking.wxss */

+ 66 - 0
package5/pages/supplier-list/add/add.js

@@ -0,0 +1,66 @@
+// package5/pages/supplier-list/add/add.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
package5/pages/supplier-list/add/add.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
package5/pages/supplier-list/add/add.wxml

@@ -0,0 +1,2 @@
+<!--package5/pages/supplier-list/add/add.wxml-->
+<text>package5/pages/supplier-list/add/add.wxml</text>

+ 1 - 0
package5/pages/supplier-list/add/add.wxss

@@ -0,0 +1 @@
+/* package5/pages/supplier-list/add/add.wxss */

+ 122 - 0
package5/pages/supplier-list/supplier-list.js

@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright(c) 2022 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		于继渤		 2024-1-24			1.00		    供应商列表
+ *******************************************************************************/
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    tableData: []
+  },
+  toChecked(e) {
+    console.log(e)
+    let index = e.currentTarget.dataset.index
+    let tableData = this.data.tableData
+    tableData.forEach(res => {
+      res.checked = false
+    })
+    tableData[index].checked = true
+    this.setData({
+      tableData: tableData
+    })
+  },
+
+  toAdd() {
+    
+  },
+  /**
+ * @desc : 关闭弹窗
+ * @author : 于继渤
+ * @date : 2024/1/23 9:16
+ */
+  onClosePopup() {
+    this.setData({
+      showPopup: false
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.setData({
+
+      tableData: [
+        {
+          name: '佛山蒙娜丽莎瓷砖',
+          code: '张经理',
+          type: '采购供应商',
+          phone: '156 5678 5643',
+          brand:'蒙娜丽莎瓷砖',
+          account:'-6.000.00',
+          flagValue: true
+        },
+        {
+          name: '京东配送物流公司',
+          code: '王经理',
+          type: '服务供应商',
+          phone: '156 5678 5643',
+          brand:'蒙娜丽莎瓷砖',
+          account:'-6.000.00',
+          flagValue: true
+        },
+      ]
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
package5/pages/supplier-list/supplier-list.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "供应商列表"
+}

+ 133 - 0
package5/pages/supplier-list/supplier-list.wxml

@@ -0,0 +1,133 @@
+<!-- 顶部信息 -->
+<van-sticky scroll-top="0">
+  <van-search model:value="{{ searchText }}" bind:change="onSearchText" bind:search="doSearch" placeholder="输入供应商名称/联系人/电话/品牌/服务类别/备注"> </van-search>
+</van-sticky>
+
+
+
+<!-- 内容列表 -->
+<view style="width: 100%;">
+  <view wx:for="{{tableData}}" wx:key="index" class="main-class">
+    <van-swipe-cell right-width="{{ 65 }}">
+      <view bind:tap="toChecked" data-index="{{index}}" class="main-foot" style="border-radius:15rpx;">
+        <view class="table-content">
+          <view class="table-content-row">
+            <view style="display: flex;">
+              <view catchtap="toCustomer" style="width: 39rpx;height: 39rpx;background-color: #95A8CB;border-radius:50%;margin-top: 5rpx;">
+                <view style="width: 39rpx; height: 39rpx;text-align: center;">
+                  <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
+                </view>
+              </view>
+              <view style="font-size: 14px;font-weight: 600;width: 80%;margin-left: 20rpx;">
+                {{item.name}}
+              </view>
+              <view style="height: 49rpx;border-radius: 6rpx;background-color: {{ item.flagValue ?'#77C5D5':'rgba(228, 0, 43, 1)'}};text-align: center;width: 20%;">
+                  <text style=" font-size: 13px;color:  #FFFFFF;">{{item.flagValue ? '启用' : '停用'}}</text>
+                </view>
+            </view>
+          </view>
+          <view style="width: 100%;flex-direction: row; margin-top: 0px;">
+            <view class="table-content-row">
+              <view style="display: flex;width: 100%;">
+                <view style="width: 80%;display: flex;">
+                  <view class="table-content-row-font">
+                    <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="联系人" copyValue="{{item.code}}"></dk-text>
+                  </view>
+                  <view class="table-content-class">
+                    {{item.code ? item.code :''}}
+                  </view>
+                </view>
+
+                <view style="width: 20%;text-align: center;">
+                  <dk-tag type="primary" height="32rpx" color="#EAF1FF" textColor="#606EB2" radius="5rpx" roundFlag="{{true}}" value="{{item.type}}"></dk-tag>
+                </view>
+              </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.phone}}"></dk-text>
+                </view>
+                <view class="table-content-class">
+                  {{item.phone ? item.phone :''}}
+                </view>
+              </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="{{item.type == '服务供应商' ? '服务类别':'供货品牌'}}" copyValue="{{item.brand}}"></dk-text>
+                </view>
+                <view class="table-content-class">
+                  {{item.brand ? item.brand :''}}
+                </view>
+              </view>
+            </view>
+          </view>
+          <view style="width: 100%;flex-direction: row; margin-top: 0px;padding-top: 20rpx;">
+            <view class="table-content-row" style="display: flex;">
+              <view style="display: flex;width:85%">
+                <view class="table-content-row-font">
+                  <dk-text fontSize="14px" color="#1B365D" fontWeight="nomal" value="应付款" copyValue="{{item.account}}"></dk-text>
+                </view>
+                <view class="table-content-class" style="color:#CAA977;">
+                  {{item.account ? item.account :''}}
+                </view>
+              </view>
+              <view style="display: flex;width:15%;text-align: right;">
+                <dk-tag height="40rpx" plain="true" color="#00A7B5" textColor="#00A7B5" radius="5rpx" roundFlag="{{true}}" value="{{'打电话'}}"></dk-tag>
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view data-index="{{index}}" bind:tap="onCloseDel" slot="right">{{item.flagValue ? '停用' : '启用'}}</view>
+    </van-swipe-cell>
+  </view>
+  <!-- 保留高度 -->
+  <view style="height: 220rpx;"></view>
+</view>
+
+
+<!-- 弹窗 新建-->
+<van-popup show="{{showPopup}}" position="bottom" bind:close="onClosePopup" custom-class="function-pop-class">
+
+  <view style="background-color:#F8F9FD;color:#1B365D;font-size: 17px;font-weight: 600;display: flex;justify-content: left;align-items: center;padding: 40rpx;">
+    <view>供应商</view>
+  </view>
+
+  <van-field input-width="200rpx" disabled="{{true}}" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" data-key="addressNo" maxlength="50" value="{{ '张经理' }}" input-align="right" label="联系人" placeholder="" autosize border="{{ false }}" bind:change="changeCustomerFormField">
+  </van-field>
+
+  <van-field input-width="200rpx" input-class="dk-cell-value-class" input-align="left" label-class="red-label" data-key="addressNo" maxlength="50" value="{{ '蒙娜丽莎瓷砖' }}" input-align="right" label="供应商名称" placeholder="" autosize border="{{ false }}" bind:change="changeCustomerFormField">
+  </van-field>
+
+
+  <van-field input-width="200rpx" disabled="{{false}}" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" data-key="addressNo" maxlength="50" value="{{ '156 5678 5643' }}" input-align="right" label="联系人电话" placeholder="" autosize border="{{ false }}" bind:change="changeCustomerFormField">
+  </van-field>
+  <van-field disabled="{{false}}" input-width="200rpx" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" maxlength="50" value="" input-align="right" label="备注" placeholder="{{'请输入' + '备注'}}" autosize border="{{ false }}">
+  </van-field>
+
+
+  <view style="display: flex; padding:35rpx 34rpx 62rpx 34rpx;">
+    <view style="width:48%">
+      <van-button size="large" plain round color="#1B365D" custom-style="height:88rpx;" bind:click="onClosePopup" type="default">取消
+      </van-button>
+    </view>
+    <view style="width: 4%;"></view>
+    <view style="width:48%;">
+      <van-button size="large" round color="#1B365D" custom-style="height:88rpx;" bind:click="allClean" type="default">保存
+      </van-button>
+    </view>
+  </view>
+</van-popup>
+
+
+<!-- 底部信息 -->
+<dk-save-bottom flagTypeName="supplier-list" bottomClass="{{true}}" bind:submit="toClose" bind:allClean="toAdd" />

+ 1 - 0
package5/pages/supplier-list/supplier-list.wxss

@@ -0,0 +1 @@
+/* package5/pages/supplier-list/supplier-list.wxss */

+ 23 - 7
pages/index/index.js

@@ -239,49 +239,49 @@ Page({
       // '采购管理', 
       {
         FunctionName: '采购订单',
-        FormName: '/package4/pages/order-billing/order-billing',
+        FormName: '/package5/pages/purchase-order/purchase-order',
         ImageUri: '/static/img/order-billing.png',
         PFunctionCode: '04',
         FunctionCode: '0401'
       },
       {
         FunctionName: '采购入库',
-        FormName: '/package4/pages/order-billing/customer-collection/customer-collection',
+        FormName: '/package5/pages/purchase-receipt/purchase-receipt',
         ImageUri: '/static/img/inventory-query.png',
         PFunctionCode: '04',
         FunctionCode: '0402'
       },
       {
         FunctionName: '以销定采',
-        FormName: '/package4/pages/order-billing/customer-collection/customer-collection',
+        FormName: '/package5/pages/purchase-based-sales/purchase-based-sales',
         ImageUri: '/static/img/collection.png',
         PFunctionCode: '04',
         FunctionCode: '0403'
       },
       {
         FunctionName: '采购退货',
-        FormName: '/package4/pages/order-billing/customer-collection/customer-collection',
+        FormName: '/package5/pages/purchase-return/purchase-return',
         ImageUri: '/static/img/collection.png',
         PFunctionCode: '04',
         FunctionCode: '0404'
       },
       {
         FunctionName: '采购明细',
-        FormName: '/package4/pages/order-billing/customer-collection/customer-collection',
+        FormName: '/package5/pages/purchase-details/purchase-details',
         ImageUri: '/static/img/collection.png',
         PFunctionCode: '04',
         FunctionCode: '0405'
       },
       {
         FunctionName: '采购跟踪',
-        FormName: '/package4/pages/order-billing/customer-collection/customer-collection',
+        FormName: '/package5/pages/purchase-tracking/purchase-tracking',
         ImageUri: '/static/img/collection.png',
         PFunctionCode: '04',
         FunctionCode: '0406'
       },
       {
         FunctionName: '供应商',
-        FormName: '/package4/pages/order-billing/customer-collection/customer-collection',
+        FormName: '/package5/pages/supplier-list/supplier-list',
         ImageUri: '/static/img/collection.png',
         PFunctionCode: '04',
         FunctionCode: '0407'
@@ -582,6 +582,11 @@ Page({
    * @param {*} rights 
    * @param {*} initFlag 
    */
+
+
+    // 测试fixed函数
+    //  this.testObjectValue()
+    // console.log("ceshi",parseInt('1'),  );
   setRight: function (rights, initFlag) {
     this.setData({
       rights: rights
@@ -641,6 +646,17 @@ Page({
   onLoad: function (options) {
     // 调用权限时候放开
     this.filterFunction()
+    this.open('add');
+    let t = [{name:'t1',age:23},{name:'t2',age:24},{name:'t2',age:24}]
+    let t12 = [{name:'t1',age:23},{name:'t3',age:24},{name:'t4',age:24}]
+    t.forEach((it,index)=>{
+      console.log('ti',it,index);
+      return;
+    })
+    let t1 = [1,3,4,1]
+    let t2 = [1,3,6]
+    let ttt= {key:'key1',value:'value1'}
+    console.log('ff',this.$t('test'),t1.diff(t2),t.max('age'),new Date(),new Date().getWeekFirstDay());
   },
 
   /* 点击icon事件 */

+ 135 - 1
utils/common.js

@@ -20,6 +20,12 @@ var qqmapsdk;
   * 小程序地图调用
   */
 function onClickWxchartAddress() {
+  const key = config.key; //使用在腾讯位置服务申请的key
+  const referer = 'wx76a9a06e5b4e693e'; //调用插件的app的名称
+  const category = '小区';
+  wx.navigateTo({
+    url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + '&category=' + category
+  });
     const key = config.key; //使用在腾讯位置服务申请的key
     const referer = 'wx76a9a06e5b4e693e'; //调用插件的app的名称
     const category = '小区';
@@ -32,6 +38,17 @@ function onClickWxchartAddress() {
  * @param {*} functionCode 
  */
 function hasRight(functionCode) {
+  let rights = app.globalData.user.rights
+  let value = false
+  if (rights != null && rights.length > 0) {
+    rights.forEach(item => {
+      if (item.FunctionCode == functionCode) {
+        value = true
+        return
+      }
+    })
+  }
+  return value
     let rights = app.globalData.user.rights
     let value = false
     if (rights != null && rights.length > 0) {
@@ -51,6 +68,22 @@ function hasRight(functionCode) {
  * @param {*} minus 
  */
 function navigatePosition(selectid, minus) {
+  //1、返回一个查询实例
+  const query = wx.createSelectorQuery();
+  //2、选择要跳转的节点id
+  query.select('#' + selectid).boundingClientRect();
+  //3、获取显示区域的尺寸、滚动等位置等信息,然后添加节点的滚动位置查询
+  query.selectViewport().scrollOffset();
+  //4、执行跳转
+  query.exec((res) => {
+    //5、res[0]是步骤2中的数据,res[1]是步骤3中的数据
+    if (res[0] && res[1]) {
+      //6、将页面滚动到目标位置  减300不是固定的 根据自己的要求调
+      wx.pageScrollTo({
+        //7、计算滚动到目标的位置  
+        scrollTop: res[0].top + res[1].scrollTop - minus,
+        duration: 300
+      })
     //1、返回一个查询实例
     const query = wx.createSelectorQuery();
     //2、选择要跳转的节点id
@@ -80,6 +113,7 @@ function toThousandCents(num) {
     if (num == undefined) {
         return 0;
     }
+  });
     var num = num + '';
     var d = '';
     if (num.slice(0, 1) == '-') {
@@ -106,12 +140,35 @@ function toThousandCents(num) {
     }
     return d + (result + num2)
 }
+ 
 
 /**
  * 导航
  */
 function navigate(address) {
-
+  qqmapsdk.geocoder({
+    //获取表单传入地址
+    address: address,
+    //地址参数,例:固定地址,address: '北京市海淀区彩和坊路海淀西大街74号'
+    success: function (res) {//成功后的回调 
+      var res = res.result;
+      var latitude = res.location.lat;
+      var longitude = res.location.lng;
+
+      wx.openLocation({
+        latitude,
+        longitude,
+        scale: 18
+      })
+    },
+    fail: function (error) {
+      wx.showToast({
+        title: '地址无法导航',
+        image: '/static/image/warning.png',
+        duration: 1000
+      })
+    },
+    complete: function (res) {
     qqmapsdk.geocoder({
         //获取表单传入地址
         address: address,
@@ -165,6 +222,8 @@ function setSkuIcon(skuData) {
             })
         }
     }
+  })
+}  
 }
 /**
 * @desc : 设置行的图标路径
@@ -226,6 +285,23 @@ function setRowImagePath(it) {
  * @param {*} loc 
  */
 function reverseGeocoder(loc) {
+  return new Promise(resolve => {
+    qqmapsdk.reverseGeocoder({
+      location: {
+        latitude: loc.latitude,
+        longitude: loc.longitude
+      } || '',
+      //get_poi: 1, //是否返回周边POI列表:1.返回;0不返回(默认),非必须参数
+      success: function (res) {//成功后的回调
+        resolve(res)
+      },
+      fail: function (error) {
+        resolve('')
+      },
+      complete: function (res) {
+      }
+    })
+  });
     return new Promise(resolve => {
         qqmapsdk.reverseGeocoder({
             location: {
@@ -251,6 +327,25 @@ function reverseGeocoder(loc) {
    * @param {*} toloc 
    */
 function calculateDistance(fromloc, toloc) {
+  return new Promise(resolve => {
+    //调用距离计算接口
+    qqmapsdk.calculateDistance({
+      //mode: 'straight',//可选值:'driving'(驾车)、'walking'(步行),不填默认:'walking',可不填 新增直线距离计算,‘straight’(直线)
+      //from参数不填默认当前地址
+      //获取表单提交的经纬度并设置from和to参数(示例为string格式)
+      from: fromloc, //若起点有数据则采用起点坐标,若为空默认当前地址
+      to: toloc, //终点坐标
+      success: function (res) {//成功后的回调  
+        var destinationDistance = res.result.elements[0].distance;
+        console.log("calculateDistance-ok", res);
+        resolve(destinationDistance)
+      },
+      fail: function (error) {
+        console.log("calculateDistance-error", error);
+        resolve(0)
+      },
+      complete: function (res) {
+      }
     return new Promise(resolve => {
         //调用距离计算接口
         qqmapsdk.calculateDistance({
@@ -272,6 +367,7 @@ function calculateDistance(fromloc, toloc) {
             }
         });
     });
+  });
 
 }
 
@@ -281,6 +377,14 @@ function calculateDistance(fromloc, toloc) {
  * @param {*} lng 
  */
 function bdMap_to_wxMap(lat, lng) {
+  let pi = 3.14159265358979324 * 3000.0 / 180.0;
+  let x = lng - 0.0065;
+  let y = lat - 0.006;
+  var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
+  var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
+  let lngv = z * Math.cos(theta);
+  let latv = z * Math.sin(theta);
+  return { 'longitude': lngv, 'latitude': latv };
     let pi = 3.14159265358979324 * 3000.0 / 180.0;
     let x = lng - 0.0065;
     let y = lat - 0.006;
@@ -297,6 +401,14 @@ function bdMap_to_wxMap(lat, lng) {
  * @param {*} lng 
  */
 function wxMap_to_bdMap(lat, lng) {
+  let pi = 3.14159265358979324 * 3000.0 / 180.0;
+  let x = lng;
+  let y = lat;
+  var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
+  var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
+  let lngv = z * Math.cos(theta) + 0.0065;
+  let latv = z * Math.sin(theta) + 0.006;
+  return { 'longitude': lngv, 'latitude': latv };
     let pi = 3.14159265358979324 * 3000.0 / 180.0;
     let x = lng;
     let y = lat;
@@ -310,6 +422,11 @@ function wxMap_to_bdMap(lat, lng) {
  * 在onload时间中新建qq地址对象
  */
 function openQQMap() {
+  if (qqmapsdk === undefined || qqmapsdk === null) {
+    qqmapsdk = new QQMapWX({
+      key: '7I3BZ-VADCX-TJQ4C-TN5O4-F4BZE-RDFCK'
+    });
+  }
     if (qqmapsdk === undefined || qqmapsdk === null) {
         qqmapsdk = new QQMapWX({
             key: '7I3BZ-VADCX-TJQ4C-TN5O4-F4BZE-RDFCK'
@@ -393,6 +510,9 @@ function countLastAmount(choosedGoodsList, followFlag) {
  * @param {*} functionCode 
  */
 function hasButtonRight(functionCode) {
+  let buttonRights = app.globalData.buttonRights
+  let orderAuditVisible = buttonRights.indexOf(functionCode)
+  return orderAuditVisible == -1 ? false : true
     let buttonRights = app.globalData.buttonRights
     let orderAuditVisible = buttonRights.indexOf(functionCode)
     return orderAuditVisible == -1 ? false : true
@@ -420,6 +540,9 @@ function hasInputPageItemMust(functionCode) {
  * @param {*} functionCode 
  */
 function hasPageUUidRight(uuid) {
+  let pageRights = app.globalData.pageRights
+  let pageVisible = pageRights.indexOf(uuid)
+  return pageVisible == -1 ? false : true
     if (uuid) {
         let pageRights = app.globalData.pageRights
         let pageVisible = pageRights.indexOf(uuid)
@@ -454,6 +577,17 @@ function isUserSensitive() {
  * 导出函数
  */
 module.exports = {
+  openQQMap,
+  navigate, 
+  reverseGeocoder,
+  calculateDistance,
+  hasButtonRight,
+  hasRight,
+  wxMap_to_bdMap,
+  bdMap_to_wxMap,  
+  onClickWxchartAddress,  
+  hasPageUUidRight 
+
     openQQMap,
     navigate,
     toThousandCents,

+ 101 - 141
utils/prototype/prototypeArray.js

@@ -2,6 +2,8 @@
 //Array对象 Object.defineProperty 增加额外的函数方法
 // 在app.js 中增加require即可
 ///////////////////////////////////////////////////////////////////// 
+const proObj = require('./prototypeObject')
+
 // Array.prototype.at函数
 if (!Array.prototype.at) {
   const atFunc = function (idx) {
@@ -21,18 +23,6 @@ if (!Array.prototype.at) {
     Array.prototype.at = atFunc;
   }
 }
-/**
- * 取最大值
- */
-Array.prototype.getMax = function () {
-  var max = this[0];
-  for (var index = 1; index < this.length; index++) {
-    if (this[index] > max) {
-      max = this[index];
-    }
-  }
-  return max;
-}
 
 /**
  * 将一个数组元素清空
@@ -63,86 +53,42 @@ Array.prototype.first = function () {
 Array.prototype.last = function () {
   return this[this.length - 1]
 }
-function cacl(arr, callback) {
-  // 变量的初始化(治理在使用的时候进行初始化)
-  var ret;
-  for (var i = 0, len = arr.length; i < len; i++) {
-    ret = callback(arr[i], ret);
-  }
-  return ret;
-}
 
 /**
  * 对数组的所有元素进行求和
  * @return {*}
  */
-Array.prototype.sum = function () {
-  // 1. 一般的方法
-  /*var ret = 0;
-  for (var i = 0, len = this.length; i < len; i++){
-      ret = ret + this[i];
+Array.prototype.sum = function (name) {
+  if (!name) {
+    return this.reduce((acc, cur) => (parseFloat(cur) + acc), 0);
+  } else {
+    return this.filter(it => it[name]).map(it => it[name]).reduce(
+      (acc, cur) => (parseFloat(cur) + acc), 0);
   }
-  return ret;*/
-
-  // 2.使用上面的计算类
-  /**
-   * @param:item 数组的每一项
-   * @param:sum 数组求和的结果
-   */
-  return cacl(this, function (item, sum) {
-    // 如果刚开始没有初始化的话,就直接使用第一项作为sum(ret)的初始值
-    if (typeof sum === 'undefined') {
-      return item;
-    } else {
-      return sum += item;
-    }
-  })
-
 }
 /**
  * 找出数组中的最大值
  * @return {*}
  */
-Array.prototype.max = function () {
-  // 1. 一般的方式求出最大值
-  /*var ret = 0;
-  for (var i = 0, len = this.length; i < len; i++){
-      if (ret < this[i]){
-          ret = this[i];
-      }
+Array.prototype.max = function (name) {
+  if (!name) {
+    return this.reduce((acc, cur) => acc > cur ? acc : cur);
+  } else {
+    return this.filter(it => it[name]).map(it => it[name]).reduce(
+      (acc, cur) => acc > cur ? acc : cur);
   }
-  return ret;*/
-
-  // 2. 第二种方式
-  return cacl(this, function (item, max) {
-    if (typeof max === 'undefined') {
-      return item;
-    } else {
-      if (max < item) {
-        return item;
-      } else {
-        return max;
-      }
-    }
-  })
 }
 /**
  * 找出一个数组中的最小值
  * @return {*}
  */
-Array.prototype.min = function () {
-  return cacl(this, function (item, min) {
-    if (typeof min === 'undefined') {
-      return item;
-    } else {
-      // 只要每一项的值都不比最小值小的话
-      if (!(min < item)) {
-        return item;
-      } else {
-        return min;
-      }
-    }
-  })
+Array.prototype.min = function (name) {
+  if (!name) {
+    return this.reduce((acc, cur) => acc < cur ? acc : cur);
+  } else {
+    return this.filter(it => it[name]).map(it => it[name]).reduce(
+      (acc, cur) => acc < cur ? acc : cur);
+  }
 }
 
 /**
@@ -170,90 +116,104 @@ Array.prototype.avg = function () {
 }
 
 
-// 去除数组中的重复项
-/*
-* 实现思路: 遍历原始数组中的每一项元素,让每次遍历的这一个元素和后面的每一个元素进行比较
-* 【只要相同的话就直接跳过继续向下寻找】
-* */
+/**
+ * @desc   : 数组去重
+ * @author : 周兴
+ * @date   : 2022/12/14 16:14
+ */
 Array.prototype.unique = function () {
-  var a = [],
-    len = this.length;
-  for (var i = 0; i < len; i++) {
-    for (var j = i + 1; j < len; j++) {
-      if (this[i] === this[j]) {
-        // 如果找到了相邻的两个元素是相同的,i直接向后移动一位
-        // 然后j开始从i的位置继续向后寻找元素
-        j = ++i;
-      }
-    }
-    a.push(this[i]);
+  if (!this || this.length == 0) return this;
+  console.log('ttt',typeof this[0],typeof this[0] === 'object');
+  if (typeof this[0] === 'object') {
+    let arr = []
+    return this.filter(item => !arr.has(item) && arr.push(item))
+  } else {
+    return Array.from(new Set(this));
   }
-  ;
-  return a;
 }
+
 /**
- * 去除数组中的重复项
- * 【实现思路】:先对数组进行排序,然后比较相邻的元素是否相同
- * @return {Array}
+ * @desc   : 判断数组中是否包含这个对象
+ * @author : 周兴
+ * @date   : 2022/11/16 9:11
  */
-Array.prototype.unique = function () {
-  var tmp = [],
-    len = this.length;
-  // 1.先对原始的数组进行排序
-  this.sort();
-  // 2.比较相邻的元素
-  for (var i = 0; i < len; i++) {
-    // 只要相邻的元素相同,就直接跳过
-    if (this[i] === this[i + 1]) {
-      continue;
+Array.prototype.has = function (obj) {
+  if (this && this.length > 0) {
+    for (let i of this) {
+      if (proObj.objEqual(i, obj)) {
+        return true;
+      }
     }
+    return false;
+  }
+}
 
-    // 由于tmp.length初始的位置一直是0, 添加一个元素之后变为1,因此下标和长度每次相差1, 实现了实时插入数据的功能
-    tmp[tmp.length] = this[i];
+
+/**
+ * @desc   : 取得原数组跟目标数组的交集
+ * @author : 周兴
+ * @date   : 2022/11/15 17:21
+ */
+Array.prototype.intersection = function (arr) {
+  if (!this || !arr || arr.length == 0) return this;
+  // 如果第一个是对象,那么就按照对象数组来进行
+  if (typeof arr[0] == 'object') {
+    return this.filter(it => arr.has(it))
   }
-  return tmp;
+  return this.filter(it => arr.includes(it))
 }
 
 /**
- * 实现两个数组的并集,然后去除重复元素
- * @param target
- * @return {*}
+ * @desc   : 取得原数组跟目标数组的并集
+ * @author : 周兴
+ * @date   : 2022/11/15 17:26
  */
-Array.prototype.union = function (target) {
-  // concat() 方法用于连接两个或多个数组。
-  // 连接数组之后然后去除数组中的重复项
-  return this.concat(target).union();
+Array.prototype.union = function (...arr) {
+  if (!this || !arr || arr.length == 0) return this;
+  return this.concat(...arr)
 }
 
 /**
- * 求出两个数组的交集
- * @param target
- * @return {Array|*[]}
+ * @desc   : 取得原数组跟目标数组的差集
+ * @author : 周兴
+ * @date   : 2022/11/15 17:26
+ * @param  : arr:目标数组;cols,需要判断的列
  */
-Array.prototype.intersect = function (target) {
-  // 1.先去除原始数组和目标数组中的重复元素
-  var originArr = this.unique(),
-    targetArr = target.unique();
-  // filter()的作用是返回某一数组中满足条件的元素,该方法返回的是一个新的数组
-  // 2.开始使用条件过滤
-  /**
-   * @param element(必选):当前元素的值
-   @param index(可选): 当前元素的索引
-   @param array(可选):当前元素所属的数组
-   */
-  return originArr.filter(function (element, index, array) {
-    // filter函数默认会把所有的返回false的元素去掉
-    for (var i = 0, len = targetArr.length; i < len; i++) {
-      if (element === targetArr[i]) {
-        // 只要是返回满足true的所有条件,基本上都会被过滤掉
-        return true;
-      }
-      //return false;
+Array.prototype.minus = function (arr, cols = []) {
+  if (!this || !arr || arr.length == 0) return this;
+  // 如果第一个是对象,那么就按照对象数组来进行
+  if (typeof arr[0] == 'object') {
+    if (!cols || cols.length === 0) {
+      return this.filter(it => !arr.has(it))
+    } else {
+      let arrt = arr.map(it => {
+        let item = {}
+        cols.forEach(col => {
+          item[col] = it[col]
+        })
+        return item;
+      })
+      let thisTable = this.map(it => {
+        let item = {}
+        cols.forEach(col => {
+          item[col] = it[col]
+        })
+        return item;
+      })
+      return thisTable.filter(it => !arrt.has(it))
     }
-    // 只有找到相同的元素的时候返回的是true,其他情况都是返回的是false
-    return false;
-  });
+  }
+  return this.filter(it => !arr.includes(it))
+}
 
+/**
+ * @desc   : 数组的复制
+ * @author : 周兴
+ * @date   : 2022/12/8 17:45
+ */
+Array.prototype.copy = function () {
+  if (!this) return this;
+  return JSON.parse(JSON.stringify(this));
 }
 
 /**

+ 117 - 10
utils/prototype/prototypeDatetime.js

@@ -3,29 +3,29 @@
 // 在app.js 中增加require即可
 /////////////////////////////////////////////////////////////////////   
 // 添加秒数
-Date.prototype.addSecond = function (count) {
+Date.prototype.addSeconds = function (count) {
   var time = this.getTime();
   time += count * 1000;
   return new Date(time);
 }
 
 // 添加分钟
-Date.prototype.addMinute = function (count) {
-  return this.addSecond(count * 60);
+Date.prototype.addMinutes = function (count) {
+  return this.addSeconds(count * 60);
 }
 
 // 添加小时
-Date.prototype.addHour = function (count) {
-  return this.addMinute(count * 60);
+Date.prototype.addHours = function (count) {
+  return this.addMinutes(count * 60);
 }
 
 // 添加天数
-Date.prototype.addDay = function (count) {
-  return this.addHour(count * 24);
+Date.prototype.addDays = function (count) {
+  return this.addHours(count * 24);
 }
 
 // 添加月份
-Date.prototype.addMonth = function (count) {
+Date.prototype.addMonths = function (count) {
   var year = this.getFullYear();
   var month = this.getMonth();
   var date = this.getDate();
@@ -45,8 +45,8 @@ Date.prototype.addMonth = function (count) {
 }
 
 // 添加年份
-Date.prototype.addYear = function (count) {
-  return this.addMonth(count * 12);
+Date.prototype.addYears = function (count) {
+  return this.addMonths(count * 12);
 }
 
 // 计算两个日期数据,相隔的天数
@@ -174,5 +174,112 @@ Date.prototype.toSmartString = function () {
   }
 }
 
+/**
+ * @desc   : 获取当前时间,格式YYYY-MM-DD
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.toDateStr = function () {
+  return this.format('yyyy-MM-dd')
+}
+
+/**
+ * @desc   : 获取当前时间,格式HH:mi:ss
+ * @author : 周兴
+ * @date   : 2022/11/16 11:02
+ */
+Date.prototype.toTimeStr = function () {
+  return this.format('hh:mm:ss')
+}
+
+/**
+ * @desc   : 获取当前日期,格式YYYY-MM-DD hh:mm:ss
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.toDateTimeStr = function () {
+  return this.format('yyyy-MM-dd hh:mm:ss')
+}
+
+/**
+ * @desc   : 获取当前年月
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.toYearMonth = function () {
+  return this.format('yyyyMM')
+}
+
+/**
+ * @desc   : 获取当前年月
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.toYear = function () {
+  return this.format('yyyy')
+}
+
+/**
+ * @desc   : 获取当前年月
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.toYearMonth2 = function () {
+  return this.format('yyyy-MM')
+}
+
+/**
+ * @desc   : 获得星期
+ * @author : 周兴
+ * @date   : 2022/11/16 17:16
+ */
+Date.prototype.getWeek = function () {
+  let days = this.getDay()
+  let weekArray = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
+  return weekArray[days];
+}
+
+/**
+ * @desc   : 获得本周一日期
+ * @author : 周兴
+ * @date   : 2022/11/16 17:16
+ */
+Date.prototype.getWeekFirstDay = function () {
+  let days = this.getDay()
+  days = days === 0 ? 6 : days - 1;
+  return this.addDays(-1 * days).toDateStr();
+}
+
+/**
+ * @desc   : 获得本周周末的日期
+ * @author : 周兴
+ * @date   : 2022/11/16 17:16
+ */
+Date.prototype.getWeekLastDay = function () {
+  let days = this.getDay()
+  days = days === 0 ? 1 : 7 - days;
+  return this.addDays( days).toDateStr();
+}
+
+/**
+ * @desc   : 获取当前月份的第一天
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.getFirstDateStr = function () {
+  return new Date(this.toYearMonth2() + '-01').toDateStr()
+}
+
+/**
+ * @desc   : 获取当前月份的最后一天
+ * @author : 周兴
+ * @date   : 2022/11/16 10:59
+ */
+Date.prototype.getLastDateStr = function () {
+  let year = this.getFullYear();
+  let month = this.getMonth() + 1;
+  let day = new Date(year, month, 0).getDate();
+  return year + '-' + month + '-' + day;
+}
 
 

+ 11 - 49
utils/prototype/prototypeObject.js

@@ -2,57 +2,19 @@
 //Object对象 Object.defineProperty 增加额外的函数方法
 // 在app.js 中增加require即可
 ///////////////////////////////////////////////////////////////////// 
+module.exports = {  
 /**
-* object转成String类型
-* @return
-*/ 
-// Object.prototype.obj2string = function () {
-//   // if (this == null || this == undefined  ) {
-//   //   return {} + '';
-//   // }
-//   return String.value(this)    ;
-// }
-/**
- * obj转int
- */
-// Object.prototype.toInt = function  () {
-//   if (this == null || this == undefined || this == isNaN ||   this == '') {
-//     return 0
-//   }
-//   return parseInt(this)
-// }
-/**
- * obj转decimal
+ * @param {*} obj1 对象
+ * @param {*} obj2 对象
+ * @description 判断两个对象是否相等,这两个对象的值只能是数字或字符串
  */
-// Object.prototype.toDec = function  () {
-//   if (this == null || this == undefined || this == isNaN ||   this == '') {
-//     return 0.0
-//   }
-//   return parseFloat(this)
-// }
-
-/**
- * toFixed函数
- */
-if (!Object.prototype.toFixed) {
-  var toFixed = function (value) {
-    //默认小数点得长度2
-    let length = 2
-    if (value === '' || value === null || value === undefined) return 0;
-    // 第二个参数为小数点的长度
-    if (arguments.length == 2 && Number.isInteger(arguments[1])) {
-      length = arguments[1]
-    }
-    return value.toFixed(length);
-  }
-  if (Object.defineProperty) {
-    Object.defineProperty(Object.prototype, 'toFixed', {
-      'value': toFixed,
-      'configurable': true,
-      'writable': true
-    });
-  } else {
-    Object.prototype.toFixed = toFixed;
+ objEqual(obj1, obj2) {
+    const keysArr1 = Object.keys(obj1)
+    const keysArr2 = Object.keys(obj2)
+    if (keysArr1.length !== keysArr2.length) return false
+    else if (keysArr1.length === 0 && keysArr2.length === 0) return true
+    /* eslint-disable-next-line */
+    else return !keysArr1.some(key => obj1[key] != obj2[key])
   }
 }