监管车,修改初步完成,待测

DS7_JingHan
ddlucky 2 years ago
parent 25865236b5
commit c66f3c2cf0

@ -242,14 +242,18 @@ namespace DSWeb.MvcShipping.Controllers
//20230129 关贸云 报关业务导入
result = MsOpTaskDAL.(enumValue, Convert.ToString(Session["SHOWNAME"]).ToString().Trim(),Convert.ToString(Session["USERID"]).ToString().Trim());
//SetTaskOver(enumValue, Convert.ToString(Session["SHOWNAME"]).ToString().Trim());
}
else
{
var blUpSQL = " insert into op_task_state (GID,TASKNO,TASKSTATUS,OP,OPTIME) values (newid(),'" + enumValue.TASKNO + "','已完成','" + Convert.ToString(Session["SHOWNAME"]).ToString().Trim() + "',GETDATE())";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
//var blUpSQL = " insert into op_task_state (GID,TASKNO,TASKSTATUS,OP,OPTIME) values (newid(),'" + enumValue.TASKNO + "','已完成','" + Convert.ToString(Session["SHOWNAME"]).ToString().Trim() + "',GETDATE())";
//bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
// blUpSQL = " update op_task set ISCOMPLETE=1,TASKSTATUS='已完成',COMPLETETYPE='人工',COMPLETETIME=GETDATE(),OP='" + Convert.ToString(Session["SHOWNAME"]).ToString().Trim() + "' where GID='" + enumValue.GID + "'";
// bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
SetTaskOver(enumValue, Convert.ToString(Session["SHOWNAME"]).ToString().Trim());
blUpSQL = " update op_task set ISCOMPLETE=1,TASKSTATUS='已完成',COMPLETETYPE='人工',COMPLETETIME=GETDATE(),OP='" + Convert.ToString(Session["SHOWNAME"]).ToString().Trim() + "' where GID='" + enumValue.GID + "'";
bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
if (enumValue.ISCOMPLETE != "1" && (enumValue.TASKTYPE == "BA" || enumValue.TASKTYPE == "BC" || enumValue.TASKTYPE == "BCL" || enumValue.TASKTYPE == "ORIGINAL" || enumValue.TASKTYPE == "VC" || enumValue.TASKTYPE == "DRAFT" || enumValue.TASKTYPE == "SEAWAY"))
{
//blUpSQL = "INSERT INTO [Receipt_Doc](GID,BSNO,URL,Driect_URL,MODIFIEDUSER,MODIFIEDTIME,RECEIPTTYPE,DOCUMENTATTACHEDCODE,DOCUMENTATTACHEDNO)"
@ -279,6 +283,14 @@ namespace DSWeb.MvcShipping.Controllers
}
public static void SetTaskOver(OpTask enumValue,string SHOWNAME) {
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var blUpSQL = " insert into op_task_state (GID,TASKNO,TASKSTATUS,OP,OPTIME) values (newid(),'" + enumValue.TASKNO + "','已完成','" + SHOWNAME + "',GETDATE())";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
blUpSQL = " update op_task set ISCOMPLETE=1,TASKSTATUS='已完成',COMPLETETYPE='人工',COMPLETETIME=GETDATE(),OP='" + SHOWNAME + "' where GID='" + enumValue.GID + "'";
bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
public ContentResult UpTaskEmail(string data)
{

@ -35,6 +35,8 @@ using static com.sun.net.httpserver.Authenticator;
using DSWeb.MvcShipping.Models.MsOpSeae;
using DSWeb.MvcShipping.Helper.Repository;
using DSWeb.MvcContainer.DAL.MsCodeCtnTk;
using DSWeb.Areas.MvcShipping.Helper;
using DSWeb.MvcShipping.Models.MsOpSeaeEdi;
namespace DSWeb.MvcShipping.Controllers
{
@ -113,6 +115,26 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = json };
}
public ContentResult GetCopyData(string handle, string condition)
{
OP_SuperVision_Truck_md head = null;
var oldhead = MsOp_SuperVision_TruckDAL.GetData(condition);
head = AutoMapperHelper.MapTo<OP_SuperVision_Truck_md, OP_SuperVision_Truck_md>(oldhead);
head.BSNO = "";
head.CUSTNO = "";
head.CreatorID = Session["USERID"].ToString(); ;
head.Creator = Session["SHOWNAME"].ToString();
head.CreateTime=DateTime.Now;
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult Save(string opstatus, string data, string data2, string body)
{
var canlogin = BasicDataRefDAL.CheckLogin(Session);
@ -249,7 +271,8 @@ namespace DSWeb.MvcShipping.Controllers
}
/// <summary>
/// 获取一个新的分单号 并回传至前台
/// 获取一个新的
/// 并回传至前台
/// </summary>
/// <param name="BSNO"></param>
/// <returns></returns>

@ -38,6 +38,7 @@ using DSWeb.MvcShipping.Models.WMSNew;
using DSWeb.Areas.Dispatch.DB;
using System.Web.Mvc;
using Ivony.Fluent;
using Quartz.Util;
namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
{
@ -75,7 +76,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql.Append(@") as num , ");
strSql.Append(" *,convert(bigint ,TimeMark) as TimeMark_int from OP_SuperVision_Truck ");
strSql.Append(" *,convert(bigint ,TimeMark) as TimeMark_int ");
strSql.Append(" , case when billtype='主单' then isnull((select sum(1) from OP_SuperVision_Truck f where f.masterno=OP_SuperVision_Truck.BSNO and f.BILLTYPE='分单'),0) else 0 end FENPIAO ");
strSql.Append(" from OP_SuperVision_Truck ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" where 1=1 AND " + strCondition + "");
@ -164,7 +168,12 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
var strSql = new StringBuilder();
strSql.Append("select *,convert(bigint ,TimeMark) as TimeMark_int from OP_SuperVision_Truck ");
strSql.Append("select ");
strSql.Append(" *,convert(bigint ,TimeMark) as TimeMark_int ");
strSql.Append(" ,case when billtype='主单' then isnull((select sum(1) from OP_SuperVision_Truck f where f.masterno=OP_SuperVision_Truck.BSNO and f.BILLTYPE='分单'),0) else 0 end FENPIAO ");
strSql.Append(" from OP_SuperVision_Truck ");
if (!string.IsNullOrEmpty(strCondition))
{
@ -187,7 +196,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
}
}
public static DBResult CanSave(string opstatus, OP_SuperVision_Truck_md headData) {
public static DBResult CanSave(string opstatus,ref OP_SuperVision_Truck_md headData) {
var result = new DBResult();
result.OK();
@ -196,16 +205,22 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
// result.SetErrorInfo("发车日期必填");
//}
var _count = BasicDataRefDAL.GetExist("OP_SuperVision_Truck", $" BSNO<>'{headData.BSNO}' and isnull(MBLNO,'')<>'' and isnull(MBLNO,'')='{headData.MBLNO}' ");
if (_count > 0)
{
result.SetErrorInfo("主单号不允许重复");
var _count = 0;
if (headData.BILLTYPE == "主单") {
//如果是主单 主单号不允许重复
_count=BasicDataRefDAL.GetExist("OP_SuperVision_Truck", $" BSNO<>'{headData.BSNO}' and isnull(MBLNO,'')<>'' and isnull(MBLNO,'')='{headData.MBLNO}' and BILLTYPE='主单' ");
if (_count > 0)
{
result.SetErrorInfo("主单号不允许重复");
}
}
_count = BasicDataRefDAL.GetExist("OP_SuperVision_Truck", $" BSNO<>'{headData.BSNO}' and isnull(HBLNO,'')<>'' and isnull(HBLNO,'')='{headData.HBLNO}' ");
if (_count > 0)
{
result.SetErrorInfo("分单号不允许重复");
else {
//如果是分单 同主单不同分单的分单号不允许重复
_count = BasicDataRefDAL.GetExist("OP_SuperVision_Truck", $" BSNO<>'{headData.BSNO}' and isnull(MBLNO,'')='{headData.MBLNO}' and isnull(HBLNO,'')<>'' and isnull(HBLNO,'')='{headData.HBLNO}' ");
if (_count > 0)
{
result.SetErrorInfo("同主单的不同分单之间,分单号不允许重复");
}
}
var _currdata = GetData($" BSNO='{headData.BSNO}' ");
@ -214,6 +229,23 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
result.SetErrorInfo("已经业务锁定");
}
//20230316 如果是分单 查找有没有相同主单号的主单 如没有 提示错误并返回 如果有 将masterno设为主单BSNO
//如果是主单 masterno=bsno
if (headData.BILLTYPE == "主单")
{
headData.MASTERNO = headData.BSNO;
}
else {
var = GetData($" MBLNO='{headData.MBLNO}' and BILLTYPE='主单' ");
if ( == null || string.IsNullOrWhiteSpace(.MBLNO))
{
result.SetErrorInfo($"未找到主单号[{headData.MBLNO}]的主单");
}
else {
headData.MASTERNO = .BSNO;
}
}
return result;
}
@ -302,7 +334,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
headData.setDate();
var _cansave = CanSave(opstatus,headData);
var _cansave = CanSave(opstatus,ref headData);
if (_cansave.Success)
{
@ -311,6 +343,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
return _cansave;
}
var modb = new ModelObjectRepository();
result = modb.Save(headData,
ModelObjectConvert<OP_SuperVision_Truck_Detail_md>.ToModelObjectList(bodyList),
@ -386,7 +421,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
}
else
{
result.SetErrorInfo("请设置命名规则:【监管车业务、委托编号】");
result.SetErrorInfo("请设置命名规则:【监管车业务、分提单号】");
return result;
}
iscreatecustno = true;
headData.HBLNO = HBLNO;
@ -496,6 +532,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
if (reader["BILLFEESTATUSTIME"] != DBNull.Value)
data.BILLFEESTATUSTIME = Convert.ToString(reader["BILLFEESTATUSTIME"]);
data.FENPIAO = Convert.ToInt32(reader["FENPIAO"]);
#endregion
headList.Add(data);
}

@ -10,6 +10,7 @@ using HcUtility.Comm;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.EntityDA;
using System.Transactions;
using DSWeb.Areas.CommMng.DAL;
namespace DSWeb.MvcShipping.DAL.MsSysBillNoSet
{
@ -452,24 +453,30 @@ namespace DSWeb.MvcShipping.DAL.MsSysBillNoSet
orgCode = cookies.getCookie(CookieConstant.OrgCode);//登录组织
}
try
{
var cmd = db.GetStoredProcCommand("sSysGetBillNo_new");
db.AddInParameter(cmd, "@ps_BillType", DbType.String, billType.BILLTYPE);
db.AddInParameter(cmd, "@ps_OrgCode", DbType.String, orgCode);
db.AddInParameter(cmd, "@ps_EmpCode", DbType.String, UserCode);
db.AddInParameter(cmd, "@ps_bshead", DbType.String, bshead);
if (billType.RULEDATETYPE == "业务日期")
db.AddInParameter(cmd, "@ps_Date", DbType.String, bsdate);
else if (billType.RULEDATETYPE == "会计期间"&&accdate.Length==7)
db.AddInParameter(cmd, "@ps_Date", DbType.String, accdate+"-01");
else
db.AddInParameter(cmd, "@ps_Date", DbType.String, "");
db.AddOutParameter(cmd, "@ps_BillNo", DbType.String, 20);
db.AddInParameter(cmd, "@ps_RefBillNo", DbType.String, null);
db.ExecuteNonQuery(cmd);
return Convert.ToString(db.GetParameterValue(cmd, "@ps_BillNo"));
var cmd = db.GetStoredProcCommand("sSysGetBillNo_new");
db.AddInParameter(cmd, "@ps_BillType", DbType.String, billType.BILLTYPE);
db.AddInParameter(cmd, "@ps_OrgCode", DbType.String, orgCode);
db.AddInParameter(cmd, "@ps_EmpCode", DbType.String, UserCode);
db.AddInParameter(cmd, "@ps_bshead", DbType.String, bshead);
if (billType.RULEDATETYPE == "业务日期")
db.AddInParameter(cmd, "@ps_Date", DbType.String, bsdate);
else if (billType.RULEDATETYPE == "会计期间" && accdate.Length == 7)
db.AddInParameter(cmd, "@ps_Date", DbType.String, accdate + "-01");
else
db.AddInParameter(cmd, "@ps_Date", DbType.String, "");
db.AddOutParameter(cmd, "@ps_BillNo", DbType.String, 20);
db.AddInParameter(cmd, "@ps_RefBillNo", DbType.String, null);
db.ExecuteNonQuery(cmd);
return Convert.ToString(db.GetParameterValue(cmd, "@ps_BillNo"));
}
catch (Exception e) {
BasicDataRefDAL.SaveLog(e.Message, billType.BILLTYPE, "获取编号","错误");
}
return "";
}
public static string GetBillNoHblno(SysBillNoSet billType, string bsdate, string accdate, string bshead = "")

@ -22,6 +22,7 @@
</script>
<script type="text/javascript" src="../../../../Views/../TruckMng/Scripts/ExtjsEx/exportexcel/export-all.js"></script>
<script type="text/javascript" src="../../../../Views/../TruckMng/Scripts/ExtjsEx/gridToExcel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/FenRowExpander.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOp_SuperVision_Truck/MsOp_SuperVision_TruckModel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOp_SuperVision_Truck/MsOp_SuperVision_TruckIndex.js"></script>

@ -67,16 +67,16 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
});
this.storeOpCode.load();
//客服
// this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '客服',
// store: this.storeOpCode,
//// flex: 0.5,
// forceSelection: true,
// name: 'CUSTSERVICE',
// valueField: 'UserName',
// displayField: 'CodeAndName',
// value: SHOWNAME
// });
// this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '客服',
// store: this.storeOpCode,
//// flex: 0.5,
// forceSelection: true,
// name: 'CUSTSERVICE',
// valueField: 'UserName',
// displayField: 'CodeAndName',
// value: SHOWNAME
// });
this.storeOpCode2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
@ -113,8 +113,8 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属部门', //'所属部门',
store: this.storeDept,
// flex: 0.5,
// labelWidth: 60,
// flex: 0.5,
// labelWidth: 60,
forceSelection: true,
name: 'SALEDEPT',
value: DEPTNAME,
@ -149,7 +149,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'" } });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
@ -169,7 +169,8 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.formHead.getForm().findField('SALECORPID').setValue(records[0].data.SALECORPID);
this.formHead.getForm().findField('SALE').setValue(records[0].data.SALE);
var s = " LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
this.storeInfoClientContact.load({ params: { condition: s },
this.storeInfoClientContact.load({
params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContact.getCount() > 0) {
@ -238,7 +239,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
model: 'DsShipping.ux.TSysEnumValueDataModel',
proxy: { url: '/CommMng/BasicDataRef/GetTSysEnumValueList' }
});
this.storeTSysEnumValueCode.load({ params: { condition: " and EnumTypeID=96023"} });
this.storeTSysEnumValueCode.load({ params: { condition: " and EnumTypeID=96023" } });
this.comboxTRANSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '运输类型',
store: this.storeTSysEnumValueCode,
@ -254,7 +255,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode.load({ params: { condition: " and KEYTYPE='贸易方式'"} });
this.storeCrmKeyCodeCode.load({ params: { condition: " and KEYTYPE='贸易方式'" } });
this.comboxTRADETYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '贸易方式',
store: this.storeCrmKeyCodeCode,
@ -310,7 +311,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
if (recs.getCount() > 0) {
var data = recs.getAt(0).data;
var s = "SOURCEID='" + data.SourceID + "'";
this.storeSourceDetail.load({ params: { condition: s} });
this.storeSourceDetail.load({ params: { condition: s } });
} else {
var BSSOURCEDETAIL = this.formHead.getForm().findField('BSSOURCEDETAIL');
BSSOURCEDETAIL.setValue('');
@ -344,8 +345,9 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
store: this.StoreBSTYPE,
fieldLabel: '业务类型',
forceSelection: true,
id:'BILLTYPE',
name: 'BILLTYPE',
value:'主单',
value: '主单',
valueField: 'BSTYPE',
displayField: 'BSTYPE'
});
@ -361,7 +363,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
fieldLabel: '预付到付',
forceSelection: true,
name: 'FEEFRT',
value:'PP',
value: 'PP',
valueField: 'Frt',
displayField: 'Frt'
});
@ -406,7 +408,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.storeSaleCompany.load({ params: { condition: "" } });
this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:'所属分部', //'委托分公司',
fieldLabel: '所属分部', //'委托分公司',
store: this.storeSaleCompany,
forceSelection: true,
name: 'SALECORPID',
@ -488,7 +490,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
name: 'CORPID', hidden: true
}, {
fieldLabel: '业务编号',
name: 'CUSTNO', readOnly:true
name: 'CUSTNO', readOnly: true
}, {
fieldLabel: '会计期间',
xtype: 'monthfield',
@ -529,7 +531,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.comboxSALE,
this.comboxDept,
this.comboxSaleCompany
]
]
}, {
xtype: 'container',
layout: 'hbox',
@ -542,21 +544,21 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
flex: 1,
defaultType: 'textfield',
items: [
{
fieldLabel: 'HAWB NO', //'委托编号',
//allowBlank: true,
readOnly:true,
name: 'HBLNO'
}, {
xtype: 'button',
id: 'btnCUSTNO',
iconCls: "btncancel",
handler: function (button, event) {
this.GetNewHBLNO();
},
scope: this
}]
fieldLabel: 'HAWB NO', //'委托编号',
//allowBlank: true,
readOnly: true,
name: 'HBLNO'
}, {
xtype: 'button',
id: 'btnCUSTNO',
iconCls: "btncancel",
handler: function (button, event) {
this.GetNewHBLNO();
},
scope: this
}]
},
{
fieldLabel: 'MAWB NO',
@ -568,7 +570,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
}
}
//allowBlank: false
//allowBlank: false
}
, this.comboxFeeFrt
, this.comboxTRANSFERCOMPANY
@ -678,7 +680,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
xtype: "textarea"
}
]
}
}
]//end items(fieldset 1)
}]//end root items
@ -696,14 +698,14 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
},
scope: this
}, {
id: 'btnENext',
text: "下一票", //"下一票",
// iconCls: "btnsave",
handler: function (button, event) {
this.NextRecord();
},
scope: this
},{
id: 'btnENext',
text: "下一票", //"下一票",
// iconCls: "btnsave",
handler: function (button, event) {
this.NextRecord();
},
scope: this
}, {
id: 'btnESave',
text: "保存",
iconCls: "btnsave",
@ -725,47 +727,106 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.Save('2');
},
scope: this
}, , {
text: '复制新建', //"国外舱单",
menu: [{
id: 'btnECopyNew',
text: "复制新建",
handler: function (button, event) {
var btnESave = Ext.getCmp('btnESave');
}, , {
text: '复制新建', //"国外舱单",
menu: [
{
id: 'btnECopyNew',
text: "复制新建",
handler: function (button, event) {
if (this.opStatus == 'add') {
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var btnESave = Ext.getCmp('btnESave');
if (btnESave.isDisabled() || this.getIsModify == '') {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno, false);
if (btnESave.isDisabled() || this.getIsModify == '') {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno, false);
this.LoadPeriodStatus(this.opStatus);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodOpOtherInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
this.LoadPeriodStatus(this.opStatus);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodOpOtherInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
this.tabOtherPanel.doLayout();
}
this.tabOtherPanel.doLayout();
} else {
this.CopyNew();
} else {
this.copyfee = false;
this.CopyNew(false);
}
this.panelOcr.hide();
},
scope: this
}
, {
id: 'btnECopyNewFee',
text: '复制新建(含费用)', //"复制新建",
handler: function (button, event) {
if (this.opStatus == 'add')
{
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var btnESave = Ext.getCmp('btnESave');
if (btnESave.isDisabled() || this.getIsModify == '') {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno, true,false);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodOpOtherInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.panelOcr.hide();
},
scope: this
}, {
id: 'btnECopyNewFee',
text: '复制新建(含费用)', //"复制新建",
this.tabOtherPanel.doLayout();
} else {
this.copyfee = true;
this.CopyNew(false);
}
this.panelOcr.hide();
},
scope: this
}
, {
id: 'btnECopyNewFen',
text: "新建分单",
handler: function (button, event) {
if (this.opStatus == 'add')
{
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var btnESave = Ext.getCmp('btnESave');
if (btnESave.isDisabled() || this.getIsModify == '') {
@ -773,8 +834,9 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.opStatus = 'add';
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno,true);
this.LoadCopyData(oldbsno, false,true);
this.LoadPeriodStatus(this.opStatus);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
@ -789,28 +851,25 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
}
this.tabOtherPanel.doLayout();
} else {
this.copyfee = true;
this.CopyNew();
this.copyfee = false;
this.CopyNew(true);
}
this.panelOcr.hide();
},
scope: this
}]
}, '-', {
}
]
}, '-', {
text: "关闭",
handler: function (button, event) {
window.close();
},
scope: this
}, {
text: "新建",
id: 'btnENew',
text: "新建",
id: 'btnENew',
handler: function (button, event) {
this.LoadData('add', '');
},
@ -900,7 +959,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
// title: record.data.DESCRIPTION
// });
//} else
if (record.data.NAME == 'modOpOtherAmendFee') {
if (record.data.NAME == 'modOpOtherAmendFee') {
var paneltabitems = new Shipping.OtherAmendFee({
id: 'pnl' + record.data.NAME,
layout: "border",
@ -934,7 +993,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
//#region 费用页面
this.panelFee = new Shipping.FeeEditGrid({
title:'应收应付费用',
title: '应收应付费用',
region: 'center',
layout: 'border'
});
@ -1036,7 +1095,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.GridBodyCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridBodyList = new Ext.grid.GridPanel({
title:'车单',
title: '车单',
store: this.storeBodyList,
enableHdMenu: false,
region: 'center',
@ -1063,35 +1122,35 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.onDelBodyClick(button, event);
},
scope: this
}, {
id: 'btnESave2',
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, {
text: "EXCEL导入", //"EXCEL导入",
iconCls: "btnexportexcel",
handler: function (button, event) {
if (this.opStatus == 'add') {
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} else {
this.onImportBillClick(button, event);
}
},
scope: this
}, {
}, {
id: 'btnESave2',
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, {
text: "EXCEL导入", //"EXCEL导入",
iconCls: "btnexportexcel",
handler: function (button, event) {
if (this.opStatus == 'add') {
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} else {
this.onImportBillClick(button, event);
}
},
scope: this
}, {
text: '刷新',
id:'bodyrefresh',
id: 'bodyrefresh',
tooltip: '刷新',
iconCls: "btnrefresh",
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeBodyList.load({ params: { BSNO: this.editRecord.get('BSNO') } });
},
scope: this
}],
},
scope: this
}],
columns: [
{
sortable: false,
@ -1109,7 +1168,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
sortable: true,
dataIndex: 'ROWNUM',
header: '顺序号',
width:60,
width: 60,
editor: {
xtype: 'numberfield',
selectOnFocus: true,
@ -1368,9 +1427,9 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
id: "tabOtherPanel",
enableTabScroll: true,
items:
[
this.panelOther
],
[
this.panelOther
],
listeners: {
scope: this,
'beforetabchange': function (tabPanel, newCard, oldCard, eOpts) {
@ -1480,7 +1539,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
//
if (this.opStatus == 'edit') {
var s = "SOURCEID=(select SOURCEID from code_source where SOURCENAME='" + this.editRecord.get('BSSOURCE') + "')";
this.storeSourceDetail.load({ params: { condition: s} }); //来源明细加载
this.storeSourceDetail.load({ params: { condition: s } }); //来源明细加载
//
condition = " BSNO='" + this.editRecord.get('BSNO') + "'";
} else if (this.opStatus == 'add') {
@ -1488,57 +1547,57 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
}
if (this.opStatus == 'copyadd') {
this.LoadCopyData(this.editRecord.get('BSNO'),this.copyfee);
this.LoadCopyData(this.editRecord.get('BSNO'), this.copyfee);
} else {
if (this.opStatus == 'edit')
this.LoadData(this.opStatus, condition);
}
// this.storecodeservice.load({ params: { condition: "OPTYPE='7'" },
// callback: function (r, options, success) {
// if (success) {
// if (r.length != 0) {
// var checkboxitems = "";
// checkboxitems = "[";
// for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
// var memberyf = this.storecodeservice.getAt(i);
// if (i == 0) {
// var checkboxSingleItem = "{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:'1',name:'Is" + memberyf.data.OPField + "',id:'Is" + memberyf.data.OPField + "'";
// checkboxSingleItem += "}";
// } else {
// var checkboxSingleItem = ",{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:'1',name:'Is" + memberyf.data.OPField + "',id:'Is" + memberyf.data.OPField + "'";
// checkboxSingleItem += "}";
// }
// checkboxitems += checkboxSingleItem;
// };
// checkboxitems += "]";
//// _this.myCheckboxGroup = new Ext.form.CheckboxGroup({
////// id: 'myGroup',
//// xtype: 'checkboxgroup',
//// fieldLabel: '服务项目',
//// columns: 8,
//// items: eval(checkboxitems)
//// });
//// _this.formHead.add(_this.myCheckboxGroup);
//// _this.formHead.doLayout();
// }
// if (this.opStatus == 'copyadd') {
// this.LoadCopyData(this.editRecord.get('BSNO'),this.copyfee);
// } else {
// if (this.opStatus == 'edit')
// this.LoadData(this.opStatus, condition);
// }
// //if (this.opStatus == 'add') {
// // this.LoadPeriod('add');
// //}
// }
// },
// scope: this
// });
// this.storecodeservice.load({ params: { condition: "OPTYPE='7'" },
// callback: function (r, options, success) {
// if (success) {
// if (r.length != 0) {
// var checkboxitems = "";
// checkboxitems = "[";
// for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
// var memberyf = this.storecodeservice.getAt(i);
// if (i == 0) {
// var checkboxSingleItem = "{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:'1',name:'Is" + memberyf.data.OPField + "',id:'Is" + memberyf.data.OPField + "'";
// checkboxSingleItem += "}";
// } else {
// var checkboxSingleItem = ",{boxLabel:'" + memberyf.data.SERVICENAME + "',inputValue:'1',name:'Is" + memberyf.data.OPField + "',id:'Is" + memberyf.data.OPField + "'";
// checkboxSingleItem += "}";
// }
// checkboxitems += checkboxSingleItem;
// };
// checkboxitems += "]";
//// _this.myCheckboxGroup = new Ext.form.CheckboxGroup({
////// id: 'myGroup',
//// xtype: 'checkboxgroup',
//// fieldLabel: '服务项目',
//// columns: 8,
//// items: eval(checkboxitems)
//// });
//// _this.formHead.add(_this.myCheckboxGroup);
//// _this.formHead.doLayout();
// }
// if (this.opStatus == 'copyadd') {
// this.LoadCopyData(this.editRecord.get('BSNO'),this.copyfee);
// } else {
// if (this.opStatus == 'edit')
// this.LoadData(this.opStatus, condition);
// }
// //if (this.opStatus == 'add') {
// // this.LoadPeriod('add');
// //}
// }
// },
// scope: this
// });
}, //end InitData
@ -1610,7 +1669,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
if (CUSTOMERNAME != '') {
var s = " LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
this.storeInfoClientContact.load({ params: { condition: s} });
this.storeInfoClientContact.load({ params: { condition: s } });
}
this.LoadPeriod(this.opStatus);
@ -1634,7 +1693,11 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
this.panelFee.storeChFeeGain.load({ params: { bsno: data.BSNO, optype: "op_other" } });
this.storeBodyList.load({ params: { bsno: data.BSNO } });
} else {
this.setCanEdit();
}
else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
@ -1648,7 +1711,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
},
LoadCopyData: function (bsno, CopyFee) {
LoadCopyData: function (bsno, CopyFee,fen=false) {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOp_SuperVision_Truck/GetCopyData',
@ -1670,14 +1733,19 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
}
data = result.data;
//this.LoadInit(data);
if (fen) {
data.BILLTYPE = "分单";
}
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
this.opStatus = 'add';
var arrNewRecords = this.storePLList.add(data);
this.editRecord = arrNewRecords[0];
this.Editdata = data;
@ -1749,7 +1817,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
},
CopyNew: function (type) {
CopyNew: function (fen=false) {
var basicForm2 = this.formHead.getForm();
if (!basicForm2.isValid()) {
return;
@ -1833,7 +1901,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
//basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno, this.copyfee);
this.LoadCopyData(oldbsno, this.copyfee, fen);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
@ -1974,7 +2042,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
//var jsonBody = ConvertRecordsToJsonAll(this.bodyDel);
var data = this.formHead.getForm().getValues(false, false, false);
var data2 = this.formEdit.getForm().getValues(false, false, false);
@ -2049,7 +2117,8 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
@ -2151,7 +2220,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
var custno = _this.formHead.getForm().findField('CUSTNO');
custno.setReadOnly(false);
_this.GetFeeCustNoStatus();
;
;
} else {
if (data.RULEBLNO == '') {
var custno = _this.formHead.getForm().findField('CUSTNO');
@ -2200,7 +2269,8 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
});
},
LoadDefValue: function () {
this.storeDefValue.load({ params: { condition: "BSTYPE='综合业务'" },
this.storeDefValue.load({
params: { condition: "BSTYPE='综合业务'" },
callback: function (r, options, success) {
if (success) {
if (this.storeDefValue.getCount() > 0) {
@ -2229,7 +2299,8 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
},
LoadMustBe: function () {
this.storeMustBe.load({ params: { condition: "BSTYPE='综合业务'" },
this.storeMustBe.load({
params: { condition: "BSTYPE='综合业务'" },
callback: function (r, options, success) {
if (success) {
if (this.storeMustBe.getCount() > 0) {
@ -2321,7 +2392,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
}, //onDelDetailClick
BodyAfterEdit: function (editor, e, eOpts) {
//需要自己实现里面的事件
},
deleteDetail: function () {
@ -2354,7 +2425,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
//Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
@ -2370,7 +2441,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
Ext.MessageBox.hide();
},
scope: this
});
});
}
},
@ -2390,7 +2461,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
PrevRecord: function () {
var j = this.StoreList.indexOf(this.editRecord);
if (j == 0) {
Ext.Msg.show({ title:'警告', msg:'已经是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); //'警告', '已是最前一票'
Ext.Msg.show({ title: '警告', msg: '已经是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); //'警告', '已是最前一票'
return;
}
@ -2498,7 +2569,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
}
else return '';
},
SetHeadDate(data) {
if (data.CreateTime)
data.CreateTime = data.CreateTime.replace(" 00:00:00", "");
@ -2607,7 +2678,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
GetNewHBLNO() {
BSNO = this.editRecord.get('BSNO');
_this = this;
if (this.opStatus == 'add' ) {
if (this.opStatus == 'add') {
Ext.Msg.show({ title: '注意', msg: '请先保存业务信息后再打开其他模块!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} else {
Ext.Ajax.request({
@ -2640,7 +2711,16 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckEdit, Ext.Panel, {
});
}
}
});
});
}
}
, setCanEdit() {
var 主分单 = Ext.getCmp("BILLTYPE");
if (this.opStatus == 'add') {
主分单.readOnly = false;
} else {
主分单.readOnly = true;
}
}
});

@ -365,11 +365,19 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckIndex, Ext.Panel, {
store: this.storeList,
enableHdMenu: false,
region: 'center',
id: 'gridlist',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
columns: this.girdcolums,
plugins: [{
ptype: 'rowexpander',
rowBodyTpl: [
'<div id="{BSNO}">',
'</div>'
]
}],
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
@ -981,7 +989,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckIndex, Ext.Panel, {
this.InitGrid(this.girdcolums);
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
this.sqlcontext = " ACCDATE='" + mydatestr + "' ";
this.sqlcontext = " ACCDATE='" + mydatestr + "' and BILLTYPE='主单' ";
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext },
@ -994,6 +1002,14 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckIndex, Ext.Panel, {
}, this);
this.onRefreshSumClick(this.sqlcontext);
this.gridList.view.on('expandBody', function (rowNode, record, expandRow, eOpts) {
_this.displayInnerGrid(record.get('BSNO'), record.get('FENPIAO'));
});
this.gridList.view.on('collapsebody', function (rowNode, record, expandRow, eOpts) {
_this.destroyInnerGrid(record);
});
}, //end initUIComponents
InitGrid: function (grid) {
@ -1503,7 +1519,7 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckIndex, Ext.Panel, {
return '';
}
var sql = "";
var sql = " BILLTYPE='主单' ";
var MBLNO = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MBLNO, "MBLNO like '%" + MBLNO + "%'");
@ -1856,6 +1872,115 @@ Ext.extend(Shipping.MsOp_SuperVision_TruckIndex, Ext.Panel, {
return "";
}
}
//#region 分单Grid
,
displayInnerGrid: function (renderId, fenpiao) {
if (fenpiao == '0')
return;
var storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSuperVisionTruckModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOp_SuperVision_Truck/GetDataList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
var innerGrid = Ext.create('Ext.grid.Panel', {
store: storeBodyList,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
columns: [],
// columnLines: true,
// autoWidth: true,
// autoHeight: true,
frame: false,
renderTo: renderId
});
/////////////以下部分为获取存储的gridpanel显示样式
fengirdcolums = JSON.parse(JSON.stringify(this.girdcolums)) ;
var 分单号 = '';
var 主单号 = '';
fengirdcolums.forEach((item, index) => {
//alert(item.dataIndex);
if (item.dataIndex == "CUSTNO") item.hidden = true;
if (item.dataIndex == "HBLNO") {
分单号 = item;
}
if (item.dataIndex == "MBLNO") {
主单号 = item;
}
});
fengirdcolums.forEach((item, index) => {
//alert(item.dataIndex);
if (item.dataIndex == "HBLNO") {
item.dataIndex = 主单号.dataIndex;
item.header = 主单号.header;
}else
if (item.dataIndex == "MBLNO") {
item.dataIndex = 分单号.dataIndex;
item.header = 分单号.header;
}
});
innerGrid.reconfigure(storeBodyList, fengirdcolums);
innerGrid.columns[0] = new Ext.grid.RowNumberer();
////////////////////////////
//innerGrid.columns[0] = new Ext.grid.RowNumberer();
innerGrid.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcShipping/MsOp_SuperVision_Truck/Edit');
}, this);
storeBodyList.on('beforeload', function (store) {
var sql = " MASTERNO='" + renderId + "' AND BSNO<>'" + renderId + "'"
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
storeBodyList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " MASTERNO='" + renderId + "' AND BSNO<>'" + renderId + "'" } });
// innerGrid.getEl().swallowEvent([
// 'mousedown', 'mouseup', 'click',
// 'contextmenu', 'mouseover', 'mouseout',
// 'dblclick', 'mousemove'
// ]);
},
destroyInnerGrid: function (record) {
if (record.get('FENPIAO') == '0')
return;
var parent = document.getElementById(record.get('BSNO'));
var child = parent.firstChild;
while (child) {
child.parentNode.removeChild(child);
child = child.nextSibling;
}
}
//#endregion
});

@ -183,6 +183,8 @@ Ext.define('MsOpSuperVisionTruckModel', {
{ name: 'REMARK', type: 'string' },
{ name: 'TimeMark', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }
,{ name: 'FENPIAO', type: 'number' }
]
});

Loading…
Cancel
Save