| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- // 引入Day.js库
- const dayjs = require('dayjs');
- import { saleOrderProgressStatusEnum,purchaseOrderProgressStatusEnum } from '@/enum/dict';
- // 获取本月日期列表的函数
- function getDatesInMonth() {
- let year = dayjs().year();
- let month = dayjs().month();
- const dates = [];
- const startDate = dayjs(new Date(year, month, 1));
- const endDate = dayjs(new Date(year, month + 1, 1)).subtract(1, 'day');
- let currentDate = startDate;
- while (currentDate.isBefore(endDate) || currentDate.isSame(endDate, 'day')) {
- dates.push(currentDate.format('YYYY-MM-DD'));
- currentDate = currentDate.add(1, 'day');
- }
- return dates;
- }
- export const columns = [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'orderNo',
- label: '订单编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'needProduce',
- label: '类型',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return cellValue==1?'有客户生产性订单':cellValue==2?'无客户生产性订单':cellValue==4?'不定向订单':'库存式订单'
- }
- },
- {
- prop: 'productCodes',
- label: '产品编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productNames',
- label: '产品名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCount',
- label: '总数',
- align: 'center',
- width: 70,
- showOverflowTooltip: true
- },
- {
- prop: 'progress',
- label: '进度',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return saleOrderProgressStatusEnum.find(
- (val) => val.value == _row.progress
- )?.label;
- }
- }
- ];
- export const columns1 = [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'orderNo',
- label: '订单编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'sourceTypeName',
- label: '类型',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCodes',
- label: '产品编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productNames',
- label: '产品名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCount',
- label: '总数',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'progress',
- label: '进度',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return purchaseOrderProgressStatusEnum.find(
- (val) => val.value == _row.progress
- )?.label;
- },
- }
- ];
- export const barOption = (xData, series,name) => {
- return {
- tooltip: {
- formatter: (item) => {
- return item.name + ':' + item.seriesName + ' ' + item.value;
- },
- trigger: 'item'
- },
- legend: {
- // bottom: '2%',
- itemGap: window.innerHeight * 0.014,
- textStyle: {
- fontSize: window.innerHeight * 0.013
- }
- },
- grid: {
- left: 40,
- right: 55,
- bottom: '13%' //也可设置left和right设置距离来控制图表的大小
- },
- color: ['#1890ff'],
- xAxis: {
- type: 'category',
- data: xData,
- axisLabel: {
- fontSize: window.innerHeight * 0.012
- }
- },
- yAxis: [
- {
- type: 'value',
- name,
- nameTextStyle: {
- align: 'center',
- color: '#333',
- fontSize: window.innerHeight * 0.012,
- padding: [0, 20, -3, 0]
- }
- }
- ],
- series
- };
- };
|