|
|
|
@ -87,9 +87,8 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<!-- 导出 --> |
|
|
|
<el-button type="primary" :disabled="multiple" @click="handleDc" |
|
|
|
v-hasPermi="['business:resource:mjy:dc']">{{ |
|
|
|
$t('form.export') }}</el-button> |
|
|
|
<el-button type="primary" @click="exportExcel" v-hasPermi="['business:resource:mjy:dc']">{{ |
|
|
|
$t('form.export') }}</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
@ -186,7 +185,7 @@ |
|
|
|
<el-button type="text" @click="handleGh(scope.row)" v-hasPermi="['business:resource:mjy:gh']">{{ |
|
|
|
$t('page.business.resource.mjy.guihuan') }}</el-button> |
|
|
|
</template> |
|
|
|
<template v-if="scope.row.zjzt == 2"> |
|
|
|
<template v-if="scope.row.zjzt == 2"> |
|
|
|
<!-- 入库 --> |
|
|
|
<el-button type="text" @click="handleRk(scope.row)" v-hasPermi="['business:resource:mjy:rk']">{{ |
|
|
|
$t('page.business.resource.mjy.ruku') }}</el-button> |
|
|
|
@ -261,17 +260,18 @@ import Czrq from "./mjy/Czrq"; |
|
|
|
import Czyj from "./mjy/Czyj"; |
|
|
|
import Ysff from "./mjy/Ysff"; |
|
|
|
import moment from "moment"; |
|
|
|
import { deepClone } from "@/utils/index"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "MjyList", |
|
|
|
components: { Rk,Sd, Js, Gd, Xq, Jd, Bj, Shbj, Xgkc, Shxgkc, Jy, Gh, Czyj, Czrq, Ff, Ysff }, |
|
|
|
components: { Rk, Sd, Js, Gd, Xq, Jd, Bj, Shbj, Xgkc, Shxgkc, Jy, Gh, Czyj, Czrq, Ff, Ysff }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
daterange: [], |
|
|
|
loading: true, |
|
|
|
single: true, |
|
|
|
multiple: true, |
|
|
|
showDetail:false, |
|
|
|
showDetail: false, |
|
|
|
total: 0, |
|
|
|
list: [], |
|
|
|
//勾选列表 |
|
|
|
@ -293,9 +293,124 @@ export default { |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
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.mjy.mc') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.bh') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.nd') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.kcl') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.sxrq') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.zcg') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.cctj') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.ccwz') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.zjzt') + '</th>' + |
|
|
|
'<th style="text-align: center;">' + this.$t('page.business.resource.mjy.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') |
|
|
|
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>' + |
|
|
|
value.bh + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
value.nd + value.nddw + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
value.kc + value.kcdw + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
value.sxrq + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
value.zcgMc + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
value.cctj + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
value.ccwz + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
zjzt + |
|
|
|
'</td>' + |
|
|
|
' <td>' + |
|
|
|
jyzt + |
|
|
|
'</td>' + |
|
|
|
'</tr>' |
|
|
|
}) |
|
|
|
tabelStr = tabelStr + _datastr + ' <table>' |
|
|
|
// Worksheet名 |
|
|
|
var worksheet = that.$t('page.business.resource.mjy.mjygl') |
|
|
|
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() |
|
|
|
}) |
|
|
|
}, |
|
|
|
//钥匙发放 |
|
|
|
handleYsff() { |
|
|
|
@ -349,7 +464,7 @@ export default { |
|
|
|
handleGh(row) { |
|
|
|
this.$refs.Gh.show(row) |
|
|
|
}, |
|
|
|
//入库 |
|
|
|
//入库 |
|
|
|
handleRk(row) { |
|
|
|
this.$refs.Rk.show(row) |
|
|
|
}, |
|
|
|
@ -357,15 +472,15 @@ export default { |
|
|
|
checkSelectable(row) { |
|
|
|
return true; |
|
|
|
}, |
|
|
|
closeXq(){ |
|
|
|
this.showDetail=false |
|
|
|
this.$emit('showDetail',this.showDetail) |
|
|
|
closeXq() { |
|
|
|
this.showDetail = false |
|
|
|
this.$emit('showDetail', this.showDetail) |
|
|
|
this.handleQuery() |
|
|
|
}, |
|
|
|
//详情 |
|
|
|
handleXq(row) { |
|
|
|
this.showDetail=true |
|
|
|
this.$emit('showDetail',this.showDetail) |
|
|
|
this.showDetail = true |
|
|
|
this.$emit('showDetail', this.showDetail) |
|
|
|
this.$refs.Xq.show(row) |
|
|
|
}, |
|
|
|
//批量解锁 |
|
|
|
|