chenhj
2 天以前 648f83f5d4480ae9c2794d5f4e114085943bdf6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<script setup lang="ts">
import {computed, onMounted, ref} from "vue";
 
defineOptions({
  name: "ReportingDetail"
});
 
const props = defineProps({
  isShow: {
    type: Boolean,
    required: true
  },
  row: {
    type: Object,
    default: () => ({}),
  }
});
 
const emits = defineEmits(["update:isShow"]);
 
const visible = computed({
  get: () => props.isShow,
  set: (value: boolean) => emits("update:isShow", value),
});
 
const otherData = ref({})
const otherDataEntries = computed(() => {
  return Object.entries(otherData.value || {})
      .filter(([key]) => key !== "rows")
      .map(([key, value]) => ({key, value}));
});
const init = () => {
  if (props.row.otherData !== null && props.row.otherData !== '') {
    try {
      otherData.value = JSON.parse(props.row.otherData);
    } catch {
      otherData.value = {};
    }
  }
};
 
onMounted(() => {
  init();
})
 
</script>
 
<template>
  <el-dialog v-model="visible"
             :title="'详情'"
             width="90%">
    <el-descriptions title="报工详情">
      <el-descriptions-item label="报工单号">{{ row.productNo || '-' }}</el-descriptions-item>
      <el-descriptions-item label="报工人员">{{ row.nickName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="工序">{{ row.process || '-' }}</el-descriptions-item>
      <el-descriptions-item label="工单编号">{{ row.workOrderNo || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产品名称">{{ row.salesContractNo || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产品规格型号">{{ row.productName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产出数量">{{ row.productModelName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="报废数量">{{ row.quantity || '-' }}</el-descriptions-item>
      <el-descriptions-item label="单位">{{ row.scrapQty || '-' }}</el-descriptions-item>
      <el-descriptions-item label="创建时间">{{ row.createTime || '-' }}</el-descriptions-item>
      <el-descriptions-item
          v-for="item in otherDataEntries"
          :key="item.key"
          :label="item.key"
      >
        {{ item.value || '-' }}
      </el-descriptions-item>
      <el-descriptions-item
          v-for="item in (otherData.rows || [])"
          :key="item.parameterItem"
          :label="`${item.parameterItem}`"
      >
        {{ item.value || '-' }}
      </el-descriptions-item>
    </el-descriptions>
    <template #footer>
        <span class="dialog-footer">
          <el-button @click="visible = false">关闭</el-button>
        </span>
    </template>
  </el-dialog>
</template>
 
<style scoped>
</style>