Przeglądaj źródła

委外维修的牧场多选

Shan9312 5 miesięcy temu
rodzic
commit
43e776c2d0

BIN
dist-现代牧业-正式-20231210.zip → dist-现代牧业-正式-20231210-2.zip


Plik diff jest za duży
+ 0 - 0
dist/index.html


+ 0 - 2
src/views/maintenance/repair/index.vue

@@ -174,8 +174,6 @@
     <!-- 分页 -->
     <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
 
-
-
     <!-- 新增委外维修单 -->
     <el-dialog  title="新增委外维修单1" :visible.sync="dialogFormVisibleCont" :close-on-click-modal="false" width="90%" @close="handleClose(1)">
       <div >

+ 100 - 5
src/views/maintenance/subcontractingMainten/tabPage/tab1.vue

@@ -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;

+ 103 - 7
src/views/maintenance/subcontractingMainten/tabPage/tab2.vue

@@ -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">
@@ -479,7 +495,7 @@
 
           <el-row v-if="dialogStatus ==='see'  ">
             <el-col>
-              <h3 >流程进度</h3>
+              <h3 >流程进度1</h3>
               <el-steps :active="active" align-center finish-status="success">
                 <el-step
                   v-for="(item,index) in activeList"
@@ -726,12 +742,13 @@ export default {
   inject: ['reload'],
   data() {
     return {
+      findAllPasture:[],
       myHeight:document.documentElement.clientHeight - 85- 200,
       //多个下拉框 - 请求内容
       send_select_list: [
         { 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: 'findAllMainPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
       ],
 
 
@@ -762,7 +779,7 @@ export default {
           name: 'getBigacceptanceList',
           //请求的 page 无用参数  offset 第几页  pagecount 每页多少条
           page: 1, offset: 1, pagecount: 50, returntype: 'Map',
-          parammaps: { pastureName: Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
+          parammaps: { pastureName: Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:'',pastureArr:[]}
         },
         tableKey: 0, listLoading: false,
         //返回的 pageNum 第几页  pageSize 每页多少条 total 总条数
@@ -959,10 +976,42 @@ export default {
 
 
     this.get_select_list()
-    this.get_table_data1()
+
 
   },
   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
+    },
+
      // 给表头加必填符号*
      addRedStar(h, { column }) {
       return [
@@ -997,7 +1046,6 @@ export default {
 
     },
 
-
     get_select_list() {
       GetDataByNames(this.send_select_list).then(response => {
         this.pastureNameList = response.data.findAllPasture.list
@@ -1005,6 +1053,11 @@ export default {
         this.employeNameList = response.data.findAllEmploye.list
         console.log("申请人下拉框", this.employeNameList)
 
+         this.findAllPasture = response.data.findAllMainPasture.list
+         this.tableObj1.getdataListParm.parammaps.pastureArr = this.findAllPasture.map(item => {
+          return item.name
+        })
+        this.get_table_data1()
         this.get_depart_list1()
       })
     },
@@ -1051,6 +1104,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
@@ -2392,6 +2456,38 @@ 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;
+  }
+
 
  ::v-deep .is-requied .el-form-item__label::before{
     content:'*';

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików