detail.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  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) tabbarList = [{
  285. icon: "icon-baobeishenhe",
  286. label: "报备审核"
  287. }].concat(tabbarList);
  288. if (isLeader || isAdmin) {
  289. if (status != '已失败' && status != '已结案') {
  290. _Http.basic({
  291. "classname": "sysmanage.develop.datafunction.datafunction",
  292. "method": "execute",
  293. "content": {
  294. functionname: "bpmswitch"
  295. }
  296. }).then(res => {
  297. console.log("查询是否启用BPM流程", res)
  298. if (res.code != '0') paramvalue = res.data[0].paramvalue == "true";
  299. })
  300. tabbarList = tabbarList.concat([{
  301. icon: "icon-bianji",
  302. label: "编辑"
  303. }, {
  304. icon: "icon-tijiaobaobei1",
  305. label: "提交报备"
  306. }])
  307. if (editdataleader) tabbarList.push({
  308. icon: "icon-zhuanyi",
  309. label: "更换负责人"
  310. })
  311. }
  312. if (isLeader) {
  313. if (status == '已成交') tabbarList.push({
  314. icon: "icon-dibu-jieshu",
  315. label: "结案"
  316. })
  317. if (status == '跟进中') tabbarList.push({
  318. icon: "icon-dibu-wuxiao",
  319. label: "失败"
  320. })
  321. if (status == '已失败' || status == '已结案') tabbarList = [{
  322. icon: "icon-dibu-chehui",
  323. label: "恢复"
  324. }]
  325. }
  326. tabbarList.push({
  327. icon: "icon-shanchu",
  328. label: "作废"
  329. })
  330. }
  331. if (this.data.options.find(v => v == 'viewRepetition')) tabbarList.push({
  332. icon: "icon-a-shouyejingangquhehuoren",
  333. label: "查看重复"
  334. });
  335. this.setData({
  336. isLeader,
  337. tabbarList,
  338. disabled: status != '已失败' && status != '已结案'
  339. });
  340. },
  341. //详情按钮回调
  342. tabbarOnClick({
  343. detail
  344. }) {
  345. let data = this.data.detail,
  346. that = this;
  347. switch (detail.label) {
  348. case "失败":
  349. wx.navigateTo({
  350. url: '/packageA/project/modules/fail/index?id=' + this.data.sa_projectid
  351. })
  352. break;
  353. case "结案":
  354. this.selectComponent("#Dialog").onClick(this.data.sa_projectid)
  355. break;
  356. case "发起授权":
  357. wx.navigateTo({
  358. url: `./impower/initiate?projectname=${data.projectname}&sa_projectid=${data.sa_projectid}`,
  359. })
  360. break;
  361. case "审核授权":
  362. wx.navigateTo({
  363. url: `./impower/impower?sa_projectid=${data.sa_projectid}`,
  364. })
  365. break;
  366. case "恢复":
  367. _Http.basic({
  368. "id": 20221208184202,
  369. "content": {
  370. ...data,
  371. pageSize: 999
  372. }
  373. }).then(res => {
  374. console.log("查看重复", res)
  375. if (res.code != '1') return wx.showToast({
  376. title: res.msg,
  377. icon: "none"
  378. });
  379. if (res.data.length == 0) {
  380. wx.showModal({
  381. title: getApp().globalData.Language.getMapText('提示'),
  382. content: getApp().globalData.Language.getMapText('是否确认恢复项目'),
  383. cancelText: getApp().globalData.Language.getMapText('取消'),
  384. confirmText: getApp().globalData.Language.getMapText('确定'),
  385. complete: ({
  386. confirm
  387. }) => {
  388. if (confirm) that.onRecover()
  389. }
  390. })
  391. } else {
  392. wx.showToast({
  393. title: getApp().globalData.Language.getMapText('查询到有疑似重复项目'),
  394. icon: "none"
  395. })
  396. this.setData({
  397. repetitionList: res.data,
  398. repetitionShow: true,
  399. isRecover: true
  400. });
  401. }
  402. })
  403. break;
  404. case "提交报备":
  405. wx.showModal({
  406. title: getApp().globalData.Language.getMapText('提示'),
  407. content: getApp().globalData.Language.getMapText('是否确认提交项目审核'),
  408. cancelText: getApp().globalData.Language.getMapText('取消'),
  409. confirmText: getApp().globalData.Language.getMapText('确定'),
  410. complete: ({
  411. confirm
  412. }) => {
  413. if (confirm) that.handleReport(1)
  414. }
  415. })
  416. break;
  417. case "报备审核":
  418. if (paramvalue) {
  419. wx.showModal({
  420. title: getApp().globalData.Language.getMapText('提示'),
  421. content: getApp().globalData.Language.getMapText('请前往WEB端操作'),
  422. showCancel: false,
  423. confirmText: getApp().globalData.Language.getMapText('确定'),
  424. })
  425. } else {
  426. wx.showModal({
  427. title: getApp().globalData.Language.getMapText('提示'),
  428. content: getApp().globalData.Language.getMapText('提示'),
  429. cancelText: getApp().globalData.Language.getMapText('取消'),
  430. confirmText: getApp().globalData.Language.getMapText('确定'),
  431. complete: ({
  432. confirm
  433. }) => {
  434. if (confirm) that.handleReport(2)
  435. }
  436. })
  437. }
  438. break;
  439. case "报备驳回(退回)":
  440. if (paramvalue) {
  441. wx.showModal({
  442. title: getApp().globalData.Language.getMapText('提示'),
  443. content: getApp().globalData.Language.getMapText('请前往WEB端操作'),
  444. showCancel: false,
  445. confirmText: getApp().globalData.Language.getMapText('确定'),
  446. })
  447. } else {
  448. wx.showModal({
  449. title: getApp().globalData.Language.getMapText('提示'),
  450. content: getApp().globalData.Language.getMapText('是否确认报备驳回(退回)项目'),
  451. cancelText: getApp().globalData.Language.getMapText('取消'),
  452. confirmText: getApp().globalData.Language.getMapText('确定'),
  453. complete: ({
  454. confirm
  455. }) => {
  456. if (confirm) that.handleReport(3)
  457. }
  458. })
  459. }
  460. break;
  461. case "跟进":
  462. that.selectComponent("#Trace").insetr();
  463. break;
  464. case "编辑":
  465. let tags = that.selectComponent("#Tags").data.systemtag;
  466. wx.navigateTo({
  467. url: `/packageA/project/addAndEdit?data=${JSON.stringify(data)}&disabled=${tags.includes("报备中")||tags.includes("已报备")}`,
  468. })
  469. break;
  470. case "作废":
  471. _Http.basic({
  472. "id": "20221223102102",
  473. "content": {
  474. "nocache": true,
  475. "sa_projectid": that.data.sa_projectid,
  476. pageNumbe: 1,
  477. pageSize: 9999,
  478. "where": {
  479. "conditino": ""
  480. }
  481. }
  482. }).then(res => {
  483. console.log("查询合同列表", res)
  484. if (res.code != '1') return wx.showToast({
  485. title: res.data,
  486. icon: "none"
  487. })
  488. if (res.data.some(v => v.status == '审核')) {
  489. wx.showModal({
  490. title: getApp().globalData.Language.getMapText('提示'),
  491. content: getApp().globalData.Language.getMapText('当前项目中存在审核状态合同,不可作废') + '!',
  492. showCancel: false,
  493. confirmText: getApp().globalData.Language.getMapText('确定'),
  494. })
  495. } else {
  496. wx.navigateTo({
  497. url: `/packageA/project/delete?id=${this.data.detail.sa_projectid}`,
  498. })
  499. }
  500. })
  501. break;
  502. case "更换负责人":
  503. wx.navigateTo({
  504. url: `/pages/group/select?data=${JSON.stringify({
  505. ownertable:"sa_project",
  506. ownerid:data.sa_projectid,
  507. })}&radio=true&principal=true`,
  508. })
  509. break;
  510. case "查看重复":
  511. _Http.basic({
  512. "id": 20221208184202,
  513. "content": {
  514. ...data,
  515. pageSize: 999
  516. }
  517. }).then(res => {
  518. console.log("查看重复", res)
  519. if (res.code != '1') return wx.showToast({
  520. title: res.msg,
  521. icon: "none"
  522. });
  523. if (res.data.length == 0) {
  524. getApp().globalData.Language.showToast('未查询到重复数据')
  525. this.getTags()
  526. } else {
  527. this.setTags();
  528. this.setData({
  529. repetitionList: res.data,
  530. repetitionShow: true
  531. })
  532. }
  533. })
  534. break;
  535. default:
  536. console.log(detail)
  537. break;
  538. }
  539. },
  540. /* 恢复项目 */
  541. onRecover() {
  542. _Http.basic({
  543. "id": 20221215164002,
  544. "content": {
  545. "sa_projectid": this.data.sa_projectid
  546. }
  547. }).then(res => {
  548. console.log('恢复', res)
  549. wx.showToast({
  550. title: res.code == '1' ? getApp().globalData.Language.getMapText('已恢复') : res.msg,
  551. icon: "none",
  552. mask: true
  553. });
  554. if (res.code == '1') setTimeout(this.getDetail, 300);
  555. })
  556. },
  557. /* 关闭查重弹窗 */
  558. repClose() {
  559. let that = this;
  560. if (this.data.isRecover) wx.showModal({
  561. title: getApp().globalData.Language.getMapText('提示'),
  562. content: getApp().globalData.Language.getMapText('存在重复项目,是否确认恢复'),
  563. cancelText: getApp().globalData.Language.getMapText('取消'),
  564. confirmText: getApp().globalData.Language.getMapText('确定'),
  565. complete: ({
  566. confirm
  567. }) => {
  568. if (confirm) {
  569. that.onRecover(true)
  570. that.setTags();
  571. }
  572. }
  573. });
  574. this.setData({
  575. repetitionShow: false,
  576. isRecover: false
  577. })
  578. },
  579. /* setTags */
  580. setTags() {
  581. let {
  582. datatag,
  583. systemtag
  584. } = this.selectComponent("#Tags").returnTags();
  585. if (!systemtag.some(v => v == '疑似重复')) {
  586. systemtag.push("疑似重复")
  587. _Http.basic({
  588. "id": 20220929090901,
  589. "content": {
  590. "ownertable": "sa_project",
  591. "ownerid": this.data.sa_projectid,
  592. datatag,
  593. systemtag
  594. }
  595. }).then(res => {
  596. console.log("绑定疑似重复标签", res)
  597. if (res.code == '1') this.getTags();
  598. })
  599. } else {
  600. this.getTags();
  601. }
  602. },
  603. /* 1提交报备,2报备审核,3报备驳回(退回) */
  604. handleReport(type) {
  605. _Http.basic({
  606. "id": 20221114163402,
  607. "content": {
  608. "sa_projectid": this.data.sa_projectid,
  609. type
  610. }
  611. }).then(res => {
  612. console.log("报备", type, res)
  613. if (res.code != '1') {
  614. wx.showModal({
  615. title: getApp().globalData.Language.getMapText('提示'),
  616. content: res.msg,
  617. showCancel: false,
  618. confirmText: getApp().globalData.Language.getMapText('确定'),
  619. })
  620. } else {
  621. wx.showToast({
  622. title: getApp().globalData.Language.getMapText('操作成功'),
  623. icon: "none",
  624. mask: true
  625. })
  626. this.getDetail();
  627. this.getTags();
  628. }
  629. })
  630. },
  631. //局部数据更新 tabs
  632. partialRenewal(init = false) {
  633. let model = this.data.tabsList[this.data.tabsActive].model;
  634. if (model) {
  635. let Component = this.selectComponent(model),
  636. {
  637. total,
  638. pageNumber,
  639. pageTotal
  640. } = Component.data.content,
  641. id = this.data.sa_projectid;
  642. if (total == null || init) {
  643. Component.getList(id, init);
  644. } else if (pageNumber <= pageTotal) {
  645. Component.getList(id, false);
  646. }
  647. }
  648. },
  649. onReachBottom() {
  650. this.partialRenewal();
  651. },
  652. /* 项目评估切换 */
  653. taskTabsChange({
  654. detail
  655. }) {
  656. if (detail.change) {
  657. this.setData({
  658. tabsActive: this.data.tabsList.findIndex(v => v.label == '项目评估')
  659. });
  660. this.selectComponent("#Task").getList(this.data.sa_projectid, true)
  661. }
  662. },
  663. //tabs 切换
  664. tabsChange({
  665. detail
  666. }) {
  667. this.setData({
  668. tabsActive: detail
  669. });
  670. this.partialRenewal();
  671. },
  672. /* 更换负责人 */
  673. handelSubmit(arr) {
  674. const that = this;
  675. wx.showModal({
  676. title: getApp().globalData.Language.getMapText('提示'),
  677. content: getApp().globalData.Language.getMapText('是否确认更换负责人'),
  678. cancelText: getApp().globalData.Language.getMapText('取消'),
  679. confirmText: getApp().globalData.Language.getMapText('确定'),
  680. complete: ({
  681. confirm
  682. }) => {
  683. if (confirm) wx.showModal({
  684. title: getApp().globalData.Language.getMapText('提示'),
  685. content: getApp().globalData.Language.getMapText('是否参与该数据的后续工作'),
  686. cancelText: getApp().globalData.Language.getMapText('不参与'),
  687. confirmText: getApp().globalData.Language.getMapText('参与'),
  688. complete: (s) => {
  689. _Http.basic({
  690. "id": 20220930103701,
  691. "content": {
  692. ownertable: "sa_project",
  693. ownerid: that.data.detail.sa_projectid,
  694. userid: arr[0],
  695. isaddoldleader: s.confirm ? 1 : 0
  696. }
  697. }).then(res => {
  698. console.log("更换负责人", res)
  699. wx.showToast({
  700. title: res.code != '1' ? res.data : getApp().globalData.Language.getMapText('更换成功'),
  701. icon: "none",
  702. mask: true
  703. });
  704. if (res.code == '1') setTimeout(() => {
  705. wx.navigateBack({
  706. delta: 2
  707. });
  708. }, 300)
  709. })
  710. }
  711. })
  712. }
  713. })
  714. },
  715. //更新标签
  716. getTags() {
  717. this.selectComponent("#Tags").getTags();
  718. },
  719. //更新团队成员
  720. getGroup() {
  721. this.selectComponent("#Group").getList().then(this.setTabbarList)
  722. },
  723. /* tag更新列表 */
  724. onGetList({
  725. detail
  726. }) {
  727. let tabbarList = this.data.tabbarList;
  728. if (detail.data.systemtag.includes('报备中')) {
  729. tabbarList = tabbarList.filter(v => v.label != '提交报备')
  730. let index = tabbarList.findIndex(v => v.label == '报备审核');
  731. if (index != -1) tabbarList.splice(index, 0, {
  732. icon: "icon-genjin",
  733. label: "报备驳回(退回)"
  734. })
  735. this.setData({
  736. tabbarList
  737. })
  738. } else if (detail.data.systemtag.includes('已报备')) {
  739. let status = this.data.detail.status
  740. if (this.data.isLeader && status != '已失败' && status != '已结案') tabbarList.unshift({
  741. icon: "icon-faqishouquan",
  742. label: "发起授权"
  743. })
  744. this.setData({
  745. isInsert: true,
  746. tabbarList
  747. })
  748. }
  749. },
  750. onUnload() {
  751. const page = getCurrentPages().find(v => v.__route__ == 'packageA/project/index');
  752. if (!page) return;
  753. let content = JSON.parse(JSON.stringify(page.data.content));
  754. content.pageSize = (content.pageNumber - 1) * content.pageSize;
  755. content.pageNumber = 1;
  756. _Http.basic({
  757. id: 20221020143502,
  758. content
  759. }).then(res => {
  760. console.log("更新项目商机列表", res);
  761. if (res.code == '1') {
  762. page.data.list = res.data.map(v => {
  763. v.progress = v.stage / v.totalstage * 100;
  764. return v
  765. });
  766. page.data.content.total = res.total;
  767. page.getTags();
  768. }
  769. })
  770. }
  771. })