|
@@ -134,6 +134,22 @@ $(function () {
|
|
|
});
|
|
|
|
|
|
$('#add_cert_btn').click(function () {
|
|
|
+ // 判断是否有重复项cert_id的,否则不允许提交
|
|
|
+ const certIdList = [];
|
|
|
+ let isRepeat = false;
|
|
|
+ $('#select-certs-table tr[data-remove="0"]').each(function () {
|
|
|
+ const certId = parseInt($(this).attr('data-certid'));
|
|
|
+ if (certIdList.indexOf(certId) === -1) {
|
|
|
+ certIdList.push(certId);
|
|
|
+ } else {
|
|
|
+ isRepeat = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (isRepeat) {
|
|
|
+ toastr.error('用户不能添加重复的证书');
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 判断增删改
|
|
|
const insertList = [];
|
|
|
if ($('#select-certs-table tr[data-insert="1"][data-remove="0"]').length > 0) {
|