sc
This commit is contained in:
@@ -74,6 +74,9 @@
|
||||
<script setup name="DialogExtraPay">
|
||||
import { signAddPay, getSignExtraPayList } from '@/api/clue/sign'
|
||||
import * as ExtraFeeApi from '@/api/clue/extraFee'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const extraPayOptions = ref([])
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -92,13 +95,13 @@ defineExpose({
|
||||
const form = ref({})
|
||||
function resetForm(id) {
|
||||
form.value = {
|
||||
signOrderId: id,
|
||||
id: id,
|
||||
extraPay: []
|
||||
}
|
||||
}
|
||||
|
||||
function getFormList() {
|
||||
getSignExtraPayList({ id: form.value.signOrderId }).then((data) => {
|
||||
getSignExtraPayList({ id: form.value.id }).then((data) => {
|
||||
form.value.extraPay = data.map((it) => ({
|
||||
...it,
|
||||
editabled: false
|
||||
@@ -121,10 +124,14 @@ async function onSubmit() {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const params = {
|
||||
signOrderId: form.value.signOrderId,
|
||||
let params = {
|
||||
extraPay: form.value.extraPay.filter((it) => it.editabled)
|
||||
}
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
params.signId = form.value.id
|
||||
} else {
|
||||
params.signOrderId = form.value.id
|
||||
}
|
||||
await signAddPay(params)
|
||||
message.success('添加额外支出成功!')
|
||||
getFormList()
|
||||
|
||||
Reference in New Issue
Block a user