Browse Source

feat:[资源库管理][供试品管理]导出

lkf
HanLong 3 months ago
parent
commit
8766699697
3 changed files with 403 additions and 39 deletions
  1. +149
    -14
      src/views/business/resource/gsp/comps/ffjlList.vue
  2. +119
    -6
      src/views/business/resource/gsp/comps/gspList.vue
  3. +135
    -19
      src/views/business/resource/gsp/comps/rkjlList.vue

+ 149
- 14
src/views/business/resource/gsp/comps/ffjlList.vue View File

@ -41,7 +41,7 @@
<el-option :label="$t('page.business.resource.resource.jyzt.jyz')" :value="5" /> <el-option :label="$t('page.business.resource.resource.jyzt.jyz')" :value="5" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 出库日期 -->
<!-- 出库日期 -->
<el-form-item :label="$t('page.business.resource.mjy.cksj') + ':'"> <el-form-item :label="$t('page.business.resource.mjy.cksj') + ':'">
<el-date-picker v-model="daterangeCk" class="chat-histogram-daterange" type="daterange" <el-date-picker v-model="daterangeCk" class="chat-histogram-daterange" type="daterange"
range-separator="-" :start-placeholder="$t('form.startDate')" :end-placeholder="$t('form.endDate')" range-separator="-" :start-placeholder="$t('form.startDate')" :end-placeholder="$t('form.endDate')"
@ -75,7 +75,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 导出 --> <!-- 导出 -->
<el-button type="primary" :disabled="multiple" @click="handleDc"
<el-button type="primary" @click="exportExcel"
v-hasPermi="['business:resource:gsp:ffjldc']">{{ v-hasPermi="['business:resource:gsp:ffjldc']">{{
$t('form.export') }}</el-button> $t('form.export') }}</el-button>
</el-col> </el-col>
@ -95,7 +95,7 @@
<el-table-column :label="$t('page.business.resource.gsp.rksj')" align="center" prop="ghrq" width="150px" /> <el-table-column :label="$t('page.business.resource.gsp.rksj')" align="center" prop="ghrq" width="150px" />
<el-table-column :label="$t('page.business.resource.gsp.ckl')" align="center" width="150px"> <el-table-column :label="$t('page.business.resource.gsp.ckl')" align="center" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.ckl }} {{ scope.row.ckdw }}
{{ scope.row.ckl }} {{ scope.row.ckldw }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.gsp.rkl')" align="center" width="150px"> <el-table-column :label="$t('page.business.resource.gsp.rkl')" align="center" width="150px">
@ -138,32 +138,32 @@
class-name="small-padding fixed-width" width="250px"> class-name="small-padding fixed-width" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 加签 --> <!-- 加签 -->
<el-button v-if="scope.row.jlzt == 1" type="text" v-hasPermi="['business:resource:gsp:ffjljq']" @click="handleJq(scope.row)">{{
<el-button v-if="scope.row.jlzt == 1" type="text" v-hasPermi="['business:resource:gsp:ffjljq']"
@click="handleJq(scope.row)">{{
$t('page.business.resource.gsp.jiaqian') }}</el-button> $t('page.business.resource.gsp.jiaqian') }}</el-button>
<!-- 详情 --> <!-- 详情 -->
<el-button v-if="scope.row.jlzt == 1 || scope.row.jlzt == 3 || scope.row.jlzt == 7" type="text" <el-button v-if="scope.row.jlzt == 1 || scope.row.jlzt == 3 || scope.row.jlzt == 7" type="text"
v-hasPermi="['business:resource:gsp:ffjlxq']"
@click="handleXq(scope.row)" >{{
v-hasPermi="['business:resource:gsp:ffjlxq']" @click="handleXq(scope.row)">{{
$t('page.business.resource.gsp.detail') }}</el-button> $t('page.business.resource.gsp.detail') }}</el-button>
<!-- 锁定 --> <!-- 锁定 -->
<el-button type="text" v-if="scope.row.jlzt == 1" @click="handleSd(scope.row)" <el-button type="text" v-if="scope.row.jlzt == 1" @click="handleSd(scope.row)"
v-hasPermi="['business:resource:gsp:ffjlsd']">{{
v-hasPermi="['business:resource:gsp:ffjlsd']">{{
$t('page.business.resource.gsp.lock') }}</el-button> $t('page.business.resource.gsp.lock') }}</el-button>
<!-- 解锁 --> <!-- 解锁 -->
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleJs(scope.row)" <el-button type="text" v-if="scope.row.jlzt == 3" @click="handleJs(scope.row)"
v-hasPermi="['business:resource:gsp:ffjljs']">{{
v-hasPermi="['business:resource:gsp:ffjljs']">{{
$t('page.business.resource.gsp.unlock') }}</el-button> $t('page.business.resource.gsp.unlock') }}</el-button>
<!-- 归档 --> <!-- 归档 -->
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleGd(scope.row)" <el-button type="text" v-if="scope.row.jlzt == 3" @click="handleGd(scope.row)"
v-hasPermi="['business:resource:gsp:ffjlgd']">{{
v-hasPermi="['business:resource:gsp:ffjlgd']">{{
$t('page.business.resource.gsp.guidang') }}</el-button> $t('page.business.resource.gsp.guidang') }}</el-button>
<!-- 解档 --> <!-- 解档 -->
<el-button type="text" v-if="scope.row.jlzt == 7" @click="handleJd(scope.row)" <el-button type="text" v-if="scope.row.jlzt == 7" @click="handleJd(scope.row)"
v-hasPermi="['business:resource:gsp:ffjljd']">{{
v-hasPermi="['business:resource:gsp:ffjljd']">{{
$t('page.business.resource.gsp.jiedang') }}</el-button> $t('page.business.resource.gsp.jiedang') }}</el-button>
<!-- 借阅 --> <!-- 借阅 -->
<el-button type="text" v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1" @click="handleJy(scope.row)" <el-button type="text" v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1" @click="handleJy(scope.row)"
v-hasPermi="['business:resource:gsp:ffjljy']">{{
v-hasPermi="['business:resource:gsp:ffjljy']">{{
$t('page.business.resource.gsp.jieyue') }}</el-button> $t('page.business.resource.gsp.jieyue') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -198,7 +198,7 @@ import Gd from "./ffjl/Gd";
import Jd from "./ffjl/Jd"; import Jd from "./ffjl/Jd";
import Xq from "./ffjl/Xq"; import Xq from "./ffjl/Xq";
import Jq from "./ffjl/Jq"; import Jq from "./ffjl/Jq";
import { deepClone } from "@/utils/index";
export default { export default {
name: "FfjlList", name: "FfjlList",
components: { Sd, Js, Gd, Jd, Jy, Xq, Jq }, components: { Sd, Js, Gd, Jd, Jy, Xq, Jq },
@ -235,8 +235,143 @@ export default {
}, },
methods: { methods: {
// //
handleDc() {
exportExcel() {
let that = this
that.$modal.loading()
let params = deepClone(this.queryParams)
params.pageSize = 999999
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.resource.gsp.mc') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.bh') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.md') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.zytj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.cksj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.rksj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.ckl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.rkl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.syl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.lqr1') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.lqr2') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.kgy1') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.kgy2') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.zcg') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.jlzt') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.jyzt') + '</th>' +
' </tr>'
let _datastr = ''
_.forEach(response.rows, function (value) {
let jlzt = ''
switch (value.jlzt) {
case 1:
jlzt = that.$t('page.business.resource.resource.jlzt.wsd')
break
case 3:
jlzt = that.$t('page.business.resource.resource.jlzt.ysd')
break
case 5:
jlzt = that.$t('page.business.resource.resource.jlzt.dgd')
break
case 7:
jlzt = that.$t('page.business.resource.resource.jlzt.gd')
break
case 9:
jlzt = that.$t('page.business.resource.resource.jlzt.djd')
break
default: jlzt = ''
}
let jyzt = ''
switch (value.jyzt) {
case 1:
jyzt = that.$t('page.business.resource.resource.jyzt.wjy')
break
case 3:
jyzt = that.$t('page.business.resource.resource.jyzt.djy')
break
case 5:
jyzt = that.$t('page.business.resource.resource.jyzt.jyz')
break
default: jyzt = ''
}
_datastr =
_datastr +
'<tr style="text-align: center;">' +
' <td>' +
value.mc +
'</td>' +
' <td>' +
'&nbsp;' + value.bh +
'</td>' +
' <td>' +
value.mdMc +
'</td>' +
' <td>' +
value.ffzytj +
'</td>' +
' <td>' +
value.ffrq +
'</td>' +
' <td>' +
value.ghrq +
'</td>' +
' <td>' +
value.ckl + value.ckldw +
'</td>' +
' <td>' +
value.rkl + value.rkldw +
'</td>' +
' <td>' +
value.syl + value.syldw +
'</td>' +
' <td>' +
value.lqr1Mc +
'</td>' +
' <td>' +
value.lqr2Mc +
'</td>' +
' <td>' +
value.jsr1Mc +
'</td>' +
' <td>' +
value.jsr2Mc +
'</td>' +
' <td>' +
value.zcgMc +
'</td>' +
' <td>' +
jlzt +
'</td>' +
' <td>' +
jyzt +
'</td>' +
'</tr>'
})
tabelStr = tabelStr + _datastr + ' <table>'
// Worksheet
var worksheet = that.$t('page.business.resource.gsp.ffhsjl')
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()
}).finally(() => {
that.$modal.closeLoading()
})
}, },
// //
handleJq(row) { handleJq(row) {

+ 119
- 6
src/views/business/resource/gsp/comps/gspList.vue View File

@ -90,7 +90,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 导出 --> <!-- 导出 -->
<el-button type="primary" @click="handleDc" v-hasPermi="['business:resource:gsp:dc']">{{
<el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:gsp:dc']">{{
$t('form.export') }}</el-button> $t('form.export') }}</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -115,7 +115,7 @@
<el-table-column :label="$t('page.business.resource.gsp.jsrq')" align="center" prop="jsrq" width="150px" /> <el-table-column :label="$t('page.business.resource.gsp.jsrq')" align="center" prop="jsrq" width="150px" />
<el-table-column :label="$t('page.business.resource.gsp.cctj')" align="center" prop="cctj" width="130px" /> <el-table-column :label="$t('page.business.resource.gsp.cctj')" align="center" prop="cctj" width="130px" />
<el-table-column :label="$t('page.business.resource.mjy.zjzt')" align="center" width="100px" fixed="right">
<el-table-column :label="$t('page.business.resource.gsp.zjzt')" align="center" width="100px" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.zjzt == 1">{{ $t('page.business.resource.resource.zjzt.rk') }}</span> <span v-if="scope.row.zjzt == 1">{{ $t('page.business.resource.resource.zjzt.rk') }}</span>
<span v-if="scope.row.zjzt == 3">{{ $t('page.business.resource.resource.zjzt.yff') }}</span> <span v-if="scope.row.zjzt == 3">{{ $t('page.business.resource.resource.zjzt.yff') }}</span>
@ -125,7 +125,7 @@
<span v-if="scope.row.zjzt == 11">{{ $t('page.business.resource.resource.zjzt.djd') }}</span> <span v-if="scope.row.zjzt == 11">{{ $t('page.business.resource.resource.zjzt.djd') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.mjy.jyzt')" align="center" width="100px" fixed="right">
<el-table-column :label="$t('page.business.resource.gsp.jyzt')" align="center" width="100px" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.jyzt == 1">{{ $t('page.business.resource.resource.jyzt.wjy') }}</span> <span v-if="scope.row.jyzt == 1">{{ $t('page.business.resource.resource.jyzt.wjy') }}</span>
<span v-if="scope.row.jyzt == 3">{{ $t('page.business.resource.resource.jyzt.djy') }}</span> <span v-if="scope.row.jyzt == 3">{{ $t('page.business.resource.resource.jyzt.djy') }}</span>
@ -251,7 +251,7 @@ import Ff from "./gsp/Ff";
import Cz from "./gsp/Cz"; import Cz from "./gsp/Cz";
import CzBatch from "./gsp/CzBatch"; import CzBatch from "./gsp/CzBatch";
import Ysff from "./gsp/Ysff"; import Ysff from "./gsp/Ysff";
import { deepClone } from "@/utils/index";
export default { export default {
name: "GspList", name: "GspList",
components: { Xz, Sd, Js, Gd, Xq, Jd, Bj, Shbj, Xgkc, Shxgkc, Jy, Gh, Cz, CzBatch, Ff, Ysff }, components: { Xz, Sd, Js, Gd, Xq, Jd, Bj, Shbj, Xgkc, Shxgkc, Jy, Gh, Cz, CzBatch, Ff, Ysff },
@ -284,8 +284,121 @@ export default {
}, },
methods: { methods: {
// //
handleDc() {
exportExcel() {
let that = this
that.$modal.loading()
let params = deepClone(this.queryParams)
params.pageSize = 999999
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.resource.gsp.mc') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.bh') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.gg') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.kcl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.ph') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.jsrq') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.cctj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.zjzt') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.jyzt') + '</th>' +
' </tr>'
let _datastr = ''
_.forEach(response.rows, function (value) {
let zjzt = ''
switch (value.zjzt) {
case 1:
zjzt = that.$t('page.business.resource.resource.zjzt.rk')
break
case 2:
zjzt = that.$t('page.business.resource.resource.zjzt.wrk')
break
case 3:
zjzt = that.$t('page.business.resource.resource.zjzt.yff')
break
case 5:
zjzt = that.$t('page.business.resource.resource.zjzt.ysd')
break
case 7:
zjzt = that.$t('page.business.resource.resource.zjzt.dgd')
break
case 9:
zjzt = that.$t('page.business.resource.resource.zjzt.gd')
break
case 11:
zjzt = that.$t('page.business.resource.resource.zjzt.djd')
break
default: zjzt = ''
}
let jyzt = ''
switch (value.jyzt) {
case 1:
jyzt = that.$t('page.business.resource.resource.jyzt.wjy')
break
case 3:
jyzt = that.$t('page.business.resource.resource.jyzt.djy')
break
case 5:
jyzt = that.$t('page.business.resource.resource.jyzt.jyz')
break
default: jyzt = ''
}
_datastr =
_datastr +
'<tr style="text-align: center;">' +
' <td>' +
value.mc +
'</td>' +
' <td>' +
'&nbsp;'+value.bh +
'</td>' +
' <td>' +
value.gg + value.ggdw +
'</td>' +
' <td>' +
value.kc + value.kcdw +
'</td>' +
' <td>' +
value.ph +
'</td>' +
' <td>' +
value.jsrq +
'</td>' +
' <td>' +
value.cctj +
'</td>' +
' <td>' +
zjzt +
'</td>' +
' <td>' +
jyzt +
'</td>' +
'</tr>'
})
tabelStr = tabelStr + _datastr + ' <table>'
// Worksheet
var worksheet = that.$t('page.business.resource.gsp.gspgl')
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()
}).finally(() => {
that.$modal.closeLoading()
})
}, },
// //
handleXz() { handleXz() {

+ 135
- 19
src/views/business/resource/gsp/comps/rkjlList.vue View File

@ -57,27 +57,30 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 新增 --> <!-- 新增 -->
<el-button type="primary" @click="handleXz" v-hasPermi="['business:resource:gsp:rkxz']">{{
$t('form.add') }}</el-button>
<el-button type="primary" @click="handleXz" v-hasPermi="['business:resource:gsp:rkxz']">{{
$t('form.add') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 导入 --> <!-- 导入 -->
<el-button type="primary" @click="handleXz" v-hasPermi="['business:resource:gsp:rkdr']">{{
$t('page.business.resource.gsp.dr') }}</el-button>
<el-button type="primary" @click="handleXz" v-hasPermi="['business:resource:gsp:rkdr']">{{
$t('page.business.resource.gsp.dr') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 批量归档 --> <!-- 批量归档 -->
<el-button type="primary" :disabled="multiple" @click="handlePlgd" v-hasPermi="['business:resource:gsp:rkgd']">{{
<el-button type="primary" :disabled="multiple" @click="handlePlgd"
v-hasPermi="['business:resource:gsp:rkgd']">{{
$t('page.business.resource.gsp.plgd') }}</el-button> $t('page.business.resource.gsp.plgd') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 批量锁定 --> <!-- 批量锁定 -->
<el-button type="primary" :disabled="multiple" @click="handlePlsd" v-hasPermi="['business:resource:gsp:rksd']">{{
<el-button type="primary" :disabled="multiple" @click="handlePlsd"
v-hasPermi="['business:resource:gsp:rksd']">{{
$t('page.business.resource.gsp.plsd') }}</el-button> $t('page.business.resource.gsp.plsd') }}</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<!-- 导出 --> <!-- 导出 -->
<el-button type="primary" :disabled="multiple" @click="handleDc" v-hasPermi="['business:resource:gsp:rkdc']">{{
<el-button type="primary" @click="exportExcel"
v-hasPermi="['business:resource:gsp:rkdc']">{{
$t('form.export') }}</el-button> $t('form.export') }}</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -88,7 +91,7 @@
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column :label="$t('page.business.resource.gsp.ph')" align="center" prop="ph" <el-table-column :label="$t('page.business.resource.gsp.ph')" align="center" prop="ph"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column :label="$t('page.business.resource.gsp.gg')" align="center" >
<el-table-column :label="$t('page.business.resource.gsp.gg')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.gg }} {{ scope.row.ggdw }} {{ scope.row.gg }} {{ scope.row.ggdw }}
</template> </template>
@ -97,7 +100,7 @@
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column :label="$t('page.business.resource.gsp.rkl')" align="center" width="150px"> <el-table-column :label="$t('page.business.resource.gsp.rkl')" align="center" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.rkl }} {{ scope.row.rkdl }}
{{ scope.row.rkl }} {{ scope.row.rkdw }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.gsp.cctj')" align="center" prop="cctj" /> <el-table-column :label="$t('page.business.resource.gsp.cctj')" align="center" prop="cctj" />
@ -123,26 +126,32 @@
class-name="small-padding fixed-width" width="250px"> class-name="small-padding fixed-width" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 编辑 --> <!-- 编辑 -->
<el-button v-if="scope.row.jlzt == 1" type="text" @click="handleBj(scope.row)" v-hasPermi="['business:resource:gsp:rkbj']">{{
<el-button v-if="scope.row.jlzt == 1" type="text" @click="handleBj(scope.row)"
v-hasPermi="['business:resource:gsp:rkbj']">{{
$t('form.edit') }}</el-button> $t('form.edit') }}</el-button>
<!-- 详情 --> <!-- 详情 -->
<el-button v-if="scope.row.jlzt == 1 || scope.row.jlzt == 3 || scope.row.jlzt == 7" type="text" <el-button v-if="scope.row.jlzt == 1 || scope.row.jlzt == 3 || scope.row.jlzt == 7" type="text"
@click="handleXq(scope.row)" v-hasPermi="['business:resource:gsp:rkxq']">{{ @click="handleXq(scope.row)" v-hasPermi="['business:resource:gsp:rkxq']">{{
$t('page.business.resource.gsp.detail') }}</el-button> $t('page.business.resource.gsp.detail') }}</el-button>
<!-- 锁定 --> <!-- 锁定 -->
<el-button type="text" v-if="scope.row.jlzt == 1" @click="handleSd(scope.row)" v-hasPermi="['business:resource:gsp:rksd']">{{
<el-button type="text" v-if="scope.row.jlzt == 1" @click="handleSd(scope.row)"
v-hasPermi="['business:resource:gsp:rksd']">{{
$t('page.business.resource.gsp.lock') }}</el-button> $t('page.business.resource.gsp.lock') }}</el-button>
<!-- 解锁 --> <!-- 解锁 -->
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleJs(scope.row)" v-hasPermi="['business:resource:gsp:rkjs']">{{
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleJs(scope.row)"
v-hasPermi="['business:resource:gsp:rkjs']">{{
$t('page.business.resource.gsp.unlock') }}</el-button> $t('page.business.resource.gsp.unlock') }}</el-button>
<!-- 归档 --> <!-- 归档 -->
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleGd(scope.row)" v-hasPermi="['business:resource:gsp:rkgd']">{{
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleGd(scope.row)"
v-hasPermi="['business:resource:gsp:rkgd']">{{
$t('page.business.resource.gsp.guidang') }}</el-button> $t('page.business.resource.gsp.guidang') }}</el-button>
<!-- 解档 --> <!-- 解档 -->
<el-button type="text" v-if="scope.row.jlzt == 7" @click="handleJd(scope.row)" v-hasPermi="['business:resource:gsp:rkjd']">{{
<el-button type="text" v-if="scope.row.jlzt == 7" @click="handleJd(scope.row)"
v-hasPermi="['business:resource:gsp:rkjd']">{{
$t('page.business.resource.gsp.jiedang') }}</el-button> $t('page.business.resource.gsp.jiedang') }}</el-button>
<!-- 借阅 --> <!-- 借阅 -->
<el-button type="text" v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1" @click="handleJy(scope.row)" v-hasPermi="['business:resource:gsp:rkjy']">{{
<el-button type="text" v-if="scope.row.jlzt == 7 && scope.row.jyzt == 1" @click="handleJy(scope.row)"
v-hasPermi="['business:resource:gsp:rkjy']">{{
$t('page.business.resource.gsp.jieyue') }}</el-button> $t('page.business.resource.gsp.jieyue') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -180,10 +189,10 @@ import Jd from "./rkjl/Jd";
import Xq from "./rkjl/Xq"; import Xq from "./rkjl/Xq";
import Xz from "./rkjl/Xz"; import Xz from "./rkjl/Xz";
import Bj from "./rkjl/Bj"; import Bj from "./rkjl/Bj";
import { deepClone } from "@/utils/index";
export default { export default {
name: "FfjlList", name: "FfjlList",
components: { Sd, Js, Gd, Jd, Jy, Xq, Xz, Bj },
components: { Sd, Js, Gd, Jd, Jy, Xq, Xz, Bj },
data() { data() {
return { return {
daterangeCk: [], daterangeCk: [],
@ -217,8 +226,115 @@ export default {
}, },
methods: { methods: {
// //
handleDc() {
exportExcel() {
let that = this
that.$modal.loading()
let params = deepClone(this.queryParams)
params.pageSize = 999999
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.resource.gsp.mc') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.ph') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.gg') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.rksj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.kcl') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.cctj') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.zysx') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.jlzt') + '</th>' +
'<th style="text-align: center;">' + this.$t('page.business.resource.gsp.jyzt') + '</th>' +
' </tr>'
let _datastr = ''
_.forEach(response.rows, function (value) {
let jlzt = ''
switch (value.jlzt) {
case 1:
jlzt = that.$t('page.business.resource.resource.jlzt.wsd')
break
case 3:
jlzt = that.$t('page.business.resource.resource.jlzt.ysd')
break
case 5:
jlzt = that.$t('page.business.resource.resource.jlzt.dgd')
break
case 7:
jlzt = that.$t('page.business.resource.resource.jlzt.gd')
break
case 9:
jlzt = that.$t('page.business.resource.resource.jlzt.djd')
break
default: jlzt = ''
}
let jyzt = ''
switch (value.jyzt) {
case 1:
jyzt = that.$t('page.business.resource.resource.jyzt.wjy')
break
case 3:
jyzt = that.$t('page.business.resource.resource.jyzt.djy')
break
case 5:
jyzt = that.$t('page.business.resource.resource.jyzt.jyz')
break
default: jyzt = ''
}
_datastr =
_datastr +
'<tr style="text-align: center;">' +
' <td>' +
value.mc +
'</td>' +
' <td>' +
'&nbsp;' + value.ph +
'</td>' +
' <td>' +
value.gg + value.ggdw +
'</td>' +
' <td>' +
value.rksj +
'</td>' +
' <td>' +
value.rkl + value.rkdw +
'</td>' +
' <td>' +
value.cctj +
'</td>' +
' <td>' +
value.zysx +
'</td>' +
' <td>' +
jlzt +
'</td>' +
' <td>' +
jyzt +
'</td>' +
'</tr>'
})
tabelStr = tabelStr + _datastr + ' <table>'
// Worksheet
var worksheet = that.$t('page.business.resource.gsp.gsprkjl')
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()
}).finally(() => {
that.$modal.closeLoading()
})
}, },
handleBj(row) { handleBj(row) {
this.$refs.Bj.show(row) this.$refs.Bj.show(row)

Loading…
Cancel
Save