Explorar o código

退返单添加筛选

xiaohaizhao %!s(int64=2) %!d(string=hai) anos
pai
achega
5ef5e222fe

+ 81 - 57
packageA/returnOne/index.js

@@ -1,61 +1,85 @@
 const _Http = getApp().globalData.http;
 
 Page({
-  data: {
-    list: [],
-    loading: true,
-    "content": {
-      nocache: true,
-      "isExport": 0,
-      "pageNumber": 1,
-      "pageTotal": 1,
-      "pageSize": 20,
-      "where": {
-        "condition": "",
-        "tablefilter": {},
-        "status": ""
-      },
-      "type": "退货单"
-    },
-  },
-  onLoad(options) {
-    this.setData({
-      userrole: wx.getStorageSync('userrole')
-    })
-    this.getList(true)
-  },
-  /* 获取产品 */
-  getList(init = false) {
-    if (init.detail != undefined) init = init.detail;
-    let content = this.data.content;
-    if (init) content.pageNumber = 1;
-    if (content.pageNumber > content.pageTotal) return;
-    _Http.basic({
-      "id": 20230105161503,
-      content
-    }).then(res => {
-      console.log("退返列表", res)
-      this.selectComponent('#ListBox').RefreshToComplete();
-      this.setData({
-        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
-        "content.pageNumber": res.pageNumber + 1,
-        "content.pageTotal": res.pageTotal,
-        "content.sort": res.sort,
-        "content.total": res.total,
-        loading: false,
-      })
-    })
-  },
-  tabsChange(e) {
-    this.data.content.where.status = e.detail.title == '全部' ? '' : e.detail.title;
-    this.getList(true);
-  },
-  onReady() {
-    this.selectComponent("#ListBox").setHeight(".tab", this);
-  },
-  toAdd(e) {
-    wx.navigateTo({
-      url: '/packageA/returnOne/update'
-    })
-  }
+	data: {
+		list: [],
+		loading: true,
+		"content": {
+			nocache: true,
+			"isExport": 0,
+			"pageNumber": 1,
+			"pageTotal": 1,
+			"pageSize": 20,
+			"where": {
+				"condition": "",
+				"tablefilter": {},
+				"status": ""
+			},
+			"type": "退货单"
+		},
+		filtratelist: [{
+			label: "单据类型",
+			index: null,
+			showName: "value", //显示字段
+			valueKey: "type", //返回Key
+			selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+			value: "退货单", //选中值
+			list: [{
+				value: "退货单"
+			}, {
+				value: "换货单"
+			}]
+		}]
+	},
+	onLoad(options) {
+		this.setData({
+			userrole: wx.getStorageSync('userrole')
+		})
+		this.getList(true)
+	},
+	/* 获取产品 */
+	getList(init = false) {
+		if (init.detail != undefined) init = init.detail;
+		let content = this.data.content;
+		if (init) content.pageNumber = 1;
+		if (content.pageNumber > content.pageTotal) return;
+		_Http.basic({
+			"id": 20230105161503,
+			content
+		}).then(res => {
+			console.log("退返列表", res)
+			this.selectComponent('#ListBox').RefreshToComplete();
+			this.setData({
+				list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+				"content.pageNumber": res.pageNumber + 1,
+				"content.pageTotal": res.pageTotal,
+				"content.sort": res.sort,
+				"content.total": res.total,
+				loading: false,
+			})
+		})
+	},
+	tabsChange(e) {
+		this.data.content.where.status = e.detail.title == '全部' ? '' : e.detail.title;
+		this.getList(true);
+	},
+	onReady() {
+		this.selectComponent("#ListBox").setHeight(".tab", this);
+	},
+	toAdd(e) {
+		wx.navigateTo({
+			url: '/packageA/returnOne/update'
+		})
+	},
+	hideModal(e) {
+		this.setData({
+			modalName: null
+		})
+	},
+	handleFiltrate({
+		detail
+	}) {
+		detail.type && (this.data.content.type = detail.type);
+		this.getList(true);
+	}
 })

+ 1 - 0
packageA/returnOne/index.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
+    "Filtrate": "../../pages/index/market/modules/filtrate/index",
     "List": "./modules/list/index"
   }
 }

+ 2 - 1
packageA/returnOne/index.scss

@@ -1 +1,2 @@
-@import "./index.skeleton.wxss";
+@import "./index.skeleton.wxss";
+@import "../../static/filter.scss";

+ 27 - 19
packageA/returnOne/index.wxml

@@ -1,19 +1,27 @@
-<import src="index.skeleton.wxml"/>
-<template is="skeleton" wx:if="{{loading}}" />
-<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
-<van-tabs class="tab" active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
-	<van-tab title="全部" />
-	<van-tab title="新建" />
-	<van-tab title="提交" />
-	<van-tab title="审核" />
-	<van-tab title="复核" />
-</van-tabs>
-<Yl_ListBox id='ListBox' bind:getlist='getList'>
-	<view style="height: 20rpx;" />
-	<List list="{{list}}" userrole="{{userrole}}" />
-	<view style="height: 20px;" />
-</Yl_ListBox>
-<!-- 新建浮动按钮 -->
-<!-- <Yl_FloatingButton bindtap="toAdd" /> -->
-<!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
+<view class="DrawerPage {{modalName=='viewModal'?'show':''}}">
+	<import src="index.skeleton.wxml" />
+	<template is="skeleton" wx:if="{{loading}}" />
+	<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" isFilter />
+	<van-tabs class="tab" active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+		<van-tab title="全部" />
+		<van-tab title="新建" />
+		<van-tab title="提交" />
+		<van-tab title="审核" />
+		<van-tab title="复核" />
+	</van-tabs>
+	<Yl_ListBox id='ListBox' bind:getlist='getList'>
+		<view style="height: 20rpx;" />
+		<List list="{{list}}" userrole="{{userrole}}" />
+		<view style="height: 20px;" />
+	</Yl_ListBox>
+</view>
+
+<view class="DrawerClose {{modalName=='viewModal'?'show':''}}" bindtap="hideModal">
+	<text class="cuIcon-pullright"></text>
+</view>
+<scroll-view scroll-y class="DrawerWindow  {{modalName=='viewModal'?'show':''}}">
+	<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg bg-white">
+		<Filtrate list='{{filtratelist}}' bindhandle='handleFiltrate' />
+	</view>
+	<view style="height: 200rpx;" />
+</scroll-view>