Selaa lähdekoodia

项目台账优化

songxy 1 vuosi sitten
vanhempi
commit
111443ea16

+ 33 - 4
client/src/views/OaSystem/projectCenter/projectBook/deptProject.vue

@@ -187,21 +187,21 @@ const queryParams = reactive<{
   deptId: deptId
 })
 const lxsjObj = ref()
-const infoList: any = ref([
+const infoList: any = reactive([
   {
     icon: 'xmzx/xmzcz',
     name: '项目总产值(元)',
-    num: '0'
+    num: 0
   },
   {
     icon: 'xmzx/xmzcb',
     name: '项目总成本(元)',
-    num: '0'
+    num: 0
   },
   {
     icon: 'xmzx/xmzlr',
     name: '项目总利润(元)',
-    num: '0'
+    num: 0
   }
 ])
 
@@ -218,6 +218,8 @@ const operateClick = (row: any) => {
 const tableData = ref<Array<any>>([])
 const total = ref<number>()
 const searchHandle: () => void = () => {
+  queryXmztCount()
+  queryProjectCalculate()
   queryProjectListAjax()
 }
 const queryProjectListAjax = async (): Promise<void> => {
@@ -242,6 +244,33 @@ const queryProjectListAjax = async (): Promise<void> => {
 }
 queryProjectListAjax()
 
+/**
+ * 获取项目台账金额计算
+ */
+const queryProjectCalculate = async (): Promise<void> => {
+  const urlApi = `/project/calculate`
+  if (lxsjObj.value && lxsjObj.value.length > 0) {
+    queryParams.lxsjOn = moment(lxsjObj.value[0]).format('YYYY-MM-DD')
+    queryParams.lxsjOff = moment(lxsjObj.value[1]).format('YYYY-MM-DD')
+  } else {
+    queryParams.lxsjOn = ''
+    queryParams.lxsjOff = ''
+  }
+  const sendData = {
+    ...queryParams,
+    pageSize: 15
+  }
+  if (sendData['hyId'] == 0) {
+    sendData['hyId'] = null
+  }
+  const result = await request.get({ url: urlApi, params: sendData }, '/business')
+  if (result) {
+    infoList[0]['num'] = result.output ?? 0
+    infoList[1]['num'] = result.cost ?? 0
+    infoList[2]['num'] = infoList[1]['num'] - infoList[0]['num']
+  }
+}
+queryProjectCalculate()
 /**
  * 项目状态数据统计
  */

+ 33 - 4
client/src/views/OaSystem/projectCenter/projectBook/myProject.vue

@@ -187,21 +187,21 @@ const queryParams = reactive<{
   userId: userId
 })
 const lxsjObj = ref()
-const infoList: any = ref([
+const infoList: any = reactive([
   {
     icon: 'xmzx/xmzcz',
     name: '项目总产值(元)',
-    num: '-'
+    num: 0
   },
   {
     icon: 'xmzx/xmzcb',
     name: '项目总成本(元)',
-    num: '-'
+    num: 0
   },
   {
     icon: 'xmzx/xmzlr',
     name: '项目总利润(元)',
-    num: '-'
+    num: 0
   }
 ])
 
@@ -218,6 +218,8 @@ const operateClick = (row: any) => {
 const tableData = ref<Array<any>>([])
 const total = ref<number>()
 const searchHandle: () => void = () => {
+  queryXmztCount()
+  queryProjectCalculate()
   queryProjectListAjax()
 }
 const queryProjectListAjax = async (): Promise<void> => {
@@ -242,6 +244,33 @@ const queryProjectListAjax = async (): Promise<void> => {
 }
 queryProjectListAjax()
 
+/**
+ * 获取项目台账金额计算
+ */
+const queryProjectCalculate = async (): Promise<void> => {
+  const urlApi = `/project/calculate`
+  if (lxsjObj.value && lxsjObj.value.length > 0) {
+    queryParams.lxsjOn = moment(lxsjObj.value[0]).format('YYYY-MM-DD')
+    queryParams.lxsjOff = moment(lxsjObj.value[1]).format('YYYY-MM-DD')
+  } else {
+    queryParams.lxsjOn = ''
+    queryParams.lxsjOff = ''
+  }
+  const sendData = {
+    ...queryParams,
+    pageSize: 15
+  }
+  if (sendData['hyId'] == 0) {
+    sendData['hyId'] = null
+  }
+  const result = await request.get({ url: urlApi, params: sendData }, '/business')
+  if (result) {
+    infoList[0]['num'] = result.output ?? 0
+    infoList[1]['num'] = result.cost ?? 0
+    infoList[2]['num'] = infoList[1]['num'] - infoList[0]['num']
+  }
+}
+queryProjectCalculate()
 /**
  * 获取行政区tree结构数据
  */

+ 33 - 4
client/src/views/OaSystem/projectCenter/projectBook/projectBook.vue

@@ -148,21 +148,21 @@ const queryParams = reactive<{
   hyId: 0
 })
 const lxsjObj = ref()
-const infoList: any = ref([
+const infoList: any = reactive([
   {
     icon: 'xmzx/xmzcz',
     name: '项目总产值(元)',
-    num: '0'
+    num: 0
   },
   {
     icon: 'xmzx/xmzcb',
     name: '项目总成本(元)',
-    num: '0'
+    num: 0
   },
   {
     icon: 'xmzx/xmzlr',
     name: '项目总利润(元)',
-    num: '0'
+    num: 0
   }
 ])
 
@@ -179,6 +179,8 @@ const operateClick = (row: any) => {
 const tableData = ref<Array<any>>([])
 const total = ref<number>()
 const searchHandle: () => void = () => {
+  queryXmztCount()
+  queryProjectCalculate()
   queryProjectListAjax()
 }
 const queryProjectListAjax = async (): Promise<void> => {
@@ -203,6 +205,33 @@ const queryProjectListAjax = async (): Promise<void> => {
 }
 queryProjectListAjax()
 
+/**
+ * 获取项目台账金额计算
+ */
+const queryProjectCalculate = async (): Promise<void> => {
+  const urlApi = `/project/calculate`
+  if (lxsjObj.value && lxsjObj.value.length > 0) {
+    queryParams.lxsjOn = moment(lxsjObj.value[0]).format('YYYY-MM-DD')
+    queryParams.lxsjOff = moment(lxsjObj.value[1]).format('YYYY-MM-DD')
+  } else {
+    queryParams.lxsjOn = ''
+    queryParams.lxsjOff = ''
+  }
+  const sendData = {
+    ...queryParams,
+    pageSize: 15
+  }
+  if (sendData['hyId'] == 0) {
+    sendData['hyId'] = null
+  }
+  const result = await request.get({ url: urlApi, params: sendData }, '/business')
+  if (result) {
+    infoList[0]['num'] = result.output ?? 0
+    infoList[1]['num'] = result.cost ?? 0
+    infoList[2]['num'] = infoList[1]['num'] - infoList[0]['num']
+  }
+}
+queryProjectCalculate()
 /**
  * 项目状态数据统计
  */

+ 0 - 89
client/src/views/OaSystem/projectCenter/reviewManager/projectBook.scss

@@ -1,89 +0,0 @@
-._ProjectCenterBook {
-  width: calc(100% - 30px);
-  height: calc(100% - 30px);
-  background: #FFFFFF;
-  border-radius: 4px 4px 4px 4px;
-  border: 1px solid #DEE0E3;
-  margin: 15px;
-
-  .searchBox {
-    width: 100%;
-    height: 125px;
-    background: #F7F8FA;
-    border-radius: 4px 4px 0 0;
-    display: flex;
-    align-items: center;
-    flex-wrap: wrap;
-    padding: 0 20px;
-    box-sizing: border-box;
-
-    .form {
-      display: flex;
-      align-items: center;
-      margin-right: 20px;
-
-      .formSpan {
-        font-size: 16px;
-      }
-
-      .btnBox {
-        display: flex;
-        align-items: center;
-      }
-    }
-  }
-
-  .infoBox {
-    width: 100%;
-    height: 55px;
-    background: #EDF2FB;
-
-    ul {
-      width: 100%;
-      height: 100%;
-      display: flex;
-      align-items: center;
-      padding: 0 20px;
-
-      li {
-        list-style: none;
-        display: flex;
-        align-items: center;
-      }
-    }
-  }
-
-  .tableBox {
-    width: 100%;
-    height: calc(100% - 180px);
-    padding: 15px 20px;
-    position: relative;
-
-    .table {
-      width: 100%;
-      height: calc(100% - 40px);
-
-      .operateBtn {
-        width: 54px;
-        height: 24px;
-        background: #EBF2FF;
-        border-radius: 16px 16px 16px 16px;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        cursor: pointer;
-
-        span {
-          color: #2E77E6;
-        }
-      }
-    }
-
-    .pageBox {
-      position: absolute;
-      right: 20px;
-      bottom: 10px;
-      text-align: right;
-    }
-  }
-}

+ 0 - 244
client/src/views/OaSystem/projectCenter/reviewManager/reviewManager.vue

@@ -1,244 +0,0 @@
-<template>
-  <div class="oa-sys-list-view">
-    <div class="searchBox">
-      <div class="form">
-        <span class="formSpan">项目名称:</span>
-        <el-input v-model="queryParams.xmmc" placeholder="请输入项目名称" style="width: 210px" />
-      </div>
-      <div class="form">
-        <span class="formSpan">项目编号:</span>
-        <el-input v-model="queryParams.xmbh" placeholder="请输入项目名称" style="width: 160px" />
-      </div>
-      <div class="form">
-        <span class="formSpan">行政区:</span>
-        <el-select v-model="queryParams.xzqmc" placeholder="请选择行政区" style="width: 160px">
-          <el-option
-            v-for="item in xzqList"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-      </div>
-      <div class="form">
-        <span class="formSpan">行业:</span>
-        <el-input v-model="queryParams.hymc" placeholder="请输入行业" style="width: 160px" />
-      </div>
-      <div class="form">
-        <span class="formSpan">立项时间:</span>
-        <el-date-picker
-          v-model="queryParams.lxsj"
-          type="daterange"
-          unlink-panels
-          range-separator="To"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-        />
-      </div>
-      <div class="form">
-        <span class="formSpan">合同:</span>
-        <el-checkbox-group v-model="queryParams.htList">
-          <el-checkbox label="全部" />
-          <el-checkbox label="已签订" />
-          <el-checkbox label="未签订" />
-        </el-checkbox-group>
-      </div>
-      <div class="form">
-        <span class="formSpan">项目状态:</span>
-        <el-radio-group v-model="queryParams.xmzt">
-          <el-radio :label="1">进行中({{ process }})</el-radio>
-          <el-radio :label="4">已验收({{ accepted }})</el-radio>
-          <el-radio :label="2">已结项({{ finished }})</el-radio>
-          <el-radio :label="9">已终止({{ terminated }})</el-radio>
-          <el-radio>全部({{ totalNum }})</el-radio>
-        </el-radio-group>
-      </div>
-      <div class="from">
-        <div class="btnBox">
-          <el-button type="primary" style="background: #3485ff">
-            <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
-            查询</el-button
-          >
-          <el-button type="primary">
-            <img src="@/assets/imgs/OA/open.png" class="mr-8px" alt="" />
-            导出</el-button
-          >
-        </div>
-      </div>
-    </div>
-    <div class="infoBox">
-      <ul>
-        <li v-for="(item, index) in infoList" :key="index" class="mr-40px">
-          <img class="mr-8px" :src="getAssetURL(item.icon)" alt="" />
-          <p>{{ item.name }}:</p>
-          <h4 class="font-size-18px">{{ item.num }}</h4>
-        </li>
-      </ul>
-    </div>
-    <div class="tableBox">
-      <div class="table" ref="tableRef">
-        <el-table
-          :data="tableData"
-          style="width: 100%; height: 100%"
-          :style="{ height: tableHeight + 'px' }"
-          :header-cell-style="{
-            background: '#F7F8FA',
-            color: '#121518',
-            height: '50px'
-          }"
-        >
-          <el-table-column label="序号" width="60">
-            <template #default="scope">{{ scope.$index + 1 }}</template>
-          </el-table-column>
-          <el-table-column prop="name" label="项目名称" />
-          <el-table-column prop="name" label="项目编号" width="180" />
-          <el-table-column prop="name" label="行政区" width="100" />
-          <el-table-column prop="name" label="项目类别" width="180" />
-          <el-table-column prop="name" label="责任部门" />
-          <el-table-column prop="name" label="项目经理" />
-          <el-table-column prop="name" label="立项时间" />
-          <el-table-column prop="name" label="OA确认验收时间" />
-          <el-table-column prop="name" label="实际验收时间" />
-          <el-table-column prop="name" label="总产值" />
-          <el-table-column prop="name" label="总成本" />
-          <el-table-column prop="name" label="项目状态" />
-
-          <el-table-column label="操作" width="80">
-            <template #default="scope">
-              <div class="operateBtn" @click="operateClick(scope.row)">
-                <span>查看</span>
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div class="pageBox">
-        <el-pagination
-          v-model:current-page="currentPage1"
-          :page-size="100"
-          background
-          layout="total, prev, pager, next"
-          :total="1000"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        />
-      </div>
-    </div>
-  </div>
-</template>
-<script setup lang="ts">
-import { useRouter } from 'vue-router'
-import { getAssetURL } from '@/utils/auth'
-defineOptions({ name: 'ProjectBook' })
-const router = useRouter()
-const tableRef: any = ref(null)
-const tableHeight: any = ref(0)
-const currentPage1: any = ref(5)
-const tableData: any = ref([
-  {
-    id: 111
-  },
-  { id: 222 },
-  { id: 333 }
-])
-const queryParams: any = reactive({
-  xmmc: '',
-  xmbh: '',
-  xzqmc: '',
-  hymc: '',
-  lxsj: '',
-  htList: [],
-  xmzt: 0
-})
-const infoList: any = ref([
-  {
-    icon: 'xmzx/xmzcz',
-    name: '项目总产值(元)',
-    num: '0'
-  },
-  {
-    icon: 'xmzx/xmzcb',
-    name: '项目总成本(元)',
-    num: '0'
-  },
-  {
-    icon: 'xmzx/xmzlr',
-    name: '项目总利润(元)',
-    num: '0'
-  }
-])
-const xzqList: any = ref([
-  {
-    value: 'Option1',
-    label: 'Option1'
-  },
-  {
-    value: 'Option2',
-    label: 'Option2'
-  },
-  {
-    value: 'Option3',
-    label: 'Option3'
-  },
-  {
-    value: 'Option4',
-    label: 'Option4'
-  },
-  {
-    value: 'Option5',
-    label: 'Option5'
-  }
-])
-
-const handleSizeChange = () => {}
-const handleCurrentChange = () => {}
-const operateClick = (row: any) => {
-  let c: any = {}
-  c = router.resolve({
-    path: '/projectDetail',
-    query: { id: row.id }
-  })
-
-  window.open(c.href, '_blank')
-}
-/**
- * 项目状态数据统计
- */
-const totalNum = ref<number>(0)
-const process = ref<number>(0)
-const finished = ref<number>(0)
-const terminated = ref<number>(0)
-const accepted = ref<number>(0)
-
-const queryXmztCount = async (): Promise<void> => {
-  const urlApi = `/project/xmzt/count`
-  if (lxsjObj.value && lxsjObj.value.length > 0) {
-    queryParams.lxsjOn = moment(lxsjObj.value[0]).format('YYYY-MM-DD')
-    queryParams.lxsjOff = moment(lxsjObj.value[1]).format('YYYY-MM-DD')
-  } else {
-    queryParams.lxsjOn = ''
-    queryParams.lxsjOff = ''
-  }
-  const sendData = {
-    ...queryParams
-  }
-  if (sendData['hyId'] == 0) {
-    sendData['hyId'] = null
-  }
-  const result = await request.get({ url: urlApi, params: sendData }, '/business')
-  if (result) {
-    totalNum.value = result['total']
-    process.value = result['process']
-    finished.value = result['finished']
-    terminated.value = result['terminated']
-    accepted.value = result['accepted']
-  }
-}
-queryXmztCount()
-onMounted(() => {
-  tableHeight.value = tableRef.value.clientHeight
-})
-</script>
-<!-- <style lang="scss" scoped>
-@import url('./projectBook.scss');
-</style> -->

+ 1 - 0
client_h5/index.html

@@ -4,6 +4,7 @@
     <meta charset="UTF-8" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1">
+    <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.10.3/dingtalk.open.js"></script>
     <title></title>
   </head>
   <body>

+ 12 - 0
client_h5/src/App.vue

@@ -1,4 +1,16 @@
 <script setup lang="ts">
+dd.getAuthCode({
+  corpId: 'ding12345xxx',
+  success: (res) => {
+      const { authCode } = res;
+      if (authCode) {
+        // 授权成功
+        console.log(authCode);
+      }
+  },
+  fail: () => {},
+  complete: () => {},
+});
 </script>
 
 <template>