Răsfoiți Sursa

前端: 资质配置查询 三个类别列表的查询参数持久化

baichengfei 4 ani în urmă
părinte
comite
f854ea61c7

+ 39 - 25
src/dashoo.cn/frontend_web/src/pages/oilsupplier/basisbuild/index.vue

@@ -34,7 +34,7 @@
           </el-form-item>
 
           <el-form-item>
-            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+            <el-dropdown split-button type="primary" size="mini" @click="handleSearch($event)" @command="searchCommand">
               查询
               <el-dropdown-menu slot="dropdown">
                 <!-- <el-dropdown-item command="search">高级查询</el-dropdown-item> -->
@@ -310,8 +310,8 @@
   import setapi from '@/api/oilsupplier/oilclassorgset'
   import axios from 'axios'
   import uploadajax from '@/assets/js/uploadajax.js'
-  import tmpSupplierCheck from "../basisbuild/tmpsuppliercheck"
-  import tmpClassCheck from "../basisbuild/tmpclasscheck"
+  import tmpSupplierCheck from '../basisbuild/tmpsuppliercheck'
+  import tmpClassCheck from '../basisbuild/tmpclasscheck'
 
   export default {
     computed: {
@@ -324,7 +324,7 @@
       tmpClassCheck
     },
     name: 'oilbasisbuild',
-    data() {
+    data () {
       return {
         Excelurl: '',
         textarea: '',
@@ -514,9 +514,15 @@
         }
       }
     },
-    created() {
+    created () {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
+      if (process.client) {
+        let basisAptitudeSearchParams = window.localStorage.getItem('basisAptitudeSearchParams')
+        if (basisAptitudeSearchParams !== '' && basisAptitudeSearchParams !== null) {
+          this.searchForm = JSON.parse(basisAptitudeSearchParams)
+        }
+      }
       this.initTableHeader()
       // 查询列表
       this.initDatas()
@@ -535,7 +541,7 @@
           _currentPage: this.importcurrentPage,
           _size: this.importsize,
           Order: this.importColumn.Order,
-          Prop: this.importColumn.Prop,
+          Prop: this.importColumn.Prop
         }
         let myCreateOn = []
         // 解析时间
@@ -719,12 +725,12 @@
         })
       },
 
