|
|
@ -42,6 +42,7 @@ function StuffMgm(props) { |
|
|
|
const [editVisible, setEditVisible] = useState(false) |
|
|
|
const [getSelectStatus, setGetSelectStatus] = useState(true) |
|
|
|
const [addVisible, setAddVisible] = useState(false) |
|
|
|
const [deleteVisible, setDeleteVisible] = useState(false) |
|
|
|
const [getCanCaDer, setGetCanCaDer] = useState([])//区域 |
|
|
|
|
|
|
|
//物品编号 |
|
|
@ -157,8 +158,10 @@ function StuffMgm(props) { |
|
|
|
<Popover content={ |
|
|
|
<div className="operateBtn"> |
|
|
|
<div onClick={() => { CheckBtn(record) }}>查看</div> |
|
|
|
<div onClick={() => { translateBtn(record) }}> |
|
|
|
编辑</div> |
|
|
|
<div onClick={() => { translateBtn(record) }}>编辑</div> |
|
|
|
{ |
|
|
|
record.status === '1' || record.status === '2' ? <div onClick={() => { deleteBtn(record) }}>删除</div> : '' |
|
|
|
} |
|
|
|
</div>}> |
|
|
|
<button className="scheduleBtn colorBtn">操作</button> |
|
|
|
</Popover> |
|
|
@ -182,6 +185,29 @@ function StuffMgm(props) { |
|
|
|
const checkModal = () => { |
|
|
|
setCheckVisible(false) |
|
|
|
} |
|
|
|
const [getRecord, setGetRecord] = useState({}) |
|
|
|
const deleteBtn = (record) => { |
|
|
|
setGetRecord(record.id) |
|
|
|
setDeleteVisible(true) |
|
|
|
} |
|
|
|
const deleteModalBtn = () => { |
|
|
|
let data = { |
|
|
|
id: getRecord |
|
|
|
} |
|
|
|
ajax.handleDeleteData(data).then((res) => { |
|
|
|
if (res.status = 20000) { |
|
|
|
message.success('删除成功') |
|
|
|
setDeleteVisible(false) |
|
|
|
getData(formData) |
|
|
|
} else { |
|
|
|
message.error(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
//删除功能 |
|
|
|
const deleteModal = () => { |
|
|
|
setDeleteVisible(false) |
|
|
|
} |
|
|
|
//编辑弹窗 |
|
|
|
const [getEditData, setGetEditData] = useState({ |
|
|
|
region_id: null,//区域 |
|
|
@ -272,7 +298,7 @@ function StuffMgm(props) { |
|
|
|
setFormData({ |
|
|
|
...parameter |
|
|
|
}) |
|
|
|
getData({...parameter,pn: 1} ) |
|
|
|
getData({ ...parameter, pn: 1 }) |
|
|
|
} |
|
|
|
//检索数据 |
|
|
|
const getSearchData = (data = formData) => { |
|
|
@ -558,6 +584,7 @@ function StuffMgm(props) { |
|
|
|
} |
|
|
|
const placeBtn = () => { |
|
|
|
setEditVisible(false) |
|
|
|
setDeleteVisible(false) |
|
|
|
setGetEditData({ |
|
|
|
region_id: [],//区域 |
|
|
|
operatorid: '', |
|
|
@ -1084,11 +1111,11 @@ function StuffMgm(props) { |
|
|
|
} |
|
|
|
if (v === '1') { |
|
|
|
setGetSelectStatus(true) |
|
|
|
getEditData.uid='' |
|
|
|
getEditData.uid = '' |
|
|
|
} |
|
|
|
if (v === '2') { |
|
|
|
setGetSelectStatus(true) |
|
|
|
getEditData.uid='' |
|
|
|
getEditData.uid = '' |
|
|
|
} |
|
|
|
setGetEditData( |
|
|
|
Object.assign({}, getEditData, { status: v }) |
|
|
@ -1135,6 +1162,24 @@ function StuffMgm(props) { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
<Modal |
|
|
|
visible={deleteVisible} |
|
|
|
onCancel={deleteModal} |
|
|
|
footer={null} |
|
|
|
className="deleteModal" |
|
|
|
> |
|
|
|
<div className="delete"> |
|
|
|
此操作将删除该记录, 是否继续? |
|
|
|
</div> |
|
|
|
<div className="submitBtn"> |
|
|
|
<button type="primary" className="submit" onClick={() => { deleteModalBtn() }}> |
|
|
|
提交 |
|
|
|
</button> |
|
|
|
<button type="primary" className="cancel colorReset" onClick={() => { placeBtn() }}> |
|
|
|
取消 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
</> |
|
|
|
} |
|
|
|
|