feat(): 实施过程记录联调
parent
bedf26d9a6
commit
96970ad8cc
|
|
@ -74,7 +74,7 @@ export default function FileUpload({ mode, setFileIds, files, downloadUrl, uploa
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mode != "save" && files) {
|
if (mode != "save" && files) {
|
||||||
setFileList(files.map(file => ({ ...file, name: file.fileName, response: { data: { name: file.fileName, fileId: file.fileId,filePath:file.filePath } } })))
|
setFileList(files.map(file => ({ ...file, name: file.fileName, response: { data: { name: file.fileName, fileId: file.fileId,filePath:file.filePath } } })))
|
||||||
setFileIds(files.map(item => ({fileId:item.response?.data?.fileId})))
|
setFileIds(files.map(item => ({fileId:item.fileId})))
|
||||||
}
|
}
|
||||||
}, [mode, files])
|
}, [mode, files])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const service_ykz = '/gunshiApp/ykz'
|
||||||
const apiurl = {
|
const apiurl = {
|
||||||
setMenu: service_fxdd + '/visitMenuLog/insert',
|
setMenu: service_fxdd + '/visitMenuLog/insert',
|
||||||
setPassword: service_fxdd + '/user/updateSecretKey',
|
setPassword: service_fxdd + '/user/updateSecretKey',
|
||||||
xytlogin: {
|
login: {
|
||||||
login: service_xyt + '/login',
|
login: service_xyt + '/login',
|
||||||
info: service_xyt + '/getInfo',
|
info: service_xyt + '/getInfo',
|
||||||
router: service_xyt + '/getRouters',
|
router: service_xyt + '/getRouters',
|
||||||
|
|
@ -39,7 +39,7 @@ const apiurl = {
|
||||||
delete: service_ykz + '/implementProcessRecord/del',
|
delete: service_ykz + '/implementProcessRecord/del',
|
||||||
uploadUrl: service_ykz + '/implementProcessRecord/file/upload/singleSimple',
|
uploadUrl: service_ykz + '/implementProcessRecord/file/upload/singleSimple',
|
||||||
downloadUrl: service_ykz + '/implementProcessRecord/file/download',
|
downloadUrl: service_ykz + '/implementProcessRecord/file/download',
|
||||||
list:service_ykz + '/implementProcessRecord/list'
|
list: service_ykz + '//maintainPlan/list'
|
||||||
},
|
},
|
||||||
whxmys: {
|
whxmys: {
|
||||||
page: service_ykz + '/maintainProjectCheck/page',
|
page: service_ykz + '/maintainProjectCheck/page',
|
||||||
|
|
@ -55,7 +55,30 @@ const apiurl = {
|
||||||
edit: service_ykz + '/purchaseLedger/update',
|
edit: service_ykz + '/purchaseLedger/update',
|
||||||
delete: service_ykz + '/purchaseLedger/del',
|
delete: service_ykz + '/purchaseLedger/del',
|
||||||
uploadUrl: service_ykz + '/purchaseLedger/file/upload/singleSimple',
|
uploadUrl: service_ykz + '/purchaseLedger/file/upload/singleSimple',
|
||||||
downloadUrl:service_ykz + '/purchaseLedger/file/download'
|
downloadUrl: service_ykz + '/purchaseLedger/file/download',
|
||||||
|
export:service_ykz + '/purchaseLedger/export'
|
||||||
|
},
|
||||||
|
kchsgl: {
|
||||||
|
page: service_ykz + '/stockRecord/page',
|
||||||
|
save: service_ykz + '/stockRecord/insert',
|
||||||
|
edit: service_ykz + '/stockRecord/update',
|
||||||
|
delete: service_ykz + '/stockRecord/del',
|
||||||
|
uploadUrl: service_ykz + '/stockRecord/file/upload/singleSimple',
|
||||||
|
downloadUrl: service_ykz + '/stockRecord/file/download',
|
||||||
|
export:service_ykz + '/stockRecord/export'
|
||||||
|
},
|
||||||
|
spbjgl: {
|
||||||
|
page: service_ykz + '/sparePartsInfo/page',
|
||||||
|
save: service_ykz + '/sparePartsInfo/insert',
|
||||||
|
edit: service_ykz + '/sparePartsInfo/update',
|
||||||
|
delete: service_ykz + '/sparePartsInfo/del',
|
||||||
|
tree: service_ykz + "/sparePartsClassify/tree",
|
||||||
|
saveTree: service_ykz + "/sparePartsClassify/insert",
|
||||||
|
editTree: service_ykz + "/sparePartsClassify/update",
|
||||||
|
deleteTree: service_ykz + "/sparePartsClassify/del",
|
||||||
|
uploadUrl: service_ykz + '/sparePartsInfo/file/upload/singleSimple',
|
||||||
|
downloadUrl: service_ykz + '/sparePartsInfo/file/download',
|
||||||
|
export:service_ykz + '/sparePartsInfo/export'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export async function getXjTreeData(params = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getjdTreeData(params = {}) {
|
export async function getjdTreeData(params = {}) {
|
||||||
const { data, code, msg } = await httppost2(apiurl.rcgl.jdkh.khzbgl.tree) || {};
|
const { data, code, msg } = await httppost2(apiurl.sbwh.spbjgl.tree) || {};
|
||||||
if (code !== 200) {
|
if (code !== 200) {
|
||||||
message.error(msg || '请求失败');
|
message.error(msg || '请求失败');
|
||||||
return [];
|
return [];
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ module.exports = function (app) {
|
||||||
app.use(
|
app.use(
|
||||||
'/gunshiApp',
|
'/gunshiApp',
|
||||||
createProxyMiddleware({
|
createProxyMiddleware({
|
||||||
// target: 'http://local.gunshiiot.com:18083/',//测试
|
target: 'http://local.gunshiiot.com:18083/',//测试
|
||||||
target: 'http://192.168.66.7:24106/',//正式
|
// target: 'http://192.168.66.7:24106/',//正式
|
||||||
// target: 'http://36.139.207.50:18083/',//移动云
|
// target: 'http://36.139.207.50:18083/',//移动云
|
||||||
// target: 'http://192.168.66.49:24105/',//移动云
|
// target: 'http://192.168.66.49:24105/',//移动云
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import Ssgcjl from "./Sbwh/Ssgcjl";
|
||||||
import Whxmys from "./Sbwh/Whxmys";
|
import Whxmys from "./Sbwh/Whxmys";
|
||||||
import Cgtzgl from "./Sbwh/Cgtzgl";
|
import Cgtzgl from "./Sbwh/Cgtzgl";
|
||||||
import Kchsgl from "./Sbwh/Kchsgl";
|
import Kchsgl from "./Sbwh/Kchsgl";
|
||||||
|
import Spbjgl from "./Sbwh/Spbjgl";
|
||||||
import BasicSituation from "./Gcyx/InformationSearch/BasicSituation";
|
import BasicSituation from "./Gcyx/InformationSearch/BasicSituation";
|
||||||
import RunSituation from "./Gcyx/InformationSearch/RunSituation";
|
import RunSituation from "./Gcyx/InformationSearch/RunSituation";
|
||||||
import StaticTable from "./Gcyx/InformationSearch/StaticTable";
|
import StaticTable from "./Gcyx/InformationSearch/StaticTable";
|
||||||
|
|
@ -50,6 +51,7 @@ const AppRouters: React.FC = () => {
|
||||||
{ path: 'sbwh/wxyhgl/whxmys', element: <Whxmys /> },
|
{ path: 'sbwh/wxyhgl/whxmys', element: <Whxmys /> },
|
||||||
{ path: 'sbwh/sbwzgl/cgtzgl', element: <Cgtzgl /> },
|
{ path: 'sbwh/sbwzgl/cgtzgl', element: <Cgtzgl /> },
|
||||||
{ path: 'sbwh/sbwzgl/kchsgl', element: <Kchsgl /> },
|
{ path: 'sbwh/sbwzgl/kchsgl', element: <Kchsgl /> },
|
||||||
|
{ path: 'sbwh/sbwzgl/bpbjgl', element: <Spbjgl /> },
|
||||||
// 工程运行
|
// 工程运行
|
||||||
{ path: 'gcyx/xxcx/jbqk', element: <BasicSituation /> },
|
{ path: 'gcyx/xxcx/jbqk', element: <BasicSituation /> },
|
||||||
{ path: 'gcyx/xxcx/yxqk', element: <RunSituation /> },
|
{ path: 'gcyx/xxcx/yxqk', element: <RunSituation /> },
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
showTime
|
showTime
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
{timeType == 0 ?
|
{timeType == 0 ?
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
/>: timeType == 1 ?
|
/>: timeType == 1 ?
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,16 @@ import apiUrl from '../../service/apiurl'
|
||||||
// return res
|
// return res
|
||||||
// }
|
// }
|
||||||
export const login = async (params) => {
|
export const login = async (params) => {
|
||||||
const res = await httppost2(apiUrl.xytlogin.login, params)
|
const res = await httppost2(apiUrl.login.login, params)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
export const info = async (params) => {
|
export const info = async (params) => {
|
||||||
const res = await xyt_httpget2(apiUrl.xytlogin.info, params)
|
const res = await xyt_httpget2(apiUrl.login.info, params)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
export const router = async (params) => {
|
export const router = async (params) => {
|
||||||
const res = await xyt_httpget2(apiUrl.xytlogin.router, params)
|
const res = await xyt_httpget2(apiUrl.login.router, params)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,18 +26,51 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
value: 2
|
value: 2
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const goodsTypeList = [
|
||||||
|
{
|
||||||
|
label: "防汛物资",
|
||||||
|
value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "食品和饮水",
|
||||||
|
value: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "防护用具",
|
||||||
|
value: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "照明设备",
|
||||||
|
value: 3
|
||||||
|
}, {
|
||||||
|
label: "金属材料类",
|
||||||
|
value: 4
|
||||||
|
}, {
|
||||||
|
label: "其它",
|
||||||
|
value: 5
|
||||||
|
},
|
||||||
|
]
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileIds, setFileIds] = useState()
|
const [fileIds, setFileIds] = useState()
|
||||||
const onfinish = (values) => {
|
const onfinish = (values) => {
|
||||||
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
|
const userId = localStorage.getItem('userId')
|
||||||
if (mode === 'edit') {
|
const userName = localStorage.getItem('userName')
|
||||||
|
values.createUserId = userId;
|
||||||
|
values.createUserName = userName;
|
||||||
|
values.purchaseTime = values.purchaseTime ? moment(values.purchaseTime).format("YYYY-MM-DD 00:00:00") : ''
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
values.id = record.id;
|
if (mode === 'edit') {
|
||||||
onEdit(apiurl.rcgl.gcdsj.edit,values)
|
onEdit(apiurl.sbwh.cgtzgl.edit, {...record, ...values})
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
values.files = fileIds
|
onSave(apiurl.sbwh.cgtzgl.save, values)
|
||||||
onSave(apiurl.rcgl.gcdsj.save,values)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const onValuesChange = (v,vv) => {
|
||||||
|
if (vv.quantity && vv.unitPrice) {
|
||||||
|
form.setFieldValue('totalPrice',vv.quantity * vv.unitPrice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,12 +81,13 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
{...formItemLayout}
|
{...formItemLayout}
|
||||||
onFinish={onfinish}
|
onFinish={onfinish}
|
||||||
initialValues={record}
|
initialValues={record}
|
||||||
|
onValuesChange={onValuesChange}
|
||||||
>
|
>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目名称"
|
label="物资名称"
|
||||||
name="name"
|
name="goodsName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
|
@ -61,81 +95,82 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="方案名称"
|
label="类别"
|
||||||
name="name"
|
name="goodsType"
|
||||||
rules={[{ required: true }]}
|
|
||||||
>
|
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item
|
|
||||||
label="项目地点"
|
|
||||||
name="adress"
|
|
||||||
>
|
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item
|
|
||||||
label="项目负责人"
|
|
||||||
name="name"
|
|
||||||
>
|
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item
|
|
||||||
label="维护类型"
|
|
||||||
name="type"
|
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<NormalSelect
|
<NormalSelect
|
||||||
allowClear
|
allowClear
|
||||||
disabled={mode === 'view'}
|
disabled={mode === 'view'}
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
options={types}
|
options={goodsTypeList}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item
|
|
||||||
label="计划维护时间"
|
|
||||||
name="eventsDate"
|
|
||||||
getValueFromEvent={(e,dateString) => dateString}
|
|
||||||
getValueProps={(value) => {
|
|
||||||
return {
|
|
||||||
value: value ? [value[0]&&moment(value[0]),value[1]&&moment(value[1])] : undefined
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<RangePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="维护内容"
|
label="规格型号"
|
||||||
name="eventsDesc"
|
name="specs"
|
||||||
labelCol={{ span: 3 }}
|
|
||||||
wrapperCol={{ span: 19 }}
|
|
||||||
>
|
>
|
||||||
<Input.TextArea disabled={mode==='view'} style={{width:'100%',minHeight:'100px'}} allowClear />
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="数量"
|
||||||
|
name="quantity"
|
||||||
|
>
|
||||||
|
<InputNumber min={0} disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="费用预估(元)"
|
label="计量单位"
|
||||||
name="eventsDesc"
|
name="unit"
|
||||||
|
>
|
||||||
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="单价(元)"
|
||||||
|
name="unitPrice"
|
||||||
|
>
|
||||||
|
<InputNumber min={0} disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="总价(元)"
|
||||||
|
name="totalPrice"
|
||||||
|
>
|
||||||
|
<InputNumber min={0} disabled={true} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="采购时间"
|
||||||
|
name="purchaseTime"
|
||||||
|
getValueFromEvent={(e,dateString) => dateString}
|
||||||
|
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
|
||||||
|
>
|
||||||
|
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="供方名称"
|
||||||
|
name="supplierName"
|
||||||
>
|
>
|
||||||
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -151,6 +186,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
uploadUrl={apiurl.sbwh.cgtzgl.uploadUrl}
|
||||||
|
downloadUrl={apiurl.sbwh.cgtzgl.downloadUrl}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
files={record?.files}
|
files={record?.files}
|
||||||
setFileIds={setFileIds}
|
setFileIds={setFileIds}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ const Page = () => {
|
||||||
{ title: '数量', key: 'quantity', dataIndex: 'quantity', width: 140},
|
{ title: '数量', key: 'quantity', dataIndex: 'quantity', width: 140},
|
||||||
{ title: '计量单位', key: 'unit', dataIndex: 'unit', width: 140},
|
{ title: '计量单位', key: 'unit', dataIndex: 'unit', width: 140},
|
||||||
{ title: '单价(元)', key: 'unitPrice', dataIndex: 'unitPrice', width: 140},
|
{ title: '单价(元)', key: 'unitPrice', dataIndex: 'unitPrice', width: 140},
|
||||||
|
{
|
||||||
|
title: '总价(元)', key: 'totalPrice', dataIndex: 'totalPrice', width: 140},
|
||||||
{
|
{
|
||||||
title: '采购时间', key: 'purchaseTime', dataIndex: 'purchaseTime', width: 150,
|
title: '采购时间', key: 'purchaseTime', dataIndex: 'purchaseTime', width: 150,
|
||||||
},
|
},
|
||||||
|
|
@ -79,7 +81,7 @@ const Page = () => {
|
||||||
let params = {
|
let params = {
|
||||||
...searchVal,
|
...searchVal,
|
||||||
}
|
}
|
||||||
httppost5(apiurl.pxjh.export, params).then(res => {
|
httppost5(apiurl.sbwh.cgtzgl.export, params).then(res => {
|
||||||
exportFile(`采购台账管理.xlsx`,res.data)
|
exportFile(`采购台账管理.xlsx`,res.data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +97,7 @@ const Page = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
|
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
|
||||||
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
||||||
<Card className='nonebox'>
|
<Card className='nonebox'>
|
||||||
<ToolBar
|
<ToolBar
|
||||||
|
|
@ -112,7 +114,7 @@ const Page = () => {
|
||||||
<BasicCrudModal
|
<BasicCrudModal
|
||||||
width={1000}
|
width={1000}
|
||||||
ref={refModal}
|
ref={refModal}
|
||||||
title="维护方案"
|
title="采购台账"
|
||||||
component={ModalForm}
|
component={ModalForm}
|
||||||
onCrudSuccess={successCallback}
|
onCrudSuccess={successCallback}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,10 @@
|
||||||
import React,{useEffect,useState,useMemo,useRef} from 'react';
|
import React,{useEffect,useState,useMemo,useRef} from 'react';
|
||||||
import { Form, Button, Input, Row,Upload, Col, Table, DatePicker, InputNumber,message,Image,Modal,Typography ,Popconfirm } from 'antd';
|
import { Form, Button, Input, Row,Upload, Col, Table, DatePicker, InputNumber,message,Image,Modal,Typography ,Popconfirm } from 'antd';
|
||||||
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
|
|
||||||
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
||||||
|
|
||||||
import apiurl from '../../../service/apiurl';
|
import apiurl from '../../../service/apiurl';
|
||||||
import FileUpload from '../../../components/fileUpload';
|
import FileUpload from '../../../components/fileUpload';
|
||||||
import NormalSelect from '../../../components/Form/NormalSelect';
|
import NormalSelect from '../../../components/Form/NormalSelect';
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
import moment from 'moment';
|
|
||||||
const { RangePicker } = DatePicker
|
|
||||||
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
|
||||||
|
|
||||||
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
const types = [
|
const types = [
|
||||||
|
|
@ -50,15 +44,16 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileIds, setFileIds] = useState()
|
const [fileIds, setFileIds] = useState()
|
||||||
const onfinish = (values) => {
|
const onfinish = (values) => {
|
||||||
values.eventsDate = values.eventsDate?moment(values.eventsDate).format("YYYY-MM-DD 00:00:00"):''
|
const userId = localStorage.getItem('userId')
|
||||||
if (mode === 'edit') {
|
const userName = localStorage.getItem('userName')
|
||||||
|
values.createUserId = userId;
|
||||||
|
values.createUserName = userName;
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
values.id = record.id;
|
if (mode === 'edit') {
|
||||||
onEdit(apiurl.rcgl.gcdsj.edit,values)
|
onEdit(apiurl.sbwh.kchsgl.edit,{...record,...values});
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
values.files = fileIds
|
onSave(apiurl.sbwh.kchsgl.save,values)
|
||||||
onSave(apiurl.rcgl.gcdsj.save,values)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,7 +69,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="物资名称"
|
label="物资名称"
|
||||||
name="name"
|
name="goodsName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
|
|
@ -100,7 +95,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="类别"
|
label="类别"
|
||||||
name="type"
|
name="goodsType"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<NormalSelect
|
<NormalSelect
|
||||||
|
|
@ -114,7 +109,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="规格型号"
|
label="规格型号"
|
||||||
name="name"
|
name="specs"
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -124,7 +119,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="记录数量"
|
label="记录数量"
|
||||||
name="type"
|
name="quantity"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<InputNumber isabled={mode==='view'} style={{width:'100%'}} allowClear/>
|
<InputNumber isabled={mode==='view'} style={{width:'100%'}} allowClear/>
|
||||||
|
|
@ -133,7 +128,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="计量单位"
|
label="计量单位"
|
||||||
name="eventsDate"
|
name="unit"
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -144,7 +139,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="备注"
|
label="备注"
|
||||||
name="eventsDesc"
|
name="remark"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
|
|
@ -162,6 +157,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
uploadUrl={apiurl.sbwh.kchsgl.uploadUrl}
|
||||||
|
downloadUrl={apiurl.sbwh.kchsgl.downloadUrl}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
files={record?.files}
|
files={record?.files}
|
||||||
setFileIds={setFileIds}
|
setFileIds={setFileIds}
|
||||||
|
|
|
||||||
|
|
@ -29,21 +29,21 @@ const Page = () => {
|
||||||
const [searchVal, setSearchVal] = useState(false)
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
||||||
{ title: '物资名称', key: 'name', dataIndex: 'name', width: 150, ellipsis: true },
|
{ title: '物资名称', key: 'goodsName', dataIndex: 'goodsName', width: 150, ellipsis: true },
|
||||||
{
|
{
|
||||||
title: '类型', key: 'type', dataIndex: 'type', width: 140,
|
title: '类型', key: 'type', dataIndex: 'type', width: 140,
|
||||||
render: (value) => <span>{types1[value]}</span>,
|
render: (value) => <span>{types1[value]}</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '类别', key: 'type', dataIndex: 'type', width: 140,
|
title: '类别', key: 'goodsType', dataIndex: 'goodsType', width: 140,
|
||||||
render: (value) => <span>{types[value]}</span>,
|
render: (value) => <span>{types[value]}</span>,
|
||||||
},
|
},
|
||||||
{ title: '规格型号', key: 'adress', dataIndex: 'adress', width: 150, ellipsis: true },
|
{ title: '规格型号', key: 'specs', dataIndex: 'specs', width: 150, ellipsis: true },
|
||||||
{ title: '记录数量', key: 'type', dataIndex: 'type', width: 140},
|
{ title: '记录数量', key: 'quantity', dataIndex: 'quantity', width: 140 },
|
||||||
{ title: '计量单位', key: 'type', dataIndex: 'type', width: 140},
|
{ title: '计量单位', key: 'unit', dataIndex: 'unit', width: 140 },
|
||||||
{ title: '记录人', key: 'type', dataIndex: 'type', width: 140},
|
{ title: '记录人', key: 'createUserName', dataIndex: 'createUserName', width: 140 },
|
||||||
{
|
{
|
||||||
title: '记录时间', key: 'eventsDate', dataIndex: 'eventsDate', width: 150,
|
title: '记录时间', key: 'createTime', dataIndex: 'createTime', width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作', key: 'operation', width: 200, fixed: 'right', align: 'center',
|
title: '操作', key: 'operation', width: 200, fixed: 'right', align: 'center',
|
||||||
|
|
@ -67,13 +67,13 @@ const Page = () => {
|
||||||
} else if (type === 'view') {
|
} else if (type === 'view') {
|
||||||
refModal.current.showView(params);
|
refModal.current.showView(params);
|
||||||
} else if (type === 'del') {
|
} else if (type === 'del') {
|
||||||
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
|
refModal.current.onDeleteGet(apiurl.sbwh.kchsgl.delete + `/${params.id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.whfabz.page).find_noCode);
|
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.kchsgl.page).find_noCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 处理成功的回调
|
* @description 处理成功的回调
|
||||||
|
|
@ -87,8 +87,8 @@ const Page = () => {
|
||||||
let params = {
|
let params = {
|
||||||
...searchVal,
|
...searchVal,
|
||||||
}
|
}
|
||||||
httppost5(apiurl.pxjh.export, params).then(res => {
|
httppost5(apiurl.sbwh.kchsgl.export, params).then(res => {
|
||||||
exportFile(`采购台账管理.xlsx`,res.data)
|
exportFile(`库存核算管理.xlsx`, res.data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
<>
|
<>
|
||||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||||
<Form.Item label="物资名称" name="name">
|
<Form.Item label="物资名称" name="goodsName">
|
||||||
<Input allowClear style={{width:'150px'}}/>
|
<Input allowClear style={{width:'150px'}}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="类别" name="type">
|
<Form.Item label="类别" name="goodsType">
|
||||||
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="类型" name="type">
|
<Form.Item label="类型" name="type">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
li.ant-tree-treenode-disabled > span:not(.ant-tree-switcher),
|
||||||
|
li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper,
|
||||||
|
li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper span{
|
||||||
|
color: #000 !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.treeBox1{
|
||||||
|
.ant-tree-node-content-wrapper{
|
||||||
|
position: static !important;
|
||||||
|
}
|
||||||
|
.hover-ele{
|
||||||
|
&:hover{
|
||||||
|
color:#259dff
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.AdcdTreeSelectorStyle{
|
||||||
|
.ant-input-wrapper{
|
||||||
|
|
||||||
|
.ant-input-affix-wrapper{
|
||||||
|
width: 98%;
|
||||||
|
}
|
||||||
|
.ant-input-group-addon{
|
||||||
|
.ant-btn{
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.treeTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
.treeBtn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.treeTitle:hover {
|
||||||
|
.treeBtn {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.no-matter{
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,315 @@
|
||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { Tree, Input, Checkbox, Spin, Modal, Form, Col, Row, message, Space } from 'antd';
|
||||||
|
import { EditOutlined, PlusCircleOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
|
import './index.less';
|
||||||
|
import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps';
|
||||||
|
import { getjdTreeData } from '../../../../service/warn';
|
||||||
|
import apiurl from '../../../../service/apiurl';
|
||||||
|
import { httppost3, httpget6 } from '../../../../utils/request';
|
||||||
|
|
||||||
|
const { Search } = Input;
|
||||||
|
|
||||||
|
type IProps = {
|
||||||
|
onSelectFun?: any;
|
||||||
|
setAdcd?: any;
|
||||||
|
showCheckbox: any;
|
||||||
|
tableName?: any;
|
||||||
|
onChangeOpen?: any;
|
||||||
|
hasAlertBox?: boolean;//顶部是否有预警条
|
||||||
|
isFetch?: boolean;
|
||||||
|
}
|
||||||
|
const { confirm } = Modal;
|
||||||
|
const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox, tableName, hasAlertBox }) => {
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [treeData, setTreeData] = useState([]);
|
||||||
|
const [newTreeData, setNewTreeData] = useState([]);
|
||||||
|
const [isFiter, setIsFiter] = useState(false);
|
||||||
|
const [expandedKeys, setExpandedKeys] = useState([]);
|
||||||
|
const [checkedKeys, setCheckedKeys] = useState([]);
|
||||||
|
const [selectedKeys, setSelectedKeys] = useState<any>([]);
|
||||||
|
const [selectedItem, setSelectedItem] = useState({});
|
||||||
|
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
||||||
|
const [treeBoxHeight, setTreeBoxHeight] = useState({});
|
||||||
|
const [jdOpen, setJdOpen] = useState(false)
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [mode, setMode] = useState('')
|
||||||
|
const [itemDetail, setItemDetail] = useState<any>({})
|
||||||
|
const [orderMax, setOrderMax] = useState<any>(0)
|
||||||
|
useEffect(() => {
|
||||||
|
getCustomerTreeData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (tableName) {
|
||||||
|
setSelectedKeys([]);
|
||||||
|
}
|
||||||
|
}, [tableName]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
//根据预警条计/多选框计算高度
|
||||||
|
if (hasAlertBox) {
|
||||||
|
if (showCheckbox) {
|
||||||
|
setTreeBoxHeight({ height: "calc( 100vh - 240px )" })
|
||||||
|
} else {
|
||||||
|
setTreeBoxHeight({ height: "calc( 100vh - 210px )" })
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (showCheckbox) {
|
||||||
|
setTreeBoxHeight({ height: "calc( 100vh - 224px )" })
|
||||||
|
} else {
|
||||||
|
setTreeBoxHeight({ height: "calc( 100vh - 194px )" })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [hasAlertBox])
|
||||||
|
|
||||||
|
const getCustomerTreeData = async () => {
|
||||||
|
const adcdTreedata: any = await getjdTreeData();
|
||||||
|
const item: any = adcdTreedata
|
||||||
|
if (item) {
|
||||||
|
setSelectedKeys([item[0]?.id])
|
||||||
|
setAdcd(item[0]?.id)
|
||||||
|
}
|
||||||
|
if (adcdTreedata.length > 0) {
|
||||||
|
handelTreeData(adcdTreedata);
|
||||||
|
setTreeData(adcdTreedata);
|
||||||
|
setLoading(false);
|
||||||
|
setOrderMax(Math.max(...adcdTreedata.map((item: any) => item?.orderIndex)))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// @ts-ignore
|
||||||
|
const handelTreeData = (data) => {
|
||||||
|
if (data.length > 0) {
|
||||||
|
// @ts-ignore
|
||||||
|
data.forEach(item => {
|
||||||
|
item.title = item.name;
|
||||||
|
item.key = item.id;
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
handelTreeData(item.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const onExpand = (expandedKeysValue: any) => {
|
||||||
|
setExpandedKeys(expandedKeysValue);
|
||||||
|
setAutoExpandParent(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const onSelect = (selectedKeysValue: any, info: any) => {
|
||||||
|
setSelectedKeys(selectedKeysValue);
|
||||||
|
setSelectedItem(info);
|
||||||
|
|
||||||
|
if (info.selectedNodes.length > 0) {
|
||||||
|
let selectData = info.selectedNodes[0];
|
||||||
|
|
||||||
|
let adcdVal = "";
|
||||||
|
adcdVal = selectData.key;
|
||||||
|
|
||||||
|
let params = { id: adcdVal };
|
||||||
|
if (onSelectFun) {
|
||||||
|
onSelectFun(params);
|
||||||
|
}
|
||||||
|
if (setAdcd) {
|
||||||
|
setAdcd(adcdVal)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let params = { id: "" };
|
||||||
|
if (onSelectFun) {
|
||||||
|
onSelectFun(params);
|
||||||
|
}
|
||||||
|
if (setAdcd) {
|
||||||
|
setAdcd("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const deleteJd = (v: any) => {
|
||||||
|
confirm({
|
||||||
|
title: '删除',
|
||||||
|
icon: <ExclamationCircleOutlined />,
|
||||||
|
content: '确认删除此数据',
|
||||||
|
okText: '确定',
|
||||||
|
okType: 'primary',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
try {
|
||||||
|
const res = await httpget6(apiurl.sbwh.spbjgl.deleteTree + `/${v.id}`)
|
||||||
|
if (res.code === 200) {
|
||||||
|
message.success('删除成功');
|
||||||
|
getCustomerTreeData();
|
||||||
|
}
|
||||||
|
if (res.code === 400) {
|
||||||
|
message.error(res.description);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
console.log('Cancel');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增节点
|
||||||
|
const saveJd = (v: any) => {
|
||||||
|
if (v) {
|
||||||
|
// form.setFieldValue('name', v.title);
|
||||||
|
setItemDetail(v);
|
||||||
|
}
|
||||||
|
setJdOpen(true);
|
||||||
|
setMode("save");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑节点
|
||||||
|
const editJd = (v: any) => {
|
||||||
|
setJdOpen(true);
|
||||||
|
form.setFieldsValue(v);
|
||||||
|
setMode("edit");
|
||||||
|
setItemDetail(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
const onOk = async () => {
|
||||||
|
const name = form.getFieldValue('name').replace(/\s/g, "");
|
||||||
|
if (!name) return
|
||||||
|
const url = mode == "save" ? apiurl.sbwh.spbjgl.saveTree : apiurl.sbwh.spbjgl.editTree;
|
||||||
|
let saveParams = {
|
||||||
|
name,
|
||||||
|
parentId: itemDetail?.id || undefined,
|
||||||
|
orderIndex: itemDetail?.orderIndex || orderMax
|
||||||
|
}
|
||||||
|
let editParams = {
|
||||||
|
...itemDetail,
|
||||||
|
name
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await httppost3(url, mode == "save" ? saveParams : editParams)
|
||||||
|
if (res.code == 200) {
|
||||||
|
message.success(mode == "save" ? '新增成功' : '编辑成功');
|
||||||
|
setJdOpen(false);
|
||||||
|
getCustomerTreeData();
|
||||||
|
form.resetFields();
|
||||||
|
} else if (res.code == 400) {
|
||||||
|
message.error(res.description);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div className='AdcdTreeSelectorStyle'>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
padding: '10px',
|
||||||
|
// color: "#409eff",
|
||||||
|
color: "#000",
|
||||||
|
backgroundColor: '#f7f7f7',
|
||||||
|
borderBottom: "1px solid #dfdfdf",
|
||||||
|
marginBottom: 20,
|
||||||
|
cursor: "pointer",
|
||||||
|
textAlign: 'center',
|
||||||
|
fontWeight:700
|
||||||
|
}}
|
||||||
|
// onClick={saveJd}
|
||||||
|
>备品备件分类</div>
|
||||||
|
{
|
||||||
|
loading ?
|
||||||
|
<div style={{ position: "absolute", top: "200px", left: "35%", background: "#fff", padding: "20px 30px", borderRadius: "10px" }}>
|
||||||
|
<Spin tip="正在加载..." size="large" spinning={loading} />
|
||||||
|
</div> : null
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="treeBox1" style={{ ...treeBoxHeight, marginTop: "10px" }}>
|
||||||
|
<div style={{ width: "300px" }}>
|
||||||
|
{
|
||||||
|
treeData.length > 0 &&
|
||||||
|
<Tree
|
||||||
|
defaultExpandAll={true}
|
||||||
|
blockNode={false}
|
||||||
|
onExpand={onExpand}
|
||||||
|
checkedKeys={checkedKeys}
|
||||||
|
onSelect={onSelect}
|
||||||
|
selectedKeys={selectedKeys}
|
||||||
|
treeData={isFiter ? newTreeData : treeData}
|
||||||
|
showLine={true}
|
||||||
|
titleRender={(v: any) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{ width: 200 }}
|
||||||
|
className='treeTitle'
|
||||||
|
>
|
||||||
|
<span>{v.title}</span>
|
||||||
|
<Space
|
||||||
|
size={4}
|
||||||
|
className='treeBtn'
|
||||||
|
>
|
||||||
|
{v.children && <PlusCircleOutlined
|
||||||
|
style={{ fontSize: 15 }}
|
||||||
|
title='新增'
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
saveJd(v);
|
||||||
|
}}
|
||||||
|
className='hover-ele'
|
||||||
|
/>}
|
||||||
|
<EditOutlined
|
||||||
|
title='编辑'
|
||||||
|
style={{ fontSize: 15 }}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
editJd(v);
|
||||||
|
}}
|
||||||
|
className='hover-ele'
|
||||||
|
/>
|
||||||
|
<DeleteOutlined
|
||||||
|
title='删除'
|
||||||
|
style={{ fontSize: 15 }}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
deleteJd(v);
|
||||||
|
}}
|
||||||
|
className='hover-ele'
|
||||||
|
/>
|
||||||
|
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<Modal
|
||||||
|
open={jdOpen}
|
||||||
|
title={mode == "save" ? "新增" : '编辑'}
|
||||||
|
destroyOnClose
|
||||||
|
onCancel={() => { setJdOpen(false); form.resetFields() }}
|
||||||
|
onOk={onOk}
|
||||||
|
>
|
||||||
|
<Form form={form} {...formItemLayout}>
|
||||||
|
<Row>
|
||||||
|
<Col span={24}>
|
||||||
|
<Form.Item
|
||||||
|
label="备品备件"
|
||||||
|
name="name"
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
>
|
||||||
|
<Input allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AdcdTreeSelector;
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
import React, { useEffect, useState, useMemo, useRef } from 'react';
|
||||||
|
import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Popconfirm } from 'antd';
|
||||||
|
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
|
||||||
|
import apiurl from '../../../service/apiurl';
|
||||||
|
import FileUpload from '../../../components/fileUpload';
|
||||||
|
import NormalSelect from '../../../components/Form/NormalSelect';
|
||||||
|
import moment from 'moment';
|
||||||
|
import { httppost2 } from '../../../utils/request';
|
||||||
|
const { RangePicker } = DatePicker
|
||||||
|
|
||||||
|
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [fileIds, setFileIds] = useState()
|
||||||
|
const onfinish = (values) => {
|
||||||
|
const userId = localStorage.getItem('userId')
|
||||||
|
const userName = localStorage.getItem('userName')
|
||||||
|
values.createUserId = userId;
|
||||||
|
values.createUserName = userName;
|
||||||
|
values.files = fileIds;
|
||||||
|
values.classifyId = record.code;
|
||||||
|
if (mode === 'edit') {
|
||||||
|
onEdit(apiurl.sbwh.spbjgl.edit, {...record,...values})
|
||||||
|
}
|
||||||
|
if (mode === 'save') {
|
||||||
|
onSave(apiurl.sbwh.spbjgl.save, values)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Form
|
||||||
|
form={form}
|
||||||
|
{...formItemLayout}
|
||||||
|
onFinish={onfinish}
|
||||||
|
initialValues={record}
|
||||||
|
>
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="名称"
|
||||||
|
name="name"
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
>
|
||||||
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="规格型号"
|
||||||
|
name="specs"
|
||||||
|
>
|
||||||
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="数量"
|
||||||
|
name="quantity"
|
||||||
|
>
|
||||||
|
<InputNumber min={0} disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="单位"
|
||||||
|
name="unit"
|
||||||
|
>
|
||||||
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item
|
||||||
|
label="厂家"
|
||||||
|
name="manufactor"
|
||||||
|
>
|
||||||
|
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col span={24}>
|
||||||
|
<Form.Item
|
||||||
|
label="备注"
|
||||||
|
name="remark"
|
||||||
|
labelCol={{ span: 3 }}
|
||||||
|
wrapperCol={{ span: 19 }}
|
||||||
|
>
|
||||||
|
<Input.TextArea disabled={mode === 'view'} style={{ width: '100%', minHeight: '100px' }} allowClear />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col span={24}>
|
||||||
|
<Form.Item
|
||||||
|
label="附件"
|
||||||
|
name="fieldId"
|
||||||
|
labelCol={{ span: 3 }}
|
||||||
|
wrapperCol={{ span: 19 }}
|
||||||
|
>
|
||||||
|
<FileUpload
|
||||||
|
uploadUrl={apiurl.sbwh.spbjgl.uploadUrl}
|
||||||
|
downloadUrl={apiurl.sbwh.spbjgl.downloadUrl}
|
||||||
|
mode={mode}
|
||||||
|
files={record?.files}
|
||||||
|
setFileIds={setFileIds}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
{
|
||||||
|
mode === 'view' ? null : (
|
||||||
|
<>
|
||||||
|
<Form.Item {...btnItemLayout}>
|
||||||
|
<Button type="primary" htmlType="submit">
|
||||||
|
{mode === 'save' ? '提交' : '修改'}
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ModalForm;
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
|
||||||
|
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
|
||||||
|
import { Table, Card, Modal, Form, Input, Button, Row,Col, Timeline, message, Tabs,Image,Switch } from 'antd';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import AdcdTreeSelector from "./AdcdTreeSelector";
|
||||||
|
import ToolBar from './toolbar';
|
||||||
|
import ModalForm from './form';
|
||||||
|
import apiurl from '../../../service/apiurl';
|
||||||
|
import usePageTable from '../../../components/crud/usePageTable2';
|
||||||
|
import { createCrudService } from '../../../components/crud/_';
|
||||||
|
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
|
||||||
|
import { httppost5 } from '../../../utils/request';
|
||||||
|
import { exportFile } from '../../../utils/tools.js';
|
||||||
|
const Page = () => {
|
||||||
|
const refModal = useRef();
|
||||||
|
const columns = [
|
||||||
|
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
||||||
|
{title: '名称', key: 'name', dataIndex: 'name', width: 150},
|
||||||
|
{
|
||||||
|
title: '类别', key: 'classifyName', dataIndex: 'classifyName', width: 150,ellipsis:true},
|
||||||
|
{
|
||||||
|
title: '规格型号', key: 'specs', dataIndex: 'specs', width: 150 },
|
||||||
|
{
|
||||||
|
title: '数量', key: 'quantity', dataIndex: 'quantity', width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '单位', key: 'unit', dataIndex: 'unit', width: 100,
|
||||||
|
},
|
||||||
|
{title: '厂家', key: 'manufactor', dataIndex: 'manufactor', width: 150 },
|
||||||
|
{title: '备注', key: 'remark', dataIndex: 'remark', width: 150 },
|
||||||
|
{title: '创建时间', key: 'createTime', dataIndex: 'createTime', width: 150 },
|
||||||
|
{
|
||||||
|
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
||||||
|
render: (value, row, index) => (
|
||||||
|
<CrudOpRender_text
|
||||||
|
edit={true}
|
||||||
|
del={true}
|
||||||
|
command={(cmd) => () => command(cmd)(row)} />)
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const [code, setCode] = useState()
|
||||||
|
|
||||||
|
|
||||||
|
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const command = (type) => (params) => {
|
||||||
|
if (type === 'save') {
|
||||||
|
refModal.current.showSave({code});
|
||||||
|
} else if (type === 'edit') {
|
||||||
|
refModal.current.showEdit({ ...params,code });
|
||||||
|
} else if (type === 'view') {
|
||||||
|
refModal.current.showView(params);
|
||||||
|
} else if (type === 'del') {
|
||||||
|
refModal.current.onDeleteGet(apiurl.sbwh.spbjgl.delete + `/${params.id}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.sbwh.spbjgl.page).find_noCode);
|
||||||
|
const [searchVal, setSearchVal] = useState(false)
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const exportExcel = () => {
|
||||||
|
let params = {
|
||||||
|
...searchVal,
|
||||||
|
classifyId:code
|
||||||
|
}
|
||||||
|
httppost5(apiurl.sbwh.spbjgl.export, params).then(res => {
|
||||||
|
exportFile(`备品备件管理.xlsx`,res.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if (code) {
|
||||||
|
let params = {
|
||||||
|
search: {
|
||||||
|
classifyId:code,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
search(params)
|
||||||
|
}
|
||||||
|
}, [code]);
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='content-box' style={{ backgroundColor: '#fff', height: '100%',display:'flex',padding:'10px' }}>
|
||||||
|
<div className='lf adcdTreeSelectorBox' style={{height:'calc(100vh - 168px)',width:'340px'}}>
|
||||||
|
<AdcdTreeSelector hasAlertBox={false} setAdcd={setCode}/>
|
||||||
|
</div>
|
||||||
|
<div className='AdcdTreeTableBox' style={{flex:1,overflowX:"auto"}}>
|
||||||
|
<Card className='nonebox'>
|
||||||
|
<ToolBar
|
||||||
|
onSave={command('save')}
|
||||||
|
setSearchVal={setSearchVal}
|
||||||
|
exportFile1={exportExcel}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
{...tableProps}
|
||||||
|
scroll={{ x: width, y: "calc( 100vh - 400px )" }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<BasicCrudModal
|
||||||
|
width={1000}
|
||||||
|
ref={refModal}
|
||||||
|
title=""
|
||||||
|
component={ModalForm}
|
||||||
|
onCrudSuccess={refresh}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Page;
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { Form, Input, Button, DatePicker } from 'antd';
|
||||||
|
|
||||||
|
const ToolBar = ({ setSearchVal, onSave, exportFile1 }) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
const onFinish = (values) => {
|
||||||
|
setSearchVal({ ...values });
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||||
|
<Form.Item label="名称" name="name">
|
||||||
|
<Input allowClear style={{ width: '170px' }} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="厂家" name="manufactor">
|
||||||
|
<Input allowClear style={{ width: '170px' }} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item>
|
||||||
|
<Button type="primary" htmlType="submit">查询</Button>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item>
|
||||||
|
<Button onClick={() => form.resetFields()}>重置</Button>
|
||||||
|
</Form.Item>
|
||||||
|
{
|
||||||
|
(onSave) ?
|
||||||
|
<Form.Item>
|
||||||
|
<Button onClick={onSave}>新增</Button>
|
||||||
|
</Form.Item>
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
<Form.Item>
|
||||||
|
<Button onClick={() => exportFile1()}>导出</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ToolBar;
|
||||||
|
|
@ -43,12 +43,14 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
onSave(apiurl.sbwh.ssgcjl.save, values)
|
onSave(apiurl.sbwh.ssgcjl.save, values)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const [faList, setFaList] = useState([])
|
||||||
// 获取方案list
|
// 获取方案list
|
||||||
const faList = async () => {
|
const getFaList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await httppost2(apiurl.sbwh.ssgcjl.list)
|
const res = await httppost2(apiurl.sbwh.ssgcjl.list)
|
||||||
debugger
|
if (res.code == 200) {
|
||||||
|
setFaList(res.data.map(item => ({label:item.planName,value:item.id})));
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
||||||
|
|
@ -63,7 +65,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
}, [record, mode])
|
}, [record, mode])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
faList()
|
getFaList()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -87,10 +89,15 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="方案名称"
|
label="方案名称"
|
||||||
name="planName"
|
name="planId"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
<NormalSelect
|
||||||
|
allowClear
|
||||||
|
disabled={mode === 'view'}
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
options={faList}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ const Page = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
|
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
|
||||||
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
||||||
<Card className='nonebox'>
|
<Card className='nonebox'>
|
||||||
<ToolBar
|
<ToolBar
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
showTime
|
showTime
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
values.endTime = values.tm?moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") :'';
|
values.endTime = values.tm?moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
if (mode === 'edit') {
|
if (mode === 'edit') {
|
||||||
values.id = record.id;
|
onEdit(apiurl.sbwh.whfabz.edit,{...record,...values})
|
||||||
onEdit(apiurl.sbwh.whfabz.edit,values)
|
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
onSave(apiurl.sbwh.whfabz.save,values)
|
onSave(apiurl.sbwh.whfabz.save,values)
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ const Page = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
|
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
|
||||||
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
||||||
<Card className='nonebox'>
|
<Card className='nonebox'>
|
||||||
<ToolBar
|
<ToolBar
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
showTime
|
showTime
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -35,17 +35,23 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
values.createUserName = userName;
|
values.createUserName = userName;
|
||||||
values.startTime =values.tm? moment(values.tm[0]).format("YYYY-MM-DD 00:00:00") :'';
|
values.startTime =values.tm? moment(values.tm[0]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
values.endTime = values.tm?moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") :'';
|
values.endTime = values.tm?moment(values.tm[1]).format("YYYY-MM-DD 00:00:00") :'';
|
||||||
if (mode === 'edit') {
|
|
||||||
values.files = fileIds;
|
values.files = fileIds;
|
||||||
values.id = record.id;
|
if (mode === 'edit') {
|
||||||
onEdit(apiurl.sbwh.whxmys.edit,values)
|
onEdit(apiurl.sbwh.whxmys.edit,{...record,...values});
|
||||||
}
|
}
|
||||||
if (mode === 'save') {
|
if (mode === 'save') {
|
||||||
values.files = fileIds
|
|
||||||
onSave(apiurl.sbwh.whxmys.save,values)
|
onSave(apiurl.sbwh.whxmys.save,values)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (mode != 'save') {
|
||||||
|
let dataSo = record.startTime && record.endTime ?
|
||||||
|
[moment(record.startTime), moment(record.endTime)]:''
|
||||||
|
form.setFieldValue("tm", dataSo)
|
||||||
|
}
|
||||||
|
}, [record,mode])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form
|
<Form
|
||||||
|
|
@ -58,7 +64,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="项目名称"
|
label="项目名称"
|
||||||
name="name"
|
name="projectName"
|
||||||
rules={[{ required: true }]}
|
rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||||
|
|
@ -67,7 +73,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="验收时间"
|
label="验收时间"
|
||||||
name="eventsDate"
|
name="tm"
|
||||||
getValueFromEvent={(e,dateString) => dateString}
|
getValueFromEvent={(e,dateString) => dateString}
|
||||||
getValueProps={(value) => {
|
getValueProps={(value) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -84,7 +90,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="验收检查"
|
label="验收检查"
|
||||||
name="eventsDesc"
|
name="acceptCheck"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
|
|
@ -96,7 +102,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="质量评估"
|
label="质量评估"
|
||||||
name="eventsDesc"
|
name="qualityAssess"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
|
|
@ -108,7 +114,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="预算审核"
|
label="预算审核"
|
||||||
name="eventsDesc"
|
name="budgetReview"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
|
|
@ -120,7 +126,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="备注"
|
label="备注"
|
||||||
name="eventsDesc"
|
name="remark"
|
||||||
labelCol={{ span: 3 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 19 }}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ const Page = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
|
<div className='content-root clearFloat xybm' style={{paddingBottom:"0"}}>
|
||||||
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
|
||||||
<Card className='nonebox'>
|
<Card className='nonebox'>
|
||||||
<ToolBar
|
<ToolBar
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
showTime
|
showTime
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
showTime
|
showTime
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
showTime
|
showTime
|
||||||
style={{ width: "300px" }}
|
style={{ width: "330px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue