|
|
@@ -90,7 +90,7 @@
|
|
|
<el-col :span="4">
|
|
|
<!-- ||form.approver_info.name -->
|
|
|
<el-form-item label="审批人" prop="applicant_remark_type">
|
|
|
- <el-select v-model="form.applicant_remark_type" placeholder="请选择" :disabled="true" >
|
|
|
+ <el-select v-model="form.approver_info.name" placeholder="请选择" :disabled="true" >
|
|
|
<el-option label="管理员" value="1"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -101,22 +101,15 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <div style="margin: 16px 0 8px 0; font-weight: bold"> {{ isCollect ? '借用列表' : '归还列表' }}</div>
|
|
|
- <el-table :data="form.items.filter(item => item.device === null)" border style="width: 100%; margin-bottom: 12px">
|
|
|
+ <div style="margin: 16px 0 8px 0; font-weight: bold"> {{ isView ? '借用列表' : (isCollect ? '借用列表' : '归还列表') }}</div>
|
|
|
+ <el-table :data="form.items.filter(item => item.device === null)" border style="width: 50%; margin-bottom: 12px">
|
|
|
<el-table-column type="index" label="序号" width="60" />
|
|
|
<el-table-column prop="device_category_name" label="设备分类" />
|
|
|
- <!-- <el-table-column prop="quantity" label="借用数量" /> -->
|
|
|
- <el-table-column :label="isCollect ? '借用数量' : '归还数量'">
|
|
|
+ <el-table-column :label="isView ? '数量' : (isCollect ? '借用数量' : '归还数量')">
|
|
|
<template #default="{ row }">
|
|
|
<el-input v-model="row.quantity" type="number" :min="1" prop="quantity" size="small" :disabled="true" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="condition" label="归还备注" v-if="isReturn">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-input v-model="row.condition" :placeholder="isView?'':'请输入备注'" :disabled="true" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column prop="location" label="存放仓库" /> -->
|
|
|
<el-table-column label="操作" width="80">
|
|
|
<template #default="{ $index }">
|
|
|
<el-button type="text" style="color: red" @click="removeItem($index)" :disabled="true">移除</el-button>
|
|
|
@@ -144,14 +137,14 @@
|
|
|
<div class="el-upload__text">将文件拖到此处,或 <em>点击上传</em></div>
|
|
|
</el-upload> -->
|
|
|
<el-upload
|
|
|
- :disabled="true"
|
|
|
- class="avatar-uploader"
|
|
|
+ :disabled="true"
|
|
|
action="#"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="handleUploadSuccess"
|
|
|
+ list-type="picture-card"
|
|
|
+ :on-preview="handlePictureCardPreview"
|
|
|
+ :on-remove="handleRemoves"
|
|
|
+ :file-list="attachmentFileList"
|
|
|
>
|
|
|
- <img v-if="form.attachments" :src="form.attachments" class="avatar" />
|
|
|
- <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</el-form>
|
|
|
<!-- 审批信息流程展示 -->
|
|
|
@@ -199,7 +192,7 @@
|
|
|
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane v-if="isCollect" label="设备清单" name="second">
|
|
|
+ <el-tab-pane v-if="isCollect && !shouldHideDeviceList" label="设备清单" name="second">
|
|
|
<el-form :model="form" label-width="110px">
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="24">
|
|
|
@@ -267,7 +260,7 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane v-else label="设备清单" name="third">
|
|
|
+ <el-tab-pane v-else-if="!shouldHideDeviceList" label="设备清单" name="third">
|
|
|
<el-form :model="form" label-width="110px">
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="24">
|
|
|
@@ -384,6 +377,10 @@
|
|
|
v-model:visible="showViewAbnormalDialog"
|
|
|
:abnormal-data="currentAbnormalData"
|
|
|
/>
|
|
|
+ <!-- 图片预览对话框 -->
|
|
|
+ <el-dialog v-model="dialogVisible" title="图片预览" width="auto" center>
|
|
|
+ <img width="100%" :src="dialogImageUrl" alt="Preview Image" style="max-width: 100%; max-height: 80vh;" />
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -537,10 +534,33 @@ const isAdd = computed(() => props.modelValue?.mode === 'add');
|
|
|
const isCollect = computed(() => props.modelValue?.mode === 'collect');
|
|
|
const isReturn = computed(() => props.modelValue?.mode === 'return');
|
|
|
|
|
|
+// 计算是否应该隐藏设备清单标签页
|
|
|
+const shouldHideDeviceList = computed(() => {
|
|
|
+ if (!isView.value) return false;
|
|
|
+ // 检查状态是否已批准或待审批(通过数值或标签判断)
|
|
|
+ const status = (form.value as any).status;
|
|
|
+ const statusLabel = (form.value as any).status_label;
|
|
|
+
|
|
|
+ // 已批准状态:status >= 2 或状态标签为已批准相关
|
|
|
+ const isApproved = status >= 2 ||
|
|
|
+ statusLabel === '已批准' ;
|
|
|
+
|
|
|
+ // 待审批状态:status < 2 或状态标签为待审批
|
|
|
+ const isPendingApproval = status < 2 ||
|
|
|
+ statusLabel === '待审批';
|
|
|
+
|
|
|
+ // 只有在已批准或待审批状态时才隐藏设备清单
|
|
|
+ return isApproved || isPendingApproval;
|
|
|
+});
|
|
|
+
|
|
|
const emit = defineEmits(['update:visible', 'update:modelValue', 'submit']);
|
|
|
const visible = ref(props.visible);
|
|
|
const formRef = ref();
|
|
|
|
|
|
+// 图片预览相关
|
|
|
+const dialogImageUrl = ref('');
|
|
|
+const dialogVisible = ref(false);
|
|
|
+
|
|
|
const timeline = ref({
|
|
|
create: '',
|
|
|
approve: '',
|
|
|
@@ -917,6 +937,18 @@ function handleUploadError(err: any, file: any, fileList: any) {
|
|
|
console.error('上传失败:', file.name);
|
|
|
}
|
|
|
|
|
|
+// 图片预览处理函数
|
|
|
+const handlePictureCardPreview = (uploadFile: any) => {
|
|
|
+ dialogImageUrl.value = uploadFile.url || uploadFile.response?.url || form.value.attachments;
|
|
|
+ dialogVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+// 处理附件删除
|
|
|
+const handleRemoves = (file: any, fileList: any) => {
|
|
|
+ // 由于是禁用状态,这里只是示例,实际不会执行删除
|
|
|
+ console.log('删除附件:', file.name);
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
const form = ref<FormData>({
|
|
|
borrower_info:{
|
|
|
@@ -939,7 +971,10 @@ const form = ref<FormData>({
|
|
|
items: [],
|
|
|
accessory_info: '',
|
|
|
borrow_type: 2,
|
|
|
- return_location:''
|
|
|
+ return_location:'',
|
|
|
+ approver_info: {
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
});
|
|
|
const showSelectDeviceDialog = ref(false);
|
|
|
|
|
|
@@ -1042,7 +1077,7 @@ watch(() => props.modelValue, async (val) => {
|
|
|
// 添加损坏类型记录
|
|
|
const damageRecord: AbnormalRecord = {
|
|
|
application_no: form.value.application_no,
|
|
|
- operator_name: form.value.external_borrower_name||form.value.app_user_borrower?.name||'',
|
|
|
+ operator_name: form.value.app_user_borrower?.name||form.value.external_borrower_name||'',
|
|
|
user_code: form.value.borrower_info?.user_code || form.value.app_user_borrower?.user_code||'',
|
|
|
emergency_phone: form.value.external_borrower_phone || form.value.app_user_borrower?.mobile||'',
|
|
|
type: '损坏',
|
|
|
@@ -1053,7 +1088,7 @@ watch(() => props.modelValue, async (val) => {
|
|
|
// 添加逾期类型记录
|
|
|
const overdueRecord: AbnormalRecord = {
|
|
|
application_no: form.value.application_no,
|
|
|
- operator_name: form.value.external_borrower_name||form.value.app_user_borrower?.name||'',
|
|
|
+ operator_name: form.value.app_user_borrower?.name||form.value.external_borrower_name||'',
|
|
|
user_code: form.value.borrower_info?.user_code || form.value.app_user_borrower?.user_code||'',
|
|
|
emergency_phone: form.value.external_borrower_phone || form.value.app_user_borrower?.mobile||'',
|
|
|
type: '逾期',
|