|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[19116],{
|
|
|
|
|
|
/***/ 25032:
|
|
|
/*!*******************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_InboxOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.25.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(33614);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/InboxOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_InboxOutlined = (InboxOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(1393);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/InboxOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var InboxOutlined_InboxOutlined = function InboxOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_InboxOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(InboxOutlined_InboxOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_InboxOutlined = (RefIcon);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 67053:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./src/pages/Materials/ItemAssets/AddProcure/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 */ AddProcure; }
|
|
|
});
|
|
|
|
|
|
// 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/_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);
|
|
|
// 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/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/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// 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/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(86859);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Materials/ItemAssets/AddProcure/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var AddProcuremodules = ({"wrap":"wrap___uDEdN","back_style":"back_style___Wh6NB","back_style_span":"back_style_span___cDr7M","header":"header___EYIbO","header_form":"header_form___axdTB","guize_select":"guize_select___zWIti","guize_update":"guize_update___FiKWW","shangchuan_button":"shangchuan_button___z7F26","shangchuan_img":"shangchuan_img___mHcZH","shangchuan_close":"shangchuan_close___sWJYn","close_button":"close_button___KyOIv","submit_button":"submit_button___ISIvd","add_button":"add_button___xX4Rr","search_params":"search_params___XFwut","search":"search___h0smH","searchIcon":"searchIcon___QdwCn"});
|
|
|
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
|
|
var laboratory = __webpack_require__(70974);
|
|
|
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 2 modules
|
|
|
var MultiUpload = __webpack_require__(1058);
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
|
var markdown_editor = __webpack_require__(77036);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(49105);
|
|
|
// EXTERNAL MODULE: ./src/service/materials.ts
|
|
|
var materials = __webpack_require__(32013);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Materials/ItemAssets/AddProcure/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var unitType = {
|
|
|
1: '个',
|
|
|
2: '套',
|
|
|
3: '袋',
|
|
|
4: '条',
|
|
|
5: '根',
|
|
|
6: '升',
|
|
|
7: '毫升'
|
|
|
};
|
|
|
var Navigation = function Navigation(_ref) {
|
|
|
var loading = _ref.loading,
|
|
|
user = _ref.user,
|
|
|
dispatch = _ref.dispatch,
|
|
|
account = _ref.account;
|
|
|
var phoneReg = /^1\d{10}$/;
|
|
|
var emailReg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
myForm = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
openRuleModal = _useState2[0],
|
|
|
setOpenRuleModal = _useState2[1]; //选择规则弹框
|
|
|
//实验室下拉
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
laboratoryLists = _useState4[0],
|
|
|
setLaboratoryLists = _useState4[1];
|
|
|
// 关联
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
containerList = _useState6[0],
|
|
|
setContainerList = _useState6[1];
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
|
|
|
//分页
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
total = _useState8[0],
|
|
|
setTotal = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
page = _useState10[0],
|
|
|
setPage = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(20),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
limit = _useState12[0],
|
|
|
setLimit = _useState12[1];
|
|
|
//物资类型 可用、报废
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
keyword = _useState14[0],
|
|
|
setkeyword = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
tableData = _useState16[0],
|
|
|
setTableData = _useState16[1];
|
|
|
//实验室、实验室房间、物资类别
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
roomList = _useState18[0],
|
|
|
setRoomList = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
classroomRoomId = _useState20[0],
|
|
|
setClassroomRoomId = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
substanceList = _useState22[0],
|
|
|
setSubstanceList = _useState22[1];
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
substanceCategoryId = _useState24[0],
|
|
|
setSubstanceCategoryId = _useState24[1];
|
|
|
//申请物资
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
modalTableData = _useState26[0],
|
|
|
setModalTableData = _useState26[1];
|
|
|
var _useState27 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
formTableData = _useState28[0],
|
|
|
setFormTableData = _useState28[1];
|
|
|
var _useState29 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
|
refresh = _useState30[0],
|
|
|
setRefresh = _useState30[1];
|
|
|
var _useState31 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
|
rowKeys = _useState32[0],
|
|
|
setRowKeys = _useState32[1];
|
|
|
var addColumns = [{
|
|
|
title: '物资编码',
|
|
|
dataIndex: 'number',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '物资名称',
|
|
|
dataIndex: 'title',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '规格型号',
|
|
|
dataIndex: 'model',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '存放实验室房间',
|
|
|
dataIndex: 'classroom_room_title',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '单位',
|
|
|
dataIndex: 'unit',
|
|
|
ellipsis: true,
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: unitType[text]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '需申请数量',
|
|
|
dataIndex: 'apply_num',
|
|
|
ellipsis: true,
|
|
|
render: function render(text, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
defaultValue: text,
|
|
|
onChange: function onChange(e) {
|
|
|
formTableData[index].apply_num = e.target.value;
|
|
|
setFormTableData(toConsumableArray_default()(formTableData));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '操作',
|
|
|
width: 60,
|
|
|
render: function render(text, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#165DFF',
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
formTableData.splice(index, 1);
|
|
|
setFormTableData(toConsumableArray_default()(formTableData));
|
|
|
},
|
|
|
children: "\u5220\u9664"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _user$userInfo, _user$userInfo2;
|
|
|
myForm.setFieldsValue({
|
|
|
phone: user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.phone,
|
|
|
mail: user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.email
|
|
|
});
|
|
|
if (searchParams.get('initId')) {
|
|
|
//从物资详情里面进入
|
|
|
(0,materials/* substances_info */.os)({
|
|
|
id: searchParams.get('initId')
|
|
|
}).then(function (res) {
|
|
|
var _res$data, _res$data2;
|
|
|
myForm.setFieldValue('classroom_id', res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.classroom_id);
|
|
|
setFormTableData([res === null || res === void 0 ? void 0 : res.data]);
|
|
|
//实验室房间
|
|
|
(0,laboratory/* user_substance_classroom_rooms */.Zd)({
|
|
|
classroom_id: res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.classroom_id
|
|
|
}).then(function (res) {
|
|
|
var _res$data3;
|
|
|
setRoomList([{
|
|
|
id: '',
|
|
|
title: '全部'
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list)));
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
if ((params === null || params === void 0 ? void 0 : params.receiveId) != 'null') {
|
|
|
//编辑
|
|
|
(0,materials/* purchases_info */.zG)({
|
|
|
id: params === null || params === void 0 ? void 0 : params.receiveId
|
|
|
}).then(function (res) {
|
|
|
var _res$data4, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, _res$data12, _res$data13, _res$data14, _res$data15, _res$data16, _res$data17, _res$data19;
|
|
|
myForm.setFieldsValue({
|
|
|
number: res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.number,
|
|
|
attachment_ids: (res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5.attachments) === null || _res$data5 === void 0 ? void 0 : _res$data5.length) > 0 ? (0,MultiUpload/* coverToFileList */.z)(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.attachments) : [],
|
|
|
classroom_id: res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.classroom_id,
|
|
|
phone: res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.phone,
|
|
|
mail: res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.mail,
|
|
|
reason: res === null || res === void 0 || (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.reason,
|
|
|
container_type: res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.container_type,
|
|
|
container_id: res === null || res === void 0 || (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : _res$data12.container_id,
|
|
|
description: res === null || res === void 0 || (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.description,
|
|
|
substances: (res === null || res === void 0 || (_res$data14 = res.data) === null || _res$data14 === void 0 || (_res$data14 = _res$data14.substances) === null || _res$data14 === void 0 ? void 0 : _res$data14.length) > 0 ? res === null || res === void 0 || (_res$data15 = res.data) === null || _res$data15 === void 0 ? void 0 : _res$data15.substances : []
|
|
|
});
|
|
|
setFormTableData(toConsumableArray_default()(res === null || res === void 0 || (_res$data16 = res.data) === null || _res$data16 === void 0 ? void 0 : _res$data16.substances));
|
|
|
//实验室房间
|
|
|
(0,laboratory/* user_substance_classroom_rooms */.Zd)({
|
|
|
classroom_id: res === null || res === void 0 || (_res$data17 = res.data) === null || _res$data17 === void 0 ? void 0 : _res$data17.classroom_id
|
|
|
}).then(function (res) {
|
|
|
var _res$data18;
|
|
|
setRoomList([{
|
|
|
id: '',
|
|
|
title: '全部'
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data18 = res.data) === null || _res$data18 === void 0 ? void 0 : _res$data18.list)));
|
|
|
});
|
|
|
getContainerList(res === null || res === void 0 || (_res$data19 = res.data) === null || _res$data19 === void 0 ? void 0 : _res$data19.container_type);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//我的实验室下拉
|
|
|
(0,laboratory/* user_substance_classrooms */.y8)({
|
|
|
type: 1
|
|
|
}).then(function (res) {
|
|
|
var _res$data20;
|
|
|
setLaboratoryLists(res === null || res === void 0 || (_res$data20 = res.data) === null || _res$data20 === void 0 ? void 0 : _res$data20.list);
|
|
|
});
|
|
|
//物资分类
|
|
|
(0,materials/* substance_categories_query */.xb)({
|
|
|
page: 1,
|
|
|
limit: 10000,
|
|
|
keyword: '',
|
|
|
is_public: 1
|
|
|
}).then(function (res) {
|
|
|
var _res$data21;
|
|
|
setSubstanceList([{
|
|
|
id: '',
|
|
|
title: '全部'
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data21 = res.data) === null || _res$data21 === void 0 ? void 0 : _res$data21.list)));
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'globalSetting/headerFooterToggle',
|
|
|
payload: false
|
|
|
});
|
|
|
return function () {
|
|
|
dispatch({
|
|
|
type: 'globalSetting/headerFooterToggle',
|
|
|
payload: true
|
|
|
});
|
|
|
};
|
|
|
}, []);
|
|
|
|
|
|
//获取关联
|
|
|
var getContainerList = function getContainerList(e) {
|
|
|
var _user$userInfo3;
|
|
|
var obj = e == 'Subject' ? 'subjects' : e == 'Shixun' ? 'shixuns' : 'courses';
|
|
|
(0,fetch/* default */.ZP)("/api/users/".concat(user === null || user === void 0 || (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login, "/").concat(obj, ".json"), {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
page: 1,
|
|
|
per_page: 1000,
|
|
|
username: user.userInfo.login
|
|
|
}
|
|
|
}).then(function (res) {
|
|
|
setContainerList(res === null || res === void 0 ? void 0 : res[obj]);
|
|
|
});
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData(false);
|
|
|
}, [page]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData(true);
|
|
|
}, [keyword, classroomRoomId, substanceCategoryId, myForm.getFieldValue('classroom_id'), limit]);
|
|
|
var getData = function getData(flag) {
|
|
|
if (flag) {
|
|
|
setPage(1);
|
|
|
}
|
|
|
(0,materials/* substances_query */.HM)({
|
|
|
page: page,
|
|
|
limit: limit,
|
|
|
keyword: keyword,
|
|
|
classroom_room_id: classroomRoomId,
|
|
|
classroom_id: myForm.getFieldValue('classroom_id'),
|
|
|
substance_category_id: substanceCategoryId,
|
|
|
scrapped: 0
|
|
|
}).then(function (res) {
|
|
|
var _res$data22, _res$data23;
|
|
|
setTableData(res === null || res === void 0 || (_res$data22 = res.data) === null || _res$data22 === void 0 || (_res$data22 = _res$data22.list) === null || _res$data22 === void 0 ? void 0 : _res$data22.map(function (item) {
|
|
|
item.key = item === null || item === void 0 ? void 0 : item.id;
|
|
|
return item;
|
|
|
}));
|
|
|
setTotal(res === null || res === void 0 || (_res$data23 = res.data) === null || _res$data23 === void 0 ? void 0 : _res$data23.count);
|
|
|
});
|
|
|
};
|
|
|
var onShowSizeChange = function onShowSizeChange(page, size) {
|
|
|
setPage(page);
|
|
|
setLimit(size);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddProcuremodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddProcuremodules.back_style,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: AddProcuremodules.back_style_span,
|
|
|
onClick: function onClick() {
|
|
|
_umi_production_exports.history.push(searchParams.get('backUrl'));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-fanhui2 font12 mr5"
|
|
|
}), "\u8FD4\u56DE"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddProcuremodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: myForm,
|
|
|
className: AddProcuremodules.header_form
|
|
|
// labelCol={{ span: 3 }}
|
|
|
,
|
|
|
wrapperCol: {
|
|
|
span: 21
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u7533\u8BF7\u539F\u56E0",
|
|
|
name: "reason",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入申请原因'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: "large",
|
|
|
showCount: true,
|
|
|
maxLength: 30,
|
|
|
onChange: function onChange(e) {
|
|
|
var _e$target;
|
|
|
myForm.setFieldValue('reason', e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.value) === null || _e$target === void 0 ? void 0 : _e$target.trim());
|
|
|
}
|
|
|
})
|
|
|
}), /*#__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",
|
|
|
name: "container_type",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
size: "large",
|
|
|
style: {
|
|
|
width: '300px'
|
|
|
},
|
|
|
onChange: function onChange(e) {
|
|
|
getContainerList(e);
|
|
|
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",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
size: "large",
|
|
|
style: {
|
|
|
marginLeft: '10px',
|
|
|
width: '714px'
|
|
|
},
|
|
|
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: "\u7533\u8BF7\u5B9E\u9A8C\u5BA4",
|
|
|
name: "classroom_id",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请选择实验室'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
size: "large",
|
|
|
onChange: function onChange(e) {
|
|
|
//实验室房间
|
|
|
(0,laboratory/* user_substance_classroom_rooms */.Zd)({
|
|
|
classroom_id: e
|
|
|
}).then(function (res) {
|
|
|
var _res$data24;
|
|
|
setRoomList([{
|
|
|
id: '',
|
|
|
title: '全部'
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data24 = res.data) === null || _res$data24 === void 0 ? void 0 : _res$data24.list)));
|
|
|
});
|
|
|
setFormTableData([]);
|
|
|
},
|
|
|
children: laboratoryLists === null || laboratoryLists === void 0 ? void 0 : laboratoryLists.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: item.id,
|
|
|
children: item.title
|
|
|
}, index);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u624B\u673A\u53F7",
|
|
|
name: "phone",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入手机号'
|
|
|
}, {
|
|
|
required: true,
|
|
|
pattern: phoneReg,
|
|
|
message: '请输入正确的手机号'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: "large"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u90AE\u7BB1",
|
|
|
name: "mail",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
pattern: emailReg,
|
|
|
message: '请输入正确的邮箱'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: "large"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u5907\u6CE8\u8BF4\u660E",
|
|
|
name: "description",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
height: 300,
|
|
|
defaultValue: myForm.getFieldValue('description') || '',
|
|
|
watch: true
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u9644\u4EF6",
|
|
|
name: "attachment_ids",
|
|
|
style: {
|
|
|
marginTop: '-15px'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u7533\u8BF7\u7269\u8D44",
|
|
|
name: "substances",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请选择申请物资'
|
|
|
}],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddProcuremodules.guize_select,
|
|
|
onClick: function onClick() {
|
|
|
if (myForm.getFieldValue('classroom_id')) {
|
|
|
setOpenRuleModal(true);
|
|
|
getData(true);
|
|
|
setModalTableData(toConsumableArray_default()(formTableData));
|
|
|
setRowKeys(toConsumableArray_default()(formTableData === null || formTableData === void 0 ? void 0 : formTableData.map(function (item) {
|
|
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
|
})));
|
|
|
} else {
|
|
|
message/* default */.ZP.error('请先选择申请实验室');
|
|
|
}
|
|
|
},
|
|
|
children: "\u6DFB\u52A0"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
scroll: {
|
|
|
y: 300
|
|
|
},
|
|
|
pagination: false,
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
dataSource: formTableData,
|
|
|
columns: addColumns
|
|
|
}, refresh)]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
marginTop: '40px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddProcuremodules.close_button,
|
|
|
onClick: function onClick() {
|
|
|
_umi_production_exports.history.push(searchParams.get('backUrl'));
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddProcuremodules.submit_button,
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var regex, i, _myForm$getFieldValue, _myForm$getFieldValue2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
regex = /^(?!0+(\.0*)?$)\d+(\.\d)?$/;
|
|
|
_context.t0 = regeneratorRuntime_default()().keys(formTableData);
|
|
|
case 2:
|
|
|
if ((_context.t1 = _context.t0()).done) {
|
|
|
_context.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
i = _context.t1.value;
|
|
|
if (regex.test(formTableData[i].apply_num)) {
|
|
|
_context.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error("请检查需申请数量,必须大于0且最多只能一位小数");
|
|
|
return _context.abrupt("return", false);
|
|
|
case 7:
|
|
|
_context.next = 2;
|
|
|
break;
|
|
|
case 9:
|
|
|
myForm.setFieldValue('substances', formTableData === null || formTableData === void 0 ? void 0 : formTableData.map(function (item) {
|
|
|
item.apply_num = Number(item === null || item === void 0 ? void 0 : item.apply_num);
|
|
|
return item;
|
|
|
}));
|
|
|
_context.next = 12;
|
|
|
return myForm.validateFields();
|
|
|
case 12:
|
|
|
if ((params === null || params === void 0 ? void 0 : params.receiveId) != 'null') {
|
|
|
//编辑
|
|
|
(0,materials/* purchases_update */.aQ)({
|
|
|
id: params === null || params === void 0 ? void 0 : params.receiveId,
|
|
|
purchase: objectSpread2_default()(objectSpread2_default()({}, myForm.getFieldsValue()), {}, {
|
|
|
attachment_ids: myForm.getFieldValue('attachment_ids') ? (_myForm$getFieldValue = myForm.getFieldValue('attachment_ids')) === null || _myForm$getFieldValue === void 0 ? void 0 : _myForm$getFieldValue.map(function (item) {
|
|
|
var _item$response;
|
|
|
return item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id;
|
|
|
}) : []
|
|
|
})
|
|
|
}).then(function (res) {
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
message/* default */.ZP.success('编辑成功');
|
|
|
_umi_production_exports.history.push(searchParams.get('backUrl'));
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
(0,materials/* purchases_create */.jc)({
|
|
|
purchase: objectSpread2_default()(objectSpread2_default()({}, myForm.getFieldsValue()), {}, {
|
|
|
attachment_ids: myForm.getFieldValue('attachment_ids') ? (_myForm$getFieldValue2 = myForm.getFieldValue('attachment_ids')) === null || _myForm$getFieldValue2 === void 0 ? void 0 : _myForm$getFieldValue2.map(function (item) {
|
|
|
var _item$response2;
|
|
|
return item === null || item === void 0 || (_item$response2 = item.response) === null || _item$response2 === void 0 ? void 0 : _item$response2.id;
|
|
|
}) : []
|
|
|
})
|
|
|
}).then(function (res) {
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
message/* default */.ZP.success('申请成功');
|
|
|
_umi_production_exports.history.push(searchParams.get('backUrl'));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
children: "\u63D0\u4EA4"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
maskClosable: false,
|
|
|
centered: true,
|
|
|
keyboard: false,
|
|
|
destroyOnClose: true,
|
|
|
className: AddProcuremodules.my_modal,
|
|
|
open: openRuleModal,
|
|
|
title: "\u9009\u62E9\u7269\u8D44",
|
|
|
width: "1000px",
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var i, j;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
//去重保存已选的值的 需申请数据
|
|
|
for (i in modalTableData) {
|
|
|
for (j in formTableData) {
|
|
|
if (formTableData[j].id == modalTableData[i].id) {
|
|
|
modalTableData[i] = formTableData[j];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
setFormTableData(toConsumableArray_default()(modalTableData));
|
|
|
setOpenRuleModal(false);
|
|
|
setRefresh(new Date());
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setOpenRuleModal(false);
|
|
|
setRefresh(new Date());
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddProcuremodules.search_params,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u5B9E\u9A8C\u5BA4\u623F\u95F4",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
style: {
|
|
|
width: 140
|
|
|
},
|
|
|
defaultValue: classroomRoomId,
|
|
|
value: classroomRoomId,
|
|
|
onChange: function onChange(e) {
|
|
|
setClassroomRoomId(e);
|
|
|
},
|
|
|
children: roomList === null || roomList === void 0 ? void 0 : roomList.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: "\u7269\u8D44\u7C7B\u522B",
|
|
|
style: {
|
|
|
marginLeft: '20px'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
style: {
|
|
|
width: 140
|
|
|
},
|
|
|
defaultValue: substanceCategoryId,
|
|
|
value: substanceCategoryId,
|
|
|
onChange: function onChange(e) {
|
|
|
setSubstanceCategoryId(e);
|
|
|
},
|
|
|
children: substanceList === null || substanceList === void 0 ? void 0 : substanceList.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)(input/* default */.Z.Search, {
|
|
|
placeholder: "\u8BF7\u641C\u7D22\u540D\u79F0/\u7269\u8D44\u7F16\u53F7",
|
|
|
size: "large",
|
|
|
className: AddProcuremodules.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(AddProcuremodules.searchIcon),
|
|
|
onClick: function onClick() {
|
|
|
setkeyword(keyword);
|
|
|
getData(true);
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
rowSelection: {
|
|
|
type: 'checkbox',
|
|
|
selectedRowKeys: rowKeys,
|
|
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
|
return {
|
|
|
checked: rowKeys.includes(record.key)
|
|
|
};
|
|
|
},
|
|
|
onChange: function onChange(id, info) {
|
|
|
var updatedInfoArr;
|
|
|
if ((id === null || id === void 0 ? void 0 : id.length) === 0) {
|
|
|
var idArr = tableData.map(function (item) {
|
|
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
|
});
|
|
|
var tData = tableData.filter(function (obj) {
|
|
|
return idArr.includes(obj.id);
|
|
|
});
|
|
|
updatedInfoArr = [].concat(toConsumableArray_default()(modalTableData), toConsumableArray_default()(tData)).filter(function (item, index, arr) {
|
|
|
return arr.findIndex(function (item2) {
|
|
|
return (item2 === null || item2 === void 0 ? void 0 : item2.id) === item.id;
|
|
|
}) === index;
|
|
|
});
|
|
|
setRowKeys(rowKeys.filter(function (x) {
|
|
|
return !idArr.includes(x);
|
|
|
}));
|
|
|
} else {
|
|
|
var _tData = tableData.filter(function (obj) {
|
|
|
return !id.includes(obj.id);
|
|
|
});
|
|
|
updatedInfoArr = [].concat(toConsumableArray_default()(modalTableData), toConsumableArray_default()(info)).filter(function (obj) {
|
|
|
return !_tData.map(function (item) {
|
|
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
|
}).includes(obj.id);
|
|
|
});
|
|
|
updatedInfoArr = updatedInfoArr.filter(function (item, index, arr) {
|
|
|
return arr.findIndex(function (item2) {
|
|
|
return (item2 === null || item2 === void 0 ? void 0 : item2.id) === item.id;
|
|
|
}) === index;
|
|
|
});
|
|
|
setRowKeys(Array.from(new Set([].concat(toConsumableArray_default()(rowKeys), toConsumableArray_default()(id)))));
|
|
|
}
|
|
|
setModalTableData(updatedInfoArr);
|
|
|
},
|
|
|
onSelect: function onSelect(record, selected) {
|
|
|
if (selected) {
|
|
|
//添加
|
|
|
setModalTableData([].concat(toConsumableArray_default()(modalTableData), [record]));
|
|
|
setRowKeys([].concat(toConsumableArray_default()(rowKeys), [record === null || record === void 0 ? void 0 : record.id]));
|
|
|
} else {
|
|
|
//删除
|
|
|
for (var i = 0; i < (rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys.length); i++) {
|
|
|
if (rowKeys[i] == (record === null || record === void 0 ? void 0 : record.id)) {
|
|
|
rowKeys.splice(i, 1);
|
|
|
modalTableData.splice(i, 1);
|
|
|
}
|
|
|
}
|
|
|
setModalTableData(toConsumableArray_default()(modalTableData));
|
|
|
setRowKeys(toConsumableArray_default()(rowKeys));
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
scroll: {
|
|
|
y: 300
|
|
|
},
|
|
|
pagination: false,
|
|
|
dataSource: tableData,
|
|
|
columns: [{
|
|
|
title: '物资编号',
|
|
|
dataIndex: 'number',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '物资名称',
|
|
|
dataIndex: 'title',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '型号规格',
|
|
|
dataIndex: 'model',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '可申请数量',
|
|
|
dataIndex: 'apply_total',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '物资类别',
|
|
|
dataIndex: 'substance_category_title',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '实验室房间',
|
|
|
dataIndex: 'classroom_room_title',
|
|
|
ellipsis: true
|
|
|
}]
|
|
|
}), /*#__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: ['20', '50', '100'],
|
|
|
current: page || 1,
|
|
|
pageSize: limit || 20,
|
|
|
defaultPageSize: 20,
|
|
|
total: total
|
|
|
})]
|
|
|
}) : ''
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var AddProcure = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var loading = _ref4.loading,
|
|
|
user = _ref4.user,
|
|
|
engineeringNavigtion = _ref4.engineeringNavigtion,
|
|
|
dispatch = _ref4.dispatch,
|
|
|
account = _ref4.account;
|
|
|
return objectSpread2_default()(objectSpread2_default()({
|
|
|
loading: loading,
|
|
|
user: user
|
|
|
}, engineeringNavigtion), {}, {
|
|
|
dispatch: dispatch,
|
|
|
account: account
|
|
|
});
|
|
|
})(Navigation));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 60028:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/upload/index.js ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _Dragger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dragger */ 71409);
|
|
|
/* harmony import */ var _Upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Upload */ 81376);
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Upload = _Upload__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z;
|
|
|
Upload.Dragger = _Dragger__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
|
|
|
Upload.LIST_IGNORE = _Upload__WEBPACK_IMPORTED_MODULE_0__/* .LIST_IGNORE */ .E;
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Upload);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |