| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 出差时间(仅当 approveType 为 3 时显示) --> |
| | | <el-row :gutter="30" v-if="props.approveType == 3"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="出差开始时间:" prop="startDateTime"> |
| | | <el-date-picker |
| | | v-model="form.startDateTime" |
| | | type="datetime" |
| | | placeholder="请选择开始时间" |
| | | value-format="YYYY-MM-DD HH:mm" |
| | | format="YYYY-MM-DD HH:mm" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="出差结束时间:" prop="endDateTime"> |
| | | <el-date-picker |
| | | v-model="form.endDateTime" |
| | | type="datetime" |
| | | placeholder="请选择结束时间" |
| | | value-format="YYYY-MM-DD HH:mm" |
| | | format="YYYY-MM-DD HH:mm" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 出差地点(仅当 approveType 为 3 时显示) --> |
| | | <el-row v-if="props.approveType == 3"> |
| | | <el-col :span="24"> |
| | |
| | | startDate: "", // 请假开始时间 |
| | | endDate: "", // 请假结束时间 |
| | | price: null, // 报销金额 |
| | | startDateTime: "", // 出差开始时间 |
| | | endDateTime: "", // 出差结束时间 |
| | | location: "", // 出差地点 |
| | | storageBlobDTOS: [] |
| | | }, |
| | |
| | | startDate: [{ required: true, message: "请选择请假开始时间", trigger: "change" }], |
| | | endDate: [{ required: true, message: "请选择请假结束时间", trigger: "change" }], |
| | | price: [{ required: true, message: "请输入报销金额", trigger: "blur" }], |
| | | startDateTime: [{ required: true, message: "请选择出差开始时间", trigger: "change" }], |
| | | endDateTime: [{ required: true, message: "请选择出差结束时间", trigger: "change" }], |
| | | location: [{ required: true, message: "请输入出差地点", trigger: "blur" }], |
| | | }, |
| | | }); |
| | |
| | | return |
| | | } |
| | | } |
| | | // 当 approveType 为 3 时,校验出差地点 |
| | | // 当 approveType 为 3 时,校验出差时间和地点 |
| | | if (props.approveType == 3) { |
| | | if (!form.value.startDateTime) { |
| | | proxy.$modal.msgError("请选择出差开始时间!") |
| | | return |
| | | } |
| | | if (!form.value.endDateTime) { |
| | | proxy.$modal.msgError("请选择出差结束时间!") |
| | | return |
| | | } |
| | | if (new Date(form.value.endDateTime) < new Date(form.value.startDateTime)) { |
| | | proxy.$modal.msgError("出差结束时间不能早于开始时间!") |
| | | return |
| | | } |
| | | if (!form.value.location || form.value.location.trim() === '') { |
| | | proxy.$modal.msgError("请输入出差地点!") |
| | | return |
| | |
| | | // 动态表格列配置,根据审批类型生成列 |
| | | const tableColumnCopy = computed(() => { |
| | | const isLeaveType = currentApproveType.value === 2; // 请假管理 |
| | | const isBusinessTripType = currentApproveType.value === 3; // 出差管理 |
| | | const isReimburseType = currentApproveType.value === 4; // 报销管理 |
| | | const isQuotationType = currentApproveType.value === 6; // 报价审批 |
| | | const isPurchaseType = currentApproveType.value === 5; // 采购审批 |
| | |
| | | width: 120 |
| | | }); |
| | | } |
| | | |
| | | // 请假管理:开始日期 / 结束日期 |
| | | if (isLeaveType) { |
| | | baseColumns.push( |
| | | { label: "开始日期", prop: "startDate", width: 120 }, |
| | | { label: "结束日期", prop: "endDate", width: 120 } |
| | | ); |
| | | } |
| | | |
| | | // 日期列(根据类型动态配置) |
| | | baseColumns.push( |
| | | { |
| | | label: isLeaveType ? "开始日期" : "申请日期", |
| | | prop: isLeaveType ? "startDate" : "approveTime", |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: "结束日期", |
| | | prop: isLeaveType ? "endDate" : "approveOverTime", |
| | | width: 120 |
| | | } |
| | | ); |
| | | // 出差管理:开始时间 / 结束时间(不含秒) |
| | | if (isBusinessTripType) { |
| | | baseColumns.push( |
| | | { |
| | | label: "开始时间", |
| | | prop: "startDateTime", |
| | | width: 180, |
| | | formatData: (val) => val ? val.substring(0, 16) : '' |
| | | }, |
| | | { |
| | | label: "结束时间", |
| | | prop: "endDateTime", |
| | | width: 180, |
| | | formatData: (val) => val ? val.substring(0, 16) : '' |
| | | } |
| | | ); |
| | | } |
| | | |
| | | // 当前审批人列 |
| | | baseColumns.push({ |
| | |
| | | prop: "approveUserCurrentName", |
| | | width: 120 |
| | | }); |
| | | |
| | | // 申请时间 - 所有类型都显示 |
| | | baseColumns.push({ |
| | | label: "申请时间", |
| | | prop: "approveTime", |
| | | width: 180, |
| | | }); |
| | | |
| | | // 审批时间 - 所有类型都显示 |
| | | baseColumns.push({ |
| | | label: "审批时间", |
| | | prop: "approveOverTime", |
| | | width: 180, |
| | | }); |
| | | |
| | | // 操作列 |
| | | const actionOperations = [ |
| | |
| | | const { VITE_APP_ENV } = env; |
| | | const baseUrl = |
| | | env.VITE_APP_ENV === "development" |
| | | ? "http://1.15.17.182:9048" |
| | | ? "http://localhost:7003" |
| | | : env.VITE_BASE_API; |
| | | const javaUrl = |
| | | env.VITE_APP_ENV === "development" |
| | | ? "http://1.15.17.182:9049" |
| | | ? "http://localhost:7003" |
| | | : env.VITE_JAVA_API; |
| | | return { |
| | | define:{ |