Explorar o código

修改标段授权

zhaoke %!s(int64=2) %!d(string=hai) anos
pai
achega
fdaef778f0

+ 25 - 56
src/components/CheckCardList/index.vue

@@ -14,15 +14,8 @@
         <slot name="header">
           <div class="title">{{ title }}</div>
           <template v-if="withSearch">
-            <el-input
-              v-model="searchText"
-              :placeholder="searchPlaceholder"
-              @keyup.enter.native="searchClickHandler"
-            />
-            <el-button
-              type="primary"
-              @click="searchClickHandler"
-            >搜索</el-button>
+            <el-input v-model="searchText" :placeholder="searchPlaceholder" @keyup.enter.native="searchClickHandler" />
+            <el-button type="primary" @click="searchClickHandler">搜索</el-button>
           </template>
         </slot>
       </div>
@@ -30,28 +23,10 @@
     <div class="main">
       <template v-if="dataList.length">
         <el-scrollbar class="scrollBar">
-          <el-row
-            v-infinite-scroll="load"
-            :infinite-scroll-distance="20"
-            infinite-scroll-disabled="disabled"
-            :gutter="16"
-            class="infinite-scroll"
-          >
-            <el-checkbox-group
-              v-model="checkedKeys"
-              :disabled="checkDisabled"
-              @change="checkChange"
-            >
-              <el-col
-                v-for="(item, index) in dataList"
-                :key="index"
-                :span="span"
-              >
-                <div
-                  class="check-card"
-                  :style="{ height: cardHeight }"
-                  @click.self="cardClickHandler(item[checkId])"
-                >
+          <el-row v-infinite-scroll="load" :infinite-scroll-distance="20" infinite-scroll-disabled="disabled" :gutter="16" class="infinite-scroll">
+            <el-checkbox-group v-model="checkedKeys" :disabled="checkDisabled" @change="checkChange">
+              <el-col v-for="(item, index) in dataList" :key="index" :span="span">
+                <div class="check-card" :style="{ height: cardHeight }" @click.self="cardClickHandler(item[checkId])">
                   <div class="label">{{ item[label] }}</div>
                   <el-checkbox :label="item[checkId]" />
                 </div>
@@ -59,14 +34,8 @@
             </el-checkbox-group>
           </el-row>
           <template v-if="total > 1">
-            <p
-              v-if="loading"
-              class="center"
-            >加载中...</p>
-            <p
-              v-if="noMore"
-              class="center"
-            >没有更多数据了~</p>
+            <p v-if="loading" class="center">加载中...</p>
+            <p v-if="noMore" class="center">没有更多数据了~</p>
           </template>
         </el-scrollbar>
       </template>
@@ -121,7 +90,7 @@ export default {
       default: false
     }
   },
