Browse Source

no message

kllay 21 hours ago
parent
commit
2605e10aec

+ 1 - 1
.env.development

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

+ 1 - 1
src/settings.ts

@@ -153,7 +153,7 @@ export default {
 
         setLogger({level: 'error'});
         // 设置自动染色
-        const dictComponentList = ['dict-cascader', 'dict-checkbox', 'dict-radio', 'dict-select', 'dict-switch', 'dict-tree'];
+        const dictComponentList = ['dict-cascader', 'dict-checkbox', 'dict-radio', 'dict-switch', 'dict-tree'];
         dictComponentList.forEach((val) => {
             getType(val).column.component.color = 'auto';
             getType(val).column.align = 'center';

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

@@ -14,16 +14,6 @@
 					</el-select>
 				</el-col>
 				
-
-				<!-- <el-col :span="3">
-					<el-button>手动输入</el-button>
-				</el-col> -->
-				<!-- <el-col :span="6">
-					<el-input v-model="form.course_input" placeholder="请输入课程名称" />
-				</el-col>
-				<el-col :span="3">
-					<el-button type="primary">搜索</el-button>
-				</el-col> -->
 			</el-row>
 			<div style="max-height: 400px; overflow-y: auto; border: 1px solid #eee; padding: 8px; margin-bottom:0px">
 				<timetablemanage />
@@ -95,6 +85,10 @@
 			</el-table>
 			<el-button type="primary" @click="addItem">添加设备</el-button>
 
+			<div style="margin: 16px 0 8px 0; font-weight: bold">配件信息</div>
+			<el-input v-model="form.accessory_info" placeholder="请输入配件信息"  :disabled="isView"/>
+
+
 			<!-- <div style="margin: 16px 0 8px 0; font-weight: bold">附件</div>
 			<el-upload
 			drag
@@ -121,37 +115,6 @@
 		</el-form>
 
 
-		<!-- 审批信息流程展示 -->
-		<div v-if="isView"  style="margin-top: 24px; padding: 0 12px">
-		<div style="font-weight: bold; margin-bottom: 12px">审批流程进度</div>
-		<el-steps :active="activeStep" align-center>
-			<el-step
-			title="创建申请"
-			:description="`创建时间:${ timeline.create }`"
-			icon="CircleCheck"
-			:status="activeStep >= 1 ? 'finish' : 'wait'"
-			/>
-			<el-step
-			title="待审批"
-			description="待超级管理员审批"
-			icon="CircleCheck"
-			:status="activeStep >= 2 ? 'finish' : 'wait'"
-			/>
-			<el-step
-			title="审批通过"
-			:description="`审批人:${timeline.approver},时间:${timeline.approve}`"
-			icon="CircleCheck"
-			:status="activeStep >= 3 ? 'finish' : 'wait'"
-			/>
-			<el-step
-			title="流程完成"
-			description="流程已结束"
-			icon="CircleCheck"
-			:status="activeStep >= 4 ? 'finish' : 'wait'"
-			/>
-		</el-steps>
-		</div>
-
 		<template #footer>
 			<el-button @click="onCancel">关闭</el-button>
 			<el-button v-if="!isViewMode" type="primary" @click="onSave">提交</el-button>
@@ -307,6 +270,7 @@ const form = ref({
 	borrow_type:1,
 	course_input: '',
 	attachments:'',
+	accessory_info:''
 });
 const showSelectDeviceDialog = ref(false);
 const isViewMode = computed(() => props.modelValue?.mode === 'view');
@@ -323,7 +287,7 @@ const rules = {
     { required: true, message: '请输入联系电话', trigger: 'change' },
   ],
   team_members_count: [
-  	{ required: true, message: '请输入团队人数', trigger: 'change' },
+	{ required: true, message: '请输入团队人数', trigger: 'change' },
 	{
 		validator: (_rule, value, callback) => {
 		if (value <= 1) {
@@ -389,6 +353,7 @@ function resetForm() {
     borrow_type: 1,
     course_input: '',
 	attachments:'',
+	accessory_info:''
   };
 }
 
@@ -402,19 +367,12 @@ watch(() => props.visible, (v) => {
 		console.log("快照lastFormSnapshot.value::",props.lastFormSnapshot )
 		form.value = { ...props.lastFormSnapshot };
     } else {
-		// console.log("没有快照lastFormSnapshot.value::",props.lastFormSnapshot )
       resetForm(); // 如果没有快照,初始化表单
     }
   }
 }, { immediate: true });
 
 
-const timeline = ref({
-  create: '',
-  approve: '',
-  approver: ''
-});
-const activeStep = ref(1);
 
 watch(() => props.modelValue, async (val) => {
   if (val && val.id && isView.value) {
@@ -423,17 +381,9 @@ watch(() => props.modelValue, async (val) => {
 			if (res.code === 2000 && res.data) {
 				const data = res.data;
 				Object.assign(form.value, data);
-				timeline.value.create = data.create_datetime || '';
-				timeline.value.approve = data.approve_time || '';
-				timeline.value.approver = data.approver_info?.name || '审批人';
-
-				activeStep.value = 1; // 创建
-				if (data.status >= 1) activeStep.value = 2; // 待审批
-				if (data.status >= 2) activeStep.value = 3; // 审批通过
-				if (data.status >= 3) activeStep.value = 4; // 完成
 			}
 			} catch (e) {
-			ElMessage.error('获取审批信息失败');
+			ElMessage.error('获取详细信息失败');
 			}
 	}else if(val&& isEdit.value){
 		try {
@@ -443,7 +393,7 @@ watch(() => props.modelValue, async (val) => {
 				Object.assign(form.value, data);
 			}
 			} catch (e) {
-			ElMessage.error('获取审批信息失败');
+			ElMessage.error('获取详细信息失败');
 			}
 	}
 }, { immediate: true });
@@ -452,6 +402,9 @@ function addItem() {
 	showSelectDeviceDialog.value = true;
 }
 function onDeviceSelected(devices) {
+	if (!form.value.items) {
+    form.value.items = [];
+  }
 	form.value.items.push(
 		...devices.map((d) => ({
 			device_category: d.category,

+ 2 - 2
src/views/system/borrow/index.vue

@@ -44,7 +44,7 @@ const showSettlementDialog = ref(false);
 
 
 
-// const lastFormSnapshot = ref({});
+const lastFormSnapshot = ref({});
 // provide('lastFormSnapshot', lastFormSnapshot);
 
 
@@ -161,7 +161,7 @@ onMounted(() => {
 	}
 
 	// 先尝试插入一次
-	insertButton();
+	// insertButton();
 
 	// 监听 DOM 变化,确保 actionbar 出现时插入按钮
 	observer = new MutationObserver(() => {

+ 2 - 2
src/views/system/borrow/workflow/curd.tsx

@@ -22,7 +22,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 	};
 	const editRequest = async ({ form, row }: EditReq) => {
 		form.id = row.id;
-		return await api.UpdateObj(form);
+		return await api.UpdateObj(row.id,form);
 	};
 	const delRequest = async ({ row }: DelReq) => {
 		return await api.DelObj(row.id);
@@ -44,7 +44,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					add: { show: false ,text: '创建审批流',}, // 关闭 fast-crud 自带新增按钮
 				},
 			},
-			search:{show:false},
+			search:{show:true},
 			toolbar:{show:false},
 			rowHandle: {
 				fixed: 'right',

+ 24 - 12
src/views/system/device/crud.tsx

@@ -156,20 +156,32 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				// },
 				"inventory.borrowed_quantity":{
 						title: '设备状态',
-						type: 'dict-select',
+						type: 'text',
 						search: { show: false },
-						dict: dict({
-							data: [
-								{ label: '在借', value: 1 },
-								{ label: '空闲', value: 0 },
-							],
-							getData: (dict) => {
-								return (value) => {
-									return value > 0 ? '在借' : '空闲';
-								}
+						column: {
+							show: true,
+							minWidth: 100,
+							formatter: ({ row }) => {
+								const isBorrowed = row.borrowed_quantity > 0;
+								const label = isBorrowed ? '在借' : '空闲';
+								const color = isBorrowed ? '#FFA500' : '#4CAF50';
+								return h(
+									'span',
+									{
+										style: {
+										display: 'inline-block',
+										padding: '2px 8px',
+										border: `1px solid ${color}`,
+										borderRadius: '4px',
+										backgroundColor: color,
+										color: 'white',
+										fontWeight: 'bold',
+										}
+									},
+									label
+									);
 							}
-						}),
-						column: { show:true, minWidth: 100 },
+						},
 						form: {
 							show:false,
 							component: { placeholder: '请选择设备状态' },

+ 16 - 15
src/views/system/deviceclass/api.ts

@@ -1,4 +1,4 @@
-import { AddReq, UserPageQuery } from '@fast-crud/fast-crud';
+import { AddReq, UserPageQuery,InfoReq, EditReq,DelReq} from '@fast-crud/fast-crud';
 import { request } from '/@/utils/service';
 
 export const apiPrefix = '/api/system/device/category/';
@@ -24,21 +24,22 @@ export function AddObj(obj: AddReq) {
 	});
 }
 
-// export function UpdateObj(obj: EditReq) {
-// 	return request({
-// 		url: apiPrefix + obj.id + '/',
-// 		method: 'put',
-// 		data: obj,
-// 	});
-// }
+export function UpdateObj(obj: EditReq) {
+	return request({
+		url: apiPrefix + obj.id + '/',
+		method: 'put',
+		data: obj,
+	});
+}
+
+export function DelObj(id: DelReq) {
+	return request({
+		url: apiPrefix + id + '/',
+		method: 'delete',
+		data: { id },
+	});
+}
 
-// export function DelObj(id: DelReq) {
-// 	return request({
-// 		url: apiPrefix + id + '/',
-// 		method: 'delete',
-// 		data: { id },
-// 	});
-// }
 export function GetPermission() {
     return request({
         url: apiPrefix,

+ 12 - 8
src/views/system/deviceclass/crud.tsx

@@ -11,13 +11,13 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 		return await api.GetObj(row.id);
 	};
 
-	// const editRequest = async ({ form, row }: EditReq) => {
-	// 	form.id = row.id;
-	// 	return await api.UpdateObj(form);
-	// };
-	// const delRequest = async ({ row }: DelReq) => {
-	// 	return await api.DelObj(row.id);
-	// };
+	const editRequest = async ({ form, row }: EditReq) => {
+		form.id = row.id;
+		return await api.UpdateObj(form);
+	};
+	const delRequest = async ({ row }: DelReq) => {
+		return await api.DelObj(row.id);
+	};
 	const addRequest = async ({ form }: AddReq) => {
 		return await api.AddObj(form);
 	};
@@ -27,6 +27,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			request: {
 				pageRequest,
 				addRequest,
+				editRequest,
+				delRequest,
 				getDetail,
 			},
 			toolbar:{
@@ -35,7 +37,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			rowHandle:{
 				buttons:{
 					remove:{
-						show:false,
+						show:true,
 					},
 					edit:{
 						show:false,
@@ -125,6 +127,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						value:1,
+						show:false,
 						component: { placeholder: '请填写排序' },
 						rules: [{ required: true, message: '请填写排序' }],
 					},

+ 16 - 15
src/views/system/devicelabel/api.ts

@@ -1,4 +1,4 @@
-import { AddReq, UserPageQuery } from '@fast-crud/fast-crud';
+import { AddReq,EditReq, DelReq,UserPageQuery } from '@fast-crud/fast-crud';
 import { request } from '/@/utils/service';
 
 export const apiPrefix = '/api/system/device_tags/';
@@ -24,21 +24,22 @@ export function AddObj(obj: AddReq) {
 	});
 }
 
-// export function UpdateObj(obj: EditReq) {
-// 	return request({
-// 		url: apiPrefix + obj.id + '/',
-// 		method: 'put',
-// 		data: obj,
-// 	});
-// }
+export function UpdateObj(obj: EditReq) {
+	return request({
+		url: apiPrefix + obj.id + '/',
+		method: 'put',
+		data: obj,
+	});
+}
+
+export function DelObj(id: DelReq) {
+	return request({
+		url: apiPrefix + id + '/',
+		method: 'delete',
+		data: { id },
+	});
+}
 
-// export function DelObj(id: DelReq) {
-// 	return request({
-// 		url: apiPrefix + id + '/',
-// 		method: 'delete',
-// 		data: { id },
-// 	});
-// }
 export function GetPermission() {
     return request({
         url: apiPrefix,

+ 15 - 9
src/views/system/devicelabel/crud.tsx

@@ -2,17 +2,18 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery } f
 import * as api from './api';
 import { auth } from '/@/utils/authFunction';
 
+
 export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
 	const pageRequest = async (query: UserPageQuery) => {
 		return await api.GetList(query);
 	};
-	// const editRequest = async ({ form, row }: EditReq) => {
-	// 	form.id = row.id;
-	// 	return await api.UpdateObj(form);
-	// };
-	// const delRequest = async ({ row }: DelReq) => {
-	// 	return await api.DelObj(row.id);
-	// };
+	const editRequest = async ({ form, row }: EditReq) => {
+		form.id = row.id;
+		return await api.UpdateObj(form);
+	};
+	const delRequest = async ({ row }: DelReq) => {
+		return await api.DelObj(row.id);
+	};
 	const addRequest = async ({ form }: AddReq) => {
 		return await api.AddObj(form);
 	};
@@ -22,6 +23,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			request: {
 				pageRequest,
 				addRequest,
+				editRequest,
+				delRequest,
+
 			},
 			actionbar: {
 				buttons: {
@@ -36,10 +40,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			rowHandle:{
 				buttons:{
 					remove:{
-						show:false,
+						show:true,
 					},
 					edit:{
-						show:false,
+						show:true,
 					}
 
 				}
@@ -109,6 +113,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						value:1,
+						show:false,
 						component: { placeholder: '请填写排序' },
 						rules: [{ required: false, message: '请填写排序' }],
 					},