Browse Source

fix:[资源库管理]优化

luojie
15881625488@163.com 2 weeks ago
parent
commit
6bf9359ca2
5 changed files with 172 additions and 11 deletions
  1. +8
    -0
      src/api/business/gyzj/gyzjFfjl.js
  2. +8
    -0
      src/api/business/mjy/mjyFfjl.js
  3. +1
    -1
      src/lang/zh/business/resource/gyzj.js
  4. +81
    -2
      src/views/business/resource/gyzj/comps/ffjlList.vue
  5. +74
    -8
      src/views/business/resource/mjy/comps/ffjlList.vue

+ 8
- 0
src/api/business/gyzj/gyzjFfjl.js View File

@ -8,6 +8,14 @@ export function list(query) {
params: query params: query
}) })
} }
export function yltj(query) {
return request({
url: '/system/business/gyzjFfjl/yltj',
method: 'get',
params: query
})
}
// 稽查轨迹列表 // 稽查轨迹列表
export function jcgjList(query) { export function jcgjList(query) {
return request({ return request({

+ 8
- 0
src/api/business/mjy/mjyFfjl.js View File

@ -8,6 +8,14 @@ export function list(query) {
params: query params: query
}) })
} }
// 列表
export function yltj(query) {
return request({
url: '/system/business/mjyFfjl/yltj',
method: 'get',
params: query
})
}
// 稽查轨迹列表 // 稽查轨迹列表
export function jcgjList(query) { export function jcgjList(query) {
return request({ return request({

+ 1
- 1
src/lang/zh/business/resource/gyzj.js View File

@ -88,7 +88,7 @@ export default {
rkwz: '入库位置', rkwz: '入库位置',
rktj: '入库条件', rktj: '入库条件',
zytj: '转移条件', zytj: '转移条件',
rkl: '入库净重',
rkl: '入库',
ghr1Id: '归还人', ghr1Id: '归还人',
ghr2Id: '归还人2', ghr2Id: '归还人2',
jsr1Id: '接收人', jsr1Id: '接收人',

+ 81
- 2
src/views/business/resource/gyzj/comps/ffjlList.vue View File

@ -80,6 +80,11 @@
<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;">
{{ $t('page.business.resource.gyzj.ckl') }}{{ ckldw != '' ? ckl : '--' }}{{ ckldw }}
{{ $t('page.business.resource.gyzj.rkl') }}{{ rkldw != '' ? rkl : '--' }}{{ rkldw }}
{{ $t('page.business.resource.gyzj.syl') }}{{ syldw != '' ? syl : '--' }}{{ syldw }}
</el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
@ -211,7 +216,7 @@
</template> </template>
<script> <script>
import { list } from "@/api/business/gyzj/gyzjFfjl"
import { list, yltj } from "@/api/business/gyzj/gyzjFfjl"
import Sd from "./ffjl/Sd"; import Sd from "./ffjl/Sd";
import Jy from "./ffjl/Jy"; import Jy from "./ffjl/Jy";
import Js from "./ffjl/Js"; import Js from "./ffjl/Js";
@ -252,6 +257,12 @@ export default {
startDateRk: null, startDateRk: null,
endDateRk: null, endDateRk: null,
}, },
ckl: '',
rkl: '',
syl: '',
ckldw: '',
rkldw: '',
syldw: '',
} }
}, },
computed: { computed: {
@ -263,6 +274,73 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getyltj() {
yltj(this.queryParams).then(response => {
let that=this
// {
// "rkl": 0,
// "ckldw": "mL",
// "syldw": "mL",
// "ckl": 0,
// "syl": 0,
// "count": 1,
// "rkldw": ""
// },
let tmpRklUnit = []
let tmpCklUnit = []
let tmpSylUnit = []
_.forEach(deepClone(response.data), function (item) {
//
let _indexRkl = _.findIndex(tmpRklUnit, function (fitem) { return fitem.key == item.rkldw })
if (_indexRkl > -1) {
tmpRklUnit[_indexRkl] = tmpRklUnit[_indexRkl].count + item.count
} else {
tmpRklUnit.push({ key: item.rkldw, count: item.count })
}
//
let _indexCkl = _.findIndex(tmpCklUnit, function (fitem) { return fitem.key == item.ckldw })
if (_indexCkl > -1) {
tmpCklUnit[_indexCkl] = tmpCklUnit[_indexCkl].count + item.count
} else {
tmpCklUnit.push({ key: item.ckldw, 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 _ckldw = _.maxBy(tmpCklUnit, function (o) { return o.count; })
this.ckldw = _ckldw != null ? _ckldw.key : '';
let _rkldw = _.maxBy(tmpRklUnit, function (o) { return o.count; })
this.rkldw = _rkldw != null ? _rkldw.key : '';
let _syldw = _.maxBy(tmpSylUnit, function (o) { return o.count; })
this.syldw = _syldw != null ? _syldw.key : '';
//
let sylCalc = that.getCalc(that.syldw)
let cklCalc = that.getCalc(that.ckldw)
let rklCalc = that.getCalc(that.rkldw)
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.rkl =_.divide( _.sumBy(deepClone(response.data), function (item) { return item.rkl }), rklCalc)
})
},
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() { exportExcel() {
let that = this let that = this
that.$modal.loading() that.$modal.loading()
@ -397,7 +475,7 @@ export default {
a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate))) a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate)))
a.click() a.click()
that.$modal.closeLoading() that.$modal.closeLoading()
that.saveSimpleLog({name:'',nameEn:'',jcmc:'给药制剂发放回收导出',jcmcEn:'Formulation In-and-Out Record Export'})
that.saveSimpleLog({ name: '', nameEn: '', jcmc: '给药制剂发放回收导出', jcmcEn: 'Formulation In-and-Out Record Export' })
}).finally(() => { }).finally(() => {
that.$modal.closeLoading() that.$modal.closeLoading()
}) })
@ -469,6 +547,7 @@ 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()
this.loading = false this.loading = false
}) })
}, },

