|
|
@ -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 |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|