Browse Source

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

zhoux 1 year ago
parent
commit
e1a7f90344

+ 5 - 6
api/pages/common/common.js

@@ -16,12 +16,11 @@ module.exports = {
         getInitData: 'get_init_data',
         getUser: 'get_user',
         getUserByPage: 'get_user_by_page',
-        selectById: '',
-        goodsBrandListBy: 'goods_brand_list_by', //商品品牌
-        goodsSeriesListBy: 'goods_Series_list_by', //商品系列
-        goodsCategoryListBy: 'goods_category_list_by', //商品种类
-        unitListBy: 'unit_list_by', //计量单位
-        warehouseListBy: 'get_warehouse_by_page', //仓库档案(带分页)
+        selectById: '', 
+        getGoodsSeriesListBy: 'get_goods_Series_list_by', //商品系列
+    
+        getUnitListBy: 'get_unit_list_by', //计量单位
+        getWarehouseListBy: 'get_warehouse_by_page', //仓库档案(带分页)
         getWarehouse :'get_warehouse',//仓库档案(不带分页)
         getDictionaryData: 'get_dictionary_data', //数据字典
         getDataKind: 'get_data_kind', //系统数据

+ 21 - 0
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -517,7 +517,28 @@ Component({
         ds.item.packageBox = ds.item['box'] + ds.item.subUnitName + ds.item['piece'] + ds.item.unitName
       }
       this.setInitPopData()
+      //没有skuid 是外协商品 
+      let popupTopObj_sku = null
+      let popContent_sku = null
+      let popContent_ =  util.copyObj(this.data.popContent) 
+      if(ds.item.skuId){
+        popupTopObj_sku = this.data.popupTopObj
+        popContent_sku = popContent_
+      }else{
+        //  全-免费版-销售出库-新建、编辑、详情-外协品-抽屉不展示库存量、仓库字段
+        popupTopObj_sku = []
+        let index = popContent_.findIndex(element => element.code == 'whId');  
+        if (index !== -1) {  
+            // 找到了满足条件的元素,index 是它的索引  
+            popContent_sku = popContent_
+            popContent_sku.splice(index,1)
+        } else {  
+          popContent_sku = popContent_
+        } 
+      }
       this.setData({
+        popContent_sku:popContent_sku,
+        popupTopObj_sku:popupTopObj_sku,
         dataIndex: ds.index,
         dataItem: JSON.stringify(ds.item),
         showPop: true,

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

@@ -128,8 +128,8 @@
                 </view>
               </van-card>
               <!-- 明细右上角 -->
-              <view wx:if="{{titpsFlag}}" class="titps" style="{{item[titpsItemColorFlagKey] ? 'background-color: #E4002B8F;' : 'background: #77C5D59C;'}}">
-                <view wx:if="{{!isDetailFlag}}" class="titps-font" style="{{ item[titpsItemColorFlagKey] ?'color:#E4002B' : 'color: #00A7B5;'}}">{{ item[titpsLabel] ? item[titpsLabel] : '有货' }}</view>
+              <view wx:if="{{titpsFlag&&!isDetailFlag&&!!!item.noshowtitps}}" class="titps" style="{{item[titpsItemColorFlagKey] ? 'background-color: #E4002B8F;' : 'background: #77C5D59C;'}}">
+                <view  class="titps-font" style="{{ item[titpsItemColorFlagKey] ?'color:#E4002B' : 'color: #00A7B5;'}}">{{ item[titpsLabel] ? item[titpsLabel] : '有货' }}</view>
               </view>
               <view style="display: flex;" wx:if="{{item[quantityRedColFlagKey]}}">
                 <view style="width: 60%;">
@@ -289,6 +289,6 @@
   <van-datetime-picker type="date" bind:confirm="chooseDate" bind:cancel="cancelDatePop" loading="{true}" value="{{dataTime}}" />
 </van-popup>
 
-<dk-popup id="dkPopup" type="{{popType}}" routeObjName="{{routeObjName}}" priceCol="{{priceCol}}" titleTagCol="{{titleTagCol}}" titleCol="{{titleCol}}" subCol="{{subCol}}" descCol="{{descCol}}" iconCol="{{iconCol}}" priceCol="{{pupPriceCol}}" priceTitle="{{priceTitle}}" value="{{dataItem}}" show="{{showPop}}" contentObj="{{popContent}}" popupTopObj="{{popupTopObj}}" bind:changeStep="changeStep" bind:changeCheckBox="changeCheckBox" readonly="{{readonly}}" bind:blurNumberField="blurNumberField" bind:commit="editItems" bind:openPackageBox="openPackageBox"></dk-popup>
+<dk-popup id="dkPopup" type="{{popType}}" routeObjName="{{routeObjName}}" priceCol="{{priceCol}}" titleTagCol="{{titleTagCol}}" titleCol="{{titleCol}}" subCol="{{subCol}}" descCol="{{descCol}}" iconCol="{{iconCol}}" priceCol="{{pupPriceCol}}" priceTitle="{{priceTitle}}" value="{{dataItem}}" show="{{showPop}}" contentObj="{{popContent_sku}}" popupTopObj="{{popupTopObj_sku}}" bind:changeStep="changeStep" bind:changeCheckBox="changeCheckBox" readonly="{{readonly}}" bind:blurNumberField="blurNumberField" bind:commit="editItems" bind:openPackageBox="openPackageBox"></dk-popup>
 <!-- 箱片 -->
 <dk-popup type="basic" title="修改包装数量" titleCol="skuModel" iconCol="imagesUrl" value="{{dataItem}}" show="{{showPopBox}}" routeObjName="{{routeObjName}}" contentObj="{{popContentBox}}" bind:changeStep="changeStep" bind:commit="editItemsBox"></dk-popup>

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

@@ -674,7 +674,7 @@ Page({
         this.setData({
           routeObjName: 'common',
           routeObjNamePop: 'warehouse',
-          method: 'warehouseListBy',
+          method: 'getWarehouseListBy',
           title: 'whName',
           contentList: [{
             name: 'supervisor',

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

@@ -633,8 +633,7 @@ Page({
    * @author : 于继渤
    */
   getGoodsCategoryNoPage() {
-    return this.excute(this.data.commonService, this.data.commonService.getGoodsCategoryNoPage, {}).then(res => {
-      console.log('goodsCategoryListBy', res.data.data)
+    return this.excute(this.data.commonService, this.data.commonService.getGoodsCategoryNoPage, {}).then(res => { 
       this.setData({
         typeList: this.data.typeList.concat(res.data.data)
       })

+ 1 - 1
package-basic-data/pages/product-file/metering-unit/metering-unit.js

@@ -79,7 +79,7 @@ Page({
   * @author : 王英杰
   */
  getData(params) {
-  return this.excute(this.data.commonService, this.data.commonService.unitListBy, params);
+  return this.excute(this.data.commonService, this.data.commonService.getUnitListBy, params);
 },
  /**
    * @desc   : 新建编辑事件

+ 1 - 1
package-basic-data/pages/product-file/product-series/product-series.js

@@ -90,7 +90,7 @@ Page({
   * @author : 王英杰
   */
  getData(params) {
-  return this.excute(this.data.commonService, this.data.commonService.goodsSeriesListBy, params);
+  return this.excute(this.data.commonService, this.data.commonService.getGoodsSeriesListBy, params);
 },
  /**
    * @desc   : 新建编辑事件

+ 4 - 5
package-inventory/pages/ivt-detail-report/ivt-detail-report.js

@@ -175,7 +175,7 @@ Page({
       })
       // 库区
       list.push({
-        title:  mixins.$t('reservoirArea'),
+        title: mixins.$t('reservoirArea'),
         value: item.whName ? item.whName : '',
         copyValue: item.whName ? item.whName : '',
       })
@@ -193,8 +193,8 @@ Page({
       })
       // 库存量
       list.push({
-        title: mixins.$t('storageNum'), 
-        value: (item.invQty ? item.invQty : '0') +  item.unitName,
+        title: mixins.$t('storageNum'),
+        value: (item.invQty ? item.invQty : '0') + item.unitName,
         copyValue: item.invQty ? item.invQty : '0',
       })
       // 可售包装 
@@ -207,7 +207,7 @@ Page({
           value: item.packageBox,
           copyValue: item.packageBox,
         })
-      } 
+      }
       item.list = list
       if (item.skuImages && item.skuImages.length > 0) {
         item.skuImages.forEach(it => {
@@ -227,7 +227,6 @@ Page({
   */
   getGoodsBrandNoPage() {
     return this.excute(this.data.commonService, this.data.commonService.getGoodsBrandNoPage, {}).then(res => {
-      console.log('getGoodsBrandNoPage', res.data.data)
       this.setData({
         typeList: this.data.typeList.concat(res.data.data)
       })

+ 9 - 3
package-inventory/pages/warehousing-processing/detail/detail.js

@@ -436,6 +436,7 @@ Page({
 
         let contentObj = {}
         let cardList = []
+
         // 采购入库
         if (this.data.item.intoType == Constants.intoType.pur) {
             wx.setNavigationBarTitle({
@@ -599,7 +600,13 @@ Page({
             wx.setNavigationBarTitle({
                 title: mixins.$t('firstInWh'),
             })
-
+            // 期初入库 --不能编辑箱片
+            let popContent = this.data.popContent
+            popContent.forEach(p => {
+                if (p.code === 'packageBox') {
+                    p.readonly = true
+                }
+            })
             cardList = [
                 {
                     name: 'items',
@@ -614,8 +621,6 @@ Page({
                 }
             ]
             contentObj = {
-
-
                 items: [{
                     code: 'collectType',
                     name: 'collectName',
@@ -641,6 +646,7 @@ Page({
             this.setData({
                 contentObj,
                 cardList,
+                popContent,
             })
         } else {
             // 销售退货

+ 100 - 67
package-inventory/pages/warehousing-processing/warehousing-processing.js

@@ -33,7 +33,7 @@ Page({
     }],
 
     // 查询条件-筛选
-    pullMenuList: [
+    pullMenuList: (app.globalData.company.gradeCode == Constants.gradeCode.PRO)?[
       {
         code: 'intoType',
         pullType: 'mSelect',
@@ -52,6 +52,40 @@ Page({
         code: 'supName',
       },
       {
+        code: 'whName',
+        title: mixins.$t('reservoirArea')
+      },
+      {
+        code: 'staffName',
+      },
+      {
+        code: 'orgName',
+      },
+      {
+        code: 'flgValid',
+        title: mixins.$t('flgValid'),
+        dataType: 'checkbox'
+      },
+    ]:[
+      {
+        code: 'intoType',
+        pullType: 'mSelect',
+        typeName: 'intoTypeSt'
+      },
+      {
+        code: 'cusName',
+      },
+      {
+        code: 'cusPhone',
+      },
+      {
+        code: 'addressFull',
+      },
+      {
+        code: 'whName',
+        title: mixins.$t('reservoirArea')
+      },
+      {
         code: 'staffName',
       },
       {
@@ -583,75 +617,74 @@ Page({
    * @author : 姜永辉
    */
   loadInit() {
-    console.log(app.globalData.company.gradeCode);
+    let pullMenuList = []
     if (app.globalData.company.gradeCode == Constants.gradeCode.PRO) {
       //专业
-      this.setData({
-        pullMenuList: [
-          {
-            code: 'intoType',
-            pullType: 'mSelect',
-            typeName: 'intoType'
-          },
-          {
-            code: 'cusName',
-          },
-          {
-            code: 'cusPhone',
-          },
-          {
-            code: 'addressFull',
-          },
-          {
-            code: 'supName',
-          },
-          {
-            code: 'staffName',
-          },
-          {
-            code: 'orgName',
-          },
-          {
-            code: 'flgValid',
-            title: mixins.$t('flgValid'),
-            dataType: 'checkbox'
-          },
-        ],
-      })
-    } else { 
-      this.setData({
-        pullMenuList: [
-          {
-            code: 'intoType',
-            pullType: 'mSelect',
-            typeName: 'intoTypeSt'
-          },
-          {
-            code: 'cusName',
-          },
-          {
-            code: 'cusPhone',
-          },
-          {
-            code: 'addressFull',
-          },
-          {
-            code: 'supName',
-          },
-          {
-            code: 'staffName',
-          },
-          {
-            code: 'orgName',
-          },
-          {
-            code: 'flgValid',
-            title: mixins.$t('flgValid'),
-            dataType: 'checkbox'
-          },
-        ],
-      })
+      pullMenuList = [
+        {
+          code: 'intoType',
+          pullType: 'mSelect',
+          typeName: 'intoType'
+        },
+        {
+          code: 'cusName',
+        },
+        {
+          code: 'cusPhone',
+        },
+        {
+          code: 'addressFull',
+        },
+        {
+          code: 'supName',
+        },
+        {
+          code: 'staffName',
+        },
+        {
+          code: 'orgName',
+        },
+        {
+          code: 'flgValid',
+          title: mixins.$t('flgValid'),
+          dataType: 'checkbox'
+        },
+      ]
+    } else {
+      pullMenuList = [
+        {
+          code: 'intoType',
+          pullType: 'mSelect',
+          typeName: 'intoTypeSt'
+        },
+        {
+          code: 'cusName',
+        },
+        {
+          code: 'cusPhone',
+        },
+        {
+          code: 'addressFull',
+        },
+        {
+          code: 'supName',
+        },
+        {
+          code: 'staffName',
+        },
+        {
+          code: 'orgName',
+        },
+        {
+          code: 'flgValid',
+          title: mixins.$t('flgValid'),
+          dataType: 'checkbox'
+        },
+      ]
     }
+    this.setData({
+      pullMenuList,
+    })
   },
 
 })

+ 85 - 52
package-sales/pages/sales-outbound/add/add.js

@@ -10,7 +10,7 @@ Page({
    */
   data: {
     // 路由
-    isDetailFlag:false,
+    isDetailFlag: false,
     routeObjName: 'outbound',
     table: Constants.tables.order,
     orderService: app.globalData['orderService'],
@@ -32,7 +32,6 @@ Page({
         chooseGoodsItemFlag: true,
         chooseInventoryFlag: true,
         chooseCoordinationFlag: true,
-
         itemAmt: '',
         displayNum: 2,
         controls: [{
@@ -132,12 +131,27 @@ Page({
           title: mixins.$t("amountCollected")
         }
       ],
- 
+
       other: [
         // { code: 'contractNo', type: 'textarea', title: mixins.$t("contractNumber"), readonly: false },
-        { code: 'outDate', type: 'date', required: false, title: mixins.$t("delivery_Time"), required: true },
-        { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: false },
-        { code: 'file', type: 'uploader', title: mixins.$t("uploader") } 
+        {
+          code: 'outDate',
+          type: 'date',
+          required: false,
+          title: mixins.$t("delivery_Time"),
+          required: true
+        },
+        {
+          code: 'remarks',
+          type: 'textarea',
+          title: mixins.$t("remarks"),
+          readonly: false
+        },
+        {
+          code: 'file',
+          type: 'uploader',
+          title: mixins.$t("uploader")
+        }
       ]
     },
     //按钮
@@ -174,7 +188,7 @@ Page({
         type: 'packageBox',
         title: mixins.$t("packageBox"),
       },
- 
+
       {
         code: 'priceOut',
         type: 'number',
@@ -422,10 +436,7 @@ Page({
               item.outingQty = item.canOutingQty
               item.outingAmt = Number(item.outingQty * item.priceOut)
             }
-            // if (this.data.formMode == 'detail' && Service == 'saleOutBoundService') {
-            //   item.outingQty = item.outQty
-            //   item.outingAmt = Number(item.outingQty * item.priceOut)
-            // }
+
             //出库中 办理详情页
             if (this.data.formMode == 'other' && Service == 'saleOutBoundService') {
               item.outingQty = item.outQty
@@ -440,18 +451,7 @@ Page({
               item.packageBox = item['outingBox'] + item.subUnitName + item['outingPiece'] + item.unitName
             }
             let btnFormData = JSON.parse(this.data.btnFormData)
-            //销售订单、销售出库、采购退货-自动出库或者办理时要读取系统参数【欠货开单】开启就不判断库存,调取后台自动生成对应入库单
-            // if (btnFormData.flag && this.data.flgBackStockInvoicingSetting) {} else {
-            //   item.outingQty_max = item.canOutingQty ? item.canOutingQty : item.invQty //可出库最大值
-            // }
-            // if (item['outingQty_max'] && item['outingQty_max'] < item['outingQty']) { 
-            //   console.log("2222");
-            //   item['outingQty'] = item['outingQty_max']
-            //   item['box'] = parseInt(item.outingQty / item.packBox)
-            //   item['piece'] = Number(item.outingQty % item.packBox)
-            //   item.sumPrice = item['outingQty'] * item.priceOut
-            //   item.packageBox = item['box'] + item.subUnitName + item['piece'] + item.unitName
-            // }
+
             item.outingQty_min = 1 //可出库最小值
             if (item.skuId && item.whId) {
               list.push({
@@ -460,7 +460,7 @@ Page({
                 whId: item.whId
               })
             }
-
+            item.noshowtitps = (item.skuId == null) ? true : false //是否显示 有货 无货  没有skuId  就是外协商品 
           })
           //处理按钮
           if (res.data.data.data && res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus")) {
@@ -527,13 +527,20 @@ Page({
         formData = this.setStaffOrg(formData)
         //设置选商品不可用
         let cardList = this.data.cardList
-        cardList[2].chooseGoodsFlag = false
+        cardList.forEach(element => {
+          if (element.name == 'items') {
+            element.chooseGoodsFlag = false
+          }
+        });
         this.calculateAmount(formData)
         this.setData({
-          cardList: cardList,
-          formData: JSON.stringify(formData)
-        })
-
+          cardList: cardList, 
+        }) 
+        setTimeout(() => {
+          // 刷新商品明细 显示 查看更多
+          let card = this.data.cardList.filter(it => it.name == 'items');
+          this.selectComponent('#' + this.data.formName).handleContentObj(card[0])
+       }, 2000)
       }
     });
   },
@@ -624,15 +631,17 @@ Page({
       addressGcj02: data.addressGcj02,
       addressName: data.addressName,
     }
-    cardList[1].sumAmount = data.sumAmount
-    cardList[1].sumStandard = data.sumStandard
-    cardList[1].sumQuantity = data.sumQuantity
-    cardList[1].saleDiscount = data.saleDiscount
-
+    cardList.forEach(element => {
+      if (element.name == 'items') {
+        element.sumAmount = data.sumAmount
+        element.sumStandard = data.sumStandard
+        element.sumQuantity = data.sumQuantity
+        element.saleDiscount = data.saleDiscount
+      }
+    })
     this.setData({
       cardList: cardList,
       formData: JSON.stringify(data),
-      isDetailFlag:true,
     })
     if (this.data.formMode == 'edit') { //编辑  办理页
       //处理商品
@@ -661,6 +670,8 @@ Page({
           nonStdCode: res.nonStdCode,
           whId: res.whId
         })
+      } else {
+        res.noshowtitps = true
       }
       res.sumPrice = res.priceInto * res.outingQty
     })
@@ -944,17 +955,17 @@ Page({
       //标价合计 =  商品标价 x  商品数量
       item.outingAmt = item.outingQty * item.priceOut
       sumAmount += item.outingQty * item.priceOut
-      sumQuantity +=  Number(item.outingQty) //数量
+      sumQuantity += Number(item.outingQty) //数量
       item.priceDiscount = Number((item.priceOut / item.priceStandard) * 100).toFixed(2) //售价折扣
       sumStandard += item.priceStandard * item.outingQty
-      
+
       if (item.flgSubUnit && item.subUnitName) {
         item.box = item.outingBox
         item.piece = item.outingPiece
         item.calculationFormula = item.packBox + item.unitName + '= 1' + item.subUnitName
         item.packageBox = item['box'] + item.subUnitName + item['piece'] + item.unitName
       }
-   
+
     })
 
     formData.sumAmount = sumAmount
@@ -969,14 +980,14 @@ Page({
     let contentSaveList = this.data.contentSaveList
     console.log(' formData.sumAmount', formData.sumAmount)
     cardList.forEach(element => {
-      if(element.name =="items"){
+      if (element.name == "items") {
         element.sumAmount = formData.sumAmount
         element.sumQuantity = formData.sumQuantity
         element.sumStandard = formData.sumStandard
         element.saleDiscount = formData.saleDiscount
       }
     });
-   
+
     //详情 办理
     if (this.data.formMode == Constants.formMode.add) {
       if (contentSaveList.length == 1) {
@@ -986,7 +997,7 @@ Page({
       }
     } else {
       contentSaveList[0].content = formData.sumAmount
-    } 
+    }
     this.setData({
       cardList: cardList,
       contentSaveList: contentSaveList,
@@ -1148,11 +1159,26 @@ Page({
         readonly: true,
       }],
 
- 
-      contentObj.other = [ 
-        { code: 'outDate', type: 'str', readonly: true, required: false, title: mixins.$t('delivery_Time') },
-        { code: 'remarks', type: 'str', readonly: true, required: false, title: mixins.$t('remarks') },
-        { code: 'file', type: 'uploader', title: mixins.$t("uploader") } 
+
+      contentObj.other = [{
+          code: 'outDate',
+          type: 'str',
+          readonly: true,
+          required: false,
+          title: mixins.$t('delivery_Time')
+        },
+        {
+          code: 'remarks',
+          type: 'str',
+          readonly: true,
+          required: false,
+          title: mixins.$t('remarks')
+        },
+        {
+          code: 'file',
+          type: 'uploader',
+          title: mixins.$t("uploader")
+        }
       ]
 
     cardList = [{
@@ -1213,7 +1239,7 @@ Page({
         },
 
         {
-          code: 'whName',
+          code: 'whId',
           title: mixins.$t("warehouseId"),
           type: 'str',
           readonly: true,
@@ -1272,12 +1298,13 @@ Page({
         console.log('eventChannel', data)
         if (data && data.goodsList && data.goodsList.length > 0) {
           formData = JSON.parse(that.data.formData)
-          console.log('formData1',formData);
+          console.log('formData1', formData);
           formData.goodsList = data.goodsList
-          formData.goodsList.forEach(element => {
+          formData.goodsList.forEach((element, index) => {
+            element.itemIndex = index
             element.outingQty = element.itemQty
             element.priceOut = element.priceSale
-          }); 
+          });
           that.setData({
             formData: JSON.stringify(formData)
           })
@@ -1302,7 +1329,7 @@ Page({
       this.setStdAndPro()
       //处理默认值  业务员业务部门
       formData = this.setStaffOrg(formData)
-      console.log('formData3',formData);
+      console.log('formData3', formData);
       // 设置送货日期 当前日期 加一天
       var currentDate = new Date();
       currentDate.setDate(currentDate.getDate() + 7);
@@ -1317,7 +1344,12 @@ Page({
 
       //设置只读
       this.setFormMain()
+      this.setFlagView()
       this.getItemDetal(this.data.id, 'saleOutBoundService', 'getOutboundForUpdate')
+      this.setData({
+        isDetailFlag: true,
+      })
+
     } else if (this.data.formMode == Constants.formMode.detailEdit) {
       //编辑
       wx.setNavigationBarTitle({
@@ -1338,10 +1370,11 @@ Page({
 
       this.getItemDetal(this.data.id, 'saleOutBoundService', 'getOutboundForUpdate')
     }
-    console.log('formData2',formData);
+
     this.setData({
       formData: JSON.stringify(formData)
     })
+
   },
   setStdAndPro() {
     let contentObj = this.data.contentObj

+ 1 - 2
pages/shopping/shopping.js

@@ -309,8 +309,7 @@ Page({
    * @author : 于继渤
    */
   getGoodsCategoryNoPage() {
-    return this.excute(this.data.commonService, this.data.commonService.getGoodsCategoryNoPage, {}).then(res => {
-      console.log('goodsCategoryListBy', res.data.data)
+    return this.excute(this.data.commonService, this.data.commonService.getGoodsCategoryNoPage, {}).then(res => { 
       this.setData({
         typeList: this.data.typeList.concat(res.data.data)
       })