@Html.ShortInput("Name", "客户名称")
diff --git a/YLErpWeb/Views/client/_ClientDutyEdit.cshtml b/YLErpWeb/Views/client/_ClientDutyEdit.cshtml
index fec453ac..24a87c24 100644
--- a/YLErpWeb/Views/client/_ClientDutyEdit.cshtml
+++ b/YLErpWeb/Views/client/_ClientDutyEdit.cshtml
@@ -83,6 +83,16 @@
+
diff --git a/YLErpWeb/wwwroot/Scripts/app/client/clientEditV2.js b/YLErpWeb/wwwroot/Scripts/app/client/clientEditV2.js
index 2d6d6f3e..c35b60c9 100644
--- a/YLErpWeb/wwwroot/Scripts/app/client/clientEditV2.js
+++ b/YLErpWeb/wwwroot/Scripts/app/client/clientEditV2.js
@@ -387,7 +387,18 @@ const dutyVue = (function () {
}
}
}
-
+ if (_.trim($("#AuthorizeEffectiveEndDate").val()) == "" && $("#clickLongOrShort_Authorize").text() == "长期") {
+ this.duty.AuthorizeEffectiveEndDateStr = "";
+ this.duty.AuthorizeEffectiveEndDate = "";
+ } else {
+ if (_.trim(this.duty.AuthorizeEffectiveEndDate) || $("#clickLongOrShort_Authorize").text() == "短期") {
+ if ($("#clickLongOrShort_Authorize").text() != "长期") {
+ this.duty.AuthorizeEffectiveEndDateStr = "30001231"
+ } else {
+ this.duty.AuthorizeEffectiveEndDateStr = new Date(this.duty.AuthorizeEffectiveEndDate.substr(0, 10)).Format("yyyyMMMdd");
+ }
+ }
+ }
let self = this, clone = _.cloneDeep(this.duty);
@@ -437,15 +448,27 @@ const dutyVue = (function () {
this.duty.IsReceiveEmail = $("#duty_ContactTypeId :selected:contains(约定收件人)").length + '';
}
},
- clickLongOrShort() {
- if ($("#clickLongOrShort").text() == "长期") {
- $("#IdCardEffectiveDateStr").show();
- $("#IdCardEffectiveDate").hide();
- $("#clickLongOrShort").text("短期");
- } else {
- $("#IdCardEffectiveDateStr").hide();
- $("#IdCardEffectiveDate").show();
- $("#clickLongOrShort").text("长期");
+ clickLongOrShort(id) {
+ if (id == "IdCard") {
+ if ($("#clickLongOrShort_IdCard").text() == "长期") {
+ $("#IdCardEffectiveDateStr").show();
+ $("#IdCardEffectiveDate").hide();
+ $("#clickLongOrShort_IdCard").text("短期");
+ } else {
+ $("#IdCardEffectiveDateStr").hide();
+ $("#IdCardEffectiveDate").show();
+ $("#clickLongOrShort_IdCard").text("长期");
+ }
+ } else if (id == "Authorize") {
+ if ($("#clickLongOrShort_Authorize").text() == "长期") {
+ $("#AuthorizeEffectiveEndDateStr").show();
+ $("#AuthorizeEffectiveEndDate").hide();
+ $("#clickLongOrShort_Authorize").text("短期");
+ } else {
+ $("#AuthorizeEffectiveEndDateStr").hide();
+ $("#AuthorizeEffectiveEndDate").show();
+ $("#clickLongOrShort_Authorize").text("长期");
+ }
}
}
diff --git a/YLErpWeb/wwwroot/Scripts/app/client/clientExpireWarningList.js b/YLErpWeb/wwwroot/Scripts/app/client/clientExpireWarningList.js
new file mode 100644
index 00000000..e69c4246
--- /dev/null
+++ b/YLErpWeb/wwwroot/Scripts/app/client/clientExpireWarningList.js
@@ -0,0 +1,257 @@
+$(function () {
+
+ Updatestatue()
+
+ var PostData = {};
+
+ $(".datepicker").datepicker({
+ changeMonth: true,
+ changeYear: true,
+ showButtonPanel: true,
+ showOtherMonths: true,
+ selectOtherMonths: true
+ });
+
+ grid = jQuery('#listGrid').jqGrid({
+ cmTemplate: {
+ align: 'center',
+ sortable: false
+ },
+ url: '/client/ClientExpireWarningListJson',
+ datatype: 'json',
+ height: 'auto',
+ width: '96%',
+ autowidth: false,
+ shrinkToFit: false,
+ viewrecords: true,
+ jsonReader: { repeatitems: false },
+ caption: '',
+ mtype: 'POST',
+ postData: PostData,
+ afterInsertRow: AfterInsertRow,
+ onSelectRow: rowclick,
+ ondblClickRow: rowdblclick,
+ colModel: colModelGrid,
+ pagerpos: 'left',
+ footerrow: false,
+ loadComplete: gridComplete,
+ onPaging: onJqgridPaging,
+ });
+
+ function keyEnter(event) {
+ try {
+ var e = event ? event : (window.event ? window.event : null);
+ if (e.keyCode === 13) {
+ SearchClick(true);
+ }
+ } catch (e) {
+ //
+ }
+ }
+
+ document.onkeydown = keyEnter;
+
+});
+
+var i = 0;
+
+var getColModelGrid = function () {
+ return [
+ {
+ name: 'id',
+ label: 'id',
+ index: 'id',
+ sortIndex: i++,
+ width: 1,
+ align: 'center',
+ hidden: true,
+ optionHide: true
+ }, {
+ name: 'EncryptId',
+ label: 'EncryptId',
+ index: 'EncryptId',
+ sortIndex: i++,
+ width: 1,
+ align: 'center',
+ hidden: true,
+ optionHide: true
+ }, {
+ name: '',
+ label: '操作',
+ index: '',
+ sortIndex: i++,
+ width: 220,
+ align: 'center',
+ sortable: false,
+ formatter: showToolName
+ }, {
+ name: 'Number',
+ label: '客户编号',
+ index: 'Number',
+ sortIndex: i++,
+ width: 200,
+ align: 'center',
+ sortable: false
+ }, {
+ name: 'Name',
+ label: '客户名称',
+ index: 'Name',
+ sortIndex: i++,
+ width: 300,
+ align: 'center',
+ sortable: false
+ }, {
+ name: 'EvaluateDate',
+ label: '适当性评估日期',
+ index: 'EvaluateDate',
+ width: 170,
+ align: 'center',
+ sortable: false,
+ formatter: 'date',
+ }, {
+ name: 'EvaluateExpireDateStr',
+ label: '适当性评估到期日',
+ index: 'EvaluateExpireDateStr',
+ sortIndex: i++,
+ width: 170,
+ align: 'center',
+ sortable: false,
+ cellattr: function (cellvalue, options, rowObject) {
+ return "style='" + checkDate(rowObject.EvaluateExpireDate) + "'";
+ }
+ }, {
+ name: 'AuthorizeEffectiveEndDateStr',
+ label: '人员证件到期日',
+ index: 'AuthorizeEffectiveEndDateStr',
+ sortIndex: i++,
+ width: 170,
+ align: 'center',
+ sortable: false,
+ cellattr: function (cellvalue, options, rowObject) {
+ return "style='" + checkDate(rowObject.AuthorizeEffectiveEndDate) + "'";
+ }
+ }
+ ];
+};
+var colModelGrid = getColModelGrid();
+
+function gridComplete() {
+ var newHeight = $(window).height() - 250;
+ $(".ui-jqgrid .ui-jqgrid-bdiv").css("cssText", "height: " + newHeight + "px!important;");
+ $('.ui-jqgrid-bdiv', '#gbox_listGrid').floatingScroll();
+}
+
+function checkDate(cellvalue) {
+ if (cellvalue < page.ExpireDate) {
+ return "background-color: #FAACAC"
+ } else if (cellvalue <= page.DueDate) {
+ return "background-color: #FDA749"
+ } else {
+ return "";
+ }
+ return "";
+}
+
+function SearchClick(isSearchclick) {
+ var listGrid = $('#listGrid');
+
+ listGrid.appendPostData({ Number: $("#Number").val() });
+ listGrid.appendPostData({ Name: $("#Name").val() });
+ listGrid.appendPostData({ StartExpireDate: $("#DateFromExpireDate").val() });
+ listGrid.appendPostData({ EndExpireDate: $("#DateToExpireDate").val() });
+
+ query_data = listGrid.jqGrid('getPostData');
+ if (typeof isSearchclick !== "undefined" && isSearchclick) {
+ //点击搜索时默认第一页
+ listGrid.jqGrid('setGridParam',
+ {
+ page: 1
+ });
+ }
+ listGrid.trigger('reloadGrid');
+}
+
+function showToolName(cellValue, options, rowObject) {
+ var html = "";
+ html = html +
+ ""
+ .template(rowObject.EncryptId, "查看");
+ if (rowObject.isWarning) {
+ html = html +
+ ""
+ .template(rowObject.EncryptId, "继续预警");
+ } else {
+ html = html +
+ ""
+ .template(rowObject.EncryptId, "不再预警");
+ }
+ return html;
+}
+
+function startclientView(id) {
+ var srcurl = "/client/clientViewV2?enid=" + id;
+ var width = "1300px";
+ layer.open({
+ type: 2,
+ title: "查看客户信息",
+ shadeClose: false,
+ shade: 0.4,
+ area: [width, '800px'],
+ content: srcurl,
+ cancel: function (index, layero) {
+ var iframeWin = window["layui-layer-iframe" + index];
+ if (iframeWin.topVue == undefined) {
+ return window.layer.closeMe();
+ }
+ return iframeWin.topVue.closeMe();
+ }
+ });
+}
+
+function cancel(id) {
+ main.post("/client/ClientExpireWarningUpdate", { enid: id }).done(function (res) {
+ try {
+ SearchClick();
+ Updatestatue();
+ window.parent.reloadclient2 && window.parent.reloadclient2();
+ } catch (e) { }
+ });
+}
+
+function Updatestatue() {
+ main.post("/client/ClientExpireWarningStatusJson").done(function (res) {
+ var div = document.getElementById("statue");
+ var date = res;
+ var html = "";
+ if (date.status == "即将到期") {
+ div.setAttribute("style", "background-color:#FFF2D9;padding:5px 5px 5px 20px;margin:1rem 1rem 0rem 1rem;");
+ html += "即将到期3个月内到期的客户:" + date.isDue + "";
+ if (date.isDue_all != date.isDue) {
+ html += "(" + date.isDue_all + ")个";
+ } else {
+ html += "个";
+ }
+ html += "已到期客户:0个";
+ } else if (date.status == "已到期") {
+ div.setAttribute("style", "background-color:#FFE1E1;padding:5px 5px 5px 20px;margin:1rem 1rem 0rem 1rem;");
+ html += "已到期3个月内到期的客户:" + date.isDue + ""
+ if (date.isDue_all != date.isDue) {
+ html += "(" + date.isDue_all + ")个";
+ } else {
+ html += "个";
+ }
+ html += "已到期客户:" + date.isExpire + "";
+ if (date.isExpire_all != date.isExpire) {
+ html += "(" + date.isExpire_all + ")个";
+ } else {
+ html += "个";
+ }
+ } else {
+ div.setAttribute("style", "background-color:#E7F6FF;padding:5px 5px 5px 20px;margin:1rem 1rem 0rem 1rem;");
+ html += "无异常";
+ html += "3个月内到期的客户:0个";
+ html += "已到期客户:0个";
+ }
+ div.innerHTML = html;
+ });
+}
\ No newline at end of file
diff --git a/YLErpWeb/wwwroot/Scripts/app/client/clientListV2.js b/YLErpWeb/wwwroot/Scripts/app/client/clientListV2.js
index 8800fb01..a298928f 100644
--- a/YLErpWeb/wwwroot/Scripts/app/client/clientListV2.js
+++ b/YLErpWeb/wwwroot/Scripts/app/client/clientListV2.js
@@ -1,7 +1,7 @@
var colModelGrid = [];
$(function () {
var PostData = {};
-
+ Updatestatue();
getColModelGrid();
$(".datepicker").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true });
jqGridInit();
@@ -521,12 +521,14 @@ function startclientView(id) {
function reloadclient() {
//重新加载
+ Updatestatue();
SearchClick();
window.layer.closeAll();
}
function reloadclient2() {
//重新加载
+ Updatestatue();
SearchClick();
}
@@ -713,4 +715,39 @@ $("#OptName").change(function () {
function showcolumnChooser() {
main.showcolumnChooser(jQuery('#listGrid'), page.configcolumn_name);
}
-
+function Updatestatue() {
+ main.post("/client/CheckedClientWarning").done(function (res) {
+ var div = document.getElementById("statue");
+ var date = res;
+ var html = "";
+ if (date == "即将到期") {
+ div.setAttribute("style", "border-color:#FF9933;border-radius:3px;box-shadow: 0 0px #FF9933;color:#FF9933;background-color:#FFF2D9");
+ html += " 即将到期";
+ } else if (date == "已到期") {
+ div.setAttribute("style", "border-color:red;border-radius:3px;box-shadow: 0 0px red;color:red;background-color:#FFE1E1");
+ html += " 已到期";
+ } else {
+ div.setAttribute("style", "border-color:#0282EC;border-radius:3px;box-shadow: 0 0px #0282EC;color:#0282EC;background-color:#E7F6FF;");
+ html += " 无异常";
+ }
+ div.innerHTML = html;
+ });
+}
+function clientExpireWarningList() {
+ var srcurl = "/client/ClientExpireWarningList";
+ layer.open({
+ type: 2,
+ title: "查看预警情况",
+ shadeClose: false,
+ shade: 0.4,
+ area: ['1650px', '900px'],
+ content: srcurl,
+ cancel: function (index, layero) {
+ var iframeWin = window["layui-layer-iframe" + index];
+ if (iframeWin.topVue == undefined) {
+ return window.layer.closeMe();
+ }
+ return iframeWin.topVue.closeMe();
+ }
+ });
+}
\ No newline at end of file