zhaoxiaohai 3 سال پیش
والد
کامیت
142d5a24f9

+ 0 - 0
packageA/project/modules/contacts/select/index.scss → packageA/select/contacts/select.scss


+ 0 - 0
packageA/project/modules/contacts/select/index.wxml → packageA/select/contacts/select.wxml


+ 1 - 1
packageA/project/select.js → packageA/select/project/select.js

@@ -1,5 +1,5 @@
 const _Http = getApp().globalData.http,
-    getHeight = require("../../utils/getRheRemainingHeight");
+    getHeight = require("../../../utils/getRheRemainingHeight");
 Page({
     data: {
         content: {

+ 0 - 0
packageA/project/select.json → packageA/select/project/select.json


+ 0 - 0
packageA/project/select.scss → packageA/select/project/select.scss


+ 0 - 0
packageA/project/select.wxml → packageA/select/project/select.wxml


+ 39 - 39
packageA/setclient/select.js → packageA/select/setclient/select.js

@@ -1,53 +1,53 @@
 const _Http = getApp().globalData.http,
-    getHeight = require("../../utils/getRheRemainingHeight");
+    getHeight = require("../../../utils/getRheRemainingHeight");
 Page({
     data: {
-        content: {
-            nocache: true,
-            "type": 0,
-            "pageNumber": 1,
-            "pageSize": 20,
-            "isExport": 0,
-            "where": {
-                "condition": "",
-            }
-        },
+        item: {},
+
         result: [],
         radio: true,
     },
     onLoad(options) {
+        /* 从表单组件进入进入 */
+        if (options.item) {
+            let item = JSON.parse(options.item);
+            this.setData({
+                item,
+                result: item.value.length ? item.value[1] : [],
+                params: item.params
+            })
+        };
+        if (options.params) this.setData({
+            params: JSON.parse(options.params)
+        });
+
+        this.setData({
+            radio: options.radio ? true : false
+        });
         this.getList()
     },
     submit() {
-        let pages = getCurrentPages();
-        let list = this.data.result.map(v => this.data.list.find(value => value.sys_enterpriseid == v));
-        console.log(this.data.result)
-        console.log(list)
-        /*  try {
-             pages[pages.length - 2].selectComponent("#Treaty").submit({
-                 "sa_projectid": this.data.content.where.sa_projectid,
-                 "sys_enterpriseids": this.data.result,
-                 "remarks": ""
-             }, list)
-         } catch (e) {
-             pages[pages.length - 2].submit({
-                 "sa_projectid": this.data.content.where.sa_projectid,
-                 "sys_enterpriseids": this.data.result,
-                 "remarks": ""
-             }, list);
-         } */
+        let pages = getCurrentPages(),
+            item = this.data.item,
+            result = this.data.result;
+        let list = result.map(v => this.data.list.find(value => value.sys_enterpriseid == v));
+        item.value = this.data.radio ? [list[0].enterprisename, result] : [list.map(v => v.enterprisename), result];
+        try {
+            pages[pages.length - 2].selectComponent(item.model || "#Form").handleRoute(item, list);
+        } catch (e) {
+            wx.showToast({
+                title: '操作失败',
+                icon: "none"
+            })
+        }
     },
     getList(init = false) {
         //init 用于初始化分页
         if (init.detail != undefined) init = init.detail;
-        if (init) this.setData({
-            ['content.pageNumber']: 1
-        })
-        if (this.data.content.pageNumber > this.data.content.pageTotal) return;
-        _Http.basic({
-            "id": 20221012164402,
-            content: this.data.content
-        }).then(res => {
+        let params = this.data.params;
+        if (init) params.content.pageNumber = 1;
+        if (params.content.pageNumber > params.content.pageTotal) return;
+        _Http.basic(params).then(res => {
             console.log("选择客户列表", res)
             this.selectComponent('#ListBox').RefreshToComplete();
             if (res.msg != '成功') return wx.showToast({
@@ -55,9 +55,9 @@ Page({
                 icon: "none"
             })
             this.setData({
-                'content.pageNumber': res.pageNumber + 1,
-                'content.pageTotal': res.pageTotal,
-                'content.total': res.total,
+                'params.content.pageNumber': res.pageNumber + 1,
+                'params.content.pageTotal': res.pageTotal,
+                'params.content.total': res.total,
                 list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
             })
             this.getTags();

+ 0 - 0
packageA/setclient/select.json → packageA/select/setclient/select.json


+ 0 - 0
packageA/setclient/select.scss → packageA/select/setclient/select.scss


+ 2 - 2
packageA/setclient/select.wxml → packageA/select/setclient/select.wxml

@@ -1,6 +1,6 @@
-<van-search class="search" value="{{ content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
+<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
-    <view class="total">共{{content.total}}个</view>
+    <view class="total">共{{params.content.total}}个</view>
     <navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="item.sys_enterpriseid" data-id="{{item.sys_enterpriseid}}" bindtap="changeResult">
         <view class="con">
             <view class="portrait {{item.enterprisename <=2?'min-portrait':''}}">