diff --git a/src/components/ImportBtn/index.jsx b/src/components/ImportBtn/index.jsx index a088ae1..469a373 100644 --- a/src/components/ImportBtn/index.jsx +++ b/src/components/ImportBtn/index.jsx @@ -23,7 +23,7 @@ function ImportBtn(props) { if (e && e.status == 20000) { setMsg(e.message) } else { - message.error(e.message) + // message.error(e.message) } } diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 5c08be9..1e4d390 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -655,7 +655,7 @@ const TableModule = forwardRef((props, ref) => { onChange={handleChange} defaultValue={item.defaultValue} filterOption={(input, option) => (option?.label ?? '').includes(input)} - options={getRoadList} + options={item.options || getRoadList} /> </Form.Item> ); diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx index 5dece80..44360e4 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx @@ -11,6 +11,7 @@ function InfoModal (props) { isDetail=false, onCancel, timeRulesData=[], + parkList=[], data={}, onOk } = props @@ -24,6 +25,10 @@ function InfoModal (props) { }, ] + const handleParkChange = (v, _) => { + baseForm.setFieldValue('total', _.berth_number) + } + const handleSave = () => { baseForm.validateFields().then((data) => { onOk({...data}) @@ -66,14 +71,18 @@ function InfoModal (props) { <Row> <Col span={11}> - <Form.Item label="车场名称" name="park_name" rules={rules}> - <Input></Input> + <Form.Item label="车场名称" name="park_id" rules={rules}> + {/* <Input></Input> */} + <Select + options={parkList} + onChange={handleParkChange} + /> </Form.Item> </Col> <Col span={2}></Col> <Col span={11}> <Form.Item label="总车位数" name="total" rules={rules}> - <Input type='number'></Input> + <Input type='number' disabled></Input> </Form.Item> </Col> </Row> diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx index f473522..63572e1 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx @@ -15,6 +15,7 @@ function ShareParkMgm() { const [isEdit, setIsEdit] = useState(false) const [editData, setEditData] = useState({}) const [timeRulesData, setTimeRulesData] = useState([]) + const [parkList, setParkList] = useState([]) const tableRef = useRef(null) const columns = [ { @@ -70,11 +71,11 @@ function ShareParkMgm() { placeholder:"请选择商户名称" }, { - type: "Input", + type: "SearchSelect", label: "车场名称", placeholder: "请输入车场名称", name: "parkName", - hiddenCount: 1 + options: [{label: '全部', value: ""}, ...parkList] }, { type: "Input", @@ -85,6 +86,16 @@ function ShareParkMgm() { } ]; + const ajaxGetPark = () => { + ajax.getParkList().then(res => { + if (res.status == 20000) { + setParkList([...res.data]) + } else { + setParkList([]) + } + }) + } + const handleEdit = (data) => { setIsEdit(true) setEditData({...data}) @@ -171,6 +182,7 @@ function ShareParkMgm() { useEffect(() => { getTimeRulesData() + ajaxGetPark() }, []) @@ -187,6 +199,7 @@ function ShareParkMgm() { renderAdd={() => ( <Button type="primary" className="submit" onClick={handleAdd}>添加</Button> )} + isExport={false} // mandatory={'parking_num'} // mandatory_name={'泊位号'} // pagename="PDA操作记录" @@ -201,6 +214,7 @@ function ShareParkMgm() { onOk={handleEditConfirm} data={editData} timeRulesData={timeRulesData} + parkList={parkList} /> </> ); diff --git a/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx b/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx index 3d31406..1f0c1a9 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx @@ -10,6 +10,7 @@ import { TableModule } from "@/components"; function StallCount() { + const [parkList, setParkList] = useState([]) const columns = [ { title: '日期', @@ -56,12 +57,12 @@ function StallCount() { name: 'time' }, { - type: 'Input', - label: '车场名称', - name: 'parkName', - placeholder: '请输入车场名称', - hiddenCount: 1 - } + type: "SearchSelect", + label: "车场名称", + placeholder: "请输入车场名称", + name: "parkName", + options: [{label: '全部', value: ""}, ...parkList] + }, ]; //搜索参数初始化 const initFormData = { @@ -81,6 +82,20 @@ function StallCount() { }); } + const ajaxGetPark = () => { + ajax.getParkList().then(res => { + if (res.status == 20000) { + setParkList([...res.data]) + } else { + setParkList([]) + } + }) + } + + useEffect(() => { + ajaxGetPark() + }, []) + return ( <TableModule columns={columns} @@ -89,6 +104,7 @@ function StallCount() { search={search} total={total} initFormData={initFormData} + isExport={false} exportUrl="/api/off_peak/park_info/get_park_list/export" /> ); diff --git a/src/services/OffPeak/index.js b/src/services/OffPeak/index.js index bccf2c6..036c5d0 100644 --- a/src/services/OffPeak/index.js +++ b/src/services/OffPeak/index.js @@ -59,7 +59,14 @@ const getTimeRulesData = () => { return ajax({ url: "/api/off_peak/park_info/get_time_rules_list", type: "get", - data: params, + // data: params, + }) +} + +const getParkList = () => { + return ajax({ + url: '/api/common/get_park_select', + type: 'get' }) } @@ -72,5 +79,6 @@ export default { shareParkAdd, getBookInfoList, getBreakInfoList, - getOffPeakRecords + getOffPeakRecords, + getParkList } \ No newline at end of file