fix:修复交互弹窗样式

This commit is contained in:
zhangds 2023-06-15 17:23:12 +08:00
parent f4e341f6f6
commit a25e842c03
5 changed files with 260 additions and 171 deletions

View File

@ -310,27 +310,8 @@ const UseCouponList = () => {
history.push("/home/coupon-add-edit");
};
//
const delFn = (e, row) => {
console.log("row =>", row);
if (row.status == 6) {
Notify.error("审核中的数据不允许作废");
return;
}
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定作废{row.title}</p>,
onConfirm() {
let param = {
type: 3,
object_value: row.id,
};
try {
commonSearchOrder(param).then((res) => {
if (res === 1 || res === 2) {
delCoupon(row.id)
const delCouponFun = (id) => {
delCoupon(id)
.then((res) => {
handelResponse(
res,
@ -345,16 +326,41 @@ const UseCouponList = () => {
);
})
.catch((err) => {});
};
//
const delFn = (e, row) => {
console.log("row =>", row);
if (row.status == 6) {
Notify.error("审核中的数据不允许作废");
return;
}
});
} catch (err) {
console.log("pages/coupon/list/index.jsx =>", err);
}
let param = {
type: 3,
object_value: row.id,
};
try {
commonSearchOrder(param).then((res) => {
if (res === 2) {
delCouponFun(row.id);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定作废{row.title}</p>,
onConfirm() {
delCouponFun(row.id);
},
onCancel() {},
className: "questModal",
parentComponent: this,
});
}
});
} catch (err) {
console.log("pages/coupon/list/index.jsx =>", err);
}
};
//

View File

@ -218,27 +218,10 @@ export default class acclist extends React.Component {
});
}
//作废
delFn(e, row) {
if (row.status == 6) {
Notify.error("审核中的数据不允许作废");
return;
}
// 作废接口
delCodeFun(id) {
let self = this;
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定作废{row.title}</p>,
onConfirm() {
let param = {
type: 2,
object_value: row.id,
};
try {
commonSearchOrder(param).then((res) => {
if (res === 1 || res === 2) {
delCode(row.id)
delCode(id)
.then((res) => {
handelResponse(
res,
@ -254,16 +237,41 @@ export default class acclist extends React.Component {
})
.catch((err) => {});
}
});
} catch (err) {
console.log("exchangecode/list =>", err);
//作废
delFn(e, row) {
if (row.status == 6) {
Notify.error("审核中的数据不允许作废");
return;
}
let self = this;
let param = {
type: 2,
object_value: row.id,
};
try {
commonSearchOrder(param).then((res) => {
if (res === 2) {
self.delCodeFun(row.id);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定作废{row.title}</p>,
onConfirm() {
self.delCodeFun(row.id);
},
onCancel() {},
className: "questModal",
parentComponent: this,
});
}
});
} catch (err) {
console.log("exchangecode/list =>", err);
}
}
//点击启用/禁用
changestatus(status, row) {

View File

@ -16,6 +16,7 @@ import {
MenuItem,
DropdownContent,
Menu,
Sweetalert,
} from "zent";
import Ipt from "@/components/input/main";
import Grid from "@/components/gird/main.js";
@ -242,12 +243,34 @@ export default class acclist extends React.Component {
};
this.getKeyCodeList(params);
}
keyCancelFun(rowData) {
let formdata = {
key: rowData.key,
};
keyCancel(formdata).then((res) => {
handelResponse(
res,
(req, msg) => {
let data = {
page: 1,
limit: 10,
};
this.setState({ page: 1, limit: 10 });
this.getKeyCodeList(data);
Notify.success("作废成功");
},
(err) => {
Notify.error(err);
}
);
});
}
menuItemClick(e, key, rowData) {
let self = this;
if (key == 1) {
let formdata = {
key: rowData.key,
};
keyUsage(formdata).then((res) => {
handelResponse(
res,
@ -273,26 +296,24 @@ export default class acclist extends React.Component {
};
try {
commonSearchOrder(param).then((res) => {
if (res === 1 || res === 2) {
let formdata = {
key: rowData.key,
};
keyCancel(formdata).then((res) => {
handelResponse(
res,
(req, msg) => {
let data = {
page: 1,
limit: 10,
};
this.setState({ page: 1, limit: 10 });
this.getKeyCodeList(data);
Notify.success("作废成功");
if (res === 2) {
self.keyCancelFun(rowData);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: (
<p>
是否作废key批次ID<b>[{rowData.key}]</b>
</p>
),
onConfirm: () => {
self.keyCancelFun(rowData);
},
(err) => {
Notify.error(err);
}
);
onCancel: this.onCancel,
className: "questModal",
parentComponent: this,
});
}
});

View File

@ -640,6 +640,16 @@ export default class acclist extends React.Component {
return;
}
// 查询作废
let param = {
type: 1,
object_value: row.id,
};
try {
commonSearchOrder(param).then((res) => {
if (res === 2) {
self.cancelKeyFn(row);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
@ -650,26 +660,18 @@ export default class acclist extends React.Component {
</p>
),
onConfirm: () => {
// 查询作废
let param = {
type: 1,
object_value: row.id,
};
try {
commonSearchOrder(param).then((res) => {
if (res === 1 || res === 2) {
self.cancelKeyFn(row);
}
});
} catch (err) {
console.log("pages/plan/key/list.js =>", err);
}
},
onCancel: this.onCancel,
className: "questModal",
parentComponent: this,
});
}
});
} catch (err) {
console.log("pages/plan/key/list.js =>", err);
}
}
}
//limit
countChange(e) {

View File

@ -18,6 +18,7 @@ import {
MenuItem,
DropdownContent,
Menu,
Sweetalert,
} from "zent";
import {
keyCancel,
@ -263,18 +264,7 @@ const UseKeyList = () => {
setState({ selectTable: [] });
};
/**
* 作废
*/
const multipleCancel = () => {
let keys = map(state.selectTable, (item) => {
return item.key;
});
let param = { keys: keys };
try {
commonSearchOrder(param, 2).then((res) => {
if (res === 1 || res === 2) {
const keyBatchCancelFun = (keys) => {
let formdata = {
keys: keys,
};
@ -294,6 +284,34 @@ const UseKeyList = () => {
}
);
});
};
/**
* 作废
*/
const multipleCancel = () => {
let keys = map(state.selectTable, (item) => {
return item.key;
});
let param = { keys: keys };
try {
commonSearchOrder(param, 2).then((res) => {
if (res === 2) {
keyBatchCancelFun(keys);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定批量作废</p>,
onConfirm() {
keyBatchCancelFun(keys);
},
onCancel() {},
className: "questModal",
parentComponent: this,
});
}
});
} catch (err) {
@ -429,6 +447,24 @@ const UseKeyList = () => {
});
};
const keyCancelFun = (rowData) => {
let formdata = {
key: rowData.key,
};
keyCancel(formdata).then((res) => {
handelResponse(
res,
(req, msg) => {
setState({ page: 1, limit: 10, isQuery: !state.isQuery });
Notify.success("作废成功");
},
(err) => {
Notify.error(err);
}
);
});
};
const menuItemClick = (e, key, rowData) => {
if (Number(key) === 1) {
let formdata = {
@ -455,21 +491,20 @@ const UseKeyList = () => {
};
try {
commonSearchOrder(param).then((res) => {
if (res === 1 || res === 2) {
let formdata = {
key: rowData.key,
};
keyCancel(formdata).then((res) => {
handelResponse(
res,
(req, msg) => {
setState({ page: 1, limit: 10, isQuery: !state.isQuery });
Notify.success("作废成功");
if (res === 2) {
keyCancelFun(rowData);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定作废{rowData.title}</p>,
onConfirm() {
keyCancelFun(rowData);
},
(err) => {
Notify.error(err);
}
);
onCancel() {},
className: "questModal",
parentComponent: this,
});
}
});
@ -525,6 +560,27 @@ const UseKeyList = () => {
setState({ bachVisible: false });
};
const batchUploadVoidFun = (hash) => {
batchUploadVoid({ hash: hash }).then((res) => {
handelResponse(
res,
(req, msg) => {
Notify.success("批量上传标记为作废");
key_query_el.current.clearData(); //
setState({
page: 1,
limit: 10,
hash: hash,
isQuery: !state.isQuery,
});
},
(err) => {
Notify.error(err);
}
);
});
};
const bachImportBtn = (data) => {
//
if (state.bachApiType === 1) {
@ -535,24 +591,20 @@ const UseKeyList = () => {
//
if (state.bachApiType === 2) {
commonSearchOrder({ hash: data }, 1).then((res) => {
if (res === 1 || res === 2) {
batchUploadVoid({ hash: data }).then((res) => {
handelResponse(
res,
(req, msg) => {
Notify.success("批量上传标记为作废");
key_query_el.current.clearData(); //
setState({
page: 1,
limit: 10,
hash: data,
isQuery: !state.isQuery,
});
if (res === 2) {
batchUploadVoidFun(data);
} else if (res === 1) {
Sweetalert.confirm({
type: "warning",
closeBtn: true,
title: "确认操作",
content: <p>确定要批量作废</p>,
onConfirm() {
batchUploadVoidFun(data);
},
(err) => {
Notify.error(err);
}
);
onCancel() {},
className: "questModal",
parentComponent: this,
});
}
});