|
@@ -1,13 +1,38 @@
|
|
|
<template>
|
|
|
<div class="adopt-list" :class="{ 'has-btn': isManySetting }">
|
|
|
<div class="select-wrap common-select">
|
|
|
- <el-select class="select-item" v-model="areaVal" placeholder="全区" style="width: 116px">
|
|
|
- <el-option v-for="item in areaOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ @change="handleChageData"
|
|
|
+ v-model="areaVal"
|
|
|
+ placeholder="全区"
|
|
|
+ style="width: 116px"
|
|
|
+ >
|
|
|
+ <el-option label="全部分区" :value="0"></el-option>
|
|
|
+ <el-option v-for="(item, index) in areaOptions" :key="index" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
- <el-select class="select-item" v-model="typeVal" placeholder="全部品类" style="width: 116px">
|
|
|
- <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ @change="handleChageData"
|
|
|
+ v-model="typeVal"
|
|
|
+ placeholder="全部品类"
|
|
|
+ style="width: 116px"
|
|
|
+ >
|
|
|
+ <el-option label="全部品类" :value="0"></el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="(species, index) in speciesList"
|
|
|
+ :key="index"
|
|
|
+ :label="species.name"
|
|
|
+ :value="species.name"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
- <el-select class="select-item" v-model="ageVal" placeholder="树龄" style="width: 116px">
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ @change="handleChageData"
|
|
|
+ v-model="ageVal"
|
|
|
+ placeholder="树龄"
|
|
|
+ style="width: 116px"
|
|
|
+ >
|
|
|
<el-option v-for="item in ageOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -18,7 +43,13 @@
|
|
|
<el-select class="select-item" v-model="ecologyVal" placeholder="生态评分" style="width: 116px">
|
|
|
<el-option v-for="item in ecologyOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
- <el-select class="select-item" v-model="statusVal" placeholder="全部状态" style="width: 116px">
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ @change="handleChageData"
|
|
|
+ v-model="statusVal"
|
|
|
+ placeholder="全部状态"
|
|
|
+ style="width: 116px"
|
|
|
+ >
|
|
|
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -76,6 +107,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="list-wrap">
|
|
|
+ <div class="no-data" v-show="!adoptList.length">暂无数据</div>
|
|
|
<div class="list-item" v-for="(item, index) in adoptList" :key="index">
|
|
|
<div class="list-info">
|
|
|
<div class="tree-icon">
|
|
@@ -173,15 +205,17 @@
|
|
|
|
|
|
<div
|
|
|
class="center-item p-t-2 user-wrap"
|
|
|
- v-show="item.status === 0 && !isManySetting && !item.settingPrice"
|
|
|
+ v-show="!item.miniUserId && !isManySetting && !item.settingPrice"
|
|
|
+ @click="showTreeDialog(item)"
|
|
|
>
|
|
|
<img src="@/assets/images/foster-home/user.png" alt="" />
|
|
|
- 选择守护人
|
|
|
+ <span class="user-text">选择预留守护人</span>
|
|
|
+
|
|
|
|
|
|
- <el-select
|
|
|
+ <!-- <el-select
|
|
|
v-model="offlineTakeSelected"
|
|
|
filterable
|
|
|
- style="width: 240px"
|
|
|
+ style="width: 140px"
|
|
|
placeholder="请选择守护人"
|
|
|
>
|
|
|
<el-option
|
|
@@ -190,27 +224,26 @@
|
|
|
:label="user.name"
|
|
|
:value="{ value: user.tel, ...user }"
|
|
|
/>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
</div>
|
|
|
<div
|
|
|
class="center-item p-t-2 progress-wrap"
|
|
|
- v-show="item.status === 1 && !isManySetting && !item.settingPrice"
|
|
|
+ v-show="item.miniUserId && !isManySetting && !item.settingPrice"
|
|
|
>
|
|
|
守护人:
|
|
|
<span class="unit">
|
|
|
<div class="user-item">
|
|
|
- <div class="user-detail" v-for="(owner, oI) in owners" :key="oI">
|
|
|
+ <!-- <div class="user-detail" v-for="(owner, oI) in owners" :key="oI">
|
|
|
{{ owner.userName }}
|
|
|
<span v-show="oI < owners.length - 1">/</span>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <el-avatar :size="26" :src="item.icon" />
|
|
|
+ <span class="avatar-name">{{ item.userNickName || item.miniUserId }}</span>
|
|
|
</div>
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div
|
|
|
- v-show="!isManySetting && !item.settingPrice"
|
|
|
- @click="toSettingSinglePrice(index, true)"
|
|
|
- >
|
|
|
+ <div v-show="!isManySetting && !item.settingPrice" @click="toSettingSinglePrice(index, true)">
|
|
|
<img src="@/assets/images/common/edit-icon.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -235,12 +268,12 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 渐变主色按钮 -->
|
|
|
- <div class="center-btn" v-show="!isManySetting" @click="manySetPrice">批量编辑果树</div>
|
|
|
+ <div class="center-btn" v-show="adoptList.length" @click="manySetPrice">批量编辑果树</div>
|
|
|
<!-- 渐变主色按钮 -->
|
|
|
- <div class="btn-group list-btn" v-show="isManySetting">
|
|
|
+ <!-- <div class="btn-group list-btn" v-show="isManySetting">
|
|
|
<div class="btn cancel-btn" @click="saveManySetting(0)">取消</div>
|
|
|
<div class="btn edit-btn" @click="saveManySetting(1)">保存</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -250,25 +283,21 @@ import { onMounted, ref } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
let store = useStore();
|
|
|
import { useRouter } from "vue-router";
|
|
|
+import eventBus from "@/api/eventBus";
|
|
|
const router = useRouter();
|
|
|
|
|
|
const areaVal = ref(0);
|
|
|
-const areaOptions = ref([
|
|
|
- { label: "全区", value: 0 },
|
|
|
- { label: "1区", value: 1 },
|
|
|
- { label: "2区", value: 2 },
|
|
|
-]);
|
|
|
+const areaOptions = ref([]);
|
|
|
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 },
|
|
|
+ { label: "0-10年", value: 10 },
|
|
|
+ { label: "10-20年", value: 20 },
|
|
|
+ { label: "20-30年", value: 30 },
|
|
|
+ { label: "30-40年", value: 40 },
|
|
|
+ { label: "40-50年", value: 50 },
|
|
|
+ { label: "50年以上", value: 60 },
|
|
|
]);
|
|
|
const allVal = ref(0);
|
|
|
const allOptions = ref([
|
|
@@ -282,11 +311,11 @@ const ecologyOptions = ref([
|
|
|
{ label: "0-10年", value: 1 },
|
|
|
{ label: "10-20年", value: 2 },
|
|
|
]);
|
|
|
-const statusVal = ref(0);
|
|
|
+const statusVal = ref("-1");
|
|
|
const statusOptions = ref([
|
|
|
- { label: "全部状态", value: 0 },
|
|
|
- { label: "0-10年", value: 1 },
|
|
|
- { label: "10-20年", value: 2 },
|
|
|
+ { label: "全部状态", value: "-1" },
|
|
|
+ { label: "未开放", value: 0 },
|
|
|
+ { label: "已开放", value: 1 },
|
|
|
]);
|
|
|
|
|
|
const adoptList = ref([]);
|
|
@@ -297,25 +326,45 @@ const offlineTakeSelected = ref(null);
|
|
|
const userList = ref([]);
|
|
|
const speciesList = ref([]);
|
|
|
function getUserList() {
|
|
|
- VE_API.manage_interface.offlineTakeList({ farmId: 80865 }).then(({ data }) => {
|
|
|
+ VE_API.manage_interface.offlineTakeList({ farmId: 766 }).then(({ data }) => {
|
|
|
userList.value = data;
|
|
|
});
|
|
|
- VE_API.manage_interface.speciesList({ farmId: 80865 }).then(({ data }) => {
|
|
|
+ VE_API.manage_interface.speciesList({ farmId: 766 }).then(({ data }) => {
|
|
|
speciesList.value = data;
|
|
|
});
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
getSamplePage();
|
|
|
getUserList();
|
|
|
+ getBlueRegionList();
|
|
|
});
|
|
|
|
|
|
+function getBlueRegionList() {
|
|
|
+ VE_API.manage_interface.fetchRegionList({ farmId: 766 }).then(({ data }) => {
|
|
|
+ areaOptions.value = data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
const currentPage = ref(1);
|
|
|
const pageSize = ref(20);
|
|
|
const totalVal = ref(0);
|
|
|
|
|
|
+function handleChageData() {
|
|
|
+ currentPage.value = 1;
|
|
|
+ getSamplePage();
|
|
|
+}
|
|
|
+
|
|
|
function getSamplePage() {
|
|
|
VE_API.manage_interface
|
|
|
- .fetchSamplePage({ farmId: 80865, page: currentPage.value, limit: 20 })
|
|
|
+ .fetchSamplePage({
|
|
|
+ farmId: 766,
|
|
|
+ regionId: areaVal.value === 0 ? null : areaVal.value,
|
|
|
+ isRenyang: statusVal.value === "-1" ? null : statusVal.value,
|
|
|
+ ageRange: ageVal.value === 0 ? null : [ageVal.value - 10, ageVal.value],
|
|
|
+ pz: typeVal.value === 0 ? null : typeVal.value,
|
|
|
+ page: currentPage.value,
|
|
|
+ limit: 20,
|
|
|
+ })
|
|
|
.then(({ data, count }) => {
|
|
|
adoptList.value = data;
|
|
|
totalVal.value = count;
|
|
@@ -337,12 +386,6 @@ function manySetPrice() {
|
|
|
// isManySetting.value = true;
|
|
|
router.push("/layout/settingTree");
|
|
|
}
|
|
|
-function saveManySetting(isToSave) {
|
|
|
- isManySetting.value = false;
|
|
|
- if (isToSave) {
|
|
|
- // 保存
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
function setManyPrice(v) {
|
|
|
// adoptList.value.map(item => item.price = v)
|
|
@@ -351,7 +394,6 @@ function setManyPrice(v) {
|
|
|
// 设置单棵树单价
|
|
|
|
|
|
function toSettingSinglePrice(i, val, toSave = false) {
|
|
|
- console.log("tototot");
|
|
|
const data = adoptList.value[i];
|
|
|
if (toSave) {
|
|
|
const params = {
|
|
@@ -374,6 +416,15 @@ function toSettingSinglePrice(i, val, toSave = false) {
|
|
|
function settingSinglePrice() {
|
|
|
console.log("sss");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+function showTreeDialog(item) {
|
|
|
+ eventBus.emit("click:point", {
|
|
|
+ farmId: 766,
|
|
|
+ sampleId: item.sampleId,
|
|
|
+ data: item,
|
|
|
+ });
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -439,8 +490,13 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
|
|
|
.list-wrap {
|
|
|
- padding: 12px 0;
|
|
|
+ padding: 12px 0 40px 0;
|
|
|
margin-bottom: 60px;
|
|
|
+ .no-data {
|
|
|
+ padding-top: 16px;
|
|
|
+ text-align: center;
|
|
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
+ }
|
|
|
.list-item {
|
|
|
background: rgba(120, 120, 120, 0.05);
|
|
|
padding: 8px 16px 8px 10px;
|
|
@@ -519,7 +575,19 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
|
|
|
.user-wrap {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
color: #f0ac37;
|
|
|
+ cursor: pointer;
|
|
|
+ img {
|
|
|
+ width: 13px;
|
|
|
+ }
|
|
|
+ .user-text {
|
|
|
+ padding-left: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .avatar-name {
|
|
|
+ padding-left: 4px;
|
|
|
}
|
|
|
|
|
|
.progress-wrap {
|