刘翔宇-旅管家 2 years ago
parent 938fc5d2f2
commit 9995d26cdd

@ -2,8 +2,8 @@
ENV = 'development'
# base api
#VUE_APP_DOMIAN=http://192.168.60.99:9003/
VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/
VUE_APP_DOMIAN=http://192.168.60.99:9003/
#VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/
VUE_APP_BASE_API = ''
VUE_APP_UPLOAD=http://hdcontract.ali251.langye.net/api/admin/upload-file

@ -1,25 +1,24 @@
<template>
<div>
<Modal v-model="isShow" title="附件" footer-hide :width="64">
<Button v-if="role === 1 || role === 0" type="primary" shape="circle" icon="ios-add" @click="add"
>新增</Button
>
<Button v-if="role === 1 || role === 0" type="primary" shape="circle" icon="ios-add" @click="add"></Button>
<Table
style="margin-top: 10px"
:height="320"
:data="detail.attachment"
:columns="columns"
>
<Table style="margin-top: 10px" :height="320" :data="detail.attachment" :columns="columns">
</Table>
</Modal>
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
import { show, save, store } from "@/api/propertyPlan";
export default {
import {
getToken
} from "@/utils/auth";
import {
show,
save,
store
} from "@/api/propertyPlan";
export default {
props: {
role: Number
},
@ -34,16 +33,19 @@ export default {
type: "",
detail: {},
columns: [
{
columns: [{
key: "file",
title: "文件(点击下载)",
width: 200,
render: (h, { row }) => {
render: (h, {
row
}) => {
return h(
"a",
{
attrs: { download: row.file.original_name, href: row.file.url },
"a", {
attrs: {
download: row.file.original_name,
href: row.file.url
},
},
row.file.original_name
);
@ -65,7 +67,9 @@ export default {
title: "操作",
width: 100,
align: "left",
render: (h, { row }) => {
render: (h, {
row
}) => {
if (this.role == 0 || this.role == 1)
return h("Poptip", {
props: {
@ -76,8 +80,7 @@ export default {
scopedSlots: {
default: () => {
return h(
"Button",
{
"Button", {
props: {
ghost: true,
size: "small",
@ -174,7 +177,9 @@ export default {
},
async getDetail() {
const res = await show({ id: this.getId() });
const res = await show({
id: this.getId()
});
this.detail = res;
console.log(res);
},
@ -185,20 +190,29 @@ export default {
file: "",
content: "",
};
this.fileList = [];
const h = this.$createElement;
this.$msgbox({
title: "新增附件",
message: h(
"el-form",
{ key: ++this.key, props: { model: form, "label-width": "80px" } },
"el-form", {
key: ++this.key,
props: {
model: form,
"label-width": "80px"
}
},
[
h("el-form-item", {
props: { label: "文件", required: true },
props: {
label: "文件",
required: true
},
scopedSlots: {
default: () =>
h(
"el-upload",
{
"el-upload", {
props: {
action: this.action,
"file-list": this.fileList,
@ -206,8 +220,7 @@ export default {
headers: {
Authorization: "Bearer " + getToken(),
},
accept:
".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.xls,.xlsx",
accept: ".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.xls,.xlsx",
"on-success": (response, file, fileList) => {
this.fileList = fileList;
form.file = response?.id;
@ -228,8 +241,7 @@ export default {
},
[
h(
"el-button",
{
"el-button", {
props: {
type: "primary",
size: "small",
@ -239,8 +251,7 @@ export default {
"选取文件"
),
h(
"div",
{
"div", {
class: "el-upload__tip",
slot: "tip",
},
@ -251,13 +262,17 @@ export default {
},
}),
h("el-form-item", {
props: { label: "内容" },
props: {
label: "内容"
},
scopedSlots: {
default: () =>
h("textarea", {
key: this.key,
class: "el-textarea__inner",
props: { value: form.content },
props: {
value: form.content
},
on: {
["input"]: (e) => {
form.content = e.target.value;
@ -284,7 +299,11 @@ export default {
instance.confirmButtonText = "保存中...";
this.detail.attachment_list = [
...this.detail.attachment?.map((i) => {
return { file: i.file.id, content: i.content, date: i.date };
return {
file: i.file.id,
content: i.content,
date: i.date
};
}),
form,
];
@ -315,16 +334,15 @@ export default {
this.getDetail();
} else {
this.id = "";
this.fileList = [];
}
},
},
created() {},
};
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
::v-deep .el-input__inner {
text-align: left;
}
}
</style>

Loading…
Cancel
Save