Pārlūkot izejas kodu

1-优化关闭弹窗2-添加牧场&多牧场选择领用页面

Shan9312 2 nedēļas atpakaļ
vecāks
revīzija
42a524bfda

+ 16 - 3
src/views/console/user/index.vue

@@ -2,6 +2,19 @@
   <div class="app-container">
     <div class="app-container">
       <div class="filter-container">
+        <el-select
+          v-model="getdataListParm.parammaps.pastureName"
+          placeholder="牧场"
+          style="width:120px"
+          class="filter-item"
+        >
+          <el-option
+            v-for="item in findAllPasture"
+            :key="item.id"
+            :label="item.name"
+            :value="item.name"
+          />
+        </el-select>
         <el-input v-model="getdataListParm.parammaps.empCode" placeholder="用户名" style="width: 140px;" class="filter-item" />
         <el-input v-model="getdataListParm.parammaps.empname" placeholder="姓名" style="width: 140px;" class="filter-item" />
         <el-input v-model="getdataListParm.parammaps.roleName" placeholder="角色" style="width: 140px;" class="filter-item" />
@@ -202,6 +215,7 @@ export default {
   directives: { waves },
   data() {
     return {
+      findAllPasture: [],
       myHeight:document.documentElement.clientHeight - 85- 200,
       isUserDelete:[],isUserResetpassword:[],isUserEdit:[],isUserRole:[],isUserAdd:[],
       tableKey: 0,
@@ -216,7 +230,7 @@ export default {
         { name: 'getEmpall', offset: 0, pagecount: 0, params: [] },
         { name: 'getMaintenanceTypeList', offset: 0, pagecount: 0, params: [] },
         { name: 'getMcsAccounts', offset: 0, pagecount: 0, params: [] },
-
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
       ],
       requestFilterParams: { returntype: 'Map', parammaps: {}},
       UpdateDataRelationParam: { name: '', dataname: '', datavalue: '', valuename: '', values: [] },
@@ -294,9 +308,8 @@ export default {
         this.rolelist = response.data.getRoleall.list
         this.emplist = response.data.getEmpall.list
         this.repairmanTypeList = response.data.getMaintenanceTypeList.list
-
         this.viedoAccountList = response.data.getMcsAccounts.list
-
+        this.findAllPasture = response.data.findAllPasture.list
 
         GetDataByName(this.getdataListParm).then(response => {
           this.list = response.data.list

+ 21 - 4
src/views/custom/receive/index.vue

@@ -5,7 +5,8 @@
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
     <div class="filter-container">
-      <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
+      <el-select v-model="getdataListParm.parammaps.pastureArr" style="width: 220px;" placeholder="牧场"  multiple
+        collapse-tags collapse-tags-tooltip  class="filter-item" @change="changePastureName">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
       <el-input v-model="getdataListParm.parammaps.applyCode" clearable placeholder="领用单号" style="width: 200px;" class="filter-item" />
@@ -548,7 +549,7 @@ export default {
       myHeight:document.documentElement.clientHeight - 85- 250,
       findAllPasture: [], findAllDepart: [], findAllEmploye: [], createDepartList: [], edit: 0,
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllMainPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
       ],
@@ -575,7 +576,7 @@ export default {
       radioAll: '全部',
       getdataListParm: {
         name: 'getBigpartapplyList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureName: Cookies.get('pasturename'), applyCode: this.$route.query.applyCode, applyType: '', statue: '', departmentId: '', inputDatetime: '', startTime: '', stopTime: '', loginId: Cookies.get('employeid'), menu: 'Receive', logindeptId: Cookies.get('departmentid'), loginpastureId: Cookies.get('pastureid') }
+        parammaps: { pastureName: Cookies.get('pasturename'), applyCode: this.$route.query.applyCode, applyType: '', pastureArr:[], statue: '', departmentId: '', inputDatetime: '', startTime: '', stopTime: '', loginId: Cookies.get('employeid'), menu: 'Receive', logindeptId: Cookies.get('departmentid'), loginpastureId: Cookies.get('pastureid') }
       },
       tableKey: 0,
       listLoading: true,
@@ -770,6 +771,19 @@ export default {
         this.getdataListParm.parammaps.startTime = ''
         this.getdataListParm.parammaps.stopTime = ''
       }
+
+      // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
+      if (this.getdataListParm.parammaps.pastureArr && this.getdataListParm.parammaps.pastureArr.length > 0) {
+        const arr = this.findAllPasture.filter((item) => {
+          if (this.getdataListParm.parammaps.pastureArr.includes(item.name)) {
+            return item
+          }
+        })
+        const ids = arr.map((child) => { return child.id })
+        console.log(arr,ids,'999999')
+        this.getdataListParm.parammaps.pastureId = ids.toString();
+      }
+
       GetDataByName(this.getdataListParm).then(response => {
         if (response.data.list !== null) {
           console.log('table数据', response.data.list)
@@ -1318,8 +1332,11 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.findAllMainPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
+        this.getdataListParm.parammaps.pastureArr = this.findAllPasture.map(item => {
+          return item.name
+        })
         this.getDepartDownList()
       })
     },

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 523 - 522
src/views/custom/subscribe/index.vue


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels