|
@@ -267,14 +267,17 @@
|
|
|
sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === this.acceptList.length - 1 ? '' : ', '}`
|
|
sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === this.acceptList.length - 1 ? '' : ', '}`
|
|
|
})
|
|
})
|
|
|
const sql2 = `select ${sqlStr} from t_lhjczb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
|
|
const sql2 = `select ${sqlStr} from t_lhjczb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
|
|
|
|
|
+ const sql3 = `select count(shi_fou_ji_shi_ = '是' or null) as timely, count(shi_fou_ji_shi_ = '否' or null) as untimely, count(zhuang_tai_ != '已完成' or null) as incomplete from t_lhjczb where create_time_ like '${this.month}%'`
|
|
|
// console.log(sqlStr, sql2)
|
|
// console.log(sqlStr, sql2)
|
|
|
|
|
|
|
|
Promise.all([
|
|
Promise.all([
|
|
|
curdPost('sql', sql1),
|
|
curdPost('sql', sql1),
|
|
|
- curdPost('sql', sql2)
|
|
|
|
|
- ]).then(([res1, res2]) => {
|
|
|
|
|
|
|
+ curdPost('sql', sql2),
|
|
|
|
|
+ curdPost('sql', sql3)
|
|
|
|
|
+ ]).then(([res1, res2, res3]) => {
|
|
|
const data1 = res1.variables.data
|
|
const data1 = res1.variables.data
|
|
|
const data2 = res2.variables.data
|
|
const data2 = res2.variables.data
|
|
|
|
|
+ const data3 = res3.variables.data
|
|
|
// console.log(data1, data2)
|
|
// console.log(data1, data2)
|
|
|
|
|
|
|
|
this.tableData.data = []
|
|
this.tableData.data = []
|
|
@@ -298,8 +301,35 @@
|
|
|
result.sort((a, b) => b.value - a.value)
|
|
result.sort((a, b) => b.value - a.value)
|
|
|
// 根据排序后数据重新生成图例
|
|
// 根据排序后数据重新生成图例
|
|
|
const newRes = result.slice(0, 12).map(i => i.name)
|
|
const newRes = result.slice(0, 12).map(i => i.name)
|
|
|
|
|
+ const completionRate = [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '及时',
|
|
|
|
|
+ value: data3[0].timely
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '不及时',
|
|
|
|
|
+ value: data3[0].untimely
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '未完成',
|
|
|
|
|
+ value: data3[0].incomplete
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // value: data3[0].timely + data3[0].untimely + data3[0].incomplete,
|
|
|
|
|
+ // itemStyle: {
|
|
|
|
|
+ // color: 'none',
|
|
|
|
|
+ // decal: {
|
|
|
|
|
+ // symbol: 'none'
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
+ // label: {
|
|
|
|
|
+ // show: false
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ ]
|
|
|
this.middleCardData.config = this.getOptions(newRes)
|
|
this.middleCardData.config = this.getOptions(newRes)
|
|
|
this.middleCardData.acceptData = result.slice(0, 12)
|
|
this.middleCardData.acceptData = result.slice(0, 12)
|
|
|
|
|
+ this.middleCardData.completionRate = completionRate
|
|
|
this.middleCardData.flag = true
|
|
this.middleCardData.flag = true
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
console.log(error)
|
|
@@ -310,11 +340,12 @@
|
|
|
// 获取检测委托受理情况数据
|
|
// 获取检测委托受理情况数据
|
|
|
const sql1 = `select tm.wei_tuo_zhuang_ta as state, DATE_FORMAT(tm.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhwtsqb tm where tm.create_time_ like '${this.year}%'`
|
|
const sql1 = `select tm.wei_tuo_zhuang_ta as state, DATE_FORMAT(tm.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhwtsqb tm where tm.create_time_ like '${this.year}%'`
|
|
|
// 获取检测月度年度任务完成情况数据
|
|
// 获取检测月度年度任务完成情况数据
|
|
|
- const sql2 = `select rw.zhuang_tai_ as state, DATE_FORMAT(rw.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhrwfpb rw where rw.create_time_ like '${this.year}%'`
|
|
|
|
|
|
|
+ // const sql2 = `select rw.zhuang_tai_ as state, DATE_FORMAT(rw.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhrwfpb rw where rw.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_lhjczb where create_time_ like '${this.year}%'`
|
|
|
// 获取已委托样品数量
|
|
// 获取已委托样品数量
|
|
|
const sql3 = `select count(yp.id_) as unReceive from t_lhypb yp, t_lhwtsqb wt where yp.parent_id_ = wt.id_ and yp.create_time_ like '${this.month}%'`
|
|
const sql3 = `select count(yp.id_) as unReceive from t_lhypb yp, t_lhwtsqb wt where yp.parent_id_ = wt.id_ and yp.create_time_ like '${this.month}%'`
|
|
|
// 获取样品 收样/留样/不合格数量
|
|
// 获取样品 收样/留样/不合格数量
|
|
|
- const sql4 = `select count(a.id_) as receive, count(a.shi_fou_liu_yang_ = '是' or null) as keep, count(a.yan_shou_jie_guo_ = '残缺' or null) as incomplete from (select id_, shi_fou_liu_yang_, yan_shou_jie_guo_ from t_lhypdjb where create_time_ like '${this.month}%' group by yang_ben_bian_hao) as a`
|
|
|
|
|
|
|
+ const sql4 = `select (a.id_) as receive, count(a.shi_fou_liu_yang_ = '是' or null) as keep, count(a.yan_shou_jie_guo_ = '残缺' or null) as incomplete from (select id_, shi_fou_liu_yang_, yan_shou_jie_guo_ from t_lhypdjb where create_time_ like '${this.month}%' group by yang_ben_bian_hao) as a`
|
|
|
Promise.all([
|
|
Promise.all([
|
|
|
curdPost('sql', sql1),
|
|
curdPost('sql', sql1),
|
|
|
curdPost('sql', sql2),
|
|
curdPost('sql', sql2),
|
|
@@ -349,13 +380,13 @@
|
|
|
let taskCount = task.reduce((pre, cur) => pre + cur)
|
|
let taskCount = task.reduce((pre, cur) => pre + cur)
|
|
|
let completeCount = complete.reduce((pre, cur) => pre + cur)
|
|
let completeCount = complete.reduce((pre, cur) => pre + cur)
|
|
|
let year = [
|
|
let year = [
|
|
|
- {
|
|
|
|
|
- name: '未完成',
|
|
|
|
|
- value: taskCount - completeCount
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
name: '已完成',
|
|
name: '已完成',
|
|
|
value: completeCount
|
|
value: completeCount
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '未完成',
|
|
|
|
|
+ value: taskCount - completeCount
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
let sample = [data3[0].unReceive - data4[0].receive, data4[0].receive, data4[0].incomplete, data4[0].keep]
|
|
let sample = [data3[0].unReceive - data4[0].receive, data4[0].receive, data4[0].incomplete, data4[0].keep]
|