|
@@ -13,6 +13,21 @@
|
|
|
:rules="rules"
|
|
|
ref="formDom1"
|
|
|
>
|
|
|
+ <template #file>
|
|
|
+ <div
|
|
|
+ v-if="formData.data.fileList && formData.data.fileList.length > 0"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in formData.data.fileList"
|
|
|
+ :key="index"
|
|
|
+ class="fileItem"
|
|
|
+ @click="handleOpenFile(item)"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>暂无附件</div>
|
|
|
+ </template>
|
|
|
</testForm>
|
|
|
</div>
|
|
|
<div class="common-process-card" v-show="active == 1">
|
|
@@ -69,6 +84,7 @@ const tabsChange = () => {
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
purchaseDetailList: [],
|
|
|
+ fileList: [],
|
|
|
},
|
|
|
});
|
|
|
const formDom1 = ref(null);
|
|
@@ -303,6 +319,11 @@ const formConfig = reactive([
|
|
|
itemType: "textarea",
|
|
|
readonly: true,
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ label: "附件",
|
|
|
+ slotName: "file",
|
|
|
+ },
|
|
|
]);
|
|
|
const formConfigOne = reactive([
|
|
|
{
|
|
@@ -435,6 +456,7 @@ onMounted(() => {
|
|
|
for (const key in jsonData) {
|
|
|
formData.data[key] = jsonData[key];
|
|
|
}
|
|
|
+
|
|
|
if (formData.data.supplyId && formData.data.supplyName) {
|
|
|
proxy
|
|
|
.post("/supplierInfo/page", {
|
|
@@ -472,18 +494,33 @@ onMounted(() => {
|
|
|
formDom2.value.formDataListShowLabelOne();
|
|
|
});
|
|
|
|
|
|
- // proxy.post("/fileInfo/getList", { businessIdList: [val] }).then((fileObj) => {
|
|
|
- // formData.data.fileList = fileObj[val] || [];
|
|
|
- // if (formData.data.fileList && formData.data.fileList.length > 0) {
|
|
|
- // fileList.value = formData.data.fileList.map((item) => {
|
|
|
- // return {
|
|
|
- // raw: item,
|
|
|
- // name: item.fileName,
|
|
|
- // url: item.fileUrl,
|
|
|
- // };
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
+ proxy.post("/fileInfo/getList", { businessIdList: [val] }).then((fileObj) => {
|
|
|
+ formData.data.fileList = fileObj.data[val] || [];
|
|
|
+ if (formData.data.fileList && formData.data.fileList.length > 0) {
|
|
|
+ formData.data.fileList = formData.data.fileList.map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
+
|
|
|
+const handleOpenFile = (item) => {
|
|
|
+ uni.postMessage({
|
|
|
+ data: {
|
|
|
+ url: item.url,
|
|
|
+ name: item.name,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.fileItem {
|
|
|
+ cursor: pointer;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+</style>
|