作业现场
This commit is contained in:
parent
12281aa470
commit
fdb9badd88
158
src/components/CustomPages/FO/FO035ShowPrint.js
Normal file
158
src/components/CustomPages/FO/FO035ShowPrint.js
Normal file
@ -0,0 +1,158 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd';
|
||||
import React from 'react';
|
||||
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showUserSign } from "../../../utils/common";
|
||||
import ReactToPrint from "react-to-print";
|
||||
import stylesStep from '../HI/StepForm.css';
|
||||
import config from "../../../config";
|
||||
import XLSX from 'xlsx';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
class FO035ShowPrint extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
data: null,
|
||||
enumData: null,
|
||||
BtnAgreeDisplay: 'none'
|
||||
};
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.data?.id)
|
||||
this.loadData(this.props.data?.id);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(NextProps) {
|
||||
if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
|
||||
this.loadData(NextProps.data?.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onTableBtnAgree() {
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
url: 'FO/FOTechDisclosureFromTech/PersonalAgree',
|
||||
payload: {
|
||||
ID: this.props.data.id,
|
||||
TaskID: this.props.data.TaskID,
|
||||
},
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
message.success('确认成功!');
|
||||
this.setState({ BtnAgreeDisplay: 'none' })
|
||||
this.BtnClose();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
BtnClose = () => {
|
||||
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
|
||||
this.props.data.onCancel();
|
||||
}
|
||||
|
||||
loadData = (dataId) => {
|
||||
let json = initFilter(this.props.login.OrgId);
|
||||
extendRule(json, 'ID', 1, dataId);
|
||||
extendIgnoreDataRule(json)
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
payload: json,
|
||||
url: 'FO/FOTechDisclosureFromTech/GetEdit',
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
if(this.props.data && this.props.data.loadDataDeal)
|
||||
{
|
||||
this.props.data.loadDataDeal(1);
|
||||
}
|
||||
this.setState({ data: ret })
|
||||
if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) {
|
||||
this.setState({ BtnAgreeDisplay: 'none' })
|
||||
}else{
|
||||
this.setState({ BtnAgreeDisplay: 'inline' })
|
||||
}
|
||||
}
|
||||
else
|
||||
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onTableBtnExport() {
|
||||
let TableWrap = document.getElementById('tableId' + this.props.data.id);
|
||||
let Table = TableWrap.getElementsByTagName('table')[0];
|
||||
const wb = XLSX.utils.table_to_book(Table);
|
||||
XLSX.writeFile(wb, "技术交底表.xlsx")
|
||||
}
|
||||
|
||||
render() {
|
||||
const { data } = this.state;
|
||||
return <div>
|
||||
<div style={{ padding: '10px' }}>
|
||||
<ReactToPrint
|
||||
trigger={() => <Button type={'default'} icon={'printer'} style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }}>打印</Button>}
|
||||
content={() => this.componentRef}
|
||||
pageStyle=".printDIV { padding:0 40px;} img{width :120px}"
|
||||
/>
|
||||
<Button style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
|
||||
<Button type="primary" style={{ marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button>
|
||||
</div>
|
||||
|
||||
|
||||
{/* */}
|
||||
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV">
|
||||
|
||||
<h1 style={{ textAlign: 'center', margin: '15px' }}>技术交底表</h1>
|
||||
{
|
||||
data ?
|
||||
<div>
|
||||
<Descriptions size="middle" bordered className={stylesStep.description}>
|
||||
<Descriptions.Item label="编号">{data.CODE}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底事项">{data.NAME}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底时间">{data.DISCLOSURE_DATE}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底地点">{data.JOB_LOCATION}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底人">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
|
||||
<Descriptions.Item label="被交底人">{
|
||||
data.Nav_Person && data.Nav_Person.map((item, i) => {
|
||||
if (i == (data.Nav_Person.length - 1)) {
|
||||
if (item.DEAL_STATUS == 0)
|
||||
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
|
||||
else
|
||||
return item.Nav_User?.NAME
|
||||
} else {
|
||||
if (item.DEAL_STATUS == 0)
|
||||
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ' '}</label>
|
||||
else
|
||||
return item.Nav_User?.NAME + ' '
|
||||
}
|
||||
})
|
||||
}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底内容">{data.DisclosureContent}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底人签字">{
|
||||
(data.Nav_User && data.Nav_User.FILE_PATH)?
|
||||
showUserSign(data.Nav_User, config.picServerHost):null
|
||||
// <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={data.Nav_User?.NAME} src={config.picServerHost + data.Nav_User.FILE_PATH} />
|
||||
// :data.Nav_User?.NAME
|
||||
}</Descriptions.Item>
|
||||
<Descriptions.Item label="被交底人签字">{
|
||||
data.Nav_Person && data.Nav_Person.map((item, i) => {
|
||||
if (item.DEAL_STATUS == 1) {
|
||||
showUserSign(item.Nav_User, config.picServerHost)
|
||||
// if (item.Nav_User != null && item.Nav_User.FILE_PATH != null)
|
||||
// return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item.Nav_User?.NAME} src={config.picServerHost + item.Nav_User.FILE_PATH} />
|
||||
// else
|
||||
// return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item.Nav_User?.NAME} />
|
||||
}
|
||||
})
|
||||
}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div> : null
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
export default connect(({ login }) => ({ login }))(FO035ShowPrint)
|
||||
158
src/components/CustomPages/FO/FO037ShowPrint.js
Normal file
158
src/components/CustomPages/FO/FO037ShowPrint.js
Normal file
@ -0,0 +1,158 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd';
|
||||
import React from 'react';
|
||||
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showUserSign } from "../../../utils/common";
|
||||
import ReactToPrint from "react-to-print";
|
||||
import stylesStep from '../HI/StepForm.css';
|
||||
import config from "../../../config";
|
||||
import XLSX from 'xlsx';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
class FO037ShowPrint extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
data: null,
|
||||
enumData: null,
|
||||
BtnAgreeDisplay: 'none'
|
||||
};
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.data?.id)
|
||||
this.loadData(this.props.data?.id);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(NextProps) {
|
||||
if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
|
||||
this.loadData(NextProps.data?.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onTableBtnAgree() {
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
url: 'FO/FOTechDisclosureFromSafe/PersonalAgree',
|
||||
payload: {
|
||||
ID: this.props.data.id,
|
||||
TaskID: this.props.data.TaskID,
|
||||
},
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
message.success('确认成功!');
|
||||
this.setState({ BtnAgreeDisplay: 'none' })
|
||||
this.BtnClose();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
BtnClose = () => {
|
||||
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
|
||||
this.props.data.onCancel();
|
||||
}
|
||||
|
||||
loadData = (dataId) => {
|
||||
let json = initFilter(this.props.login.OrgId);
|
||||
extendRule(json, 'ID', 1, dataId);
|
||||
extendIgnoreDataRule(json)
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
payload: json,
|
||||
url: 'FO/FOTechDisclosureFromSafe/GetEdit',
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
if(this.props.data && this.props.data.loadDataDeal)
|
||||
{
|
||||
this.props.data.loadDataDeal(1);
|
||||
}
|
||||
this.setState({ data: ret })
|
||||
if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) {
|
||||
this.setState({ BtnAgreeDisplay: 'none' })
|
||||
}else{
|
||||
this.setState({ BtnAgreeDisplay: 'inline' })
|
||||
}
|
||||
}
|
||||
else
|
||||
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onTableBtnExport() {
|
||||
let TableWrap = document.getElementById('tableId' + this.props.data.id);
|
||||
let Table = TableWrap.getElementsByTagName('table')[0];
|
||||
const wb = XLSX.utils.table_to_book(Table);
|
||||
XLSX.writeFile(wb, "安全交底表.xlsx")
|
||||
}
|
||||
|
||||
render() {
|
||||
const { data } = this.state;
|
||||
return <div>
|
||||
<div style={{ padding: '10px' }}>
|
||||
<ReactToPrint
|
||||
trigger={() => <Button type={'default'} icon={'printer'} style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }}>打印</Button>}
|
||||
content={() => this.componentRef}
|
||||
pageStyle=".printDIV { padding:0 40px;} img{width :120px}"
|
||||
/>
|
||||
<Button style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
|
||||
<Button type="primary" style={{ marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button>
|
||||
</div>
|
||||
|
||||
|
||||
{/* */}
|
||||
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV">
|
||||
|
||||
<h1 style={{ textAlign: 'center', margin: '15px' }}>安全交底表</h1>
|
||||
{
|
||||
data ?
|
||||
<div>
|
||||
<Descriptions size="middle" bordered className={stylesStep.description}>
|
||||
<Descriptions.Item label="编号">{data.CODE}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底事项">{data.NAME}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底时间">{data.DISCLOSURE_DATE}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底地点">{data.JOB_LOCATION}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底人">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
|
||||
<Descriptions.Item label="被交底人">{
|
||||
data.Nav_Person && data.Nav_Person.map((item, i) => {
|
||||
if (i == (data.Nav_Person.length - 1)) {
|
||||
if (item.DEAL_STATUS == 0)
|
||||
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
|
||||
else
|
||||
return item.Nav_User?.NAME
|
||||
} else {
|
||||
if (item.DEAL_STATUS == 0)
|
||||
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ' '}</label>
|
||||
else
|
||||
return item.Nav_User?.NAME + ' '
|
||||
}
|
||||
})
|
||||
}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底内容">{data.DisclosureContent}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底人签字">{
|
||||
(data.Nav_User && data.Nav_User.FILE_PATH)?
|
||||
showUserSign(data.Nav_User, config.picServerHost):null
|
||||
// <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={data.Nav_User?.NAME} src={config.picServerHost + data.Nav_User.FILE_PATH} />
|
||||
// :data.Nav_User?.NAME
|
||||
}</Descriptions.Item>
|
||||
<Descriptions.Item label="被交底人签字">{
|
||||
data.Nav_Person && data.Nav_Person.map((item, i) => {
|
||||
if (item.DEAL_STATUS == 1) {
|
||||
showUserSign(item.Nav_User, config.picServerHost)
|
||||
// if (item.Nav_User != null && item.Nav_User.FILE_PATH != null)
|
||||
// return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item.Nav_User?.NAME} src={config.picServerHost + item.Nav_User.FILE_PATH} />
|
||||
// else
|
||||
// return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item.Nav_User?.NAME} />
|
||||
}
|
||||
})
|
||||
}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div> : null
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
export default connect(({ login }) => ({ login }))(FO037ShowPrint)
|
||||
153
src/components/CustomPages/FO/FO041ShowPrint.js
Normal file
153
src/components/CustomPages/FO/FO041ShowPrint.js
Normal file
@ -0,0 +1,153 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd';
|
||||
import React from 'react';
|
||||
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showFiles, GetFileModel,showUserSign } from "../../../utils/common";
|
||||
import ReactToPrint from "react-to-print";
|
||||
import stylesStep from '../HI/StepForm.css';
|
||||
import config from "../../../config";
|
||||
import XLSX from 'xlsx';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
class FO041ShowPrint extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
data: null,
|
||||
enumData: null,
|
||||
BtnAgreeDisplay: 'none'
|
||||
};
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.data?.id)
|
||||
this.loadData(this.props.data?.id);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(NextProps) {
|
||||
if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
|
||||
this.loadData(NextProps.data?.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onTableBtnAgree() {
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
url: 'FO/FOLeaderWellRecord/PersonalAgree',
|
||||
payload: {
|
||||
ID: this.props.data.id,
|
||||
TaskID: this.props.data.TaskID,
|
||||
},
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
message.success('确认成功!');
|
||||
this.setState({ BtnAgreeDisplay: 'none' })
|
||||
this.BtnClose();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
BtnClose = () => {
|
||||
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
|
||||
this.props.data.onCancel();
|
||||
}
|
||||
|
||||
loadData = (dataId) => {
|
||||
let json = initFilter(this.props.login.OrgId);
|
||||
extendRule(json, 'ID', 1, dataId);
|
||||
extendIgnoreDataRule(json)
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
payload: json,
|
||||
url: 'FO/FOLeaderWellRecord/GetEdit',
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
if(this.props.data && this.props.data.loadDataDeal)
|
||||
{
|
||||
this.props.data.loadDataDeal(1);
|
||||
}
|
||||
this.setState({ data: ret })
|
||||
if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) {
|
||||
this.setState({ BtnAgreeDisplay: 'none' })
|
||||
}else{
|
||||
this.setState({ BtnAgreeDisplay: 'inline' })
|
||||
}
|
||||
}
|
||||
else
|
||||
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onTableBtnExport() {
|
||||
let TableWrap = document.getElementById('tableId' + this.props.data.id);
|
||||
let Table = TableWrap.getElementsByTagName('table')[0];
|
||||
const wb = XLSX.utils.table_to_book(Table);
|
||||
XLSX.writeFile(wb, "领导带班下井记录.xlsx")
|
||||
}
|
||||
|
||||
render() {
|
||||
const { data } = this.state;
|
||||
return <div>
|
||||
<div style={{ padding: '10px' }}>
|
||||
<ReactToPrint
|
||||
trigger={() => <Button type={'default'} icon={'printer'} style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }}>打印</Button>}
|
||||
content={() => this.componentRef}
|
||||
pageStyle=".printDIV { padding:0 40px;} img{width :120px}"
|
||||
/>
|
||||
<Button style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
|
||||
<Button type="primary" style={{ marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button>
|
||||
</div>
|
||||
|
||||
|
||||
{/* */}
|
||||
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV">
|
||||
|
||||
<h1 style={{ textAlign: 'center', margin: '15px' }}>领导带班下井记录</h1>
|
||||
{
|
||||
data ?
|
||||
<div>
|
||||
<Descriptions size="middle" bordered className={stylesStep.description}>
|
||||
<Descriptions.Item label="编号">{data.CODE}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底事项">{data.NAME}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底时间">{data.DISCLOSURE_DATE}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底地点">{data.JOB_LOCATION}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底人">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
|
||||
<Descriptions.Item label="被交底人">{
|
||||
data.Nav_Person && data.Nav_Person.map((item, i) => {
|
||||
if (i == (data.Nav_Person.length - 1)) {
|
||||
if (item.DEAL_STATUS == 0)
|
||||
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
|
||||
else
|
||||
return item.Nav_User?.NAME
|
||||
} else {
|
||||
if (item.DEAL_STATUS == 0)
|
||||
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ' '}</label>
|
||||
else
|
||||
return item.Nav_User?.NAME + ' '
|
||||
}
|
||||
})
|
||||
}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底内容">{data.DisclosureContent}</Descriptions.Item>
|
||||
<Descriptions.Item label="交底人签字">{
|
||||
(data.Nav_User && data.Nav_User.FILE_PATH)?
|
||||
showUserSign(data.Nav_User, config.picServerHost):null
|
||||
|
||||
}</Descriptions.Item>
|
||||
<Descriptions.Item label="被交底人签字">{
|
||||
data.Nav_Person && data.Nav_Person.map((item, i) => {
|
||||
if (item.DEAL_STATUS == 1) {
|
||||
showUserSign(item.Nav_User, config.picServerHost)
|
||||
}
|
||||
})
|
||||
}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div> : null
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
export default connect(({ login }) => ({ login }))(FO041ShowPrint)
|
||||
37
src/files/edit/FO041.js
Normal file
37
src/files/edit/FO041.js
Normal file
@ -0,0 +1,37 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
|
||||
import moment from 'moment';
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
// 编辑
|
||||
export default {
|
||||
onBeforeSaveHandleRecord(params) {
|
||||
params.record.TaskID = params.data.TaskID //TaskID传递消息表ID
|
||||
params.record.PUBLISH = params.customParams;
|
||||
},
|
||||
onBeforeEdit: ({ isNew,login,record, dispatch,stateData, setFieldVisible,setFieldValue,setFieldValueByBatch }) => {
|
||||
if (isNew) {
|
||||
let json = initFilter(login.OrgId);
|
||||
extendRule(json, "ID", 1, login.userId);
|
||||
extendInclude(json, 'Nav_Department.Nav_Unit');
|
||||
dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
url: 'FM/User/Get',
|
||||
payload: json,
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
let temps = [];
|
||||
temps.push({ field: 'APPLY_USER_ID', value: ret.ID})
|
||||
temps.push({ field: 'Nav_ApplyUser.NAME', value: ret.NAME })
|
||||
temps.push({ field: 'APPLY_DEPARTMENT_ID', value: ret.DEPARTMENT_ID})
|
||||
temps.push({ field: 'Nav_ApplyDepartment.NAME', value: ret.Nav_Department?.NAME })
|
||||
temps.push({ field: 'PRODUCTION_UNIT_ID', value: ret.Nav_Department?.PRODUCTION_UNIT_ID})
|
||||
temps.push({ field: 'Nav_ProductionUnit.NAME', value: ret.Nav_Department?.Nav_Unit?.NAME })
|
||||
setFieldValueByBatch(temps);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
35
src/files/edit/FOO035.js
Normal file
35
src/files/edit/FOO035.js
Normal file
@ -0,0 +1,35 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
|
||||
import moment from 'moment';
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
// 编辑
|
||||
export default {
|
||||
onBeforeSaveHandleRecord(params) {
|
||||
params.record.TaskID = params.data.TaskID //TaskID传递消息表ID
|
||||
params.record.PUBLISH = params.customParams;
|
||||
},
|
||||
onBeforeEdit: ({ isNew,login,record, dispatch,stateData, setFieldVisible,setFieldValue,setFieldValueByBatch }) => {
|
||||
if (isNew) {
|
||||
let json = initFilter(login.OrgId);
|
||||
extendRule(json, "ID", 1, login.userId);
|
||||
extendInclude(json, 'Nav_Department');
|
||||
dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
url: 'FM/User/Get',
|
||||
payload: json,
|
||||
onComplete: (ret) => {
|
||||
if (ret) {
|
||||
let temps = [];
|
||||
temps.push({ field: 'USER_ID', value: ret.ID})
|
||||
temps.push({ field: 'Nav_User.NAME', value: ret.NAME })
|
||||
temps.push({ field: 'DEPARTMENT_ID', value: ret.DEPARTMENT_ID})
|
||||
temps.push({ field: 'Nav_Department.NAME', value: ret.Nav_Department?.NAME })
|
||||
setFieldValueByBatch(temps);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -216,7 +216,12 @@ btnSubContents: ({row, srcRecord,getSelectedRecords,record,saveRowRecord,colInfo
|
||||
payload: stateData,
|
||||
onlyData: false,
|
||||
onComplete: (re) => {
|
||||
if (re && re.IsSuccessful && re.Data) {
|
||||
if(re && re.ErrorMessage)
|
||||
{
|
||||
message.error(re.ErrorMessage)
|
||||
return
|
||||
}
|
||||
else if (re && re.IsSuccessful && re.Data) {
|
||||
stateData.Nav_CheckNoticeDetails = re.Data
|
||||
saveRowRecord({ record: stateData, editCode: "T_SK_SECURITY_INSPECTION_NOTICE_DETAIL" })
|
||||
}
|
||||
|
||||
@ -97,6 +97,11 @@ const FO015ShowPrint = createLoadableComponent(() => import('../components/Custo
|
||||
const FO008ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO008ShowPrint'))
|
||||
const FO021EditPage = createLoadableComponent(() => import('../components/CustomPages/FO/FO021EditPage'))
|
||||
const FO019ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO019ShowPrint'))
|
||||
const FO035ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO035ShowPrint'))
|
||||
const FO037ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO037ShowPrint'))
|
||||
const FO041ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO041ShowPrint'))
|
||||
const FO043ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO043ShowPrint'))
|
||||
const FO045ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO045ShowPrint'))
|
||||
|
||||
const PreMeetingTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreMeetingTask'))
|
||||
const PreOperSchTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreOperSchTask'))
|
||||
@ -301,6 +306,11 @@ export default function (componentName, formId, formParam, data, formCode, formD
|
||||
FO022ShowPrint: <FO022ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO021EditPage: <FO021EditPage formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO015ShowPrint: <FO015ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO035ShowPrint: <FO035ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO037ShowPrint: <FO037ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO041ShowPrint: <FO041ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO043ShowPrint: <FO043ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO045ShowPrint: <FO045ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
|
||||
HM104ShowPrint: <HM104ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
HM087ShowPrint: <HM087ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user