修改界面

master
夜笙歌 4 years ago
parent 75c64a8c0b
commit e2afbed74f

@ -13,15 +13,6 @@ $(() => {
$.post(url + "/selectProductInTarget", {}, data => { $.post(url + "/selectProductInTarget", {}, data => {
data = JSON.parse(data) data = JSON.parse(data)
target.topTips = data.find(val => val.name == "进度目标").qty target.topTips = data.find(val => val.name == "进度目标").qty
let arr = []
for (let i = 0; i < 12; i++) {
arr.push(Math.ceil(target.topTips / 11))
}
arr[3] = Math.ceil(target.topTips / 22)
arr[8] = Math.ceil(target.topTips / 22)
arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - target.topTips)
target.top = arr
target.topProgress = arr.reduce((val1, val2) => val1 + val2, 0)
Tips('#Tips') Tips('#Tips')
if (isFirst){ if (isFirst){
isFirst = false isFirst = false
@ -45,7 +36,6 @@ $(() => {
// 终检一次不合格率目标 // 终检一次不合格率目标
$.post(url + "/selectOneBadRateMb", {}, data => { $.post(url + "/selectOneBadRateMb", {}, data => {
data = JSON.parse(data) data = JSON.parse(data)
console.log(data.rate)
target.bottomTips = data.rate target.bottomTips = data.rate
for (let i = 0; i < 12; i++) { for (let i = 0; i < 12; i++) {
target.bottom.push(data.rate) target.bottom.push(data.rate)
@ -65,11 +55,29 @@ $(() => {
let oneTime = parseFloat(data[0].name.split(':')[0]) let oneTime = parseFloat(data[0].name.split(':')[0])
let xName = [] let xName = []
if (yieldType == 0) { if (yieldType == 0) {
let arr = []
for (let i = 0; i < 12; i++) {
arr.push(Math.ceil(target.topTips / 11))
}
arr[3] = Math.ceil(target.topTips / 22)
arr[8] = Math.ceil(target.topTips / 22)
arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - target.topTips)
target.top = arr
target.topProgress = arr.reduce((val1, val2) => val1 + val2, 0)
for (let i = 0; i < 12; i++) { for (let i = 0; i < 12; i++) {
xName.push(`${(oneTime + i) % 24}:30`) xName.push(`${(oneTime + i) % 24}:30`)
} }
} else { } else {
xName = data.map(val => val.name) let arr = []
for (let i = 0; i < 24; i++) {
arr.push(Math.ceil(target.topTips / 23))
}
arr[8] = Math.ceil(target.topTips / 46)
arr[13] = Math.ceil(target.topTips / 46)
arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - target.topTips)
target.top = arr
target.topProgress = arr.reduce((val1, val2) => val1 + val2, 0)
xName = ['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00']
} }
barChartAndLineChartThree({ barChartAndLineChartThree({
xName: xName, xName: xName,
@ -90,7 +98,7 @@ $(() => {
xName.push(`${(oneTime + i) % 24}:30`) xName.push(`${(oneTime + i) % 24}:30`)
} }
} else { } else {
xName = data.map(val => val.name) xName = ['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00']
} }
target.bottomReality = (data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length).toFixed(2) target.bottomReality = (data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length).toFixed(2)
target.bottomTotal = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) target.bottomTotal = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0)
@ -163,6 +171,7 @@ const LOSS = (val = 0) => {
` `
$('#LOSS').html(html) $('#LOSS').html(html)
} }
// 节拍
const jp = (val = 0) => { const jp = (val = 0) => {
const html = ` const html = `
<span style="position: absolute;top: 15.7%;left: 85.5%;color: #CFD2D0;font-size: 2vw;transform: translateX(-50%)">${val}</span> <span style="position: absolute;top: 15.7%;left: 85.5%;color: #CFD2D0;font-size: 2vw;transform: translateX(-50%)">${val}</span>
@ -181,6 +190,7 @@ const moduleTitle = () => {
` `
$('body').append(html) $('body').append(html)
} }
// 目标
const Tips = (el, top = { const Tips = (el, top = {
target: target.topTips, target: target.topTips,
progress: target.topProgress, progress: target.topProgress,
@ -194,7 +204,7 @@ const Tips = (el, top = {
` `
$(el).html(html) $(el).html(html)
} }
// 入库执行订单合计
const total = (el,val=0) => { const total = (el,val=0) => {
const html = ` const html = `
<span style="position: absolute;top: 54.3%;left: 66.7%;color: #CFD2D0;font-size: 1.0vw">合计${val}</span> <span style="position: absolute;top: 54.3%;left: 66.7%;color: #CFD2D0;font-size: 1.0vw">合计${val}</span>

Loading…
Cancel
Save