1 files added
5 files modified
| | |
| | | $this->ajaxReturn($ps->sobillTrackingList($params)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 报关 |
| | | */ |
| | | public function setDeclareData() |
| | | { |
| | | if (IS_POST) { |
| | | $json = I("post.jsonStr"); |
| | | $ps = new SOBillTrackingService(); |
| | | $this->ajaxReturn($ps->setDeclareData($json)); |
| | | } |
| | | } |
| | | } |
| | |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 报关 |
| | | * |
| | | * @param array $bill |
| | | * @return null|array |
| | | */ |
| | | public function setDeclareData(&$bill) |
| | | { |
| | | $db = $this->db; |
| | | |
| | | $id = $bill["sobill_tacking_id"]; |
| | | if(!empty($id)){ |
| | | $id = $this->newId(); |
| | | } |
| | | |
| | | $soBillId = $bill["soBillId"]; |
| | | $soBillDetailId = $bill["soBillDetailId"]; |
| | | $wsBillId = $bill["wsBillId"]; |
| | | $wsBillDetailId = $bill["wsBillDetailId"]; |
| | | $goodsId = $bill["goodsId"]; |
| | | $declareNo = $bill["declareNo"]; |
| | | $time = $bill["time"]; |
| | | if (!$this->dateIsValid($time)) { |
| | | return $this->bad("报关日期不正确"); |
| | | } |
| | | |
| | | $loginUserId = $bill["loginUserId"]; |
| | | if ($this->loginUserIdNotExists($loginUserId)) { |
| | | return $this->badParam("loginUserId"); |
| | | } |
| | | |
| | | // 保存订单跟踪信息 |
| | | $sql = "INSERT INTO t_so_bill_tracking ( |
| | | `id`, |
| | | `sobill_id`, |
| | | `sobill_detail_id`, |
| | | `wsbill_id`, |
| | | `wsbill_detail_id`, |
| | | `goods_id`, |
| | | `declare_no`, |
| | | `declare_time`, |
| | | `declare_user_id` |
| | | ) |
| | | VALUES |
| | | ('%s', '%s', '%s', '%s', '%s', '%s', |
| | | '%s', '%s', '%s') |
| | | ON duplicate KEY UPDATE |
| | | `goods_id`='%s', |
| | | `declare_no`='%s', |
| | | `declare_time`='%s', |
| | | `declare_user_id`='%s' |
| | | "; |
| | | $rc = $db->execute( |
| | | $sql, |
| | | $id, |
| | | $soBillId, |
| | | $soBillDetailId, |
| | | $wsBillId, |
| | | $wsBillDetailId, |
| | | $goodsId, |
| | | $declareNo, |
| | | $time, |
| | | $loginUserId, |
| | | $goodsId, |
| | | $declareNo, |
| | | $time, |
| | | $loginUserId |
| | | ); |
| | | if ($rc === false) { |
| | | return $this->sqlError(__METHOD__, __LINE__); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | return $dao->sobillTackingList($params); |
| | | } |
| | | |
| | | /** |
| | | * 报关 |
| | | */ |
| | | public function setDeclareData($json) |
| | | { |
| | | if ($this->isNotOnline()) { |
| | | return $this->notOnlineError(); |
| | | } |
| | | |
| | | $bill = json_decode(html_entity_decode($json), true); |
| | | if ($bill == null) { |
| | | return $this->bad("传入的参数错误,不是正确的JSON格式"); |
| | | } |
| | | |
| | | $db = $this->db(); |
| | | |
| | | $dao = new SOBillTrackingDAO($db); |
| | | |
| | | $log = null; |
| | | // 记录业务日志 |
| | | $bs = new BizlogService($db); |
| | | |
| | | foreach ($bill as $v) { |
| | | $v["loginUserId"] = $this->getLoginUserId(); |
| | | $rc = $dao->setDeclareData($v); |
| | | if ($rc) { |
| | | $log["failed"][$v["soBillNo"]] = "销售订单号:{$v["soBillNo"]}跟踪报关失败。"; |
| | | $bs->insertBizlog($log["failed"][$v["soBillNo"]], $this->LOG_CATEGORY); |
| | | }else{ |
| | | $log["success"][$v["soBillNo"]] = "销售订单号:{$v["soBillNo"]}跟踪报关成功。"; |
| | | $bs->insertBizlog($log["success"][$v["soBillNo"]], $this->LOG_CATEGORY); |
| | | } |
| | | } |
| | | |
| | | if(count($log["failed"]) > 0){ |
| | | return $this->bad($log); |
| | | }else{ |
| | | return $this->ok($log); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | <layout name="layout" /> |
| | | <script src="{$uri}Public/Scripts/PSI/SaleOrderTracking/SOTMainForm.js?dt={$dtFlag}" type="text/javascript"></script> |
| | | <script src="{$uri}Public/Scripts/PSI/SaleOrderTracking/EditForm.js?dt={$dtFlag}" type="text/javascript"></script> |
| | | <script src="{$uri}Public/Scripts/PSI/UX/CellEditing.js?dt={$dtFlag}" type="text/javascript"></script> |
| | | <script src="{$uri}Public/Lodop/LodopFuncs.js?dt={$dtFlag}" type="text/javascript"></script> |
| | | |
New file |
| | |
| | | /** |
| | | * 订单状态跟踪信息编辑 |
| | | */ |
| | | Ext.define("PSI.SaleOrderTracking.EditForm", { |
| | | extend: "PSI.AFX.BaseDialogForm", |
| | | |
| | | config: { |
| | | selectedSOTs: null, |
| | | fid:null |
| | | }, |
| | | |
| | | initComponent: function () { |
| | | var me = this; |
| | | |
| | | var t = "订单状态跟踪信息编辑"; |
| | | var f = "edit-form-money.png"; |
| | | var logoHtml = "<img style='float:left;margin:20px 20px 0px 10px;width:48px;height:48px;' src='" |
| | | + PSI.Const.BASE_URL |
| | | + "Public/Images/" |
| | | + f |
| | | + "'></img>" |
| | | + "<h2 style='color:#196d83'>" |
| | | + t |
| | | + "</h2>" |
| | | + "<p style='color:#196d83'>标记 <span style='color:red;font-weight:bold'>*</span>的是必须录入数据的字段</p>"; |
| | | |
| | | Ext.apply(me, { |
| | | header: { |
| | | title: me.formatTitle(PSI.Const.PROD_NAME), |
| | | height: 40 |
| | | }, |
| | | width: 400, |
| | | height: 340, |
| | | layout: "border", |
| | | listeners: { |
| | | show: { |
| | | fn: me.onWndShow, |
| | | scope: me |
| | | }, |
| | | close: { |
| | | fn: me.onWndClose, |
| | | scope: me |
| | | } |
| | | }, |
| | | items: [{ |
| | | region: "north", |
| | | border: 0, |
| | | height: 90, |
| | | html: logoHtml |
| | | }, { |
| | | region: "center", |
| | | border: 0, |
| | | id: "editForm", |
| | | xtype: "form", |
| | | layout: { |
| | | type: "table", |
| | | columns: 1 |
| | | }, |
| | | height: "100%", |
| | | bodyPadding: 5, |
| | | defaultType: 'textfield', |
| | | fieldDefaults: { |
| | | labelWidth: 60, |
| | | labelAlign: "right", |
| | | labelSeparator: "", |
| | | msgTarget: 'side', |
| | | width: 370, |
| | | margin: "5" |
| | | }, |
| | | items: [{ |
| | | xtype: "hidden", |
| | | name: "fid", |
| | | value: me.getFid() |
| | | }, { |
| | | id: "declareNo", |
| | | fieldLabel: "报关单号", |
| | | xtype: "displayfield" |
| | | }, { |
| | | id: "time", |
| | | fieldLabel: "日期", |
| | | allowBlank: false, |
| | | blankText: "没有输入日期", |
| | | beforeLabelTextTpl: PSI.Const.REQUIRED, |
| | | xtype: "datefield", |
| | | format: "Y-m-d", |
| | | value: new Date(), |
| | | name: "time" |
| | | }], |
| | | buttons: [{ |
| | | text: "保存", |
| | | iconCls: "PSI-button-ok", |
| | | formBind: true, |
| | | handler: me.onOK, |
| | | scope: me |
| | | }, { |
| | | text: "取消", |
| | | handler: function () { |
| | | me.close(); |
| | | }, |
| | | scope: me |
| | | }] |
| | | }] |
| | | }); |
| | | |
| | | me.callParent(arguments); |
| | | }, |
| | | |
| | | onWindowBeforeUnload: function (e) { |
| | | return (window.event.returnValue = e.returnValue = '确认离开当前页面?'); |
| | | }, |
| | | |
| | | onWndClose: function () { |
| | | var me = this; |
| | | |
| | | Ext.get(window).un('beforeunload', me.onWindowBeforeUnload); |
| | | }, |
| | | |
| | | // onWndShow: function () { |
| | | // var me = this; |
| | | |
| | | // Ext.get(window).on('beforeunload', me.onWindowBeforeUnload); |
| | | |
| | | // var f = Ext.getCmp("editForm"); |
| | | // var el = f.getEl(); |
| | | // el.mask(PSI.Const.LOADING); |
| | | // Ext.Ajax.request({ |
| | | // url: PSI.Const.BASE_URL + "Home/Funds/rvRecInfo", |
| | | // params: {}, |
| | | // method: "POST", |
| | | // callback: function (options, success, response) { |
| | | // el.unmask(); |
| | | |
| | | // if (success) { |
| | | // var data = Ext.JSON.decode(response.responseText); |
| | | |
| | | // Ext.getCmp("editBizUserId") |
| | | // .setValue(data.bizUserId); |
| | | // Ext.getCmp("editBizUser") |
| | | // .setValue(data.bizUserName); |
| | | // Ext.getCmp("editBizUser") |
| | | // .setIdValue(data.bizUserId); |
| | | // } else { |
| | | // PSI.MsgBox.showInfo("网络错误") |
| | | // } |
| | | // } |
| | | // }); |
| | | // }, |
| | | |
| | | // private |
| | | onOK: function () { |
| | | var me = this; |
| | | //var pSOTs = window.opener.Ext.getMainGrid().getSelectionModel().getSelection(); |
| | | var f = Ext.getCmp("editForm"); |
| | | var el = f.getEl(); |
| | | el.mask(PSI.Const.SAVING); |
| | | f.submit({ |
| | | url: PSI.Const.BASE_URL + "Home/SaleTracking/setDeclareData", |
| | | method: "POST", |
| | | params:{ |
| | | "selectedSOTs": me.getSelectedSOTs() |
| | | }, |
| | | success: function (form, action) { |
| | | el.unmask(); |
| | | |
| | | me.close(); |
| | | var pf = me.getParentForm(); |
| | | pf.refreshRvInfo(); |
| | | //pf.refreshselectedSOTsInfo(); |
| | | pf.getRvRecordGrid().getStore().loadPage(1); |
| | | }, |
| | | failure: function (form, action) { |
| | | el.unmask(); |
| | | PSI.MsgBox.showInfo(action.result.msg, function () { |
| | | //xt.getCmp("editBizDT").focus(); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | getSaveData: function () { |
| | | var me = this; |
| | | var result = { |
| | | id: Ext.getCmp("hiddenId").getValue(), |
| | | dealDate: Ext.Date.format(Ext.getCmp("editDealDate").getValue(), |
| | | "Y-m-d"), |
| | | customerId: Ext.getCmp("editCustomer").getIdValue(), |
| | | dealAddress: Ext.getCmp("editDealAddress").getValue(), |
| | | contact: Ext.getCmp("editContact").getValue(), |
| | | tel: Ext.getCmp("editTel").getValue(), |
| | | fax: Ext.getCmp("editFax").getValue(), |
| | | orgId: Ext.getCmp("editOrg").getIdValue(), |
| | | bizUserId: Ext.getCmp("editBizUser").getIdValue(), |
| | | receivingType: Ext.getCmp("editReceivingType").getValue(), |
| | | billMemo: Ext.getCmp("editBillMemo").getValue(), |
| | | scbillRef: me.getScbillRef(), |
| | | items: [] |
| | | }; |
| | | |
| | | var store = this.getGoodsGrid().getStore(); |
| | | for (var i = 0; i < store.getCount(); i++) { |
| | | var item = store.getAt(i); |
| | | result.items.push({ |
| | | id: item.get("id"), |
| | | goodsId: item.get("goodsId"), |
| | | goodsCount: item.get("goodsCount"), |
| | | goodsPrice: item.get("goodsPrice"), |
| | | goodsMoney: item.get("goodsMoney"), |
| | | tax: item.get("tax"), |
| | | taxRate: item.get("taxRate"), |
| | | moneyWithTax: item.get("moneyWithTax"), |
| | | memo: item.get("memo"), |
| | | scbillDetailId: item.get("scbillDetailId"), |
| | | goodsPriceWithTax: item.get("goodsPriceWithTax") |
| | | }); |
| | | } |
| | | |
| | | return Ext.JSON.encode(result); |
| | | }, |
| | | |
| | | }); |
| | |
| | | id: "buttonCheck" |
| | | }, { |
| | | hidden: me.getPermission().check == "0", |
| | | xtype: "tbseparator", |
| | | id: "tbseparator1" |
| | | xtype: "tbseparator" |
| | | }, { |
| | | text: "放行", |
| | | hidden: me.getPermission().release == "0", |
| | |
| | | handler: me.onRelease, |
| | | id: "buttonRelease" |
| | | }, { |
| | | hidden: me.getPermission().pickUp == "0", |
| | | xtype: "tbseparator", |
| | | id: "tbseparator2" |
| | | hidden: me.getPermission().release == "0", |
| | | xtype: "tbseparator" |
| | | }, { |
| | | text: "提货", |
| | | hidden: me.getPermission().pickUp == "0", |
| | |
| | | id: "buttonPickUp" |
| | | }, { |
| | | hidden: me.getPermission().pickUp == "0", |
| | | xtype: "tbseparator", |
| | | id: "tbseparator2" |
| | | xtype: "tbseparator" |
| | | }, { |
| | | text: "卸货", |
| | | hidden: me.getPermission().unload == "0", |
| | |
| | | id: "buttonUnload" |
| | | }, { |
| | | hidden: me.getPermission().unload == "0", |
| | | xtype: "tbseparator", |
| | | id: "tbseparator2" |
| | | xtype: "tbseparator" |
| | | }, { |
| | | text: "关闭", |
| | | handler: function () { |
| | |
| | | value: "条记录" |
| | | }], |
| | | listeners: { |
| | | select: { |
| | | selectionchange: { |
| | | fn: me.onMainGridSelect, |
| | | scope: me |
| | | } |
| | |
| | | |
| | | onMainGridSelect: function () { |
| | | var me = this; |
| | | var item = me.getMainGrid().getSelectionModel().getSelection(); |
| | | if (item == null || item.length != 1) { |
| | | //var item = me.getMainGrid().getSelectionModel().getSelection(); |
| | | var records = me.getMainGrid().getSelectionModel().getSelection(); |
| | | if (records.length == 0) { |
| | | Ext.getCmp("buttonDeclare").setDisabled(true); |
| | | Ext.getCmp("buttonQuarantine").setDisabled(true); |
| | | Ext.getCmp("buttonCheck").setDisabled(true); |
| | |
| | | }, |
| | | |
| | | /** |
| | | * 编辑销售订单 |
| | | * 报关 |
| | | */ |
| | | onEditBill: function () { |
| | | onDeclare: function () { |
| | | var me = this; |
| | | var item = me.getMainGrid().getSelectionModel().getSelection(); |
| | | if (item == null || item.length != 1) { |
| | | me.showInfo("没有选择要编辑的销售订单"); |
| | | var records = me.getMainGrid().getSelectionModel().getSelection(); |
| | | if (records.length == 0) { |
| | | me.showInfo("没有选择任何行,请选择数据行。"); |
| | | return; |
| | | } |
| | | var bill = item[0]; |
| | | |
| | | var form = Ext.create("PSI.SaleOrder.SOEditForm", { |
| | | |
| | | var form = Ext.create("PSI.SaleOrderTracking.EditForm", { |
| | | parentForm: me, |
| | | showAddGoodsButton: me.getPermission().showAddGoodsButton, |
| | | entity: bill |
| | | fid: "C001-01", |
| | | selectedSOTs: records |
| | | }); |
| | | form.show(); |
| | | }, |