lmm 3 mesiacov pred
rodič
commit
8d222bca80

+ 56 - 0
src/views/museums/OutboundForm/OutboundForm.vue

@@ -0,0 +1,56 @@
+<!--<template>-->
+<!--  <Dialog :title="dialogTitle" v-model="dialogVisible">-->
+
+<!--    <template #footer>-->
+<!--      <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>-->
+<!--      <el-button @click="dialogVisible = false">取 消</el-button>-->
+<!--    </template>-->
+<!--  </Dialog>-->
+<!--</template>-->
+
+<!--<script setup lang="ts">-->
+
+
+<!--const dialogVisible = ref(false) // 弹窗的是否展示-->
+<!--const formData = ref({-->
+<!--  id: undefined,-->
+<!--  infoId: undefined,-->
+<!--  chineseName: undefined,-->
+<!--  specimenNumber: undefined,-->
+<!--  applicantName: undefined,-->
+<!--  applicationDate: undefined,-->
+<!--  applicationUsage: undefined,-->
+<!--  attachments: undefined,-->
+<!--  status: undefined,-->
+<!--  remarks: undefined,-->
+<!--  processInstanceId: undefined,-->
+<!--  operator: undefined,-->
+<!--  outgoingTime: undefined,-->
+<!--  returner: undefined,-->
+<!--  receiver: undefined,-->
+<!--  returnDate: undefined,-->
+<!--  specimenCondition: undefined,-->
+<!--  sampleStatus: undefined-->
+<!--})-->
+
+
+
+<!--/** 打开弹窗 */-->
+<!--const open = async (type: string, id?: number) => {-->
+<!--  dialogVisible.value = true-->
+<!--  dialogTitle.value = t('action.' + type)-->
+<!--  formType.value = type-->
+<!--  resetForm()-->
+<!--  // 修改时,设置数据-->
+<!--  if (id) {-->
+<!--    formLoading.value = true-->
+<!--    try {-->
+<!--      formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)-->
+<!--    } finally {-->
+<!--      formLoading.value = false-->
+<!--    }-->
+<!--  }-->
+<!--}-->
+<!--defineExpose({ open }) // 提供 open 方法,用于打开弹窗-->
+
+<!--</script>-->

+ 99 - 0
src/views/museums/specimenoutbound/approval.vue

@@ -0,0 +1,99 @@
+<template>
+  <Dialog
+    v-model="dialogVisible"
+    title="是否审批通过"
+    width="800"
+  >
+    <el-form
+
+      :action="approvalUrl + '?updateSupport=' + updateSupport">
+      <el-form-item>
+        <el-radio-group  v-model="approvalStatus">
+          <el-radio :label="1">通过</el-radio>
+          <el-radio :label="2">驳回</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item  v-if="approvalStatus === 2">
+        <el-input
+          v-model="chkRemarks"
+          style="width:800px ;height: 200px"
+          placeholder="请输入驳回原因"
+
+        />
+      </el-form-item>
+    </el-form>
+
+    <div>
+        <el-button :disabled="formLoading" type="primary" @click="submitApproval">确定</el-button>
+        <el-button type="danger" @click="dialogVisible = false">取消</el-button>
+    </div>
+  </Dialog>
+</template>
+
+
+
+<script setup lang="ts">
+import { getAccessToken, getTenantId } from '@/utils/auth'
+import { ref } from 'vue'
+const approvalUrl =
+  import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/museums/specimen-outbound/reject'
+
+const {t} = useI18n() // 国际化
+const approvalStatus = ref(0);
+const uploadRef = ref()
+const formLoading = ref(false) // 表单的加载中
+const dialogVisible = ref(false) // 弹窗的是否展示
+const dialogTitle = ref('') // 弹窗的标题
+const chkRemarks = ref('')
+const message = useMessage() // 消息弹窗
+const processInstanceId = ref([]) // 文件列表
+const uploadHeaders = ref() // 上传 Header 头
+const updateSupport = ref(0) // 是否更新已经存在的用户数据
+/** 打开弹窗 */
+const open = async (type: string, ) => {
+  dialogVisible.value = true
+  formLoading.value = true
+  approvalStatus.value = 0
+  dialogVisible.value = true
+  updateSupport.value = 0
+  dialogTitle.value = t('action.' + type)
+  processInstanceId.value = []
+  resetForm()
+}
+defineExpose({ open })// 提供 open 方法,用于打开弹窗
+
+
+/** 提交审批 */
+const submitApproval = async () => {
+  if (approvalStatus.value === 2 && !chkRemarks.value.trim()) {
+    message.error('请输入驳回原因')
+    formLoading.value = false
+    return
+  }
+  // 提交请求
+  uploadHeaders.value  = {
+    Authorization: 'Bearer ' + getAccessToken(),
+    'tenant-id': getTenantId()
+  }
+  formLoading.value = true
+
+  try {
+    // 这里应该添加实际的请求发送代码,例如使用 axios 或其他 HTTP 库
+    // await axios.post(approvalUrl, { approvalStatus, chkRemarks, updateSupport }, { headers })
+    console.log('提交审批请求...')
+    dialogVisible.value = false;
+  } catch (error) {
+    message.error('审批提交失败')
+  } finally {
+    formLoading.value = false
+
+  }
+}
+/** 重置表单 */
+const resetForm = async (): Promise<void> => {
+  // 重置上传状态和文件
+  formLoading.value = false
+  await nextTick()
+  uploadRef.value?.clearFiles()
+}
+</script>