Browse Source

抽查功能

dev
wenlele 12 months ago
parent
commit
2545b30d58
  1. 1735
      api/app/lib/controllers/report/index.js
  2. 20
      api/app/lib/models/road_spot_check_preview.js
  3. 3
      api/app/lib/routes/report/index.js
  4. 18
      api/utils/xlsxDownload.js
  5. 11
      scripts/1.5/road_spot_check_preview.sql
  6. 31
      web/client/src/sections/fillion/actions/spotCheck.js
  7. 315
      web/client/src/sections/fillion/components/spotCheck.js
  8. 162
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

1735
api/app/lib/controllers/report/index.js

File diff suppressed because it is too large

20
api/app/lib/models/road_spot_check_preview.js

@ -122,7 +122,25 @@ module.exports = dc => {
primaryKey: false, primaryKey: false,
field: "last_abstract_village", field: "last_abstract_village",
autoIncrement: false autoIncrement: false
} },
abstractFinish: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: "是否全部抽取完",
primaryKey: false,
field: "abstract_finish",
autoIncrement: false
},
nextAbstract:{
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "next_abstract",
autoIncrement: false
},
}, { }, {
tableName: "road_spot_check_preview", tableName: "road_spot_check_preview",
comment: "", comment: "",

3
api/app/lib/routes/report/index.js

@ -55,4 +55,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/road/spot/export'] = { content: '导出路线抽查', visible: false }; app.fs.api.logAttr['GET/road/spot/export'] = { content: '导出路线抽查', visible: false };
router.get('/road/spot/export', report.exportSpotRode) router.get('/road/spot/export', report.exportSpotRode)
app.fs.api.logAttr['GET/town'] = { content: '获取乡镇', visible: false };
router.get('/town', report.town)
} }

18
api/utils/xlsxDownload.js

@ -31,7 +31,7 @@ async function gatherSheet ({ sheet_2, data = [] }) {
const indexCell1 = headerRow1.addCell(); const indexCell1 = headerRow1.addCell();
indexCell1.value = '南昌县农村公路养护管理暨用地范围内环境整治提升工程 考核汇总表' indexCell1.value = '南昌县农村公路养护管理暨用地范围内环境整治提升工程 考核汇总表'
indexCell1.style = headerStyle indexCell1.style = headerStyle
indexCell1.hMerge = 12 indexCell1.hMerge = 14
const headerRow2 = sheet_2.addRow(); const headerRow2 = sheet_2.addRow();
const indexCell2 = headerRow2.addCell(); const indexCell2 = headerRow2.addCell();
@ -90,6 +90,14 @@ async function gatherSheet ({ sheet_2, data = [] }) {
}, { }, {
key: 'villageDifferenceValue', key: 'villageDifferenceValue',
title: '实际抽取比原计划多', title: '实际抽取比原计划多',
},
{
key: 'drawPeople',
title: '抽查人',
},
{
key: 'abstractTime',
title: '抽查时间',
},] },]
const headerRow3 = sheet_2.addRow(); const headerRow3 = sheet_2.addRow();
@ -110,16 +118,24 @@ async function gatherSheet ({ sheet_2, data = [] }) {
let rowGather = sheet_2.addRow(); let rowGather = sheet_2.addRow();
for (let h of header) { for (let h of header) {
if (h.key != 'drawPeople' && h.key != 'abstractTime') {
const cell = rowGather.addCell(); const cell = rowGather.addCell();
cell.value = h.key == 'name' ? '汇总' : data.reduce((a, b) => a + (b[h.key] || 0), 0) cell.value = h.key == 'name' ? '汇总' : data.reduce((a, b) => a + (b[h.key] || 0), 0)
cell.style = style cell.style = style
} }
}
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
const row = sheet_2.addRow(); const row = sheet_2.addRow();
for (let h of header) { for (let h of header) {
const cell = row.addCell(); const cell = row.addCell();
if (h.key == 'abstractTime') {
cell.value = moment(data[i][h.key]).format('YYYY-MM-DD HH:mm:ss')
} else {
cell.value = data[i][h.key] cell.value = data[i][h.key]
}
cell.style = style cell.style = style
} }
} }

11
scripts/1.5/road_spot_check_preview.sql

