zhengnaiwen_citu 5 months ago
parent
commit
b92c0d3550

+ 1 - 1
src/api/approval.js

@@ -12,5 +12,5 @@ export function setApproval (data) {
 
 // 进度明细
 export function getApprovalProgress (data) {
-  return http.post('/work/flow/instance/detail', data)
+  return http.post('/work/flow/instance/process', data)
 }

+ 4 - 0
src/utils/request.js

@@ -80,6 +80,10 @@ service.interceptors.response.use(
     if (res.code === 60902) {
       return Promise.reject(res)
     }
+    if (res.code === 72000) {
+      const str = '已发起工作流,请等待审批'
+      return Promise.reject(str)
+    }
     if (res.code !== 20000) {
       if (res.data && Object.keys(res.data).length) {
         return Promise.reject(res)

+ 15 - 5
src/views/approval/approvalProgress.vue

@@ -1,10 +1,13 @@
 <template>
   <m-dialog ref="dialog" title="审批明细">
-    <el-steps :active="2" align-center>
-      <el-step title="步骤1" description="这是一段很长很长很长的描述性文字"></el-step>
-      <el-step title="步骤2" description="这是一段很长很长很长的描述性文字"></el-step>
-      <el-step title="步骤3" description="这是一段很长很长很长的描述性文字"></el-step>
-      <el-step title="步骤4" description="这是一段很长很长很长的描述性文字"></el-step>
+    <el-steps align-center finish-status="success">
+      <el-step
+        v-for="(item) in items"
+        :key="item.id"
+        :title="item.title"
+        :description="item.date"
+        :status="statusMap[item.status]"
+      ></el-step>
     </el-steps>
   </m-dialog>
 </template>
@@ -12,9 +15,16 @@
 <script>
 export default {
   name: 'approvalProgress',
+  data () {
+    return {
+      items: [],
+      statusMap: ['wait', 'success', 'error']
+    }
+  },
   methods: {
     open (item) {
       console.log(item)
+      this.items = item
       this.$refs.dialog.open()
     }
   }

+ 13 - 9
src/views/approval/index.vue

@@ -10,12 +10,12 @@
       :total="total"
       @page-change="onPageChange"
     >
-      <template #status="{ row }">
-        <el-tag size="small" :type="statusList[row.status].color">{{ statusList[row.status].text }}</el-tag>
+      <template #opType="{ row }">
+        <el-tag size="small" :type="statusList[row.opType].color">{{ statusList[row.opType].text }}</el-tag>
       </template>
       <template #actions="{ row }">
         <m-button type="primary" text @click="onDetails(row)">审批进度</m-button>
-        <!-- <m-button type="danger" text @click="onDelete(row)">删除</m-button> -->
+        <m-button v-if="row.opType === 1" type="primary" text @click="onApproval(row)">审批</m-button>
       </template>
     </m-table>
     <ApprovalProgress ref="approvalProgressRefs"></ApprovalProgress>
@@ -36,10 +36,9 @@ export default {
   data () {
     return {
       statusList: [
-        { text: '开始 ', color: 'default' },
-        { text: '审批通过 ', color: 'success' },
-        { text: '审批拒绝 ', color: 'danger' },
-        { text: '异常结束 ', color: 'warning' }
+        { text: '我发起的 ', color: 'default' },
+        { text: '待我审批 ', color: 'warning' },
+        { text: '我已审批 ', color: 'success' }
       ],
       searchItems: [
         {
@@ -57,7 +56,8 @@ export default {
       headers: [
         { label: '名称', prop: 'title' },
         { label: '发起人', prop: 'createUserName' },
-        { label: '状态', prop: 'status', align: 'center' },
+        { label: '状态', prop: 'opType', align: 'center' },
+        { label: '发起时间', prop: 'createDate' },
         { label: '版本号', prop: 'version' },
         { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
       ],
@@ -79,7 +79,10 @@ export default {
       try {
         const { data } = await getApprovalList({
           page: {
-            ...this.pageInfo
+            ...this.pageInfo,
+            orders: [
+              { column: 'create_date', asc: false }
+            ]
           },
           entity: {
             ...this.searchValues
@@ -101,6 +104,7 @@ export default {
         this.$message.error(error)
       }
     },
+    onApproval () {},
     onSearch () {
       this.pageInfo.current = 1
       this.onInit()

+ 27 - 3
src/views/salary/solution/salarySolution/salarySolutionEdit.vue

@@ -9,6 +9,7 @@ import {
   saveSolution,
   getSolutionDetails
 } from '@/api/salary'
+import { mapGetters } from 'vuex'
 export default {
   name: 'salary-solution-edit',
   data () {
@@ -18,7 +19,13 @@ export default {
         title: null,
         tag: null
       },
-      items: [
+      itemData: {}
+    }
+  },
+  computed: {
+    ...mapGetters(['organizationTree']),
+    items () {
+      return [
         {
           label: '方案名称',
           prop: 'title',
@@ -37,9 +44,26 @@ export default {
           options: {
             placeholder: '请输入方案描述'
           }
+        },
+        {
+          label: '绩效机构',
+          prop: 'organizationNo',
+          type: 'cascader',
+          options: {
+            clearable: true,
+            placeholder: '请选择机构',
+            options: this.organizationTree,
+            showAllLevels: false,
+            props: {
+              checkStrictly: true,
+              // emitPath: false,
+              value: 'organizationNo',
+              label: 'organizationName',
+              children: 'child'
+            }
+          }
         }
-      ],
-      itemData: {}
+      ]
     }
   },
   methods: {