Jelajahi Sumber

增加了账单和提现记录功能

ljh 2 tahun lalu
induk
melakukan
7d0a720693

+ 7 - 0
src/components/commons/Header2.0.vue

@@ -26,6 +26,13 @@
                     </el-link>
                   </router-link>
                 </el-dropdown-item>
+                <el-dropdown-item>
+                  <router-link :to="{ path:'/bookkeeptest'}">
+                    <el-link icon="el-icon-user" :underline="false">
+                      个人账单
+                    </el-link>
+                  </router-link>
+                </el-dropdown-item>
                 <el-dropdown-item v-if="rolesPermissions.isSystemAdministrator">
                   <router-link :to="{ name: 'AuthenticationManage'}">
                     <el-link icon="el-icon-view" :underline="false">

+ 3 - 0
src/js/api.js

@@ -98,6 +98,9 @@ export default {
   RESOURCE: {
     GET_DETAIL: '/api/common/index/resource/{code}'
   },
+  BOOKLIST: {
+    GET_DETAIL: '/api/bookTest/bookDetail/{id}',
+  },
   EXPERT: {
     GET_DETAIL: '/api/common/index/expert/{id}'
   },

+ 628 - 0
src/pages/BookKeep/BookTest.vue

@@ -0,0 +1,628 @@
+<template>
+  <div class="home-wrapper">
+    <!--    <TopSearch :searchVal="searchVal" :searchType="searchType" :searchTypeArr="searchTypeArr"/>-->
+    <div class="nav" stype="height:500px">
+      <!--搜索框-->
+      <el-row class="search-nav" style="padding: 30px 0 20px 0">
+        <el-col :span="6">
+          <div class="pull-left" @click="gotoHome" style="cursor: pointer">
+            <img class="logo-img" :src="logo_transparent"/>
+            <span class="logo-title">{{ logoTitle }}</span>
+          </div>
+        </el-col>
+        <el-col :span="12">
+          <div class="search-nav">
+            <div id="search-block ">
+              <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
+                <el-tab-pane v-for="item in searchTypeArr" v-if="item.value!=='all'" :label="item.name"
+                             :name="item.value"
+                             :key="item.value"></el-tab-pane>
+              </el-tabs>
+              <div class="search-input">
+                <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
+                  <el-button class="search-button" slot="append" type="primary" @click="handleSearchData">搜索</el-button>
+                </el-input>
+              </div>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="container" style="margin: 20px auto;">
+      <div class="create-body">
+        <div class="title h2" v-if="authType<2" >个人账单台账管理</div>
+        <div class="title h2" v-if="authType===2 || authType ===0" >企业台账管理</div>
+        <el-row>
+          <el-col :span="16">
+            当前用户酬劳总额:{{ summary.sum }},
+            未提现总额:
+            <span
+              :style="getNumerStyle('default',summary.defaultSum)">
+              {{summary.defaultSum}}
+            </span>
+            待审核中总额:
+            <span
+              :style="getNumerStyle('commit',summary.commitSum)">
+                {{ summary.commitSum }}
+            </span>
+            已提现总额:
+            <span
+              :style="getNumerStyle('audit',summary.auditSum)">
+                {{ summary.auditSum }}
+            </span>
+
+          </el-col>
+          <el-col :span="8">
+            <div style="float: right">
+              <div class="btn btn-small btn-info" @click="handleBatchUpdate" v-if="authType<2">批量提现</div>
+              <div class="btn btn-small btn-info" @click="goToBalDetail(user.id)" v-if="authType<2">查看个人提现记录</div>
+              <div class="btn btn-small btn-info" @click="goToBalDetailBycode(user.id)" v-if="authType===2 || authType ===0">查看项目提现记录</div>
+
+            </div>
+          </el-col>
+        </el-row>
+
+        <template style="color: black">
+          <el-table
+            ref="multipleTable"
+            :data="curResourceList"
+            tooltip-effect="dark"
+            style="width: 100%; font-size: 15px; color: black" v-loading="loading"
+            @selection-change="handleSelectionChange">
+            <el-table-column
+              type="selection">
+            </el-table-column>
+            <el-table-column type="expand" align="center" min-width="1%">
+              <template slot-scope="{row, $index}">
+                <el-table
+                  :data="[row]"
+                  border
+                  fit
+                  highlight-current-row
+                  style="width: 100%; "
+                  max-height="500"
+                >
+                  <el-table-column label="独有的致命缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.onlyOneVeryHighDefectCount }}</div>
+                      <div>得分:{{ row.onlyOneVeryHighDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="独有的严重缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.onlyOneHighDefectCount }}</div>
+                      <div>得分:{{ row.onlyOneHighDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="独有的一般缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.onlyOneMidDefectCount }}</div>
+                      <div>得分:{{ row.onlyOneMidDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="独有的轻微缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.onlyOneLowDefectCount }}</div>
+                      <div>得分:{{ row.onlyOneLowDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="独有的建议缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.onlyOneVeryLowDefectCount }}</div>
+                      <div>得分:{{ row.onlyOneVeryLowDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="优质的致命缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.topVeryHighDefectCount }}</div>
+                      <div>得分:{{ row.topVeryHighDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="优质的严重缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.topHighDefectCount }}</div>
+                      <div>得分:{{ row.topHighDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="优质的一般缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.topMidDefectCount }}</div>
+                      <div>得分:{{ row.topMidDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="优质的轻微缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.topLowDefectCount }}</div>
+                      <div>得分:{{ row.topLowDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="优质的建议缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.topVeryLowDefectCount }}</div>
+                      <div>得分:{{ row.topVeryLowDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="补充的致命缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.notTopVeryHighDefectCount }}</div>
+                      <div>得分:{{ row.notTopVeryHighDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="补充的严重缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.notTopHighDefectCount }}</div>
+                      <div>得分:{{ row.notTopHighDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="补充的一般缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.notTopMidDefectCount }}</div>
+                      <div>得分:{{ row.notTopMidDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="补充的轻微缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.notTopLowDefectCount }}</div>
+                      <div>得分:{{ row.notTopLowDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="补充的建议缺陷" prop="code" align="center" min-width="5%">
+                    <template slot-scope="{row}">
+                      <div>数量:{{ row.notTopVeryLowDefectCount }}</div>
+                      <div>得分:{{ row.notTopVeryLowDefectScore }}</div>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="id"
+              align="center"
+              label="序号">
+            </el-table-column>
+<!--            <el-table-column-->
+<!--              prop="cptcode"-->
+<!--              align="left"-->
+<!--              label="项目编号">-->
+<!--            </el-table-column>-->
+            <el-table-column
+              prop="cptname"
+              label="项目名称"
+              min-width="120"
+              align="center">
+            </el-table-column>
+<!--            <el-table-column-->
+<!--              prop="cttcode"-->
+<!--              align="left"-->
+<!--              label="任务编号">-->
+<!--            </el-table-column>-->
+            <el-table-column
+              prop="cttname"
+              align="center"
+              min-width="150"
+              label="任务名称">
+            </el-table-column>
+<!--            <el-table-column-->
+<!--              prop="acceptTime"-->
+<!--              align="left"-->
+<!--              label="接包时间">-->
+<!--            </el-table-column>-->
+<!--            <el-table-column-->
+<!--              prop="submitTime"-->
+<!--              align="left"-->
+<!--              label="提交时间">-->
+<!--            </el-table-column>-->
+<!--            <el-table-column-->
+<!--              prop="price"-->
+<!--              align="left"-->
+<!--              label="酬劳所得">-->
+<!--            </el-table-column>-->
+            <el-table-column
+              prop="effectiveWorkloadAmount"
+              align="center"
+              min-width="120"
+              label="有效工作量金额">
+            </el-table-column>
+            <el-table-column
+              prop="defectExciationAmount"
+              align="center"
+              min-width="120"
+              label="缺陷激励金额">
+            </el-table-column>
+            <el-table-column
+              prop="extraRewardAmount"
+              align="center"
+              min-width="120"
+              label="额外奖励金额">
+            </el-table-column>
+            <el-table-column
+              prop="totalAmount"
+              align="center"
+              label="总金额">
+            </el-table-column>
+            <el-table-column
+              prop="stateName"
+              align="center"
+              label="状态">
+            </el-table-column>
+            <el-table-column
+              align="center"
+              label="操作"
+              width="120px"
+              >
+              <template slot-scope="scope">
+                <div :style="getActionStyle('user')">
+                  <div :style="getActionStyle('enterprise')" class="btn btn-small btn-info" @click="goToDetail(scope.row.id)">详情</div>
+                  <div class="btn btn-small btn-info " @click="updateState(scope)" v-if="authType<2">提现</div>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+        <el-collapse accordion style="margin: 0 30px">
+          <el-pagination
+            v-if="curResourceList&&curResourceList.length"
+            :page-size="10"
+            layout="prev, pager, next"
+            :total="totalElements"
+            :current-page="activePage"
+            @current-change="handlePageChange"
+            class="pull-right"
+          >
+          </el-pagination>
+        </el-collapse>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Http from '@/js/http.js';
+import TopSearch from "../../components/commons/TopSearch";
+import {storageGet} from '@/js/index.js'
+import {notify} from "../../constants";
+import Apis from '@/js/api';
+import {CONFIG} from "../../config";
+
+export default {
+  name: "ResourceList",
+  components: {TopSearch},
+  data() {
+    return {
+      logoTitle: CONFIG.logoTitle,
+      logo_transparent: CONFIG.logo_transparent,
+      user: {},
+      authInfo:{},
+      authType:-1,
+      isLogin: false,
+      loading: false,
+      searchVal: '',
+      curResourceList: [],
+      searchType: 'cptcode',
+      searchTypeArr: [
+        {
+          "name": "全部",
+          "value": "all"
+        },
+        //首先,这个列表就是需要查询的查询,需要查多少个字段就用多少个实体{“name”:“”,value:“”}
+        //这个value不要这么乱七八糟的额,还用什么0和1,传到后台鬼知道是什么啊
+        //一般可以考虑用参数名
+        {
+          "name": "项目名称",
+          "value": "cptcode"
+        },
+        {
+          "name": "任务名称",
+          "value": "cttcode"
+        }],
+      activePage: 1,
+      totalElements: 0,
+      selection: [],
+      summary: {
+        sum: 0,
+        defaultSum: 0,
+        commitSum: 0,
+        auditSum: 0,
+        completeSum: 0,
+      }
+    }
+  },
+  methods: {
+    loadData() {
+      if (storageGet('user') != null) {
+        this.isLogin = true;
+      }
+      this.searchVal = this.$route.params.searchVal;
+      this.handleSearchData();
+    },
+    checkLogin() {
+      this.checkCreateProjectAuth();
+    },
+    checkCreateProjectAuth() {
+      if (!this.isLogin) {
+        // console.log("请登录后访问");
+        notify('warning', '请登录后访问');
+      } else if (this.isLogin) {
+        Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
+          this.$router.push('/project/create');
+        }).catch((error) => {
+          notify('error', error.data)
+        })
+      }
+    },
+    handleSearchData() {
+      console.log(this.authType)
+      if(this.authType<2) {
+        let url = '/api/bookTest/pageList';
+        let params = {
+          "keyword": this.searchVal,
+          // "userid":this.user.userVO.id,
+          "activePage": 1,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": {
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.bookTestPageDTOPage.content;
+          this.totalElements = res.data.bookTestPageDTOPage.totalElements;
+          this.summary = res.data.summary;
+        });
+      }
+      else if(this.authType===2) {
+        let url = '/api/bookTest/projectpageList';
+        let params = {
+          "keyword": this.searchVal,
+          // "userid":this.user.userVO.id,
+          "activePage": 1,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": {
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.bookTestPageDTOPage.content;
+          this.totalElements = res.data.bookTestPageDTOPage.totalElements;
+          this.summary = res.data.summary;
+        });
+      }
+    },
+    nextPage() {
+      if(this.authType<2) {
+        let url = '/api/bookTest/pageList';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": { //这里是下一页的参数
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.bookTestPageDTOPage.content;
+          this.totalElements = res.data.bookTestPageDTOPage.totalElements;
+          this.summary = res.data.summary;
+        })
+      }
+      else if(this.authType===2) {
+        let url = '/api/bookTest/projectpageList';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": { //这里是下一页的参数
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.bookTestPageDTOPage.content;
+          this.totalElements = res.data.bookTestPageDTOPage.totalElements;
+          this.summary = res.data.summary;
+        })
+      }
+    },
+    gotoHome() {
+      this.$router.push('/home');
+    },
+    handleTypeClick(tab) {
+      this.searchType = tab.name
+    },
+    handlePageChange(index) {
+      this.activePage = index;
+      this.nextPage();
+    },
+    goToDetail(id) {
+      this.$router.push({
+        name: 'BookDetail',
+        path: '/book/detail',
+        query: {id: id}
+      })
+    },
+    goToBalDetail(uid) {
+      this.$router.push({
+        name: 'BalanceDetail',
+        path: '/book/baldetail',
+        query: {uid: uid}
+      })
+    },
+    goToBalDetailBycode(rmid) {
+      this.$router.push({
+        name: 'ProjectBalanceDetail',
+        path: '/book/projectbalDetail',
+        query: {rmid: rmid}
+      })
+    },
+    updateState(scope) {
+      const state = scope.row.state;
+      if (state > 0) {
+        notify('warning', '已经提现,请勿重新提现');
+        return;
+      }
+      let url = '/api/bookTest/updateState/{id}';
+      Http.get(url.replaceAll("{id}", scope.row.id + "")).then((res) => {
+        if (res.code == 20000) {
+          notify('success', '提现成功');
+          this.handleSearchData()
+        }
+          // if(scope.state==1){
+          //   notify('error', '已经提现,请勿重新提现');
+        // }
+        else {
+          notify('error', '提现申请提交失败');
+        }
+      })
+    },
+    showLoading() {
+      this.loading = true
+    },
+    hideLoading() {
+      this.loading = false
+    },
+    setUserInfo() {
+      this.user = storageGet('user') && storageGet('user').userVO;
+    },
+    handleSelectionChange(data) {
+      this.selection = data;
+    },
+    handleBatchUpdate() {
+      // console.log(this.selection)
+      if (this.selection.length === 0) {
+        notify('warning', '请先勾选需要提现的台账');
+        return
+      }
+      let canUpdate = true;
+      this.selection.some(d => {
+        if (d.state > 0) {
+          notify('warning', '请勾选未提现的台账');
+          canUpdate = false;
+          return true;
+        }
+        return false;
+      })
+      if (canUpdate) {
+        this.batchUpdate(this.selection.map(d => {
+          return d.id
+        }).join())
+      }
+    },
+    batchUpdate(ids) {
+      let url = '/api/bookTest/batchUpdateState/{ids}';
+      Http.get(url.replaceAll("{ids}", ids)).then((res) => {
+        if (res.code === 20000) {
+          notify('success', '批量提现申请成功');
+          this.handleSearchData()
+        } else {
+          notify('error', '提现申请失败');
+        }
+      })
+    },
+    getNumerStyle(state, sum) {
+      const style = {color: 'black'}
+      if (state === 'default') {
+        if (sum >= 30000) {
+          style.color = 'red';
+        } else {
+          style.color = '#6496ba';
+        }
+      } else if (state === 'commit') {
+        // console.log(sum)
+        if (sum >= 30000) {
+          style.color = 'red';
+        } else {
+          style.color = '#6496ba';
+        }
+
+      }
+      return style;
+    },
+    async getAuthStatus(){
+      this.showLoading();
+      let userId = storageGet('user')&&storageGet('user').userVO.id;
+      await Http.get(`/api/user/${userId}`).then(res=>{
+        this.authInfo = res;
+        if(res.personalAuthVO){
+          this.authType = 1  //个人
+        }else if(res.agencyVO){
+          this.authType = 2  //企业
+        }else if((!res.enterpriseAuthVO) || (!res.agencyVO)){
+          this.authType = 0  //无
+          this.firstSubmit = 1
+        }
+        this.hideLoading();
+      })
+    },
+    getActionStyle(type){
+      const style={};
+      if(type==="user"){
+        if(this.authType<2){
+          style.display="flex";
+        }
+      }else{
+        if(this.authType<2){
+          style.marginRight="5px"
+        }
+      }
+      return style;
+    },
+  },
+  async mounted() {
+    this.setUserInfo();
+    await this.getAuthStatus();
+    this.loadData();
+  }
+}
+</script>
+
+<style lang="scss">
+@import "../../style/search-nav.scss";
+
+.item-template {
+  height: 80px;
+}
+</style>

+ 365 - 0
src/pages/DetailPage/BalanceDetail.vue

@@ -0,0 +1,365 @@
+<template>
+  <div class="home-wrapper">
+    <!--    <TopSearch :searchVal="searchVal" :searchType="searchType" :searchTypeArr="searchTypeArr"/>-->
+    <div class="container" style="margin: 20px auto;">
+      <div class="create-body">
+        <div class="title h2">提现记录</div>
+        <el-row>
+          <el-col>
+            <div style="float: right">
+              <div class="btn btn-small btn-info" @click="handleBatchExamine" v-if="authType===2 || authType ===0">批量审核</div>
+            </div>
+          </el-col>
+        </el-row>
+        <template style="color: black">
+          <el-table
+            ref="multipleTable"
+            :data="curResourceList"
+            tooltip-effect="dark"
+            style="width: 100%; font-size: 16px; color: black" v-loading="loading"
+            @selection-change="handleSelectionChange">
+            <el-table-column
+              type="selection">
+            </el-table-column>
+            <el-table-column
+              prop="id"
+              align="left"
+              label="序号">
+            </el-table-column>
+            <el-table-column
+              prop="uname"
+              align="left"
+              min-width="80"
+              label=用户>
+            </el-table-column>
+            <el-table-column
+              prop="cttname"
+              align="left"
+              min-width="200"
+              label=任务名称>
+            </el-table-column>
+            <el-table-column
+              prop="balvalue"
+              align="left"
+              label="提现金额">
+            </el-table-column>
+            <el-table-column
+              prop="baltime"
+              label="提现时间"
+              min-width="150"
+              align="left">
+            </el-table-column>
+            <el-table-column
+              prop="stateName"
+              align="left"
+              label="状态">
+            </el-table-column>
+            <el-table-column
+              align="center"
+              label="操作"
+              v-if="authType===2 || authType ===0">
+              <template slot-scope="scope">
+                <div class="btn btn-small btn-info " @click="examineState(scope)" v-if="authType===2 || authType ===0">审核</div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+        <el-collapse accordion style="margin: 0 30px">
+          <el-pagination
+            v-if="curResourceList&&curResourceList.length"
+            :page-size="10"
+            layout="prev, pager, next"
+            :total="totalElements"
+            :current-page="activePage"
+            @current-change="handlePageChange"
+            class="pull-right"
+          >
+          </el-pagination>
+        </el-collapse>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Http from '@/js/http.js';
+import TopSearch from "../../components/commons/TopSearch";
+import {storageGet} from '@/js/index.js'
+import {notify} from "../../constants";
+import Apis from '@/js/api';
+import {CONFIG} from "../../config";
+
+export default {
+  name: "ResourceList",
+  components: {TopSearch},
+  data() {
+    return {
+      logoTitle: CONFIG.logoTitle,
+      logo_transparent: CONFIG.logo_transparent,
+      user: {},
+      authInfo:{},
+      authType:-1,
+      isLogin: false,
+      loading: false,
+      searchVal: '',
+      curResourceList: [],
+      searchType: 'cptcode',
+      selection: [],
+      searchTypeArr: [
+        {
+          "name": "全部",
+          "value": "all"
+        },
+        {
+          "name": "项目名称",
+          "value": "cptcode"
+        },
+        {
+          "name": "任务名称",
+          "value": "cttcode"
+        }],
+      activePage: 1,
+      totalElements: 0
+    }
+  },
+  methods: {
+    loadData() {
+      if (storageGet('user') != null) {
+        this.isLogin = true;
+      }
+      this.searchVal = this.$route.params.searchVal;
+      this.handleSearchData();
+    },
+    checkLogin() {
+      this.checkCreateProjectAuth();
+    },
+    handleSelectionChange(data) {
+      this.selection = data;
+    },
+    checkCreateProjectAuth() {
+      if (!this.isLogin) {
+        console.log("请登录后访问");
+        notify('warning', '请登录后访问');
+      } else if (this.isLogin) {
+        Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
+          this.$router.push('/project/create');
+        }).catch((error) => {
+          notify('error', error.data)
+        })
+      }
+    },
+    handleSearchData() {
+      console.log(this.authType)
+      if(this.authType<2) {
+        let url = '/api/bookTest/balDetail';
+        let params = {
+          "keyword": this.searchVal,
+          // "userid":this.user.userVO.id,
+          "activePage": 1,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": {
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.balancePageDTOPage.content;
+          this.totalElements = res.data.balancePageDTOPage.totalElements;
+        });
+      }
+      else if(this.authType===2) {
+        let url = '/api/bookTest/projectbalDetail';
+        let params = {
+          "keyword": this.searchVal,
+          // "userid":this.user.userVO.id,
+          "activePage": 1,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": {
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.balancePageDTOPage.content;
+          this.totalElements = res.data.balancePageDTOPage.totalElements;
+        });
+      }
+    },
+    nextPage() {
+      if(this.authType<2) {
+        let url = '/api/bookTest/balDetail';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": { //这里是下一页的参数
+            "userId": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.balancePageDTOPage.content;
+          this.totalElements = res.data.balancePageDTOPage.totalElements;
+        })
+      }
+      else if(this.authType===2) {
+        let url = '/api/bookTest/projectbalDetail';
+        let params = {
+          "keyword": this.searchVal,
+          // "userid":this.user.userVO.id,
+          "activePage": 1,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "value": this.searchType
+            },
+            {
+              "field": "id",
+              "type": "sort",
+              "value": "asc"
+            },
+          ],
+          "extraCondition": {
+            "userid": this.user.id//用户ID
+          }
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.balancePageDTOPage.content;
+          this.totalElements = res.data.balancePageDTOPage.totalElements;
+        });
+      }
+    },
+    examineState(scope) {
+      const state = scope.row.state;
+      if (state > 1) {
+        notify('warning', '已经审核,请勿重新审核');
+        return;
+      }
+      let url = '/api/bookTest/examineState/{id}';
+      Http.get(url.replaceAll("{id}", scope.row.id + "")).then((res) => {
+        if (res.code == 20000) {
+          notify('success', '审核成功');
+          this.handleSearchData()
+        }
+          // if(scope.state==1){
+          //   notify('error', '已经提现,请勿重新提现');
+        // }
+        else {
+          notify('error', '审核申请提交失败');
+        }
+      })
+    },
+    handleBatchExamine() {
+      // console.log(this.selection)
+      if (this.selection.length === 0) {
+        notify('warning', '请先勾选需要审核的记录');
+        return
+      }
+      let canExamine = true;
+      this.selection.some(d => {
+        if (d.state > 1) {
+          notify('warning', '请勾选未审核的记录');
+          canExamine = false;
+          return true;
+        }
+        return false;
+      })
+      if (canExamine) {
+        this.batchExamine(this.selection.map(d => {
+          return d.id
+        }).join())
+      }
+    },
+    batchExamine(ids) {
+      let url = '/api/bookTest/batchExamineState/{ids}';
+      Http.get(url.replaceAll("{ids}", ids)).then((res) => {
+        if (res.code === 20000) {
+          notify('success', '批量审核申请成功');
+          this.handleSearchData()
+        } else {
+          notify('error', '审核申请失败');
+        }
+      })
+    },
+    gotoHome() {
+      this.$router.push('/home');
+    },
+    handleTypeClick(tab) {
+      this.searchType = tab.name
+    },
+    handlePageChange(index) {
+      this.activePage = index;
+      this.nextPage();
+    },
+    showLoading() {
+      this.loading = true
+    },
+    hideLoading() {
+      this.loading = false
+    },
+    setUserInfo() {
+      this.user = storageGet('user') && storageGet('user').userVO;
+    },
+    async getAuthStatus() {
+      this.showLoading();
+      let userId = storageGet('user') && storageGet('user').userVO.id;
+      await Http.get(`/api/user/${userId}`).then(res => {
+        this.authInfo = res;
+        if (res.personalAuthVO) {
+          this.authType = 1  //个人
+        } else if (res.agencyVO) {
+          this.authType = 2  //企业
+        } else if ((!res.enterpriseAuthVO) || (!res.agencyVO)) {
+          this.authType = 0  //无
+          this.firstSubmit = 1
+        }
+        this.hideLoading();
+      })
+    }
+  },
+  async mounted() {
+    this.setUserInfo();
+    await this.getAuthStatus();
+    this.loadData();
+  }
+}
+</script>
+
+<style lang="scss">
+@import "../../style/search-nav.scss";
+.item-template {
+  height: 80px;
+}
+</style>

+ 153 - 0
src/pages/DetailPage/BookDetail.vue

@@ -0,0 +1,153 @@
+<template>
+  <div class="create-container">
+    <div class="create-body" v-loading="loading">
+      <el-form :model="resource" label-width="12%" class="demo">
+        <el-form-item label="序号" prop="id">
+          <span>{{resource.id}}</span>
+        </el-form-item>
+        <el-form-item label="项目编号" prop="cptcode" v-if="resource.cptcode">
+          <span>{{resource.cptcode}}</span>
+        </el-form-item>
+        <el-form-item label="项目名称" prop="cptname" v-if="resource.cptname">
+          <span>{{resource.cptname}}</span>
+        </el-form-item>
+        <el-form-item label="任务编号" prop="cttcode" v-if="resource.cttcode">
+          <span>{{resource.cttcode}}</span>
+        </el-form-item>
+        <el-form-item label="任务名称" prop="cttname" v-if="resource.cttname">
+          <span>{{resource.cttname}}</span>
+        </el-form-item>
+        <el-form-item label="接包时间" prop="acceptTime" v-if="resource.acceptTime">
+          <span>{{resource.acceptTime}}</span>
+        </el-form-item>
+        <el-form-item label="提交时间" prop="submitTime" v-if="resource.submitTime">
+          <span>{{resource.submitTime}}</span>
+        </el-form-item>
+        <el-form-item label="有效工作量金额" prop="effectiveWorkloadAmount" v-if="typeof effectiveWorkloadAmount ==='undefined'">
+          <span>{{resource.effectiveWorkloadAmount}}</span>
+        </el-form-item>
+        <el-form-item label="缺陷奖励金额" prop="defectExciationAmount" v-if="typeof defectExciationAmount ==='undefined'">
+          <span>{{resource.defectExciationAmount}}</span>
+        </el-form-item>
+        <el-form-item label="额外奖励金额" prop="extraRewardAmount" v-if="typeof extraRewardAmount ==='undefined'">
+          <span>{{resource.extraRewardAmount}}</span>
+        </el-form-item>
+        <el-form-item label="有效测试用例数量" prop="effectiveTestCaseCount" v-if="typeof effectiveTestCaseCount ==='undefined'">
+          <span>{{resource.effectiveTestCaseCount}}</span>
+        </el-form-item>
+        <el-form-item label="缺陷得分" prop="defectScore" v-if="typeof defectScore ==='undefined'">
+          <span>{{resource.defectScore}}</span>
+        </el-form-item>
+        <el-form-item label="酬劳所得" prop="totalAmount" v-if="resource.totalAmount">
+          <span>{{resource.totalAmount}}</span>
+        </el-form-item>
+        <el-form-item>
+          <div class="btn btn-medium" @click="back()">返回</div>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<script>
+import Http from '@/js/http.js'
+import Apis from '@/js/api.js'
+import {notify} from '@/constants/index'
+import {storageGet} from '@/js/index'
+
+export default {
+  name: 'BookDetail',
+  components: {},
+  data() {
+    return {
+      user: {},
+      loading: false,
+      type: 0,
+      code: 0,
+      resource: {
+        id:0,
+        cptcode: '',
+        cptname:'',
+        cttcode:0,
+        tname:'',
+        acceptTime:'',
+        submitTime:'',
+        price:'',
+        effectiveWorkloadAmount:'',
+        defectExciationAmount:'',
+        extraRewardAmount:'',
+      },
+    }
+  },
+  //这里是初始化方法,一般有create()和mounted
+  //mounted是在界面的dom初始化后才触发,created是一开始就触发
+  mounted() {
+    this.$nextTick(() => {
+      this.init() //这里执行init
+    })
+  },
+  methods: {
+    init() {
+      this.id = this.$route.query.id//这里获取code
+      this.loadData() //加载数据,这里应该就会调后台,传code
+    },
+    back() {
+      this.$router.go(-1);
+    },
+    loadData() {
+      this.showLoading()
+      //先写死Apis.RESOURCE.GET_DETAIL="/api/common/index/resource/{code}"
+      //然后把{code}替换为初始化获取的code
+      //这里用的是get方法Http.get,然后传了url,then和res就不用説了
+      //相当于http://localhost:5757/api/common/index/resource/POWERAGREEMENT
+      Http.get(Apis.BOOKLIST.GET_DETAIL.replace('{id}', this.id)).then((res) => {
+        this.resource.id = res.data.id
+        this.resource.cptcode = res.data.cptcode
+        this.resource.cptname = res.data.cptname
+        this.resource.cttcode = res.data.cttcode
+        this.resource.cttname = res.data.cttname
+        this.resource.acceptTime = res.data.acceptTime
+        this.resource.submitTime = res.data.submitTime
+        // this.resource.audit = res.data.audit
+        // this.resource.auditTime = res.data.auditTime
+        this.resource.effectiveWorkloadAmount = res.data.effectiveWorkloadAmount
+        this.resource.defectExciationAmount = res.data.defectExciationAmount
+        this.resource.extraRewardAmount = res.data.extraRewardAmount
+        this.resource.effectiveTestCaseCount = res.data.effectiveTestCaseCount
+        this.resource.extraRewardAmount = res.data.extraRewardAmount
+        this.resource.defectScore = res.data.defectScore
+        this.resource.totalAmount = res.data.totalAmount
+        this.hideLoading()
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '打开详情失败:' + error.data)
+      })
+    },
+    setUserInfo() {
+      this.user = storageGet('user')
+    },
+    showLoading() {
+      this.loading = true
+    },
+    hideLoading() {
+      this.loading = false
+    }
+  },
+  watch: {
+    resourceType(val) {
+      this.resourceType = val
+    }
+  }
+}
+</script>
+
+<style>
+.demo {
+  font-size: 32px;
+}
+
+.el-form-item {
+  /*max-height: 120px !important;*/
+}
+</style>
+

+ 47 - 1
src/router/index.js

@@ -534,7 +534,53 @@ export default new Router({
       name: 'TaskAmountCalPage',
       path: '/taskamount/:taskCode',
       component: resolve => require(['@/pages/Amount/TaskAmountCal.vue'], resolve)
-    }
+    },
+    //Test
+    {
+      path: '/bookeep',
+      name: 'TestBookKeep',
+      component: resolve => require(['@/pages/BookKeep/Test.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
+    {
+      path: '/bookkeeptest',
+      name: 'TestBookKeep',
+      component: resolve => require(['@/pages/BookKeep/BookTest.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
+    {
+      path: '/book/detail',
+      name: 'BookDetail',
+      component: resolve => require(['@/pages/DetailPage/BookDetail.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
+    {
+      path: '/book/baldetail',
+      name: 'BalanceDetail',
+      component: resolve => require(['@/pages/DetailPage/BalanceDetail.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
+    {
+      path: '/book/projetctbaldetail',
+      name: 'ProjectBalanceDetail',
+      component: resolve => require(['@/pages/DetailPage/BalanceDetail.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
   ]
 })
 // const originalPush = Router.prototype.push