Commit b824a20f authored by TZW's avatar TZW

switch

parent 4b5ff344
......@@ -2,7 +2,7 @@ import { doFetch } from '@/utils/doFetch';
import { Switch } from 'antd';
import fieldsDetail from '@/utils/fieldsDetail';
function getcolumns(ifs) {
function getcolumns(ifs, actionRef) {
return [
{
title: '供应商编号',
......@@ -130,7 +130,7 @@ function getcolumns(ifs) {
<Switch
checkedChildren="启用"
unCheckedChildren="禁用"
defaultChecked={row.status == 1}
checked={row?.status == 1}
disabled={row?.statusChangeable == 1 ? false : true}
onChange={(flag) => {
// //console.log(e);
......@@ -138,11 +138,15 @@ function getcolumns(ifs) {
doFetch({
url: '/asset/equipmentSupplier/update/status',
params: { id: row.id, status: '1' },
}).then(() => {
actionRef.current.reload();
});
} else {
doFetch({
url: '/asset/equipmentSupplier/update/status',
params: { id: row.id, status: '2' },
}).then(() => {
actionRef.current.reload();
});
}
}}
......
......@@ -293,7 +293,7 @@ function Supplier(props) {
);
};
const columns = useMemo(() => {
let defcolumn = getcolumns(false);
let defcolumn = getcolumns(false,actionRef);
defcolumn[1].render = (text, row) => {
return (
<a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment