Merge pull request 'projects/mescc/zhp' (#45) from projects/mescc/zhp into projects/mescc/develop
Some checks are pending
continuous-integration/drone/push Build is pending

Reviewed-on: #45
This commit is contained in:
朱菊兰 2024-06-18 08:46:50 +08:00
commit d6cb371c68
5 changed files with 32 additions and 17 deletions

View File

@ -437,7 +437,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
for (const factory of preData) { for (const factory of preData) {
const fId = getPreFactoryId(factory); const fId = getPreFactoryId(factory);
if (factory.previousGlassType === 0) { if (factory.previousGlassType === 0) {
chipInvest.previous[fId] = factory.inputNumber chipInvest.previous[fId] = factory.previousYearInputNumber
} }
// chipInvest.previous[fId] = factory.previousYearInputNumber; // chipInvest.previous[fId] = factory.previousYearInputNumber;
if (![0, 1, 2].includes(factory.previousGlassType)) continue; if (![0, 1, 2].includes(factory.previousGlassType)) continue;
@ -476,7 +476,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType]; const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType];
_t.current[fId] = factory.outputNumber; _t.current[fId] = factory.outputNumber;
} }
console.log('chipInvest',chipInvest); console.log('chipInvest',ftoInvest);
return { return {
chipInvest, chipInvest,
// ftoInvest, // ftoInvest,

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-29 14:48:06 * @Date: 2024-05-29 14:48:06
* @LastEditTime: 2024-06-07 14:11:01 * @LastEditTime: 2024-06-17 16:40:15
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -54,8 +54,20 @@ export default {
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); var day2 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000)
day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000)
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
//
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "" + day2.getDate() + '';
// const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
// const month = new Date().getMonth() + 1;
// const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
// const year = new Date().getFullYear();
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -65,15 +77,18 @@ export default {
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === 1 && this.than === '同比') { if (this.period === 1 && this.than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}`, color: "#12f7f1" }, { label: `${year - 1}${yesterday}累计` },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}日累计`, },
// { label: `${month}${today}`, },
]; ];
} else if (this.period ===1 && this.than === '环比') { } else if (this.period === 1 && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}`, color: "#12f7f1" }, { label: `${dayBeYes}日累计` },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}日累计` },
// { label: `${month}${today}`, },
]; ];
} else if (this.period === 2 && this.than === '同比') { } else if (this.period === 2 && this.than === '同比') {
items = [ items = [

View File

@ -105,7 +105,7 @@ export default {
); );
arr.push( arr.push(
`<span title=${this.prodOrder[i].orderStatus || ""}>${ `<span title=${this.prodOrder[i].orderStatus || ""}>${
this.prodOrder[i].orderStatus === 0 ? '未开始' : this.prodOrder[i].orderStatus === 1 ? '进行中' : '已完成' || "" this.prodOrder[i].orderStatus === 1 ? '未开始' : this.prodOrder[i].orderStatus === 2 ? '进行中' : '已完成' || ""
}</span>` }</span>`
); );
arr.push( arr.push(

View File

@ -89,7 +89,7 @@ export default {
updateThan(val) { updateThan(val) {
console.log(val); console.log(val);
this.than = val; this.than = val;
// this.getMes(); this.getMes()
}, },
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-20 13:32:59 * @Date: 2024-05-20 13:32:59
* @LastEditTime: 2024-06-14 09:44:42 * @LastEditTime: 2024-06-17 16:42:12
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -118,13 +118,13 @@ export default {
items = [ items = [
{ label: `${yesterday}日累计`,}, { label: `${yesterday}日累计`,},
{ label: `${year - 1}${yesterday}累计` }, { label: `${year - 1}${yesterday}累计` },
{ label: `${month}${today}日目标`, }, { label: `${yesterday}日目标`, },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}日累计`}, { label: `${yesterday}日累计`},
{ label: `${dayBeYes}日累计` }, { label: `${dayBeYes}日累计` },
{ label: `${month}${today}日目标`, }, { label: `${yesterday}日目标`, },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
@ -243,13 +243,13 @@ function calculateItems(period, valueTuple, than) {
items = [ items = [
{ label: `${year - 1}${yesterday}累计`, value: valueTuple[0] }, { label: `${year - 1}${yesterday}累计`, value: valueTuple[0] },
{ label: `${yesterday}累计`, value: valueTuple[1] }, { label: `${yesterday}累计`, value: valueTuple[1] },
{ label: `${month}${today}日目标`, value: valueTuple[2] }, { label: `${yesterday}日目标`, value: valueTuple[2] },
]; ];
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ label: `${dayBeYes}日累计`, value: valueTuple[0] }, { label: `${dayBeYes}日累计`, value: valueTuple[0] },
{ label: `${yesterday}日累计`, value: valueTuple[1] }, { label: `${yesterday}日累计`, value: valueTuple[1] },
{ label: `${month}${today}日目标`, value: valueTuple[2] }, { label: `${yesterday}日目标`, value: valueTuple[2] },
]; ];
} else if (period === '周' && than === '同比') { } else if (period === '周' && than === '同比') {
items = [ items = [