details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-02-21 12:00:38
  6. * @Description: file content
  7. * @FilePath: \frontend_mobile\pages\project\details.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" @click="goBack()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>项目详情</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <view class="main-top">
  23. <view class="customer-box">
  24. <view class="header flex1">
  25. <view class="name flex_l">
  26. <image class="img" src="../../static/images/menu2.png" mode="scaleToFill" />
  27. <text>{{ projectData.nboName }}</text>
  28. </view>
  29. <view class="date">{{ parseTime(projectData.createdTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</view>
  30. </view>
  31. <view class="info">
  32. <view class="info-item">
  33. <u-row>
  34. <u-col span="6">
  35. <view class="flex_l">
  36. <view class="info-label">项目编码:</view>
  37. <text class="info-txt">{{ projectData.nboCode }}</text>
  38. </view>
  39. </u-col>
  40. <u-col span="6">
  41. <view class="flex_l">
  42. <view class="info-label">客户名称:</view>
  43. <text class="info-txt">{{ projectData.custName }}</text>
  44. </view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="info-item">
  49. <u-row justify="space-between">
  50. <u-col span="6">
  51. <view class="flex_l">
  52. <view class="info-label">产品线:</view>
  53. <text class="info-txt">{{ selectDictLabel(productLineOptions, projectData.productLine) }}</text>
  54. </view>
  55. </u-col>
  56. <u-col span="6">
  57. <view class="flex_l">
  58. <view class="info-label">项目预算:</view>
  59. <text class="info-txt">{{ formatPrice(projectData.nboBudget) }}</text>
  60. </view>
  61. </u-col>
  62. </u-row>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="tabs">
  67. <u-tabs
  68. @change="changeTabs"
  69. lineWidth="8"
  70. :current="curTabIndex"
  71. lineHeight="8"
  72. :scrollable="false"
  73. :list="list"
  74. :lineColor="`url(${lineBg}) 100% 100%`"
  75. :activeStyle="{
  76. color: '#3E7EF8',
  77. fontWeight: 'bold',
  78. }"
  79. :inactiveStyle="{
  80. color: '#969696',
  81. }"
  82. itemStyle="height: 90rpx;"></u-tabs>
  83. </view>
  84. </view>
  85. <view class="data-list">
  86. <!-- 跟进记录 -->
  87. <follow-records v-if="curTabIndex == 0" ref="follow" :custId="projectData.custId"></follow-records>
  88. <!-- 详情 -->
  89. <project-detail v-if="curTabIndex == 1" :detail="projectData"></project-detail>
  90. <!-- 联系人 -->
  91. <contacts v-if="curTabIndex == 2" :projectId="projectId"></contacts>
  92. </view>
  93. </view>
  94. <!-- 新增按钮 -->
  95. <view class="fixed-btn-group" :style="{ width: openBtnWidth ? '560rpx' : '90rpx' }">
  96. <view class="flex1" v-if="openBtnWidth">
  97. <view class="btn center" @click="linkToLevel(1)">升</view>
  98. <view class="red btn center" @click="linkToLevel(0)">降</view>
  99. <view class="btn center" @click="$refs.reserve.open(projectId)">储</view>
  100. <view class="btn center" @click="linkToTransfer()">转</view>
  101. <view class="btn center" @click="createProject()">增</view>
  102. <view class="btn center" @click="openFollow()">跟</view>
  103. </view>
  104. <view class="btn center" @click="openBtnWidth = !openBtnWidth">
  105. <u-icon name="plus" color="#fff" size="20"></u-icon>
  106. </view>
  107. </view>
  108. <!-- 转储备 -->
  109. <transfer-reserve ref="reserve"></transfer-reserve>
  110. </view>
  111. </template>
  112. <script>
  113. import projectApi from '../../api/project'
  114. import to from 'await-to-js'
  115. import projectDetail from './components/projectDetail'
  116. import followRecords from './components/followRecords'
  117. import Contacts from './components/contacts'
  118. import TransferReserve from './components/transferReserve'
  119. export default {
  120. name: 'omsIndex',
  121. components: { projectDetail, followRecords, Contacts, TransferReserve },
  122. data() {
  123. return {
  124. openBtnWidth: false,
  125. lineBg: require('../../static/images/up.png'),
  126. curTabIndex: 0,
  127. fllowList: [], //跟进数据
  128. list: [
  129. {
  130. name: '活动记录',
  131. index: 0,
  132. },
  133. {
  134. name: '详细信息',
  135. index: 1,
  136. },
  137. {
  138. name: '联系人',
  139. index: 2,
  140. },
  141. ],
  142. height: '',
  143. paddingTop: '',
  144. projectData: {}, //项目详情
  145. projectId: 0, //项目id
  146. // salesModelOptions: [],
  147. productLineOptions: [], //产品线
  148. // sourceOptions: [],
  149. }
  150. },
  151. onLoad(option) {
  152. this.projectId = parseInt(option.id)
  153. this.getOptions()
  154. },
  155. created() {
  156. const navData = uni.getMenuButtonBoundingClientRect()
  157. this.height = navData.height + 'px'
  158. this.paddingTop = navData.top + 'px'
  159. },
  160. onShow() {
  161. this.getProjectDetail()
  162. },
  163. methods: {
  164. getOptions() {
  165. Promise.all([
  166. // this.getDicts('proj_sales_model'),
  167. this.getDicts('sys_product_line'),
  168. // this.getDicts('proj_nbo_source'),
  169. ])
  170. .then(([line]) => {
  171. // this.salesModelOptions = model.data.values || []
  172. this.productLineOptions = line.data.values || []
  173. // this.sourceOptions = source.data.values || []
  174. })
  175. .catch((err) => console.log(err))
  176. },
  177. async getProjectDetail() {
  178. const [err, res] = await to(projectApi.getDetail({ id: this.projectId }))
  179. if (err) return
  180. if (res && res.code == 200) {
  181. this.$refs.follow.getRecords()
  182. this.projectData = res.data
  183. }
  184. },
  185. // 改变tab
  186. changeTabs(data) {
  187. this.curTabIndex = data.index
  188. },
  189. // 打开转移
  190. openFollow() {
  191. this.$store.commit('setDetails', this.projectData)
  192. uni.navigateTo({
  193. //保留当前页面,跳转到应用内的某个页面
  194. url: '/pages/publicPages/follow?targetType=20',
  195. })
  196. },
  197. // 跳转到转移客户
  198. linkToTransfer() {
  199. uni.navigateTo({
  200. //保留当前页面,跳转到应用内的某个页面
  201. url: '/pages/project/transfer?id=' + this.projectId,
  202. })
  203. },
  204. // 升降级
  205. linkToLevel(type) {
  206. if (type === 1) {
  207. uni.navigateTo({
  208. //保留当前页面,跳转到应用内的某个页面
  209. url: '/pages/project/upgrade?id=' + this.projectId,
  210. })
  211. } else {
  212. uni.navigateTo({
  213. //保留当前页面,跳转到应用内的某个页面
  214. url: '/pages/project/downgrade?id=' + this.projectId,
  215. })
  216. }
  217. },
  218. // 跳转到新建项目
  219. createProject() {
  220. uni.navigateTo({
  221. //保留当前页面,跳转到应用内的某个页面
  222. url: '/pages/project/create',
  223. })
  224. },
  225. goBack() {
  226. uni.navigateBack({
  227. //关闭当前页面,返回上一页面或多级页面。
  228. delta: 1,
  229. })
  230. },
  231. },
  232. }
  233. </script>
  234. <style>
  235. page {
  236. background: #f2f3f5;
  237. }
  238. </style>
  239. <style lang="scss" scoped>
  240. .home {
  241. padding-top: 200rpx;
  242. .nav {
  243. position: absolute;
  244. left: 0;
  245. top: 0;
  246. width: 100%;
  247. height: 356rpx;
  248. background: #3e7ef8;
  249. border-radius: 0 0 31rpx 31rpx;
  250. .title {
  251. position: relative;
  252. text-align: center;
  253. font-size: 32rpx;
  254. font-weight: bold;
  255. color: #ffffff;
  256. .back {
  257. position: absolute;
  258. top: 0;
  259. bottom: 0;
  260. margin: auto;
  261. left: 70rpx;
  262. display: flex;
  263. }
  264. }
  265. }
  266. .main {
  267. position: absolute;
  268. width: 100%;
  269. height: calc(100vh - 200rpx);
  270. overflow: hidden;
  271. padding-bottom: 64rpx;
  272. .main-top {
  273. padding: 0 32rpx;
  274. }
  275. .customer-box {
  276. width: 100%;
  277. background: #ffffff;
  278. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  279. border-radius: 32rpx;
  280. padding: 22rpx 38rpx 68rpx 40rpx;
  281. .header {
  282. .name {
  283. .img {
  284. width: 46rpx;
  285. height: 46rpx;
  286. border-radius: 50%;
  287. margin-right: 8rpx;
  288. }
  289. text {
  290. font-size: 28rpx;
  291. font-weight: bold;
  292. color: #323232;
  293. }
  294. }
  295. .date {
  296. font-size: 24rpx;
  297. color: #3e7ef8;
  298. }
  299. }
  300. .info {
  301. .info-item {
  302. margin-top: 18rpx;
  303. .info-label {
  304. width: 120rpx;
  305. text-align: left;
  306. font-size: 24rpx;
  307. color: #646464;
  308. }
  309. .info-txt {
  310. flex: 1;
  311. font-size: 24rpx;
  312. color: #323232;
  313. }
  314. }
  315. }
  316. }
  317. .data-list {
  318. margin-top: 16rpx;
  319. width: 100%;
  320. height: calc(100vh - 532rpx);
  321. background: #ffffff;
  322. padding: 32rpx;
  323. overflow: auto;
  324. padding-bottom: 145rpx;
  325. .status1 {
  326. color: #4096fb;
  327. background: rgba(64, 150, 251, 0.2);
  328. }
  329. .status2 {
  330. background: rgba(255, 184, 60, 0.2);
  331. color: #ffb83c;
  332. }
  333. .status3 {
  334. color: #fe6936;
  335. background: rgba(254, 105, 54, 0.2);
  336. }
  337. }
  338. }
  339. .fixed-btn-group {
  340. position: fixed;
  341. display: flex;
  342. justify-content: space-around;
  343. align-items: center;
  344. width: 90rpx;
  345. height: 90rpx;
  346. bottom: 50rpx;
  347. right: 50rpx;
  348. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  349. border-radius: 20px;
  350. transition: all 0.2s;
  351. background: #fff;
  352. .red {
  353. background: #ff4d4f !important;
  354. }
  355. .btn {
  356. width: 60rpx;
  357. height: 60rpx;
  358. background: #3e7ef8;
  359. border-radius: 50%;
  360. margin: 10rpx;
  361. font-size: 26rpx;
  362. font-weight: bold;
  363. color: #ffffff;
  364. }
  365. }
  366. }
  367. </style>