Browse Source

合同台账

chris 3 years ago
parent
commit
c479dacc4c

+ 9 - 0
src/api/cus.js

@@ -99,3 +99,12 @@ export function getCommunicationList (coId) {
     method: 'get'
   })
 }
+
+// 合同统计列表
+export function getStatList (param) {
+  return request({
+    url: request.adornUrl(`/biz-service/cusContractCensus/list`),
+    method: 'get',
+    params: param
+  })
+}

File diff suppressed because it is too large
+ 0 - 0
src/icons/svg/icon-taizhang.svg


+ 1 - 0
src/icons/svg/icon-tongji.svg

@@ -0,0 +1 @@
+<svg t="1649574261871" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4624" width="200" height="200"><path d="M420.864 450.56l-164.864 139.264 0-186.368 185.344-162.816 5.12 6.144 167.936 195.584 308.224-320.512 92.16 112.64-413.696 431.104-3.072-7.168zM928.768 705.536q19.456 0 37.376 7.68t30.72 20.48 20.48 30.208 7.68 36.864q0 20.48-7.68 37.888t-20.48 30.208-30.72 20.48-37.376 7.68l-832.512 0q-20.48 0-37.888-7.68t-30.208-20.48-20.48-30.208-7.68-37.888l0-640q0-19.456 7.68-37.376t20.48-30.72 30.208-20.48 37.888-7.68q19.456 0 37.376 7.68t30.72 20.48 20.48 30.72 7.68 37.376l0 544.768 736.256 0z" p-id="4625"></path></svg>

+ 2 - 0
src/main.js

@@ -15,6 +15,7 @@ import cloneDeep from 'lodash/cloneDeep'
 import SuperFlow from './views/modules/common/vue-super-flow/index'
 import html2pdf from '@/api/pdf'
 import Print from 'vue-print-nb'
+// import * as echarts from 'echarts'
 import ElementUI from 'element-ui'
 import Contextmenu from 'vue-contextmenujs'
 
@@ -32,6 +33,7 @@ if (process.env.NODE_ENV !== 'production') {
 }
 
 // 挂载全局
+// Vue.prototype.$echarts = echarts
 Vue.prototype.$http = httpRequest // ajax请求方法
 Vue.prototype.isAuth = isAuth     // 权限方法
 

+ 11 - 16
src/views/modules/cus/contract-record.vue

@@ -1,7 +1,7 @@
 <!-- 合同台账 -->
 <template>
   <div class="contract">
-    <template v-if="!detailVisible && !addOrUpdateVisible && !changeFormVisible && !attachVisible && !noticeChangeVisible">
+    <template v-if="!detailVisible && !addOrUpdateVisible && !changeFormVisible &&!changeAttachVisible && !attachVisible && !noticeChangeAttachVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
         <el-form-item label="名称">
           <el-input v-model="dataForm.customerName" placeholder="客户名称" clearable/>
@@ -115,7 +115,7 @@
           align="center"
           label="合同更改通知单附件">
           <template slot-scope="scope">
-            <el-button :disabled="!scope.row.noticeAttachList || scope.row.noticeAttachList.length === 0" type="text" size="small" @click="attachDetails(scope.row)">查看</el-button>
+            <el-button :disabled="!scope.row.noticeAttachList || scope.row.noticeAttachList.length === 0" type="text" size="small" @click="changeDetails(scope.row)">查看</el-button>
           </template>
         </el-table-column>
         <el-table-column
@@ -152,11 +152,9 @@
     <!-- 弹窗, 新增 / 修改 -->
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
     <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
-<!--    <crafts-detail v-if="craftsVisible" ref="craftsDetail" @onChose="onChose"/>-->
-<!--    <product-draw-detail v-if="drawVisible" ref="drawDetail" @onChose="onChose"/>-->
-<!--    <attach-detail v-if="changeVisible" ref="changeDetail" @onChose="onChose"/>-->
+    <attach-detail v-if="changeAttachVisible" ref="changeDetail" @onChose="onChose"/>
     <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
