|
|
@@ -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();
|