Browse Source

附件备注变更

master
zhangli 1 year ago
parent
commit
549e896341
  1. 14
      src/api/wms/remark/index.ts
  2. 11
      src/components/Annex/src/Annex.vue
  3. 40
      src/components/Detail/src/Detail.vue
  4. 4
      src/components/Remarks/src/Remarks.vue

14
src/api/wms/remark/index.ts

@ -0,0 +1,14 @@
import request from '@/config/axios'
// 查询备注列表
export const getRemarkPage = async (params) => {
return await request.get({ url: `/infra/remark/list`, params })
}
// 新增备注
export const createRemark= async (data) => {
return await request.post({ url: `/infra/remark/create`, data })
}
// 查询变更记录列表
export const getChangeRecordPage = async (params) => {
return await request.get({ url: `/infra/trends/list`, params })
}

11
src/components/Annex/src/Annex.vue

@ -28,6 +28,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import UploadFile from '@/components/UploadFile/src/UploadFile.vue' import UploadFile from '@/components/UploadFile/src/UploadFile.vue'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as FileApi from '@/api/wms/file'
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
defineComponent({ defineComponent({
@ -53,8 +54,14 @@ const handleAnnexSuccess = () => {
// //
const deleteAnnex = async (id) => { const deleteAnnex = async (id) => {
try {
emit('deleteAnnexSuccess', id) //
await message.delConfirm()
//
await FileApi.deleteFile(id)
message.success(t('common.delSuccess'))
} catch { }
emit('deleteAnnexSuccess')
} }
</script> </script>

40
src/components/Detail/src/Detail.vue

@ -41,11 +41,9 @@ import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue' import Remarks from '@/components/Remarks/src/Remarks.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue' import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import Tabs from '@/components/Tabs/src/Tabs.vue' import Tabs from '@/components/Tabs/src/Tabs.vue'
import * as DetailApi from '@/api/wms/detail' import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file' import * as FileApi from '@/api/wms/file'
const message = useMessage() //
const { t } = useI18n() //
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
@ -114,26 +112,7 @@ const remarksData = reactive({
// //
const changeRecordData = reactive({ const changeRecordData = reactive({
changeRecordList: [{ changeRecordList: []
name: '诸葛亮',
type: 1,
time: '2023年5月6日 17:16:00',
}, {
name: '刘备',
type: 2,
time: '2023年5月6日 17:16:00',
}, {
name: '曹操',
type: 3,
time: '2023年5月6日 17:16:00',
file: [{
name: '这是个附件的名字.docx',
url: 'http://localhost:12080/admin-api/system/user/get-import-template'
}, {
name: '这是个附件的名字.docx',
url: 'http://localhost:12080/admin-api/system/user/get-import-template'
}]
}]
}) })
const detailData = ref("")// const detailData = ref("")//
// //
@ -152,17 +131,10 @@ const handleAnnexSuccess = () => {
} }
// //
const deleteAnnexSuccess = async (id) => { const deleteAnnexSuccess = async () => {
console.log('删除成功');
try {
//
await message.delConfirm()
//
await FileApi.deleteFile(id)
message.success(t('common.delSuccess'))
getFileList() getFileList()
getChangeRecordList() getChangeRecordList()
} catch { }
} }
// Tabs // Tabs
@ -204,7 +176,7 @@ defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗
const getRemarkList = async () => { const getRemarkList = async () => {
detailLoading.value = true detailLoading.value = true
try { try {
remarksData.remarksList = await DetailApi.getRemarkPage(remarksData.data) remarksData.remarksList = await RemarkApi.getRemarkPage(remarksData.data)
} finally { } finally {
detailLoading.value = false detailLoading.value = false
} }
@ -218,7 +190,7 @@ const remarksSubmitScuess = async (remark) => {
// //
const getChangeRecordList = async () => { const getChangeRecordList = async () => {
// remarksData.data.tableId = '1679654720693248010' // remarksData.data.tableId = '1679654720693248010'
changeRecordData.changeRecordList = await DetailApi.getChangeRecordPage(remarksData.data) changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
} }

4
src/components/Remarks/src/Remarks.vue

@ -30,7 +30,7 @@
<script lang="ts" setup> <script lang="ts" setup>
const message = useMessage() // const message = useMessage() //
import * as DetailApi from '@/api/wms/detail' import * as RemarkApi from '@/api/wms/remark'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
defineComponent({ defineComponent({
@ -55,7 +55,7 @@ const handleSubmitrRemarks =async ()=>{
return; return;
} }
try { try {
await DetailApi.createRemark(data.value) await RemarkApi.createRemark(data.value)
message.success('提交成功') message.success('提交成功')
} finally { } finally {
emit('remarksSubmitScuess') // emit('remarksSubmitScuess') //

Loading…
Cancel
Save