Commit 99f84149bcd61a6bd97125ca09c44a9d0742c0b4

Authored by Min
1 parent b879ca08

1.切换手动增加一个切换原因的必填项

Showing 1 changed file with 20 additions and 3 deletions
src/mes/indexMes/index.js
@@ -894,17 +894,34 @@ const SystemFunComponent = () => { @@ -894,17 +894,34 @@ const SystemFunComponent = () => {
894 <Select.Option value="2">夜班</Select.Option> 894 <Select.Option value="2">夜班</Select.Option>
895 </Select> 895 </Select>
896 </Form.Item> 896 </Form.Item>
  897 + {sProName === "sp_ResetDailyReport" && (
  898 + <Form.Item label="切换原因" name="sReportReason" rules={[{ required: true, message: '请输入切换原因' }]}>
  899 + <textarea
  900 + style={{ width: "100%" }}
  901 + rows={3}
  902 + placeholder="请输入切换原因"
  903 + />
  904 + </Form.Item>
  905 + )}
897 </Form> 906 </Form>
898 </ConfigProvider> 907 </ConfigProvider>
899 ), 908 ),
900 wrapClassName: "mesCommonModal mesLoginForm", 909 wrapClassName: "mesCommonModal mesLoginForm",
901 cancelText: "取消", 910 cancelText: "取消",
902 okText: "确定", 911 okText: "确定",
903 - onOk() { 912 + onOk: async () => {
904 const values = form.getFieldsValue(); 913 const values = form.getFieldsValue();
905 const tReportDate = values?.tReportDate.format("YYYY-MM-DD") || ""; 914 const tReportDate = values?.tReportDate.format("YYYY-MM-DD") || "";
906 const sTeamType = values.sTeamType?.value || ''; 915 const sTeamType = values.sTeamType?.value || '';
907 - resolve({ tReportDate, sTeamType }); 916 + const sReportReason = values?.sReportReason || '';
  917 +
  918 + if (sProName === "sp_ResetDailyReport") {
  919 + if (!sReportReason) {
  920 + message.warning('请输入切换原因');
  921 + return Promise.reject(); // 关键!阻止弹窗关闭
  922 + }
  923 + }
  924 + resolve({ tReportDate, sTeamType, sReportReason });
908 }, 925 },
909 onCancel() { 926 onCancel() {
910 resolve(false); 927 resolve(false);
@@ -926,7 +943,7 @@ const SystemFunComponent = () =&gt; { @@ -926,7 +943,7 @@ const SystemFunComponent = () =&gt; {
926 changeValue: {}, 943 changeValue: {},
927 sButtonParam: { 944 sButtonParam: {
928 sproName: sProName, 945 sproName: sProName,
929 - inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType" 946 + inMap: sProName === "sp_ResetDailyReport" ? "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType,userinfo.sReportReason" : "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType"
930 }, 947 },
931 params: [ 948 params: [
932 { 949 {