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,6 +29,8 @@ import { | ||
| 29 | } from "antd"; | 29 | } from "antd"; |
| 30 | import { | 30 | import { |
| 31 | CloseOutlined, | 31 | CloseOutlined, |
| 32 | + ClockCircleOutlined, | ||
| 33 | + CloseCircleOutlined, | ||
| 32 | UserAddOutlined, | 34 | UserAddOutlined, |
| 33 | SwapOutlined, | 35 | SwapOutlined, |
| 34 | AppstoreOutlined | 36 | AppstoreOutlined |
| @@ -860,7 +862,7 @@ const SystemFunComponent = () => { | @@ -860,7 +862,7 @@ const SystemFunComponent = () => { | ||
| 860 | 862 | ||
| 861 | // 调用通用过程 | 863 | // 调用通用过程 |
| 862 | const [form] = Form.useForm(); | 864 | const [form] = Form.useForm(); |
| 863 | - const handleProcedureCall = async (params, iFlag) => { | 865 | + const handleProcedureCall = async (params, iFlag, sProName = "sp_ResetDailyReport") => { |
| 864 | const shiftValue = String(props.app.sShift || '1'); | 866 | const shiftValue = String(props.app.sShift || '1'); |
| 865 | const extraValues = await new Promise(resolve => { | 867 | const extraValues = await new Promise(resolve => { |
| 866 | form.setFieldsValue({ | 868 | form.setFieldsValue({ |
| @@ -870,8 +872,9 @@ const SystemFunComponent = () => { | @@ -870,8 +872,9 @@ const SystemFunComponent = () => { | ||
| 870 | label: shiftValue === '1' ? '白班' : '夜班' | 872 | label: shiftValue === '1' ? '白班' : '夜班' |
| 871 | } | 873 | } |
| 872 | }); | 874 | }); |
| 875 | + const title = sProName === "sp_ResetDailyReport" ? "切换手动" : (sProName === "sp_mes_downtimeReport" ? "误工登记" : "取消误工登记"); | ||
| 873 | Modal.confirm({ | 876 | Modal.confirm({ |
| 874 | - title: "切换手动", | 877 | + title: title, |
| 875 | content: ( | 878 | content: ( |
| 876 | <ConfigProvider locale={zhCN}> | 879 | <ConfigProvider locale={zhCN}> |
| 877 | <Form layout="vertical" size="large" form={form}> | 880 | <Form layout="vertical" size="large" form={form}> |
| @@ -918,11 +921,11 @@ const SystemFunComponent = () => { | @@ -918,11 +921,11 @@ const SystemFunComponent = () => { | ||
| 918 | 921 | ||
| 919 | const value = { | 922 | const value = { |
| 920 | sBtnName: "BtnEventAuto", | 923 | sBtnName: "BtnEventAuto", |
| 921 | - sProName: "sp_ResetDailyReport", | 924 | + sProName: sProName, |
| 922 | sProInParam: JSON.stringify({ | 925 | sProInParam: JSON.stringify({ |
| 923 | changeValue: {}, | 926 | changeValue: {}, |
| 924 | sButtonParam: { | 927 | sButtonParam: { |
| 925 | - sproName: "sp_ResetDailyReport", | 928 | + sproName: sProName, |
| 926 | inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType" | 929 | inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType" |
| 927 | }, | 930 | }, |
| 928 | params: [ | 931 | params: [ |
| @@ -1144,6 +1147,28 @@ const SystemFunComponent = () => { | @@ -1144,6 +1147,28 @@ const SystemFunComponent = () => { | ||
| 1144 | } | 1147 | } |
| 1145 | }); | 1148 | }); |
| 1146 | break; | 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 | default: | 1172 | default: |
| 1148 | break; | 1173 | break; |
| 1149 | } | 1174 | } |
| @@ -1211,6 +1236,24 @@ const SystemFunComponent = () => { | @@ -1211,6 +1236,24 @@ const SystemFunComponent = () => { | ||
| 1211 | <CloseOutlined /> | 1236 | <CloseOutlined /> |
| 1212 | <span>取消手动</span> | 1237 | <span>取消手动</span> |
| 1213 | </div> | 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 | </div> | 1257 | </div> |
| 1215 | } | 1258 | } |
| 1216 | > | 1259 | > |