You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1257 lines
56 KiB
1257 lines
56 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[43212],{
|
|
|
|
/***/ 61773:
|
|
/*!**********************************************************************!*\
|
|
!*** ./src/pages/Laboratory/ReservationManage/index.tsx + 1 modules ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ ReservationManage; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(80608);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/ReservationManage/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ReservationManagemodules = ({"header_div":"header_div___FnZUF","header_title":"header_title___Uziic","search":"search___fe9lC","searchIcon":"searchIcon___wfKLC","search_params":"search_params___OmXRN","add_Data":"add_Data___h_mvI","my_modal":"my_modal___emMcK"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
|
|
var input = __webpack_require__(92832);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
|
var date_picker = __webpack_require__(30518);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(51945);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(86859);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
var TextArea = __webpack_require__(1643);
|
|
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
|
var laboratory = __webpack_require__(70974);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(61186);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(49105);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/ReservationManage/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var timeType = {
|
|
1: '第1节(00:00-00:50)',
|
|
2: '第2节(01:00-01:50)',
|
|
3: '第3节(02:00-02:50)',
|
|
4: '第4节(03:00-03:50)',
|
|
5: '第5节(04:00-04:50)',
|
|
6: '第6节(05:00-05:50)',
|
|
7: '第7节(06:00-06:50)',
|
|
8: '第8节(07:00-07:50)',
|
|
9: '第9节(08:00-08:50)',
|
|
10: '第10节(09:00-09:50)',
|
|
11: '第11节(10:00-10:50)',
|
|
12: '第12节(11:00-11:50)',
|
|
13: '第13节(12:00-12:50)',
|
|
14: '第14节(13:00-13:50)',
|
|
15: '第15节(14:00-14:50)',
|
|
16: '第16节(15:00-15:50)',
|
|
17: '第17节(16:00-16:50)',
|
|
18: '第18节(17:00-17:50)',
|
|
19: '第19节(18:00-18:50)',
|
|
20: '第20节(19:00-19:50)',
|
|
21: '第21节(20:00-20:50)',
|
|
22: '第22节(21:00-21:50)',
|
|
23: '第23节(22:00-22:50)',
|
|
24: '第24节(23:00-23:50)'
|
|
};
|
|
var statusType = {
|
|
'pending': '待审核',
|
|
'queue': '排队中',
|
|
'progress': '进行中',
|
|
'completed': '已完成',
|
|
'rejected': '已驳回',
|
|
'canceled': '已取消'
|
|
};
|
|
var Navigation = function Navigation(_ref) {
|
|
var _infoData$sections;
|
|
var loading = _ref.loading,
|
|
user = _ref.user;
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
keyword = _useState2[0],
|
|
setkeyword = _useState2[1];
|
|
//时间
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
time = _useState4[0],
|
|
setTime = _useState4[1];
|
|
//预约状态
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
status = _useState6[0],
|
|
setStatus = _useState6[1];
|
|
//预约数据
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
tableData = _useState8[0],
|
|
setTableData = _useState8[1];
|
|
//预约人下拉
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
directorsList = _useState10[0],
|
|
setDirectorsList = _useState10[1];
|
|
|
|
//新建 调整
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
openAddModal = _useState12[0],
|
|
setOpenAddModal = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)({}),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
infoData = _useState14[0],
|
|
setInfoData = _useState14[1];
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
myForm = _Form$useForm2[0];
|
|
//驳回 取消预约 查看
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
openSeeModal = _useState16[0],
|
|
setOpenSeeModal = _useState16[1];
|
|
var _useState17 = (0,_react_17_0_2_react.useState)('驳回'),
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
modalType = _useState18[0],
|
|
setModalType = _useState18[1];
|
|
|
|
//分页
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(0),
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
total = _useState20[0],
|
|
setTotal = _useState20[1];
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(1),
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
page = _useState22[0],
|
|
setPage = _useState22[1];
|
|
var _useState23 = (0,_react_17_0_2_react.useState)(10),
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
limit = _useState24[0],
|
|
setLimit = _useState24[1];
|
|
|
|
//实验室
|
|
var _useState25 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
laboratorysAll = _useState26[0],
|
|
setLaboratorysAll = _useState26[1];
|
|
var _useState27 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
laboratorys = _useState28[0],
|
|
setLaboratorys = _useState28[1];
|
|
var _useState29 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
classroomId = _useState30[0],
|
|
setClassroomId = _useState30[1];
|
|
//实验室房间
|
|
var _useState31 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
rooms = _useState32[0],
|
|
setRooms = _useState32[1];
|
|
var _useState33 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
sectionList = _useState34[0],
|
|
setSectionList = _useState34[1];
|
|
var _useState35 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState36 = slicedToArray_default()(_useState35, 2),
|
|
stationSize = _useState36[0],
|
|
setStationSize = _useState36[1];
|
|
var _useState37 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState38 = slicedToArray_default()(_useState37, 2),
|
|
containerList = _useState38[0],
|
|
setContainerList = _useState38[1];
|
|
var columns = [{
|
|
title: '预约人',
|
|
dataIndex: 'user_name',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '角色',
|
|
dataIndex: 'user_role',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text == 'student' ? '学生' : '教师',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text == 'student' ? '学生' : '教师'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '预约房间',
|
|
dataIndex: 'classroom_room_title',
|
|
ellipsis: true
|
|
}, {
|
|
title: '所属实验室',
|
|
dataIndex: 'classroom_title',
|
|
ellipsis: true
|
|
}, {
|
|
title: '预约节次',
|
|
dataIndex: 'sections',
|
|
ellipsis: true,
|
|
width: 160,
|
|
render: function render(text, record) {
|
|
var _record$sections;
|
|
return record === null || record === void 0 || (_record$sections = record.sections) === null || _record$sections === void 0 ? void 0 : _record$sections.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: timeType[item === null || item === void 0 ? void 0 : item.section_id]
|
|
}, index);
|
|
});
|
|
}
|
|
}, {
|
|
title: '工位数量',
|
|
dataIndex: 'work_num',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '关联类型',
|
|
dataIndex: 'container_type',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text == 'Subject' ? '实践课程' : text == 'Shixun' ? '实践项目' : '教学课堂',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text == 'Subject' ? '实践课程' : text == 'Shixun' ? '实践项目' : '教学课堂'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '关联内容',
|
|
dataIndex: 'container_titile',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '学号/工号',
|
|
dataIndex: 'student_id',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '手机号',
|
|
dataIndex: 'user_phone',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '邮箱',
|
|
dataIndex: 'mail',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '备注',
|
|
dataIndex: 'description',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '预约状态',
|
|
dataIndex: 'status',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: statusType[text],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: statusType[text]
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '操作',
|
|
ellipsis: true,
|
|
width: 150,
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [(record === null || record === void 0 ? void 0 : record.status) == 'queue' && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
cursor: "pointer",
|
|
marginRight: 10
|
|
},
|
|
onClick: function onClick() {
|
|
var _record$sections2;
|
|
myForm.setFieldsValue({
|
|
reservation_user_id: record === null || record === void 0 ? void 0 : record.user_id,
|
|
user_phone: record === null || record === void 0 ? void 0 : record.user_phone,
|
|
mail: record === null || record === void 0 ? void 0 : record.mail,
|
|
classroom_room_id: record === null || record === void 0 ? void 0 : record.classroom_room_id,
|
|
classroom_id: record === null || record === void 0 ? void 0 : record.classroom_id,
|
|
date: dayjs_min_default()(record === null || record === void 0 ? void 0 : record.date),
|
|
work_num: record === null || record === void 0 ? void 0 : record.work_num,
|
|
description: record === null || record === void 0 ? void 0 : record.description,
|
|
adjusted_reason: '',
|
|
container_id: record === null || record === void 0 ? void 0 : record.container_id,
|
|
container_type: record === null || record === void 0 ? void 0 : record.container_type,
|
|
sections: record === null || record === void 0 || (_record$sections2 = record.sections) === null || _record$sections2 === void 0 ? void 0 : _record$sections2.map(function (item) {
|
|
return item === null || item === void 0 ? void 0 : item.section_id;
|
|
})
|
|
});
|
|
|
|
//实验室下拉
|
|
(0,laboratory/* can_reservation_classrooms */.QS)({
|
|
reservation_user_id: record === null || record === void 0 ? void 0 : record.user_id
|
|
}).then(function (res) {
|
|
var _res$data;
|
|
setLaboratorys(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list);
|
|
});
|
|
//实验室房间下拉
|
|
(0,laboratory/* can_reservation_classroom_rooms */.i6)({
|
|
reservation_user_id: record === null || record === void 0 ? void 0 : record.user_id,
|
|
classroom_id: record === null || record === void 0 ? void 0 : record.classroom_id
|
|
}).then(function (res) {
|
|
var _res$data2;
|
|
setRooms(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list);
|
|
});
|
|
//节次下拉
|
|
(0,laboratory/* date_section_details */.P6)({
|
|
date: dayjs_min_default()(record === null || record === void 0 ? void 0 : record.date).format('YYYY-MM-DD'),
|
|
classroom_room_id: record === null || record === void 0 ? void 0 : record.classroom_room_id,
|
|
reservation_id: record === null || record === void 0 ? void 0 : record.id
|
|
}).then(function (res) {
|
|
var _res$data3, _record$sections3, _record$sections5;
|
|
setSectionList(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list);
|
|
//计算可预约工位数量
|
|
if ((record === null || record === void 0 || (_record$sections3 = record.sections) === null || _record$sections3 === void 0 ? void 0 : _record$sections3.length) == 1) {
|
|
var _res$data4, _res$data5;
|
|
var obj = 0;
|
|
res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 || (_res$data4 = _res$data4.list) === null || _res$data4 === void 0 || _res$data4.map(function (item, index) {
|
|
var _record$sections4;
|
|
if ((item === null || item === void 0 ? void 0 : item.section_id) == (record === null || record === void 0 || (_record$sections4 = record.sections) === null || _record$sections4 === void 0 || (_record$sections4 = _record$sections4[0]) === null || _record$sections4 === void 0 ? void 0 : _record$sections4.section_id)) {
|
|
obj = index;
|
|
}
|
|
});
|
|
setStationSize(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5.list[obj]) === null || _res$data5 === void 0 ? void 0 : _res$data5.work_num);
|
|
} else if ((record === null || record === void 0 || (_record$sections5 = record.sections) === null || _record$sections5 === void 0 ? void 0 : _record$sections5.length) == 2) {
|
|
var _res$data6, _res$data7, _res$data8, _res$data9, _res$data10;
|
|
var obj1 = 0;
|
|
var obj2 = 0;
|
|
res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 || (_res$data6 = _res$data6.list) === null || _res$data6 === void 0 || _res$data6.map(function (item, index) {
|
|
var _record$sections6, _record$sections7;
|
|
if ((item === null || item === void 0 ? void 0 : item.section_id) == (record === null || record === void 0 || (_record$sections6 = record.sections) === null || _record$sections6 === void 0 || (_record$sections6 = _record$sections6[0]) === null || _record$sections6 === void 0 ? void 0 : _record$sections6.section_id)) {
|
|
obj1 = index;
|
|
}
|
|
if ((item === null || item === void 0 ? void 0 : item.section_id) == (record === null || record === void 0 || (_record$sections7 = record.sections) === null || _record$sections7 === void 0 || (_record$sections7 = _record$sections7[1]) === null || _record$sections7 === void 0 ? void 0 : _record$sections7.section_id)) {
|
|
obj2 = index;
|
|
}
|
|
});
|
|
setStationSize((res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 || (_res$data7 = _res$data7.list[obj1]) === null || _res$data7 === void 0 ? void 0 : _res$data7.work_num) > (res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 || (_res$data8 = _res$data8.list[obj2]) === null || _res$data8 === void 0 ? void 0 : _res$data8.work_num) ? res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 || (_res$data9 = _res$data9.list[obj2]) === null || _res$data9 === void 0 ? void 0 : _res$data9.work_num : res === null || res === void 0 || (_res$data10 = res.data) === null || _res$data10 === void 0 || (_res$data10 = _res$data10.list[obj1]) === null || _res$data10 === void 0 ? void 0 : _res$data10.work_num);
|
|
} else {
|
|
setStationSize(0);
|
|
}
|
|
});
|
|
//关联教学
|
|
getContainerList(record === null || record === void 0 ? void 0 : record.container_type, record === null || record === void 0 ? void 0 : record.user_id);
|
|
setOpenAddModal(true);
|
|
setInfoData(record);
|
|
},
|
|
children: "\u8C03\u6574"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#5F6367",
|
|
marginRight: 10,
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
setOpenSeeModal(true);
|
|
setModalType('取消');
|
|
setInfoData(record);
|
|
},
|
|
children: "\u53D6\u6D88\u9884\u7EA6"
|
|
})]
|
|
}), (record === null || record === void 0 ? void 0 : record.status) == 'pending' && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
cursor: "pointer",
|
|
marginRight: 10
|
|
},
|
|
onClick: function onClick() {
|
|
(0,laboratory/* reservations_review */.UP)({
|
|
id: record === null || record === void 0 ? void 0 : record.id,
|
|
type: 2
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('操作成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
},
|
|
children: "\u901A\u8FC7"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#E30000",
|
|
marginRight: 10,
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
setOpenSeeModal(true);
|
|
setModalType('驳回');
|
|
setInfoData(record);
|
|
},
|
|
children: "\u9A73\u56DE"
|
|
})]
|
|
}), (record === null || record === void 0 ? void 0 : record.status) != 'queue' && (record === null || record === void 0 ? void 0 : record.status) != 'pending' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
setOpenSeeModal(true);
|
|
setModalType('查看');
|
|
setInfoData(record);
|
|
},
|
|
children: "\u67E5\u770B"
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
//预约人
|
|
(0,laboratory/* users_query */.ik)({}).then(function (res) {
|
|
var _res$data11;
|
|
setDirectorsList(res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.list);
|
|
});
|
|
//实验室
|
|
(0,laboratory/* classroom_query */.GJ)({
|
|
page: 1,
|
|
limit: 10000,
|
|
keyword: ''
|
|
}).then(function (res) {
|
|
var _res$data12;
|
|
setLaboratorysAll([{
|
|
id: '',
|
|
title: '全部'
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : _res$data12.list)));
|
|
});
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
getData(false);
|
|
}, [page]);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
getData(true);
|
|
}, [time, status, keyword, classroomId, limit]);
|
|
var getData = function getData(flag) {
|
|
if (flag) {
|
|
setPage(1);
|
|
}
|
|
(0,laboratory/* reservations_query */.bU)({
|
|
page: page,
|
|
limit: limit,
|
|
date: time ? dayjs_min_default()(time === null || time === void 0 ? void 0 : time.$d).format('YYYY-MM-DD') : '',
|
|
status: status,
|
|
classroom_id: classroomId,
|
|
keyword: keyword
|
|
}).then(function (res) {
|
|
var _res$data13, _res$data14;
|
|
setTotal(res === null || res === void 0 || (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.count);
|
|
setTableData(res === null || res === void 0 || (_res$data14 = res.data) === null || _res$data14 === void 0 ? void 0 : _res$data14.list);
|
|
});
|
|
};
|
|
var onShowSizeChange = function onShowSizeChange(page, size) {
|
|
setPage(page);
|
|
setLimit(size);
|
|
};
|
|
var filterOption = function filterOption(input, option) {
|
|
var _option$label;
|
|
var label = ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase();
|
|
// const phone = (option?.phone ?? '').toLowerCase();
|
|
var search = input.toLowerCase();
|
|
// label.includes(search) || phone.includes(search)
|
|
return label.includes(search);
|
|
};
|
|
|
|
//获取关联教学
|
|
var getContainerList = function getContainerList(e, user_id) {
|
|
var obj = e == 'Subject' ? 'subjects' : e == 'Shixun' ? 'shixuns' : 'courses';
|
|
(0,fetch/* default */.ZP)("/api/users/".concat(user_id, "/").concat(obj, ".json"), {
|
|
method: 'get',
|
|
params: {
|
|
page: 1,
|
|
per_page: 1000,
|
|
username: user.userInfo.login,
|
|
user_id: user_id
|
|
}
|
|
}).then(function (res) {
|
|
setContainerList(res === null || res === void 0 ? void 0 : res[obj]);
|
|
});
|
|
};
|
|
var disabledDate = function disabledDate(current) {
|
|
// 获取今天的日期
|
|
var today = dayjs_min_default()().startOf('day');
|
|
// 获取本周的第一天和最后一天
|
|
var startOfThisWeek = dayjs_min_default()().startOf('week');
|
|
// 获取下周的最后一天
|
|
var endOfNextWeek = dayjs_min_default()().endOf('week').add(1, 'week');
|
|
// 如果当前日期早于本周的第一天或晚于下周的最后一天,则禁用
|
|
if (current.isBefore(startOfThisWeek) || current.isAfter(endOfNextWeek)) {
|
|
return true;
|
|
}
|
|
// 如果当前日期在本周的日期范围内,但早于今天,则禁用
|
|
if (current.isBefore(today)) {
|
|
return true;
|
|
}
|
|
// 如果当前日期在下周最后一天之后,则禁用
|
|
if (current.isAfter(endOfNextWeek)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: ReservationManagemodules.header_div,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReservationManagemodules.header_title,
|
|
children: "\u9884\u7EA6\u7BA1\u7406"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u5B9E\u9A8C\u5BA4\u540D\u79F0\u3001\u623F\u95F4\u53F7\u6216\u9884\u7EA6\u4EBA\u8FDB\u884C\u641C\u7D22",
|
|
size: "large",
|
|
className: ReservationManagemodules.search,
|
|
value: keyword,
|
|
onChange: function onChange(e) {
|
|
setkeyword(e.target.value);
|
|
},
|
|
onSearch: function onSearch(value) {
|
|
setkeyword(value);
|
|
},
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-sousuo9 font14 ".concat(ReservationManagemodules.searchIcon),
|
|
onClick: function onClick() {
|
|
setkeyword(keyword);
|
|
getData(true);
|
|
}
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: ReservationManagemodules.search_params,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u6240\u5C5E\u5B9E\u9A8C\u5BA4",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
style: {
|
|
width: 160
|
|
},
|
|
defaultValue: classroomId,
|
|
value: classroomId,
|
|
onChange: function onChange(e) {
|
|
setClassroomId(e);
|
|
},
|
|
children: laboratorysAll === null || laboratorysAll === void 0 ? void 0 : laboratorysAll.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.title
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u65E5\u671F",
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
style: {
|
|
width: 140
|
|
},
|
|
defaultValue: time,
|
|
value: time,
|
|
onChange: function onChange(e) {
|
|
setTime(e);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u72B6\u6001",
|
|
style: {
|
|
marginLeft: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
style: {
|
|
width: 160
|
|
},
|
|
defaultValue: status,
|
|
value: status,
|
|
onChange: function onChange(e) {
|
|
setStatus(e);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: '',
|
|
children: "\u5168\u90E8"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'pending',
|
|
children: "\u5F85\u5BA1\u6838"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'queue',
|
|
children: "\u6392\u961F\u4E2D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'progress',
|
|
children: "\u8FDB\u884C\u4E2D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'completed',
|
|
children: "\u5DF2\u5B8C\u6210"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'rejected',
|
|
children: "\u5DF2\u9A73\u56DE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'canceled',
|
|
children: "\u5DF2\u53D6\u6D88"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReservationManagemodules.add_Data,
|
|
onClick: function onClick() {
|
|
setOpenAddModal(true);
|
|
setInfoData({});
|
|
myForm.resetFields();
|
|
},
|
|
children: "\u65B0\u5EFA\u9884\u7EA6"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
pagination: false,
|
|
dataSource: tableData,
|
|
columns: columns,
|
|
scroll: {
|
|
x: 1500
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
children: total > 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'space-between',
|
|
padding: '10px 7px 20px 7px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
style: {
|
|
color: '#656F87'
|
|
},
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-light-primary",
|
|
children: total
|
|
}), "\u6761\u6570\u636E"]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
showSizeChanger: true,
|
|
showQuickJumper: true,
|
|
onChange: onShowSizeChange,
|
|
defaultCurrent: 1,
|
|
pageSizeOptions: ['10', '20', '50', '100'],
|
|
current: page || 1,
|
|
pageSize: limit || 10,
|
|
defaultPageSize: 10,
|
|
total: total
|
|
})]
|
|
}) : ''
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
keyboard: false,
|
|
destroyOnClose: true,
|
|
className: ReservationManagemodules.my_modal,
|
|
open: openAddModal,
|
|
title: "".concat(infoData !== null && infoData !== void 0 && infoData.id ? '调整' : '新建', "\u9884\u7EA6"),
|
|
width: "600px",
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var _myForm$getFieldValue, _myForm$getFieldValue2;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return myForm.validateFields();
|
|
case 2:
|
|
//编辑预约
|
|
if (infoData !== null && infoData !== void 0 && infoData.id) {
|
|
(0,laboratory/* reservations_update */.vW)({
|
|
id: infoData === null || infoData === void 0 ? void 0 : infoData.id,
|
|
reservation: {
|
|
reservation_user_id: myForm.getFieldValue('reservation_user_id'),
|
|
user_phone: myForm.getFieldValue('user_phone'),
|
|
mail: myForm.getFieldValue('mail'),
|
|
classroom_room_id: myForm.getFieldValue('classroom_room_id'),
|
|
classroom_id: myForm.getFieldValue('classroom_id'),
|
|
date: dayjs_min_default()((_myForm$getFieldValue = myForm.getFieldValue('date')) === null || _myForm$getFieldValue === void 0 ? void 0 : _myForm$getFieldValue.$d).format('YYYY-MM-DD'),
|
|
work_num: Number(myForm.getFieldValue('work_num')),
|
|
description: myForm.getFieldValue('description'),
|
|
adjusted_reason: myForm.getFieldValue('adjusted_reason'),
|
|
container_id: myForm.getFieldValue('container_id'),
|
|
container_type: myForm.getFieldValue('container_type'),
|
|
sections: myForm.getFieldValue('sections')
|
|
}
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('编辑成功');
|
|
setOpenAddModal(false);
|
|
getData(true);
|
|
}
|
|
});
|
|
} else {
|
|
//创建
|
|
(0,laboratory/* reservations_create */.Do)({
|
|
reservation: {
|
|
reservation_user_id: myForm.getFieldValue('reservation_user_id'),
|
|
classroom_room_id: myForm.getFieldValue('classroom_room_id'),
|
|
classroom_id: myForm.getFieldValue('classroom_id'),
|
|
date: dayjs_min_default()((_myForm$getFieldValue2 = myForm.getFieldValue('date')) === null || _myForm$getFieldValue2 === void 0 ? void 0 : _myForm$getFieldValue2.$d).format('YYYY-MM-DD'),
|
|
work_num: Number(myForm.getFieldValue('work_num')),
|
|
description: myForm.getFieldValue('description'),
|
|
container_id: myForm.getFieldValue('container_id'),
|
|
container_type: myForm.getFieldValue('container_type'),
|
|
sections: myForm.getFieldValue('sections')
|
|
}
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('新增成功');
|
|
setOpenAddModal(false);
|
|
getData(true);
|
|
}
|
|
});
|
|
}
|
|
case 3:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
})),
|
|
onCancel: function onCancel() {
|
|
setOpenAddModal(false);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
className: ReservationManagemodules.formWrap,
|
|
form: myForm,
|
|
wrapperCol: {
|
|
span: 19
|
|
},
|
|
style: {
|
|
maxHeight: "550px",
|
|
overflowY: 'auto'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u4EBA",
|
|
name: "reservation_user_id",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择预约人'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
showSearch: true,
|
|
filterOption: filterOption,
|
|
disabled: infoData !== null && infoData !== void 0 && infoData.id ? true : false,
|
|
onChange: function onChange(e) {
|
|
//实验室
|
|
(0,laboratory/* can_reservation_classrooms */.QS)({
|
|
reservation_user_id: e
|
|
}).then(function (res) {
|
|
var _res$data15;
|
|
setLaboratorys(res === null || res === void 0 || (_res$data15 = res.data) === null || _res$data15 === void 0 ? void 0 : _res$data15.list);
|
|
});
|
|
myForm.setFieldValue('classroom_id', '');
|
|
myForm.setFieldValue('classroom_room_id', '');
|
|
//关联教学清空
|
|
getContainerList(myForm.getFieldValue('container_type'), e);
|
|
myForm.setFieldValue('container_id', '');
|
|
},
|
|
children: directorsList === null || directorsList === void 0 ? void 0 : directorsList.map(function (item, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
label: item === null || item === void 0 ? void 0 : item.real_name,
|
|
phone: item === null || item === void 0 ? void 0 : item.phone,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
display: "flex"
|
|
},
|
|
children: (item === null || item === void 0 ? void 0 : item.real_name) || '--'
|
|
})
|
|
}, key);
|
|
})
|
|
})
|
|
}), (infoData === null || infoData === void 0 ? void 0 : infoData.id) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u624B\u673A\u53F7\u7801",
|
|
name: "user_phone",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
disabled: true
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u90AE\u7BB1\u8D26\u53F7",
|
|
name: "mail",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
disabled: true
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
label: "\u9884\u7EA6\u5B9E\u9A8C\u5BA4",
|
|
name: "classroom_id",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
onChange: function onChange(e) {
|
|
//实验室房间
|
|
(0,laboratory/* can_reservation_classroom_rooms */.i6)({
|
|
reservation_user_id: myForm.getFieldValue('reservation_user_id'),
|
|
classroom_id: e
|
|
}).then(function (res) {
|
|
var _res$data16;
|
|
setRooms(res === null || res === void 0 || (_res$data16 = res.data) === null || _res$data16 === void 0 ? void 0 : _res$data16.list);
|
|
});
|
|
myForm.setFieldValue('classroom_room_id', '');
|
|
},
|
|
children: laboratorys === null || laboratorys === void 0 ? void 0 : laboratorys.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.title
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
label: "\u9884\u7EA6\u623F\u95F4\u53F7",
|
|
name: "classroom_room_id",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
children: rooms === null || rooms === void 0 ? void 0 : rooms.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.title
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u65E5\u671F",
|
|
name: "date",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择日期'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
style: {
|
|
width: '100%'
|
|
},
|
|
format: "YYYY-MM-DD",
|
|
disabledDate: disabledDate,
|
|
onChange: function onChange(e) {
|
|
(0,laboratory/* date_section_details */.P6)({
|
|
date: dayjs_min_default()(e === null || e === void 0 ? void 0 : e.$d).format('YYYY-MM-DD'),
|
|
classroom_room_id: myForm.getFieldValue('classroom_room_id'),
|
|
reservation_id: infoData === null || infoData === void 0 ? void 0 : infoData.id
|
|
}).then(function (res) {
|
|
var _res$data17;
|
|
setSectionList(res === null || res === void 0 || (_res$data17 = res.data) === null || _res$data17 === void 0 ? void 0 : _res$data17.list);
|
|
});
|
|
myForm.setFieldValue('sections', []);
|
|
myForm.setFieldValue('work_num', '');
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u8282\u6B21",
|
|
name: "sections",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择节次'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
mode: "multiple",
|
|
onChange: function onChange(e) {
|
|
var _myForm$getFieldValue3, _myForm$getFieldValue5;
|
|
if (e.length > 2) {
|
|
message/* default */.ZP.error('最多只能选择两节次,请重新选择');
|
|
// 清空最后选的那个选项
|
|
myForm.setFieldValue('sections', e.slice(0, 2));
|
|
} else {
|
|
myForm.setFieldValue('sections', e);
|
|
}
|
|
//计算可预约工位数量
|
|
if (((_myForm$getFieldValue3 = myForm.getFieldValue('sections')) === null || _myForm$getFieldValue3 === void 0 ? void 0 : _myForm$getFieldValue3.length) == 1) {
|
|
var _sectionList$obj;
|
|
var obj = 0;
|
|
sectionList === null || sectionList === void 0 || sectionList.map(function (item, index) {
|
|
var _myForm$getFieldValue4;
|
|
if ((item === null || item === void 0 ? void 0 : item.section_id) == ((_myForm$getFieldValue4 = myForm.getFieldValue('sections')) === null || _myForm$getFieldValue4 === void 0 ? void 0 : _myForm$getFieldValue4[0])) {
|
|
obj = index;
|
|
}
|
|
});
|
|
setStationSize((_sectionList$obj = sectionList[obj]) === null || _sectionList$obj === void 0 ? void 0 : _sectionList$obj.work_num);
|
|
} else if (((_myForm$getFieldValue5 = myForm.getFieldValue('sections')) === null || _myForm$getFieldValue5 === void 0 ? void 0 : _myForm$getFieldValue5.length) == 2) {
|
|
var _sectionList$obj2, _sectionList$obj3, _sectionList$obj4, _sectionList$obj5;
|
|
var obj1 = 0;
|
|
var obj2 = 0;
|
|
sectionList === null || sectionList === void 0 || sectionList.map(function (item, index) {
|
|
var _myForm$getFieldValue6, _myForm$getFieldValue7;
|
|
if ((item === null || item === void 0 ? void 0 : item.section_id) == ((_myForm$getFieldValue6 = myForm.getFieldValue('sections')) === null || _myForm$getFieldValue6 === void 0 ? void 0 : _myForm$getFieldValue6[0])) {
|
|
obj1 = index;
|
|
}
|
|
if ((item === null || item === void 0 ? void 0 : item.section_id) == ((_myForm$getFieldValue7 = myForm.getFieldValue('sections')) === null || _myForm$getFieldValue7 === void 0 ? void 0 : _myForm$getFieldValue7[1])) {
|
|
obj2 = index;
|
|
}
|
|
});
|
|
setStationSize(((_sectionList$obj2 = sectionList[obj1]) === null || _sectionList$obj2 === void 0 ? void 0 : _sectionList$obj2.work_num) > ((_sectionList$obj3 = sectionList[obj2]) === null || _sectionList$obj3 === void 0 ? void 0 : _sectionList$obj3.work_num) ? (_sectionList$obj4 = sectionList[obj2]) === null || _sectionList$obj4 === void 0 ? void 0 : _sectionList$obj4.work_num : (_sectionList$obj5 = sectionList[obj1]) === null || _sectionList$obj5 === void 0 ? void 0 : _sectionList$obj5.work_num);
|
|
} else {
|
|
setStationSize(0);
|
|
}
|
|
},
|
|
children: sectionList === null || sectionList === void 0 ? void 0 : sectionList.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.section_id,
|
|
disabled: (item === null || item === void 0 ? void 0 : item.work_num) == 0 ? true : false,
|
|
children: ["\u7B2C", item === null || item === void 0 ? void 0 : item.section_id, "\u8282"]
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u5DE5\u4F4D\u6570\u91CF",
|
|
name: "work_num",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择输入数量'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "number",
|
|
max: stationSize,
|
|
onChange: function onChange(e) {
|
|
var value = e.target.value;
|
|
if (value === '' || Number(value) <= stationSize && Number.isInteger(Number(value)) && Number(value) > 0) {
|
|
myForm.setFieldValue('work_num', value);
|
|
} else {
|
|
message/* default */.ZP.error("".concat(stationSize == 0 ? '请先选择预约节次' : "\u8BF7\u8F93\u5165\u5927\u4E8E0\u4E14\u4E0D\u5927\u4E8E".concat(stationSize || 0, "\u7684\u6B63\u6574\u6570")));
|
|
myForm.setFieldValue('work_num', '');
|
|
}
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5173\u8054\u6559\u5B66",
|
|
name: "container_type",
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
style: {
|
|
width: '100px'
|
|
},
|
|
onChange: function onChange(e) {
|
|
getContainerList(e, myForm.getFieldValue('reservation_user_id'));
|
|
myForm.setFieldValue('container_id', '');
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'Subject',
|
|
children: "\u5B9E\u8DF5\u8BFE\u7A0B"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'Shixun',
|
|
children: "\u5B9E\u8DF5\u9879\u76EE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'Course',
|
|
children: "\u6559\u5B66\u8BFE\u5802"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
name: "container_id",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择关联教学'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
style: {
|
|
marginLeft: '10px',
|
|
width: '325px'
|
|
},
|
|
children: containerList === null || containerList === void 0 ? void 0 : containerList.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
}, index);
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5907\u6CE8",
|
|
name: "description",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {})
|
|
}), (infoData === null || infoData === void 0 ? void 0 : infoData.id) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
label: "\u8C03\u6574\u9884\u7EA6\u539F\u56E0",
|
|
name: "adjusted_reason",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {})
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
keyboard: false,
|
|
destroyOnClose: true,
|
|
className: ReservationManagemodules.my_modal,
|
|
open: openSeeModal,
|
|
title: "".concat(modalType, "\u9884\u7EA6"),
|
|
width: "600px",
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return myForm.validateFields();
|
|
case 2:
|
|
if (modalType == '驳回') {
|
|
(0,laboratory/* reservations_review */.UP)({
|
|
id: infoData === null || infoData === void 0 ? void 0 : infoData.id,
|
|
type: 1,
|
|
reason: myForm.getFieldValue('reason_bohui')
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('操作成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
} else if (modalType == '取消') {
|
|
(0,laboratory/* reservations_canceled */.mJ)({
|
|
id: infoData === null || infoData === void 0 ? void 0 : infoData.id,
|
|
reason: myForm.getFieldValue('reason_quxiao')
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('操作成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
}
|
|
setOpenSeeModal(false);
|
|
case 4:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
})),
|
|
onCancel: function onCancel() {
|
|
setOpenSeeModal(false);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
className: ReservationManagemodules.formWrap,
|
|
form: myForm,
|
|
style: {
|
|
height: "500px",
|
|
overflowY: 'auto'
|
|
},
|
|
wrapperCol: {
|
|
span: 19
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u4EBA",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.user_name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u624B\u673A\u53F7",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.user_phone
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u90AE\u7BB1",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.mail
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u5B9E\u9A8C\u5BA4",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.classroom_title
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u623F\u95F4\u53F7",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.classroom_room_title
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u65E5\u671F",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.date
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u8282\u6B21",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
display: "flex"
|
|
},
|
|
children: infoData === null || infoData === void 0 || (_infoData$sections = infoData.sections) === null || _infoData$sections === void 0 ? void 0 : _infoData$sections.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginTop: '5px',
|
|
marginRight: '10px'
|
|
},
|
|
children: timeType[item === null || item === void 0 ? void 0 : item.section_id]
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u5DE5\u4F4D\u6570\u91CF",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.work_num
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5173\u8054\u6559\u5B66\u7C7B\u578B",
|
|
children: (infoData === null || infoData === void 0 ? void 0 : infoData.container_type) == 'Subject' ? '实践课程' : (infoData === null || infoData === void 0 ? void 0 : infoData.container_type) == 'Shixun' ? '实践项目' : '教学课堂'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5173\u8054\u6559\u5B66\u5185\u5BB9",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.container_titile
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5907\u6CE8",
|
|
children: infoData === null || infoData === void 0 ? void 0 : infoData.description
|
|
}), modalType == '驳回' && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
label: "\u9A73\u56DE\u9884\u7EA6\u539F\u56E0",
|
|
name: "reason_bohui",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {})
|
|
}), modalType == '取消' && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
label: "\u53D6\u6D88\u9884\u7EA6\u539F\u56E0",
|
|
name: "reason_quxiao",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {})
|
|
})]
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var ReservationManage = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var loading = _ref4.loading,
|
|
engineeringNavigtion = _ref4.engineeringNavigtion,
|
|
user = _ref4.user;
|
|
return objectSpread2_default()(objectSpread2_default()({
|
|
loading: loading
|
|
}, engineeringNavigtion), {}, {
|
|
user: user
|
|
});
|
|
})(Navigation));
|
|
|
|
/***/ })
|
|
|
|
}]); |