Browse Source

fix:[资源库]统计

zhangteng
15881625488@163.com 6 days ago
parent
commit
e715c34384
5 changed files with 44 additions and 27 deletions
  1. +10
    -4
      src/views/business/resource/gyzj/comps/ffjlList.vue
  2. +28
    -20
      src/views/business/resource/mjy/comps/ffjlList.vue
  3. +1
    -0
      src/views/business/study/comp/enter.vue
  4. +3
    -3
      src/views/business/study/comp/tbbd/Bj.vue
  5. +2
    -0
      src/views/business/study/comp/ytbd/Bj.vue

+ 10
- 4
src/views/business/resource/gyzj/comps/ffjlList.vue View File

@ -80,7 +80,7 @@
<el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:gyzj:ffjldc']">{{ <el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:gyzj:ffjldc']">{{
$t('form.export') }}</el-button> $t('form.export') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5" style="float: right;">
<el-col :span="1.5" style="float: right;" v-if=" showtj">
{{ $t('page.business.resource.gyzj.ckl') }}{{ ckldw != '' ? ckl : '--' }}{{ ckldw }} {{ $t('page.business.resource.gyzj.ckl') }}{{ ckldw != '' ? ckl : '--' }}{{ ckldw }}
{{ $t('page.business.resource.gyzj.rkl') }}{{ rkldw != '' ? rkl : '--' }}{{ rkldw }} {{ $t('page.business.resource.gyzj.rkl') }}{{ rkldw != '' ? rkl : '--' }}{{ rkldw }}
{{ $t('page.business.resource.gyzj.syl') }}{{ syldw != '' ? syl : '--' }}{{ syldw }} {{ $t('page.business.resource.gyzj.syl') }}{{ syldw != '' ? syl : '--' }}{{ syldw }}
@ -236,6 +236,7 @@ export default {
daterangeCk: [], daterangeCk: [],
daterangeRk: [], daterangeRk: [],
loading: true, loading: true,
showtj: false,
showDetail: false, showDetail: false,
single: true, single: true,
multiple: true, multiple: true,
@ -328,16 +329,17 @@ export default {
this.syl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.syl }), sylCalc) this.syl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.syl }), sylCalc)
this.ckl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.ckl }), cklCalc) this.ckl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.ckl }), cklCalc)
this.rkl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.rkl }), rklCalc) this.rkl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.rkl }), rklCalc)
this.showtj=true
}) })
}, },
getCalc(toUnit) { getCalc(toUnit) {
let unit = ['pL', 'nL', 'uL', 'mL', 'L'] let unit = ['pL', 'nL', 'uL', 'mL', 'L']
let result = 1 let result = 1
for (var i = 1; i < unit.length; i++) {
result = result*1000
for (var i = 0; i < unit.length; i++) {
if (unit[i] == toUnit) { if (unit[i] == toUnit) {
break break
} }
result = result*1000
} }
return result return result
}, },
@ -547,7 +549,11 @@ export default {
list(this.queryParams).then(response => { list(this.queryParams).then(response => {
this.list = response.rows this.list = response.rows
this.total = response.total this.total = response.total
this.getyltj()
if (this.queryParams.mc && this.queryParams.mc != '') {
this.getyltj()
}else{
this.showtj=false
}
this.loading = false this.loading = false
}) })
}, },

+ 28
- 20
src/views/business/resource/mjy/comps/ffjlList.vue View File

