zhuoyuan.wang
2024-06-19 15ebe96f28cadec6a726c5324593a40bbf56205f
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
<template>
  <app-dialog-form
    v-bind="dialogFormProps"
    v-loading="appStore.getLoading('changeBatchStatusByGeneral')"
  >
    <app-form-fields v-bind="formFieldsProps"/>
  </app-dialog-form>
</template>
 
<script setup>
 
import {modal} from '@/plugins';
 
import * as api from './api.js';
 
import {useI18n} from 'vue-i18n';
 
const {t} = useI18n();
 
import {useAppStore, useEntityStore} from '@/store/modules';
 
 
const entityStore = useEntityStore();
 
const appStore = useAppStore();
 
const dialogFormRef = ref();
const formFieldsRef = ref();
const typeDialogRef = ref();
 
const props = defineProps({
  subReload: {
    type: Function,
    default: () => {
    }
  },
});
 
const formFieldsProps = {
  ref: formFieldsRef,
  fields: [{
    type: 'el-textarea',
    prop: "feed_back",
    label: '反馈',
    col: {span: 24},
    textarea: {
      placeholder: '请输入',
    },
    item: {
      prop: 'feed_back',
      label: '反馈'
    }
  }]
}
 
const form = {
  selection: []
}
 
const dialogFormProps = {
  title: '同意审批',
  ref: dialogFormRef,
  subSubmit: async () => {
      const {feed_back} = await formFieldsRef.value.onValidate();
      await api.changeBatchStatusByGeneral({status: 'operator', ids: form.selection.map(e => e.id), feed_back});
 
      props.subReload();
  },
  subReset: async () => {
    formFieldsRef.value.onReset();
  }
};
const onOpen = async (selection) => {
  form.selection = selection;
  dialogFormRef.value.onOpen();
  await nextTick();
  formFieldsRef.value.onReset();
}
 
defineExpose({
  onOpen
});
 
</script>