-      initTableHeader() {
+      initTableHeader () {
         setapi.initBbTableHeader(this.$axios).then(res => {
           this.dynamicTableColumns = res.data.items
         })
       },
-      saveApprovalDept() {
+      saveApprovalDept () {
         let organizeids = []
         let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
         organize.forEach(row => {
@@ -749,7 +755,7 @@
           console.log(err)
         })
       },
-      deptSet(val) {
+      deptSet (val) {
         let stcode = this.setForm.SupplierTypeCode
         this.deptsetVisible = true
         this.selecteclassid = val.Id
@@ -768,20 +774,26 @@
             console.log(err)
           })
       },
-      MoreCmdClick(cmd) {
+      MoreCmdClick (cmd) {
         if (cmd.Command === 'Set') {
           this.deptSet(cmd.row)
         } else if (cmd.Command === 'Delete') {
           this.deleteEntity(cmd.row)
         }
       },
-      GetCommand(cmdType, row) {
+      GetCommand (cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
-      initDatas() {
+      initDatas (event) {
+        if (event != null) {
+          this.currentPage = 1
+          if (process.client) {
+            window.localStorage.setItem('basisAptitudeSearchParams', JSON.stringify(this.searchForm)) // 物资类查询参数
+          }
+        }
         this.loading1 = true
         // 分页及列表条件
         let params = {
@@ -822,7 +834,7 @@
         // })
       },
 
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
           // this.dictOptions.customerList = res.data.items['customerList']
           // this.dictOptions.projectList = res.data.items['projectList']
@@ -889,7 +901,7 @@
           }
         })
       },
-      searchCommand(command) {
+      searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
@@ -897,7 +909,7 @@
         }
       },
       // 列表排序功能
-      orderby(column) {
+      orderby (column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -906,27 +918,30 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
+      clearSearch () {
+        if (process.client) {
+          window.localStorage.setItem('basisAptitudeSearchParams', '')
+        }
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
+      handleSearch (event) {
         this.currentPage = 1
         this.dialogVisible = false
-        this.initDatas()
+        this.initDatas(event)
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
+      deleteEntity (row) {
         this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -953,7 +968,7 @@
         })
       },
 
-      transferStr(val) {
+      transferStr (val) {
         if (val === '1') {
           return '是'
         }
@@ -964,7 +979,7 @@
         }
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -977,7 +992,7 @@
         }
       },
 
-      formatDateTime(date) {
+      formatDateTime (date) {
         var y = date.getFullYear()
         var m = date.getMonth() + 1
         m = m < 10 ? ('0' + m) : m
@@ -990,5 +1005,4 @@
       }
     }
   }
-
 </script>

+ 22 - 9
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/index.vue

@@ -36,7 +36,7 @@
             <el-input size="mini" v-model="searchForm.Name" style="width:100%" placeholder="请输入" clearable></el-input>
           </el-form-item>
           <el-form-item>
-            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+            <el-dropdown split-button type="primary" size="mini" @click="handleSearch($event)" @command="searchCommand">
               查询
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="search">高级查询</el-dropdown-item>
@@ -197,7 +197,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
-        <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
+        <el-button size="mini" type="primary" @click="handleSearch($event)">查 询</el-button>
       </span>
     </el-dialog>
     <el-dialog title="设置审批部门" :close-on-click-modal="false" :visible.sync="deptsetVisible">
@@ -486,9 +486,7 @@
   </div>
 </template>
 <script>
-  import {
-    mapGetters
-  } from 'vuex'
+  import {mapGetters} from 'vuex'
   import api from '@/api/oilsupplier/goodsaptitude'
   import setapi from '@/api/oilsupplier/oilclassorgset'
   import axios from 'axios'
@@ -818,12 +816,18 @@
         ContrastLoading: false,
         contrastsize: 10,
         contrastcurrentPage: 1,
-        contrastimportCount: 0,
+        contrastimportCount: 0
       }
     },
     created () {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
+      if (process.client) {
+        let goodsAptitudeSearchParams = window.localStorage.getItem('goodsAptitudeSearchParams')
+        if (goodsAptitudeSearchParams !== '' && goodsAptitudeSearchParams !== null) {
+          this.searchForm = JSON.parse(goodsAptitudeSearchParams)
+        }
+      }
       // 初始化部分表头
       this.initTableHeader()
 
@@ -1184,7 +1188,13 @@
             console.log(err)
           })
       },
-      initDatas () {
+      initDatas (event) {
+        if (event != null) {
+          this.currentPage = 1
+          if (process.client) {
+            window.localStorage.setItem('goodsAptitudeSearchParams', JSON.stringify(this.searchForm)) // 物资类查询参数
+          }
+        }
         this.loading1 = true
         // 分页及列表条件
         let params = {
@@ -1290,15 +1300,18 @@
         this.initDatas()
       },
       clearSearch () {
+        if (process.client) {
+          window.localStorage.setItem('goodsAptitudeSearchParams', '')
+        }
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch () {
+      handleSearch (event) {
         this.currentPage = 1
         this.dialogVisible = false
-        this.initDatas()
+        this.initDatas(event)
       },
       handleCurrentChange (value) {
         this.currentPage = value

+ 42 - 28
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/index.vue

@@ -33,7 +33,7 @@
             <el-input size="mini" v-model="searchForm.Name" style="width:100%" placeholder="请输入" clearable></el-input>
           </el-form-item>
           <el-form-item>
-            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+            <el-dropdown split-button type="primary" size="mini" @click="handleSearch($event)" @command="searchCommand">
               查询
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="search">高级查询</el-dropdown-item>
@@ -171,7 +171,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
-        <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
+        <el-button size="mini" type="primary" @click="handleSearch($event)">查 询</el-button>
       </span>
     </el-dialog>
     <el-dialog title="设置审批部门" :close-on-click-modal="false" :visible.sync="deptsetVisible">
@@ -718,12 +718,18 @@
           F39: '',
           F40: '',
           Remark: ''
-        },
+        }
       }
     },
-    created() {
+    created () {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
+      if (process.client) {
+        let techAptitudeSearchParams = window.localStorage.getItem('techAptitudeSearchParams')
+        if (techAptitudeSearchParams !== '' && techAptitudeSearchParams !== null) {
+          this.searchForm = JSON.parse(techAptitudeSearchParams)
+        }
+      }
       this.initTableHeader()
       // 查询列表
       this.initDatas()
@@ -916,7 +922,7 @@
           if (res.data.code === 0) {
             this.$message({
               type: 'success',
-              message: res.data.message + " 即将生成对比列表"
+              message: res.data.message + ' 即将生成对比列表'
             })
             this.importloading = false
             this.initImportDatas()
@@ -933,7 +939,7 @@
         })
       },
 
-      initTableHeader() {
+      initTableHeader () {
         setapi.initTsTableHeader(this.$axios).then(res => {
           this.dynamicTableColumns = res.data.items
         })
@@ -1003,19 +1009,19 @@
           }
         })
       },
