|
|
@ -15,7 +15,7 @@ import { |
|
|
|
Timeline, |
|
|
|
Popover |
|
|
|
} from "antd"; |
|
|
|
import { dictionary } from "@/config/common"; |
|
|
|
import { utils } from "@/config/common"; |
|
|
|
import ajax from "@/services"; |
|
|
|
import { TableModule } from "@/components"; |
|
|
|
import moment from 'moment' |
|
|
@ -139,10 +139,17 @@ function BillingRule() { |
|
|
|
|
|
|
|
// 检索 |
|
|
|
const search = (params) => { |
|
|
|
utils.tableScrollTop("parent-table-scroll"); |
|
|
|
let data = { |
|
|
|
...params, |
|
|
|
type:1 |
|
|
|
} |
|
|
|
let regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im, |
|
|
|
regCn = /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im; |
|
|
|
if(regEn.test(data.rule_name) || regCn.test(data.rule_name)){ |
|
|
|
message.error("输入不能包含特殊字符,请重新输入") |
|
|
|
return |
|
|
|
} |
|
|
|
ajax.getRegularList(data).then((res) => { |
|
|
|
if (res.status === 20000) { |
|
|
|
setTableData(res.data.list); |
|
|
@ -167,19 +174,25 @@ function BillingRule() { |
|
|
|
|
|
|
|
// 处理弹框ok按钮 |
|
|
|
const handleConfirm = () => { |
|
|
|
let data = { |
|
|
|
...modalData, |
|
|
|
rule_name:modalData?.rule_name.replace(/\s/g,""), |
|
|
|
rule_code:modalData?.rule_code.replace(/\s/g,""), |
|
|
|
type:1 |
|
|
|
} |
|
|
|
setDetailVisible(true) |
|
|
|
if(!modalData?.operator_id){ |
|
|
|
if(!data?.operator_id){ |
|
|
|
message.warning("运营商名称不能为空") |
|
|
|
return |
|
|
|
}else if(!modalData?.rule_name){ |
|
|
|
}else if(!data?.rule_name){ |
|
|
|
message.warning("规则名称不能为空") |
|
|
|
return |
|
|
|
}else if(!modalData?.rule_code){ |
|
|
|
}else if(!data?.rule_code){ |
|
|
|
message.warning("规则编码不能为空") |
|
|
|
return |
|
|
|
} |
|
|
|
// 发保存请求 |
|
|
|
ajax.addRule({...modalData,type:1}).then(res => { |
|
|
|
ajax.addRule(data).then(res => { |
|
|
|
if (res.status === 20000) { |
|
|
|
message.success(res.message) |
|
|
|
tableRef.current.fetch() |
|
|
@ -222,7 +235,7 @@ function BillingRule() { |
|
|
|
<Modal |
|
|
|
open={detailVisible} |
|
|
|
width={650} |
|
|
|
className="totalModal" |
|
|
|
className="bill-rule-modal" |
|
|
|
onCancel={() => { |
|
|
|
setModalData({...params,username:modalData?.username}) |
|
|
|
setDetailVisible(false); |
|
|
@ -254,7 +267,7 @@ function BillingRule() { |
|
|
|
placeholder="请输入名称" |
|
|
|
value={modalData.rule_name} |
|
|
|
style={{ width: 660, marginLeft: 10 }} |
|
|
|
maxLength={30} |
|
|
|
maxLength={20} |
|
|
|
onChange={(v) => {setModalData({...modalData,rule_name:v.target.value})}} |
|
|
|
/> |
|
|
|
</div> |
|
|
@ -265,7 +278,7 @@ function BillingRule() { |
|
|
|
placeholder="请输入编码" |
|
|
|
value={modalData.rule_code} |
|
|
|
style={{ width: 660, marginLeft: 10 }} |
|
|
|
maxLength={30} |
|
|
|
maxLength={20} |
|
|
|
onChange={(v) => {setModalData({...modalData,rule_code:v.target.value})}} |
|
|
|
/> |
|
|
|
</div> |
|
|
@ -315,7 +328,7 @@ function BillingRule() { |
|
|
|
}} |
|
|
|
> |
|
|
|
<div className="ruleTitle"> |
|
|
|
<span className="font">新增规则</span> |
|
|
|
<span className="font">规则详情</span> |
|
|
|
</div> |
|
|
|
<div className="ltc-content"> |
|
|
|
<div className="ltc-item"> |
|
|
|