Merge pull request 'projects/mescc/dy' (#30) from projects/mescc/dy into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #30
This commit is contained in:
朱菊兰 2024-06-04 08:57:54 +08:00
commit 7d7e4314e9
6 changed files with 93 additions and 106 deletions

View File

@ -1,8 +1,8 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-28 13:42:51 # @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-06-03 15:41:29 # @LastEditTime: 2024-06-04 08:56:35
# @LastEditors: zhp # @LastEditors: DY
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 08:54:59 * @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-05-31 15:08:27 * @LastEditTime: 2024-06-03 14:25:02
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -50,3 +50,11 @@ export function exportExcel(data) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 获得工单数据概览
export function getOverView(){
return request({
url: '/ip/prod-work-order/getOverView',
method: 'get'
})
}

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-05-22 15:29:18 * @LastEditTime: 2024-06-03 15:42:47
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -18,11 +18,11 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<p class="title">时间维度</p> <p class="title">时间维度</p>
<p class="text">{{ dataForm.targetType === 0 ? '月' : '年' }}</p> <p class="text">{{ ['日', '周', '月', '年'][dataForm.targetType] }}</p>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<p class="title">时间</p> <p class="title">时间</p>
<p class="text">{{ dataForm.targetType === 1 ? dataForm.targetYear + '年' : dataForm.targetYear + '年' + dataForm.targetMonth + '月'}}</p> <p class="text">{{ dataForm.targetTime}}</p>
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
@ -371,5 +371,8 @@ export default {
color: rgba(102,102,102,0.75); color: rgba(102,102,102,0.75);
padding-bottom: 20px; padding-bottom: 20px;
} }
.detailBox {
width: 98%;
}
</style> </style>

View File