-      Name1Change(val) {
+      Name1Change (val) {
         this.formData.Code2 = this.formData.Code2.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
         this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
         this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
       },
-      Name2Change(val) {
+      Name2Change (val) {
         this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
         this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
       },
-      Name3Change(val) {
+      Name3Change (val) {
         this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{6}(.*)$/, '$1' + val + '$2')
       },
-      saveApprovalDept() {
+      saveApprovalDept () {
         let organizeids = []
         let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
         organize.forEach(row => {
@@ -1040,7 +1046,7 @@
           console.log(err)
         })
       },
-      deptSet(val) {
+      deptSet (val) {
         let stcode = this.setForm.SupplierTypeCode
         this.deptsetVisible = true
         this.selecteclassid = val.Id
@@ -1059,7 +1065,7 @@
             console.log(err)
           })
       },
-      MoreCmdClick(cmd) {
+      MoreCmdClick (cmd) {
         if (cmd.Command === 'Set') {
           this.deptSet(cmd.row)
         } else if (cmd.Command === 'Delete') {
@@ -1068,13 +1074,19 @@
           this.CodeNameEdit(cmd.row)
         }
       },
-      GetCommand(cmdType, row) {
+      GetCommand (cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
-      initDatas() {
+      initDatas (event) {
+        if (event != null) {
+          this.currentPage = 1
+          if (process.client) {
+            window.localStorage.setItem('techAptitudeSearchParams', JSON.stringify(this.searchForm)) // 物资类查询参数
+          }
+        }
         this.loading1 = true
         // 分页及列表条件
         let params = {
@@ -1103,7 +1115,7 @@
           console.error(err)
         })
       },
-      CodeNameEdit(val) {
+      CodeNameEdit (val) {
         this.myclassid = val.ClassId
         this.$axios.get('technologyserviceclass/getcodename/' + val.Code, {})
           .then(res => {
@@ -1115,30 +1127,29 @@
             console.log(err)
           })
       },
-      codeedit() {
+      codeedit () {
         this.loading3 = true
         api.updateCodeEntity(this.myclassid, this.formData, this.$axios).then(res => {
           this.loading3 = false
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
+            // 保存成功后,初始化数据,变成修改
             this.codeeditshow = false
-            this.initDatas();
+            this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
-
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
           this.AuditStepOptions = res.data.items['AuditStep']
           // this.dictOptions.customerList = res.data.items['customerList']
@@ -1148,7 +1159,7 @@
         })
       },
 
-      searchCommand(command) {
+      searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
@@ -1156,7 +1167,7 @@
         }
       },
       // 列表排序功能
-      orderby(column) {
+      orderby (column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -1165,16 +1176,19 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
+      clearSearch () {
+        if (process.client) {
+          window.localStorage.setItem('techAptitudeSearchParams', '')
+        }
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
+      handleSearch (event) {
         this.currentPage = 1
         this.dialogVisible = false
-        this.initDatas()
+        this.initDatas(event)
       },
       handleCurrentChange(value) {
         this.currentPage = value