@ -80,9 +80,9 @@
<el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:mjy:ffjldc']">{{ <el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:mjy:ffjldc']">{{
$t('form.export') }}</el-button> $t('form.export') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5" style="float: right;">
{{$t('page.business.resource.mjy.jsl')}}{{ jsldw!=''? jsl:'--' }}{{ jsldw }}
{{$t('page.business.resource.mjy.syl')}}{{ syldw!=''? syl:'--' }}{{ syldw }}
<el-col :span="1.5" style="float: right;" v-if=" showtj">
{{ $t('page.business.resource.mjy.jsl') }}{{ jsldw != '' ? jsl : '--' }}{{ jsldw }}
{{ $t('page.business.resource.mjy.syl') }}{{ syldw != '' ? syl : '--' }}{{ syldw }}
</el-col> </el-col>
</el-row> </el-row>
@ -116,7 +116,7 @@
{{ scope.row.rkmz }} {{ scope.row.rkmzdw }} {{ scope.row.rkmz }} {{ scope.row.rkmzdw }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.mjy.jsl')" align="center"
<el-table-column :label="$t('page.business.resource.mjy.jsl')" align="center"
:width="$i18n.locale === 'zh_CN' ? '100px' : '180px'"> :width="$i18n.locale === 'zh_CN' ? '100px' : '180px'">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.jsl }} {{ scope.row.jsldw }} {{ scope.row.jsl }} {{ scope.row.jsldw }}
@ -240,6 +240,7 @@ export default {
daterangeRk: [], daterangeRk: [],
loading: true, loading: true,
showDetail: false, showDetail: false,
showtj: false,
single: true, single: true,
multiple: true, multiple: true,
total: 0, total: 0,
@ -276,7 +277,8 @@ export default {
}, },
methods: { methods: {
getyltj() { getyltj() {
yltj(this.queryParams).then(response => {
let that = this
yltj(that.queryParams).then(response => {
// { // {
// "jsl": 0, // "jsl": 0,
// "jsldw": "mL", // "jsldw": "mL",
@ -288,14 +290,14 @@ export default {
let tmpJslUnit = [] let tmpJslUnit = []
let tmpSylUnit = [] let tmpSylUnit = []
_.forEach(deepClone(response.data), function (item) { _.forEach(deepClone(response.data), function (item) {
//
let _indexJsl= _.findIndex(tmpJslUnit, function (fitem) { return fitem.key == item.jsldw })
//
let _indexJsl = _.findIndex(tmpJslUnit, function (fitem) { return fitem.key == item.jsldw })
if (_indexJsl > -1) { if (_indexJsl > -1) {
tmpJslUnit[_indexJsl] = tmpJslUnit[_indexJsl].count + item.count tmpJslUnit[_indexJsl] = tmpJslUnit[_indexJsl].count + item.count
} else { } else {
tmpJslUnit.push({ key: item.jsldw, count: item.count }) tmpJslUnit.push({ key: item.jsldw, count: item.count })
} }
//使
//使
let _indexSyl = _.findIndex(tmpSylUnit, function (fitem) { return fitem.key == item.syldw }) let _indexSyl = _.findIndex(tmpSylUnit, function (fitem) { return fitem.key == item.syldw })
if (_indexSyl > -1) { if (_indexSyl > -1) {
tmpSylUnit[_indexSyl] = tmpSylUnit[_indexSyl].count + item.count tmpSylUnit[_indexSyl] = tmpSylUnit[_indexSyl].count + item.count
@ -304,27 +306,29 @@ export default {
} }
}) })
// //
let _jsldw=_.maxBy(tmpJslUnit, function(o) { return o.count; })
this.jsldw=_jsldw!=null?_jsldw.key:'';
let _jsldw = _.maxBy(tmpJslUnit, function (o) { return o.count; })
that.jsldw = _jsldw != null ? _jsldw.key : '';
let _syldw=_.maxBy(tmpSylUnit, function(o) { return o.count; })
this.syldw=_syldw!=null?_syldw.key:'';
let _syldw = _.maxBy(tmpSylUnit, function (o) { return o.count; })
that.syldw = _syldw != null ? _syldw.key : '';
// //
let jslCalc = this.getCalc(this.jsldw)
let sylCalc = this.getCalc(this.syldw)
this.syl=_.divide(_.sumBy(deepClone(response.data),function(item){return item.syl}), sylCalc)
this.jsl=_.divide(_.sumBy(deepClone(response.data),function(item){return item.jsl}), jslCalc)
let jslCalc = that.getCalc(that.jsldw)
let sylCalc = that.getCalc(that.syldw)
that.syl = _.divide(_.sumBy(deepClone(response.data), function (item) { return item.syl }), sylCalc).toString()
that.jsl = _.divide(_.sumBy(deepClone(response.data), function (item) { return item.jsl }), jslCalc).toString()
this.showtj = true
}) })
}, },
getCalc(toUnit) {
getCalc(toUnit) {
let unit = ['pL', 'nL', 'uL', 'mL', 'L'] let unit = ['pL', 'nL', 'uL', 'mL', 'L']
let result = 1 let result = 1
for (var i = 1; i < unit.length; i++) {
result = result*1000
for (var i = 0; i < unit.length; i++) {
if (unit[i] == toUnit) { if (unit[i] == toUnit) {
break break
} }
result = result * 1000
} }
return result return result
}, },
@ -534,7 +538,11 @@ export default {
list(this.queryParams).then(response => { list(this.queryParams).then(response => {
this.list = response.rows this.list = response.rows
this.total = response.total this.total = response.total
this.getyltj()
if (this.queryParams.mc && this.queryParams.mc != '') {
this.getyltj()
}else{
this.showtj=false
}
this.loading = false this.loading = false
}) })
}, },

+ 1
- 0
src/views/business/study/comp/enter.vue View File

@ -96,6 +96,7 @@ export default {
this.study = row this.study = row
}, },
showDetailCallback(val) { showDetailCallback(val) {
this.$tab.refreshPage();
this.showDetail = val this.showDetail = val
}, },
changeTab(item) { changeTab(item) {

+ 3
- 3
src/views/business/study/comp/tbbd/Bj.vue View File

@ -1005,7 +1005,7 @@ export default {
this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空") this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空")
return return
} }
if (!that.cclistYj[i].cctjqt || that.cclistYj[i].cctjqt == '') {
if (that.cclistYj[i].cctj == '其他'&& that.cclistYj[i].cctjqt == '') {
this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空") this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空")
return return
} }
@ -1043,7 +1043,7 @@ export default {
this.$modal.msgError('第' + (i + 1) + "个处置,处置方式不能为空") this.$modal.msgError('第' + (i + 1) + "个处置,处置方式不能为空")
return return
} }
if (!that.czlist[i].czfsqt || that.czlist[i].czfsqt == '') {
if (that.czlist[i].czfs == '其他'&& that.czlist[i].czfsqt == '') {
this.$modal.msgError('第' + (i + 1) + "个存储,处置方式不能为空") this.$modal.msgError('第' + (i + 1) + "个存储,处置方式不能为空")
return return
} }
@ -1057,7 +1057,7 @@ export default {
this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空") this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空")
return return
} }
if (!that.cclist[i].cctjqt || that.cclist[i].cctjqt == '') {
if (that.cclist[i].cctj=='其他' && that.cclist[i].cctjqt == '') {
this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空") this.$modal.msgError('第' + (i + 1) + "个存储,存储条件不能为空")
return return
} }

+ 2
- 0
src/views/business/study/comp/ytbd/Bj.vue View File

@ -235,6 +235,8 @@ export default {
studyFormPre_bcOnly(this.form).then(response => { studyFormPre_bcOnly(this.form).then(response => {
this.form = response.data this.form = response.data
this.templateData = deepClone(this.form) this.templateData = deepClone(this.form)
const obj = Object.assign({}, this.$route, { title:this.form.bdmc })
this.$tab.updatePage(obj);
this.showIndex = 2 this.showIndex = 2
this.$modal.closeLoading() this.$modal.closeLoading()
}).finally(() => { }).finally(() => {

Loading…
Cancel
Save