crm_second_opening_mini/pages/index/groupCompany/contract/addPayment.js

1 line
5.5 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/groupCompany/contract/addPayment"],{1126:function(t,e,n){},"1b79":function(t,e,n){"use strict";var o=n("1126"),i=n.n(o);i.a},"40eb":function(t,e,n){"use strict";(function(t){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n("9523")),c=n("0c59"),r=n("76dd"),a=n("dc92"),u=n("8683"),s={mixins:[u.commonF],components:{formItem:function(){Promise.all([n.e("common/vendor"),n.e("components/form/formitem")]).then(function(){return resolve(n("d7bf"))}.bind(null,n)).catch(n.oe)},fixedApproval:function(){n.e("components/fixedApproval").then(function(){return resolve(n("d3f7"))}.bind(null,n)).catch(n.oe)},selectCustomer:function(){Promise.all([n.e("common/vendor"),n.e("components/selectCustomer")]).then(function(){return resolve(n("5bcd"))}.bind(null,n)).catch(n.oe)},selectContract:function(){n.e("components/selectContract").then(function(){return resolve(n("e630"))}.bind(null,n)).catch(n.oe)}},data:function(){var t;return t={noClick:!0,type:[],numList:[],numIndex:0,info:null,customer_id:"",contract_id:"",number:"",money:"",return_time:"",return_type:"",flow_staff_id:"",BASE_IMG_URL:c.BASE_IMG_URL,remindPeople:[],remindType:"contract",otherForm:[],customerList:[],customerIndex:null,customerObj:{},contractObj:{},contractList:[],contractIndex:null},(0,i.default)(t,"number",""),(0,i.default)(t,"approvalPro",{}),(0,i.default)(t,"isRequired",!1),t},onLoad:function(t){t.kehuid&&(this.customer_id=t.kehuid),t.id&&(this.contract_id=t.id,this.getNum()),this.getKehu(),this.getType(),this.getProcess()},onUnload:function(){t.removeStorageSync("remindlist")},methods:{changeRequired:function(t){this.isRequired=t.detail.value},getProcess:function(){var t=this;(0,a.netApprovalProcess)({type:"receivables"}).then((function(e){t.approvalPro=e.data}))},getForm:function(){var t=this;(0,a.netSetForm)({type:"examine"}).then((function(e){e=e.data.data,e.forEach((function(e){if("return_time"==e.id){var n=new Date,o=n.getFullYear(),i=n.getMonth()+1,c=n.getDate(),r=o+"-"+i+"-"+c;e.value=r}"money"==e.id&&(e.value=t.contractObj.id?t.contractObj.receivables.be_money:""),"return_type"==e.id&&(e.value=e.config.content?e.config.content[0].value:""),"number"==e.id&&(e.value=t.number)})),t.otherForm=e}))},changeData:function(t,e,n){var o=this,i=this.otherForm;i.forEach((function(t,i){t.id==n.id&&(t.value=e,o.$set(o.otherForm,i,t))}))},getType:function(){var t=this;(0,r.netSelect)().then((function(e){t.type=e.data["回款方式"]}))},getKehu:function(){var t=this;(0,r.netPrevCustomer)().then((function(e){t.customerList=e.data,t.customer_id&&t.customerList.forEach((function(e,n){e.id==t.customer_id&&(t.customerObj=e)})),t.getContract()}))},changeCustomer:function(t){this.$refs.customerChild.init(),this.customerIndex=t.detail.value,this.index=null,this.getContract()},sureCustomer:function(t){this.customerObj=t,this.contractObj={}},getContract:function(){var t=this,e={customer_id:this.customerObj.id?this.customerObj.id:this.customer_id};(0,r.netContractList)(e).then((function(e){t.contractList=e.data,t.contract_id&&t.contractList.forEach((function(e,n){e.id==t.contract_id&&(t.contractObj=e)})),t.getNumber()}))},getNumber:function(){var t=this;(0,r.netPaymentNumber)().then((function(e){t.number=e.data.number,t.otherForm=[],t.getForm()}))},changeContract:function(t){this.$refs.contractChild.init(this.customerObj.id)},sureContract:function(t){this.contractObj=t,this.getNum()},getNum:function(){var t=this,e={contract_id:this.contractObj.id?this.contractObj.id:this.contract_id};(0,r.netPaymentNum)(e).then((function(e){t.numList=e.data}))},changeNum:function(t){this.numIndex=t.detail.value},changeType:function(t){this.return_type=this.type[t.detail.value]},changeTime:function(t){this.return_time=t.detail.value},saveFollow:function(){this.info;var e=this.remindPeople;if(this.customerObj.id)if(this.contractObj.id){var n=this.checkCommonForm(this.otherForm);if(n)if(e&&0!=e.length||0!=this.approvalPro.status){var o=[];e.forEach((function(t){o.push(t.id)})),n=Object.assign({},n,{customer_id:this.customerObj.id?this.customerObj.id:"",contract_id:this.contractObj?this.contractObj.id:"",plan_id:this.numList[this.numIndex]?this.numList[this.numIndex].id:"",flow_staff_ids:0==this.approvalPro.status?o.join(","):""}),(0,r.netAddPayment)(n).then((function(e){t.showToast({title:e.msg,icon:"none"}),setTimeout((function(){t.navigateBack({delta:1})}),2e3)}))}else t.showToast({title:"请选择审批人",icon:"none"})}else t.showToast({title:"请选择关联合同",icon:"none"});else t.showToast({title:"请选择关联客户",icon:"none"})}}};e.default=s}).call(this,n("543d")["default"])},5804:function(t,e,n){"use strict";(function(t,e){var o=n("4ea4");n("8886");o(n("66fd"));var i=o(n("edb7"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},a291:function(t,e,n){"use strict";n.r(e);var o=n("40eb"),i=n.n(o);for(var c in o)["default"].indexOf(c)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(c);e["default"]=i.a},bcf6:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},i=[]},edb7:function(t,e,n){"use strict";n.r(e);var o=n("bcf6"),i=n("a291");for(var c in i)["default"].indexOf(c)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(c);n("1b79");var r=n("f0c5"),a=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=a.exports}},[["5804","common/runtime","common/vendor"]]]);