Browse Source

二维码

master
zhangyuan 3 years ago
parent
commit
7cf1b52fff
  1. 65
      src/views/modules/personroom/epidemicbuildingunit.vue

65
src/views/modules/personroom/epidemicbuildingunit.vue

@ -50,7 +50,6 @@
<el-button type="primary"
@click="beforeImportUser">导入</el-button>
</el-form-item>
<el-form-item>
<el-upload ref="upload"
:action="uploadUrl"
@ -62,6 +61,10 @@
type="primary">导入</el-button>
</el-upload>
</el-form-item>
<!-- <el-form-item>-->
<!-- <el-button type="primary"-->
<!-- @click="updateMa">更新数据码</el-button>-->
<!-- </el-form-item>-->
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
@ -80,6 +83,7 @@
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<!-- <el-button type="text" size="small" @click="downloadMa(scope.row.id)">下载房屋二维码</el-button>-->
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
@ -95,6 +99,27 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog :visible.sync="faultDataVisible"
title="请修改后重新导入">
<el-table :data="this.errordataList"
border
style="width: 100%;">
<el-table-column prop="errorLine"
label="行数"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="errorInfo"
label="错误信息"
header-align="center"
align="center"></el-table-column>
</el-table>
<template slot="footer">
<!--<el-button type="primary" @click="importResult">忽略错误</el-button>-->
<el-button type="primary"
@click="exportError">导出错误数据</el-button>
</template>
</el-dialog>
</div>
</el-card>
</template>
@ -103,6 +128,7 @@
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './epidemicbuildingunit-add-or-update'
import Cookies from "js-cookie";
import qs from "qs";
export default {
mixins: [mixinViewModule],
data () {
@ -111,9 +137,12 @@ export default {
getDataListURL: '/custom/epidemicbuildingunit/page',
getDataListIsPage: true,
deleteURL: '/custom/epidemicbuildingunit',
deleteIsBatch: true
deleteIsBatch: true,
exportErrorInfoURL: '/custom/epidemicusererror/export'
},
options: [],
faultDataVisible: false,
errordataList: [],
deptIdListUpload: [],
roomTypeArr: [],
roomUseArr: [],
@ -214,6 +243,38 @@ export default {
this.uploeadLoeading = false
this.$message.error('上传失败请重试')
},
updateMa () {
this.$http.post(`/custom/epidemicbuildingunit/updateMaCode`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}).catch(() => {})
this.$http.post(`/custom/epidemicplotbuilding/updateMaCode`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}).catch(() => {})
},
downloadMa (id) {
this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}).catch(() => {})
},
//
exportError () {
var params = qs.stringify({
// 'token': window.localStorage.getItem('token'),
'token': Cookies.get('token'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportErrorInfoURL}?${params}`
this.$message({
type: 'success',
message: '下载成功'
});
},
beforeImportUser () {
//
if (this.gridIdImport === '') {

Loading…
Cancel
Save