|
|
|
@ -6,12 +6,12 @@ |
|
|
|
:close-on-press-escape="false" |
|
|
|
> |
|
|
|
<el-form :inline="true" :model="dataForm"> |
|
|
|
<!-- <el-form-item> |
|
|
|
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input> |
|
|
|
</el-form-item> --> |
|
|
|
<!-- <el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="dataForm.sentryPostCode" placeholder="哨卡编码" clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|
|
|
</el-form-item> --> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
@ -23,12 +23,31 @@ |
|
|
|
</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> |
|
|
|
<!-- <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> --> |
|
|
|
<el-table-column prop="sentryPostCode" label="哨卡编码" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="sentryPostName" label="哨卡名称" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="thirdSentryPostId" label="第三方哨卡id" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="maCodeUrl" label="小程序码图片" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column align="center" header-align="center" |
|
|
|
label="小程序码" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
prop="maCodeUrl"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-popover placement="right" |
|
|
|
title="" |
|
|
|
trigger="click" |
|
|
|
class="big_image"> |
|
|
|
<el-image slot="reference" |
|
|
|
min-width="70" |
|
|
|
height="70" |
|
|
|
v-if="scope.row.maCodeUrl" |
|
|
|
:src="scope.row.maCodeUrl" |
|
|
|
:alt="scope.row.maCodeUrl"></el-image> |
|
|
|
<img class="big_image" |
|
|
|
:src="scope.row.maCodeUrl" /> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center" width="160px"></el-table-column> |
|
|
|
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="danger" |
|
|
|
@ -36,7 +55,7 @@ |
|
|
|
@click="downloadHandle(scope.row.maCodeUrl)">下载</el-button> |
|
|
|
<el-button type="danger" |
|
|
|
size="mini" |
|
|
|
@click="downloadHandle(scope.row.maCodeUrl)">生成</el-button> |
|
|
|
@click="singleMaCodeHandle(scope.row.id)">生成</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -62,20 +81,22 @@ export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
mixinViewModuleOptions: { |
|
|
|
getDataListURL: '/custom/epidemicsentrypost/page', |
|
|
|
getDataListURL: '/custom/epidemicSentryPost/page', |
|
|
|
getDataListIsPage: true |
|
|
|
}, |
|
|
|
visible: false, |
|
|
|
dataForm: { |
|
|
|
id: '', |
|
|
|
gridId: '' |
|
|
|
gridId: '', |
|
|
|
sentryPostCode: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init () { |
|
|
|
this.visible = true |
|
|
|
this.getDataList() |
|
|
|
this.dataForm.sentryPostCode = '' |
|
|
|
this.getDataList(this.dataForm.gridId) |
|
|
|
}, |
|
|
|
// 新增 修改 |
|
|
|
addOrUpdateHandle () { |
|
|
|
@ -91,6 +112,25 @@ export default { |
|
|
|
}, |
|
|
|
// 批量生成功能 |
|
|
|
initDeptMaCodeHandle () { |
|
|
|
this.$http |
|
|
|
.post(`custom/epidemicSentryPost/createCodes`, { gridId: this.dataForm.gridId }) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
}, |
|
|
|
// 单独生成哨卡码 |
|
|
|
singleMaCodeHandle (id) { |
|
|
|
this.$http |
|
|
|
.post(`custom/epidemicSentryPost/createCode`, { postId: id }) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -98,3 +138,9 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.big_image { |
|
|
|
width: 300px; |
|
|
|
height: 300px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|