Procházet zdrojové kódy

fix:盘点状态按钮样式

maliang před 4 týdny
rodič
revize
40c1d9b2df
1 změnil soubory, kde provedl 100 přidání a 104 odebrání
  1. 100 104
      pages/inventory-task/detail.vue

+ 100 - 104
pages/inventory-task/detail.vue

@@ -17,19 +17,19 @@
 
     <u-sticky bgColor="#F5F6F7" :offsetTop="offsetTop">
       <!-- 基本信息 吸顶 -->
-			<view class="search-box">
-			  <u-search
-			    placeholder="输入货物名称/库位/条码/内部编码"
-			    shape="square"
-			    :showAction="false"
-			    @search="onRefresh"
-			    @clear="onRefresh"
-			    v-model="queryFilterValues.number"
-			  ></u-search>
-			  <view class="scan-icon flex_box flex_row_center" @click="scanCode">
-			    <image src="@/static/image/scan-icon-2.png" mode=""></image>
-			  </view>
-			</view>
+      <view class="search-box">
+        <u-search
+          placeholder="输入货物名称/库位/条码/内部编码"
+          shape="square"
+          :showAction="false"
+          @search="onRefresh"
+          @clear="onRefresh"
+          v-model="queryFilterValues.number"
+        ></u-search>
+        <view class="scan-icon flex_box flex_row_center" @click="scanCode">
+          <image src="@/static/image/scan-icon-2.png" mode=""></image>
+        </view>
+      </view>
       <view class="info-card">
         <view class="info-item page-title">
           {{ inventoryInfo.taskName }}
@@ -41,7 +41,9 @@
           </view>
           <view class="info-item">
             <text class="info-label">盘点人:</text>
-            <text class="info-value">{{ inventoryInfo.creatorName || '-'}}</text>
+            <text class="info-value">{{
+              inventoryInfo.creatorName || "-"
+            }}</text>
           </view>
         </view>
 
@@ -85,9 +87,9 @@
         <view class="location-row">
           <view class="location-left">
             <text class="location-label">库位:</text>
-            <text class="location-value">{{ item.position || '-' }}</text>
+            <text class="location-value">{{ item.position || "-" }}</text>
             <image
-							v-if="item.status != 3"
+              v-if="item.status != 3"
               src="@/static/image/bianji-icon.png"
               mode=""
               class="icon"
@@ -111,11 +113,13 @@
             </view>
             <view class="goods-field half-w">
               <text class="field-label">盘点人:</text>
-              <text class="field-value">{{ item.createName || '-' }}</text>
+              <text class="field-value">{{ item.createName || "-" }}</text>
             </view>
             <view class="goods-field">
               <text class="field-label">盘点时间:</text>
-              <text class="field-value">{{ item.operTime ? $u.timeFormat(item.operTime, 'yyyy-mm-dd') : '-' }}</text>
+              <text class="field-value">{{
+                item.operTime ? $u.timeFormat(item.operTime, "yyyy-mm-dd") : "-"
+              }}</text>
             </view>
             <view class="stock-row">
               <view class="stock-item">
@@ -165,40 +169,37 @@
           >
           </u-button>
           <u-tag
-						:text="`盘亏${item.inventory-item.newInventory}`"
-            type="error"
-            plain
-            plainFill
-						class="action-btn"
+            :text="`盘亏${item.inventory - item.newInventory}`"
+            bg-color="#FF4E02"
+            color="#ffffff"
+            class="action-btn"
             v-if="item.status === 3"
           >
           </u-tag>
           <u-tag
-            :text="`盘盈${item.newInventory-item.inventory}`"
-            type="error"
-            plain
-            plainFill
-						class="action-btn"
+            :text="`盘盈${item.newInventory - item.inventory}`"
+            bg-color="#F59701"
+            color="#ffffff"
+            class="action-btn"
             v-if="item.status === 2"
           >
           </u-tag>
