|
|
@@ -54,6 +54,7 @@
|
|
|
</FlexCol>
|
|
|
<Divider />
|
|
|
<Button type="primary" block :loading="submitLoading" @click="saveForm">保存评估表</Button>
|
|
|
+ <Button type="primary" block :loading="submitLoading" @click="submitForm">提交审核</Button>
|
|
|
<Button :loading="submitLoading" @click="downloadForm">下载评估表PDF</Button>
|
|
|
</FlexCol>
|
|
|
</template>
|
|
|
@@ -201,6 +202,33 @@ async function saveForm() {
|
|
|
|
|
|
submitLoading.value = false;
|
|
|
}
|
|
|
+async function submitForm() {
|
|
|
+ const detail = currentForm.value;
|
|
|
+ try {
|
|
|
+ await blockRef.value?.validate();
|
|
|
+ } catch (error) {
|
|
|
+ toast('请填写完整信息');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ submitLoading.value = true;
|
|
|
+ currentForm.value!.checkItems = currentFormCheckItems.value;
|
|
|
+ try {
|
|
|
+ assertNotNull(detail, 'currentForm is null');
|
|
|
+ await AssessmentContentApi.saveSelfAssessment(detail as SelfAssessmentDetail, 1);
|
|
|
+ toast('提交审核成功');
|
|
|
+
|
|
|
+ await waitTimeOut(1000);
|
|
|
+ await loader.reload();
|
|
|
+ } catch (error) {
|
|
|
+ alert({
|
|
|
+ title: '提交审核失败',
|
|
|
+ content: formatError(error),
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ submitLoading.value = false;
|
|
|
+}
|
|
|
async function downloadForm() {
|
|
|
if (!currentForm.value?.id) {
|
|
|
toast('请先保存评估表后再下载PDF');
|