Browse Source

fix:[试验管理][饲养间管理]导出

lkf
HanLong 2 months ago
parent
commit
d4a47e106f
5 changed files with 116 additions and 17 deletions
  1. +6
    -6
      src/lang/en/business/study/studyRoom.js
  2. +6
    -5
      src/views/business/resource/gsp/comps/ffjlList.vue
  3. +1
    -0
      src/views/business/resource/gsp/comps/gspList.vue
  4. +2
    -1
      src/views/business/resource/gsp/comps/rkjlList.vue
  5. +101
    -5
      src/views/business/study/comp/syjList.vue

+ 6
- 6
src/lang/en/business/study/studyRoom.js View File

@ -13,13 +13,13 @@ export default {
jsr: 'End by',
jssj: 'End Date',
zt: 'Status',
syz: '使用中',
yjs: '已结束',
ghlj: '更换笼具',
js: '结束',
ljjl: '笼具记录',
syz: 'In use',
yjs: 'Ended',
ghlj: 'Replace the cage',
js: 'End',
ljjl: 'Cage records',
ghr: '更换人',
ghsj: '更换时间',
ghsj: 'Change time',
ghqlj: '更换前笼具',
ghhlj: '更换后笼具',
}

+ 6
- 5
src/views/business/resource/gsp/comps/ffjlList.vue View File

@ -163,12 +163,12 @@
v-hasPermi="['business:resource:gsp:ffjlgd']">{{
$t('page.business.resource.gsp.guidang') }}</el-button>
<!-- 解档 -->
<el-button type="text" v-if="scope.row.jlzt == 7 && id == scope.row.gdsqrId" @click="handleJd(scope.row)"
<el-button type="text" v-if="scope.row.jlzt == 7 && id == scope.row.gdsqrId" @click="handleJd(scope.row)"
v-hasPermi="['business:resource:gsp:ffjljd']">{{
$t('page.business.resource.gsp.jiedang') }}</el-button>
<!-- 借阅 -->
<el-button type="text" v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1 && id == scope.row.gdsqrId" @click="handleJy(scope.row)"
v-hasPermi="['business:resource:gsp:ffjljy']">{{
<el-button type="text" v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1 && id == scope.row.gdsqrId"
@click="handleJy(scope.row)" v-hasPermi="['business:resource:gsp:ffjljy']">{{
$t('page.business.resource.gsp.jieyue') }}</el-button>
</template>
</el-table-column>
@ -316,7 +316,7 @@ export default {
'&nbsp;' + value.bh +
'</td>' +
' <td>' +
(value.mdMcs&&value.mdMcs!=''&&value.mdOther&&value.mdOther!=''? (value.mdMcs +","+value.mdOther) :(value.mdMcs +value.mdOther))+
(value.mdMcs && value.mdMcs != '' && value.mdOther && value.mdOther != '' ? (value.mdMcs + "," + value.mdOther) : (value.mdMcs + value.mdOther)) +
'</td>' +
' <td>' +
value.ffzytj +
@ -359,6 +359,7 @@ export default {
'</td>' +
'</tr>'
})
_datastr = _datastr.replaceAll('null', '')
tabelStr = tabelStr + _datastr + ' <table>'
// Worksheet
var worksheet = that.$t('page.business.resource.gsp.ffhsjl')
@ -380,7 +381,7 @@ export default {
a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate)))
a.click()
that.$modal.closeLoading()
this.saveSimpleLog({name:'',nameEn:'',jcmc:'供试品发放回收导出',jcmcEn:'Test Item In-and-Out Record Export'})
this.saveSimpleLog({ name: '', nameEn: '', jcmc: '供试品发放回收导出', jcmcEn: 'Test Item In-and-Out Record Export' })
}).finally(() => {
that.$modal.closeLoading()
})

+ 1
- 0
src/views/business/resource/gsp/comps/gspList.vue View File

@ -385,6 +385,7 @@ export default {
'</td>' +
'</tr>'
})
_datastr = _datastr.replaceAll('null', '')
tabelStr = tabelStr + _datastr + ' <table>'
// Worksheet
var worksheet = that.$t('page.business.resource.gsp.gspgl')

