更新
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '时间',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
@@ -102,33 +105,42 @@ const tableProps = [
|
||||
{
|
||||
prop: 'inCount',
|
||||
label: '上片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outCount',
|
||||
label: '下片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costSum',
|
||||
label: '深加工成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costPiece',
|
||||
label: '单片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costArea',
|
||||
label: '每平米成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '产线',
|
||||
@@ -140,30 +152,35 @@ const tableProps2 = [
|
||||
{
|
||||
prop: 'inCount',
|
||||
label: '上片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outCount',
|
||||
label: '下片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costSum',
|
||||
label: '深加工成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costPiece',
|
||||
label: '单片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costArea',
|
||||
label: '每平米成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -225,13 +242,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -288,26 +308,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -318,13 +332,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -346,15 +365,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
if (this.listQuery.startTime) {
|
||||
|
||||
Reference in New Issue
Block a user