| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- import axios from 'axios'
- import _ from 'lodash'
- import * as uiv from 'uiv'
- Vue.use(uiv)
- Vue.use(Vuex)
- const store = () => new Vuex.Store({
- state: {
- //路由
- route:{
- path:'',
- query:''
- },
- option:{
- userAgent: '',
- // 是否移动端
- isMobile: false,
- // 身份token
- cookies: '',
- // 用户身份SessionId
- sessionId: '',
- // 用户信息
- user: {
- // 是否登录
- logged: false,
- fetching: false,
- compamy:'',//登录公司名
- name:'',//登录人姓名
- enuu:'',//公司UU
- data: {}
- },
- // 系统设置
- globalOptions: {
- fetching: false,
- data: {}
- }
- },
- //保理申请单
- apply: {
- cusId: '',
- id: '',
- fa_contact: '',
- fa_telphone: '',
- fa_phone: '',
- fa_appamount: '',
- fa_facorpname: '',
- fa_enname: '',
- submitTime:'',
- checkinfo:''
- },
- //单个上传的附件
- attach1:{type: '', applyId: '', uid: ''},
- //存储所有附件
- attach:[],
- //附件1
- fileList0: [],
- //附件2
- fileList1: [],
- fileList2: [],
- fileList3: [],
- fileList4: [],
- fileList5: [],
- fileList6: [],
- fileList7: [],
- fileList8: [],
- fileList9: [],
- fileList10: [],
- fileList11: [],
- fileList12: [],
- fileList13: [],
- fileList14: [],
- fileList15: [],
- fileList16: [],
- fileList17: [],
- fileList18: [],
- fileList19: [],
- fileList20: [],
- fileList21: [],
- fileList22: [],
- //出账申请下附件
- aafileList0 : [],
- aafileList1 : [],
- aafileList2 : [],
- aafileList3 : [],
- applyModal:false,
- visible: false,
- num: 0,
- tabInfo: {},
- info: '客户资料填写',
- tabs: [
- '客户基础资料',
- '股东构成',
- '主要关联企业',
- '高管信息',
- '经营状况',
- '贸易流程',
- '资产科目明细(上半年末)',
- '负债科目明细(上半年末)',
- '买方客户信息'
- ],
- //买方用户
- mfmodal: [],
- // 客户资料,给表单默认为空的填写框,同下
- tab1: {
- id: '',
- cu_officeadd: '',
- cu_name: '',
- cu_engname: '',
- cu_enterptype: '',
- cu_licensedate: '',
- cu_paperstype: '',
- cu_regcapital: '',
- cu_institutype: '',
- cu_paperscode: '',
- cu_ctfduedate: '',
- cu_businesscode: '',
- cu_nastdinducls: '',
- cu_capcurrency: '',
- cu_paidincapital: '',
- cu_regadd: '',
- cu_businsscope: '',
- cu_others: '',
- cu_highestauthority: '',
- cu_employeesnum: '',
- cu_departsituation: '',
- isDisabled: false
- },
- // 股东构成
- tab2: [{
- cusId:'', id: '', cs_name: '', cs_paperstype: '', cs_paperscode: '',
- cs_investratio: '', cs_investamount: '', isDisabled: false
- }],
- // 主要关联企业
- tab3: [{
- id: '',
- cusId: '',
- cud_name: '',
- cud_association: '',
- cud_legalperson: '',
- cud_ratio: '',
- cud_product: '',
- cud_amount: '',
- isDisabled: false
- }],
- // 管理层背景
- tab4: [{
- cusId: '',
- id: '',
- ce_name: '',
- ce_sex: '',
- ce_paperstype: '',
- ce_paperscode: '',
- ce_education: '',
- ce_position: '',
- ce_stwkfpo: '',
- ce_workeyears: '',
- ce_nowaddress: '',
- ce_woekexper: '',
- isDisabled: false
- }],
- // 经营描述
- condition: {bc_bcremark: '', bc_sweaterprocess: '', cusId: '', id: ''},
- // 经营情况
- tab5: [{
- cusId: '',
- id: '',
- pm_kind: '',
- pm_tannualrevenue: '',
- pm_tratio: '',
- pm_annualrevenue: '',
- pm_ratio: '',
- isDisabled: false
- }],
- // 应收账款表单
- tab7: [],
- // 其他应收账款
- tab8: [],
- // 预付账款
- tab9: [],
- // 固定资产
- tab10: [],
- // 存货
- tab11: [],
- // 短期借款
- tab12: [],
- // 应付账款
- tab13: [],
- // 其他应付账款
- tab14: [],
- // 长期借款
- tab15: [],
- // 经营情况描述
- financecondition: {
- cusId: '',
- id: '',
- fc_arbalance: '',
- fc_agingamount1: '',
- fc_agingamount2: '',
- fc_agingamount4: '',
- fc_agingamount3: '',
- fc_apremark: '',
- year: '',
- month: '',
- fc_yeatmonth: '',
- isDisabled: false
- },
- // 变更信息
- changeInstruction: [{
- cusId: '',
- id: '',
- cd_type: '股东',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }, {
- cusId: '',
- id: '',
- cd_type: '法人',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }, {
- cusId: '',
- id: '',
- cd_type: '住所',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }],
- // 前五大供应商
- tab6 :[{
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- }, {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- }],
- // 前五大客户商
- tab6_2: [{
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- }],
- show: [
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- {isshow: true},
- ],
- open:false,
- //买方模态框打开状态
- openmf:false,
- //出账申请单模态框打开状态
- openTransfer:false,
- //授权书打开状态
- openAuth:false,
- //保理申请弹框打开状态
- openApply:false,
- //附件1
- fileList: [],
- //附件2
- fileList0: [],
- //附件3
- fileList1: [],
- fileList2: [],
- fileList3: [],
- fileList4: [],
- fileList5: [],
- fileList6: [],
- fileList7: [],
- fileList8: [],
- fileList9: [],
- fileList10: [],
- fileList11: [],
- fileList12: [],
- fileList13: [],
- fileList14: [],
- fileList15: [],
- fileList16: [],
- fileList17: [],
- fileList18: [],
- fileList19: [],
- fileList20: [],
- fileList21: [],
- fileList22: [],
- //买方用户额度列表
- credit:[],
- //英唐保理客户列表
- baolilist:[],
- //判断要不要展示客户资料列表
- showcustlist:false,
- //申请列表
- applylist:[],
- //出账申请列表
- transfer:[],
- //可以保存
- cansave:true,
- //已经被客户经理确认
- checkinfo:false,
- //出账转让所有附件
- array:[],
- //出账转让单个附件
- attach2:{type:'',aaid:'',name:'',size:'',path:'',id:''},
- custFiles: []
- },
- mutations: {
- login(state){
- state.option.user.logged=true
- },
- //左侧菜单栏打开与关闭
- openmenu(state){
- state.open = state.open ? false :true;
- },
- openAuth:function(state){
- state.openAuth = true
- },
- //同意企业征信授权
- agreeAuth:function(state){
- state.openAuth = false
- state.openApply = true
- },
- //关闭企业授权
- closeAuth:function (state) {
- state.openAuth = false
- },
- //关闭保理申请弹框
- closeApply:function(state){
- state.openApply = false
- },
- //tab标签的显示与隐藏
- changeShow(state,table) {
- state.show[table.index].isshow = state.show[table.index].isshow ? false : true
- },
- // 以下都是给表格增加一行新数据功能
- addtab2 (state) {
- state.tab2.push({
- cs_name: '',
- cs_paperstype: '',
- cs_paperscode: '',
- cs_investratio: '',
- cs_investamount: '',
- isDisabled:false
- })
- },
- addtab3(state) {
- state.tab3.push({
- cud_name: '',
- cud_association: '',
- cud_legalperson: '',
- cud_ratio: '',
- cud_product: '',
- cud_amount: '',
- isDisabled:false
- })
- },
- addtab4: function (state) {
- state.tab4.push({
- cusId: '',
- id: '',
- ce_name: '',
- ce_sex: '',
- ce_paperstype: '',
- ce_paperscode: '',
- ce_education: '',
- ce_position: '',
- ce_stwkfpo: '',
- ce_workeyears: '',
- ce_nowaddress: '',
- ce_woekexper: '',
- isDisabled:false
- });
- },
- addtab5(state) {
- state.tab5.push({
- cusId: '',
- id: '',
- pm_kind: '',
- pm_tannualrevenue: '',
- pm_tratio: '',
- pm_annualrevenue: '',
- pm_ratio: '',
- isDisabled:false
- });
- },
- addtab7(state) {
- state.tab7.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '应收账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab8(state) {
- state.tab8.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '其他应收账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab9 (state) {
- state.tab9.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '预付账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab10(state) {
- state.tab10.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '固定资产', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab11(state) {
- state.tab11.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '存货', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab12(state) {
- state.tab12.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '短期借款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab13(state) {
- state.tab13.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '应付账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab14(state) {
- state.tab14.push(
- {
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '其他应付账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- addtab15(state) {
- state.tab15.push({
- cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
- ai_kind: '长期借款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
- })
- },
- // 增加买方信息
- addMfmodal(state){
- var a = {
- cusId: '',
- id: '',
- mf_legrep: '',
- mf_custname: '',
- mf_credit: '',
- mf_regcapital: '',
- mf_addr: '',
- mf_estabtime: '',
- mf_contact: '',
- mf_contactnum: '',
- mf_fax: '',
- mf_email: '',
- mf_tradprod: '',
- mf_payterm: '',
- mf_shareholder: '',
- mf_businsscope: '',
- mf_coopohers: '',
- mf_hasinslimit: '',
- mf_balancebank: '',
- mf_bankaccount: '',
- mfCustInfoDetailList: [{
- id: '',
- mfd_year: '',
- mfd_amount: '',
- mfd_chargeamount: '',
- mfd_discountamount: '',
- mfd_overdue: '',
- mfId: '',
- }],
- show: true
- };
- state.mfmodal.push(a);
- for (var i = 0; i < (state.mfmodal.length - 1); i++) {
- state.mfmodal[i].show = false;
- }
- state.openmf = true;
- },
- // 增加买方客户列表
- addmfCustInfoDetailList(state,index) {
- state.mfmodal[index].mfCustInfoDetailList.push({
- id: '',
- mfd_year: '',
- mfd_amount: '',
- mfd_chargeamount: '',
- mfd_discountamount: '',
- mfd_overdue: '',
- mfId: '',
- isDisabled:false
- });
- },
- //关闭买方模态框
- cancleMf(state){
- state.openmf = false
- },
- //取出客户资料
- getCustomer:function(state,result) {
- state.tab1={
- id: '',
- cu_officeadd: '',
- cu_name: '',
- cu_engname: '',
- cu_enterptype: '',
- cu_licensedate: '',
- cu_paperstype: '',
- cu_regcapital: '',
- cu_institutype: '',
- cu_paperscode: '',
- cu_ctfduedate: '',
- cu_businesscode: '',
- cu_nastdinducls: '',
- cu_capcurrency: '',
- cu_paidincapital: '',
- cu_regadd: '',
- cu_businsscope: '',
- cu_others: '',
- cu_highestauthority: '',
- cu_employeesnum: '',
- cu_departsituation: '',
- isDisabled: false
- }
- if (result.customer != null) {
- state.tab1 = result.customer;
- }
- state.tab2 = [{
- cusId:'', id: '', cs_name: '', cs_paperstype: '', cs_paperscode: '',
- cs_investratio: '', cs_investamount: '', isDisabled: false
- }]
- if (result && result.customer && result.customer.shareholders) {
- state.tab2 = result.customer.shareholders
- }
- state.tab3 = [{
- id: '',
- cusId: '',
- cud_name: '',
- cud_association: '',
- cud_legalperson: '',
- cud_ratio: '',
- cud_product: '',
- cud_amount: '',
- isDisabled: false
- }]
- if(result && result.customer && result.customer.associateCompanies){
- state.tab3 = result.customer.associateCompanies;
- }
- state.tab4 = [{
- cusId: '',
- id: '',
- ce_name: '',
- ce_sex: '',
- ce_paperstype: '',
- ce_paperscode: '',
- ce_education: '',
- ce_position: '',
- ce_stwkfpo: '',
- ce_workeyears: '',
- ce_nowaddress: '',
- ce_woekexper: '',
- isDisabled: false
- }]
- if(result && result.customer && result.customer.customerExcutives){
- state.tab4 = result.customer.customerExcutives;
- }
- state.changeInstruction = [{
- cusId: '',
- id: '',
- cd_type: '股东',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }, {
- cusId: '',
- id: '',
- cd_type: '法人',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }, {
- cusId: '',
- id: '',
- cd_type: '住所',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }]
- if (result && result.customer && result.customer.changesInstructions && result.customer.changesInstructions.length !=0 ) {
- state.changeInstruction = result.customer.changesInstructions;
- }
- state.condition = {bc_bcremark: '', bc_sweaterprocess: '', cusId: '', id: ''}
- if (result && result.customer && result.customer.businessCondition) {
- state.condition = result.customer.businessCondition;
- }
- state.financecondition = {
- cusId: '',
- id: '',
- fc_arbalance: '',
- fc_agingamount1: '',
- fc_agingamount2: '',
- fc_agingamount4: '',
- fc_agingamount3: '',
- fc_apremark: '',
- year: '',
- month: '',
- fc_yeatmonth: '',
- isDisabled: false
- }
- if (result && result.customer && result.customer.financeCondition) {
- state.financecondition = result.customer.financeCondition;
- }
- state.tab5 = [{
- cusId: '',
- id: '',
- pm_kind: '',
- pm_tannualrevenue: '',
- pm_tratio: '',
- pm_annualrevenue: '',
- pm_ratio: '',
- isDisabled: false
- }]
- if (result && result.customer && result.customer.productMixes) {
- state.tab5 = result.customer.productMixes;
- }
- state.tab6 = [{
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- }, {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '上游'
- }]
- state.tab6_2 = [{
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- },
- {
- cusId: '',
- id: '',
- udc_name: '',
- udc_product: '',
- udc_lastyear: '',
- udc_thisyear: '',
- udc_payment: '',
- udc_cooperationyears: '',
- udc_kind: '下游'
- }]
- if (result && result.customer && result.customer.updowncasts && result.customer.updowncasts.length != 0) {
- var array1 = [];
- var array2 = [];
- for (var i = 0; i < result.customer.updowncasts.length; i++) {
- if (result.customer.updowncasts[i].udc_kind == '上游') {
- array1.push(result.customer.updowncasts[i])
- } else {
- array2.push(result.customer.updowncasts[i])
- }
- }
- state.tab6 = array1;
- state.tab6_2 = array2;
- }
- state.tab7=[];
- state.tab8=[];
- state.tab9=[];
- state.tab10=[];
- state.tab11=[];
- state.tab12=[];
- state.tab13=[];
- state.tab14=[];
- state.tab15=[];
- if(result && result.customer && result.customer.accountInfoList) {
- for (var i = 0; i < result.customer.accountInfoList.length; i++) {
- if (result.customer.accountInfoList[i].ai_kind == '应收账款') {
- state.tab7.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '其他应收账款') {
- state.tab8.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '预付账款') {
- state.tab9.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '固定资产') {
- state.tab10.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '存货') {
- state.tab11.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '短期借款') {
- state.tab12.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '应付账款') {
- state.tab13.push(result.customer.accountInfoList[i]);
- } else if (result.customer.accountInfoList[i].ai_kind == '其他应付账款') {
- state.tab14.push(result.customer.accountInfoList[i]);
- } else {
- state.tab15.push(result.customer.accountInfoList[i]);
- }
- }
- }
- state.mfmodal=[];
- if(result && result.customer && result.customer.mfCustInfos){
- for (var i = 0; i < result.customer.mfCustInfos.length; i++) {
- state.mfmodal.push(result.customer.mfCustInfos[i]);
- Vue.set(this.state.mfmodal[i], 'show', true)
- }
- }
- if(result.apply != null){
- state.apply = result.apply;
- if(result.apply.attachList){
- state.attach = result.apply.attachList
- for (var i = 0; i < state.attach.length; i++) {
- if (state.attach[i].type == '保理业务申请书' && !state.fileList0.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList0.push(state.attach[i]);
- } else if (state.attach[i].type == '营业执照正副本' && !state.fileList1.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList1.push(state.attach[i]);
- } else if (state.attach[i].type == '开户许可证' && !state.fileList2.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList2.push(state.attach[i]);
- } else if (state.attach[i].type == '法人代表身份证' && !state.fileList3.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList3.push(state.attach[i]);
- } else if (state.attach[i].type == '实际控制人身份证' && !state.fileList4.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList4.push(state.attach[i]);
- } else if (state.attach[i].type == '法人代表证明书' && !state.fileList5.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList5.push(state.attach[i]);
- } else if (state.attach[i].type == '公司章程' && !state.fileList6.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList6.push(state.attach[i]);
- } else if (state.attach[i].type == '实际控制人征信授权书' && !state.fileList7.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList7.push(state.attach[i]);
- } else if (state.attach[i].type == '租赁合同/房产证' && !state.fileList8.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList8.push(state.attach[i]);
- } else if (state.attach[i].type == '法定代表人和实际控制人简历(Word版)' && !state.fileList9.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList9.push(state.attach[i]);
- } else if (state.attach[i].type == '近三年财务报表和近一期月度财报(含资产负债表、损益表、现金流量表)' && !state.fileList10.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList10.push(state.attach[i]);
- } else if (state.attach[i].type == '前五大上游企业贸易合同(两份)' && !state.fileList11.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList11.push(state.attach[i]);
- } else if (state.attach[i].type == '前五大下游企业贸易合同(两份)' && !state.fileList12.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList12.push(state.attach[i]);
- } else if (state.attach[i].type == '近1年税控系统导出的增值税发票清单(Excel版)' && !state.fileList13.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList13.push(state.attach[i]);
- } else if (state.attach[i].type == '近一年最大的五份贸易合同' && !state.fileList14.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList14.push(state.attach[i]);
- } else if (state.attach[i].type == '税控系统导出近一年全部发票(Excel版)' && !state.fileList15.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList15.push(state.attach[i]);
- } else if (state.attach[i].type == '公司人行征信报告及对外担保信息' && !state.fileList16.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList16.push(state.attach[i]);
- } else if (state.attach[i].type == '上一年度增值税(营业税)、所得税纳税证明' && !state.fileList17.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList17.push(state.attach[i]);
- } else if (state.attach[i].type == '企业近1年主要结算银行流水' && !state.fileList18.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList18.push(state.attach[i]);
- } else if (state.attach[i].type == '个人近1年主要结算银行流水' && !state.fileList19.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList19.push(state.attach[i]);
- } else if (state.attach[i].type == '近三个月水电费单据' && !state.fileList20.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList20.push(state.attach[i]);
- } else if (state.attach[i].type == '其他' && !state.fileList21.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList21.push(state.attach[i]);
- } else if (state.attach[i].type == '担保人的人行征信报告及对外担保信息' && !state.fileList22.find(item => {
- return item.id === state.attach[i].id
- })) {
- state.fileList22.push(state.attach[i]);
- }
- }
- }
- }
- if(result.status==202 || result.status==203 || result.status == 204){
- state.cansave = false
- }
- },
- //找到某一具体的客户资料
- findcust:function(state,result){
- if (result != null) {
- state.tab1 = result;
- }
- state.tab2 = result.shareholders
- state.tab3 = result.associateCompanies;
- state.tab4 = result.customerExcutives;
- state.tab5 = result.productMixes;
- state.changeInstruction=[{
- cusId: '',
- id: '',
- cd_type: '股东',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }, {
- cusId: '',
- id: '',
- cd_type: '法人',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }, {
- cusId: '',
- id: '',
- cd_type: '住所',
- cs_date: '',
- cs_before: '',
- cs_after: '',
- isDisabled: false
- }]
- if(result.changesInstructions != null) {
- state.changeInstruction = result.changesInstructions;
- }
- state.condition= {bc_bcremark: '', bc_sweaterprocess: '', cusId: '', id: ''};
- if(result.businessCondition != null){
- state.condition = result.businessCondition;}
- state.financecondition={
- cusId: '',
- id: '',
- fc_arbalance: '',
- fc_agingamount1: '',
- fc_agingamount2: '',
- fc_agingamount4: '',
- fc_agingamount3: '',
- fc_apremark: '',
- year: '',
- month: '',
- fc_yeatmonth: '',
- isDisabled: false
- };
- if(result.financeCondition != null){
- state.financecondition = result.financeCondition;}
- state.tab5 = result.productMixes;
- state.tab6 = [];
- state.tab6_2 = [];
- if(result && result.updowncasts){
- for (var i = 0; i < result.updowncasts.length; i++) {
- if (result.updowncasts[i].udc_kind == '上游') {
- state.tab6.push(result.updowncasts[i])
- } else {
- state.tab6_2.push(result.updowncasts[i])
- }
- }
- }
- state.tab7=[];
- state.tab8=[];
- state.tab9=[];
- state.tab10=[];
- state.tab11=[];
- state.tab12=[];
- state.tab13=[];
- state.tab14=[];
- state.tab15=[];
- if(result && result.accountInfoList){
- for (var i = 0; i < result.accountInfoList.length; i++) {
- if (result.accountInfoList[i].ai_kind == '应收账款') {
- state.tab7.push(result.accountInfoList[i]);
- } else if (result.accountInfoList[i].ai_kind == '其他应收账款') {
- state.tab8.push(result.accountInfoList[i]);
- console.log('tab8',state.tab8)
- } else if (result.accountInfoList[i].ai_kind == '预付账款') {
- state.tab9.push(result.accountInfoList[i]);
- } else if (result.accountInfoList[i].ai_kind == '固定资产') {
- state.tab10.push(result.accountInfoList[i]);
- } else if (result.accountInfoList[i].ai_kind == '存货') {
- state.tab11.push(result.accountInfoList[i]);
- } else if (result.accountInfoList[i].ai_kind == '短期借款') {
- state.tab12.push(result.accountInfoList[i]);
- } else if (result.accountInfoList[i].ai_kind == '应付账款') {
- state.tab13.push(result.accountInfoList[i]);
- } else if (result.accountInfoList[i].ai_kind == '其他应付账款') {
- state.tab14.push(result.accountInfoList[i]);
- } else {
- state.tab15.push(result.accountInfoList[i]);
- }
- }
- }
- state.mfmodal=[]
- if(result && result.mfCustInfos){
- for (var i = 0; i < result.mfCustInfos.length; i++) {
- state.mfmodal.push(result.mfCustInfos[i]);
- Vue.set(this.state.mfmodal[i], 'show', true)
- }
- }
- },
- // 客户上传的附件
- setCustFiles: function (state, res) {
- state.custFiles = res || []
- },
- //获取保理申请单
- getApplyList:function(state,result){
- state.applylist = result
- },
- //获取出账申请单
- getCreditList:function(state,result){
- state.credit = result;
- },
- getTransferList:function(state,result){
- state.transfer = result
- },
- //查看买方客户详情
- infoMfmodal(state,index) {
- for (var i = 0; i < state.mfmodal.length; i++) {
- Vue.set(state.mfmodal[i],'show',false)
- }
- Vue.set(state.mfmodal[index],'show',true)
- state.openmf = true;
- },
- addtransfer: function (state) {
- var a = window.location.href;
- var index = a.lastIndexOf("=");
- var creditId = a.substring(index + 1, a.length);
- var b = {
- aa_billamount: 0,
- aa_transferamount: '',
- aa_dueamount: '',
- aa_saamount: 0,
- aa_maturitydate: '',
- indate: '',
- aa_iscloseoff: '',
- fsSaleList: [],
- receipts: [],
- attaches: [],
- show: true,
- cq_id: creditId,
- id: '',
- erpstatus: '',
- status: ''
- }
- state.transfer.push(b)
- for (var i = 0; i < state.transfer.length - 1; i++) {
- state.transfer[i].show = false;
- }
- state.openTransfer = true
- },
- //给保理模态框设置客户资料id
- setModalId:function(state,id){
- state.apply.cusId = id
- },
- //给客户基础资料从表设置id
- setCusId:function(state){
- state.apply.cusId = state.tab1.id;
- for (var i = 0; i < state.tab2.length; i++) {
- state.tab2[i].cusId = state.tab1.id;
- }
- },
- setPage1Id:function(state,id){
- state.tab1.id = id
- },
- //设置保理单id
- setApplyId:function(state,id){
- state.apply.id = id;
- },
- //保存完,将返回的id赋给他们
- setcustomer:function(state,response){
- state.tab1 = response
- },
- setShareId:function(state,response){
- for (var i = 0; i < response.data.length; i++) {
- state.tab2[i] = response.data[i];
- }
- },
- setAssociate:function(state,response){
- for (var i = 0; i < response.data.length; i++) {
- state.tab3[i] = response.data[i];
- }
- },
- setChangeInstruction:function(state,response){
- state.changeInstruction = response
- },
- setExcutive:function(state,response){
- state.tab4 = response
- },
- setBusinessCon:function(state,response){
- state.condition = response
- },
- setProductmix:function (state,response) {
- state.tab5 = response
- },
- setUpdowncast:function(state,response){
- state.tab6 = response;
- },
- setUpdowncast2:function(state,response){
- state.tab6_2 = response;
- },
- setAccountInfo1:function(state,response){
- state.tab7 = response
- },
- setFinanceCondition:function(state,response){
- state.financecondition = response
- },
- setAccountInfo2:function(state,response){
- state.tab8 = response
- },
- setAccountInfo3:function (state,response) {
- state.tab9 = response
- },
- setAccountInfo4:function (state,response) {
- state.tab10 = response
- },
- setAccountInfo5:function (state,response) {
- state.tab11 = response
- },
- setAccountInfo6:function(state,response){
- state.tab12 = response
- },
- setAccountInfo7:function(state,response){
- state.tab13 = response
- },
- setAccountInfo8:function(state,response){
- state.tab14 = response
- },
- setAccountInfo9:function(state,response){
- state.tab15 = response
- },
- setMf:function(state,payload){
- state.mfmodal[payload.index] = payload.response
- console.log('模态框里面买方的数据',payload.response)
- },
- setMfDetail:function (state,payload) {
- state.mfmodal[payload.index].mfCustInfoDetailList = payload.response
- },
- infotransfer:function(state,index){
- let _this = this;
- //只展示点击查看的出账申请
- for (var i = 0; i < state.transfer.length; i++) {
- state.transfer[i].show = false
- }
- state.transfer[index].show = true;
- state.openTransfer = true
- },
- //关闭出账申请弹框
- cancleTransfer:function(state){
- state.openTransfer = false
- },
- addfsSale:function(state,index){
- state.transfer[index].fsSaleList.push({
- sa_contractno:'',
- sa_contractamount:'',
- sa_code:'',
- sa_total:'',
- sa_payment:'',
- id:'',
- aa_id:'',
- })
- },
- //删除合同
- deleteFsSale:function(state,params){
- state.transfer[params.index].fsSaleList.splice(params.index1,1)
- },
- addreceipt:function(state,index){
- state.transfer[index].receipts.push({
- aai_billdate:'',
- aai_invoiceno:'',
- aai_salesno:'',
- aai_amount:'',
- id:'',
- aa_id:'',
- })
- },
- //删除发票
- deleteReceipt:function(state,params){
- state.transfer[params.index].receipts.splice(params.index2,1)
- },
- //查找英唐保理下所有客户资料
- showbaolilist:function(state,params){
- state.baolilist = params
- },
- },
- actions:{
- // 全局服务初始化
- nuxtServerInit (store, { params, route, isDev, req }) {
- let _this = this;
- store.state.route.query = route.query
- store.state.route.path = req.headers.host
- // Get user info from java server-
- return Promise.all([
- store.dispatch('loadUserInfo'),
- ])
- },
- // 获取用户信息
- loadUserInfo (store={}) {
- return this.$axios.get('/sso/account')
- .then(response => {
- if(response.data.success){
- store.state.option.user.enuu = response.data.content.spaceUU
- store.state.option.user.compamy = response.data.content.spaceName
- store.state.option.user.name = response.data.content.vipName
- store.state.option.user.logged=true
- if(store.state.option.user.enuu == '10046945'){
- store.state.showcustlist = true
- }
- return this.$axios.get('/financeapply/getHistory',{params:{ enuu: store.state.option.user.enuu }})
- .then(response => {
- //如果有客户资料则直接取出
- console.log('进入getcustomer')
- store.commit('getCustomer',response.data)
- }, err => {
- console.log(err)
- })
- }
- }).catch(error => {
- console.log('error'+error)
- })
- },
- // 用户退出
- logout ({ commit }) {
- return axios.get('/logout')
- .then(response => {
- commit('option/REQUEST_LOGOUT_SUCCESS', response.data)
- })
- },
- findNew({commit},params={}){
- return this.$axios.get('/customer/findnew',{params:params})
- .then(function (response) {
- if (response.data) {
- //没有客户资料则弹出弹框
- commit('openAuth')
- }
- }).catch(function (error) {
- // alert('判断是否有客户资料失败')
- });
- },
- agreeApply(store){
- let _this = this
- this.$axios.post('/customer/save',store.state.tab1)
- .then(function(response){
- //设置模态框客户资料id
- store.commit('setModalId',response.data.id)
- //设置page1的id
- store.commit('setPage1Id',response.data.id)
- _this.$axios.post('/financeapply/save', store.state.apply)
- .then(function (response) {
- store.commit('setApplyId',response.data.id)
- alert('保存成功');
- store.commit('closeApply')
- }).catch(function () {
- alert('保存失败');
- })
- }).catch(function(){
- alert('保存失败')
- })
- },
- //保存客户资料基础资料
- savepage1(params){
- let _this = this;
- return this.$axios.post(`/customer/save`,params.state.tab1)
- .then(response => {
- params.commit('setPage1Id',response.data.id)
- alert('保存成功')
- }, err => {
- alert('保存失败')
- })
- },
- //保存客户资料股东构成
- savepage2(params = {}){
- params.commit('setCusId')
- return this.$axios.post('/shareholders/save',params.state.tab2)
- .then(response => {
- params.commit('setShareId',response)
- alert('保存成功')
- }, err => {
- alert('保存失败')
- })
- },
- //保存客户资料主要关联企业
- savepage3(params={}){
- for (var i = 0; i < params.state.tab3.length; i++) {
- params.state.tab3[i].cusId = params.state.tab1.id;
- }
- return this.$axios.post('/associate/save',params.state.tab3)
- .then(response => {
- params.commit('setAssociate',response)
- alert('保存成功')
- }, err => {
- alert('保存失败')
- })
- },
- //保存客户资料高管信息
- savepage4(params = {}){
- let _this = this;
- for (var i = 0; i < params.state.tab4.length; i++) {
- params.state.tab4[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.changeInstruction.length; i++) {
- params.state.changeInstruction[i].cusId = params.state.tab1.id;
- }
- this.$axios.post('/customer/save',params.state.tab1)
- .then(response =>{
- params.commit('setcustomer',response.data)
- savechange()
- },err=>{
- alert('保存失败')
- })
- var savechange = function(){
- _this.$axios.post('/changesInstruction/save',params.state.changeInstruction)
- .then(response =>{
- params.commit('setChangeInstruction',response.data)
- _this.$axios.post('/customerexcutive/save', params.state.tab4)
- .then(function (response) {
- params.commit('setExcutive',response.data)
- alert('保存成功');
- })
- .catch(function (error) {
- alert('保存管理层背景失败');
- });
- },err=>{
- alert('保存失败')
- })
- }
- },
- //保存客户资料经营情况
- savepage5(params={}){
- let _this = this;
- //设置外键值
- params.state.condition.cusId = params.state.tab1.id;
- for (var i = 0; i < params.state.tab5.length; i++) {
- params.state.tab5[i].cusId = params.state.tab1.id;
- }
- //保存经营情况描述
- return this.$axios.post('/businesscondition/save',params.state.condition)
- .then(function (response) {
- params.commit('setBusinessCon',response.data)
- _this.$axios.post('/productmix/save', params.state.tab5)
- .then(function (response) {
- params.commit('setProductmix',response.data)
- alert('保存成功');
- })
- .catch(function (error) {
- alert('保存经营情况失败');
- });
- }),err=>{
- alert('保存经营情况描述失败');
- }
- },
- //保存客户资料贸易流程
- savepage6(params={}){
- let _this = this;
- //设置外键值
- params.state.condition.cusId = params.state.tab1.id;
- for (var i = 0; i < params.state.tab6.length; i++) {
- params.state.tab6[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab6_2.length; i++) {
- params.state.tab6_2[i].cusId = params.state.tab1.id;
- }
- //保存贸易情况描述
- this.$axios.post('/businesscondition/save', params.state.condition)
- .then(function (response) {
- params.commit('setBusinessCon',response.data)
- //保存前五大供应商
- _this.$axios.post('/updowncast/save', params.state.tab6)
- .then(function (response) {
- params.commit('setUpdowncast',response.data)
- //保存前五大客户
- _this.$axios.post('/updowncast/save', params.state.tab6_2)
- .then(function (response) {
- params.commit('setUpdowncast2',response.data)
- alert('保存成功');
- })
- .catch(function (error) {
- alert('保存前五大客户失败');
- });
- })
- .catch(function (error) {
- alert('保存前五大供应商失败');
- });
- })
- .catch(function (error) {
- alert('保存贸易情况描述失败');
- });
- },
- savepage7(params={}){
- let _this = this;
- //设置资产科目明细外键
- for (var i = 0; i < params.state.tab7.length; i++) {
- params.state.tab7[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab8.length; i++) {
- params.state.tab8[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab9.length; i++) {
- params.state.tab9[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab10.length; i++) {
- params.state.tab10[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab11.length; i++) {
- params.state.tab11[i].cusId = params.state.tab1.id;
- }
- params.state.financecondition.cusId = params.state.tab1.id;
- //以下都是保存财务数据
- this.$axios.post('/accountinfo/save', params.state.tab7)
- .then(function (response) {
- params.commit('setAccountInfo1',response.data)
- a1();
- })
- .catch(function (error) {
- alert('保存应收账目详情失败');
- });
- var a1 = function () {
- if (params.state.financecondition.year != undefined && params.state.financecondition.month != undefined) {
- if (params.state.financecondition.month.length == 1) {
- params.state.financecondition.fc_yeatmonth = params.state.financecondition.year + '0' + params.state.financecondition.month;
- } else {
- params.state.financecondition.fc_yeatmonth = params.state.financecondition.year + params.state.financecondition.month;
- }
- }
- //财务情况说明
- _this.$axios.post('/financecondition/save', params.state.financecondition)
- .then(function (response) {
- params.commit('setFinanceCondition',response.data)
- b1();
- })
- .catch(function (error) {
- alert('保存财务情况说明失败');
- });
- }
- var b1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab8)
- .then(function (response) {
- params.commit('setAccountInfo2',response.data)
- c1();
- })
- .catch(function (error) {
- alert('保存其他应收账款失败');
- });
- }
- var c1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab9)
- .then(function (response) {
- params.commit('setAccountInfo3',response.data)
- d1();
- })
- .catch(function (error) {
- alert('保存预付账款失败');
- });
- }
- var d1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab10)
- .then(function (response) {
- params.commit('setAccountInfo4',response.data)
- e1();
- })
- .catch(function (error) {
- alert('保存固定资产失败');
- });
- }
- var e1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab11)
- .then(function (response) {
- params.commit('setAccountInfo5',response.data)
- alert('保存成功');
- })
- .catch(function (error) {
- alert('保存存货失败');
- });
- }
- },
- //保存负债科目明细v
- savepage8(params={}){
- let _this = this;
- //给以下表设置客户基础资料主键id
- for (var i = 0; i < params.state.tab12.length; i++) {
- params.state.tab12[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab13.length; i++) {
- params.state.tab13[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab14.length; i++) {
- params.state.tab14[i].cusId = params.state.tab1.id;
- }
- for (var i = 0; i < params.state.tab15.length; i++) {
- params.state.tab15[i].cusId = params.state.tab1.id;
- }
- params.state.financecondition.cusId = params.state.tab1.id;
- //保存财务数据
- this.$axios.post('/accountinfo/save', params.state.tab12)
- .then(function (response) {
- params.commit('setAccountInfo6',response.data)
- a1();
- }),err=>{
- alert('保存短期借款失败');
- }
- var a1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab13)
- .then(function (response) {
- params.commit('setAccountInfo7',response.data)
- b1();
- }),err=>{
- alert('保存应付账款失败');
- }
- };
- var b1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab14)
- .then(function (response) {
- params.commit('setAccountInfo8',response.data)
- c1();
- }),err=>{
- alert('保存其他应付账款失败');
- }
- }
- var c1 = function () {
- _this.$axios.post('/financecondition/save', params.state.financecondition)
- .then(function (response) {
- params.commit('setFinanceCondition',response.data)
- d1();
- }),err=>{
- alert('保存说明失败');
- }
- }
- var d1 = function () {
- _this.$axios.post('/accountinfo/save', params.state.tab15)
- .then(function (response) {
- params.commit('setAccountInfo9',response.data)
- alert('保存成功');
- }),err=>{
- alert('保存长期借款失败');
- }
- }
- },
- // 保存买方客户信息
- savepage9(params={}) {
- let _this = this;
- var index;
- for (var i = 0; i < params.state.mfmodal.length; i++) {
- if (params.state.mfmodal[i].show == true) {
- params.state.mfmodal[i].cusId = params.state.tab1.id;
- index = i;
- }
- }
- this.$axios.post('/mfcustinfo/save', params.state.mfmodal[index])
- .then(function (response) {
- for (var i = 0; i < params.state.mfmodal[index].mfCustInfoDetailList.length; i++) {
- params.state.mfmodal[index].mfCustInfoDetailList[i].mfId = response.data.id;
- }
- _this.$axios.post('/mfcustinfodetail/save', params.state.mfmodal[index].mfCustInfoDetailList)
- .then(function (response) {
- params.commit('setMfDetail',{response:response.data,index:index})
- alert('保存成功')
- params.commit('cancleMf');
- })
- .catch(function (error) {
- params.commit('cancleMf');
- alert('保护近三年双方交易情况失败');
- });
- })
- .catch(function (error) {
- params.commit('cancleMf');
- alert('保存买方客户失败');
- });
- },
- //保理申请保存
- saveapply: function (context) {
- context.commit('setCusId',context.state.tab1.id)
- return this.$axios.post('/financeapply/save', context.state.apply)
- .then(function (response) {
- context.state.apply = response.data
- alert('保存成功')
- }).catch(function () {
- alert('保存失败');
- })
- },
- //正式提交
- submitinfo: function (context) {
- return this.$axios.post('/financeapply/submit', context.state.apply)
- .then(function (response) {
- alert('成功提交');
- })
- .catch(function (error) {
- alert('提交失败');
- });
- },
- //获取登录人所有的金融保理单
- findApplyList:function({commit},params = {}){
- //找到登录人申请过的所有保理申请单
- return this.$axios.get('/financeapply/findByEnuu',{params:params})
- .then(response => {
- commit('getApplyList',response.data)
- }, err => {
- console.log(err)
- })
- },
- //相关文件下载
- download: function (context) {
- window.open("http://"+context.state.route.path+"/attach/download?fauu=10046945");
- },
- //查找登录用户下所有买方客户额度
- findCredit:function({store,commit},params = {}){
- return this.$axios.get('/sellerquota/findAll',{params:params})
- .then(response => {
- commit('getCreditList',response.data)
- }, err => {
- console.log(err)
- })
- },
- getId:function(){
- var a = window.location.href;
- var index = a.lastIndexOf("=");
- if(index>0){
- var creditId = a.substring(index+1,a.length);
- return creditId;
- }
- },
- //查找某买方客户的所有出账申请
- findTransfer:function(context){
- return this.$axios.get("/accountapply/find",{params:{id:context.state.route.query.id}})
- .then(function(response){
- context.commit('getTransferList',response.data)
- }).catch(function(){
- alert('查找失败')
- })
- },
- infoTransfer:function(transfer,index){
- //只展示点击查看的出账申请
- for (var i = 0; i < state.transfer.length; i++) {
- _this.transfer[i].show = false || _this.$set(_this.transfer[i], 'show', false)
- }
- this.transfer[index].show = true;
- return this.$axios.get('/accountapply/findone',{params:{aaid:this.transfer[index].id}})
- .then(function(response){
- _this.aafileList0=[]
- _this.aafileList1=[]
- _this.aafileList2=[]
- _this.aafileList3=[]
- _this.attaches=[]
- for(var i=0;i<response.data.length;i++){
- if(response.data[i].type=='交易买方贸易合同'){
- _this.aafileList0.push(response.data[i])
- }else if(response.data[i].type=='增值税发票'){
- _this.aafileList1.push(response.data[i])
- }else if(response.data[i].type=='货运单据'){
- _this.aafileList2.push(response.data[i])
- }else if(response.data[i].type=='其他'){
- _this.aafileList3.push(response.data[i])
- }
- }
- }).catch(function(){
- })
- },
- //打开新的应收账款转让窗口
- openTransfer:function(context,params={}){
- window.open("http://"+context.state.route.path+"/transfer/transferList?id="+params.id);
- },
- savetransfer: function(context,params={}) {
- let _this = this;
- //保存出账申请单
- this.$axios.post('/accountapply/save', params)
- .then(function (response) {
- //设置合同和支票的出账单外键
- for (var i = 0; i < params.fsSaleList.length; i++) {
- params.fsSaleList[i].aa_id = response.data.id;
- }
- for (var i = 0; i < params.receipts.length; i++) {
- params.receipts[i].aa_id = response.data.id;
- }
- savefssale();
- }).catch(function () {
- alert('保存失败')
- })
- var savefssale = function () {
- _this.$axios.post('/fssale/save', params.fsSaleList)
- .then(function (response) {
- savereceipt()
- }).catch(function () {
- alert("保存合同失败")
- })
- }
- var savereceipt = function () {
- _this.$axios.post('/receipt/save', params.receipts)
- .then(function (response) {
- alert('保存成功')
- context.commit('cancleTransfer');
- location.reload()
- }).catch(function () {
- alert("保存发票失败")
- })
- }
- },
- //提交出账申请转让
- submittransfer: function (context,params={}) {
- let _this = this;
- var num = 0;
- for (var j = 0; j < params.fsSaleList.length; j++) {
- if (params.fsSaleList[j].sa_code != '') {
- num++;
- }
- }
- if (!params.aa_transferamount) {
- alert('保理转让款不能为空')
- } else if (!params.aa_dueamount) {
- alert('保理首付款不能为空')
- } else if (params.aa_dueamount > params.aa_transferamount) {
- alert('保理首付款不能大于保理转让款')
- } else if (!params.aa_maturitydate) {
- alert('应收账款到期日不能为空')
- } else if (params.fsSaleList.length == 0) {
- alert('合同不能为空')
- } else if (params.fsSaleList.length > num) {
- alert('合同订单编号不能为空')
- } else {
- this.$axios.post('/accountapply/submit', params)
- .then(function (response) {
- //设置合同和支票的出账单外键
- for (var i = 0; i < params.fsSaleList.length; i++) {
- params.fsSaleList[i].aa_id = response.data.id;
- }
- for (var i = 0; i < params.receipts.length; i++) {
- params.receipts[i].aa_id = response.data.id;
- }
- params = response.data
- savefssale();
- }).catch(function () {
- })
- var savefssale = function () {
- _this.$axios.post('/fssale/save', params.fsSaleList)
- .then(function (response) {
- savereceipt()
- }).catch(function () {
- alert("保存合同失败")
- })
- }
- var savereceipt = function () {
- _this.$axios.post('/receipt/save', params.receipts)
- .then(function (response) {
- alert('保存成功')
- context.commit('cancleTransfer');
- location.reload()
- }).catch(function () {
- alert("保存发票失败")
- })
- }
- }
- },
- //展示英唐保理下所有单据
- showbaolilist:function (state,params) {
- return this.$axios.get('/financeapply/findAll')
- .then(function(response){
- state.commit('showbaolilist',response.data)
- })
- },
- //展示客户资料详情
- showcustdetail:function (context,params) {
- window.open("http://"+context.state.route.path+"/checkcustinfo/checkcust?id="+params);
- },
- //查找某一具体客户信息
- findcustomer:function (context,params) {
- return this.$axios.get('/customer/findone?id='+context.state.route.query.id)
- .then(function(response){
- context.commit('findcust',response.data)
- })
- },
- findCustomerFiles: function (context, params) {
- return this.$axios.get('/attach/findattaches?cuId='+context.state.route.query.id)
- .then(function(response){
- context.commit('setCustFiles',response.data)
- })
- },
- //客户经理确认客户资料
- checkinfo:function (state,params) {
- return this.$axios.post('/financeapply/checkinfo?id='+params)
- .then(function(response){
- alert('确认客户资料成功');
- window.location.reload();
- })
- }
- }
- })
- export default store
|