作业动态(缺:作业人员)

This commit is contained in:
熊丽君
2021-12-22 17:36:29 +08:00
parent d1e3c698fa
commit 4e6d4663c4
7 changed files with 1039 additions and 1 deletions

View File

@ -1,3 +1,53 @@
<template>
<div>page2 one</div>
<div class="app-container">
<el-divider content-position="left"><span class="text-bold-18">全厂资源动态</span></el-divider>
<left1 />
<el-divider content-position="left"><span class="text-bold-18">车辆管理</span></el-divider>
<left2 />
<el-divider content-position="left"><span class="text-bold-18">本周计划</span></el-divider>
<left3 />
<!-- <el-divider content-position="left"><span class="text-bold-18">全年目标</span></el-divider>
<center1 />
<el-divider content-position="left"><span class="text-bold-18">今日动态</span></el-divider>
<center2 />
<el-divider content-position="left"><span class="text-bold-18">生产责任令完成概况</span></el-divider>
<right1 /> -->
<el-divider content-position="left"><span class="text-bold-18">装药当前作业内容</span></el-divider>
<right2 />
<el-divider content-position="left"><span class="text-bold-18">酯生产量</span></el-divider>
<right3 />
</div>
</template>
<script>
import left1 from './left1.vue'
import left2 from './left2.vue'
import left3 from './left3.vue'
// import center1 from './center1.vue'
// import center2 from './center2.vue'
// import right1 from './right1.vue'
import right2 from './right2.vue'
import right3 from './right3.vue'
export default {
components: {
left1,
left2,
left3,
// center1,
// center2,
// right1,
right2,
right3,
},
}
</script>
<style lang="scss" scoped>
.app-container {
.el-divider:nth-child(n + 2) {
margin-top: 50px;
}
}
.text-bold-18 {
font-size: 18px;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,116 @@
import request from '@/utils/request'
/** --------------- left1 --------------- */
// 全厂资源动态列表
export function leftOneList(params) {
return request({
url: '/hx/factoryResources/list',
params,
})
}
// 导出模板
export function importTemplate() {
return request({
url: '/hx/factoryResources/importTemplate',
})
}
/** --------------- left2 --------------- */
// 车辆使用列表
export function leftTwoList(params) {
return request({
url: '/hx/carUse/list',
params,
})
}
// 导出模板
export function leftTwoImportTemplate() {
return request({
url: '/hx/carUse/importTemplate',
})
}
/** --------------- left3 --------------- */
// 本周计划列表
export function leftThreeList(params) {
return request({
url: '/hx/weekPlan/list',
params,
})
}
// 导出模板
export function leftThreeImportTemplate() {
return request({
url: '/hx/weekPlan/importTemplate',
})
}
// /** --------------- center1 --------------- */
// // 全年目标和大图列表
// export function centerOneList(params) {
// return request({
// url: '/hx/annualTarget/list',
// params,
// })
// }
// // 修改全年目标和大图
// export function updateAnnualTarget(data) {
// return request({
// url: '/hx/annualTarget',
// method: 'put',
// data,
// })
// }
// /** --------------- center2 --------------- */
// // 今日动态列表
// export function centerTwoList(params) {
// return request({
// url: '/hx/todayDynamic/list',
// params,
// })
// }
// // 导出模板
// export function centerTwoImportTemplate() {
// return request({
// url: '/hx/todayDynamic/importTemplate',
// })
// }
// /** --------------- right1 --------------- */
// // 生产责任令
// export function rightOneList(params) {
// return request({
// url: '/hx/productionResponsibility/list',
// params,
// })
// }
// // 导出模板
// export function rightOneImportTemplate() {
// return request({
// url: '/hx/productionResponsibility/importTemplate',
// })
// }
/** --------------- right2 --------------- */
// 装药当前内容表列表
export function rightTwoList(params) {
return request({
url: '/hx/chargeJobContent/list',
params,
})
}
// 导出模板
export function rightTwoImportTemplate() {
return request({
url: '/hx/chargeJobContent/importTemplate',
})
}
/** --------------- right3 --------------- */
// 酯作业内容列表
export function rightThreeList(params) {
return request({
url: '/hx/esterProduction/list',
params,
})
}
// 导出模板
export function rightThreeImportTemplate() {
return request({
url: '/hx/esterProduction/importTemplate',
})
}

View File

@ -0,0 +1,175 @@
<template>
<el-row :gutter="20">
<!--用户数据-->
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8 fr">
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="importTemplate"
>导出模板</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="userList">
<el-table-column label="序号" align="center" prop="id" width="80" />
<el-table-column label="日期" align="center" prop="todayDate" />
<el-table-column label="工房总数" align="center" prop="workshopTotal" />
<el-table-column label="作业工房数" align="center" prop="workingWorkshopTotal" />
<el-table-column label="实际出勤人数" align="center" prop="realAttendance" />
<el-table-column label="应出勤总数" align="center" prop="attendanceTotal" />
<el-table-column label="设备运行数" align="center" prop="equipmentRunTotal" />
<el-table-column label="设备总数" align="center" prop="equipmentTotal" />
<el-table-column label="视频正常采集率" align="center" prop="videoCollectionRate" />
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:autoScroll="false"
:pageSizes="[2, 5, 10, 20]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
<!-- <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<!-- <el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
> -->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { leftOneList, importTemplate } from './indexApi'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: this.page_size,
},
// 用户信息
userList: [],
// 总条数
total: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: '',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/hx/factoryResources/importData',
},
}
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true
leftOneList(this.queryParams).then(res => {
this.userList = res.rows
this.total = res.total
this.loading = false
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$modal
.confirm('是否确认导出所有用户数据项?')
.then(() => {
this.exportLoading = true
return exportUser(queryParams)
})
.then(response => {
this.$download.name(response.msg)
this.exportLoading = false
})
.catch(() => {})
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = '数据导入'
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then(response => {
this.$download.name(response.msg)
})
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
},
},
created() {
this.getList()
},
}
</script>

