Przeglądaj źródła

调整组织架构关联账号,新增模糊搜索分页功能

qymljy 2 lat temu
rodzic
commit
aed72c8b7b

+ 50 - 16
package-lock.json

@@ -17,8 +17,10 @@
         "axios": "^0.26.0",
         "core-js": "^3.8.3",
         "countup.js": "^2.0.8",
+        "cross-env": "^7.0.3",
         "element-ui": "^2.15.6",
         "file-saver": "^2.0.5",
+        "increase-memory-limit": "^1.0.7",
         "js-md5": "^0.7.3",
         "less-loader": "^11.1.0",
         "nprogress": "^0.2.0",
@@ -5852,11 +5854,27 @@
       "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz",
       "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA=="
     },
+    "node_modules/cross-env": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz",
+      "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+      "dependencies": {
+        "cross-spawn": "^7.0.1"
+      },
+      "bin": {
+        "cross-env": "src/bin/cross-env.js",
+        "cross-env-shell": "src/bin/cross-env-shell.js"
+      },
+      "engines": {
+        "node": ">=10.14",
+        "npm": ">=6",
+        "yarn": ">=1"
+      }
+    },
     "node_modules/cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz",
       "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
-      "dev": true,
       "dependencies": {
         "path-key": "^3.1.0",
         "shebang-command": "^2.0.0",
@@ -8770,6 +8788,17 @@
         "node": ">=0.8.19"
       }
     },
+    "node_modules/increase-memory-limit": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmmirror.com/increase-memory-limit/-/increase-memory-limit-1.0.7.tgz",
+      "integrity": "sha512-ozyn+HHAPD9VxMT1U50A7G8XXlktUWhnnEDYSeDYnQjKsNrBWHqq6XfEA0uhMdDPD+q/7rXWlzF1CbXX/c1LiQ==",
+      "dependencies": {
+        "glob": "^7.1.1"
+      },
+      "bin": {
+        "increase-memory-limit": "index.js"
+      }
+    },
     "node_modules/indent-string": {
       "version": "4.0.0",
       "resolved": "https://registry.npmmirror.com/indent-string/-/indent-string-4.0.0.tgz",
@@ -9163,8 +9192,7 @@
     "node_modules/isexe": {
       "version": "2.0.0",
       "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz",
-      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
-      "dev": true
+      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
     },
     "node_modules/isobject": {
       "version": "3.0.1",
@@ -10947,7 +10975,6 @@
       "version": "3.1.1",
       "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
       "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
-      "dev": true,
       "engines": {
         "node": ">=8"
       }
@@ -12433,7 +12460,6 @@
       "version": "2.0.0",
       "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz",
       "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
-      "dev": true,
       "dependencies": {
         "shebang-regex": "^3.0.0"
       },
@@ -12445,7 +12471,6 @@
       "version": "3.0.0",
       "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz",
       "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
-      "dev": true,
       "engines": {
         "node": ">=8"
       }
@@ -15370,7 +15395,6 @@
       "version": "2.0.2",
       "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
       "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
-      "dev": true,
       "dependencies": {
         "isexe": "^2.0.0"
       },
@@ -20327,11 +20351,18 @@
       "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz",
       "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA=="
     },
+    "cross-env": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz",
+      "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+      "requires": {
+        "cross-spawn": "^7.0.1"
+      }
+    },
     "cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz",
       "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
-      "dev": true,
       "requires": {
         "path-key": "^3.1.0",
         "shebang-command": "^2.0.0",
@@ -22618,6 +22649,14 @@
       "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
       "dev": true
     },