-					<u-tag
-					  text="无差异"
-					  type="success"
-					  plain
-					  plainFill
-						class="action-btn"
-					  v-if="item.status === 4"
-					>
-					</u-tag>
-					<u-tag
-					  text="未盘"
-					  plain
-					  plainFill
-						class="action-btn"
-					  v-if="item.status === 1"
-					>
-					</u-tag>
+          <u-tag
+            text="无差异"
+            bg-color="#00B97B"
+            color="#ffffff"
+            class="action-btn"
+            v-if="item.status === 4"
+          >
+          </u-tag>
+          <u-tag
+            text="未盘"
+            bg-color="#0256FF"
+            color="#ffffff"
+            class="action-btn"
+            v-if="item.status === 1"
+          >
+          </u-tag>
         </view>
       </view>
       <!-- 加载更多 -->
@@ -284,7 +285,7 @@ export default {
         userIdList: [], // 盘点负责人id
         categoryIdList: [], // 类目
         positionList: [], // 库位
-				number:''
+        number: "",
       },
       actionPop: {
         // 盘点数量弹框状态
@@ -322,18 +323,18 @@ export default {
     this.taskId = opt.id;
     this.loadData(opt.id);
   },
-	onShow() {
-	  uni.$on("scanFinish", (data) => {
-	    this.queryFilterValues.number = data;
-	    this.onRefresh();
-	  });
-	},
-	onHide() {
-	  uni.$off("scanFinish");
-	},
-	onUnload() {
-	  uni.$off("scanFinish");
-	},
+  onShow() {
+    uni.$on("scanFinish", (data) => {
+      this.queryFilterValues.number = data;
+      this.onRefresh();
+    });
+  },
+  onHide() {
+    uni.$off("scanFinish");
+  },
+  onUnload() {
+    uni.$off("scanFinish");
+  },
   onPullDownRefresh() {
     // 下拉刷新
     this.onRefresh();
@@ -371,14 +372,14 @@ export default {
         };
         const res = await taskStocktakingItemList(params);
         const { total, rows } = res.data;
-				rows.forEach(item=>{
-					if(item.imgName && item.imgName.length >0) {
-						item.imgNameArr = item.imgName.split(",")
-					}else {
-						item.imgNameArr = []
-					}
-				})
-				console.log('rows======',rows)
+        rows.forEach((item) => {
+          if (item.imgName && item.imgName.length > 0) {
+            item.imgNameArr = item.imgName.split(",");
+          } else {
+            item.imgNameArr = [];
+          }
+        });
+        console.log("rows======", rows);
         this.goodsList = [...this.goodsList, ...rows];
         if (pageNum * pageSize < Number(total)) {
           this.pageNum++;
@@ -465,9 +466,9 @@ export default {
       this.filterPopupVisible = false;
       this.onRefresh();
     },
-		scanCode() {
-		  this.$scan.scanCode();
-		},
+    scanCode() {
+      this.$scan.scanCode();
+    },
   },
 };
 </script>
@@ -481,34 +482,34 @@ export default {
   .nav-right {
     padding: 0 24rpx;
   }
-	
-	.search-box {
-	  background-color: rgba(191, 200, 219, 0.2);
-	  margin: 0 32rpx;
-	  display: flex;
-	  align-items: center;
-	  justify-content: space-between;
-	  border-radius: 8rpx;
-	
-	  ::v-deep .u-search__content {
-	    background-color: transparent !important;
-	
-	    .u-search__content__input {
-	      background-color: transparent !important;
-	    }
-	  }
-	
-	  .scan-icon {
-	    width: 100rpx;
-	    height: 100%;
-	
-	    image {
-	      width: 40rpx;
-	      height: 40rpx;
-	    }
-	  }
-	}
-	
+
+  .search-box {
+    background-color: rgba(191, 200, 219, 0.2);
+    margin: 0 32rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    border-radius: 8rpx;
+
+    ::v-deep .u-search__content {
+      background-color: transparent !important;
+
+      .u-search__content__input {
+        background-color: transparent !important;
+      }
+    }
+
+    .scan-icon {
+      width: 100rpx;
+      height: 100%;
+
+      image {
+        width: 40rpx;
+        height: 40rpx;
+      }
+    }
+  }
+
   .info-card {
     background-color: #fff;
     padding: 16rpx 32rpx;
@@ -714,13 +715,8 @@ export default {
         .action-btn {
           height: 56rpx;
           padding: 0;
-					margin-left: 20rpx;
-					
-          &-secondary {
-            background-color: transparent;
-            border-color: #ff9900;
-            color: #ff9900;
-          }
+          margin-left: 20rpx;
+          border: 0;
         }
       }
     }