<template>
|
|
<el-dialog title="标签退回" :visible.sync="dialogFormVisible" width="380px">
|
|
<el-tabs tab-position="left" style="height: 140px;">
|
<el-tab-pane label="部分退回">
|
<el-form :model="form">
|
<div style="margin: 0 20px 20px 40px">
|
<el-button type="text" @click="viewHandle">下载excel模板</el-button>
|
</div>
|
<div style="margin: 20px 20px 20px 40px">
|
<el-upload
|
class="upload"
|
:action="actionUrlPrefixx+'/contract/'+this.ordercode+'/returnTag'"
|
:headers="headers"
|
:on-preview="handlePreview"
|
:on-remove="handleRemove"
|
:before-remove="beforeRemove"
|
:limit="1"
|
:on-exceed="handleExceed"
|
:on-success="handleSuccess"
|
:on-error="handleError"
|
:show-file-list="false"
|
:file-list="fileList">
|
<el-button size="small" type="primary">点击上传</el-button>
|
</el-upload>
|
</div>
|
|
</el-form>
|
</el-tab-pane>
|
<el-tab-pane label="全部退回">
|
<div style="margin: 20px 20px 20px 40px">
|
<el-button type="warning" plain @click="returnAllTagHandler">全部退回</el-button>
|
</div>
|
</el-tab-pane>
|
</el-tabs>
|
|
|
|
</el-dialog>
|
</template>
|
|
<script>
|
const exampleFile = require('@/assets/example/returntag.xlsx')
|
import { getToken } from '@/utils/auth'
|
export default {
|
name: 'index',
|
data() {
|
return {
|
headers:{ 'Authorization':getToken()},
|
dialogFormVisible: false,
|
actionUrlPrefixx:process.env.BASE_API,
|
form: {
|
name: '',
|
region: '',
|
date1: '',
|
date2: '',
|
delivery: false,
|
type: [],
|
resource: '',
|
desc: ''
|
},
|
formLabelWidth: '120px',
|
fileList:[],
|
ordercode:''
|
};
|
},
|
methods:{
|
showDialog(ordercode){
|
this.dialogFormVisible = true
|
this.ordercode = ordercode
|
},
|
viewHandle(){
|
window.open(exampleFile, '_blank')
|
},
|
handleRemove(file, fileList) {
|
if (file && file.status==="success") {
|
this.dataForm.productList = []
|
return this.$confirm(`已清空产品信息`);
|
}
|
},
|
handleExceed(files, fileList) {
|
this.$message.warning(`当前限制选择 1个文件,本次选择了 ${files.length} 个文件`);
|
},
|
beforeRemove(file, fileList) {
|
if (file && file.status==="success") {
|
//移除方法
|
return this.$confirm(`确定移除 ${ file.name },并清空产品信息吗?`);
|
}
|
},
|
handleSuccess(response, file, fileList) {
|
if (response.code === '200') {
|
this.$notify({
|
title: '成功',
|
duration: 2000,
|
message: '标签退回成功',
|
type: 'success'
|
})
|
this.fileList = []
|
this.dialogFormVisible=false
|
this.$emit("getinfo")
|
}else{
|
this.$message.warning(response.message);
|
this.fileList = []
|
}
|
|
},
|
handleError(response, file, fileList) {
|
this.fileList = []
|
},
|
handlePreview(file) {
|
},
|
returnAllTagHandler(){
|
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|