| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- 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)
- this.setData({
- "content.dataid": wx.getStorageSync('userMsg').userid,
- "content.username": wx.getStorageSync('userMsg').name,
- })
- }
- },
- data: {
- "content": {
- dataType: "",
- where: {
- type: "",
- tradingstatus: "",
- tradefield: "",
- grade: "",
- sa_projectid: ""
- },
- pageNumber: 1,
- pageSize: 20,
- pageTotal: 1
- },
- grades: [],
- tradefields: [],
- projecttypes: [],
- nodes: [{
- remarks: '全部',
- value: ''
- }, {
- remarks: '立项',
- value: '立项'
- }, {
- remarks: '报备',
- value: '报备'
- }, {
- remarks: '报价',
- value: '报价'
- }, {
- remarks: '合同',
- value: '合同'
- }, {
- remarks: '订单',
- value: '订单'
- }, {
- remarks: '结案',
- value: '结案'
- }],
- },
- methods: {
- async getList() {
- let content = this.data.content;
- if (this.data.tradefields.length == 0) {
- _Http.basic({
- "classname": "sysmanage.develop.optiontype.optiontype",
- "method": "optiontypeselect",
- "content": {
- "pageNumber": 1,
- "pageSize": 1000,
- "typename": "tradefield",
- "parameter": {}
- },
- }).then(res => {
- console.log("领域", res)
- if (res.code == 1) {
- res.data = res.data.map(v => {
- v.remarks = v.value
- return v
- })
- res.data.unshift({
- remarks: '全部',
- value: ''
- })
- this.setData({
- tradefields: res.data
- })
- }
- })
- }
- if (this.data.projecttypes.length == 0) await _Http.basic({
- "classname": "sysmanage.develop.optiontype.optiontype",
- "method": "optiontypeselect",
- "content": {
- "pageNumber": 1,
- "pageSize": 1000,
- "typename": "projecttype",
- "parameter": {}
- },
- }).then(res => {
- console.log("项目类型", res)
- if (res.code == 1) {
- res.data = res.data.map((v, i) => {
- if (i == 0) content.where.projecttype = v.value;
- v.remarks = v.value + '-' + getApp().globalData.Language.getMapText(v.remarks)
- return v
- })
- res.data.unshift({
- remarks: '全部',
- value: ''
- })
- this.setData({
- content,
- projecttypes: res.data
- })
- }
- })
- if (this.data.grades.length == 0) {
- _Http.basic({
- "classname": "sysmanage.develop.optiontype.optiontype",
- "method": "optiontypeselect",
- "content": {
- "pageNumber": 1,
- "pageSize": 1000,
- "typename": "projectgrade",
- "parameter": {}
- },
- }).then(res => {
- console.log("项目等级", res)
- if (res.code == 1) {
- res.data = res.data.map(v => {
- v.remarks = v.value + '-' + getApp().globalData.Language.getMapText(v.remarks)
- return v
- })
- res.data.unshift({
- remarks: '全部',
- value: ''
- })
- this.setData({
- grades: res.data
- })
- }
- })
- }
- const {
- dataid,
- type,
- username,
- isleave
- } = getCurrentPages()[getCurrentPages().length - 1].data;
- content.dataid = dataid;
- content.type = type;
- content.username = username;
- content.where.isleave = isleave;
- _Http.basic({
- "id": 20231023092304,
- content
- }).then(res => {
- console.log("项目生命周期分析", res)
- if (res.code != '1') return wx.showToast({
- title: res.data,
- icon: "none"
- })
- this.setData({
- list: res.data.map(v => {
- v.bgColor = {
- "报备": "#3874F6",
- "报价": "#00B32B",
- "合同": "#FFAE02",
- "订单": "#F53F3F",
- } [v.end]
- v.tips = {
- "报价": "项目报价审核",
- "订单": "项目订单审核",
- } [v.start] || "项目报备审核"
- v.dateavg = v.dateavg.toFixed(2)
- return v
- })
- })
- try {
- this.selectAllComponents("#Filtrate").forEach(v => v.onCancel())
- } catch (error) {}
- })
- },
- changeType1(e) {
- this.setData({
- [`content.${e.currentTarget.dataset.node}`]: e.detail,
- })
- this.getList(true)
- },
- changeType2(e) {
- this.setData({
- [`content.where.${e.currentTarget.dataset.node}`]: e.detail,
- })
- this.getList(true)
- },
- changeType3({
- detail
- }) {
- this.setData({
- "content.where.tradefield": detail,
- })
- this.getList(true)
- },
- showTips() {
- getApp().globalData.Language.showToast('统计项目生命周期中的各个关键节点之间平均周期')
- },
- toSelectProject({
- detail
- }) {
- if (detail) {
- this.setData({
- "content.where.sa_projectid": ''
- })
- this.getList(true);
- } else {
- _Http.data = JSON.parse(JSON.stringify(this.data));
- delete _Http.data.list;
- delete _Http.data.language;
- delete _Http.data.sColors;
- delete _Http.data.nodes;
- wx.navigateTo({
- url: '/salesPanel/dataOverview/Project/projectList'
- })
- function selectItem(item) {
- this.setData({
- "content.where.sa_projectid": item.sa_projectid,
- })
- this.selectComponent("#Filtrate1").setShowArrText([item.projectname]);
- this.getList(true);
- wx.navigateBack()
- delete _Http.selectItem;
- }
- _Http.selectItem = selectItem.bind(this);
- }
- }
- }
- })
|