|
@@ -2,12 +2,12 @@
|
|
|
<div class="pbbasic">
|
|
|
<el-container>
|
|
|
<!-- 树状图 -->
|
|
|
- <el-aside>
|
|
|
+ <!-- <el-aside>
|
|
|
<div class="rect">
|
|
|
<pbbasic-left @getPigs="getPigs"></pbbasic-left>
|
|
|
</div>
|
|
|
</el-aside>
|
|
|
- <el-container>
|
|
|
+ <el-container> -->
|
|
|
<!-- form表单 -->
|
|
|
<el-header>
|
|
|
<div class="rect" style="padding-bottom: 10px">
|
|
@@ -130,14 +130,12 @@
|
|
|
</el-form-item> -->
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
- style="background-color: rgb(24,144,255);color: #fff;border-color: rgb(24,144,255);width: 90px;height: 30px;font-size: 13px"
|
|
|
icon="el-icon-plus">
|
|
|
- 新增
|
|
|
+ 新 增
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- style="background-color: rgb(24,144,255);color: #fff;border-color: rgb(24,144,255);width: 115px;height: 30px;font-size: 14px"
|
|
|
icon="el-icon-delete">
|
|
|
- 删除
|
|
|
+ 删 除
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -382,9 +380,9 @@
|
|
|
label-width="80px"
|
|
|
size="mini"
|
|
|
style="padding: 0 60px 0 40px">
|
|
|
- <el-form-item label="所属牧场" prop="pastureId">
|
|
|
+ <el-form-item label="所属牧场" prop="farmId">
|
|
|
<el-select
|
|
|
- v-model="form.pastureId"
|
|
|
+ v-model="form.farmId"
|
|
|
placeholder="请选择所属牧场"
|
|
|
@change="getPasture"
|
|
|
ref="pasture"
|
|
@@ -515,13 +513,13 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</el-main>
|
|
|
- </el-container>
|
|
|
+ <!-- </el-container> -->
|
|
|
</el-container>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import pbbasicLeft from "./pbbasicLeft";
|
|
|
+// import pbbasicLeft from "./pbbasicLeft";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -556,7 +554,7 @@ export default {
|
|
|
sex: "",
|
|
|
pigstyId: "",
|
|
|
periodId: "",
|
|
|
- pastureId: "",
|
|
|
+ farmId: "",
|
|
|
},
|
|
|
pastureList: [], // 牧场list
|
|
|
pighouseList: [], // 猪舍list
|
|
@@ -587,7 +585,7 @@ export default {
|
|
|
],
|
|
|
row: {},
|
|
|
dataRule: {
|
|
|
- pastureId: [
|
|
|
+ farmId: [
|
|
|
{ required: true, message: "牧场不能为空", trigger: "blur" },
|
|
|
],
|
|
|
pigstyId: [
|
|
@@ -606,7 +604,14 @@ export default {
|
|
|
weight: [],
|
|
|
breed: [{ required: true, message: "品种不能为空", trigger: "blur" }],
|
|
|
},
|
|
|
- labelPosition: 'right'
|
|
|
+ labelPosition: 'right',
|
|
|
+ searchForm: {
|
|
|
+ earTag: '',
|
|
|
+ sex: '',
|
|
|
+ breed: '',
|
|
|
+ health: '',
|
|
|
+
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -632,7 +637,7 @@ export default {
|
|
|
}).then(async ({ data }) => {
|
|
|
// 获取所有牧场
|
|
|
let pastureResult = await this.$http({
|
|
|
- url: this.$http.adornUrl("/management/pasture/findAll"),
|
|
|
+ url: this.$http.adornUrl("/management/farm/findAll"),
|
|
|
method: "post",
|
|
|
});
|
|
|
pastureResult.data.all && (this.pastureList = pastureResult.data.all);
|
|
@@ -664,7 +669,7 @@ export default {
|
|
|
for (let unit of this.unitList) {
|
|
|
if (item.unitId === unit.id) {
|
|
|
item.unitNumber = unit.number;
|
|
|
- item.pastureId = unit.pastureId;
|
|
|
+ item.farmId = unit.farmId;
|
|
|
item.pigstyId = unit.pigstyId;
|
|
|
break;
|
|
|
}
|
|
@@ -673,7 +678,7 @@ export default {
|
|
|
// 牧场对应
|
|
|
this.dataList.forEach((item) => {
|
|
|
for (let pasture of this.pastureList) {
|
|
|
- if (item.pastureId === pasture.id) {
|
|
|
+ if (item.farmId === pasture.id) {
|
|
|
item.name = pasture.name;
|
|
|
break;
|
|
|
}
|
|
@@ -769,39 +774,39 @@ export default {
|
|
|
// → 限制猪舍
|
|
|
this.phSelectedList = [];
|
|
|
this.pighouseList.forEach((item) => {
|
|
|
- if (item.pastureId === val) {
|
|
|
+ if (item.farmId === val) {
|
|
|
this.phSelectedList.push(item);
|
|
|
}
|
|
|
});
|
|
|
// 判断当前 猪舍 是否需要清除
|
|
|
let pigsty = this.pigstyByYid(this.form.pigstyId);
|
|
|
- if (pigsty && pigsty.pastureId !== val) {
|
|
|
+ if (pigsty && pigsty.farmId !== val) {
|
|
|
this.form.pigstyId = "";
|
|
|
}
|
|
|
/** 关于单元 */
|
|
|
// → 限制单元
|
|
|
this.unSelectedList = [];
|
|
|
this.unitList.forEach((item) => {
|
|
|
- if (item.pastureId === val) {
|
|
|
+ if (item.farmId === val) {
|
|
|
this.unSelectedList.push(item);
|
|
|
}
|
|
|
});
|
|
|
// 判断当前 单元 是否需要清除
|
|
|
let unit = this.UnitByIid(this.form.unitId);
|
|
|
- if (unit && unit.pastureId !== val) {
|
|
|
+ if (unit && unit.farmId !== val) {
|
|
|
this.form.unitId = "";
|
|
|
}
|
|
|
/** 关于栏期 */
|
|
|
// → 限制栏期
|
|
|
this.peSelectedList = [];
|
|
|
this.periodList.forEach((item) => {
|
|
|
- if (item.pastureId === val) {
|
|
|
+ if (item.farmId === val) {
|
|
|
this.peSelectedList.push(item);
|
|
|
}
|
|
|
});
|
|
|
// 判断当前 栏期 是否需要清除
|
|
|
let period = this.periodByJid(this.form.periodId);
|
|
|
- if (period && period.pastureId !== val) {
|
|
|
+ if (period && period.farmId !== val) {
|
|
|
this.form.periodId = "";
|
|
|
}
|
|
|
},
|
|
@@ -809,9 +814,9 @@ export default {
|
|
|
getPigsty(val) {
|
|
|
// → 反向确定牧场
|
|
|
let pigsty = this.pigstyByYid(this.form.pigstyId);
|
|
|
- this.form.pastureId = pigsty.pastureId;
|
|
|
+ this.form.farmId = pigsty.farmId;
|
|
|
// → 先获取猪舍,没有确定牧场的情况下,限制猪舍自身
|
|
|
- this.phSelectedList = this.xidYlist(pigsty.pastureId);
|
|
|
+ this.phSelectedList = this.xidYlist(pigsty.farmId);
|
|
|
/** 关于单元 */
|
|
|
// → 限制单元
|
|
|
this.unSelectedList = [];
|
|
@@ -843,10 +848,10 @@ export default {
|
|
|
getUnit(val) {
|
|
|
let unit = this.UnitByIid(val);
|
|
|
// 反向确定 牧场 + 猪舍
|
|
|
- this.form.pastureId = unit.pastureId;
|
|
|
+ this.form.farmId = unit.farmId;
|
|
|
this.form.pigstyId = unit.pigstyId;
|
|
|
// 反向确定 猪舍selectedList + 单元selectedList + 栏期selectedList
|
|
|
- this.phSelectedList = this.xidYlist(unit.pastureId);
|
|
|
+ this.phSelectedList = this.xidYlist(unit.farmId);
|
|
|
this.unSelectedList = this.yidIlist(unit.pigstyId);
|
|
|
this.peSelectedList = this.yidJlist(unit.pigstyId);
|
|
|
// 判断当前栏期是否需要清除
|
|
@@ -856,10 +861,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 根据牧场id → 限制猪舍selectedList
|
|
|
- xidYlist(pastureId) {
|
|
|
+ xidYlist(farmId) {
|
|
|
let phSelectedList = [];
|
|
|
this.pighouseList.forEach((item) => {
|
|
|
- if (item.pastureId === pastureId) {
|
|
|
+ if (item.farmId === farmId) {
|
|
|
phSelectedList.push(item);
|
|
|
}
|
|
|
});
|
|
@@ -916,10 +921,10 @@ export default {
|
|
|
getPeriod(val) {
|
|
|
let period = this.periodByJid(val);
|
|
|
// 反向确定牧场 + 猪舍
|
|
|
- this.form.pastureId = period.pastureId;
|
|
|
+ this.form.farmId = period.farmId;
|
|
|
this.form.pigstyId = period.pigstyId;
|
|
|
// 反向确定 猪舍selectedList + 单元selectedList + 栏期selectedList
|
|
|
- this.phSelectedList = this.xidYlist(period.pastureId);
|
|
|
+ this.phSelectedList = this.xidYlist(period.farmId);
|
|
|
this.unSelectedList = this.yidIlist(period.pigstyId);
|
|
|
this.peSelectedList = this.yidJlist(period.pigstyId);
|
|
|
// 判断当前 单元 是否需要清除
|
|
@@ -1199,7 +1204,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
components: {
|
|
|
- pbbasicLeft,
|
|
|
+ // pbbasicLeft,
|
|
|
},
|
|
|
};
|
|
|
</script>
|