View File

@ -0,0 +1,172 @@
<template>
<el-row :gutter="20">
<!--用户数据-->
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8 fr">
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="importTemplate"
>导出模板</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="userList">
<el-table-column label="序号" align="center" prop="id" width="80" />
<el-table-column label="日期" align="center" prop="todayDate" />
<el-table-column label="汽车名称" align="center" prop="carName" />
<el-table-column label="作业内容" align="center" prop="workContent" />
<el-table-column label="当前位置" align="center" prop="nowAddress" />
<el-table-column label="车辆状态" align="center" prop="carStatus" />
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:autoScroll="false"
:pageSizes="[2, 5, 10, 20]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
<!-- <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<!-- <el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
> -->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { leftTwoList, leftTwoImportTemplate } from './indexApi'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: this.page_size,
},
// 用户信息
userList: [],
// 总条数
total: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: '',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/hx/carUse/importData',
},
}
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true
leftTwoList(this.queryParams).then(res => {
this.userList = res.rows
this.total = res.total
this.loading = false
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$modal
.confirm('是否确认导出所有用户数据项?')
.then(() => {
this.exportLoading = true
return exportUser(queryParams)
})
.then(response => {
this.$download.name(response.msg)
this.exportLoading = false
})
.catch(() => {})
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = '数据导入'
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
leftTwoImportTemplate().then(response => {
this.$download.name(response.msg)
})
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
},
},
created() {
this.getList()
},
}
</script>

View File

@ -0,0 +1,176 @@
<template>
<el-row :gutter="20">
<!--用户数据-->
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8 fr">
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="importTemplate"
>导出模板</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="userList">
<el-table-column label="序号" align="center" prop="id" width="80" />
<el-table-column label="周开始日期" align="center" prop="month" />
<el-table-column label="周结束日期" align="center" prop="serialNumber" />
<el-table-column label="实际探伤完成量" align="center" prop="realFlawDetection" />
<el-table-column label="探伤计划值" align="center" prop="targetFlawDetection" />
<el-table-column label="实际装药完成量" align="center" prop="realCharge" />
<el-table-column label="装药计划值" align="center" prop="targetCharge" />
<el-table-column label="实际交付量" align="center" prop="realDeliver" />
<el-table-column label="目标交付量" align="center" prop="targetDeliver" />
<el-table-column label="实际壳体入场量" align="center" prop="realHousing" />
<el-table-column label="目标壳体入场量" align="center" prop="targetHousing" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:autoScroll="false"
:pageSizes="[2, 5, 10, 20]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
<!-- <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<!-- <el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
> -->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { leftThreeList, leftThreeImportTemplate } from './indexApi'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: this.page_size,
},
// 用户信息
userList: [],
// 总条数
total: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: '',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/hx/weekPlan/importData',
},
}
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true
leftThreeList(this.queryParams).then(res => {
this.userList = res.rows
this.total = res.total
this.loading = false
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$modal
.confirm('是否确认导出所有用户数据项?')
.then(() => {
this.exportLoading = true
return exportUser(queryParams)
})
.then(response => {
this.$download.name(response.msg)
this.exportLoading = false
})
.catch(() => {})
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = '数据导入'
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
leftThreeImportTemplate().then(response => {
this.$download.name(response.msg)
})
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
},
},
created() {
this.getList()
},
}
</script>

