王英杰 1 anno fa
parent
commit
38ab6a9570

+ 1 - 0
app.wxss

@@ -608,6 +608,7 @@ end
 /**数量计数器 start**/
 /**数量计数器 start**/
 .van-stepper__input{
 .van-stepper__input{
   background: transparent !important;
   background: transparent !important;
+  width: 50% !important;
 }
 }
 
 
 .van-stepper__plus{
 .van-stepper__plus{

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

@@ -171,7 +171,7 @@ Component({
     // 是否只读
     // 是否只读
     readonly: {
     readonly: {
       type: Boolean,
       type: Boolean,
-    }, 
+    },
     titpsFlag: { //商品右上角信息
     titpsFlag: { //商品右上角信息
       type: Boolean,
       type: Boolean,
       value: false
       value: false
@@ -284,7 +284,7 @@ Component({
       type: String,
       type: String,
       value: '合计金额'
       value: '合计金额'
     },
     },
-    customerReadonly:{
+    customerReadonly: {
       type: Boolean,
       type: Boolean,
       value: false
       value: false
     },
     },
@@ -599,15 +599,15 @@ Component({
       } else { //外协品走
       } else { //外协品走
         //  全-免费版-销售出库-新建、编辑、详情-外协品-抽屉不展示库存量、仓库字段 商品品牌 色号 
         //  全-免费版-销售出库-新建、编辑、详情-外协品-抽屉不展示库存量、仓库字段 商品品牌 色号 
         popContent_sku = popContent_
         popContent_sku = popContent_
-        let whId_index = popContent_.findIndex(element => element.code == 'whId');  
+        let whId_index = popContent_.findIndex(element => element.code == 'whId');
         if (whId_index !== -1) {
         if (whId_index !== -1) {
           // 找到了满足条件的元素,index 是它的索引   
           // 找到了满足条件的元素,index 是它的索引   
           popContent_sku.splice(whId_index, 1)
           popContent_sku.splice(whId_index, 1)
-        }  
+        }
         let brandName_index = popContent_.findIndex(element => element.code == 'brandName');
         let brandName_index = popContent_.findIndex(element => element.code == 'brandName');
         if (brandName_index !== -1) {
         if (brandName_index !== -1) {
           popContent_sku.splice(brandName_index, 1)
           popContent_sku.splice(brandName_index, 1)
-        } 
+        }
         let nonStdCode_index = popContent_.findIndex(element => element.code == 'nonStdCode');
         let nonStdCode_index = popContent_.findIndex(element => element.code == 'nonStdCode');
         if (nonStdCode_index !== -1) {
         if (nonStdCode_index !== -1) {
           popContent_sku.splice(nonStdCode_index, 1)
           popContent_sku.splice(nonStdCode_index, 1)
@@ -729,8 +729,8 @@ Component({
         //如果设有做大值 判断  箱片的反算数量 大于 数量最大值
         //如果设有做大值 判断  箱片的反算数量 大于 数量最大值
         if (dataItem["itemQty_max"] && itemQty > dataItem["itemQty_max"]) {
         if (dataItem["itemQty_max"] && itemQty > dataItem["itemQty_max"]) {
           //那就吧 把最大值的数量换算 箱片赋值箱片
           //那就吧 把最大值的数量换算 箱片赋值箱片
-          dataItem['box'] = parseInt(Number(dataItem['itemQty']) %  Number(dataItem['packBox']))
-          dataItem['piece'] = Number(dataItem['itemQty']) %  Number(dataItem['packBox'])
+          dataItem['box'] = parseInt(Number(dataItem['itemQty']) % Number(dataItem['packBox']))
+          dataItem['piece'] = Number(dataItem['itemQty']) % Number(dataItem['packBox'])
           dataItem.packageBox = dataItem['box'] + dataItem.subUnitName + dataItem['piece'] + dataItem.unitName
           dataItem.packageBox = dataItem['box'] + dataItem.subUnitName + dataItem['piece'] + dataItem.unitName
           this.setData({
           this.setData({
             dataItem: JSON.stringify(dataItem)
             dataItem: JSON.stringify(dataItem)
@@ -1260,13 +1260,13 @@ Component({
           },
           },
           success: function (res) {
           success: function (res) {
             // 通过eventChannel向被打开页面传送数据
             // 通过eventChannel向被打开页面传送数据
-              res.eventChannel.emit('params', {
-                choose: true,
-                item: e.currentTarget.dataset.type ? e.currentTarget.dataset.type : _this.data.type,
-                noWarehouseFlag: !noWarehouseFlag ? '': noWarehouseFlag,
-                popContent: _this.data.popContent,
-                controlFlags: _this.data.controlFlags
-              })
+            res.eventChannel.emit('params', {
+              choose: true,
+              item: e.currentTarget.dataset.type ? e.currentTarget.dataset.type : _this.data.type,
+              noWarehouseFlag: !noWarehouseFlag ? '' : noWarehouseFlag,
+              popContent: _this.data.popContent,
+              controlFlags: _this.data.controlFlags
+            })
           }
           }
         })
         })
       }
       }
@@ -1543,6 +1543,11 @@ Component({
         code: ds.key
         code: ds.key
       })
       })
     },
     },
+    setchooseVisible(isflag) {
+      this.setData({
+        chooseVisible: isflag
+      })
+    },
     /**
     /**
      * @desc   : 修改数值输入框的值
      * @desc   : 修改数值输入框的值
      * @author : 周兴
      * @author : 周兴
@@ -1860,15 +1865,15 @@ Component({
       }
       }
       let form = this.data.form
       let form = this.data.form
       // 如果删除的是外部的
       // 如果删除的是外部的
-      if(item.show == undefined || item.show){
+      if (item.show == undefined || item.show) {
         let goodsList = form[this.data.itemName]
         let goodsList = form[this.data.itemName]
-        let filters = goodsList.filter(it=>it.show == false);
+        let filters = goodsList.filter(it => it.show == false);
         // 需要把隐藏中的显示出来一条
         // 需要把隐藏中的显示出来一条
-        if(filters && filters.length > 0){
+        if (filters && filters.length > 0) {
           filters[0].show = true;
           filters[0].show = true;
         }
         }
         this.setData({
         this.setData({
-          form:form
+          form: form
         })
         })
       }
       }
 
 
@@ -2313,11 +2318,11 @@ Component({
           dataItem.factPrice = Number(dataItem.priceSale) * Number((Number(dataItem.discount) / 100)) //实际单价  = 销售单价*折扣 
           dataItem.factPrice = Number(dataItem.priceSale) * Number((Number(dataItem.discount) / 100)) //实际单价  = 销售单价*折扣 
           dataItem.factAmt = dataItem.factPrice * dataItem['itemQty'] //实际销售金额= 实际销售单价*数量
           dataItem.factAmt = dataItem.factPrice * dataItem['itemQty'] //实际销售金额= 实际销售单价*数量
         }
         }
-        if (key == "factPrice") { 
+        if (key == "factPrice") {
           dataItem.factPrice = e.detail.value
           dataItem.factPrice = e.detail.value
           dataItem.priceSale = e.detail.value
           dataItem.priceSale = e.detail.value
-          dataItem.factAmt = dataItem.factPrice * dataItem['itemQty']  
-          dataItem.sumPrice = dataItem.priceSale * dataItem['itemQty']  
+          dataItem.factAmt = dataItem.factPrice * dataItem['itemQty']
+          dataItem.sumPrice = dataItem.priceSale * dataItem['itemQty']
         }
         }
       }
       }
       this.setData({
       this.setData({

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

@@ -45,12 +45,12 @@
       </van-field>
       </van-field>
     </view>
     </view>
   </view>
   </view>
-  <!-- 单据信息 -->
+  <!-- 单据信息 --> 
   <view wx:for="{{cardList}}" wx:for-item="card" data-item="{{card}}" wx:for-index="cardIndex"
   <view wx:for="{{cardList}}" wx:for-item="card" data-item="{{card}}" wx:for-index="cardIndex"
    wx:if="{{card.name == 'items' || contentObj[card.name] && contentObj[card.name].length > 0}}">
    wx:if="{{card.name == 'items' || contentObj[card.name] && contentObj[card.name].length > 0}}">
     <view style="display: flex;justify-content: center;align-items: center;" id="{{card.name}}">
     <view style="display: flex;justify-content: center;align-items: center;" id="{{card.name}}">
       <view wx:if="{{ card.name == 'items' && !readonly && chooseVisible && card.chooseGoodsItemFlag}}" style="margin:10rpx 15rpx;text-align: center;flex: 1;">
       <view wx:if="{{ card.name == 'items' && !readonly && chooseVisible && card.chooseGoodsItemFlag}}" style="margin:10rpx 15rpx;text-align: center;flex: 1;">
-        <van-button icon="{{imageUrl + 'choose_goods_sale.png'}}" size="normal" color="#3E69F6" catchtap="openChooseItems" data-item="{{card}}" custom-style="height:70rpx;border-radius:15rpx;width:100%;padding:0" data-index="{{cardIndex}}" type="info">选商品
+        <van-button icon="{{imageUrl + 'choose_goods_sale.png'}}" size="normal" color="#3E69F6" catchtap="openChooseItems" data-item="{{card}}" custom-style="height:70rpx;border-radius:15rpx;width:100%;padding:0" data-index="{{cardIndex}}" type="info">选商品 
         </van-button>
         </van-button>
       </view>
       </view>
       <view wx:if="{{card.name == 'items' && !readonly && chooseVisible &&  card.chooseInventoryFlag}}" style="margin:10rpx 15rpx;text-align: center;flex: 1;">
       <view wx:if="{{card.name == 'items' && !readonly && chooseVisible &&  card.chooseInventoryFlag}}" style="margin:10rpx 15rpx;text-align: center;flex: 1;">

+ 15 - 15
package-purchase/pages/purchase-receipt/add/add.js

@@ -104,11 +104,7 @@ Page({
       controls: [{
       controls: [{
         card: 'relation',
         card: 'relation',
         code: 'sourceNo'
         code: 'sourceNo'
-      }],
-      contentBottomLeft: [{
-        code: 'remarks',
-        type: "remarks"
-      }]
+      }], 
     }, {
     }, {
       name: 'other',
       name: 'other',
       title: mixins.$t("otherInfo"), // '其他信息'
       title: mixins.$t("otherInfo"), // '其他信息'
@@ -199,9 +195,9 @@ Page({
       })
       })
       this.setData({
       this.setData({
         contentList: contentList_,
         contentList: contentList_,
-        cardList,
-        chooseVisible: false,
+        cardList, 
       })
       })
+      this.selectComponent('#' + this.data.formName).setchooseVisible(true)
     }
     }
     this.setData({
     this.setData({
       formData: JSON.stringify(formData)
       formData: JSON.stringify(formData)
@@ -255,10 +251,8 @@ Page({
    */
    */
   setValuesByEdit(data) {
   setValuesByEdit(data) {
     { //是否可编辑逻辑
     { //是否可编辑逻辑
-      if (data.fromId) { //有来源单据
-        this.setData({ //隐藏选商品按钮
-          chooseVisible: true
-        })
+      if (data.fromId) { //有来源单据 
+        this.selectComponent('#' + this.data.formName).setchooseVisible(false)//隐藏选商品按钮
         if (this.data.flgHandleSetting) { //系统参数为自动办理
         if (this.data.flgHandleSetting) { //系统参数为自动办理
           if (this.data.nopay) { //未付款
           if (this.data.nopay) { //未付款
             //大编辑
             //大编辑
@@ -678,7 +672,7 @@ Page({
   getData(e) {
   getData(e) {
     if (!e.idKey) {
     if (!e.idKey) {
       return
       return
-    }
+    } 
     let param = {}
     let param = {}
     let excute = this.excute(this.data.purchaseService, this.data.purchaseService.purSelectId + e.id, {});
     let excute = this.excute(this.data.purchaseService, this.data.purchaseService.purSelectId + e.id, {});
     excute.then(res => {
     excute.then(res => {
@@ -686,9 +680,8 @@ Page({
         let formData = JSON.parse(this.data.formData)
         let formData = JSON.parse(this.data.formData)
         formData = res.data.data
         formData = res.data.data
         this.setData({
         this.setData({
-          formData: JSON.stringify(formData),
-          chooseVisible: true
-        })
+          formData: JSON.stringify(formData), 
+        }) 
         this.calculateTotal(res.data.data.purchaseItemResponseList)
         this.calculateTotal(res.data.data.purchaseItemResponseList)
         // 刷新商品明细 显示 查看更多
         // 刷新商品明细 显示 查看更多
         let card = this.data.cardList.filter(it => it.name == 'items');
         let card = this.data.cardList.filter(it => it.name == 'items');
@@ -756,5 +749,12 @@ Page({
         cardList_
         cardList_
       })
       })
     }
     }
+    if(this.data.formMode == Constants.formMode.other){ //转入库进
+      this.selectComponent('#' + this.data.formName).setchooseVisible(false)
+    }
+  },
+  onLoad(){ 
+      
+   
   },
   },
 })
 })

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

@@ -4,7 +4,7 @@
 <loading wx:if="{{loading}}" ></loading>
 <loading wx:if="{{loading}}" ></loading>
 
 
  
  
-<dk-form-bill type="purInto" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}"  titleCol="skuModel" subCol="calculationFormula"  descCol="skuName" priceCol="priceInto" pupPriceCol="sumPrice" iconCol="imagesUrl"  quantityCol="{{(!intoStatusflag)?'intoQty':'intoingQty'}}" sumAmountCol="itemAmt"sumQuantityCol="itemQty" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle=""   bind:clear = "clear" readonly = "{{readonly}}" chooseVisible="{{!chooseVisible}}" controlFlags ="{{controlFlags}}"
+<dk-form-bill type="purInto" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}"  titleCol="skuModel" subCol="calculationFormula"  descCol="skuName" priceCol="priceInto" pupPriceCol="sumPrice" iconCol="imagesUrl"  quantityCol="{{(!intoStatusflag)?'intoQty':'intoingQty'}}" sumAmountCol="itemAmt"sumQuantityCol="itemQty" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle=""   bind:clear = "clear" readonly = "{{readonly}}"   controlFlags ="{{controlFlags}}"
 bind:delItem="setGoods" bind:setGoods="setGoods" bind:editItems="setGoods" table="{{table}}">
 bind:delItem="setGoods" bind:setGoods="setGoods" bind:editItems="setGoods" table="{{table}}">
 </dk-form-bill>
 </dk-form-bill>
 
 

+ 1 - 1
pages/shopping/shopping.wxml

@@ -165,7 +165,7 @@
 
 
             <view style="display:flex;align-items: center;">
             <view style="display:flex;align-items: center;">
       
       
-                <van-stepper value="{{item.itemQty}}" data-index="{{index}}" min="0" integer="{{true}}" max="999999999"  bind:change="changeAllreadyChooseQuantity" disabled="true" />
+                <van-stepper value="{{item.itemQty}}" data-index="{{index}}" min="0"   max="999999999"  bind:change="changeAllreadyChooseQuantity" disabled="true" />
               </view>
               </view>
           </view>
           </view>
         </view>
         </view>