修改界面

master
夜笙歌 4 years ago
parent fc6b93cdbd
commit d3e4232b08

@ -1,17 +1,15 @@
$(() => { $(() => {
moduleTitle() moduleTitle()
moduleOne()
moduleTwo()
// 公共请求地址 // 公共请求地址
let url = '/broad/beforeLibrary' let url = '/broad/beforeLibrary'
const INTERVAL = 30000 const INTERVAL = 30000
// 订单详情 // 订单详情
const orderDetailsTable = new AutoScrollTable(document.getElementById("orderQuantityFulfillmentRateOfTheDay"), ["编号", "型号", "计划数量", "完成数量", "差异值"], {width: ['13%', '40%', null, null, '9%']},8) const orderDetailsTable = new AutoScrollTable(document.getElementById("orderQuantityFulfillmentRateOfTheDay"), ["编号", "型号", "计划数量", "完成数量", "差异值"], {width: ['13%', '40%', null, null, '9%']}, 8)
// 成品质量详情 // 成品质量详情
const PropertyInsuranceOneDayOrderInfoTable = new AutoScrollTable(document.getElementById("PropertyInsuranceOneDayOrderInfo"), ["检测项", "质量缺陷", "数量",'占比'], {width: ['30%', null, null, null]}) const PropertyInsuranceOneDayOrderInfoTable = new AutoScrollTable(document.getElementById("PropertyInsuranceOneDayOrderInfo"), ["检测项", "质量缺陷", "数量", '占比'], {width: ['30%', null, null, null]})
//订单详情轮询 + 当日订单数量达成率轮询 //订单详情轮询 + 当日订单数量达成率轮询
// 目标 // 目标
@ -28,46 +26,24 @@ $(() => {
let oneTime = parseFloat(data[0].name.split(':')[0]) let oneTime = parseFloat(data[0].name.split(':')[0])
// 横坐标 // 横坐标
let xName = [] let xName = []
if (yieldType == 0) { let arr = []
let arr = [] for (let i = 0; i < 12; i++) {
for (let i = 0; i < 12; i++) { arr.push(Math.ceil(targetTop.tips / 11))
arr.push(Math.ceil(targetTop.tips / 11)) }
arr[3] = Math.ceil(targetTop.tips / 22)
arr[8] = Math.ceil(targetTop.tips / 22)
arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - targetTop.tips)
targetTop.targetArr = arr
let num = 0
arr.forEach((val, index) => {
if (data[index].qty) {
num += arr[index]
} }
arr[3] = Math.ceil(targetTop.tips / 22) })
arr[8] = Math.ceil(targetTop.tips / 22) targetTop.progress = num
arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - targetTop.tips) // targetTop.progress = arr.slice(0, data.length).reduce((val1, val2) => val1 + val2, 0)
targetTop.targetArr = arr for (let i = 0; i < 12; i++) {
let num = 0 xName.push(`${(oneTime + i) % 24}:30`)
arr.forEach((val,index) => {
console.log(data[index])
if(data[index].qty){
num += arr[index]
}
})
targetTop.progress = num
// targetTop.progress = arr.slice(0, data.length).reduce((val1, val2) => val1 + val2, 0)
for (let i = 0; i < 12; i++) {
xName.push(`${(oneTime + i) % 24}:30`)
}
} else {
let arr = []
for (let i = 0; i < 24; i++) {
arr.push(Math.ceil(targetTop.tips / 23))
}
arr[8] = Math.ceil(targetTop.tips / 46)
arr[13] = Math.ceil(targetTop.tips / 46)
arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - targetTop.tips)
targetTop.targetArr = arr
// let num = 0
// arr.forEach((val,index) => {
// console.log(data[index])
// if(data[index].qty){
// num += arr[index]
// }
// })
// targetTop.progress = num
targetTop.progress = arr.slice(0, data.length).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']
} }
// 达成率 // 达成率
if (targetTop.progress != 0) { if (targetTop.progress != 0) {
@ -112,12 +88,16 @@ $(() => {
orderDetailsTable.loadData(data.map(value => [value.plan_code, value.name, value.plan_number, value.actual_number, value.plan_number - value.actual_number]), Object.keys(["编号", "型号", "计划数量", "完成数量", "差异值"])) orderDetailsTable.loadData(data.map(value => [value.plan_code, value.name, value.plan_number, value.actual_number, value.plan_number - value.actual_number]), Object.keys(["编号", "型号", "计划数量", "完成数量", "差异值"]))
}) })
autoUpdate(url + "/selectOrderInfo", INTERVAL, data => {
moduleOne(0,0,0)
})
//成品入库统计轮询 //成品入库统计轮询
autoUpdate("/broad/mtk/selectInstoreNumByday", INTERVAL, data => { autoUpdate("/broad/mtk/selectInstoreNumByday", INTERVAL, data => {
data.sort((a, b) => { data.sort((a, b) => {
return b.qty - a.qty return b.qty - a.qty
}) })
moduleTwo(data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0))
barChartAndLineChart({ barChartAndLineChart({
xName: data.map(value => value.name), xName: data.map(value => value.name),
yDataTwo: data.map(value => value.qty), yDataTwo: data.map(value => value.qty),
@ -127,7 +107,7 @@ $(() => {
//成品质量详情轮询 //成品质量详情轮询
autoUpdate(url + "/selectQualityInfo ", INTERVAL, data => { autoUpdate(url + "/selectQualityInfo ", INTERVAL, data => {
PropertyInsuranceOneDayOrderInfoTable.loadData(data.map(value => [value.item, value.type, value.qty, `${value.rate}%`]), Object.keys(["检测项", "质量缺陷", "数量",'占比'])) PropertyInsuranceOneDayOrderInfoTable.loadData(data.map(value => [value.item, value.type, value.qty, `${value.rate}%`]), Object.keys(["检测项", "质量缺陷", "数量", '占比']))
pieChart(data.map(val => { pieChart(data.map(val => {
return { return {
@ -225,16 +205,16 @@ const jp = (val = 0) => {
$('#jp').html(html) $('#jp').html(html)
} }
const moduleOne = (val = 0) => { const moduleOne = (val1 = 0,val2=0,val3=0) => {
const html = ` const html = `
<span style="position: absolute;top: 10.1%;left: 56%;color: #CFD2D0;font-size: 1vw;transform: translateX(-50%)">订单数量1 完成数量 1 清单率1%</span> <span style="position: absolute;top: 10.1%;left: 56%;color: #CFD2D0;font-size: 1vw;transform: translateX(-50%)">订单数量${val1} 完成数量 ${val2} 清单率${val3}%</span>
` `
$('#moduleOne').html(html) $('#moduleOne').html(html)
} }
const moduleTwo = (val = 0) => { const moduleTwo = (val = 0) => {
const html = ` const html = `
<span style="position: absolute;top: 54.3%;left: 21%;color: #CFD2D0;font-size: 1vw;transform: translateX(-50%)">合计1 </span> <span style="position: absolute;top: 54.3%;left: 21%;color: #CFD2D0;font-size: 1vw;transform: translateX(-50%)">合计${val} </span>
` `
$('#moduleTwo').html(html) $('#moduleTwo').html(html)
} }

Loading…
Cancel
Save