Archer_cdm
2 years ago
8 changed files with 182 additions and 4 deletions
@ -0,0 +1,43 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const VacateRemark = sequelize.define("vacateRemark", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: true, |
||||
|
unique: "vacate_remark_id_uindex" |
||||
|
}, |
||||
|
pepUserId: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: 'pep用户id', |
||||
|
primaryKey: false, |
||||
|
field: "pep_user_id", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
remark: { |
||||
|
type: DataTypes.TEXT, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: '备注', |
||||
|
primaryKey: false, |
||||
|
field: "remark", |
||||
|
autoIncrement: false |
||||
|
} |
||||
|
}, { |
||||
|
tableName: "vacate_remark", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
dc.models.VacateRemark = VacateRemark; |
||||
|
return VacateRemark; |
||||
|
}; |
@ -0,0 +1,15 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import { ApiTable, basicAction } from '$utils' |
||||
|
|
||||
|
export function createVacateRemark(query) {//添加请假统计备注
|
||||
|
return (dispatch) => basicAction({ |
||||
|
type: "put", |
||||
|
dispatch: dispatch, |
||||
|
query: query, |
||||
|
actionType: "PUT_VACATE_REMARK", |
||||
|
url: `${ApiTable.createVacateRemark}`, |
||||
|
msg: { option: '添加备注' }, |
||||
|
reducer: {}, |
||||
|
}); |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
import React, { useEffect, useRef, useState } from 'react'; |
||||
|
import { connect } from "react-redux"; |
||||
|
import { Modal, Form } from "@douyinfe/semi-ui"; |
||||
|
const VacateRemark = (props) => { |
||||
|
const { dispatch, actions, onCancel, close, remarkData } = props; |
||||
|
console.log(actions, 'actionsactionsactions'); |
||||
|
const { humanAffairs } = actions; |
||||
|
const form = useRef();//表单
|
||||
|
//初始化
|
||||
|
useEffect(() => { }, []); |
||||
|
|
||||
|
function handleOk() { |
||||
|
form.current.validate().then((values) => { |
||||
|
dispatch(humanAffairs.createVacateRemark({ pepUserId: remarkData.pepUserId, remark: values.remark || '' })).then((res) => { |
||||
|
if (res.success) { |
||||
|
close(); |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
return ( |
||||
|
<Modal title='添加备注' |
||||
|
visible={true} |
||||
|
destroyOnClose |
||||
|
okText='保存' width={800} |
||||
|
onOk={handleOk} |
||||
|
onCancel={onCancel}> |
||||
|
<Form getFormApi={(formApi) => (form.current = formApi)} labelPosition={'left'}> |
||||
|
<Form.TextArea |
||||
|
field="remark" |
||||
|
label='备注' |
||||
|
initValue={remarkData?.remark || ""} |
||||
|
placeholder="请输入备注" |
||||
|
/> |
||||
|
</Form> |
||||
|
</Modal> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
function mapStateToProps(state) { |
||||
|
const { global } = state; |
||||
|
return { |
||||
|
actions: global.actions, |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default connect(mapStateToProps)(VacateRemark); |
Loading…
Reference in new issue