-    <notice-change-setting v-if="noticeChangeVisible" ref="noticeChangeSetting" @onChose="onChose"/>
+    <notice-change-setting v-if="noticeChangeAttachVisible" ref="noticeChangeSetting" @onChose="onChose"/>
     <change-form v-if="changeFormVisible" ref="changeForm" @refreshDataList="getDataList" @onChose="onChose"/>
   </div>
 </template>
@@ -165,8 +163,6 @@
 import AddOrUpdate from './contract-record-add-or-update'
 import Detail from './contract-record-detail'
 import { getCusContractBookList } from '@/api/cus'
-// import CraftsDetail from './crafts-detail'
-// import ProductDrawDetail from './product-draw-detail'
 import AttachDetail from '../common/attach-detail'
 import NoticeChangeSetting from './contract-record-notice-change-setting'
 import ChangeForm from './contract-record-change'
@@ -174,11 +170,8 @@ export default {
   name: 'contract-record',
   components: {
     AttachDetail,
-    // ProductDrawDetail,
-    // CraftsDetail,
     AddOrUpdate,
     Detail,
-    // Detail,
     NoticeChangeSetting,
     ChangeForm
   },
@@ -187,7 +180,8 @@ export default {
       addOrUpdateVisible: false,
       detailVisible: false,
       attachVisible: false,
-      noticeChangeVisible: false,
+      changeAttachVisible: false,
+      noticeChangeAttachVisible: false,
       changeFormVisible: false,
       dataForm: {},
       dataList: [],
@@ -206,8 +200,9 @@ export default {
       this.addOrUpdateVisible = false
       this.attachVisible = false
       this.detailVisible = false
-      this.noticeChangeVisible = false
+      this.noticeChangeAttachVisible = false
       this.changeFormVisible = false
+      this.changeAttachVisible = false
     },
     // 查询
     search () {
@@ -310,16 +305,16 @@ export default {
     },
     // 变更通知人设置
     setNoticeChangeHandel () {
-      this.noticeChangeVisible = true
+      this.noticeChangeAttachVisible = true
       this.$nextTick(() => {
         this.$refs.noticeChangeSetting.init()
       })
     },
     // 产品更改通知单
     changeDetails (row) {
-      this.changeVisible = true
+      this.changeAttachVisible = true
       this.$nextTick(() => {
-        this.$refs.changeDetail.init(row.noticeChangeRecord.attachList)
+        this.$refs.changeDetail.init(row.noticeAttachList)
       })
     },
     // 附件

+ 84 - 0
src/views/modules/cus/contract-statistics-annual-report.vue

@@ -0,0 +1,84 @@
+<template>
+  <div>
+    <div class="my-title">年度合同统计</div>
+    <div style="margin-left: 20px;margin-right: 20px">
+      <!-- todo -->
+      <div id="myChart" :style="{width: '600px', height: '300px'}"></div>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">返回</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+  // import echarts from 'echarts'
+  import EDesc from '../common/e-desc'
+  import EDescItem from '../common/e-desc-item'
+  export default {
+    name: 'contract-statistics-annual-report',
+    components: {
+      EDesc, EDescItem
+    },
+    data () {
+      return {
+        id: 0,
+        dataForm: {}
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init (id) {
+        this.id = id || 0
+        this.dataForm = {
+          year: 2020
+        }
+        // this.drawLine()
+        this.getDetails()
+      },
+      drawLine () {
+        // // 基于刚刚准备好的 DOM 容器,初始化 EChart 实例
+        // let myChart = this.$echarts.init(document.getElementById('myChart'))
+        // // 绘制图表
+        // myChart.setOption({
+        //   title: { text: '太阳系八大行星的卫星数量' },
+        //   tooltip: {},
+        //   xAxis: {
+        //     data: ['水星', '金星', '地球', '火星', '木星', '土星', '金王星', '海王星']
+        //   },
+        //   yAxis: {},
+        //   series: [{
+        //     name: '数量',
+        //     type: 'bar',
+        //     data: [0, 0, 1, 2, 79, 82, 27, 14]
+        //   }]
+        // })
+      },
+      getDetails () {
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/cusContractCensus/year/info`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'year': this.dataForm.year
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+.my-line{
+  border-bottom: 1px solid #c0c4cc;
+  margin-bottom: 10px;
+}
+.title{
+  padding: 10px 0 ;
+}
+</style>

+ 173 - 0
src/views/modules/cus/contract-statistics.vue

@@ -0,0 +1,173 @@
+<!-- 合同统计 -->
+<template>
+  <div class="contract">
+    <template v-if="!annualReportVisible">
+      <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
+        <el-form-item label="名称">
+          <el-input v-model="dataForm.customerName" placeholder="客户名称" clearable/>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="search()">查询</el-button>
+          <el-button v-if="isAuth('cus:contractCensus:info')" type="primary" @click="annualReportHandle()">年度合同统计</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table
+        :data="dataList"
+        border
+        v-loading="dataListLoading"
+        style="width: 100%;">
+        <el-table-column
+          label="序号"
+          type="index"
+          width="50"
+          align="center">
+        </el-table-column>
+        <el-table-column
+          prop="customerName"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="客户名称">
+        </el-table-column>
+        <el-table-column
+          prop="bizManagerName"
+          header-align="center"
+          align="center"
+          min-width="120"
+          :show-tooltip-when-overflow="true"
+          label="业务员">
+        </el-table-column>
+        <el-table-column
+          prop="monthNum"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-overflow-tooltip="true"
+          label="本月合同总数">
+        </el-table-column>
+        <el-table-column
+          prop="monthTotalAmount"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-overflow-tooltip="true"
+          label="本月合同总金额">
+        </el-table-column>
+        <el-table-column
+          prop="historyNum"
+          header-align="center"
+          align="center"
+          min-width="100"
+          label="历史合同总数">
+        </el-table-column>
+        <el-table-column
+          prop="historyTotalAmount"
+          header-align="center"
+          align="center"
+          min-width="120"
+          label="历史订单合同总金额">
+        </el-table-column>
+        <el-table-column
+          prop="notes"
+          header-align="center"
+          align="center"
+          min-width="180"
+          :show-overflow-tooltip="true"
+          label="备注">
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="sizeChangeHandle"
+        @current-change="currentChangeHandle"
+        :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        :total="totalPage"
+        layout="total, sizes, prev, pager, next, jumper">
+      </el-pagination>
+    </template>
+    <report v-if="annualReportVisible" ref="reportPage" @onChose="onChose"/>
+  </div>
+</template>
+
+<script>
+import Report from './contract-statistics-annual-report'
+import { getStatList } from '@/api/cus'
+export default {
+  name: 'contract-statistics',
+  components: {
+    Report
+  },
+  data () {
+    return {
+      annualReportVisible: false,
+      dataForm: {},
+      dataList: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPage: 0,
+      dataListLoading: false,
+      dataListSelections: []
+    }
+  },
+  created () {
+    this.getDataList()
+  },
+  methods: {
+    onChose () {
+      this.annualReportVisible = false
+    },
+    // 查询
+    search () {
+      this.pageIndex = 1
+      this.getDataList()
+    },
+    // 获取数据列表
+    getDataList () {
+      this.dataListLoading = true
+      let params = {
+        'current': this.pageIndex,
+        'size': this.pageSize,
+        'customerName': this.dataForm.customerName ? this.dataForm.customerName : null
+      }
+      getStatList(params).then(({data}) => {
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
+        } else {
+          this.dataList = []
+          this.totalPage = 0
+        }
+        this.dataListLoading = false
+      })
+    },
+    // 每页数
+    sizeChangeHandle (val) {
+      this.pageSize = val
+      this.pageIndex = 1
+      this.getDataList()
+    },
+    // 当前页
+    currentChangeHandle (val) {
+      this.pageIndex = val
+      this.getDataList()
+    },
+    // 多选
+    selectionChangeHandle (val) {
+      this.dataListSelections = val
+    },
+    // 年度合同统计
+    annualReportHandle () {
+      this.annualReportVisible = true
+      this.$nextTick(() => {
+        this.$refs.reportPage.init()
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

Some files were not shown because too many files changed in this diff