detail.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. const _Http = getApp().globalData.http,
  2. currency = require("../../utils/currency"),
  3. CNY = value => currency(value, {
  4. symbol: "¥",
  5. precision: 2
  6. }).format();
  7. let paramvalue = false;
  8. Page({
  9. data: {
  10. isInsert: false,
  11. loading: true,
  12. isLeader: false, //是否为负责人
  13. isRecover: false, //关闭弹窗是否恢复项目
  14. tabsActive: 0, //tabs 选中项
  15. sa_projectid: "",
  16. tabbarList: [],
  17. },
  18. onLoad(options) {
  19. const appAuth = wx.getStorageSync('auth').wproject;
  20. let tabsList = [{
  21. label: "报价单",
  22. icon: "icon-tabbaojiadan",
  23. model: "#Offers"
  24. }, {
  25. label: "合同",
  26. icon: "icon-tabhetong",
  27. model: "#Contract"
  28. }, {
  29. label: "详细信息",
  30. icon: "icon-tabxiangxixinxi1"
  31. }, {
  32. label: "关联客户",
  33. icon: "icon-tabkehu",
  34. model: "#Treaty"
  35. }, {
  36. label: "联系人",
  37. icon: "icon-tablianxiren",
  38. model: "#Contacts"
  39. }]
  40. if (appAuth.isdatafollowup) tabsList.unshift({
  41. label: "跟进动态",
  42. icon: "icon-tabgenjinjilu",
  43. model: "#Trace"
  44. })
  45. if (appAuth.options.some(v => v == 'product')) tabsList.push({
  46. label: "产品配置单",
  47. icon: "icon-tabchanpin",
  48. model: "#Product"
  49. })
  50. tabsList = tabsList.concat([{
  51. label: "关联线索",
  52. icon: "icon-tabxiansuo",
  53. model: "#Clue"
  54. }, {
  55. label: "报备进度",
  56. icon: "icon-tabfujian1",
  57. model: "#ReportingProgress"
  58. }])
  59. if (appAuth.istask) tabsList.push({
  60. label: "任务",
  61. icon: "icon-tabrenwu",
  62. model: "#Work"
  63. })
  64. tabsList = tabsList.concat([{
  65. label: "竞争对手",
  66. icon: "icon-tabjingzhengduishou",
  67. model: "#Opponent"
  68. }, {
  69. label: "项目评估",
  70. icon: "icon-tabxiangmupinggu",
  71. model: "#Task"
  72. }, {
  73. label: "附件",
  74. icon: "icon-tabfujian1",
  75. model: "#Files"
  76. }, {
  77. label: "操作记录",
  78. icon: "icon-tabcaozuojilu1",
  79. model: "#Record"
  80. }])
  81. this.setData({
  82. sa_projectid: options.id,
  83. isAdmin: appAuth.options.some(v => v == "admin"), //是否具有管理权限
  84. options: appAuth.options, //权限列表
  85. tabsList,
  86. appAuth
  87. })
  88. this.getDetail(true);
  89. getApp().globalData.Language.getLanguagePackage(this, '项目详情');
  90. },
  91. getDetail(init = false) {
  92. _Http.basic({
  93. "id": 20221021103902,
  94. "content": {
  95. nocache: true,
  96. "sa_projectid": this.data.sa_projectid
  97. },
  98. }).then(res => {
  99. console.log("项目商机详情", res)
  100. if (res.code != '1') return wx.showToast({
  101. title: res.data,
  102. icon: "none"
  103. });
  104. this.setPreview(res.data);
  105. this.setData({
  106. loading: false,
  107. detail: res.data,
  108. })
  109. if (init) {
  110. if (this.data.appAuth.isdatatag) this.getTags();
  111. if (this.data.appAuth.isdatateam) this.getGroup();
  112. this.selectComponent("#TaskTabs").getList();
  113. }
  114. this.setTabbarList();
  115. this.partialRenewal(init);
  116. })
  117. },
  118. /* 设置显示信息 */
  119. async setPreview(data) {
  120. let list1 = [{
  121. label: "项目编号",
  122. value: data.projectnum
  123. }, {
  124. label: "项目名称",
  125. value: data.projectname
  126. }, {
  127. label: "报备进度",
  128. value: data.reportstatus,
  129. style: `color:${this.data.sColors[data.reportstatus]}`
  130. }, {
  131. label: "项目类型",
  132. value: data.projecttype
  133. }, {
  134. label: "项目阶段",
  135. value: data.stagename
  136. }, {
  137. label: "项目方阶段",
  138. value: data.squarestage
  139. }, {
  140. label: "项目等级",
  141. value: data.grade
  142. }, {
  143. label: "省市县",
  144. value: data.province ? data.province + data.city + data.county : ''
  145. }, {
  146. label: "地址",
  147. value: data.address
  148. }, {
  149. label: "项目规模",
  150. value: data.scale ? data.scale + data.unitname : ""
  151. }, {
  152. label: "项目预算(万元)",
  153. value: CNY(data.budgetary)
  154. }, {
  155. label: "总投资额(万元)",
  156. value: CNY(data.totalinvestment)
  157. }, {
  158. label: "造价(万元)",
  159. value: CNY(data.costofconstruction)
  160. }, {
  161. label: "预计开工时间",
  162. value: data.begdate_due
  163. }, {
  164. label: "预计完工时间",
  165. value: data.enddate_due
  166. }, {
  167. label: "预计签约时间",
  168. value: data.signdate_due
  169. }, {
  170. label: "预计签约金额(元)",
  171. value: CNY(data.signamount_due)
  172. }, {
  173. label: "项目成交金额",
  174. value: CNY(data.dealamount)
  175. }, {
  176. label: "领域",
  177. value: data.tradefield
  178. }, {
  179. label: "品牌",
  180. value: data.brandname
  181. }, {
  182. label: "品牌是否填报方植入",
  183. value: data.isfillbrangd == 1 ? '是' : (data.isfillbrangd + "").length == 0 ? '' : "否"
  184. }, {
  185. label: "项目来源",
  186. value: data.source
  187. }, {
  188. label: "赢率",
  189. value: data.winrate
  190. }, {
  191. label: "负责人",
  192. value: data.name
  193. }, {
  194. label: "项目状态",
  195. value: getApp().globalData.Language.getMapText(data.status),
  196. style: `color:${data.status == '跟进中'? '#3874f6':this.data.sColors[data.status]}`
  197. }, {
  198. label: "结案/失败原因",
  199. value: data.status == '已结案' ? data.endreason : data.defeattype + (data.defeatreason ? "," + data.defeatreason : data.defeatreason)
  200. }];
  201. if (wx.getStorageSync('userMsg').siteid == 'HY') list1 = list1.filter(v => !["项目预算(万元)", "总投资额(万元)", "造价(万元)"].includes(v.label))
  202. this.setData({
  203. briefs: [{
  204. label: "项目编号",
  205. value: data.projectnum
  206. }, {
  207. label: "报备进度",
  208. value: data.reportstatus,
  209. style: `color:${this.data.sColors[data.reportstatus]}`
  210. }, {
  211. label: "项目类型",
  212. value: data.projecttype
  213. }, {
  214. label: "项目阶段",
  215. value: data.stagename
  216. }, {
  217. label: "项目等级",
  218. value: data.grade
  219. }, {
  220. label: "状态",
  221. value: getApp().globalData.Language.getMapText(data.status),
  222. style: `color:${data.status == '跟进中'? '#3874f6':this.data.sColors[data.status]}`
  223. }, {
  224. label: '营销费用',
  225. value: CNY(data.salesfeesamount || '0')
  226. }],
  227. list1,
  228. list2: [{
  229. label: "创建人",
  230. value: data.createby
  231. }, {
  232. label: "创建时间",
  233. value: data.createdate
  234. }, {
  235. label: "最近编辑人",
  236. value: data.changeby
  237. }, {
  238. label: "最近编辑时间",
  239. value: data.changedate
  240. }, {
  241. label: "提交报备人",
  242. value: data.reportby
  243. }, {
  244. label: "提交报备时间",
  245. value: data.reportdate
  246. }, {
  247. label: "报备审核人",
  248. value: data.reportcheckby
  249. }, {
  250. label: "报备审核时间",
  251. value: data.reportcheckdate
  252. }, {
  253. label: "转手次数",
  254. value: data.changecount
  255. }]
  256. })
  257. },
  258. /* 设置tabbar */
  259. async setTabbarList() {
  260. let detail = this.data.detail,
  261. status = detail.status,
  262. isLeader = detail.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
  263. isAdmin = this.data.isAdmin,
  264. editdataleader = isLeader,
  265. tabbarList = [];
  266. if (this.data.appAuth.isdatafollowup) tabbarList.push({
  267. icon: "icon-genjin",
  268. label: "跟进"
  269. });
  270. if (wx.getStorageSync('auth').wproject.options.some(v => v == "auditauthorization")) tabbarList.unshift({
  271. icon: "icon-shenheshouquan",
  272. label: "审核授权"
  273. })
  274. if (!isLeader) {
  275. let res = await getApp().agentOrNot("sa_project", this.data.sa_projectid),
  276. data = res.code == '1' ? res.data : {
  277. editable: 0,
  278. editdataleader: 0
  279. }
  280. if (this.data.appAuth.isdatateam) isLeader = this.selectComponent("#Group").data.editable == 1;
  281. if (!isLeader) isLeader = data.editable == 1;
  282. editdataleader = data.editdataleader;
  283. }
  284. if (isAdmin && detail.reportstatus == '报备中') tabbarList = [{
  285. icon: "icon-baobeishenhe",
  286. label: "报备审核"
  287. }, {
  288. icon: "icon-genjin",
  289. label: "报备驳回(退回)"
  290. }].concat(tabbarList)
  291. if (isLeader || isAdmin) {
  292. if (status != '已失败' && status != '已结案') {
  293. _Http.basic({
  294. "classname": "sysmanage.develop.datafunction.datafunction",
  295. "method": "execute",
  296. "content": {
  297. functionname: "bpmswitch"
  298. }
  299. }).then(res => {
  300. console.log("查询是否启用BPM流程", res)
  301. if (res.code != '0') paramvalue = res.data[0].paramvalue == "true";
  302. })
  303. tabbarList.push({
  304. icon: "icon-bianji",
  305. label: "编辑"
  306. })
  307. if (detail.reportstatus == '未报备') tabbarList.push({
  308. icon: "icon-tijiaobaobei1",
  309. label: "提交报备"
  310. })
  311. if (editdataleader) tabbarList.push({
  312. icon: "icon-zhuanyi",
  313. label: "更换负责人"
  314. })
  315. }
  316. if (isLeader) {
  317. if (status == '已成交') tabbarList.push({
  318. icon: "icon-dibu-jieshu",
  319. label: "结案"
  320. })
  321. if (status == '跟进中') tabbarList.push({
  322. icon: "icon-dibu-wuxiao",
  323. label: "失败"
  324. })
  325. if (status == '已失败' || status == '已结案') tabbarList = [{
  326. icon: "icon-dibu-chehui",
  327. label: "恢复"
  328. }]
  329. }
  330. tabbarList.push({
  331. icon: "icon-shanchu",
  332. label: "作废"
  333. })
  334. }
  335. if (this.data.options.find(v => v == 'viewRepetition')) tabbarList.push({
  336. icon: "icon-a-shouyejingangquhehuoren",
  337. label: "查看重复"
  338. });
  339. this.setData({
  340. isLeader,
  341. tabbarList,
  342. disabled: status != '已失败' && status != '已结案'
  343. });
  344. },
  345. //详情按钮回调
  346. tabbarOnClick({
  347. detail
  348. }) {
  349. let data = this.data.detail,
  350. that = this;
  351. switch (detail.label) {
  352. case "失败":
  353. wx.navigateTo({
  354. url: '/packageA/project/modules/fail/index?id=' + this.data.sa_projectid
  355. })
  356. break;
  357. case "结案":
  358. this.selectComponent("#Dialog").onClick(this.data.sa_projectid)
  359. break;
  360. case "发起授权":
  361. wx.navigateTo({
  362. url: `./impower/initiate?projectname=${data.projectname}&sa_projectid=${data.sa_projectid}`,
  363. })
  364. break;
  365. case "审核授权":
  366. wx.navigateTo({
  367. url: `./impower/impower?sa_projectid=${data.sa_projectid}`,
  368. })
  369. break;
  370. case "恢复":
  371. _Http.basic({
  372. "id": 20221208184202,
  373. "content": {
  374. ...data,
  375. pageSize: 999
  376. }
  377. }).then(res => {
  378. console.log("查看重复", res)
  379. if (res.code != '1') return wx.showToast({
  380. title: res.msg,
  381. icon: "none"
  382. });
  383. if (res.data.length == 0) {
  384. wx.showModal({
  385. title: getApp().globalData.Language.getMapText('提示'),
  386. content: getApp().globalData.Language.getMapText('是否确认恢复项目'),
  387. cancelText: getApp().globalData.Language.getMapText('取消'),
  388. confirmText: getApp().globalData.Language.getMapText('确定'),
  389. complete: ({
  390. confirm
  391. }) => {
  392. if (confirm) that.onRecover()
  393. }
  394. })
  395. } else {
  396. wx.showToast({
  397. title: getApp().globalData.Language.getMapText('查询到有疑似重复项目'),
  398. icon: "none"
  399. })
  400. this.setData({
  401. repetitionList: res.data,
  402. repetitionShow: true,
  403. isRecover: true
  404. });
  405. }
  406. })
  407. break;
  408. case "提交报备":
  409. wx.showModal({
  410. title: getApp().globalData.Language.getMapText('提示'),
  411. content: getApp().globalData.Language.getMapText('是否确认提交项目审核'),
  412. cancelText: getApp().globalData.Language.getMapText('取消'),
  413. confirmText: getApp().globalData.Language.getMapText('确定'),
  414. complete: ({
  415. confirm
  416. }) => {
  417. if (confirm) that.handleReport(1)
  418. }
  419. })
  420. break;
  421. case "报备审核":
  422. if (paramvalue) {
  423. wx.showModal({
  424. title: getApp().globalData.Language.getMapText('提示'),
  425. content: getApp().globalData.Language.getMapText('请前往WEB端操作'),
  426. showCancel: false,
  427. confirmText: getApp().globalData.Language.getMapText('确定'),
  428. })
  429. } else {
  430. wx.showModal({
  431. title: getApp().globalData.Language.getMapText('提示'),
  432. content: getApp().globalData.Language.getMapText('是否确认报备审核'),
  433. cancelText: getApp().globalData.Language.getMapText('取消'),
  434. confirmText: getApp().globalData.Language.getMapText('确定'),
  435. complete: ({
  436. confirm
  437. }) => {
  438. if (confirm) that.handleReport(2)
  439. }
  440. })
  441. }
  442. break;
  443. case "报备驳回(退回)":
  444. if (paramvalue) {
  445. wx.showModal({
  446. title: getApp().globalData.Language.getMapText('提示'),
  447. content: getApp().globalData.Language.getMapText('请前往WEB端操作'),
  448. showCancel: false,
  449. confirmText: getApp().globalData.Language.getMapText('确定'),
  450. })
  451. } else {
  452. wx.showModal({
  453. title: getApp().globalData.Language.getMapText('提示'),
  454. content: getApp().globalData.Language.getMapText('是否确认报备驳回(退回)项目'),
  455. cancelText: getApp().globalData.Language.getMapText('取消'),
  456. confirmText: getApp().globalData.Language.getMapText('确定'),
  457. complete: ({
  458. confirm
  459. }) => {
  460. if (confirm) that.handleReport(3)
  461. }
  462. })
  463. }
  464. break;
  465. case "跟进":
  466. that.selectComponent("#Trace").insetr();
  467. break;
  468. case "编辑":
  469. let tags = that.selectComponent("#Tags").data.systemtag;
  470. wx.navigateTo({
  471. url: `/packageA/project/addAndEdit?data=${JSON.stringify(data)}&disabled=${tags.includes("报备中")||tags.includes("已报备")}`,
  472. })
  473. break;
  474. case "作废":
  475. _Http.basic({
  476. "id": "20221223102102",
  477. "content": {
  478. "nocache": true,
  479. "sa_projectid": that.data.sa_projectid,
  480. pageNumbe: 1,
  481. pageSize: 9999,
  482. "where": {
  483. "conditino": ""
  484. }
  485. }
  486. }).then(res => {
  487. console.log("查询合同列表", res)
  488. if (res.code != '1') return wx.showToast({
  489. title: res.data,
  490. icon: "none"
  491. })
  492. if (res.data.some(v => v.status == '审核')) {
  493. wx.showModal({
  494. title: getApp().globalData.Language.getMapText('提示'),
  495. content: getApp().globalData.Language.getMapText('当前项目中存在审核状态合同,不可作废') + '!',
  496. showCancel: false,
  497. confirmText: getApp().globalData.Language.getMapText('确定'),
  498. })
  499. } else {
  500. wx.navigateTo({
  501. url: `/packageA/project/delete?id=${this.data.detail.sa_projectid}`,
  502. })
  503. }
  504. })
  505. break;
  506. case "更换负责人":
  507. wx.navigateTo({
  508. url: `/pages/group/select?data=${JSON.stringify({
  509. ownertable:"sa_project",
  510. ownerid:data.sa_projectid,
  511. })}&radio=true&principal=true`,
  512. })
  513. break;
  514. case "查看重复":
  515. _Http.basic({
  516. "id": 20221208184202,
  517. "content": {
  518. ...data,
  519. pageSize: 999
  520. }
  521. }).then(res => {
  522. console.log("查看重复", res)
  523. if (res.code != '1') return wx.showToast({
  524. title: res.msg,
  525. icon: "none"
  526. });
  527. if (res.data.length == 0) {
  528. getApp().globalData.Language.showToast('未查询到重复数据')
  529. this.getTags()
  530. } else {
  531. this.setTags();
  532. this.setData({
  533. repetitionList: res.data,
  534. repetitionShow: true
  535. })
  536. }
  537. })
  538. break;
  539. default:
  540. console.log(detail)
  541. break;
  542. }
  543. },
  544. /* 恢复项目 */
  545. onRecover() {
  546. _Http.basic({
  547. "id": 20221215164002,
  548. "content": {
  549. "sa_projectid": this.data.sa_projectid
  550. }
  551. }).then(res => {
  552. console.log('恢复', res)
  553. wx.showToast({
  554. title: res.code == '1' ? getApp().globalData.Language.getMapText('已恢复') : res.msg,
  555. icon: "none",
  556. mask: true
  557. });
  558. if (res.code == '1') setTimeout(this.getDetail, 300);
  559. })
  560. },
  561. /* 关闭查重弹窗 */
  562. repClose() {
  563. let that = this;
  564. if (this.data.isRecover) wx.showModal({
  565. title: getApp().globalData.Language.getMapText('提示'),
  566. content: getApp().globalData.Language.getMapText('存在重复项目,是否确认恢复'),
  567. cancelText: getApp().globalData.Language.getMapText('取消'),
  568. confirmText: getApp().globalData.Language.getMapText('确定'),
  569. complete: ({
  570. confirm
  571. }) => {
  572. if (confirm) {
  573. that.onRecover(true)
  574. that.setTags();
  575. }
  576. }
  577. });
  578. this.setData({
  579. repetitionShow: false,
  580. isRecover: false
  581. })
  582. },
  583. /* setTags */
  584. setTags() {
  585. let {
  586. datatag,
  587. systemtag
  588. } = this.selectComponent("#Tags").returnTags();
  589. if (!systemtag.some(v => v == '疑似重复')) {
  590. systemtag.push("疑似重复")
  591. _Http.basic({
  592. "id": 20220929090901,
  593. "content": {
  594. "ownertable": "sa_project",
  595. "ownerid": this.data.sa_projectid,
  596. datatag,
  597. systemtag
  598. }
  599. }).then(res => {
  600. console.log("绑定疑似重复标签", res)
  601. if (res.code == '1') this.getTags();
  602. })
  603. } else {
  604. this.getTags();
  605. }
  606. },
  607. /* 1提交报备,2报备审核,3报备驳回(退回) */
  608. handleReport(type) {
  609. _Http.basic({
  610. "id": 20221114163402,
  611. "content": {
  612. "sa_projectid": this.data.sa_projectid,
  613. type
  614. }
  615. }).then(res => {
  616. console.log("报备", type, res)
  617. if (res.code != '1') {
  618. wx.showModal({
  619. title: getApp().globalData.Language.getMapText('提示'),
  620. content: res.msg,
  621. showCancel: false,
  622. confirmText: getApp().globalData.Language.getMapText('确定'),
  623. })
  624. } else {
  625. wx.showToast({
  626. title: getApp().globalData.Language.getMapText('操作成功'),
  627. icon: "none",
  628. mask: true
  629. })
  630. this.getDetail();
  631. this.getTags();
  632. }
  633. })
  634. },
  635. //局部数据更新 tabs
  636. partialRenewal(init = false) {
  637. let model = this.data.tabsList[this.data.tabsActive].model;
  638. if (model) {
  639. let Component = this.selectComponent(model),
  640. {
  641. total,
  642. pageNumber,
  643. pageTotal
  644. } = Component.data.content,
  645. id = this.data.sa_projectid;
  646. if (total == null || init) {
  647. Component.getList(id, init);
  648. } else if (pageNumber <= pageTotal) {
  649. Component.getList(id, false);
  650. }
  651. }
  652. },
  653. onReachBottom() {
  654. this.partialRenewal();
  655. },
  656. /* 项目评估切换 */
  657. taskTabsChange({
  658. detail
  659. }) {
  660. if (detail.change) {
  661. this.setData({
  662. tabsActive: this.data.tabsList.findIndex(v => v.label == '项目评估')
  663. });
  664. this.selectComponent("#Task").getList(this.data.sa_projectid, true)
  665. }
  666. },
  667. //tabs 切换
  668. tabsChange({
  669. detail
  670. }) {
  671. this.setData({
  672. tabsActive: detail
  673. });
  674. this.partialRenewal();
  675. },
  676. /* 更换负责人 */
  677. handelSubmit(arr) {
  678. const that = this;
  679. wx.showModal({
  680. title: getApp().globalData.Language.getMapText('提示'),
  681. content: getApp().globalData.Language.getMapText('是否确认更换负责人'),
  682. cancelText: getApp().globalData.Language.getMapText('取消'),
  683. confirmText: getApp().globalData.Language.getMapText('确定'),
  684. complete: ({
  685. confirm
  686. }) => {
  687. if (confirm) wx.showModal({
  688. title: getApp().globalData.Language.getMapText('提示'),
  689. content: getApp().globalData.Language.getMapText('是否参与该数据的后续工作'),
  690. cancelText: getApp().globalData.Language.getMapText('不参与'),
  691. confirmText: getApp().globalData.Language.getMapText('参与'),
  692. complete: (s) => {
  693. _Http.basic({
  694. "id": 20220930103701,
  695. "content": {
  696. ownertable: "sa_project",
  697. ownerid: that.data.detail.sa_projectid,
  698. userid: arr[0],
  699. isaddoldleader: s.confirm ? 1 : 0
  700. }
  701. }).then(res => {
  702. console.log("更换负责人", res)
  703. wx.showToast({
  704. title: res.code != '1' ? res.msg : getApp().globalData.Language.getMapText('更换成功'),
  705. icon: "none",
  706. mask: true
  707. });
  708. if (res.code == '1') setTimeout(() => {
  709. wx.navigateBack({
  710. delta: 2
  711. });
  712. }, 300)
  713. })
  714. }
  715. })
  716. }
  717. })
  718. },
  719. //更新标签
  720. getTags() {
  721. this.selectComponent("#Tags").getTags();
  722. },
  723. //更新团队成员
  724. getGroup() {
  725. this.selectComponent("#Group").getList().then(this.setTabbarList)
  726. },
  727. /* tag更新列表 */
  728. onGetList({
  729. detail
  730. }) {
  731. let tabbarList = this.data.tabbarList;
  732. if (detail.data.systemtag.includes('已报备')) {
  733. let status = this.data.detail.status
  734. if (this.data.isLeader && status != '已失败' && status != '已结案') tabbarList.unshift({
  735. icon: "icon-faqishouquan",
  736. label: "发起授权"
  737. })
  738. this.setData({
  739. isInsert: true,
  740. tabbarList
  741. })
  742. }
  743. },
  744. onUnload() {
  745. const page = getCurrentPages().find(v => v.__route__ == 'packageA/project/index');
  746. if (!page) return;
  747. let content = JSON.parse(JSON.stringify(page.data.content));
  748. content.pageSize = (content.pageNumber - 1) * content.pageSize;
  749. content.pageNumber = 1;
  750. _Http.basic({
  751. id: 20221020143502,
  752. content
  753. }).then(res => {
  754. console.log("更新项目商机列表", res);
  755. if (res.code == '1') {
  756. page.data.list = res.data.map(v => {
  757. v.progress = v.stage / v.totalstage * 100;
  758. return v
  759. });
  760. page.data.content.total = res.total;
  761. page.getTags();
  762. }
  763. })
  764. }
  765. })