index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <template>
  2. <div class="base-container">
  3. <fnHeader showDate></fnHeader>
  4. <div class="back-icon" @click="goBack">
  5. <img src="@/assets/images/common/back-icon.png" />
  6. 返回
  7. </div>
  8. <div class="custom-content">
  9. <div class="custom-l">
  10. <div class="box-title">
  11. <img src="@/assets/images/common/area-icon.png" alt="" />
  12. 选择果树
  13. </div>
  14. <div class="select-wrap">
  15. <el-select class="select-item" v-model="areaVal" placeholder="全区" style="width: 146px">
  16. <el-option
  17. v-for="item in areaOptions"
  18. :key="item.value"
  19. :label="item.label"
  20. :value="item.value"
  21. />
  22. </el-select>
  23. <el-select class="select-item" v-model="typeVal" placeholder="全部品类" style="width: 146px">
  24. <el-option
  25. v-for="item in typeOptions"
  26. :key="item.value"
  27. :label="item.label"
  28. :value="item.value"
  29. />
  30. </el-select>
  31. <el-select class="select-item" v-model="ageVal" placeholder="树龄" style="width: 146px">
  32. <el-option
  33. v-for="item in ageOptions"
  34. :key="item.value"
  35. :label="item.label"
  36. :value="item.value"
  37. />
  38. </el-select>
  39. </div>
  40. <div class="tree-list">
  41. <div
  42. class="list-item"
  43. :class="{ selected: selectedItems.includes(item.id) }"
  44. @click="selecteTree(item.id)"
  45. v-for="(item, index) in allTrees"
  46. :key="index"
  47. >
  48. <div class="tree-icon">
  49. <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" />
  50. <div class="tree-type-name-tag">白糖罂</div>
  51. </div>
  52. <div class="item-center">
  53. <div class="center-t">
  54. BTY-A25
  55. <span class="type-tag">综合:94分</span>
  56. <span class="type-tag">生态:92分</span>
  57. <!-- <span class="type-tag">树龄:5年</span> -->
  58. </div>
  59. <div class="center-item p-t-2 age-line">
  60. <div class="age-wrap">
  61. <div class="has-age">
  62. <div class="age">树龄:<span class="unit">5年</span></div>
  63. </div>
  64. <div class="sort-line"></div>
  65. </div>
  66. 单价:<span class="unit">12元/斤</span>
  67. </div>
  68. <!-- <div class="center-item p-t-2">单价:<span>12元/斤</span></div> -->
  69. <div class="center-item" v-show="ROLE==1">总认养斤数:<span>215斤</span></div>
  70. <div class="center-item progress-wrap" v-show="ROLE==2">
  71. 剩余可购:
  72. <el-progress :percentage="60" color="#FFD887"><span class="progress-text"><span class="over">150</span>/215斤</span></el-progress>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="custom-r">
  79. <div class="second-title">
  80. <img src="@/assets/images/common/chart-yellow.png" alt="" />
  81. 定制详情
  82. </div>
  83. <div class="custom-detail">
  84. <div class="custom-user">
  85. 选择客户:
  86. <el-select v-model="selectUser" placeholder="选择客户" style="width: 256px">
  87. <el-option
  88. v-for="item in userOptions"
  89. :key="item.value"
  90. :label="item.label"
  91. :value="item.value"
  92. />
  93. </el-select>
  94. </div>
  95. <div class="custom-user" v-show="ROLE == 2">
  96. 平均斤数:
  97. <el-select v-model="selectNum" placeholder="请选择" style="width: 256px">
  98. <el-option
  99. v-for="item in numOptions"
  100. :key="item.value"
  101. :label="item.label"
  102. :value="item.value"
  103. />
  104. </el-select>
  105. </div>
  106. <div class="total" v-show="ROLE == 2">总斤数为<span class="main-unit">250</span>斤</div>
  107. <div class="selected-tree" v-show="selectedItems.length">
  108. <div class="tree-text">{{ ROLE === 1 ? "选择果树:" : "优先分配果树:" }}</div>
  109. <div
  110. class="list-item selected"
  111. @click="removeFromSelected(item)"
  112. v-for="(item, index) in selectedItems"
  113. :key="index"
  114. >
  115. <div class="tree-icon">
  116. <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" />
  117. <div class="tree-type-name-tag">白糖罂</div>
  118. </div>
  119. <div class="item-center">
  120. <div class="center-t">
  121. BTY-A25
  122. <span class="type-tag">综合:94分</span>
  123. <span class="type-tag">生态:92分</span>
  124. <span class="type-tag">树龄:5年</span>
  125. </div>
  126. <div class="center-item p-t-2">单价:<span>12元/斤</span></div>
  127. <div class="center-item">总认养斤数:<span>215斤</span></div>
  128. </div>
  129. <div class="item-icon">
  130. <el-icon size="24" color="#E04C4C"><CircleCloseFilled /></el-icon>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="selected-tips" v-show="selectedItems.length === 0">请在左侧选择 果树列表</div>
  135. <!-- 渐变主色按钮 -->
  136. <div class="btn-group" v-show="selectedItems.length">
  137. <div class="btn cancel-btn">取消</div>
  138. <div class="btn edit-btn">确认定制</div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </template>
  145. <script setup>
  146. import fnHeader from "@/components/fnHeader.vue";
  147. import { ref } from "vue";
  148. import { useRouter } from "vue-router";
  149. import { useStore } from "vuex";
  150. let store = useStore();
  151. const ROLE = store.state.home.userRole;
  152. const areaVal = ref(0);
  153. const areaOptions = ref([
  154. { label: "全区", value: 0 },
  155. { label: "1区", value: 1 },
  156. { label: "2区", value: 2 },
  157. ]);
  158. const typeVal = ref(0);
  159. const typeOptions = ref([
  160. { label: "全部品类", value: 0 },
  161. { label: "白糖罂", value: 1 },
  162. { label: "井岗红糯", value: 2 },
  163. ]);
  164. const ageVal = ref(0);
  165. const ageOptions = ref([
  166. { label: "全部树龄", value: 0 },
  167. { label: "0-10年", value: 1 },
  168. { label: "10-20年", value: 2 },
  169. ]);
  170. const selectUser = ref(null);
  171. const userOptions = ref([
  172. { label: "张一", value: 1 },
  173. { label: "张二", value: 2 },
  174. { label: "张三", value: 3 },
  175. ]);
  176. const selectNum = ref(null)
  177. const numOptions = ref([
  178. { label: "25 斤/人", value: 1 },
  179. { label: "50 斤/人", value: 2 },
  180. { label: "100 斤/人", value: 3 },
  181. ]);
  182. const selectedItems = ref([]);
  183. function selecteTree(id) {
  184. if (!selectedItems.value.includes(id)) {
  185. selectedItems.value.push(id);
  186. }
  187. }
  188. const allTrees = ref([
  189. { id: 1 },
  190. { id: 2 },
  191. { id: 3 },
  192. { id: 4 },
  193. { id: 5 },
  194. { id: 6 },
  195. { id: 7 },
  196. { id: 8 },
  197. { id: 9 },
  198. { id: 10 },
  199. ]);
  200. const removeFromSelected = (id) => {
  201. const index = selectedItems.value.findIndex((item) => item === id);
  202. if (index !== -1) {
  203. selectedItems.value.splice(index, 1);
  204. }
  205. };
  206. const router = useRouter();
  207. function goBack() {
  208. router.go(-1);
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. .base-container {
  213. width: 100%;
  214. height: 100vh;
  215. color: #fff;
  216. position: relative;
  217. box-sizing: border-box;
  218. z-index: 1;
  219. background: #000000;
  220. .back-icon {
  221. position: absolute;
  222. // left: 405px;
  223. left: 485px;
  224. top: 38px;
  225. cursor: pointer;
  226. margin-right: 20px;
  227. height: 40px;
  228. display: flex;
  229. align-items: center;
  230. box-sizing: border-box;
  231. padding: 0 28px;
  232. border: 1px solid rgba(255, 255, 255, 0.6);
  233. background: rgba(0, 0, 0, 0.2);
  234. border-radius: 4px;
  235. img {
  236. width: 17px;
  237. margin-right: 10px;
  238. }
  239. }
  240. .custom-content {
  241. width: 100%;
  242. height: calc(100% - 74px - 48px);
  243. display: flex;
  244. justify-content: space-between;
  245. box-sizing: border-box;
  246. padding: 16px 20px 0 20px;
  247. .select-wrap {
  248. display: flex;
  249. align-items: center;
  250. ::v-deep {
  251. .el-select__wrapper {
  252. background: rgba(255, 212, 137, 0.06);
  253. box-shadow: 0 0 0 1px rgba(255, 212, 137, 0.3) inset;
  254. font-size: 13px;
  255. .el-select__input {
  256. color: #ffd489;
  257. }
  258. .el-select__placeholder {
  259. color: #ffd489;
  260. text-align: center;
  261. }
  262. .el-select__suffix {
  263. color: #ffd489;
  264. }
  265. }
  266. }
  267. .select-item + .select-item {
  268. margin-left: 5px;
  269. }
  270. }
  271. .type-tag {
  272. color: #ffd489;
  273. background: rgba(255, 212, 137, 0.06);
  274. padding: 2px 4px;
  275. font-size: 10px;
  276. margin-left: 4px;
  277. border-radius: 4px;
  278. }
  279. .custom-l {
  280. flex: 1;
  281. width: calc(100% - 473px);
  282. height: 100%;
  283. box-sizing: border-box;
  284. border: 1px solid #444444;
  285. background: #191919;
  286. border-radius: 8px;
  287. padding: 20px 8px 22px 22px;
  288. .box-title {
  289. font-size: 22px;
  290. display: flex;
  291. align-items: flex-end;
  292. font-family: "PangMenZhengDao";
  293. margin-bottom: 16px;
  294. img {
  295. margin-right: 8px;
  296. }
  297. }
  298. .tree-list {
  299. display: flex;
  300. flex-wrap: wrap;
  301. padding-top: 8px;
  302. }
  303. }
  304. .list-item {
  305. background: rgba(255, 255, 255, 0.08);
  306. padding: 8px 10px;
  307. border-radius: 5px;
  308. width: max-content;
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. margin-right: 8px;
  313. margin-top: 12px;
  314. border: 1px solid transparent;
  315. cursor: pointer;
  316. width: calc(25% - 8px);
  317. box-sizing: border-box;
  318. &.selected {
  319. background: rgba(243, 193, 29, 0.1);
  320. border-color: #f2d677;
  321. }
  322. .item-info {
  323. display: flex;
  324. justify-content: space-between;
  325. align-items: center;
  326. }
  327. .tree-icon {
  328. position: relative;
  329. .tree-type-name-tag {
  330. position: absolute;
  331. left: 0;
  332. bottom: 0;
  333. background: rgba(0, 0, 0, 0.6);
  334. border-radius: 0 5px 5px 0;
  335. font-size: 10px;
  336. width: 100%;
  337. text-align: center;
  338. padding: 1px;
  339. backdrop-filter: blur(2px);
  340. }
  341. .tree-img {
  342. width: 63px;
  343. height: 63px;
  344. border-radius: 5px;
  345. object-fit: cover;
  346. }
  347. }
  348. .item-center {
  349. flex: 1;
  350. padding-left: 12px;
  351. color: #fff;
  352. .center-t {
  353. font-size: 14px;
  354. }
  355. .center-item {
  356. color: #6c6c6c;
  357. font-size: 12px;
  358. padding-top: 2px;
  359. span {
  360. color: #fff;
  361. }
  362. ::v-deep {
  363. .el-progress-bar__outer {
  364. width: 100px;
  365. background: rgba(242, 243, 245, 0.23);
  366. }
  367. }
  368. }
  369. .age-line {
  370. display: flex;
  371. align-items: center;
  372. padding-top: 4px;
  373. .age-wrap {
  374. display: flex;
  375. align-items: center;
  376. .sort-line {
  377. margin: 0 10px;
  378. height: 10px;
  379. width: 1px;
  380. background: #6C6C6C;
  381. }
  382. }
  383. }
  384. .progress-wrap {
  385. display: flex;
  386. align-items: center;
  387. .progress-text {
  388. font-size: 12px;
  389. color: #999999;
  390. .over {
  391. color: #FFD489;
  392. }
  393. }
  394. }
  395. }
  396. }
  397. .p-t-2 {
  398. padding-top: 2px;
  399. }
  400. .custom-r {
  401. width: 473px;
  402. height: 100%;
  403. box-sizing: border-box;
  404. margin-left: 18px;
  405. border: 1px solid #444444;
  406. background: #191919;
  407. border-radius: 8px;
  408. .second-title {
  409. background: rgba(255, 255, 255, 0.02);
  410. border-radius: 8px 8px 0 0;
  411. color: #ffd489;
  412. font-size: 22px;
  413. padding: 14px 12px;
  414. }
  415. .custom-detail {
  416. padding: 16px 12px;
  417. height: calc(100% - 60px);
  418. box-sizing: border-box;
  419. position: relative;
  420. .custom-user {
  421. display: flex;
  422. align-items: center;
  423. justify-content: space-between;
  424. background: rgba(255, 255, 255, 0.04);
  425. padding: 16px 12px;
  426. border-radius: 8px;
  427. ::v-deep {
  428. .el-select__wrapper {
  429. background: transparent;
  430. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  431. font-size: 13px;
  432. .el-select__input {
  433. color: #ffffff;
  434. }
  435. .el-select__placeholder {
  436. color: #ffffff;
  437. text-align: center;
  438. }
  439. .el-select__suffix {
  440. color: #ffffff;
  441. }
  442. }
  443. }
  444. }
  445. .custom-user + .custom-user {
  446. margin-top: 12px;
  447. }
  448. }
  449. .total {
  450. padding-top: 12px;
  451. }
  452. .main-unit {
  453. color: #F3C11D;
  454. }
  455. .selected-tree {
  456. // display: flex;
  457. margin-top: 12px;
  458. background: rgba(255, 255, 255, 0.04);
  459. padding: 16px 12px;
  460. border-radius: 8px;
  461. max-height: calc(100% - 64px - 60px);
  462. overflow: auto;
  463. box-sizing: border-box;
  464. .list-item {
  465. width: 100%;
  466. box-sizing: border-box;
  467. margin-right: 0;
  468. }
  469. }
  470. .selected-tips {
  471. background: rgba(243, 193, 29, 0.1);
  472. border: 1px solid #f3c11d;
  473. width: 100%;
  474. text-align: center;
  475. border-radius: 8px;
  476. height: 50px;
  477. line-height: 50px;
  478. color: #f3c11d;
  479. margin-top: 12px;
  480. }
  481. .btn-group {
  482. display: flex;
  483. align-items: center;
  484. justify-content: end;
  485. position: absolute;
  486. bottom: 0;
  487. right: 0;
  488. background: #232323;
  489. width: 100%;
  490. padding: 10px 12px;
  491. box-sizing: border-box;
  492. border-radius: 0 0 8px 8px;
  493. .btn {
  494. cursor: pointer;
  495. padding: 8px 44px;
  496. font-size: 16px;
  497. border-radius: 4px;
  498. border: 1px solid #ffd489;
  499. }
  500. .cancel-btn {
  501. color: #ffd489;
  502. }
  503. .edit-btn {
  504. background: #ffd489;
  505. color: #000000;
  506. }
  507. .btn + .btn {
  508. margin-left: 12px;
  509. }
  510. }
  511. }
  512. }
  513. }
  514. </style>