projects/mescc/dy #30

Merged
juzi merged 2 commits from projects/mescc/dy into projects/mescc/develop 2024-06-04 08:57:54 +08:00
6 changed files with 94 additions and 107 deletions
Showing only changes of commit 7cb8abd618 - Show all commits

View File

@ -1,7 +1,7 @@
###
# @Author: zhp
# @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-06-03 08:50:41
# @LastEditTime: 2024-06-03 09:21:15
# @LastEditors: DY
# @Description:
###
@ -13,11 +13,11 @@ VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.1.70:30307'
# VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
# sara
# VUE_APP_BASE_API = 'http://192.168.1.63:48080'
# 张一丁
VUE_APP_BASE_API = 'http://192.168.4.139:48080'
# VUE_APP_BASE_API = 'http://192.168.4.139:48080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

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

View File

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

View File

@ -1,15 +1,15 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 16:41:12
* @LastEditTime: 2024-06-03 16:02:56
* @LastEditors: DY
* @Description:
-->
<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>
<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-item v-if="facType === 0" label="工厂名称" prop="factorys">
<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="选择周"
style="width: 180px" @change="onValueChange">
</el-date-picker>
<span v-if="start && end" style="margin-left: 10px">
<!-- <span v-if="start && end" style="margin-left: 10px">
{{ date1 }} {{ date2 }} {{ weekNum }}
</span>
</span> -->
</el-form-item>
<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="开始月份"
@ -173,7 +173,7 @@ export default {
current: 1,
factorys: null,
total: 0,
date: 1,
date: 3,
beginTime: undefined,
endTime: undefined,
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'
}
console.log(112, this.tableProps)
}
},
mounted() {
// this.getDict()
// this.getCurrentYearFirst()
this.getDataList()
created() {
const currentMonth = new Date()
this.listQuery.reportTime = [moment(currentMonth).format('yyyyMM'), moment(currentMonth).format('yyyyMM')]
this.changeTime()
},
methods: {
handleImport() {
@ -469,42 +468,6 @@ export default {
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) {
if (response.code !== 0) {
this.$modal.msgError(response.msg)
@ -529,11 +492,6 @@ export default {
changeFactory($event) {
this.currentMenu = $event
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()
},
handleClick(val) {
@ -544,7 +502,6 @@ export default {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
console.log('啊啊', val)
this.deleteHandle(val.data.id, val.data.factory, val.data._pageIndex)
} else {
this.otherMethods(val)
@ -600,6 +557,10 @@ export default {
this.listQuery.endTime = Number(this.end)
}
}
if (!this.start && !this.end) {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
}
// console.log(e);
},
changeTime() {
@ -615,6 +576,9 @@ export default {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1])
}
} else {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
}
},
onValueChange(picker, k) { // k
@ -633,6 +597,10 @@ export default {
this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
}
}
if (!this.start && !this.end) {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
}
},
changeDayTime() {
if (this.listQuery.reportTime) {
@ -647,44 +615,12 @@ export default {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
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() {
// 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 === '碲化镉工厂') {
await prodTargetDiPage(this.listQuery).then(res => {
if (res.code === 0) {

View File

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

View File

@ -1,16 +1,25 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 17:13:56
* @LastEditTime: 2024-06-03 15:15:18
* @LastEditors: DY
* @Description:
-->
<template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
<div class="app-container" style="margin-top: 8px;padding: 16px; height: auto;">
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 35px)">
<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" />
</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" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="tableData">
@ -30,7 +39,7 @@
<script>
// 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 lineChart from './lineChart';
import moment from 'moment'
@ -217,7 +226,8 @@ export default {
],
tableData: [],
xAxis: [],
lineData: {}
lineData: {},
data: {}
// proLineList: [],
// all: {}
};
@ -228,7 +238,16 @@ export default {
this.listQuery.time = [moment(sevenDaysAgo).format('yyyy-MM-DD'), moment(today).format('yyyy-MM-DD')]
this.formConfig[2].defaultSelect = this.listQuery.time
},
mounted() {
this.getOverView()
},
methods: {
getOverView() {
getOverView().then(res => {
this.data = res.data
console.log('aa', res.data)
})
},
otherMethods(val) {
this.detailOrUpdateVisible = true;
// this.addOrEditTitle = "";
@ -299,6 +318,12 @@ export default {
/* padding-bottom: 10px; */
/* } */
/* .blueTi */
.view {
display: flex;
justify-content: space-around;
align-items: center;
flex: 1;
}
.blueTip::before{
display: inline-block;
content: '';