zcy 4 rokov pred
rodič
commit
eb9bc787b8

+ 8 - 40
src/components/leftTree/index.vue

@@ -17,14 +17,13 @@
         <template>
           <a-tree
             :selected-keys="selectedKeys"
-            :checked-keys="checkedKeys"
-            :tree-data="departTree"
+            :tree-data="treeData"
             :check-strictly="checkStrictly"
             :expanded-keys="iExpandedKeys"
             :auto-expand-parent="autoExpandParent"
             @select="onSelect"
-            @check="onCheck"
             @expand="onExpand"
+            :replaceFields="{children:'children', title:'label', key:'id', value: 'id' }"
           />
         </template>
       </a-col>
@@ -43,27 +42,21 @@ export default {
       iExpandedKeys: [],
       loading: false,
       autoExpandParent: true,
-      currFlowId: '',
-      currFlowName: '',
       treeData: [],
-      departTree: [],
       hiding: true,
-      checkedKeys: [],
       selectedKeys: ['1'],
       currSelected: {},
       allTreeKeys: [],
       checkStrictly: true,
       url: {
-        tree: '/system/sjConfigProcess/queryTreeList'
+        tree: '/system/dept/treeSelect'
       },
       orgCategoryDisabled: false
     }
   },
   computed: {},
   created() {
-    this.currFlowId = this.$route.params.id
-    this.currFlowName = this.$route.params.name
-    // this.loadTree()
+    this.loadTree()
   },
   methods: {
     loadData() {
@@ -72,18 +65,15 @@ export default {
     loadTree() {
       var that = this
       that.treeData = []
-      that.departTree = []
       getAction(this.url.tree).then((res) => {
-        if (res.success) {
+        if (res.code === 200) {
           // 部门全选后,再添加部门,选中数量增多
           this.allTreeKeys = []
-          for (let i = 0; i < res.result.length; i++) {
-            const temp = res.result[i]
+          for (let i = 0; i < res.data.length; i++) {
+            const temp = res.data[i]
             that.treeData.push(temp)
-            that.departTree.push(temp)
             that.setThisExpandedKeys(temp)
             that.getAllKeys(temp)
-            // console.log(temp.id)
           }
           this.loading = false
         }
@@ -106,22 +96,6 @@ export default {
       this.iExpandedKeys = expandedKeys
       this.autoExpandParent = false
     },
-    nodeModalOk() {
-      this.loadTree()
-    },
-    nodeModalClose() {
-    },
-    onCheck(checkedKeys, info) {
-      console.log('onCheck', checkedKeys, info)
-      this.hiding = false
-      // ---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
-      if (this.checkStrictly) {
-        this.checkedKeys = checkedKeys.checked
-      } else {
-        this.checkedKeys = checkedKeys
-      }
-      // ---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
-    },
     onSelect(selectedKeys, e) {
       console.log('selected', selectedKeys, e)
       this.hiding = false
@@ -131,15 +105,10 @@ export default {
       this.selectedKeys = [record.key]
       this.$emit('selected', this.currSelected)
     },
-    getCurrSelectedTitle() {
-      return !this.currSelected.title ? '' : this.currSelected.title
-    },
     onClearSelected() {
       this.hiding = true
-      this.checkedKeys = []
       this.currSelected = {}
       this.selectedKeys = []
-      this.$refs.departAuth.departId = ''
     },
     // ---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
     expandAll() {
@@ -149,8 +118,7 @@ export default {
       this.iExpandedKeys = []
     },
     getAllKeys(node) {
-      // console.log('node',node);
-      this.allTreeKeys.push(node.key)
+      this.allTreeKeys.push(node.id)
       if (node.children && node.children.length > 0) {
         for (let a = 0; a < node.children.length; a++) {
           this.getAllKeys(node.children[a])

+ 32 - 56
src/views/sys/dept/CheckAndEditModel.vue

@@ -8,69 +8,29 @@
     @close="close"
   >
     <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :rules="validatorRules" :model="model">
-      <a-form-model-item label="支柱号" prop="zzh">
-        <a-input v-model="model.zzh" />
+      <a-form-model-item label="部门名称" prop="deptName">
+        <a-input v-model="model.deptName" />
       </a-form-model-item>
-      <a-form-model-item label="所属部门" prop="bm">
-      </a-form-model-item>
-      <a-form-model-item label="线别" prop="xb">
-        <j-dict-select-tag
-          v-model="model.xb"
-          dict-code="word_type"
-        />
-      </a-form-model-item>
-      <a-form-model-item label="站场区间" prop="qj">
-        <j-dict-select-tag
-          v-model="model.qj"
-          dict-code="word_type"
-        />
-      </a-form-model-item>
-      <a-form-model-item label="行别" prop="hb">
-        <j-dict-select-tag
-          type="radioButton"
-          v-model="model.hb"
-          dict-code="word_type"
+      <a-form-model-item label="上级部门" prop="parentId">
+        <a-tree-select
+          v-model="model.parentId"
+          tree-default-expand-all
+          style="width: 100%"
+          :tree-data="treeData"
+          :replaceFields="{children:'children', title:'label', key:'id', value: 'id' }"
         />
       </a-form-model-item>
-      <a-form-model-item label="公里标" prop="glb">
-        <a-input v-model="model.glb" />
+      <a-form-model-item label="主管人员" prop="leader">
+        <a-input />
       </a-form-model-item>
-      <a-form-model-item label="支柱类型" prop="zzlx">
-        <j-dict-select-tag
-          v-model="model.zzlx"
-          dict-code="word_type"
-        />
-      </a-form-model-item>
-      <a-form-model-item label="支柱型号" prop="zzxh">
-        <j-dict-select-tag
-          v-model="model.zzxh"
-          dict-code="word_type"
-        />
-      </a-form-model-item>
-      <a-form-model-item label="支柱用途" prop="zzyt">
-        <j-dict-select-tag
-          v-model="model.zzyt"
-          dict-code="word_type"
-        />
-      </a-form-model-item>
-      <a-form-model-item label="材质" prop="cz">
-        <j-dict-select-tag
-          v-model="model.cz"
-          dict-code="word_type"
-        />
-      </a-form-model-item>
-      <a-form-model-item label="直线/曲外/曲内" prop="zxqwqn">
-        <j-dict-select-tag
-          type="radioButton"
-          v-model="model.zxqwqn"
-          dict-code="word_type"
-        />
+      <a-form-model-item label="部门描述">
+        <a-textarea v-model="model.remark" placeholder="请输入" :rows="4" />
       </a-form-model-item>
     </a-form-model>
   </j-modal>
 </template>
 <script>
-import { httpAction } from '@/api/request'
+import { getAction, httpAction } from '@/api/request'
 import JModal from '@/components/JModal'
 export default {
   name: 'CheckAndEditModel',
@@ -79,6 +39,7 @@ export default {
   },
   data() {
     return {
+      treeData: [],
       labelCol: { span: 4 },
       wrapperCol: { span: 19 },
       dataSource: [],
@@ -91,8 +52,9 @@ export default {
         type: [{ required: true, message: '请选择' }]
       },
       url: {
-        add: '/system/dept/add',
-        edit: '/system/dept/update'
+        add: '/system/dept',
+        edit: '/system/dept',
+        tree: '/system/dept/treeSelect'
       }
     }
   },
@@ -102,11 +64,25 @@ export default {
     add() {
       this.model = {}
       this.visible = true
+      this.loadTree()
     },
     edit(record) {
       debugger
       this.model = Object.assign({}, record)
+      if (this.model.parentId === 0) {
+        this.model.parentId = null
+      }
       this.visible = true
+      this.loadTree()
+    },
+    loadTree() {
+      this.treeData = []
+      getAction(this.url.tree).then((res) => {
+        if (res.code === 200) {
+          debugger
+          this.treeData = res.data
+        }
+      })
     },
     close(isSubmit) {
       if (isSubmit) {

+ 4 - 4
src/views/sys/dept/index.vue

@@ -56,7 +56,7 @@
       >
         <template slot="status" slot-scope="text, record">
           <a-switch
-            :checked="record.status==='0'?false:true"
+            :checked="record.status==='1'?false:true"
             checked-children="启用"
             un-checked-children="停用"
             @change="changeStatus({$event,record})"
@@ -97,7 +97,7 @@ export default {
       // 表头
       columns: columns(this),
       url: {
-        list: '/system/dept/list',
+        list: '/system/dept/treeSelect',
         delete: '/system/dept/',
         exportXlsUrl: '/exportXlsUrl',
         importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
@@ -109,8 +109,8 @@ export default {
   methods: {
     changeStatus({ $event, record }) {
       console.log($event, record)
-      record.status = $event ? '1' : '0'
-      httpAction('/system/dept/update', record, 'put').then((res) => {
+      record.status = $event ? '0' : '1'
+      httpAction('/system/dept', record, 'put').then((res) => {
         if (res.code === 200) {
           this.$message.success(res.msg)
         } else {

+ 16 - 21
src/views/sys/dept/indexColumns.js

@@ -2,43 +2,38 @@ function columns(vm) {
   const cols = [
     {
       title: '部门名称',
-      dataIndex: 'deptName',
-      key: 'deptName'
-    },
-    {
-      title: '状态',
-      align: 'center',
-      dataIndex: 'status',
-      scopedSlots: { customRender: 'status' },
-      key: 'status'
-    },
-    {
-      title: '成员数量',
-      align: 'center',
-      dataIndex: 'bm',
-      key: 'bm'
+      dataIndex: 'label',
+      key: 'label'
     },
     {
       title: '部门描述',
       align: 'center',
-      dataIndex: 'hb',
-      key: 'hb'
+      dataIndex: 'remark',
+      key: 'remark'
     },
     {
       title: '更新时间',
       align: 'center',
-      dataIndex: 'zzh',
-      key: 'zzh'
+      dataIndex: 'updateTime',
+      key: 'updateTime'
     },
     {
       title: '排序',
       align: 'center',
-      dataIndex: 'glb',
-      key: 'glb'
+      dataIndex: 'orderNum',
+      key: 'orderNum'
+    },
+    {
+      title: '状态',
+      align: 'center',
+      dataIndex: 'status',
+      scopedSlots: { customRender: 'status' },
+      key: 'status'
     },
     {
       title: '操作',
       dataIndex: 'action',
+      width: 200,
       align: 'center',
       slots: { title: 'actionName' },
       scopedSlots: { customRender: 'action' }

+ 14 - 13
src/views/sys/dict/index.vue

@@ -1,5 +1,18 @@
 <template>
   <el-card style="margin: 15px">
+    <!-- 操作按钮区域 -->
+    <div class="table-operator" style="margin: 5px 0;float: right">
+      <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -16,22 +29,10 @@
         </a-form-item>
       </a-form>
     </div>
-    <!-- 操作按钮区域 -->
-    <div class="table-operator" style="margin: 15px 0">
-      <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
-        </a-menu>
-        <a-button style="margin-left: 8px">
-          批量操作 <a-icon type="down" />
-        </a-button>
-      </a-dropdown>
-    </div>
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+      <div class="ant-alert ant-alert-info" style="margin: 16px 0;">
         <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>

+ 5 - 6
src/views/sys/job/CheckAndEditModel.vue

@@ -8,8 +8,8 @@
     @close="close"
   >
     <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :rules="validatorRules" :model="model">
-      <a-form-model-item label="职务名称" prop="zzh">
-        <a-input v-model="model.zzh" />
+      <a-form-model-item label="职务名称" prop="roleName">
+        <a-input v-model="model.roleName" />
       </a-form-model-item>
       <a-form-model-item label="数据权限" prop="zxqwqn">
         <j-dict-select-tag
@@ -18,9 +18,9 @@
           dict-code="word_type"
         />
       </a-form-model-item>
-      <a-form-model-item label="职务描述" prop="zzh">
+      <a-form-model-item label="职务描述">
         <a-textarea
-          v-model="model.zzh"
+          v-model="model.remark"
           placeholder="Controlled autosize"
           :auto-size="{ minRows: 3, maxRows: 5 }"
         />
@@ -46,8 +46,7 @@ export default {
       isCheck: false,
       model: {},
       validatorRules: {
-        zzh: [{ required: true, message: '请输入' }],
-        zxqwqn: [{ required: true, message: '请选择' }]
+        roleName: [{ required: true, message: '请输入' }]
       },
       url: {
         add: '/business/catenary/bus/zzdzxx/add',

+ 18 - 3
src/views/sys/job/index.vue

@@ -50,7 +50,12 @@
         @change="handleTableChange"
       >
         <template slot="status" slot-scope="text, record">
-          <a-switch v-model="record['status']" checked-children="启用" un-checked-children="停用" @change="changeStatus($event,record)" />
+          <a-switch
+            :checked="record.status==='1'?false:true"
+            checked-children="启用"
+            un-checked-children="停用"
+            @change="changeStatus({$event,record})"
+          />
         </template>
         <span slot="action" slot-scope="text, record">
           <a-button size="small" type="primary" @click="handleEdit(record)">
@@ -91,6 +96,7 @@ import { listMixin } from '@/mixin/listMixin'
 import columns from './indexColumns'
 import CheckAndEditModel from './CheckAndEditModel'
 import rightModel from '@/components/RightModel'
+import {httpAction} from "@/api/request";
 
 export default {
   components: {
@@ -115,8 +121,17 @@ export default {
   created() {
   },
   methods: {
-    changeStatus(val, row) {
-      console.log(val, row.id)
+    changeStatus({ $event, record }) {
+      debugger
+      console.log($event, record)
+      record.status = $event ? '0' : '1'
+      httpAction('/system/role', record, 'put').then((res) => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+        } else {
+          console.log(res)
+        }
+      })
     },
     app(data) {
       this.$refs.rightModal.title = 'app菜单权限'

+ 8 - 7
src/views/sys/job/indexColumns.js

@@ -2,16 +2,10 @@ function columns(vm) {
   const cols = [
     {
       title: '职务名称',
+      align: 'center',
       dataIndex: 'roleName',
       key: 'roleName'
     },
-    {
-      title: '状态',
-      align: 'center',
-      dataIndex: 'status',
-      scopedSlots: { customRender: 'status' },
-      key: 'status'
-    },
     {
       title: '本职务成员数量',
       align: 'center',
@@ -30,6 +24,13 @@ function columns(vm) {
       dataIndex: 'updateTime',
       key: 'updateTime'
     },
+    {
+      title: '状态',
+      align: 'center',
+      dataIndex: 'status',
+      scopedSlots: { customRender: 'status' },
+      key: 'status'
+    },
     {
       title: '操作',
       dataIndex: 'action',

+ 4 - 3
src/views/sys/worker/index.vue

@@ -105,7 +105,7 @@
             </template>
             <template slot="status" slot-scope="text, record">
               <a-switch
-                :checked="record.status==='0'?false:true"
+                :checked="record.status==='1'?false:true"
                 checked-children="启用"
                 un-checked-children="停用"
                 @change="changeStatus({$event,record})"
@@ -187,7 +187,8 @@ export default {
   },
   methods: {
     getTreeData(data) {
-      this.queryParam.cate = data.id
+      debugger
+      this.queryParam.deptId = data.id
       this.loadData()
     },
     rePwd(record) {
@@ -201,7 +202,7 @@ export default {
     },
     changeStatus({ $event, record }) {
       console.log($event, record)
-      record.status = $event ? '1' : '0'
+      record.status = $event ? '0' : '1'
       httpAction('/system/user/changeStatus', record, 'put').then((res) => {
         if (res.code === 200) {
           this.$message.success(res.msg)