|
|
@@ -1,7 +1,7 @@
|
|
|
const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
data: {
|
|
|
- tabsActive: 3, //tabs 选中项
|
|
|
+ tabsActive: 0, //tabs 选中项
|
|
|
sa_projectid: "",
|
|
|
tabsList: [{
|
|
|
label: "详细信息",
|
|
|
@@ -19,6 +19,22 @@ Page({
|
|
|
label: "联系人",
|
|
|
num: 132
|
|
|
}],
|
|
|
+ tabbarList: [{
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: "报备"
|
|
|
+ }, {
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: "跟进"
|
|
|
+ }, {
|
|
|
+ icon: "icon-bianji",
|
|
|
+ label: "编辑"
|
|
|
+ }, {
|
|
|
+ icon: "icon-zhuanyi",
|
|
|
+ label: "更换负责人"
|
|
|
+ }, {
|
|
|
+ icon: "icon-shanchu",
|
|
|
+ label: "作废"
|
|
|
+ }],
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.setData({
|
|
|
@@ -142,7 +158,7 @@ Page({
|
|
|
})
|
|
|
//更新列表赢率
|
|
|
getCurrentPages().forEach(v => {
|
|
|
- if (v.getList) {
|
|
|
+ if (v.__route__ == 'packageA/project/index') {
|
|
|
let i = v.data.list.findIndex(e => e.sa_projectid == this.data.sa_projectid);
|
|
|
if (i != -1) v.setData({
|
|
|
[`list[${i}].winrate`]: parseFloat(res.data.winrate.substring(0, res.data.winrate.length - 1))
|
|
|
@@ -186,6 +202,9 @@ Page({
|
|
|
case "关联客户":
|
|
|
model = "#Treaty"
|
|
|
break;
|
|
|
+ case "联系人":
|
|
|
+ model = "#Contacts"
|
|
|
+ break;
|
|
|
};
|
|
|
if (model) {
|
|
|
// 确定好模块ID total = null 是第一次加载 加载数据
|
|
|
@@ -208,6 +227,99 @@ Page({
|
|
|
onReachBottom() {
|
|
|
this.partialRenewal();
|
|
|
},
|
|
|
+ //详情按钮回调
|
|
|
+ tabbarOnClick({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ let data = this.data.detail;
|
|
|
+ switch (detail.label) {
|
|
|
+ case "跟进":
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_project&ownerid=${data.sa_projectid}`,
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "编辑":
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/packageA/project/addAndEdit?data=${JSON.stringify(data)}`,
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "作废":
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/packageA/project/delete?id=${this.data.detail.sa_projectid}`,
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "更换负责人":
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/packageA/group/select?data=${JSON.stringify({
|
|
|
+ ownertable:"sa_project",
|
|
|
+ ownerid:data.sa_projectid,
|
|
|
+ })}&radio=true&principal=true`,
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "报备":
|
|
|
+ console.log(detail)
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221114163402,
|
|
|
+ "content": {
|
|
|
+ "sa_projectid": data.sa_projectid,
|
|
|
+ "tag": "报备中"
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ this.getTags();
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.showToast({
|
|
|
+ title: '已提交报备!',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ console.log(detail)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 更换负责人 */
|
|
|
+ handelSubmit(arr) {
|
|
|
+ const that = this;
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认更换负责人',
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": 20220930103701,
|
|
|
+ "content": {
|
|
|
+ ownertable: "sa_project",
|
|
|
+ ownerid: that.data.detail.sa_projectid,
|
|
|
+ userid: arr[0]
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("更换负责人", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ wx.showToast({
|
|
|
+ title: '更换成功!',
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ that.getDetail();
|
|
|
+ getCurrentPages().forEach(v => {
|
|
|
+ if (['packageA/project/index'].includes(v.__route__)) v.getList(true)
|
|
|
+ })
|
|
|
+ wx.navigateBack();
|
|
|
+ }, 300)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
onShareAppMessage() {
|
|
|
|
|
|
}
|