fangmingyue 1 year ago
parent
commit
2aff1913e6

+ 6
- 17
src/pages/financeItem/Edit.jsx View File

25
 
25
 
26
   const [params] = useSearchParams()
26
   const [params] = useSearchParams()
27
   const id = params.get('id')
27
   const id = params.get('id')
28
-  const [ycType, setYcType] = useState()
29
 
28
 
30
-  const onChange = (e) => {
31
-    setYcType(e.target.value);
32
-  };
33
   useEffect(() => {
29
   useEffect(() => {
34
     if (id) {
30
     if (id) {
35
       getTfItemFinanceId(id).then((res) => {
31
       getTfItemFinanceId(id).then((res) => {
36
         formRef.current?.setFieldsValue(res)
32
         formRef.current?.setFieldsValue(res)
37
-        setYcType(res?.ycType);
38
       })
33
       })
39
     }
34
     }
40
   }, [])
35
   }, [])
41
 
36
 
42
   const onFinish = (values) => {
37
   const onFinish = (values) => {
43
     if (!id) {
38
     if (!id) {
44
-      postTfItemFinance(ycType, ...values).then((res) => {
39
+      postTfItemFinance(values).then((res) => {
45
         navigate(-1)
40
         navigate(-1)
46
       })
41
       })
47
     } else if (id) {
42
     } else if (id) {
48
       let financeItemId = id
43
       let financeItemId = id
49
-      putTfItemFinance(id, { financeItemId, ycType, ...values }).then((res) => {
44
+      putTfItemFinance(id, { financeItemId, ...values }).then((res) => {
50
         navigate(-1)
45
         navigate(-1)
51
       })
46
       })
52
     }
47
     }
56
     minimumFractionDigits: 4,
51
     minimumFractionDigits: 4,
57
     maximumFractionDigits: 4,
52
     maximumFractionDigits: 4,
58
   })
53
   })
59
-  console.log('ycType', ycType);
54
+
60
   return (
55
   return (
61
     <Page>
56
     <Page>
62
       <Card>
57
       <Card>
87
           <ProFormText name="fromOrg" label="来源机构" />
82
           <ProFormText name="fromOrg" label="来源机构" />
88
           <ProFormText name="toOrg" label="目的机构" />
83
           <ProFormText name="toOrg" label="目的机构" />
89
           <ProFormText name="attach" label="附件" />
84
           <ProFormText name="attach" label="附件" />
90
-          {/* <ProFormRadio.Group
85
+          <ProFormRadio.Group
91
             name="ycType"
86
             name="ycType"
92
             label="收支类型"
87
             label="收支类型"
93
             options={[
88
             options={[
94
               { label: '收入', value: 1 },
89
               { label: '收入', value: 1 },
95
-              { label: '支出', value: `${-1}` },
90
+              { label: '支出', value: -1 },
96
             ]}
91
             ]}
97
-          /> */}
98
-          <Form.Item label="收支类型">
99
-            <Radio.Group name="ycType" onChange={onChange} value={ycType}>
100
-              <Radio value={1}>收入</Radio>
101
-              <Radio value={0}>支出</Radio>
102
-            </Radio.Group>
103
-          </Form.Item>
92
+          />
104
         </ProForm>
93
         </ProForm>
105
       </Card>
94
       </Card>
106
     </Page>
95
     </Page>

+ 26
- 9
src/pages/package/components/Package.jsx View File

5
   ProFormMoney,
5
   ProFormMoney,
6
   ProFormSelect,
6
   ProFormSelect,
7
   ProFormText,
7
   ProFormText,
8
+  ProFormRadio,
8
 } from "@ant-design/pro-components";
9
 } from "@ant-design/pro-components";
9
 import { Button, Row, Col } from "antd";
10
 import { Button, Row, Col } from "antd";
10
 import { useNavigate } from "react-router-dom";
11
 import { useNavigate } from "react-router-dom";
62
     >
63
     >
63
       <ProFormText name="packageName" label="套餐名称" />
64
       <ProFormText name="packageName" label="套餐名称" />
64
       <ProFormText name="packageType" label="套餐类型" />
65
       <ProFormText name="packageType" label="套餐类型" />
65
-      <ProForm.Item name="thumb" label="图片">
66
+      <ProForm.Item name="thumb" label="套餐图片">
66
         <UploadImage onChange={onChange} />
67
         <UploadImage onChange={onChange} />
67
       </ProForm.Item>
68
       </ProForm.Item>
68
-      <ProFormMoney name="charge" label="价格" />
69
-      <ProFormText name="limitType" label="是否限制型消费" />
69
+      <ProFormMoney name="charge" label="套餐价格" />
70
+      {/* <ProFormText name="limitType" label="是否限制型消费" /> */}
70
       <ProFormText name="limitNum" label="限制数目" />
71
       <ProFormText name="limitNum" label="限制数目" />
71
       <ProFormSelect
72
       <ProFormSelect
72
         name="limitUnit"
73
         name="limitUnit"
73
         label="限制单位"
74
         label="限制单位"
74
         options={[
75
         options={[
75
-          { key: "year", label: "year" },
76
-          { key: "month", label: "month" },
77
-          { key: "day", label: "day" },
78
-          { key: "order", label: "order" },
76
+          { key: "year", label: "" },
77
+          { key: "month", label: "" },
78
+          { key: "day", label: "" },
79
+          { key: "order", label: "" },
79
         ]}
80
         ]}
80
       />
81
       />
81
-      <ProFormText name="desc" label="说明" />
82
-      <ProFormSelect
82
+      <ProFormText name="desc" label="套餐说明" />
83
+      <ProFormRadio.Group
84
+        name="limitType"
85
+        label="是否限制型消费"
86
+        options={[
87
+          { label: '是', value: 1 },
88
+          { label: '否', value: 0 },
89
+        ]}
90
+      />
91
+      {/* <ProFormSelect
83
         name="status"
92
         name="status"
84
         label="状态"
93
         label="状态"
85
         options={[
94
         options={[
92
             value: 1,
101
             value: 1,
93
           },
102
           },
94
         ]}
103
         ]}
104
+      /> */}
105
+      <ProFormRadio.Group
106
+        name="status"
107
+        label="套餐状态"
108
+        options={[
109
+          { label: '上架', value: 1 },
110
+          { label: '下架', value: 0 },
111
+        ]}
95
       />
112
       />
96
     </ProForm>
113
     </ProForm>
97
   );
114
   );

+ 6
- 0
src/pages/package/index.jsx View File

44
     {
44
     {
45
       title: "限制单位",
45
       title: "限制单位",
46
       dataIndex: "limitUnit",
46
       dataIndex: "limitUnit",
47
+      valueEnum: {
48
+        'order': "次",
49
+        'day': "日",
50
+        'month': "月",
51
+        'year': "年",
52
+      },
47
       search: false,
53
       search: false,
48
     },
54
     },
49
 
55