| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- const _Http = getApp().globalData.http,
- currency = require("../../utils/currency"),
- CNY = (value, symbol = "¥", precision = 2) => currency(value, {
- symbol,
- precision
- }).format();
- Component({
- options: {
- addGlobalClass: true
- },
- lifetimes: {
- attached: function () {
- getApp().globalData.Language.getLanguagePackage(this)
- _Http.basic({
- "classname": "sysmanage.develop.optiontype.optiontype",
- "method": "optiontypeselect",
- "content": {
- "pageNumber": 1,
- "pageSize": 1000,
- "typename": "ordertype",
- "parameter": {}
- },
- }).then(res => {
- console.log("订单类型", res)
- if (res.code == 1) {
- res.data.unshift({
- remarks: "全部",
- value: ""
- })
- this.setData({
- typeList: res.data
- })
- }
- })
- }
- },
- properties: {
- },
- data: {
- dateTypes: ["全部", "本年"],
- dateType: "本年",
- showList: false,
- list: [],
- "isAll": 0, //1全部 0本年
- "content": {
- "nocache": true,
- "pageNumber": 1,
- "pageTotal": 1,
- "total": null,
- "where": {
- type: "",
- begdate: "",
- enddate: "",
- }
- }
- },
- methods: {
- getList(id, init) {
- let content = this.data.content;
- content.sa_customersid = id;
- content.isAll = this.data.isAll;
- if (init) {
- content.pageNumber = 1;
- content.total = null;
- }
- if (!this.data.showList && content.total != null) return;
- if (content.pageNumber > content.pageTotal) return;
- _Http.basic({
- "id": 20230713104304,
- content
- }).then(res => {
- console.log("客户订单", res)
- if (res.code != '1') return wx.showToast({
- title: res.data,
- icon: "none"
- })
- content.pageNumber = res.pageNumber + 1;
- content.pageSize = res.pageSize;
- content.pageTotal = res.pageTotal;
- content.total = res.total;
- res.data = res.data.map(v => {
- v.allAmount = CNY(v.allAmount / (wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000));
- v.cashbillAmount = CNY(v.cashbillAmount / (wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000));
- v.allunAmount = CNY(v.allunAmount / (wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000));
- v.alluninvoicamount = CNY(v.alluninvoicamount / (wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000));
- v.allunwriteoffamount = CNY(v.allunwriteoffamount / (wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000));
- v.joinOrderAmount = CNY(v.joinOrderAmount / (wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000))
- v.sumamount = CNY(v.sumamount);
- v.unoutOrderamount = CNY(v.unoutOrderamount);
- v.uninvoicamount = CNY(v.uninvoicamount);
- v.unwriteoffamount = CNY(v.unwriteoffamount);
- v.writeoffamount = CNY(v.writeoffamount);
- v.returnamount = CNY(v.returnamount);
- return v
- })
- this.setData({
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
- content,
- id: id,
- });
- try {
- this.selectComponent("#TimeRange").onCancel()
- } catch (error) {
- }
- try {
- this.selectComponent("#Filtrate").onCancel()
- } catch (error) {
- }
- })
- },
- changeType({
- detail
- }) {
- this.setData({
- "content.where.type": detail,
- })
- this.getList(this.data.id, true)
- },
- changeDate({
- detail
- }) {
- this.setData({
- dateType: detail.dateType,
- isAll: detail.isAll === "" ? 99 : detail.isAll,
- "content.where.begdate": detail.begdate || "",
- "content.where.enddate": detail.enddate || ""
- })
- this.getList(this.data.id, true)
- },
- shrinkChange({
- detail
- }) {
- this.setData({
- showList: detail
- })
- },
- viewInstructions() {
- getApp().globalData.Language.modeBoxPrompts('参与项日订单金额:客户参与的项目的订单金额')
- }
- }
- })
|