Compare commits
19 Commits
57071bc24a
...
4801287c01
Author | SHA1 | Date | |
---|---|---|---|
4801287c01 | |||
40ff565b92 | |||
300a33dca4 | |||
6f937e1976 | |||
b315564489 | |||
|
aa582495de | ||
|
6adbdac0a4 | ||
135d9f0a60 | |||
|
e211e585af | ||
|
630e7a95b3 | ||
395a6e2967 | |||
8fcf6516a3 | |||
c339e5c2de | |||
|
75309dd9ea | ||
|
a0a9107863 | ||
|
94886eedde | ||
cb3406fac3 | |||
0c5245ef9b | |||
1ea2fe2738 |
@ -6,3 +6,12 @@ export function getLineAll() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据车间获得所有工厂产线列表
|
||||
export function getLinelistByRoom(query) {
|
||||
return request({
|
||||
url: '/base/core-production-line/listFilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-04 14:10:37
|
||||
* @LastEditTime: 2023-12-14 10:06:03
|
||||
* @LastEditTime: 2024-03-19 15:02:49
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -26,10 +26,11 @@ export function updateQualityInspectionBoxBtn(data) {
|
||||
}
|
||||
|
||||
// 删除安灯按钮16键对应
|
||||
export function deleteQualityInspectionBoxBtn(id) {
|
||||
export function deleteQualityInspectionBoxBtn(query) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-box-btn/delete?id=' + id,
|
||||
method: 'delete'
|
||||
url: 'base/quality-inspection-box-btn/deleteByLineSection',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-18 09:33:57
|
||||
* @LastEditTime: 2023-11-03 09:31:17
|
||||
* @LastEditTime: 2024-03-20 15:39:27
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -33,3 +33,12 @@ export function exportEnergyPlcExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function exportEquipmentTraceabilityExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-analysis/export-efficiency',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
@ -116,7 +116,9 @@ export const DICT_TYPE = {
|
||||
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
|
||||
|
||||
// ============== GROUP - 班组模块 =============
|
||||
WORK_SHOP: 'workshop'
|
||||
WORK_SHOP: 'workshop',
|
||||
// ============== GROUP - 质量模块 =============
|
||||
MATERIAL_GRADE: 'material_grade'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -123,6 +123,7 @@
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="setLine"
|
||||
placeholder="请选择车间名称">
|
||||
<el-option
|
||||
v-for="(dict, index) in getDictDatas('workshop')"
|
||||
@ -163,7 +164,7 @@
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
|
||||
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
|
||||
import { getLineAll } from '@/api/base/productionLine'
|
||||
import { getLinelistByRoom, getLineAll } from '@/api/base/productionLine'
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
|
||||
export default {
|
||||
@ -225,6 +226,14 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
setLine() {
|
||||
// 产线
|
||||
getLinelistByRoom({
|
||||
room: this.dataForm.roomNameDict
|
||||
}).then(res => {
|
||||
this.productLineList = res.data || []
|
||||
})
|
||||
},
|
||||
// 工艺变更
|
||||
materialMethodChange(val) {
|
||||
if (val === 2 && !this.dataForm.processFlowId) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 14:47:44
|
||||
* @LastEditTime: 2024-03-15 15:34:58
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -17,30 +17,47 @@
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="formContent">
|
||||
<el-form :model="dataForm" ref="dataForm" label-width="120px" label-position="top" class="demo-ruleForm" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">工单名称</div>
|
||||
<div class="lightTip">{{ dataForm.name }}</div>
|
||||
<el-form-item label="工单名称" prop="name">
|
||||
<!-- <el-input v-model="dataForm.name" autocomplete="off"></el-input> -->
|
||||
<span>{{ dataForm.name }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">工单编码</div>
|
||||
<div class="lightTip">{{ dataForm.code }}</div>
|
||||
<el-form-item label="工单编码" prop="code">
|
||||
<span>{{ dataForm.code }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">产品名称</div>
|
||||
<div class="lightTip">{{ dataForm.productName }}</div>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<span>{{ dataForm.productName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">产品规格</div>
|
||||
<div class="lightTip">{{ dataForm.specifications }}</div>
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<span>{{ dataForm.specifications }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">实际生产数量</div>
|
||||
<div class="lightTip">{{ dataForm.expectedTime }}</div>
|
||||
<el-form-item label="实际生产数量" prop="actualQuantity">
|
||||
<el-input v-model.number="dataForm.actualQuantity" autocomplete="off" style="width: 80%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际生产完成时间" prop="finishProduceTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.finishProduceTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择日期时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="attr-list">
|
||||
@ -99,11 +116,11 @@
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" type="primary" @click="goback()">关闭</el-button>
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> -->
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -117,7 +134,7 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getConOrderList, updateConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
|
||||
import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
|
||||
import SmallTitle from '../material/SmallTitle';
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
@ -148,11 +165,43 @@ export default {
|
||||
tableData: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
idAttrShow: false
|
||||
idAttrShow: false,
|
||||
rules: {
|
||||
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
statusChange({
|
||||
id: this.dataForm.id,
|
||||
status: 4,
|
||||
finishProduceTime: this.dataForm.finishProduceTime,
|
||||
actualQuantity: this.dataForm.actualQuantity
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
// this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.visible = false;
|
||||
// this.$emit("refreshDataList");
|
||||
// });
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
// this.materialAttrList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
@ -255,6 +304,9 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .item .el-form-item__label {
|
||||
color: red;
|
||||
} */
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
@ -263,6 +315,7 @@ export default {
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 14:42:32
|
||||
* @LastEditTime: 2024-03-15 15:40:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -97,6 +97,10 @@
|
||||
<div class="blodTip">关联工艺</div>
|
||||
<div class="lightTip">{{ dataForm.processFlowName }}</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="blodTip">车间名称</div>
|
||||
<div class="lightTip">{{ (dataForm.roomNameDict || dataForm.roomNameDict === 0) ? getDictDataLabel('workshop', dataForm.roomNameDict) : '-' }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -431,6 +431,7 @@ export default {
|
||||
opration = '终止'
|
||||
}
|
||||
console.log('22',val)
|
||||
if (param.status !== 4) {
|
||||
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@ -445,14 +446,18 @@ export default {
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
// 分配产量
|
||||
if (param.status === 4) {
|
||||
this.allocationOrder(param);
|
||||
}
|
||||
// if (param.status === 4) {
|
||||
// this.allocationOrder(param);
|
||||
// }
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else {
|
||||
// 完成弹出分配框
|
||||
this.allocationOrder(param);
|
||||
}
|
||||
}
|
||||
},
|
||||
allocationOrder(val) {
|
||||
@ -460,7 +465,7 @@ export default {
|
||||
getConOrderList({
|
||||
workOrderId: val.id,
|
||||
}).then((response) => {
|
||||
if (response.data.length > 0) {
|
||||
|
||||
this.$confirm('工单结束,可分配产量', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@ -469,11 +474,16 @@ export default {
|
||||
.then(() => {
|
||||
this.allocationVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.allocation.init(val.id, true);
|
||||
if (response.data.length > 0) {
|
||||
// 有绑定订单带id
|
||||
this.$refs.allocation.init(val.id);
|
||||
} else {
|
||||
this.$refs.allocation.init();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2024-01-22 09:55:32
|
||||
* @LastEditTime: 2024-03-20 08:36:01
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -23,7 +23,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标签类型" prop="typeId">
|
||||
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择打印方式" clearable>
|
||||
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择标签类型" clearable>
|
||||
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -46,6 +46,7 @@
|
||||
import BalanceChart from '../balanceChart';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AnalysisChart from './chart.vue';
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -82,7 +83,7 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'monthrange',
|
||||
dateType: 'month',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
@ -255,13 +256,13 @@ export default {
|
||||
const date = eq.dynamicName;
|
||||
eq.children.forEach((sub) => {
|
||||
if (sub.dynamicName == '设备CT')
|
||||
row[date + '_eq_ct'] = sub.dynamicValue;
|
||||
row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2);
|
||||
if (sub.dynamicName == '设备TT')
|
||||
row[date + '_eq_tt'] = sub.dynamicValue;
|
||||
row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2);
|
||||
if (sub.dynamicName == '产线CT')
|
||||
row[date + '_pl_ct'] = sub.dynamicValue;
|
||||
row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2);
|
||||
if (sub.dynamicName == '产线TT')
|
||||
row[date + '_pl_tt'] = sub.dynamicValue;
|
||||
row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2);
|
||||
});
|
||||
});
|
||||
this.tableData.push(row);
|
||||
@ -369,21 +370,63 @@ export default {
|
||||
// this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if(val) {
|
||||
const timeStamp = new Date(val).getMonth(); //标准时间转为时间戳,毫秒级别
|
||||
console.log('沃尔沃', timeStamp)
|
||||
const fullyear = new Date(val).getFullYear()
|
||||
let days = 0
|
||||
switch (timeStamp) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
days = 31
|
||||
break
|
||||
case 3:
|
||||
case 4:
|
||||
case 8:
|
||||
case 10:
|
||||
days = 30
|
||||
break
|
||||
case 1:
|
||||
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
||||
days = 29
|
||||
} else {
|
||||
days = 28
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
this.queryParams.startTime = new Date(fullyear, timeStamp, 1, 0, 0, 0).getTime() //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.queryParams.endTime = new Date(fullyear, timeStamp, days, 23, 59, 59).getTime() //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
}
|
||||
},
|
||||
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.lineId = btn.lineIds || null;
|
||||
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
|
||||
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
|
||||
console.log('2222', new Date(btn.timeArr).getFullYear())
|
||||
this.changeTime(btn.timeArr)
|
||||
// this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
|
||||
// this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
|
||||
|
||||
if (!btn.lineIds || !btn.timeArr.length) {
|
||||
if (!btn.lineIds || !btn.timeArr) {
|
||||
this.$message({
|
||||
message: '请选择产线和时间',
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.getList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<div
|
||||
id="analysischartLine"
|
||||
style="width: 100%;height: 100%;"
|
||||
></div>
|
||||
<div id="analysischartLine" style="width: 100%;height: 100%;"></div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
@ -60,7 +57,6 @@ export default {
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: []
|
||||
}
|
||||
obj.name = keys[k]
|
||||
|
@ -4,38 +4,23 @@
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
<el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="抄表日期" prop="recordTime">
|
||||
<el-date-picker
|
||||
v-model="form.recordTime"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="timestamp"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;">
|
||||
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
|
||||
placeholder="选择日期" style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='24'>
|
||||
<base-table
|
||||
border
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitFun="inputChange"
|
||||
@emitButtonClick="emitButtonClick"
|
||||
/>
|
||||
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -48,12 +33,12 @@ import SelectArea from './SelectArea'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '表名',
|
||||
label: '表名*',
|
||||
subcomponent: SelectArea
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表数',
|
||||
label: '抄表数*',
|
||||
subcomponent: InputArea
|
||||
}
|
||||
]
|
||||
|
@ -185,7 +185,7 @@ export default {
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({ ...this.queryParams });
|
||||
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => { })
|
||||
|
@ -2,27 +2,12 @@
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:selectWidth="55"
|
||||
:max-height="tableH"
|
||||
@selection-change="selectChange"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -71,7 +56,8 @@ export default {
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId'
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
|
@ -127,9 +127,11 @@ export default {
|
||||
name: '',
|
||||
code: '',
|
||||
unit: '',
|
||||
singlePrice: 0,
|
||||
pricingMethod: 2,
|
||||
leaderName: '',
|
||||
push: false
|
||||
dim: '',
|
||||
push: false,
|
||||
description: ''
|
||||
},
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
@ -162,14 +164,15 @@ export default {
|
||||
this.form.code = res.data.code
|
||||
this.form.unit = res.data.unit
|
||||
this.form.pricingMethod = res.data.pricingMethod
|
||||
this.form.leaderName = res.data.leaderName
|
||||
this.form.push = res.data.push ? true : false
|
||||
this.form.description = res.data.description
|
||||
switch (this.form.pricingMethod) {
|
||||
case 0:
|
||||
this.tableData1 = res.data.segPriceList || []
|
||||
break;
|
||||
case 1:
|
||||
this.tableData2 = res.data.usedPriceList || []
|
||||
this.form.dim = res.data.dim
|
||||
break;
|
||||
default:
|
||||
this.form.singlePrice = res.data.singlePrice || 0
|
||||
|
@ -2,40 +2,22 @@
|
||||
<div class="app-container energyOverlimitLog">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<el-tabs v-model="activeName" @tab-click="toggleTab">
|
||||
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
|
||||
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 列表 -->
|
||||
<div v-if="activeName === 'auto'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH" />
|
||||
</div>
|
||||
<div v-if="activeName === 'manual'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list2"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps2"
|
||||
:table-data="list2" :max-height="tableH" />
|
||||
</div>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -199,7 +181,13 @@ export default {
|
||||
item.limitValue = ''
|
||||
}
|
||||
})
|
||||
if (this.queryParams.method === '1') {
|
||||
this.list = arr
|
||||
this.list2 = []
|
||||
} else {
|
||||
this.list2 = arr
|
||||
this.list1 = []
|
||||
}
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
@ -232,21 +220,27 @@ export default {
|
||||
height: 2px;
|
||||
background-color: #e4e7ed;
|
||||
}
|
||||
|
||||
.el-tabs__nav-wrap::after {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.el-tabs__item:hover {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.el-tabs__item.is-active {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.searchBarBox {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
@ -35,20 +35,20 @@ import {
|
||||
} from '@/api/equipment/analysis/statistics';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '时间段',
|
||||
filter: (val) => {
|
||||
if (val && val.length > 0) {
|
||||
return (
|
||||
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
' ~ ' +
|
||||
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
);
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// prop: 'recordTime',
|
||||
// label: '时间段',
|
||||
// filter: (val) => {
|
||||
// if (val && val.length > 0) {
|
||||
// return (
|
||||
// moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
// ' ~ ' +
|
||||
// moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
// );
|
||||
// }
|
||||
// return '-';
|
||||
// },
|
||||
// },
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
@ -158,7 +158,7 @@ export default {
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
|
@ -19,6 +19,7 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
max-height="600"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -93,17 +94,29 @@ export default {
|
||||
{ prop: 'downCount', label: '故障次数' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '请选择月份',
|
||||
// placeholder: '请选择月份',
|
||||
// param: 'month',
|
||||
// selectOptions: Array(12)
|
||||
// .fill(0)
|
||||
// .map((v, i) => ({
|
||||
// id: i + 1,
|
||||
// name: `${i + 1}月`,
|
||||
// })),
|
||||
// },
|
||||
{
|
||||
type: 'select',
|
||||
label: '请选择月份',
|
||||
placeholder: '请选择月份',
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'month',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
width: 240,
|
||||
param: 'month',
|
||||
selectOptions: Array(12)
|
||||
.fill(0)
|
||||
.map((v, i) => ({
|
||||
id: i + 1,
|
||||
name: `${i + 1}月`,
|
||||
})),
|
||||
},
|
||||
{
|
||||
__index: 'line',
|
||||
@ -111,6 +124,7 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -164,7 +178,13 @@ export default {
|
||||
},
|
||||
});
|
||||
if (code === 0) {
|
||||
this.list = data;
|
||||
this.list = data.map(item => {
|
||||
item.mtbf = item.mtbf?.toFixed(2)
|
||||
item.mttr = item.mttr?.toFixed(2)
|
||||
item.workTime = item.workTime?.toFixed(2)
|
||||
item.downTime = item.downTime?.toFixed(2)
|
||||
return item
|
||||
});
|
||||
} else {
|
||||
this.list.splice(0);
|
||||
}
|
||||
@ -174,12 +194,14 @@ export default {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
if (btn.month) {
|
||||
this.queryParams.recordTime = [
|
||||
moment()
|
||||
.month(btn.month - 1)
|
||||
.format('YYYY-MM') + '-01 00:00:00',
|
||||
moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
|
||||
];
|
||||
// this.queryParams.recordTime = [
|
||||
// moment()
|
||||
// .month(btn.month - 1)
|
||||
// .format('YYYY-MM') + '-01 00:00:00',
|
||||
// moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
|
||||
// ];
|
||||
this.queryParams.recordTime = [btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00']
|
||||
console.log(btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00')
|
||||
} else {
|
||||
this.queryParams.recordTime = null;
|
||||
}
|
||||
|
@ -464,7 +464,9 @@ export default {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备采集配置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 16:47:02
|
||||
* @LastEditTime: 2024-03-15 18:54:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
|
@ -99,7 +99,7 @@
|
||||
<el-option
|
||||
v-for="plc in plcList"
|
||||
:key="plc.id"
|
||||
:label="plc.name"
|
||||
:label="plc.plcTableName"
|
||||
:value="plc.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -404,9 +404,9 @@ export default {
|
||||
this.eqList = data;
|
||||
});
|
||||
this.$axios({
|
||||
url: '/base/equipment-plc/page',
|
||||
url: '/base/equipment-plc/listAll',
|
||||
}).then(({ code, data }) => {
|
||||
this.plcList = data.list;
|
||||
this.plcList = data;
|
||||
});
|
||||
}
|
||||
for (const section of this.sections) {
|
||||
|
@ -2,14 +2,15 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-04 11:14:28
|
||||
* @LastEditTime: 2024-03-18 15:47:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
:wrapper-closable="true"
|
||||
:before-close="beforeClose"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@ -269,6 +270,17 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
if (!this.isdetail) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
async getDict() {
|
||||
// 班次列表
|
||||
const res = await groupClassesListAll();
|
||||
@ -372,6 +384,7 @@ export default {
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.dataForm.checkPerson = [this.$store.getters.nickname]
|
||||
this.idAttrShow = false
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-01 19:44:59
|
||||
* @LastEditTime: 2024-03-15 18:38:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -27,7 +27,7 @@
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
|
||||
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="dataForm.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
|
@ -17,7 +17,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="180"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -52,6 +52,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@ -111,6 +112,12 @@ export default {
|
||||
width: 150,
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'checkPeriod',
|
||||
label: '巡检频率(天/次)',
|
||||
width: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'confirmTimeLimit',
|
||||
label: '确认时限',
|
||||
|
@ -220,7 +220,7 @@
|
||||
label="维修工"
|
||||
prop="repairman"
|
||||
:rules="[
|
||||
{ required: true, message: '维修工不能为空', trigger: 'blur' },
|
||||
{ required: false, message: '维修工不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.repairman"
|
||||
@ -262,7 +262,7 @@
|
||||
prop="repairMode"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
required: false,
|
||||
message: '维修方式不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
|
@ -83,33 +83,41 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableProps: [
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'inQuantity', label: '投入数' },
|
||||
{ prop: 'outQuantity', label: '产出数' },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'inQuantity', label: '投入数', minWidth: 80, showOverflowtooltip: true },
|
||||
{ prop: 'outQuantity', label: '产出数', minWidth: 80, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'run',
|
||||
label: '是否运行',
|
||||
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
filter: (val) =>
|
||||
val != null ? ['正常', '计划停机', '故障'][val] : '',
|
||||
minWidth: 90,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'error',
|
||||
label: '是否故障',
|
||||
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'quantityRecordTime',
|
||||
label: '生产量记录时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
|
||||
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
|
||||
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
|
||||
// { prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
|
||||
],
|
||||
searchBarForm: {
|
||||
|
@ -17,7 +17,7 @@
|
||||
padding: 16px 16px 0;
|
||||
border-radius: 8px;
|
||||
">
|
||||
<div class="blue-title">生产节拍时序图</div>
|
||||
<!-- <div class="blue-title">生产节拍时序图</div> -->
|
||||
<!-- <h1>设备状态时序图</h1> -->
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
@ -76,6 +76,7 @@
|
||||
|
||||
<script>
|
||||
import LineChart from './components/lineChart.vue';
|
||||
import moment from 'moment';
|
||||
// import response from './response.json';
|
||||
|
||||
export default {
|
||||
@ -84,6 +85,7 @@ export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
startTime: null, // new Date(2023, 8, 26, 0, 0, 0, 0).getTime(),
|
||||
accumulators: new Map(),
|
||||
searchBarFormConfig: [
|
||||
@ -94,6 +96,7 @@ export default {
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
onchange: true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@ -101,11 +104,12 @@ export default {
|
||||
placeholder: '请选择工段',
|
||||
selectOptions: [],
|
||||
param: 'sectionId',
|
||||
filterable: true
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
label: '日期',
|
||||
dateType: 'date', // datetimerange
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd',
|
||||
@ -263,7 +267,11 @@ export default {
|
||||
this.initProductline();
|
||||
this.initWorksection();
|
||||
this.initEquipment();
|
||||
// this.getList();
|
||||
let end = moment().format('YYYY-MM-DD 23:59:59')
|
||||
let start = moment().format('YYYY-MM-DD 00:00:00')
|
||||
this.searchBarFormConfig[2].defaultSelect = start
|
||||
this.queryParams.recordTime = [start, end]
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleSearchBarBtnClick({ btnName, ...payload }) {
|
||||
@ -293,8 +301,10 @@ export default {
|
||||
},
|
||||
|
||||
handleSearchBarChanged({ param, value }) {
|
||||
this.searchBarFormConfig[1].defaultSelect = null
|
||||
if (!value) {
|
||||
this.searchBarFormConfig[1].selectOptions = [];
|
||||
// this.searchBarFormConfig[1].defaultSelect = null
|
||||
return;
|
||||
}
|
||||
switch (param) {
|
||||
@ -486,7 +496,10 @@ export default {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/monitoring/equipment-monitor/quantity-series',
|
||||
method: 'get',
|
||||
params: this.queryParams,
|
||||
params: {
|
||||
equipmentId: this.queryParams.equipmentId,
|
||||
recordTime: this.queryParams.recordTime
|
||||
}
|
||||
});
|
||||
|
||||
this.queryParams.equipmentId = null; // 清空一下
|
||||
|
@ -17,7 +17,7 @@
|
||||
padding: 16px 16px 0;
|
||||
border-radius: 8px;
|
||||
">
|
||||
<div class="blue-title">生产节拍时序图</div>
|
||||
<!-- <div class="blue-title">生产节拍时序图</div> -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@ -119,6 +119,7 @@ export default {
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
onchange: true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@ -126,6 +127,7 @@ export default {
|
||||
placeholder: '请选择工段',
|
||||
selectOptions: [],
|
||||
param: 'sectionId',
|
||||
filterable: true
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-08 13:59:20
|
||||
* @LastEditTime: 2024-03-20 09:18:30
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -42,10 +42,8 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="当前状态" prop="enabled">
|
||||
<el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择当前状态">
|
||||
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -93,6 +93,7 @@ export default {
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'equipmentId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
@ -146,6 +147,26 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否确认删除设备物料bom${name}`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
getDict() {
|
||||
getEquipmentList().then((res) => {
|
||||
// console.log(res);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-08 09:14:38
|
||||
* @LastEditTime: 2024-03-20 09:17:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -43,10 +43,12 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="当前状态" prop="enabled">
|
||||
<!-- <el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" /> -->
|
||||
<el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
|
||||
<!-- <el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择当前状态">
|
||||
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -93,6 +93,8 @@ export default {
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'equipmentId',
|
||||
filterable: true
|
||||
// filter
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
@ -158,6 +160,26 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否确认删除设备参数bom${ name}`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
|
@ -189,7 +189,7 @@ export default {
|
||||
input: true,
|
||||
label: '工艺编码',
|
||||
prop: 'code',
|
||||
// url: '/base/core-equipment/getCode',
|
||||
url: '/extend/process-flow/getCode',
|
||||
},
|
||||
],
|
||||
[
|
||||
|
@ -210,8 +210,8 @@ export default {
|
||||
mobileCodeTimer: 0,
|
||||
loginForm: {
|
||||
loginType: 'uname',
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
username: '',
|
||||
password: '',
|
||||
captchaVerification: '',
|
||||
mobile: '',
|
||||
mobileCode: '',
|
||||
@ -297,9 +297,9 @@ export default {
|
||||
this.handleLogin({});
|
||||
},
|
||||
getCookie() {
|
||||
const username = getUsername();
|
||||
const password = getPassword();
|
||||
const rememberMe = getRememberMe();
|
||||
// const username = getUsername();
|
||||
// const password = getPassword();
|
||||
// const rememberMe = getRememberMe();
|
||||
const tenantName = getTenantName();
|
||||
this.loginForm = {
|
||||
...this.loginForm,
|
||||
|
@ -272,7 +272,7 @@ export default {
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
// { prop: 'externalCode', label: '设备编码' },
|
||||
{ prop: 'equipmentId', label: '设备编码' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'totalQuantity', label: '加工数量' },
|
||||
],
|
||||
|
@ -5,7 +5,8 @@
|
||||
<span class="blueTitle"></span>
|
||||
<span>集团编码: {{ orderGroupMsg.code }}</span>
|
||||
</div>
|
||||
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon
|
||||
icon-class="return" /> 返回</el-button>
|
||||
<div style="padding-left: 14px;">
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
@ -153,13 +154,8 @@
|
||||
<span class="blueTitle"></span>
|
||||
<span>工单信息</span>
|
||||
</div>
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="item.coreWorkOrderRespVOS || []"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps"
|
||||
:table-data="item.coreWorkOrderRespVOS || []" :max-height="tableH" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -192,14 +188,14 @@ const tableProps = [
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100
|
||||
prop: 'planAssignmentQuantity',
|
||||
label: '计划分配数量',
|
||||
width: 110
|
||||
},
|
||||
{
|
||||
prop: 'actualQuantity',
|
||||
label: '实际加工量',
|
||||
width: 100
|
||||
prop: 'actualAssignmentQuantity',
|
||||
label: '实际分配数量',
|
||||
width: 110
|
||||
},
|
||||
{
|
||||
prop: 'actualArea',
|
||||
@ -285,9 +281,12 @@ export default {
|
||||
height: calc(100vh - 120px - 8px);
|
||||
background-color: rgb(242, 244, 249);
|
||||
overflow: auto;
|
||||
.box1, .box2 {
|
||||
|
||||
.box1,
|
||||
.box2 {
|
||||
background-color: #fff;
|
||||
border-radius: 9px;
|
||||
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
@ -295,6 +294,7 @@ export default {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.lightTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
@ -306,15 +306,18 @@ export default {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.box2 {
|
||||
height: 415px;
|
||||
padding: 12px 16px 0;
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.box1 {
|
||||
height: 215px;
|
||||
padding: 16px 16px 0 16px;
|
||||
}
|
||||
|
||||
.boxTitle {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
@ -322,6 +325,7 @@ export default {
|
||||
color: #000000;
|
||||
margin: 0 10px 20px 0;
|
||||
}
|
||||
|
||||
.blueTitle {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
|
@ -2,14 +2,17 @@
|
||||
<div class="orderDetailData">
|
||||
<div v-show="!isSingle" style="position: relative;padding-right: 90px;">
|
||||
<TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName' />
|
||||
<el-button type="primary" plain size="small" style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
<el-button type="primary" plain size="small"
|
||||
style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon
|
||||
icon-class="return" /> 返回</el-button>
|
||||
</div>
|
||||
<div class="box1">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>订单编码: {{ orderMsg.code }}</span>
|
||||
</div>
|
||||
<el-button v-show="isSingle" type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
<el-button v-show="isSingle" type="primary" plain size="small" style="float: right;"
|
||||
@click="returnOrderManage"><svg-icon icon-class="return" /> 返回</el-button>
|
||||
<div style="padding-left: 14px;">
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
@ -85,13 +88,8 @@
|
||||
<span>工单信息</span>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps1"
|
||||
:table-data="list1"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps1"
|
||||
:table-data="list1" :max-height="tableH" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -125,14 +123,14 @@ const tableProps1 = [
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100
|
||||
prop: 'planAssignmentQuantity',
|
||||
label: '计划分配数量',
|
||||
width: 110
|
||||
},
|
||||
{
|
||||
prop: 'actualQuantity',
|
||||
label: '实际加工量',
|
||||
width: 100
|
||||
prop: 'actualAssignmentQuantity',
|
||||
label: '实际分配数量',
|
||||
width: 110
|
||||
},
|
||||
{
|
||||
prop: 'actualArea',
|
||||
@ -253,18 +251,23 @@ export default {
|
||||
<style lang='scss' scoped>
|
||||
.orderDetailData {
|
||||
background-color: rgb(242, 244, 249);
|
||||
.box1, .box2{
|
||||
|
||||
.box1,
|
||||
.box2 {
|
||||
background-color: #fff;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
.box2 {
|
||||
height: calc(100vh - 351px);
|
||||
padding: 12px 16px 0;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.box1 {
|
||||
height: 215px;
|
||||
padding: 16px 16px 0 16px;
|
||||
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
@ -272,6 +275,7 @@ export default {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.lightTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
@ -280,6 +284,7 @@ export default {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.boxTitle {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
@ -287,6 +292,7 @@ export default {
|
||||
color: #000000;
|
||||
margin: 0 10px 20px 0;
|
||||
}
|
||||
|
||||
.blueTitle {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
|
@ -108,6 +108,7 @@ export default {
|
||||
{
|
||||
prop: 'inspectionInfoList',
|
||||
label: '检测内容',
|
||||
showOverflowtooltip: true,
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
@ -165,13 +166,20 @@ export default {
|
||||
this.resetForm('form');
|
||||
},
|
||||
deleteHandle(id, name, index, data) {
|
||||
console.log(data)
|
||||
// const params = new URLSearchParams();
|
||||
// params.append('productionLineId', data.productionLineId)
|
||||
// params.append('sectionId', data.sectionId);
|
||||
this.$confirm(`确认要删除产线名为${data.productionLineName}的数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.urlOptions.deleteURL({
|
||||
'productionLineId': data.productionLineId,
|
||||
'sectionId': data.sectionId,
|
||||
}).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-30 10:53:32
|
||||
* @LastEditTime: 2024-02-23 15:16:35
|
||||
* @LastEditTime: 2024-03-15 14:07:15
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -31,7 +31,7 @@
|
||||
<el-col :span="12" style="border-left: 1px solid #ccc">
|
||||
<div class="select-list">
|
||||
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
|
||||
<span style="">选择工序</span>
|
||||
<span style="">选择工段</span>
|
||||
</div>
|
||||
|
||||
<BomSelection ref="materialsBomList" :key="materialsBomList.equipmentId + 'materialsBomList'"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-30 10:52:01
|
||||
* @LastEditTime: 2024-02-01 14:43:53
|
||||
* @LastEditTime: 2024-03-15 14:06:55
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -64,7 +64,7 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" /> -->
|
||||
|
||||
<base-dialog dialogTitle="选择产线工序" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
|
||||
<base-dialog dialogTitle="选择产线工段" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<el-row>
|
||||
<el-form ref="dataForm" :model="dataForm" label-width="120px" :inline="true" class="demo-form-inline">
|
||||
|
@ -34,6 +34,7 @@ import basicPage from './basic-page';
|
||||
import moment from 'moment';
|
||||
import addOrUpdate from './dialogForm.vue';
|
||||
import ProcessBomList from './ProcessBomList.vue';
|
||||
import row from './row.vue';
|
||||
export default {
|
||||
name: 'QualityInspectionBoxBtn',
|
||||
mixins: [basicPage],
|
||||
@ -116,6 +117,7 @@ export default {
|
||||
{
|
||||
prop: 'datas',
|
||||
label: '产线及工段',
|
||||
subcomponent: row
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
@ -168,7 +170,7 @@ export default {
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
this.tableData = res.data.list.map((item) => {
|
||||
return {
|
||||
datas: item.strList ? item.strList.toString() : null,
|
||||
datas: item.strList || null,
|
||||
nickName: item.nickName,
|
||||
userName: item.userName,
|
||||
userId: item.userId
|
||||
|
@ -0,0 +1,46 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-03-20 10:01:01
|
||||
* @LastEditTime: 2024-03-20 10:03:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="tableInner">
|
||||
<div v-for="(item,index) in injectData.datas" :key="index">
|
||||
<span> {{ item }} </span>
|
||||
</div>
|
||||
<!-- <el-input-number v-model="list[itemProp]" @blur="changeInput" :min="0" :max="100000000" style="width: 100%" :controls='false'></el-input-number> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'InputArea',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
itemProp: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// changeInput() {
|
||||
// this.$emit('emitData', this.list)
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
// .tableInner .el-input__inner {
|
||||
// border: none;
|
||||
// padding: 0;
|
||||
// height: 33px;
|
||||
// }
|
||||
</style>
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-08 13:46:17
|
||||
* @LastEditTime: 2024-03-12 14:54:05
|
||||
* @LastEditTime: 2024-03-15 14:54:38
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -247,6 +247,8 @@ export default {
|
||||
// code: [{ required: true, message: "设备物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
|
||||
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
|
||||
checkResult: [{ required: true, message: "判定结果不能为空", trigger: "change" }],
|
||||
|
||||
// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
}
|
||||
@ -405,7 +407,7 @@ export default {
|
||||
getSupplierList().then(res => {
|
||||
this.supplierList = res.data
|
||||
})
|
||||
const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
const res = await getDictDatas(this.DICT_TYPE.MATERIAL_GRADE)
|
||||
console.log('111', res)
|
||||
this.gradeList = res
|
||||
},
|
||||
|
@ -59,12 +59,18 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'materialGrade',
|
||||
label: '原料等级'
|
||||
label: '原料等级',
|
||||
filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
|
||||
},
|
||||
{
|
||||
prop: 'checkerName',
|
||||
label: '检测人员'
|
||||
},
|
||||
{
|
||||
prop: 'checkTime',
|
||||
label: '检测时间',
|
||||
filter: parseTime
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
@ -112,6 +118,19 @@ export default {
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'materialId',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'checkTime',
|
||||
defaultSelect: [],
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -159,7 +178,7 @@ export default {
|
||||
});
|
||||
},
|
||||
deleteHandle(id, name, index, data) {
|
||||
this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
|
||||
this.$confirm(`确认要删除序号${index}?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
@ -189,7 +208,7 @@ export default {
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.materialId = val.materialId ? val.materialId : undefined;
|
||||
// this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||
this.listQuery.checkTime = val.checkTime ? val.checkTime : undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
|
@ -145,7 +145,7 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'typeName', label: '类型名称', },
|
||||
{ prop: 'typeName', label: '检测类型', },
|
||||
{ prop: 'content', label: '检测内容', },
|
||||
{ prop: 'code', label: '检测编码', },
|
||||
{ prop: 'remark', label: '备注', },
|
||||
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="30%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2024-03-01 10:33:48
|
||||
* @LastEditTime: 2024-03-20 09:38:10
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
|
||||
<el-row :gutter="24">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单号" prop="workOrderId">
|
||||
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号">
|
||||
@ -22,7 +22,8 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报废时间" prop="logTime">
|
||||
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
|
||||
<el-date-picker style="width: 100%;" v-model="dataForm.logTime" type="datetime" value-format="timestamp"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -51,18 +52,17 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="请输入描述" />
|
||||
<el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
@ -130,15 +130,14 @@ export default {
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
// this.getCurrentTime()
|
||||
this.getWorksectionById()
|
||||
// this.dataForm.logTime = new Date()
|
||||
},
|
||||
methods: {
|
||||
getCurrentTime() {
|
||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
this.dataForm.logTime = new Date()
|
||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
// getCurrentTime() {
|
||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
// // console.log(this.dataForm.logTime);
|
||||
// },
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList()
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2024-02-28 09:51:25
|
||||
* @LastEditTime: 2024-03-08 13:46:46
|
||||
* @LastEditTime: 2024-03-20 09:42:46
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -24,10 +24,24 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
activated() {
|
||||
mounted() {
|
||||
},
|
||||
// activated() {
|
||||
// },
|
||||
methods: {
|
||||
format(dataString) {
|
||||
//dataString是整数,否则要parseInt转换
|
||||
var time = new Date(dataString);
|
||||
var year = time.getFullYear();
|
||||
var month = time.getMonth() + 1;
|
||||
var day = time.getDate();
|
||||
var hour = time.getHours();
|
||||
var minute = time.getMinutes();
|
||||
var second = time.getSeconds();
|
||||
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second)
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
@ -35,12 +49,14 @@ export default {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
this.$refs["dataForm"].resetFields()
|
||||
this.dataForm.logTime = new Date()
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
console.log(response)
|
||||
this.dataForm = response.data
|
||||
this.dataForm.detId = response.data.detIdList
|
||||
this.getWorksectionById(this.dataForm.lineId)
|
||||
this.dataForm.logTime = new Date(response.data.logTime)
|
||||
|
||||
// if (this.setData) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2024-03-01 10:18:39
|
||||
* @LastEditTime: 2024-03-20 09:40:42
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -57,18 +57,17 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="请输入描述" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注" disabled />
|
||||
<el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
@ -110,6 +109,7 @@ export default {
|
||||
name: '自动',
|
||||
}
|
||||
],
|
||||
sectionList:[],
|
||||
visible:false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
@ -138,19 +138,18 @@ export default {
|
||||
mounted() {
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
this.getCurrentTime()
|
||||
// this.getWorksectionById()
|
||||
// this.getCurrentTime()
|
||||
},
|
||||
methods: {
|
||||
// init() {
|
||||
// this.dialogVisible = true
|
||||
// },
|
||||
getCurrentTime() {
|
||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
this.dataForm.logTime = new Date()
|
||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
// getCurrentTime() {
|
||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
// this.dataForm.logTime = new Date()
|
||||
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
// console.log(this.dataForm.logTime);
|
||||
// },
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList()
|
||||
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="30%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
@ -89,7 +89,9 @@
|
||||
// import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import PieChart from './components/pieChart.vue';
|
||||
|
||||
import {
|
||||
exportEquipmentTraceabilityExcel
|
||||
} from '@/api/quality/deviceParameters';
|
||||
export default {
|
||||
name: 'EfficiencyAnalysis',
|
||||
mixins: [basicPageMixin],
|
||||
@ -256,7 +258,7 @@ export default {
|
||||
// parent: 'dateFilterType',
|
||||
// 时间段选择
|
||||
type: 'datePicker',
|
||||
// label: '时间段',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
@ -284,6 +286,12 @@ export default {
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
@ -372,6 +380,23 @@ export default {
|
||||
this.trendOpen = true;
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出设备状态追溯?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTraceabilityExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备状态追溯.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
@ -405,6 +430,7 @@ export default {
|
||||
];
|
||||
}
|
||||
} else {
|
||||
this.handleExport()
|
||||
this.queryParams.recordTime = null;
|
||||
}
|
||||
this.getList();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-01 16:43:10
|
||||
* @LastEditTime: 2024-03-20 09:25:40
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -121,10 +121,10 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '工单开始时间',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
@ -251,8 +251,8 @@ export default {
|
||||
this.listQuery.orderName = val.orderName ? val.orderName :undefined
|
||||
// this.queryParams.status = val.status
|
||||
if (val.timeVal && val.timeVal.length != 0 ) {
|
||||
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
|
||||
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
|
||||
this.listQuery.startTime = val.timeVal[0]
|
||||
this.listQuery.endTime = val.timeVal[1]
|
||||
} else {
|
||||
this.listQuery.startTime = undefined
|
||||
this.listQuery.endTime = undefined
|
||||
|
@ -263,7 +263,7 @@ export default {
|
||||
width: 90,
|
||||
prop: 'source',
|
||||
label: '来源',
|
||||
filter: (val) => ['平板端', '网页端'][val],
|
||||
filter: (val) => val == 1 ? '平板端' : '网页端',
|
||||
},
|
||||
],
|
||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
||||
@ -457,7 +457,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
let str = this.form.checkPerson.join()
|
||||
let str = this.form.checkPerson ? this.form.checkPerson.join() : null
|
||||
this.form.checkPerson = str
|
||||
if (this.form.id != null) {
|
||||
updateQualityInspectionRecord(this.form).then((response) => {
|
||||
|
@ -223,7 +223,7 @@ export default {
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'sumScrap',
|
||||
label: '未检测总数',
|
||||
label: '未通过检测总数',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
|
@ -1,13 +1,15 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-24 15:15:24
|
||||
* @LastEditTime: 2024-03-13 15:21:30
|
||||
* @LastEditTime: 2024-03-18 16:00:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<!-- <el-alert title="自定义 close-text" type="warning" close-text="知道了">
|
||||
</el-alert> -->
|
||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||
<el-form-item label="日" prop="reportTime">
|
||||
<el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
@ -21,8 +23,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType"
|
||||
@refreshDataList="getDataList" />
|
||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
|
||||
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
||||
<!-- <pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
@ -37,7 +39,8 @@ import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
||||
import inputTable from './inputTable.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
import moment from 'moment'
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
export default {
|
||||
components: { inputTable },
|
||||
data() {
|
||||
@ -79,6 +82,8 @@ export default {
|
||||
},
|
||||
// 获取数据列表
|
||||
multipliedByHundred(str) {
|
||||
// console.log(str)
|
||||
if (str != 0) {
|
||||
let floatVal = parseFloat(str);
|
||||
if (isNaN(floatVal)) {
|
||||
return 0;
|
||||
@ -94,30 +99,58 @@ export default {
|
||||
strVal += '0';
|
||||
}
|
||||
return parseFloat(strVal);
|
||||
}
|
||||
|
||||
},
|
||||
async getDataList() {
|
||||
this.dataListLoading = true;
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
item.lineName = it.name
|
||||
|
||||
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
this.dataListLoading = true
|
||||
if (this.listQuery.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
res.data.forEach((ele, index) => {
|
||||
if (ele.det === false) {
|
||||
res.data[index].lineName = '合计'
|
||||
this.remark = res.data[index].remark
|
||||
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
})
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
res.data.forEach(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
console.log(item)
|
||||
item.lineName = it.name
|
||||
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
this.listQuery.total = response.data.length;
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
// this.tableData = response.data.filter(item => {
|
||||
// this.proLineList.forEach(it => {
|
||||
// if (item.lineId === it.id) {
|
||||
// item.lineName = it.name
|
||||
|
||||
// }
|
||||
// })
|
||||
// if (item.det === false) {
|
||||
// this.all = {
|
||||
// id: item.id,
|
||||
// remark: item.remark
|
||||
// }
|
||||
// }
|
||||
// return item.det === true
|
||||
// });
|
||||
this.listQuery.total = res.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
@ -142,6 +175,9 @@ export default {
|
||||
// console.log(val.setHours(7, 0, 0))
|
||||
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
|
||||
// let time = this.format(val.setHours(7, 0, 0))
|
||||
this.startTimeStamp = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.endTimeStamp = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// console.log(this.listQuery.reportTime);
|
||||
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
console.log(this.listQuery.reportTime);
|
||||
@ -176,17 +212,33 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '原片生产日报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩日原片生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-13 14:10:04
|
||||
* @LastEditTime: 2024-03-13 15:27:43
|
||||
* @LastEditTime: 2024-03-18 09:57:30
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -9,10 +9,10 @@
|
||||
<div>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!edit" size="small" @click="edit = true">编辑</el-button>
|
||||
<el-button v-if="edit" size="small" @click="edit= false">返回</el-button>
|
||||
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button v-if="edit" size="small" @click="updateData">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="data" border show-summary style="width: 100%">
|
||||
<el-table :id="id" :data="data" border style="width: 100%">
|
||||
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
|
||||
:align="item.align ? item.align : 'left'">
|
||||
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
|
||||
@ -20,14 +20,16 @@
|
||||
<el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!edit">{{ scope.row[y.prop] }}</span>
|
||||
<el-input v-else v-model="scope.row[y.prop]"></el-input>
|
||||
<el-input @change="handleChange" :disabled="y.prop == 'dailyOutputTrend' || y.prop === 'originalGlassStatisticsTrend'
|
||||
|| y.prop === 'actualProductTrend' || y.prop === 'originalGlassPassTrend' || y.prop === 'originalGlassPassNow' || y.prop === 'originalGlassPassHis'
|
||||
" v-else v-model="scope.row[y.prop]"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-input type="textarea" v-model="sum.remark" placeholder="备注" :disabled="!edit"
|
||||
:autosize="{ minRows: 2, maxRows: 6}"></el-input>
|
||||
<el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}">
|
||||
</el-input>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -130,6 +132,10 @@ const cols = [
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default:'exportTable'
|
||||
},
|
||||
time: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
@ -150,6 +156,7 @@ const cols = [
|
||||
data() {
|
||||
return {
|
||||
cols,
|
||||
remark:null,
|
||||
edit: false,
|
||||
};
|
||||
},
|
||||
@ -196,15 +203,43 @@ const cols = [
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
// this.disabled = true
|
||||
this.edit = false
|
||||
},
|
||||
handleChange(e) {
|
||||
// console.log(q)
|
||||
console.log(e);
|
||||
},
|
||||
updateData() {
|
||||
let obj = {}
|
||||
this.data.forEach((ele, index) => {
|
||||
if (ele.det === false) {
|
||||
this.data[index].lineId = ''
|
||||
this.data[index].remark = this.remark
|
||||
obj = ele
|
||||
delete this.data[index].dailyOutputTrend
|
||||
delete this.data[index].originalGlassStatisticsTrend
|
||||
delete this.data[index].actualProductTrend
|
||||
delete this.data[index].originalGlassPassTrend
|
||||
this.data.splice(index, 1)
|
||||
}
|
||||
})
|
||||
let updateArr = this.data
|
||||
updateArr.forEach((ele, index) => {
|
||||
delete ele.dailyOutputTrend
|
||||
delete ele.originalGlassStatisticsTrend
|
||||
delete ele.actualProductTrend
|
||||
delete ele.originalGlassPassTrend
|
||||
});
|
||||
updateGlass(this.data).then(response => {
|
||||
updateGlassRemark(this.sum).then(res => {
|
||||
// this.data.forEach((ele, index) => {
|
||||
// delete ele.dailyOutputTrend
|
||||
// delete ele.originalGlassStatisticsTrend
|
||||
// delete ele.actualProductTrend
|
||||
// delete ele.originalGlassPassTrend
|
||||
// });
|
||||
updateGlass(updateArr).then(response => {
|
||||
updateGlassRemark(obj).then(res => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.edit = false;
|
||||
this.$emit("refreshDataList");
|
||||
|
@ -29,7 +29,8 @@ import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
||||
import inputTable from './inputTable.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
export default {
|
||||
components: { inputTable },
|
||||
data() {
|
||||
@ -72,29 +73,61 @@ export default {
|
||||
// console.log(date)
|
||||
this.changeTime(date)
|
||||
// console.log(date.valueOf());
|
||||
},
|
||||
multipliedByHundred(str) {
|
||||
if (str) {
|
||||
let floatVal = parseFloat(str);
|
||||
if (isNaN(floatVal)) {
|
||||
return 0;
|
||||
}
|
||||
floatVal = Math.round(str * 10000) / 100;
|
||||
let strVal = floatVal.toString();
|
||||
let searchVal = strVal.indexOf('.');
|
||||
if (searchVal < 0) {
|
||||
searchVal = strVal.length;
|
||||
strVal += '.';
|
||||
}
|
||||
while (strVal.length <= searchVal + 2) {
|
||||
strVal += '0';
|
||||
}
|
||||
return parseFloat(strVal);
|
||||
}
|
||||
|
||||
},
|
||||
// 获取数据列表
|
||||
async getDataList() {
|
||||
this.dataListLoading = true;
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
item.lineName = it.name
|
||||
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
if (this.listQuery.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
res.data.forEach((ele, index) => {
|
||||
if (ele.det === false) {
|
||||
res.data[index].lineName = '合计'
|
||||
this.remark = res.data[index].remark
|
||||
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
})
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
res.data.forEach(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
console.log(item)
|
||||
item.lineName = it.name
|
||||
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
@ -165,16 +198,32 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '原片生产周报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩月原片生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -31,7 +31,8 @@ import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
||||
import inputTable from './inputTable.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
export default {
|
||||
components: { inputTable },
|
||||
data() {
|
||||
@ -163,29 +164,61 @@ export default {
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
// this.changeTime(reportTime)
|
||||
}
|
||||
},
|
||||
multipliedByHundred(str) {
|
||||
if (str) {
|
||||
let floatVal = parseFloat(str);
|
||||
if (isNaN(floatVal)) {
|
||||
return 0;
|
||||
}
|
||||
floatVal = Math.round(str * 10000) / 100;
|
||||
let strVal = floatVal.toString();
|
||||
let searchVal = strVal.indexOf('.');
|
||||
if (searchVal < 0) {
|
||||
searchVal = strVal.length;
|
||||
strVal += '.';
|
||||
}
|
||||
while (strVal.length <= searchVal + 2) {
|
||||
strVal += '0';
|
||||
}
|
||||
return parseFloat(strVal);
|
||||
}
|
||||
|
||||
},
|
||||
// 获取数据列表
|
||||
async getDataList() {
|
||||
this.dataListLoading = true;
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
item.lineName = it.name
|
||||
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
if (this.listQuery.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
res.data.forEach((ele, index) => {
|
||||
if (ele.det === false) {
|
||||
res.data[index].lineName = '合计'
|
||||
this.remark = res.data[index].remark
|
||||
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
})
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
res.data.forEach(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
console.log(item)
|
||||
item.lineName = it.name
|
||||
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
@ -230,16 +263,32 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '原片生产周报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩周原片生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -26,7 +26,8 @@ import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
||||
import inputTable from './inputTable.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
export default {
|
||||
components: { inputTable },
|
||||
data() {
|
||||
@ -74,29 +75,61 @@ export default {
|
||||
// 产线列表
|
||||
const res = await getCorePLList();
|
||||
this.proLineList = res.data;
|
||||
},
|
||||
multipliedByHundred(str) {
|
||||
if (str) {
|
||||
let floatVal = parseFloat(str);
|
||||
if (isNaN(floatVal)) {
|
||||
return 0;
|
||||
}
|
||||
floatVal = Math.round(str * 10000) / 100;
|
||||
let strVal = floatVal.toString();
|
||||
let searchVal = strVal.indexOf('.');
|
||||
if (searchVal < 0) {
|
||||
searchVal = strVal.length;
|
||||
strVal += '.';
|
||||
}
|
||||
while (strVal.length <= searchVal + 2) {
|
||||
strVal += '0';
|
||||
}
|
||||
return parseFloat(strVal);
|
||||
}
|
||||
|
||||
},
|
||||
// 获取数据列表
|
||||
async getDataList() {
|
||||
this.dataListLoading = true;
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
|
||||
item.lineName = it.name
|
||||
if (this.listQuery.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||
res.data.forEach((ele, index) => {
|
||||
if (ele.det === false) {
|
||||
res.data[index].lineName = '合计'
|
||||
this.remark = res.data[index].remark
|
||||
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
|
||||
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
})
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
res.data.forEach(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
console.log(item)
|
||||
item.lineName = it.name
|
||||
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
|
||||
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
|
||||
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
|
||||
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
@ -139,16 +172,32 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '原片生产周报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩年原片生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-13 15:28:18
|
||||
* @LastEditTime: 2024-03-18 15:24:10
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="listQuery" class="demo-form-inline">
|
||||
<el-form :inline="true" :model="listQuery" class="blueTip">
|
||||
<el-form-item label="日" prop="reportTime">
|
||||
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
@ -17,10 +17,11 @@
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -46,7 +47,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' :
|
||||
undefined}} </span>
|
||||
</template>
|
||||
@ -69,7 +70,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) +
|
||||
'%' : undefined }} </span>
|
||||
@ -80,42 +81,56 @@
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' :
|
||||
undefined }} </span>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) +
|
||||
@ -125,12 +140,16 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
<span v-else>{{ remark ? remark : '请输入备注' }} </span>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark" >
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -157,6 +176,8 @@ import {
|
||||
} from '@/api/report/production';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
@ -432,6 +453,10 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
},
|
||||
format(shijianchuo) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
@ -457,23 +482,40 @@ export default {
|
||||
// let time = this.format(val.setHours(7, 0, 0))
|
||||
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
console.log(this.listQuery.reportTime);
|
||||
this.timeTips = this.listQuery.reportTime[0] + ' - ' + this.listQuery.reportTime[1]
|
||||
// console.log(this.listQuery.reportTime);
|
||||
} else {
|
||||
this.listQuery.reportTime = []
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '成品生产月报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩月成品生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
},
|
||||
// timeSelect() {
|
||||
// // switch (this.queryParams.timeDim) {
|
||||
@ -520,6 +562,7 @@ export default {
|
||||
editDataList() {
|
||||
this.disabled = false
|
||||
this.isSave = true
|
||||
this.getDataList()
|
||||
},
|
||||
async saveDataList() {
|
||||
let obj = {}
|
||||
@ -563,14 +606,19 @@ export default {
|
||||
// this.listQuery.reportTime[0] = this.transformTime(this.monthValue[0])
|
||||
// // this.queryParams.startTime = this.monthValue[0]
|
||||
// this.listQuery.reportTime[1] = this.transformTime(this.monthValue[1])
|
||||
this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||
// this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||
// console.log(this.timeTips);
|
||||
// } else {
|
||||
// // this.$modal.msgError('月范围不能为空')
|
||||
// // return false
|
||||
// }
|
||||
|
||||
console.log(this.listQuery);
|
||||
if (this.listQuery.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
const res = await this.$axios({
|
||||
url: '/base/report-auto-production/page',
|
||||
@ -604,3 +652,19 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,17 +1,15 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-13 15:29:17
|
||||
* @LastEditTime: 2024-03-18 15:27:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" clearable :picker-options="pickerOptions" size="small" style='width:350px;'
|
||||
@change="timeSelect">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form-item label="月" prop="reportTime">
|
||||
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
@ -19,10 +17,11 @@
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -48,7 +47,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
@ -71,7 +70,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
@ -79,59 +78,78 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="本月" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上月" align="center">
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) +'%' : undefined }} </span>
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="本月" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上月" align="center">
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2))+ '%' :undefined }}
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -159,8 +177,10 @@ import {
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
@ -398,6 +418,7 @@ export default {
|
||||
// remark: undefined,
|
||||
// },
|
||||
// 查询参数
|
||||
reportTime:'',
|
||||
dataForm: {
|
||||
// workOrderIdList:undefined,
|
||||
// productionId: undefined,
|
||||
@ -411,7 +432,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getCurrentMonthFirst()
|
||||
this.getCurrentMonthLast()
|
||||
// this.getCurrentMonthLast()
|
||||
// this.getProductLineList();
|
||||
},
|
||||
mounted() {
|
||||
@ -435,6 +456,11 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList();
|
||||
@ -442,32 +468,89 @@ export default {
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '成品生产月报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩月成品生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
},
|
||||
getCurrentMonthFirst() {
|
||||
const date = new Date();
|
||||
date.setDate(1)
|
||||
// date.setHours(7, 0, 1)
|
||||
this.monthValue[0] = moment(date).format('YYYY-MM-DD')
|
||||
console.log(date)
|
||||
date.setDate(1);
|
||||
this.reportTime = date
|
||||
// console.log(date)
|
||||
this.changeTime(date)
|
||||
// console.log(date.valueOf());
|
||||
},
|
||||
getCurrentMonthLast() {
|
||||
const date = new Date();
|
||||
const currentMonth = date.getMonth();
|
||||
const nextMonth = currentMonth + 1;
|
||||
const nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
|
||||
const oneDay = 24 * 60 * 60 * 1000;
|
||||
this.monthValue[1] = new Date(nextMonthFirstDay - oneDay)
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if (val) {
|
||||
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
|
||||
const fullyear = val.getFullYear()
|
||||
let days = 0
|
||||
switch (timeStamp) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
days = 31
|
||||
break
|
||||
case 3:
|
||||
case 4:
|
||||
case 8:
|
||||
case 10:
|
||||
days = 30
|
||||
break
|
||||
case 1:
|
||||
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
||||
days = 29
|
||||
} else {
|
||||
days = 28
|
||||
}
|
||||
break
|
||||
}
|
||||
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //结束时间
|
||||
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||
this.timeTips = this.startTimeStamp + '-' + this.endTimeStamp
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.dataForm.reportTime = []
|
||||
}
|
||||
},
|
||||
|
||||
//时间戳转为yy-mm-dd hh:mm:ss
|
||||
timeFun(unixtimestamp) {
|
||||
var unixtimestamp = new Date(unixtimestamp);
|
||||
var year = 1900 + unixtimestamp.getYear();
|
||||
var month = "0" + (unixtimestamp.getMonth() + 1);
|
||||
var date = "0" + unixtimestamp.getDate();
|
||||
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
||||
},
|
||||
timeSelect() {
|
||||
// switch (this.queryParams.timeDim) {
|
||||
@ -566,7 +649,13 @@ export default {
|
||||
// this.$modal.msgError('月范围不能为空')
|
||||
// return false
|
||||
}
|
||||
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
console.log(this.dataForm);
|
||||
const res = await this.$axios({
|
||||
url: '/base/report-auto-production/page',
|
||||
@ -601,3 +690,19 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-15 13:42:59
|
||||
* @LastEditTime: 2024-03-18 15:26:52
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form-item>
|
||||
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
@ -17,10 +17,11 @@
|
||||
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -70,11 +71,11 @@
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="完成良品产量"> -->
|
||||
<el-table-column prop="customerId" align="center" label="用户">
|
||||
<el-table-column prop="customerName" align="center" label="用户">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.customerId" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.customerName" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.customerId }} </span>
|
||||
<span v-else>{{ scope.row.customerName }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageType" align="center" label="包装形式">
|
||||
@ -158,12 +159,16 @@
|
||||
</el-table-column>
|
||||
|
||||
<!-- </el-table-column> -->
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -191,6 +196,7 @@ import {
|
||||
} from '@/api/report/production';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
@ -453,6 +459,11 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
format(shijianchuo) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
@ -562,11 +573,19 @@ export default {
|
||||
async getDataList() {
|
||||
this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||
console.log(this.dataForm);
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
const res = await this.$axios({
|
||||
url: 'base/report-auto-delive/listPlus',
|
||||
method: 'get',
|
||||
params: this.dataForm
|
||||
})
|
||||
|
||||
console.log(res)
|
||||
// let sum = undefined
|
||||
// res.data.list.forEach((ele, index) => {
|
||||
@ -594,3 +613,19 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-13 15:29:26
|
||||
* @LastEditTime: 2024-03-18 15:25:48
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
||||
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||
@ -20,10 +20,11 @@
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -49,7 +50,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
@ -72,7 +73,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
@ -80,59 +81,78 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="本周" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周" align="center">
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="本周" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周" align="center">
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) + '%' :undefined }}
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -162,7 +182,8 @@ import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
@ -377,6 +398,11 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList()
|
||||
@ -399,6 +425,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
|
||||
@ -406,6 +434,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
|
||||
@ -413,6 +443,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
|
||||
@ -420,6 +452,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
|
||||
@ -427,6 +461,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
|
||||
@ -434,6 +470,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
|
||||
@ -441,21 +479,39 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '成品生产周报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩周成品生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
},
|
||||
startWeek() {
|
||||
// console.log(this.weekValue1);
|
||||
@ -532,7 +588,8 @@ export default {
|
||||
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间
|
||||
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime())
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
} else {
|
||||
this.dataForm.reportTime = []
|
||||
}
|
||||
@ -551,8 +608,14 @@ export default {
|
||||
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
|
||||
// this.queryParams.startTime = this.monthValue[0]
|
||||
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
|
||||
this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
|
||||
} else {
|
||||
}
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
@ -589,3 +652,19 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-13 15:29:35
|
||||
* @LastEditTime: 2024-03-18 15:25:54
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
||||
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||
@ -21,10 +21,11 @@
|
||||
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -51,7 +52,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
@ -74,7 +75,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
@ -82,60 +83,78 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今年" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="去年" align="center">
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) + '%' : undefined }}
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今年" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="去年" align="center">
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) + '%' : undefined }}
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -165,7 +184,8 @@ import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
const tableProps = [
|
||||
{
|
||||
// width: 128,
|
||||
@ -378,6 +398,11 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList()
|
||||
@ -395,16 +420,32 @@ export default {
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.dataForm };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '成品生产月报.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
var xlsxParam = { raw: true };
|
||||
/* 从表生成工作簿对象 */
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array",
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"许昌安彩年成品生产汇总.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
},
|
||||
// startYear() {
|
||||
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||
@ -506,6 +547,13 @@ export default {
|
||||
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
|
||||
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
|
||||
}
|
||||
}
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
@ -542,3 +590,19 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user