wangyingjie 2 yıl önce
ebeveyn
işleme
e5d47de360

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

@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:盘点
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		王英杰		  	     2024-1-19       			1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+  checkService: {
+      // 前缀
+      prefix: 'mdm-server/ivt/inbound/', 
+     
+
+  },
+
+  routeUrl: {
+    check: {
+     
+      // detail: { key: 'detail', url: '/package-purchase/pages/purchase-receipt/detail/detail'  },
+      // add: { key: 'add', url: '/package-purchase/pages/purchase-receipt/add/add'  },
+      // edit: { key: 'edit', url: '/package-inventory/pages/warehousing-processing/detail/detail'  }, 
+    }
+  } 
+};

+ 2 - 1
app.js

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

+ 1 - 2
app.json

@@ -159,8 +159,7 @@
                 "pages/fund-journal/fund-journal",
                 "pages/supplier-transaction-table/supplier-transaction-table",
                 "pages/fund-account/fund-account",
-                "pages/fund-account/add/add",
-                "pages/fund-account/detail/detail"
+                "pages/fund-account/add/add" 
             ]
         },
         {

+ 6 - 111
package-inventory/pages/inventory-check/inventory-check.js

@@ -185,18 +185,7 @@ Page({
     routeObjName: 'customer',
     active:0
   },
-   /**
-   * 切换 已出库 未出库
-   */
-  onChangeTabs(e) {
-      let index =   e.detail.detail.index
-      console.log("qeaqwewa", index)
-    console.log("qeaqwewa", e)
-    this.setData({
-      active:index, 
-    })
-     
-  },
+  
   /**
    * 跳转客户详细
    */
@@ -222,32 +211,11 @@ Page({
       url: './add/add',
     })
   },
-  /**
-   * @desc : 右上角三个小点 点击回调事件
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
-   */
-  open(e) {
-     let name = e.detail.name
-     let item = e.detail.item 
-     if(name == 'customerRefund'){  //出库办理
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection-refund/customer-collection-refund?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection' + '&pageIndex=customer-collection',
-      })
-     }
-     if(name == 'customerRefundList'){  //客户退款
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection/refund-record/refund-record?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection',
-      })
-     }
-   
-       
-  
-  },
+ 
   /**
    * @desc : 校验
    * @date : 2024/2/1 15:49
-   * @author : 周兴
+   * @author : 王英杰
    */
   openValidData(item, name) {
     console.log('item', item, name, item.customerId);
@@ -264,85 +232,12 @@ Page({
   /**
    * @desc : 查询
    * @date : 2024/2/1 15:49
-   * @author : 周兴
+   * @author : 王英杰
    */
   getData(params) {
     console.log('fff', params);
   },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    //按钮权限
-
-    // let Customer_Follow = common.hasButtonRight(Constants.Customer_Follow) //跟进
-    // let Customer_Follow_Task = common.hasButtonRight(Constants.Customer_Follow_Task) //跟进任务
-    // let Customer_Order = common.hasButtonRight(Constants.Customer_Order) //销售订单
-    // let Customer_Receive = common.hasButtonRight(Constants.Customer_Receive) //客户收款
-    // let Customer_Add = common.hasButtonRight(Constants.Customer_Add) //客户新建
-
-    this.setData({
-      Customer_Follow: true,
-      Customer_Follow_Task: true,
-      Customer_Order: true,
-      Customer_Receive: true,
-      Customer_Add: true
-
-    })
-
-
-
-
-    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()
-    }
-  },
+ 
+   
 })

+ 74 - 5
package-purchase/pages/purchase-receipt/choose-purchase-order/choose-purchase-order.js

