Ext.define('make.view.osmake.osMakeCheckIn.FormPanelController', { extend: 'saas.view.core.form.FormPanelController', alias: 'controller.osmake-osmakecheckin-formpanel', init: function (form) { var me = this; this.control({ //放大镜赋值关系 以及 tpl模板 'dbfindtrigger[name=pi_vendname]':{ beforerender:function(f){ Ext.apply(f,{ dbfinds:[{ from:'id',to:'pi_vendid',ignore:true },{ from:'ve_code',to:'pi_vendcode' },{ from:'ve_name',to:'pi_vendname' },{ from:'ve_buyerid',to:'pi_buyerid' },{ from:'ve_buyercode',to:'pi_buyercode' },{ from:'ve_buyername',to:'pi_buyername' },{ from:'ve_currency',to:'pi_currency' },{ from:'cr_rate',to:'pi_rate' },{ from:'vc_name',to:'pi_contact' },{ from:'vc_tel',to:'pi_tel' },{ from:'ve_paymentsid',to:'pi_paymentsid' },{ from:'ve_paymentscode',to:'pi_paymentscode' },{ from:'ve_payments',to:'pi_payments' },{ from:'ve_taxrate',to:'pi_taxrate' }], }) ; } }, 'osMakeMainMultiDbfindTrigger[name=pd_ordercode]':{ beforerender: function (f) { Ext.apply(f, { defaultCondition: "ma_statuscode = 'AUDITED' and ma_tasktype = 'OS' AND ma_vendcode IS NOT NULL AND MA_QTY - IFNULL(MA_MADEQTY,0) > 0" }); } }, //从表多选放大镜赋值关系 以及 tpl模板 'multidbfindtrigger[name=pd_prodcode]':{ beforerender:function(f){ Ext.apply(f,{ //放大镜赋值设置 dbfinds:[{ from:'id',to:'pd_prodid',ignore:true },{ from:'pr_code',to:'pd_prodcode' },{ from:'pr_detail',to:'pr_detail' },{ from:'pr_spec',to:'pr_spec' },{ from: 'pr_brand', to: 'pr_brand' },{ from: 'pr_orispeccode', to: 'pr_orispeccode' },{ from: 'pr_unit', to: 'pr_unit' }, { from:'pr_purcprice',to:'pd_lastprice' },{ from:'pr_zxbzs',to:'pr_zxbzs' }], }); } }, 'multidbfindtrigger[name=pr_detail]': { beforerender: function (f) { Ext.apply(f, { dbfinds:[{ from:'id',to:'pd_prodid',ignore:true },{ from:'pr_code',to:'pd_prodcode' },{ from:'pr_detail',to:'pr_detail' },{ from:'pr_spec',to:'pr_spec' },{ from: 'pr_brand', to: 'pr_brand' },{ from: 'pr_orispeccode', to: 'pr_orispeccode' },{ from: 'pr_unit', to: 'pr_unit' }, { from:'pr_purcprice',to:'pd_lastprice' },{ from:'pr_zxbzs',to:'pr_zxbzs' }], }); } },//放大镜赋值关系 以及 tpl模板 'dbfindtrigger[name=pd_whname]':{ beforerender:function(f){ Ext.apply(f,{ dbfinds:[{ from:'id',to:'pd_whid',ignore:true },{ from:'wh_code',to:'pd_whcode' },{ from:'wh_description',to:'pd_whname' }], }) ; } } }); }, /** * 生成外协验退单 */ turnOsMakeInBack: function(){ var me = this, form = me.getView(), id = form.getForm().findField(form._idField); form.setLoading(true); saas.util.BaseUtil.request({ url: form._turnOsMakeInBackUrl + '/' + id.value, method: 'POST', }) .then(function (localJson) { form.setLoading(false); if (localJson.success) { var intValue = localJson.data.id, codeValue = localJson.data.code, name ='外协验退'; saas.util.BaseUtil.openTab('osmake-osmakecheckreturn-formpanel', name + "(" + codeValue + ")", codeValue + intValue, { initId: intValue }); saas.util.BaseUtil.showSuccessToast('转单成功'); saas.util.FormUtil.loadData(form); } }) .catch(function (e) { form.setLoading(false); saas.util.BaseUtil.showErrorToast('转单失败: ' + e.message); }); }, });