yangg 1 tháng trước cách đây
mục cha
commit
9f1dde81e9

+ 2 - 2
.env.development

@@ -5,8 +5,8 @@ ENV = 'development'
 #线下:http://192.168.100.187:8083
 # 本地环境接口地址 121.36.251.245
 
-VITE_API_URL = 'http://192.168.100.106:8086'
-#VITE_API_URL = 'http://1.94.168.85:8086'
+#VITE_API_URL = 'http://192.168.100.106:8086'
+VITE_API_URL = 'http://1.94.168.85:8086'
 # VITE_API_URL = 'https://backend.qicai321.com'
 VITE_API_WX_URL='https://api.weixin.qq.com/'
 VITE_API_URL_MINLONG='http://117.185.80.170:7861'

+ 1 - 1
src/i18n/lang/zh-cn.ts

@@ -54,7 +54,7 @@ export default {
         searchPlaceholder: '菜单搜索:支持中文、路由路径',
         newTitle: '通知',
         newBtn: '全部已读',
-        newGo: '前往通知中心',
+        newGo: '前往消息中心',
         newDesc: '暂无通知',
         logOutTitle: '提示',
         logOutMessage: '此操作将退出登录, 是否继续?',

+ 1 - 1
src/i18n/lang/zh-tw.ts

@@ -100,7 +100,7 @@ export default {
 		searchPlaceholder: '選單蒐索:支援中文、路由路徑',
 		newTitle: '通知',
 		newBtn: '全部已讀',
-		newGo: '前往通知中心',
+		newGo: '前往消息中心',
 		newDesc: '暫無通知',
 		logOutTitle: '提示',
 		logOutMessage: '此操作將登出,是否繼續?',

+ 1 - 1
src/views/system/Inventorycount/crud.tsx

@@ -70,7 +70,7 @@ export const createCrudOptions = function ({ crudExpose , inventoryDialog}: Crea
 				width: 220,
 				buttons:{
 					view:{
-						show:false
+						show:true
 					},
 					remove:{
 						show:false,

+ 90 - 5
src/views/system/borrow/approval/SpecialBorrowApp/index.vue

@@ -51,7 +51,9 @@
 				</el-col> -->
 				<el-col :span="8">
 					<el-form-item label="预计归还时间" prop="expected_end_time">
-						<el-date-picker v-model="form.expected_end_time" type="datetime" placeholder="请选择预计归还时间" style="width: 100%"  :disabled="isView"/>
+						<el-date-picker v-model="form.expected_end_time" type="date" 
+                                format="YYYY-MM-DD"
+                                value-format="YYYY-MM-DD" placeholder="请选择预计归还时间" style="width: 100%"  :disabled="isView"/>
 					</el-form-item>
 				</el-col>
 				<el-col :span="4">
@@ -92,7 +94,7 @@
 			</el-row>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">借用列表</div>
 			<!-- {{ isEdit }} -->
-			<el-table :data="!isEdit ? form.items : form.items.filter(item => item.device === null)" border style="width: 100%; margin-bottom: 12px">
+			<el-table :data="!isEdit ? form.items : 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="借用数量" /> -->
@@ -118,12 +120,23 @@
 			:disabled="true"
 			list-type="picture-card"
 			:show-file-list="true"
+			:on-preview="handlePictureCardPreview"
 			:http-request="handleCustomUpload"
 			:file-list="fileList"
 			style="margin-top: 10px;"
 			>
 			<el-icon><Plus /></el-icon>
 			</el-upload>
+			<!-- <el-upload
+				:disabled="true"
+				class="avatar-uploader"
+				action="#"
+				:show-file-list="false"
+				:on-success="handleUploadSuccess"
+			>
+				<img v-if="form.attachments" :src="form.attachments" class="avatar" />
+				<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+			</el-upload> -->
 		    </div>
 
 		</el-form>
@@ -150,6 +163,9 @@
 			<el-button type="primary" @click="onSubmit" v-if="!isView">提交</el-button>
 		</template>
 	</el-dialog>
+	<el-dialog v-model="dialogVisible">
+		<img w-full :src="dialogImageUrl" alt="Preview Image" />
+	</el-dialog>
 	<SelectDeviceDialogApp v-model:visible="showSelectDeviceDialog" @confirm="onDeviceSelected" />
 	<!-- <SelectCatgory v-model:visible="showSelectDeviceDialog" @confirm="onDeviceSelected" /> -->
 	<RefuseNotification/>
@@ -166,7 +182,7 @@ import SelectDeviceDialogApp from './SelectDeviceDialogApp/index.vue';
 import RefuseNotification from '../RefuseNotification/index.vue';
 import WarehouseSelectDialog from '../components/WarehouseSelectDialog.vue';
 import dayjs from 'dayjs';
-import { ElMessage } from 'element-plus';
+import { ElMessage,UploadProps, UploadUserFile } from 'element-plus';
 import * as api from '../api';
 import * as apis from '../../api';
 import Cookies from 'js-cookie';
@@ -175,6 +191,8 @@ import { Plus } from '@element-plus/icons-vue';
 // import SelectDeviceDialog from './SelectDeviceDialogApp/index.vue';
 import { getUserInfo,getAdminUserInfo } from '../../../login/api';
 
+const dialogImageUrl = ref('')
+const dialogVisible = ref(false)
 const showRejectDialog = ref(false);
 const rejectReason = ref('');
 const currentFormId = ref<number | null>(null);
@@ -247,8 +265,16 @@ const visible = ref(props.visible);
 const formRef = ref();
 
 
-const fileList = ref([]);
+const fileList = ref<UploadUserFile[]>([]);
 
+function handleUploadSuccess(response: any, file: any, fileList: any) {
+	// eslint-disable-next-line no-console
+  console.log('上传成功:', file.name);
+}
+const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
+  dialogImageUrl.value = uploadFile.url!
+  dialogVisible.value = true
+}
 // const fileList = ref([]);
 const handleCustomUpload = async ({ file, onProgress, onSuccess, onError }: any) => {
   const token = Cookies.get('token'); 
@@ -334,7 +360,7 @@ function buildSteps(data: any) {
     },
     {
       title: '待审批',
-      description: '待审批人审批',
+      description: `待审批人:${data.approver_info.name}`,
       status: data.status >= 2 ? 'finish' : 'process'
     }
   ];
@@ -479,6 +505,35 @@ watch(() => props.modelValue, async (val) => {
 				buildSteps(data);
 				form.value.app_user_borrower = res.data.app_user_borrower?.id || '';
 
+				// 处理附件回显
+				if (data.attachments) {
+					if (typeof data.attachments === 'string') {
+						// 如果attachments是字符串URL
+						fileList.value = [{
+							name: data.attachments.split('/').pop() || '附件',
+							url: data.attachments,
+							status: 'success'
+						}];
+					} else if (Array.isArray(data.attachments)) {
+						// 如果attachments是数组
+						fileList.value = data.attachments.map((item: any, index: number) => {
+							if (typeof item === 'string') {
+								return {
+									name: item.split('/').pop() || `附件${index + 1}`,
+									url: item,
+									status: 'success'
+								};
+							} else if (typeof item === 'object' && item.url) {
+								return {
+									name: item.name || item.url.split('/').pop() || `附件${index + 1}`,
+									url: item.url,
+									status: 'success'
+								};
+							}
+							return null;
+						}).filter(Boolean);
+					}
+				}
        
 			}
 			} catch (e) {
@@ -492,6 +547,34 @@ watch(() => props.modelValue, async (val) => {
 				const data = res.data;
 				Object.assign(form.value, data);
 				form.value.app_user_borrower = res.data.app_user_borrower?.id || '';
+
+				// 处理附件回显 (编辑模式)
+				if (data.attachments) {
+					if (typeof data.attachments === 'string') {
+						fileList.value = [{
+							name: data.attachments.split('/').pop() || '附件',
+							url: data.attachments,
+							status: 'success'
+						}];
+					} else if (Array.isArray(data.attachments)) {
+						fileList.value = data.attachments.map((item: any, index: number) => {
+							if (typeof item === 'string') {
+								return {
+									name: item.split('/').pop() || `附件${index + 1}`,
+									url: item,
+									status: 'success'
+								};
+							} else if (typeof item === 'object' && item.url) {
+								return {
+									name: item.name || item.url.split('/').pop() || `附件${index + 1}`,
+									url: item.url,
+									status: 'success'
+								};
+							}
+							return null;
+						}).filter(Boolean);
+					}
+				}
 			}
 			} catch (e) {
 			  ElMessage.error('获取审批信息失败');
@@ -551,6 +634,8 @@ async function onSucess(){
 
 
 function onCancel() {
+	// 清空附件列表
+	fileList.value = [];
 	emit('update:visible', false);
 }
 function onSubmit() {

+ 1 - 1
src/views/system/borrow/component/ClassroomBorrow/index.vue

@@ -94,7 +94,7 @@
 				</el-col>
 			</el-row>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">借用列表</div>
-			<el-table :data="form.items" border style="width: 100%; margin-bottom: 12px">
+			<el-table :data="form.items" border style="width: 50%; margin-bottom: 12px">
 				<el-table-column type="index" label="序号" width="60" />
 				<el-table-column prop="remark" label="设备分类" />
 				<el-table-column label="借用数量">

+ 57 - 22
src/views/system/borrow/component/CollectEquipment/index.vue

@@ -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: '逾期',

+ 1 - 1
src/views/system/borrow/component/CommonBorrow/index.vue

@@ -92,7 +92,7 @@
 			</el-row>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">借用列表</div>
 			<!-- {{ isEdit }} -->
-			<el-table :data="!isEdit ? form.items : form.items.filter(item => item.device === null)" border style="width: 100%; margin-bottom: 12px">
+			<el-table :data="!isEdit ? form.items : 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" label="设备分类">
 					<template #default="{ row }">

+ 1 - 1
src/views/system/borrow/component/SpecialBorrow/index.vue

@@ -95,7 +95,7 @@
 			</el-row>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">借用列表</div>
 			<!-- {{ isEdit }} -->
-			<el-table :data="!isEdit ? form.items : form.items.filter(item => item.device === null)" border style="width: 100%; margin-bottom: 12px">
+			<el-table :data="!isEdit ? form.items : 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="remark" label="设备分类" />
 				<!-- <el-table-column prop="quantity" label="借用数量" /> -->

+ 1 - 0
src/views/system/devicedamage/crud.tsx

@@ -217,6 +217,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					form: {
 						component: { 
 							placeholder: '请填写设备名称',
+							filterable: true,
 							onChange: async (context: any) => {
 								// 当选择设备时,自动回填设备编号和设备名称
 								console.log("onChange context:", context);

+ 1 - 1
src/views/system/devicelabel/crud.tsx

@@ -138,7 +138,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				sort:{

+ 1 - 0
src/views/system/devicemaintenance/crud.tsx

@@ -202,6 +202,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					}),
 					form: {
 						component: { placeholder: '请选择设备名称',
+							filterable: true,
 							onChange: async (context: any) => {
 							// 当选择设备时,自动回填设备编号和设备名称
 							console.log("onChange context:", context);

+ 3 - 1
src/views/system/devicepreserve/crud.tsx

@@ -232,7 +232,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}),
 					form: {
 						show:true,
-						component: { placeholder: '请选择设备名称' },
+						component: { placeholder: '请选择设备名称',
+							filterable: true,
+						 },
 						rules: [{ required: true, message: '请选择设备名称' }],
 					},
 					viewForm:{

+ 3 - 1
src/views/system/devicepreserveplan/crud.tsx

@@ -225,7 +225,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}),
 					form: {
 						show:true,
-						component: { placeholder: '请选择设备名称' },
+						component: { placeholder: '请选择设备名称'
+							,filterable: true,
+						 },
 						rules: [{ required: true, message: '请选择设备名称' }],
 					},
 					viewForm:{

+ 12 - 12
src/views/system/studentInfo/crud.tsx

@@ -45,7 +45,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			actionbar: {
 				buttons: {
 					add: {
-						show: auth('area:Create'),
+						show: false,//auth('area:Create'),
 					},
 				},
 			},
@@ -99,15 +99,15 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				username:{
-					title:'账号名',
+					title:'用户名',
 					type:'input',
 					column: {
 						show: false,
 						minWidth: 120,
 					},
 					form: {
-						component: { placeholder: '请填写账号名' },
-						rules: [{ required: true, message: '请填写账号名' }],
+						component: { placeholder: '请填写用户名' },
+						rules: [{ required: true, message: '请填写用户名' }],
 					},
 					viewForm:{
 						component: { placeholder: '' },
@@ -270,15 +270,15 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					dict: dict({
 						data: [
 							{ label: '学生', value: 0 },
-							{ label: '教师', value: 1 },
+							/* { label: '教师', value: 1 },
 							{ label: '校外团体', value: 2 },
-							{ label: '学院领导', value: 3 },
+							{ label: '学院领导', value: 3 }, */
 						],
 					}),
 					form: {
 						value:0,
-						component: { placeholder: '请填写租户' },
-						rules: [{ required: false, message: '请填写租户' }],
+						component: { placeholder: '请选择用户' },
+						rules: [{ required: false, message: '请选择用户' }],
 					},
 				},
 				/* organization:{
@@ -331,7 +331,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '学院',
 					type: 'input',
 					search:{
-						show:true
+						show:false
 					},
 					column: {
 						show: true,
@@ -368,7 +368,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '专业',
 					type: 'input',
 					search:{
-						show:true
+						show:false
 					},
 					column: {
 						show: true,
@@ -397,7 +397,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '年级',
 					type: 'input',
 					search:{
-						show:true
+						show:false
 					},
 					column: {
 						show: true,
@@ -426,7 +426,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '班级',
 					type: 'input',
 				search:{
-						show:true
+						show:false
 					},
 					column: {
 						show: true,

+ 4 - 4
src/views/system/teacherInfor/crud.tsx

@@ -48,7 +48,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			actionbar: {
 				buttons: {
 					add: {
-						show: auth('area:Create'),
+						show: false,// auth('area:Create'),
 					},
 				},
 			},
@@ -87,15 +87,15 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 				},
 				username:{
-					title:'账号名',
+					title:'用户名',
 					type:'input',
 					column: {
 						show: false,
 						minWidth: 120,
 					},
 					form: {
-						component: { placeholder: '请填写账号名' },
-						rules: [{ required: true, message: '请填写账号名' }],
+						component: { placeholder: '请填写用户名' },
+						rules: [{ required: true, message: '请填写用户名' }],
 					},
 					viewForm:{
 						component: { placeholder: '' },