瀏覽代碼

1.新增资产业务绩效提成申报审批功能
2.新增VanTable组件

GouGengquan 2 周之前
父節點
當前提交
acbd1b9f8e

+ 16 - 0
src/api/commissonDeclare.js

@@ -0,0 +1,16 @@
+import request from '@/utils/request'
+
+// 获取绩效申报详情
+export function detail(params) {
+    return request.get(`commissionDeclare/${params}`)
+}
+
+// 资产提成申报待审核列表
+export function assetsCheckPage(params) {
+    return request.get(`commissionDeclare/assets/check`, { params: params })
+}
+
+// 更新资产绩效申报提成比例与下限信息
+export function updateAssetsCommissionDeclare(params) {
+    return request.put(`commissionDeclare/assets/check/update`, params)
+}

+ 61 - 0
src/components/VanTable/index.vue

@@ -0,0 +1,61 @@
+<template>
+  <div class="vant-table">
+    <table cellspacing="0" :style="bgcolor" style="width:100%" class="table">
+      <tr>
+        <th class="th" v-for="(item, index) in option.column" :key="index">{{ item.label }}</th>
+      </tr>
+      <tr v-for="(item, index) in tableData" :key="index" class="list-tr">
+        <td v-for="(context, i) in option.column" :key="i">{{ item[context.tableDataprop] }}</td>
+      </tr>
+    </table>
+  </div>
+</template>
+<script>
+export default {
+  name:'TableVant',
+  props:{
+    bgcolor:{
+      type: Object,
+      default: {}
+    },
+    tableData:{
+      type: Array,
+      default: []
+    },
+    option:{
+      type: Object,
+      default: {}
+    }
+  },
+  created() {}
+};
+</script>
+
+<style  scoped>
+
+.vant-table {
+  font-size: 14px;
+  margin: 5px;
+}
+
+.table {
+}
+
+.th {
+  color: #909399;
+  height: 30px;
+  line-height: 30px;
+  background-color: #F7F8FA;
+  text-align: center;
+}
+
+.list-tr {
+  height: 20px;
+  line-height: 20px;
+}
+
+td {
+  text-align: center;
+}
+</style>
+

+ 20 - 0
src/router/index.js

@@ -42,6 +42,10 @@ import LandPlaceOrder from '@/views/land/placeOrder.vue'
 import LandMyOrder from '@/views/land/myOrder.vue'
 import LandPendingOrder from '@/views/land/pendingOrder.vue'
 
+// 提成绩效审批
+import CommissonDeclareIndex from '@/views/commissonDeclare/index.vue'
+import AssetsDeclareDetail from '@/views/commissonDeclare/assets/declareDetail.vue'
+
 const routes = [
   // 重定向到首页的路由
   {
@@ -283,6 +287,22 @@ const routes = [
             },
           },
         ]
+      },
+      // 提成绩效审批
+      {
+        path: 'commissonDeclare',
+        component: CommissonDeclareIndex,
+        name: 'commissonDeclareView',
+        children: [
+          {
+            path: 'assets/declareDetail',
+            component: AssetsDeclareDetail,
+            name: 'assetsDeclareDetail',
+            meta: {
+              title: '资产绩效审批详情'
+            },
+          },
+        ]
       }
     ]
   },

+ 191 - 0
src/views/commissonDeclare/assets/declareDetail.vue

@@ -0,0 +1,191 @@
+<template>
+  <div>
+    <BackBar title="业务提成申报详情-资产" lefttext="返回" />
+    <van-form>
+      <van-cell-group inset>
+        <van-field label="项目名称" v-model="declareForm.name" name="name" type="textarea" readonly placeholder="-" />
+        <van-field label="订单号" v-model="declareForm.orderId" name="orderId" readonly placeholder="-" />
+        <van-field label="报告号" v-model="declareForm.reportNo" name="reportNo" readonly placeholder="-" />
+        <van-field label="业务分类" v-model="declareForm.businessCate" name="businessCate" readonly placeholder="-" />
+        <van-field label="产品类型" v-model="productionType" name="production" readonly placeholder="-" />
+        <van-field
+          label="提成比例"
+          v-model="declareForm.ratio"
+          name="ratio"
+          type="number"
+          :error="true"
+          :readonly="declareForm.declareBusinessType !== 'COMMISSION_DECLARE_ASSET_EVALUATE' || nodeBusinessInfo.nodeCode !== 'DEPARTMENT_LEADER_CHECK' || !couldEdit"
+          placeholder="-"
+          v-if="declareForm.declareBusinessType === 'COMMISSION_DECLARE_ASSET_EVALUATE'"
+        >
+          <template #button>%</template>
+        </van-field>
+        <van-field
+          label="提成下限"
+          v-model="declareForm.definedLowLimitAmount"
+          name="definedLowLimitAmount"
+          type="number"
+          :error="true"
+          :readonly="declareForm.declareBusinessType !== 'COMMISSION_DECLARE_ASSET_EVALUATE' || nodeBusinessInfo.nodeCode !== 'DEPARTMENT_LEADER_CHECK' || !couldEdit"
+          placeholder="-"
+          v-if="declareForm.declareBusinessType === 'COMMISSION_DECLARE_ASSET_EVALUATE'"
+        >
+          <template #button>元</template>
+        </van-field>
+        <van-field label="当前节点" v-model="currentNode.nodeName" name="nodeName" readonly :error="true" placeholder="-" />
+        <van-field label="申报人" v-model="declareForm.declareUser" name="declareUser" readonly placeholder="-" />
+        <van-field label="申报日期" v-model="declareForm.created" name="created" readonly placeholder="-" />
+        <van-field label="审核状态" v-model="declareForm.declareResult" name="declareResult" readonly placeholder="-" />
+        <van-field label="审核备注" v-model="declareForm.remarks" name="remarks" readonly placeholder="-" />
+        <van-field label="我的意见" v-model="commitInfo.comments" name="comments" placeholder="在此填写审核意见" />
+        <div
+          style="margin: 16px;width:120px;float:right"
+          v-if="declareForm.declareBusinessType === 'COMMISSION_DECLARE_ASSET_EVALUATE' && nodeBusinessInfo.nodeCode === 'DEPARTMENT_LEADER_CHECK' && couldEdit"
+        >
+          <van-button round block type="danger" @click="updateCommissionDeclare()" size="small">修改比例与下限</van-button>
+        </div>
+        <VanTable :option="option" :tableData="declareForm.userShareRates"></VanTable>
+      </van-cell-group>
+    </van-form>
+    <div class="button-style" style="float: left">
+      <van-button type="danger" style="width: 100%" @click="commitNode('TERMINATE')">拒绝</van-button>
+    </div>
+    <div class="button-style" style="float: right">
+      <van-button type="success" style="width: 100%" @click="commitNode('PASS')">通过</van-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { showConfirmDialog } from 'vant';
+import { showNotify } from 'vant';
+import { currentNode } from '@/api/workFlowNodeInstance';
+import { commit } from '@/api/workflow';
+import { detail, updateAssetsCommissionDeclare } from '@/api/commissonDeclare';
+import VanTable from '@/components/VanTable/index.vue';
+
+export default {
+  components: { VanTable },
+  computed: {
+    productionType() {
+      if (this.declareForm.production === 'REPORT') {
+        return '评估报告';
+      }
+      if (this.declareForm.production === 'LETTER') {
+        return '意见函';
+      }
+      if (this.declareForm.production === 'CONSULT') {
+        return '咨询报告';
+      }
+    },
+  },
+  data() {
+    return {
+      couldEdit: false,
+      businessId: null,
+      nodeBusinessInfo: {},
+      declareForm: {},
+      users: [],
+      cates: [],
+      currentNode: {},
+      option: {
+        column: [
+          {
+            label: '评估人员',
+            tableDataprop: 'name',
+          },
+          {
+            label: '提成比例(%)',
+            tableDataprop: 'rate',
+          },
+          {
+            label: '参与时长',
+            tableDataprop: 'participationDuration',
+          },
+          {
+            label: '成员类型',
+            tableDataprop: 'memberType',
+          },
+        ],
+      },
+      commitInfo: {}
+    };
+  },
+  created() {
+    this.couldEdit = this.$route.query.couldEdit;
+    this.nodeBusinessInfo.businessId = this.$route.query.businessId;
+    this.nodeBusinessInfo.mainBusiness = this.$route.query.businessType;
+    this.declareForm.declareBusinessType = this.$route.query.businessType;
+    this.getCurrentNode();
+    this.businessId = this.$route.query.businessId;
+    this.getDeclareDetail();
+  },
+  methods: {
+    // 获取审核详情
+    getDeclareDetail() {
+      detail(this.businessId).then((res) => {
+        if (res.code === 200) {
+          this.declareForm = res.data;
+          this.declareForm.remarks = this.declareForm.remarks.map((item) => (item != null ? String(item) : '')).join(', ');
+        }
+      });
+    },
+    // 获取当前节点实例
+    getCurrentNode() {
+      if (this.nodeBusinessInfo.businessId) {
+        currentNode({
+          mainBusiness: this.nodeBusinessInfo.mainBusiness,
+          businessId: this.nodeBusinessInfo.businessId,
+        }).then((res) => {
+          if (res.code === 200 && res.data != null) {
+            this.currentNode = res.data;
+            this.nodeBusinessInfo.currentInstanceNodeId = res.data.instanceId;
+            this.nodeBusinessInfo.nodeCode = res.data.nodeCode;
+            console.log(this.currentNode)
+          }
+        });
+      }
+    },
+    // 更新资产绩效申报提成比例与下限信息
+    updateCommissionDeclare() {
+      let declareDTO = new Object();
+      declareDTO.id = this.businessId;
+      declareDTO.ratio = this.declareForm.ratio;
+      declareDTO.definedLowLimitAmount = this.declareForm.definedLowLimitAmount;
+      declareDTO.recordId = this.currentNode.tasks[0].recordId;
+      updateAssetsCommissionDeclare(declareDTO).then((res) => {
+        if (res.code === 200 && res.data) {
+          showNotify({ type: 'success', message: '提成比例与下限信息更新成功' });
+          this.getDeclareDetail();
+        } else {
+          showNotify({ type: 'success', message: '提成比例与下限信息更新失败, 请稍后重试' });
+        }
+      });
+    },
+    // 提交节点
+    commitNode(state) {
+      showConfirmDialog({
+        title: '提交节点',
+        message: '确认提交流程节点?',
+      }).then(() => {
+        this.commitInfo.instanceNodeId = this.currentNode.instanceId;
+        this.commitInfo.state = state;
+        commit(this.commitInfo).then((res) => {
+          if (res.code === 200 && res.data) {
+            showNotify({ type: 'success', message: '节点提交成功' });
+            history.back();
+          }
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style scoped>
+.button-style {
+  display: inline-block;
+  margin: 20px;
+  width: 100px;
+}
+</style>

+ 29 - 0
src/views/commissonDeclare/index.vue

@@ -0,0 +1,29 @@
+<template>
+  <div class="base">
+    <router-view v-slot="{ Component }">
+      <transition>
+        <component :is="Component" />
+      </transition>
+    </router-view>
+  </div>
+</template>
+
+<script>
+
+export default {
+  data() {
+    return {};
+  },
+  created() {
+  },
+  methods: {
+    
+  },
+};
+</script>
+<style scoped>
+.base {
+  background-color: #F7F8FA; 
+  width: 100%; 
+}
+</style>

+ 63 - 24
src/views/home/todo.vue

@@ -126,31 +126,27 @@
       <van-back-top right="10vw" bottom="10vh" />
     </van-tab>
     <van-tab v-if="assetsAdmin" title="资产提成审批" name="assetsAdmin">
-      <van-search v-model="assetsListQuery.keyWord" placeholder="请输入搜索关键词" @search="onAssetsSearch()" />
-      <van-pull-refresh v-model="loading" @refresh="onAssetsRefresh()">
+      <van-search v-model="assetsListQuery.keyWord" placeholder="请输入搜索关键词" @search="onAssetsDeclSearch()" />
+      <van-pull-refresh v-model="loading" @refresh="onAssetsDeclRefresh()">
         <van-list v-model:loading="loading" :finished="assetsFinished" finished-text="没有待办了" @load="assetsTodoList()">
-          <div class="card" v-for="item in assetsListData" :key="item.id" @click="toAssetsDetail(item)">
+          <div class="card" v-for="item in assetsDeclListData" :key="item.id" @click="toAssetsDeclDetail(item)">
             <div class="businessTitle">
               <van-icon name="link-o" />
-              {{ item.orderId }}
+              {{ item.assetsSimple.orderId }}
             </div>
-            <div class="productionNo" v-if="item.statementNo || item.reportNo">
+            <div class="productionNo">
               <van-icon name="coupon-o" />
-              {{ item.statementNo }}
-              <!-- 产品号都不为空才显示中间的分割空格, 以保持页面间距统一 -->
-              <span v-if="item.statementNo && item.reportNo">&nbsp;&nbsp;</span>
-              {{ item.reportNo }}
+              {{ item.assetsSimple.reportNo }}
             </div>
             <div class="projectName">
               <div>
                 <van-icon name="location-o" />
-                {{ item.reportName || item.statementName || item.name }}
+                {{ item.assetsSimple.orderName}}
               </div>
             </div>
             <div class="otherInfo">
-              <van-tag type="primary" size="medium" class="van-tag">{{ item.currentNodeName }}</van-tag>
-              <van-tag type="success" size="medium" class="van-tag">{{ item.clientManagerName }}</van-tag>
-              <van-tag color="#969799" size="medium" class="van-tag">{{ item.created }}</van-tag>
+              <van-tag type="primary" size="medium" class="van-tag">{{ item.businessCate }}</van-tag>
+              <van-tag type="success" size="medium" class="van-tag">{{ item.nodeName }}</van-tag>
             </div>
           </div>
         </van-list>
@@ -166,6 +162,7 @@ import { getPersonalTodoList } from '@/api/personal';
 import { getMajorTodoList } from '@/api/major';
 import { getAssetsTodoList } from '@/api/assets';
 import { checkHasBusinessHandle } from '@/api/workFlowNodeInstance';
+import { assetsCheckPage } from '@/api/commissonDeclare';
 import { mapStores } from 'pinia';
 import { menuStore } from '@/stores/menuStore';
 
@@ -200,24 +197,32 @@ export default {
         // 查询关键字
         keyWord: null,
       },
+      assetsDeclFinished: false,
+      assetsDeclListQuery: {
+        // 当前页数
+        current: 1,
+        // 项目编号
+        orderId: null,
+      },
+      assetsDeclListData: [],
     };
   },
   computed: {
     ...mapStores(menuStore),
-    majorAdmin(){
-      const adminMeun = this.menuStore.menuInfo.filter(item=>item.name=='行政审批');
-      if (adminMeun.length>0){
-        return adminMeun[0].children.map(item=>item.name).includes("大中型提成申报审核")
+    majorAdmin() {
+      const adminMeun = this.menuStore.menuInfo.filter((item) => item.name == '行政审批');
+      if (adminMeun.length > 0) {
+        return adminMeun[0].children.map((item) => item.name).includes('大中型提成申报审核');
       }
       return false;
     },
-    assetsAdmin(){
-      const adminMeun = this.menuStore.menuInfo.filter(item=>item.name=='行政审批');
-      if (adminMeun.length>0){
-        return adminMeun[0].children.map(item=>item.name).includes("资产提成申报审核")
+    assetsAdmin() {
+      const adminMeun = this.menuStore.menuInfo.filter((item) => item.name == '行政审批');
+      if (adminMeun.length > 0) {
+        return adminMeun[0].children.map((item) => item.name).includes('资产提成申报审核');
       }
       return false;
-    }
+    },
   },
   created() {
     this.personalFinished = false;
@@ -238,6 +243,7 @@ export default {
         case 'majorAdmin':
           break;
         case 'assetsAdmin':
+          this.onAssetsDeclRefresh();
           break;
         default:
           break;
@@ -371,8 +377,8 @@ export default {
         case 'LETTER_IN':
         case 'LETTER_OUT':
         case 'BUSINESS_ARCHIVING':
-        //case 'REPORT_FEEDBACK':
-        //case 'LETTER_FEEDBACK':
+          //case 'REPORT_FEEDBACK':
+          //case 'LETTER_FEEDBACK':
           showDialog({
             message: '当前节点需要业务操作, 请在电脑端处理节点',
           });
@@ -515,6 +521,39 @@ export default {
           break;
       }
     },
+    // 资产提成申报审批列表刷新
+    onAssetsDeclRefresh() {
+      this.assetsDeclListQuery.current = 1;
+      this.assetsDeclFinished = false;
+      this.assetsDeclListData = [];
+      this.getAssetsDecl();
+    },
+    onAssetsDeclSearch() {
+      this.assetsDeclListQuery.current = 1;
+      this.assetsDeclFinished = false;
+      this.assetsDeclListData = [];
+      this.getAssetsDecl();
+    },
+    // 获取资产提成申报审批列表
+    getAssetsDecl() {
+      assetsCheckPage(this.assetsDeclListQuery).then((res) => {
+        if (res.code == 200) {
+          if (res.data.records) {
+            this.assetsDeclListData = this.assetsDeclListData.concat(res.data.records);
+          }
+          if (res.data.pages > this.assetsDeclListQuery.current) {
+            this.assetsDeclListQuery.current++;
+          } else {
+            this.assetsDeclFinished = true;
+          }
+        }
+        this.loading = false;
+      });
+    },
+    // 前往资产申报详情
+    toAssetsDeclDetail(item) {
+      this.$router.push(`/index/commissonDeclare/assets/declareDetail?businessId=${item.businessId}&businessType=${item.businessType}&couldEdit=${true}`);
+    },
   },
 };
 </script>