@ -0,0 +1,11 @@
alter table road_spot_check_preview
add abstract_finish boolean;
comment on column road_spot_check_preview.abstract_finish is '是否全部抽取完';
alter table road_spot_check_preview
add next_abstract jsonb;
comment on column road_spot_check_preview.next_abstract is '下次必抽道路';

31
web/client/src/sections/fillion/actions/spotCheck.js

@ -89,23 +89,14 @@ export function roadSpotChange (data = {}) {
}); });
} }
// export function delAssess (query) { export function getTown (query = {}) {
// return dispatch => basicAction({ return dispatch => basicAction({
// type: 'del', type: 'get',
// dispatch: dispatch, dispatch: dispatch,
// actionType: 'DEL_ASSESS', query: query,
// url: ApiTable.delAssess.replace("{assessId}", query?.id), actionType: 'GET_TOWN',
// msg: { option: '删除考核评分信息' }, url: 'town',
// }); msg: { error: '获取乡镇code失败' },
// } reducer: { name: 'town' }
});
// export function editAssess (query) { }
// return dispatch => basicAction({
// type: 'put',
// dispatch: dispatch,
// data: query,
// actionType: 'PUT_ASSESS',
// url: ApiTable.editAssess,
// msg: { option: '编辑/新增考核评分信息' },
// });
// }

315
web/client/src/sections/fillion/components/spotCheck.js

@ -0,0 +1,315 @@
import { connect } from 'react-redux'
import React, { useEffect, useState } from 'react'
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd'
import { roadSpotPrepare, getTown } from '../actions/spotCheck'
import moment from 'moment'
import '../components/maintenanceTable.less'
const SpotCheck = ({ dispatch, user, loading, reportDetail, editData, onCancel, road, onOk, town = [], viewDetails }) => {
const [countyRoadTime, setCountyRoadTime] = useState(true)
const [currentValue, setCurrentValue] = useState({})
const [townDisabled, setTownDisabled] = useState({})
const [dataList, setDataList] = useState([])
const [form] = Form.useForm()
useEffect(() => {
if (!viewDetails) {
if (editData?.id) {
exhibition(editData)
setCurrentValue(editData)
}
} else {
let gather = [editData.gather['countyRoad']]
town.forEach(d => {
if (d.code != '360121205000') {
gather.push(editData.gather[d.code] || {})
}
})
setDataList(gather)
}
}, [])
const exhibition = (show) => {
form.setFieldsValue({
'countyPercentage': show?.countyPercentage,
'townPercentage': show?.countyPercentage == 50 ? 25 : 50,
'villagePercentage': show?.countyPercentage == 50 ? 10 : 20,
})
let disabled = {}
for (let code in show.gather) {
if (code == 'countyRoad') {
setCountyRoadTime(false)
form.setFieldsValue({
'countyPresent': show.gather[code]?.countyPresent?.toFixed(4) || 0,
'countyDifferenceValue': show.gather[code]?.countyDifferenceValue?.toFixed(4) || 0,
'drawPeople': show.gather[code]?.drawPeople,
'abstractTime': moment(show.gather[code]?.abstractTime),
})
} else {
form.setFieldsValue({
[code + 'townshipPresent']: show.gather[code]?.townshipPresent?.toFixed(4) || 0,
[code + 'townshipDifferenceValue']: show.gather[code]?.townshipDifferenceValue?.toFixed(4) || 0,
[code + 'villagePresent']: show.gather[code]?.villagePresent?.toFixed(4) || 0,
[code + 'villageDifferenceValue']: show.gather[code]?.villageDifferenceValue?.toFixed(4) || 0,
[code + 'drawPeople']: show.gather[code]?.drawPeople,
[code + 'abstractTime']: moment(show.gather[code]?.abstractTime),
})
disabled[code] = true
}
}
setTownDisabled(disabled)
}
return (
<Modal
visible={true}
title={viewDetails ? "抽查详情" : '养护抽查'}
width={1274}
footer={null}
onCancel={() => {
onCancel()
}}
onOk={() => {
}}>
{viewDetails ? <div style={{ width: "100%" }}>
<div style={{ textAlign: 'center', fontSize: 16 }}>南昌县农村公路养护管理暨用地范围内环境整治提升工程 考核汇总表</div>
<Table
// sticky
scroll={{
x: 2534, y: 600
}}
pagination={false}
columns={[{ title: '责任单位', dataIndex: 'name', key: 'name', fixed: 'left', },
{
title: '县道',
children: [
{ title: '总里程', dataIndex: 'county', key: 'county', render: (t, r) => t?.toFixed(4) },
{ title: '纳入考核里程', dataIndex: 'countyParticipate', key: 'countyParticipate', render: (t, r) => t?.toFixed(4) },
{ title: '本次考核里程', dataIndex: 'countyPresent', key: 'countyPresent', render: (t, r) => t?.toFixed(4) },
{ title: '实际抽取比原计划多', dataIndex: 'countyDifferenceValue', key: 'countyDifferenceValue', render: (t, r) => t?.toFixed(4) },
]
},
{
title: '乡道',
children: [
{ title: '总里程', dataIndex: 'township', key: 'township', render: (t, r) => t?.toFixed(4) },
{ title: '纳入考核里程', dataIndex: 'townshipParticipate', key: 'townshipParticipate', render: (t, r) => t?.toFixed(4) },
{ title: '本次考核里程', dataIndex: 'townshipPresent', key: 'townshipPresent', render: (t, r) => t?.toFixed(4) },
{ title: '实际抽取比原计划多', dataIndex: 'townshipDifferenceValue', key: 'townshipDifferenceValue', render: (t, r) => t?.toFixed(4) },
]
},
{
title: '村道',
children: [
{ title: '总里程', dataIndex: 'village', key: 'village', render: (t, r) => t?.toFixed(4) },
{ title: '纳入考核里程', dataIndex: 'villageParticipate', key: 'villageParticipate', render: (t, r) => t?.toFixed(4) },
{ title: '本次考核里程', dataIndex: 'villagePresent', key: 'villagePresent', render: (t, r) => t?.toFixed(4) },
{ title: '实际抽取比原计划多', dataIndex: 'villageDifferenceValue', key: 'villageDifferenceValue', render: (t, r) => t?.toFixed(4) },
]
},
{
title: '',
children: [
{ title: '抽查人', dataIndex: 'drawPeople', key: 'drawPeople', },
]
},
{
title: '',
children: [
{ title: '抽查时间', dataIndex: 'abstractTime', key: 'abstractTime', width: 160, render: (t, r) => moment(t).format('YYYY-MM-DD HH:mm:ss') },
]
},
{
title: '',
children: [
{
title: '操作', dataIndex: 'action', key: 'action', fixed: 'right',
render: (t, r) => {
let roadId = []
if (r.name == '南昌县交通运输局') {
roadId = r.countyRoadId || []
} else {
roadId = [...r.townRoadId, ...r.villageRoadId]
}
return <a href={`/_api/road/spot/export?token=${user?.token}&previewId=${editData.id}&roadId=${roadId.join()}`}> 导出</a>
}
},
]
},]}
dataSource={dataList}
/>
</div>
: <Form
form={form}
onValuesChange={(changedValues, allValues) => {
}}>
<div style={{ display: "flex" }} >
<Form.Item
label={'抽取县道比例(%)'}
name="countyPercentage"
rules={[
{ required: true, message: '请选择抽取比例' },
// {
// pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
// message: '请输入有效的比例',
// },
]}
>
<Select style={{ width: 150, marginRight: 20 }} placeholder="请选择抽取比例" options={[{ value: 50, label: '50%', }, { value: 75, label: '75%', }]}
onChange={v => {
// setShow(v)
form.setFieldsValue({
'townPercentage': v == 75 ? 50 : 25,
'villagePercentage': v == 75 ? 20 : 10,
})
}} />
</Form.Item>
<Form.Item label='抽查人' name='drawPeople' rules={[{ required: true, message: '请输入抽查人' },]}>
<Input placeholder="抽查人" style={{ width: 100, marginRight: 20 }} />
</Form.Item>
<Form.Item >
<Button disabled={!countyRoadTime} style={{ marginRight: 20 }} type='primary' onClick={() => {
form.validateFields(['countyPercentage', 'drawPeople']).then((values) => {
console.log(111, values);
dispatch(roadSpotPrepare({
countyPercentage: values.countyPercentage, drawPeople: values.drawPeople, level: '县'
})).then(res => {
if (res.success) {
exhibition(res?.payload.data || {})
setCurrentValue(res?.payload.data || {})
}
})
})
}}>开始抽取</Button>
</Form.Item>
<Form.Item >
<Button disabled={countyRoadTime} style={{}} type='primary' >
<a href={`/_api/road/spot/export?token=${user?.token}&previewId=${currentValue.id}&roadId=${currentValue?.gather && currentValue?.gather['countyRoad']?.countyRoadId?.join()}`}> 导出</a>
</Button>
</Form.Item>
</div>
<div style={{ display: "flex" }}>
<Form.Item label='县道实际抽取(公里)' name='countyPresent'>
<Input disabled style={{ width: 100, marginRight: 20 }} />
</Form.Item>
<Form.Item label='县道比计划多(公里)' name='countyDifferenceValue'>
<Input disabled style={{ width: 100, marginRight: 20 }} />
</Form.Item>
<Form.Item name="abstractTime" label='抽取时间' >
<DatePicker disabled showTime format="YYYY-MM-DD HH:mm:ss" placeholder="" style={{ width: 174, }} />
</Form.Item>
</div>
<div style={{ display: "flex", marginTop: 30, paddingLeft: 30 }}>
<Form.Item label={'抽取乡道比例(%)'} name="townPercentage" rules={[{ required: true, message: '请选择抽取比例' }]}
>
<Select disabled style={{ width: 150, marginRight: 20 }} placeholder="" options={[{ value: 25, label: '25%', }, { value: 50, label: '50%', }]} />
</Form.Item>
<Form.Item label={'抽取村道比例(%)'} name="villagePercentage" rules={[{ required: true, message: '请选择抽取比例' }]}
>
<Select disabled style={{ width: 150, marginRight: 20 }} placeholder="" options={[{ value: 10, label: '10%', }, { value: 20, label: '20%', }]} />
</Form.Item>
</div>
<div style={{ display: "flex", marginBottom: 10 }}>
<div style={{ width: 66, marginLeft: 34 }}>责任单位</div>
<div style={{ width: 150 }}>乡道实际抽取公里</div>
<div style={{ width: 150 }}>乡道比计划多公里</div>
<div style={{ width: 150 }}>村道实际抽取公里</div>
<div style={{ width: 150 }}>村道比计划多公里</div>
<div style={{ width: 120 }}>抽查人</div>
<div style={{ width: 196 }}>抽查时间</div>
<div style={{ width: 100 }}>操作</div>
</div>
{town?.map(d => {
return <div style={{ display: "flex" }} >
<div style={{ width: 200, }}>
<Form.Item label={d.name} name={d.code + 'townshipPresent'} labelCol={{ span: 12, }} >
<Input disabled style={{ width: 130, }} />
</Form.Item>
</div>
<Form.Item name={d.code + 'townshipDifferenceValue'}>
<Input disabled style={{ width: 130, marginRight: 20, marginLeft: 50 }} />
</Form.Item>
<Form.Item name={d.code + 'villagePresent'}>
<Input disabled style={{ width: 130, marginRight: 20 }} />
</Form.Item>
<Form.Item name={d.code + 'villageDifferenceValue'}>
<Input disabled style={{ width: 130, marginRight: 20 }} />
</Form.Item>
<Form.Item name={d.code + 'drawPeople'} rules={[{ required: true, message: '请填写抽查人' }]}>
<Input placeholder="抽查人" style={{ width: 100, marginRight: 20 }} />
</Form.Item>
<Form.Item name={d.code + 'abstractTime'} >
<DatePicker disabled showTime format="YYYY-MM-DD HH:mm:ss" placeholder="" style={{ width: 174, marginRight: 20, }} />
</Form.Item>
<Form.Item >
<Button disabled={countyRoadTime ? true : townDisabled[d.code] ? true : false} style={{ marginRight: 20 }} type='primary' onClick={() => {
form.validateFields([d.code + 'drawPeople', 'countyPercentage']).then((values) => {
console.log(111, values);
dispatch(roadSpotPrepare({
countyPercentage: values.countyPercentage, drawPeople: values[d.code + 'drawPeople'], code: d.code
})).then(res => {
if (res.success) {
exhibition(res?.payload.data || {})
setCurrentValue(res?.payload.data || {})
}
})
})
}}>开始抽取</Button>
</Form.Item>
<Form.Item >
<Button disabled={townDisabled[d.code] ? false : true} style={{}} type='primary'>
<a href={`/_api/road/spot/export?token=${user?.token}&previewId=${currentValue.id}&roadId=${currentValue?.gather
&& [...(currentValue?.gather[d.code]?.townRoadId || []), ...(currentValue?.gather[d.code]?.villageRoadId
|| [])].join()}`}> 导出</a>
</Button>
</Form.Item>
</div>
})
}
</Form>
}
</Modal >
)
}
function mapStateToProps (state) {
const { auth, road, } = state
return {
user: auth.user,
road: road?.data || [],
// town: town?.data || [],
}
}
export default connect(mapStateToProps)(SpotCheck)

