|
|
|
@ -80,6 +80,10 @@ |
|
|
|
<el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:mjy:ffjldc']">{{ |
|
|
|
$t('form.export') }}</el-button> |
|
|
|
</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> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> |
|
|
|
@ -112,6 +116,12 @@ |
|
|
|
{{ scope.row.rkmz }} {{ scope.row.rkmzdw }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column :label="$t('page.business.resource.mjy.jsl')" align="center" |
|
|
|
:width="$i18n.locale === 'zh_CN' ? '100px' : '180px'"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.jsl }} {{ scope.row.jsldw }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column :label="$t('page.business.resource.mjy.syl')" align="center" |
|
|
|
:width="$i18n.locale === 'zh_CN' ? '80px' : '120px'"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -178,13 +188,11 @@ |
|
|
|
$t('page.business.resource.mjy.guidang') }}</el-button> |
|
|
|
<template v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1 && id == scope.row.gdsqrId"> |
|
|
|
<!-- 解档 --> |
|
|
|
<el-button type="text" |
|
|
|
v-hasPermi="['business:resource:mjy:ffjljd']">{{ |
|
|
|
$t('page.business.resource.mjy.jiedang') }}</el-button> |
|
|
|
<el-button type="text" v-hasPermi="['business:resource:mjy:ffjljd']">{{ |
|
|
|
$t('page.business.resource.mjy.jiedang') }}</el-button> |
|
|
|
<!-- 借阅 --> |
|
|
|
<el-button type="text" @click="handleJy(scope.row)" |
|
|
|
v-hasPermi="['business:resource:mjy:ffjljy']">{{ |
|
|
|
$t('page.business.resource.mjy.jieyue') }}</el-button> |
|
|
|
<el-button type="text" @click="handleJy(scope.row)" v-hasPermi="['business:resource:mjy:ffjljy']">{{ |
|
|
|
$t('page.business.resource.mjy.jieyue') }}</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -211,7 +219,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { list } from "@/api/business/mjy/mjyFfjl" |
|
|
|
import { list, yltj } from "@/api/business/mjy/mjyFfjl" |
|
|
|
import Sd from "./ffjl/Sd"; |
|
|
|
import Jy from "./ffjl/Jy"; |
|
|
|
import Js from "./ffjl/Js"; |
|
|
|
@ -252,6 +260,10 @@ export default { |
|
|
|
startDateRk: null, |
|
|
|
endDateRk: null, |
|
|
|
}, |
|
|
|
jsl: '', |
|
|
|
syl: '', |
|
|
|
jsldw: '', |
|
|
|
syldw: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -263,6 +275,59 @@ export default { |
|
|
|
]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getyltj() { |
|
|
|
yltj(this.queryParams).then(response => { |
|
|
|
// { |
|
|
|
// "jsl": 0, |
|
|
|
// "jsldw": "mL", |
|
|
|
// "syldw": "mL", |
|
|
|
// "syl": 0, |
|
|
|
// "count": 1 |
|
|
|
// }, |
|
|
|
//单位统计 |
|
|
|
let tmpJslUnit = [] |
|
|
|
let tmpSylUnit = [] |
|
|
|
_.forEach(deepClone(response.data), function (item) { |
|
|
|
//减少量 |
|
|
|
let _indexJsl= _.findIndex(tmpJslUnit, function (fitem) { return fitem.key == item.jsldw }) |
|
|
|
if (_indexJsl > -1) { |
|
|
|
tmpJslUnit[_indexJsl] = tmpJslUnit[_indexJsl].count + item.count |
|
|
|
} else { |
|
|
|
tmpJslUnit.push({ key: item.jsldw, count: item.count }) |
|
|
|
} |
|
|
|
//使用量 |
|
|
|
let _indexSyl = _.findIndex(tmpSylUnit, function (fitem) { return fitem.key == item.syldw }) |
|
|
|
if (_indexSyl > -1) { |
|
|
|
tmpSylUnit[_indexSyl] = tmpSylUnit[_indexSyl].count + item.count |
|
|
|
} else { |
|
|
|
tmpSylUnit.push({ key: item.syldw, count: item.count }) |
|
|
|
} |
|
|
|
}) |
|
|
|
//获取最多单位 |
|
|
|
let _jsldw=_.maxBy(tmpJslUnit, function(o) { return o.count; }) |
|
|
|
this.jsldw=_jsldw!=null?_jsldw.key:''; |
|
|
|
|
|
|
|
let _syldw=_.maxBy(tmpSylUnit, function(o) { return o.count; }) |
|
|
|
this.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) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCalc(toUnit) { |
|
|
|
let unit = ['pL', 'nL', 'uL', 'mL', 'L'] |
|
|
|
let result = 1 |
|
|
|
for (var i = 1; i < unit.length; i++) { |
|
|
|
result = result*1000 |
|
|
|
if (unit[i] == toUnit) { |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
return result |
|
|
|
}, |
|
|
|
exportExcel() { |
|
|
|
let that = this |
|
|
|
that.$modal.loading() |
|
|
|
@ -397,7 +462,7 @@ export default { |
|
|
|
a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate))) |
|
|
|
a.click() |
|
|
|
that.$modal.closeLoading() |
|
|
|
that.saveSimpleLog({name:'',nameEn:'',jcmc:'麻精药发放回收导出',jcmcEn:'Controlled Drug In-and-Out Record Export'}) |
|
|
|
that.saveSimpleLog({ name: '', nameEn: '', jcmc: '麻精药发放回收导出', jcmcEn: 'Controlled Drug In-and-Out Record Export' }) |
|
|
|
}).finally(() => { |
|
|
|
that.$modal.closeLoading() |
|
|
|
}) |
|
|
|
@ -469,6 +534,7 @@ export default { |
|
|
|
list(this.queryParams).then(response => { |
|
|
|
this.list = response.rows |
|
|
|
this.total = response.total |
|
|
|
this.getyltj() |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|