王英杰 1 год назад
Родитель
Сommit
9d6ec15ca5

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

@@ -17,6 +17,10 @@ module.exports = {
 
   routeUrl: {
     check: {
+      editInventoryCheck: { key: 'editInventoryCheck', method: 'editInventoryCheck', primaryKey: 'checkId', image: 'btn-edit.png'}, //编辑
+      invaidOrder: { key: 'invaidOrder', method: 'invaidOrder',image: 'btn-void.png',question:true  },//作废
+      ticketPirnt: { key: 'ticketPirnt', method: 'ticketPirnt', primaryKey: 'rpId', image:'btn-printing.png' },//打印
+
       docName:{key:'check' ,title:'盘点单'},
       edit: { key: 'edit', url: '/package-inventory/pages/inventory-check/detail/detail'  },
       add: { key: 'add', url: '/package-inventory/pages/inventory-check/add/add'  },

+ 1 - 1
components/dkbase/dk-list/dk-list.wxml

@@ -145,7 +145,7 @@
             <view class="footer-tag-class" wx:if="{{footerTag && item[footerTag]}}">
               <dk-tag border="1rpx solid #437FF8" height="44rpx" color="transparent" textColor="#437FF8" radius="10rpx" roundFlag="{{true}}" value="{{item[footerTag]}}"></dk-tag>
             </view>
-            <view class="totalamount-class" wx:else>
+            <view wx:if="{{footerAmount}}" class="totalamount-class"  >
               <dk-cell center="{{(footerInfo && footerInfo.length > 0)?'space-around':'space-between'}}" contentRight="{{false}}" fontSize="15" contentFontSize="17" contentColor="#FF7B1A" titleColor="#002340" contentFontWeight="bold" title="{{footerAmount.title}}" content="{{item[footerAmount.name]?item[footerAmount.name]:0}}"></dk-cell>
             </view>
           </view>

+ 3 - 2
mixins/index.js

@@ -278,7 +278,7 @@ module.exports = {
         return;
       }
       // 如果有链接,就跳转
-      console.log('url', routeUrl); 
+      console.log('url', routeUrl);
       if (routeUrl.url) {
         let url = routeUrl.url
         //保存按钮自定义跳转URL
@@ -344,7 +344,8 @@ module.exports = {
             res.eventChannel.emit('params', data);
           }
         })
-      } else { 
+      } else {
+        debugger
         // 如果是方法就执行方法
         if (routeUrl.method) {
           // 有提示信息,就提出

+ 1 - 2
package-accounts-manage/pages/other-expenditure-orders/add/add.js

@@ -389,8 +389,7 @@ Page({
     formData.staffId = app.globalData.user.staffId
     formData.orgId = app.globalData.user.orgId
     formData.staffName = app.globalData.user.staffName
-    formData.orgName = app.globalData.user.orgName
-    formData.orgName = app.globalData.user.orgName
+    formData.orgName = app.globalData.user.orgName 
     let  dataTime = _this.getTomorrowsDateTimestamp()
     formData.accDate = _this.getTomorrowsDateString() 
     contentList.forEach(it => {

+ 1 - 2
package-accounts-manage/pages/other-receipt/add/add.js

@@ -438,8 +438,7 @@ Page({
       formData.staffId = app.globalData.user.staffId
       formData.orgId = app.globalData.user.orgId
       formData.staffName = app.globalData.user.staffName
-      formData.orgName = app.globalData.user.orgName
-      formData.orgName = app.globalData.user.orgName
+      formData.orgName = app.globalData.user.orgName 
       let  dataTime = _this.getTomorrowsDateTimestamp()
       formData.accDate = _this.getTomorrowsDateString() 
       contentList.forEach(it => {

+ 8 - 15
package-base-select/pages/select-goods/select-goods.js

@@ -327,12 +327,13 @@ Page({
     }
     //处理图片
     if (tableData && tableData.length > 0) {
-      tableData.forEach(item => {
-        if (item.skuImages && item.skuImages.value) {
-          item.skuImages.value = JSON.parse(item.skuImages.value)
-          console.log('item.skuImages.value', item.skuImages.value[0].url)
-          item['imagesUrl'] = item.skuImages.value.length > 0 ? item.skuImages.value[0].url : null
-        }
+      tableData.forEach(element => {
+        if (element.skuImages && element.skuImages.length > 0) {
+          element.skuImages.forEach(item => {
+            item.url = config.image_url + item.path
+          });
+          element.imagesUrl =   element.skuImages[0].url
+        } 
       })
       this.setData({
         tableData: tableData
@@ -361,15 +362,7 @@ Page({
           res.nonStdCode = ''
         })
       }
-      if (tableData && tableData.length > 0) {
-        tableData.forEach(element => {
-          if (element.skuImages && element.skuImages.length > 0) {
-            element.skuImages.forEach(item => {
-              item.url = config.image_url + item.path
-            });
-          }
-        });
-      }
+   
       this.setData({
         popContent: popContent,
         tableData: tableData

+ 14 - 30
package-inventory/pages/inventory-check/add/add.js

@@ -9,11 +9,20 @@ Page({
      * 页面的初始数据
      */
     data: {
+      controlFlags: { choosewhFlag: true, chooseWhByUserDefault: true, choosewhReadonly: false, paramsByWhId: true, sourcePage: 'inventory-check' },
         draftFlag: false,
         purIdArray: '', //来源单id 
         // 弹出按钮
-        buttonList: [],
-
+        buttonList : [{
+          code: 'draft',
+          name: 'merge',
+          color: '#636FB4',
+          title: mixins.$t("staging"), //'暂存'
+      }, {
+          code: 'save',
+          name: 'merge',
+          title: mixins.$t("save"), //'保存'
+      }],
         btnFormData: null,
         popupTopObj: [{
             leftTitle: mixins.$t('storageNum'),//库存量',
@@ -60,8 +69,7 @@ Page({
             },
             {
                 name: 'items',
-                title: mixins.$t("goodsDetail"), //'商品明细',
-                info: '(' + mixins.$t("warehousingProcessing") + ')',
+                title: mixins.$t("goodsDetail"), //'商品明细', 
                 color: '#E4002B',
                 displayNum: 2
             }, {
@@ -268,7 +276,7 @@ Page({
             buttonList = [{
                 code: 'edit',
                 name: 'merge',
-                title: mixins.$t("edit"), //'保存'
+                title: mixins.$t("save"), //'保存'
             }]
             readonly = true
         } else {
@@ -298,31 +306,7 @@ Page({
      * @author : 王英杰
      */
     loadInit() {
-        let formData = JSON.parse(this.data.formData)
-        let item = this.data.item || []
-        let buttonList = this.data.buttonList 
-        if (item.length > 0) {//新建选品进来的走这
-            formData.goodsList = item
-            formData.goodsList.forEach(element => {
-                element.balanceQty = element.itemQty - element.invQty
-            });
-            buttonList = [{
-                    code: 'draft',
-                    name: 'merge',
-                    color: '#636FB4',
-                    title: mixins.$t("staging"), //'暂存'
-                }, {
-                    code: 'save',
-                    name: 'merge',
-                    title: mixins.$t("save"), //'保存'
-                }],
-                this.setData({
-                    buttonList: buttonList,
-                    formData: JSON.stringify(formData)
-                })
-        }
-
-
+          
 
     },
     /**

+ 1 - 1
package-inventory/pages/inventory-check/add/add.wxml

@@ -6,7 +6,7 @@
 <!-- <dk-form id="{{formName}}" cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData">
 </dk-form> -->
 
-<dk-form-bill sumAmountColFlag="{{false}}" type="out" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode" descCol="skuModel"   quantityCol="itemQty"   contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle="{{$t['wholesalePrice']}}:" bind:editItems="setGoods" bind:clear = "clear" readonly = "{{readonly}}"chooseVisible="{{!chooseVisible}}" popupTopObj="{{popupTopObj}}"
+<dk-form-bill sumAmountColFlag="{{false}}" type="out" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode" descCol="skuModel" priceCol="priceInto"pupPriceCol="pricePurchase"  quantityCol="itemQty"   contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle="{{$t['wholesalePrice']}}:" bind:editItems="setGoods" bind:clear = "clear" readonly = "{{readonly}}"chooseVisible="{{!chooseVisible}}" popupTopObj="{{popupTopObj}}"controlFlags="{{controlFlags}}"
 bind:delItem="setGoods" bind:setGoods="setGoods">
 </dk-form-bill>
 

+ 4 - 2
package-inventory/pages/inventory-check/detail/detail.js

@@ -55,8 +55,7 @@ Page({
             },
             {
                 name: 'items',
-                title: mixins.$t("goodsDetail"), //'商品明细',
-                info: '(' + mixins.$t("warehousingProcessing") + ')',
+                title: mixins.$t("goodsDetail"), //'商品明细', 
                 color: '#E4002B',
                 displayNum: 2
             }, {
@@ -71,6 +70,7 @@ Page({
                     title:mixins.$t("inventoryEmployees"), //'盘点员工', 
                     type: 'choose',
                     required: true,
+                    readonlyItem:true,
                     urlKey: 'chooseStaff'
                 }, {
                     code: 'orgId',
@@ -78,6 +78,7 @@ Page({
                     title: mixins.$t("inventoryOrg"), //'盘点部门',  
                     type: 'choose',
                     required: true,
+                    readonlyItem:true,
                     urlKey: 'chooseOrg'
                 },
                 {
@@ -85,6 +86,7 @@ Page({
                     name: 'whName',
                     type: 'choose',
                     title:  mixins.$t("inventoryWh"), //'盘点仓库' 
+                    readonlyItem:true,
                     urlKey: 'chooseWh'
                 }
             ],

+ 56 - 18
package-inventory/pages/inventory-check/inventory-check.js

@@ -54,15 +54,13 @@ Page({
       dataType: 'date'
     }],
 
-
-    // 列表区(脚部信息)
-    footerInfo: [{
-      name: 'categoryQuantity',
-      title: mixins.$t('together'),//'共计',
-    }, {
-      name: 'tsumQuantity',
-      title: mixins.$t('piece'),//'件'
-    }],
+ 
+      // 列表区(脚部信息)
+      // footerInfo: [{
+      //   prefix: mixins.$t('together'), //'共计',
+      //   name: 'sumQuantity',
+      //   title: mixins.$t('piece'), //'件'
+      // }],
     // 列表区(内容)
     contentList: [{
       name: 'checkNo',
@@ -85,15 +83,16 @@ Page({
     }],
 
     // 弹出按钮
-    pupbuttonList: [{
-      name: 'customerRefund',
+    pupbuttonList: [
+      {
+        name: 'editInventoryCheck',
+        title: mixins.$t('edit'),//编辑
+      }, {
+      name: 'invaidOrder',
       title: mixins.$t('invaidOrder'),//作废
-    }, {
-      name: 'customerRefundList',
-      title: mixins.$t('edit'),//编辑
-    }, {
-      name: 'printedBill',
-      title: mixins.$t('printedBill') //打印票据
+    },{
+      name: 'ticketPirnt',
+      title: mixins.$t('ticketPirnt') //打印票据
     }
     ],
     buttonList: [{
@@ -133,6 +132,45 @@ Page({
       }
     })
   },
+    /**
+   * @desc : (编辑)
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  editInventoryCheck(e) {
+    let item = e
+    let id = item.checkId
+    // 采购入库 
+    wx.navigateTo({
+      url: this.data.route.add.url,
+      events: {
+        // 回调后,在这里给页面赋值
+        bandData: function (e) {}
+      },
+      success: function (res) {
+        res.eventChannel.emit('params', {
+          id: id,
+          formMode: Constants.formMode.edit
+        })
+      }
+    })
+  },
+ /**
+    * @desc : 作废
+    * @date : 2024/2/1 15:49
+    * @author : 王英杰
+    */
+   invaidOrder(e) {
+    let item = e
+    let id = item.rpId
+    this.excute(this.data.service, this.data.service.invalid + id, null).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        // 重新查询
+        this.searchData()
+      }
+    })
+
+  },
   toPoint(e) {
     console.log('t3', e);
     this.setData({
@@ -147,7 +185,7 @@ Page({
   openChooseItems(e) {
     let _this = this
     wx.navigateTo({
-      url: this.data.route.selectGoods.url,
+      url: this.data.route.add.url,
       events: {
         // 回调后
         bindData: function (data) { }

+ 2 - 1
package-inventory/pages/inventory-check/inventory-check.json

@@ -1,4 +1,5 @@
 {
     "usingComponents": {},
-    "navigationBarTitleText": "库存盘点"
+    "navigationBarTitleText": "库存盘点",
+    "enablePullDownRefresh":true
   }

+ 1 - 1
package-inventory/pages/inventory-check/inventory-check.wxml

@@ -21,6 +21,6 @@
 
  
 <!-- 新建按钮 -->
-<dk-save-button   btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="openChooseItems"  ></dk-save-button>
+<dk-save-button   btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="open"  ></dk-save-button>
  
  

+ 27 - 33
package-purchase/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxml

@@ -34,11 +34,11 @@
         </view>
       </view>
       <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #002340;">
-        {{item.contactName ? item.contactName : ''}}
+        {{item.staffName ? item.staffName : ''}}
       </view>
 
       <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #002340;">
-        {{item.contactPhone ? "|  "+item.contactPhone : ''}}
+        {{item.orgName ? "|  "+item.orgName : ''}}
       </view>
 
 
@@ -59,46 +59,40 @@
     </view>
   </view>
 </view> 
-<!-- 统计 -->
-<view>
-  <view style="display: flex;text-align: center;justify-content: center;">
-    <view class="statistics">
-      <view>
-        <view class="statistics-title"> {{$t['orderQty']}}</view>
-        <view class="statistics-value">{{item.sumQuantity}}</view>
-      </view>
-    </view>
-    <view class="statistics" data-quantity="{{item.sumWarehousing ? item.sumWarehousing: 0}}" data-type="inventoryQty" data-item="{{item}}" bind:tap="toJumpPage">
-      <view>
-        <view class="statistics-title">{{$t['inventoryQty']}}</view>
-        <view class="statistics-value">{{item.sumWarehousing ? item.sumWarehousing: 0}}</view>
-      </view>
-      <view wx:if="{{item.sumWarehousing}}" style="margin-left:4px;">
-        <van-icon color="#bdb7b7" name="arrow" style="font-size: 16px;" />
-      </view>
-    </view>
-    <view class="statistics" data-quantity="{{item.returnQty ? item.returnQty: 0}}" data-type="returnQty" data-item="{{item}}" bind:tap="toJumpPage">
-      <view>
-        <view class="statistics-title">{{$t['returnQty']}}</view>
-        <view class="statistics-value">{{item.returnQty ? item.returnQty  : 0}}</view>
+ 
+
+<view class="dk-card-outer-class-1">
+  <!--对象-->
+  <view class="dk-card-class">
+    <view style="display: flex;padding:10rpx;">
+    <!-- 订单数量 -->
+      <view style="background-color:#F4F9FF;width:50%;padding:10rpx;border-radius: 16rpx;">
+        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['orderQty']}}</view>
+        <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.sumQuantity}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
       </view>
-      <view wx:if="{{item.returnQty}}" style="margin-left:4px;">
-        <van-icon color="#bdb7b7" name="arrow" style="font-size: 16px;" />
+      <!-- 入库数量 -->
+      <view style="background-color:#F4F9FF;width: 50%;padding:10rpx;border-radius: 16rpx;margin-left: 20rpx;"data-quantity="{{item.sumWarehousing ? item.sumWarehousing: 0}}" data-type="inventoryQty" data-item="{{item}}" bind:tap="toJumpPage">
+        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['inventoryQty']}}</view>
+        <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.sumWarehousing ? item.sumWarehousing: 0}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
       </view>
     </view>
-    <view class="statistics" data-quantity="{{item.inboundReturnQty ? item.inboundReturnQty: 0}}" data-type="returnAndOutbound" data-item="{{item}}" bind:tap="toJumpPage">
-      <view>
-        <view class="statistics-title">{{$t['returnAndOutbound']}}</view>
-        <view class="statistics-value">{{item.inboundReturnQty ? item.inboundReturnQty : 0}}</view>
+
+
+    <view style="display: flex;padding:10rpx;">
+    <!-- 退货数量 -->
+      <view style="background-color:#F4F9FF;width:50%;padding:10rpx;border-radius: 16rpx;" data-quantity="{{item.returnQty ? item.returnQty: 0}}" data-type="returnQty" data-item="{{item}}" bind:tap="toJumpPage">
+        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['returnQty']}}</view>
+        <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.returnQty ? item.returnQty  : 0}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
       </view>
-      <view  wx:if="{{item.inboundReturnQty}}" style="margin-left:4px;">
-        <van-icon color="#bdb7b7" name="arrow" style="font-size: 16px;" />
+      <!-- 退货数量 -->
+      <view style="background-color:#F4F9FF;width: 50%;padding:10rpx;border-radius: 16rpx;margin-left: 20rpx;"data-quantity="{{item.inboundReturnQty ? item.inboundReturnQty: 0}}" data-type="returnAndOutbound" data-item="{{item}}" bind:tap="toJumpPage">
+        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['returnAndOutbound']}}</view>
+        <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.inboundReturnQty ? item.inboundReturnQty : 0}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
       </view>
     </view>
   </view>
 </view>
 
-
 <!-- 商品信息 和 其他信息 -->
 <dk-form-bill id="{{formName}}" routeObjName="{{routeObjName}}" readonly="{{true}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode" descCol="skuModel" priceCol="pricePur"pupPriceCol="pricePurchase" quantityCol="itemQty" sumAmountCol="itemAmt" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle="{{$t['wholesalePrice']}}:">
 </dk-form-bill>

+ 6 - 1
package-purchase/pages/purchase-order/purchase-order-detail/purchase-order-detail.wxss

@@ -10,7 +10,12 @@
   justify-content: center;
   align-items: center;
 }
-
+.dk-card-outer-class-1 {
+  margin: 10px 32rpx 10px 32rpx;
+  margin-top: 10px;
+  border-radius: 15rpx;
+  /* box-shadow: 2px 2px 5px #e5e5e6; */
+}
 .statistics-title{
   color: #1B365D;
   font-size: 24rpx;

+ 18 - 10
package-purchase/pages/purchase-receipt/add/add.js

@@ -1,6 +1,7 @@
 // package-basic-data/pages/test/add/add.js
 const mixins = require('@/mixins/index.js')
 const util = require('@/utils/util.js')
+const config = require('@/config/config.js')
 const app = getApp()
 const Constants = require('@/utils/Constants');
 Page({
@@ -36,7 +37,7 @@ Page({
         type: 'number',
         title: mixins.$t("inboundPrice"),
         required: true
-      }, ,
+      }, 
       {
         code: 'itemQty',
         type: 'step',
@@ -305,6 +306,9 @@ Page({
     purIdArray_ = purIdArray.join(',');
 
     data.goodsList.forEach(element => {
+            //设置商品明细输入数量 最大 最小限制
+      //  element['itemQty_max'] = element.itemQty
+      //  element['itemQty_min'] = 1
       if(element.intoStatus == Constants.intoStatus.inBounded)//"入库状态-已入库"
       {
        element.itemAmt = element.priceInto * element.intoQty
@@ -313,12 +317,17 @@ Page({
       {
        element.itemAmt = element.priceInto * element.intoingQty
        element.itemQty = element.intoingQty 
-      }
-
+      } 
       if (data.whId) {
         element.whId = data.whId
         element.whName = data.whName
       }
+      if (element.skuImages && element.skuImages.length > 0) {
+        element.skuImages.forEach(item => {
+          item.url = config.image_url + item.path
+        });
+        element.imagesUrl =   element.skuImages[0].url
+      }
     });
     let sumitemAmt = 0
     sumitemAmt = data.goodsList.sum("itemAmt")
@@ -446,15 +455,14 @@ Page({
     let formData = JSON.parse(this.data.formData)
     let totalAmout = Number(0)
     // 各个明细的金额数量
-    formData.goodsList.forEach(element => { //循环出商品总共价格   
-      element.intoingAmt = element.pricePurchase * element.itemQty
-      element.intoingQty = element.itemQty
-      element.pricePur = element.pricePurchase
-      element.priceInto = element.priceInto ? element.priceInto : element.pricePurchase
+    formData.goodsList.forEach(element => { //循环出商品总共价格    
+      element.intoingQty = element.itemQty 
+      element.priceInto = element.priceInto?element.priceInto : element.pricePurchase
+      element.intoingAmt = element.priceInto * element.itemQty
       element.intoAmt = 0 //  已入库金额
       element.intoQty = 0 //  已入库数量
-      totalAmout += Number(element.pricePurchase) * Number(element.itemQty)
-    })
+      totalAmout += Number(element.priceInto) * Number(element.itemQty)
+     })
     // 左下角的合计金额
     contentList_.forEach(card => {
       if (card.code === 'amount') {

+ 2 - 2
package-purchase/pages/purchase-receipt/add/add.wxml

@@ -4,8 +4,8 @@
 <loading wx:if="{{loading}}" ></loading>
 
  
-<dk-form-bill type="pur" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode" subCol="skuCode" descCol="skuModel" priceCol="priceInto" quantityCol="{{intoStatusflag?'intoingQty':'intoQty'}}" sumAmountCol="itemAmt" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle="{{$t['referencePrice']}}:"  bind:editItems="setGoods" bind:clear = "clear" readonly = "{{readonly}}" chooseVisible="{{!chooseVisible}}" controlFlags ="{{controlFlags}}"
-bind:delItem="setGoods" bind:setGoods="setGoods" table="{{table}}">
+<dk-form-bill type="pur" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuModel"  descCol="skuName" priceCol="priceInto" pupPriceCol="pricePurchase" iconCol="imagesUrl"  quantityCol="{{intoStatusflag?'intoingQty':'intoQty'}}" sumAmountCol="itemAmt" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle="{{$t['referencePrice']}}:"   bind:clear = "clear" readonly = "{{readonly}}" chooseVisible="{{!chooseVisible}}" controlFlags ="{{controlFlags}}"
+bind:delItem="setGoods" bind:setGoods="setGoods" bind:editItems="setGoods" table="{{table}}">
 </dk-form-bill>
 
 <view style="height: 200rpx;"></view>

+ 59 - 7
package-purchase/pages/purchase-receipt/detail/detail.js

@@ -1,6 +1,7 @@
 // package-basic-data/pages/test/add/add.js
 const mixins = require('@/mixins/index.js')
-const Constants = require('@/utils/Constants');
+const Constants = require('@/utils/Constants'); 
+const config = require('@/config/config.js')
 const app = getApp()
 Page({
   mixins: [mixins],
@@ -59,18 +60,21 @@ Page({
 
       other: [{
         code: 'remarks',
-        type: 'textarea',
-        readonly:true,
+        type: 'textarea', 
         title:  mixins.$t("remarks"),//'备注'
       }, {
         code: 'file',
-        type: 'uploader',
-        readonly:true,
+        type: 'uploader', 
         title: mixins.$t("uploader"),//'附件'
       }]
     },
     popContent: [{
-        code: 'intoingQty',
+      code: 'priceInto',
+      type: 'number',
+      title: mixins.$t("inboundPrice"),
+      required: true
+    },{
+        code: 'itemQty',
         type: 'step',
         title: mixins.$t("count"),//'数量',
         required: true
@@ -167,6 +171,9 @@ Page({
       })
     }
     data.goodsList.forEach(element => { //删掉查出的无用数据
+         //设置商品明细输入数量 最大 最小限制
+         element['itemQty_max'] = element.itemQty
+         element['itemQty_min'] = 1
       if(element.intoStatus == Constants.intoStatus.inBounded)//"入库状态-已入库"
       {
        element.itemAmt = element.priceInto * element.intoQty
@@ -180,7 +187,14 @@ Page({
         element.whId = data.whId
         element.whName = data.whName
       }
+      if (element.skuImages && element.skuImages.length > 0) {
+        element.skuImages.forEach(item => {
+          item.url = config.image_url + item.path
+        });
+        element.imagesUrl =   element.skuImages[0].url
+      }
     });
+    
     sumitemAmt = data.goodsList.sum("itemAmt")
     cardList_.forEach(card => {
       if (card.name === 'items') {
@@ -211,7 +225,45 @@ Page({
 
   },
 
-
+/**
+   * @desc : 外露设置产品方法 
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  setGoods(e) {
+    let contentList_ = this.data.contentList
+    let cardList = this.data.cardList
+    let formData = JSON.parse(this.data.formData)
+    let totalAmout = Number(0)
+    // 各个明细的金额数量
+    formData.goodsList.forEach(element => { //循环出商品总共价格    
+     element.intoingQty = element.itemQty 
+     element.priceInto = element.priceInto?element.priceInto : element.pricePurchase
+     element.intoingAmt = element.priceInto * element.itemQty
+     element.intoAmt = 0 //  已入库金额
+     element.intoQty = 0 //  已入库数量
+     totalAmout += Number(element.priceInto) * Number(element.itemQty)
+    })
+    // 左下角的合计金额
+    contentList_.forEach(card => {
+      if (card.code === 'amount') {
+        card.content = totalAmout
+      }
+    })
+    // 明细的合计金额
+    cardList.forEach(card => { //循环出商品总共价格
+      if (card.name === 'items') {
+        //合计金额
+        card.itemAmt = totalAmout
+      }
+    })
+    console.log(formData.goodsList);
+    this.setData({
+      contentList: contentList_,
+      cardList,
+      formData: JSON.stringify(formData)
+    })
+  },
   /**
    * @desc : 保存的參數設置
    * @date : 2024/2/1 15:49

+ 3 - 4
package-purchase/pages/purchase-receipt/detail/detail.wxml

@@ -59,11 +59,10 @@
     </view>
   </view>
 </view> 
-<dk-form-bill id="{{formName}}"  readonly="{{true}}"  routeObjName="{{routeObjName}}" 
-cardList="{{cardList}}"  titleTagCol ="shortName"  titleCol ="skuCode"   
-descCol = "skuModel" priceCol ="priceInto" quantityCol="{{intoStatusflag?'intoingQty':'intoQty'}}"  sumAmountCol ="itemAmt"
+<dk-form-bill id="{{formName}}"  routeObjName="{{routeObjName}}" 
+cardList="{{cardList}}"  titleTagCol="shortName" titleCol="skuModel"  iconCol="imagesUrl" descCol="skuName" priceCol="priceInto" pupPriceCol="pricePurchase" quantityCol="{{intoStatusflag?'intoingQty':'intoQty'}}"  sumAmountCol ="itemAmt"
 contentObj="{{contentObj}}" model:value="{{formData}}" popContent = "{{popContent}}" 
-bind:chooseData = "chooseData"  popType = "sale" priceTitle = "{{$t['referencePrice']+':'}}">
+bind:chooseData = "chooseData"  popType = "sale" priceTitle = "{{$t['referencePrice']+':'}}" bind:delItem="setGoods" bind:setGoods="setGoods" bind:editItems="setGoods">
 </dk-form-bill>
 
 <view style="height: 200rpx;"></view>

+ 14 - 3
package-purchase/pages/supplier-list/add/add.js

@@ -147,7 +147,8 @@ Page({
    * @author : 王英杰
    */
   setValuesByEdit(data) { 
-    data.serviceCategories = (data.serviceCategories && data.serviceCategories.length > 0) ? data.serviceCategories.join(',') : undefined
+    data.serviceCategories = data.serviceCategories.join(',') 
+ 
     data.brandIds = (data.brandIds && data.brandIds.length > 0) ? data.brandIds.split(',') : undefined
     data.addressFull =    data.returnAddress
     data.address =   {address :data.returnAddress }
@@ -167,7 +168,7 @@ Page({
        // 修改之后的 值 
        params = Object.assign({}, params, saveData);
        console.log("params",params);
-       params.serviceCategories = (params.serviceCategories && params.serviceCategories.length > 0) ? params.serviceCategories.split(',') : []
+       params.serviceCategories = params.serviceCategorie.split(',') 
        params.brandIds = (params.brandIds && params.brandIds.length > 0) ? params.brandIds : []
        params.returnAddress   = saveData.addressFull
        params.makeStaff = app.globalData.user.staffId
@@ -198,11 +199,21 @@ Page({
     if (this.data.formMode == Constants.formMode.edit) {
       wx.setNavigationBarTitle({
         title: mixins.$t('supplierEdit'),
-      })
+      }) 
+
     } else {
       wx.setNavigationBarTitle({
         title: mixins.$t('supplierAdd'),
       })
+      let formData = {} 
+      //采购人员和采购部门默认带出来(当前登录人
+      formData.staffId = app.globalData.user.staffId
+      formData.orgId = app.globalData.user.orgId
+      formData.staffName = app.globalData.user.staffName 
+      formData.orgName = app.globalData.user.orgName 
+      this.setData({ 
+        formData: JSON.stringify(formData)
+      })
     }
   },
 })