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.
600 lines
24 KiB
600 lines
24 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[81273],{
|
|
|
|
/***/ 81273:
|
|
/*!****************************************************************!*\
|
|
!*** ./src/components/ReservationDialog/index.tsx + 1 modules ***!
|
|
\****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_ReservationDialog; }
|
|
});
|
|
|
|
// 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/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/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/_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/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// 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/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// 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 + 12 modules
|
|
var date_picker = __webpack_require__(47119);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/components/ReservationDialog/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ReservationDialogmodules = ({"reservation_dialog":"reservation_dialog___J5l2y","ant-modal-title":"ant-modal-title___vjVUA","ant-checkbox-inner":"ant-checkbox-inner___olY6N","check_text_style":"check_text_style___e_q5k","check_text_style_active":"check_text_style_active___NGMhD","check_text_style_disabled":"check_text_style_disabled___26UhD","footerWrap":"footerWrap___H1q8O"});
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.19@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(66649);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(55794);
|
|
// EXTERNAL MODULE: ./src/service/user.ts
|
|
var service_user = __webpack_require__(98971);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(25789);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/components/ReservationDialog/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TextArea = input/* default */.Z.TextArea;
|
|
var defaultFormData = {
|
|
// shiyanshi_id: null,
|
|
// device_id: null,
|
|
date: null,
|
|
time_ids: [],
|
|
shixun_id: null,
|
|
phone: null
|
|
};
|
|
var ReservationDialog = function ReservationDialog(_ref) {
|
|
var user = _ref.user,
|
|
open = _ref.open,
|
|
modalName = _ref.modalName,
|
|
shixuns_detail_id = _ref.shixuns_detail_id,
|
|
shixuns_detail_name = _ref.shixuns_detail_name,
|
|
dataInfo = _ref.dataInfo,
|
|
onCancel = _ref.onCancel;
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
options = _useState2[0],
|
|
setOptions = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
deviceTags = _useState4[0],
|
|
setDeviceTags = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
showDate = _useState6[0],
|
|
setShowDate = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
timesArr = _useState8[0],
|
|
settimesArr = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
users = _useState10[0],
|
|
setUsers = _useState10[1];
|
|
|
|
// 获取表单内容
|
|
var formInfo = form.getFieldsValue(true);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (open) {
|
|
form.resetFields();
|
|
setDeviceTags([]);
|
|
settimesArr([]);
|
|
if (modalName == "增加预约" || modalName == "调整预约") {
|
|
//预约人
|
|
(0,service_user/* user_table_query */.bn)({}).then(function (res) {
|
|
var _res$data;
|
|
var arr = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.list) === null || _res$data === void 0 ? void 0 : _res$data.map(function (info) {
|
|
return {
|
|
value: info.id,
|
|
label: info.real_name
|
|
};
|
|
})) || [];
|
|
setUsers(toConsumableArray_default()(arr));
|
|
});
|
|
}
|
|
if (modalName == "开始预约" || modalName == "增加预约") {
|
|
var _user$userInfo;
|
|
if (modalName == "增加预约") {
|
|
formInfo.reservation_user_id = "";
|
|
}
|
|
formInfo.date = dayjs_min_default()();
|
|
// 预约时间
|
|
getShixunDevices({
|
|
date: dayjs_min_default()(),
|
|
shixun_id: dataInfo.shixun_id,
|
|
reservation_user_id: dataInfo.reservation_user_id
|
|
});
|
|
// 实验项目
|
|
formInfo.shixun_id = shixuns_detail_id, formInfo.phone = (user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.phone) || '';
|
|
form.setFieldsValue(formInfo);
|
|
} else if (modalName == "修改预约" || modalName == "调整预约") {
|
|
setDefaultFormData();
|
|
}
|
|
}
|
|
}, [open]);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
setOptions(timesArr);
|
|
}, [formInfo === null || formInfo === void 0 ? void 0 : formInfo.date]);
|
|
var setDefaultFormData = function setDefaultFormData() {
|
|
// 所属实验室
|
|
// formInfo.shiyanshi_id = dataInfo.classroom_id;
|
|
// 预约设备
|
|
// getTags(dataInfo.classroom_id);
|
|
// formInfo.device_id = dataInfo.device_id;
|
|
formInfo.date = dayjs_min_default()(dataInfo.date);
|
|
// 预约时间
|
|
getShixunDevices({
|
|
// device_id: dataInfo.device_id,
|
|
date: dataInfo.date,
|
|
shixun_id: dataInfo.shixun_id,
|
|
reservation_user_id: dataInfo.reservation_user_id
|
|
});
|
|
// 实验项目
|
|
formInfo.shixun_id = dataInfo.shixun_id,
|
|
// 预约说明
|
|
formInfo.description = dataInfo.description;
|
|
if (modalName == "调整预约") {
|
|
formInfo.reservation_user_id = dataInfo.reservation_user_id;
|
|
}
|
|
// 预约人电话
|
|
formInfo.phone = dataInfo.phone;
|
|
form.setFieldsValue(formInfo);
|
|
|
|
// if (!formInfo.device_id) setShowDate(true);
|
|
};
|
|
|
|
// 预约时间段限制
|
|
var onChange = function onChange(checkedValues) {
|
|
if ((checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.length) > 2) {
|
|
message/* default */.ZP.error('最多只能选择2个时间段预约');
|
|
formInfo.time_ids = [checkedValues[0], checkedValues[1]];
|
|
form.setFieldsValue(formInfo);
|
|
} else if ((checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.length) === 2) {
|
|
var a = 0;
|
|
var b = 0;
|
|
for (var i in options) {
|
|
if (options[i].value === checkedValues[0]) {
|
|
// a = options[i].id;
|
|
a = Number(i);
|
|
}
|
|
if (options[i].value === checkedValues[1]) {
|
|
// b = options[i].id;
|
|
b = Number(i);
|
|
}
|
|
}
|
|
if (a - b !== 1 && a - b !== -1) {
|
|
message/* default */.ZP.error('只能选择2个连续的时间段预约');
|
|
formInfo.time_ids = [checkedValues[0]];
|
|
form.setFieldsValue(formInfo);
|
|
}
|
|
}
|
|
var obj = JSON.parse(JSON.stringify(options));
|
|
for (var _i in obj) {
|
|
if (form.getFieldValue('time_ids').length === 1) {
|
|
if (obj[_i].value === form.getFieldValue('time_ids')[0]) {
|
|
obj[_i].is_check = true;
|
|
} else {
|
|
obj[_i].is_check = false;
|
|
}
|
|
} else if (form.getFieldValue('time_ids').length === 2) {
|
|
if (obj[_i].value === form.getFieldValue('time_ids')[0] || obj[_i].value === form.getFieldValue('time_ids')[1]) {
|
|
obj[_i].is_check = true;
|
|
} else {
|
|
obj[_i].is_check = false;
|
|
}
|
|
} else {
|
|
obj[_i].is_check = false;
|
|
}
|
|
}
|
|
setOptions(obj);
|
|
};
|
|
|
|
// 限制日期是否可选
|
|
var disabledDate = function disabledDate(time) {
|
|
var weekOfday = parseInt(dayjs_min_default()().format('d'));
|
|
var weekEnd = dayjs_min_default()().add(7 - weekOfday + 7, 'days');
|
|
return time <= dayjs_min_default()().subtract(1, 'days').endOf('day') || time > weekEnd;
|
|
};
|
|
|
|
// 获取可预约的时间段
|
|
var getShixunDevices = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(params) {
|
|
var res, obj, i, _res$device, _res$device2, _res$device3, _res$device4, optionsArr, todayDate, paramsDate, isToday, myDate, hours, minutes, resID;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
formInfo.time_ids = [];
|
|
if (params !== null && params !== void 0 && params.date) {
|
|
formInfo.date = dayjs_min_default()(params === null || params === void 0 ? void 0 : params.date);
|
|
} else {
|
|
formInfo.date = '';
|
|
}
|
|
form.setFieldsValue(formInfo);
|
|
params.date = dayjs_min_default()(params.date).format('YYYY-MM-DD');
|
|
_context.next = 6;
|
|
return (0,fetch/* default */.ZP)('/api/zz_classrooms/reservations/get_shixun_devices.json', {
|
|
method: 'Get',
|
|
params: objectSpread2_default()({}, params)
|
|
});
|
|
case 6:
|
|
res = _context.sent;
|
|
obj = [];
|
|
for (i in res === null || res === void 0 || (_res$device = res.device) === null || _res$device === void 0 ? void 0 : _res$device.reservation_times) {
|
|
obj.push({
|
|
id: res === null || res === void 0 || (_res$device2 = res.device) === null || _res$device2 === void 0 ? void 0 : _res$device2.reservation_times[i].id,
|
|
label: res === null || res === void 0 || (_res$device3 = res.device) === null || _res$device3 === void 0 ? void 0 : _res$device3.reservation_times[i].name,
|
|
value: res === null || res === void 0 || (_res$device4 = res.device) === null || _res$device4 === void 0 ? void 0 : _res$device4.reservation_times[i].id,
|
|
is_check: false,
|
|
disabled: false
|
|
});
|
|
}
|
|
settimesArr(obj);
|
|
|
|
// 赋值
|
|
optionsArr = obj.map(function (item, i) {
|
|
var _res$device5, _res$device6;
|
|
// 是否能预约
|
|
var can_reservation = res === null || res === void 0 || (_res$device5 = res.device) === null || _res$device5 === void 0 ? void 0 : _res$device5.reservation_times[i].can_reservation;
|
|
// 是否当前用户预约
|
|
var is_person = res === null || res === void 0 || (_res$device6 = res.device) === null || _res$device6 === void 0 ? void 0 : _res$device6.reservation_times[i].is_person;
|
|
if (is_person) {
|
|
item.is_check = true;
|
|
} else if (!can_reservation) {
|
|
item.disabled = true;
|
|
} else {
|
|
item.is_check = false;
|
|
item.disabled = false;
|
|
}
|
|
return item;
|
|
}); // 判断是否为今天
|
|
todayDate = new Date().setHours(0, 0, 0, 0);
|
|
paramsDate = new Date("".concat(params.date)).setHours(0, 0, 0, 0);
|
|
isToday = todayDate === paramsDate;
|
|
if (isToday) {
|
|
// 当前小时、分钟
|
|
myDate = new Date(), hours = myDate.getHours(), minutes = myDate.getMinutes(); // 将小于当前的时间段过滤
|
|
obj.forEach(function (item) {
|
|
var h = item.label.slice(0, 1) == "0" ? item.label.slice(1, 2) : item.label.slice(0, 2);
|
|
// let m = "";
|
|
// if (item.label.slice(3, 5) == "00") {
|
|
// m = "0";
|
|
// } else if (item.label.slice(3, 4) == "0" && item.label.slice(4, 5) != "0") {
|
|
// m = item.label.slice(4, 5);
|
|
// } else {
|
|
// m = item.label.slice(3, 5);
|
|
// }
|
|
if (hours > Number(h) || hours == Number(h) && minutes >= 30) {
|
|
item.disabled = true;
|
|
}
|
|
});
|
|
}
|
|
setOptions(obj);
|
|
resID = [];
|
|
optionsArr.forEach(function (item) {
|
|
if (item.is_check) {
|
|
resID.push(item.id);
|
|
}
|
|
});
|
|
formInfo.time_ids = resID;
|
|
form.setFieldsValue(formInfo);
|
|
case 20:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getShixunDevices(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
// 提交表单
|
|
var onFinish = function onFinish(values) {
|
|
if (modalName == "开始预约" || modalName == "增加预约") {
|
|
createReservation(objectSpread2_default()(objectSpread2_default()({}, values), {}, {
|
|
date: dayjs_min_default()(values === null || values === void 0 ? void 0 : values.date).format('YYYY-MM-DD')
|
|
}));
|
|
} else if (modalName == "修改预约" || modalName == "调整预约") {
|
|
updateReservation(objectSpread2_default()(objectSpread2_default()({}, values), {}, {
|
|
date: dayjs_min_default()(values === null || values === void 0 ? void 0 : values.date).format('YYYY-MM-DD')
|
|
}));
|
|
}
|
|
};
|
|
|
|
// 创建预约api
|
|
var createReservation = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(params) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,fetch/* default */.ZP)('/api/zz_classrooms/reservations.json', {
|
|
method: 'post',
|
|
body: objectSpread2_default()({}, params)
|
|
});
|
|
case 2:
|
|
res = _context2.sent;
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success('创建成功');
|
|
onCancel();
|
|
location.reload();
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function createReservation(_x2) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
// 修改预约api
|
|
var updateReservation = /*#__PURE__*/function () {
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(params) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/".concat(dataInfo === null || dataInfo === void 0 ? void 0 : dataInfo.id, ".json"), {
|
|
method: 'put',
|
|
body: objectSpread2_default()({}, params)
|
|
});
|
|
case 2:
|
|
res = _context3.sent;
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success('修改成功');
|
|
form.resetFields();
|
|
onCancel(true);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function updateReservation(_x3) {
|
|
return _ref4.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
// 设置设备下拉框数据
|
|
// const getTags = (id: any) => {
|
|
// let arr = kd_classrooms.find((data: any) => data.id == id)?.devices;
|
|
// console.log("arr",arr);
|
|
|
|
// setDeviceTags(arr)
|
|
// }
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
getContainer: false,
|
|
visible: open,
|
|
title: modalName,
|
|
width: "800px",
|
|
centered: true,
|
|
onCancel: function (_onCancel) {
|
|
function onCancel() {
|
|
return _onCancel.apply(this, arguments);
|
|
}
|
|
onCancel.toString = function () {
|
|
return _onCancel.toString();
|
|
};
|
|
return onCancel;
|
|
}(function () {
|
|
return onCancel();
|
|
}),
|
|
footer: null,
|
|
maskClosable: false,
|
|
className: ReservationDialogmodules.reservation_dialog,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
initialValues: defaultFormData,
|
|
layout: "horizontal",
|
|
labelCol: {
|
|
span: 3
|
|
},
|
|
wrapperCol: {
|
|
span: 20
|
|
},
|
|
onFinish: onFinish,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "shixun_id",
|
|
label: "\u5B9E\u9A8C\u9879\u76EE",
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择实验项目'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
placeholder: "\u8BF7\u9009\u62E9\u5B9E\u9A8C\u9879\u76EE",
|
|
disabled: true,
|
|
options: [{
|
|
value: shixuns_detail_id,
|
|
label: shixuns_detail_name
|
|
}]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u9884\u7EA6\u65E5\u671F",
|
|
name: "date",
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择预约日期'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
format: "YYYY-MM-DD",
|
|
allowClear: false,
|
|
disabled: showDate,
|
|
disabledDate: disabledDate,
|
|
onChange: function onChange(val) {
|
|
getShixunDevices({
|
|
// device_id: formInfo.device_id,
|
|
date: val,
|
|
shixun_id: dataInfo.shixun_id,
|
|
reservation_user_id: dataInfo.reservation_user_id
|
|
});
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "time_ids",
|
|
label: "\u9884\u7EA6\u65F6\u95F4",
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择预约时间'
|
|
}],
|
|
children: (options === null || options === void 0 ? void 0 : options.length) > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
style: {
|
|
width: '100%'
|
|
},
|
|
onChange: onChange,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
children: options.map(function (v, i) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 8,
|
|
className: ReservationDialogmodules.check_style,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
value: v.value,
|
|
disabled: formInfo.date == null || v.disabled,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "\n ".concat(v.is_check ? ReservationDialogmodules.check_text_style_active : ReservationDialogmodules.check_text_style, " \n ").concat(v.disabled ? ReservationDialogmodules.check_text_style_disabled : '', " \n "),
|
|
children: v.label
|
|
})
|
|
})
|
|
}, i);
|
|
})
|
|
})
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
position: 'relative',
|
|
top: '0px',
|
|
fontSize: '14px'
|
|
},
|
|
children: "\u6682\u65E0\u53EF\u9009\u65F6\u95F4\u6BB5"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "description",
|
|
label: "\u9884\u7EA6\u8BF4\u660E",
|
|
colon: false,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
|
|
rows: 4,
|
|
placeholder: "\u8BF7\u8F93\u5165\u9884\u7EA6\u8BF4\u660E"
|
|
})
|
|
}), (modalName == "调整预约" || modalName == "增加预约") && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "reservation_user_id",
|
|
label: "\u9884\u7EA6\u4EBA",
|
|
rules: [{
|
|
required: true
|
|
}],
|
|
style: {
|
|
marginTop: '-10px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
disabled: modalName == "调整预约" || (dataInfo !== null && dataInfo !== void 0 && dataInfo.reservations_id ? true : false),
|
|
showSearch: true,
|
|
filterOption: function filterOption(input, option) {
|
|
var _option$label;
|
|
var realName = (option === null || option === void 0 || (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toLowerCase()) || '';
|
|
return realName.includes(input.toLowerCase());
|
|
},
|
|
options: users
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "phone",
|
|
label: "\u9884\u7EA6\u4EBA\u7535\u8BDD",
|
|
colon: false,
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入正确的手机号',
|
|
pattern: new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/, 'g')
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u7535\u8BDD",
|
|
style: {
|
|
width: '200px'
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReservationDialogmodules.footerWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
className: "mr20",
|
|
size: "large",
|
|
onClick: function onClick() {
|
|
return onCancel();
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
size: "large",
|
|
type: "primary",
|
|
ghost: true,
|
|
htmlType: "submit",
|
|
children: "\u786E\u5B9A"
|
|
})]
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_ReservationDialog = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
var user = _ref5.user;
|
|
return {
|
|
user: user
|
|
};
|
|
})(ReservationDialog));
|
|
;
|
|
|
|
/***/ })
|
|
|
|
}]); |