+ 2
- 1
src/views/business/resource/gsp/comps/rkjlList.vue View File

@ -177,7 +177,7 @@
<!-- 新增 -->
<Xz key="Xz" ref="Xz" @callback="handleQuery" />
<!-- 导入 -->
<RkjlImport key="RkjlImport" ref="RkjlImport" @callback="handleQuery"/>
<RkjlImport key="RkjlImport" ref="RkjlImport" @callback="handleQuery" />
</div>
</div>
@ -325,6 +325,7 @@ export default {
'</td>' +
'</tr>'
})
_datastr = _datastr.replaceAll('null', '')
tabelStr = tabelStr + _datastr + ' <table>'
// Worksheet
var worksheet = that.$t('page.business.resource.gsp.gsprkjl')

+ 101
- 5
src/views/business/study/comp/syjList.vue View File

@ -100,7 +100,7 @@
<!-- 笼具更换记录 -->
<Jl key="Jl" ref="Jl" @callback="search" />
<!-- 详情 -->
<Detail key="Detail" ref="Detail" @callback="search" @close="xqClose" v-show="showDetail"/>
<Detail key="Detail" ref="Detail" @callback="search" @close="xqClose" v-show="showDetail" />
</div>
</template>
@ -114,6 +114,7 @@ import Jl from "./syj/Jl";
import Detail from "./syj/Detail";
import { mapGetters } from 'vuex'
import moment from "moment";
import { deepClone } from "@/utils/index";
export default {
name: 'SyjList',
props: {
@ -168,7 +169,105 @@ export default {
},
created() { },
methods: {
//
handleExport() {
let that = this
that.$modal.loading()
let params = deepClone(this.searchForm)
params.pageSize = 999999
studyRoom_list(params).then(response => {
var tabelStr =
'<table border="1" class="html-tabel">' +
'<tr style="background:#eee;">' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.syjh') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.syqy') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.dwzs') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.longju') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.kssyyl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.qyr') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.kssj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.jssyyl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.jsr') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.jssj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.study.studyRoom.zt') + '</th>' +
' </tr>'
let _datastr = ''
_.forEach(response.rows, function (value) {
let zt = ''
switch (value.zt) {
case 1:
zt = that.$t('page.business.study.studyRoom.syz')
break
case 3:
zt = that.$t('page.business.study.studyRoom.yjs')
break
}
_datastr =
_datastr +
'<tr style="text-align: center;">' +
' <td>' +
value.syjh +
'</td>' +
' <td>' +
'&nbsp;' + value.syqy +
'</td>' +
' <td>' +
value.dwzs +
'</td>' +
' <td>' +
value.lj +
'</td>' +
' <td>' +
value.kssyyl +
'</td>' +
' <td>' +
value.qyrMc +
'</td>' +
' <td>' +
value.createTime +
'</td>' +
' <td>' +
value.jssyyl +
'</td>' +
' <td>' +
value.jsrMc +
'</td>' +
'<td>' +
value.jssj +
'</td>' +
'<td>' +
zt +
'</td>' +
'</tr>'
})
_datastr = _datastr.replaceAll('null', ' ')
tabelStr = tabelStr + _datastr + ' <table>'
console.log(tabelStr)
// Worksheet
var worksheet = that.$t('page.business.study.studyEnter.syjsygl')
var uri = 'data:application/vnd.ms-excel;base64,'
// HTML
var exportTemplate = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>
<x:Name>${worksheet}</x:Name>
<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>
</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->
</head>
<body>
${tabelStr}
</body>
</html>`
var a = document.createElement('a')
a.download = worksheet + '.xls'
a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate)))
a.click()
that.$modal.closeLoading()
this.saveSimpleLog({ name: '', nameEn: '', jcmc: '饲养间使用管理导出', jcmcEn: 'Animal Room Usage Export' })
}).finally(() => {
that.$modal.closeLoading()
})
},
search() {
this.searchForm.pageNum = 1
this.getList()
@ -215,9 +314,6 @@ export default {
// this.$emit('showDetail', this.showDetail)
// this.$refs.Xq.show(row)
},
handleExport() {
},
xqClose() {
this.showDetail = false
this.$emit('showDetail', this.showDetail)

Loading…
Cancel
Save