qrScan.js
5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import React, { useEffect } from 'react';
import { Modal , Button , Input } from 'antd';
import * as commonFunc from "@/components/Common/commonFunc";
import * as commonUtils from "@/utils/utils";
import * as commonBusiness from "@/components/Common/commonBusiness";
import StaticEditTable from "@/components/Common/CommonTable";
import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
import styles from './index.less'
const teamInfoSid = "12710101117087385123610";
// 业务层
const useTeamInfoEvent = (props) => {
const { formData } = props;
useEffect(async () => {
if (commonUtils.isNotEmptyArr(formData)) {
const colunmData = handleGetColumnData(formData, true);
const result = await handleGetData(formData, true);
const addState = {
...colunmData,
...result
};
props.onSaveState(addState)
}
}, [formData])
// 获取表头数据
const handleGetColumnData = (formData = [], isWait) => {
let addState = {};
for (let i = 0; i < formData.length; i++) {
const config = formData[i];
const column = commonFunc.getHeaderConfig(config);
addState = {
...addState,
[`slave${i}Column`]: column,
[`slave${i}Config`]: config
};
}
if (isWait) {
return addState;
} else {
props.onSaveState(addState);
}
};
// 获取数据集
const handleGetData = async (formData = [], isWait) => {
let addState = {};
for (let i = 0; i < formData.length; i++) {
const config = formData[i];
const { sGrd } = config;
const conditonValues = props.onGetSqlConditionValues(config);
const result =
(await props.onGetDataSet({
name: sGrd,
configData: config,
condition: { sSqlCondition: { ...conditonValues } },
isWait: true
})) || {};
props.setTempRef(result);
addState = { ...addState, ...result };
}
props.setTempRef({}, true);
if (isWait) {
return addState;
} else {
props.onSaveState(addState);
}
};
return {
...props,
// 其他对象
}
}
const firstNoticeModal = _props =>{
if (!_props.modalValue) return "";
const props = useTeamInfoEvent(useCommonBase({..._props, sModelsId: teamInfoSid}));
// 人员
const tablePropsCrew = {
...commonBusiness.getTableTypes('slave0', props),
tableProps: {
onChange: () => {},
tableHeight: '100%',
},
fixedHeight : '100.5px',
};
// 收信人
const tablePropsCollect = {
...commonBusiness.getTableTypes('slave1', props),
tableProps: {
onChange: () => {},
tableHeight: '100%',
},
fixedHeight : '100.5px',
};
// 岗位
const tablePropsPost = {
...commonBusiness.getTableTypes('slave3', props),
tableProps: {
onChange: () => {},
tableHeight: '100%',
},
fixedHeight : '100.5px',
};
// 通知列表
const tableProps = {
...commonBusiness.getTableTypes('slave2', props),
tableProps: {
onChange: () => {},
tableHeight: '100%',
},
fixedHeight : '100.5px',
};
return (
<Modal title="扫码上料" footer={null} open={props.modalValue} width="80%" onCancel={()=>props.setModalShow(false)} wrapClassName={styles.modalRef}>
<div className={styles.firstNoticeBox}>
<div className="noticeInfo">
<div className="post">
<h2>签样岗位</h2>
<div>
<StaticEditTable {...tablePropsPost} />
</div>
</div>
<div className="postUser">
<div className="postUser_box">
<div className="postTable">
<StaticEditTable {...tablePropsCrew} />
</div>
<div className="userTable">
<StaticEditTable {...tablePropsCollect} />
</div>
</div>
<div className='postUser-foot'>
<Input size="large" placeholder="人员名称" />
<Button size="large" type="primary">查 询</Button>
<Button size="large" type="primary">全 部</Button>
</div>
</div>
<div className="postFrom">
<div class="postFrom_box">表单</div>
<div className='postFrom-foot'>
<Button size="large" type="primary" onClick={()=>props.setModalShow(false) } style={{"background":'#ff7800' , 'border-color': '#ff7800'}}>取 消</Button>
<Button size="large" type="primary">发 送</Button>
</div>
</div>
</div>
<div class="noticeList">
<h2>首签样通知列表</h2>
<div>
<StaticEditTable {...tableProps} />
</div>
</div>
</div>
</Modal>
)
}
export default firstNoticeModal;