|
@@ -2,8 +2,24 @@
|
|
|
<div class="app-container">
|
|
|
<div class="filter-container">
|
|
|
|
|
|
- <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
|
|
|
- <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
|
|
|
+ <el-select v-model="tableObj1.getdataListParm.parammaps.pastureArr"
|
|
|
+ style="width: 220px;" placeholder="牧场" multiple
|
|
|
+ filterable collapse-tags-tooltip class="filter-item" @change="change_pasture1">
|
|
|
+ <!-- -->
|
|
|
+ <div class="select_up">
|
|
|
+ <el-button type="text" @click="selectAll">
|
|
|
+ <i class="jw jw-quanxuan " />
|
|
|
+ 全选</el-button>
|
|
|
+ <el-button type="text" @click="removeTag">
|
|
|
+ <i class="jw jw-qingkong " />
|
|
|
+ 清空</el-button>
|
|
|
+ <el-button type="text" @click="selectReverse">
|
|
|
+ <i class="jw jw-fanxuan " />
|
|
|
+ 反选</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="select_list">
|
|
|
+ <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
|
|
|
+ </div>
|
|
|
</el-select>
|
|
|
|
|
|
<el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
|
|
@@ -385,6 +401,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// todo
|
|
|
+ findAllPasture:[],
|
|
|
rejectList: [{ id: '0', name: '正常' }, { id: '1', name: '已关单' }], // TODO: 已关单状态
|
|
|
myHeight:document.documentElement.clientHeight - 85- 200,
|
|
|
//多个下拉框 - 请求内容
|
|
@@ -392,7 +409,7 @@ export default {
|
|
|
{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
|
|
|
{ name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
|
|
|
{ name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }},
|
|
|
-
|
|
|
+ { name: 'findAllMainPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
|
|
|
],
|
|
|
|
|
|
|
|
@@ -424,7 +441,7 @@ export default {
|
|
|
name: 'getBigoutsourcingList',
|
|
|
//请求的 page 无用参数 offset 第几页 pagecount 每页多少条
|
|
|
page: 1, offset: 1,pagecount: 50,returntype: 'Map',
|
|
|
- parammaps: { pastureName: Cookies.get('pasturename'), outsourcingCode: '',departmentName: '',status: "",eqName: "",eqCode: "",contractCode: "",inputDatetime:"",startdate: "",enddate: ""}
|
|
|
+ parammaps: { pastureName: Cookies.get('pasturename'), outsourcingCode: '',departmentName: '',status: "",eqName: "",eqCode: "",contractCode: "",inputDatetime:"",startdate: "",enddate: "",pastureArr:[]}
|
|
|
},
|
|
|
tableKey: 0,listLoading: false,
|
|
|
//返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
|
|
@@ -568,10 +585,41 @@ export default {
|
|
|
|
|
|
|
|
|
this.get_select_list()
|
|
|
- this.get_table_data1()
|
|
|
+
|
|
|
this.get_auto_buttons()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 删除
|
|
|
+ removeTag(type) {
|
|
|
+
|
|
|
+ if (type == 1) {
|
|
|
+ this.tableObj1.getdataListParm.parammaps.pastureArr = []
|
|
|
+ } else {
|
|
|
+ this.tableObj1.getdataListParm2.parammaps.pastureArr = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 全选
|
|
|
+ selectAll(val) {
|
|
|
+ val = []
|
|
|
+ this.findAllPasture.map(item => {
|
|
|
+ val.push(item.name)
|
|
|
+ })
|
|
|
+ this.tableObj1.getdataListParm.parammaps.pastureArr = val
|
|
|
+ },
|
|
|
+ // 反选
|
|
|
+ selectReverse(val) {
|
|
|
+ val = []
|
|
|
+ this.findAllPasture.map(item => {
|
|
|
+ let index = this.tableObj1.getdataListParm.parammaps.pastureArr.indexOf(item.name);
|
|
|
+ if (index != -1) {
|
|
|
+ //orgData.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ val.push(item.name)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tableObj1.getdataListParm.parammaps.pastureArr = val
|
|
|
+ },
|
|
|
+
|
|
|
// 提交按钮
|
|
|
form_submit(row) {
|
|
|
MessageBox.confirm('确认提交此条信息?', {
|
|
@@ -672,11 +720,16 @@ export default {
|
|
|
get_select_list() {
|
|
|
GetDataByNames(this.send_select_list).then(response => {
|
|
|
this.pastureNameList = response.data.findAllPasture.list
|
|
|
+ this.findAllPasture = response.data.findAllMainPasture.list
|
|
|
console.log("牧场下拉框", this.pastureNameList)
|
|
|
this.employeNameList = response.data.findAllEmploye.list
|
|
|
console.log("申请人下拉框", this.employeNameList)
|
|
|
this.providerNameList = response.data.findAllProviderByCt.list
|
|
|
|
|
|
+ this.tableObj1.getdataListParm.parammaps.pastureArr = this.findAllPasture.map(item => {
|
|
|
+ return item.name
|
|
|
+ })
|
|
|
+ this.get_table_data1()
|
|
|
this.get_depart_list1()
|
|
|
})
|
|
|
},
|
|
@@ -723,6 +776,17 @@ export default {
|
|
|
this.tableObj1.getdataListParm.parammaps.enddate = ''
|
|
|
}
|
|
|
|
|
|
+ // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
|
|
|
+ if (this.tableObj1.getdataListParm.parammaps.pastureArr && this.tableObj1.getdataListParm.parammaps.pastureArr.length > 0) {
|
|
|
+ const arr = this.findAllPasture.filter((item) => {
|
|
|
+ if (this.tableObj1.getdataListParm.parammaps.pastureArr.includes(item.name)) {
|
|
|
+ return item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const ids = arr.map((child) => { return child.id })
|
|
|
+ this.tableObj1.getdataListParm.parammaps.pastureId = ids.toString();
|
|
|
+ }
|
|
|
+
|
|
|
GetDataByName(this.tableObj1.getdataListParm).then(response => {
|
|
|
if (response.data.list !== null) {
|
|
|
this.tableObj1.list = response.data.list
|
|
@@ -1654,6 +1718,37 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.select_up {
|
|
|
+ padding: 0 12px;
|
|
|
+ font-size: 14px;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 99999;
|
|
|
+ background-color: white;
|
|
|
+ top: 0px;
|
|
|
+ width: 100%;
|
|
|
+ border-radius: 5px 5px 0 0;
|
|
|
+
|
|
|
+ ::v-deep .el-button {
|
|
|
+ color: #bcbcbc;
|
|
|
+ font-size: 14px;
|
|
|
+
|
|
|
+ i {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .el-button:hover {
|
|
|
+ color: #409EFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button+.el-button {
|
|
|
+ margin-left: 6px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .select_list {
|
|
|
+ margin-top: 25px;
|
|
|
+ }
|
|
|
|
|
|
// .content{
|
|
|
// padding: 20px 20px;
|