Procházet zdrojové kódy

feature(报表统计): 业绩指标统计,包括回款金额(月度、年度)和签约合同金额(月度、年度)

lk před 2 roky
rodič
revize
55973b27c3

+ 13 - 0
src/api/contract/report.js

@@ -0,0 +1,13 @@
+import micro_request from '@/utils/micro_request'
+
+const basePath = process.env.VUE_APP_ParentPath
+export default {
+  // 业绩指标-回款金额
+  queryCollectionNum(query) {
+    return micro_request.postRequest(basePath, 'ContractReport', 'QueryCollectionNum', query)
+  },
+  // 业绩指标-签约合同金额
+  queryContractNum(query) {
+    return micro_request.postRequest(basePath, 'ContractReport', 'QueryContractNum', query)
+  },
+}

+ 12 - 12
src/views/proj/business/detail.vue

@@ -171,6 +171,15 @@
           <el-tab-pane label="跟进记录" name="follow">
             <details-follow ref="follow" :bus-id="id" />
           </el-tab-pane>
+          <el-tab-pane label="支持工单" name="workorder">
+            <details-work-order ref="detailsWorkOrder" />
+          </el-tab-pane>
+          <el-tab-pane label="产品信息" name="product">
+            <h3 style="float: right; margin-right: 20px; margin-bottom: 15px">
+              预计出货金额: {{ formatPrice(details.estTransPrice) }}
+            </h3>
+            <product-table ref="productTable" is-look :product-data="productData" />
+          </el-tab-pane>
           <el-tab-pane label="联系人" name="contact">
             <details-contact
               ref="contact"
@@ -179,21 +188,15 @@
               :primacy-contact-id="details.contactId"
               @fetch-data="getRecord" />
           </el-tab-pane>
-          <el-tab-pane label="产品信息" name="product">
-            <h3 style="float: right; margin-right: 20px; margin-bottom: 15px">
-              预计出货金额: {{ formatPrice(details.estTransPrice) }}
-            </h3>
-            <product-table ref="productTable" is-look :product-data="productData" />
-          </el-tab-pane>
           <el-tab-pane label="合同记录" name="contract">
             <details-contract ref="detailsContract" :bus-id="id" />
           </el-tab-pane>
-          <el-tab-pane label="支持工单" name="workorder">
-            <details-work-order ref="detailsWorkOrder" />
-          </el-tab-pane>
           <el-tab-pane label="交付工单" name="deliver">
             <details-deliver ref="detailsDeliver" />
           </el-tab-pane>
+          <el-tab-pane label="附件" name="enclosure">
+            <details-enclosure ref="detailsEnclosure" />
+          </el-tab-pane>
           <el-tab-pane label="归属记录" name="belong">
             <el-table v-loading="belongLoading" border :data="belongs" height="calc(100% - 42px)">
               <el-table-column align="center" label="归属销售" prop="opnContent.saleName" show-overflow-tooltip />
@@ -208,9 +211,6 @@
               <el-table-column align="center" label="备注" prop="remark" show-overflow-tooltip />
             </el-table>
           </el-tab-pane>
-          <el-tab-pane label="附件" name="enclosure">
-            <details-enclosure ref="detailsEnclosure" />
-          </el-tab-pane>
         </el-tabs>
       </div>
       <div class="info-side">

+ 93 - 0
src/views/report/contract/collection.vue

