|
|
@@ -157,7 +157,7 @@ export default {
|
|
|
const retentionData = this.dealingRetentionData(data3,dayNum)
|
|
|
const untestedSample = this.dealingData1(data4,dayNum)
|
|
|
const completedSample = this.dealingData1(data5,dayNum)
|
|
|
- console.log('xxxxxxxxx方法返回的数据1 -------',untestedSample,completedSample,data3,sql3)
|
|
|
+ // console.log('xxxxxxxxx方法返回的数据1 -------',untestedSample,completedSample,data3,sql3)
|
|
|
// console.log('xxxxxxxxx方法返回的数据2 -------',unqualifiedData)
|
|
|
// console.log('xxxxxxxxx方法返回的数据3 -------',retentionData)
|
|
|
//三组数据处理完毕之后,传给图表进行渲染 (月份天数数组,已收样,不合格,留样)
|
|
|
@@ -175,7 +175,7 @@ export default {
|
|
|
find ? find.count++ : obj.push(CheckedArray);
|
|
|
return obj;
|
|
|
}, []);
|
|
|
- console.log('12345678',result);
|
|
|
+ // console.log('12345678',result);
|
|
|
this.filledNum = Array(dayNum).fill(0)
|
|
|
//遍历拿到的数组,截取出月份对应的 // 2022-11-01
|
|
|
result.forEach(item =>{
|
|
|
@@ -187,7 +187,7 @@ export default {
|
|
|
},
|
|
|
//处理sql查询出来的数据
|
|
|
dealingData(data,dayNum){
|
|
|
- console.log(data,'data1')
|
|
|
+ // console.log(data,'data1')
|
|
|
let newArray = data.reduce((total, cur, index) => {
|
|
|
let hasValue = total.findIndex(current => {
|
|
|
return current.shou_yang_ri_qi_ === cur.shou_yang_ri_qi_;
|
|
|
@@ -211,6 +211,8 @@ export default {
|
|
|
},
|
|
|
//处理留样数据
|
|
|
dealingRetentionData(data,dayNum){
|
|
|
+ // console.log(data,'121279787897997898798')
|
|
|
+
|
|
|
for (let ii in data) {
|
|
|
let num3 = data[ii].liu_yang_shu_lian.match(/×+\d+(\.\d+)?/g)
|
|
|
// console.log(num3,'768u76mudg')
|
|
|
@@ -222,13 +224,24 @@ export default {
|
|
|
// console.log(Number(num3[0].replace(/[^\d]/g, "")),num3[0])
|
|
|
}else{
|
|
|
data[ii].liu_yang_shu_lian=num3.reduce((a, b) => {
|
|
|
- let aa=Number(a.replace(/[^\d]/g, ""))
|
|
|
- let bb=Number(b.replace(/[^\d]/g, ""))
|
|
|
- return aa + bb
|
|
|
+ // console.log(a,b,typeof(a),'dweewe')
|
|
|
+ if (typeof(a)=='number') {
|
|
|
+ let bb=Number(b.replace(/[^\d]/g, ""))
|
|
|
+ return a + bb
|
|
|
+ }else if(typeof(b)=='number'){
|
|
|
+ let aa=Number(a.replace(/[^\d]/g, ""))
|
|
|
+ return aa + b
|
|
|
+ }else{
|
|
|
+ let aa=Number(a.replace(/[^\d]/g, ""))
|
|
|
+ let bb=Number(b.replace(/[^\d]/g, ""))
|
|
|
+ return aa + bb
|
|
|
+
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // console.log(data,'79787897997898798')
|
|
|
let newArray = data.reduce((total, cur, index) => {
|
|
|
let hasValue = total.findIndex(current => {
|
|
|
return current.liu_yang_ri_qi_ === cur.liu_yang_ri_qi_;
|
|
|
@@ -237,25 +250,25 @@ export default {
|
|
|
hasValue !== -1 && (total[hasValue].liu_yang_shu_lian = Number(total[hasValue].liu_yang_shu_lian) + Number(cur.liu_yang_shu_lian));
|
|
|
return total;
|
|
|
}, []);
|
|
|
- console.log('日期相同数量相加 处理结果',newArray);
|
|
|
+ // console.log('日期相同数量相加 处理结果',newArray);
|
|
|
//创建一个长度为当前月份天数的数组
|
|
|
this.filledNum = Array(dayNum).fill(0)
|
|
|
//遍历拿到的数组,截取出月份对应的 // 2022-11-01
|
|
|
newArray.forEach(item =>{
|
|
|
let key = item.liu_yang_ri_qi_.slice(8,10) < 10 ?item.liu_yang_ri_qi_.slice(9,10) :item.liu_yang_ri_qi_.slice(8,10)
|
|
|
let value =Number(item.liu_yang_shu_lian)
|
|
|
- console.log(key,value,this.filledNum)
|
|
|
+ // console.log(key,value,this.filledNum)
|
|
|
this.filledNum.splice(key - 1,1,value)
|
|
|
})
|
|
|
//返回处理好的数量数组
|
|
|
- console.log(this.filledNum,'89o9009jkikjkj')
|
|
|
+ // console.log(this.filledNum,'89o9009jkikjkj')
|
|
|
return this.filledNum;
|
|
|
},
|
|
|
|
|
|
//委托样品图表
|
|
|
entrustNumberInit(dayArray,receivedData,receivedData2,unqualifiedData,retentionData,untestedSample,completedSample){
|
|
|
// console.log('拿到日期数组',dayArray)
|
|
|
- console.log(receivedData,receivedData2,unqualifiedData,retentionData,'we12e12312312312')
|
|
|
+ // console.log(receivedData,receivedData2,unqualifiedData,retentionData,'we12e12312312312')
|
|
|
this.entrustNumber = echarts.init(this.$refs.Number_refs);
|
|
|
var entrustNumberOption = {
|
|
|
xAxis:{
|