Browse Source

(*)短信提醒完成

dev
ww664853070 1 year ago
parent
commit
6329bdc20d
  1. 2
      api/app/lib/controllers/data/anspectionNotificationPhone.js
  2. 14
      web/client/src/sections/fillion/components/patrolTable.js

2
api/app/lib/controllers/data/anspectionNotificationPhone.js

@ -36,7 +36,7 @@ async function addAnspectionNotificationPhone(ctx) {
}) })
}) })
await models.AnspectionNotificationPhone.bulkCreate(dataList); await models.AnspectionNotificationPhone.bulkCreate(dataList);
await transaction.commit(); // await transaction.commit();
ctx.status = 204 ctx.status = 204
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);

14
web/client/src/sections/fillion/components/patrolTable.js

@ -713,6 +713,7 @@ const PatrolTable = (props) => {
const isPatrol = !isRoad && !isAnomaly const isPatrol = !isRoad && !isAnomaly
const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol'; const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol';
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const [phoneList, setPhoneList] = useState([]);
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
queryData(); queryData();
@ -823,6 +824,7 @@ const PatrolTable = (props) => {
}) })
} }
console.log(phoneList, '789789789789'); console.log(phoneList, '789789789789');
setPhoneList(phoneList)
}, [anspectionNotificationPhoneList]) }, [anspectionNotificationPhoneList])
const showModal = () => { const showModal = () => {
@ -924,17 +926,9 @@ const PatrolTable = (props) => {
</Card> </Card>
<Modal title="短信提醒" maskClosable={false} destroyOnClose={true} visible={isModalOpen} onOk={handleOk} onCancel={handleCancel}> <Modal title="短信提醒" maskClosable={false} destroyOnClose={true} visible={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
<Form form={form} name="dynamic_form_item" {...formItemLayoutWithOutLabel} > <Form form={form} name="dynamic_form_item" {...formItemLayoutWithOutLabel} >
<Form.List <Form.List
name="phone" name="phone"
// rules={[ initialValue={phoneList}
// {
// validator: async (_, names) => {
// if (!names || names.length < 1) {
// return Promise.reject(new Error('At least 2 passengers'));
// }
// },
// },
// ]}
> >
{(fields, { add, remove }, { errors }) => ( {(fields, { add, remove }, { errors }) => (
<> <>

Loading…
Cancel
Save