12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <template>
- <div class="">
- <el-dialog
- v-model="show"
- :title="$t(prefix + 'dialog_title_record')"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :before-close="close"
- width="550px"
- >
- <el-table
- v-loading="loading"
- :data="record"
- >
- <el-table-column
- width="180"
- :label="$t(prefix + 'label_audit_time')"
- prop="create_time"
- ></el-table-column>
- <el-table-column
- :label="$t(prefix + 'label_audit_operator')"
- prop="admin_name"
- ></el-table-column>
- <el-table-column :label="$t(prefix + 'label_audit_result')">
- <template #default="scope">
- <div>{{ getStatusLabel(scope.row.status) }}</div>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t(prefix + 'label_feedback')"
- prop="feedback"
- ></el-table-column>
- </el-table>
- </el-dialog>
- </div>
- </template>
- <script lang="ts" setup>
- import { defineComponent, ref, watch } from 'vue'
- import { ElDialog, ElTable, ElTableColumn } from 'element-plus'
- import { getExamineRecord } from '@/api/supplier'
- import { $t } from '@/i18n/index'
- defineComponent({
- name: 'DialogExamineRecord',
- })
- const {
- visible = false,
- id = '',
- statusList = [],
- } = defineProps<{
- visible: boolean
- id: number | string
- statusList: any[]
- }>()
- const $emit = defineEmits(['update:visible'])
- let show = ref(false)
- let loading = ref(false)
- let record = ref([] as any[])
- const prefix = 'order.product.'
- watch(
- () => visible,
- () => {
- show.value = visible
- if (show.value) getRecord()
- },
- )
- const getStatusLabel = (value: any) => {
- const temp: any[] = statusList.filter((i: any) => i.value === value)
- return temp.length ? temp[0].label : '-'
- }
- const getRecord = () => {
- loading.value = true
- getExamineRecord({ supplier_id: id })
- .then((res: any) => {
- if (res.code !== 1) {
- return
- }
- if (Array.isArray(res.result)) {
- record.value = res.result
- }
- })
- .finally(() => {
- loading.value = false
- })
- }
- let close = (done = {} as any) => {
- $emit('update:visible', false)
- if (typeof done === 'function') done()
- }
- </script>
|