|
|
@@ -8,6 +8,33 @@ Page({
|
|
|
radio: false, //是否为单选
|
|
|
idname: "itemid", //idkey
|
|
|
showName: "itemname", //表单用 显示名称
|
|
|
+ filtrate: false,
|
|
|
+ filtratelist: [{
|
|
|
+ label: "品牌",
|
|
|
+ index: null,
|
|
|
+ showName: "brandname", //显示字段
|
|
|
+ valueKey: "sa_brandid", //返回Key
|
|
|
+ selectKey: "sa_brandid", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ interrupt: true,
|
|
|
+ list: null
|
|
|
+ }, {
|
|
|
+ label: "标准",
|
|
|
+ index: null,
|
|
|
+ showName: "value", //显示字段
|
|
|
+ valueKey: "value", //返回Key
|
|
|
+ selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ list: null
|
|
|
+ }, {
|
|
|
+ label: "领域",
|
|
|
+ index: null,
|
|
|
+ showName: "tradefield", //显示字段
|
|
|
+ valueKey: "tradefield", //返回Key
|
|
|
+ selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ list: null
|
|
|
+ }]
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
if (options.params) {
|
|
|
@@ -135,5 +162,120 @@ Page({
|
|
|
onUnload() {
|
|
|
//回收数据
|
|
|
getApp().globalData.handleSelect = null;
|
|
|
- }
|
|
|
+ },
|
|
|
+ async openFiltrate() {
|
|
|
+ if (this.data.filtratelist[0].list == null) {
|
|
|
+ let res = await Promise.all([this.getBrand(), this.getitemstandards(), this.gettradefields()]);
|
|
|
+ console.log(res)
|
|
|
+ res.forEach((v, i) => this.data.filtratelist[i].list = v.data);
|
|
|
+ this.setData({
|
|
|
+ filtratelist: this.data.filtratelist,
|
|
|
+ filtrate: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ filtrate: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 处理筛选 */
|
|
|
+ handleFilter(e) {
|
|
|
+ this.data.params.content.where.itemclassid = e.detail.itemclassid || "";
|
|
|
+ this.data.params.content.where.sa_brandid = e.detail.sa_brandid || "";
|
|
|
+ this.data.params.content.where.tradefield = e.detail.tradefield || "";
|
|
|
+ this.getList(true)
|
|
|
+ },
|
|
|
+ /* 获取品牌列表 */
|
|
|
+ getBrand() {
|
|
|
+ return _Http.basic({
|
|
|
+ "id": "20220922085103",
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 获取标准列表 */
|
|
|
+ getitemstandards() {
|
|
|
+ return _Http.basic({
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 999,
|
|
|
+ "typename": "itemstandards",
|
|
|
+ "parameter": {
|
|
|
+ "siteid": wx.getStorageSync('siteP').siteid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ /* 获取标准列表 */
|
|
|
+ getitemstandards() {
|
|
|
+ return _Http.basic({
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 999,
|
|
|
+ "typename": "itemstandards",
|
|
|
+ "parameter": {
|
|
|
+ "siteid": wx.getStorageSync('siteP').siteid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 获取领域列表 */
|
|
|
+ gettradefields() {
|
|
|
+ return _Http.basic({
|
|
|
+ "id": 20221223141802,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 99999,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 打断 */
|
|
|
+ interrupt(e) {
|
|
|
+ let {
|
|
|
+ name,
|
|
|
+ index,
|
|
|
+ item,
|
|
|
+ list
|
|
|
+ } = e.detail;
|
|
|
+ if (name == "sa_brandid") _Http.basic({
|
|
|
+ "id": "20220922110403",
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ "sa_brandid": item.sa_brandid,
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("分类列表", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ if (!res.data[0].ttemclass) return;
|
|
|
+ list[3] = {
|
|
|
+ label: "分类",
|
|
|
+ index: null,
|
|
|
+ showName: "itemclassname", //显示字段
|
|
|
+ valueKey: "itemclassid", //返回Key
|
|
|
+ selectKey: "itemclassid", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ list: res.data[0].ttemclass
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ filtratelist: list
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
})
|