Browse Source

导入

master
曲树通 6 years ago
parent
commit
558694e45c
  1. 38
      src/views/modules/sys/deptmacode.vue

38
src/views/modules/sys/deptmacode.vue

@ -43,6 +43,18 @@
type="primary"
@click="createGridLeaderMaCodeHandle()">生成网格长注册码</el-button>
</el-form-item>
<el-form-item>
<el-upload class="upload-demo"
ref="upload"
:action="uploadUrl"
:on-preview="handlePreview"
multiple
:limit="1"
:on-success='uploadSuccess'
:on-error='errorExceed'>
<el-button type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading"
:data="dataList"
@ -122,10 +134,9 @@
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<epidemicSentryPost
v-if="epidemicSentryPostVisible"
ref="epidemicSentryPost"
@refreshDataList="getDataList"></epidemicSentryPost>
<epidemicSentryPost v-if="epidemicSentryPostVisible"
ref="epidemicSentryPost"
@refreshDataList="getDataList"></epidemicSentryPost>
</div>
</el-card>
</template>
@ -133,6 +144,7 @@
<script>
import mixinViewModule from '@/mixins/view-module'
import epidemicSentryPost from '../custom/epidemicsentrypost'
import Cookies from 'js-cookie'
export default {
mixins: [mixinViewModule],
data () {
@ -150,6 +162,7 @@ export default {
leaderFlag: '0'
},
epidemicSentryPostVisible: false,
upLoadUrl: '',
deptIdList: [],
options: [],
streetList: [],
@ -165,6 +178,7 @@ export default {
epidemicSentryPost
},
created () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/custom/epidemicsentrypost/importExcel?token=${Cookies.get('token')}`
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => {
@ -307,6 +321,22 @@ export default {
// this.$refs.epidemicSentryPostVisible.dataForm.id = id
this.$refs.epidemicSentryPost.init()
})
},
uploadSuccess (response, file, fileList) {
console.log(response)
console.log(11111111111)
this.$refs.upload.clearFiles()
console.log(response)
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
}
})
},
errorExceed (file, fileList) {
this.$message.error('上传失败请重试')
}
}
}

Loading…
Cancel
Save