|
|
|
|
@ -480,6 +480,81 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var inputRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
var _useState33 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
|
|
|
visible = _useState34[0],
|
|
|
|
|
setVisible = _useState34[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 _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var number, numberArr, res, _res$data;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.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))) {
|
|
|
|
|
_context2.next = 7;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.warning('该物资已存在申请物资列表中');
|
|
|
|
|
return _context2.abrupt("return");
|
|
|
|
|
case 7:
|
|
|
|
|
_context2.next = 9;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/yn_classrooms/substance_details/serach_by_number.json", {
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: {
|
|
|
|
|
number: myRuleForm.getFieldValue('number')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 9:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) == 0)) {
|
|
|
|
|
_context2.next = 15;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
myRuleForm.setFieldValue('number', '');
|
|
|
|
|
if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.id) {
|
|
|
|
|
warehousingList.push(res === null || res === void 0 ? void 0 : res.data);
|
|
|
|
|
setWarehousingList(toConsumableArray_default()(warehousingList));
|
|
|
|
|
message/* default */.ZP.success('添加成功');
|
|
|
|
|
setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
_context2.next = 16;
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
return _context2.abrupt("return", Promise.reject());
|
|
|
|
|
case 16:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
return function handleOk() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
getData(false);
|
|
|
|
|
}, [page]);
|
|
|
|
|
@ -493,11 +568,11 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
limit: 10000,
|
|
|
|
|
keyword: ''
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data;
|
|
|
|
|
var _res$data2;
|
|
|
|
|
setClassroomList([{
|
|
|
|
|
id: '',
|
|
|
|
|
title: '全部'
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list)));
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list)));
|
|
|
|
|
});
|
|
|
|
|
//实验室房间
|
|
|
|
|
(0,laboratory/* classroom_rooms_query */.jd)({
|
|
|
|
|
@ -506,11 +581,11 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
keyword: '',
|
|
|
|
|
classroom_id: ''
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data2;
|
|
|
|
|
var _res$data3;
|
|
|
|
|
setRoomList([{
|
|
|
|
|
id: '',
|
|
|
|
|
title: '全部'
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list)));
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list)));
|
|
|
|
|
});
|
|
|
|
|
//物资分类
|
|
|
|
|
(0,materials/* substance_categories_query */.xb)({
|
|
|
|
|
@ -518,11 +593,11 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
limit: 10000,
|
|
|
|
|
keyword: ''
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data3;
|
|
|
|
|
var _res$data4;
|
|
|
|
|
setSubstanceList([{
|
|
|
|
|
id: '',
|
|
|
|
|
title: '全部'
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list)));
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list)));
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
var getData = function getData(flag) {
|
|
|
|
|
@ -538,9 +613,9 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
substance_category_id: substanceCategoryId,
|
|
|
|
|
scrapped: itemType == 2 ? 1 : ''
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data4, _res$data5;
|
|
|
|
|
setTableData(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list);
|
|
|
|
|
setTotal(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.count);
|
|
|
|
|
var _res$data5, _res$data6;
|
|
|
|
|
setTableData(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.list);
|
|
|
|
|
setTotal(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.count);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var onShowSizeChange = function onShowSizeChange(page, size) {
|
|
|
|
|
@ -567,19 +642,19 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
|
|
|
|
|
// 确认入库
|
|
|
|
|
var confirmSubmit = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (!(warehousingList.length == 0)) {
|
|
|
|
|
_context2.next = 3;
|
|
|
|
|
_context3.next = 3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.info('请添加物资');
|
|
|
|
|
return _context2.abrupt("return");
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
case 3:
|
|
|
|
|
_context2.next = 5;
|
|
|
|
|
_context3.next = 5;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/yn_classrooms/substance_details/storing.json", {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: {
|
|
|
|
|
@ -589,7 +664,7 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 5:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success('入库成功');
|
|
|
|
|
setWarehousingList([]);
|
|
|
|
|
@ -598,12 +673,12 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}));
|
|
|
|
|
return function confirmSubmit() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
@ -684,11 +759,11 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
keyword: '',
|
|
|
|
|
classroom_id: e
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data6;
|
|
|
|
|
var _res$data7;
|
|
|
|
|
setRoomList([{
|
|
|
|
|
id: '',
|
|
|
|
|
title: '全部'
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list)));
|
|
|
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.list)));
|
|
|
|
|
});
|
|
|
|
|
setClassroomRoomId('');
|
|
|
|
|
},
|
|
|
|
|
@ -796,10 +871,10 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
open: openUpload,
|
|
|
|
|
title: "\u5BFC\u5165\u7269\u8D44",
|
|
|
|
|
width: "500px",
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var formData;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
formData = new FormData();
|
|
|
|
|
formData.append('file', fileList === null || fileList === void 0 ? void 0 : fileList[0]);
|
|
|
|
|
@ -843,9 +918,9 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
setFileList([]);
|
|
|
|
|
case 5:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}, _callee4);
|
|
|
|
|
})),
|
|
|
|
|
onCancel: function onCancel() {
|
|
|
|
|
setOpenUpload(false);
|
|
|
|
|
@ -893,7 +968,7 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
}))]
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
|
|
maskClosable: false,
|
|
|
|
|
centered: true,
|
|
|
|
|
keyboard: false,
|
|
|
|
|
@ -909,99 +984,11 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
onCancel: function onCancel() {
|
|
|
|
|
setWarehousing(false);
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: ItemAssetsListmodules.warehousing_add,
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
centered: true,
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
title: '添加',
|
|
|
|
|
icon: null,
|
|
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
|
|
className: ItemAssetsListmodules.formWrap,
|
|
|
|
|
form: myRuleForm,
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
span: 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());
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}),
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var number, numberArr, res, _res$data7;
|
|
|
|
|
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:
|
|
|
|
|
_context4.next = 9;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/yn_classrooms/substance_details/serach_by_number.json", {
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: {
|
|
|
|
|
number: myRuleForm.getFieldValue('number')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 9:
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) == 0)) {
|
|
|
|
|
_context4.next = 15;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
myRuleForm.setFieldValue('number', '');
|
|
|
|
|
if (res !== null && res !== void 0 && (_res$data7 = res.data) !== null && _res$data7 !== void 0 && _res$data7.id) {
|
|
|
|
|
warehousingList.push(res === null || res === void 0 ? void 0 : res.data);
|
|
|
|
|
setWarehousingList(toConsumableArray_default()(warehousingList));
|
|
|
|
|
message/* default */.ZP.success('添加成功');
|
|
|
|
|
}
|
|
|
|
|
_context4.next = 16;
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
return _context4.abrupt("return", Promise.reject());
|
|
|
|
|
case 16:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
return onOk;
|
|
|
|
|
}()
|
|
|
|
|
});
|
|
|
|
|
setVisible(true);
|
|
|
|
|
},
|
|
|
|
|
children: "\u589E\u52A0"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
|
|
@ -1009,13 +996,53 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
dataSource: warehousingList,
|
|
|
|
|
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: 400,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
|
|
className: ItemAssetsListmodules.formWrap,
|
|
|
|
|
form: myRuleForm,
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
span: 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 ItemAssetsList = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
|
|
var loading = _ref4.loading,
|
|
|
|
|
engineeringNavigtion = _ref4.engineeringNavigtion;
|
|
|
|
|
/* harmony default export */ var ItemAssetsList = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
|
|
var loading = _ref5.loading,
|
|
|
|
|
engineeringNavigtion = _ref5.engineeringNavigtion;
|
|
|
|
|
return objectSpread2_default()({
|
|
|
|
|
loading: loading
|
|
|
|
|
}, engineeringNavigtion);
|