162
web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

@ -1,11 +1,12 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Tooltip, Table } from 'antd' import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Tooltip, Table, } from 'antd'
import { ExclamationCircleOutlined } from '@ant-design/icons' import { ExclamationCircleOutlined } from '@ant-design/icons'
import { getVillageList } from "../actions/infor" import { getVillageList } from "../actions/infor"
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck' import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode, getTown } from '../actions/spotCheck'
import moment from 'moment' import moment from 'moment'
import Adjustment from '../components/adjustment' import Adjustment from '../components/adjustment'
import SpotCheck from '../components/spotCheck'
import '../components/maintenanceTable.less' import '../components/maintenanceTable.less'
@ -30,28 +31,10 @@ const MaintenanceSpotCheck = (props) => {
const [editData, setEditData] = useState({}) const [editData, setEditData] = useState({})
const [keyword, setKeyword] = useState("") const [keyword, setKeyword] = useState("")
const [show, setShow] = useState() const [show, setShow] = useState()
const [town, setTown] = useState([])
const [viewDetails, setViewDetails] = useState(false)
const roadCode = [
{ title: "八一乡", value: "360121206000" },
{ title: "东新乡", value: "360121205000" },
{ title: "富山乡", value: "360121204000" },
{ title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" },
{ title: "黄马乡", value: "360121203000" },
{ title: "蒋巷镇", value: "360121105000" },
{ title: "金湖管理处", value: "330052" },
{ title: "泾口乡", value: "360121200000" },
{ title: "莲塘镇", value: "360121100000" },
{ title: "南新乡", value: "360121201000" },
{ title: "三江镇", value: "360121102000" },
{ title: "塔城乡", value: "360121202000" },
{ title: "塘南镇", value: "360121103000" },
{ title: "武阳镇", value: "360121106000" },
{ title: "向塘镇", value: "360121101000" },
{ title: "银三角管委会", value: "360121471000" },
{ title: "幽兰镇", value: "360121104000" },
]
const columns = [ const columns = [
{ {
@ -87,8 +70,39 @@ const MaintenanceSpotCheck = (props) => {
title: '操作', title: '操作',
key: 'operation', key: 'operation',
dataIndex: 'operation', dataIndex: 'operation',
render: (_, record) => width: 180,
<a href={`/_api/road/spot/export?token=${user?.token}&previewId=${record.id}`}>导出</a> render: (_, record, index) => {
return <>
{index != 0 ?
<Button type="link" onClick={() => {
setEditData(record)
setVis(true)
setViewDetails(true)
}}>查看详情</Button>
: record.abstractFinish ?
<Button type="link" onClick={() => {
setEditData(record)
setVis(true)
setViewDetails(true)
}}>查看详情</Button>
: <Button type="link" onClick={() => {
setEditData(record)
setVis(true)
}}>继续抽查</Button>
}
{index != 0 ?
<Button type="link" ><a href={`/_api/road/spot/export?token=${user?.token}&previewId=${record.id}&isgather=true`}> 导出</a></Button>
: !reportData[0]?.abstractFinish ?
<Tooltip title="当前抽查未完成">
<Button type="link" disabled={true} >导出</Button>
</Tooltip>
: <Button type="link" ><a href={`/_api/road/spot/export?token=${user?.token}&previewId=${record.id}&isgather=true`}> 导出</a></Button>
}
</>
}
}, },
] ]
@ -114,6 +128,11 @@ const MaintenanceSpotCheck = (props) => {
useEffect(() => { useEffect(() => {
queryData() queryData()
dispatch(getTown({})).then(res => {
if (res.success) {
setTown(res?.payload.data?.filter(d => d.code != '360121205000'))
}
})
}, []) }, [])
@ -144,9 +163,15 @@ const MaintenanceSpotCheck = (props) => {
return ( return (
<div> <div>
<div style={{ display: "flex", alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }}> <div style={{ display: "flex", alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }}>
<Button onClick={() => {
{reportData?.length > 0 && !reportData[0]?.abstractFinish ?
<Tooltip title="当前有未完成的抽查">
<Button disabled={true} type='primary' style={{ marginLeft: 10 }}> 新增 </Button>
</Tooltip>
: <Button onClick={() => {
setVis(true) setVis(true)
}} type='primary' style={{ marginLeft: 10 }}> 新增 </Button> }} type='primary' style={{ marginLeft: 10 }}> 新增 </Button>
}
<div> <div>
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => { <RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => {
@ -212,9 +237,9 @@ const MaintenanceSpotCheck = (props) => {
{ {
title: '所属乡镇', key: 'townshipCode', dataIndex: 'townshipCode', render: (_, r) => { title: '所属乡镇', key: 'townshipCode', dataIndex: 'townshipCode', render: (_, r) => {
const targetValue = r?.road?.townshipCode ?? '' const targetValue = r?.road?.townshipCode ?? ''
const foundItem = roadCode.find(item => item.value === targetValue) const foundItem = town.find(item => item.code === targetValue)
if (foundItem) { if (foundItem) {
return foundItem.title return foundItem.name
} else { } else {
return "--" return "--"
} }
@ -268,82 +293,29 @@ const MaintenanceSpotCheck = (props) => {
// search={false} // search={false}
/> />
{ {
vis && <Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={() => { vis &&
form.validateFields().then((values) => { <SpotCheck
dispatch(confirmRoadSpot({ previewId })).then(res => { town={town}
if (res.success) { viewDetails={viewDetails}
editData={editData}
onCancel={() => {
if (!viewDetails) {
setShow("")
setPage(1) setPage(1)
setExpandedRowKeys([]) setExpandedRowKeys([])
queryData({ startTime: dateRange[0], endTime: dateRange[1] }) queryData({ startTime: dateRange[0], endTime: dateRange[1] })
form.resetFields()
setVis(false)
setShow("")
}
})
})
}}>
<Form form={form}>
<Form.Item
label={'抽取县道比例(%)'}
name="percentValue"
rules={[
{ required: true, message: '请选择抽取比例' },
// {
// pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
// message: '请输入有效的比例',
// },
]}
>
<Select style={{}} placeholder="请选择抽取比例" options={[{ value: 50, label: '50%', }, { value: 75, label: '75%', }]}
onChange={v => {
setShow(v)
form.setFieldsValue({
'town': v == 75 ? 50 : 25,
'village': v == 75 ? 20 : 10,
})
}} />
</Form.Item>
{
show && <>
<Form.Item
label={'抽取乡道比例(%)'}
name="town"
rules={[{ required: true, message: '请选择抽取比例' }]}
>
<Select disabled placeholder="请选择抽取比例" options={[{ value: 25, label: '25%', }, { value: 50, label: '50%', }]} />
</Form.Item>
<Form.Item
label={'抽取村道比例(%)'}
name="village"
rules={[{ required: true, message: '请选择抽取比例' }]}
>
<Select disabled placeholder="请选择抽取比例" options={[{ value: 10, label: '10%', }, { value: 20, label: '20%', }]} />
</Form.Item>
</>
} }
setViewDetails(false)
setVis(false)
setEditData({})
}}
onOk={() => {
<Form.Item className="ant-row" style={{ }}
textAlign: 'center', />
}}>
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item>
<Form.Item label='抽查县道(公里)' name='countryMil'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查乡道(公里)' name='townMil'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查村道(公里)' name='villageMil'>
<Input disabled />
</Form.Item>
</Form>
</Modal>
} }
{ {
isAdjustment && isAdjustment &&
<Adjustment <Adjustment

Loading…
Cancel
Save