diff --git a/src/api/work/negative.ts b/src/api/work/negative.ts
index 0268b1c..12c8540 100644
--- a/src/api/work/negative.ts
+++ b/src/api/work/negative.ts
@@ -73,3 +73,11 @@ export function transferTodo(id) {
url: `/negative/${id}/transferTodo`
});
}
+
+
+export function spotCheckNegative(id, body) {
+ return request.post({
+ url: `/negative/${id}/spotCheck`,
+ body
+ });
+}
\ No newline at end of file
diff --git a/src/components/negative/dialog.vue b/src/components/negative/dialog.vue
index 805cad0..77b4550 100644
--- a/src/components/negative/dialog.vue
+++ b/src/components/negative/dialog.vue
@@ -6,6 +6,7 @@
class="dialog-header-nopadding"
style="--el-dialog-padding-primary: 10px; margin-bottom: 2vh"
:lock-scroll="false"
+ ref="dialogRef"
>
+
+
+
+
+ 合格
+ 不合格
+
+
+
+
+
+
@@ -187,6 +256,13 @@
+ 保存抽检结果
{
getDetails();
verifyEditFlag.value = false;
+ formData.value = {};
}
);
@@ -423,6 +504,55 @@ function handleFav() {
}
isFav.value = !isFav.value;
}
+
+const spotCheckEditFlag = ref(false);
+
+function spotCheck() {
+ spotCheckEditFlag.value = true;
+}
+
+const dialogRef = ref();
+watch(
+ () => dialogRef.value?.visible,
+ (val) => {
+ if (!val) {
+ spotCheckEditFlag.value = false;
+ }
+ }
+);
+
+const formData = ref({});
+const formRef = ref();
+async function handleSubmitSpotCheck() {
+ try {
+ await formRef.value.validate();
+ } catch (e) {
+ feedback.msgWarning(e.message || "请检查输入项");
+ throw e;
+ }
+ await spotCheckNegative(props.id, formData.value);
+ feedback.msgSuccess("抽查成功!");
+ emit("change");
+ emit("close");
+ formData.value = {};
+}
+
+async function handleUpdateVerify() {
+ if (verifyEditFlag.value) {
+ try {
+ const data = await componentRef.value.validate();
+ formData.value.verifyData = data;
+ } catch (e) {
+ feedback.msgWarning(e.message || "请检查输入项");
+ throw e;
+ }
+ }
+ verifyEditFlag.value = !verifyEditFlag.value;
+}
+
+defineExpose({
+ spotCheck,
+});
\ No newline at end of file