|
|
|
|
@ -410,6 +410,7 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
_useState40 = slicedToArray_default()(_useState39, 2),
|
|
|
|
|
historyData = _useState40[0],
|
|
|
|
|
setHistoryData = _useState40[1];
|
|
|
|
|
var reasonRef = (0,_react_17_0_2_react.useRef)(reason); // 用来存储最新的 reason
|
|
|
|
|
|
|
|
|
|
//资产表格
|
|
|
|
|
var columns = [{
|
|
|
|
|
@ -503,6 +504,20 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, searchParams.get('indexType') == '2' && {
|
|
|
|
|
title: '报废原因',
|
|
|
|
|
width: 150,
|
|
|
|
|
dataIndex: 'scrapped_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: 'image',
|
|
|
|
|
@ -572,9 +587,10 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
style: {
|
|
|
|
|
marginTop: '10px'
|
|
|
|
|
},
|
|
|
|
|
defaultValue: reason,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
return setReason(e.target.value);
|
|
|
|
|
var newReason = e.target.value;
|
|
|
|
|
setReason(newReason);
|
|
|
|
|
reasonRef.current = newReason;
|
|
|
|
|
},
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u62A5\u5E9F\u539F\u56E0"
|
|
|
|
|
})]
|
|
|
|
|
@ -586,12 +602,13 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
case 0:
|
|
|
|
|
(0,materials/* substance_details_scrapped */.FA)({
|
|
|
|
|
id: record === null || record === void 0 ? void 0 : record.id,
|
|
|
|
|
reason: reason
|
|
|
|
|
reason: reasonRef.current
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
message/* default */.ZP.success('报废成功');
|
|
|
|
|
getData(true);
|
|
|
|
|
setReason('');
|
|
|
|
|
setReason(''); // 清空输入框
|
|
|
|
|
reasonRef.current = ''; // 清空 reasonRef
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 1:
|
|
|
|
|
@ -611,7 +628,8 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setReason('');
|
|
|
|
|
case 1:
|
|
|
|
|
reasonRef.current = '';
|
|
|
|
|
case 2:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|