|
@@ -11,11 +11,29 @@
|
|
|
果树列表
|
|
|
</div>
|
|
|
<div class="select-wrap">
|
|
|
- <el-select class="select-item" @change="handleAreaChange" v-model="areaVal" placeholder="分区" style="width: 146px">
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ @change="handleAreaChange"
|
|
|
+ v-model="areaVal"
|
|
|
+ placeholder="分区"
|
|
|
+ style="width: 146px"
|
|
|
+ >
|
|
|
<el-option label="全部分区" :value="0"></el-option>
|
|
|
- <el-option v-for="(item, index) in areaOptions" :key="index" :label="item.name" :value="item.id" />
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in areaOptions"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
- <el-select class="select-item" filterable @change="handleTypeChange" v-model="typeVal" placeholder="全部品类" style="width: 146px">
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ filterable
|
|
|
+ @change="handleTypeChange"
|
|
|
+ v-model="typeVal"
|
|
|
+ placeholder="全部品类"
|
|
|
+ style="width: 146px"
|
|
|
+ >
|
|
|
<el-option label="全部品类" :value="0"></el-option>
|
|
|
<el-option
|
|
|
v-for="(species, index) in speciesList"
|
|
@@ -24,7 +42,13 @@
|
|
|
:value="species.name"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- <el-select class="select-item" v-model="ageVal" placeholder="树龄" style="width: 146px">
|
|
|
+ <el-select
|
|
|
+ class="select-item"
|
|
|
+ v-model="ageVal"
|
|
|
+ @change="handleTypeChange"
|
|
|
+ placeholder="树龄"
|
|
|
+ style="width: 146px"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in ageOptions"
|
|
|
:key="item.value"
|
|
@@ -34,11 +58,7 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="tree-list">
|
|
|
- <div
|
|
|
- class="list-item"
|
|
|
- v-for="(item, index) in allTrees"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
+ <div class="list-item" 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">{{ item.pz }}</div>
|
|
@@ -52,15 +72,21 @@
|
|
|
<div class="center-item p-t-2 age-line">
|
|
|
<div class="age-wrap">
|
|
|
<div class="has-age">
|
|
|
- <div class="age">栽种时间:<span class="unit">{{item.plantDate || '--'}}</span></div>
|
|
|
+ <div class="age">
|
|
|
+ 栽种时间:<span class="unit">{{ item.plantDate || "--" }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="sort-line"></div>
|
|
|
</div>
|
|
|
- 树龄:<span class="unit">{{ (item.age && item.age+'年') || '--' }}</span>
|
|
|
+ 树龄:<span class="unit">{{ (item.age && item.age + "年") || "--" }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="center-item">
|
|
|
+ 栽种区域:<span>{{ (item.area && item.area + "区") || "--" }}</span>
|
|
|
</div>
|
|
|
- <div class="center-item">栽种区域:<span>{{ (item.area && item.area + '区') || '--' }}</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div v-show="!allTrees.length" class="no-data">暂无数据</div>
|
|
|
</div>
|
|
|
<div class="pagination-wrap">
|
|
|
<el-pagination
|
|
@@ -72,7 +98,7 @@
|
|
|
:total="totalVal"
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="getSamplePage"
|
|
|
- />
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="custom-r">
|
|
@@ -83,36 +109,36 @@
|
|
|
<div class="custom-detail">
|
|
|
<div class="setting-item">
|
|
|
<span class="edit-label">树龄:</span>
|
|
|
- <el-input-number
|
|
|
- @change="settingSinglePrice"
|
|
|
- class="number-input"
|
|
|
- :controls="false"
|
|
|
- placeholder="请输入树龄"
|
|
|
- v-model="settingAge"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
- <span class="unit">年</span>
|
|
|
+ <el-input-number
|
|
|
+ @change="settingSinglePrice"
|
|
|
+ class="number-input"
|
|
|
+ :controls="false"
|
|
|
+ placeholder="请输入树龄"
|
|
|
+ v-model="settingAge"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
+ <span class="unit">年</span>
|
|
|
</div>
|
|
|
<div class="setting-item">
|
|
|
<span class="edit-label">品种:</span>
|
|
|
- <el-select
|
|
|
- class="blue-select"
|
|
|
- v-model="settingPz"
|
|
|
- filterable
|
|
|
- style="width: 190px"
|
|
|
- placeholder="请选择品种"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(species, index) in speciesList"
|
|
|
- :key="index"
|
|
|
- :label="species.name"
|
|
|
- :value="species.name"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+ <el-select
|
|
|
+ class="blue-select"
|
|
|
+ v-model="settingPz"
|
|
|
+ filterable
|
|
|
+ style="width: 190px"
|
|
|
+ placeholder="请选择品种"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(species, index) in speciesList"
|
|
|
+ :key="index"
|
|
|
+ :label="species.name"
|
|
|
+ :value="species.name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
<div class="setting-item date-picker">
|
|
|
<span class="edit-label">栽种时间:</span>
|
|
|
- <!-- <el-input-number @change="settingSinglePrice" class="number-input" :controls="false" v-model="item.total" :min="0" /> -->
|
|
|
+ <!-- <el-input-number @change="settingSinglePrice" class="number-input" :controls="false" v-model="item.total" :min="0" /> -->
|
|
|
<el-date-picker
|
|
|
v-model="plantDate"
|
|
|
type="date"
|
|
@@ -122,7 +148,6 @@
|
|
|
placeholder="请选择时间"
|
|
|
/>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
<!-- 渐变主色按钮 -->
|
|
|
<div class="btn-group">
|
|
@@ -150,8 +175,12 @@ const typeVal = ref(0);
|
|
|
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 currentPage = ref(1);
|
|
@@ -166,15 +195,15 @@ function goBack() {
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getSamplePage()
|
|
|
-
|
|
|
+ getSamplePage();
|
|
|
+
|
|
|
VE_API.manage_interface.speciesList({ farmId: 766 }).then(({ data }) => {
|
|
|
speciesList.value = data;
|
|
|
});
|
|
|
|
|
|
// 获取区域列表
|
|
|
getBlueRegionList();
|
|
|
-})
|
|
|
+});
|
|
|
|
|
|
function getBlueRegionList() {
|
|
|
VE_API.manage_interface.fetchRegionList({ farmId: 766 }).then(({ data }) => {
|
|
@@ -193,10 +222,19 @@ function handleTypeChange() {
|
|
|
}
|
|
|
|
|
|
function getSamplePage() {
|
|
|
- VE_API.manage_interface.fetchSamplePage({farmId: 766, pz: typeVal.value ? typeVal.value : null, page: currentPage.value, limit: pageSize.value}).then(({data, count}) => {
|
|
|
- allTrees.value = data
|
|
|
- totalVal.value = count;
|
|
|
- })
|
|
|
+ VE_API.manage_interface
|
|
|
+ .fetchSamplePage({
|
|
|
+ farmId: 766,
|
|
|
+ regionId: areaVal.value === 0 ? null : areaVal.value,
|
|
|
+ pz: typeVal.value ? typeVal.value : null,
|
|
|
+ ageRange: ageVal.value === 0 ? null : [ageVal.value - 10, ageVal.value],
|
|
|
+ page: currentPage.value,
|
|
|
+ limit: pageSize.value,
|
|
|
+ })
|
|
|
+ .then(({ data, count }) => {
|
|
|
+ allTrees.value = data;
|
|
|
+ totalVal.value = count;
|
|
|
+ });
|
|
|
}
|
|
|
function handleSizeChange(newSize) {
|
|
|
pageSize.value = newSize;
|
|
@@ -204,7 +242,6 @@ function handleSizeChange(newSize) {
|
|
|
getSamplePage();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const editClientRef = ref(null);
|
|
|
|
|
|
// 批量编辑
|
|
@@ -212,7 +249,6 @@ const settingAge = ref(null);
|
|
|
const settingPz = ref(null);
|
|
|
const plantDate = ref(null);
|
|
|
|
|
|
-
|
|
|
const speciesList = ref([]);
|
|
|
|
|
|
function settingSinglePrice() {
|
|
@@ -220,7 +256,7 @@ function settingSinglePrice() {
|
|
|
}
|
|
|
|
|
|
function settingForm() {
|
|
|
- const sampleIds = allTrees.value.map(item => item.sampleId);
|
|
|
+ const sampleIds = allTrees.value.map((item) => item.sampleId);
|
|
|
const params = {
|
|
|
sampleIds,
|
|
|
farmId: Number(sessionStorage.getItem("currentFarmId")),
|
|
@@ -228,7 +264,7 @@ function settingForm() {
|
|
|
pz: settingPz.value,
|
|
|
plantDate: plantDate.value,
|
|
|
};
|
|
|
- VE_API.manage_interface.batchEditFosterSample(params).then(({code}) => {
|
|
|
+ VE_API.manage_interface.batchEditFosterSample(params).then(({ code }) => {
|
|
|
if (code === 0) {
|
|
|
ElMessage.success("批量设置成功");
|
|
|
getSamplePage();
|
|
@@ -263,7 +299,7 @@ function settingForm() {
|
|
|
box-sizing: border-box;
|
|
|
padding: 0 28px;
|
|
|
border: 1px solid rgba(255, 255, 255, 0.78);
|
|
|
- background: #2199F8;
|
|
|
+ background: #2199f8;
|
|
|
border-radius: 4px;
|
|
|
color: #fff;
|
|
|
img {
|
|
@@ -310,7 +346,7 @@ function settingForm() {
|
|
|
align-items: center;
|
|
|
font-family: "PangMenZhengDao";
|
|
|
margin-bottom: 16px;
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
img {
|
|
|
margin-right: 8px;
|
|
|
}
|
|
@@ -322,13 +358,19 @@ function settingForm() {
|
|
|
padding-top: 8px;
|
|
|
max-height: calc(100% - 32px - 32px - 52px);
|
|
|
overflow: auto;
|
|
|
+ .no-data {
|
|
|
+ padding-top: 20px;
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 16px;
|
|
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
+ }
|
|
|
}
|
|
|
.pagination-wrap {
|
|
|
position: absolute;
|
|
|
bottom: 12px;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
.list-item {
|
|
@@ -345,10 +387,10 @@ function settingForm() {
|
|
|
cursor: pointer;
|
|
|
width: calc(25% - 8px);
|
|
|
box-sizing: border-box;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
&.selected {
|
|
|
background: rgba(33, 153, 248, 0.1);
|
|
|
- border-color: #2199F8;
|
|
|
+ border-color: #2199f8;
|
|
|
}
|
|
|
&.disabled {
|
|
|
opacity: 0.5;
|
|
@@ -406,7 +448,7 @@ function settingForm() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.age-line {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -418,7 +460,7 @@ function settingForm() {
|
|
|
margin: 0 10px;
|
|
|
height: 10px;
|
|
|
width: 1px;
|
|
|
- background: #6C6C6C;
|
|
|
+ background: #6c6c6c;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -429,13 +471,13 @@ function settingForm() {
|
|
|
font-size: 12px;
|
|
|
color: #999999;
|
|
|
.over {
|
|
|
- color: #FFD489;
|
|
|
+ color: #ffd489;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.right-tree-list + .right-tree-list {
|
|
|
margin-top: 12px;
|
|
|
}
|
|
@@ -451,12 +493,12 @@ function settingForm() {
|
|
|
border-radius: 8px;
|
|
|
.second-title {
|
|
|
border-radius: 8px 8px 0 0;
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
font-size: 22px;
|
|
|
padding: 14px 12px;
|
|
|
font-family: "PangMenZhengDao";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.user-name {
|
|
|
font-size: 16px;
|
|
|
color: rgba(0, 0, 0, 0.9);
|
|
@@ -470,7 +512,6 @@ function settingForm() {
|
|
|
overflow: auto;
|
|
|
position: relative;
|
|
|
|
|
|
-
|
|
|
.number-input {
|
|
|
// margin: 0 12px;
|
|
|
::v-deep {
|
|
@@ -514,7 +555,7 @@ function settingForm() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.date-picker {
|
|
|
::v-deep {
|
|
|
.el-date-editor {
|
|
@@ -548,7 +589,7 @@ function settingForm() {
|
|
|
padding-top: 12px;
|
|
|
}
|
|
|
.main-unit {
|
|
|
- color: #F3C11D;
|
|
|
+ color: #f3c11d;
|
|
|
}
|
|
|
.box-line {
|
|
|
width: 100%;
|
|
@@ -572,19 +613,18 @@ function settingForm() {
|
|
|
}
|
|
|
.selected-tips {
|
|
|
background: rgba(33, 153, 248, 0.1);
|
|
|
- border: 1px solid #2199F8;
|
|
|
+ border: 1px solid #2199f8;
|
|
|
width: 100%;
|
|
|
text-align: center;
|
|
|
border-radius: 8px;
|
|
|
height: 50px;
|
|
|
line-height: 50px;
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
.bottom-btn {
|
|
|
height: 60px;
|
|
|
-
|
|
|
}
|
|
|
.btn-group {
|
|
|
display: flex;
|
|
@@ -601,13 +641,13 @@ function settingForm() {
|
|
|
padding: 8px 44px;
|
|
|
font-size: 16px;
|
|
|
border-radius: 4px;
|
|
|
- border: 1px solid #2199F8;
|
|
|
+ border: 1px solid #2199f8;
|
|
|
}
|
|
|
.cancel-btn {
|
|
|
- color: #2199F8;
|
|
|
+ color: #2199f8;
|
|
|
}
|
|
|
.edit-btn {
|
|
|
- background: #2199F8;
|
|
|
+ background: #2199f8;
|
|
|
color: #fff;
|
|
|
}
|
|
|
.btn + .btn {
|