Przeglądaj źródła

修改部分内容

yangg 2 tygodni temu
rodzic
commit
31c0a666aa

+ 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
index.html

@@ -12,7 +12,7 @@
 			name="description"
 			content="django-vue-admin 基于RBAC模型的权限控制的一整套基础开发平台,权限粒度达到列级别,前后端分离,后端采用django + django-rest-framework,前端采用基于 vue3 + CompositionAPI + typescript + vite + element plus"
 		/>
-		<link rel="icon" href="/favicon.ico" />
+		<link rel="icon" href="/public/facivon.ico" />
 		<title>django-vue-admin</title>
 		<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
 	</head>

BIN
public/facivon.ico


+ 1 - 1
src/views/system/Inventorycount/InventoryDetailDialog/index.vue

@@ -19,7 +19,7 @@
 			<el-table-column prop="device_code" label="设备编号" min-width="140" />
 			<el-table-column prop="device_name" label="设备名称" min-width="140" />
 			<el-table-column prop="device_category" label="分类" min-width="120" />
-			<el-table-column prop="device_unit" label="单位" width="80" />
+			<!-- <el-table-column prop="device_unit" label="单位" width="80" /> -->
 			<el-table-column prop="original_quantity" label="原数量" width="90" />
 			<el-table-column prop="scanned_quantity" label="实盘数量" width="100" />
 			<el-table-column prop="difference" label="差异" width="80" />

+ 4 - 0
src/views/system/Inventorycount/InventoryDialog/index.vue

@@ -11,6 +11,8 @@
           <el-table-column type="index" label="序号" width="60" />
           <!-- <el-table-column prop="id" label="盘点id" width="60" /> -->
           <el-table-column prop="device_code" label="设备编号" />
+          <el-table-column prop="device_name" label="设备名称" />
+          <el-table-column prop="device_category" label="设备分类" />
           <el-table-column prop="check_no" label="盘点编号" />
           <el-table-column prop="status_display" label="状态" />
           <!-- <el-table-column prop="productName" label="商品名称" /> -->
@@ -78,6 +80,8 @@
                   productName: res.data?.productName || '未知商品',
                   id: record?.id||0,
                   status_display:record?.status_display||'',
+                  device_name: res.data?.device_name || '未知设备',
+                  device_category: res.data?.device_category || '未知分类',
               });
               device_code.value = '';
               currentRecordId.value = record?.id ?? null;

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

@@ -540,9 +540,9 @@ const rules = {
 		trigger: 'change'
 	}
 	],
-  borrower_dept: [
+ /*  borrower_dept: [
     { required: true, message: '请输入借用部门', trigger: 'change' },
-  ],
+  ], */
   expected_end_time: [
     { required: true, message: '请输选择归还时间', trigger: 'change' },
   ],
@@ -583,6 +583,52 @@ watch(() => form.value.app_user_borrower, (newValue) => {
     if (selectedUser) {
       form.value.user_code = selectedUser.user_code || '';
 	  form.value.mobile = selectedUser.mobile || '';
+	  // 根据用户类型动态设置借用部门:
+	  // 学生(user_type===0):学院/专业/班级;教师或领导(user_type===1或3):学院
+	  let deptName: string = '';
+	  const orgDetail: any = (selectedUser as any).organization_detail || {};
+	  const parentChain: any[] = Array.isArray(orgDetail.parent_chain) ? orgDetail.parent_chain : [];
+	  const isValid = (val: any) => {
+		const s = String(val).trim();
+		return val !== null && val !== undefined && s !== '' && s.toLowerCase() !== 'nan' && !Number.isNaN(val);
+	  };
+	  if ((selectedUser as any).user_type === 0) {
+		// 学生:优先按 parent_chain 顺序拼接“学院/专业/班级”,过滤掉“学校”层级
+		const chainNames: string[] = parentChain
+		  .filter((n: any) => Number(n?.type) !== 1) // 1=学校,过滤
+		  .map((n: any) => n?.name)
+		  .filter((n: any) => isValid(n));
+		// 取前3级:学院(0)/专业(1)/班级(2)
+		const college = chainNames[1] || '';
+		const major = chainNames[2] || (selectedUser as any).sub_organization || '';
+		const clazz = orgDetail.name || (selectedUser as any).class_or_group || '';
+		const parts = [college, major, clazz].filter((p) => isValid(p));
+		deptName = parts.join('/');
+		if (!deptName) {
+		  // 兜底:若 parent_chain 不可用,则使用已有汇总字段但尽量去掉“学校/”前缀
+		  const full = (selectedUser as any).full_organization_name || '';
+		  deptName = full.replace(/^学校\s*\/\s*/,'');
+		  // 兜底后继续清洗 'nan' 与空白段
+		  deptName = deptName
+		    .split('/')
+		    .map((s: string) => s.trim())
+		    .filter((s: string) => isValid(s))
+		    .join('/');
+		}
+		// 最终统一清洗,避免出现重复斜杠或 'nan'
+		deptName = deptName
+		  .split('/')
+		  .map((s: string) => s.trim())
+		  .filter((s: string) => isValid(s))
+		  .join('/');
+	  } else if ((selectedUser as any).user_type === 1 || (selectedUser as any).user_type === 3) {
+		// 教师或学院领导:显示学院名称
+		deptName = orgDetail?.name || (selectedUser as any).organization || (selectedUser as any).full_organization_name || '';
+	  } else {
+		// 其他类型兜底
+		deptName = (selectedUser as any).full_organization_name || '';
+	  }
+	  form.value.borrower_dept = isValid(deptName)?deptName:'';
 	  
 	  // 如果是新创建的用户,提示用户填写完整信息
 	  if (selectedUser.isNew) {

+ 7 - 0
src/views/system/borrow/component/CollectEquipment/SettlementDialog.vue

@@ -87,6 +87,7 @@
           <div class="detail-title">备注</div>
           <div class="form-content">{{ formData.remark || '-' }}</div>
         </div>
+
         <div v-if="isrenew">
           <div style="margin-bottom: 8px; font-weight: bold;">续借时间(天)</div>
           <input
@@ -107,6 +108,12 @@
 
 
 
+        </div>
+        <div v-else>
+          <div style="margin-bottom: 8px; font-weight: bold;">续借时间(天)</div>
+          <div class="form-content">{{ formData.renewal_days || '-' }}</div>
+          <div style="margin-bottom: 8px; font-weight: bold;">续借理由</div>
+          <div class="form-content">{{ formData.return_remark || '-' }}</div>
         </div>
       </el-form>
     </div>

+ 20 - 14
src/views/system/borrow/component/CollectEquipment/index.vue

@@ -316,9 +316,9 @@
                             </el-table-column>
                             <el-table-column label="操作" width="150" align="center">
                                 <template #default="{ $index,row }">
-                                 
+                                 <!--  && (!returnDeviceList[$index]?.condition || returnDeviceList[$index]?.photos?.length==0)&& row.problem_records?.length ==0 -->
                                   <el-button :disabled="isView" type="text" style="color: red"  
-                                   v-if="!isView && (!returnDeviceList[$index]?.condition || returnDeviceList[$index]?.photos?.length==0)&& row.problem_records?.length ==0"
+                                   v-if="!isView"
                                   @click="handleAbnormal($index)">异常操作</el-button>
                                   <el-button 
                                     
@@ -561,20 +561,26 @@ 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 isRejected = status === 3 || (typeof statusLabel === 'string' && statusLabel.includes('拒绝'));
+  if (isRejected) {
+    return true;
+  }
+
+  // 强制显示:状态大于 5 或状态标签为“已借出”
+  if ((typeof status === 'number' && status > 5) || statusLabel === '已借出') {
+    return false;
+  }
+
+  // 待审批状态:隐藏设备清单
+  const isPendingApproval = status < 2 || statusLabel === '待审批';
+
+  // 其他情况默认显示
+  return isPendingApproval;
 });
 
 const emit = defineEmits(['update:visible', 'update:modelValue', 'submit']);

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

@@ -356,7 +356,7 @@ function createNewUser(query: string) {
 		mobile: '',
 		isNew: true // 标记为新创建的用户
 	};
-	
+
 	// 添加到用户列表
 	allUserList.value.unshift(newUser);
 	filteredUserList.value = allUserList.value;
@@ -514,8 +514,8 @@ const form = ref({
 	external_borrower_phone:"",
 	emergency_contact: '111',
 	emergency_phone: '11111',
-	app_user_borrower: null,
-	admin_borrower: null,
+	app_user_borrower: null as number | null,
+	admin_borrower: null as number | null,
 	team_type: 0,
 	team_members_count: 2,
 	team_members: '',
@@ -532,6 +532,7 @@ const form = ref({
 	attachments:'',
 	user_code: '',
 	mobile: '',
+	mode: '' as 'add' | 'edit' | 'view' | '',
 });
 const showSelectDeviceDialog = ref(false);
 
@@ -579,7 +580,6 @@ onMounted(() => {
 			form.value.external_borrower_name = userInfo.username || '';
 			form.value.app_user_borrower =  null;/* Number(userInfo.dept_info?.dept_id )|| */
 			form.value.external_borrower_phone = userInfo.mobile || '';
-			form.value.borrower_dept = userInfo.dept_info?.dept_name || '';
 		}
 	} catch (e) {
 		/* empty */
@@ -631,7 +631,52 @@ watch(() => form.value.app_user_borrower, (newValue) => {
     if (selectedUser) {
       form.value.user_code = selectedUser.user_code || '';
 	  form.value.mobile = selectedUser.mobile || '';
-	  
+	  // 根据用户类型动态设置借用部门:
+	  // 学生(user_type===0):学院/专业/班级;教师或领导(user_type===1或3):学院
+	  let deptName: string = '';
+	  const orgDetail: any = (selectedUser as any).organization_detail || {};
+	  const parentChain: any[] = Array.isArray(orgDetail.parent_chain) ? orgDetail.parent_chain : [];
+	  const isValid = (val: any) => {
+		const s = String(val).trim();
+		return val !== null && val !== undefined && s !== '' && s.toLowerCase() !== 'nan' && !Number.isNaN(val);
+	  };
+	  if ((selectedUser as any).user_type === 0) {
+		// 学生:优先按 parent_chain 顺序拼接“学院/专业/班级”,过滤掉“学校”层级
+		const chainNames: string[] = parentChain
+		  .filter((n: any) => Number(n?.type) !== 1) // 1=学校,过滤
+		  .map((n: any) => n?.name)
+		  .filter((n: any) => isValid(n));
+		// 取前3级:学院(0)/专业(1)/班级(2)
+		const college = chainNames[1] || '';
+		const major = chainNames[2] || (selectedUser as any).sub_organization || '';
+		const clazz = orgDetail.name || (selectedUser as any).class_or_group || '';
+		const parts = [college, major, clazz].filter((p) => isValid(p));
+		deptName = parts.join('/');
+		if (!deptName) {
+		  // 兜底:若 parent_chain 不可用,则使用已有汇总字段但尽量去掉“学校/”前缀
+		  const full = (selectedUser as any).full_organization_name || '';
+		  deptName = full.replace(/^学校\s*\/\s*/,'');
+		  // 兜底后继续清洗 'nan' 与空白段
+		  deptName = deptName
+		    .split('/')
+		    .map((s: string) => s.trim())
+		    .filter((s: string) => isValid(s))
+		    .join('/');
+		}
+		// 最终统一清洗,避免出现重复斜杠或 'nan'
+		deptName = deptName
+		  .split('/')
+		  .map((s: string) => s.trim())
+		  .filter((s: string) => isValid(s))
+		  .join('/');
+	  } else if ((selectedUser as any).user_type === 1 || (selectedUser as any).user_type === 3) {
+		// 教师或学院领导:显示学院名称
+		deptName = orgDetail?.name || (selectedUser as any).organization || (selectedUser as any).full_organization_name || '';
+	  } else {
+		// 其他类型兜底
+		deptName = (selectedUser as any).full_organization_name || '';
+	  }
+	  form.value.borrower_dept = isValid(deptName)?deptName:'';
 	  // 如果是新创建的用户,提示用户填写完整信息
 	  if (selectedUser.isNew) {
 		ElMessage.info('请为新用户填写学号/工号和联系电话');

+ 32 - 10
src/views/system/timetablemanage/index.vue

@@ -5,14 +5,14 @@
 		<div class="schedule-wrapper">
 			<div class="header">
 				<div class="header-bar">
-				<el-button type="primary" icon="el-icon-arrow-left" @click="prevWeek" circle ><</el-button>
+				<el-button type="primary" :icon="ArrowLeft" @click="prevWeek" circle />
 				<span class="week-display">{{ displayWeek }} 周</span>
-				<el-button type="primary" icon="el-icon-arrow-right" @click="nextWeek" circle
-							:disabled="currentWeek + weekOffset >= totalWeeks" >></el-button>
+				<el-button type="primary" :icon="ArrowRight" @click="nextWeek" circle
+							:disabled="currentWeek + weekOffset >= totalWeeks" />
 
 				</div>
-				<div>
-					<el-button type="success" icon="el-icon-plus" @click="openDialog()">添加课程</el-button>
+				<div><!-- :icon="Plus" -->
+					<el-button type="success"  @click="openDialog()">添加课程</el-button>
 				</div>
 
 			</div>
@@ -96,10 +96,12 @@ import { handleColumnPermission } from '/@/utils/columnPermission';
 import AdditionDialog from './AdditionDialog/index.vue';
 import { inject } from 'vue';
 import { ElMessage } from 'element-plus';
+import { ArrowLeft, ArrowRight, Plus} from '@element-plus/icons-vue';
 
 
-const isEmbedded = inject('isEmbedded', false);
-const onCourseSelected = inject('onCourseSelected', () => {});
+const isEmbedded = inject<boolean>('isEmbedded', false);
+type CourseSelectedPayload = { course_id: string | number; course_Name: string; expected_start_time: string };
+const onCourseSelected = inject<(payload: CourseSelectedPayload) => void>('onCourseSelected');
 
 
 
@@ -172,12 +174,12 @@ async function deleteCourse(courseId: number) {
 
 
 function getStartTime(time: number): string {
-  const timeMap = {
+  const timeMap: Record<number, string> = {
     1: '09:00:00',
     2: '14:00:00',
     3: '19:00:00'
   };
-  return timeMap[time] || '09:00';
+  return timeMap[time] ?? '09:00:00';
 }
 
 
@@ -196,7 +198,7 @@ function openDialogEdit(course?: any) {
 	// console.log("expectedStartTime:::",expectedStartTime)
 	// eslint-disable-next-line no-console
 	// console.log("courseName:::",courseName)
-  if (isEmbedded && typeof onCourseSelected === 'function') {
+  if (isEmbedded && typeof onCourseSelected === 'function' && onCourseSelected) {
 	
 	try {
       onCourseSelected({
@@ -286,4 +288,24 @@ onMounted(async () => {
 }
 
 
+:deep(.el-button.is-circle) {
+  width: 36px;
+  height: 36px;
+  padding: 0;
+}
+
+:deep(.el-button .el-icon) {
+  font-size: 18px;
+}
+
+.schedule-table :deep(.el-table__cell) {
+  padding-top: 12px;
+  padding-bottom: 12px;
+  font-size: 14px;
+}
+
+.schedule-table :deep(.el-table__header .cell) {
+  font-size: 15px;
+}
+
 </style>