|
@@ -32,16 +32,6 @@
|
|
|
</van-cell-group>
|
|
|
|
|
|
<van-cell-group>
|
|
|
- <!-- <van-field
|
|
|
- v-model="siteInspection.place"
|
|
|
- center
|
|
|
- readonly
|
|
|
- label="地点:"
|
|
|
- placeholder="请填写地点"
|
|
|
- input-align="right"
|
|
|
- right-icon="arrow-down"
|
|
|
- @click="showArea = true"
|
|
|
- /> -->
|
|
|
<van-field
|
|
|
v-model="siteInspection.place"
|
|
|
center
|
|
@@ -98,7 +88,7 @@
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
|
|
|
- <van-cell-group>
|
|
|
+ <!-- <van-cell-group>
|
|
|
<van-field name="uploader" label="附件:">
|
|
|
<template #input>
|
|
|
<van-uploader>
|
|
@@ -106,7 +96,28 @@
|
|
|
</van-uploader>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
+ </van-cell-group> -->
|
|
|
+
|
|
|
+ <van-cell-group>
|
|
|
+ <van-field name="uploader" label="附件:">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :after-read="afterRead"
|
|
|
+ v-model="fileList"
|
|
|
+ :max-count="1"
|
|
|
+ capture="camera"
|
|
|
+ accept=""
|
|
|
+ >
|
|
|
+ <van-button icon="plus">上传文件</van-button>
|
|
|
+ <template #preview-cover="file">
|
|
|
+ <div class="preview-cover van-ellipsis">{{ file.name }}</div>
|
|
|
+ </template>
|
|
|
+ </van-uploader>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
</van-cell-group>
|
|
|
+
|
|
|
+
|
|
|
<van-cell-group>
|
|
|
<div class="rowTextArea">
|
|
|
<van-field
|
|
@@ -212,6 +223,21 @@ export default {
|
|
|
.join("/");
|
|
|
}
|
|
|
};
|
|
|
+ // 文件上传
|
|
|
+ let fileList = ref([]);
|
|
|
+ const afterRead = (file) => {
|
|
|
+ fileList.value = [];
|
|
|
+ // 此时可以自行将文件上传至服务器
|
|
|
+ new tools()
|
|
|
+ .uploadFile(file, `csjcqk/siteInspection`)
|
|
|
+ .then(({ data }) => {
|
|
|
+ // window.xm.showToast({
|
|
|
+ // message:data.url
|
|
|
+ // })
|
|
|
+ fileList.value.push("http://localhost:3000"+data.url);
|
|
|
+ //siteInspection.value.enclosure = data.url;
|
|
|
+ });
|
|
|
+ };
|
|
|
// 提交数据
|
|
|
const submit = () => {
|
|
|
//添加保存前判断
|
|
@@ -247,6 +273,9 @@ export default {
|
|
|
options,
|
|
|
onFinish,
|
|
|
cascaderValue,
|
|
|
+ // 文件上传
|
|
|
+ afterRead,
|
|
|
+ fileList,
|
|
|
submit,
|
|
|
};
|
|
|
},
|