|
@@ -24,12 +24,22 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="many-setting select-wrap" v-show="isManySetting">
|
|
|
- <el-select class="select-item many-select" v-model="settingType" placeholder="选中设置项" style="width: 88px">
|
|
|
+ <el-select
|
|
|
+ class="select-item many-select"
|
|
|
+ v-model="settingType"
|
|
|
+ placeholder="选中设置项"
|
|
|
+ style="width: 88px"
|
|
|
+ >
|
|
|
<template #label="{ label, value }">
|
|
|
- <span v-show="value!=='total'">设置</span>
|
|
|
+ <span v-show="value !== 'total'">设置</span>
|
|
|
<span>{{ label }}</span>
|
|
|
</template>
|
|
|
- <el-option v-for="(item, index) in settingTypeOptions" :key="index" :label="item.name" :value="item.value" />
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in settingTypeOptions"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
<div v-if="settingType === 'age'">
|
|
|
<el-input-number
|
|
@@ -69,51 +79,86 @@
|
|
|
<div class="list-item" v-for="(item, index) in adoptList" :key="index">
|
|
|
<div class="list-info">
|
|
|
<div class="tree-icon">
|
|
|
- <div class="tree-tag" v-show="!item.offlineTakeSelected">未守护</div>
|
|
|
- <div class="tree-tag wait" v-show="item.offlineTakeSelected">已守护</div>
|
|
|
- <!-- <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" /> -->
|
|
|
- <img class="tree-img" :src="item.icon || require(`@/assets/images/foster-home/list/1.png`)" alt="" />
|
|
|
+ <div class="tree-tag" v-show="!item.miniUserId">未守护</div>
|
|
|
+ <div class="tree-tag wait" v-show="item.miniUserId">已守护</div>
|
|
|
+ <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" />
|
|
|
+ <!-- <img class="tree-img" :src="item.icon || require(`@/assets/images/foster-home/list/1.png`)" alt="" /> -->
|
|
|
<div class="tree-type-name-tag">{{ item.pz }}</div>
|
|
|
</div>
|
|
|
<div class="item-center">
|
|
|
<div class="center-t">
|
|
|
- {{item.fosterCode}}
|
|
|
+ {{ item.fosterCode }}
|
|
|
<!-- <span class="type-tag">综合:{{item.zh||94}}分</span>
|
|
|
<span class="type-tag">生态:{{item.st||92}}分</span> -->
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<!-- 批量设置树龄或单项设置 -->
|
|
|
- <div class="center-item p-t-2 has-input" v-show="(isManySetting && settingType === 'age') || item.settingPrice">
|
|
|
+ <div
|
|
|
+ class="center-item p-t-2 has-input"
|
|
|
+ v-show="(isManySetting && settingType === 'age') || item.settingPrice"
|
|
|
+ >
|
|
|
<span class="edit-label">树龄:</span>
|
|
|
- <el-input-number @change="settingSinglePrice" class="number-input" :controls="false" v-model="item.age" :min="0" />
|
|
|
+ <el-input-number
|
|
|
+ @change="settingSinglePrice"
|
|
|
+ class="number-input"
|
|
|
+ :controls="false"
|
|
|
+ v-model="item.age"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
<span class="unit">年</span>
|
|
|
</div>
|
|
|
<!-- 不是编辑状态 -->
|
|
|
<div class="center-item p-t-2 age-line" v-show="!isManySetting && !item.settingPrice">
|
|
|
<div class="age-wrap">
|
|
|
<div class="has-age">
|
|
|
- <div class="age">栽种时间:<span class="unit">{{ item.time || '--' }}</span></div>
|
|
|
+ <div class="age">
|
|
|
+ 栽种时间:<span class="unit">{{ item.time || "--" }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="sort-line"></div>
|
|
|
</div>
|
|
|
- 树龄:<span class="unit"><span class="unit">{{item.age||'--'}}年</span></span>
|
|
|
+ 树龄:<span class="unit"
|
|
|
+ ><span class="unit">{{ item.age || "--" }}年</span></span
|
|
|
+ >
|
|
|
</div>
|
|
|
- <div class="center-item" v-show="isManySetting && settingType !== 'age'"><span class="edit-label">树龄:</span><span class="unit">{{item.age||'--'}}年</span></div>
|
|
|
- <div class="center-item edit-item" v-show="isManySetting && settingType !== 'price'"><span class="edit-label">品种:</span><span class="unit">{{item.pz}}</span></div>
|
|
|
-
|
|
|
- <div class="center-item p-t-2 has-input edit-item" v-show="(isManySetting && settingType === 'price') || item.settingPrice">
|
|
|
+ <div class="center-item" v-show="isManySetting && settingType !== 'age'">
|
|
|
+ <span class="edit-label">树龄:</span><span class="unit">{{ item.age || "--" }}年</span>
|
|
|
+ </div>
|
|
|
+ <div class="center-item edit-item" v-show="isManySetting && settingType !== 'price'">
|
|
|
+ <span class="edit-label">品种:</span><span class="unit">{{ item.pz }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="center-item p-t-2 has-input edit-item"
|
|
|
+ v-show="(isManySetting && settingType === 'price') || item.settingPrice"
|
|
|
+ >
|
|
|
<span class="edit-label">品种:</span>
|
|
|
-
|
|
|
|
|
|
- <el-select v-model="item.pz" filterable style="width: 140px;" placeholder="请选择品种">
|
|
|
- <el-option v-for="(species, index) in speciesList" :key="index" :label="species.name" :value="species.name" />
|
|
|
+ <el-select
|
|
|
+ class="blue-select"
|
|
|
+ v-model="item.pz"
|
|
|
+ filterable
|
|
|
+ style="width: 140px"
|
|
|
+ placeholder="请选择品种"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(species, index) in speciesList"
|
|
|
+ :key="index"
|
|
|
+ :label="species.name"
|
|
|
+ :value="species.name"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
<!-- <el-input @change="settingSinglePrice" style="width: 140px" class="number-input" v-model="item.pz" /> -->
|
|
|
</div>
|
|
|
|
|
|
- <div class="center-item" v-show="(isManySetting && settingType !== 'total')"><span class="edit-label">栽种时间:</span><span class="unit">{{item.time}}</span></div>
|
|
|
+ <div class="center-item" v-show="isManySetting && settingType !== 'total'">
|
|
|
+ <span class="edit-label">栽种时间:</span><span class="unit">{{ item.time }}</span>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="center-item p-t-2 has-input date-input" v-show="(isManySetting && settingType === 'total') || item.settingPrice">
|
|
|
+ <div
|
|
|
+ class="center-item p-t-2 has-input date-input"
|
|
|
+ v-show="(isManySetting && settingType === 'total') || item.settingPrice"
|
|
|
+ >
|
|
|
<span class="edit-label">栽种时间:</span>
|
|
|
<!-- <el-input-number @change="settingSinglePrice" class="number-input" :controls="false" v-model="item.total" :min="0" /> -->
|
|
|
<el-date-picker
|
|
@@ -126,27 +171,46 @@
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div class="center-item p-t-2 user-wrap" v-show="item.status === 0 && !isManySetting && !item.settingPrice">
|
|
|
- <img src="@/assets/images/foster-home/user.png" alt="">
|
|
|
+ <div
|
|
|
+ class="center-item p-t-2 user-wrap"
|
|
|
+ v-show="item.status === 0 && !isManySetting && !item.settingPrice"
|
|
|
+ >
|
|
|
+ <img src="@/assets/images/foster-home/user.png" alt="" />
|
|
|
选择守护人
|
|
|
|
|
|
- <el-select v-model="offlineTakeSelected" filterable style="width: 240px;" placeholder="请选择守护人">
|
|
|
- <el-option v-for="(user, index) in userList" :key="index" :label="user.name" :value="{value: user.tel, ...user}" />
|
|
|
+ <el-select
|
|
|
+ v-model="offlineTakeSelected"
|
|
|
+ filterable
|
|
|
+ style="width: 240px"
|
|
|
+ placeholder="请选择守护人"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(user, index) in userList"
|
|
|
+ :key="index"
|
|
|
+ :label="user.name"
|
|
|
+ :value="{ value: user.tel, ...user }"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- <div class="center-item p-t-2 progress-wrap" v-show="item.status === 1 && !isManySetting && !item.settingPrice">
|
|
|
+ <div
|
|
|
+ class="center-item p-t-2 progress-wrap"
|
|
|
+ v-show="item.status === 1 && !isManySetting && !item.settingPrice"
|
|
|
+ >
|
|
|
守护人:
|
|
|
<span class="unit">
|
|
|
<div class="user-item">
|
|
|
<div class="user-detail" v-for="(owner, oI) in owners" :key="oI">
|
|
|
{{ owner.userName }}
|
|
|
- <span v-show="oI<owners.length-1">/</span>
|
|
|
+ <span v-show="oI < owners.length - 1">/</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-show="!isManySetting && !item.settingPrice && ROLE == 1" @click="toSettingSinglePrice(index, true)">
|
|
|
+ <div
|
|
|
+ v-show="!isManySetting && !item.settingPrice && ROLE == 1"
|
|
|
+ @click="toSettingSinglePrice(index, true)"
|
|
|
+ >
|
|
|
<img src="@/assets/images/common/edit-icon.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -157,7 +221,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="pagination-wrap">
|
|
|
- <el-pagination background :page-size="20" :pagerCount="5" v-model:current-page="currentPage" @current-change="getSamplePage" layout="prev, pager, next" :total="totalVal" />
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ :page-size="20"
|
|
|
+ :pagerCount="5"
|
|
|
+ v-model:current-page="currentPage"
|
|
|
+ @current-change="getSamplePage"
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="totalVal"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -218,33 +290,34 @@ const statusOptions = ref([
|
|
|
|
|
|
const adoptList = ref([]);
|
|
|
|
|
|
-const owners = ref([{userName: "王丽丽", value: 50}])
|
|
|
+const owners = ref([{ userName: "王丽丽", value: 50 }]);
|
|
|
|
|
|
-
|
|
|
-const offlineTakeSelected = ref(null)
|
|
|
-const userList = ref([])
|
|
|
-const speciesList = ref([])
|
|
|
+const offlineTakeSelected = ref(null);
|
|
|
+const userList = ref([]);
|
|
|
+const speciesList = ref([]);
|
|
|
function getUserList() {
|
|
|
- VE_API.manage_interface.offlineTakeList({farmId: 766}).then(({data}) => {
|
|
|
- userList.value = data
|
|
|
- })
|
|
|
- VE_API.manage_interface.speciesList({farmId: 766}).then(({data}) => {
|
|
|
- speciesList.value = data
|
|
|
- })
|
|
|
+ VE_API.manage_interface.offlineTakeList({ farmId: 80865 }).then(({ data }) => {
|
|
|
+ userList.value = data;
|
|
|
+ });
|
|
|
+ VE_API.manage_interface.speciesList({ farmId: 80865 }).then(({ data }) => {
|
|
|
+ speciesList.value = data;
|
|
|
+ });
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
- getSamplePage()
|
|
|
- getUserList()
|
|
|
+ getSamplePage();
|
|
|
+ getUserList();
|
|
|
});
|
|
|
|
|
|
-const currentPage = ref(1)
|
|
|
-const totalVal = ref(0)
|
|
|
+const currentPage = ref(1);
|
|
|
+const totalVal = ref(0);
|
|
|
|
|
|
function getSamplePage() {
|
|
|
- VE_API.manage_interface.fetchSamplePage({farmId: 80865, page: currentPage.value, limit: 20}).then(({data, count}) => {
|
|
|
- adoptList.value = data
|
|
|
- totalVal.value = count
|
|
|
- })
|
|
|
+ VE_API.manage_interface
|
|
|
+ .fetchSamplePage({ farmId: 80865, page: currentPage.value, limit: 20 })
|
|
|
+ .then(({ data, count }) => {
|
|
|
+ adoptList.value = data;
|
|
|
+ totalVal.value = count;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 批量设置
|
|
@@ -253,11 +326,11 @@ const batchPrice = ref(null);
|
|
|
const batchTotal = ref(null);
|
|
|
const isManySetting = ref(false);
|
|
|
const settingTypeOptions = [
|
|
|
- {name: "树龄", value: "age"},
|
|
|
- {name: "品种", value: "price"},
|
|
|
- {name: "栽种时间", value: "total"},
|
|
|
-]
|
|
|
-const settingType = ref("age")
|
|
|
+ { name: "树龄", value: "age" },
|
|
|
+ { name: "品种", value: "price" },
|
|
|
+ { name: "栽种时间", value: "total" },
|
|
|
+];
|
|
|
+const settingType = ref("age");
|
|
|
function manySetPrice() {
|
|
|
isManySetting.value = true;
|
|
|
}
|
|
@@ -269,34 +342,34 @@ function saveManySetting(isToSave) {
|
|
|
}
|
|
|
|
|
|
function setManyPrice(v) {
|
|
|
-// adoptList.value.map(item => item.price = v)
|
|
|
+ // adoptList.value.map(item => item.price = v)
|
|
|
}
|
|
|
|
|
|
// 设置单棵树单价
|
|
|
|
|
|
function toSettingSinglePrice(i, val, toSave = false) {
|
|
|
- console.log('tototot');
|
|
|
- const data = adoptList.value[i]
|
|
|
- if (toSave) {
|
|
|
- const params = {
|
|
|
- sampleId: data.sampleId,
|
|
|
- pz: data.pz,
|
|
|
- age: data.age,
|
|
|
- plantDate: data.plantDate,
|
|
|
- offlineTakeSelected: {...offlineTakeSelected.value}
|
|
|
+ console.log("tototot");
|
|
|
+ const data = adoptList.value[i];
|
|
|
+ if (toSave) {
|
|
|
+ const params = {
|
|
|
+ sampleId: data.sampleId,
|
|
|
+ pz: data.pz,
|
|
|
+ age: data.age,
|
|
|
+ plantDate: data.plantDate,
|
|
|
+ offlineTakeSelected: { ...offlineTakeSelected.value },
|
|
|
+ };
|
|
|
+ VE_API.manage_interface.editFosterSample(params).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success("修改成功");
|
|
|
+ adoptList.value[i].settingPrice = val;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ adoptList.value[i].settingPrice = val;
|
|
|
}
|
|
|
- VE_API.manage_interface.editFosterSample(params).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- ElMessage.success("修改成功")
|
|
|
- adoptList.value[i].settingPrice = val
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- adoptList.value[i].settingPrice = val
|
|
|
- }
|
|
|
}
|
|
|
function settingSinglePrice() {
|
|
|
- console.log('sss');
|
|
|
+ console.log("sss");
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -361,6 +434,7 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.list-wrap {
|
|
|
padding: 12px 0;
|
|
|
margin-bottom: 60px;
|
|
@@ -442,9 +516,9 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
|
|
|
.user-wrap {
|
|
|
- color: #F0AC37;
|
|
|
+ color: #f0ac37;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.progress-wrap {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -456,7 +530,7 @@ function settingSinglePrice() {
|
|
|
font-size: 12px;
|
|
|
color: #999999;
|
|
|
.over {
|
|
|
- color: #FFD489;
|
|
|
+ color: #ffd489;
|
|
|
}
|
|
|
}
|
|
|
::v-deep {
|
|
@@ -494,14 +568,33 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
}
|
|
|
.small-btn-group {
|
|
|
- display: flex;
|
|
|
- font-size: 12px;
|
|
|
+ display: flex;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.list-item + .list-item {
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
+ .blue-select {
|
|
|
+ ::v-deep {
|
|
|
+ .el-select__wrapper {
|
|
|
+ background: rgba(33, 153, 248, 0.08);
|
|
|
+ box-shadow: 0 0 0 1px #2199f8 inset;
|
|
|
+ font-size: 13px;
|
|
|
+ .el-select__input {
|
|
|
+ color: #2199f8;
|
|
|
+ }
|
|
|
+ .el-select__placeholder {
|
|
|
+ color: #2199f8;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .el-select__caret {
|
|
|
+ color: #2199f8;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.unit {
|
|
|
padding-left: 5px;
|
|
@@ -509,12 +602,12 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
.many-setting {
|
|
|
background: rgba(33, 153, 248, 0.1);
|
|
|
- border: 1px solid #2199F8;
|
|
|
+ border: 1px solid #2199f8;
|
|
|
border-radius: 5px;
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
padding: 12px 8px;
|
|
|
margin: 12px 8px 0 12px;
|
|
|
- color: #0064B3;
|
|
|
+ color: #0064b3;
|
|
|
::v-deep {
|
|
|
.many-select {
|
|
|
margin-right: 10px;
|
|
@@ -523,17 +616,19 @@ function settingSinglePrice() {
|
|
|
box-shadow: none;
|
|
|
background: none;
|
|
|
}
|
|
|
- .el-select__placeholder, .el-select__caret {
|
|
|
- color: #0064B3;
|
|
|
+ .el-select__placeholder,
|
|
|
+ .el-select__caret {
|
|
|
+ color: #0064b3;
|
|
|
}
|
|
|
}
|
|
|
.number-input-setting {
|
|
|
.el-input__wrapper {
|
|
|
- box-shadow: 0 0 0 1px #2199F8 inset;
|
|
|
+ box-shadow: 0 0 0 1px #2199f8 inset;
|
|
|
border-radius: 6px;
|
|
|
}
|
|
|
- .el-input__inner, .el-input__inner::placeholder {
|
|
|
- color: #2199F8;
|
|
|
+ .el-input__inner,
|
|
|
+ .el-input__inner::placeholder {
|
|
|
+ color: #2199f8;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
@@ -545,10 +640,11 @@ function settingSinglePrice() {
|
|
|
.number-input {
|
|
|
// margin: 0 12px;
|
|
|
::v-deep {
|
|
|
- &.el-input-number, &.el-input {
|
|
|
+ &.el-input-number,
|
|
|
+ &.el-input {
|
|
|
width: 90px;
|
|
|
background: rgba(33, 153, 248, 0.08);
|
|
|
- border: 1px solid #2199F8;
|
|
|
+ border: 1px solid #2199f8;
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
.el-input__wrapper {
|
|
@@ -558,8 +654,9 @@ function settingSinglePrice() {
|
|
|
.el-input-number.is-without-controls .el-input__wrapper {
|
|
|
padding: 0 8px;
|
|
|
}
|
|
|
- .el-input__inner, .el-input__inner::placeholder {
|
|
|
- color: #2199F8;
|
|
|
+ .el-input__inner,
|
|
|
+ .el-input__inner::placeholder {
|
|
|
+ color: #2199f8;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
@@ -569,13 +666,14 @@ function settingSinglePrice() {
|
|
|
.el-date-editor {
|
|
|
.el-input__wrapper {
|
|
|
background: rgba(33, 153, 248, 0.08);
|
|
|
- box-shadow: 0 0 0 1px #2199F8 inset;
|
|
|
+ box-shadow: 0 0 0 1px #2199f8 inset;
|
|
|
}
|
|
|
- .el-input__inner, .el-input__inner::placeholder {
|
|
|
- color: #2199F8;
|
|
|
+ .el-input__inner,
|
|
|
+ .el-input__inner::placeholder {
|
|
|
+ color: #2199f8;
|
|
|
}
|
|
|
.el-input__prefix {
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -588,13 +686,13 @@ function settingSinglePrice() {
|
|
|
bottom: 64px;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
border-radius: 20px;
|
|
|
font-size: 14px;
|
|
|
padding: 7px 10px;
|
|
|
cursor: pointer;
|
|
|
border: 1px solid #fff;
|
|
|
- background: linear-gradient(180deg, #84C9FF, #2199F8);
|
|
|
+ background: linear-gradient(180deg, #84c9ff, #2199f8);
|
|
|
width: 194px;
|
|
|
box-sizing: border-box;
|
|
|
text-align: center;
|
|
@@ -618,15 +716,15 @@ function settingSinglePrice() {
|
|
|
padding: 12px 36px;
|
|
|
font-size: 14px;
|
|
|
border-radius: 4px;
|
|
|
- border: 1px solid #2199F8;
|
|
|
- color: #2199F8;
|
|
|
+ border: 1px solid #2199f8;
|
|
|
+ color: #2199f8;
|
|
|
}
|
|
|
.cancel-btn {
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
}
|
|
|
.edit-btn {
|
|
|
- background: #2199F8;
|
|
|
- color: #FFFFFF;
|
|
|
+ background: #2199f8;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
.btn + .btn {
|
|
|
margin-left: 12px;
|