看板时间调整,抛光一次合格批量删除优化,导入文件创建(未完成)

This commit is contained in:
2024-08-27 09:15:34 +08:00
parent f575ebc12a
commit 3d3cfe1408
5 changed files with 143 additions and 1 deletions

View File

@@ -0,0 +1,128 @@
<template>
<div>
<el-button type="success" icon="el-icon-upload" v-hasPermi="['business:wmblankinventory:edit']" size="mini" @click="handleImport"
>导入</el-button
>
<el-dialog v-loading="upload.isUploading" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
name="file"
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 text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" @click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getToken } from '@/utils/auth'
export default {
props: {
url: {
type: String,
default: '/',
},
title: {
type: String,
default: '导入',
},
templateUrl: {
type: String,
default: '/',
},
templateTitle: {
type: String,
default: '导入模板',
},
},
data() {
return {
upload: {
// 用户导入参数
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: '',
// 是否加载中,禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: '',
templateTitle: '导入模板',
templateUrl: '',
},
}
},
methods: {
// 打开页面
handleImport() {
this.upload.open = true
this.upload.title = this.title
this.upload.templateTitle = this.templateTitle
this.upload.templateUrl = this.templateUrl
this.upload.url = process.env.VUE_APP_BASE_API + this.url
},
openDialog() {
this.upload.open = true
},
closeDialog() {
this.upload.open = false
},
//清空数据
clear() {},
// 刷新外部数据
refresh() {
this.$emit('refresh')
},
//提交上传文件
submit() {
this.$refs.upload.submit()
},
//todo 下载模板
importTemplate() {
// @/utils/ruoyi"
this.download(this.templateUrl, this.templateTitle)
},
//文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
//文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.isUploading = false
this.$refs.upload.clearFiles()
if (response.code == 200) {
this.$alert(response.data, '导入结果', { dangerouslyUseHTMLString: true })
} else {
this.$alert(response.msg, '导入结果', {
dangerouslyUseHTMLString: true,
type: 'error',
})
}
this.$emit('uploadSuccess')
this.refresh()
},
},
}
</script>
<style></style>

View File

@@ -289,7 +289,7 @@ export default {
timer1: null,
queryParams: {
partnumber: '',
startTime: this.$dayjs('2024-7-26').toDate(),
startTime: this.$dayjs('2024-8-26').toDate(),
endTime: null,
},
boardData: {

View File

@@ -81,6 +81,9 @@
>清单列表同步</el-button
>
</el-col>
<el-col :span="1.5">
<ImportExcel :url="''" :title="'毛坯信息导入'" :templateUrl="''" :templateTitle="'毛坯信息导入模板'" @refresh="getList" @uploadSuccess="getList"></ImportExcel>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" icon="el-icon-refresh" v-hasPermi="['business:wmblankinventory:edit']" size="mini" @click="handleBlankInventoryRenew">毛坯库存更新</el-button>
</el-col> -->
@@ -246,9 +249,11 @@ import {
} from '@/api/wmsManagement/wmBlankInventory.js'
import TheWmBlankRecord from './components/TheWmBlankRecord/TheWmBlankRecord.vue'
import TheWmBlankInventoryRenew from './components/TheWmBlankInventoryRenew/TheWmBlankInventoryRenew.vue'
import ImportExcel from '@/components/ImportExcel/index.vue'
export default {
name: 'wmBlankInventory',
components: {
ImportExcel,
TheWmBlankRecord,
TheWmBlankInventoryRenew,
},
@@ -509,6 +514,9 @@ export default {
}
})
},
handleImport(){
}
},
}
</script>

View File

@@ -49,6 +49,9 @@
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-minus" size="mini" @click="handleOneTimeRetrieval()">零件出库</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
</el-col>
<right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 仓库零件数 -->

View File

@@ -49,6 +49,9 @@
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-minus" size="mini" @click="handlePolishRetrieval()">抛光零件出库</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
</el-col>
<right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<div style="display: flex; align-items: center; justify-content: center; margin-bottom: 10px">