@@ -0,0 +1,93 @@
+<!--
+ * @Author: niezch@dashoo.cn
+ * @Date: 2023-04-03 09:32:08
+ * @LastEditors: niezch@dashoo.cn
+ * @LastEditTime: 2023-04-06 18:07:13
+ * @Description: file content
+ * @FilePath: \opms_frontend\src\views\report\contract\collection.vue
+-->
+<template>
+  <div class="detail">
+    <h2 style="text-align: center">回款金额统计报表</h2>
+    <div style="float: right; margin-bottom: 10px">
+      <p>
+        <el-radio-group v-model="reportType" style="margin-right: 20px" @change="fetchData">
+          <el-radio-button label="年" />
+          <el-radio-button label="月" />
+        </el-radio-group>
+        <el-date-picker
+          v-show="reportType == '月'"
+          v-model="month"
+          type="month"
+          value-format="yyyy-MM"
+          @change="fetchData" />
+        <el-date-picker
+          v-show="reportType == '年'"
+          v-model="year"
+          type="year"
+          value-format="yyyy"
+          @change="fetchData" />
+      </p>
+    </div>
+
+    <el-table ref="businessTable" v-loading="loading" border :data="tableData" :height="$baseTableHeight(1)">
+      <el-table-column
+        v-for="(item, key) in header"
+        :key="key"
+        align="center"
+        :label="item.label"
+        :prop="item.prop"
+        show-overflow-tooltip>
+        <template #default="{ row }">
+          <span>{{ row[item.prop] }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+  import reportApi from '@/api/contract/report'
+  import { parseTime } from '@/utils'
+
+  export default {
+    name: 'CollectionReport',
+    components: {},
+    data() {
+      return {
+        reportType: '月',
+        month: parseTime(new Date(), '{y}-{m}'),
+        year: parseTime(new Date(), '{y}'),
+        loading: false,
+        header: undefined,
+        tableData: undefined,
+      }
+    },
+    mounted() {
+      this.fetchData()
+    },
+    methods: {
+      async fetchData() {
+        let date = ''
+        if (this.reportType == '月') {
+          date = this.month
+        } else if (this.reportType == '年') {
+          date = this.year
+        }
+        this.loading = true
+        const {
+          data: { header, data },
+        } = await reportApi.queryCollectionNum({ date: date })
+        this.header = header
+        this.tableData = data
+        this.loading = false
+      },
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  .detail {
+    padding: 30px;
+  }
+</style>

+ 93 - 0
src/views/report/contract/index.vue

@@ -0,0 +1,93 @@
+<!--
+ * @Author: niezch@dashoo.cn
+ * @Date: 2023-04-03 09:32:08
+ * @LastEditors: niezch@dashoo.cn
+ * @LastEditTime: 2023-04-06 18:07:13
+ * @Description: file content
+ * @FilePath: \opms_frontend\src\views\report\contract\index.vue
+-->
+<template>
+  <div class="detail">
+    <h2 style="text-align: center">签约合同金额统计报表</h2>
+    <div style="float: right; margin-bottom: 10px">
+      <p>
+        <el-radio-group v-model="reportType" style="margin-right: 20px" @change="fetchData">
+          <el-radio-button label="年" />
+          <el-radio-button label="月" />
+        </el-radio-group>
+        <el-date-picker
+          v-show="reportType == '月'"
+          v-model="month"
+          type="month"
+          value-format="yyyy-MM"
+          @change="fetchData" />
+        <el-date-picker
+          v-show="reportType == '年'"
+          v-model="year"
+          type="year"
+          value-format="yyyy"
+          @change="fetchData" />
+      </p>
+    </div>
+
+    <el-table ref="businessTable" v-loading="loading" border :data="tableData" :height="$baseTableHeight(1)">
+      <el-table-column
+        v-for="(item, key) in header"
+        :key="key"
+        align="center"
+        :label="item.label"
+        :prop="item.prop"
+        show-overflow-tooltip>
+        <template #default="{ row }">
+          <span>{{ row[item.prop] }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+  import reportApi from '@/api/contract/report'
+  import { parseTime } from '@/utils'
+
+  export default {
+    name: 'ContractReport',
+    components: {},
+    data() {
+      return {
+        reportType: '月',
+        month: parseTime(new Date(), '{y}-{m}'),
+        year: parseTime(new Date(), '{y}'),
+        loading: false,
+        header: undefined,
+        tableData: undefined,
+      }
+    },
+    mounted() {
+      this.fetchData()
+    },
+    methods: {
+      async fetchData() {
+        let date = ''
+        if (this.reportType == '月') {
+          date = this.month
+        } else if (this.reportType == '年') {
+          date = this.year
+        }
+        this.loading = true
+        const {
+          data: { header, data },
+        } = await reportApi.queryContractNum({ date: date })
+        this.header = header
+        this.tableData = data
+        this.loading = false
+      },
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  .detail {
+    padding: 30px;
+  }
+</style>