修改数据请求

master
夜笙歌 4 years ago
parent 6a9c07245d
commit 4ec85058df

@ -3,28 +3,6 @@ $(() => {
// 公共请求地址
let url = '/broad/beforeLibrary'
// 表格头
const planWorkOrderColumns = [
"编号", "计划数量", "完成数量", "差异值", "时间",
]
// 订单详情
const orderDetailsTable = new AutoScrollTable(document.getElementById("orderDetails"), ["编号", "计划数量", "完成数量", "差异值", "时间",], {width: ['30%', null, null, null, '17%']})
// 成品入库统计
const PropertyInsuranceOneDayOrderInfoTable = new AutoScrollTable(document.getElementById("PropertyInsuranceOneDayOrderInfo"), [
"物料条码", "检测项", "质量缺陷", "标志", "时间",
], {width: ['30%', null, null, null, '17%']})
// 当日订单数量达成率
horizontalRoundedBarChartWithBackground(null, document.getElementById("orderQuantityFulfillmentRateOfTheDay"));
// 质量统计
barChartAndLineChart(null, document.getElementById("FinishedGoodsWarehousingStatisticsByHour"));
// 产线不良类型分布
pieChart(null, document.getElementById("distributionOfBadTypesInProductionLineByDay"));
//订单详情轮询 + 当日订单数量达成率轮询
autoUpdate(url + "/selectOrderInfo ", INTERVAL, data => {
orderDetailsTable.loadData(data.map(value => [value.plan_code, value.plan_number, value.actual_number, value.plan_number - value.actual_number, value.day]), Object.keys(planWorkOrderColumns))
@ -34,7 +12,8 @@ $(() => {
xDataName: "达成率",
}, document.getElementById("orderQuantityFulfillmentRateOfTheDay"))
})
//质量统计轮询
//成品入库统计轮询
autoUpdate(url + "/selectProductInStore ", INTERVAL, data => {
barChartAndLineChart({
xName: data.map(value => value.name),
@ -42,16 +21,18 @@ $(() => {
yDataTwoName: "成品数量",
}, document.getElementById("FinishedGoodsWarehousingStatisticsByHour"));
})
//成品入库统计轮询
//成品质量详情轮询
autoUpdate(url + "/selectQualityInfo ", INTERVAL, data => {
PropertyInsuranceOneDayOrderInfoTable.loadData(data.map(value => [value.code, value.item, value.qa, value.state, value.day]), Object.keys(planWorkOrderColumns))
})
//产线不良类型分布轮询
autoUpdate(url + "/selectQualityItem ", INTERVAL, data => {
let params = data.map(val => {
return{
name:val.name,
value:val.qty
return {
name: val.name,
value: val.qty
}
})
@ -61,12 +42,13 @@ $(() => {
})
const moduleTitle = () => {
const html = `
<span style="position: absolute;top: 9.6%;left: 5.5%;color: #CFD2D0;font-size: 1.3vw">订单详情</span>
<span style="position: absolute;top: 9.6%;left: 37%;color: #CFD2D0;font-size: 1.3vw">当日订单数量达成率</span>
<span style="position: absolute;top: 9.6%;left: 68.5%;color: #CFD2D0;font-size: 1.3vw">质量统计</span>
<span style="position: absolute;top: 39%;left: 5.5%;color: #CFD2D0;font-size: 1.3vw">成品入库统计</span>
<span style="position: absolute;top: 69%;left: 5.5%;color: #CFD2D0;font-size: 1.3vw">成品质量详情</span>
<span style="position: absolute;top: 69%;left: 68.6%;color: #CFD2D0;font-size: 1.3vw">产线不良类型分布</span>
<span style="position: absolute;top: 0%;left: 50%;color: #CFD2D0;font-size: 2vw;transform: translateX(-50%)">泡前库数据展示平台</span>
<span style="position: absolute;top: 10%;left: 5.5%;color: #CFD2D0;font-size: 1.0vw">订单详情</span>
<span style="position: absolute;top: 10%;left: 37%;color: #CFD2D0;font-size: 1.0vw">当日订单数量达成率</span>
<span style="position: absolute;top: 10%;left: 68.5%;color: #CFD2D0;font-size: 1.0vw">质量统计</span>
<span style="position: absolute;top: 40%;left: 5.5%;color: #CFD2D0;font-size: 1.0vw">成品入库统计</span>
<span style="position: absolute;top: 69.5%;left: 5.5%;color: #CFD2D0;font-size: 1.0vw">成品质量详情</span>
<span style="position: absolute;top: 69.5%;left: 68.6%;color: #CFD2D0;font-size: 1.0vw">产线不良类型分布</span>
`
$('body').append(html)
}

@ -120,20 +120,20 @@ const horizontalRoundedBarChartWithBackground = function (data, id) {
},
],
};
if (data.xData?.length >= 3) {
option.dataZoom.push({
show: true,
type: 'slider',
yAxisIndex: 0,
width: 0.75 * vw,
start: 0,
end: 1 / (data.xData.length / 4) * 100,
textStyle: {
fontSize: 0,
color: 'rgba(0,0,0,0)'
}
})
}
// if (data.xData?.length >= 3) {
// option.dataZoom.push({
// show: true,
// type: 'slider',
// yAxisIndex: 0,
// width: 0.75 * vw,
// start: 0,
// end: 1 / (data.xData.length / 4) * 100,
// textStyle: {
// fontSize: 0,
// color: 'rgba(0,0,0,0)'
// }
// })
// }
charts.setOption(option);
$(window).resize(charts.resize);
}
@ -386,7 +386,7 @@ const pieChart = function (data, id) {
roseType: "radius",
label: {
normal: {
formatter: ["{c|{c}次}", "{b|{b}}"].join("\n"),
formatter: "{b|{b}} {c|{c}次}",
rich: {
c: {
color: "rgb(241,246,104)",
@ -412,7 +412,7 @@ const pieChart = function (data, id) {
color: "rgb(98,137,169)",
},
smooth: true,
length: 5,
length: 0,
length2: 10,
},
},

@ -33,10 +33,10 @@
<!--当日订单数量达成率-->
<div class="orderQuantityFulfillmentRateOfTheDay" id="orderQuantityFulfillmentRateOfTheDay"></div>
<!--质量统计-->
<!--成品入库统计-->
<div class="FinishedGoodsWarehousingStatisticsByHour" id="FinishedGoodsWarehousingStatisticsByHour"></div>
<!--成品入库统计-->
<!--成品质量详情-->
<div class="PropertyInsuranceOneDayOrderInfo" id="PropertyInsuranceOneDayOrderInfo"></div>
<!--产线不良类型分布-->

Loading…
Cancel
Save