chenhj
2 天以前 648f83f5d4480ae9c2794d5f4e114085943bdf6e
src/views/productionManagement/productionReporting/components/Detail.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {computed, onMounted} from "vue";
import {computed, onMounted, ref} from "vue";
defineOptions({
  name: "ReportingDetail"
@@ -23,10 +23,19 @@
  set: (value: boolean) => emits("update:isShow", value),
});
const otherData = ref([])
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 !== '') {
    otherData.value = JSON.parse(props.row.otherData);
    try {
      otherData.value = JSON.parse(props.row.otherData);
    } catch {
      otherData.value = {};
    }
  }
};
@@ -52,7 +61,15 @@
      <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 otherData"
          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 || '-' }}