123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <!-- 订单内部统计表-->
- <div id="interiorStatistics">
- <!-- 查询区域 -->
- <a-card :bordered="false">
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="8">
- <a-form-item label="起始年月">
- <a-range-picker
- style="width: 100%"
- placeholder="['开始年月', '结束年月']"
- format="YYYY-MM"
- :mode="mode2"
- :value="value"
- @panelChange="handlePanelChange"
- @change="monthChange"
- />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="部门">
- <a-input placeholder="请输入部门" v-model="queryParam.department"></a-input>
- <!-- <a-select placeholder="请选择部门" v-model="queryParam.department">
- <a-select-option :value="''">请选择</a-select-option>
- <a-select-option :value="0">业务一部</a-select-option>
- <a-select-option :value="1">业务二部</a-select-option>
- </a-select> -->
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="客户">
- <a-input placeholder="请输入客户" v-model="queryParam.customer"></a-input>
- <!-- <a-select placeholder="请选择客户" v-model="queryParam.customer">
- <a-select-option :value="''">请选择</a-select-option>
- <a-select-option :value="0">FD</a-select-option>
- <a-select-option :value="1">PMK</a-select-option>
- </a-select> -->
- </a-form-item>
- </a-col>
- <template v-if="toggleSearchStatus"></template>
- <a-col :md="6" :sm="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- <a @click="handleToggleSearch" style="margin-left: 8px">
- {{ toggleSearchStatus ? '收起' : '展开' }}
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- </a-card>
- <!-- 引入 echarts -->
- <a-card :bordered="false" style="marginTop:10px;">
- <div class="chart">
- <!-- 部门 "-->
- <div class="departmentChart" style="background:rgba(255, 165, 0,.08);">
- <departmentChart />
- </div>
- <!-- 客户 -->
- <div class="customerChart" style="background:rgba(134, 151, 201,.08);">
- <customerChart />
- </div>
- </div>
- </a-card>
- <!-- table rowKey="id" :scroll="{ x: 1500 }"-->
- <a-card :bordered="false" style="marginTop:10px;">
- <a-table
- bordered
- :row-key="record => record.id"
- :columns="interiorColumns"
- :data-source="interiorData"
- :loading="loading"
- :pagination="pagination"
- @change="handleTableChange"
- >
- </a-table>
- </a-card>
- </div>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import departmentChart from '@views/reportForms/order-statistics/chart/interior/departmentChart'
- import customerChart from '@views/reportForms/order-statistics/chart/interior/customerChart.vue'
- // import { external } from '@api/reportForms/order-statistics.js'
- export default {
- name: 'InteriorStatistics', // 订单内部统计表
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment, departmentChart, customerChart },
- data() {
- // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
- return {
- interiorColumns: [
- {
- title: '部门',
- width: 140,
- dataIndex: 'department',
- // fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '供应商分类',
- width: 120,
- dataIndex: 'supplierType',
- className: 'replacecolor'
- // customRender: function(text) {
- // if (text == '1') {
- // return '销售类型1'
- // }
- // if (text == '2') {
- // return '销售类型2'
- // }
- // if (text == '3') {
- // return '销售类型3'
- // }
- // if (text == '4') {
- // return '销售类型4'
- // }
- // }
- },
- {
- title: '供应商',
- width: 140,
- dataIndex: 'supplier',
- className: 'replacecolor'
- },
- {
- title: '计划到货月份',
- width: 120,
- dataIndex: 'planDeliveryMonth',
- customRender: text => {
- return moment(text).format('YYYY-MM')
- },
- className: 'replacecolor'
- },
- { title: '含税单价', width: 120, dataIndex: 'priceInTax', className: 'replacecolor' },
- {
- title: '实际数量',
- width: 120,
- dataIndex: 'realQuantity',
- className: 'replacecolor'
- },
- { title: '本币金额', width: 150, dataIndex: 'LocalMoney', className: 'replacecolor' }
- ],
- interiorData: [
- {
- department: '业务八部',
- supplierType: '成衣厂',
- supplier: '国云森',
- planDeliveryMonth: '2021-04',
- priceInTax: '87.89',
- realQuantity: '90,120,0000',
- LocalMoney: '301,929,04'
- }
- ],
- loading: false, // 表格加载
- // 查询条件
- queryParam: {
- vendorType: '内部',
- startYearMonth: '',
- endYearMonth: '',
- department: '',
- customer: ''
- },
- pagination: {
- // total: '', //总条数
- // current: '', //当前页
- // pageSize: '' //一页多少
- },
- mode2: ['month', 'month'],
- value: [], //起始月份
- dateFormat: 'YYYY-MM-DD'
- }
- },
- created() {
- this.getInteriorData()
- },
- methods: {
- getInteriorData() {
- this.$nextTick(() => {
- // external(this.queryParam).then(res => {
- // if (res.success) {
- // this.interiorData = res.result.records
- // console.log('订单外部列表', this.interiorData)
- // this.pagination = {
- // total: res.result.total,
- // current: 1,
- // pageSize: res.result.size
- // }
- // // console.log('分页器赋值:', this.pagination.total, this.pagination.current, this.pagination.pageSize)
- // }
- // })
- })
- },
- // 日期面板变化时的回调
- handlePanelChange(value, mode) {
- this.value = value
- this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]]
- // console.log('this.mode2', this.mode2)
- this.queryParam.startYearMonth = value[0].format('YYYY-MM')
- this.queryParam.endYearMonth = value[1].format('YYYY-MM')
- console.log('开始年月:', this.queryParam.startYearMonth)
- console.log('结束年月:', this.queryParam.endYearMonth)
- setFieldsValue({
- timeRange: value
- })
- },
- // 时间发生变化的回调,发生在用户选择时间时
- monthChange(value) {
- this.value = value
- console.log('what------monthChange')
- },
- searchQuery() {
- this.getInteriorData()
- },
- searchReset() {
- this.queryParam = {}
- this.value = [] //起始年月重置
- this.getInteriorData()
- },
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current
- this.getInteriorData()
- }
- },
- computed: {},
- mounted() {}
- }
- </script>
- <style lang="less" scoped>
- @import '~@assets/less/common.less';
- @import '~@assets/less/overwriter.less';
- /deep/ .ant-table-thead > tr > th {
- text-align: center;
- // font-weight: 700;
- }
- /deep/ .ant-table-tbody {
- text-align: center;
- }
- // /deep/ th.replacecolor {
- // background-color: #ccc;
- // }
- .departmentChart {
- margin-bottom: 20px;
- }
- </style>
|