ddlucky 9 months ago
parent d7b16c21e7
commit c2874e7ec9

@ -5225,7 +5225,9 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
],
scope: this
}, '-', {
}, '-'
, {
id: 'btnRuleWarning',
text: '0',
iconCls: "btn-warning",
@ -5278,7 +5280,8 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
}
},
scope: this
}]
}
]
}); //end 按钮Toolbar
//#endregion

@ -18,7 +18,12 @@ Ext.extend(Shipping.MsSeaeOrderEdit, Ext.Panel, {
seaecustservice: "",
FORWARDER: "",
reason: "",
ruleList: null,
ruleCheckFail: false,
ruleCheckNames: '',
ruleCheckNameArr: [],
ruleCheckNameArr_2: [],
redAlertFields: [],
initUIComponents: function () {
this.serialNo = 0;
//this.bodyDel = [];
@ -2609,6 +2614,13 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
this.checkRules();
if (this.ruleCheckFail) {
Ext.MessageBox.alert("提示", "表单校验不满足如下规则:<br/><b>" + this.ruleCheckNames + "</b><br/>不允许保存");
return;
}
this.Save('0');
},
scope: this
@ -2616,6 +2628,13 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
id: 'btnESaveAndClose',
text: "保存并关闭",
handler: function (button, event) {
this.checkRules();
if (this.ruleCheckFail) {
Ext.MessageBox.alert("提示", "表单校验不满足如下规则:<br/><b>" + this.ruleCheckNames + "</b><br/>不允许保存");
return;
}
this.Save('1');
},
scope: this
@ -2623,6 +2642,13 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
id: 'btnESaveAndNew',
text: "保存并新建",
handler: function (button, event) {
this.checkRules();
if (this.ruleCheckFail) {
Ext.MessageBox.alert("提示", "表单校验不满足如下规则:<br/><b>" + this.ruleCheckNames + "</b><br/>不允许保存");
return;
}
this.Save('2');
this.panelOcr.hide();
},
@ -2631,6 +2657,13 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
id: 'btnECopyNew',
text: "复制新建",
handler: function (button, event) {
this.checkRules();
if (this.ruleCheckFail) {
Ext.MessageBox.alert("提示", "表单校验不满足如下规则:<br/><b>" + this.ruleCheckNames + "</b><br/>不允许保存");
return;
}
var basicForm = this.formHead.getForm();
var editForm = this.formEdit.getForm();
this.opStatus = 'add';
@ -2803,7 +2836,63 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
},
scope: this
}]
}
, {
id: 'btnRuleWarning',
text: '0',
iconCls: "btn-warning",
handler: function (button, event) {
this.checkRules();
if (this.ruleCheckNameArr.length > 0) {
var store = Ext.data.Store({
fields: [{
name: 'Title', type: "string"
}],
data: this.ruleCheckNameArr,
autoLoad: true
});
var grid = Ext.create('Ext.grid.Panel', {
store: store,
columns: [
{ text: "规则名称", flex: 1, dataIndex: 'Title', sortable: true }
],
forceFit: true,
split: true,
region: 'center'
});
this.winCheckRuleListShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.CheckRuleNames,
width: 600,
height: 350,
plain: true,
layout: "border",
iconCls: "addicon",
resizable: false,
draggable: false,
collapsible: true,
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [grid],
buttons: [{
text: Zi.LAN.GuanBi, //"关闭",
minWidth: 70,
handler: function () {
me.winCheckRuleListShow.close();
}
}]
});
this.winCheckRuleListShow.show();
}
},
scope: this
}
]
}); //end 按钮Toolbar
//#endregion
@ -3080,6 +3169,7 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
this.LoadData(this.opStatus, condition);
this.LoadMustBe();
this.loadCheckRules();
}, //end InitData
LoadData: function (opstatus, condition) {
@ -4582,6 +4672,224 @@ DFF42726-A0BA-4264-BFDF-2500A35E89C7 isVehiclesDispatcher 是否派车调度人
},
//#endregion
//#region 规则判断
loadCheckRules: function () {
var _this = this;
Ext.Ajax.request({
url: '/MvcShipping/MsOpRule/RuleListEnable',
method: 'POST',
success: function (resp, opts) {
var data = Ext.decode(resp.responseText);
_this.ruleList = data;
},
failure: function (resp, opts) {
Ext.Msg.alert('错误', '加载规则错误');
}
});
},
checkRules: function () {
this.clearRuleAlertStyle();
var btnWarning = Ext.getCmp('btnRuleWarning');
var matchCount = 0;
var matchRuleName = '';
var matchRuleNameArr = [];
var redAlertFields = [];
for (var idx = 0; idx < this.ruleList.length; idx++) {
var rule = this.ruleList[idx];
var redAlert = rule.RedAlertField;
var saveDisable = rule.SaveDisable;
var compareType = rule.CompareType;
var matchSuccess = false;
if (compareType == "And") {
//与条件下,任意一条不满足,则整条规则不满足
matchSuccess = true;
for (var itemIdx = 0; itemIdx < rule.Items.length; itemIdx++) {
var ruleItem = rule.Items[itemIdx];
var member = ruleItem.Field;
var found = false;
var headfield = this.formHead.getForm().findField(member);
if (headfield != NaN && headfield != null) {
found = true;
if (!this.isMatchRule(ruleItem, headfield)) {
matchSuccess = false;
break;
}
}
headfield = this.formEdit.getForm().findField(member);
if (headfield != NaN && headfield != null) {
found = true;
if (!this.isMatchRule(ruleItem, headfield)) {
matchSuccess = false;
break;
}
}
headfield = this.formBill.getForm().findField(member);
if (headfield != NaN && headfield != null) {
found = true;
if (!this.isMatchRule(ruleItem, headfield)) {
matchSuccess = false;
break;
}
}
//字段没有找到,则不符合
if (!found) {
matchSuccess = false;
break;
}
}
}
else if (compareType == "Or") {
//或条件下,任意一条满足,则整条规则满足
for (var itemIdx = 0; itemIdx < rule.Items.length; itemIdx++) {
var ruleItem = rule.Items[itemIdx];
var member = ruleItem.Field;
var headfield = this.formHead.getForm().findField(member);
if (headfield != NaN && headfield != null) {
if (this.isMatchRule(ruleItem, headfield)) {
matchSuccess = true;
}
}
headfield = this.formEdit.getForm().findField(member);
if (headfield != NaN && headfield != null) {
if (this.isMatchRule(ruleItem, headfield)) {
matchSuccess = true;
}
}
headfield = this.formEDI.getForm().findField(member);
if (headfield != NaN && headfield != null) {
if (this.isMatchRule(ruleItem, headfield)) {
matchSuccess = true;
}
}
}
}
if (matchSuccess) {
matchCount++;
matchRuleName += rule.Title + ","
matchRuleNameArr.push(rule);
if (redAlert != null && redAlert.length > 0) {
var headfield = this.formHead.getForm().findField(redAlert);
if (headfield != NaN && headfield != null) {
var srcColor = this.getBackgroundColorFromStyle(headfield.getFieldStyle());
redAlertFields.push({ name: redAlert, color: srcColor });
headfield.setFieldStyle({ background: '#f00' });
}
headfield = this.formEdit.getForm().findField(redAlert);
if (headfield != NaN && headfield != null) {
var srcColor = this.getBackgroundColorFromStyle(headfield.getFieldStyle());
redAlertFields.push({ name: redAlert, color: srcColor });
headfield.setFieldStyle({ background: '#f00' });
}
headfield = this.formEDI.getForm().findField(redAlert);
if (headfield != NaN && headfield != null) {
var srcColor = this.getBackgroundColorFromStyle(headfield.getFieldStyle());
redAlertFields.push({ name: redAlert, color: srcColor });
headfield.setFieldStyle({ background: '#f00' });
}
}
if (saveDisable) {
this.ruleCheckFail = true;
}
}
}
btnWarning.setText(matchCount + '');
this.formHead.getForm().findField('WARNCOUNT').setValue(matchCount);
this.ruleCheckNames = matchRuleName;
this.ruleCheckNameArr = matchRuleNameArr;
this.redAlertFields = redAlertFields;
},
isMatchRule: function (ruleItem, field) {
var compare = ruleItem.Compare;
var value = ruleItem.Value;
var fieldValue = field.getRawValue();
if (compare == "Contains") {
if (fieldValue.indexOf(value) > -1) {
return true;
}
} else if (compare == "NotContains") {
if (fieldValue.indexOf(value) == -1) {
return true;
}
} else if (compare == "Large") {
if (fieldValue > value) {
return true;
}
} else if (compare == "Small") {
if (fieldValue < value) {
return true;
}
} else if (compare == "LargeEqual") {
if (fieldValue >= value) {
return true;
}
} else if (compare == "SmallEqual") {
if (fieldValue <= value) {
return true;
}
} else if (compare == "Equal") {
if (fieldValue == value) {
return true;
}
} else if (compare == "NotEqual") {
if (fieldValue != value) {
return true;
}
}
return false;
},
clearRuleAlertStyle: function () {
if (this.redAlertFields.length > 0) {
for (var idx = 0; idx < this.redAlertFields.length; idx++) {
var redAlert = this.redAlertFields[idx].name;
if (redAlert == null || redAlert.length == 0) {
continue;
}
var headfield = this.formHead.getForm().findField(redAlert);
if (headfield != NaN && headfield != null) {
var srcColor = this.redAlertFields[idx].color;
headfield.setFieldStyle({ background: srcColor });
}
headfield = this.formEdit.getForm().findField(redAlert);
if (headfield != NaN && headfield != null) {
var srcColor = this.redAlertFields[idx].color;
headfield.setFieldStyle({ background: srcColor });
}
headfield = this.formEDI.getForm().findField(redAlert);
if (headfield != NaN && headfield != null) {
var srcColor = this.redAlertFields[idx].color;
headfield.setFieldStyle({ background: srcColor });
}
}
}
},
getBackgroundColorFromStyle: function (style) {
var backColor = "#fff";
var idx = style.indexOf("background");
if (idx > -1) {
var idx1 = style.indexOf(";", idx);
if (idx1 > idx) {
backColor = style.substring(idx + "background".length + 1, idx1);
}
}
return backColor;
},
//#endregion
//#region 打印
Print: function () {

@ -4,7 +4,7 @@
<ProjectView>ShowAllFiles</ProjectView>
<NameOfLastUsedPublishProfile>E:\DS7_QDHHYT\DSWeb\Properties\PublishProfiles\FolderProfile1.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2024-01-03T01:09:05.9486813Z;True|2023-12-22T13:45:30.1024603+08:00;False|2023-12-19T14:02:46.6136527+08:00;True|2022-07-01T11:57:59.3192766+08:00;False|2022-07-01T10:21:57.6363181+08:00;False|2022-07-01T10:13:59.6180616+08:00;False|2022-07-01T10:12:32.2645556+08:00;</History>
<History>True|2024-02-05T01:15:41.0910946Z;True|2024-02-01T16:50:17.3691311+08:00;True|2024-01-03T09:09:05.9486813+08:00;True|2023-12-22T13:45:30.1024603+08:00;False|2023-12-19T14:02:46.6136527+08:00;True|2022-07-01T11:57:59.3192766+08:00;False|2022-07-01T10:21:57.6363181+08:00;False|2022-07-01T10:13:59.6180616+08:00;False|2022-07-01T10:12:32.2645556+08:00;</History>
<_PublishTargetUrl>E:\DS7Deploy</_PublishTargetUrl>
<LastFailureDetails />
</PropertyGroup>
@ -12637,34 +12637,34 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>10/09/2023 15:12:58</publishTime>
</File>
<File Include="bin/DSWeb.Common.dll">
<publishTime>01/03/2024 15:02:48</publishTime>
<publishTime>02/05/2024 09:14:43</publishTime>
</File>
<File Include="bin/DSWeb.Common.dll.config">
<publishTime>10/09/2023 15:12:55</publishTime>
</File>
<File Include="bin/DSWeb.Common.pdb">
<publishTime>01/03/2024 15:02:48</publishTime>
<publishTime>02/05/2024 09:14:43</publishTime>
</File>
<File Include="bin/DSWeb.dll">
<publishTime>01/04/2024 11:00:39</publishTime>
<publishTime>02/05/2024 09:17:11</publishTime>
</File>
<File Include="bin/DSWeb.Interface.dll">
<publishTime>01/03/2024 15:02:49</publishTime>
<publishTime>02/05/2024 09:14:44</publishTime>
</File>
<File Include="bin/DSWeb.Interface.pdb">
<publishTime>01/03/2024 15:02:49</publishTime>
<publishTime>02/05/2024 09:14:44</publishTime>
</File>
<File Include="bin/DSWeb.pdb">
<publishTime>01/04/2024 11:00:39</publishTime>
<publishTime>02/05/2024 09:17:11</publishTime>
</File>
<File Include="bin/DSWeb.XmlSerializers.dll">
<publishTime>01/04/2024 11:00:40</publishTime>
<publishTime>02/05/2024 09:17:14</publishTime>
</File>
<File Include="bin/DSWebComponent.dll">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:28</publishTime>
</File>
<File Include="bin/DSWebComponent.pdb">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:28</publishTime>
</File>
<File Include="bin/EntityFramework.dll">
<publishTime>09/27/2023 16:47:38</publishTime>
@ -12688,10 +12688,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>09/14/2022 17:45:31</publishTime>
</File>
<File Include="bin/HcDBUtility.dll">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:28</publishTime>
</File>
<File Include="bin/HcDBUtility.pdb">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:28</publishTime>
</File>
<File Include="bin/HtmlTextBoxControl.dll">
<publishTime>10/09/2023 15:12:58</publishTime>
@ -12796,10 +12796,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>08/26/2022 20:27:07</publishTime>
</File>
<File Include="bin/JsonHelper.dll">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:27</publishTime>
</File>
<File Include="bin/JsonHelper.pdb">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:27</publishTime>
</File>
<File Include="bin/junit.dll">
<publishTime>08/26/2022 20:27:07</publishTime>
@ -12826,7 +12826,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>08/26/2022 20:27:07</publishTime>
</File>
<File Include="bin/Microsoft.mshtml.dll">
<publishTime>12/29/2023 17:03:53</publishTime>
<publishTime>01/10/2024 11:56:22</publishTime>
</File>
<File Include="bin/Microsoft.Owin.dll">
<publishTime>08/26/2022 20:27:07</publishTime>
@ -12880,10 +12880,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>08/26/2022 20:26:50</publishTime>
</File>
<File Include="bin/OfficeHelper.dll">
<publishTime>01/02/2024 14:50:36</publishTime>
<publishTime>02/01/2024 16:49:27</publishTime>
</File>
<File Include="bin/OfficeHelper.pdb">
<publishTime>01/02/2024 14:50:36</publishTime>
<publishTime>02/01/2024 16:49:27</publishTime>
</File>
<File Include="bin/Owin.dll">
<publishTime>08/26/2022 20:27:07</publishTime>
@ -12901,10 +12901,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>10/09/2023 15:12:59</publishTime>
</File>
<File Include="bin/SocialExplorer.FastDBF.dll">
<publishTime>01/02/2024 14:50:36</publishTime>
<publishTime>02/01/2024 16:49:27</publishTime>
</File>
<File Include="bin/SocialExplorer.FastDBF.pdb">
<publishTime>01/02/2024 14:50:36</publishTime>
<publishTime>02/01/2024 16:49:27</publishTime>
</File>
<File Include="bin/Spire.License.dll">
<publishTime>08/26/2022 20:26:45</publishTime>
@ -12928,10 +12928,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>10/09/2023 15:12:59</publishTime>
</File>
<File Include="bin/WebSqlHelper.dll">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:28</publishTime>
</File>
<File Include="bin/WebSqlHelper.pdb">
<publishTime>01/02/2024 14:50:37</publishTime>
<publishTime>02/01/2024 16:49:28</publishTime>
</File>
<File Include="bin/zh-Hans/System.Web.Http.resources.dll">
<publishTime>02/01/2018 20:17:44</publishTime>
@ -23578,7 +23578,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>08/26/2022 20:26:48</publishTime>
</File>
<File Include="Web.config">
<publishTime>01/02/2024 14:44:38</publishTime>
<publishTime>02/05/2024 08:59:19</publishTime>
</File>
<File Include="WebSearchEngine/SearchEngineAdapter.aspx">
<publishTime>08/26/2022 20:26:48</publishTime>

@ -88,14 +88,14 @@
<add name="DongShengDB" connectionString="Server=123.234.225.158,26600;Database=shippingwebTEST;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
<add name="sydevzsh" connectionString="Server=123.234.225.158,26600;Database=shippingwebTEST;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
-->
<!-- 环海运通 http://221.215.122.2:8081/login.aspx qdhhyt admin 888666
<!-- 环海运通 http://221.215.122.2:8081/login.aspx qdhhyt admin 888666 -->
<add name="DongShengDB" connectionString="Server=221.215.122.2,12456 ;Database=Shippingweb_HHYT;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
<add name="sydevzsh" connectionString="Server=221.215.122.2,12456 ;Database=Shippingweb_HHYT;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
-->
<!-- 环海运通 测试 http://221.215.122.2:8088/login.aspx qdhhyt admin 666888 -->
<!-- 环海运通 测试 http://221.215.122.2:8088/login.aspx qdhhyt admin 666888
<add name="DongShengDB" connectionString="Server=221.215.122.2,12456 ;Database=20231031;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
<add name="sydevzsh" connectionString="Server=221.215.122.2,12456 ;Database=20231031;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
-->
<!-- 锦海运通 旧 http://221.215.122.2:8081/login.aspx qdhhyt admin 666888
<add name="DongShengDB" connectionString="Server=221.215.122.2,12456 ;Database=Shippingweb_QDJHYT;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />
<add name="sydevzsh" connectionString="Server=221.215.122.2,12456 ;Database=Shippingweb_QDJHYT;User ID=sa;Password=Ds20040201;Connect Timeout=120000;" providerName="System.Data.SqlClient" />

Loading…
Cancel
Save