ysy 1 年之前
父节点
当前提交
a0400b78e6
共有 1 个文件被更改,包括 48 次插入32 次删除
  1. 48 32
      pages/pda/turnover/components/turnoverBom.vue

+ 48 - 32
pages/pda/turnover/components/turnoverBom.vue

@@ -11,8 +11,8 @@
 					<view class="btn_box rx-bc" @click="handleTrade(index)" v-if='item.isOld == 1'>
 						工单换周转车
 					</view>
-					
-					<view  class='title_des' v-if='item.isOld == 0'>
+
+					<view class='title_des' v-if='item.isOld == 0'>
 						转换后周转车
 					</view>
 				</view>
@@ -43,31 +43,35 @@
 						<view class="item ww30">工单编号</view>
 						<view class="item ww30">产品编码</view>
 						<view class="item ww15">数量</view>
-						<view class="item ww15"></view>
+						<view class="item ww15" style="color: #157A2C;" @click="turnoverSelect(index)">
+							{{ isAllSelect ?  '取消' : '全选' }}
+						</view>
 					</view>
 
 					<view class="table">
 						<u-list @scrolltolower="scrolltolower" class="z_list">
-						<view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
-							<view class="item ww10">{{it.code}}</view>
-							<view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
-								{{ it.workOrderCode }}
-							</view>
-							<view class="item ww30" :class="{'color157': it.categoryCode === wordItem.productCode}">
-								{{it.categoryCode}}
-							</view>
-							<view class="item ww15  ">
-								<text :class="{ 'isend': it.isend }">{{it.newQuantity}}</text>
+							<view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
+								<view class="item ww10">{{it.code}}</view>
+								<view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
+									{{ it.workOrderCode }}
+								</view>
+								<view class="item ww30" :class="{'color157': it.categoryCode === wordItem.productCode}">
+									{{it.categoryCode}}
+								</view>
+								<view class="item ww15  ">
+									<text :class="{ 'isend': it.isend }">{{it.newQuantity}}</text>
+								</view>
+
+								<view class="item ww15 rx-cc " v-if='!it.isend  ' @click="handleCheck(index, idx, it)">
+
+									<image class="check" v-if='item.isOld != 0 && it.check' src='@/static/check.png'>
+									</image>
+									<image class="check" v-if='item.isOld != 0 && !it.check'
+										src='@/static/check_no.png'></image>
+								</view>
 							</view>
 
-							<view class="item ww15 rx-cc " v-if='!it.isend  ' @click="handleCheck(index, idx, it)">
-
-								<image class="check" v-if='item.isOld != 0 && it.check' src='@/static/check.png'></image>
-								<image class="check"  v-if='item.isOld != 0 && !it.check' src='@/static/check_no.png'></image>
-							</view>
-						</view>
-
-                      </u-list>
+						</u-list>
 
 
 
@@ -131,6 +135,7 @@
 			return {
 				recycleQuantity: '',
 				newList: [],
+				isAllSelect: false,
 
 				wordInfo: {
 					workOrderCode: null,
@@ -141,7 +146,19 @@
 
 		methods: {
 
-           scrolltolower() {},
+			scrolltolower() {},
+
+
+			turnoverSelect(index) {
+				this.newList[index].extInfo.positionList.forEach(f => {
+					if (this.isAllSelect && Number(f.newQuantity) > 0) {
+						f.check = false
+					} else if (!this.isAllSelect && Number(f.newQuantity) > 0) {
+						f.check = true
+					}
+				})
+				this.isAllSelect =!this.isAllSelect
+			},
 
 			handleCheck(index, idx, it) {
 
@@ -201,9 +218,9 @@
 				// this.$refs.turnoverRef.open('w0300000003431001', this.wordInfo, this.newList, this.wordItem, index)
 				// return false
 
-		
+
 				uni.scanCode({
-				success: (res) => {
+					success: (res) => {
 						this.$refs.turnoverRef.open(res.result, this.wordInfo, this.newList, this.wordItem,
 							index)
 					}
@@ -226,9 +243,9 @@
 				newTurnover[0].id = null
 				this.newList[index].isOld = 1 // 老的
 				turnoverArr = [this.newList[index], ...newTurnover]
-				
+
 				transferVehicle(turnoverArr).then(res => {
-					 this.$emit('refreshList')
+					this.$emit('refreshList')
 				})
 
 
@@ -461,15 +478,14 @@
 	.isend {
 		text-decoration: line-through;
 	}
-	
-	.title_des{
+
+	.title_des {
 		font-size: 28rpx;
 		color: #FFA929;
 	}
-	
 
-			.z_list{
-				max-height: 500rpx;
-			}
 
+	.z_list {
+		max-height: 500rpx;
+	}
 </style>