Blame view

src/views/project/order/PassCalculate.vue 1.23 KB
1
2
3
4
5
<template>
  <BasicModal
    v-bind="$attrs"
    :title="title"
    @register="register"
柏杨 authored
6
    @visible-change="handleShow"
7
8
9
10
    width="500px"
    :bodyStyle="{ height: '100px' }"
    @ok="handleOk"
  >
11
    <div style="margin-left: 10px; font-size: 16px">一次通过率:{{ num }}</div>
12
13
14
15
16
  </BasicModal>
</template>
<script lang="ts" setup>
  import { BasicModal, useModalInner } from '@/components/Modal';
  import { computed, ref } from 'vue';
17
  import { passCalculate } from '@/api/project/order';
18
19
20

  const [register, { closeModal }] = useModalInner(async (data) => {
    title.value = data.title;
柏杨 authored
21
    const ids = data.check;
22
23
24
25
26
27
28
29
    const opinionType = ref();
    if (data.title == '确认意见') {
      opinionType.value = 'pp样品确认意见';
    } else if (data.title == '生产样品') {
      opinionType.value = 'shipment sample确认意见';
    } else if (data.title == '测试样品') {
      opinionType.value = 'Altex测试结果';
    }
柏杨 authored
30
    num.value = await passCalculate({ ids: ids, opinionType: opinionType.value });
31
32
  });
  const title = ref('');
33
  const num = ref();
34
35

  async function handleOk() {
36
    num.value = '';
柏杨 authored
37
38
39
40
41
42
    closeModal();
  }
  function handleShow(visible: boolean) {
    if (visible) {
      num.value = '';
    }
43
44
  }
</script>