Browse Source

商户管理系统bug修改

tags/PMS_Frontend_v1.0.6-develop
heyx 2 years ago
parent
commit
88155a1828
  1. 80
      src/pages/MerchantMgm/InvoiceConf/loadable.jsx
  2. 3
      src/pages/MerchantMgm/MerchantAdmin/index.scss
  3. 31
      src/pages/MerchantMgm/MerchantAdmin/loadable.jsx
  4. 8
      src/pages/MerchantMgm/MerchantInfo/loadable.jsx

80
src/pages/MerchantMgm/InvoiceConf/loadable.jsx

@ -19,7 +19,7 @@ function InvoiceConf() {
const parameter = {
info_id: '',//ID
tenantName: '',
receipt_type: 0,//
receipt_type: '',//
receipt_type_name: '',
invoice_item: '',//
sell_name: '',
@ -27,8 +27,8 @@ function InvoiceConf() {
drawer_name: '',
updatePerson: '',
updateAt: '',
type: 1,
status: 0,
type: "",
status: "",
status_name: '',
start: moment().subtract(90, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
end: moment().format('YYYY-MM-DD HH:mm:ss'),
@ -87,7 +87,8 @@ function InvoiceConf() {
const [createVisible, setCreateVisible] = useState(false)
//
const [checkVisible, setCheckVisible] = useState(false)
//
const [isFirst,setIsFirst]=useState(true)
//
const tenantOption = [
{
@ -277,22 +278,44 @@ function InvoiceConf() {
var end=formData.end
}
setLoading(true)
ajax.getInvoiceTable({ ...value, start, end }).then(
res => {
if (res.status == 20000) {
setTableData(res.data.list)
setTotal(res.data.total_records)
if(isFirst){//
ajax.getInvoiceTable({ start, end }).then(
res => {
if (res.status == 20000) {
setTableData(res.data.list)
setTotal(res.data.total_records)
setLoading(false)
setIsFirst(false)
} else {
message.error(res.message)
}
setLoading(false)
} else {
message.error(res.message)
}
setLoading(false)
}
).catch(
(err) => {
console.log(err)
}
)
).catch(
(err) => {
console.log(err)
}
)
}else{
ajax.getInvoiceTable({...value, start, end }).then(
res => {
if (res.status == 20000) {
setTableData(res.data.list)
setTotal(res.data.total_records)
setLoading(false)
} else {
message.error(res.message)
}
setLoading(false)
}
).catch(
(err) => {
console.log(err)
}
)
}
}
//
const getTenantNamePull = () => {
@ -419,7 +442,7 @@ function InvoiceConf() {
///
function stopBtn(record) {
ajax.updateInvoiceStatus(record.id).then(
ajax.updateInvoiceStatus({id:record.id}).then(
res => {
if (res.status == 20000) {
getTable()
@ -739,6 +762,7 @@ function InvoiceConf() {
className="form-item"
value={formData.code}
maxLength={30}
showCount={true}
onChange={e => {
setFormData({ code: e.target.value })
}}
@ -751,6 +775,7 @@ function InvoiceConf() {
className="form-item"
value={formData.auth_code}
maxLength={36}
showCount={true}
onChange={e => {
setFormData({ auth_code: e.target.value })
}}
@ -763,6 +788,7 @@ function InvoiceConf() {
className="form-item"
value={formData.request_url}
maxLength={200}
showCount={true}
onChange={e => {
setFormData({ request_url: e.target.value })
}}
@ -776,6 +802,7 @@ function InvoiceConf() {
value={formData.request_code}
showClose={true}
maxLength={36}
showCount={true}
onChange={e => {
setFormData({ request_code: e.target.value })
}}
@ -789,6 +816,7 @@ function InvoiceConf() {
value={formData.request_func}
showClose={true}
maxLength={40}
showCount={true}
onChange={e => {
setFormData({ request_func: e.target.value })
}}
@ -802,6 +830,7 @@ function InvoiceConf() {
value={formData.namespace}
showClose={true}
maxLength={200}
showCount={true}
onChange={e => {
setFormData({ namespace: e.target.value })
}}
@ -818,6 +847,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.tax_name}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ tax_name: e.target.value })
}}
@ -829,6 +859,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.tax_num}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ tax_num: e.target.value })
}}
@ -840,6 +871,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.sell_name}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ sell_name: e.target.value })
}}
@ -851,6 +883,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.sell_num}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ sell_num: e.target.value })
}}
@ -862,6 +895,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.sell_address}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ sell_address: e.target.value })
}}
@ -873,6 +907,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.sell_phone}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ sell_phone: e.target.value })
}}
@ -884,6 +919,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.sell_bank_name}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ sell_bank_name: e.target.value })
}}
@ -895,6 +931,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.sell_bank_num}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ sell_bank_num: e.target.value })
}}
@ -906,6 +943,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.pay_name}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ pay_name: e.target.value })
}}
@ -917,6 +955,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.check_name}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ check_name: e.target.value })
}}
@ -928,6 +967,7 @@ function InvoiceConf() {
isRequired={true}
value={formData.drawer_name}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ drawer_name: e.target.value })
}}
@ -938,6 +978,7 @@ function InvoiceConf() {
placeholder="请输入最小开票金额(0.01~1000)"
value={formData.mini_amount}
showClose={true}
showCount={true}
onChange={e => {
setFormData({ mini_amount: e.target.value })
}}
@ -947,6 +988,7 @@ function InvoiceConf() {
labelPosition="left"
placeholder="请输入最大开票金额(0.01~1000)"
value={formData.max_amount}
showCount={true}
onChange={e => {
setFormData({ max_amount: e.target.value })
}}

3
src/pages/MerchantMgm/MerchantAdmin/index.scss

@ -164,6 +164,9 @@ $color-primary : var(--color-primary);
height: 20px;
border-radius: 50%;
border: 1px solid #67C23A;
}
.table-status-err {

31
src/pages/MerchantMgm/MerchantAdmin/loadable.jsx

@ -19,7 +19,7 @@ function MerchantAdmin() {
manage_type: '',//
manage_type_name: "",//
account: "",//
username: "",//
name: "",//
phone: "",//
email: "",//
sex: "",//
@ -147,7 +147,7 @@ function MerchantAdmin() {
<Popover content={
<div className="operateBtn" style={{ cursor: "pointer" }} trigger="hover">
<div onClick={() => { checkBtn(record.id) }}>详情</div>
<div onClick={() => { resetPassWordBtn(record.id) }}>重置密码</div>
<div onClick={() => { resetPassWordBtn(record) }}>重置密码</div>
{
record.user_status == 2 ?
<>
@ -195,11 +195,10 @@ function MerchantAdmin() {
}
//
const getTable = () => {
const value =searchForm.getFieldsValue(["operatorid","phone","name","account","status"])
console.log(value);
const getTable = (data) => {
setLoading(true)
ajax.getMerchantAdminTable(value).then(
ajax.getMerchantAdminTable(data).then(
res => {
if (res.status == 20000) {
if (banBtn) {
@ -253,9 +252,14 @@ function MerchantAdmin() {
//
const changePn = (pn, length) => {
console.log(pn,length);
if (lastFormData.page_size === length) {
setLastFormData(Object.assign({}, lastFormData, { pn: pn }))
setLastFormData(Object.assign({...lastFormData, pn: pn }))
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn })
const value =searchForm.getFieldsValue(["operatorid","phone","name","account","status"])
// console.log(value);
setLastFormData({...value})
getTable(Object.assign({}, lastFormData, { pn: pn }))
}
}
@ -374,7 +378,7 @@ function MerchantAdmin() {
}
const handleAdminStatus = () => {
ajax.updateAdminStatus(ID).then(
ajax.updateAdminStatus({id:ID}).then(
res => {
if (res.status == 20000) {
getTable()
@ -389,13 +393,13 @@ function MerchantAdmin() {
)
}
//
const resetPassWordBtn = (index) => {
const resetPassWordBtn = (record) => {
setConfirm(true)
setID(index)
setID(record.id)
}
const handleReset = () => {
ajax.resetPassWord(ID).then(
ajax.resetPassWord({id:ID}).then(
res => {
if (res.status == 20000) {
getTable()
@ -540,6 +544,7 @@ function MerchantAdmin() {
pagination={false}
dataSource={tableData}
loading={loading}
scroll={{y:800}}
></Table>
<Pagination
className="pagination-common"
@ -553,7 +558,7 @@ function MerchantAdmin() {
}
}
total={total}
current={formData.pn}
current={lastFormData.pn}
pageSize={formData.page_size}
pageSizeOptions={pageSizeOptions}
onChange={changePn}
@ -839,7 +844,7 @@ function MerchantAdmin() {
<div className="item"><div className="item-title">登录名</div><span>{records.account}</span></div>
<div className="item"><div className="item-title">姓名</div><span>{records.username}</span></div>
<div className="item"><div className="item-title">邮箱</div><span>{records.email}</span></div>
<div className="item"><div className="item-title">性别</div><span>{records.sex_status}</span></div>
<div className="item"><div className="item-title">性别</div><span>{records.sex_status_name}</span></div>
</div>
</div>
</div>

8
src/pages/MerchantMgm/MerchantInfo/loadable.jsx

@ -411,6 +411,8 @@ function MerchantInfo() {
//
const changePn = (pn, length) => {
console.log("pn",pn);//2
console.log("length",length);
if (lastFormData.page_size === length) {
setLastFormData(Object.assign({}, lastFormData, { pn: pn }))
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn })
@ -510,7 +512,7 @@ function MerchantInfo() {
}
///
function stopBtn(record) {
ajax.updateStatus(record.id).then(
ajax.updateStatus({id:record.id}).then(
res => {
if (res.status == 20000) {
getTable()
@ -764,8 +766,8 @@ function MerchantInfo() {
}
}
total={total}
current={formData.pn}
pageSize={formData.page_size}
current={lastFormData.pn}
pageSize={lastFormData.page_size}
pageSizeOptions={pageSizeOptions}
onChange={changePn}
onShowSizeChange={changeLength}

Loading…
Cancel
Save