|
@@ -1,152 +1,133 @@
|
|
|
const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
- data: {
|
|
|
- appid: 'wxc1b6ae925ac1d06a',
|
|
|
- detailsData: {}
|
|
|
- },
|
|
|
- onLoad(options) {
|
|
|
- getApp().globalData.Language.getLanguagePackage(this, '消息详情')
|
|
|
- const item = JSON.parse(options.item)
|
|
|
- if (item.isread == 0) _Http.basic({
|
|
|
- "classname": "system.message.Message",
|
|
|
- "method": "readMessage",
|
|
|
- "content": {
|
|
|
- "messageid": item.messageid
|
|
|
- }
|
|
|
- })
|
|
|
- //判断具体消息归属
|
|
|
- switch (item.objectname) {
|
|
|
- case "sa_customers":
|
|
|
- //客户
|
|
|
- item.name = '';
|
|
|
- this.saCustomer(item.objectid);
|
|
|
- break;
|
|
|
- case "sat_orderclue":
|
|
|
- item.name = '';
|
|
|
- this.satOrderclue(item.objectid);
|
|
|
- //线索
|
|
|
- break;
|
|
|
- case "sa_order":
|
|
|
- item.name = '';
|
|
|
- this.saOrder(item.objectid)
|
|
|
- break;
|
|
|
- case "sa_salesforecastbill":
|
|
|
- item.name = '';
|
|
|
- this.salesforecastbill(item.objectid)
|
|
|
- break;
|
|
|
- case "sys_phonebook":
|
|
|
- item.name = '联系人';
|
|
|
- item.path = '/packageA/contacts/detail'
|
|
|
- break;
|
|
|
- case "sys_enterprise_contacts":
|
|
|
- item.name = '客户联系人';
|
|
|
- item.path = '/packageA/contacts/detail'
|
|
|
- break;
|
|
|
- case "sa_project_contacts":
|
|
|
- item.name = '项目联系人';
|
|
|
- item.path = '/packageA/contacts/detail'
|
|
|
- break;
|
|
|
- }
|
|
|
- //修改跳转页面
|
|
|
- if (item.path) {
|
|
|
- let arr = item.path.split("/");
|
|
|
- arr[arr.length - 1] = 'detail';
|
|
|
- item.path = arr.join("/");
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- detailsData: item,
|
|
|
- auth: JSON.stringify(wx.getStorageSync('auth')),
|
|
|
- userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
|
|
|
- site: JSON.stringify(wx.getStorageSync('siteP'))
|
|
|
- })
|
|
|
- console.log("消息详情", item)
|
|
|
- },
|
|
|
- saOrder(sa_orderid) {
|
|
|
- _Http.basic({
|
|
|
- "id": 20221108151302,
|
|
|
- "content": {
|
|
|
- nocache: true,
|
|
|
- sa_orderid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("订单", res)
|
|
|
- if (res.code != '1') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- let path = '';
|
|
|
- switch (res.data.type) {
|
|
|
- case '工具借用单':
|
|
|
- path = '/packageA/borrow/detail'
|
|
|
- break;
|
|
|
- case '借用归还单':
|
|
|
- path = '/packageA/toolBill/detail'
|
|
|
- break;
|
|
|
- default:
|
|
|
- path = '/packageA/orderForm/detail'
|
|
|
- break;
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- "detailsData.name": res.data.type,
|
|
|
- "detailsData.path": path
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- satOrderclue(sat_orderclueid) {
|
|
|
- _Http.basic({
|
|
|
- "classname": "saletool.orderclue.web.orderclue",
|
|
|
- "method": "selectDetail",
|
|
|
- "version": 1,
|
|
|
- "content": {
|
|
|
- "nocache": true,
|
|
|
- sat_orderclueid
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- console.log("线索详情", res)
|
|
|
- if (res.code != '1') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- "detailsData.name": res.data.isprivate ? '销售线索' : '公海线索',
|
|
|
- "detailsData.path": res.data.isprivate ? '/packageA/saleClue/detail' : '/packageA/publicClue/detail',
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- salesforecastbill(sa_salesforecastbillid) {
|
|
|
- _Http.basic({
|
|
|
- "id": 20230705144704,
|
|
|
- "content": {
|
|
|
- sa_salesforecastbillid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("预测详情", res)
|
|
|
- if (res.code != '1') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- "detailsData.name": res.data.baseonproject ? '项目成交预测' : '出货开票预测',
|
|
|
- "detailsData.path": res.data.baseonproject ? '/packageA/finishforecast/detail' : '/packageA/invoiceforecast/detail',
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- saCustomer(sa_customersid) {
|
|
|
- _Http.basic({
|
|
|
- "id": 20221012164302,
|
|
|
- "content": {
|
|
|
- sa_customersid
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- console.log("客户详情", res)
|
|
|
- if (res.code != '1') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- "detailsData.name": res.data.sa_customerpoolid ? '公海客户' : '我的客户',
|
|
|
- "detailsData.path": res.data.sa_customerpoolid ? '/packageA/publicCustomer/detail' : '/packageA/setclient/detail',
|
|
|
- })
|
|
|
- });
|
|
|
- }
|
|
|
+ data: {
|
|
|
+ appid: 'wxc1b6ae925ac1d06a',
|
|
|
+ detailsData: {}
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ const item = JSON.parse(options.item)
|
|
|
+ if (item.isread == 0) _Http.basic({
|
|
|
+ "classname": "system.message.Message",
|
|
|
+ "method": "readMessage",
|
|
|
+ "content": {
|
|
|
+ "messageid": item.messageid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("已读消息", res)
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ //判断具体消息归属
|
|
|
+ switch (item.objectname) {
|
|
|
+ case "sa_customers":
|
|
|
+ //客户
|
|
|
+ item.name = '';
|
|
|
+ this.saCustomer(item.objectid);
|
|
|
+ break;
|
|
|
+ case "sat_orderclue":
|
|
|
+ item.name = '';
|
|
|
+ this.satOrderclue(item.objectid);
|
|
|
+ //线索
|
|
|
+ break;
|
|
|
+ case "sa_order":
|
|
|
+ item.name = '';
|
|
|
+ this.saOrder(item.objectid)
|
|
|
+ // sa_order
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //修改跳转页面
|
|
|
+ if (item.path) {
|
|
|
+ switch (item.path) {
|
|
|
+ case "sa_workorder":
|
|
|
+ //工单
|
|
|
+ item.path = "/Eservice/workerLeader/editworkOrderDetail/index"
|
|
|
+ break;
|
|
|
+ /* case "sa_serviceorder":
|
|
|
+ //申请单
|
|
|
+ item.path = "/Eservice/workerLeader/serviceBillDetail/index"
|
|
|
+ break; */
|
|
|
+ default:
|
|
|
+ let arr = item.path.split("/");
|
|
|
+ arr[arr.length - 1] = ["sat_submiteditmodel", "sat_noticeids", "sat_sharematerial"].includes(item.objectname) ? 'details' : ["sys_attachment"].includes(item.objectname) ? 'index' : 'detail';
|
|
|
+ item.path = arr.join("/");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ detailsData: item,
|
|
|
+ auth: JSON.stringify(wx.getStorageSync('auth')),
|
|
|
+ userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
|
|
|
+ site: JSON.stringify(wx.getStorageSync('siteP'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saOrder(sa_orderid) {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221108151302,
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ sa_orderid
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("订单", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ let path = '';
|
|
|
+ switch (res.data.type) {
|
|
|
+ case '工具借用单':
|
|
|
+ path = '/packageA/borrow/detail'
|
|
|
+ break;
|
|
|
+ case '借用归还单':
|
|
|
+ path = '/packageA/toolBill/detail'
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ path = '/packageA/orderForm/detail'
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ "detailsData.name": res.data.type,
|
|
|
+ "detailsData.path": path
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ satOrderclue(sat_orderclueid) {
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "saletool.orderclue.web.orderclue",
|
|
|
+ "method": "selectDetail",
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "nocache": true,
|
|
|
+ sat_orderclueid
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ console.log("线索详情", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ "detailsData.name": res.data.isprivate ? '销售线索' : '公海线索',
|
|
|
+ "detailsData.path": res.data.isprivate ? '/packageA/saleClue/detail' : '/packageA/publicClue/detail',
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ saCustomer(sa_customersid) {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221012164302,
|
|
|
+ "content": {
|
|
|
+ sa_customersid
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ console.log("客户详情", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ "detailsData.name": res.data.ispublic ? '公海客户' : '我的客户',
|
|
|
+ "detailsData.path": res.data.ispublic ? '/packageA/publicCustomer/detail' : '/packageA/setclient/detail',
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|