|
|
@ -38,6 +38,16 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="小程序码类别"> |
|
|
|
<el-select v-model="dataForm.leaderFlag" |
|
|
|
placeholder="小程序码类别"> |
|
|
|
<el-option v-for="item in maCodeCategorys" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|
|
|
</el-form-item> |
|
|
@ -46,7 +56,7 @@ |
|
|
|
@click="clearDataForm()">清空</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button v-if="$hasPermission('sys:deptmacode:delete')" |
|
|
|
<el-button v-if="$hasPermission('sys:deptmacode:delete') && dataForm.leaderFlag === '0'" |
|
|
|
type="danger" |
|
|
|
@click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|
|
|
</el-form-item> |
|
|
@ -55,6 +65,11 @@ |
|
|
|
type="primary" |
|
|
|
@click="initDeptMaCodeHandle()">初始化</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button v-if="$hasPermission('sys:deptmacode:leader')" |
|
|
|
type="primary" |
|
|
|
@click="createGridLeaderMaCodeHandle()">生成网格长注册码</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table v-loading="dataListLoading" |
|
|
|
:data="dataList" |
|
|
@ -77,16 +92,35 @@ |
|
|
|
label="网格" |
|
|
|
header-align="center" |
|
|
|
align="center"></el-table-column> |
|
|
|
<el-table-column prop="codeUrl" |
|
|
|
<!-- <el-table-column prop="codeUrl" |
|
|
|
label="小程序码" |
|
|
|
header-align="center" |
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<img v-if="scope.row.codeUrl" |
|
|
|
:src="scope.row.codeUrl" |
|
|
|
:preview-src-list="[scope.row.codeUrl]" |
|
|
|
min-width="70" |
|
|
|
height="70" /> |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column align="center" |
|
|
|
label="小程序码" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
prop="codeUrl"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-popover placement="right" |
|
|
|
title="" |
|
|
|
trigger="click"> |
|
|
|
<el-image slot="reference" |
|
|
|
min-width="70" |
|
|
|
height="70" |
|
|
|
v-if="scope.row.codeUrl" |
|
|
|
:src="scope.row.codeUrl" |
|
|
|
:alt="scope.row.codeUrl"></el-image> |
|
|
|
<el-image :src="scope.row.codeUrl"></el-image> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createdTime" |
|
|
|
label="创建时间" |
|
|
@ -98,10 +132,14 @@ |
|
|
|
align="center" |
|
|
|
width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="$hasPermission('sys:deptmacode:delete') && scope.row.codeUrl" |
|
|
|
<el-button v-if="$hasPermission('sys:deptmacode:delete') && scope.row.codeUrl && scope.row.leaderFlag === '0'" |
|
|
|
type="danger" |
|
|
|
size="mini" |
|
|
|
@click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|
|
|
<el-button v-if="scope.row.codeUrl" |
|
|
|
type="danger" |
|
|
|
size="mini" |
|
|
|
@click="downloadHandle(scope.row.codeUrl)">下载</el-button> |
|
|
|
<el-button v-if="$hasPermission('sys:deptmacode:create') && !scope.row.codeUrl" |
|
|
|
type="primary" |
|
|
|
size="mini" |
|
|
@ -136,11 +174,13 @@ export default { |
|
|
|
dataForm: { |
|
|
|
streetId: null, |
|
|
|
communityId: null, |
|
|
|
gridId: null |
|
|
|
gridId: null, |
|
|
|
leaderFlag: '0' |
|
|
|
}, |
|
|
|
streetList: [], |
|
|
|
communityList: [], |
|
|
|
gridList: [] |
|
|
|
gridList: [], |
|
|
|
maCodeCategorys: [{ id: '0', name: '群众注册码' }, { id: '1', name: '网格长注册码' }] |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
@ -170,6 +210,27 @@ export default { |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
createGridLeaderMaCodeHandle () { |
|
|
|
this.$confirm(this.$t('prompt.info', { 'handle': '生成网格长注册小程序码' }), this.$t('生成'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$http.post(`/sys/deptmacode/gridLeader`).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
initDeptMaCodeHandle () { |
|
|
|
this.$confirm('初始化所有网格的小程序码', this.$t('初始化'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
@ -229,6 +290,9 @@ export default { |
|
|
|
clearDataForm () { |
|
|
|
this.dataForm.streetId = this.dataForm.communityId = this.dataForm.gridId = null |
|
|
|
this.communityList = this.gridList = [] |
|
|
|
}, |
|
|
|
downloadHandle (codeUrl) { |
|
|
|
window.location.href = `${window.SITE_CONFIG['apiURL']}/oss/file/download?fileUrl=${codeUrl}` |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|