const _Http = getApp().globalData.http;
Component({
    properties: {
        isproject: String
    },
    data: {
        sa_quotedpriceid: 0,
        content: {
            nocache: true,
            isExport: 0,
            pageNumber: 1,
            pageTotal: 1,
            total: null,
            where: {},
            type: "0",
        },
    },
    methods: {
        /* 获取产品列表 */
        getList(id, init) {
            let content = this.data.content;
            content.sa_quotedpriceid = id;
            if (init) content.pageNumber = 1;
            content.where.isproject = this.data.isproject;
            _Http.basic({
                "id": "20221209093003",
                content
            }).then(res => {
                console.log("历史报价", res)
                if (res.msg != '成功') return wx.showToast({
                    title: res.data,
                    icon: "none"
                })
                this.setData({
                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
                    "content.pageNumber": res.pageNumber + 1,
                    "content.pageSize": res.pageSize,
                    "content.pageTotal": res.pageTotal,
                    "content.total": res.total,
                    sa_quotedpriceid: id
                })
            })
        },
    }
})