项目管理(差左下角)
This commit is contained in:
171
src/views/chartList/page2/three/center2.vue
Normal file
171
src/views/chartList/page2/three/center2.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<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="stationName" />
|
||||
<el-table-column label="升温工位数" align="center" prop="riseNumber" />
|
||||
<el-table-column label="降温工位数" align="center" prop="coolingNumber" />
|
||||
<el-table-column label="保温工位数" align="center" prop="warmNumber" />
|
||||
<el-table-column label="空闲工位数" align="center" prop="freeNumber" />
|
||||
</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>仅允许导入xls、xlsx格式文件。</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 { centerTwoList, centerTwoImportTemplate } 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/modelStation/importData',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
centerTwoList(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() {
|
||||
centerTwoImportTemplate().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>
|
@ -1,3 +1,50 @@
|
||||
<template>
|
||||
<div>page2 three</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 />
|
||||
</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'
|
||||
export default {
|
||||
components: {
|
||||
left1,
|
||||
left2,
|
||||
// left3,
|
||||
// center1,
|
||||
center2,
|
||||
right1,
|
||||
right2,
|
||||
},
|
||||
}
|
||||
</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>
|
||||
|
105
src/views/chartList/page2/three/indexApi.js
Normal file
105
src/views/chartList/page2/three/indexApi.js
Normal file
@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/** --------------- left1 --------------- */
|
||||
// 年度型号信息列表
|
||||
export function leftOneList(params) {
|
||||
return request({
|
||||
url: '/hx/modelYearPlan/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
// 导出模板
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/hx/modelYearPlan/importTemplate',
|
||||
})
|
||||
}
|
||||
/** --------------- left2 --------------- */
|
||||
// 生产计划列表
|
||||
export function leftTwoList(params) {
|
||||
return request({
|
||||
url: '/hx/productionPlan/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
// 导出模板
|
||||
export function leftTwoImportTemplate() {
|
||||
return request({
|
||||
url: '/hx/productionPlan/importTemplate',
|
||||
// url: '/hx/materialsAccessories/importTemplate', // left
|
||||
// url: '/hx/stockDetailed/importTemplate', // right
|
||||
})
|
||||
}
|
||||
/** --------------- left3 --------------- */
|
||||
//
|
||||
export function leftThreeList(params) {
|
||||
return request({
|
||||
url: '/hx/milepostAndBottleneck/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
//
|
||||
export function leftThreeImportTemplate() {
|
||||
return request({
|
||||
url: '/hx/milepostAndBottleneck/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/modelStation/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
// 导出模板
|
||||
export function centerTwoImportTemplate() {
|
||||
return request({
|
||||
url: '/hx/modelStation/importTemplate',
|
||||
})
|
||||
}
|
||||
/** --------------- right1 --------------- */
|
||||
// 单台产品信息获取
|
||||
export function rightOneList() {
|
||||
return request({
|
||||
url: '/hx/productPic/getInfo',
|
||||
})
|
||||
}
|
||||
// 单台产品信息更新
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/hx/productPic/updateInfo',
|
||||
method: 'put',
|
||||
data,
|
||||
})
|
||||
}
|
||||
/** --------------- right2 --------------- */
|
||||
// 库房信息列表
|
||||
export function rightTwoList(params) {
|
||||
return request({
|
||||
url: '/hx/storehouse/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
// 导出模板
|
||||
export function rightTwoImportTemplate() {
|
||||
return request({
|
||||
url: '/hx/storehouse/importTemplate',
|
||||
})
|
||||
}
|
172
src/views/chartList/page2/three/left1.vue
Normal file
172
src/views/chartList/page2/three/left1.vue
Normal 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="year" />
|
||||
<el-table-column label="产品型号" align="center" prop="productModel" />
|
||||
<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>
|
||||
|
||||
<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>仅允许导入xls、xlsx格式文件。</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/modelYearPlan/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>
|
175
src/views/chartList/page2/three/left2.vue
Normal file
175
src/views/chartList/page2/three/left2.vue
Normal 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="month" />
|
||||
<el-table-column label="产品型号" align="center" prop="productModel" />
|
||||
<el-table-column label="生产数量" align="center" prop="productionNumber" />
|
||||
<el-table-column label="绝热数量" align="center" prop="adiabat" />
|
||||
<el-table-column label="装药数量" align="center" prop="charge" />
|
||||
<el-table-column label="总装数量" align="center" prop="assembly" />
|
||||
<el-table-column label="交付数量" align="center" prop="deliver" />
|
||||
<el-table-column label="评审数量" align="center" prop="review" />
|
||||
<el-table-column label="结算数量" align="center" prop="settlement" />
|
||||
</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>仅允许导入xls、xlsx格式文件。</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/productionPlan/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>
|
35
src/views/chartList/page2/three/right1.vue
Normal file
35
src/views/chartList/page2/three/right1.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :xs="24">
|
||||
<el-button class="mb10" size="mini" :disabled="dataInfo.pic ? false : true" @click="handleUpdate">更新</el-button>
|
||||
<ImageUpload v-model="dataInfo.pic" :isShowTip="false" :limit="1" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<script>
|
||||
import { rightOneList, updateInfo } from './indexApi'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataInfo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
rightOneList().then(({ data }) => {
|
||||
this.dataInfo = data
|
||||
})
|
||||
},
|
||||
handleUpdate() {
|
||||
updateInfo(this.dataInfo).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
171
src/views/chartList/page2/three/right2.vue
Normal file
171
src/views/chartList/page2/three/right2.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<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="name" />
|
||||
<el-table-column label="库房类型" align="center" prop="category" />
|
||||
<el-table-column label="当前状态" align="center" prop="status" />
|
||||
<el-table-column label="产品信息" align="center" prop="productInfo" />
|
||||
</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>仅允许导入xls、xlsx格式文件。</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 { 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/storehouse/importData',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
rightTwoList(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() {
|
||||
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>
|
Reference in New Issue
Block a user