Commit 39794136 by liupeng

修改了列表页的上传附件

parent c9eaf4ba
......@@ -1482,6 +1482,7 @@ export default {
});
});
for (var fileItem in self.fileLists) {
debugger;
for (var i = 0; i < self.fileLists[fileItem].length; i++) {
if (self.fileLists[fileItem][i].raw) {
params.append(fileItem, self.fileLists[fileItem][i].raw);
......
......@@ -484,8 +484,7 @@
pageBs == 'gnsyrz' ||
pageBs == 'jdcxsGl' ||
pageBs == 'hmxsGl' ||
pageBs == 'ryxsGl' ||
pageBs == 'rwbd'
pageBs == 'ryxsGl'
)
"
>
......@@ -541,7 +540,7 @@
>签收</span
>
<span
v-if="pageBs == 'rwbdjs' && scope.row.rwztdm == '04'"
@click="addFeedBack(scope)"
class="edit"
style="margin-right: 16px"
......
......@@ -14,7 +14,7 @@ arr.forEach((item) => {
appToken = item.split("appToken")[1];
}
});
debugger
// debugger
axios.defaults.timeout = 0;
axios.defaults.headers = {
"X-Requested-With": "XMLHttpRequest",
......@@ -318,7 +318,7 @@ export function postdown(url, data) {
* @returns {Promise}
*/
export function postJson(url, data) {
debugger
// debugger
return new Promise((resolve, reject) => {
json.post(url, JSON.parse(data)).then(response => {
resolve(response);
......
......@@ -28,7 +28,7 @@
width="30%"
center
>
<el-form :inline="true" :model="feedbackInfo" class="demo-form-inline">
<el-form :inline="true" :model="feedbackInfo" class="demo-form-inline" label-width="100px">
<el-row>
<el-col :span="20" :offset="4" style="margin-top: 20px">
<el-form-item label="反馈结果概要" style="width:100%;">
......@@ -62,11 +62,12 @@
}
"
multiple
:limit="3"
:limit="4"
:httpRequest="httpRequest"
:on-exceed="handleExceed"
:file-list="feedbackInfo.files"
:auto-upload="false"
v-model="feedbackInfo.files"
v-model="file"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
......@@ -75,36 +76,7 @@
上传文件不能超过100M
</div>
</el-upload>
<!-- <el-upload
class="upload-demo"
action="#"
:on-change="
(flie, fileList) => {
handleChange(flie, fileList, item);
}
"
:on-remove="
(flie, fileList) => {
handleRemove(flie, fileList, item);
}
"
:before-remove="
(flie, fileList) => {
handleBeforeRemove(flie, fileList, item);
}
"
:on-preview="
(flie, fileList) => {
handlerPreview(flie, fileList, item);
}
"
:auto-upload="false"
:http-request="httpRequest"
:file-list="fileLists[item.fileId || item.id]"
v-model="formLabelAlign[item.id]"
>
<el-button size="small" type="primary">选择上传</el-button>
</el-upload> -->
</el-form-item>
</el-col>
</el-row>
......@@ -156,7 +128,7 @@ export default {
id: "rwlxdm",
type: "codeTree",
codeTree: "CODE_XSJSBD_RWLXDM",
props: [],
props: "",
codeOptions: [],
value: "",
placeholder: "",
......@@ -186,7 +158,7 @@ export default {
id: "ajlbdm",
type: "codeTree",
codeTree: "CODE_AJLB",
props: [],
codeOptions: [],
value: "",
placeholder: "",
......@@ -268,12 +240,13 @@ export default {
fkjgJyqk: "",
files: [],
},
file: "",
};
},
created() {},
methods: {
add() {
this.$router.push('addRwbd')
this.$router.push("addRwbd");
},
signFor(data) {
let params = new FormData();
......@@ -283,8 +256,7 @@ export default {
this.$alert("签收成功!", "提示", {
confirmButtonText: "确定",
type: "success",
callback: () => {
},
callback: () => {},
});
} else {
this.$message.error("签收失败");
......@@ -296,31 +268,34 @@ export default {
this.dialogVisible = true;
this.feedbackInfo.bdrwbh = data;
console.log(this.feedbackInfo.bdrwbh);
},
httpRequest() {},
submitFeedback() {
console.log(this.feedbackInfo, this.file);
let params = new FormData();
console.log(this.feedbackInfo.files);
params.append('bdrwbh', this.feedbackInfo.bdrwbh);
params.append('fkjgJyqk', this.feedbackInfo.fkjgJyqk);
params.append('files', this.feedbackInfo.files);
params.append("bdrwbh", this.feedbackInfo.bdrwbh);
params.append("fkjgJyqk", this.feedbackInfo.fkjgJyqk);
for(let i = 0 ; i < this.feedbackInfo.files.length ; i++){
params.append("files", this.feedbackInfo.files[i].raw);
}
insertFkxx(params).then((res) => {
if (res.success && res.code == 200) {
this.$alert("新增反馈信息成功!", "提示", {
confirmButtonText: "确定",
type: "success",
callback: () => {
},
callback: () => {},
});
} else {
this.$message.error("新增反馈信息失败");
}
});
this.dialogVisible = false
},
//upload组件相关方法
handleChange(file, fileList) {
console.log(file, fileList);
this.feedbackInfo.files = fileList
this.feedbackInfo.files = fileList;
// var self = this;
// let isLt1M = "";
// isLt1M = file.raw.size / 1024 / 1024 < 101;
......@@ -374,18 +349,17 @@ export default {
},
handleRemove(file, fileList) {
fileList.forEach((item, index) => {
if (file.uid == item.uid) {
fileList.splice(index, 1);
}
});
if (file.uid == item.uid) {
fileList.splice(index, 1);
}
});
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${this.feedbackInfo.files.length} 个文件`
`当前限制选择 4 个文件,本次选择了 ${files.length} 个文件,共选择了 ${this.feedbackInfo.files.length} 个文件`
);
},
beforeRemove(file, fileList) {
......@@ -393,8 +367,11 @@ export default {
},
toInfor(data) {
console.log(123);
this.$router.push({path:'/detailRwbd',query:{ 'xxzjbh': data.xxzjbh }})
this.$router.push({
path: "/detailRwbd",
query: { xxzjbh: data.xxzjbh },
});
},
},
};
......
......@@ -27,7 +27,7 @@
width="30%"
center
>
<el-form :inline="true" :model="feedbackInfo" class="demo-form-inline">
<el-form :inline="true" :model="feedbackInfo" class="demo-form-inline" label-width="100px">
<el-row>
<el-col :span="20" :offset="4" style="margin-top: 20px">
<el-form-item label="反馈结果概要" style="width:100%;">
......@@ -62,10 +62,11 @@
"
multiple
:limit="3"
:httpRequest="httpRequest"
:on-exceed="handleExceed"
:file-list="feedbackInfo.files"
:auto-upload="false"
v-model="feedbackInfo.files"
v-model="file"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
......@@ -74,36 +75,7 @@
上传文件不能超过100M
</div>
</el-upload>
<!-- <el-upload
class="upload-demo"
action="#"
:on-change="
(flie, fileList) => {
handleChange(flie, fileList, item);
}
"
:on-remove="
(flie, fileList) => {
handleRemove(flie, fileList, item);
}
"
:before-remove="
(flie, fileList) => {
handleBeforeRemove(flie, fileList, item);
}
"
:on-preview="
(flie, fileList) => {
handlerPreview(flie, fileList, item);
}
"
:auto-upload="false"
:http-request="httpRequest"
:file-list="fileLists[item.fileId || item.id]"
v-model="formLabelAlign[item.id]"
>
<el-button size="small" type="primary">选择上传</el-button>
</el-upload> -->
</el-form-item>
</el-col>
</el-row>
......@@ -155,7 +127,7 @@ export default {
id: "rwlxdm",
type: "codeTree",
codeTree: "CODE_XSJSBD_RWLXDM",
props: [],
props: "",
codeOptions: [],
value: "",
placeholder: "",
......@@ -185,7 +157,6 @@ export default {
id: "ajlbdm",
type: "codeTree",
codeTree: "CODE_AJLB",
props: [],
codeOptions: [],
value: "",
placeholder: "",
......@@ -267,6 +238,7 @@ export default {
fkjgJyqk: "",
files: [],
},
file: "",
};
},
created() {},
......@@ -297,8 +269,7 @@ export default {
this.$alert("签收成功!", "提示", {
confirmButtonText: "确定",
type: "success",
callback: () => {
},
callback: () => {},
});
} else {
this.$message.error("签收失败");
......@@ -310,31 +281,33 @@ export default {
this.dialogVisible = true;
this.feedbackInfo.bdrwbh = data;
console.log(this.feedbackInfo.bdrwbh);
},
httpRequest() {},
submitFeedback() {
let params = new FormData();
console.log(this.feedbackInfo.files);
params.append('bdrwbh', this.feedbackInfo.bdrwbh);
params.append('fkjgJyqk', this.feedbackInfo.fkjgJyqk);
params.append('files', this.feedbackInfo.files);
params.append("bdrwbh", this.feedbackInfo.bdrwbh);
params.append("fkjgJyqk", this.feedbackInfo.fkjgJyqk);
for(let i = 0 ; i < this.feedbackInfo.files.length ; i++){
params.append("files", this.feedbackInfo.files[i].raw);
}
insertFkxx(params).then((res) => {
if (res.success && res.code == 200) {
this.$alert("新增反馈信息成功!", "提示", {
confirmButtonText: "确定",
type: "success",
callback: () => {
},
callback: () => {},
});
} else {
this.$message.error("新增反馈信息失败");
}
});
this.dialogVisible = false
},
//upload组件相关方法
handleChange(file, fileList) {
console.log(file, fileList);
this.feedbackInfo.files = fileList
this.feedbackInfo.files = fileList;
// var self = this;
// let isLt1M = "";
// isLt1M = file.raw.size / 1024 / 1024 < 101;
......@@ -395,11 +368,10 @@ export default {
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${this.feedbackInfo.files.length} 个文件`
`当前限制选择 4 个文件,本次选择了 ${files.length} 个文件,共选择了 ${this.feedbackInfo.files.length} 个文件`
);
},
beforeRemove(file, fileList) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment