|
|
@@ -44,8 +44,14 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
|
|
|
+ <template slot="attachment" slot-scope="{ row }">
|
|
|
+ <div v-for="(file, index) of row.attachment" :key="index">
|
|
|
+ <el-link @click="handleDownFile(file)">{{ file.label }}</el-link>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot="xmIdForm">
|
|
|
- <project-select placeholder="请选择项目名称" v-model="form.xmId"></project-select>
|
|
|
+ <project-select ref="proSelect" placeholder="请选择项目名称" v-model="form.xmId"></project-select>
|
|
|
</template>
|
|
|
|
|
|
</avue-crud>
|
|
|
@@ -113,6 +119,14 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
getFormData() {
|
|
|
let newFormData = { ...this.form };
|
|
|
+ if (!!newFormData.xmId) {
|
|
|
+ let projectList = this.$refs.proSelect.projectList;
|
|
|
+ let selPro = projectList.find(item => item.id === newFormData.xmId );
|
|
|
+ if (!!selPro) {
|
|
|
+ newFormData.xmmc = selPro.xmmc;
|
|
|
+ newFormData.xmbh = selPro.xmbh;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!!newFormData.attachment) {
|
|
|
newFormData.attachment = JSON.stringify(newFormData.attachment);
|
|
|
}
|
|
|
@@ -142,9 +156,22 @@ export default window.$crudCommon({
|
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
|
})
|
|
|
},
|
|
|
+ handleDownFile(file) {
|
|
|
+ window.open(file.value, "_blank");
|
|
|
+ }
|
|
|
},
|
|
|
}, {
|
|
|
// 模块路径
|
|
|
- name: 'achievement/otherAchivement'
|
|
|
+ name: 'achievement/otherAchivement',
|
|
|
+ res: ({ data }) => {
|
|
|
+ data.records = data.records.map(item => {
|
|
|
+ if (!!item.attachment) {
|
|
|
+ item.attachment = JSON.parse(item.attachment);
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ })
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|