+    "increase-memory-limit": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmmirror.com/increase-memory-limit/-/increase-memory-limit-1.0.7.tgz",
+      "integrity": "sha512-ozyn+HHAPD9VxMT1U50A7G8XXlktUWhnnEDYSeDYnQjKsNrBWHqq6XfEA0uhMdDPD+q/7rXWlzF1CbXX/c1LiQ==",
+      "requires": {
+        "glob": "^7.1.1"
+      }
+    },
     "indent-string": {
       "version": "4.0.0",
       "resolved": "https://registry.npmmirror.com/indent-string/-/indent-string-4.0.0.tgz",
@@ -22927,8 +22966,7 @@
     "isexe": {
       "version": "2.0.0",
       "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz",
-      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
-      "dev": true
+      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
     },
     "isobject": {
       "version": "3.0.1",
@@ -24318,8 +24356,7 @@
     "path-key": {
       "version": "3.1.1",
       "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
-      "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
-      "dev": true
+      "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
     },
     "path-parse": {
       "version": "1.0.7",
@@ -25444,7 +25481,6 @@
       "version": "2.0.0",
       "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz",
       "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
-      "dev": true,
       "requires": {
         "shebang-regex": "^3.0.0"
       }
@@ -25452,8 +25488,7 @@
     "shebang-regex": {
       "version": "3.0.0",
       "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz",
-      "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
-      "dev": true
+      "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
     },
     "shell-quote": {
       "version": "1.7.3",
@@ -27784,7 +27819,6 @@
       "version": "2.0.2",
       "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
       "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
-      "dev": true,
       "requires": {
         "isexe": "^2.0.0"
       }

+ 4 - 1
package.json

@@ -5,7 +5,8 @@
   "scripts": {
     "serve": "vue-cli-service serve --host 0.0.0.0",
     "build": "vue-cli-service build",
-    "lint": "vue-cli-service lint"
+    "lint": "vue-cli-service lint",
+    "fix-memory-limit": "cross-env LIMIT=10240 increase-memory-limit"
   },
   "dependencies": {
     "@antv/g2": "^4.1.46",
@@ -17,8 +18,10 @@
     "axios": "^0.26.0",
     "core-js": "^3.8.3",
     "countup.js": "^2.0.8",
+    "cross-env": "^7.0.3",
     "element-ui": "^2.15.6",
     "file-saver": "^2.0.5",
+    "increase-memory-limit": "^1.0.7",
     "js-md5": "^0.7.3",
     "less-loader": "^11.1.0",
     "nprogress": "^0.2.0",

+ 3 - 1
src/HManagement/accountManage/index.vue

@@ -22,6 +22,7 @@
             v-model="accountType"
             placeholder="请选择用户类型"
             @change="typeChange"
+            clearable
           >
             <el-option
               v-for="item in selectType"
@@ -39,7 +40,8 @@
             v-model="status"
             placeholder="请选择数据状态"
             @change="handleSelectChange"
-          >
+            clearable
+            >
             <el-option
               v-for="item in select"
               :label="item.remarks"

+ 1 - 1
src/HManagement/department/staff/detail/index.vue

@@ -18,7 +18,7 @@
       </div>
       <div slot="customOperation" >
         <linkAccount class="inline-16" v-if="tool.checkAuth($route.name,'update')"  :data="mainData"  @onSuccess="queryMainData"></linkAccount>
-        <createUser class="inline-16" v-if="tool.checkAuth($route.name,'update') && !mainData.userid" :data="mainData"  @onSuccess="queryMainData"></createUser>
+<!--        <createUser class="inline-16" v-if="tool.checkAuth($route.name,'update') && !mainData.userid" :data="mainData"  @onSuccess="queryMainData"></createUser>-->
       </div>
       <div class="container normal-panel" slot="slot0" >
         <baseInfo :mainInfo="mainData"></baseInfo>

+ 56 - 3
src/HManagement/department/staff/detail/modules/linkAccount.vue

@@ -2,7 +2,17 @@
   <div>
     <el-button size="mini" icon="el-icon-link" type="primary"  @click="onShow">关联账号</el-button>
     <el-dialog title="绑定账号" append-to-body :visible.sync="dialogTableVisible">
-      <tableLayout :layout="tablecols" :data="sys_options" height="400px">
+      <el-input
+          size="small"
+          style="margin-top:-20px;width: 300px;margin-bottom:20px;float: right"
+          suffix-icon="el-icon-search"
+          v-model="param.content.parameter.condition"
+          placeholder="登录账号/账号名称/联系方式"
+          @keyup.enter.native="listData(param.content.pageNumber = 1)"
+          @clear="listData(param.content.pageNumber = 1)"
+          clearable>
+      </el-input>
+      <tableLayout :layout="tablecols" :data="tableData" height="400px">
         <template v-slot:opreation="scope">
           <el-popconfirm
             class="inline-16"
@@ -12,6 +22,20 @@
           </el-popconfirm>
         </template>
       </tableLayout>
+      <div style="display:flex;align-items:center;flex-direction:row-reverse;justify-content:space-between">
+        <div class="container normal-panel" style="text-align:right">
+          <el-pagination
+              background
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[20, 50, 100, 200]"
+              layout="total,sizes, prev, pager, next, jumper"
+              :total="total">
+          </el-pagination>
+        </div>
+        <slot name="footerLeft"></slot>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -24,6 +48,21 @@ export default {
     return {
       dialogTableVisible:false,
       tablecols:[],
+      tableData:[],
+      total:0,
+      currentPage:0,
+      param:{
+        classname: "sysmanage.develop.optiontype.optiontype",
+        method: "optiontypeselect",
+        content: {
+          pageNumber: 1,
+          pageSize: 20,
+          typename: "userlistunused",
+          parameter: {
+            condition:""
+          }
+        },
+      },
       form:{},
     }
   },
@@ -37,8 +76,12 @@ export default {
       this.listData()
       this.dialogTableVisible = true
     },
-    listData () {
-      this.$store.dispatch('optiontypeselect','userlistunused')
+    async listData () {
+      /*this.$store.dispatch('optiontypeselect','userlistunused')*/
+      const res = await this.$api.requested(this.param)
+      this.tableData = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
     },
     bindAccount (scope) {
       this.data.birthday = ''
@@ -67,6 +110,16 @@ export default {
         this.dialogTableVisible = false
         this.$emit('onSuccess')
     },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
   },
   mounted () {
     this.tablecols = this.tool.tabelCol(this.$route.name)['unBindtACTable'].tablecols

+ 78 - 0
src/HManagement/department/staff/detail/modules/linkAccountCopy.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <el-button size="mini" icon="el-icon-link" type="primary"  @click="onShow">关联账号</el-button>
+    <el-dialog title="绑定账号" append-to-body :visible.sync="dialogTableVisible">
+      <tableLayout :layout="tablecols" :data="sys_options" height="400px">
+        <template v-slot:opreation="scope">
+          <el-popconfirm
+            class="inline-16"
+            title="确定要绑定员工账号吗?"
+            @confirm="bindAccount(scope)">
+            <el-button slot="reference" type="text" size="small">绑定账号</el-button>
+          </el-popconfirm>
+        </template>
+      </tableLayout>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from 'vuex'
+export default {
+  props:['data'],
+  data () {
+    return {
+      dialogTableVisible:false,
+      tablecols:[],
+      form:{},
+    }
+  },
+  computed:{
+    ...mapGetters({
+      sys_options:'sys_options',
+    })
+  },
+  methods:{
+    onShow () {
+      this.listData()
+      this.dialogTableVisible = true
+    },
+    listData () {
+      this.$store.dispatch('optiontypeselect','userlistunused')
+    },
+    bindAccount (scope) {
+      this.data.birthday = ''
+      this.form = Object.assign({},this.form,this.data)
+      this.form.userid = scope.data.userid
+      this.onSave()
+    },
+    async onSave () {
+      const res = await this.$api.requested({
+        "classname": "webmanage.hr.hr",
+        "method": "insertormodify_hr",
+        "content": this.form
+      })
+      if (res.code === 0)  return this.$notify({
+          title: '失败',
+          message: res.data,
+          type: 'error'
+        });
+
+        this.$notify({
+          title: '成功',
+          message: '绑定成功',
+          type: 'success'
+        });
+
+        this.dialogTableVisible = false
+        this.$emit('onSuccess')
+    },
+  },
+  mounted () {
+    this.tablecols = this.tool.tabelCol(this.$route.name)['unBindtACTable'].tablecols
+  }
+}
+
+</script>
+<style>
+</style>