Commit a1aad7275882d7b350abb30bc6f671551d76c4ab

Authored by Min
1 parent cd17f112

1.处理切换手工,传参问题

2.处理班组报工 默认传未报工 0
src/mes/common/commonModelComponent/index.js
@@ -2126,7 +2126,7 @@ const RunningStatusConditionComponent = props => { @@ -2126,7 +2126,7 @@ const RunningStatusConditionComponent = props => {
2126 : now 2126 : now
2127 ); 2127 );
2128 2128
2129 - const [iShowType, setShowType] = useState(1); 2129 + const [iShowType, setShowType] = useState(0);
2130 2130
2131 const flag = useRef(false); 2131 const flag = useRef(false);
2132 useEffect( 2132 useEffect(
src/mes/indexMes/index.js
@@ -869,10 +869,14 @@ const SystemFunComponent = () => { @@ -869,10 +869,14 @@ const SystemFunComponent = () => {
869 // 调用通用过程 869 // 调用通用过程
870 const [form] = Form.useForm(); 870 const [form] = Form.useForm();
871 const handleProcedureCall = async (params, iFlag) => { 871 const handleProcedureCall = async (params, iFlag) => {
  872 + const shiftValue = String(props.app.sShift || '1');
872 const extraValues = await new Promise(resolve => { 873 const extraValues = await new Promise(resolve => {
873 form.setFieldsValue({ 874 form.setFieldsValue({
874 tReportDate: moment(), 875 tReportDate: moment(),
875 - // sTeamType: props.app.sShift 876 + sTeamType: {
  877 + value: shiftValue, // 统一为字符串类型
  878 + label: shiftValue === '1' ? '白班' : '夜班'
  879 + }
876 }); 880 });
877 Modal.confirm({ 881 Modal.confirm({
878 title: "切换手动", 882 title: "切换手动",
@@ -890,8 +894,6 @@ const SystemFunComponent = () => { @@ -890,8 +894,6 @@ const SystemFunComponent = () => {
890 <Select 894 <Select
891 placeholder="请选择" 895 placeholder="请选择"
892 labelInValue 896 labelInValue
893 - // 或者使用defaultValue确保初始显示正确  
894 - defaultValue={{ value: props.app.sShift, label: props.app.sShift === 1 || props.app.sShift === '1' ? '白班' : '夜班' }}  
895 > 897 >
896 <Select.Option value="1">白班</Select.Option> 898 <Select.Option value="1">白班</Select.Option>
897 <Select.Option value="2">夜班</Select.Option> 899 <Select.Option value="2">夜班</Select.Option>
@@ -906,7 +908,7 @@ const SystemFunComponent = () =&gt; { @@ -906,7 +908,7 @@ const SystemFunComponent = () =&gt; {
906 onOk() { 908 onOk() {
907 const values = form.getFieldsValue(); 909 const values = form.getFieldsValue();
908 const tReportDate = values?.tReportDate.format("YYYY-MM-DD") || ""; 910 const tReportDate = values?.tReportDate.format("YYYY-MM-DD") || "";
909 - const sTeamType = values.sTeamType; 911 + const sTeamType = values.sTeamType?.value || '';
910 resolve({ tReportDate, sTeamType }); 912 resolve({ tReportDate, sTeamType });
911 }, 913 },
912 onCancel() { 914 onCancel() {