| | |
| | | items: [{ |
| | | id: "panelQueryCmp", |
| | | region: "north", |
| | | height: 65, |
| | | height: 95, |
| | | header: false, |
| | | collapsible: true, |
| | | collapseMode: "mini", |
| | |
| | | }, |
| | | scope: me |
| | | }] |
| | | }, { |
| | | id: "editQueryUser", |
| | | labelWidth: 60, |
| | | labelAlign: "right", |
| | | labelSeparator: "", |
| | | fieldLabel: "制单人", |
| | | margin: "5, 0, 0, 0", |
| | | xtype: "psi_userfield", |
| | | showModal: true |
| | | }]; |
| | | }, |
| | | |
| | |
| | | gridDetail.setTitle("销售订单明细"); |
| | | gridDetail.getStore().removeAll(); |
| | | |
| | | var grid = me.getWSGrid(); |
| | | grid.getStore().removeAll(); |
| | | |
| | | Ext.getCmp("pagingToobar").doRefresh(); |
| | | me.__lastId = id; |
| | | }, |
| | |
| | | Ext.getCmp("editQueryCustomer").clearIdValue(); |
| | | Ext.getCmp("editQueryReceivingType").setValue(-1); |
| | | Ext.getCmp("editQueryGoods").clearIdValue(); |
| | | Ext.getCmp("editQueryUser").clearIdValue(); |
| | | |
| | | me.onQuery(); |
| | | }, |
| | |
| | | result.goodsId = goodsId; |
| | | } |
| | | |
| | | var userId = Ext.getCmp("editQueryUser").getIdValue(); |
| | | if (userId) { |
| | | result.userId = userId; |
| | | } |
| | | |
| | | return result; |
| | | }, |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | var form = Ext.create("PSI.PurchaseOrder.POEditForm", { |
| | | parentForm: me, |
| | | sobillRef: bill.get("ref"), |
| | | genBill: true |
| | | }); |
| | | form.show(); |
| | | var funShowForm = function () { |
| | | var form = Ext.create("PSI.PurchaseOrder.POEditForm", { |
| | | parentForm: me, |
| | | sobillRef: bill.get("ref"), |
| | | genBill: true |
| | | }); |
| | | form.show(); |
| | | }; |
| | | |
| | | // 先判断是否已经生成过采购订单了 |
| | | // 如果已经生成过,就提醒用户 |
| | | var el = Ext.getBody(); |
| | | el.mask("正在查询是否已经生成过采购订单..."); |
| | | var r = { |
| | | url: me.URL("Home/Sale/getPOBillRefListBySOBillRef"), |
| | | params: { |
| | | soRef: bill.get("ref") |
| | | }, |
| | | callback: function (options, success, response) { |
| | | el.unmask(); |
| | | |
| | | if (success) { |
| | | var data = me.decodeJSON(response.responseText); |
| | | if (data.length > 0) { |
| | | // 已经生成过采购订单,提醒用户 |
| | | var poRefList = ""; |
| | | for (var i = 0; i < data.length; i++) { |
| | | if (i > 0) { |
| | | poRefList += "、"; |
| | | } |
| | | poRefList += data[i].ref; |
| | | } |
| | | var info = "当前销售订单已经生成过采购订单了,请确认是否继续生成新的采购订单?"; |
| | | info += "<br/><br/>已经生成的采购订单单号是:<br/>"; |
| | | info += poRefList; |
| | | me.confirm(info, funShowForm); |
| | | } else { |
| | | // 没有生成过采购订单,直接显示UI界面 |
| | | funShowForm(); |
| | | } |
| | | } else { |
| | | me.showInfo("网络错误"); |
| | | } |
| | | } |
| | | }; |
| | | me.ajax(r); |
| | | }, |
| | | |
| | | /** |