Newer
Older
xc-business-system / src / views / quality / internal / report / components / preventProcessForm.vue
<!-- 预防措施处理单 -->
<script name="PreventProcessForm" lang="ts" setup>
const $props = defineProps({
  data: {
    type: Array,
    default: () => ([]),
  },
})
const columns = ref([
  { text: '文件编号', value: 'fileCode', align: 'center' },
  { text: '文件名称', value: 'fileName', align: 'center' },
  { text: '责任部门', value: 'supDeptName', align: 'center' },
  { text: '潜在不符合要求事实陈述', value: 'description', align: 'center' },
  { text: '提出人', value: 'standardNo', align: 'creatorName' },
  { text: '预防措施后的结果验证', value: 'standardNo', align: 'center' },
])
// 多选发生改变时
const checkoutList = ref<string[]>([])// 选中的内容
function handleSelectionChange(e: any) {
  checkoutList.value = e.map((item: { id: string }) => item.id)
}
const list = ref<any[]>([])
watch(() => $props.data, (newVal) => {
  if (newVal.length) {
    list.value = newVal
  }
  else {
    list.value = []
  }
}, {
  deep: true,
})
</script>

<template>
  <detail-block title="预防措施处理单">
    <normal-table
      :data="list" :columns="columns as any" :pagination="false" :is-multi="true"
      :is-showmulti-select="false" @multi-select="handleSelectionChange"
    />
  </detail-block>
</template>