|
|
@ -179,8 +179,8 @@ function ComplainManage(props) { |
|
|
|
park_name: "", //停车场名称 |
|
|
|
plate: "", //车牌号 |
|
|
|
park_type: "", //出入场类型 |
|
|
|
in_time: moment().subtract(30, "days").format("YYYY-MM-DD"), //入场时间 |
|
|
|
out_time: moment().format("YYYY-MM-DD"), //出场时间 |
|
|
|
in_time: moment().subtract(30, "days").format("YYYY-MM-DD HH:mm:ss"), //入场时间 |
|
|
|
out_time: moment().format("YYYY-MM-DD HH:mm:ss"), //出场时间 |
|
|
|
pn: 1, // 页码 |
|
|
|
page_size: 10, // 长度 |
|
|
|
}; |
|
|
@ -188,8 +188,8 @@ function ComplainManage(props) { |
|
|
|
const [recordData, setRecordData] = useState(defRecordData); |
|
|
|
// 停车记录-结果 |
|
|
|
const [tableData, setTableData] = useState({ |
|
|
|
data: [], |
|
|
|
total_records: 0, |
|
|
|
total: 0, |
|
|
|
list: [], |
|
|
|
}); |
|
|
|
// 停车记录-选中数据 |
|
|
|
const [checkIds, setCheckIds] = useState([]); |
|
|
@ -204,30 +204,27 @@ function ComplainManage(props) { |
|
|
|
// 问题分类2 |
|
|
|
const [problemArr2, setProblemArr2] = useState([]); |
|
|
|
|
|
|
|
// 一级分类 |
|
|
|
const [sortArr1, setSortArr1] = useState([]); |
|
|
|
|
|
|
|
// 设置弹窗 |
|
|
|
const [visible6, setVisible6] = useState(false); |
|
|
|
// 设置弹窗-分类 |
|
|
|
const defSortData = { |
|
|
|
tab: "1", // 分类表格 1-一级,2-二级 |
|
|
|
sort1: "", // 一级分类 |
|
|
|
sort2: "", // 二级分类 |
|
|
|
sort1: undefined, // 一级分类 |
|
|
|
sort2: undefined, // 二级分类 |
|
|
|
pn: 1, // 页码 |
|
|
|
page_size: 10, // 长度 |
|
|
|
}; |
|
|
|
const [sortData, setSortData] = useState(defSortData); |
|
|
|
// 设置弹窗-分类 |
|
|
|
const [sortTableData, setSortTableData] = useState({ |
|
|
|
data: [], |
|
|
|
total_records: 0, |
|
|
|
total: 0, |
|
|
|
list: [], |
|
|
|
}); |
|
|
|
|
|
|
|
// 添加/编辑、查看一/二级分类 |
|
|
|
const [visible7, setVisible7] = useState(false); |
|
|
|
// 是否添加 |
|
|
|
const [isAdd, setIsAdd] = useState(false); |
|
|
|
// 是否编辑 |
|
|
|
const [isEdit, setIsEdit] = useState(false); |
|
|
|
// 添加/编辑、查看数据 |
|
|
|
const [rowData, setRowData] = useState({}); |
|
|
|
|
|
|
@ -386,6 +383,7 @@ function ComplainManage(props) { |
|
|
|
useEffect(() => { |
|
|
|
if (isDeal) { |
|
|
|
getProblemSelect1(); |
|
|
|
setProblemArr2([]); |
|
|
|
setDealData({}); |
|
|
|
} |
|
|
|
}, [isDeal]); |
|
|
@ -426,8 +424,8 @@ function ComplainManage(props) { |
|
|
|
size: "small", |
|
|
|
showQuickJumper: true, |
|
|
|
showSizeChanger: true, |
|
|
|
showTotal: () => `共 ${tableData.total_records || 0} 条`, |
|
|
|
total: tableData?.total_records, |
|
|
|
showTotal: () => `共 ${tableData.total || 0} 条`, |
|
|
|
total: tableData?.total, |
|
|
|
current: recordData.pn, |
|
|
|
pageSize: recordData.page_size, |
|
|
|
// pageSizeOptions: Array.from( |
|
|
@ -448,8 +446,8 @@ function ComplainManage(props) { |
|
|
|
size: "small", |
|
|
|
showQuickJumper: true, |
|
|
|
showSizeChanger: true, |
|
|
|
showTotal: () => `共 ${sortTableData.total_records || 0} 条`, |
|
|
|
total: sortTableData?.total_records, |
|
|
|
showTotal: () => `共 ${sortTableData.total || 0} 条`, |
|
|
|
total: sortTableData?.total, |
|
|
|
current: sortData.pn, |
|
|
|
pageSize: sortData.page_size, |
|
|
|
// pageSizeOptions: Array.from( |
|
|
@ -477,10 +475,10 @@ function ComplainManage(props) { |
|
|
|
// 表格填充 |
|
|
|
const handleFillTable = () => { |
|
|
|
const arr = [...checkIds]; |
|
|
|
const list = [...(tableData?.data || [])]; |
|
|
|
const list = [...(tableData?.list || [])]; |
|
|
|
// console.log(arr, list); |
|
|
|
if (arr?.length && list?.length) { |
|
|
|
const newList = list.filter((v, i) => arr.includes(v?.id || i)); |
|
|
|
const newList = list.filter((v, i) => arr.includes(v?.id)); |
|
|
|
setParkData(newList); |
|
|
|
setVisible4(false); |
|
|
|
} else { |
|
|
@ -576,12 +574,12 @@ function ComplainManage(props) { |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "一级分类", |
|
|
|
dataIndex: "sort1", |
|
|
|
dataIndex: "sort1_name", |
|
|
|
align: "center", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "二级分类", |
|
|
|
dataIndex: "sort2", |
|
|
|
dataIndex: "sort2_name", |
|
|
|
align: "center", |
|
|
|
}, |
|
|
|
{ |
|
|
@ -605,7 +603,7 @@ function ComplainManage(props) { |
|
|
|
menu={{ |
|
|
|
items: items, |
|
|
|
onClick: (key) => { |
|
|
|
return clickDropDown2(key, row, index); |
|
|
|
return clickDropDown2(key, row); |
|
|
|
}, |
|
|
|
}} |
|
|
|
> |
|
|
@ -662,14 +660,26 @@ function ComplainManage(props) { |
|
|
|
setParkData(newArr.filter((v, i) => i != index)); |
|
|
|
} else { |
|
|
|
// 详情 |
|
|
|
getRecordDetail(record); |
|
|
|
setRecordDetail(record || {}); |
|
|
|
setVisible5(true); |
|
|
|
} |
|
|
|
}; |
|
|
|
// 操作 |
|
|
|
const clickDropDown2 = (param, record) => { |
|
|
|
// console.log(param.key, record); |
|
|
|
setRowData(record); |
|
|
|
setIsAdd(false); |
|
|
|
const { sort1, sort1_name, sort2, sort2_name, remark } = record || {}; |
|
|
|
if (param.key == "2") { |
|
|
|
// 编辑 |
|
|
|
setIsEdit(true); |
|
|
|
} else { |
|
|
|
// 详情 |
|
|
|
setIsEdit(false); |
|
|
|
} |
|
|
|
if (sortData?.tab == "2") { |
|
|
|
setRowData({ sort1, sort1_name, sort2, sort2_name, remark }); |
|
|
|
} else { |
|
|
|
setRowData({ sort1, sort1_name, remark }); |
|
|
|
} |
|
|
|
setVisible7(true); |
|
|
|
}; |
|
|
|
|
|
|
@ -808,19 +818,25 @@ function ComplainManage(props) { |
|
|
|
|
|
|
|
// 添加分类 |
|
|
|
const handleSaveSort = () => { |
|
|
|
if (sortData?.tab == "1" && !rowData?.sort1) { |
|
|
|
if (sortData?.tab == "1" && !rowData?.sort1_name) { |
|
|
|
message.error("请输入一级分类名称"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (sortData?.tab == "2" && !rowData?.sort1) { |
|
|
|
message.error("请选择关联一级分类"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (sortData?.tab == "2" && !rowData?.sort2) { |
|
|
|
message.error("请输入二级分类名称"); |
|
|
|
return; |
|
|
|
if (sortData?.tab == "2") { |
|
|
|
if (!rowData?.sort1) { |
|
|
|
message.error("请选择关联一级分类"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!rowData?.sort2_name) { |
|
|
|
message.error("请输入二级分类名称"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
ajax.getComplainList(rowData).then( |
|
|
|
const postStr = |
|
|
|
sortData?.tab == "2" |
|
|
|
? "getComplainClassifyUpdateTwo" |
|
|
|
: "getComplainClassifyUpdateOne"; |
|
|
|
ajax[postStr](rowData).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
message.success(res?.message); |
|
|
@ -841,7 +857,7 @@ function ComplainManage(props) { |
|
|
|
|
|
|
|
// 获取问题分类1下拉 |
|
|
|
const getProblemSelect1 = () => { |
|
|
|
ajax.getComplainList().then( |
|
|
|
ajax.getComplainOneClassify().then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
if (Array.isArray(res?.data)) { |
|
|
@ -863,7 +879,7 @@ function ComplainManage(props) { |
|
|
|
// 获取问题分类2下拉 |
|
|
|
const getProblemSelect2 = (id) => { |
|
|
|
if (id) { |
|
|
|
ajax.getComplainList({ id }).then( |
|
|
|
ajax.getComplainTwoClassify({ id }).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
if (Array.isArray(res?.data)) { |
|
|
@ -885,30 +901,9 @@ function ComplainManage(props) { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 获取所有一级分类下拉 |
|
|
|
const getSortSelect1 = () => { |
|
|
|
ajax.getComplainList().then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
if (Array.isArray(res?.data)) { |
|
|
|
setSortArr1(res?.data); |
|
|
|
} else { |
|
|
|
setSortArr1([]); |
|
|
|
} |
|
|
|
} else { |
|
|
|
message.error(res?.message); |
|
|
|
} |
|
|
|
}, |
|
|
|
(err) => { |
|
|
|
console.log(err); |
|
|
|
message.error("服务器异常"); |
|
|
|
} |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
// 获取计算规则下拉 |
|
|
|
const getRuleSelect = () => { |
|
|
|
ajax.getComplainList().then( |
|
|
|
ajax.getComplainChargeRule().then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
if (Array.isArray(res?.data)) { |
|
|
@ -930,7 +925,7 @@ function ComplainManage(props) { |
|
|
|
// 获取计算模型详情 |
|
|
|
const getRuleData = (val) => { |
|
|
|
if (val) { |
|
|
|
ajax.getComplainList({ rule: val }).then( |
|
|
|
ajax.getComplainChargeModel({ rule: val }).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
setModelData(res?.data || {}); |
|
|
@ -958,7 +953,7 @@ function ComplainManage(props) { |
|
|
|
message.error("请选择出入场时间"); |
|
|
|
return; |
|
|
|
} |
|
|
|
ajax.getComplainList(editData).then( |
|
|
|
ajax.getComplainChargeResult(editData).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
setAmount(res?.data || 0); |
|
|
@ -976,32 +971,10 @@ function ComplainManage(props) { |
|
|
|
// 获取停车记录 |
|
|
|
const getRecordData = (obj) => { |
|
|
|
setCheckIds([]); |
|
|
|
ajax.getComplainList(obj).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
// setTableData(res?.data || {}); |
|
|
|
setTableData({ |
|
|
|
data: res?.data?.list, |
|
|
|
total_records: 50, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
message.error(res?.message); |
|
|
|
} |
|
|
|
}, |
|
|
|
(err) => { |
|
|
|
console.log(err); |
|
|
|
message.error("服务器异常"); |
|
|
|
} |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
// 获取停车记录详情 |
|
|
|
const getRecordDetail = (obj) => { |
|
|
|
ajax.getComplainList({ id: obj?.id }).then( |
|
|
|
ajax.getComplainParkList(obj).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
setRecordDetail(res?.data || {}); |
|
|
|
setVisible5(true); |
|
|
|
setTableData(res?.data || {}); |
|
|
|
} else { |
|
|
|
message.error(res?.message); |
|
|
|
} |
|
|
@ -1015,14 +988,10 @@ function ComplainManage(props) { |
|
|
|
|
|
|
|
// 获取分类数据 |
|
|
|
const getSortData = (obj) => { |
|
|
|
ajax.getComplainList(obj).then( |
|
|
|
ajax.getComplainClassifyList(obj).then( |
|
|
|
(res) => { |
|
|
|
if (parseInt(res?.status) === 20000) { |
|
|
|
// setTableData(res?.data || {}); |
|
|
|
setSortTableData({ |
|
|
|
data: res?.data?.list, |
|
|
|
total_records: 50, |
|
|
|
}); |
|
|
|
setSortTableData(res?.data || {}); |
|
|
|
} else { |
|
|
|
message.error(res?.message); |
|
|
|
} |
|
|
@ -1275,7 +1244,7 @@ function ComplainManage(props) { |
|
|
|
allowClear |
|
|
|
placeholder="请选择" |
|
|
|
value={sortData?.sort1 || undefined} |
|
|
|
options={sortArr1} |
|
|
|
options={problemArr1} |
|
|
|
onChange={(e) => setSortData({ ...sortData, sort1: e })} |
|
|
|
/> |
|
|
|
</div> |
|
|
@ -1327,7 +1296,7 @@ function ComplainManage(props) { |
|
|
|
type="primary" |
|
|
|
onClick={() => { |
|
|
|
setRowData({}); |
|
|
|
setIsAdd(true); |
|
|
|
setIsEdit(true); |
|
|
|
setVisible7(true); |
|
|
|
}} |
|
|
|
> |
|
|
@ -1345,7 +1314,7 @@ function ComplainManage(props) { |
|
|
|
<div className="result-table"> |
|
|
|
<Table |
|
|
|
rowKey={(row, index) => row?.id || index} |
|
|
|
dataSource={sortTableData?.data || []} |
|
|
|
dataSource={sortTableData?.list || []} |
|
|
|
columns={ |
|
|
|
sortData?.tab == "1" |
|
|
|
? columns3.filter((v, i) => i != 2) |
|
|
@ -1733,7 +1702,7 @@ function ComplainManage(props) { |
|
|
|
rowKey={(row, index) => row?.id || index} |
|
|
|
dataSource={parkData || []} |
|
|
|
columns={isDeal ? getNewColumns() : columns1} |
|
|
|
scroll={{ y: "260px" }} |
|
|
|
scroll={{ y: "265px" }} |
|
|
|
pagination={false} |
|
|
|
/> |
|
|
|
</Panel> |
|
|
@ -1797,6 +1766,7 @@ function ComplainManage(props) { |
|
|
|
placeholder="请选择" |
|
|
|
value={dealData?.wtej_sort || undefined} |
|
|
|
options={problemArr2} |
|
|
|
disabled={!problemArr2?.length} |
|
|
|
onChange={(e) => |
|
|
|
setDealData({ ...dealData, wtej_sort: e }) |
|
|
|
} |
|
|
@ -2009,7 +1979,7 @@ function ComplainManage(props) { |
|
|
|
? v.section.map((k, j) => { |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
区间{j + 1}:<span>计算方式:{k || "-"}</span> |
|
|
|
区间{j + 1}:<span>计费方式:{k || "-"}</span> |
|
|
|
</div> |
|
|
|
); |
|
|
|
}) |
|
|
@ -2125,7 +2095,7 @@ function ComplainManage(props) { |
|
|
|
<div className="result-table"> |
|
|
|
<Table |
|
|
|
rowKey={(row, index) => row?.id || index} |
|
|
|
dataSource={tableData?.data || []} |
|
|
|
dataSource={tableData?.list || []} |
|
|
|
columns={columns1} |
|
|
|
rowSelection={rowSelection} |
|
|
|
scroll={{ y: "550px" }} |
|
|
@ -2236,7 +2206,7 @@ function ComplainManage(props) { |
|
|
|
const obj = { ...defSortData, tab: e, pn: 1 }; |
|
|
|
setSortData(obj); |
|
|
|
getSortData(obj); |
|
|
|
e == "2" ? getSortSelect1() : null; |
|
|
|
e == "2" ? getProblemSelect1() : null; |
|
|
|
}} |
|
|
|
> |
|
|
|
<Tabs.TabPane tab="一级分类" key="1"> |
|
|
@ -2252,7 +2222,7 @@ function ComplainManage(props) { |
|
|
|
className="complain-manage-detail" |
|
|
|
visible={visible7} |
|
|
|
title={ |
|
|
|
(isAdd ? "添加" : "查看") + |
|
|
|
(isEdit ? "添加" : "查看") + |
|
|
|
(sortData?.tab == "2" ? "二" : "一") + |
|
|
|
"级分类" |
|
|
|
} |
|
|
@ -2265,75 +2235,85 @@ function ComplainManage(props) { |
|
|
|
{sortData?.tab == "2" ? ( |
|
|
|
<> |
|
|
|
<div className="form-box"> |
|
|
|
<label className="required">关联一级分类</label> |
|
|
|
{isAdd ? ( |
|
|
|
<label className={isEdit ? "required" : "normal"}> |
|
|
|
关联一级分类 |
|
|
|
</label> |
|
|
|
{isEdit ? ( |
|
|
|
<Select |
|
|
|
className="form-con" |
|
|
|
allowClear |
|
|
|
placeholder="请选择" |
|
|
|
value={rowData?.sort1 || undefined} |
|
|
|
options={sortArr1} |
|
|
|
options={problemArr1} |
|
|
|
onChange={(e) => setRowData({ ...rowData, sort1: e })} |
|
|
|
/> |
|
|
|
) : ( |
|
|
|
<span>{rowData?.sort1 || "-"}</span> |
|
|
|
<span>{rowData?.sort1_name || "-"}</span> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
<div className="form-box"> |
|
|
|
<label className="required">二级分类名称</label> |
|
|
|
{isAdd ? ( |
|
|
|
<label className={isEdit ? "required" : "normal"}> |
|
|
|
二级分类名称 |
|
|
|
</label> |
|
|
|
{isEdit ? ( |
|
|
|
<Input |
|
|
|
className="form-con" |
|
|
|
placeholder="请输入" |
|
|
|
value={rowData?.sort2 || undefined} |
|
|
|
value={rowData?.sort2_name || undefined} |
|
|
|
onChange={(e) => |
|
|
|
setRowData({ |
|
|
|
...rowData, |
|
|
|
sort2: e.target.value, |
|
|
|
sort2_name: e.target.value, |
|
|
|
}) |
|
|
|
} |
|
|
|
/> |
|
|
|
) : ( |
|
|
|
<span>{rowData?.sort2 || "-"}</span> |
|
|
|
<span>{rowData?.sort2_name || "-"}</span> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</> |
|
|
|
) : ( |
|
|
|
<div className="form-box"> |
|
|
|
<label className="required">一级分类名称</label> |
|
|
|
{isAdd ? ( |
|
|
|
<label className={isEdit ? "required" : "normal"}> |
|
|
|
一级分类名称 |
|
|
|
</label> |
|
|
|
{isEdit ? ( |
|
|
|
<Input |
|
|
|
className="form-con" |
|
|
|
placeholder="请输入" |
|
|
|
value={rowData?.sort1 || undefined} |
|
|
|
value={rowData?.sort1_name || undefined} |
|
|
|
onChange={(e) => |
|
|
|
setRowData({ |
|
|
|
...rowData, |
|
|
|
sort1: e.target.value, |
|
|
|
sort1_name: e.target.value, |
|
|
|
}) |
|
|
|
} |
|
|
|
/> |
|
|
|
) : ( |
|
|
|
<span>{rowData?.sort1 || "-"}</span> |
|
|
|
<span>{rowData?.sort1_name || "-"}</span> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
)} |
|
|
|
<div className="form-box"> |
|
|
|
<label>备注</label> |
|
|
|
<Input.TextArea |
|
|
|
className="form-con" |
|
|
|
placeholder="请输入" |
|
|
|
value={rowData?.remark || undefined} |
|
|
|
onChange={(e) => |
|
|
|
setRowData({ |
|
|
|
...rowData, |
|
|
|
remark: e.target.value, |
|
|
|
}) |
|
|
|
} |
|
|
|
/> |
|
|
|
{isEdit ? ( |
|
|
|
<Input.TextArea |
|
|
|
className="form-con" |
|
|
|
placeholder="请输入" |
|
|
|
value={rowData?.remark || undefined} |
|
|
|
onChange={(e) => |
|
|
|
setRowData({ |
|
|
|
...rowData, |
|
|
|
remark: e.target.value, |
|
|
|
}) |
|
|
|
} |
|
|
|
/> |
|
|
|
) : ( |
|
|
|
<span>{rowData?.remark || "-"}</span> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
<div className="submitBtn"> |
|
|
|
{isAdd ? ( |
|
|
|
{isEdit ? ( |
|
|
|
<> |
|
|
|
<Button type="primary" onClick={handleSaveSort}> |
|
|
|
保存 |
|
|
|