| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- Ext.define('make.view.osmake.reconciliation.FormPanelController', {
- extend: 'saas.view.core.form.FormPanelController',
- alias: 'controller.osmake-reconciliation-formpanel',
- init: function (form) {
- var me = this;
- this.control({
- 'multidbfindtrigger[name = ad_inoutno]': {
- beforerender: function (f) {
- Ext.apply(f, {
- defaultCondition: "pi_statuscode = 'AUDITED' and pi_class in ('PURCIN','OSMAKEIN','OSMAKEINBACK','PURCOUT') and IFNULL(Apcheckstatus,' ') != '已转对账' and IFNULL(Apcheckstatus,' ') != '已对账' and pd_status = 99",
- defaultQueryField: 'pi_inoutno',
- dbfinds: [{
- from: 'pi_inoutno', to: 'ad_inoutno'
- }, {
- from: 'pd_id', to: 'ad_pdid'
- }, {
- from: 'pd_ordercode', to: 'ad_pucode'
- }, {
- from: 'pd_pdno', to: 'ad_pdno'
- }, {
- from: 'pr_detail', to: 'pr_detail'
- }, {
- from: 'pr_orispeccode', to: 'pr_orispeccode'
- }, {
- from: 'pd_qty', to: 'ad_b2bqty'
- }, {
- from: 'pd_orderprice', to: 'ad_price'
- }, {
- from: 'pd_ordertotal', to: 'ad_ordertotal'
- }, {
- from: 'pd_prodcode', to: 'ad_prodcode'
- }, {
- from: 'pr_brand', to: 'pr_brand'
- }, {
- from: 'pr_spec', to: 'pr_spec'
- }, {
- from: 'pd_remark', to: 'ard_remark'
- }],
- });
- },
- beforetriggerclick: function (f) {
- var view = this.view,
- vendnameValue = view.ownerCt.down('[name="ac_vendname"]').value,
- veidValue = view.ownerCt.down('[name="ac_vendid"]').value,
- defaultCondition = "pi_statuscode = 'AUDITED' and pi_class in ('PURCIN','PURCOUT','OSMAKEIN','OSMAKEINBACK') and IFNULL(Apcheckstatus,' ') != '已转对账' and IFNULL(Apcheckstatus,' ') != '已对账' and pd_status = 99",
- ar_cuidValue = view.ownerCt.down('[name="ac_vendid"]').value;
- f.defaultCondition = defaultCondition;
- if (vendnameValue) {
- if (veidValue != '' && veidValue > 0) {
- defaultCondition = "pi_statuscode = 'AUDITED' and pi_class in ('OSMAKEIN','OSMAKEINBACK') and IFNULL(Apcheckstatus,' ') != '已转对账' and IFNULL(Apcheckstatus,' ') != '已对账' and pd_status = 99 AND pi_vendid = " + veidValue;
- } else if (ar_cuidValue == '' || ar_cuidValue == 0) {
- defaultCondition = "pi_statuscode = 'AUDITED' and pi_class in ('OSMAKEIN','OSMAKEINBACK') and IFNULL(Apcheckstatus,' ') != '已转对账' and IFNULL(Apcheckstatus,' ') != '已对账' and pd_status = 99";
- }
- f.defaultCondition = defaultCondition ;
- }
- }
- }
- });
- },
- agree:function(){
- var me = this;
- var url = '/api/money/apcheck/agree/';
- me.sendUrl(url)
- },
- disagree:function(){
- var me = this;
- var url = '/api/money/apcheck/reject/';
- me.sendUrl(url)
- },
- sendUrl:function(url){
- var me = this;
- var view = me.getView();
- var id = me.getViewModel().getData().id;
- view.setLoading(true);
- saas.util.BaseUtil.request({
- url: url + id,
- params: '',
- method: 'POST',
- })
- .then(function() {
- view.setLoading(false);
- //解析参数
- saas.util.BaseUtil.showSuccessToast('操作成功');
- me.refresh()
- })
- .catch(function(e) {
- //失败
- saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
- });
- }
- });
|