|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<template>
<BasicDrawer
v-cloakv-bind="$attrs"
@register="register"
title="编辑"
width="35%"
showFooter
@ok="handleSubmit"
ref="formRef"
okText="保存"
:destroyOnClose="true"
:isDetail="true"
:showDetailBack="false"
:mask="false"
class="z-20"
>
<a-space direction="vertical" style="width: 100%">
<a-input v-model:value="fixCost" addonBefore="固定成本 " />
|
|
19
|
<a-input v-model:value="ratio" addonBefore="提成单价 " />
|
|
20
|
<a-input v-model:value="year" :disabled="true" addonBefore="年份 " />
|
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
</a-space>
</BasicDrawer>
</template>
<script lang="ts" setup>
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
import { BasicForm, FormSchema, useForm } from '@/components/Form';
import { defineComponent, ref, computed, unref, toRaw, reactive, onMounted } from 'vue';
import { saveConfig } from '/@/api/sys/config';
// const emit = defineEmits(['success']);
// const isUpdate = ref(true);
const emit = defineEmits(['success']);
const [register, { closeDrawer }] = useDrawerInner((data) => {
listAll.value = data.data;
relationValue.value = JSON.parse(listAll.value.relationValue);
fixCost.value = relationValue.value[0].relationValue;
ratio.value = relationValue.value[1].relationValue;
|
|
39
|
year.value = listAll.value.relationName;
|
|
40
41
42
43
44
45
|
});
//获取现有的列表
const listAll = ref();
const fixCost = ref();
const ratio = ref();
const relationValue = ref();
|
|
46
|
const year = ref();
|
|
47
48
49
50
51
52
53
54
55
56
57
|
//完成编辑
async function handleSubmit() {
relationValue.value[0].relationValue = fixCost.value;
relationValue.value[1].relationValue = ratio.value;
await saveConfig({
id: listAll.value.id,
settingCode: 'customerCode',
settingName: '生产提成成本配置',
settingValue: listAll.value.settingValue,
settingType: 4,
relationCode: 'ProduceSettingItem',
|
|
58
|
relationName: year.value,
|
|
59
60
61
62
63
64
|
costSettingItemVOS: relationValue.value,
});
emit('success');
closeDrawer();
}
</script>
|