-  data() {
+  data () {
     return {
       keyWords: '',
       searchText: '',
@@ -133,7 +102,7 @@ export default {
     }
   },
   computed: {
-    span() {
+    span () {
       if (Number.isInteger(this.column)) {
         if (this.column > 0 && this.column <= 24) {
           return 24 % this.column ? 24 : 24 / this.column
@@ -144,58 +113,58 @@ export default {
         throw new Error('Only integer!')
       }
     },
-    noMore() {
+    noMore () {
       return this.pageNum >= this.total
     },
-    disabled() {
+    disabled () {
       return this.loading || this.noMore
     }
   },
   watch: {
-    searchText(val) {
+    searchText (val) {
       if (val.length === 0) {
         this.clearFliter()
       }
     }
   },
-  mounted() {
+  mounted () {
     this.fetchData()
   },
   methods: {
-    fetchData() {
+    fetchData () {
       this.$emit('load', this.keyWords, this.pageSize, this.pageNum)
     },
-    searchClickHandler() {
+    searchClickHandler () {
       if (this.searchText.length > 0) {
         this.keyWords = this.searchText
         this.pageNum = 1
         this.fetchData()
       }
     },
-    clearFliter() {
+    clearFliter () {
       this.keyWords = ''
       this.pageNum = 1
       this.fetchData()
     },
-    load() {
+    load () {
       this.pageNum += 1
       this.fetchData()
     },
-    cardClickHandler(id) {
+    cardClickHandler (id) {
       console.log(id)
     },
-    checkChange(arr) {
+    checkChange (arr) {
       this.$emit('check-change', arr)
     },
     // 父组件请求完成后调用此方法设置total值
-    setTotal(total) {
+    setTotal (total) {
       this.total = total
     },
-    setLoading(loading) {
+    setLoading (loading) {
       this.loading = loading
     },
     // 设置勾选
-    setCheckedKeys(keys) {
+    setCheckedKeys (keys) {
       this.checkedKeys = keys
     }
   }
@@ -215,7 +184,7 @@ export default {
       flex: 1;
       height: 24px;
       font-size: 24px;
-      font-family: 'Microsoft YaHei';
+      font-family: "Microsoft YaHei";
       font-weight: bold;
       color: #303133;
     }
@@ -256,7 +225,7 @@ export default {
         align-items: flex-start;
         .label {
           font-size: 16px;
-          font-family: 'Microsoft YaHei';
+          font-family: "Microsoft YaHei";
           color: #303133;
         }
         .el-checkbox {

+ 20 - 68
src/views/lotAuthorization/components/home.vue

@@ -1,81 +1,33 @@
 <template>
   <div class="lot-authorization-wrap">
     <div class="lot-authorization-header">
-      <el-button
-        type="primary"
-        @click="btnSaveHandler"
-      >保存</el-button>
+      <el-button type="primary" @click="btnSaveHandler">保存</el-button>
     </div>
-    <el-row
-      class="lot-authorization-body"
-      :gutter="24"
-    >
-      <el-col :span="6">
+    <el-row class="lot-authorization-body" :gutter="24">
+      <el-col :span="18">
         <div class="body-card">
-          <CheckCardList
-            ref="userList"
-            title="用户列表"
-            label="OfficerName"
-            check-id="OfficerId"
-            search-placeholder="请输入用户名称"
-            :data-list="userList"
-            @load="loadUserList"
-            @check-change="userCheckChangeHandler"
-          />
+          <CheckCardList ref="userList" title="用户列表" label="OfficerName" :column="6" check-id="OfficerId" search-placeholder="请输入用户名称" :data-list="userList" @load="loadUserList" @check-change="userCheckChangeHandler" />
         </div>
       </el-col>
-      <el-col :span="6">
+      <!-- <el-col :span="6">
         <div class="body-card">
-          <MultipleTree
-            ref="sectionTree"
-            :default-props="{
+          <MultipleTree ref="sectionTree" :default-props="{
               children: 'children',
               label: 'SessionName'
-            }"
-            :data="sectionTree"
-            :checked-keys-duo="sectionCheckedKeys"
-            :org-list="sectionList"
-            :default-multiple="true"
-            node-key="SessionId"
-            up-node-key="UpSessionId"
-            title="选择标段"
-            @getTreeDataDuo="sectionCheckChangeHandler"
-          />
+            }" :data="sectionTree" :checked-keys-duo="sectionCheckedKeys" :org-list="sectionList" :default-multiple="true" node-key="SessionId" up-node-key="UpSessionId" title="选择标段" @getTreeDataDuo="sectionCheckChangeHandler" />
         </div>
       </el-col>
       <el-col :span="6">
         <div class="body-card">
-          <CheckCardList
-            ref="regulatorList"
-            title="监管单位"
-            label="OrganName"
-            check-id="OrganId"
-            :with-search="false"
-            search-placeholder="请输入单位名称"
-            :data-list="regulatorList"
-            :check-disabled="regulatorCheckDisabled"
-            @load="loadRegulatorList"
-            @check-change="regulatorCheckChangeHandler"
-          />
+          <CheckCardList ref="regulatorList" title="监管单位" label="OrganName" check-id="OrganId" :with-search="false" search-placeholder="请输入单位名称" :data-list="regulatorList" :check-disabled="regulatorCheckDisabled" @load="loadRegulatorList" @check-change="regulatorCheckChangeHandler" />
         </div>
-      </el-col>
+      </el-col> -->
       <el-col :span="6">
         <div class="body-card">
-          <MultipleTree
-            ref="organizationTree"
-            :default-props="{
+          <MultipleTree ref="organizationTree" :default-props="{
               children: 'children',
               label: 'OrganName'
-            }"
-            :data="orgTree"
-            :checked-keys-duo="orgCheckedKeys"
-            :org-list="orgList"
-            :default-multiple="true"
-            node-key="OrganId"
-            up-node-key="OrganUpid"
-            title="选择组织"
-            @getTreeDataDuo="orgCheckChangeHandler"
-          />
+            }" :data="orgTree" :checked-keys-duo="orgCheckedKeys" :org-list="orgList" :default-multiple="true" node-key="OrganId" up-node-key="OrganUpid" title="选择组织" @getTreeDataDuo="orgCheckChangeHandler" />
         </div>
       </el-col>
     </el-row>
@@ -95,23 +47,23 @@ import { translateDataToTreeAll } from '@/utils/validate'
 export default {
   components: { CheckCardList, MultipleTree },
   mixins: [userList, sectionTree, regulatorList, orgTree],
-  data() {
+  data () {
     return {
       regulatorCheckDisabled: false
     }
   },
   watch: {
-    checkedSections(arr) {
+    checkedSections (arr) {
       this.hasChecked('section', !!arr.length)
     },
-    checkedRegulators(arr) {
+    checkedRegulators (arr) {
       this.hasChecked('regulator', !!arr.length)
     },
-    checkedOrgs(arr) {
+    checkedOrgs (arr) {
       this.hasChecked('org', !!arr.length)
     },
     sectionList: {
-      handler(arr) {
+      handler (arr) {
         const obj = {
           SessionId: -1,
           SessionName: '标段',
@@ -124,7 +76,7 @@ export default {
       deep: true
     },
     orgList: {
-      handler(arr) {
+      handler (arr) {
         const obj = {
           AuthCount: 0,
           JobCount: 0,
@@ -143,7 +95,7 @@ export default {
     }
   },
   methods: {
-    hasChecked(type, checked) {
+    hasChecked (type, checked) {
       switch (type) {
         case 'section':
           this.regulatorCheckDisabled = checked
@@ -173,7 +125,7 @@ export default {
           break
       }
     },
-    btnSaveHandler() {
+    btnSaveHandler () {
       if (this.checkedUsers.length === 0) {
         this.$message.error('请选择用户')
         return
@@ -237,7 +189,7 @@ export default {
       // console.log(mixedDatas)
       this.saveSection(mixedDatas)
     },
-    async saveSection(params) {
+    async saveSection (params) {
       try {
         const res = await SaveSection(params)
         if (res.code === 0) {