Merge branch 'dev-cq' of http://192.168.0.56:3000/bonus/devicesmgt into dev-cq
This commit is contained in:
commit
886a093818
|
|
@ -50,6 +50,7 @@
|
|||
icon="el-icon-bottom"
|
||||
size="mini"
|
||||
v-hasPermi="['machinery:parts:add']"
|
||||
@click="handleUploadExcel"
|
||||
>导入</el-button
|
||||
>
|
||||
<el-button
|
||||
|
|
@ -249,6 +250,45 @@
|
|||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="上传文件"
|
||||
:visible.sync="openUpload"
|
||||
width="400px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-upload
|
||||
ref="excelUpload"
|
||||
:http-request="(file) => excelUpload(file)"
|
||||
accept=".xlsx, .xls"
|
||||
:limit="1"
|
||||
:file-list="excelList"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
<div style="
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 20px 0;
|
||||
"
|
||||
>
|
||||
<span>支持格式:excel表格,单个文件不能超过20MB</span>
|
||||
<span>注意:需要根据模版导入本年配件框架内容,重复上传会覆盖本年框架内容。</span>
|
||||
</div>
|
||||
<div style="
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
align-items: center;
|
||||
margin-top: 20px
|
||||
">
|
||||
<el-button type="primary" style="margin-right: 15px;">确定</el-button>
|
||||
<el-button>取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -261,6 +301,7 @@ import {
|
|||
updatePartTypeById,
|
||||
delPartType,
|
||||
} from '@/api/store/tools'
|
||||
import { fileUpLoad } from '@/api/system/upload'
|
||||
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
|
@ -283,6 +324,7 @@ export default {
|
|||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
openUpload: false,
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 重新渲染表格状态
|
||||
|
|
@ -333,12 +375,30 @@ export default {
|
|||
],
|
||||
},
|
||||
isEdit: false,
|
||||
// excel文件列表
|
||||
excelList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 上传excel文件 */
|
||||
uploadExcel(file) {
|
||||
console.log(file)
|
||||
},
|
||||
/** 上传excel文件前 */
|
||||
beforeExcelUpload(file) {
|
||||
console.log(file)
|
||||
},
|
||||
/** 上传excel文件成功 */
|
||||
excelSuccess() {
|
||||
console.log('上传成功')
|
||||
},
|
||||
/** 上传excel文件失败 */
|
||||
excelError() {
|
||||
console.log('上传失败')
|
||||
},
|
||||
/** 查询部门列表 */
|
||||
getList() {
|
||||
console.log(this.queryParams)
|
||||
|
|
@ -400,6 +460,11 @@ export default {
|
|||
this.isEdit = false
|
||||
this.initApiGetPartTree()
|
||||
},
|
||||
/** 导入excel按钮操作 */
|
||||
handleUploadExcel() {
|
||||
this.reset()
|
||||
this.openUpload = true
|
||||
},
|
||||
/** 展开/折叠操作 */
|
||||
toggleExpandAll() {
|
||||
this.refreshTable = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue