zhengnaiwen_citu 5 mēneši atpakaļ
vecāks
revīzija
cc38015b47

+ 37 - 30
src/views/humanResources/organizationStructure/index.vue

@@ -29,14 +29,14 @@ import OrganizationAdd from './organizationAdd.vue'
 import {
   getOrganizationAndEmployeeTree,
   // getOrganizationAtlasEmployee,
-  importOrganization,
+  // importOrganization,
   exportOrganization,
-  downloadOrganization,
+  // downloadOrganization,
   deleteOrganization
 } from '@/api/system'
 import { mapGetters } from 'vuex'
 import {
-  upload,
+  // upload,
   download
 } from '@/utils/elementUploadAndDownload'
 export default {
@@ -53,7 +53,6 @@ export default {
         { label: '删除', prop: 'delete' }
       ],
       nodes: null,
-      loading: false,
       importLoading: false,
       exportLoading: false,
       downloadLoading: false,
@@ -103,10 +102,8 @@ export default {
   mounted () {
     this.$nextTick(async () => {
       this.graph = this.$refs.eCharts.onInit()
-      this.graph.showLoading()
       this.seriesData = await this.onInit()
       this.graph.setOption(this.option)
-      this.graph.hideLoading()
       this.graph.on('click', (params) => {
         const data = getData(params.data.id, this.seriesData)
         if (params.event.target.type === 'tspan') {
@@ -130,6 +127,14 @@ export default {
       this.graph.on('treeroam', (event) => {
         this.contextMenuShow = false
       })
+      this.graph.on('contextmenu', (params) => {
+        params.event.event.preventDefault()
+        if (params.event.target.type === 'tspan') {
+          const data = getData(params.data.id, this.seriesData)
+          this.nodes = data
+          this.onGraphHandles(params.event.event)
+        }
+      })
     })
 
     function getData (id, data) {
@@ -156,7 +161,7 @@ export default {
   },
   methods: {
     async onInit () {
-      this.loading = true
+      this.graph.showLoading()
       try {
         const { data } = await getOrganizationAndEmployeeTree({})
         return changeChildToChildren(data)
@@ -172,7 +177,7 @@ export default {
         this.$message.error(error)
         return {}
       } finally {
-        this.loading = false
+        this.graph.hideLoading()
       }
     },
     onGraphHandles (e) {
@@ -196,17 +201,21 @@ export default {
       this.$confirm('是否删除该项', '提示').then(async () => {
         try {
           await deleteOrganization({
-            organizationNo: nodes.id
+            organizationNo: nodes.id,
+            organizationName: nodes.name
           })
           this.$message.success('删除成功')
-          const data = await this.initData()
-          this.drawGraph(data)
+          this.onRefresh()
         } catch (error) {
           this.$message.error(error)
         }
       }).catch(_ => {})
     },
-    onRefresh () {},
+    // 重新渲染
+    async onRefresh () {
+      this.seriesData = await this.onInit()
+      this.graph.setOption(this.option)
+    },
     onMenuClick (prop) {
       if (prop === 'edit') {
         this.editTag(this.nodes)
@@ -215,20 +224,8 @@ export default {
         this.onDelete(this.nodes)
       }
     },
-    async onImport (response) {
-      this.importLoading = true
-      const check = await upload(importOrganization, response.file)
-      if (check) {
-        const graphData = await this.onInit()
-        await this.renderGraph(graphData)
-        this.onSetClose(graphData.nodes)
-      }
-      this.importLoading = false
-    },
     async editTag (nodes) {
-      this.loading = true
-      await this.$refs.organizationEditRefs.open(nodes)
-      this.loading = false
+      this.$refs.organizationEditRefs.open(nodes)
     },
     onAdd () {
       this.$refs.organizationAddRefs.open()
@@ -237,12 +234,22 @@ export default {
       this.exportLoading = true
       await download(exportOrganization)
       this.exportLoading = false
-    },
-    async onDownload () {
-      this.downloadLoading = true
-      await download(downloadOrganization)
-      this.downloadLoading = false
     }
+    // async onImport (response) {
+    //   this.importLoading = true
+    //   const check = await upload(importOrganization, response.file)
+    //   if (check) {
+    //     const graphData = await this.onInit()
+    //     await this.renderGraph(graphData)
+    //     this.onSetClose(graphData.nodes)
+    //   }
+    //   this.importLoading = false
+    // },
+    // async onDownload () {
+    //   this.downloadLoading = true
+    //   await download(downloadOrganization)
+    //   this.downloadLoading = false
+    // }
   }
 }
 </script>

+ 6 - 2
src/views/humanResources/organizationStructure/organizationEdit.vue

@@ -4,7 +4,7 @@
     :visible.sync="drawer"
     direction="rtl"
   >
-  <div class="px-3">
+  <div class="px-3" v-loading="loading">
     <el-tabs v-model="activeName">
       <el-tab-pane
         v-for="tab in tabs"
@@ -39,12 +39,14 @@ export default {
         { label: '标注管理', name: 'Label', path: organizationEditLabel }
       ],
       drawer: false,
-      item: {}
+      item: {},
+      loading: false
     }
   },
   methods: {
     async open (nodes) {
       try {
+        this.loading = true
         const { data } = await getOrganizationDetails({
           organizationNo: nodes.id
         })
@@ -57,6 +59,8 @@ export default {
         this.drawer = true
       } catch (error) {
         this.$message.error(error)
+      } finally {
+        this.loading = false
       }
     },
     onSuccess () {

+ 46 - 45
src/views/system/workflow/workflowApproved.vue

@@ -1,46 +1,49 @@
 <template>
   <m-dialog title="审批配置" ref="dialog" @sure="onSure">
-    <el-form ref="form" inline :model="formValues" label-width="70px" >
+    <el-form label-width="70px" >
       <el-form-item label="工作流">
         <el-tag>{{ item.workFlowTmplate?.name }}</el-tag>
       </el-form-item>
       <el-form-item label="工作流">
         <m-card shadow="never">
-          <m-card
-            v-for="(item, index) in formValues.items"
-            :key="item.key"
-            class="mb-5 cardBox"
-          >
-            <el-form-item label="处理对象" :prop="`items.${index}.handleType`">
-              <el-select v-model="item.handleType" placeholder="请选择处理对象" @change="onChange(item)">
-                <el-option label="指定人" value="0"></el-option>
-                <el-option label="指定部室岗位" value="1"></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="处理方" :prop="`items.${index}.handleValue`" :rules="{ required: true, message: '请选择处理方', trigger: 'change' }">
-              <el-cascader
-                v-model="item.handleValue"
-                :ref="`cascader_${index}`"
-                placeholder="请选择处理方"
-                :show-all-levels="false"
-                :options="options[item.handleType]"
-                :props="{
-                  emitPath: false,
-                  value: 'id',
-                  label: 'title',
-                  children: 'child'
-                }"
-                @change="onChangeCascader(item, `cascader_${index}`)"
-              ></el-cascader>
-            </el-form-item>
-            <div class="button-group">
-              <m-button :disabled="index === 0" icon="el-icon-top" circle size="mini" @click="onUp(index)"></m-button>
-              <m-button :disabled="index === formValues.items.length - 1" icon="el-icon-bottom" circle size="mini" @click="onDown(index)"></m-button>
-              <m-button type="danger" icon="el-icon-delete" circle size="mini" @click="onDelete(index)"></m-button>
-            </div>
-          </m-card>
+          <el-form ref="form" inline :model="formValues">
+            <m-card
+              v-for="(item, index) in formValues.items"
+              :key="item.key"
+              class="mb-5 cardBox"
+            >
+              <el-form-item label="处理对象" :prop="`items.${index}.handleType`">
+                <el-select v-model="item.handleType" placeholder="请选择处理对象" @change="onChange(item)">
+                  <el-option label="指定人" value="0"></el-option>
+                  <el-option label="指定部室岗位" value="1"></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="处理方" :prop="`items.${index}.handleValue`" :rules="{ required: true, message: '请选择处理方', trigger: 'change' }">
+                <el-cascader
+                  v-model="item.handleValue"
+                  :ref="`cascader_${index}`"
+                  placeholder="请选择处理方"
+                  :show-all-levels="false"
+                  filterable
+                  :options="options[item.handleType]"
+                  :props="{
+                    emitPath: false,
+                    value: 'id',
+                    label: 'title',
+                    children: 'child'
+                  }"
+                  @change="onChangeCascader(item, `cascader_${index}`)"
+                ></el-cascader>
+              </el-form-item>
+              <div class="button-group">
+                <m-button :disabled="index === 0" icon="el-icon-top" circle size="mini" @click="onUp(index)"></m-button>
+                <m-button :disabled="index === formValues.items.length - 1" icon="el-icon-bottom" circle size="mini" @click="onDown(index)"></m-button>
+                <m-button type="danger" icon="el-icon-delete" circle size="mini" @click="onDelete(index)"></m-button>
+              </div>
+            </m-card>
+          </el-form>
           <div class="text-center">
-            <el-button type="orange" @click="onAdd" icon="el-icon-plus">新增一条记录</el-button>
+            <el-button type="orange" @click="onAdd" size="small" icon="el-icon-plus">新增一条记录</el-button>
           </div>
         </m-card>
       </el-form-item>
@@ -90,16 +93,14 @@ export default {
       this.item = item
       this.$refs.dialog.open()
       this.loading = true
-      if (item.workFlowTmplateItems.length > 0) {
-        this.formValues.items = item.workFlowTmplateItems.map((e, index) => {
-          return {
-            handleType: e.handleType,
-            handleValue: e.handleType === '0' ? e.handleValue.userId : e.handleValue.postName,
-            handleValueData: e.handleValue, // 回显
-            key: index
-          }
-        })
-      }
+      this.formValues.items = item.workFlowTmplateItems.map((e, index) => {
+        return {
+          handleType: e.handleType,
+          handleValue: e.handleType === '0' ? e.handleValue.userId : e.handleValue.postName,
+          handleValueData: e.handleValue, // 回显
+          key: index
+        }
+      })
       this.key = item.workFlowTmplateItems.length + 1
       try {
         const { data: person } = await getOrganizationAtlasAll({ type: 0 })

+ 14 - 14
src/views/system/workflow/workflowEdit.vue

@@ -16,7 +16,7 @@ export default {
       item: null,
       funItems: [],
       formValues: {
-        name: null,
+        // name: null,
         funUrl: null,
         status: 0
       }
@@ -25,17 +25,17 @@ export default {
   computed: {
     formItems () {
       return [
-        {
-          label: '工作流名称',
-          prop: 'name',
-          type: 'input',
-          rules: [
-            { required: true, message: '请输入工作流名称', trigger: 'blur' }
-          ],
-          options: {
-            placeholder: '请输入工作流名称'
-          }
-        },
+        // {
+        //   label: '工作流名称',
+        //   prop: 'name',
+        //   type: 'input',
+        //   rules: [
+        //     { required: true, message: '请输入工作流名称', trigger: 'blur' }
+        //   ],
+        //   options: {
+        //     placeholder: '请输入工作流名称'
+        //   }
+        // },
         {
           label: '功能地址',
           prop: 'funUrl',
@@ -68,7 +68,7 @@ export default {
       if (!item) {
         this.item = null
         this.formValues = {
-          name: null,
+          // name: null,
           funUrl: null,
           status: 0
         }
@@ -79,7 +79,7 @@ export default {
           workFlowTmplateItems
         }
         this.formValues = {
-          name: this.item.name,
+          // name: this.item.name,
           funUrl: this.item.funUrl,
           status: this.item.status
         }

+ 1 - 1
src/views/workOrder/approval/index.vue

@@ -2,7 +2,7 @@
   <div>
     <IndexPage ref="indexPageRefs" :dataType="3">
       <template #actions="{ row }">
-        <m-button  type="primary" class="mr-2" text @click="onApproval(row.workFlowInstanceId)">通过审核</m-button>
+        <m-button  type="primary" text @click="onApproval(row.workFlowInstanceId)">通过审核</m-button>
         <m-button type="danger" text @click="onApprovalReject(row)">拒绝通过</m-button>
       </template>
     </IndexPage>

+ 49 - 3
src/views/workOrder/components/ApprovalDetails.vue

@@ -1,12 +1,58 @@
 <template>
-  <div>
+  <m-dialog ref="dialog" title="申请单">
+    <el-form label-width="120px">
+      <el-form-item label="审批功能名称">
+        <el-tag type="default">{{ itemData.title }}</el-tag>
+      </el-form-item>
+      <el-form-item label="申请明细">
+        <el-descriptions :column="1" border v-loading="loading">
+          <el-descriptions-item
+            v-for="item in headers"
+            :key="item.column"
+            labelStyle="width: 300px"
+          >
+            <template slot="label">
+              {{ item.title }}
+            </template>
+            {{ items[item.column] }}
+          </el-descriptions-item>
+        </el-descriptions>
+      </el-form-item>
+    </el-form>
 
-  </div>
+  </m-dialog>
 </template>
 
 <script>
+import {
+  getApprovalApply
+} from '@/api/approval'
 export default {
-  name: 'ApprovalDetails'
+  name: 'ApprovalDetails',
+  data () {
+    return {
+      headers: [],
+      items: [],
+      itemData: {},
+      loading: false
+    }
+  },
+  methods: {
+    async open (item) {
+      this.itemData = item
+      this.$refs.dialog.open()
+      this.loading = true
+      try {
+        const { data } = await getApprovalApply({ workFlowInstanceId: item.workFlowInstanceId })
+        this.headers = data.columns
+        this.items = data.data
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    }
+  }
 }
 </script>
 

+ 15 - 4
src/views/workOrder/components/ApprovalProgress.vue

@@ -1,6 +1,6 @@
 <template>
   <m-dialog ref="dialog" title="审批明细">
-    <el-steps align-center finish-status="success">
+    <el-steps align-center finish-status="success" v-loading="loading">
       <el-step
         v-for="(item) in items"
         :key="item.id"
@@ -17,19 +17,30 @@
 </template>
 
 <script>
+import {
+  getApprovalProgress
+} from '@/api/approval'
 export default {
   name: 'approvalProgress',
   data () {
     return {
+      loading: false,
       items: [],
       statusMap: ['wait', 'success', 'error']
     }
   },
   methods: {
-    open (item) {
-      console.log(item)
-      this.items = item
+    async open (workFlowInstanceId) {
       this.$refs.dialog.open()
+      this.loading = true
+      try {
+        const { data } = await getApprovalProgress({ workFlowInstanceId })
+        this.items = data
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
     }
   }
 }

+ 6 - 18
src/views/workOrder/components/IndexPage.vue

@@ -15,7 +15,7 @@
       </template>
       <template #actions="{ row }">
         <m-button type="primary" text @click="onProcess(row)">审批进度</m-button>
-        <m-button type="primary" text @click="onDetails(row)">申请明细</m-button>
+        <m-button type="primary" text @click="onDetails(row)">申请</m-button>
         <slot name="actions" :row="row"></slot>
       </template>
     </m-table>
@@ -26,9 +26,7 @@
 
 <script>
 import {
-  getApprovalList,
-  getApprovalProgress,
-  getApprovalApply
+  getApprovalList
 } from '@/api/approval'
 import ApprovalProgress from './ApprovalProgress'
 import ApprovalDetails from './ApprovalDetails'
@@ -109,21 +107,11 @@ export default {
         this.loading = false
       }
     },
-    async onProcess ({ workFlowInstanceId }) {
-      try {
-        const { data } = await getApprovalProgress({ workFlowInstanceId })
-        this.$refs.approvalProgressRefs.open(data)
-      } catch (error) {
-        this.$message.error(error)
-      }
+    onProcess ({ workFlowInstanceId }) {
+      this.$refs.approvalProgressRefs.open(workFlowInstanceId)
     },
-    async onDetails ({ workFlowInstanceId }) {
-      try {
-        const { data } = await getApprovalApply({ workFlowInstanceId })
-        console.log(data)
-      } catch (error) {
-        this.$message.error(error)
-      }
+    async onDetails (item) {
+      this.$refs.approvalDetailsRefs.open(item)
     },
     onSearch () {
       this.pageInfo.current = 1