Pārlūkot izejas kodu

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

zhoux 1 gadu atpakaļ
vecāks
revīzija
7b2be6830e
35 mainītis faili ar 1615 papildinājumiem un 927 dzēšanām
  1. 1 0
      api/pages/mst/customer.js
  2. 18 3
      components/dkbase/dk-form-bill/dk-form-bill.js
  3. 1 1
      components/dkbase/dk-form-bill/dk-form-bill.wxml
  4. 9 0
      components/dkbase/dk-form/dk-form.js
  5. 1 1
      components/dkbase/dk-form/dk-form.wxml
  6. 2 2
      components/dkbase/dk-popup/dk-popup.wxml
  7. 4 1
      i18n/zh-CN.js
  8. 3 3
      package-base-select/pages/select-collection_confirm/select-collection_confirm.js
  9. 45 15
      package-base-select/pages/select-data/select-data.js
  10. 289 253
      package-base-select/pages/select-goods/select-goods.js
  11. 1 1
      package-base-select/pages/select-goods/select-goods.wxml
  12. 47 9
      package-basic-data/pages/customer-list/add/add.js
  13. 509 192
      package-basic-data/pages/product-file/add/add.js
  14. 6 2
      package-basic-data/pages/product-file/add/add.wxml
  15. 18 1
      package-inventory/pages/inventory-adjustment/add/add.js
  16. 45 28
      package-inventory/pages/inventory-adjustment/detail/detail.js
  17. 6 0
      package-inventory/pages/inventory-check/add/add.js
  18. 6 0
      package-inventory/pages/inventory-check/detail/detail.js
  19. 83 74
      package-inventory/pages/inventory-freeze/add/add.js
  20. 7 0
      package-inventory/pages/other-outbound/other-outbound.js
  21. 7 0
      package-inventory/pages/other-warehousing/other-warehousing.js
  22. 6 0
      package-inventory/pages/outbound-processing/detail/detail.js
  23. 6 0
      package-inventory/pages/warehousing-processing/detail/detail.js
  24. 181 175
      package-purchase/pages/purchase-order/add/add.js
  25. 61 55
      package-purchase/pages/purchase-order/purchase-order-detail/purchase-order-detail.js
  26. 111 105
      package-purchase/pages/purchase-receipt/add/add.js
  27. 6 0
      package-purchase/pages/purchase-receipt/detail/detail.js
  28. 6 0
      package-sales/pages/order-billing/add/add.js
  29. 20 5
      package-sales/pages/order-return/add/add.js
  30. 9 1
      package-sales/pages/sales-outbound/add/add.js
  31. 74 0
      pages/home-page/home-page.js
  32. 4 0
      pages/home-page/home-page.wxml
  33. 10 0
      pages/home-page/home-page.wxss
  34. 6 0
      pages/shopping/shopping.js
  35. 7 0
      utils/Constants.js

+ 1 - 0
api/pages/mst/customer.js

@@ -49,6 +49,7 @@ module.exports = {
       toReceipt:{ key: 'toReceipt', url: '/package-accounts-manage/pages/receipt/add/add', formMode: 'add',formType:'add', idKey: 'cusId' } ,//跳转收款单新建
       toReceiptDetail:{ key: 'toReceiptDetail', url: '/package-accounts-manage/pages/receipt/detail/detail', formMode: 'edit',formType:'edit', idKey: 'cusId' } ,//跳转收款单新建
       chooseInitialPaymentType: { key: 'chooseInitialPaymentType', url: '/package-base-select/pages/select-data/select-data',type:'kindData', kindType:'初始款项' ,  },
+      chooseMoneyAccount: { key: 'chooseMoneyAccount', url: '/package-base-select/pages/select-data/select-data',type:'moneyAccount',  },
     }
   }
 };

+ 18 - 3
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -521,6 +521,7 @@ Component({
           popContent_sku = popContent_
         } 
       }
