weichaochao 5 年 前
コミット
75115a14a8
共有2 個のファイルを変更した35 個の追加4 個の削除を含む
  1. 2
    1
      src/pages/house/raise/edit/components/IdentifyingChips.jsx
  2. 33
    3
      src/pages/house/raise/edit/components/base.jsx

+ 2
- 1
src/pages/house/raise/edit/components/IdentifyingChips.jsx ファイルの表示

@@ -134,6 +134,7 @@ function PreselectionRecord(props) {
134 134
 
135 135
   function raiseRefund(e){
136 136
     setSingleRefund({visable:true,raiseRecordId:e.raiseRecordId});
137
+    getList();
137 138
   }
138 139
   // const raiseRefund = rowData => () => {
139 140
   //   Modal.confirm({
@@ -435,7 +436,7 @@ function PreselectionRecord(props) {
435 436
       <BatchDel visible={batchDel.visable} houseIds={batchDel.houseIds} onCancel={() => showBatchDel({visable:false, houseIds: taRaiseRecords})} onSuccess={() => showBatchDel({visable:false, houseIds:'' })}/>
436 437
       <BatchPay visible={pay.visable} houseIds={pay.houseIds} onCancel={() => showPay(false)} onSuccess={() => showPay(false)} />
437 438
       <BatchRefund visible={refund.visable} houseIds={refund.houseIds} onCancel={() => setRefund(false)} onSuccess={() => setRefund(false)}/>
438
-      <Refund visible={singleRefund.visable} raiseRecordId={singleRefund.raiseRecordId} onCancel={() => setSingleRefund({visable:false, raiseRecordId:''})}></Refund>
439
+      <Refund visible={singleRefund.visable} raiseRecordId={singleRefund.raiseRecordId} onCancel={() => setSingleRefund({visable:false, raiseRecordId:''})} onSuccess={() => setSingleRefund({visable:false})}></Refund>
439 440
       <br/>
440 441
       <span>共筛选出{data.total}条数据</span>      
441 442
       <Table rowSelection={rowSelection} dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>

+ 33
- 3
src/pages/house/raise/edit/components/base.jsx ファイルの表示

@@ -63,6 +63,35 @@ const Base = props => {
63 63
     }
64 64
   }
65 65
 
66
+  function toDecimal2 (x){
67
+    var f = parseFloat(x);
68
+    if (isNaN(f)) {
69
+      return false;
70
+    }
71
+    var f = Math.round(x * 100) / 100;
72
+    var s = f.toString();
73
+    var rs = s.indexOf('.');
74
+    if (rs < 0) {
75
+      rs = s.length;
76
+      s += '.';
77
+    }
78
+    while (s.length <= rs + 2) {
79
+      s += '0';
80
+    }
81
+    console.log(s)
82
+    return s;
83
+  }
84
+  function regFenToYuan(fen){
85
+    var num = fen;
86
+    num = fen * 0.01;
87
+    num += '';
88
+    var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
89
+    num = num.replace(reg, '$1');
90
+    console.log(num, 'yuan')
91
+    num = toDecimal2(num)
92
+    return num
93
+  }
94
+
66 95
   function handleSubmit (e) {
67 96
     e.preventDefault();
68 97
     props.form.validateFields((err, values) => {
@@ -90,6 +119,7 @@ const Base = props => {
90 119
         values.raiseStartTime = moment(values.raiseStartTime._d).format('YYYY-MM-DD HH:mm:ss')
91 120
         values.raiseEndTime = moment(values.raiseEndTime._d).format('YYYY-MM-DD HH:mm:ss')
92 121
         values.payType = values.payType.toString();
122
+        values.raisePrice = values.raisePrice * 100;
93 123
         request({ ...apis.house.updateRaise, urlData: { id: raiseId }, data: { ...values },}).then((data) => {
94 124
           message.info("保存成功")
95 125
         }).catch((err) => {
@@ -155,9 +185,9 @@ const Base = props => {
155 185
           </Select>)}
156 186
         </Form.Item>
157 187
         <Form.Item label="认筹金额" help="最高50000元(需要微信商户号配置的行业为房地产行业:房地产开发,物业,房产中介。若微信商户号配置为其他行业则为3000元若不确定请联系平台相关运营人员。">
158
-          {getFieldDecorator('raisePrice', {initialValue:saleBatchData.raisePrice,
188
+          {getFieldDecorator('raisePrice', {initialValue:regFenToYuan(saleBatchData.raisePrice),
159 189
             rules: [{ required: true, message: '请输入认筹金额' }],
160
-          })(<InputNumber max={50000} placeholder="认筹缴费金额" style={{width:'200px'}} />)}
190
+          })(<InputNumber max={50000} min={0.1} step={0.01} placeholder="认筹缴费金额" style={{width:'200px'}} />)}
161 191
         </Form.Item>
162 192
         <Form.Item label="认筹需预选" help="设置是否需要客户之前预选了房源才能认筹。">
163 193
           {getFieldDecorator('needPreselection', {initialValue:saleBatchData.needPreselection === false?'false':'true',
@@ -194,7 +224,7 @@ const Base = props => {
194 224
           initialValue:saleBatchData.payProtocol})(<Wangedit />)}
195 225
         </Form.Item>
196 226
         <Form.Item label="扫码查看房源列表">
197
-        {getFieldDecorator('payProtocol', {
227
+        {getFieldDecorator('qrCode', {
198 228
             rules: [{ required: true, message: '请输入选房协议' }],
199 229
           initialValue:saleBatchData.payProtocol})(<MiniQRCode targetId={saleBatchData.salesBatchId} page="onlineSelling/pages/houseList/index" />)}
200 230
         </Form.Item>