|
|
@@ -320,19 +320,25 @@
|
|
|
getBottomData() {
|
|
|
// 获取检测委托受理情况数据
|
|
|
const sql1 = `select tm.zhuang_tai_ as state, DATE_FORMAT(tm.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_mjwtsqb tm where tm.create_time_ like '${this.year}%'`
|
|
|
+ // 获取报告发放数据
|
|
|
+ const sql2 = `select zhuang_tai_ as state, DATE_FORMAT(create_time_, '%Y-%m-%d %H:%i:%s') as time from t_mjjcbg where create_time_ LIKE '${this.year}%'`
|
|
|
// 获取样品 收样/留样/不合格数量
|
|
|
const sql4 = `select count(a.id_) as receive, count(a.shi_fou_liu_yang_ = '是' or null) as keep, count(a.yan_shou_zhuang_t = '残缺' or null) as incomplete, count(a.jie_yang_zhuang_t = '待确认' or null) as unReceive from (select id_, shi_fou_liu_yang_, yan_shou_zhuang_t, jie_yang_zhuang_t from t_mjypdjb where create_time_ like '${this.month}%' group by yang_pin_bian_hao) as a`
|
|
|
Promise.all([
|
|
|
curdPost('sql', sql1),
|
|
|
- curdPost('sql', sql4),
|
|
|
- ]).then(([ res1, res4]) => {
|
|
|
+ curdPost('sql', sql2),
|
|
|
+ curdPost('sql', sql4)
|
|
|
+ ]).then(([ res1, res2, res4]) => {
|
|
|
this.bottomCardData.flag = false
|
|
|
- const data1 = res1.variables.data
|
|
|
- const data4 = res4.variables.data
|
|
|
+ const data1 = res1.variables && res1.variables.data
|
|
|
+ const data2 = res2.variables && res2.variables.data
|
|
|
+ const data4 = res4.variables && res4.variables.data
|
|
|
// console.log(data1, data2, data3, data4)
|
|
|
|
|
|
let trust = new Array(12).fill(0)
|
|
|
let accepted = new Array(12).fill(0)
|
|
|
+ let reports = new Array(12).fill(0)
|
|
|
+ let compile = new Array(12).fill(0)
|
|
|
// let task = new Array(12).fill(0)
|
|
|
// let complete = new Array(12).fill(0)
|
|
|
data1.forEach(item => {
|
|
|
@@ -342,13 +348,13 @@
|
|
|
}
|
|
|
trust[index]++
|
|
|
})
|
|
|
- // data2.forEach(item => {
|
|
|
- // const index = parseInt(item.time.slice(5,7)) - 1
|
|
|
- // if (item.state === '已完成') {
|
|
|
- // complete[index]++
|
|
|
- // }
|
|
|
- // task[index]++
|
|
|
- // })
|
|
|
+ data2.forEach(item => {
|
|
|
+ const index = parseInt(item.time.slice(5,7)) - 1
|
|
|
+ if (item.state && item.state.includes('完成')) {
|
|
|
+ reports[index]++
|
|
|
+ }
|
|
|
+ compile[index]++
|
|
|
+ })
|
|
|
// let taskCount = task.reduce((pre, cur) => pre + cur)
|
|
|
// let completeCount = complete.reduce((pre, cur) => pre + cur)
|
|
|
// let year = [
|
|
|
@@ -364,6 +370,8 @@
|
|
|
let sample = [data4[0].unReceive, data4[0].receive, data4[0].incomplete, data4[0].keep]
|
|
|
this.bottomCardData.trust = trust
|
|
|
this.bottomCardData.accepted = accepted
|
|
|
+ this.bottomCardData.reports = reports
|
|
|
+ this.bottomCardData.compile = compile
|
|
|
// this.bottomCardData.task = task
|
|
|
// this.bottomCardData.complete = complete
|
|
|
// this.bottomCardData.year = year
|