|
@@ -40,6 +40,7 @@
|
|
|
:auto-upload="false"
|
|
|
ref="upload"
|
|
|
class="upload-css"
|
|
|
+ v-if="btnShow"
|
|
|
>
|
|
|
<el-button type="primary" :disabled="canUp">点击上传</el-button>
|
|
|
<div slot="tip" class="el-upload__tip"><slot name="dec"></slot></div>
|
|
@@ -87,10 +88,10 @@ export default {
|
|
|
default: 10
|
|
|
},
|
|
|
// 传递的id值
|
|
|
- fileId: {
|
|
|
- type: [Number, String],
|
|
|
- default: ""
|
|
|
- },
|
|
|
+ // fileId: {
|
|
|
+ // type: [Number, String],
|
|
|
+ // default: ""
|
|
|
+ // },
|
|
|
// 文件是否只读
|
|
|
readonly: {
|
|
|
type: Boolean,
|
|
@@ -103,7 +104,11 @@ export default {
|
|
|
fileId:{
|
|
|
type: Array,
|
|
|
default: []
|
|
|
- }
|
|
|
+ },
|
|
|
+ fileStas:{
|
|
|
+ type: String,
|
|
|
+ default: ""
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -114,6 +119,7 @@ export default {
|
|
|
srcList: [""],
|
|
|
type: "",
|
|
|
discountFiles: [], //上传附件数组
|
|
|
+ btnShow:true,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -156,9 +162,7 @@ export default {
|
|
|
const res = await uploadData(data, this);
|
|
|
if (res.success == true) {
|
|
|
let obj = {id:res.data.id,fileName:res.data.fileName}
|
|
|
- console.log(obj,"obj");
|
|
|
this.discountFiles.push(obj)
|
|
|
- console.log(this.discountFiles,"this.discountFiles");
|
|
|
this.$emit("getUpload", this.discountFiles,index);
|
|
|
// this.$emit("getUpload", res.data.id,this.index);
|
|
|
this.loading = false;
|
|
@@ -169,7 +173,6 @@ export default {
|
|
|
},
|
|
|
// 表单点击预览
|
|
|
check(item,index) {
|
|
|
- console.log(item,"121212");
|
|
|
this.pdfSrc = "";
|
|
|
this.srcList = false;
|
|
|
this.type = "";
|
|
@@ -185,9 +188,7 @@ export default {
|
|
|
const fileName = res.data.fileName.split(".").slice(-1);
|
|
|
if(fileName){
|
|
|
// if (res.data.fileSufx === "pdf") {
|
|
|
- // console.log(222)
|
|
|
const b = this.dataURLtoBlob(res.data.fileContent.slice(28));
|
|
|
- console.log(b,"bb")
|
|
|
if (this.openFileType === "dialog") {
|
|
|
this.dialogFile = true;
|
|
|
this.pdfSrc = b;
|
|
@@ -208,7 +209,6 @@ export default {
|
|
|
|
|
|
// 预览文件
|
|
|
dataURLtoBlob(e) {
|
|
|
- console.log(111)
|
|
|
let bstr = atob(e);
|
|
|
let n = bstr.length;
|
|
|
let u8arr = new Uint8Array(n);
|
|
@@ -221,16 +221,21 @@ export default {
|
|
|
},
|
|
|
|
|
|
deltabpdf(item,index) {
|
|
|
- console.log("要删除的文件编号是:" + index);
|
|
|
- console.log(item,"要删除的文件");
|
|
|
// this.discountFiles = this.discountFiles.splice(index, 1);
|
|
|
this.discountFiles = this.discountFiles.filter((currentValue, indedx, arr)=> indedx !== index);
|
|
|
// this.discountFiles = this.discountFiles.filter(obj => obj.id !== item.id);
|
|
|
- console.log(this.discountFiles);
|
|
|
this.$emit("getUpload", this.discountFiles,index);
|
|
|
},
|
|
|
- mouseEnterHandler(){
|
|
|
- console.log('鼠标悬浮在按钮上');
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ if(this.fileStas=="已录入发票"){
|
|
|
+ this.btnShow = false
|
|
|
+ }else if(this.fileStas=="未付款"){
|
|
|
+ this.btnShow = false
|
|
|
+ }else if(this.fileStas=="已付款"){
|
|
|
+ this.btnShow = false
|
|
|
+ }else{
|
|
|
+ this.btnShow = true
|
|
|
}
|
|
|
}
|
|
|
};
|