@ -1,15 +1,15 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 16:41:12 * @LastEditTime: 2024-06-03 16:02:56
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 32px)">
<ButtonNav v-show="false" :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px"> <ButtonNav v-show="false" :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px">
</ButtonNav> </ButtonNav>
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> <div class="app-container" style="height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item v-if="facType === 0" label="工厂名称" prop="factorys"> <el-form-item v-if="facType === 0" label="工厂名称" prop="factorys">
<el-select size="small" v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple clearable> <el-select size="small" v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple clearable>
@ -42,9 +42,9 @@
<el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
<span v-if="start && end" style="margin-left: 10px"> <!-- <span v-if="start && end" style="margin-left: 10px">
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> </span> -->
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime">
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyyMM" range-separator="" start-placeholder="开始月份" <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyyMM" range-separator="" start-placeholder="开始月份"
@ -173,7 +173,7 @@ export default {
current: 1, current: 1,
factorys: null, factorys: null,
total: 0, total: 0,
date: 1, date: 3,
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
reportTime: [] reportTime: []
@ -450,13 +450,12 @@ export default {
}) })
this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel' this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel'
} }
console.log(112, this.tableProps)
} }
}, },
mounted() { created() {
// this.getDict() const currentMonth = new Date()
// this.getCurrentYearFirst() this.listQuery.reportTime = [moment(currentMonth).format('yyyyMM'), moment(currentMonth).format('yyyyMM')]
this.getDataList() this.changeTime()
}, },
methods: { methods: {
handleImport() { handleImport() {
@ -469,42 +468,6 @@ export default {
this.upload.isUploading = true; this.upload.isUploading = true;
}, },
// //
// handleFileSuccess(param, type) {
// console.log('', param.file)
// const formData = new FormData()
// formData.append('multipartFile', param.file)
// console.log('', param)
// importDiTarget(formData).then(res => {
// console.log(res)
// if (res.code !== 0) {
// this.$modal.msgError(response.msg)
// return;
// }
// this.upload.open = false;
// this.upload.isUploading = false;
// this.$refs.upload.clearFiles();
// }).catch(() => {
// this.upload.open = false
// this.upload.isUploading = false
// })
// //
// // let data = response.data;
// // let text = '' + data.createUsernames.length;
// // for (const username of data.createUsernames) {
// // text += '<br />&nbsp;&nbsp;&nbsp;&nbsp;' + username;
// // }
// // text += '<br />' + data.updateUsernames.length;
// // for (const username of data.updateUsernames) {
// // text += '<br />&nbsp;&nbsp;&nbsp;&nbsp;' + username;
// // }
// // text += '<br />' + Object.keys(data.failureUsernames).length;
// // for (const username in data.failureUsernames) {
// // text += '<br />&nbsp;&nbsp;&nbsp;&nbsp;' + username + '' + data.failureUsernames[username];
// // }
// this.$message.success('');
// this.getDataList();
// },
//
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
if (response.code !== 0) { if (response.code !== 0) {
this.$modal.msgError(response.msg) this.$modal.msgError(response.msg)
@ -529,11 +492,6 @@ export default {
changeFactory($event) { changeFactory($event) {
this.currentMenu = $event this.currentMenu = $event
this.facType = this.currentMenu === '碲化镉工厂' ? 0 : 1 this.facType = this.currentMenu === '碲化镉工厂' ? 0 : 1
// if (this.facType === 0) {
// this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
// } else {
// this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel'
// }
this.getDataList() this.getDataList()
}, },
handleClick(val) { handleClick(val) {
@ -544,7 +502,6 @@ export default {
this.$refs.addOrUpdate.init(val.data.id); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
console.log('啊啊', val)
this.deleteHandle(val.data.id, val.data.factory, val.data._pageIndex) this.deleteHandle(val.data.id, val.data.factory, val.data._pageIndex)
} else { } else {
this.otherMethods(val) this.otherMethods(val)
@ -600,6 +557,10 @@ export default {
this.listQuery.endTime = Number(this.end) this.listQuery.endTime = Number(this.end)
} }
} }
if (!this.start && !this.end) {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
}
// console.log(e); // console.log(e);
}, },
changeTime() { changeTime() {
@ -615,6 +576,9 @@ export default {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0]) this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1]) this.listQuery.endTime = Number(this.listQuery.reportTime[1])
} }
} else {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
} }
}, },
onValueChange(picker, k) { // k onValueChange(picker, k) { // k
@ -633,6 +597,10 @@ export default {
this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW')) this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
} }
} }
if (!this.start && !this.end) {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
}
}, },
changeDayTime() { changeDayTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
@ -647,44 +615,12 @@ export default {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0]) this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1]) this.listQuery.endTime = Number(this.listQuery.reportTime[1])
} }
} else {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
} }
}, },
//
multipliedByHundred(str) {
console.log(str);
// console.log(str)
if ( str != 0) {
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() { async getDataList() {
// if (this.listQuery.date === 3) {
// if (this.listQuery.reportTime?.length > 0) {
// this.listQuery.beginTime = this.listQuery.reportTime[0] ? Number(this.listQuery.reportTime[0]) : undefined
// this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined
// }
// }
// if (this.listQuery.date === 4) {
// if (this.listQuery.reportTime?.length > 0) {
// this.listQuery.beginTime = this.start ? this.start : undefined
// this.listQuery.endTime = this.end ? this.end : undefined
// }
// }
if (this.currentMenu === '碲化镉工厂') { if (this.currentMenu === '碲化镉工厂') {
await prodTargetDiPage(this.listQuery).then(res => { await prodTargetDiPage(this.listQuery).then(res => {
if (res.code === 0) { if (res.code === 0) {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-05-31 16:13:22 * @LastEditTime: 2024-06-03 10:17:33
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -134,14 +134,29 @@ export default {
exportDetail() { exportDetail() {
// //
const pdf = new jsPDF('l', 'pt', 'a4'); const pdf = new jsPDF('l', 'pt', 'a4');
const options = {
scale: 2 const canvas = document.createElement('canvas')
};
const element = this.$refs['detail']; const element = this.$refs['detail'];
const width = pdf.internal.pageSize.getWidth()
const height = pdf.internal.pageSize.getHeight()
canvas.width = width * 2
canvas.height = height * 2
canvas.style.width = width + 'px'
canvas.style.height = height + 'px'
const options = {
// scale: 2,
dpi: 300,
canvas: canvas,
useCORS: true
};
html2canvas(element, options).then((canvas) => { html2canvas(element, options).then((canvas) => {
const imgData = canvas.toDataURL('image/png'); const imgData = canvas.toDataURL('image/png', 1.0);
pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight()); pdf.addImage(imgData, 'PNG', 0, 0, width, height);
pdf.save(this.dataForm.workOrderNumber + '详情.pdf'); pdf.save(this.dataForm.workOrderNumber + '详情.pdf');
}); });
}, },

View File

@ -1,16 +1,25 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 17:13:56 * @LastEditTime: 2024-06-03 15:15:18
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 35px)">
<div class="app-container" style="margin-top: 8px;padding: 16px; height: auto;"> <div class="app-container" style="margin-top: 8px; padding: 0 16px; height: auto; font-size: 20px; text-align: center;">
<p style="margin-bottom: 0">数据概览</p>
<div class="view">
<div v-for="(item, index) in data" :key="index">
<p style="color: rgb(194,128,255)">{{ item }}</p>
<p>{{ index }}</p>
</div>
</div>
</div>
<div class="app-container" style="margin-top: 8px; height: auto;">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
</div> </div>
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;"> <div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto;">
<search-bar :formConfigs="formConfig2" ref="searchBarForm" style="margin-bottom: 0" /> <search-bar :formConfigs="formConfig2" ref="searchBarForm" style="margin-bottom: 0" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="tableData"> :table-data="tableData">
@ -30,7 +39,7 @@
<script> <script>
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
import { getWorkOrderPage, exportExcel } from '@/api/produceData/order'; import { getWorkOrderPage, exportExcel, getOverView } from '@/api/produceData/order';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import lineChart from './lineChart'; import lineChart from './lineChart';
import moment from 'moment' import moment from 'moment'
@ -217,7 +226,8 @@ export default {
], ],
tableData: [], tableData: [],
xAxis: [], xAxis: [],
lineData: {} lineData: {},
data: {}
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
@ -228,7 +238,16 @@ export default {
this.listQuery.time = [moment(sevenDaysAgo).format('yyyy-MM-DD'), moment(today).format('yyyy-MM-DD')] this.listQuery.time = [moment(sevenDaysAgo).format('yyyy-MM-DD'), moment(today).format('yyyy-MM-DD')]
this.formConfig[2].defaultSelect = this.listQuery.time this.formConfig[2].defaultSelect = this.listQuery.time
}, },
mounted() {
this.getOverView()
},
methods: { methods: {
getOverView() {
getOverView().then(res => {
this.data = res.data
console.log('aa', res.data)
})
},
otherMethods(val) { otherMethods(val) {
this.detailOrUpdateVisible = true; this.detailOrUpdateVisible = true;
// this.addOrEditTitle = ""; // this.addOrEditTitle = "";
@ -299,6 +318,12 @@ export default {
/* padding-bottom: 10px; */ /* padding-bottom: 10px; */
/* } */ /* } */
/* .blueTi */ /* .blueTi */
.view {
display: flex;
justify-content: space-around;
align-items: center;
flex: 1;
}
.blueTip::before{ .blueTip::before{
display: inline-block; display: inline-block;
content: ''; content: '';