Bläddra i källkod

修改搜索按钮

chenrui 2 år sedan
förälder
incheckning
938ab111e0
1 ändrade filer med 11 tillägg och 3 borttagningar
  1. 11 3
      pages/vinAnalyse/fitProductlist.vue

+ 11 - 3
pages/vinAnalyse/fitProductlist.vue

@@ -47,9 +47,9 @@
 		<u-popup v-model="sortShow" mode="right" width="60%">
 			<view class="sortPopup">
 				<view class="sortList" v-for="(item, i) in sortList" :key="i" :class="isSortFlag == i ? 'sortChecked' : ''" @click="chooseSort(i)">{{ item.name }}</view>
-				<view class="butBox u-flex u-row-between">
-					<u-button hover-class="none" shape="circle" size="medium" @click="reset">重置</u-button>
-					<u-button hover-class="none" :custom-style="customBtnStyle"  shape="circle" size="medium" @click="handelSort">确定</u-button>
+				<view class="butBox u-flex">
+					<!-- <u-button hover-class="none" shape="circle" size="medium" @click="reset">重置</u-button> -->
+					<!-- <u-button hover-class="none" :custom-style="customBtnStyle"  size="medium"  shape="circle"  @click="handelSort">确定</u-button> -->
 				</view>
 			</view>
 		</u-popup>
@@ -149,6 +149,7 @@ export default {
 		},
 		chooseSort(i) {
 			this.isSortFlag = i;
+			this.handelSort();
 		},
 		reset() {
 			this.isSortFlag = 0;
@@ -181,6 +182,13 @@ export default {
 					productCode: this.keyword.trim()
 				};
 			}
+			if (this.isSortFlag == 0) {
+				ajaxData.orderBy = 'xvfp.scan_vin_date desc,xp.code asc';
+			} else if (this.isSortFlag == 1) {
+				ajaxData.orderBy = 'xvfp.in_stock_count desc,xp.code asc';
+			} else {
+				ajaxData.orderBy = 'xvfp.not_stock_count desc,xp.code asc';
+			}
 			this.loadData(ajaxData);
 		},
 		// 清空搜索内容