Commit 4a849b44feaa5a0381c6474d56ae3273bfc160d5
1 parent
79352ea2
1.更多功能增加误工登记,取消误工登记,走不同的过程
Showing
1 changed file
with
47 additions
and
4 deletions
src/mes/indexMes/index.js
| ... | ... | @@ -29,6 +29,8 @@ import { |
| 29 | 29 | } from "antd"; |
| 30 | 30 | import { |
| 31 | 31 | CloseOutlined, |
| 32 | + ClockCircleOutlined, | |
| 33 | + CloseCircleOutlined, | |
| 32 | 34 | UserAddOutlined, |
| 33 | 35 | SwapOutlined, |
| 34 | 36 | AppstoreOutlined |
| ... | ... | @@ -860,7 +862,7 @@ const SystemFunComponent = () => { |
| 860 | 862 | |
| 861 | 863 | // 调用通用过程 |
| 862 | 864 | const [form] = Form.useForm(); |
| 863 | - const handleProcedureCall = async (params, iFlag) => { | |
| 865 | + const handleProcedureCall = async (params, iFlag, sProName = "sp_ResetDailyReport") => { | |
| 864 | 866 | const shiftValue = String(props.app.sShift || '1'); |
| 865 | 867 | const extraValues = await new Promise(resolve => { |
| 866 | 868 | form.setFieldsValue({ |
| ... | ... | @@ -870,8 +872,9 @@ const SystemFunComponent = () => { |
| 870 | 872 | label: shiftValue === '1' ? '白班' : '夜班' |
| 871 | 873 | } |
| 872 | 874 | }); |
| 875 | + const title = sProName === "sp_ResetDailyReport" ? "切换手动" : (sProName === "sp_mes_downtimeReport" ? "误工登记" : "取消误工登记"); | |
| 873 | 876 | Modal.confirm({ |
| 874 | - title: "切换手动", | |
| 877 | + title: title, | |
| 875 | 878 | content: ( |
| 876 | 879 | <ConfigProvider locale={zhCN}> |
| 877 | 880 | <Form layout="vertical" size="large" form={form}> |
| ... | ... | @@ -918,11 +921,11 @@ const SystemFunComponent = () => { |
| 918 | 921 | |
| 919 | 922 | const value = { |
| 920 | 923 | sBtnName: "BtnEventAuto", |
| 921 | - sProName: "sp_ResetDailyReport", | |
| 924 | + sProName: sProName, | |
| 922 | 925 | sProInParam: JSON.stringify({ |
| 923 | 926 | changeValue: {}, |
| 924 | 927 | sButtonParam: { |
| 925 | - sproName: "sp_ResetDailyReport", | |
| 928 | + sproName: sProName, | |
| 926 | 929 | inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType" |
| 927 | 930 | }, |
| 928 | 931 | params: [ |
| ... | ... | @@ -1144,6 +1147,28 @@ const SystemFunComponent = () => { |
| 1144 | 1147 | } |
| 1145 | 1148 | }); |
| 1146 | 1149 | break; |
| 1150 | + case "downtimeReport": | |
| 1151 | + // 误工登记 | |
| 1152 | + handleProcedureCall({ | |
| 1153 | + onSuccess: () => { | |
| 1154 | + message.success("误工登记成功, 请等待页面刷新", 2); | |
| 1155 | + setTimeout(() => { | |
| 1156 | + location.reload(); | |
| 1157 | + }, 1500); | |
| 1158 | + } | |
| 1159 | + }, 1, "sp_mes_downtimeReport"); | |
| 1160 | + break; | |
| 1161 | + case "unDowntimeReport": | |
| 1162 | + // 取消误工登记 | |
| 1163 | + handleProcedureCall({ | |
| 1164 | + onSuccess: () => { | |
| 1165 | + message.success("取消误工登记成功, 请等待页面刷新", 2); | |
| 1166 | + setTimeout(() => { | |
| 1167 | + location.reload(); | |
| 1168 | + }, 1500); | |
| 1169 | + } | |
| 1170 | + }, 0, "sp_mes_un_downtimeReport"); | |
| 1171 | + break; | |
| 1147 | 1172 | default: |
| 1148 | 1173 | break; |
| 1149 | 1174 | } |
| ... | ... | @@ -1211,6 +1236,24 @@ const SystemFunComponent = () => { |
| 1211 | 1236 | <CloseOutlined /> |
| 1212 | 1237 | <span>取消手动</span> |
| 1213 | 1238 | </div> |
| 1239 | + <div | |
| 1240 | + className="restDailyReport" | |
| 1241 | + onClick={() => { | |
| 1242 | + handleSystemFunClick("downtimeReport"); | |
| 1243 | + }} | |
| 1244 | + > | |
| 1245 | + <ClockCircleOutlined /> | |
| 1246 | + <span>误工登记</span> | |
| 1247 | + </div> | |
| 1248 | + <div | |
| 1249 | + className="restDailyReport" | |
| 1250 | + onClick={() => { | |
| 1251 | + handleSystemFunClick("unDowntimeReport"); | |
| 1252 | + }} | |
| 1253 | + > | |
| 1254 | + <CloseCircleOutlined /> | |
| 1255 | + <span>取消误工登记</span> | |
| 1256 | + </div> | |
| 1214 | 1257 | </div> |
| 1215 | 1258 | } |
| 1216 | 1259 | > | ... | ... |