Commit 4fbb7ab7 by linjinhong

修改编辑

parent ef6bb62a
...@@ -9,7 +9,7 @@ interface Ikey { ...@@ -9,7 +9,7 @@ interface Ikey {
[key: string]: unknown [key: string]: unknown
} }
interface ILogisticsParams { interface ILogisticsParams {
logType: 'logistics_way' | 'logistics_address' logType: string
relaId: number | string relaId: number | string
} }
//获取日志 //获取日志
......
...@@ -539,7 +539,7 @@ async function showLog(row) { ...@@ -539,7 +539,7 @@ async function showLog(row) {
logDialogVisible.value = true logDialogVisible.value = true
try { try {
const { data } = await getLogisticsLog({ const { data } = await getLogisticsLog({
logType: 'logistics_way', logType: 'logistics_customs_rule',
relaId: row.id, relaId: row.id,
}) })
logList.value = data logList.value = data
......
...@@ -94,6 +94,17 @@ ...@@ -94,6 +94,17 @@
</div> </div>
</template> </template>
</LogDialog> </LogDialog>
<LogDialog
title="操作日志"
v-model="logDialogVisible"
@close="logDialogVisible = false"
>
<div v-for="item in logList" :key="item.id" style="margin-bottom: 8px">
<span style="margin-right: 10px">{{ item.createTime }}</span>
<span>{{ item.description }}</span>
</div>
</LogDialog>
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
...@@ -108,6 +119,7 @@ import { ...@@ -108,6 +119,7 @@ import {
deleteLogisticsQuotation, deleteLogisticsQuotation,
importLogisticsQuotation, importLogisticsQuotation,
downloadLogisticsQuotationTemplate, downloadLogisticsQuotationTemplate,
getLogisticsLog,
} from '@/api/logistics' } from '@/api/logistics'
import type { LogisticsMethod } from '@/types/api/logistics' import type { LogisticsMethod } from '@/types/api/logistics'
import SearchForm from '@/components/SearchForm.tsx' import SearchForm from '@/components/SearchForm.tsx'
...@@ -118,7 +130,7 @@ import type { VxeTablePropTypes } from 'vxe-table' ...@@ -118,7 +130,7 @@ import type { VxeTablePropTypes } from 'vxe-table'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { useValue } from './hooks/useValue' import { useValue } from './hooks/useValue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { Edit } from '@element-plus/icons-vue' import { Edit, List } from '@element-plus/icons-vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
const [searchForm] = useValue({ logisticsIdList: [] }) const [searchForm] = useValue({ logisticsIdList: [] })
...@@ -373,6 +385,15 @@ const tableConfig = ref([ ...@@ -373,6 +385,15 @@ const tableConfig = ref([
> >
<Edit /> <Edit />
</el-icon> </el-icon>
<el-icon
size="24"
title="日志"
color="#008aff"
style="cursor: pointer; vertical-align: middle"
onclick={() => showLog(row)}
>
<List />
</el-icon>
</div> </div>
), ),
}, },
...@@ -568,11 +589,7 @@ async function downloadExcel() { ...@@ -568,11 +589,7 @@ async function downloadExcel() {
const res = await downloadLogisticsQuotationTemplate() const res = await downloadLogisticsQuotationTemplate()
console.log(483, data) console.log(483, data)
const blob = new Blob([res]) const blob = new Blob([res])
// 2. 解析文件名(从响应头或自定义)
const filename = '物流报价模版.xlsx' const filename = '物流报价模版.xlsx'
// 3. 创建临时链接并触发下载
const link = document.createElement('a') const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob) link.href = window.URL.createObjectURL(blob)
link.download = filename link.download = filename
...@@ -612,15 +629,20 @@ async function updateExcel(file) { ...@@ -612,15 +629,20 @@ async function updateExcel(file) {
} }
} }
watch( const logList = ref([])
() => editForm.value, const logDialogVisible = ref(false)
(val) => { async function showLog(row) {
console.log('editForm', val) logDialogVisible.value = true
const bool = editForm.value?.['id'] ? true : false try {
console.log('bool', bool) const { data } = await getLogisticsLog({
}, logType: 'logistics_quotation',
{ deep: true, immediate: true }, relaId: row.id,
) })
logList.value = data
} catch (error) {
console.log(error)
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment