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

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

于继渤 2 лет назад
Родитель
Сommit
a7c1c4b106

+ 22 - 0
api/pages/ivt/inventory.js

@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:库存明细
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		姜永辉		  	     2024-1-19       			1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+  inventoryService: {
+    // 前缀
+    prefix: 'mdm-server/inventory/',
+  },
+
+  routeUrl: {
+    inventory: { 
+      edit: { key: 'edit', url: '/package-inventory/pages/outbound-processing/detail/detail' },
+       
+    }
+  }
+};

+ 2 - 1
app.js

@@ -49,6 +49,7 @@ const outboundOther = require('./api/pages/ivt/outboundOther.js');
 const outboundProcessing = require('./api/pages/ivt/outboundProcessing.js');
 // const outboundPurchaseReturn = require('./api/pages/ivt/outboundPurchaseReturn.js');
 const outboundSaleReturn = require('./api/pages/ivt/outboundSaleReturn.js');
+const inventory = require('./api/pages/ivt/inventory.js');
 const moneyAccount = require('./api/pages/mst/moneyAccount.js');
 const intoReturn = require('./api/pages/ivt/intoReturn.js');
 const intoReturnItem = require('./api/pages/ivt/intoReturnItem.js');
@@ -58,7 +59,7 @@ const order = require('./api/pages/sale/order.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,
-  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer]
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer]
 
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 8 - 7
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -104,7 +104,7 @@ Component({
     // 是否只读
     readonly: {
       type: Boolean,
-    }, 
+    },
     stepperFlag: {//步进器 标识
       type: Boolean,
     },
@@ -338,12 +338,12 @@ Component({
      */
     open(e) {
       // 只读 
-      if (this.data.readonly ) {
+      if (this.data.readonly) {
         return;
       }
-      let item = e.currentTarget.dataset; 
+      let item = e.currentTarget.dataset;
       // 明细 只读240320
-      if (item.item.readonlyItem ) {
+      if (item.item.readonlyItem) {
         return;
       }
       let that = this
@@ -598,6 +598,7 @@ Component({
      * @date   : 2024/1/26 11:46
      */
     openChooseItems(e) {
+      console.log("openChooseItems", e);
       if (this.data.selectGoodsUrl) {
         let _this = this
         wx.navigateTo({
@@ -612,7 +613,7 @@ Component({
           },
           success: function (res) {
             // 通过eventChannel向被打开页面传送数据
-            res.eventChannel.emit('params', { choose: true })
+            res.eventChannel.emit('params', { choose: true,  item:  _this.data.type })
           }
         })
       }
@@ -721,13 +722,13 @@ Component({
      * @author : 周兴
      * @date   : 2024/2/2 11:46
      */
-    clearChoose(e) { 
+    clearChoose(e) {
       let ds = e.currentTarget.dataset
       let key = ds.key
       let name = ds.name
       let item = ds.item
       // 明细 只读只读240320
-      if (item.readonlyItem ) {
+      if (item.readonlyItem) {
         return;
       }
       let form = this.data.form

+ 28 - 10
package-base-select/pages/select-goods/select-goods.js

@@ -20,6 +20,7 @@ Page({
     dataItem: {},
     choosedGoodsList: [],
     commonService: app.globalData['commonService'],
+    inventoryService: app.globalData['inventoryService'],
     typeList: [
       {
         catName: '全部分类'
@@ -30,8 +31,8 @@ Page({
     popContent:
       [
         { code: 'itemQty', type: 'step', title: '数量', required: true },
-        { code: 'whId', name: 'whName',title: '仓库', type: 'drop', dropType: 'warehouse' },
-        { code: 'skuSpec', title: '规格', type: 'str', readonly:true, dropType: '' },
+        { code: 'whId', name: 'whName', title: '仓库', type: 'drop', dropType: 'warehouse' },
+        { code: 'skuSpec', title: '规格', type: 'str', readonly: true, dropType: '' },
         { code: 'nonStdCode', title: '商品批次', type: 'str', },
       ],
   },
@@ -61,7 +62,23 @@ Page({
    * @author : 于继渤
    */
   getData(params) {
-    return this.excute(this.data.service, this.data.service.selectByCond, params);
+    if (this.data.item == Constants.billType.sale) {
+      return this.excute(this.data.inventoryService, this.data.inventoryService.selectByCond, params);
+    } else {
+      return this.excute(this.data.service, this.data.service.selectByCond, params);
+    }
+    // 
+  },
+
+  /**
+   * @desc : 加载数据
+   * @date : 2024/2/1 15:49
+   * @author : 姜永辉
+   */
+  loadInit() {
+    this.setData({
+      billType:this.data.item 
+    })    
   },
 
 
@@ -86,7 +103,7 @@ Page({
   openAddItemInfo(e) {
     console.log(e)
     let item = e.currentTarget.dataset.item
-    item.itemQty =1   //打开 popur 数量默认为1
+    item.itemQty = 1   //打开 popur 数量默认为1
     this.setData({
 
       dataItem: JSON.stringify(item),
@@ -123,22 +140,23 @@ Page({
 * @author : 于继渤
 */
   submit() {
-    const eventChannel = this.getOpenerEventChannel(); 
+    const eventChannel = this.getOpenerEventChannel();
     const choosedGoodsList = this.data.choosedGoodsList
-   eventChannel.emit('bindData', { choosedGoodsList })
-   wx.navigateBack({
-     delta: 1
-   }) 
+    eventChannel.emit('bindData', { choosedGoodsList })
+    wx.navigateBack({
+      delta: 1
+    })
   },
 
 
-  
+
   /**
 * @desc : 初始化
 * @date : 2024/2/1 15:49
 * @author : 于继渤
 */
   onLoad() {
+
     this.getGoodsCategoryNoPage()
     let _this = this;
     wx.getSystemInfo({

+ 112 - 7
package-base-select/pages/select-goods/select-goods.wxml

@@ -28,7 +28,8 @@
 </van-tabs>
 
 <view class="main-good-class" style="height:{{windowHeight+'px'}}">
-  <scroll-view scroll-y='{{true}}' bindscrolltolower='scrollToLower' lower-threshold='100' wx:if="{{active == 0}}" class="goods-class" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;">
+  <!-- 商品编码的列表 -->
+  <scroll-view scroll-y='{{true}}' bindscrolltolower='scrollToLower' lower-threshold='100' wx:if="{{active == 0 && billType == 'pur'}}" class="goods-class" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;">
     <van-cell-group style="display: flex;justify-content: flex-end;width: calc({{windowWidth+'px'}} - 20rpx);" custom-class="width-70">
 
       <!-- 商品列表 -->
@@ -59,6 +60,7 @@
           </view>
         </view>
       </van-cell>
+
       <view wx:if="{{tableData.length!=0}}" style="height:180rpx;"></view>
       <van-cell wx:if="{{tableData.length==0}}" border="{{ false }}">
         <view style="width:100%;">
@@ -67,6 +69,93 @@
       </van-cell>
     </van-cell-group>
   </scroll-view>
+
+  <!--出库商品 列表 -->
+  <view wx:if="{{active == 0 && billType == 'sale'}}" 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">
+          <view style="display:flex;width:100%;">
+            <view data-item="{{item}}" style="display:flex;font-size: 15px;">
+              <dk-text style="font-size:30rpx;" fontWeight="nomal" value="{{item.skuCode}}"></dk-text>
+            </view>
+          </view>
+        </view>
+
+        <!-- 商品名称 -->
+        <view class="table-row">
+          <view class="table-content-row">
+            <view style="display: flex;">
+              <view class="table-content-row-font">
+                <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="商品名称" copyValue="{{item.skuName}}"></dk-text>
+              </view>
+              <view class="table-content-class">
+                {{item.skuName?item.skuName:''}}
+              </view>
+            </view>
+          </view>
+        </view>
+
+        <!-- 库区 -->
+        <view class="table-content-row">
+          <view style="display: flex;">
+            <view class="table-content-row-font">
+              <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库区" copyValue="{{item.whName}}"></dk-text>
+            </view>
+            <view class="table-content-class">
+              {{item.whName?item.whName:''}}
+            </view>
+          </view>
+        </view>
+
+        <!-- 库区色号 -->
+        <view class="table-content-row">
+          <view style="display: flex; justify-content:space-between;">
+
+
+            <view style="display: flex;">
+              <view class="table-content-row-font">
+                <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="色号" copyValue="{{item.nonStdCode}}"></dk-text>
+              </view>
+              <view class="table-content-class">
+                {{item.nonStdCode?item.nonStdCode:''}}
+              </view>
+            </view>
+
+            <!-- 加号 -->
+            <view class="van-icon-class">
+              <van-icon size="25px" name="add" style="color:#1B365D" />
+            </view>
+          </view>
+        </view>
+        <!-- 分割线 -->
+        <dk-divider marginTop="20rpx"></dk-divider>
+        <!-- 下半部分 -->
+        <view class="table-content-row">
+          <view style="display: flex;justify-content:space-between">
+            <view style="display: flex;">
+              <view class="table-content-row-font">
+                <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库存量"></dk-text>
+              </view>
+              <view style="font-size: 13px;color: #CAA977;">
+                {{item.invQty}}
+              </view>
+            </view>
+
+            <view style="display: flex;">
+              <view class="table-content-row-font">
+                <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="可售量"></dk-text>
+              </view>
+              <view style="font-size: 13px;color: #CAA977;">
+                {{item.usableQty }}
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+
   <!--已选列表-->
   <view wx:if="{{active == 1}}" class="goods-selected-class">
     <view class="goods-class" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;"></view>
@@ -76,7 +165,6 @@
       </van-cell>
       <van-cell custom-class="goods-cell-class" wx:for="{{choosedGoodsList}}" wx:key="index" data-index="{{index}}" border="{{ false }}">
         <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" async-close bind:close="delChoosedGoodsItem">
-
           <view class="goods-item-class">
             <view>
               <van-image radius="15rpx" custom-class="goods-item-image" fit="fill" src="{{item.skuImages? item.skuImages.path : '' }}" />
@@ -91,7 +179,7 @@
                 <view style="display: flex; ">
                   <dk-text value="{{item.skuName}}"></dk-text>
                 </view>
-                <view style="display: flex;">
+                <view style="display: flex;" wx:if="{{billType == 'pur'}}">
                   <!-- 标准价/标价-->
                   <view style="width: 85%;">
                     <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="13" contentColor="#CAA977" fontWeight="bold" title="售价:" content="{{item.pricePurchase?item.pricePurchase:0}}"></dk-cell>
@@ -100,6 +188,23 @@
                     <van-icon name="arrow" style="font-size:3.5vw;" />
                   </view>
                 </view>
+                <view style="display: flex;"wx:if="{{billType == 'sale'}}">
+                  <view class="table-content-row-font">
+                    <dk-text   fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库区" copyValue="{{item.whName}}"></dk-text>
+                  </view>
+                  <view class="table-content-class">
+                    {{item.whName?item.whName:''}}
+                  </view>
+                </view>
+                <view style="display: flex;"wx:if="{{billType == 'sale'}}">
+                  <view class="table-content-row-font">
+                    <dk-text   fontSize="14px" color="#95A8CB" fontWeight="nomal" value="非标号" copyValue="{{item.nonStdCode}}"></dk-text>
+                  </view>
+                  <view class="table-content-class">
+                    {{item.nonStdCode?item.nonStdCode:''}}
+                  </view>
+                </view>
+                 
               </view>
 
               <view style="display:flex">
@@ -114,6 +219,8 @@
         </van-swipe-cell>
       </van-cell>
     </van-cell-group>
+
+
     <view style="height:180rpx;"></view>
   </view>
 </view>
@@ -135,7 +242,7 @@
 
 
 
-<dk-popup  type="sale" descCol="skuModel" titleCol="skuModel" priceCol="pricePromotion" subCol="desc" value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjNameGoTo}}" contentObj="{{popContent}}" bind:commit="editItems">
+<dk-popup type="sale" descCol="skuModel" titleCol="skuModel" priceCol="pricePromotion" subCol="desc" value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjNameGoTo}}" contentObj="{{popContent}}" bind:commit="editItems">
 </dk-popup>
 
 
@@ -143,6 +250,4 @@
 
 
 <!-- 合计保存相关组件 -->
-<dk-save-bottom flagTypeName="order-choose-goods" selectTotallength="{{sumQuantity}}" selectlength="{{categoryQuantity}}" totallength="{{numberFormat.toThousandCents(sumGoodsAmount)}}" bind:submit="submit" />
-
-
+<dk-save-bottom flagTypeName="order-choose-goods" selectTotallength="{{sumQuantity}}" selectlength="{{categoryQuantity}}" totallength="{{numberFormat.toThousandCents(sumGoodsAmount)}}" bind:submit="submit" />

+ 5 - 3
package-inventory/pages/other-outbound/other-outbound.js

@@ -137,7 +137,7 @@ Page({
             }]
         },
         // 路由
-        routeObjName: 'outboundOther', 
+        routeObjName: 'outboundOther',
 
     },
     /**
@@ -225,6 +225,7 @@ Page({
      * @author : 姜永辉
      */
     validData() {
+        console.log("validData");
         let formData = JSON.parse(this.data.formData)
         if (formData.goodsList == null || formData.goodsList.length == 0) {
             wx.showToast({
@@ -251,6 +252,7 @@ Page({
                 return false
             }
         }
+        console.log("validData-true");
         return true
     },
 
@@ -297,7 +299,7 @@ Page({
     * @date : 2024/2/1 15:49
     * @author : 姜永辉
     */
-    saveData() {
-        return this.excute(this.data.service, this.data.service.otherOutboundInsert, this.data.params)
+    saveData() { 
+        return this.excute(this.data.service, this.data.service.otheroutBoundInsert, this.data.params)
     },
 })