View File

@ -0,0 +1,175 @@
<template>
<el-row :gutter="20">
<!--用户数据-->
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8 fr">
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="importTemplate"
>导出模板</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="userList">
<el-table-column label="序号" align="center" prop="id" width="80" />
<el-table-column label="编号" align="center" prop="numberNo" />
<el-table-column label="称量" align="center" prop="weighing" />
<el-table-column label="混合" align="center" prop="blend" />
<el-table-column label="浇筑" align="center" prop="pouring" />
<el-table-column label="总体推迟时间" align="center" prop="delayTime" />
<el-table-column label="倒班车" align="center" prop="reverseBus" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:autoScroll="false"
:pageSizes="[2, 5, 10, 20]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { rightTwoList, rightTwoImportTemplate } from './indexApi'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: this.page_size,
},
// 用户信息
userList: [],
// 总条数
total: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: '',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/hx/chargeJobContent/importData',
},
}
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true
rightTwoList(this.queryParams).then(res => {
this.userList = res.rows
this.total = res.total
this.loading = false
})
},
/** 删除按钮操作 */
// handleDelete(row) {
// this.$modal
// .confirm('是否确认删除编号为"' + row.id + '"的数据项?')
// .then(function () {
// return rightTwoDel({ id: row.id })
// })
// .then(() => {
// this.getList()
// this.$modal.msgSuccess('删除成功')
// })
// .catch(() => {})
// },
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$modal
.confirm('是否确认导出所有数据项?')
.then(() => {
this.exportLoading = true
return exportUser(queryParams)
})
.then(response => {
this.$download.name(response.msg)
this.exportLoading = false
})
.catch(() => {})
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = '数据导入'
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
rightTwoImportTemplate().then(response => {
this.$download.name(response.msg)
})
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
},
},
created() {
this.getList()
},
}
</script>

View File

@ -0,0 +1,174 @@
<template>
<el-row :gutter="20">
<!--用户数据-->
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8 fr">
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="importTemplate"
>导出模板</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="userList">
<el-table-column label="序号" align="center" prop="id" width="80" />
<el-table-column label="酯工作内容" align="center" prop="jobContent" />
<el-table-column label="开车时间" align="center" prop="driveDate" />
<el-table-column label="预计结束时间" align="center" prop="forecastEndDate" />
<el-table-column label="酯生产量" align="center" prop="esterProduction" />
<el-table-column label="粘合剂干燥情况" align="center" prop="cleanStatus" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:autoScroll="false"
:pageSizes="[2, 5, 10, 20]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { rightThreeList, rightThreeImportTemplate } from './indexApi'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: this.page_size,
},
// 用户信息
userList: [],
// 总条数
total: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: '',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/hx/esterProduction/importData',
},
}
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true
rightThreeList(this.queryParams).then(res => {
this.userList = res.rows
this.total = res.total
this.loading = false
})
},
/** 删除按钮操作 */
// handleDelete(row) {
// this.$modal
// .confirm('是否确认删除编号为"' + row.id + '"的数据项?')
// .then(function () {
// return rightTwoDel({ id: row.id })
// })
// .then(() => {
// this.getList()
// this.$modal.msgSuccess('删除成功')
// })
// .catch(() => {})
// },
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$modal
.confirm('是否确认导出所有数据项?')
.then(() => {
this.exportLoading = true
return exportUser(queryParams)
})
.then(response => {
this.$download.name(response.msg)
this.exportLoading = false
})
.catch(() => {})
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = '数据导入'
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
rightThreeImportTemplate().then(response => {
this.$download.name(response.msg)
})
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
},
},
created() {
this.getList()
},
}
</script>