kllay 5 dagar sedan
förälder
incheckning
f1d81d61f2

+ 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/views/system/borrow/approval/SpecialBorrowApp/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<el-dialog v-model="visible" title="借用申请单" width="75%" :close-on-click-modal="false" @close="onCancel">
+	<el-dialog v-model="visible" title="查看" width="75%" :close-on-click-modal="false" @close="onCancel">
 		<el-form :model="form" label-width="110px" label-position="top" :rules="rules" ref="formRef">
 			<el-row :gutter="16">
 				<el-col :span="8">

+ 1 - 1
src/views/system/borrow/approval/curd.tsx

@@ -218,7 +218,7 @@ export const createCrudOptions = function ({ crudExpose ,context, showRejectDial
 				},
 				emergency_contact: {
 					title: '借用人',
-					search: { show: true },
+					search: { show: false },
 					type: 'input',
 					column: { show:false, minWidth: 120 },
 					form: {

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

@@ -364,7 +364,7 @@ const rules = {
     { required: true, message: '请输入借用原因', trigger: 'change' },
   ],
   applicant_remark: [
-    { required: true, message: '请输入备注', trigger: 'change' },
+    { required: false, message: '请输入备注', trigger: 'change' },
   ],
 };
 

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

@@ -1,5 +1,5 @@
 <template>
-	<el-dialog v-model="visible" :title="isView ? '借用单详情' : isCollect ? '领取' : '归还'" width="75%" :close-on-click-modal="false" @close="onCancel">
+	<el-dialog v-model="visible" :title="isView ? '查看' : isCollect ? '领取' : '归还'" width="75%" :close-on-click-modal="false" @close="onCancel">
         <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
             <el-tab-pane label="借用单信息" name="first">       
                 <el-form :model="form" label-width="110px" label-position="top" :rules="rules" ref="formRef">

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

@@ -348,7 +348,7 @@ const rules = {
     { required: true, message: '请选择审批人', trigger: 'change' },
   ],
   applicant_remark: [
-    { required: true, message: '请输入备注', trigger: 'change' },
+    { required: false, message: '请输入备注', trigger: 'change' },
   ],
 };
 

+ 1 - 1
src/views/system/borrow/workflow/WorkflowDialog/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-dialog
-		:title="editData ? (props.mode === 'view' ? '查看审批流程' : '编辑审批流程') : '新建审批流程'"
+		:title="editData ? (props.mode === 'view' ? '查看' : '编辑') : '新建审批流程'"
 		v-model="visible"
 		width="900px"
 		@close="onCancel"

+ 48 - 0
src/views/system/devicemaintenance/api.ts

@@ -0,0 +1,48 @@
+import { AddReq,EditReq, DelReq,UserPageQuery } from '@fast-crud/fast-crud';
+import { request } from '/@/utils/service';
+
+export const apiPrefix = '/api/system/device-damage-records/';
+export function GetList(query: UserPageQuery) {
+	return request({
+		url: apiPrefix,
+		method: 'get',
+		params: query,
+	});
+}
+// export function GetObj(id: InfoReq) {
+// 	return request({
+// 		url: apiPrefix + id,
+// 		method: 'get',
+// 	});
+// }
+
+export function AddObj(obj: AddReq) {
+	return request({
+		url: apiPrefix,
+		method: 'post',
+		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 GetPermission() {
+    return request({
+        url: apiPrefix,
+        method: 'get',
+    });
+}

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

@@ -0,0 +1,229 @@
+import { AddReq, CreateCrudOptionsProps,dict, CreateCrudOptionsRet, UserPageQuery } from '@fast-crud/fast-crud';
+import * as api from './api';
+import { auth } from '/@/utils/authFunction';
+import { ja } from 'element-plus/es/locale';
+
+
+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 addRequest = async ({ form }: AddReq) => {
+		return await api.AddObj(form);
+	};
+
+	return {
+		crudOptions: {
+			request: {
+				pageRequest,
+				addRequest,
+				editRequest,
+				delRequest,
+
+			},
+			form:{
+				wrapper: {
+					buttons: {
+						ok:{
+							text:'提交'
+						}
+					}
+				}
+			},
+			actionbar: {
+				buttons: {
+					add: {
+						show: auth('area:Create'),
+					},
+				},
+			},
+			toolbar:{
+				show:false,
+			},
+			rowHandle:{
+				buttons:{
+					remove:{
+						show:true,
+					},
+					edit:{
+						show:true,
+					}
+
+				}
+
+			},
+			pagination: {
+				show: false,
+			},		
+			columns: {
+				_index: {
+					title: '序号',
+					form: { show: false },
+					column: {
+						type: 'index',
+						align: 'center',
+						width: '70px',
+						columnSetDisabled: true, //禁止在列设置中选择
+					},
+				},
+				damage_no: {
+					title: '编号',
+					search: {
+						show: true,
+					},
+					treeNode: true,
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						show:false,
+						// rules: [
+						// 	// 表单校验规则
+						// 	// { required: true, message: '名称必填项' },
+						// ],
+						component: {
+							placeholder: '请输入编号',
+						},
+					},
+				},
+				device:{
+					title: '设备id',
+					type: 'dict-select',
+					column: {
+						show:false,
+						minWidth: 120,
+					},
+					dict: dict({
+						url: '/api/system/device/',
+						value: 'id',
+						label: 'name',
+					}),
+					form: {
+						component: { placeholder: '请填写设备id' },
+						rules: [{ required: true, message: '请填写设备id' }],
+					},
+				},
+				device_code:{
+					title: '设备编码',
+					type: 'input',
+					column: {
+						show:false,
+						minWidth: 120,
+					},
+					form: {
+						show:false,
+						component: { placeholder: '请填写设备编码' },
+						rules: [{ required: true, message: '请填写设备编码' }],
+					},
+				},
+				device_name:{
+					title: '设备名称',
+					type: 'input',
+					column: {
+						show:true,
+						minWidth: 120,
+					},
+					form: {
+						show:false,
+						component: { placeholder: '请填写设备名称' },
+						rules: [{ required: true, message: '请填写设备名称' }],
+					},
+				},
+				quantity:{
+					title: '库存数量',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						component: { placeholder: '请填写库存数量' },
+						rules: [{ required: false, message: '请填写库存数量' }],
+					},
+					valueResolve({ form, value }) {
+						form.quantity = Number(value);
+					},
+				},
+				damage_type:{
+					title: '维修类型',
+					type: 'dict-select',
+					dict: dict({
+						data: [
+							{ label: '报废', value: 0 },
+							{ label: '维修', value: 1 },
+						],
+					}),
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						value:1,
+						show:true,
+						component: { placeholder: '请填写排序' },
+						rules: [{ required: false, message: '请填写排序' }],
+					},
+				},
+				damage_reason:{
+					title: '报损原因',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						component: { placeholder: '请填写报损原因' },
+						rules: [{ required: false, message: '请填写报损原因' }],
+					},
+				},
+				estimated_loss:{
+					title: '预估维修费用',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						component: { placeholder: '请填写预估维修费用' },
+						rules: [{ required: false, message: '请填写预估维修费用' }],
+					},
+				},
+				responsible_person:{
+					title: '负责人',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						component: { placeholder: '请填写负责人' },
+						rules: [{ required: false, message: '请填写负责人' }],
+					},
+				},
+				status_display:{
+					title: '状态',
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						show:false,
+						component: { placeholder: '请填写负责人' },
+						rules: [{ required: false, message: '请填写负责人' }],
+					},
+				},
+
+
+
+
+
+
+
+
+			},
+		},
+	};
+};

+ 28 - 0
src/views/system/devicemaintenance/index.vue

@@ -0,0 +1,28 @@
+<template>
+	<fs-page>
+		<fs-crud ref="crudRef" v-bind="crudBinding"> </fs-crud>
+		<!-- <template #form-header-right>
+        <el-tag color="danger">form-header-right插槽</el-tag>
+      </template> -->
+	</fs-page>
+</template>
+
+<script lang="ts" setup name="devicemaintenance">
+import { useFs } from '@fast-crud/fast-crud';
+import { onMounted } from 'vue';
+import { GetPermission } from './api';
+import { createCrudOptions } from './crud';
+import { handleColumnPermission } from '/@/utils/columnPermission';
+
+const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ createCrudOptions });
+
+// 页面打开后获取列表数据
+onMounted(async () => {
+	// 设置列权限
+	const newOptions = await handleColumnPermission(GetPermission, crudOptions);
+	//重置crudBinding
+	resetCrudOptions(newOptions);
+	// 刷新
+	crudExpose.doRefresh();
+});
+</script>