|
@@ -1173,10 +1173,40 @@
|
|
label="上传附件"
|
|
label="上传附件"
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <uploadFile
|
|
|
|
- @input="showFile"
|
|
|
|
- v-model="scope.row.attachUrl"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-upload
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ :action="uploadImgUrl"
|
|
|
|
+ :on-success="
|
|
|
|
+ (res, file) => {
|
|
|
|
+ handleSucces(scope, res, file);
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ :headers="headers"
|
|
|
|
+ style="width: 25%; float: left"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ :limit="1"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ >点击上传</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="checkFile(scope)"
|
|
|
|
+ >查看</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ @click="deleteFile(scope)"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -1242,6 +1272,7 @@ import { listCorps } from "@/api/basicdata/corps";
|
|
import { listFees } from "@/api/basicdata/fees";
|
|
import { listFees } from "@/api/basicdata/fees";
|
|
import UploadFile from "@/components/Uploadfile";
|
|
import UploadFile from "@/components/Uploadfile";
|
|
import Cookies from "js-cookie";
|
|
import Cookies from "js-cookie";
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
export default {
|
|
export default {
|
|
name: "plans",
|
|
name: "plans",
|
|
props: {
|
|
props: {
|
|
@@ -1353,6 +1384,10 @@ export default {
|
|
fWbuOptions: [],
|
|
fWbuOptions: [],
|
|
ffeeunitidList: [],
|
|
ffeeunitidList: [],
|
|
collapses2: [],
|
|
collapses2: [],
|
|
|
|
+ uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
|
|
|
+ headers: {
|
|
|
|
+ Authorization: "Bearer " + getToken(),
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -1423,6 +1458,35 @@ export default {
|
|
opdata: Date.parse(new Date()),
|
|
opdata: Date.parse(new Date()),
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //附件删除
|
|
|
|
+ deleteFile(scope){
|
|
|
|
+ this.relevantAttachments[scope.$index].attachName = ''
|
|
|
|
+ this.relevantAttachments[scope.$index].attachUrl = ''
|
|
|
|
+ if(this.relevantAttachments[scope.$index].attachUrl === ''){
|
|
|
|
+ this.$message.success("删除成功")
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error("未知错误,删除失败")
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //附件查看
|
|
|
|
+ checkFile(scope){
|
|
|
|
+
|
|
|
|
+ if(this.relevantAttachments[scope.$index].attachUrl){
|
|
|
|
+ window.open(this.relevantAttachments[scope.$index].attachUrl)
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error("请上传附件")
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //附件上传
|
|
|
|
+ handleSucces(scope, res, file) {
|
|
|
|
+ this.relevantAttachments[scope.$index].attachName = res.fileName;
|
|
|
|
+ this.relevantAttachments[scope.$index].attachUrl = res.url;
|
|
|
|
+ if (this.relevantAttachments[scope.$index].attachUrl === "") {
|
|
|
|
+ this.$message.error("上传失败");
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.success("上传成功");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 添加行
|
|
// 添加行
|
|
addRow(tableData, event) {
|
|
addRow(tableData, event) {
|
|
var obj = {};
|
|
var obj = {};
|