@@ -48,10 +48,38 @@ Page({
    * @date : 2024/2/1 15:49
    * @author : 王英杰
    */
-  onListItemChange(e) {
+  onListItemChange(e) { 
     let tableData = this.data.tableData
     let index = e.currentTarget.dataset.index
+    let chooseList = this.data.chooseList
+    if(!tableData[index].checked){ //单选 如果是勾选
+
+      if(chooseList.length>0){// 已经选择了其他单据
+        if(tableData[index].purNo ==chooseList[0].purNo ){//相等 说明是一个单据下的不同品 那就直接添加到 chooseList 里
+          chooseList  =  tableData[index].purchaseItemResponseList 
+
+        }else{ //不相等 那就说明选择了其他的单据 弹出消息提示
+          wx.showToast({
+            title: '已经选了单据【'+chooseList.purNo+"】,请先勾掉已选单据",
+            icon: 'none',
+            duration: 2000
+          })
+          return
+        } 
+      }else{ //没选的话 直接把单据数据赋给已选list
+        chooseList  =  tableData[index].purchaseItemResponseList 
+      }
+    }else{ //本次要勾掉数据 那就删除 已选list 里的数据
+      tableData[index].purchaseItemResponseList.forEach(element => {
+        chooseList.forEach((item,index) => {
+             if(element.itemId == item.itemId){
+               chooseList.splice(index, 1);
+             }
+           });
+      }); 
+    }
     tableData[index].checked = !tableData[index].checked
+
     let purchaseItemResponseList = tableData[index].purchaseItemResponseList
     if (purchaseItemResponseList && purchaseItemResponseList.length > 0) {
       purchaseItemResponseList.forEach(res => {
@@ -60,7 +88,8 @@ Page({
     }
 
     this.setData({
-      tableData: tableData
+      tableData: tableData,
+      chooseList:chooseList
     })
     this.calculateTotal()
   },
@@ -73,11 +102,51 @@ Page({
     let tableData = this.data.tableData
     let index = e.currentTarget.dataset.index
     let index_ = e.currentTarget.dataset.index_
-    console.log(index, index_)
-    tableData[index].purchaseItemResponseList[index_].checked = !tableData[index].purchaseItemResponseList[index_].checked
+    let chooseList = this.data.chooseList
+    if(!tableData[index].purchaseItemResponseList[index_].checked){ //单选 如果是勾选 
+      if(chooseList.length>0){// 已经选择了其他单据
+        if(tableData[index].purchaseItemResponseList[index_].purNo ==chooseList[0].purNo ){//相等 说明是一个单据下的不同品 那就直接添加到 chooseList 里
+          chooseList.push(tableData[index].purchaseItemResponseList[index_]) 
 
+        }else{ //不相等 那就说明选择了其他的单据 弹出消息提示
+          wx.showToast({
+            title: '已经选了单据【'+chooseList.purNo+"】,请先勾掉已选单据",
+            icon: 'none',
+            duration: 2000
+          })
+          return
+        } 
+      }else{ //没选的话 直接把单据数据赋给已选list
+         
+        chooseList.push(tableData[index].purchaseItemResponseList[index_]) 
+      }
+    }else{ //本次要勾掉数据 那就删除 已选list 里的数据 
+         
+        chooseList.forEach((item,itemindex) => {
+             if(tableData[index].purchaseItemResponseList[index_].itemId == item.itemId){
+               chooseList.splice(itemindex, 1);
+             }
+           }); 
+    } 
+    tableData[index].purchaseItemResponseList[index_].checked = !tableData[index].purchaseItemResponseList[index_].checked
+    let numberPlus = 0
+    let numberReduce = 0 
+    tableData[index].purchaseItemResponseList.forEach(element => { //循环出 商品是否全部勾选或者勾掉 从而更改单据的总单的 勾选
+      if(element.checked){
+        numberPlus++
+      }else{
+        numberReduce++
+      }
+    });
+   if(numberPlus == tableData[index].purchaseItemResponseList.length ){//选了全部
+    tableData[index].checked = true
+   }
+   if(numberReduce == tableData[index].purchaseItemResponseList.length ){//勾掉全部
+    tableData[index].checked = false
+   }
     this.setData({
-      tableData: tableData
+      tableData: tableData,
+      chooseList:chooseList
     })
 
     this.calculateTotal()

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

@@ -31,7 +31,7 @@
           <view style="place-self: center;padding-left: 15rpx;padding-right: 15rpx;">
             <view style="display: flex;padding-left: 10rpx;">
               <van-checkbox checked-color="#E4002B" value="{{ item_.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onChangeItemCheckbox" checked-color="#E4002B"></van-checkbox>
-              <view class="red-checkbox" style="{{item_.checked ? 'color:#E4002B;' : ''}}"></view>
+              <view class="red-checkbox" style="{{item_.checked ? 'color:#E4002B;' : ''}}"></view>
             </view>
           </view>
           <view class="border-solid" style="{{index_ === 0 ? (item.purchaseItemResponseList.length  == 1 ? 'margin-top:30rpx;margin-bottom:30rpx;' : 'margin-top:30rpx;') : index_ ===(item.purchaseItemResponseList.length -1) ? 'margin-bottom:30rpx;': ''}}"></view>