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.
NewEduCoderBuild/p__Materials__Receive__inde...

1833 lines
72 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[22561],{
/***/ 61481:
/*!*******************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.6.1@@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.26.7@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(16378);
// 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.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(7657);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@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
}));
};
/**![inbox](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg4NS4yIDQ0Ni4zbC0uMi0uOC0xMTIuMi0yODUuMWMtNS0xNi4xLTE5LjktMjcuMi0zNi44LTI3LjJIMjgxLjJjLTE3IDAtMzIuMSAxMS4zLTM2LjkgMjcuNkwxMzkuNCA0NDNsLS4zLjctLjIuOGMtMS4zIDQuOS0xLjcgOS45LTEgMTQuOC0uMSAxLjYtLjIgMy4yLS4yIDQuOFY4MzBhNjAuOSA2MC45IDAgMDA2MC44IDYwLjhoNjI3LjJjMzMuNSAwIDYwLjgtMjcuMyA2MC45LTYwLjhWNDY0LjFjMC0xLjMgMC0yLjYtLjEtMy43LjQtNC45IDAtOS42LTEuMy0xNC4xem0tMjk1LjgtNDNsLS4zIDE1LjdjLS44IDQ0LjktMzEuOCA3NS4xLTc3LjEgNzUuMS0yMi4xIDAtNDEuMS03LjEtNTQuOC0yMC42UzQzNiA0NDEuMiA0MzUuNiA0MTlsLS4zLTE1LjdIMjI5LjVMMzA5IDIxMGgzOTkuMmw4MS43IDE5My4zSDU4OS40em0tMzc1IDc2LjhoMTU3LjNjMjQuMyA1Ny4xIDc2IDkwLjggMTQwLjQgOTAuOCAzMy43IDAgNjUtOS40IDkwLjMtMjcuMiAyMi4yLTE1LjYgMzkuNS0zNy40IDUwLjctNjMuNmgxNTYuNVY4MTRIMjE0LjRWNDgwLjF6IiAvPjwvc3ZnPg==) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(InboxOutlined_InboxOutlined);
if (false) {}
/* harmony default export */ var icons_InboxOutlined = (RefIcon);
/***/ }),
/***/ 39575:
/*!***********************************************************************!*\
!*** ./src/pages/Materials/MyReceive/ViewModal/index.tsx + 1 modules ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ MyReceive_ViewModal; }
});
// 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/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);
;// CONCATENATED MODULE: ./src/pages/Materials/MyReceive/ViewModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ViewModalmodules = ({"header":"header___K7sRa","header_params":"header_params___Gs4AP","header_title":"header_title___Y5kF9","file_list":"file_list___HS9MA","file_list_title":"file_list_title___KPqOu","file_list_size":"file_list_size___CdVn1","search_params":"search_params___MCFyg","search":"search___bSNN5","searchIcon":"searchIcon___zTK6f","header_button":"header_button___S7osw","header_content":"header_content___rD5qw","content_div":"content_div___vOe86"});
// 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/button/index.js
var es_button = __webpack_require__(3113);
// 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/table/index.js + 85 modules
var table = __webpack_require__(1710);
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 3 modules
var PreviewAll = __webpack_require__(59125);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(82710);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Materials/MyReceive/ViewModal/index.tsx
var unitType = {
1: '个',
2: '套',
3: '袋',
4: '条',
5: '根',
6: '升',
7: '毫升'
};
var ViewModal = function ViewModal(_ref) {
var _viewInfo$classroom_d, _viewInfo$classroom_d2, _viewInfo$classroom_d3, _viewInfo$classroom_d4;
var openViewModal = _ref.openViewModal,
viewInfo = _ref.viewInfo,
_onCancel = _ref.onCancel,
buttonMethod = _ref.buttonMethod,
onReject = _ref.onReject,
showButton = _ref.showButton;
var _useState = (0,_react_17_0_2_react.useState)({
content: "",
type: ""
}),
_useState2 = slicedToArray_default()(_useState, 2),
previewData = _useState2[0],
setPreviewData = _useState2[1];
var monacoValueRef = (0,_react_17_0_2_react.useRef)();
var columns = [{
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_total',
ellipsis: true
}, {
title: '需申请数量',
dataIndex: 'apply_num',
ellipsis: true
}];
var preview = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(item) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!((item === null || item === void 0 ? void 0 : item.file_type) === "txt")) {
_context.next = 5;
break;
}
_context.next = 3;
return (0,fetch/* default */.ZP)(item === null || item === void 0 ? void 0 : item.url, {
method: "get",
headers: {
"Content-Type": "application/xml"
}
});
case 3:
res = _context.sent;
monacoValueRef.current = res;
case 5:
setPreviewData({
type: item === null || item === void 0 ? void 0 : item.file_type,
content: item === null || item === void 0 ? void 0 : item.url
});
case 6:
case "end":
return _context.stop();
}
}, _callee);
}));
return function preview(_x) {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
maskClosable: false,
centered: true,
keyboard: false,
destroyOnClose: true,
className: "".concat(ViewModalmodules.my_modal, " modalXazy"),
closeIcon: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-fanhui"
}),
open: openViewModal,
title: "\u7533\u8BF7\u5185\u5BB9",
width: "1046px",
footer: showButton ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
buttonMethod('驳回', viewInfo);
},
children: "\u9A73\u56DE"
}, "cancel"), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: function onClick() {
buttonMethod('同意', viewInfo);
},
children: "\u540C\u610F"
}, "ok")]
}) : null,
onCancel: function onCancel(e) {
_onCancel();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "link",
style: {
position: 'absolute',
right: 8,
top: '18px'
},
onClick: function onClick() {
var _viewInfo$prove_files;
modal/* default */.Z.confirm({
title: '使用人证明',
icon: null,
width: 500,
closable: true,
centered: true,
footer: null,
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt10 mb20",
children: viewInfo === null || viewInfo === void 0 || (_viewInfo$prove_files = viewInfo.prove_files) === null || _viewInfo$prove_files === void 0 || (_viewInfo$prove_files = _viewInfo$prove_files.prove_files) === null || _viewInfo$prove_files === void 0 ? void 0 : _viewInfo$prove_files.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "align-center current mt10",
style: {
backgroundColor: "#F6F7F9",
justifyContent: 'space-between',
padding: '0 10px'
},
onClick: function onClick() {
if (item !== null && item !== void 0 && item.url) {
preview({
file_type: item === null || item === void 0 ? void 0 : item.file_type,
url: item === null || item === void 0 ? void 0 : item.url
});
}
// downLoadLink(item?.title,item?.url)
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-fujian3 font14",
style: {
color: '#000',
marginRight: '6px'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#3061D0",
fontSize: '14px'
},
children: item === null || item === void 0 ? void 0 : item.title
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
color: '#ADB2B8',
fontSize: '14px'
},
children: item === null || item === void 0 ? void 0 : item.filesize
})]
}, index);
})
})
});
},
children: "\u4F7F\u7528\u4EBA\u8BC1\u660E"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ViewModalmodules.header,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ViewModalmodules.header_params,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ViewModalmodules.header_content,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
maxWidth: "400px"
},
className: ViewModalmodules.content_div,
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#666',
marginRight: '10px'
},
children: "\u6240\u5728\u5B9E\u9A8C\u5BA4"
}), viewInfo === null || viewInfo === void 0 ? void 0 : viewInfo.classroom_title]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: (viewInfo === null || viewInfo === void 0 || (_viewInfo$classroom_d = viewInfo.classroom_directors) === null || _viewInfo$classroom_d === void 0 ? void 0 : _viewInfo$classroom_d.length) > 0 ? viewInfo === null || viewInfo === void 0 || (_viewInfo$classroom_d2 = viewInfo.classroom_directors) === null || _viewInfo$classroom_d2 === void 0 ? void 0 : _viewInfo$classroom_d2.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [item === null || item === void 0 ? void 0 : item.name, item !== null && item !== void 0 && item.phone ? "(".concat(item === null || item === void 0 ? void 0 : item.phone, ")") : "".concat(item !== null && item !== void 0 && item.mail ? "(".concat(item === null || item === void 0 ? void 0 : item.mail, ")") : '')]
});
}) : '--',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
maxWidth: "400px",
marginLeft: '40px'
},
className: ViewModalmodules.content_div,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#666',
marginRight: '10px'
},
children: "\u5B9E\u9A8C\u5BA4\u8D1F\u8D23\u4EBA"
}), (viewInfo === null || viewInfo === void 0 || (_viewInfo$classroom_d3 = viewInfo.classroom_directors) === null || _viewInfo$classroom_d3 === void 0 ? void 0 : _viewInfo$classroom_d3.length) > 0 ? viewInfo === null || viewInfo === void 0 || (_viewInfo$classroom_d4 = viewInfo.classroom_directors) === null || _viewInfo$classroom_d4 === void 0 ? void 0 : _viewInfo$classroom_d4.map(function (item, key) {
var _viewInfo$classroom_d5;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [item === null || item === void 0 ? void 0 : item.name, item !== null && item !== void 0 && item.phone ? "(".concat(item === null || item === void 0 ? void 0 : item.phone, ")") : "".concat(item !== null && item !== void 0 && item.mail ? "(".concat(item === null || item === void 0 ? void 0 : item.mail, ")") : ''), key == (viewInfo === null || viewInfo === void 0 || (_viewInfo$classroom_d5 = viewInfo.classroom_directors) === null || _viewInfo$classroom_d5 === void 0 ? void 0 : _viewInfo$classroom_d5.length) - 1 ? '' : '、']
}, key);
}) : '--']
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
width: 949,
marginBottom: '20px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
pagination: false,
dataSource: (viewInfo === null || viewInfo === void 0 ? void 0 : viewInfo.substances) || [],
columns: columns,
scroll: {
y: 400
},
rowKey: "id"
})
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
close: true,
data: previewData === null || previewData === void 0 ? void 0 : previewData.content,
type: previewData === null || previewData === void 0 ? void 0 : previewData.type,
style: {
zIndex: 99999
},
hasMask: true,
monacoEditor: {
value: monacoValueRef.current,
language: "txt",
onChange: function onChange() {},
options: {
readOnly: true,
fontSize: 14,
minimap: {
enabled: false
}
}
},
onImgDimensions: null,
onClose: function onClose() {
setPreviewData({
content: "",
type: ""
});
}
})]
});
};
/* harmony default export */ var MyReceive_ViewModal = (ViewModal);
/***/ }),
/***/ 85692:
/*!***********************************************************************!*\
!*** ./src/pages/Materials/Receive/RejectModal/index.tsx + 1 modules ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ Receive_RejectModal; }
});
// 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/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);
;// CONCATENATED MODULE: ./src/pages/Materials/Receive/RejectModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var RejectModalmodules = ({"header":"header___Oj4ns","header_params":"header_params___tUk8s","header_title":"header_title____sPmP","file_list":"file_list___APnKR","file_list_title":"file_list_title___YaZ8w","file_list_size":"file_list_size___ZlR70","search_params":"search_params___nCLFW","search":"search___QGH6b","searchIcon":"searchIcon___TURuQ","header_button":"header_button____DNCK","header_content":"header_content___x2mOT"});
// 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/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
var TextArea = __webpack_require__(1643);
// EXTERNAL MODULE: ./src/service/materials.ts
var materials = __webpack_require__(80231);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Materials/Receive/RejectModal/index.tsx
var RejectModal = function RejectModal(_ref) {
var openRejectModal = _ref.openRejectModal,
viewInfo = _ref.viewInfo,
_onCancel = _ref.onCancel;
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
textAreaVal = _useState2[0],
setTextAreaVal = _useState2[1];
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
maskClosable: false,
centered: true,
keyboard: false,
destroyOnClose: true,
className: RejectModalmodules.my_modal,
open: openRejectModal,
title: "\u9A73\u56DE\u9886\u7528\u7533\u8BF7",
width: "600px",
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!(textAreaVal.trim() === '')) {
_context.next = 3;
break;
}
message/* default */.ZP.info('请填写驳回理由');
return _context.abrupt("return");
case 3:
(0,materials/* receives_review */.vH)({
id: viewInfo === null || viewInfo === void 0 ? void 0 : viewInfo.id,
type: 1,
reason: textAreaVal.trim()
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('操作成功');
_onCancel();
}
});
case 4:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
_onCancel();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
color: '#999',
marginBottom: 10
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#E30000'
},
children: "* "
}), "\u9A73\u56DE\u7406\u7531"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {
rows: 5,
value: textAreaVal,
showCount: true,
maxLength: 200,
onChange: function onChange(e) {
return setTextAreaVal(e.target.value);
}
})]
});
};
/* harmony default export */ var Receive_RejectModal = (RejectModal);
/***/ }),
/***/ 18363:
/*!***********************************************************!*\
!*** ./src/pages/Materials/Receive/index.tsx + 3 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 */ Receive; }
});
// 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__(88271);
;// CONCATENATED MODULE: ./src/pages/Materials/Receive/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Receivemodules = ({"header_div":"header_div___TOAuG","header_title":"header_title___F8Sfr","search":"search___O4Fzu","searchIcon":"searchIcon___TKYCf","search_params":"search_params___Y4euP","search_params_left":"search_params_left___Xl4Vf","search_params_right":"search_params_right___X61pD","clear_Data":"clear_Data___J551Y","content_list":"content_list___ECJV2","content":"content___yWTqD","content_img":"content_img___rNbMV","content_name":"content_name___t7yID","content_title":"content_title___vYgzf","content_params":"content_params___fykDl","redRow":"redRow___wuTvA","warehousing_add":"warehousing_add___haNAS","titleWrap":"titleWrap___f_KoQ"});
// 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/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// 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/input/index.js + 3 modules
var input = __webpack_require__(92832);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(1710);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(58421);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/service/laboratory.ts
var laboratory = __webpack_require__(39531);
// 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/components/NoData/index.tsx
var NoData = __webpack_require__(63017);
// EXTERNAL MODULE: ./src/service/materials.ts
var materials = __webpack_require__(80231);
// EXTERNAL MODULE: ./src/pages/Materials/MyReceive/ViewModal/index.tsx + 1 modules
var ViewModal = __webpack_require__(39575);
// EXTERNAL MODULE: ./src/pages/Materials/Receive/RejectModal/index.tsx + 1 modules
var RejectModal = __webpack_require__(85692);
;// CONCATENATED MODULE: ./src/pages/Materials/Receive/ReturnModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ReturnModalmodules = ({"header":"header___YkxOv","header_params":"header_params___UJSwC","header_title":"header_title___gQX6R","file_list":"file_list___E21Cz","file_list_title":"file_list_title___SpAjN","file_list_size":"file_list_size___usvRd","search_params":"search_params___tDb0t","search":"search___WKpjd","searchIcon":"searchIcon___aGahU","header_button":"header_button___M19hu","header_content":"header_content___Wt9gU","content_div":"content_div___EwtVC"});
// EXTERNAL MODULE: ./node_modules/_react-jsbarcode@1.0.1@react-jsbarcode/lib/index.mjs
var lib = __webpack_require__(64727);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Materials/Receive/ReturnModal/index.tsx
var unitType = {
1: '个',
2: '套',
3: '袋',
4: '条',
5: '根',
6: '升',
7: '毫升'
};
var ReturnModal_ViewModal = function ViewModal(_ref) {
var viewInfo = _ref.viewInfo,
_onCancel = _ref.onCancel,
openReturnModal = _ref.openReturnModal;
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
selectedRowKeys = _useState2[0],
setSelectedRowKeys = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
rowSelection = _useState4[0],
setRowSelection = _useState4[1];
var columns = [{
title: '资产编号',
dataIndex: 'number',
ellipsis: true
}, {
title: '物资名称',
dataIndex: 'title',
ellipsis: true
}, {
title: '型号规格',
dataIndex: 'model',
ellipsis: true
}, {
title: '所在实验室房间',
dataIndex: 'classroom_room_title',
ellipsis: true
}, {
title: '条形码',
dataIndex: 'number',
width: 160,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(lib/* ReactBarcode */.e, {
value: text,
className: "barcode"
});
}
}, {
title: '单位',
dataIndex: 'unit',
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: unitType[text]
})
});
}
}, {
title: '领用数量',
dataIndex: 'apply_num',
ellipsis: true
}, {
title: '归还数量',
dataIndex: 'return_num',
ellipsis: true,
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
defaultValue: text,
type: "number",
max: record === null || record === void 0 ? void 0 : record.apply_num,
onChange: function onChange(e) {
viewInfo.substance_details[index].return_num = e.target.value;
}
});
}
}];
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
maskClosable: false,
centered: true,
keyboard: false,
destroyOnClose: true,
className: ReturnModalmodules.my_modal,
open: openReturnModal,
title: "\u786E\u8BA4\u5F52\u8FD8",
width: "1000px",
okText: "\u786E\u8BA4\u5F52\u8FD8",
onOk: function onOk(e) {
var regex = /^(?!0+(\.0*)?$)\d+(\.\d)?$/;
if ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.length) == 0) {
message/* default */.ZP.error('请选择需要归还的资产');
} else {
var flag = true;
for (var i in rowSelection) {
if (!regex.test(rowSelection[i].return_num)) {
message/* default */.ZP.error("请检查归还数量必须大于0且最多只能一位小数");
flag = false;
return false;
} else if (Number(rowSelection[i].return_num) > Number(rowSelection[i].apply_num)) {
message/* default */.ZP.error("归还数量必须小于等于领用数量");
flag = false;
return false;
}
}
if (flag) {
(0,materials/* receives_return */.nX)({
id: viewInfo === null || viewInfo === void 0 ? void 0 : viewInfo.id,
substance_details: rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.map(function (item) {
return {
id: item.id,
return_num: Number(item.return_num),
number: item === null || item === void 0 ? void 0 : item.number
};
})
}).then(function (res) {
if (res.status == 0) {
message/* default */.ZP.success('归还成功');
setSelectedRowKeys([]);
setRowSelection([]);
_onCancel();
}
});
}
}
},
onCancel: function onCancel(e) {
setSelectedRowKeys([]);
setRowSelection([]);
_onCancel();
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ReturnModalmodules.header,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ReturnModalmodules.header_params,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
width: 949,
marginBottom: '20px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
pagination: false,
dataSource: (viewInfo === null || viewInfo === void 0 ? void 0 : viewInfo.substance_details) || [],
columns: columns,
scroll: {
y: 400
},
rowKey: "id",
rowSelection: {
selectedRowKeys: selectedRowKeys,
onChange: function onChange(selectedRowKeys, rowSelection) {
setSelectedRowKeys(selectedRowKeys);
setRowSelection(rowSelection);
},
getCheckboxProps: function getCheckboxProps(record) {
return {
disabled: (record === null || record === void 0 ? void 0 : record.status) == 'unreturned' || (record === null || record === void 0 ? void 0 : record.status) == 0 ? false : true
};
}
}
})
})
})
})
});
};
/* harmony default export */ var ReturnModal = (ReturnModal_ViewModal);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(82710);
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
var MultiUpload = __webpack_require__(86618);
;// CONCATENATED MODULE: ./src/pages/Materials/Receive/index.tsx
var statusType = {
pending: '待审核',
approved: '待出库',
rejected: '已驳回',
canceled: '已取消',
returned: '已归还',
shipped: '待归还'
};
var Receive_unitType = {
1: '个',
2: '套',
3: '袋',
4: '条',
5: '根',
6: '升',
7: '毫升'
};
var Navigation = function Navigation(_ref) {
var loading = _ref.loading;
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),
status = _useState4[0],
setStatus = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
overdue = _useState6[0],
setOverdue = _useState6[1];
//实验室
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
laboratorys = _useState8[0],
setLaboratorys = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
laboratorySq = _useState10[0],
setLaboratorySq = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
openViewModal = _useState12[0],
setOpenViewModal = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
buttonShow = _useState14[0],
setButtonShow = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)({}),
_useState16 = slicedToArray_default()(_useState15, 2),
viewData = _useState16[0],
setViewData = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(false),
_useState18 = slicedToArray_default()(_useState17, 2),
openRejectModal = _useState18[0],
setOpenRejectModal = _useState18[1];
//归还
var _useState19 = (0,_react_17_0_2_react.useState)(false),
_useState20 = slicedToArray_default()(_useState19, 2),
openReturnModal = _useState20[0],
setOpenReturnModal = _useState20[1];
//分页
var _useState21 = (0,_react_17_0_2_react.useState)(0),
_useState22 = slicedToArray_default()(_useState21, 2),
total = _useState22[0],
setTotal = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)(1),
_useState24 = slicedToArray_default()(_useState23, 2),
page = _useState24[0],
setPage = _useState24[1];
var _useState25 = (0,_react_17_0_2_react.useState)(10),
_useState26 = slicedToArray_default()(_useState25, 2),
limit = _useState26[0],
setLimit = _useState26[1];
var _useState27 = (0,_react_17_0_2_react.useState)([]),
_useState28 = slicedToArray_default()(_useState27, 2),
tableData = _useState28[0],
setTableData = _useState28[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: 'IP地址',
dataIndex: 'ip',
ellipsis: true,
width: 140,
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,
width: 100,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text == 'teacher' ? '教员' : '学员',
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text == 'teacher' ? '教员' : '学员'
})
});
}
}, {
title: '手机号',
dataIndex: 'phone',
width: 120,
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: 'reason',
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: 'classroom_title',
// ellipsis: true,
// render: (text: string) => {
// return (
// <Tooltip placement="bottomLeft" title={text}>
// <span>{text}</span>
// </Tooltip>
// );
// },
// },
{
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: '预约时间',
dataIndex: 'apply_time',
ellipsis: true,
width: 130,
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: record !== null && record !== void 0 && record.start_time ? dayjs_min_default()(record === null || record === void 0 ? void 0 : record.start_time).format('YYYY-MM-DD HH:mm') : '--'
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: record !== null && record !== void 0 && record.end_time ? dayjs_min_default()(record === null || record === void 0 ? void 0 : record.end_time).format('YYYY-MM-DD HH:mm') : '--'
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: record !== null && record !== void 0 && record.overdue ? Receivemodules.redRow : '',
children: record !== null && record !== void 0 && record.start_time ? dayjs_min_default()(record === null || record === void 0 ? void 0 : record.start_time).format('YYYY-MM-DD HH:mm') : '--'
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: record !== null && record !== void 0 && record.overdue ? Receivemodules.redRow : '',
children: record !== null && record !== void 0 && record.end_time ? dayjs_min_default()(record === null || record === void 0 ? void 0 : record.end_time).format('YYYY-MM-DD HH:mm') : '--'
})]
})
});
}
},
// {
// title: '使用实验室',
// dataIndex: 'classroom_place_title',
// ellipsis: true,
// },
{
title: '使用实验室分室',
dataIndex: 'place_title',
ellipsis: true,
width: 140,
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: 'review_user_name',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text ? text : '--',
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? text : '--'
})
});
}
}, {
title: '操作',
// ellipsis: true,
width: 240,
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer"
},
onClick: function onClick() {
(0,materials/* receives_info */.Os)({
id: record.id,
only_apply_total: 1
}).then(function (res) {
setViewData(res === null || res === void 0 ? void 0 : res.data);
setOpenViewModal(true);
setButtonShow((record === null || record === void 0 ? void 0 : record.status) == 'pending' ? true : false);
});
},
children: "\u7533\u8BF7\u5185\u5BB9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer",
marginLeft: 10
},
onClick: function onClick() {
_umi_production_exports.history.push("/materials/receive/".concat(record.id, "/report"));
},
children: "\u7533\u8BF7\u62A5\u544A"
}), (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",
marginLeft: 10
},
onClick: function onClick() {
(0,materials/* receives_review */.vH)({
id: record === null || record === void 0 ? void 0 : record.id
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('操作成功');
getData(true);
}
});
},
children: "\u540C\u610F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer",
marginLeft: 10
},
onClick: function onClick() {
setViewData(record);
setOpenRejectModal(true);
},
children: "\u9A73\u56DE"
})]
}), (record === null || record === void 0 ? void 0 : record.status) == 'shipped' && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer",
marginLeft: 10
},
onClick: function onClick() {
setWarehousing(true);
setCanDelete(0);
(0,materials/* receives_info */.Os)({
id: record.id
}).then(function (res) {
var _res$data;
setOutboundList(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.substance_details);
});
},
children: "\u51FA\u5E93\u5355"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer",
marginLeft: 10
},
onClick: function onClick() {
setOpenReturnModal(true);
(0,materials/* receives_info */.Os)({
id: record.id
}).then(function (res) {
setViewData(res === null || res === void 0 ? void 0 : res.data);
});
},
children: "\u5F52\u8FD8"
})]
}), (record === null || record === void 0 ? void 0 : record.status) == 'approved' && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer",
marginLeft: 10
},
onClick: function onClick() {
setWarehousingList([]);
setViewData(record);
setWarehousing(true);
setCanDelete(1);
},
children: "\u51FA\u5E93"
})
})]
});
}
}];
//添加入库
var _useState29 = (0,_react_17_0_2_react.useState)(false),
_useState30 = slicedToArray_default()(_useState29, 2),
warehousing = _useState30[0],
setWarehousing = _useState30[1];
var _useState31 = (0,_react_17_0_2_react.useState)(0),
_useState32 = slicedToArray_default()(_useState31, 2),
canDelete = _useState32[0],
setCanDelete = _useState32[1]; // 0: 出库单 1出库 2归还入库
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
myRuleForm = _Form$useForm2[0];
var _useState33 = (0,_react_17_0_2_react.useState)([]),
_useState34 = slicedToArray_default()(_useState33, 2),
warehousingList = _useState34[0],
setWarehousingList = _useState34[1];
var _Form$useForm3 = es_form/* default */.Z.useForm(),
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
uploadForm = _Form$useForm4[0];
// 出库单
var _useState35 = (0,_react_17_0_2_react.useState)([]),
_useState36 = slicedToArray_default()(_useState35, 2),
outboundList = _useState36[0],
setOutboundList = _useState36[1];
var addColumns = [{
title: '资产编码',
dataIndex: 'number',
ellipsis: true
}, {
title: '物资名称',
dataIndex: 'title',
ellipsis: true
}, {
title: '规格型号',
dataIndex: 'model',
ellipsis: true
}, {
title: '数量',
dataIndex: !!canDelete ? 'apply_num' : 'num',
ellipsis: true
}, {
title: '单位',
dataIndex: 'unit',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: Receive_unitType[text]
});
}
}, {
title: '所在实验室',
dataIndex: !!canDelete ? 'classroom_title' : 'classroom_room_title',
ellipsis: true
}, canDelete == 2 && {
title: '所在实验室房间',
dataIndex: 'classroom_room_title',
ellipsis: true
}, {
title: '条形码',
dataIndex: 'number',
width: 160,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(lib/* ReactBarcode */.e, {
value: text,
className: "barcode"
});
}
}, !!canDelete && {
title: '操作',
width: 60,
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#165DFF',
cursor: 'pointer'
},
onClick: function onClick() {
warehousingList.splice(index, 1);
setWarehousingList(toConsumableArray_default()(warehousingList));
},
children: "\u5220\u9664"
});
}
}].filter(function (item) {
return !!item;
});
//正则校验
var validateInput = function validateInput(rule, value, callback) {
var pattern = /^[0-9a-zA-Z]+$/;
if (!pattern.test(value)) {
callback('请输入数字和字母');
} else {
callback();
}
};
(0,_react_17_0_2_react.useEffect)(function () {
//实验室
(0,laboratory/* classroom_query */.GJ)({
page: 1,
limit: 10000,
keyword: ''
}).then(function (res) {
var _res$data2;
setLaboratorys([{
id: '',
title: '全部'
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list)));
});
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
//列表查询
getData(false);
}, [page, limit]);
(0,_react_17_0_2_react.useEffect)(function () {
//列表查询
getData(true);
}, [laboratorySq, status, overdue, keyword]);
var getData = function getData(flag) {
if (flag) {
setPage(1);
}
(0,materials/* receives_query */._$)({
page: page,
limit: limit,
status: status,
overdue: overdue,
keyword: keyword,
classroom_id: laboratorySq
}).then(function (res) {
var _res$data3, _res$data4;
setTableData(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list);
setTotal(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.count);
});
};
var onShowSizeChange = function onShowSizeChange(page, size) {
setPage(page);
setLimit(size);
};
// 确认出库
var outbound = function outbound() {
setWarehousing(false);
modal/* default */.Z.confirm({
title: '上传使用人证明',
icon: null,
width: 500,
centered: true,
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
form: uploadForm,
onFinish: ( /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
var _values$prove_ids;
var prove_ids;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
prove_ids = values === null || values === void 0 || (_values$prove_ids = values.prove_ids) === null || _values$prove_ids === void 0 ? void 0 : _values$prove_ids.map(function (v) {
return v.response.id;
});
(0,materials/* submit_substance_details */.Gf)({
id: viewData === null || viewData === void 0 ? void 0 : viewData.id,
substance_detail_ids: warehousingList.map(function (item) {
return item === null || item === void 0 ? void 0 : item.id;
}),
prove_ids: prove_ids
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('出库成功');
getData(true);
}
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}()),
scrollToFirstError: true,
layout: "vertical",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "prove_ids",
label: "\u4E0A\u4F20\u6587\u4EF6",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
})
})
}),
onOk: function () {
var _onOk = 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 uploadForm.submit();
case 2:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
};
// 归还入库
var inbound = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!(warehousingList.length == 0)) {
_context3.next = 3;
break;
}
message/* default */.ZP.info('请添加物资');
return _context3.abrupt("return");
case 3:
_context3.next = 5;
return (0,fetch/* default */.ZP)("/api/yn_classrooms/receives/return_storage.json", {
method: 'post',
body: {
substance_details: warehousingList === null || warehousingList === void 0 ? void 0 : warehousingList.map(function (item) {
return {
number: item === null || item === void 0 ? void 0 : item.number,
return_num: item === null || item === void 0 ? void 0 : item.apply_num
};
})
}
});
case 5:
_context3.next = 7;
return _context3.sent;
case 7:
res = _context3.sent;
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('归还成功');
setWarehousingList([]);
getData(true);
setWarehousing(false);
}
case 9:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function inbound() {
return _ref3.apply(this, arguments);
};
}();
var inputRef = (0,_react_17_0_2_react.useRef)(null);
var _useState37 = (0,_react_17_0_2_react.useState)(false),
_useState38 = slicedToArray_default()(_useState37, 2),
visible = _useState38[0],
setVisible = _useState38[1];
// 在 Modal 打开后将焦点设置到 Input 元素上
(0,_react_17_0_2_react.useEffect)(function () {
if (visible) {
setTimeout(function () {
if (inputRef.current) {
inputRef.current.focus();
}
}, 0);
}
}, [visible]);
var handleKeyDown = function handleKeyDown(e) {
if ((e === null || e === void 0 ? void 0 : e.key) === 'Enter') {
handleOk();
}
};
var handleOk = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var number, numberArr, res, _res$data5;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return myRuleForm.validateFields();
case 2:
number = myRuleForm.getFieldValue('number');
numberArr = warehousingList === null || warehousingList === void 0 ? void 0 : warehousingList.map(function (item) {
return item.number;
});
if (!(numberArr !== null && numberArr !== void 0 && numberArr.includes(number))) {
_context4.next = 7;
break;
}
message/* default */.ZP.warning('该物资已存在申请物资列表中');
return _context4.abrupt("return");
case 7:
if (!(canDelete == 1)) {
_context4.next = 13;
break;
}
_context4.next = 10;
return (0,fetch/* default */.ZP)("/api/yn_classrooms/substance_details/search_by_stored.json", {
method: 'get',
params: {
number: myRuleForm.getFieldValue('number'),
receive_id: viewData === null || viewData === void 0 ? void 0 : viewData.id
}
});
case 10:
_context4.t0 = _context4.sent;
_context4.next = 16;
break;
case 13:
_context4.next = 15;
return (0,fetch/* default */.ZP)("/api/yn_classrooms/receives/return_detail.json", {
method: 'get',
params: {
number: myRuleForm.getFieldValue('number')
}
});
case 15:
_context4.t0 = _context4.sent;
case 16:
res = _context4.t0;
if (!((res === null || res === void 0 ? void 0 : res.status) == 0)) {
_context4.next = 21;
break;
}
// myRuleForm.setFieldValue('number', '')
if (res !== null && res !== void 0 && (_res$data5 = res.data) !== null && _res$data5 !== void 0 && _res$data5.id) {
warehousingList.push(res === null || res === void 0 ? void 0 : res.data);
setWarehousingList(toConsumableArray_default()(warehousingList));
message/* default */.ZP.success('添加成功');
setVisible(false);
}
_context4.next = 22;
break;
case 21:
return _context4.abrupt("return", Promise.reject());
case 22:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function handleOk() {
return _ref4.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Receivemodules.search_params,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Receivemodules.search_params_left,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
colon: false,
label: "\u7533\u8BF7\u5B9E\u9A8C\u5BA4",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
style: {
width: 120
},
defaultValue: laboratorySq,
value: laboratorySq,
onChange: function onChange(e) {
setLaboratorySq(e);
},
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,
label: "\u72B6\u6001",
style: {
marginLeft: '20px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
style: {
width: 120
},
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: "1",
children: "\u5F85\u5BA1\u6838"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "2",
children: "\u5F85\u5F52\u8FD8"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "3",
children: "\u5DF2\u9A73\u56DE"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "4",
children: "\u5DF2\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "5",
children: "\u5DF2\u5F52\u8FD8"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "6",
children: "\u5F85\u51FA\u5E93"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
colon: false,
label: "\u662F\u5426\u903E\u671F\u5F52\u8FD8",
style: {
marginLeft: '20px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
style: {
width: 120
},
defaultValue: overdue,
value: overdue,
onChange: function onChange(e) {
setOverdue(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: "1",
children: "\u662F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "0",
children: "\u5426"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
placeholder: "\u8BF7\u8F93\u5165\u7533\u8BF7\u4EBA/\u624B\u673A\u53F7\u8FDB\u884C\u641C\u7D22",
size: "large",
className: Receivemodules.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(Receivemodules.searchIcon),
onClick: function onClick() {
setkeyword(keyword);
getData(true);
}
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "text-wrapper_4 ",
style: {
width: '116px',
marginLeft: '20px'
},
onClick: function onClick() {
_umi_production_exports.history.push("/materials/itemAssets/AddReceiveScene/null?backUrl=/materials/receive");
},
children: "\u73B0\u573A\u7533\u9886"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "text-wrapper_4",
onClick: function onClick() {
setWarehousingList([]);
setWarehousing(true);
setCanDelete(2);
},
children: "\u5F52\u8FD8\u5165\u5E93"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "materials-table-wrp",
children: (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
pagination: false,
dataSource: tableData,
columns: columns
// scroll={{ x: 1500 }}
,
className: "materials-table"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
customText: "\u6682\u65E0\u6570\u636E"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "mr20",
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: '#c5d3f4'
},
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-white",
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)(ViewModal/* default */.Z, {
openViewModal: openViewModal,
viewInfo: viewData,
showButton: buttonShow,
buttonMethod: function buttonMethod(type, data) {
setOpenViewModal(false);
if (type == '同意') {
(0,materials/* receives_review */.vH)({
id: data === null || data === void 0 ? void 0 : data.id
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('操作成功');
getData(true);
}
});
} else if (type == '驳回') {
setViewData(data);
setOpenRejectModal(true);
}
},
onCancel: function onCancel() {
return setOpenViewModal(false);
},
onReject: function onReject() {
setOpenViewModal(false);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RejectModal/* default */.Z, {
openRejectModal: openRejectModal,
viewInfo: viewData,
onCancel: function onCancel() {
setOpenRejectModal(false);
getData(true);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ReturnModal, {
openReturnModal: openReturnModal,
viewInfo: viewData,
onCancel: function onCancel() {
setOpenReturnModal(false);
getData(true);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
maskClosable: false,
centered: true,
keyboard: false,
destroyOnClose: true
// className={styles.upload_modal}
,
open: warehousing,
title: canDelete == 2 ? '归还物资' : "\u7269\u8D28\u660E\u7EC6",
className: "".concat(Receivemodules.upload_modal, " modalXazy"),
closeIcon: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-fanhui"
}),
width: "1000px",
footer: !!canDelete ? /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: canDelete == 1 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
setWarehousing(false);
},
children: "\u53D6\u6D88"
}, "cancel"), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: function onClick() {
return outbound();
},
children: "\u786E\u8BA4\u51FA\u5E93"
}, "ok")]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
setWarehousing(false);
},
children: "\u53D6\u6D88"
}, "cancel"), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: function onClick() {
return inbound();
},
children: "\u786E\u8BA4\u5F52\u8FD8"
}, "ok")]
})
}) : null,
onCancel: function onCancel() {
setWarehousing(false);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [!!canDelete && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Receivemodules.warehousing_add,
onClick: function onClick() {
myRuleForm.setFieldValue('number', null);
setVisible(true);
},
children: "\u589E\u52A0"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
pagination: false,
dataSource: !!canDelete ? warehousingList : outboundList,
columns: addColumns
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
visible: visible,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
title: "\u6DFB\u52A0",
onOk: handleOk,
onCancel: function onCancel() {
myRuleForm.resetFields();
setVisible(false);
},
width: 760,
className: "modalXazy",
closeIcon: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-fanhui"
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
className: Receivemodules.formWrap,
form: myRuleForm,
wrapperCol: {
span: 20
},
style: {
marginTop: 20
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
colon: false,
label: "\u8D44\u4EA7\u7F16\u53F7",
name: "number",
rules: [{
required: true,
message: '请输入资产编号'
}, {
validator: validateInput,
message: '请输入数字和字母'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
size: "large",
onChange: function onChange(e) {
var _e$target;
myRuleForm.setFieldValue('number', 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());
},
ref: inputRef,
onKeyDown: handleKeyDown
})
})
})
})]
})]
});
};
/* harmony default export */ var Receive = ((0,_umi_production_exports.connect)(function (_ref5) {
var loading = _ref5.loading,
engineeringNavigtion = _ref5.engineeringNavigtion;
return objectSpread2_default()({
loading: loading
}, engineeringNavigtion);
})(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 */ 37714);
"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);
/***/ })
}]);