Browse Source

修改展开

liujun 2 năm trước cách đây
mục cha
commit
8186902081
1 tập tin đã thay đổi với 29 bổ sung20 xóa
  1. 29 20
      public/dzd/index.html

+ 29 - 20
public/dzd/index.html

@@ -82,9 +82,10 @@
 				color: #f0ad4e;
 				font-weight: bold;
 			}
-      .amountName{
-        font-weight: bold;
-      }
+
+			.amountName {
+				font-weight: bold;
+			}
 
 			.handleOrder {
 				color: #999;
@@ -201,7 +202,8 @@
 			<div class="orderCon flex flex-column">
 				<div class="handleOrder flex flex-between align_center">
 					<span>共{{saleList ? saleList.length : 0}}个销售单</span>
-					<span @click="openAll">全部展开</span>
+					<span v-if="!flag" @click="openAll">全部展开</span>
+					<span v-else @click="openAll">全部关闭</span>
 				</div>
 				<div class="oederBox">
 					<div v-for="(item,i) in saleList" :key="item.bizSn">
@@ -250,7 +252,8 @@
 				ajaxUrl: 'http://p.iscm.360arrow.com/qpls-md/',
 				saleList: [],
 				saleDetailList: [],
-				info: {}
+				info: {},
+				flag: false
 			},
 			created() {
 				this.loadData();
@@ -264,8 +267,8 @@
 					}
 					axios.post(this.ajaxUrl + 'verify/findBySn', ajaxData).then((res) => {
 						this.info = res.data.data;
-						res.data.data.detailList.forEach(item=>{
-							item.isShow  = false;
+						res.data.data.detailList.forEach(item => {
+							item.isShow = false;
 						})
 						this.saleList = res.data.data.detailList;
 						// if (res.data.data.bizBeginDate && res.data.data.bizEndDate) {
@@ -276,26 +279,31 @@
 						console.log(error);
 					});
 				},
-				handleShow(con , i,type=1) {
+				handleShow(con, i, type = 1) {
 					let req_data = {
 						salesBillSn: con.bizSn
 					}
 					axios.post(this.ajaxUrl + 'salesDetail/queryList', req_data).then((res) => {
 						this.saleDetailList = res.data.data;
-						if(type==1){
-							this.saleList[i].isShow =!this.saleList[i].isShow;
-						}else{
-							this.saleList[i].isShow = true
+						if (type == 1) {
+							this.saleList[i].isShow = !this.saleList[i].isShow;
+						} else {
+							if (this.flag) {
+								this.saleList[i].isShow = true
+							} else {
+								this.saleList[i].isShow = false
+							}
+
 						}
 					}).catch((error) => {
 						console.log(error);
 					});
-					
+
 				},
 				downLoad() {
 					let ajaxData = {
-              verifySn: this.getUrlParam('verifySn'),
-              dealerSn: this.getUrlParam('userSn')
+						verifySn: this.getUrlParam('verifySn'),
+						dealerSn: this.getUrlParam('userSn')
 					}
 					axios.get(this.ajaxUrl + 'verify/exportExcel', {
 						params: ajaxData
@@ -318,11 +326,12 @@
 					if (r != null) return unescape(r[2]);
 					return null; //返回参数值
 				},
-       openAll(){
-         this.saleList.forEach((item,i)=>{
-       	this.handleShow(item,i,0);
-         })
-       }
+				openAll() {
+					this.flag = !this.flag;
+					this.saleList.forEach((item, i) => {
+						this.handleShow(item, i, 0);
+					})
+				}
 			}
 		})
 	</script>