<template>
|
<ContentScrollView style="background-color: #fff" has-padding-top>
|
<div class="taskCheckFileCard-status-title">验收照片</div>
|
<TaskCheckFileCard
|
:created-time="detail.createdTime"
|
:files="detail?.files?.map?.((x) => setOSSLink(x))"
|
></TaskCheckFileCard>
|
<nut-form
|
:model-value="form"
|
ref="formRef"
|
:rules="rules"
|
label-position="top"
|
class="mineReserveServiceConfirm-page-form"
|
>
|
<nut-form-item class="bole-form-item" prop="remark" label="备注">
|
<nut-textarea v-model="form.remark" rows="4" placeholder="请输入"> </nut-textarea>
|
</nut-form-item>
|
</nut-form>
|
</ContentScrollView>
|
<PageFooter>
|
<PageFooterBtn type="primary" @click="handleConfirm">提交</PageFooterBtn>
|
</PageFooter>
|
</template>
|
|
<script setup lang="ts">
|
import Taro from '@tarojs/taro';
|
import * as standardOrderServices from '@12333/services/apiV2/standardOrder';
|
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
|
import { TaskCheckFileCard } from '@12333/components';
|
import { Message, setOSSLink } from '@12333/utils';
|
import { useQuery } from '@tanstack/vue-query';
|
import { goBack } from '@/utils';
|
|
defineOptions({
|
name: 'InnerPage',
|
});
|
|
const route = Taro.useRouter();
|
const id = route.params?.id as string;
|
|
const {
|
isLoading,
|
isError,
|
data: detail,
|
refetch,
|
} = useQuery({
|
queryKey: ['standardOrderServices/getSureStandardOrder', id],
|
queryFn: async () => {
|
const params: API.APIgetSureStandardOrderParams = {
|
id: id,
|
};
|
return await standardOrderServices.getSureStandardOrder(params, {
|
showLoading: false,
|
});
|
},
|
placeholderData: () => ({} as API.GetSureStandardOrderQueryResult),
|
});
|
|
const form = reactive({
|
remark: '',
|
});
|
|
const rules = reactive<FormRules>({});
|
|
const formRef = ref<any>(null);
|
function handleConfirm() {
|
if (!formRef.value) return;
|
formRef.value.validate().then(({ valid, errors }: any) => {
|
if (valid) {
|
confirm();
|
}
|
});
|
}
|
|
async function confirm() {
|
try {
|
let params: API.SureStandardOrderCommand = {
|
id: id,
|
appointmentCompletedRemark: form.remark,
|
};
|
let res = await standardOrderServices.sureStandardOrder(params);
|
if (res) {
|
Message.success('已确认', {
|
onClosed() {
|
goBack();
|
},
|
});
|
}
|
} catch (error) {}
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/styles/common.scss';
|
|
.mineReserveServiceConfirm-page-wrapper {
|
.taskCheckFileCard-status-title {
|
font-weight: 600;
|
font-size: 28px;
|
line-height: 32px;
|
margin-bottom: 16px;
|
color: boleGetCssVar('text-color', 'primary');
|
}
|
|
.mineReserveServiceConfirm-page-form {
|
margin-top: 20px;
|
|
.nut-cell-group__wrap {
|
box-shadow: none;
|
}
|
|
.bole-form-item {
|
padding: 0 !important;
|
}
|
}
|
}
|
</style>
|