|
@ -20,6 +20,10 @@ |
|
|
<a-button type="link">删除</a-button> |
|
|
<a-button type="link">删除</a-button> |
|
|
</a-popconfirm> |
|
|
</a-popconfirm> |
|
|
<a-button type="link" @click="handleDetail(record.id)">详情</a-button> |
|
|
<a-button type="link" @click="handleDetail(record.id)">详情</a-button> |
|
|
|
|
|
<a-button type="link" @click="downloadPhoto(record)" v-if="record.inspectionPhoto" |
|
|
|
|
|
>图片</a-button |
|
|
|
|
|
> |
|
|
|
|
|
<a-button type="link" @click="download(record)" v-if="record.attachment">下载</a-button> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</BasicTable> |
|
|
</BasicTable> |
|
@ -36,16 +40,14 @@ |
|
|
import reportModal from './reportModal.vue'; |
|
|
import reportModal from './reportModal.vue'; |
|
|
import { ref, computed, onMounted } from 'vue'; |
|
|
import { ref, computed, onMounted } from 'vue'; |
|
|
import detailDrawer from './detailDrawer.vue'; |
|
|
import detailDrawer from './detailDrawer.vue'; |
|
|
|
|
|
import { commonDownload } from '@/api/common/index'; |
|
|
|
|
|
import { downloadByData } from '@/utils/file/download'; |
|
|
defineOptions({ name: 'PatrolReport' }); |
|
|
defineOptions({ name: 'PatrolReport' }); |
|
|
const newFormSchemas: any = computed(() => { |
|
|
const newFormSchemas: any = computed(() => { |
|
|
formSchemas[0].componentProps.options = projectOptions.value; |
|
|
formSchemas[0].componentProps.options = projectOptions.value; |
|
|
return formSchemas; |
|
|
return formSchemas; |
|
|
}); |
|
|
}); |
|
|
const [registerTable, { reload }] = useTable({ |
|
|
const [registerTable, { reload }] = useTable({ |
|
|
rowSelection: { |
|
|
|
|
|
type: 'checkbox', |
|
|
|
|
|
}, |
|
|
|
|
|
title: '工作日报', |
|
|
title: '工作日报', |
|
|
api: list, |
|
|
api: list, |
|
|
showIndexColumn: true, |
|
|
showIndexColumn: true, |
|
@ -63,7 +65,7 @@ |
|
|
}, |
|
|
}, |
|
|
columns: columns, |
|
|
columns: columns, |
|
|
actionColumn: { |
|
|
actionColumn: { |
|
|
width: 200, |
|
|
width: 320, |
|
|
title: '操作', |
|
|
title: '操作', |
|
|
key: 'action', |
|
|
key: 'action', |
|
|
fixed: 'right', |
|
|
fixed: 'right', |
|
@ -99,10 +101,33 @@ |
|
|
const getOptions = () => { |
|
|
const getOptions = () => { |
|
|
getProjectOptions(); |
|
|
getProjectOptions(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
//下载 |
|
|
|
|
|
const download = async (record: any) => { |
|
|
|
|
|
const attachments = JSON.parse(record.attachment); |
|
|
|
|
|
if (attachments && attachments.length > 0) { |
|
|
|
|
|
attachments.forEach((i: any) => { |
|
|
|
|
|
commonDownload(i.url).then((res) => { |
|
|
|
|
|
const data = res; |
|
|
|
|
|
downloadByData(data, i.name); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
//下载 |
|
|
|
|
|
const downloadPhoto = async (record: any) => { |
|
|
|
|
|
const attachments = JSON.parse(record.inspectionPhoto); |
|
|
|
|
|
if (attachments && attachments.length > 0) { |
|
|
|
|
|
attachments.forEach((i: any) => { |
|
|
|
|
|
commonDownload(i.url).then((res) => { |
|
|
|
|
|
const data = res; |
|
|
|
|
|
downloadByData(data, i.name); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
getOptions() |
|
|
getOptions(); |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped></style> |
|
|
<style scoped></style> |
|
|