Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

lmm 2 сар өмнө
parent
commit
b6865efff8

+ 15 - 15
src/views/museums/specimeninfo/index.vue

@@ -225,21 +225,21 @@
 <!--          class="!w-240px"-->
 <!--        />-->
 <!--      </el-form-item>-->
-<!--      <el-form-item label="馆藏状态" prop="collectionStatus">-->
-<!--        <el-select-->
-<!--          v-model="queryParams.collectionStatus"-->
-<!--          placeholder="请选择馆藏状态(在馆、借出)"-->
-<!--          clearable-->
-<!--          class="!w-240px"-->
-<!--        >-->
-<!--          <el-option-->
-<!--            v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_INFO)"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
+      <el-form-item label="馆藏状态" prop="collectionStatus">
+        <el-select
+          v-model="queryParams.collectionStatus"
+          placeholder="请选择馆藏状态(在馆、借出)"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_INFO)"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
 <!--      <el-form-item label="备注" prop="notes">-->
 <!--        <el-input-->
 <!--          v-model="queryParams.notes"-->

+ 35 - 11
src/views/museums/specimenoutbound/approval.vue

@@ -14,23 +14,42 @@
           <el-radio :label="2" :value="2">驳回</el-radio>
         </el-radio-group>
       </el-form-item>
-
-        <el-form-item  v-if="approvalStatus == 1">
+<div  v-if="formData.status === 0">
+        <el-form-item  v-if="approvalStatus === 1">
           <el-input
             v-model="formData.processInstanceId"
             style="width:800px; height: 200px"
-            placeholder="请输入审批建议"
+            placeholder="请输入审批建议11"
             type="textarea"
           />
         </el-form-item>
       <el-form-item  v-if="approvalStatus === 2">
         <el-input
-          v-model="formData.rejectionReasons"
+          v-model="formData.processInstanceId"
           style="width:800px ;height: 200px"
-          placeholder="请输入驳回原因"
+          placeholder="请输入审批建议"
           type="textarea"
         />
       </el-form-item>
+</div>
+      <div  v-if="formData.status === 1">
+        <el-form-item  v-if="approvalStatus === 3">
+          <el-input
+            v-model="formData.rejectionReasons"
+            style="width:800px; height: 200px"
+            placeholder="请输入审批建议22"
+            type="textarea"
+          />
+        </el-form-item>
+        <el-form-item  v-if="approvalStatus === 4">
+          <el-input
+            v-model="formData.rejectionReasons"
+            style="width:800px ;height: 200px"
+            placeholder="请输入审批建议"
+            type="textarea"
+          />
+        </el-form-item>
+      </div>
     </el-form>
     <div>
         <el-button :disabled="formLoading" type="primary" @click="submitApproval">确定</el-button>
@@ -77,7 +96,7 @@ const open = async (id?: number) => {
   if (id) {
     formLoading.value = true
     try {
-      console.log('hhh', formData.value)
+      console.log('2345234', formData.value)
       // formData.value.id = id
       formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)
       formData.value.processInstanceId = undefined
@@ -93,8 +112,8 @@ defineExpose({ open })// 提供 open 方法,用于打开弹窗
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 
 const submitApproval = async () => {
-  if (approvalStatus.value === 2 && (formData.value.rejectionReasons == '' || formData.value.rejectionReasons == undefined) ) {
-    message.error(t('请输入驳回原因'));
+  if ((approvalStatus.value === 2 && (formData.value.processInstanceId == '' || formData.value.processInstanceId == undefined  )) || (approvalStatus.value == 4 && (formData.value.rejectionReasons == '' || formData.value.rejectionReasons == undefined  ))) {
+    message.error(t('请输入审批意见'));
     return;
   }
   try {
@@ -102,16 +121,21 @@ const submitApproval = async () => {
     let statusCode;
     console.log('tj', approvalStatus.value)
     if (approvalStatus.value === 1) {
-      statusCode = formData.value.status === 0 ? 1 : 5 ;
+      statusCode = formData.value.status === 1 ;
      } else  if (approvalStatus.value === 2){
-      statusCode = formData.value.status === 0 ? 2 : 6;
-     }
+      statusCode = formData.value.status ===  2;
+     }   if (approvalStatus.value === 3) {
+      statusCode = formData.value.status ===  5 ;
+    } else  if (approvalStatus.value === 4){
+      statusCode = formData.value.status ===  6;
+    }
     const data = {
       ...formData.value,
       status: statusCode,
       processInstanceId: formData.value.processInstanceId,
       rejectionReasons: formData.value.rejectionReasons,
   };
+    console.log('Sending data:', data);
     await SpecimenOutboundApi.ApprovalSpecimenOutbound(data);
     message.success(t('审批成功'));
     dialogVisible.value = false;