+      console.log("popContent_sku",popContent_sku);
       this.setData({
         popContent_sku:popContent_sku,
         popupTopObj_sku:popupTopObj_sku,
@@ -1161,6 +1162,19 @@ Component({
         item: e.detail.item
       })
     },
+       /**
+   * @desc   : 修改str 文本变化
+   * @author : 王英杰
+   * @date   : 2024/2/2 11:46
+   */
+  changeDetailField(e){
+    console.log("changeDetailField",e);
+    let dataItem = JSON.parse(this.data.dataItem)
+    dataItem[e.detail.key]= e.detail.name
+    this.setData({
+      dataItem: JSON.stringify(dataItem)
+    })
+  },
     /**
      * @desc   : 修改输入框的值
      * @author : 周兴
@@ -1178,7 +1192,7 @@ Component({
       }
       let contentObj = this.data.contentObj;
       // 输入值后清空校验提示信息
-      if (item.errMsg && e.detail) {
+      if (item && item.errMsg && e.detail) {
         contentObj[ds.card][ds.index].errMsg = undefined;
       }
       this.setData({
@@ -2058,8 +2072,9 @@ Component({
           item.outingQty = item.outingQty
           item.outAmt = item.priceOut * item.itemQty
           // item.outingAmt = item.priceOut * item.itemQty
-          item['outingQty_min'] = item.itemQty * -1
-          item['outingQty_max'] = Number(-1)
+          // item['outingQty_min'] = item.itemQty * -1
+          console.log('3333333333');
+          item['outingQty_max'] = Number(0)
           delete item['priceLimited']
           delete item['pricePurchase']
           delete item['priceWholesale']

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

@@ -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" stepperDecimal ="decimalPlaces"   type="{{popType}}" routeObjName="{{routeObjName}}"   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 id="dkPopup" stepperDecimal ="decimalPlaces"   type="{{popType}}" routeObjName="{{routeObjName}}"   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:changeField= "changeDetailField" 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"stepperDecimal ="decimalPlaces"></dk-popup>

+ 9 - 0
components/dkbase/dk-form/dk-form.js

@@ -142,6 +142,15 @@ Component({
         util.showToast(item.tip);
       }
     },
+     /**
+     * @desc   : 外漏str的点击事件
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    openStr(e){ 
+      let item = e.currentTarget.dataset;
+        this.triggerEvent("openStr", {  code: item.key,})
+    },
     /**
      * @desc   : 打开下拉
      * @author : 周兴

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

@@ -4,7 +4,7 @@
   <view class="dk-card-class" wx:for="{{cardList}}" wx:for-item="card" data-item="{{card}}"> 
     <view wx:for="{{contentObj[card]}}" wx:for-item="item" data-item="{{item}}" wx:key="index">
       <!--文本框-->
-      <van-field wx:if="{{item.type=='str' && !item.hide}}" required="{{item.required?true:false }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" clearable readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:50}}" right-icon="{{item.rightIcon}}" bind:change="changeField" bind:blur="blurField" bind:clear="clearField" errorMessage="{{item.errMsg}}">
+      <van-field wx:if="{{item.type=='str' && !item.hide}}" required="{{item.required?true:false }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" clearable readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:50}}" right-icon="{{item.rightIcon}}" bind:change="changeField" bind:blur="blurField" bind:clear="clearField" catchtap="openStr" errorMessage="{{item.errMsg}}">
         <van-icon wx:if="{{item.tip}}" slot="label-icon" name="question-o" data-item="{{item}}" catchtap="showTip" />
       </van-field>
       <!--单选下拉-->

+ 2 - 2
components/dkbase/dk-popup/dk-popup.wxml

@@ -68,8 +68,8 @@
       </van-field>
       <!--数量step-->  
       <van-cell wx:if="{{item.type=='step'}}" border="{{ false }}" title-class="cell_title"  title="{{item.title?item.title:'数量'}}" required="{{item.required?true:false }}">
-        <van-stepper wx:if="{{item.code == 'box'}}"input-width="50px" value="{{form[item.code]}}" integer="{{true}}"  data-index="{{index}}" data-item="{{item}}" data-key="{{item.code}}" min="{{form[item.code + '_min']?form[item.code + '_min']:( item.min?item.min:0)}}" max="{{form[item.code + '_max']?form[item.code + '_max']:( item.max?item.max:999999999)}}" bind:change="changeStep" disabled="{{!!readonly}}" />
-        <van-stepper wx:else value="{{form[item.code]}}" input-width="50px" integer="{{ form[stepperDecimal]==0}}"decimal-length="{{ form[stepperDecimal] }}" data-index="{{index}}" data-item="{{item}}" data-key="{{item.code}}" min="{{form[item.code + '_min']?form[item.code + '_min']:( item.min?item.min:0)}}" max="{{form[item.code + '_max']?form[item.code + '_max']:( item.max?item.max:999999999)}}" bind:change="changeStep" disabled="{{!!readonly}}" />
+        <van-stepper wx:if="{{item.code == 'box'}}"input-width="50px" value="{{form[item.code]}}" integer="{{true}}"  data-index="{{index}}" data-item="{{item}}" data-key="{{item.code}}" min="{{form[item.code + '_min']?form[item.code + '_min']:( item.min?item.min:-9999999999)}}" max="{{form[item.code + '_max']?form[item.code + '_max']:( item.max?item.max:999999999)}}" bind:change="changeStep" disabled="{{!!readonly}}" />
+        <van-stepper wx:else value="{{form[item.code]}}" input-width="50px" integer="{{ form[stepperDecimal]==0}}"decimal-length="{{ form[stepperDecimal] }}" data-index="{{index}}" data-item="{{item}}" data-key="{{item.code}}" min="{{form[item.code + '_min']?form[item.code + '_min']:( item.min?item.min:-99999999999)}}" max="{{form[item.code + '_max']?form[item.code + '_max']:( item.max?item.max:999999999)}}" bind:change="changeStep" disabled="{{!!readonly}}" />
       </van-cell>
       <!--数字类-->
       <dk-number-input wx:if="{{item.type=='number'}}" sign="{{(item.sign || item.sign == '')?item.sign:'¥'}}" digits="{{(item.digits || item.digits == 0)?item.digits:2}}" fontSize="14" left="30rpx" data-key="{{item.code}}" data-item="{{item}}" max="{{(item.max || item.max == '')?item.max:10000000}}" min="{{(item.min || item.min == '')?item.min:-10000000}}"  data-index="{{index}}" center="{{'right'}}" readonly="{{!!readonly || !!item.readonly}}" 

+ 4 - 1
i18n/zh-CN.js

@@ -295,7 +295,7 @@ const basicData = {
   saleStaff: '销售人员',
   initialPayment: '初始款项',
   saleOrg: '销售部门',
-  initialDebtOwed: '初欠款',
+  initialDebtOwed: '初欠款',
   incomeCategory: '收入类别',
   expenditureCategory: '支出类别',
   reasonStorage: '入库原因',
@@ -589,6 +589,7 @@ const fund = {
   commodityPicture: "商品图片",
   defaultAccount: "默认账户",
   balanceDate: "余额日期",
+  moneyAccount: "资金账户",
   newFundAccount: "新建资金账户",
   editFundAccount: "编辑资金账户",
   negativeBalance: "余额负数",
@@ -633,6 +634,8 @@ const pur = {
   addPurInbound: "新建采购入库",
   noGoodsList: '无可退货商品,请入库后再进行退货操作',
   createTime: '创建日期',
+  refundSave:  "退款并保存",
+  paySave:  "收款并保存",
 }
 const otherAccounts = {
   amountReceivable: "应收金额",

+ 3 - 3
package-base-select/pages/select-collection_confirm/select-collection_confirm.js

@@ -279,8 +279,7 @@ Page({
       })
 
     } else if (this.data.formType == 3) {
-      //客户收款保存参数
-      params.sumAmtRec = Number(params.sumAmtRec)
+    
       if (form.editFlag) {
         tableData.forEach(res => {
           res.amtRec = res.sumAmount
@@ -297,7 +296,8 @@ Page({
           })
         })
       }
-
+     //客户收款保存参数
+      params.sumAmtRec = Number(itemList.sum('amtRec')) 
       params.accDate = params.accDate ? params.accDate : utils.formatDayTime(new Date())
       // 240521 最佳客户信息
       params.cusName = form.objInfo.cusName

+ 45 - 15
package-base-select/pages/select-data/select-data.js

@@ -52,9 +52,9 @@ Page({
     // 是否有默认值
     defaultFlag: false,
     // 状态
-    status:null,
+    status: null,
     // 控制是否显示状态
-    statusFlag:false,
+    statusFlag: false,
     // 确定按钮
     buttonList: [{
       name: 'confirm',
@@ -97,7 +97,7 @@ Page({
    * @date : 2024/3/25 15:16
    */
   chooseData(e) {
-    console.log('eerere',e);
+    console.log('eerere', e);
     let list = e.detail.list;
     let item = e.detail.item;
     let valueKey = this.data.valueKey;
@@ -229,7 +229,6 @@ Page({
           name: item.roleName,
         }
         break;
-
       //渠道
       case Constants.chooseType.saleChannel:
         data = {
@@ -238,6 +237,14 @@ Page({
           code: item.channelCode
         }
         break;
+      //资金账户
+      case Constants.chooseType.moneyAccount:
+        data = {
+          id: item.macId,
+          name: item.macName,
+          code: item.macCode
+        }
+        break;
       //客户来源
       case Constants.chooseType.cusFrom:
         data = {
@@ -637,6 +644,29 @@ Page({
           placeholder: ['sourceName']
         })
         break;
+
+      // 资金账户
+      case Constants.chooseType.moneyAccount:
+        title = "资金账户"
+        this.setData({
+          routeObjName: 'common',
+          pageFlag: false,
+          method: 'getMac',
+          title: 'macName',
+          contentList: [{
+            name: 'macCode',
+            title: '账户编码'
+          },
+          {
+            name: 'macName',
+            title: '账户名称'
+          },
+
+          ],
+          placeholder: ['moneyAccount']
+        })
+        break;
+
       //销售渠道
       case Constants.chooseType.saleChannel:
         title = "销售渠道"
@@ -834,13 +864,13 @@ Page({
         })
         break;
       // 计量单位 刘尧 2024.05.29
-      case Constants.chooseType.unit: 
+      case Constants.chooseType.unit:
         title = "单位"
         this.setData({
           routeObjName: 'common',
           routeObjNamePop: 'unit',
           method: 'getUnitNoPage',
-          status:'decimalPlacesStr',
+          status: 'decimalPlacesStr',
           chooseFlag: route.chooseFlag,
           repeatFlag: route.repeatFlag,
           statusFlag: true,
@@ -851,7 +881,7 @@ Page({
           simpleFlag: true,
           placeholder: ['unitName']
         })
-      break;
+        break;
       // 数据字典
       case Constants.chooseType.dictionary:
         title = "数据字典"
@@ -977,20 +1007,20 @@ Page({
     this.searchData();
   },
 
-    /** 
-   * @desc : 对获取到的数据进行处理
-   * @date : 2024年5月29日
-   * @author : 刘尧
-   */
-  handleSearchData(tableData){
+  /** 
+ * @desc : 对获取到的数据进行处理
+ * @date : 2024年5月29日
+ * @author : 刘尧
+ */
+  handleSearchData(tableData) {
     tableData.forEach(item => {
       // 判断数据中是否存在计量单位的小数位数字段
-      if(item && (item.decimalPlaces || item.decimalPlaces === 0)){
+      if (item && (item.decimalPlaces || item.decimalPlaces === 0)) {
         item.decimalPlacesStr = '小数:' + item.decimalPlaces
       }
     })
     this.setData({
-        tableData: tableData
+      tableData: tableData
     })
   }
 })

+ 289 - 253
package-base-select/pages/select-goods/select-goods.js

@@ -20,13 +20,13 @@ Page({
     gradeCode: app.globalData.company.gradeCode,
     firstFlag: true,
     orderBy: [{
-        "text": "可售量升序",
-        "value": 1
-      },
-      {
-        "text": "可售量降序",
-        "value": 2
-      }
+      "text": "可售量升序",
+      "value": 1
+    },
+    {
+      "text": "可售量降序",
+      "value": 2
+    }
     ],
     routeObjName: 'goodsSku',
     dataItem: null,
@@ -39,30 +39,36 @@ Page({
     brandId: null,
     active: 0,
     popContent: [{
-        code: 'itemQty',
-        type: 'step',
-        title: '数量',
-        required: true
-      },
-      {
-        code: 'whId',
-        name: 'whName',
-        title: '仓库',
-        type: 'choose',
-        urlKey: 'chooseWh'
-      },
-      {
-        code: 'skuSpec',
-        title: '规格',
-        type: 'str',
-        readonly: true,
-        dropType: ''
-      },
-      {
-        code: 'nonStdCode',
-        title: '色号',
-        type: 'str',
-      },
+      code: 'itemQty',
+      type: 'step',
+      title: '数量',
+      required: true
+    },
+    {
+      code: 'whId',
+      name: 'whName',
+      title: '仓库',
+      type: 'choose',
+      urlKey: 'chooseWh'
+    },
+    {
+      code: 'skuSpec',
+      title: '规格',
+      type: 'str',
+      readonly: true,
+      dropType: ''
+    },
+    {
+      code: 'brandName',
+      title: mixins.$t('brandName'),
+      type: 'str',
+      readonly: true,
+    },
+    {
+      code: 'nonStdCode',
+      title: '色号',
+      type: 'str',
+    },
     ],
     popContentBox: [],
     popupTopObj: [{
@@ -126,7 +132,7 @@ Page({
       }]
       this.setData({
         buttonList: buttonList,
-        contentList: [ 
+        contentList: [
           {
             code: 'amount',
             content: 0,
@@ -145,54 +151,60 @@ Page({
     if (this.data.item == Constants.billType.sale) {
       this.setData({
         popContent: [{
-            code: 'itemQty',
-            type: 'step',
-            title: mixins.$t("count"),
-            required: true
-          },
-          {
-            code: 'packageBox',
-            type: 'packageBox',
-            title: mixins.$t("packageBox"),
-            readonly: true
-          },
+          code: 'itemQty',
+          type: 'step',
+          title: mixins.$t("count"),
+          required: true
+        },
+        {
+          code: 'packageBox',
+          type: 'packageBox',
+          title: mixins.$t("packageBox"),
+          readonly: true
+        },
 
-          {
-            code: 'priceSale',
-            type: 'number',
-            title: mixins.$t("priceSale"),
-            required: true,
-            center: 'right'
-          },
-          // {
-          //   code: 'whId',
-          //   name: 'whName',
-          //   title: mixins.$t("warehouseId"),
-          //   type: 'choose',
-          //   urlKey: 'openingInventory',
-          // },
-          {
-            code: 'whId',
-            name: 'whName',
-            title: mixins.$t("warehouseId"),
-            type: 'choose',
-            urlKey: 'chooseWh'
-          },
-          {
-            code: 'nonStdCode',
-            title: mixins.$t("goodsBatch"),
-            type: 'str',
-          },
-          {
-            code: 'flgGift',
-            title: mixins.$t("flgGift"),
-            type: 'checkbox',
-          },
-          {
-            code: 'usePlace',
-            title: mixins.$t("usePlace"),
-            type: 'str',
-          },
+        {
+          code: 'priceSale',
+          type: 'number',
+          title: mixins.$t("priceSale"),
+          required: true,
+          center: 'right'
+        },
+        // {
+        //   code: 'whId',
+        //   name: 'whName',
+        //   title: mixins.$t("warehouseId"),
+        //   type: 'choose',
+        //   urlKey: 'openingInventory',
+        // },
+        {
+          code: 'whId',
+          name: 'whName',
+          title: mixins.$t("warehouseId"),
+          type: 'choose',
+          urlKey: 'chooseWh'
+        },
+        {
+          code: 'brandName',
+          title: mixins.$t('brandName'),
+          type: 'str',
+          readonly: true,
+        },
+        {
+          code: 'nonStdCode',
+          title: mixins.$t("goodsBatch"),
+          type: 'str',
+        },
+        {
+          code: 'flgGift',
+          title: mixins.$t("flgGift"),
+          type: 'checkbox',
+        },
+        {
+          code: 'usePlace',
+          title: mixins.$t("usePlace"),
+          type: 'str',
+        },
         ]
       })
     }
@@ -200,42 +212,48 @@ Page({
     if (this.data.item == Constants.billType.inventory) {
       this.setData({
         popContent: [{
-            code: 'itemQty',
-            type: 'step',
-            title: mixins.$t("count"),
-            required: true
-          },
-          {
-            code: 'packageBox',
-            type: 'packageBox',
-            title: mixins.$t("packageBox"),
-          },
-          {
-            code: 'priceOut',
-            type: 'number',
-            title: mixins.$t("priceSale"),
-            required: true,
-            readonly: false
-          },
+          code: 'itemQty',
+          type: 'step',
+          title: mixins.$t("count"),
+          required: true
+        },
+        {
+          code: 'packageBox',
+          type: 'packageBox',
+          title: mixins.$t("packageBox"),
+        },
+        {
+          code: 'priceOut',
+          type: 'number',
+          title: mixins.$t("priceSale"),
+          required: true,
+          readonly: false
+        },
 
-          {
-            code: 'whName',
-            readonly: true,
-            title: mixins.$t("warehouseId"),
-            type: 'str'
-          },
-          {
-            code: 'nonStdCode',
-            readonly: true,
-            title: mixins.$t("goodsBatch"),
-            type: 'str',
-            tip: mixins.$t('tipPop'),
-          },
-          {
-            code: 'usePlace',
-            title: mixins.$t("usePlace"),
-            type: 'str',
-          },
+        {
+          code: 'whName',
+          readonly: true,
+          title: mixins.$t("warehouseId"),
+          type: 'str'
+        },
+        {
+          code: 'brandName',
+          title: mixins.$t('brandName'),
+          type: 'str',
+          readonly: true,
+        },
+        {
+          code: 'nonStdCode',
+          readonly: true,
+          title: mixins.$t("goodsBatch"),
+          type: 'str',
+          tip: mixins.$t('tipPop'),
+        },
+        {
+          code: 'usePlace',
+          title: mixins.$t("usePlace"),
+          type: 'str',
+        },
         ]
       })
     }
@@ -245,42 +263,48 @@ Page({
       this.setData({
 
         popContent: [{
-            code: 'itemQty',
-            type: 'step',
-            title: mixins.$t("count"),
-            required: true
-          },
-          {
-            code: 'packageBox',
-            type: 'packageBox',
-            title: mixins.$t("packageBox"),
-          },
+          code: 'itemQty',
+          type: 'step',
+          title: mixins.$t("count"),
+          required: true
+        },
+        {
+          code: 'packageBox',
+          type: 'packageBox',
+          title: mixins.$t("packageBox"),
+        },
 
-          {
-            code: 'priceOut',
-            type: 'number',
-            title: mixins.$t("priceSale"),
-            required: true,
-            readonly: false,
-            center: 'right'
-          },
-          {
-            code: 'whId',
-            name: 'whName',
-            title: mixins.$t("warehouseId"),
-            type: 'choose',
-            urlKey: 'chooseWh'
-          },
-          {
-            code: 'nonStdCode',
-            title: mixins.$t("goodsBatch"),
-            type: 'str',
-          },
-          {
-            code: 'usePlace',
-            title: mixins.$t("usePlace"),
-            type: 'str',
-          },
+        {
+          code: 'priceOut',
+          type: 'number',
+          title: mixins.$t("priceSale"),
+          required: true,
+          readonly: false,
+          center: 'right'
+        },
+        {
+          code: 'whId',
+          name: 'whName',
+          title: mixins.$t("warehouseId"),
+          type: 'choose',
+          urlKey: 'chooseWh'
+        },
+        {
+          code: 'brandName',
+          title: mixins.$t('brandName'),
+          type: 'str',
+          readonly: true,
+        },
+        {
+          code: 'nonStdCode',
+          title: mixins.$t("goodsBatch"),
+          type: 'str',
+        },
+        {
+          code: 'usePlace',
+          title: mixins.$t("usePlace"),
+          type: 'str',
+        },
 
         ]
       })
@@ -288,7 +312,7 @@ Page({
     //销售退货
     if (this.data.item == Constants.billType.saleOutReturn) {
       this.setData({
-        contentList: [ 
+        contentList: [
           {
             code: 'amount',
             content: 0,
@@ -302,37 +326,43 @@ Page({
           }
         ],
         popContent: [{
-            code: 'itemQty',
-            type: 'step',
-            title: mixins.$t("count"),
-            required: true
-          },
-          {
-            code: 'packageBox',
-            type: 'packageBox',
-            title: mixins.$t("packageBox"),
-          },
-          {
-            code: 'priceOut',
-            type: 'number',
-            title: mixins.$t("priceSale"),
-            required: true,
-            readonly: false,
-            center: 'right'
-          },
-          {
-            code: 'whId',
-            name: 'whName',
-            choosePopupType: '',
-            title: mixins.$t("warehouseId"),
-            type: 'choose',
-            urlKey: 'openingInventory',
-          },
-          {
-            code: 'nonStdCode',
-            title: mixins.$t("goodsBatch"),
-            type: 'str',
-          },
+          code: 'itemQty',
+          type: 'step',
+          title: mixins.$t("count"),
+          required: true
+        },
+        {
+          code: 'packageBox',
+          type: 'packageBox',
+          title: mixins.$t("packageBox"),
+        },
+        {
+          code: 'priceOut',
+          type: 'number',
+          title: mixins.$t("priceSale"),
+          required: true,
+          readonly: false,
+          center: 'right'
+        },
+        {
+          code: 'whId',
+          name: 'whName',
+          choosePopupType: '',
+          title: mixins.$t("warehouseId"),
+          type: 'choose',
+          urlKey: 'openingInventory',
+        },
+        {
+          code: 'brandName',
+          title: mixins.$t('brandName'),
+          type: 'str',
+          readonly: true,
+        },
+        {
+          code: 'nonStdCode',
+          title: mixins.$t("goodsBatch"),
+          type: 'str',
+        },
         ]
       })
     }
@@ -340,37 +370,43 @@ Page({
     if (this.data.item == Constants.billType.purReturn) {
       this.setData({
         popContent: [{
-            code: 'itemQty',
-            type: 'step',
-            title: mixins.$t("count"),
-            required: true
-          },
-          {
-            code: 'packageBox',
-            type: 'packageBox',
-            title: mixins.$t("packageBox"),
-          },
-          {
-            code: 'priceStandard',
-            type: 'number',
-            title: mixins.$t("purReturnPrice"),
-            required: true,
-            readonly: true,
-            center: 'right'
-          },
-          {
-            code: 'whId',
-            name: 'whName',
-            choosePopupType: '',
-            title: mixins.$t("warehouseId"),
-            type: 'choose',
-            urlKey: 'selectInventorySku',
-          },
-          {
-            code: 'nonStdCode',
-            title: mixins.$t("goodsBatch"),
-            type: 'str',
-          },
+          code: 'itemQty',
+          type: 'step',
+          title: mixins.$t("count"),
+          required: true
+        },
+        {
+          code: 'packageBox',
+          type: 'packageBox',
+          title: mixins.$t("packageBox"),
+        },
+        {
+          code: 'priceStandard',
+          type: 'number',
+          title: mixins.$t("purReturnPrice"),
+          required: true,
+          readonly: true,
+          center: 'right'
+        },
+        {
+          code: 'whId',
+          name: 'whName',
+          choosePopupType: '',
+          title: mixins.$t("warehouseId"),
+          type: 'choose',
+          urlKey: 'selectInventorySku',
+        },
+        {
+          code: 'brandName',
+          title: mixins.$t('brandName'), 
+          type: 'str',
+          readonly:true,
+      },
+        {
+          code: 'nonStdCode',
+          title: mixins.$t("goodsBatch"),
+          type: 'str',
+        },
         ]
       })
     }
@@ -520,7 +556,7 @@ Page({
    */
   handleSearchData(tableData) {
     //设置默认仓库
-    if ( this.data.item !== Constants.billType.out && this.data.item !== Constants.billType.purReturn && this.data.item !== Constants.billType.inventory) {
+    if (this.data.item !== Constants.billType.out && this.data.item !== Constants.billType.purReturn && this.data.item !== Constants.billType.inventory) {
       tableData.forEach(res => {
         res.whId = app.globalData.user.defaultWhId
         res.whName = app.globalData.user.defaultWhName
@@ -633,7 +669,7 @@ Page({
    * @author : 于继渤
    */
   getGoodsCategoryNoPage() {
-    return this.excute(this.data.commonService, this.data.commonService.getGoodsCategoryNoPage, {}).then(res => { 
+    return this.excute(this.data.commonService, this.data.commonService.getGoodsCategoryNoPage, {}).then(res => {
       this.setData({
         typeList: this.data.typeList.concat(res.data.data)
       })
@@ -696,14 +732,14 @@ Page({
       this.data.item == Constants.billType.purReturn ||
       this.data.item == Constants.billType.saleOut) {
       item['box'] = parseInt(item.itemQty / item.packBox)
-      item['piece'] = parseFloat( Number(item.itemQty % item.packBox)).toFixed(item.decimalPlaces);  
+      item['piece'] = parseFloat(Number(item.itemQty % item.packBox)).toFixed(item.decimalPlaces);
       item.packageBox = item['box'] + item.subUnitName + item['piece'] + item.unitName
       if (this.data.item == Constants.billType.pur) { //采购订单 采购数量 
-        item.pricePur = item.pricePurchase?item.pricePurchase:0 //采购价
+        item.pricePur = item.pricePurchase ? item.pricePurchase : 0 //采购价
         item.sumPrice = item['itemQty'] * item.pricePur
       }
       if (this.data.item == Constants.billType.purInto) { //采购入库
-        item.priceInto = item.pricePurchase?item.pricePurchase:0 //采购价
+        item.priceInto = item.pricePurchase ? item.pricePurchase : 0 //采购价
         item.sumPrice = item['itemQty'] * item.priceInto
       }
       if (this.data.item == Constants.billType.saleOutReturn ||
@@ -712,17 +748,17 @@ Page({
         this.data.item == Constants.billType.inventory
       ) { //销售退货
         item = this.priceSystem(item, 'priceOut') //根据价格体系取值
-        item.priceOut = item.priceStandard?item.priceStandard:0 //标价
-          if( this.data.gradeCode == 'STD'){
-            item.priceOut = 0
-          }
+        item.priceOut = item.priceStandard ? item.priceStandard : 0 //标价
+        if (this.data.gradeCode == 'STD') {
+          item.priceOut = 0
+        }
         item.sumPrice = item.priceOut * item.itemQty
       }
       if (this.data.item == Constants.billType.purReturn) { //采购退货 
-        item.sumPrice = item.priceStandard? item.priceStandard * item.itemQty:0
+        item.sumPrice = item.priceStandard ? item.priceStandard * item.itemQty : 0
       }
     }
-   
+
     //选了辅助计量单位 正好 包装也有值 那么直接给出公式
     if (item.flgSubUnit && item.subUnitName) {
       item.calculationFormula = item.packBox + item.unitName + '= 1' + item.subUnitName
@@ -796,17 +832,17 @@ Page({
       this.data.item == Constants.billType.inventory) {
       this.setData({
         popContentBox: [{
-            code: 'box',
-            type: 'step',
-            title: dataItem.subUnitName,
-            required: true
-          },
-          {
-            code: 'piece',
-            type: 'step',
-            title: dataItem.unitName,
-            required: true
-          },
+          code: 'box',
+          type: 'step',
+          title: dataItem.subUnitName,
+          required: true
+        },
+        {
+          code: 'piece',
+          type: 'step',
+          title: dataItem.unitName,
+          required: true
+        },
         ],
 
       })
@@ -815,15 +851,15 @@ Page({
       showPopBox: true,
     })
   },
-    /**
-   * @desc   : 修改str 文本变化
-   * @author : 王英杰
-   * @date   : 2024/2/2 11:46
-   */
-  changeField(e){
-    console.log("changeField",e);
+  /**
+ * @desc   : 修改str 文本变化
+ * @author : 王英杰
+ * @date   : 2024/2/2 11:46
+ */
+  changeField(e) {
+    console.log("changeField", e);
     let dataItem = JSON.parse(this.data.dataItem)
-    dataItem[e.detail.key]= e.detail.name
+    dataItem[e.detail.key] = e.detail.name
     this.setData({
       dataItem: JSON.stringify(dataItem)
     })
@@ -895,7 +931,7 @@ Page({
       if (key == 'itemQty') {
         dataItem['itemQty'] = value
         dataItem['box'] = parseInt(value / dataItem.packBox)
-        dataItem['piece'] = parseFloat( Number(value % dataItem.packBox).toFixed(dataItem.decimalPlaces)); 
+        dataItem['piece'] = parseFloat(Number(value % dataItem.packBox).toFixed(dataItem.decimalPlaces));
         dataItem.packageBox = dataItem['box'] + dataItem.subUnitName + dataItem['piece'] + dataItem.unitName
         if (this.data.billType == Constants.billType.pur) { //采购订单 ,单价*数量,实时变化
           dataItem.sumPrice = dataItem['itemQty'] * dataItem.pricePur
@@ -960,7 +996,7 @@ Page({
       this.data.billType == Constants.billType.inventory
     ) {
       //数量等于 包乘以包装数 加上片数 
-      dataItem['itemQty'] = Number(dataItem['box'])  * Number(dataItem['packBox']) + Number(dataItem['piece'])
+      dataItem['itemQty'] = Number(dataItem['box']) * Number(dataItem['packBox']) + Number(dataItem['piece'])
       dataItem.packageBox = dataItem['box'] + dataItem.subUnitName + dataItem['piece'] + dataItem.unitName
       if (this.data.billType == Constants.billType.pur) { //采购订单  ,单价*数量,实时变化
         dataItem.sumPrice = dataItem['itemQty'] * dataItem.pricePur
@@ -978,7 +1014,7 @@ Page({
         dataItem.sumPrice = dataItem['itemQty'] * dataItem.priceStandard
       }
     }
-  
+
     this.setData({
       dataItem: JSON.stringify(dataItem)
     })
@@ -1023,7 +1059,7 @@ Page({
       Dialog.alert({
         title: '提示',
         message: '销售价格不能低于销售限价',
-      }).then(() => {})
+      }).then(() => { })
       return false
     }
     return true
@@ -1044,10 +1080,10 @@ Page({
       } else if (this.data.billType == 'sale') {
         sumAmt += (res.priceStandard * res.itemQty)
       }
-   
+
       sumQty += res.itemQty
-    })   
-    contentList[0].content =  choosedGoodsList.sum('sumPrice')
+    })
+    contentList[0].content = choosedGoodsList.sum('sumPrice')
     contentList[1].quantity = sumQty
     this.setData({
       contentList: contentList
@@ -1064,14 +1100,14 @@ Page({
   submit() {
     const eventChannel = this.getOpenerEventChannel();
     const choosedGoodsList = this.data.choosedGoodsList
-    const chooseRoute = this.data.chooseRoute  
+    const chooseRoute = this.data.chooseRoute
     let that = this
     if (chooseRoute) { //跳转到上一个页面传过来的url
       wx.navigateTo({
         url: chooseRoute,
         events: {
           // 回调后
-          bindData: function (data) {}
+          bindData: function (data) { }
         },
         success: function (res) {
           let data = {
@@ -1084,7 +1120,7 @@ Page({
           res.eventChannel.emit('params', data)
         }
       })
-    } else { 
+    } else {
       eventChannel.emit('bindData', {
         choosedGoodsList
       })
@@ -1141,7 +1177,7 @@ Page({
    * @author : 姜永辉
    */
   getGoodsBrandNoPage() {
-    return this.excute(this.data.commonService, this.data.commonService.getGoodsBrandNoPage, {flgValid:true}).then(res => {
+    return this.excute(this.data.commonService, this.data.commonService.getGoodsBrandNoPage, { flgValid: true }).then(res => {
       console.log('getGoodsBrandNoPage', res.data.data)
       this.setData({
         typeList: this.data.typeList.concat(res.data.data)

+ 1 - 1
package-base-select/pages/select-goods/select-goods.wxml

@@ -400,7 +400,7 @@
 
 
 <!--  采购入库 采购订单 其它入库  --> 
-<dk-popup wx:if="{{ billType != 'sale' && billType != 'saleOut' && billType !== 'inventory'  }}" stepperDecimal ="decimalPlaces" type="sale" descCol="skuName" titleTagCol="" titleCol="skuModel" iconCol="imagesUrl"  subCol="calculationFormula"  value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjName}}" priceTitle="" priceCol="sumPrice"  contentObj="{{popContent}}"bind:changeStep="changeStep" bind:blurNumberField="blurNumberField" bind:openPackageBox="openPackageBox" bind:commit="editItems"> 
+<dk-popup wx:if="{{ billType != 'sale' && billType != 'saleOut' && billType !== 'inventory'  }}" stepperDecimal ="decimalPlaces" type="sale" descCol="skuName" titleTagCol="" titleCol="skuModel" iconCol="imagesUrl"  subCol="calculationFormula"  value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjName}}" priceTitle="" priceCol="sumPrice"  contentObj="{{popContent}}"bind:changeStep="changeStep" bind:changeField= "changeField" bind:blurNumberField="blurNumberField" bind:openPackageBox="openPackageBox" bind:commit="editItems"> 
 </dk-popup>
 
 <!-- 库存 -->

+ 47 - 9
package-basic-data/pages/customer-list/add/add.js

@@ -35,8 +35,7 @@ Page({
         { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
         { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
         { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
-        { code: 'initialPaymentId', name: 'initialPayment', type: 'choose',   title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
-        // { code: 'startAmount', type: 'number', required: false, title: '初始欠款' },
+        { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' }, 
       ],
       remarks: [
         { code: 'remarks', type: 'textarea', title: mixins.$t('remarks') }
@@ -50,12 +49,12 @@ Page({
 * @author : 于继渤
 */
   chooseData(e) {
-    
+
     let formData = JSON.parse(this.data.formData)
     let code = e.detail.code
     let data = e.detail.data.data
 
-    console.log(code,data);
+    console.log(code, data);
 
     if (code == "staffId") { //员工
       formData.staffId = data.id
@@ -77,10 +76,49 @@ Page({
       formData.cusFromCode = data.code
       formData.cusFromName = data.name
     }
+     //客户来源
+     if (code == 'macId') {
+      formData.macId = data.id
+      formData.macCode = data.code
+      formData.macName = data.name
+    }
     //初始款项
-    if (code == "initialPaymentId") { 
-      formData.initialPaymentId  = data.id
+    if (code == "initialPaymentId") {
+      formData.initialPaymentId = data.id
       formData.initialPayment = data.name
+      let contentObj = this.data.contentObj;
+      // 初始款项-欠款
+      if (data.id == Constants.initialPayType.debt) {
+        contentObj.center = [
+          { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
+          { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
+          { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
+          { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
+          { code: 'startAmount', type: 'number', required: true, title: mixins.$t('initialDebtOwed') },
+        ]
+
+      } else if (data.id == Constants.initialPayType.payment) {
+        // 初始款项-预收
+        contentObj.center = [
+          { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
+          { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
+          { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
+          { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
+          { code: 'startAmount', type: 'number', required: true, title: mixins.$t('initialDebtOwed') },
+          { code: 'macId', name: 'macName', type: 'choose', required: true,  title: mixins.$t('moneyAccount'), urlKey: 'chooseMoneyAccount' },
+        ]
+      } else {
+        // 初始款项-无
+        contentObj.center = [
+          { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
+          { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
+          { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
+          { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
+        ]
+      }
+      this.setData({
+        contentObj: contentObj
+      })
     }
     this.setData({
       formData: JSON.stringify(formData)
@@ -120,13 +158,13 @@ Page({
     })
     // 控制初始欠款不允许编辑
     let contentObj = this.data.contentObj;
-    let filters =  contentObj.center.filter(it=>it.code == 'startAmount')
+    let filters = contentObj.center.filter(it => it.code == 'initialPaymentId')
 
-    if(filters && filters.length > 0){
+    if (filters && filters.length > 0) {
       filters[0].readonly = true;
     }
     this.setData({
-      contentObj:contentObj
+      contentObj: contentObj
     })
   },
 

+ 509 - 192
package-basic-data/pages/product-file/add/add.js

@@ -154,10 +154,79 @@ Page({
         title: mixins.$t("remarks"),
       }]
     },
+    popContentBox: [],
     // 路由
     routeObjName: 'goodsSku',
   },
   /**
+   * @desc : 数量改变事件
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  changeStep(e) {
+    let key = e.detail.key
+    let value = e.detail.value
+    let dataItem = JSON.parse(this.data.dataItem)
+    dataItem[key] = value
+    this.setData({
+      dataItem: JSON.stringify(dataItem)
+    })
+  },
+  /**
+   * @desc : dk-form 里 str的点击回调 的输入回调
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  openStr(e) {
+    console.log("openStr", e);
+    let code = e.detail.code
+    if (code == "packageBox") { //点击包装数量
+      let formData = JSON.parse(this.data.formData)
+      if (formData.unitId && formData.subUnitId && formData.packBox) {
+        let dataItem = this.data.dataItem ? JSON.parse(this.data.dataItem) : {}
+        dataItem['box'] = formData.box || 0
+        dataItem['piece'] = formData.piece || 0
+        dataItem.packageBox = formData.packageBox
+        let popContentBox = [{
+            code: 'box',
+            type: 'step',
+            title: formData.subUnitName,
+            required: true
+          },
+          {
+            code: 'piece',
+            type: 'step',
+            title: formData.unitName,
+            required: true
+          },
+        ]
+        this.setData({
+          showPopBox: true,
+          dataItem: JSON.stringify(dataItem),
+          popContentBox: popContentBox
+        })
+      } else {
+        util.showToast('请先输入基本单位、包装单位、包装');
+      }
+    }
+  },
+  /**
+   * @desc : 商品确认事件--箱片的确认
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  editItemsBox(e) {
+    let dataItem = JSON.parse(this.data.dataItem)
+    let formData = JSON.parse(this.data.formData)
+    formData['box'] = dataItem['box']
+    formData['piece'] = dataItem['piece']
+    formData['intoQty'] = Number(dataItem['box']) * Number(formData['packBox']) + Number(dataItem['piece'])
+    formData.packageBox = dataItem['box'] + formData.subUnitName + dataItem['piece'] + formData.unitName
+    this.setData({
+      formData: JSON.stringify(formData)
+    })
+  },
+  /**
    * @desc : dk-form 里 dk-number-input 的输入回调
    * @date : 2024/2/1 15:49
    * @author : 王英杰
@@ -166,10 +235,49 @@ Page({
     console.log("changeNumberField", e);
     let code = e.detail.code
     let formData = JSON.parse(this.data.formData)
-    if (code = "packBox") { //包装 
-      if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
-        formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
+    if (code == "packBox") { //包装 
+      if (formData.intoQty || formData.packageBox) {
+        //提示
+        Dialog.confirm({
+          message: '修改包装将清空期初数量、包装数量',
+        }).then(() => {
+          formData.intoQty = null
+          formData.packageBox = null
+          formData.box = null
+          formData.piece = null
+          formData["packBox_"] = formData["packBox"]
+          if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
+            formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
+          }
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+
+        }).catch(() => {
+          formData["packBox"] = formData["packBox_"]
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+        });
+
+      } else {
+        if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
+          formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
+        }
+        formData["packBox_"] = formData["packBox"]
       }
+
+    }
+    if (code == "intoQty" && formData.flgSubUnit) { //期初数量  
+      if (formData.unitId && formData.subUnitId && formData.packBox) {
+        formData['box'] = parseInt(formData['intoQty'] / formData['packBox'])
+        formData['piece'] = parseFloat(Number(formData['intoQty'] % formData['packBox']).toFixed(formData.decimalPlaces));
+        formData.packageBox = formData['box'] + formData.subUnitName + formData['piece'] + formData.unitName
+      } else {
+        formData['intoQty'] = undefined
+        util.showToast('请先输入基本单位、包装单位、包装');
+      }
+
     }
     this.setData({
       formData: JSON.stringify(formData)
@@ -185,6 +293,7 @@ Page({
     let code = e.detail.code
     let checkFlag = !e.detail.checkFlag
     let contentObj = this.data.contentObj
+    let formData = JSON.stringify(this.data.formData)
     if (code == "flgSubUnit") { //辅助单位
       if (checkFlag) {
         let formData = JSON.parse(this.data.formData)
@@ -232,6 +341,47 @@ Page({
             readonly: true,
           }
         ]
+        contentObj.warehouse = [{ //期初库存标识
+            type: 'switch',
+            title: mixins.$t("openingInv"),
+            code: 'flgOpeningInv',
+          }, { //仓库名称
+            code: 'whId',
+            name: 'whName',
+            title: mixins.$t("whName"),
+            type: 'choose',
+            urlKey: 'openingInventory',
+            required: checkFlag,
+          },
+          { //库存批号
+            code: 'nonStdCode',
+            type: 'textarea',
+            title: mixins.$t("iinventoryBatchNumber"),
+            required: checkFlag,
+            tip: mixins.$t('tipPop'),
+          },
+          { //期初数量
+            code: 'intoQty',
+            type: 'number',
+            sign: "",
+            digits: formData.decimalPlaces,
+            title: mixins.$t("openingInventoryQty"),
+            required: checkFlag,
+          },
+          {
+            code: 'packageBox',
+            type: 'str',
+            title: mixins.$t("packageBox"),
+            required: checkFlag,
+            readonly: true,
+          },
+          { //期初成本价
+            code: 'priceInto',
+            type: 'number',
+            title: mixins.$t("iinitialCostPrice"),
+            required: checkFlag,
+          },
+        ]
       } else {
         contentObj.unit = [{ //基本单位
           code: 'unitId',
@@ -246,20 +396,6 @@ Page({
           title: mixins.$t("subUnitId"),
           code: 'flgSubUnit',
         }, ]
-      }
-
-    } else if (code == "flgOpeningInv") { //期初库存标识
-      if (checkFlag) {
-        let formData = JSON.parse(this.data.formData)
-        //打开期初库存的时候 要先判断 需要先选择基本单位
-        if (!formData.unitId) {
-          formData.flgOpeningInv = false
-          util.showToast('请先选择基本单位');
-          this.setData({
-            formData: JSON.stringify(formData)
-          })
-          return
-        }
         contentObj.warehouse = [{ //期初库存标识
             type: 'switch',
             title: mixins.$t("openingInv"),
@@ -294,6 +430,99 @@ Page({
             required: checkFlag,
           },
         ]
+      }
+
+    } else if (code == "flgOpeningInv") { //期初库存标识
+      if (checkFlag) {
+        let formData = JSON.parse(this.data.formData)
+        //打开期初库存的时候 要先判断 需要先选择基本单位
+        if (!formData.unitId) {
+          formData.flgOpeningInv = false
+          util.showToast('请先选择基本单位');
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+          return
+        }
+        if (formData.flgSubUnit) { //开了辅助单位
+          contentObj.warehouse = [{ //期初库存标识
+              type: 'switch',
+              title: mixins.$t("openingInv"),
+              code: 'flgOpeningInv',
+            }, { //仓库名称
+              code: 'whId',
+              name: 'whName',
+              title: mixins.$t("whName"),
+              type: 'choose',
+              urlKey: 'openingInventory',
+              required: checkFlag,
+            },
+            { //库存批号
+              code: 'nonStdCode',
+              type: 'textarea',
+              title: mixins.$t("iinventoryBatchNumber"),
+              required: checkFlag,
+              tip: mixins.$t('tipPop'),
+            },
+            { //期初数量
+              code: 'intoQty',
+              type: 'number',
+              sign: "",
+              digits: formData.decimalPlaces,
+              title: mixins.$t("openingInventoryQty"),
+              required: checkFlag,
+            },
+            {
+              code: 'packageBox',
+              type: 'str',
+              title: mixins.$t("packageBox"),
+              required: checkFlag,
+              readonly: true,
+            },
+            { //期初成本价
+              code: 'priceInto',
+              type: 'number',
+              title: mixins.$t("iinitialCostPrice"),
+              required: checkFlag,
+            },
+          ]
+        } else { //没开辅助单位
+          contentObj.warehouse = [{ //期初库存标识
+              type: 'switch',
+              title: mixins.$t("openingInv"),
+              code: 'flgOpeningInv',
+            }, { //仓库名称
+              code: 'whId',
+              name: 'whName',
+              title: mixins.$t("whName"),
+              type: 'choose',
+              urlKey: 'openingInventory',
+              required: checkFlag,
+            },
+            { //库存批号
+              code: 'nonStdCode',
+              type: 'textarea',
+              title: mixins.$t("iinventoryBatchNumber"),
+              required: checkFlag,
+              tip: mixins.$t('tipPop'),
+            },
+            { //期初数量
+              code: 'intoQty',
+              type: 'number',
+              sign: "",
+              digits: formData.decimalPlaces,
+              title: mixins.$t("openingInventoryQty"),
+              required: checkFlag,
+            },
+            { //期初成本价
+              code: 'priceInto',
+              type: 'number',
+              title: mixins.$t("iinitialCostPrice"),
+              required: checkFlag,
+            },
+          ]
+        }
+
       } else {
         contentObj.warehouse = [{ //期初库存标识
           type: 'switch',
@@ -370,18 +599,34 @@ Page({
       handledata: false
     })
     let formData = JSON.parse(this.data.formData)
-    let data = this.data.chooseUnitData
-    formData.intoQty = null
-    formData.packBox = null
-    formData.subUnitId = null
-    formData.subUnitName = null
-    // 当重新选择基本单位后清空公式 刘尧 2024.5.30
-    formData.calculationFormula = null
+    let data = this.data.chooseUnitData 
+    let Dialog_message = null
+    let code = this.data.chooseDataCode
+    if (code == "unitId") { //计量单位
+      formData.intoQty = null
+      formData.packBox = null
+      formData.subUnitId = null
+      formData.subUnitName = null
+      formData.packageBox = null
+      formData.box = null
+      formData.piece = null
+      // 当重新选择基本单位后清空公式 刘尧 2024.5.30
+      formData.calculationFormula = null
+      Dialog_message = '更换基础单位将清空包装单位、期初数量、包装、包装数量'
+    }
+    if (code == "subUnitId") { //包装单位
+      formData.intoQty = null
+      formData.packageBox = null
+      formData.box = null
+      formData.piece = null
+      Dialog_message = '更换包装单位将清空期初数量、包装数量'
+    }
+ 
     //提示
     Dialog.confirm({
-      message: '更换基础单位将清空包装单位,期初数量,包装数量',
+      message: Dialog_message,
     }).then(() => {
-      this.handleChooseDataUnit(formData, data)
+      this.handleChooseDataUnit(formData, data, code)
     }).catch(() => {});
   },
   /**
@@ -404,27 +649,34 @@ Page({
       formData.catName = data.name
     }
     if (code == "unitId") { //计量单位
-      //当期初数量有值的时候 弹提示是否清除
-
-      if (formData.intoQty || formData.packBox || formData.subUnitId) { //在onshow执行 这里无法弹出dialog
+      //当期初数量有值的时候 弹提示是否清除 
+      if (formData.intoQty || formData.packBox || formData.subUnitId || formData.packageBox) { //在onshow执行 这里无法弹出dialog  
         this.setData({
           chooseUnitData: data,
-          handledata: true
+          handledata: true,
+          chooseDataCode: code
         })
       } else {
-        this.handleChooseDataUnit(formData, data)
+        this.handleChooseDataUnit(formData, data, code)
       }
 
     }
     if (code == "subUnitId") { //辅助计量单位
-      if (data.id == formData.unitId) { 
+      if (data.id == formData.unitId) {
         setTimeout(() => {
           util.showToast('包装单位不能等于基本单位');
         }, 1000)
         return
       }
-      formData.subUnitId = data.id
-      formData.subUnitName = data.name
+      if (formData.intoQty || formData.packageBox) { //在onshow执行 这里无法弹出dialog 
+        this.setData({
+          chooseUnitData: data,
+          handledata: true,
+          chooseDataCode: code
+        })
+      } else {
+        this.handleChooseDataUnit(formData, data, code)
+      }
       if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
         formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
       }
@@ -446,47 +698,60 @@ Page({
    * @date : 2024/2/1 15:49
    * @author : 王英杰
    */
-  handleChooseDataUnit(formData, data) {
-    formData.unitId = data.id
-    formData.unitName = data.name
-    formData.decimalPlaces = data.decimalPlaces
-    if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
-      formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
-    }
-    let contentObj = this.data.contentObj
-    if (contentObj.warehouse.length > 0) {
-      // 遍历 contentObj.warehouse 数组  
-      for (let i = 0; i < contentObj.warehouse.length; i++) {
-        // 检查当前对象的 code 是否为 'intoQty'  
-        if (contentObj.warehouse[i].code === 'intoQty') { //期初数量
-          // 如果是,则修改其 digits 属性  
-          contentObj.warehouse[i].digits = formData.decimalPlaces;
-          contentObj.warehouse[i].readonly = false;
-          // 找到后,可以跳出循环(如果确定只有一个匹配项)  
-          break;
-        }
+  handleChooseDataUnit(formData, data, code) {
+    if (code == "unitId") {
+      formData.unitId = data.id
+      formData.unitName = data.name
+      formData.decimalPlaces = data.decimalPlaces
+      let dataItem = this.data.dataItem ? JSON.parse(this.data.dataItem) : {}
+      dataItem.decimalPlaces = data.decimalPlaces
+      if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
+        formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
       }
-    }
-    if (contentObj.unit.length > 0) {
-      // 遍历 contentObj.unit 数组  
-      for (let i = 0; i < contentObj.unit.length; i++) {
-        // 检查当前对象的 code 是否为 'packBox'  
-        if (contentObj.unit[i].code === 'packBox') { //包装
-          // 如果是,则修改其 digits 属性  
-          contentObj.unit[i].digits = formData.decimalPlaces;
-          contentObj.unit[i].readonly = false;
-          continue
+      let contentObj = this.data.contentObj
+      if (contentObj.warehouse.length > 0) {
+        // 遍历 contentObj.warehouse 数组  
+        for (let i = 0; i < contentObj.warehouse.length; i++) {
+          // 检查当前对象的 code 是否为 'intoQty'  
+          if (contentObj.warehouse[i].code === 'intoQty') { //期初数量
+            // 如果是,则修改其 digits 属性  
+            contentObj.warehouse[i].digits = formData.decimalPlaces;
+            contentObj.warehouse[i].readonly = false;
+            // 找到后,可以跳出循环(如果确定只有一个匹配项)  
+            break;
+          }
         }
-        if (contentObj.unit[i].code === 'subUnitId') { //包装单位 
-          contentObj.unit[i].readonly = false;
-          continue
+      }
+      if (contentObj.unit.length > 0) {
+        // 遍历 contentObj.unit 数组  
+        for (let i = 0; i < contentObj.unit.length; i++) {
+          // 检查当前对象的 code 是否为 'packBox'  
+          if (contentObj.unit[i].code === 'packBox') { //包装
+            // 如果是,则修改其 digits 属性  
+            contentObj.unit[i].digits = formData.decimalPlaces;
+            contentObj.unit[i].readonly = false;
+            continue
+          }
+          if (contentObj.unit[i].code === 'subUnitId') { //包装单位 
+            contentObj.unit[i].readonly = false;
+            continue
+          }
         }
       }
+      this.setData({
+        contentObj: contentObj,
+        formData: JSON.stringify(formData),
+        dataItem: JSON.stringify(dataItem)
+      })
+
+    }
+    if (code == "subUnitId") {
+      formData.subUnitId = data.id
+      formData.subUnitName = data.name
+      this.setData({
+        formData: JSON.stringify(formData),
+      })
     }
-    this.setData({
-      contentObj: contentObj,
-      formData: JSON.stringify(formData)
-    })
     return
   },
   /**
@@ -784,7 +1049,7 @@ Page({
     // data.serviceCategories = (data.serviceCategories && data.serviceCategories.length > 0) ? data.serviceCategories.join(',') : undefined
     data.annexPaths = data.skuImages
     data.onlyCode = data.skuCode
- 
+    
     let contentObj = this.data.contentObj
     // 我们要添加的新对象是  编码  新建的时候没有 编辑的时候添加 
     contentObj.main = [{ //唯一编码
@@ -809,89 +1074,89 @@ Page({
 
     ]
     if (data.flgSubUnit) {
-      if(data.inventoryCount !== 0){
+      if (data.inventoryCount !== 0) {
         contentObj.unit = [{
-          text: '本商品有库存,不可更改单位模块;需全部出库后才可更改',
-          type: 'text',
-        },{ //基本单位
-          code: 'unitId',
-          name: 'unitName',
-          title: mixins.$t("unit"),
-          type: 'choose',
-          urlKey: 'unit',
-          required: true,
-          readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
-        }, { //辅助单位标识
-          type: 'switch',
-          title: mixins.$t("subUnitId"),
-          code: 'flgSubUnit',
-          disabled:(data.inventoryCount !== 0),
-       
-        }, { //包装单位
-          code: 'subUnitId',
-          name: 'subUnitName',
-          title: mixins.$t("packageUnit"),
-          type: 'choose',
-          urlKey: 'unit',
-          required: true,
-          readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
-        }, { //包装
-          code: 'packBox',
-          title: mixins.$t("package"),
-          type: 'number',
-          sign: "",
-          digits: 0,
-          required: true,
-          readonly: data.inventoryCount !== 0 
-        },
-        {
-          code: 'calculationFormula',
-          type: 'textarea',
-          title: mixins.$t("calculationFormula"),
-          readonly: true,
-        }
-      ]
-      }else{ //没库存
+            text: '本商品有库存,不可更改单位模块;需全部出库后才可更改',
+            type: 'text',
+          }, { //基本单位
+            code: 'unitId',
+            name: 'unitName',
+            title: mixins.$t("unit"),
+            type: 'choose',
+            urlKey: 'unit',
+            required: true,
+            readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
+          }, { //辅助单位标识
+            type: 'switch',
+            title: mixins.$t("subUnitId"),
+            code: 'flgSubUnit',
+            disabled: (data.inventoryCount !== 0),
+
+          }, { //包装单位
+            code: 'subUnitId',
+            name: 'subUnitName',
+            title: mixins.$t("packageUnit"),
+            type: 'choose',
+            urlKey: 'unit',
+            required: true,
+            readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
+          }, { //包装
+            code: 'packBox',
+            title: mixins.$t("package"),
+            type: 'number',
+            sign: "",
+            digits: 0,
+            required: true,
+            readonly: data.inventoryCount !== 0
+          },
+          {
+            code: 'calculationFormula',
+            type: 'textarea',
+            title: mixins.$t("calculationFormula"),
+            readonly: true,
+          }
+        ]
+      } else { //没库存
         contentObj.unit = [{ //基本单位
-          code: 'unitId',
-          name: 'unitName',
-          title: mixins.$t("unit"),
-          type: 'choose',
-          urlKey: 'unit',
-          required: true,
-          readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
-        }, { //辅助单位标识
-          type: 'switch',
-          title: mixins.$t("subUnitId"),
-          code: 'flgSubUnit',
-          disabled:(data.inventoryCount !== 0),
-       
-        }, { //包装单位
-          code: 'subUnitId',
-          name: 'subUnitName',
-          title: mixins.$t("packageUnit"),
-          type: 'choose',
-          urlKey: 'unit',
-          required: true,
-          readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
-        }, { //包装
-          code: 'packBox',
-          title: mixins.$t("package"),
-          type: 'number',
-          sign: "",
-          digits: 0,
-          required: true,
-          readonly: data.inventoryCount !== 0 
-        },
-        {
-          code: 'calculationFormula',
-          type: 'textarea',
-          title: mixins.$t("calculationFormula"),
-          readonly: true,
-        }
-      ]
+            code: 'unitId',
+            name: 'unitName',
+            title: mixins.$t("unit"),
+            type: 'choose',
+            urlKey: 'unit',
+            required: true,
+            readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
+          }, { //辅助单位标识
+            type: 'switch',
+            title: mixins.$t("subUnitId"),
+            code: 'flgSubUnit',
+            disabled: (data.inventoryCount !== 0),
+
+          }, { //包装单位
+            code: 'subUnitId',
+            name: 'subUnitName',
+            title: mixins.$t("packageUnit"),
+            type: 'choose',
+            urlKey: 'unit',
+            required: true,
+            readonly: data.inventoryCount !== 0 //要校验库存;  库存量不为0不让更改 
+          }, { //包装
+            code: 'packBox',
+            title: mixins.$t("package"),
+            type: 'number',
+            sign: "",
+            digits: 0,
+            required: true,
+            readonly: data.inventoryCount !== 0
+          },
+          {
+            code: 'calculationFormula',
+            type: 'textarea',
+            title: mixins.$t("calculationFormula"),
+            readonly: true,
+          }
+        ]
       }
-    
+
     } else {
       contentObj.unit = [{ //基本单位
         code: 'unitId',
@@ -908,51 +1173,103 @@ Page({
       }, ]
     }
     if (data.flgOpeningInv) {
-      contentObj.warehouse = [{ //期初库存标识
-          type: 'switch',
-          title: mixins.$t("openingInv"),
-          code: 'flgOpeningInv',
-          disabled: true,
-           
-        }, { //仓库名称
-          code: 'whId',
-          name: 'whName',
-          title: mixins.$t("whName"),
-          type: 'choose',
-          urlKey: 'openingInventory',
-          required: true,
-          readonly: true,
-        },
-        { //库存批号
-          code: 'nonStdCode',
-          type: 'textarea',
-          title: mixins.$t("iinventoryBatchNumber"),
-          required: true,
-          readonly: true,
-          tip: mixins.$t('tipPop'),
-        },
-        { //期初数量
-          code: 'intoQty',
-          type: 'number',
-          sign: "",
-          digits: 0,
-          title: mixins.$t("openingInventoryQty"),
-          required: true,
-          readonly: true,
-        },
-        { //期初成本价
-          code: 'priceInto',
-          type: 'number',
-          title: mixins.$t("iinitialCostPrice"),
-          required: true,
-          readonly: true,
-        },
-      ]
+      if (data.flgSubUnit) { //开了辅助单位
+        data.packageBox  = data['box'] + data.subUnitName + data['piece'] + data.unitName
+        contentObj.warehouse = [{ //期初库存标识
+            type: 'switch',
+            title: mixins.$t("openingInv"),
+            code: 'flgOpeningInv',
+            disabled: true,
+
+          }, { //仓库名称
+            code: 'whId',
+            name: 'whName',
+            title: mixins.$t("whName"),
+            type: 'choose',
+            urlKey: 'openingInventory',
+            required: true,
+            readonly: true,
+          },
+          { //库存批号
+            code: 'nonStdCode',
+            type: 'textarea',
+            title: mixins.$t("iinventoryBatchNumber"),
+            required: true,
+            readonly: true,
+            tip: mixins.$t('tipPop'),
+          },
+          { //期初数量
+            code: 'intoQty',
+            type: 'number',
+            sign: "",
+            digits: 0,
+            title: mixins.$t("openingInventoryQty"),
+            required: true,
+            readonly: true,
+          },
+          {
+            code: 'packageBox',
+            type: 'str',
+            title: mixins.$t("packageBox"),
+            required: true,
+            readonly: true,
+          },
+          { //期初成本价
+            code: 'priceInto',
+            type: 'number',
+            title: mixins.$t("iinitialCostPrice"),
+            required: true,
+            readonly: true,
+          },
+        ]
+      } else {
+        contentObj.warehouse = [{ //期初库存标识
+            type: 'switch',
+            title: mixins.$t("openingInv"),
+            code: 'flgOpeningInv',
+            disabled: true,
+
+          }, { //仓库名称
+            code: 'whId',
+            name: 'whName',
+            title: mixins.$t("whName"),
+            type: 'choose',
+            urlKey: 'openingInventory',
+            required: true,
+            readonly: true,
+          },
+          { //库存批号
+            code: 'nonStdCode',
+            type: 'textarea',
+            title: mixins.$t("iinventoryBatchNumber"),
+            required: true,
+            readonly: true,
+            tip: mixins.$t('tipPop'),
+          },
+          { //期初数量
+            code: 'intoQty',
+            type: 'number',
+            sign: "",
+            digits: 0,
+            title: mixins.$t("openingInventoryQty"),
+            required: true,
+            readonly: true,
+          },
+          { //期初成本价
+            code: 'priceInto',
+            type: 'number',
+            title: mixins.$t("iinitialCostPrice"),
+            required: true,
+            readonly: true,
+          },
+        ]
+      }
+
     } else {
       contentObj.warehouse = [{ //期初库存标识
         type: 'switch',
         title: mixins.$t("openingInv"),
-        code: 'flgOpeningInv', 
+        code: 'flgOpeningInv',
         disabled: true,
       }, ]
     }

+ 6 - 2
package-basic-data/pages/product-file/add/add.wxml

@@ -3,7 +3,7 @@
 <van-dialog id="van-dialog" />
 <loading wx:if="{{loading}}" ></loading>
  
-<dk-form id="{{formName}}" routeObjName="{{routeObjName}}"uploaderMAX="1"  cardList="{{cardList}}" contentObj="{{contentObj}}"  table="{{table}}" bind:onSwitchChange = "onSwitchChange" bind:changeNumberField = "changeNumberField"
+<dk-form id="{{formName}}" routeObjName="{{routeObjName}}"uploaderMAX="1"  cardList="{{cardList}}" contentObj="{{contentObj}}"  table="{{table}}" bind:onSwitchChange = "onSwitchChange" bind:changeNumberField = "changeNumberField" bind:openStr= "openStr"
 model:value="{{formData}}" bind:chooseData="chooseData"  >
 </dk-form>
  
@@ -11,4 +11,8 @@ model:value="{{formData}}" bind:chooseData="chooseData"  >
  
 
 <!-- 新建按钮 -->
-<dk-save-button   btnAutoWidthFlag="{{true}}"  buttonList="{{buttonList}}"   bind:open="save"></dk-save-button>
+<dk-save-button   btnAutoWidthFlag="{{true}}"  buttonList="{{buttonList}}"   bind:open="save"></dk-save-button>
+
+
+<!-- 箱片 -->
+<dk-popup type="basic" title="修改包装数量"   value="{{dataItem}}" show="{{showPopBox}}"  contentObj="{{popContentBox}}" bind:changeStep="changeStep" bind:commit="editItemsBox" stepperDecimal ="decimalPlaces"></dk-popup>

+ 18 - 1
package-inventory/pages/inventory-adjustment/add/add.js

@@ -49,7 +49,12 @@ Page({
       type: 'choose',
       urlKey: 'chooseWh'
     },
- 
+    {
+      code: 'brandName',
+      title: mixins.$t('brandName'), 
+      type: 'str',
+      readonly:true,
+  },
     {
       code: 'oNonStdCode',
       name: 'oNonStdName',
@@ -268,6 +273,12 @@ Page({
           urlKey: 'chooseWh'
         },
         {
+          code: 'brandName',
+          title: mixins.$t('brandName'), 
+          type: 'str',
+          readonly:true,
+      },
+        {
           code: 'nonStdCode',
           title: mixins.$t("goodsBatch"), //'色号',
           type: 'str',
@@ -330,6 +341,12 @@ Page({
         },
         { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"),   },
         {
+          code: 'brandName',
+          title: mixins.$t('brandName'), 
+          type: 'str',
+          readonly:true,
+      },
+        {
           code: 'oNonStdCode',
           name: 'oNonStdName',
           title: mixins.$t('oNonStdCode'),//'源批号'

+ 45 - 28
package-inventory/pages/inventory-adjustment/detail/detail.js

@@ -1,7 +1,7 @@
 // package-basic-data/pages/test/add/add.js
 const mixins = require('@/mixins/index.js')
 const utils = require('@/utils/util');
-const app = getApp() 
+const app = getApp()
 const config = require('@/config/config.js')
 const Constants = require('@/utils/Constants');
 Page({
@@ -34,7 +34,7 @@ Page({
       title: mixins.$t('countedQuantity'), //'数量', 
       required: true
     },
-    { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"),readonly:true   },
+    { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), readonly: true },
     {
       code: 'oWhId',
       name: 'oWhName',
@@ -49,21 +49,26 @@ Page({
       type: 'choose',
       urlKey: 'chooseWh'
     },
- 
+    {
+      code: 'brandName',
+      title: mixins.$t('brandName'),
+      type: 'str',
+      readonly: true,
+    },
     {
       code: 'oNonStdCode',
       name: 'oNonStdName',
-      title:  mixins.$t('oNonStdCode'),//'源批号'
+      title: mixins.$t('oNonStdCode'),//'源批号'
       type: 'str',
-      tip: mixins.$t('tipPop'),
-      
+      tip: mixins.$t('tipPop'),
+
     },
     {
       code: 'nonStdCode',
       name: 'nonStdName',
       title: mixins.$t('nonStdCode'),//'目标批号'
-      type: 'str', 
-      tip: mixins.$t('tipPop'),
+      type: 'str',
+      tip: mixins.$t('tipPop'),
     },
 
     ],
@@ -89,7 +94,7 @@ Page({
         title: mixins.$t("adjustmentType"),  //"调整类型",  
         type: 'choose',
         required: true,
-        clearItemFlag:true,
+        clearItemFlag: true,
         urlKey: 'chooseAdjustmentType',
       }, {
         code: 'staffId',
@@ -117,7 +122,7 @@ Page({
         code: 'nonStdCode',
         name: 'nonStdName',
         type: 'str',
-        title:  mixins.$t('nonStdCode'),//'目标批号'  
+        title: mixins.$t('nonStdCode'),//'目标批号'  
       }
       ],
       items: [],
@@ -209,7 +214,7 @@ Page({
             title: mixins.$t("adjustmentType"),  //"调整类型",  
             type: 'choose',
             required: true,
-            clearItemFlag:true,
+            clearItemFlag: true,
             urlKey: 'chooseAdjustmentType',
           }, {
             code: 'staffId',
@@ -221,7 +226,7 @@ Page({
           }, {
             code: 'orgId',
             name: 'orgName',
-            title:  mixins.$t("orgId"),  //'部门',  ', 
+            title: mixins.$t("orgId"),  //'部门',  ', 
             type: 'choose',
             required: true,
             urlKey: 'chooseOrg'
@@ -252,7 +257,7 @@ Page({
           title: mixins.$t('countedQuantity'), //'数量', 
           required: true
         },
-        { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), readonly:true  },
+        { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), readonly: true },
         {
           code: 'oWhId',
           name: 'oWhName',
@@ -263,11 +268,17 @@ Page({
         {
           code: 'whId',
           name: 'whName',
-          title:  mixins.$t('whid'),//'目标仓库'
+          title: mixins.$t('whid'),//'目标仓库'
           type: 'choose',
           urlKey: 'chooseWh'
         },
         {
+          code: 'brandName',
+          title: mixins.$t('brandName'),
+          type: 'str',
+          readonly: true,
+        },
+        {
           code: 'nonStdCode',
           title: mixins.$t("goodsBatch"), //'色号',
           type: 'str',
@@ -286,7 +297,7 @@ Page({
             title: mixins.$t("adjustmentType"),  //"调整类型", 
             type: 'choose',
             required: true,
-            clearItemFlag:true,
+            clearItemFlag: true,
             urlKey: 'chooseAdjustmentType',
           }, {
             code: 'staffId',
@@ -298,7 +309,7 @@ Page({
           }, {
             code: 'orgId',
             name: 'orgName',
-            title:  mixins.$t("orgId"),  //'部门',  ', 
+            title: mixins.$t("orgId"),  //'部门',  ', 
             type: 'choose',
             required: true,
             urlKey: 'chooseOrg'
@@ -328,20 +339,26 @@ Page({
           title: mixins.$t('countedQuantity'), //'数量', 
           required: true
         },
-        { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"),readonly:true   },
+        { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), readonly: true },
+        {
+          code: 'brandName',
+          title: mixins.$t('brandName'),
+          type: 'str',
+          readonly: true,
+        },
         {
           code: 'oNonStdCode',
           name: 'oNonStdName',
           title: mixins.$t('oNonStdCode'),//'源批号'
           type: 'str',
-          tip: mixins.$t('tipPop'),
+          tip: mixins.$t('tipPop'),
         },
         {
           code: 'nonStdCode',
           name: 'nonStdName',
           title: mixins.$t('nonStdCode'),//'目标批号'  
           type: 'str',
-          tip: mixins.$t('tipPop'),
+          tip: mixins.$t('tipPop'),
         },
 
         ],
@@ -361,8 +378,8 @@ Page({
         element.skuImages.forEach(item => {
           item.url = config.image_url + item.path
         });
-        element.imagesUrl =   element.skuImages[0].url
-      } 
+        element.imagesUrl = element.skuImages[0].url
+      }
     });
     this.setData({
       formData: JSON.stringify(formData)
@@ -457,9 +474,9 @@ Page({
     let formData = JSON.parse(this.data.formData)
     let readonly = this.data.readonly || false
     let buttonList = this.data.buttonList
-    formData = data.data  
-    formData.transferTypeName =  formData.transferStatusName
- 
+    formData = data.data
+    formData.transferTypeName = formData.transferStatusName
+
     //明细数据
     formData.goodsList = data.dataItem
     formData.goodsList.forEach(element => {
@@ -474,7 +491,7 @@ Page({
     wx.setNavigationBarTitle({
       title: '库存调整明细', // mixins.$t('supplierAdd')
     })
-    buttonList = [ ]
+    buttonList = []
     readonly = true
     this.setData({
       formData: JSON.stringify(formData),
@@ -505,11 +522,11 @@ Page({
     let formData = this.data.formData ? JSON.parse(this.data.formData) : {}
     formData.transferType = Constants.inventoryAdjustment.warehouse
     formData.transferTypeName = '仓库调整'
-    console.log("app.globalData.user",app.globalData.user);
+    console.log("app.globalData.user", app.globalData.user);
     formData.orgId = app.globalData.user.orgId
-    formData.orgName = app.globalData.user.orgName 
+    formData.orgName = app.globalData.user.orgName
     formData.staffId = app.globalData.user.staffId
-    formData.staffName = app.globalData.user.staffName 
+    formData.staffName = app.globalData.user.staffName
     this.switchTransferType(formData.transferType)
     this.setData({
       formData: JSON.stringify(formData)

+ 6 - 0
package-inventory/pages/inventory-check/add/add.js

@@ -57,6 +57,12 @@ Page({
                 type: 'choose',
             },
             {
+                code: 'brandName',
+                title: mixins.$t('brandName'), 
+                type: 'str',
+                readonly:true,
+            },
+            {
                 code: 'nonStdCode',
                 title: mixins.$t("goodsBatch"), //'色号',
                 type: 'str',

+ 6 - 0
package-inventory/pages/inventory-check/detail/detail.js

@@ -43,6 +43,12 @@ Page({
                 type: 'choose',
             },
             {
+                code: 'brandName',
+                title: mixins.$t('brandName'), 
+                type: 'str',
+                readonly:true,
+            },
+            {
                 code: 'nonStdCode',
                 title: mixins.$t("goodsBatch"), //'色号',
                 type: 'str',

+ 83 - 74
package-inventory/pages/inventory-freeze/add/add.js

@@ -1,6 +1,6 @@
 const Constants = require('@/utils/Constants.js');
 const util = require('@/utils/util.js')
-const app = getApp(); 
+const app = getApp();
 const config = require('@/config/config.js')
 const mixins = require('@/mixins/index.js')
 Page({
@@ -11,32 +11,39 @@ Page({
   data: {
     // 路由
     routeObjName: 'freeze',
-       //弹出pop
-       popContent: [{
-        code: 'itemQty',
-        type: 'step',
-        title: mixins.$t('count'),
-        required: true
+    //弹出pop
+    popContent: [{
+      code: 'itemQty',
+      type: 'step',
+      title: mixins.$t('count'),
+      required: true
     },
-    { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"),   },
+    { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), },
     {
-        code: 'whId',
-        name: 'whName',
-        title: mixins.$t('warehouseId'),
-        type: 'choose',
-        urlKey: 'openingInventory'
+      code: 'whId',
+      name: 'whName',
+      title: mixins.$t('warehouseId'),
+      type: 'choose',
+      urlKey: 'openingInventory'
     },
     { code: 'skuSpec', title: mixins.$t('goodSpec'), type: 'str', readonly: true, },
     {
-        code: 'nonStdCode',
-        title: mixins.$t('goodsBatch'),
-        type: 'str',
-        tip: mixins.$t('tipPop'),
+      code: 'brandName',
+      title: mixins.$t('brandName'),
+      type: 'str',
+      readonly: true,
+    },
+    {
+      code: 'nonStdCode',
+      title: mixins.$t('goodsBatch'),
+      type: 'str',
+      tip: mixins.$t('tipPop'),
     },
     ],
 
     cardList: [
-      { name: 'main', title:  mixins.$t('freezeInfo'),//'冻结信息'
+      {
+        name: 'main', title: mixins.$t('freezeInfo'),//'冻结信息'
       },
       { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: true, itemAmt: '', displayNum: 2 },
       { name: 'other', title: mixins.$t("otherInfo") },
@@ -67,8 +74,9 @@ Page({
       ]
     },
 
-    buttonSaveList: [{ code: 'save', title: mixins.$t("freeze")//'冻结' 
-  }],
+    buttonSaveList: [{
+      code: 'save', title: mixins.$t("freeze")//'冻结' 
+    }],
   },
   /**
    * @desc : 外露设置产品方法 
@@ -76,19 +84,19 @@ Page({
    * @author : 王英杰
    */
   setGoods(e) {
-    let formData = JSON.parse(this.data.formData) 
+    let formData = JSON.parse(this.data.formData)
     formData.goodsList.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({
-        formData: JSON.stringify(formData)
-      })
-   
+        element.imagesUrl = element.skuImages[0].url
+      }
+    });
+    this.setData({
+      formData: JSON.stringify(formData)
+    })
+
   },
   /**
      * @desc   : 设置只读
@@ -99,7 +107,7 @@ Page({
     let formData = JSON.parse(this.data.formData)
     let cardList = this.data.cardList
     let contentObj = this.data.contentObj
-    let buttonSaveList = this.data.buttonSaveList 
+    let buttonSaveList = this.data.buttonSaveList
     cardList[1].color = '#E4002B'
     cardList[1].chooseGoodsFlag = false
     contentObj.main = [
@@ -107,16 +115,16 @@ Page({
       { code: 'staffName', title: '申请员工', type: 'str', readonly: true },
       { code: 'orgName', title: '申请部门', type: 'str', readonly: true },
     ]
-    if (formData.freezeStatus == '冻结状态-部分解冻' || formData.freezeStatus == '冻结状态-全部解冻' ){
-      buttonSaveList =  [{ code: 'close', title: '关闭' }]
-    }else{
-      buttonSaveList =  [{ code: 'save', title: '解冻' }]
+    if (formData.freezeStatus == '冻结状态-部分解冻' || formData.freezeStatus == '冻结状态-全部解冻') {
+      buttonSaveList = [{ code: 'close', title: '关闭' }]
+    } else {
+      buttonSaveList = [{ code: 'save', title: '解冻' }]
     }
-    
+
     this.setData({
-      cardList:cardList,
-      contentObj:contentObj,
-      buttonSaveList:buttonSaveList,
+      cardList: cardList,
+      contentObj: contentObj,
+      buttonSaveList: buttonSaveList,
     })
   },
 
@@ -169,7 +177,7 @@ Page({
       res.surplusQty = res.itemQty
       res.freezeQty = res.itemQty
       res.unfreezeQty = 0
-      sumQuantity +=  res.itemQty
+      sumQuantity += res.itemQty
       delete res['priceLimited']
       delete res['pricePurchase']
       delete res['priceStandard']
@@ -198,11 +206,12 @@ 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 
-          this.setData({
-            formData: JSON.stringify(formData), 
-          })
-      }});
+        formData.orgName = app.globalData.user.orgName
+        this.setData({
+          formData: JSON.stringify(formData),
+        })
+      }
+    });
   },
 
   /**
@@ -214,9 +223,9 @@ Page({
     return this.excute(this.data.service, this.data.service.getFreezeForUpdate + '/' + id, {}).then(res => {
       if (res.data.code == 200) {
         let formData = JSON.parse(this.data.formData)
-       
+
         formData = res.data.data.data
-        res.data.data.dataItem.forEach(it=>{
+        res.data.data.dataItem.forEach(it => {
           it.itemQty = it.surplusQty
         })
         formData.goodsList = res.data.data.dataItem
@@ -225,17 +234,17 @@ Page({
             element.skuImages.forEach(item => {
               item.url = config.image_url + item.path
             });
-            element.imagesUrl =   element.skuImages[0].url
-          } 
+            element.imagesUrl = element.skuImages[0].url
+          }
           if (element.flgSubUnit) {
             element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
             element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
           }
-        }); 
-          this.setData({
-            formData: JSON.stringify(formData)
-          })
-        
+        });
+        this.setData({
+          formData: JSON.stringify(formData)
+        })
+
 
       }
     });
@@ -245,22 +254,22 @@ Page({
      * @date : 2024/2/1 15:49
      * @author : 于继渤
      */
-    toEdit() {
-      let this_ = this
-      wx.navigateTo({
-        url: this_.data.route.add.url,
-        events: {
-          // 保存成功后刷新页面
-          refresh: function (data) {
-          }
-        },
-        success: function (res) {
-          res.eventChannel.emit('params', {
-            formMode: Constants.formMode.detailEdit, id: this_.data.id
-          });
+  toEdit() {
+    let this_ = this
+    wx.navigateTo({
+      url: this_.data.route.add.url,
+      events: {
+        // 保存成功后刷新页面
+        refresh: function (data) {
         }
-      })
-    },
+      },
+      success: function (res) {
+        res.eventChannel.emit('params', {
+          formMode: Constants.formMode.detailEdit, id: this_.data.id
+        });
+      }
+    })
+  },
   /**
  * 生命周期函数--监听页面加载
  */
@@ -271,26 +280,26 @@ Page({
       wx.setNavigationBarTitle({
         title: '库存冻结详情'
       })
-     
+
       this.getItemDetal(this.data.id)
       this.setColumn()
-    }else if (this.data.formMode == Constants.formMode.detailEdit) { 
+    } else if (this.data.formMode == Constants.formMode.detailEdit) {
       //编辑
       wx.setNavigationBarTitle({
         title: '编辑库存冻结'
       })
       this.getItemDetal(this.data.id)
 
-    }else{ //新建
+    } else { //新建
       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), 
-        })
+      formData.orgName = app.globalData.user.orgName
+      this.setData({
+        formData: JSON.stringify(formData),
+      })
     }
   }
 })

+ 7 - 0
package-inventory/pages/other-outbound/other-outbound.js

@@ -48,6 +48,12 @@ Page({
             readonly: true,
         },
         {
+            code: 'brandName',
+            title: mixins.$t('brandName'), 
+            type: 'str',
+            readonly:true,
+        },
+        {
             code: 'nonStdCode',
             title: mixins.$t('goodsBatch'),
             tip: mixins.$t('tipPop'),
@@ -525,6 +531,7 @@ Page({
         })
         params.itemList = formData.goodsList //商品明细
         params.annexPaths = formData.annexPaths || [] //附件 
+        params.limitEdit = true
         return params
     },
 

+ 7 - 0
package-inventory/pages/other-warehousing/other-warehousing.js

@@ -57,6 +57,12 @@ Page({
                 readonly: true,
             },
             {
+                code: 'brandName',
+                title: mixins.$t('brandName'), 
+                type: 'str',
+                readonly:true,
+            },
+            {
                 code: 'nonStdCode',
                 title: mixins.$t('goodsBatch'),
                 tip: mixins.$t('tipPop'),
@@ -532,6 +538,7 @@ Page({
         })
         params.itemList = formData.goodsList //商品明细
         params.annexPaths = formData.annexPaths || [] //附件 
+        params.limitEdit = true
         return params
     },
 

+ 6 - 0
package-inventory/pages/outbound-processing/detail/detail.js

@@ -57,6 +57,12 @@ Page({
         readonly: true
       },
       {
+        code: 'brandName',
+        title: mixins.$t('brandName'), 
+        type: 'str',
+        readonly:true,
+    },
+      {
         code: 'nonStdCode',
         title: mixins.$t('goodsBatch'),
         tip: mixins.$t('tipPop'),

+ 6 - 0
package-inventory/pages/warehousing-processing/detail/detail.js

@@ -64,6 +64,12 @@ Page({
                 readonly: true
             },
             {
+                code: 'brandName',
+                title: mixins.$t('brandName'), 
+                type: 'str',
+                readonly:true,
+            },
+            {
                 code: 'nonStdCode',
                 title: mixins.$t('goodsBatch'),
                 tip: mixins.$t('tipPop'),

+ 181 - 175
package-purchase/pages/purchase-order/add/add.js

@@ -1,7 +1,7 @@
 // package-basic-data/pages/test/add/add.js
 const mixins = require('@/mixins/index.js')
 const util = require('@/utils/util.js')
-const app = getApp() 
+const app = getApp()
 const config = require('@/config/config.js')
 const Constants = require('@/utils/Constants');
 Page({
@@ -26,13 +26,13 @@ Page({
         }],
         btnFormData: null,
         popContent: [
-          { code: 'pricePur', type: 'number', title: mixins.$t("pricePur"), required: true },{
+            { code: 'pricePur', type: 'number', title: mixins.$t("pricePur"), required: true }, {
                 code: 'itemQty',
                 type: 'step',
                 title: mixins.$t('count'), //'数量',
-                required: true, 
+                required: true,
             },
-            { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"),   },
+            { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), },
             {
                 code: 'skuSpec',
                 title: mixins.$t('goodSpec'), //'规格',
@@ -40,39 +40,45 @@ Page({
                 readonly: true,
             },
             {
+                code: 'brandName',
+                title: mixins.$t('brandName'),
+                type: 'str',
+                readonly: true,
+            },
+            {
                 code: 'nonStdCode',
                 title: mixins.$t('goodsBatch'), //'色号',
                 type: 'str',
-                tip: mixins.$t('tipPop'),
+                tip: mixins.$t('tipPop'),
             },
         ],
 
         cardList: [{
-                name: 'wh'
-            }, {
-                name: 'relation'
-            },
-            {
-                name: 'items',
-                title: mixins.$t('goodsDetail'), //'商品明细',
-                color: '#E4002B',
-                controls:[{card:'relation',code:'sourceNo'}],
-                displayNum: 2
-            }, {
-                name: 'other',
-                title: mixins.$t('otherInfo'), //'其他信息'
-            }
+            name: 'wh'
+        }, {
+            name: 'relation'
+        },
+        {
+            name: 'items',
+            title: mixins.$t('goodsDetail'), //'商品明细',
+            color: '#E4002B',
+            controls: [{ card: 'relation', code: 'sourceNo' }],
+            displayNum: 2
+        }, {
+            name: 'other',
+            title: mixins.$t('otherInfo'), //'其他信息'
+        }
         ],
         contentObj: {
 
             wh: [{
-              code: 'supId',
-              name: 'supName',
-              title: mixins.$t('supplier'), //'供应商',
-              type: 'choose',
-              required: true,
-              urlKey: 'chooseSupplier'
-          },{
+                code: 'supId',
+                name: 'supName',
+                title: mixins.$t('supplier'), //'供应商',
+                type: 'choose',
+                required: true,
+                urlKey: 'chooseSupplier'
+            }, {
                 code: 'whId',
                 name: 'whName',
                 title: mixins.$t('eiWhName'), //'预计入库仓库',
@@ -85,16 +91,16 @@ Page({
                 type: 'date',
                 required: true,
                 title: mixins.$t('erDate'), //'预计入库日期',
-            }, ], 
+            },],
             relation: [{
                 code: 'sourceNo',
                 name: 'fromNo',
-                type: 'choose', 
+                type: 'choose',
                 title: mixins.$t('sourceOrder'), //'关联源单'
-                controlChooseFlag:true,
+                controlChooseFlag: true,
                 urlKey: 'chooseSaleOrder'
             }],
-            items: [ ],
+            items: [],
 
             other: [{
                 code: 'remarks',
@@ -111,29 +117,29 @@ Page({
         // 路由
         routeObjName: 'purchase',
     },
-     /**
- * @desc :处理保存后续
- * @date : 2024/2/1 15:49
- * @author : 王英杰
- */
-  handleData() {
-    let cardList_ = this.data.cardList
-    let contentList_ = this.data.contentList
-    cardList_.forEach(card => {  //商品明细右下角 合计
-      if (card.name === 'items') {
-          card.itemAmt = 0
-      }
-  })
-  contentList_.forEach(card => { // 按钮上 dk-save-botton 上的商品明细合计
-      if (card.code === 'amount') {
-          card.content = 0
-      }
-  })
-    this.setData({
-      cardList:cardList_,
-      contentList:contentList_
-    })
-  },
+    /**
+* @desc :处理保存后续
+* @date : 2024/2/1 15:49
+* @author : 王英杰
+*/
+    handleData() {
+        let cardList_ = this.data.cardList
+        let contentList_ = this.data.contentList
+        cardList_.forEach(card => {  //商品明细右下角 合计
+            if (card.name === 'items') {
+                card.itemAmt = 0
+            }
+        })
+        contentList_.forEach(card => { // 按钮上 dk-save-botton 上的商品明细合计
+            if (card.code === 'amount') {
+                card.content = 0
+            }
+        })
+        this.setData({
+            cardList: cardList_,
+            contentList: contentList_
+        })
+    },
     /**
      * @desc   : 绑定数据
      * @author : 王英杰
@@ -164,9 +170,9 @@ Page({
         }
         if (code == "sourceNo") { //来源单 
             this.convertGoods(data.choooseItemList)
-                       // 刷新商品明细 显示 查看更多
-     let card = this.data.cardList.filter(it => it.name == 'items');
-     this.selectComponent('#'+this.data.formName).handleContentObj(card[0])
+            // 刷新商品明细 显示 查看更多
+            let card = this.data.cardList.filter(it => it.name == 'items');
+            this.selectComponent('#' + this.data.formName).handleContentObj(card[0])
             return
         }
 
@@ -185,9 +191,9 @@ Page({
         const orderNoArray = [...new Set(choooseItemList.map(item => item.orderNo))];
         const orderIdArray = [...new Set(choooseItemList.map(item => item.orderId))];
         // 将数组元素转换为逗号分隔的字符串
-       formData.fromNos = this.isArrayWithSingleNull(orderNoArray) ? []:orderNoArray.join(',').split(',')  //来源单号
-        formData.fromIds = this.isArrayWithSingleNull(orderIdArray)?[]:orderIdArray.join(',').split(',') //来源单id
-        formData.fromNo = orderNoArray.join(','); 
+        formData.fromNos = this.isArrayWithSingleNull(orderNoArray) ? [] : orderNoArray.join(',').split(',')  //来源单号
+        formData.fromIds = this.isArrayWithSingleNull(orderIdArray) ? [] : orderIdArray.join(',').split(',') //来源单id
+        formData.fromNo = orderNoArray.join(',');
         let cardList_ = this.data.cardList
         cardList_.forEach(card => { //循环出商品总共价格
             if (card.name === 'items') {
@@ -206,13 +212,13 @@ Page({
             element.priceStd = element.priceStandard
             element.fromId = element.orderId
             element.fromItemId = element.itemId
-            element.pricePur =  element.pricePur? element.pricePur:element.pricePurchase
+            element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
             element.amtStd = Number(element.priceStd * element.itemQty) //标价金额
             element.priceDiscount = (Number(element.pricePurchase) / Number(element.priceStandard)) * 100;
             element.nonStdCode = element.nonStdCode ? element.nonStdCode : '' // 色号  批次号   
             if (element.flgSubUnit) {
-              element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
-              element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
+                element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
+                element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
             }
         });
         formData.goodsList = choooseItemList
@@ -240,7 +246,7 @@ Page({
                 }
             })
             cardList.forEach(card => {
-                if (card.name === 'items') { 
+                if (card.name === 'items') {
                     card.itemAmt = 0
                 }
             })
@@ -254,85 +260,85 @@ Page({
         })
 
     },
-     /**
-     * @desc : 判断出 数组 arr 是否是 [null] 的数据
-     * @date : 2024/2/1 15:49
-     * @author : 王英杰
-     */
-     isArrayWithSingleNull(arr) {  
+    /**
+    * @desc : 判断出 数组 arr 是否是 [null] 的数据
+    * @date : 2024/2/1 15:49
+    * @author : 王英杰
+    */
+    isArrayWithSingleNull(arr) {
         // 检查是否是一个数组  
-        if (!Array.isArray(arr)) {  
-            return false;  
-        }  
-          
+        if (!Array.isArray(arr)) {
+            return false;
+        }
+
         // 检查数组长度是否为1  
-        if (arr.length !== 1) {  
-            return false;  
-        }  
-          
+        if (arr.length !== 1) {
+            return false;
+        }
+
         // 检查数组中的元素是否为null  
-        return arr[0] === null;  
+        return arr[0] === null;
     },
-    openChoosedItemInfo(e){
+    openChoosedItemInfo(e) {
         let popContent_ = this.data.popContent
-          popContent_.forEach(card => { //
+        popContent_.forEach(card => { //
             if (card.code === 'itemQty') {
                 card.max = 1
             }
         })
-        this.setData({ 
-            popContent:popContent_, 
+        this.setData({
+            popContent: popContent_,
         })
     },
-       /**
-   * @desc : 2024-04-28类型转成时间戳
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
-   */
-  convertDateToMillisecondsTimestamp(dateString) {  
-    // 创建Date对象  
-    const date = new Date(`${dateString}T00:00:00Z`); // 假设dateString是YYYY-MM-DD格式,并添加T00:00:00Z使其成为ISO 8601格式  
-    // 获取毫秒级时间戳  
-    const timestamp = date.getTime();  
-    return timestamp;  
-}  ,
+    /**
+* @desc : 2024-04-28类型转成时间戳
+* @date : 2024/2/1 15:49
+* @author : 王英杰
+*/
+    convertDateToMillisecondsTimestamp(dateString) {
+        // 创建Date对象  
+        const date = new Date(`${dateString}T00:00:00Z`); // 假设dateString是YYYY-MM-DD格式,并添加T00:00:00Z使其成为ISO 8601格式  
+        // 获取毫秒级时间戳  
+        const timestamp = date.getTime();
+        return timestamp;
+    },
     /**
      * @desc : 给表单赋值
      * @date : 2024/2/1 15:49
      * @author : 王英杰
      */
     setValuesByEdit(data) {
-        data.goodsList = data.purchaseItemResponseList 
+        data.goodsList = data.purchaseItemResponseList
         // 提取purNo字段为数组,并去重
-        const orderNoArray = [...new Set( data.goodsList.map(item => item.orderNo))];
-        const orderIdArray = [...new Set( data.goodsList.map(item => item.orderId))];
+        const orderNoArray = [...new Set(data.goodsList.map(item => item.orderNo))];
+        const orderIdArray = [...new Set(data.goodsList.map(item => item.orderId))];
         // 将数组元素转换为逗号分隔的字符串 
-       
-        data.fromNos = this.isArrayWithSingleNull(orderNoArray) ? []:orderNoArray.join(',').split(',')  //来源单号
-        data.fromIds = this.isArrayWithSingleNull(orderIdArray)?[]:orderIdArray.join(',').split(',') //来源单id
-        data.fromNo = orderNoArray.join(','); 
+
+        data.fromNos = this.isArrayWithSingleNull(orderNoArray) ? [] : orderNoArray.join(',').split(',')  //来源单号
+        data.fromIds = this.isArrayWithSingleNull(orderIdArray) ? [] : orderIdArray.join(',').split(',') //来源单id
+        data.fromNo = orderNoArray.join(',');
         data.goodsList.forEach(element => {
             element.chooseFlg = "biu" //辨别选品标识
             element.priceStd = element.priceStandard
-            element.pricePur =  element.pricePur? element.pricePur:element.pricePurchase
+            element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
             element.amtStd = Number(element.priceStd * element.itemQty) //标价金额
-            element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;  
-            element['itemQty_min'] = Number(element.intoingQty+element.intoQty) 
-            if(element.intoingQty>0||element.intoQty>0){
+            element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;
+            element['itemQty_min'] = Number(element.intoingQty + element.intoQty)
+            if (element.intoingQty > 0 || element.intoQty > 0) {
                 element.deleteFlag = false
                 element.message = '商品已转入库不能删除'
             }
             if (element.skuImages && element.skuImages.length > 0) { //处理图片
-              element.skuImages.forEach(item => {
-                item.url = config.image_url + item.path
-              });
-              element.imagesUrl = element.skuImages[0].url
+                element.skuImages.forEach(item => {
+                    item.url = config.image_url + item.path
+                });
+                element.imagesUrl = element.skuImages[0].url
             }
             if (element.flgSubUnit) {
-              element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
-              element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
+                element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
+                element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
             }
-            element.sumPrice =   element.pricePur * element.itemQty
+            element.sumPrice = element.pricePur * element.itemQty
         });
         data.supName = data.supplierName
         let cardList_ = this.data.cardList
@@ -349,19 +355,19 @@ Page({
                 card.content = data.goodsList.sum("itemAmt")
             }
         })
-  
-        let  dataTime =  this.convertDateToMillisecondsTimestamp(data.pickupDate)
+
+        let dataTime = this.convertDateToMillisecondsTimestamp(data.pickupDate)
         this.setData({
-          dataTime:dataTime,
+            dataTime: dataTime,
             item: data,
             contentList: contentList_,
             cardList: cardList_,
-            popContent:popContent_,
+            popContent: popContent_,
             formData: JSON.stringify(data)
         })
-             // 刷新商品明细 显示 查看更多
-     let card = this.data.cardList.filter(it => it.name == 'items');
-     this.selectComponent('#'+this.data.formName).handleContentObj(card[0])
+        // 刷新商品明细 显示 查看更多
+        let card = this.data.cardList.filter(it => it.name == 'items');
+        this.selectComponent('#' + this.data.formName).handleContentObj(card[0])
     },
 
 
@@ -377,17 +383,17 @@ Page({
         let totalAmout = Number(0)
         // 各个明细的金额数量
         formData.goodsList.forEach(element => { //循环出商品总共价格   
-            element.priceStd = element.priceStandard 
-            element.pricePur =  element.pricePur? element.pricePur:element.pricePurchase
+            element.priceStd = element.priceStandard
+            element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
             element.itemAmt = element.pricePur * element.itemQty
             element.amtStd = element.priceStd * element.itemQty
             element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;
             totalAmout += Number(element.pricePur * element.itemQty)
-            element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName 
-            element.sumPricePur =   element.pricePur * element.itemQty
-            element.sumPrice =   element.pricePur * element.itemQty
+            element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
+            element.sumPricePur = element.pricePur * element.itemQty
+            element.sumPrice = element.pricePur * element.itemQty
         })
-        
+
         // 左下角的合计金额
         contentList_.forEach(card => {
             if (card.code === 'amount') {
@@ -418,11 +424,11 @@ Page({
     setParams(params) {
         let formData = JSON.parse(this.data.formData)
         let totalAmout = Number(0)
-        formData.goodsList.forEach((element,index) => {
+        formData.goodsList.forEach((element, index) => {
             element.itemId = (this.data.formMode == Constants.formMode.add) ? null : element.itemId
-            totalAmout += Number(element.priceStd )*Number( element.itemQty) //标价金额
+            totalAmout += Number(element.priceStd) * Number(element.itemQty) //标价金额
             element.itemIndex = index
-            element.priceDiscount =element.priceStandard==0?0: Number(element.pricePur)/Number(element.priceStandard)
+            element.priceDiscount = element.priceStandard == 0 ? 0 : Number(element.pricePur) / Number(element.priceStandard)
         })
         params.fromIds = formData.fromIds
         params.fromNos = formData.fromNos
@@ -439,7 +445,7 @@ Page({
         params.whId = formData.whId // 仓库
         params.remarks = formData.remarks // 备注
         params.makeStaff = app.globalData.user.staffId // 制单人    
-      
+
         const deleteLisr = formData.deleteList ? formData.deleteList.filter(li => li.chooseFlg !== null && li.chooseFlg !== undefined && li.chooseFlg !== '') : [];
         params.deleteItemList = deleteLisr
         if (this.data.formMode == "edit") {
@@ -448,7 +454,7 @@ Page({
         } else {
             params.purchaseItemVOList = formData.goodsList //商品明细
         }
-        params.makeStaff = app.globalData.user.staffId  
+        params.makeStaff = app.globalData.user.staffId
         params.annexPaths = formData.annexPaths || [] //附件 
         console.log("save", this.data.params);
         return params
@@ -488,46 +494,46 @@ Page({
         }
 
     },
-         /**
-     * @desc : 返回 后一天 时间戳
-     * @date : 2024/2/1 15:49
-     * @author : 王英杰
-     */
-      getTomorrowsDateTimestamp() {  
-      // 创建一个表示当前日期和时间的 Date 对象  
-      let now = new Date();  
-      
-      // 将日期增加一天以获取明天的日期  
-      now.setDate(now.getDate() + 1);  
-      
-      // 设置时间为 00:00:00,即不带时分秒  
-      now.setHours(0, 0, 0, 0);  
-      
-      // 获取不带时分秒的时间戳  
-      let timestamp = now.getTime();  
-      
-      // 返回时间戳  
-      return timestamp;  
+    /**
+* @desc : 返回 后一天 时间戳
+* @date : 2024/2/1 15:49
+* @author : 王英杰
+*/
+    getTomorrowsDateTimestamp() {
+        // 创建一个表示当前日期和时间的 Date 对象  
+        let now = new Date();
+
+        // 将日期增加一天以获取明天的日期  
+        now.setDate(now.getDate() + 1);
+
+        // 设置时间为 00:00:00,即不带时分秒  
+        now.setHours(0, 0, 0, 0);
+
+        // 获取不带时分秒的时间戳  
+        let timestamp = now.getTime();
+
+        // 返回时间戳  
+        return timestamp;
     },
-     /**
-     * @desc : 返回 后一天 YYYY-MM-DD 的日期
-     * @date : 2024/2/1 15:49
-     * @author : 王英杰
-     */
-      getTomorrowsDateString() {  
-      // 创建一个表示当前日期和时间的 Date 对象  
-      let now = new Date();  
-      
-      // 将日期增加一天以获取明天的日期  
-      now.setDate(now.getDate() + 1);  
-      
-      // 获取年份、月份和日期  
-      let year = now.getFullYear();  
-      let month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从 0 开始的,所以要加 1,并用 0 填充到两位数  
-      let date = String(now.getDate()).padStart(2, '0'); // 用 0 填充到两位数  
-      
-      // 组合成字符串并返回  
-      return `${year}-${month}-${date}`;  
+    /**
+    * @desc : 返回 后一天 YYYY-MM-DD 的日期
+    * @date : 2024/2/1 15:49
+    * @author : 王英杰
+    */
+    getTomorrowsDateString() {
+        // 创建一个表示当前日期和时间的 Date 对象  
+        let now = new Date();
+
+        // 将日期增加一天以获取明天的日期  
+        now.setDate(now.getDate() + 1);
+
+        // 获取年份、月份和日期  
+        let year = now.getFullYear();
+        let month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从 0 开始的,所以要加 1,并用 0 填充到两位数  
+        let date = String(now.getDate()).padStart(2, '0'); // 用 0 填充到两位数  
+
+        // 组合成字符串并返回  
+        return `${year}-${month}-${date}`;
     },
     /**
      * @desc : 页面初始化加载方法
@@ -536,7 +542,7 @@ Page({
      */
     loadInit() { //以销定采  isSourceOrderFlag 区分是否来源于新建的选择原单 
         let that = this
-    
+
         let formMode = this.data.formMode
         const eventChannel = this.getOpenerEventChannel()
         eventChannel.on('params', function (data) {
@@ -556,16 +562,16 @@ Page({
             wx.setNavigationBarTitle({
                 title: mixins.$t('addPurOrder') //"新建采购订单",
             })
-              //下面的赋值 只能新建赋值 编辑在setValuesByEdit里赋值
+            //下面的赋值 只能新建赋值 编辑在setValuesByEdit里赋值
             let formdata = JSON.parse(this.data.formData)
             //.预计入库日期默认赋值“后一天”,预计入库仓库默认附上当前登录人所在组织的默认仓库,如组织上没有没人仓库,去找基础资料中仓库的默认值附上
-          let  dataTime = this.getTomorrowsDateTimestamp()
+            let dataTime = this.getTomorrowsDateTimestamp()
             formdata.pickupDate = this.getTomorrowsDateString()
             formdata.whId = app.globalData.user.defaultWhId
-            formdata.whName = app.globalData.user.defaultWhName 
+            formdata.whName = app.globalData.user.defaultWhName
             this.setData({
-              dataTime:dataTime,
-              formData:JSON.stringify(formdata)
+                dataTime: dataTime,
+                formData: JSON.stringify(formdata)
             })
         }
 

+ 61 - 55
package-purchase/pages/purchase-order/purchase-order-detail/purchase-order-detail.js

@@ -31,7 +31,7 @@ Page({
     }],
     cardList: [{
       name: 'items',
-      title:  mixins.$t('goodsDetail'),//'商品明细',
+      title: mixins.$t('goodsDetail'),//'商品明细',
       chooseGoodsFlag: '',
       itemAmt: '',
       displayNum: 2
@@ -57,78 +57,84 @@ Page({
       other: [{
         code: 'remarks',
         type: 'textarea',
-        readonly:true,
-        title:  mixins.$t('remarks'),//'备注'
+        readonly: true,
+        title: mixins.$t('remarks'),//'备注'
       }, {
         code: 'file',
         type: 'uploader',
-        readonly:true,
-        title:  mixins.$t('uploader'),//'附件'
+        readonly: true,
+        title: mixins.$t('uploader'),//'附件'
       }]
     },
     popContent: [
-      { code: 'pricePur', type: 'number', title: mixins.$t("pricePur"), required: true },{
-            code: 'itemQty',
-            type: 'step',
-            title: mixins.$t('count'), //'数量',
-            required: true, 
-        },
-        { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"),readonly:true   },
-        {
-            code: 'skuSpec',
-            title: mixins.$t('goodSpec'), //'规格',
-            type: 'str',
-            readonly: true,
-        },
-        {
-            code: 'nonStdCode',
-            title: mixins.$t('goodsBatch'), //'色号',
-            type: 'str',
-            tip: mixins.$t('tipPop'),
-        },
+      { code: 'pricePur', type: 'number', title: mixins.$t("pricePur"), required: true }, {
+        code: 'itemQty',
+        type: 'step',
+        title: mixins.$t('count'), //'数量',
+        required: true,
+      },
+      { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), readonly: true },
+      {
+        code: 'skuSpec',
+        title: mixins.$t('goodSpec'), //'规格',
+        type: 'str',
+        readonly: true,
+      },
+      {
+        code: 'brandName',
+        title: mixins.$t('brandName'),
+        type: 'str',
+        readonly: true,
+      },
+      {
+        code: 'nonStdCode',
+        title: mixins.$t('goodsBatch'), //'色号',
+        type: 'str',
+        tip: mixins.$t('tipPop'),
+      },
     ],
     // 路由
     routeObjName: 'purchase',
   },
 
-   /**
-   * @desc : 入库数量、退货数量、退货出库跳转
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
-   */
-  toJumpPage(e){ 
+  /**
+  * @desc : 入库数量、退货数量、退货出库跳转
+  * @date : 2024/2/1 15:49
+  * @author : 王英杰
+  */
+  toJumpPage(e) {
     let quantity = e.currentTarget.dataset.quantity
     let type = e.currentTarget.dataset.type
     let item = e.currentTarget.dataset.item
     let url = null
-    if(quantity<=0){
-       return
+    if (quantity <= 0) {
+      return
     }
-    if(type=='inventoryQty'){//入库数量
-      url =  this.data.route.inventoryQty.url
+    if (type == 'inventoryQty') {//入库数量
+      url = this.data.route.inventoryQty.url
     }
-    if(type=='returnQty'){//退货数量
-      url =  this.data.route.returnQty.url
+    if (type == 'returnQty') {//退货数量
+      url = this.data.route.returnQty.url
     }
-    if(type=='returnAndOutbound'){//退货出库跳转
-      url =  this.data.route.returnAndOutbound.url
+    if (type == 'returnAndOutbound') {//退货出库跳转
+      url = this.data.route.returnAndOutbound.url
     }
- 
-    if(url){
+
+    if (url) {
       wx.navigateTo({
-        url: url ,
+        url: url,
         events: {
           // 回调后,在这里给页面赋值
-          bandData: function (e) {}
+          bandData: function (e) { }
         },
         success: function (res) {
           res.eventChannel.emit('params', {
-            item: {purNo:item.purNo}, 
+            item: { purNo: item.purNo },
           })
         }
       })
     }
-  
+
   },
 
   /**
@@ -145,18 +151,18 @@ Page({
         element.skuImages.forEach(item => {
           item.url = config.image_url + item.path
         });
-        element.imagesUrl =   element.skuImages[0].url
+        element.imagesUrl = element.skuImages[0].url
       }
       element.priceStd = element.priceStandard
-      element.pricePur =  element.pricePur? element.pricePur:element.pricePurchase
+      element.pricePur = element.pricePur ? element.pricePur : element.pricePurchase
       element.amtStd = Number(element.priceStd * element.itemQty) //标价金额
-      element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;  
+      element.priceDiscount = (Number(element.pricePur) / Number(element.priceStandard)) * 100;
       if (element.flgSubUnit) {
         element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
         element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
       }
-      element.sumPrice =   element.pricePur * element.itemQty
-  });
+      element.sumPrice = element.pricePur * element.itemQty
+    });
     cardList_.forEach(card => {
       if (card.name === 'items') {
         card.itemAmt = data.goodsList.sum("itemAmt")
@@ -168,17 +174,17 @@ Page({
         card.content = data.goodsList.sum("itemAmt")
       }
     })
-    data.sumWarehousing   = Number(data.intoingQty)+Number(data.intoQty)
-   
+    data.sumWarehousing = Number(data.intoingQty) + Number(data.intoQty)
+
     this.setData({
       item: data,
       contentList: contentList_,
       cardList: cardList_,
       formData: JSON.stringify(data)
     })
-     // 刷新商品明细 显示 查看更多
-     let card = this.data.cardList.filter(it => it.name == 'items');
-     this.selectComponent('#'+this.data.formName).handleContentObj(card[0])
+    // 刷新商品明细 显示 查看更多
+    let card = this.data.cardList.filter(it => it.name == 'items');
+    this.selectComponent('#' + this.data.formName).handleContentObj(card[0])
   },
   /**
    * @desc : 关闭
@@ -201,7 +207,7 @@ Page({
       url: this.data.route.add.url,
       events: {
         // 回调后,在这里给页面赋值
-        bandData: function (e) {}
+        bandData: function (e) { }
       },
       success: function (res) {
         res.eventChannel.emit('params', {

+ 111 - 105
package-purchase/pages/purchase-receipt/add/add.js

@@ -33,105 +33,111 @@ Page({
     }],
     btnFormData: null,
     popContent: [{
-        code: 'priceInto',
-        type: 'number',
-        title: mixins.$t("inboundPrice"),
-        required: true
-      },
+      code: 'priceInto',
+      type: 'number',
+      title: mixins.$t("inboundPrice"),
+      required: true
+    },
 
-      {
-        code: 'itemQty',
-        type: 'step',
-        title: mixins.$t("count"), //'数量',
-        required: true
-      },
-      {
-        code: 'packageBox',
-        type: 'packageBox',
-        title: mixins.$t("packageBox"),
-      },
-      // { code: 'intoingBox', type: 'step', title: mixins.$t("goodsBox"), required: true },
-      // { code: 'intoingPiece', type: 'step', title: mixins.$t("goodsPiece"), required: true },
-      {
-        code: 'whId',
-        name: 'whName',
-        title: mixins.$t("warehouseId"), //'仓库',
-        type: 'drop',
-        dropType: 'warehouse',
-        required: true
-      },
-      {
-        code: 'skuSpec',
-        title: mixins.$t("goodSpec"), //'规格',
-        type: 'str',
-        readonly: true,
-      },
-      {
-        code: 'nonStdCode',
-        title: mixins.$t("goodsBatch"), //'色号',
-        type: 'str',
-        tip: mixins.$t('tipPop'),
-      },
-      {
-        code: 'remarks',
-        title: mixins.$t("remarks"), //'备注',
-        type: 'str',
-      },
-    ], 
+    {
+      code: 'itemQty',
+      type: 'step',
+      title: mixins.$t("count"), //'数量',
+      required: true
+    },
+    {
+      code: 'packageBox',
+      type: 'packageBox',
+      title: mixins.$t("packageBox"),
+    },
+    // { code: 'intoingBox', type: 'step', title: mixins.$t("goodsBox"), required: true },
+    // { code: 'intoingPiece', type: 'step', title: mixins.$t("goodsPiece"), required: true },
+    {
+      code: 'whId',
+      name: 'whName',
+      title: mixins.$t("warehouseId"), //'仓库',
+      type: 'drop',
+      dropType: 'warehouse',
+      required: true
+    },
+    {
+      code: 'skuSpec',
+      title: mixins.$t("goodSpec"), //'规格',
+      type: 'str',
+      readonly: true,
+    },
+    {
+      code: 'brandName',
+      title: mixins.$t('brandName'),
+      type: 'str',
+      readonly: true,
+    },
+    {
+      code: 'nonStdCode',
+      title: mixins.$t("goodsBatch"), //'色号',
+      type: 'str',
+      tip: mixins.$t('tipPop'),
+    },
+    {
+      code: 'remarks',
+      title: mixins.$t("remarks"), //'备注',
+      type: 'str',
+    },
+    ],
     cardList: [{
-        name: 'main',
-      }, {
-        name: 'wh'
-      }, {
-        name: 'relation'
-      },
-      {
-        name: 'items',
-        title: mixins.$t("goodsDetail"), //'商品明细',
-        controls: [{
-          card: 'relation',
-          code: 'sourceNo'
-        }],
-        info: '(' + mixins.$t("warehousingProcessing") + ')',
-        color: '#E4002B',
-        displayNum: 2,
-        controls: [{
-          card: 'relation',
-          code: 'sourceNo'
-        }],
-        contentBottomLeft: [{
-          code: 'remarks',
-          type: "remarks"
-        }]
-      }, {
-        name: 'other',
-        title: mixins.$t("otherInfo"), // '其他信息'
-      }
+      name: 'main',
+    }, {
+      name: 'wh'
+    }, {
+      name: 'relation'
+    },
+    {
+      name: 'items',
+      title: mixins.$t("goodsDetail"), //'商品明细',
+      controls: [{
+        card: 'relation',
+        code: 'sourceNo'
+      }],
+      info: '(' + mixins.$t("warehousingProcessing") + ')',
+      color: '#E4002B',
+      displayNum: 2,
+      controls: [{
+        card: 'relation',
+        code: 'sourceNo'
+      }],
+      contentBottomLeft: [{
+        code: 'remarks',
+        type: "remarks"
+      }]
+    }, {
+      name: 'other',
+      title: mixins.$t("otherInfo"), // '其他信息'
+    }
     ],
     contentObj: {
       main: [{
-          code: 'supId',
-          name: 'supplierName',
-          title: mixins.$t("supplier"), //'供应商',
-          type: 'choose',
-          required: true,
-          urlKey: 'chooseSupplier'
-        },
-        {
-          code: 'staffId',
-          name: 'staffName',
-          title: mixins.$t("procureStaff"), //'采购人',
-          type: 'choose',
-          required: true,
-          urlKey: 'chooseStaff'
-        }, {
-          code: 'orgId',
-          name: 'orgName',
-          title: mixins.$t("procureOrg"), //'采购部门',
-          type: 'choose',
-          required: true,
-          urlKey: 'chooseOrg'
-        },
+        code: 'supId',
+        name: 'supplierName',
+        title: mixins.$t("supplier"), //'供应商',
+        type: 'choose',
+        required: true,
+        urlKey: 'chooseSupplier'
+      },
+      {
+        code: 'staffId',
+        name: 'staffName',
+        title: mixins.$t("procureStaff"), //'采购人',
+        type: 'choose',
+        required: true,
+        urlKey: 'chooseStaff'
+      }, {
+        code: 'orgId',
+        name: 'orgName',
+        title: mixins.$t("procureOrg"), //'采购部门',
+        type: 'choose',
+        required: true,
+        urlKey: 'chooseOrg'
+      },
       ],
       wh: [{
         code: 'whId',
@@ -319,7 +325,7 @@ Page({
     data.fromNo = purNoArray.join(','); //来源单号
     purIdArray_ = purIdArray.join(',');
 
-    data.goodsList.forEach(element => { 
+    data.goodsList.forEach(element => {
       if (element.intoStatus == Constants.intoStatus.inBounded) //"入库状态-已入库"
       {
         element.itemAmt = element.priceInto * element.intoQty
@@ -331,11 +337,11 @@ Page({
         element.itemQty = element.intoingQty
         element.box = element.intoingBox
         element.piece = element.intoingPiece
-      } 
-      element.sumPrice =   element.priceInto * element.itemQty
+      }
+      element.sumPrice = element.priceInto * element.itemQty
       //设置商品明细输入数量 最大 最小限制
-       element['itemQty_max'] = element.itemQty
-       element['itemQty_min'] = 1
+      element['itemQty_max'] = element.itemQty
+      element['itemQty_min'] = 1
       if (data.whId) {
         element.whId = data.whId
         element.whName = data.whName
@@ -348,7 +354,7 @@ Page({
       }
       if (element.flgSubUnit) {
         element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
-        element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName 
+        element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
       }
 
     });
@@ -505,9 +511,9 @@ Page({
         element.intoQty = 0 //  已入库数量
 
       }
-      element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName 
-      element.sumPricePur =   element.pricePur * element.itemQty
-      element.sumPrice =   element.priceInto * element.itemQty
+      element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
+      element.sumPricePur = element.pricePur * element.itemQty
+      element.sumPrice = element.priceInto * element.itemQty
       totalAmout += Number(element.priceInto) * Number(element.itemQty)
     })
     // 左下角的合计金额
@@ -624,7 +630,7 @@ Page({
         } else {
           item.intoingBox = item.box
           item.intoingPiece = item.piece
-        } 
+        }
       })
     }
 
@@ -694,7 +700,7 @@ Page({
    * @author : 王英杰
    */
   loadInit() {
- 
+
     let flgHandleSetting = this.data.flgHandleSetting //true为自动办理  false 为手动办理
     let contentList = this.data.contentList
     if (flgHandleSetting) { //系统参数中的自动办理参数  隐藏左下角cheakbox

+ 6 - 0
package-purchase/pages/purchase-receipt/detail/detail.js

@@ -99,6 +99,12 @@ Page({
         readonly: true
       },
       {
+        code: 'brandName',
+        title: mixins.$t('brandName'), 
+        type: 'str',
+        readonly:true,
+    },
+      {
         code: 'nonStdCode',
         title: mixins.$t("goodsBatch"), //'色号',
         type: 'str',

+ 6 - 0
package-sales/pages/order-billing/add/add.js

@@ -74,6 +74,12 @@ Page({
       {
         code: 'whId', name: 'whName', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'openingInventory',
       },
+      {
+        code: 'brandName',
+        title: mixins.$t('brandName'), 
+        type: 'str',
+        readonly:true,
+    },
       { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
       { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', tipFlag: true },
       {

+ 20 - 5
package-sales/pages/order-return/add/add.js

@@ -136,7 +136,8 @@ Page({
     //按钮
     buttonSaveList: [{
         code: 'refund',
-        title: mixins.$t("refund")
+        width:"200rpx",
+        title:  mixins.$t("refundSave")
       },
       {
         code: 'save',
@@ -181,6 +182,12 @@ Page({
         urlKey: 'openingInventory',
       },
       {
+        code: 'brandName',
+        title: mixins.$t('brandName'), 
+        type: 'str',
+        readonly:true,
+    },
+      {
         code: 'nonStdCode',
         title: mixins.$t("goodsBatch"),
         type: 'str',
@@ -388,7 +395,8 @@ Page({
           res.outingAmt = res.outAmt * -1
           res.outingQty = res.outQty * -1
           res['outingQty_min'] = res.outQty * -1
-          res['outingQty_max'] = Number(-1)
+          res['outingQty_max'] = 0
+          console.log('111111111111111');
         })
 
 
@@ -607,7 +615,7 @@ Page({
         formData.address = this.setAddress(formData)
 
         res.data.data.dataItem.forEach(item => {
-          item.outingQty_max = -1
+          item.outingQty_max = 0
           item.priceStd = item.priceOut
           //处理图片
           if (item.skuImages) {
@@ -619,7 +627,7 @@ Page({
           }
           
 
-
+          console.log('22222222222');
           item.outingQty_min = item.canOutingQty ? item.canOutingQty : item.invQty * -1 //可出库最大值
         })
 
@@ -1019,7 +1027,8 @@ Page({
           //按钮
           buttonSaveList =  [{
             code: 'refund',
-            title: mixins.$t("refund")
+            width:"200rpx",
+            title:  mixins.$t("refundSave")
           },
           {
             code: 'save',
@@ -1086,6 +1095,12 @@ Page({
               urlKey: 'openingInventory',
             },
             {
+              code: 'brandName',
+              title: mixins.$t('brandName'), 
+              type: 'str',
+              readonly:true,
+          },
+            {
               code: 'nonStdCode',
               title: mixins.$t("goodsBatch"),
               type: 'str',

+ 9 - 1
package-sales/pages/sales-outbound/add/add.js

@@ -201,6 +201,12 @@ Page({
         urlKey: 'openingInventory',
       },
       {
+        code: 'brandName',
+        title: mixins.$t('brandName'), 
+        type: 'str',
+        readonly:true,
+    },
+      {
         code: 'nonStdCode',
         title: mixins.$t("goodsBatch"),
         type: 'str',
@@ -1414,7 +1420,8 @@ Page({
         //按钮
         buttonSaveList = [{
             code: 'collection',
-            title: mixins.$t("collection")
+            width:"200rpx",
+            title: mixins.$t("paySave")
           },
           {
             code: 'save',
@@ -1423,6 +1430,7 @@ Page({
         ]
         let btnFormData = JSON.parse(this.data.btnFormData) || {}
         btnFormData.flag = true
+          
         this.setData({
           btnFormData: JSON.stringify(btnFormData),
           buttonSaveList: buttonSaveList

+ 74 - 0
pages/home-page/home-page.js

@@ -139,6 +139,9 @@ Page({
         ],
       },
     ],
+    // 功能模块组件高度和宽度
+    funcViewHeight: 0,
+    funcViewWidth: 0
   },
   /**
   * @desc : 切换公司
@@ -454,6 +457,19 @@ Page({
 
     }
 
+    // 获取功能卡片模块高度 以便设置水印蒙版高度
+    const that = this;
+    let query = wx.createSelectorQuery();
+    query.select('.func').boundingClientRect(rect=>{
+      let height = rect.height;
+      let width = rect.width;
+      console.log('组件高度', height);
+      that.setData({
+        funcViewWidth: width,
+        funcViewHeight: height
+      })
+      that.drawWatermark('watermarkCanvas', '专业版功能', width * 2, height * 2)
+    }).exec();
 
     //小程序推送消息传过来的值 pages/login/login?loginType=1&otherParam=值
     // loginType 
@@ -462,5 +478,63 @@ Page({
 
   },
 
+  /** 
+   * 水印配置
+   * @author 刘尧
+   * @date 2024.5.30
+   * */
+  drawWatermark(canvasName, watermarkText, width, height) {  
+    const ctx = wx.createCanvasContext(canvasName); // 创建 canvas 上下文  
+    // 水印配置  
+    const watermarkConfiguration = {  
+      watermarkText: watermarkText, // 水印文本  
+      watermarkFontSize: 14, // 水印字体大小  
+      watermarkColor: '#aaa', // 水印字体颜色  
+      watermarkAngle: -25, // 水印倾斜度数  
+      watermarkOpacity: 0.5, // 水印透明度  
+      watermarkInterval: 50, // 水印之间的间隔  
+    };  
+    const canvasWidth = width; // canvas 宽度  
+    const canvasHeight = height; // canvas 高度  
+    // 设置 canvas 样式和全局属性  
+    ctx.setGlobalAlpha(watermarkConfiguration.watermarkOpacity);  
+    ctx.setFontSize(watermarkConfiguration.watermarkFontSize);  
+    ctx.setFillStyle(watermarkConfiguration.watermarkColor);  
+    // 计算单个水印文本的宽度和高度  
+    const textWidth = ctx.measureText(watermarkConfiguration.watermarkText).width;  
+    const textHeight = watermarkConfiguration.watermarkFontSize;  
+    // 计算可以放置水印的行数和列数  
+    const numColumns = Math.floor(canvasWidth / (textWidth + watermarkConfiguration.watermarkInterval));  
+    const numRows = Math.floor(canvasHeight / (textHeight + watermarkConfiguration.watermarkInterval));  
+    // 绘制水印  
+    for (let i = 0; i < numRows; i++) {  
+      for (let j = 0; j < numColumns; j++) {  
+        // 计算水印位置  
+        const x = j * (textWidth + watermarkConfiguration.watermarkInterval);  
+        const y = i * (textHeight + watermarkConfiguration.watermarkInterval);  
+        // 保存当前状态  
+        ctx.save();  
+        // 旋转坐标系以绘制倾斜的水印  
+        ctx.translate(x + textWidth / 2, y + textHeight / 2); 
+        ctx.rotate(watermarkConfiguration.watermarkAngle * Math.PI / 180);  
+        ctx.fillText(watermarkConfiguration.watermarkText, -textWidth / 2, -textHeight / 2);  
+        // 恢复之前保存的状态  
+        ctx.restore();  
+      }  
+    }  
+    
+    // 绘制到 canvas 上  
+    ctx.draw();  
+  },
+  /**
+   * 水印点击事件
+   * @author 刘尧
+   * @date 2024.5.30
+   */
+  masksClick(){
+    wx.navigateTo({
+      url: '/package-basic-data/pages/register/product-detail/product-detail',
+    })
+  }
 })
 

+ 4 - 0
pages/home-page/home-page.wxml

@@ -74,6 +74,10 @@
   <!-- 功能卡片 -->
   <view wx:if="{{advertisementList && advertisementList.length == 0}}" style="margin-top: 10rpx;"></view>
   <view class="func">
+    <!-- 水印模块 -->
+    <view class="permissions-masks-fa" catchtap="masksClick" style="height: {{ funcViewHeight }}px;">
+      <canvas canvas-id="watermarkCanvas" id="watermarkCanvas" style="width: {{funcViewWidth}}px; height: {{ funcViewHeight }}px;"></canvas>
+    </view>
     <view style="display:flex;flex-wrap: wrap;justify-content: center;">
       <view class="func-card-blue" wx:for="{{functionRegionItems}}" wx:for-item="item" wx:key="index" style="background: {{item.background}};">
         <!-- 卡片头部 -->

+ 10 - 0
pages/home-page/home-page.wxss

@@ -361,4 +361,14 @@ image {
   transform: scale(calc(0.8 + var(--index) / 10));
   margin-left: calc(var(--left) * 80rpx);
   z-index: var(--index);
+}
+
+.permissions-masks-fa {
+  position: absolute;
+  z-index: 10000;
+  left: 40rpx;
+  right: 40rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }

+ 6 - 0
pages/shopping/shopping.js

@@ -56,6 +56,12 @@ Page({
         
       },
       {
+        code: 'brandName',
+        title: mixins.$t('brandName'), 
+        type: 'str',
+        readonly:true,
+    },
+      {
         code: 'nonStdCode',
         title: '色号',
         type: 'str',

+ 7 - 0
utils/Constants.js

@@ -223,6 +223,13 @@ module.exports = {
   },
   ],
 
+   // 初始款项
+   initialPayType: {
+    none: '初始款项-无',
+    debt: '初始款项-欠款',
+    payment: '初始款项-预收', 
+  },
+
   // 收付款类型
   rpType: {
     receipt: '收付款类型-收款',