fix
HaiLin Huang
2025-02-05 4f6292b0fa66474cef8ae64640c1d395f15f3ed9
fix
3个文件已修改
48 ■■■■ 已修改文件
yandu-platform/src/pages/sales/order/components/OptometryList.tsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yandu-platform/src/pages/sales/order/components/OrderGoodsForm.tsx 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yandu-platform/src/pages/sales/order/components/StoreForm.tsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yandu-platform/src/pages/sales/order/components/OptometryList.tsx
@@ -162,8 +162,8 @@
        current,
        pageSize,
      });
      fetchData();
    }
    function onTableChange({ current, pageSize }) {
      onPaginateChange(current, pageSize);
    }
@@ -171,6 +171,10 @@
    useEffect(() => {
      onPaginateChange(1, paginationConfig.pageSize);
    }, [props.memberId]);
    useEffect(() => {
      fetchData();
    }, [paginationConfig.current]);
    return (
      <>
        <Table
yandu-platform/src/pages/sales/order/components/OrderGoodsForm.tsx
@@ -20,6 +20,7 @@
  getBallMirrorList,
  getColumnMirrorList,
  getOptometryBallMirrorList,
  getOptometryColumnMirrorList,
} from '@/utils/mirror';
import FrameModelSelect from '@/components/FrameModelSelect';
import LensSeriesSelect from '@/components/LensSeriesSelect';
@@ -84,18 +85,19 @@
    // 球镜可选列表(非库存镜片-2000到2000,每25一跳、库存镜片0到-1000,每25一跳,没有-25),选择后除以100
    const [ballMirrorList, setBallMirrorList] = useState([]);
    const [columnMirrorList, setColumnMirrorList] = useState(
      getColumnMirrorList()
    );
    const [columnMirrorList, setColumnMirrorList] = useState([]);
    const resetBallMirrorList = (series: any) => {
      // 球镜可选列表(非库存镜片-2000到2000,每25一跳、库存镜片0到-1000,每25一跳,没有-25),选择后除以100
      // 如果是非库存,
      let lastBallMirrorList = [];
      let lastColumnMirrorList = [];
      if (series.type == 2) {
        lastBallMirrorList = getOptometryBallMirrorList();
        lastColumnMirrorList = getOptometryColumnMirrorList();
      } else {
        lastBallMirrorList = getBallMirrorList();
        lastColumnMirrorList = getColumnMirrorList();
      }
      if (lastBallMirrorList.length !== ballMirrorList.length) {
        // 重置球镜,因为可选项变了(也可以检查下值有没有再说,以后再说)
@@ -104,7 +106,15 @@
          ballMirrorL: undefined,
        });
      }
      if (lastColumnMirrorList.length !== columnMirrorList.length) {
        // 重置柱镜,因为可选项变了(也可以检查下值有没有再说,以后再说)
        form.setFieldsValue({
          columnMirrorR: undefined,
          columnMirrorL: undefined,
        });
      }
      setBallMirrorList(lastBallMirrorList);
      setColumnMirrorList(lastColumnMirrorList);
    };
    const frameModelRef = useRef(null);
@@ -270,7 +280,10 @@
          lensTypeName: currentLensType?.label || '',
          refractiveIndex: values.refractiveIndex,
          ballMirror: (values.ballMirrorR / 100).toFixed(2),
          columnMirror: values.columnMirrorR,
          columnMirror:
            columnMirrorList.length > 8
              ? (values.columnMirrorR / 100).toFixed(2)
              : values.columnMirrorR,
          price: currentRefractiveIndex?.sales || 0,
          cost: currentRefractiveIndex?.cost || 0,
          frameModelId: undefined,
@@ -304,7 +317,10 @@
          lensTypeName: currentLensType?.label || '',
          refractiveIndex: values.refractiveIndex,
          ballMirror: (values.ballMirrorL / 100).toFixed(2),
          columnMirror: values.columnMirrorL,
          columnMirror:
            columnMirrorList.length > 8
              ? (values.columnMirrorL / 100).toFixed(2)
              : values.columnMirrorL,
          price: currentRefractiveIndex?.sales || 0,
          cost: currentRefractiveIndex?.cost || 0,
          frameModelId: undefined,
@@ -652,12 +668,25 @@
                              renderFormat={(option, value) => {
                                return option ? (
                                  <span>
                                    {+option.value === 0 ? '-' : option.value}
                                    {columnMirrorList.length > 8
                                      ? `${(+option.value / 100).toFixed(2)}`
                                      : +option.value === 0
                                      ? '-'
                                      : option.value}
                                  </span>
                                ) : (
                                  value
                                );
                              }}
                              // renderFormat={(option, value) => {
                              //   return option ? (
                              //     <span>
                              //       {+option.value === 0 ? '-' : option.value}
                              //     </span>
                              //   ) : (
                              //     value
                              //   );
                              // }}
                            >
                              {columnMirrorList.map((item) => {
                                return (
yandu-platform/src/pages/sales/order/components/StoreForm.tsx
@@ -42,6 +42,7 @@
                layout="horizontal"
                labelCol={{ span: 8 }}
                wrapperCol={{ span: 16 }}
                rules={[{ required: true, message: '请选择店铺' }]}
              >
                <StoreSelect />
              </Form.Item>