+ 74
- 8
src/views/business/resource/mjy/comps/ffjlList.vue View File

@ -80,6 +80,10 @@
<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>
</el-row> </el-row>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
@ -112,6 +116,12 @@
{{ 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"
: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" <el-table-column :label="$t('page.business.resource.mjy.syl')" align="center"
:width="$i18n.locale === 'zh_CN' ? '80px' : '120px'"> :width="$i18n.locale === 'zh_CN' ? '80px' : '120px'">
<template slot-scope="scope"> <template slot-scope="scope">
@ -178,13 +188,11 @@
$t('page.business.resource.mjy.guidang') }}</el-button> $t('page.business.resource.mjy.guidang') }}</el-button>
<template v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1 && id == scope.row.gdsqrId"> <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>
</template> </template>
</el-table-column> </el-table-column>
@ -211,7 +219,7 @@
</template> </template>
<script> <script>
import { list } from "@/api/business/mjy/mjyFfjl"
import { list, yltj } from "@/api/business/mjy/mjyFfjl"
import Sd from "./ffjl/Sd"; import Sd from "./ffjl/Sd";
import Jy from "./ffjl/Jy"; import Jy from "./ffjl/Jy";
import Js from "./ffjl/Js"; import Js from "./ffjl/Js";
@ -252,6 +260,10 @@ export default {
startDateRk: null, startDateRk: null,
endDateRk: null, endDateRk: null,
}, },
jsl: '',
syl: '',
jsldw: '',
syldw: '',
} }
}, },
created() { created() {
@ -263,6 +275,59 @@ export default {
]), ]),
}, },
methods: { 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() { exportExcel() {
let that = this let that = this
that.$modal.loading() that.$modal.loading()
@ -397,7 +462,7 @@ export default {
a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate))) a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate)))
a.click() a.click()
that.$modal.closeLoading() 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(() => { }).finally(() => {
that.$modal.closeLoading() that.$modal.closeLoading()
}) })
@ -469,6 +534,7 @@ 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()
this.loading = false this.loading = false
}) })
}, },

Loading…
Cancel
Save