于继渤 1 anno fa
parent
commit
879472e51b

+ 5 - 1
components/dkbase/dk-number-input/dk-number-input.js

@@ -164,6 +164,10 @@ Component({
       type: Boolean,
       value: true
     },
+    focus:{
+      type: Boolean,
+      value: false
+    },
     dataIndex: {
       type: Number,
     },
@@ -190,7 +194,7 @@ Component({
 
 
   data: {
-    focus: false,
+    // focus: false,
     displayValue: '',
     clearFlag: false,
   },

+ 19 - 5
package-inventory/pages/cost-check/cost-check.js

@@ -163,10 +163,24 @@ Page({
     let index = e.currentTarget.dataset.index
     if (tableData[index]['isFlgCostCheck']) {
       //已经点击补录 无法再次点击
+      // Dialog.alert({
+      //   message: '补录商品中已存在',
+      // }).then(() => {
+      // }).catch(() => {
+      // })
       return
     }
     if (tableData[index].costPrice == 0) {
       //成本价未修改 等于0  无法点击
+      Dialog.alert({
+        message: '输入成本后才可补录',
+      }).then(() => {
+        tableData[index].focus = true
+        this.setData({
+          tableData: tableData
+        })
+      }).catch(() => {
+      })
       return
     }
     tableData[index]['isFlgCostCheck'] = true
@@ -192,10 +206,10 @@ Page({
       tableData[index].itemList.forEach(res => {
         res.costPrice = inputValue
         res.costAmt = Number(res.intoQty * res.costPrice)
-        if(res.outQty){
+        if (res.outQty) {
           res.costAmt = Number(res.outQty * res.costPrice)
         }
-       
+
       })
     }
     this.setData({
@@ -216,7 +230,7 @@ Page({
       choosedGoodsList[index].itemList.forEach(res => {
         res.costPrice = inputValue
         res.costAmt = Number(res.intoQty * res.costPrice)
-        if(res.outQty){
+        if (res.outQty) {
           res.costAmt = Number(res.outQty * res.costPrice)
         }
       })
@@ -274,7 +288,7 @@ Page({
    */
   setSearchParams(params) {
     let formData = JSON.parse(this.data.formData)
-    params.skuIdFlag = this.data.skuIdFlag 
+    params.skuIdFlag = this.data.skuIdFlag
     params.intoDateStart = formData.intoDateStart ? formData.intoDateStart : this.data.dataDefaultSearch[0]
     params.intoDateEnd = formData.intoDateEnd ? formData.intoDateEnd : this.data.dataDefaultSearch[1]
     if (params.intoDateStart.indexOf('/') != -1) {
@@ -372,7 +386,7 @@ Page({
       wx.navigateTo({
         url: that.data.costCheckListURL,
         events: {
-          refresh: function (data) {}
+          refresh: function (data) { }
         },
         success: function (res) {
           res.eventChannel.emit('params', { formMode: Constants.formMode.index })

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

@@ -60,7 +60,7 @@
                 <view style="width: 55%;">
                   <!-- <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#FF7B1A" fontWeight="700" title="" content="{{item.costPrice}}"></dk-cell> -->
 
-                  <dk-number-input sign="¥" digits="{{2}}" fontSize="14" left="0rpx"  data-item="{{item}}" data-index="{{index}}"  center="left" readonly="{{false}}" titleValue="" inputColor="#FF7B1A" titleFontWeight="normal" inputValue="{{item.costPrice}}" bind:triggerBindValue="changeNumberTableBlur" ></dk-number-input>
+                  <dk-number-input sign="¥" digits="{{2}}" fontSize="14" left="0rpx"  data-item="{{item}}" data-index="{{index}}"  center="left" readonly="{{false}}" titleValue="" inputColor="#FF7B1A" titleFontWeight="normal" focus="{{item.focus}}" inputValue="{{item.costPrice}}" bind:triggerBindValue="changeNumberTableBlur" ></dk-number-input>
                 </view>
                 <view>
                   <view bind:tap="addItem" data-item="{{item}}" data-index="{{index}}" style="display: flex;align-items: center;border-radius: 16rpx;padding:10rpx;color: #fff;padding-left: 20rpx;padding-right: 20rpx;{{item.isFlgCostCheck ? 'background-color: #95A8CB' : 'background-color: #3E69F6;'}}">