| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- <template>
- <div class="base-container">
- <fnHeader showDate></fnHeader>
- <div class="back-icon" @click="goBack">
- <img src="@/assets/images/common/back-icon.png" />
- 返回
- </div>
- <div class="custom-content">
- <div class="custom-l">
- <div class="box-title">
- <img src="@/assets/images/common/area-icon.png" alt="" />
- 选择果树
- </div>
- <div class="select-wrap">
- <el-select class="select-item" v-model="areaVal" placeholder="全区" style="width: 146px">
- <el-option
- v-for="item in areaOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- <el-select class="select-item" v-model="typeVal" placeholder="全部品类" style="width: 146px">
- <el-option
- v-for="item in typeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- <el-select class="select-item" v-model="ageVal" placeholder="树龄" style="width: 146px">
- <el-option
- v-for="item in ageOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- <div class="tree-list">
- <div
- class="list-item"
- :class="{ selected: selectedItems.includes(item.id) }"
- @click="selecteTree(item.id)"
- v-for="(item, index) in allTrees"
- :key="index"
- >
- <div class="tree-icon">
- <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" />
- <div class="tree-type-name-tag">白糖罂</div>
- </div>
- <div class="item-center">
- <div class="center-t">
- BTY-A25
- <span class="type-tag">综合:94分</span>
- <span class="type-tag">生态:92分</span>
- <!-- <span class="type-tag">树龄:5年</span> -->
- </div>
- <div class="center-item p-t-2 age-line">
- <div class="age-wrap">
- <div class="has-age">
- <div class="age">树龄:<span class="unit">5年</span></div>
- </div>
- <div class="sort-line"></div>
- </div>
- 单价:<span class="unit">12元/斤</span>
- </div>
- <!-- <div class="center-item p-t-2">单价:<span>12元/斤</span></div> -->
- <div class="center-item" v-show="ROLE==1">总认养斤数:<span>215斤</span></div>
- <div class="center-item progress-wrap" v-show="ROLE==2">
- 剩余可购:
- <el-progress :percentage="60" color="#FFD887"><span class="progress-text"><span class="over">150</span>/215斤</span></el-progress>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="custom-r">
- <div class="second-title">
- <img src="@/assets/images/common/chart-yellow.png" alt="" />
- 定制详情
- </div>
- <div class="custom-detail">
- <div class="custom-user">
- 选择客户:
- <el-select v-model="selectUser" placeholder="选择客户" style="width: 256px">
- <el-option
- v-for="item in userOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- <div class="custom-user" v-show="ROLE == 2">
- 平均斤数:
- <el-select v-model="selectNum" placeholder="请选择" style="width: 256px">
- <el-option
- v-for="item in numOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- <div class="total" v-show="ROLE == 2">总斤数为<span class="main-unit">250</span>斤</div>
- <div class="selected-tree" v-show="selectedItems.length">
- <div class="tree-text">{{ ROLE === 1 ? "选择果树:" : "优先分配果树:" }}</div>
- <div
- class="list-item selected"
- @click="removeFromSelected(item)"
- v-for="(item, index) in selectedItems"
- :key="index"
- >
- <div class="tree-icon">
- <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" />
- <div class="tree-type-name-tag">白糖罂</div>
- </div>
- <div class="item-center">
- <div class="center-t">
- BTY-A25
- <span class="type-tag">综合:94分</span>
- <span class="type-tag">生态:92分</span>
- <span class="type-tag">树龄:5年</span>
- </div>
- <div class="center-item p-t-2">单价:<span>12元/斤</span></div>
- <div class="center-item">总认养斤数:<span>215斤</span></div>
- </div>
- <div class="item-icon">
- <el-icon size="24" color="#E04C4C"><CircleCloseFilled /></el-icon>
- </div>
- </div>
- </div>
- <div class="selected-tips" v-show="selectedItems.length === 0">请在左侧选择 果树列表</div>
- <!-- 渐变主色按钮 -->
- <div class="btn-group" v-show="selectedItems.length">
- <div class="btn cancel-btn">取消</div>
- <div class="btn edit-btn">确认定制</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import fnHeader from "@/components/fnHeader.vue";
- import { ref } from "vue";
- import { useRouter } from "vue-router";
- import { useStore } from "vuex";
- let store = useStore();
- const ROLE = store.state.home.userRole;
- const areaVal = ref(0);
- const areaOptions = ref([
- { label: "全区", value: 0 },
- { label: "1区", value: 1 },
- { label: "2区", value: 2 },
- ]);
- const typeVal = ref(0);
- const typeOptions = ref([
- { label: "全部品类", value: 0 },
- { label: "白糖罂", value: 1 },
- { label: "井岗红糯", value: 2 },
- ]);
- const ageVal = ref(0);
- const ageOptions = ref([
- { label: "全部树龄", value: 0 },
- { label: "0-10年", value: 1 },
- { label: "10-20年", value: 2 },
- ]);
- const selectUser = ref(null);
- const userOptions = ref([
- { label: "张一", value: 1 },
- { label: "张二", value: 2 },
- { label: "张三", value: 3 },
- ]);
- const selectNum = ref(null)
- const numOptions = ref([
- { label: "25 斤/人", value: 1 },
- { label: "50 斤/人", value: 2 },
- { label: "100 斤/人", value: 3 },
- ]);
- const selectedItems = ref([]);
- function selecteTree(id) {
- if (!selectedItems.value.includes(id)) {
- selectedItems.value.push(id);
- }
- }
- const allTrees = ref([
- { id: 1 },
- { id: 2 },
- { id: 3 },
- { id: 4 },
- { id: 5 },
- { id: 6 },
- { id: 7 },
- { id: 8 },
- { id: 9 },
- { id: 10 },
- ]);
- const removeFromSelected = (id) => {
- const index = selectedItems.value.findIndex((item) => item === id);
- if (index !== -1) {
- selectedItems.value.splice(index, 1);
- }
- };
- const router = useRouter();
- function goBack() {
- router.go(-1);
- }
- </script>
- <style lang="scss" scoped>
- .base-container {
- width: 100%;
- height: 100vh;
- color: #fff;
- position: relative;
- box-sizing: border-box;
- z-index: 1;
- background: #000000;
- .back-icon {
- position: absolute;
- // left: 405px;
- left: 485px;
- top: 38px;
- cursor: pointer;
- margin-right: 20px;
- height: 40px;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- padding: 0 28px;
- border: 1px solid rgba(255, 255, 255, 0.6);
- background: rgba(0, 0, 0, 0.2);
- border-radius: 4px;
- img {
- width: 17px;
- margin-right: 10px;
- }
- }
- .custom-content {
- width: 100%;
- height: calc(100% - 74px - 48px);
- display: flex;
- justify-content: space-between;
- box-sizing: border-box;
- padding: 16px 20px 0 20px;
- .select-wrap {
- display: flex;
- align-items: center;
- ::v-deep {
- .el-select__wrapper {
- background: rgba(255, 212, 137, 0.06);
- box-shadow: 0 0 0 1px rgba(255, 212, 137, 0.3) inset;
- font-size: 13px;
- .el-select__input {
- color: #ffd489;
- }
- .el-select__placeholder {
- color: #ffd489;
- text-align: center;
- }
- .el-select__suffix {
- color: #ffd489;
- }
- }
- }
- .select-item + .select-item {
- margin-left: 5px;
- }
- }
- .type-tag {
- color: #ffd489;
- background: rgba(255, 212, 137, 0.06);
- padding: 2px 4px;
- font-size: 10px;
- margin-left: 4px;
- border-radius: 4px;
- }
- .custom-l {
- flex: 1;
- width: calc(100% - 473px);
- height: 100%;
- box-sizing: border-box;
- border: 1px solid #444444;
- background: #191919;
- border-radius: 8px;
- padding: 20px 8px 22px 22px;
- .box-title {
- font-size: 22px;
- display: flex;
- align-items: flex-end;
- font-family: "PangMenZhengDao";
- margin-bottom: 16px;
- img {
- margin-right: 8px;
- }
- }
- .tree-list {
- display: flex;
- flex-wrap: wrap;
- padding-top: 8px;
- }
- }
- .list-item {
- background: rgba(255, 255, 255, 0.08);
- padding: 8px 10px;
- border-radius: 5px;
- width: max-content;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-right: 8px;
- margin-top: 12px;
- border: 1px solid transparent;
- cursor: pointer;
- width: calc(25% - 8px);
- box-sizing: border-box;
- &.selected {
- background: rgba(243, 193, 29, 0.1);
- border-color: #f2d677;
- }
- .item-info {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .tree-icon {
- position: relative;
- .tree-type-name-tag {
- position: absolute;
- left: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.6);
- border-radius: 0 5px 5px 0;
- font-size: 10px;
- width: 100%;
- text-align: center;
- padding: 1px;
- backdrop-filter: blur(2px);
- }
- .tree-img {
- width: 63px;
- height: 63px;
- border-radius: 5px;
- object-fit: cover;
- }
- }
- .item-center {
- flex: 1;
- padding-left: 12px;
- color: #fff;
- .center-t {
- font-size: 14px;
- }
- .center-item {
- color: #6c6c6c;
- font-size: 12px;
- padding-top: 2px;
- span {
- color: #fff;
- }
- ::v-deep {
- .el-progress-bar__outer {
- width: 100px;
- background: rgba(242, 243, 245, 0.23);
- }
- }
- }
-
- .age-line {
- display: flex;
- align-items: center;
- padding-top: 4px;
- .age-wrap {
- display: flex;
- align-items: center;
- .sort-line {
- margin: 0 10px;
- height: 10px;
- width: 1px;
- background: #6C6C6C;
- }
- }
- }
- .progress-wrap {
- display: flex;
- align-items: center;
- .progress-text {
- font-size: 12px;
- color: #999999;
- .over {
- color: #FFD489;
- }
- }
- }
- }
- }
- .p-t-2 {
- padding-top: 2px;
- }
- .custom-r {
- width: 473px;
- height: 100%;
- box-sizing: border-box;
- margin-left: 18px;
- border: 1px solid #444444;
- background: #191919;
- border-radius: 8px;
- .second-title {
- background: rgba(255, 255, 255, 0.02);
- border-radius: 8px 8px 0 0;
- color: #ffd489;
- font-size: 22px;
- padding: 14px 12px;
- }
- .custom-detail {
- padding: 16px 12px;
- height: calc(100% - 60px);
- box-sizing: border-box;
- position: relative;
- .custom-user {
- display: flex;
- align-items: center;
- justify-content: space-between;
- background: rgba(255, 255, 255, 0.04);
- padding: 16px 12px;
- border-radius: 8px;
- ::v-deep {
- .el-select__wrapper {
- background: transparent;
- box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
- font-size: 13px;
- .el-select__input {
- color: #ffffff;
- }
- .el-select__placeholder {
- color: #ffffff;
- text-align: center;
- }
- .el-select__suffix {
- color: #ffffff;
- }
- }
- }
- }
- .custom-user + .custom-user {
- margin-top: 12px;
- }
- }
- .total {
- padding-top: 12px;
- }
- .main-unit {
- color: #F3C11D;
- }
- .selected-tree {
- // display: flex;
- margin-top: 12px;
- background: rgba(255, 255, 255, 0.04);
- padding: 16px 12px;
- border-radius: 8px;
- max-height: calc(100% - 64px - 60px);
- overflow: auto;
- box-sizing: border-box;
- .list-item {
- width: 100%;
- box-sizing: border-box;
- margin-right: 0;
- }
- }
- .selected-tips {
- background: rgba(243, 193, 29, 0.1);
- border: 1px solid #f3c11d;
- width: 100%;
- text-align: center;
- border-radius: 8px;
- height: 50px;
- line-height: 50px;
- color: #f3c11d;
- margin-top: 12px;
- }
- .btn-group {
- display: flex;
- align-items: center;
- justify-content: end;
- position: absolute;
- bottom: 0;
- right: 0;
- background: #232323;
- width: 100%;
- padding: 10px 12px;
- box-sizing: border-box;
- border-radius: 0 0 8px 8px;
- .btn {
- cursor: pointer;
- padding: 8px 44px;
- font-size: 16px;
- border-radius: 4px;
- border: 1px solid #ffd489;
- }
- .cancel-btn {
- color: #ffd489;
- }
- .edit-btn {
- background: #ffd489;
- color: #000000;
- }
- .btn + .btn {
- margin-left: 12px;
- }
- }
- }
- }
- }
- </style>
|