|
|
|
@ -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>' + |
|
|
|
' ' + 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) |
|
|
|
|