From 71d14d121f90de2f586ad6f4632c71c86548671e Mon Sep 17 00:00:00 2001 From: dengyu Date: Fri, 15 Dec 2023 09:06:03 +0800 Subject: [PATCH] 20231215 --- .../Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js | 1268 ++++++++++------- .../Controllers/MsOpSeaeEdiController.cs | 4 +- .../DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs | 21 +- 3 files changed, 756 insertions(+), 537 deletions(-) diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js index f8d518b8..5177054a 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js @@ -1,4 +1,4 @@ -Ext.namespace('Shipping'); +Ext.namespace('Shipping'); Shipping.MsChInvoiceAppEdit = function (config) { Ext.applyIf(this, config); @@ -33,13 +33,13 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'MsFeeOP', proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' } }); - this.StoreLockOp.load({ params: { optype: "modInvLock"} }); + this.StoreLockOp.load({ params: { optype: "modInvLock" } }); this.StoreUnLockOp = Ext.create('DsExt.ux.RefTableStore', { model: 'MsFeeOP', proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' } }); - this.StoreUnLockOp.load({ params: { optype: "modInvUnLock"} }); + this.StoreUnLockOp.load({ params: { optype: "modInvUnLock" } }); this.storeMustBe = Ext.create('Ext.data.Store', { model: 'DsShipping.ux.OpDefValue', @@ -72,7 +72,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { proxy: { url: '/CommMng/BasicDataRef/GetCustomInvRefList' } }); - this.storeCustCode.load({ params: { condition: ""} }); + this.storeCustCode.load({ params: { condition: "" } }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '开票单位', store: this.storeCustCode, @@ -104,7 +104,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { CUSTADDRTEL.setValue(data.INVADDRTEL); if (CURR == 'RMB') { - this.storecustbank.load({ params: { condition: " CURRENCY='RMB' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, + this.storecustbank.load({ + params: { condition: " CURRENCY='RMB' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -115,7 +116,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { scope: this }); } else if (CURR == 'USD') { - this.storecustbank.load({ params: { condition: " CURRENCY='USD' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, + this.storecustbank.load({ + params: { condition: " CURRENCY='USD' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -153,7 +155,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { proxy: { url: '/CommMng/BasicDataRef/GetCustomInvRefList' } }); - this.storeInvCustCode.load({ params: { condition: ""} }); + this.storeInvCustCode.load({ params: { condition: "" } }); this.comboxInvCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '代开客户', @@ -184,7 +186,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { else CUSTADDRTEL.setValue(data.INVADDRTEL); if (CURR == 'RMB') { - this.storecustbank.load({ params: { condition: " CURRENCY='RMB' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, + this.storecustbank.load({ + params: { condition: " CURRENCY='RMB' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -195,7 +198,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { scope: this }); } else if (CURR == 'USD') { - this.storecustbank.load({ params: { condition: " CURRENCY='USD' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, + this.storecustbank.load({ + params: { condition: " CURRENCY='USD' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + records[0].data.CustName + "')" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -228,7 +232,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'MsFeeCurr', proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' } }); - this.StoreCurr.load({ params: { condition: ""} }); + this.StoreCurr.load({ params: { condition: "" } }); this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', { @@ -292,7 +296,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'MsFeeCurr', proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' } }); - this.StoreCurr2.load({ params: { condition: ""} }); + this.StoreCurr2.load({ params: { condition: "" } }); this.comboxCurr2 = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '发票币别', @@ -352,6 +356,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } }); + this.storecustbank = Ext.create('DsExt.ux.RefTableStore', { model: 'MsInfoClientBankModel', proxy: { url: '/MvcShipping/MsInfoClient/GetBankList' } @@ -373,7 +378,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'DsExtEnumModel', proxy: { url: '/CommMng/PubSys/GetEnumValueList' } }); - this.storeInvCategory.load({ params: { enumTypeId: 97008} }); + this.storeInvCategory.load({ params: { enumTypeId: 97008 } }); this.comboxInvCategory = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '类型', @@ -389,13 +394,13 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'MsChInvoiceNo', proxy: { url: '/Account/Chfee_invoice/GetInvoiceNo' } }); - this.StoreInvNo.load({ params: { condition: ""} }); + this.StoreInvNo.load({ params: { condition: "" } }); this.comboxInvNo = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreInvNo, fieldLabel: '发票号', - allowBlank: false, + //allowBlank: false, flex: 2, name: 'INVOICENO', valueField: 'INVNO', @@ -406,7 +411,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'MsCompanysEntity', proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' } }); - this.storeSaleCompany.load({ params: { condition: ""} }); + this.storeSaleCompany.load({ params: { condition: "" } }); this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '所属分部', //'委托分公司', @@ -464,35 +469,35 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, items: [ - {//fieldset 1 - xtype: 'fieldset', - defaultType: 'textfield', - layout: 'anchor', - defaults: { - anchor: '100%' - }, - items: [{ - xtype: 'container', - layout: 'hbox', + {//fieldset 1 + xtype: 'fieldset', defaultType: 'textfield', + layout: 'anchor', + defaults: { + anchor: '100%' + }, items: [{ - fieldLabel: 'GID', - name: 'GID', flex: 0, hidden: true, margins: '0' - }, { - fieldLabel: 'BILLSTATUS', - name: 'BILLSTATUS', flex: 0, hidden: true, margins: '0' + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: 'GID', + name: 'GID', flex: 0, hidden: true, margins: '0' + }, { + fieldLabel: 'BILLSTATUS', + name: 'BILLSTATUS', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'DZSTATUS', name: 'DZSTATUS', flex: 0, hidden: true, margins: '0' }, { - fieldLabel: 'VOUCHERNO', - name: 'VOUCHERNO', flex: 0, hidden: true, margins: '0' - }, { - fieldLabel: 'VOUNO', - name: 'VOUNO', flex: 0, hidden: true, margins: '0' - }, { - fieldLabel: 'APPLICANT', - name: 'APPLICANT', flex: 0, hidden: true, margins: '0' + fieldLabel: 'VOUCHERNO', + name: 'VOUCHERNO', flex: 0, hidden: true, margins: '0' + }, { + fieldLabel: 'VOUNO', + name: 'VOUNO', flex: 0, hidden: true, margins: '0' + }, { + fieldLabel: 'APPLICANT', + name: 'APPLICANT', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'CREATEUSER', @@ -508,273 +513,273 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { hidden: true, margins: '0' }, { - fieldLabel: 'OPERATOR', - name: 'OPERATOR', flex: 0, hidden: true, margins: '0' - }, { - fieldLabel: 'COMPANYID', - name: 'COMPANYID', flex: 0, hidden: true, margins: '0' - }, { - fieldLabel: 'INVOICETYPE', - value: '2', - name: 'INVOICETYPE', flex: 0, hidden: true, margins: '0' + fieldLabel: 'OPERATOR', + name: 'OPERATOR', flex: 0, hidden: true, margins: '0' + }, { + fieldLabel: 'COMPANYID', + name: 'COMPANYID', flex: 0, hidden: true, margins: '0' + }, { + fieldLabel: 'INVOICETYPE', + value: '2', + name: 'INVOICETYPE', flex: 0, hidden: true, margins: '0' + }, + { + fieldLabel: '编号', + readOnly: true, + hidden: true, + flex: 2, + name: 'BILLNO' + }, + { + fieldLabel: '发票类别', + readOnly: true, + flex: 2, + name: 'INVOICETYPEREF' + }, this.comboxInvNo, { + fieldLabel: '开票日期', + flex: 2, + format: 'Y-m-d', + xtype: 'datefield', + name: 'INVOICEMAKETIME' + }, + { + fieldLabel: '开票人', + flex: 2, + readOnly: true, + name: 'OPERATORNAME' + }, + { + fieldLabel: '是否锁定', + flex: 1, + readOnly: true, + name: 'BILLSTATUSREF' + }, + { + fieldLabel: '是否打印', + flex: 1, + readOnly: true, + name: 'ISNEEDPRINT' + }, + { + fieldLabel: '是否结算', + flex: 1, + readOnly: true, + name: 'ISNEEDFEE' + }, + { + fieldLabel: '是否作废', + flex: 1, + readOnly: true, + name: 'ISDELETE' + } + ] + } + ]//end items(fieldset 1) + }, //end fieldset 1 + + { + xtype: 'fieldset', + defaultType: 'textfield', + layout: 'hbox', + defaults: { + anchor: '100%' }, - { - fieldLabel: '编号', - readOnly: true, - hidden: true, - flex: 2, - name: 'BILLNO' - }, - { - fieldLabel: '发票类别', - readOnly: true, - flex: 2, - name: 'INVOICETYPEREF' - }, this.comboxInvNo, { - fieldLabel: '开票日期', - flex: 2, - format: 'Y-m-d', - xtype: 'datefield', - name: 'INVOICEMAKETIME' - }, - { - fieldLabel: '开票人', - flex: 2, - readOnly: true, - name: 'OPERATORNAME' - }, - { - fieldLabel: '是否锁定', - flex: 1, - readOnly: true, - name: 'BILLSTATUSREF' - }, - { - fieldLabel: '是否打印', - flex: 1, - readOnly: true, - name: 'ISNEEDPRINT' - }, - { - fieldLabel: '是否结算', - flex: 1, - readOnly: true, - name: 'ISNEEDFEE' - }, - { - fieldLabel: '是否作废', - flex: 1, - readOnly: true, - name: 'ISDELETE' - } - ] + items: [{ + xtype: 'container', + layout: 'anchor', + flex: 3, + defaultType: 'textfield', + items: [ + { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: '发票抬头', + name: 'INVOICECUSTNAME' + }] + + }, { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: '纳税人识别号', + name: 'CUSTRATENO' + }] + + }, { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: '地址、电话', + name: 'CUSTADDRTEL' + }] + + }, { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: '客户开户行及账号', + labelWidth: 105, + name: 'CUSTBANK' + }] + + }, { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [this.comboxBANK] + + } + ] + }, { + xtype: 'fieldset', + defaultType: 'textfield', + flex: 5, + layout: 'anchor', + defaults: { + anchor: '100%' + }, + items: [{ + xtype: 'container', + layout: 'hbox', + flex: 1, + defaultType: 'textfield', + items: [this.comboxCurr, this.comboxInvCategory, this.comboxCurr2, this.comboxCustCode, this.comboxInvCustCode] + + }, { + xtype: 'container', + layout: 'hbox', + flex: 1, + defaultType: 'textfield', + items: [{ + fieldLabel: '实际金额', + labelWidth: 60, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + var lsValue = usMoney(value, 2, '', false); + if (lsValue != "NaN") { + value = lsValue; if (parseFloat(lsValue) < 0) { + return '' + lsValue + ''; + } + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + }, + name: 'AMOUNT' + }, { + fieldLabel: '开票金额', + labelWidth: 60, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + var lsValue = usMoney(value, 2, '', false); + if (lsValue != "NaN") { + value = lsValue; if (parseFloat(lsValue) < 0) { + return '' + lsValue + ''; + } + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + }, + name: 'INVAMOUNT' + }, { + fieldLabel: '开票税率', + labelWidth: 60, + name: 'EXCHANGERATE', + listeners: { + scope: this, + blur: function (field, The, eOpts) { + _this.ChangeInvRate(field.value); + + } + } + }, { + fieldLabel: '外币金额', + labelWidth: 60, + flex: 1.5, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + var lsValue = usMoney(value, 2, '', false); + if (lsValue != "NaN") { + value = lsValue; if (parseFloat(lsValue) < 0) { + return '' + lsValue + ''; + } + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + }, + name: 'OTCURRAMOUNT' + }, this.comboxSaleCompany] + + } + + , { + xtype: 'container', + layout: 'hbox', + flex: 2, + defaultType: 'textfield', + items: [{ + xtype: 'textareafield', + grow: true, + labelWidth: 60, + name: 'REMARK', + fieldLabel: '备注', + anchor: '100%' + }, { + xtype: 'fieldset', + defaultType: 'textfield', + layout: 'anchor', + region: 'east', + width: 80, + defaults: { + anchor: '100%' + }, + items: [{ + xtype: 'button', + text: "提取备注", + handler: function (button, event) { + this.ImportRemarks(); + }, + scope: this + }, { + xtype: 'button', + text: "模板设置", + handler: function (button, event) { + + this.SetRemarksTemplate(); + }, + scope: this + }] + }] + + } + + + ] + } + ]//end items(fieldset 2) } - ]//end items(fieldset 1) - }, //end fieldset 1 - - { - xtype: 'fieldset', - defaultType: 'textfield', - layout: 'hbox', - defaults: { - anchor: '100%' - }, - items: [{ - xtype: 'container', - layout: 'anchor', - flex: 3, - defaultType: 'textfield', - items: [ - { - xtype: 'container', - layout: 'hbox', - defaultType: 'textfield', - items: [{ - fieldLabel: '发票抬头', - name: 'INVOICECUSTNAME' - }] - - }, { - xtype: 'container', - layout: 'hbox', - defaultType: 'textfield', - items: [{ - fieldLabel: '纳税人识别号', - name: 'CUSTRATENO' - }] - - }, { - xtype: 'container', - layout: 'hbox', - defaultType: 'textfield', - items: [{ - fieldLabel: '地址、电话', - name: 'CUSTADDRTEL' - }] - - }, { - xtype: 'container', - layout: 'hbox', - defaultType: 'textfield', - items: [{ - fieldLabel: '客户开户行及账号', - labelWidth: 105, - name: 'CUSTBANK' - }] - - }, { - xtype: 'container', - layout: 'hbox', - defaultType: 'textfield', - items: [this.comboxBANK] - - } - ] - }, { - xtype: 'fieldset', - defaultType: 'textfield', - flex: 5, - layout: 'anchor', - defaults: { - anchor: '100%' - }, - items: [{ - xtype: 'container', - layout: 'hbox', - flex: 1, - defaultType: 'textfield', - items: [this.comboxCurr, this.comboxInvCategory, this.comboxCurr2, this.comboxCustCode, this.comboxInvCustCode] - - }, { - xtype: 'container', - layout: 'hbox', - flex: 1, - defaultType: 'textfield', - items: [{ - fieldLabel: '实际金额', - labelWidth: 60, - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { - try { - var lsValue = usMoney(value, 2, '', false); - if (lsValue != "NaN") { - value = lsValue; if (parseFloat(lsValue) < 0) { - return '' + lsValue + ''; - } - } - else { - return value; - } - } - catch (e) { - return value; - } - return value; - }, - name: 'AMOUNT' - }, { - fieldLabel: '开票金额', - labelWidth: 60, - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { - try { - var lsValue = usMoney(value, 2, '', false); - if (lsValue != "NaN") { - value = lsValue; if (parseFloat(lsValue) < 0) { - return '' + lsValue + ''; - } - } - else { - return value; - } - } - catch (e) { - return value; - } - return value; - }, - name: 'INVAMOUNT' - }, { - fieldLabel: '开票税率', - labelWidth: 60, - name: 'EXCHANGERATE', - listeners: { - scope: this, - blur: function (field, The, eOpts) { - _this.ChangeInvRate(field.value); - - } - } - }, { - fieldLabel: '外币金额', - labelWidth: 60, - flex: 1.5, - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { - try { - var lsValue = usMoney(value, 2, '', false); - if (lsValue != "NaN") { - value = lsValue; if (parseFloat(lsValue) < 0) { - return '' + lsValue + ''; - } - } - else { - return value; - } - } - catch (e) { - return value; - } - return value; - }, - name: 'OTCURRAMOUNT' - }, this.comboxSaleCompany] - - } - - , { - xtype: 'container', - layout: 'hbox', - flex: 2, - defaultType: 'textfield', - items: [{ - xtype: 'textareafield', - grow: true, - labelWidth: 60, - name: 'REMARK', - fieldLabel: '备注', - anchor: '100%' - }, { - xtype: 'fieldset', - defaultType: 'textfield', - layout: 'anchor', - region: 'east', - width: 80, - defaults: { - anchor: '100%' - }, - items: [{ - xtype: 'button', - text: "提取备注", - handler: function (button, event) { - this.ImportRemarks(); - }, - scope: this - }, { - xtype: 'button', - text: "模板设置", - handler: function (button, event) { - - this.SetRemarksTemplate(); - }, - scope: this - }] - }] - - } - - - ] - } - ]//end items(fieldset 2) - } ]//end root items @@ -793,31 +798,31 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { this.panelBtn = new Ext.Panel({ region: "north", tbar: [ - { - id: 'btnEPrev', - text: "上一票", //"上一票", - // iconCls: "btnsave", - handler: function (button, event) { - this.PrevRecord(); - }, - scope: this - }, { - id: 'btnENext', - text: "下一票", //"下一票", - // iconCls: "btnsave", - handler: function (button, event) { - this.NextRecord(); - }, - scope: this - }, { - id: 'btnESave', - text: "保存", - iconCls: "btnsave", - handler: function (button, event) { - this.Save('0'); - }, - scope: this - }, '-', + { + id: 'btnEPrev', + text: "上一票", //"上一票", + // iconCls: "btnsave", + handler: function (button, event) { + this.PrevRecord(); + }, + scope: this + }, { + id: 'btnENext', + text: "下一票", //"下一票", + // iconCls: "btnsave", + handler: function (button, event) { + this.NextRecord(); + }, + scope: this + }, { + id: 'btnESave', + text: "保存", + iconCls: "btnsave", + handler: function (button, event) { + this.Save('0'); + }, + scope: this + }, '-', { text: "打印", handler: function (button, event) { @@ -904,7 +909,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { model: 'MsCodeGoodInv', proxy: { url: '/MvcShipping/MsCodeGoodInv/GetDataList' } }); - this.StoreCodeGoodInv.load({ params: { condition: "" } + this.StoreCodeGoodInv.load({ + params: { condition: "" } }); this.comboxCodeGoodInv = Ext.create('DsExt.ux.RefTableCombox', { @@ -1056,12 +1062,12 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { return value; } return value; - }, - summaryType: 'sum', - summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { - value = usMoney(value, 2, '', true); - return value; - }, + }, + summaryType: 'sum', + summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + value = usMoney(value, 2, '', true); + return value; + }, width: 80 }, { sortable: false, @@ -1195,26 +1201,26 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, items: [ - {//fieldset 1 - xtype: 'fieldset', - defaultType: 'textfield', - layout: 'anchor', - defaults: { - anchor: '100%' - }, - items: [{ - xtype: 'container', - layout: 'hbox', + {//fieldset 1 + xtype: 'fieldset', defaultType: 'textfield', + layout: 'anchor', + defaults: { + anchor: '100%' + }, items: [{ - fieldLabel: '金额合计(大写)', - readOnly: true, - name: 'AMOUNTCAPITAL' - } - ]//end items(fieldset 1) - }//end fieldset 1 - ]//end root items - }] + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: '金额合计(大写)', + readOnly: true, + name: 'AMOUNTCAPITAL' + } + ]//end items(fieldset 1) + }//end fieldset 1 + ]//end root items + }] }); //end this.formEdit @@ -1284,7 +1290,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { width: 100 }, { sortable: true, - dataIndex: 'ETD',//'ETD' + dataIndex: 'ETD', header: '开船日期', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 100 @@ -1385,12 +1391,12 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { dataIndex: 'PORTDISCHARGE', header: '卸货港', width: 120 - }, { - sortable: false, - dataIndex: 'ACCDATE', - header: '会计期间', - width: 60 - } + }, { + sortable: false, + dataIndex: 'ACCDATE', + header: '会计期间', + width: 60 + } ] }); @@ -1584,12 +1590,12 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { dataIndex: 'APPLICANTNAME', header: '申请人', width: 100 - }, { - sortable: true, - dataIndex: 'OPERATETIME', - header: '申请时间', - width: 100 - }, { + }, { + sortable: true, + dataIndex: 'OPERATETIME', + header: '申请时间', + width: 100 + }, { sortable: false, dataIndex: 'INVOICENO', header: '发票号', @@ -1759,22 +1765,22 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { dataIndex: 'APPLICANTNAME', header: '申请人', width: 100 - }, { - sortable: true, - dataIndex: 'OPERATETIME', - header: '申请时间', - width: 100 - }, { - sortable: true, - dataIndex: 'APPLICANTDEPT', - header: '所属部门', - width: 100 - }, { - sortable: true, - dataIndex: 'PAYCOMPANYREF', - header: '所属分部', - width: 100 - }, { + }, { + sortable: true, + dataIndex: 'OPERATETIME', + header: '申请时间', + width: 100 + }, { + sortable: true, + dataIndex: 'APPLICANTDEPT', + header: '所属部门', + width: 100 + }, { + sortable: true, + dataIndex: 'PAYCOMPANYREF', + header: '所属分部', + width: 100 + }, { sortable: true, dataIndex: 'INVOICENO', header: '发票号', @@ -1784,13 +1790,13 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { dataIndex: 'REMARK', header: '备注', width: 160 - }, { - sortable: true, - dataIndex: 'SHENREMARK', - header: '开票要求', - width: 160 - } - ]; + }, { + sortable: true, + dataIndex: 'SHENREMARK', + header: '开票要求', + width: 160 + } + ]; this.girdbilladdcolums = this.initgirdbilladdcolums; //使用者id,表名,中间column数组,跳过一开始的几列 this.gridAddFeeList = new Ext.grid.GridPanel({ store: this.storeAddFeeList, @@ -1818,15 +1824,17 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { text: "保存列表样式", id: "btntest", menu: [ - { text: "保存", - handler: function (button, event) { - _this.girdbilladdcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'billadd', _this.gridAddFeeList.columns, _this.girdbilladdcolums, 1, true); - } - }, { text: "初始化", - handler: function (menu, event) { - _this.girdbilladdcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'billadd', _this.gridAddFeeList.columns, _this.initgirdbilladdcolums, 1, true); - } - }], + { + text: "保存", + handler: function (button, event) { + _this.girdbilladdcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'billadd', _this.gridAddFeeList.columns, _this.girdbilladdcolums, 1, true); + } + }, { + text: "初始化", + handler: function (menu, event) { + _this.girdbilladdcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'billadd', _this.gridAddFeeList.columns, _this.initgirdbilladdcolums, 1, true); + } + }], scope: this }], columns: this.girdbilladdcolums, @@ -1909,7 +1917,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { width: 100 }, { sortable: true, - dataIndex: 'ETD',//'ETD' + dataIndex: 'ETD', header: '开船日期', renderer: Ext.util.Format.dateRenderer('Y-m-d'), width: 100 @@ -1977,12 +1985,12 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } return value; } - }, { - sortable: true, - dataIndex: 'EXCHANGERATE', - header: '折算汇率', - width: 80 - }, { + }, { + sortable: true, + dataIndex: 'EXCHANGERATE', + header: '折算汇率', + width: 80 + }, { sortable: true, dataIndex: 'AUDITDATE', header: '审核日期', @@ -2091,7 +2099,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, { fieldLabel: '编号', name: 'MblNo' - }, this.comboxAddCustCode, { + }, this.comboxAddCustCode, { fieldLabel: '从申请日期', format: 'Y-m-d', labelWidth: 80, @@ -2103,7 +2111,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { labelWidth: 80, xtype: 'datefield', name: 'ExpDateEnd' - }, this.comboxAPPLICANT,this.comboxInvCategory, { + }, this.comboxAPPLICANT, this.comboxInvCategory, { xtype: 'button', width: 60, text: "查询", @@ -2112,27 +2120,27 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { this.onRefreshClick(button, event); }, scope: this - }, { - xtype: 'button', - width: 45, - text: "", - iconCls: "btnmore", - handler: function (button, event) { - var sql = this.getCondition(); - var winAccess = new Shipping.DsQuery({ + }, { + xtype: 'button', + width: 45, + text: "", + iconCls: "btnmore", + handler: function (button, event) { + var sql = this.getCondition(); + var winAccess = new Shipping.DsQuery({ - }); - winAccess.StoreList = this.storeList; - winAccess.formname = this.formname; - winAccess.condition = sql; - winAccess.show(); - return; + }); + winAccess.StoreList = this.storeList; + winAccess.formname = this.formname; + winAccess.condition = sql; + winAccess.show(); + return; - }, - scope: this - } - ] + }, + scope: this + } + ] } ]//end items(fieldset 1) }//end fieldset 1 @@ -2229,7 +2237,121 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { //#endregion 明细表 + //#region 附件上传 + + + + this.storeChfeeFile = Ext.create('Ext.data.Store', { + model: 'FeeFileModel', + remoteSort: false, + proxy: { + type: 'ajax', + url: '/Account/Chfee_payapplication/GetFileList', + reader: { + id: 'GID', + root: 'data', + totalProperty: 'totalCount' + } + } + }); + //表格 + this.FeeFileColumns = [ + { + sortable: true, hidden: true, + dataIndex: 'GID', readOnly: true, + header: 'GID', + width: 80 + }, { + sortable: true, hidden: false, + dataIndex: 'File_OriginalName', readOnly: true, + header: '文件名称', //文件名称 + renderer: function (value, p, record) { + return '' + value + ''; + }, + width: 180 + }, { + sortable: true, hidden: false, + dataIndex: 'UpdateTime', readOnly: true, + header: '上传日期', //上传日期 + width: 80 + }, { + sortable: true, hidden: false, + dataIndex: 'Operator', readOnly: true, + header: '上传者', //上传者 + width: 80 + }, { + sortable: true, hidden: true, + dataIndex: 'File_Name', readOnly: true, + header: '文件物理名称', //文件物理名称 + width: 80 + }, + { + sortable: true, hidden: true, + dataIndex: 'File_Path', + header: 'File_Path', + width: 80 + }, { + xtype: 'actioncolumn', + width: 50, + text: '操作', //操作 + items: [{ + icon: '/images/icons/btnSearch.gif', // Use a URL in the icon config + tooltip: '预览', + handler: function (grid, rowIndex, colIndex) { + var rec = grid.getStore().getAt(rowIndex); + var filePath = "/Areas/Account/Files/" + rec.get('BillNo') + '/' + rec.get('File_Name') + '?a=' + Math.random(); + var imgView = new Shipping.FileView({ filePath: filePath }); + imgView.show(); + } + }] + } + ]; + var selCertModel = Ext.create('Ext.selection.CheckboxModel'); + this.fileGrid = new Ext.grid.GridPanel({ + store: this.storeChfeeFile, + enableHdMenu: false, + layout: 'border', + region: 'center', + loadMask: { msg: '数据加载中,请稍等...' }, //数据加载中,请稍等... + trackMouseOver: true, + disableSelection: false, + selModel: selCertModel, + singleSelect: true, + selType: 'rowmodel', + tbar: [{ + text: '上传图片', //上传图片 + tooltip: '上传文件', + iconCls: "btnadddetail", + handler: function (button, event) { + this.onAddFileClick(button, event); + }, + scope: this + }, '-', { + text: '删除图片', //删除 + tooltip: '删除文件', //删除图片 + iconCls: "btndeletedetail", + handler: function (button, event) { + this.onDelFileClick(button, event); + }, + scope: this + }], + columns: this.FeeFileColumns + }); + //#endregion附件上传 + + //#region 增加附件上传tab + + this.page_2 = new Ext.Panel({ + id: "page_2", + title: '附件上传', //附件上传 + autoScroll: true, + layout: "border", + region: 'center', + //closable:true, + items: [this.fileGrid] + }); + //#endregion //#region 布局 //控件布局 @@ -2256,22 +2378,23 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }); this.tabpanel = new Ext.TabPanel - ({ - activeTab: 0, - autoWidth: true, - border: false, - frame: false, - height: 280, - region: 'north', - id: "TabPanelID", - enableTabScroll: true, - split: true, - items: - [ - this.panelInv, - this.panelBody - ] - }); + ({ + activeTab: 0, + autoWidth: true, + border: false, + frame: false, + height: 280, + region: 'north', + id: "TabPanelID", + enableTabScroll: true, + split: true, + items: + [ + this.panelInv, + this.panelBody, + this.page_2 + ] + }); Ext.apply(this, { @@ -2335,7 +2458,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { var sql = ""; sql = " BILLNO='" + bsno + "'"; isloadfee = false; - this.storeAddBodyList.load({ params: { condition: sql }, + this.storeAddBodyList.load({ + params: { condition: sql }, callback: function (r, options, success) { if (success) { isloadfee = true; @@ -2494,7 +2618,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { if (this.opStatus == 'copyadd') this.CopyNewData(); - this.StoreInvNo.load({ params: { condition: "" }, + this.StoreInvNo.load({ + params: { condition: "" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -2511,6 +2636,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } } }); + this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: data.BILLNO } }); // _this.formEdit.getForm().findField('BILLSTATUS').setDisabled(true); _this.GetEditStatus(); } else { @@ -2530,7 +2656,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }; - this.storeBodyList.load({ params: { condition: " BILLNO='" + billno + "'" }, + this.storeBodyList.load({ + params: { condition: " BILLNO='" + billno + "'" }, callback: function (r, options, success) { if (success) { if (this.storeBodyList.getCount() > 0) { @@ -2545,9 +2672,9 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, scope: this }); - this.storeBodySum.load({ params: { condition: " BILLNO='" + billno + "'"} }); - this.storeDetailList.load({ params: { condition: " PID='" + GID + "'"} }); - this.storeBodyAppList.load({ params: { condition: "INVBILLNO='" + billno + "'"} }); + this.storeBodySum.load({ params: { condition: " BILLNO='" + billno + "'" } }); + this.storeDetailList.load({ params: { condition: " PID='" + GID + "'" } }); + this.storeBodyAppList.load({ params: { condition: "INVBILLNO='" + billno + "'" } }); this.onRefreshClick(); }, // end LoadDate @@ -2614,7 +2741,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } if (type == '0') { this.opStatus = 'edit'; - this.storeDetailList.load({ params: { condition: " PID='" + GID + "'"} }); + this.storeDetailList.load({ params: { condition: " PID='" + GID + "'" } }); } else if (type == '1') { @@ -2627,7 +2754,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, 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 }); @@ -3172,14 +3300,14 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { _this.addDetail(); } else { var sql = this.BillSql; - this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql} }); + this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql } }); Ext.Msg.show({ title: '提示', msg: '已生成发票,没有需要添加的发票申请!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); - return; - + return; + } } else { var sql = this.BillSql; - this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql} }); + this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql } }); Ext.Msg.show({ title: '提示', msg: '已生成发票,没有需要添加的发票申请!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } @@ -3240,7 +3368,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { else CUSTADDRTEL.setValue(data.INVADDRTEL); if (RECVCURR == 'RMB') { - this.storecustbank.load({ params: { condition: " CURRENCY='RMB' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + cust + "')" }, + this.storecustbank.load({ + params: { condition: " CURRENCY='RMB' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + cust + "')" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -3251,7 +3380,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { scope: this }); } else if (RECVCURR == 'USD') { - this.storecustbank.load({ params: { condition: " CURRENCY='USD' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + cust + "')" }, + this.storecustbank.load({ + params: { condition: " CURRENCY='USD' AND LINKID=(SELECT TOP 1 GID FROM INFO_CLIENT WHERE SHORTNAME='" + cust + "')" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { @@ -3374,7 +3504,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { this.editRecord.commit(); } this.opStatus = 'edit'; - this.storeDetailList.load({ params: { condition: " PID='" + GID + "'"} }); + this.storeDetailList.load({ params: { condition: " PID='" + GID + "'" } }); _this.addDetailfn(); } else { @@ -3383,7 +3513,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } } else { btnEAddDetail.enable(); - Ext.Msg.show({ title: '请重试', + Ext.Msg.show({ + title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); @@ -3515,11 +3646,12 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { var sql = this.BillSql; -// this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql} }); + // this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql} }); this.storeAddFeeList.reload(); - _this.storeBodyList.load({ params: { condition: " BILLNO='" + billno + "'" }, + _this.storeBodyList.load({ + params: { condition: " BILLNO='" + billno + "'" }, callback: function (r, options, success) { if (success) { if (_this.storeBodyList.getCount() > 0) { @@ -3535,10 +3667,10 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { scope: this }); - this.storeDetailList.load({ params: { condition: " PID='" + GID + "'"} }); - this.storeBodyAppList.load({ params: { condition: "INVBILLNO='" + billno + "'"} }); + this.storeDetailList.load({ params: { condition: " PID='" + GID + "'" } }); + this.storeBodyAppList.load({ params: { condition: "INVBILLNO='" + billno + "'" } }); - this.storeBodySum.load({ params: { condition: " BILLNO='" + billno + "'"} }); + this.storeBodySum.load({ params: { condition: " BILLNO='" + billno + "'" } }); Ext.Ajax.request({ waitMsg: '正在查询主表数据...', @@ -3675,8 +3807,9 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } else { var sql = this.BillSql; - this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql} }); - _this.storeBodyList.load({ params: { condition: " BILLNO='" + billno + "'" }, + this.storeAddFeeList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql } }); + _this.storeBodyList.load({ + params: { condition: " BILLNO='" + billno + "'" }, callback: function (r, options, success) { if (success) { if (_this.storeBodyList.getCount() > 0) { @@ -3691,8 +3824,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, scope: this }); - this.storeBodySum.load({ params: { condition: " BILLNO='" + billno + "'"} }); - this.storeBodyAppList.load({ params: { condition: "INVBILLNO='" + billno + "'"} }); + this.storeBodySum.load({ params: { condition: " BILLNO='" + billno + "'" } }); + this.storeBodyAppList.load({ params: { condition: "INVBILLNO='" + billno + "'" } }); Ext.Ajax.request({ waitMsg: '正在查询主表数据...', @@ -4336,45 +4469,45 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, -// ImportRemarks: function () { - -// var billno = this.formEdit.getForm().findField('BILLNO').getValue(); -// if (billno == '*') { -// Ext.Msg.show({ title: '提示', msg: '请先保存付费结算,然后才能撤销锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); -// return; -// }; -// Ext.Ajax.request({ -// waitMsg: '正在查询主表数据...', -// url: '/Account/Chfee_invoice/GetRemarksData', -// params: { -// billno: billno -// }, -// callback: function (options, success, response) { -// if (success) { -// var result = Ext.JSON.decode(response.responseText); -// if (!result.Success) { -// Ext.Msg.show({ -// title: '提示', -// msg: result.Message, -// icon: Ext.MessageBox.ERROR, -// buttons: Ext.Msg.OK -// }); -// return; -// } - -// var data = result.Data; - -// var REMARK = this.formEdit.getForm().findField('REMARK').getValue(); -// this.formEdit.getForm().findField('REMARK').setValue(REMARK + ' ' + data); - - -// } else { -// Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); -// } -// }, -// scope: this -// }); -// }, + // ImportRemarks: function () { + + // var billno = this.formEdit.getForm().findField('BILLNO').getValue(); + // if (billno == '*') { + // Ext.Msg.show({ title: '提示', msg: '请先保存付费结算,然后才能撤销锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + // return; + // }; + // Ext.Ajax.request({ + // waitMsg: '正在查询主表数据...', + // url: '/Account/Chfee_invoice/GetRemarksData', + // params: { + // billno: billno + // }, + // callback: function (options, success, response) { + // if (success) { + // var result = Ext.JSON.decode(response.responseText); + // if (!result.Success) { + // Ext.Msg.show({ + // title: '提示', + // msg: result.Message, + // icon: Ext.MessageBox.ERROR, + // buttons: Ext.Msg.OK + // }); + // return; + // } + + // var data = result.Data; + + // var REMARK = this.formEdit.getForm().findField('REMARK').getValue(); + // this.formEdit.getForm().findField('REMARK').setValue(REMARK + ' ' + data); + + + // } else { + // Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); + // } + // }, + // scope: this + // }); + // }, ImportRemarks: function () { @@ -4385,6 +4518,9 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { return; }; + this.StoreInvTemplete = Ext.create('DsExt.ux.RefEnumStore', {}); + this.StoreInvTemplete.load({ params: { enumTypeId: 83001 } }); + this.comboxInvTemplete = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '发票备注模板', store: this.StoreInvTemplete, @@ -4392,11 +4528,9 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { displayField: 'EnumValueName', forceSelection: true, name: 'TemplateName', - value: '发票备注', + value: '模板1', enableKeyEvents: true }); - - this.formRemarkShowGet = Ext.widget('form', { frame: true, title: '提取发票备注', @@ -4411,22 +4545,13 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { }, items: [ - { - xtype: 'radiogroup', - fieldLabel: "模板名称", //'文件功能', - name: 'TemplateName', - defaults: { flex: 1 }, - layout: 'hbox', - items: [ - this.comboxInvTemplete, - { - fieldLabel: '是否追加', //'是否改签', - inputValue: true, - xtype: 'checkboxfield', - name: 'ISZHUIJIA', - checked: true - } - + this.comboxInvTemplete, { + fieldLabel: '是否追加', //'是否改签', + inputValue: true, + xtype: 'checkboxfield', + name: 'ISZHUIJIA', + checked: true + } ]//end root items }); @@ -4523,6 +4648,14 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { StoreFieldName.add({ "OPLBNAME": "外币金额(总计)" }); StoreFieldName.add({ "OPLBNAME": "人民币金额(总计)" }); StoreFieldName.add({ "OPLBNAME": "折算汇率(总计)" }); + StoreFieldName.add({ "OPLBNAME": "购方银行" }); + StoreFieldName.add({ "OPLBNAME": "购方账号" }); + StoreFieldName.add({ "OPLBNAME": "销方银行" }); + StoreFieldName.add({ "OPLBNAME": "购方USD银行" }); + StoreFieldName.add({ "OPLBNAME": "购方USD账号" }); + StoreFieldName.add({ "OPLBNAME": "购方RMB银行" }); + StoreFieldName.add({ "OPLBNAME": "购方RMB账号" }); + var gridField = new Ext.grid.GridPanel({ store: StoreFieldName, @@ -4558,7 +4691,6 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { trackResetOnLoad: true, items: [gridField] }); - var StoreInvTemplete2 = Ext.create('DsExt.ux.RefEnumStore', {}); StoreInvTemplete2.load({ params: { enumTypeId: 83001 } }); @@ -4600,7 +4732,6 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } }); - var formRemarkShow = Ext.widget('form', { frame: true, title: '模板内容', @@ -4623,6 +4754,9 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { anchor: '100%' }, items: [{ + xtype: 'label', + html: "注意:请将明细部分用 《》 圈起来 例如:《[主提单号] [船名]》" + }, { xtype: 'textareafield', grow: true, height: 300, @@ -4739,7 +4873,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { onRefreshClick: function (button, event) { var sql = this.getCondition(); this.sqlcontext = sql; - this.storeAddFeeList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql} }); + this.storeAddFeeList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql } }); }, onDsQuery: function (button, event) { var sql = this.sqlcontext; @@ -4764,7 +4898,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { var APPLICANT = form.findField('APPLICANT').getValue(); sql = sql + getAndConSql(sql, APPLICANT, "APPLICANT='" + APPLICANT + "'"); - + var INVOICECATEGORY = form.findField('INVOICECATEGORY').getValue(); sql = sql + getAndConSql(sql, INVOICECATEGORY, "INVOICECATEGORY='" + INVOICECATEGORY + "'"); @@ -4865,7 +4999,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { text: afcurr, name: 'bfcurr2' } - ] + ] }, { xtype: 'container', layout: 'hbox', @@ -4915,7 +5049,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { text: bfcurr, name: 'afcurr2' } - ] + ] } ]//end items(fieldset 1) }//end fieldset 1 @@ -5099,7 +5233,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { //#region 必填字段 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) { @@ -5143,6 +5278,74 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { else return true; }, + //#region 文件上传 + + onAddFileClick: function () { + //var billstatus = this.formEdit.getForm().findField('BILLSTATUS').getValue(); + //if ((billstatus != 1) && (billstatus != 4)) { + // Ext.Msg.show({ title: '提示', msg: '当前状态无法添加附件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + // return; + //} + var BillNo = this.formEdit.getForm().findField('BILLNO').getValue(); + if (BillNo == '' || BillNo == '*') { + Ext.MessageBox.alert('提示', '请先生成申请编号!'); //提示', '请先生成申请编号! + return; + } + var winAccess = new Shipping.FileUpload({}); + winAccess.BillNo = BillNo; + winAccess.show(); + }, onDelFileClick: function () { + //var billstatus = this.formEdit.getForm().findField('BILLSTATUS').getValue(); + //if ((billstatus != 1) && (billstatus != 4)) { + // Ext.Msg.show({ title: '提示', msg: '当前状态无法删除附件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + // return; + //} + var selections = this.fileGrid.getSelectionModel().getSelection(); + if (selections.length == 0) {//提示', msg: '请先选择要删除的数据! + Ext.Msg.show({ title: '提示', msg: '请先选择要删除的数据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + var BillNo = this.formEdit.getForm().findField('BILLNO').getValue(); + + var record = new Array(); + for (var i = 0; i < selections.length; i++) { + record.push(selections[i].data); + } //提示', '确定删除该记录吗?' + Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) { + if (btn == 'yes') { + Ext.Msg.wait('正在删除数据...'); //正在删除数据 + Ext.Ajax.request({ + waitMsg: '正在删除数据...', + url: '/Account/Chfee_payapplication/CertDel', + params: { + data: Ext.JSON.encode(record) + }, + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + panelEdit.LoadData('edit', "BILLNO='" + BillNo + "'"); + Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + } //提示 + else { + Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); + } + } + }, + failure: function (response, options) {//'警告', msg: '服务器响应出错,请重试' + Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { + }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + }, + + //#endregion + + GetEditStatus: function () { var canedit = false; var op = this.formEdit.getForm().findField('OPERATORNAME').getValue(); @@ -5156,7 +5359,8 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { } else { - this.StoreOpRange.load({ params: { optype: "modInvoiceManagement" }, + this.StoreOpRange.load({ + params: { optype: "modInvoiceManagement" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeEdiController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeEdiController.cs index 6ed603f5..7bcc6cb2 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeEdiController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeEdiController.cs @@ -1470,7 +1470,7 @@ namespace DSWeb.MvcShipping.Controllers //增加费用 //20220530 改为只有成功时才生成费用 if (result.Success) - MsOpSeaeEdiDAL.MakeFee(headList, filetype, Convert.ToString(Session["USERID"])); + MsOpSeaeEdiDAL.MakeFee(headList, dcarrier, filetype, Convert.ToString(Session["USERID"])); return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } @@ -1749,7 +1749,7 @@ namespace DSWeb.MvcShipping.Controllers //增加费用 //分单 - MsOpSeaeEdiDAL.MakeFee(headList, filetype, Convert.ToString(Session["USERID"]), true); + MsOpSeaeEdiDAL.MakeFee(headList, dcarrier, filetype, Convert.ToString(Session["USERID"]), true); var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message, Data = result.Data }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs index 7cc07370..98e4930a 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeaeEdi/MsOpSeaeEdiDAL.cs @@ -11917,7 +11917,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL /// /// 业务编号 逗号隔开的文本 /// 修改类型 B:新增 E:修改 D:删除 - public static void MakeFee(List headlist, string filetype,string USERID, bool isfen = false) + public static void MakeFee(List headlist,string dcarrier, string filetype,string USERID, bool isfen = false) { var 已发单号list = new List(); @@ -11940,7 +11940,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL 已发单号list.Add(单号); } - var amount = pricehelper.getPrice(item.CARRIER, filetype, isfen); + var amount = pricehelper.getPrice(dcarrier, filetype, isfen); //var amount = 0M; //if (filetype == "B") @@ -11995,7 +11995,22 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL try { - + //Zi.LAN.CARRIER = "Carrier"; //"船公司"; + //Zi.LAN.CARRIER_COSU = "COSCO"; + //Zi.LAN.CARRIER_HaiFeng = "SITC"; + //Zi.LAN.CARRIER_HuaGang = "华港"; + //Zi.LAN.CARRIER_LianDai = "联代"; + //Zi.LAN.CARRIER_PX = "鹏信"; + //Zi.LAN.CARRIER_DongSheng = "东胜"; + //Zi.LAN.CARRIER_WaiDai = "外代"; + //Zi.LAN.CARRIER_WaiYun = "外运"; + //Zi.LAN.CARRIER_ZC = "正常"; + //Zi.LAN.CARRIER_ZhenHua = "振华"; + //Zi.LAN.CARRIER_ZhongChuang = "中创"; + //Zi.LAN.CARRIER_ZhongHaiQinggang = "中海(青港)"; + //Zi.LAN.CARRIER_ZhongHai = "中海"; + //Zi.LAN.CARRIER_ZhongTong = "中通"; + //Zi.LAN.CARRIER_ZhongYuan = "中远"; var _d = DetailList.First(x => x.EnumValueID == "其他"); if (DetailList.Exists(x => x.EnumValueID == carrier)) {