|
|
@@ -116,6 +116,7 @@ $(function () {
|
|
|
if (res.code == 0) {
|
|
|
$("#priceModal").modal("hide");
|
|
|
clearPriceInput();
|
|
|
+ $('#tb_table').bootstrapTable("refresh");
|
|
|
successMesage(res);
|
|
|
} else {
|
|
|
errorMesage(res);
|
|
|
@@ -145,6 +146,7 @@ $(function () {
|
|
|
if (res.code == 0) {
|
|
|
$("#delayToEnableOrStopModal").modal("hide");
|
|
|
clearDelayToEnableOrStopInput();
|
|
|
+ $('#tb_table').bootstrapTable("refresh");
|
|
|
successMesage(res);
|
|
|
} else {
|
|
|
errorMesage(res);
|
|
|
@@ -201,12 +203,21 @@ function initZdChargeItemList() {
|
|
|
formatter: function (value, row, index) {
|
|
|
var str = '<button type="button" class="btn btn-primary btn-sm" onclick="updateZdChargeItem(\'' + row.code + '\')">编辑</button>';
|
|
|
str += '<button type="button" class="btn btn-primary btn-sm" onclick="updateZdChargeItemPrice(\'' + row.code + '\')">延时调价</button>';
|
|
|
+ if(row.effectiveTime!=null){
|
|
|
+ str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',1)">取消延时调价</button>';
|
|
|
+ }
|
|
|
if (row.delFlag == 0) {
|
|
|
str += '<button type="button" class="btn btn-warning btn-sm" onclick="updateZdChargeItemDelFlag(\'' + row.code + '\',\'' + row.name + '\',1)">停用</button>';
|
|
|
str += '<button type="button" class="btn btn-warning btn-sm" onclick="delayStopOrToEnable(\'' + row.code + '\',1)">延时停用</button>';
|
|
|
+ if(row.effectiveDate!=null){
|
|
|
+ str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',3)">取消延时停用</button>';
|
|
|
+ }
|
|
|
} else if (row.delFlag == 1) {
|
|
|
str += '<button type="button" class="btn btn-success btn-sm" onclick="updateZdChargeItemDelFlag(\'' + row.code + '\',\'' + row.name + '\',0)">启用</button>';
|
|
|
str += '<button type="button" class="btn btn-success btn-sm" onclick="delayStopOrToEnable(\'' + row.code + '\',0)">延时启用</button>';
|
|
|
+ if(row.effectiveDate!=null){
|
|
|
+ str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',2)">取消延时启用</button>';
|
|
|
+ }
|
|
|
}
|
|
|
return [str].join('');
|
|
|
}
|
|
|
@@ -488,6 +499,43 @@ function queryParams(params) {
|
|
|
return temp;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 取消延迟改价/取消延时启用或停用
|
|
|
+ * @param code 项目编码
|
|
|
+ * @param name 项目名称
|
|
|
+ * @param type 类型 1 取消延时调价 2 取消延时启用 3 取消延时停用
|
|
|
+ */
|
|
|
+function cancelEffective(code,name,type) {
|
|
|
+ if (type == 1 && !confirm("确认要取消项目【"+name+"】的延时改价吗?")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (type == 2 && !confirm("确认要取消项目【"+name+"】的延时启用吗?")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (type == 3 && !confirm("确认要取消项目【"+name+"】的延时停用吗?")) {
|
|
|
+ type=2;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/cancelEffective?code='+code+'&type='+type,
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ async: false,
|
|
|
+ success: function (data) {
|
|
|
+ if (data == '401' || data == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(data.code==0){
|
|
|
+ successMesage(data);
|
|
|
+ $('#tb_table').bootstrapTable("refresh");
|
|
|
+ }else {
|
|
|
+ errorMesage(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 初始化下拉选
|