index.js 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import axios from 'axios'
  4. import _ from 'lodash'
  5. import * as uiv from 'uiv'
  6. Vue.use(uiv)
  7. Vue.use(Vuex)
  8. const store = () => new Vuex.Store({
  9. state: {
  10. //路由
  11. route:{
  12. path:'',
  13. query:''
  14. },
  15. option:{
  16. userAgent: '',
  17. // 是否移动端
  18. isMobile: false,
  19. // 身份token
  20. cookies: '',
  21. // 用户身份SessionId
  22. sessionId: '',
  23. // 用户信息
  24. user: {
  25. // 是否登录
  26. logged: false,
  27. fetching: false,
  28. compamy:'',//登录公司名
  29. name:'',//登录人姓名
  30. enuu:'',//公司UU
  31. data: {}
  32. },
  33. // 系统设置
  34. globalOptions: {
  35. fetching: false,
  36. data: {}
  37. }
  38. },
  39. //保理申请单
  40. apply: {
  41. cusId: '',
  42. id: '',
  43. fa_contact: '',
  44. fa_telphone: '',
  45. fa_phone: '',
  46. fa_appamount: '',
  47. fa_facorpname: '',
  48. fa_enname: '',
  49. submitTime:'',
  50. checkinfo:''
  51. },
  52. //单个上传的附件
  53. attach1:{type: '', applyId: '', uid: ''},
  54. //存储所有附件
  55. attach:[],
  56. //附件1
  57. fileList0: [],
  58. //附件2
  59. fileList1: [],
  60. fileList2: [],
  61. fileList3: [],
  62. fileList4: [],
  63. fileList5: [],
  64. fileList6: [],
  65. fileList7: [],
  66. fileList8: [],
  67. fileList9: [],
  68. fileList10: [],
  69. fileList11: [],
  70. fileList12: [],
  71. fileList13: [],
  72. fileList14: [],
  73. fileList15: [],
  74. fileList16: [],
  75. fileList17: [],
  76. fileList18: [],
  77. fileList19: [],
  78. fileList20: [],
  79. fileList21: [],
  80. fileList22: [],
  81. //出账申请下附件
  82. aafileList0 : [],
  83. aafileList1 : [],
  84. aafileList2 : [],
  85. aafileList3 : [],
  86. applyModal:false,
  87. visible: false,
  88. num: 0,
  89. tabInfo: {},
  90. info: '客户资料填写',
  91. tabs: [
  92. '客户基础资料',
  93. '股东构成',
  94. '主要关联企业',
  95. '高管信息',
  96. '经营状况',
  97. '贸易流程',
  98. '资产科目明细(上半年末)',
  99. '负债科目明细(上半年末)',
  100. '买方客户信息'
  101. ],
  102. //买方用户
  103. mfmodal: [],
  104. // 客户资料,给表单默认为空的填写框,同下
  105. tab1: {
  106. id: '',
  107. cu_officeadd: '',
  108. cu_name: '',
  109. cu_engname: '',
  110. cu_enterptype: '',
  111. cu_licensedate: '',
  112. cu_paperstype: '',
  113. cu_regcapital: '',
  114. cu_institutype: '',
  115. cu_paperscode: '',
  116. cu_ctfduedate: '',
  117. cu_businesscode: '',
  118. cu_nastdinducls: '',
  119. cu_capcurrency: '',
  120. cu_paidincapital: '',
  121. cu_regadd: '',
  122. cu_businsscope: '',
  123. cu_others: '',
  124. cu_highestauthority: '',
  125. cu_employeesnum: '',
  126. cu_departsituation: '',
  127. isDisabled: false
  128. },
  129. // 股东构成
  130. tab2: [{
  131. cusId:'', id: '', cs_name: '', cs_paperstype: '', cs_paperscode: '',
  132. cs_investratio: '', cs_investamount: '', isDisabled: false
  133. }],
  134. // 主要关联企业
  135. tab3: [{
  136. id: '',
  137. cusId: '',
  138. cud_name: '',
  139. cud_association: '',
  140. cud_legalperson: '',
  141. cud_ratio: '',
  142. cud_product: '',
  143. cud_amount: '',
  144. isDisabled: false
  145. }],
  146. // 管理层背景
  147. tab4: [{
  148. cusId: '',
  149. id: '',
  150. ce_name: '',
  151. ce_sex: '',
  152. ce_paperstype: '',
  153. ce_paperscode: '',
  154. ce_education: '',
  155. ce_position: '',
  156. ce_stwkfpo: '',
  157. ce_workeyears: '',
  158. ce_nowaddress: '',
  159. ce_woekexper: '',
  160. isDisabled: false
  161. }],
  162. // 经营描述
  163. condition: {bc_bcremark: '', bc_sweaterprocess: '', cusId: '', id: ''},
  164. // 经营情况
  165. tab5: [{
  166. cusId: '',
  167. id: '',
  168. pm_kind: '',
  169. pm_tannualrevenue: '',
  170. pm_tratio: '',
  171. pm_annualrevenue: '',
  172. pm_ratio: '',
  173. isDisabled: false
  174. }],
  175. // 应收账款表单
  176. tab7: [],
  177. // 其他应收账款
  178. tab8: [],
  179. // 预付账款
  180. tab9: [],
  181. // 固定资产
  182. tab10: [],
  183. // 存货
  184. tab11: [],
  185. // 短期借款
  186. tab12: [],
  187. // 应付账款
  188. tab13: [],
  189. // 其他应付账款
  190. tab14: [],
  191. // 长期借款
  192. tab15: [],
  193. // 经营情况描述
  194. financecondition: {
  195. cusId: '',
  196. id: '',
  197. fc_arbalance: '',
  198. fc_agingamount1: '',
  199. fc_agingamount2: '',
  200. fc_agingamount4: '',
  201. fc_agingamount3: '',
  202. fc_apremark: '',
  203. year: '',
  204. month: '',
  205. fc_yeatmonth: '',
  206. isDisabled: false
  207. },
  208. // 变更信息
  209. changeInstruction: [{
  210. cusId: '',
  211. id: '',
  212. cd_type: '股东',
  213. cs_date: '',
  214. cs_before: '',
  215. cs_after: '',
  216. isDisabled: false
  217. }, {
  218. cusId: '',
  219. id: '',
  220. cd_type: '法人',
  221. cs_date: '',
  222. cs_before: '',
  223. cs_after: '',
  224. isDisabled: false
  225. }, {
  226. cusId: '',
  227. id: '',
  228. cd_type: '住所',
  229. cs_date: '',
  230. cs_before: '',
  231. cs_after: '',
  232. isDisabled: false
  233. }],
  234. // 前五大供应商
  235. tab6 :[{
  236. cusId: '',
  237. id: '',
  238. udc_name: '',
  239. udc_product: '',
  240. udc_lastyear: '',
  241. udc_thisyear: '',
  242. udc_payment: '',
  243. udc_cooperationyears: '',
  244. udc_kind: '上游'
  245. }, {
  246. cusId: '',
  247. id: '',
  248. udc_name: '',
  249. udc_product: '',
  250. udc_lastyear: '',
  251. udc_thisyear: '',
  252. udc_payment: '',
  253. udc_cooperationyears: '',
  254. udc_kind: '上游'
  255. },
  256. {
  257. cusId: '',
  258. id: '',
  259. udc_name: '',
  260. udc_product: '',
  261. udc_lastyear: '',
  262. udc_thisyear: '',
  263. udc_payment: '',
  264. udc_cooperationyears: '',
  265. udc_kind: '上游'
  266. },
  267. {
  268. cusId: '',
  269. id: '',
  270. udc_name: '',
  271. udc_product: '',
  272. udc_lastyear: '',
  273. udc_thisyear: '',
  274. udc_payment: '',
  275. udc_cooperationyears: '',
  276. udc_kind: '上游'
  277. },
  278. {
  279. cusId: '',
  280. id: '',
  281. udc_name: '',
  282. udc_product: '',
  283. udc_lastyear: '',
  284. udc_thisyear: '',
  285. udc_payment: '',
  286. udc_cooperationyears: '',
  287. udc_kind: '上游'
  288. }],
  289. // 前五大客户商
  290. tab6_2: [{
  291. cusId: '',
  292. id: '',
  293. udc_name: '',
  294. udc_product: '',
  295. udc_lastyear: '',
  296. udc_thisyear: '',
  297. udc_payment: '',
  298. udc_cooperationyears: '',
  299. udc_kind: '下游'
  300. },
  301. {
  302. cusId: '',
  303. id: '',
  304. udc_name: '',
  305. udc_product: '',
  306. udc_lastyear: '',
  307. udc_thisyear: '',
  308. udc_payment: '',
  309. udc_cooperationyears: '',
  310. udc_kind: '下游'
  311. },
  312. {
  313. cusId: '',
  314. id: '',
  315. udc_name: '',
  316. udc_product: '',
  317. udc_lastyear: '',
  318. udc_thisyear: '',
  319. udc_payment: '',
  320. udc_cooperationyears: '',
  321. udc_kind: '下游'
  322. },
  323. {
  324. cusId: '',
  325. id: '',
  326. udc_name: '',
  327. udc_product: '',
  328. udc_lastyear: '',
  329. udc_thisyear: '',
  330. udc_payment: '',
  331. udc_cooperationyears: '',
  332. udc_kind: '下游'
  333. },
  334. {
  335. cusId: '',
  336. id: '',
  337. udc_name: '',
  338. udc_product: '',
  339. udc_lastyear: '',
  340. udc_thisyear: '',
  341. udc_payment: '',
  342. udc_cooperationyears: '',
  343. udc_kind: '下游'
  344. }],
  345. show: [
  346. {isshow: true},
  347. {isshow: true},
  348. {isshow: true},
  349. {isshow: true},
  350. {isshow: true},
  351. {isshow: true},
  352. {isshow: true},
  353. {isshow: true},
  354. {isshow: true},
  355. {isshow: true},
  356. {isshow: true},
  357. {isshow: true},
  358. {isshow: true},
  359. {isshow: true},
  360. ],
  361. open:false,
  362. //买方模态框打开状态
  363. openmf:false,
  364. //出账申请单模态框打开状态
  365. openTransfer:false,
  366. //授权书打开状态
  367. openAuth:false,
  368. //保理申请弹框打开状态
  369. openApply:false,
  370. //附件1
  371. fileList: [],
  372. //附件2
  373. fileList0: [],
  374. //附件3
  375. fileList1: [],
  376. fileList2: [],
  377. fileList3: [],
  378. fileList4: [],
  379. fileList5: [],
  380. fileList6: [],
  381. fileList7: [],
  382. fileList8: [],
  383. fileList9: [],
  384. fileList10: [],
  385. fileList11: [],
  386. fileList12: [],
  387. fileList13: [],
  388. fileList14: [],
  389. fileList15: [],
  390. fileList16: [],
  391. fileList17: [],
  392. fileList18: [],
  393. fileList19: [],
  394. fileList20: [],
  395. fileList21: [],
  396. fileList22: [],
  397. //买方用户额度列表
  398. credit:[],
  399. //英唐保理客户列表
  400. baolilist:[],
  401. //判断要不要展示客户资料列表
  402. showcustlist:false,
  403. //申请列表
  404. applylist:[],
  405. //出账申请列表
  406. transfer:[],
  407. //可以保存
  408. cansave:true,
  409. //已经被客户经理确认
  410. checkinfo:false,
  411. //出账转让所有附件
  412. array:[],
  413. //出账转让单个附件
  414. attach2:{type:'',aaid:'',name:'',size:'',path:'',id:''},
  415. custFiles: []
  416. },
  417. mutations: {
  418. login(state){
  419. state.option.user.logged=true
  420. },
  421. //左侧菜单栏打开与关闭
  422. openmenu(state){
  423. state.open = state.open ? false :true;
  424. },
  425. openAuth:function(state){
  426. state.openAuth = true
  427. },
  428. //同意企业征信授权
  429. agreeAuth:function(state){
  430. state.openAuth = false
  431. state.openApply = true
  432. },
  433. //关闭企业授权
  434. closeAuth:function (state) {
  435. state.openAuth = false
  436. },
  437. //关闭保理申请弹框
  438. closeApply:function(state){
  439. state.openApply = false
  440. },
  441. //tab标签的显示与隐藏
  442. changeShow(state,table) {
  443. state.show[table.index].isshow = state.show[table.index].isshow ? false : true
  444. },
  445. // 以下都是给表格增加一行新数据功能
  446. addtab2 (state) {
  447. state.tab2.push({
  448. cs_name: '',
  449. cs_paperstype: '',
  450. cs_paperscode: '',
  451. cs_investratio: '',
  452. cs_investamount: '',
  453. isDisabled:false
  454. })
  455. },
  456. addtab3(state) {
  457. state.tab3.push({
  458. cud_name: '',
  459. cud_association: '',
  460. cud_legalperson: '',
  461. cud_ratio: '',
  462. cud_product: '',
  463. cud_amount: '',
  464. isDisabled:false
  465. })
  466. },
  467. addtab4: function (state) {
  468. state.tab4.push({
  469. cusId: '',
  470. id: '',
  471. ce_name: '',
  472. ce_sex: '',
  473. ce_paperstype: '',
  474. ce_paperscode: '',
  475. ce_education: '',
  476. ce_position: '',
  477. ce_stwkfpo: '',
  478. ce_workeyears: '',
  479. ce_nowaddress: '',
  480. ce_woekexper: '',
  481. isDisabled:false
  482. });
  483. },
  484. addtab5(state) {
  485. state.tab5.push({
  486. cusId: '',
  487. id: '',
  488. pm_kind: '',
  489. pm_tannualrevenue: '',
  490. pm_tratio: '',
  491. pm_annualrevenue: '',
  492. pm_ratio: '',
  493. isDisabled:false
  494. });
  495. },
  496. addtab7(state) {
  497. state.tab7.push(
  498. {
  499. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  500. ai_kind: '应收账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  501. })
  502. },
  503. addtab8(state) {
  504. state.tab8.push(
  505. {
  506. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  507. ai_kind: '其他应收账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  508. })
  509. },
  510. addtab9 (state) {
  511. state.tab9.push(
  512. {
  513. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  514. ai_kind: '预付账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  515. })
  516. },
  517. addtab10(state) {
  518. state.tab10.push(
  519. {
  520. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  521. ai_kind: '固定资产', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  522. })
  523. },
  524. addtab11(state) {
  525. state.tab11.push(
  526. {
  527. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  528. ai_kind: '存货', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  529. })
  530. },
  531. addtab12(state) {
  532. state.tab12.push(
  533. {
  534. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  535. ai_kind: '短期借款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  536. })
  537. },
  538. addtab13(state) {
  539. state.tab13.push(
  540. {
  541. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  542. ai_kind: '应付账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  543. })
  544. },
  545. addtab14(state) {
  546. state.tab14.push(
  547. {
  548. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  549. ai_kind: '其他应付账款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  550. })
  551. },
  552. addtab15(state) {
  553. state.tab15.push({
  554. cusId: '', id: '', ai_cuname: '', ai_remark: '', ai_caname: '', ai_payment: '',
  555. ai_kind: '长期借款', ai_amount: '', ai_rate: '', ai_leftamount: '', ai_bank: '',isDisabled:false
  556. })
  557. },
  558. // 增加买方信息
  559. addMfmodal(state){
  560. var a = {
  561. cusId: '',
  562. id: '',
  563. mf_legrep: '',
  564. mf_custname: '',
  565. mf_credit: '',
  566. mf_regcapital: '',
  567. mf_addr: '',
  568. mf_estabtime: '',
  569. mf_contact: '',
  570. mf_contactnum: '',
  571. mf_fax: '',
  572. mf_email: '',
  573. mf_tradprod: '',
  574. mf_payterm: '',
  575. mf_shareholder: '',
  576. mf_businsscope: '',
  577. mf_coopohers: '',
  578. mf_hasinslimit: '',
  579. mf_balancebank: '',
  580. mf_bankaccount: '',
  581. mfCustInfoDetailList: [{
  582. id: '',
  583. mfd_year: '',
  584. mfd_amount: '',
  585. mfd_chargeamount: '',
  586. mfd_discountamount: '',
  587. mfd_overdue: '',
  588. mfId: '',
  589. }],
  590. show: true
  591. };
  592. state.mfmodal.push(a);
  593. for (var i = 0; i < (state.mfmodal.length - 1); i++) {
  594. state.mfmodal[i].show = false;
  595. }
  596. state.openmf = true;
  597. },
  598. // 增加买方客户列表
  599. addmfCustInfoDetailList(state,index) {
  600. state.mfmodal[index].mfCustInfoDetailList.push({
  601. id: '',
  602. mfd_year: '',
  603. mfd_amount: '',
  604. mfd_chargeamount: '',
  605. mfd_discountamount: '',
  606. mfd_overdue: '',
  607. mfId: '',
  608. isDisabled:false
  609. });
  610. },
  611. //关闭买方模态框
  612. cancleMf(state){
  613. state.openmf = false
  614. },
  615. //取出客户资料
  616. getCustomer:function(state,result) {
  617. state.tab1={
  618. id: '',
  619. cu_officeadd: '',
  620. cu_name: '',
  621. cu_engname: '',
  622. cu_enterptype: '',
  623. cu_licensedate: '',
  624. cu_paperstype: '',
  625. cu_regcapital: '',
  626. cu_institutype: '',
  627. cu_paperscode: '',
  628. cu_ctfduedate: '',
  629. cu_businesscode: '',
  630. cu_nastdinducls: '',
  631. cu_capcurrency: '',
  632. cu_paidincapital: '',
  633. cu_regadd: '',
  634. cu_businsscope: '',
  635. cu_others: '',
  636. cu_highestauthority: '',
  637. cu_employeesnum: '',
  638. cu_departsituation: '',
  639. isDisabled: false
  640. }
  641. if (result.customer != null) {
  642. state.tab1 = result.customer;
  643. }
  644. state.tab2 = [{
  645. cusId:'', id: '', cs_name: '', cs_paperstype: '', cs_paperscode: '',
  646. cs_investratio: '', cs_investamount: '', isDisabled: false
  647. }]
  648. if (result && result.customer && result.customer.shareholders) {
  649. state.tab2 = result.customer.shareholders
  650. }
  651. state.tab3 = [{
  652. id: '',
  653. cusId: '',
  654. cud_name: '',
  655. cud_association: '',
  656. cud_legalperson: '',
  657. cud_ratio: '',
  658. cud_product: '',
  659. cud_amount: '',
  660. isDisabled: false
  661. }]
  662. if(result && result.customer && result.customer.associateCompanies){
  663. state.tab3 = result.customer.associateCompanies;
  664. }
  665. state.tab4 = [{
  666. cusId: '',
  667. id: '',
  668. ce_name: '',
  669. ce_sex: '',
  670. ce_paperstype: '',
  671. ce_paperscode: '',
  672. ce_education: '',
  673. ce_position: '',
  674. ce_stwkfpo: '',
  675. ce_workeyears: '',
  676. ce_nowaddress: '',
  677. ce_woekexper: '',
  678. isDisabled: false
  679. }]
  680. if(result && result.customer && result.customer.customerExcutives){
  681. state.tab4 = result.customer.customerExcutives;
  682. }
  683. state.changeInstruction = [{
  684. cusId: '',
  685. id: '',
  686. cd_type: '股东',
  687. cs_date: '',
  688. cs_before: '',
  689. cs_after: '',
  690. isDisabled: false
  691. }, {
  692. cusId: '',
  693. id: '',
  694. cd_type: '法人',
  695. cs_date: '',
  696. cs_before: '',
  697. cs_after: '',
  698. isDisabled: false
  699. }, {
  700. cusId: '',
  701. id: '',
  702. cd_type: '住所',
  703. cs_date: '',
  704. cs_before: '',
  705. cs_after: '',
  706. isDisabled: false
  707. }]
  708. if (result && result.customer && result.customer.changesInstructions && result.customer.changesInstructions.length !=0 ) {
  709. state.changeInstruction = result.customer.changesInstructions;
  710. }
  711. state.condition = {bc_bcremark: '', bc_sweaterprocess: '', cusId: '', id: ''}
  712. if (result && result.customer && result.customer.businessCondition) {
  713. state.condition = result.customer.businessCondition;
  714. }
  715. state.financecondition = {
  716. cusId: '',
  717. id: '',
  718. fc_arbalance: '',
  719. fc_agingamount1: '',
  720. fc_agingamount2: '',
  721. fc_agingamount4: '',
  722. fc_agingamount3: '',
  723. fc_apremark: '',
  724. year: '',
  725. month: '',
  726. fc_yeatmonth: '',
  727. isDisabled: false
  728. }
  729. if (result && result.customer && result.customer.financeCondition) {
  730. state.financecondition = result.customer.financeCondition;
  731. }
  732. state.tab5 = [{
  733. cusId: '',
  734. id: '',
  735. pm_kind: '',
  736. pm_tannualrevenue: '',
  737. pm_tratio: '',
  738. pm_annualrevenue: '',
  739. pm_ratio: '',
  740. isDisabled: false
  741. }]
  742. if (result && result.customer && result.customer.productMixes) {
  743. state.tab5 = result.customer.productMixes;
  744. }
  745. state.tab6 = [{
  746. cusId: '',
  747. id: '',
  748. udc_name: '',
  749. udc_product: '',
  750. udc_lastyear: '',
  751. udc_thisyear: '',
  752. udc_payment: '',
  753. udc_cooperationyears: '',
  754. udc_kind: '上游'
  755. }, {
  756. cusId: '',
  757. id: '',
  758. udc_name: '',
  759. udc_product: '',
  760. udc_lastyear: '',
  761. udc_thisyear: '',
  762. udc_payment: '',
  763. udc_cooperationyears: '',
  764. udc_kind: '上游'
  765. },
  766. {
  767. cusId: '',
  768. id: '',
  769. udc_name: '',
  770. udc_product: '',
  771. udc_lastyear: '',
  772. udc_thisyear: '',
  773. udc_payment: '',
  774. udc_cooperationyears: '',
  775. udc_kind: '上游'
  776. },
  777. {
  778. cusId: '',
  779. id: '',
  780. udc_name: '',
  781. udc_product: '',
  782. udc_lastyear: '',
  783. udc_thisyear: '',
  784. udc_payment: '',
  785. udc_cooperationyears: '',
  786. udc_kind: '上游'
  787. },
  788. {
  789. cusId: '',
  790. id: '',
  791. udc_name: '',
  792. udc_product: '',
  793. udc_lastyear: '',
  794. udc_thisyear: '',
  795. udc_payment: '',
  796. udc_cooperationyears: '',
  797. udc_kind: '上游'
  798. }]
  799. state.tab6_2 = [{
  800. cusId: '',
  801. id: '',
  802. udc_name: '',
  803. udc_product: '',
  804. udc_lastyear: '',
  805. udc_thisyear: '',
  806. udc_payment: '',
  807. udc_cooperationyears: '',
  808. udc_kind: '下游'
  809. },
  810. {
  811. cusId: '',
  812. id: '',
  813. udc_name: '',
  814. udc_product: '',
  815. udc_lastyear: '',
  816. udc_thisyear: '',
  817. udc_payment: '',
  818. udc_cooperationyears: '',
  819. udc_kind: '下游'
  820. },
  821. {
  822. cusId: '',
  823. id: '',
  824. udc_name: '',
  825. udc_product: '',
  826. udc_lastyear: '',
  827. udc_thisyear: '',
  828. udc_payment: '',
  829. udc_cooperationyears: '',
  830. udc_kind: '下游'
  831. },
  832. {
  833. cusId: '',
  834. id: '',
  835. udc_name: '',
  836. udc_product: '',
  837. udc_lastyear: '',
  838. udc_thisyear: '',
  839. udc_payment: '',
  840. udc_cooperationyears: '',
  841. udc_kind: '下游'
  842. },
  843. {
  844. cusId: '',
  845. id: '',
  846. udc_name: '',
  847. udc_product: '',
  848. udc_lastyear: '',
  849. udc_thisyear: '',
  850. udc_payment: '',
  851. udc_cooperationyears: '',
  852. udc_kind: '下游'
  853. }]
  854. if (result && result.customer && result.customer.updowncasts && result.customer.updowncasts.length != 0) {
  855. var array1 = [];
  856. var array2 = [];
  857. for (var i = 0; i < result.customer.updowncasts.length; i++) {
  858. if (result.customer.updowncasts[i].udc_kind == '上游') {
  859. array1.push(result.customer.updowncasts[i])
  860. } else {
  861. array2.push(result.customer.updowncasts[i])
  862. }
  863. }
  864. state.tab6 = array1;
  865. state.tab6_2 = array2;
  866. }
  867. state.tab7=[];
  868. state.tab8=[];
  869. state.tab9=[];
  870. state.tab10=[];
  871. state.tab11=[];
  872. state.tab12=[];
  873. state.tab13=[];
  874. state.tab14=[];
  875. state.tab15=[];
  876. if(result && result.customer && result.customer.accountInfoList) {
  877. for (var i = 0; i < result.customer.accountInfoList.length; i++) {
  878. if (result.customer.accountInfoList[i].ai_kind == '应收账款') {
  879. state.tab7.push(result.customer.accountInfoList[i]);
  880. } else if (result.customer.accountInfoList[i].ai_kind == '其他应收账款') {
  881. state.tab8.push(result.customer.accountInfoList[i]);
  882. } else if (result.customer.accountInfoList[i].ai_kind == '预付账款') {
  883. state.tab9.push(result.customer.accountInfoList[i]);
  884. } else if (result.customer.accountInfoList[i].ai_kind == '固定资产') {
  885. state.tab10.push(result.customer.accountInfoList[i]);
  886. } else if (result.customer.accountInfoList[i].ai_kind == '存货') {
  887. state.tab11.push(result.customer.accountInfoList[i]);
  888. } else if (result.customer.accountInfoList[i].ai_kind == '短期借款') {
  889. state.tab12.push(result.customer.accountInfoList[i]);
  890. } else if (result.customer.accountInfoList[i].ai_kind == '应付账款') {
  891. state.tab13.push(result.customer.accountInfoList[i]);
  892. } else if (result.customer.accountInfoList[i].ai_kind == '其他应付账款') {
  893. state.tab14.push(result.customer.accountInfoList[i]);
  894. } else {
  895. state.tab15.push(result.customer.accountInfoList[i]);
  896. }
  897. }
  898. }
  899. state.mfmodal=[];
  900. if(result && result.customer && result.customer.mfCustInfos){
  901. for (var i = 0; i < result.customer.mfCustInfos.length; i++) {
  902. state.mfmodal.push(result.customer.mfCustInfos[i]);
  903. Vue.set(this.state.mfmodal[i], 'show', true)
  904. }
  905. }
  906. if(result.apply != null){
  907. state.apply = result.apply;
  908. if(result.apply.attachList){
  909. state.attach = result.apply.attachList
  910. for (var i = 0; i < state.attach.length; i++) {
  911. if (state.attach[i].type == '保理业务申请书' && !state.fileList0.find(item => {
  912. return item.id === state.attach[i].id
  913. })) {
  914. state.fileList0.push(state.attach[i]);
  915. } else if (state.attach[i].type == '营业执照正副本' && !state.fileList1.find(item => {
  916. return item.id === state.attach[i].id
  917. })) {
  918. state.fileList1.push(state.attach[i]);
  919. } else if (state.attach[i].type == '开户许可证' && !state.fileList2.find(item => {
  920. return item.id === state.attach[i].id
  921. })) {
  922. state.fileList2.push(state.attach[i]);
  923. } else if (state.attach[i].type == '法人代表身份证' && !state.fileList3.find(item => {
  924. return item.id === state.attach[i].id
  925. })) {
  926. state.fileList3.push(state.attach[i]);
  927. } else if (state.attach[i].type == '实际控制人身份证' && !state.fileList4.find(item => {
  928. return item.id === state.attach[i].id
  929. })) {
  930. state.fileList4.push(state.attach[i]);
  931. } else if (state.attach[i].type == '法人代表证明书' && !state.fileList5.find(item => {
  932. return item.id === state.attach[i].id
  933. })) {
  934. state.fileList5.push(state.attach[i]);
  935. } else if (state.attach[i].type == '公司章程' && !state.fileList6.find(item => {
  936. return item.id === state.attach[i].id
  937. })) {
  938. state.fileList6.push(state.attach[i]);
  939. } else if (state.attach[i].type == '实际控制人征信授权书' && !state.fileList7.find(item => {
  940. return item.id === state.attach[i].id
  941. })) {
  942. state.fileList7.push(state.attach[i]);
  943. } else if (state.attach[i].type == '租赁合同/房产证' && !state.fileList8.find(item => {
  944. return item.id === state.attach[i].id
  945. })) {
  946. state.fileList8.push(state.attach[i]);
  947. } else if (state.attach[i].type == '法定代表人和实际控制人简历(Word版)' && !state.fileList9.find(item => {
  948. return item.id === state.attach[i].id
  949. })) {
  950. state.fileList9.push(state.attach[i]);
  951. } else if (state.attach[i].type == '近三年财务报表和近一期月度财报(含资产负债表、损益表、现金流量表)' && !state.fileList10.find(item => {
  952. return item.id === state.attach[i].id
  953. })) {
  954. state.fileList10.push(state.attach[i]);
  955. } else if (state.attach[i].type == '前五大上游企业贸易合同(两份)' && !state.fileList11.find(item => {
  956. return item.id === state.attach[i].id
  957. })) {
  958. state.fileList11.push(state.attach[i]);
  959. } else if (state.attach[i].type == '前五大下游企业贸易合同(两份)' && !state.fileList12.find(item => {
  960. return item.id === state.attach[i].id
  961. })) {
  962. state.fileList12.push(state.attach[i]);
  963. } else if (state.attach[i].type == '近1年税控系统导出的增值税发票清单(Excel版)' && !state.fileList13.find(item => {
  964. return item.id === state.attach[i].id
  965. })) {
  966. state.fileList13.push(state.attach[i]);
  967. } else if (state.attach[i].type == '近一年最大的五份贸易合同' && !state.fileList14.find(item => {
  968. return item.id === state.attach[i].id
  969. })) {
  970. state.fileList14.push(state.attach[i]);
  971. } else if (state.attach[i].type == '税控系统导出近一年全部发票(Excel版)' && !state.fileList15.find(item => {
  972. return item.id === state.attach[i].id
  973. })) {
  974. state.fileList15.push(state.attach[i]);
  975. } else if (state.attach[i].type == '公司人行征信报告及对外担保信息' && !state.fileList16.find(item => {
  976. return item.id === state.attach[i].id
  977. })) {
  978. state.fileList16.push(state.attach[i]);
  979. } else if (state.attach[i].type == '上一年度增值税(营业税)、所得税纳税证明' && !state.fileList17.find(item => {
  980. return item.id === state.attach[i].id
  981. })) {
  982. state.fileList17.push(state.attach[i]);
  983. } else if (state.attach[i].type == '企业近1年主要结算银行流水' && !state.fileList18.find(item => {
  984. return item.id === state.attach[i].id
  985. })) {
  986. state.fileList18.push(state.attach[i]);
  987. } else if (state.attach[i].type == '个人近1年主要结算银行流水' && !state.fileList19.find(item => {
  988. return item.id === state.attach[i].id
  989. })) {
  990. state.fileList19.push(state.attach[i]);
  991. } else if (state.attach[i].type == '近三个月水电费单据' && !state.fileList20.find(item => {
  992. return item.id === state.attach[i].id
  993. })) {
  994. state.fileList20.push(state.attach[i]);
  995. } else if (state.attach[i].type == '其他' && !state.fileList21.find(item => {
  996. return item.id === state.attach[i].id
  997. })) {
  998. state.fileList21.push(state.attach[i]);
  999. } else if (state.attach[i].type == '担保人的人行征信报告及对外担保信息' && !state.fileList22.find(item => {
  1000. return item.id === state.attach[i].id
  1001. })) {
  1002. state.fileList22.push(state.attach[i]);
  1003. }
  1004. }
  1005. }
  1006. }
  1007. if(result.status==202 || result.status==203 || result.status == 204){
  1008. state.cansave = false
  1009. }
  1010. },
  1011. //找到某一具体的客户资料
  1012. findcust:function(state,result){
  1013. if (result != null) {
  1014. state.tab1 = result;
  1015. }
  1016. state.tab2 = result.shareholders
  1017. state.tab3 = result.associateCompanies;
  1018. state.tab4 = result.customerExcutives;
  1019. state.tab5 = result.productMixes;
  1020. state.changeInstruction=[{
  1021. cusId: '',
  1022. id: '',
  1023. cd_type: '股东',
  1024. cs_date: '',
  1025. cs_before: '',
  1026. cs_after: '',
  1027. isDisabled: false
  1028. }, {
  1029. cusId: '',
  1030. id: '',
  1031. cd_type: '法人',
  1032. cs_date: '',
  1033. cs_before: '',
  1034. cs_after: '',
  1035. isDisabled: false
  1036. }, {
  1037. cusId: '',
  1038. id: '',
  1039. cd_type: '住所',
  1040. cs_date: '',
  1041. cs_before: '',
  1042. cs_after: '',
  1043. isDisabled: false
  1044. }]
  1045. if(result.changesInstructions != null) {
  1046. state.changeInstruction = result.changesInstructions;
  1047. }
  1048. state.condition= {bc_bcremark: '', bc_sweaterprocess: '', cusId: '', id: ''};
  1049. if(result.businessCondition != null){
  1050. state.condition = result.businessCondition;}
  1051. state.financecondition={
  1052. cusId: '',
  1053. id: '',
  1054. fc_arbalance: '',
  1055. fc_agingamount1: '',
  1056. fc_agingamount2: '',
  1057. fc_agingamount4: '',
  1058. fc_agingamount3: '',
  1059. fc_apremark: '',
  1060. year: '',
  1061. month: '',
  1062. fc_yeatmonth: '',
  1063. isDisabled: false
  1064. };
  1065. if(result.financeCondition != null){
  1066. state.financecondition = result.financeCondition;}
  1067. state.tab5 = result.productMixes;
  1068. state.tab6 = [];
  1069. state.tab6_2 = [];
  1070. if(result && result.updowncasts){
  1071. for (var i = 0; i < result.updowncasts.length; i++) {
  1072. if (result.updowncasts[i].udc_kind == '上游') {
  1073. state.tab6.push(result.updowncasts[i])
  1074. } else {
  1075. state.tab6_2.push(result.updowncasts[i])
  1076. }
  1077. }
  1078. }
  1079. state.tab7=[];
  1080. state.tab8=[];
  1081. state.tab9=[];
  1082. state.tab10=[];
  1083. state.tab11=[];
  1084. state.tab12=[];
  1085. state.tab13=[];
  1086. state.tab14=[];
  1087. state.tab15=[];
  1088. if(result && result.accountInfoList){
  1089. for (var i = 0; i < result.accountInfoList.length; i++) {
  1090. if (result.accountInfoList[i].ai_kind == '应收账款') {
  1091. state.tab7.push(result.accountInfoList[i]);
  1092. } else if (result.accountInfoList[i].ai_kind == '其他应收账款') {
  1093. state.tab8.push(result.accountInfoList[i]);
  1094. console.log('tab8',state.tab8)
  1095. } else if (result.accountInfoList[i].ai_kind == '预付账款') {
  1096. state.tab9.push(result.accountInfoList[i]);
  1097. } else if (result.accountInfoList[i].ai_kind == '固定资产') {
  1098. state.tab10.push(result.accountInfoList[i]);
  1099. } else if (result.accountInfoList[i].ai_kind == '存货') {
  1100. state.tab11.push(result.accountInfoList[i]);
  1101. } else if (result.accountInfoList[i].ai_kind == '短期借款') {
  1102. state.tab12.push(result.accountInfoList[i]);
  1103. } else if (result.accountInfoList[i].ai_kind == '应付账款') {
  1104. state.tab13.push(result.accountInfoList[i]);
  1105. } else if (result.accountInfoList[i].ai_kind == '其他应付账款') {
  1106. state.tab14.push(result.accountInfoList[i]);
  1107. } else {
  1108. state.tab15.push(result.accountInfoList[i]);
  1109. }
  1110. }
  1111. }
  1112. state.mfmodal=[]
  1113. if(result && result.mfCustInfos){
  1114. for (var i = 0; i < result.mfCustInfos.length; i++) {
  1115. state.mfmodal.push(result.mfCustInfos[i]);
  1116. Vue.set(this.state.mfmodal[i], 'show', true)
  1117. }
  1118. }
  1119. },
  1120. // 客户上传的附件
  1121. setCustFiles: function (state, res) {
  1122. state.custFiles = res || []
  1123. },
  1124. //获取保理申请单
  1125. getApplyList:function(state,result){
  1126. state.applylist = result
  1127. },
  1128. //获取出账申请单
  1129. getCreditList:function(state,result){
  1130. state.credit = result;
  1131. },
  1132. getTransferList:function(state,result){
  1133. state.transfer = result
  1134. },
  1135. //查看买方客户详情
  1136. infoMfmodal(state,index) {
  1137. for (var i = 0; i < state.mfmodal.length; i++) {
  1138. Vue.set(state.mfmodal[i],'show',false)
  1139. }
  1140. Vue.set(state.mfmodal[index],'show',true)
  1141. state.openmf = true;
  1142. },
  1143. addtransfer: function (state) {
  1144. var a = window.location.href;
  1145. var index = a.lastIndexOf("=");
  1146. var creditId = a.substring(index + 1, a.length);
  1147. var b = {
  1148. aa_billamount: 0,
  1149. aa_transferamount: '',
  1150. aa_dueamount: '',
  1151. aa_saamount: 0,
  1152. aa_maturitydate: '',
  1153. indate: '',
  1154. aa_iscloseoff: '',
  1155. fsSaleList: [],
  1156. receipts: [],
  1157. attaches: [],
  1158. show: true,
  1159. cq_id: creditId,
  1160. id: '',
  1161. erpstatus: '',
  1162. status: ''
  1163. }
  1164. state.transfer.push(b)
  1165. for (var i = 0; i < state.transfer.length - 1; i++) {
  1166. state.transfer[i].show = false;
  1167. }
  1168. state.openTransfer = true
  1169. },
  1170. //给保理模态框设置客户资料id
  1171. setModalId:function(state,id){
  1172. state.apply.cusId = id
  1173. },
  1174. //给客户基础资料从表设置id
  1175. setCusId:function(state){
  1176. state.apply.cusId = state.tab1.id;
  1177. for (var i = 0; i < state.tab2.length; i++) {
  1178. state.tab2[i].cusId = state.tab1.id;
  1179. }
  1180. },
  1181. setPage1Id:function(state,id){
  1182. state.tab1.id = id
  1183. },
  1184. //设置保理单id
  1185. setApplyId:function(state,id){
  1186. state.apply.id = id;
  1187. },
  1188. //保存完,将返回的id赋给他们
  1189. setcustomer:function(state,response){
  1190. state.tab1 = response
  1191. },
  1192. setShareId:function(state,response){
  1193. for (var i = 0; i < response.data.length; i++) {
  1194. state.tab2[i] = response.data[i];
  1195. }
  1196. },
  1197. setAssociate:function(state,response){
  1198. for (var i = 0; i < response.data.length; i++) {
  1199. state.tab3[i] = response.data[i];
  1200. }
  1201. },
  1202. setChangeInstruction:function(state,response){
  1203. state.changeInstruction = response
  1204. },
  1205. setExcutive:function(state,response){
  1206. state.tab4 = response
  1207. },
  1208. setBusinessCon:function(state,response){
  1209. state.condition = response
  1210. },
  1211. setProductmix:function (state,response) {
  1212. state.tab5 = response
  1213. },
  1214. setUpdowncast:function(state,response){
  1215. state.tab6 = response;
  1216. },
  1217. setUpdowncast2:function(state,response){
  1218. state.tab6_2 = response;
  1219. },
  1220. setAccountInfo1:function(state,response){
  1221. state.tab7 = response
  1222. },
  1223. setFinanceCondition:function(state,response){
  1224. state.financecondition = response
  1225. },
  1226. setAccountInfo2:function(state,response){
  1227. state.tab8 = response
  1228. },
  1229. setAccountInfo3:function (state,response) {
  1230. state.tab9 = response
  1231. },
  1232. setAccountInfo4:function (state,response) {
  1233. state.tab10 = response
  1234. },
  1235. setAccountInfo5:function (state,response) {
  1236. state.tab11 = response
  1237. },
  1238. setAccountInfo6:function(state,response){
  1239. state.tab12 = response
  1240. },
  1241. setAccountInfo7:function(state,response){
  1242. state.tab13 = response
  1243. },
  1244. setAccountInfo8:function(state,response){
  1245. state.tab14 = response
  1246. },
  1247. setAccountInfo9:function(state,response){
  1248. state.tab15 = response
  1249. },
  1250. setMf:function(state,payload){
  1251. state.mfmodal[payload.index] = payload.response
  1252. console.log('模态框里面买方的数据',payload.response)
  1253. },
  1254. setMfDetail:function (state,payload) {
  1255. state.mfmodal[payload.index].mfCustInfoDetailList = payload.response
  1256. },
  1257. infotransfer:function(state,index){
  1258. let _this = this;
  1259. //只展示点击查看的出账申请
  1260. for (var i = 0; i < state.transfer.length; i++) {
  1261. state.transfer[i].show = false
  1262. }
  1263. state.transfer[index].show = true;
  1264. state.openTransfer = true
  1265. },
  1266. //关闭出账申请弹框
  1267. cancleTransfer:function(state){
  1268. state.openTransfer = false
  1269. },
  1270. addfsSale:function(state,index){
  1271. state.transfer[index].fsSaleList.push({
  1272. sa_contractno:'',
  1273. sa_contractamount:'',
  1274. sa_code:'',
  1275. sa_total:'',
  1276. sa_payment:'',
  1277. id:'',
  1278. aa_id:'',
  1279. })
  1280. },
  1281. //删除合同
  1282. deleteFsSale:function(state,params){
  1283. state.transfer[params.index].fsSaleList.splice(params.index1,1)
  1284. },
  1285. addreceipt:function(state,index){
  1286. state.transfer[index].receipts.push({
  1287. aai_billdate:'',
  1288. aai_invoiceno:'',
  1289. aai_salesno:'',
  1290. aai_amount:'',
  1291. id:'',
  1292. aa_id:'',
  1293. })
  1294. },
  1295. //删除发票
  1296. deleteReceipt:function(state,params){
  1297. state.transfer[params.index].receipts.splice(params.index2,1)
  1298. },
  1299. //查找英唐保理下所有客户资料
  1300. showbaolilist:function(state,params){
  1301. state.baolilist = params
  1302. },
  1303. },
  1304. actions:{
  1305. // 全局服务初始化
  1306. nuxtServerInit (store, { params, route, isDev, req }) {
  1307. let _this = this;
  1308. store.state.route.query = route.query
  1309. store.state.route.path = req.headers.host
  1310. // Get user info from java server-
  1311. return Promise.all([
  1312. store.dispatch('loadUserInfo'),
  1313. ])
  1314. },
  1315. // 获取用户信息
  1316. loadUserInfo (store={}) {
  1317. return this.$axios.get('/sso/account')
  1318. .then(response => {
  1319. if(response.data.success){
  1320. store.state.option.user.enuu = response.data.content.spaceUU
  1321. store.state.option.user.compamy = response.data.content.spaceName
  1322. store.state.option.user.name = response.data.content.vipName
  1323. store.state.option.user.logged=true
  1324. if(store.state.option.user.enuu == '10046945'){
  1325. store.state.showcustlist = true
  1326. }
  1327. return this.$axios.get('/financeapply/getHistory',{params:{ enuu: store.state.option.user.enuu }})
  1328. .then(response => {
  1329. //如果有客户资料则直接取出
  1330. console.log('进入getcustomer')
  1331. store.commit('getCustomer',response.data)
  1332. }, err => {
  1333. console.log(err)
  1334. })
  1335. }
  1336. }).catch(error => {
  1337. console.log('error'+error)
  1338. })
  1339. },
  1340. // 用户退出
  1341. logout ({ commit }) {
  1342. return axios.get('/logout')
  1343. .then(response => {
  1344. commit('option/REQUEST_LOGOUT_SUCCESS', response.data)
  1345. })
  1346. },
  1347. findNew({commit},params={}){
  1348. return this.$axios.get('/customer/findnew',{params:params})
  1349. .then(function (response) {
  1350. if (response.data) {
  1351. //没有客户资料则弹出弹框
  1352. commit('openAuth')
  1353. }
  1354. }).catch(function (error) {
  1355. // alert('判断是否有客户资料失败')
  1356. });
  1357. },
  1358. agreeApply(store){
  1359. let _this = this
  1360. this.$axios.post('/customer/save',store.state.tab1)
  1361. .then(function(response){
  1362. //设置模态框客户资料id
  1363. store.commit('setModalId',response.data.id)
  1364. //设置page1的id
  1365. store.commit('setPage1Id',response.data.id)
  1366. _this.$axios.post('/financeapply/save', store.state.apply)
  1367. .then(function (response) {
  1368. store.commit('setApplyId',response.data.id)
  1369. alert('保存成功');
  1370. store.commit('closeApply')
  1371. }).catch(function () {
  1372. alert('保存失败');
  1373. })
  1374. }).catch(function(){
  1375. alert('保存失败')
  1376. })
  1377. },
  1378. //保存客户资料基础资料
  1379. savepage1(params){
  1380. let _this = this;
  1381. return this.$axios.post(`/customer/save`,params.state.tab1)
  1382. .then(response => {
  1383. params.commit('setPage1Id',response.data.id)
  1384. alert('保存成功')
  1385. }, err => {
  1386. alert('保存失败')
  1387. })
  1388. },
  1389. //保存客户资料股东构成
  1390. savepage2(params = {}){
  1391. params.commit('setCusId')
  1392. return this.$axios.post('/shareholders/save',params.state.tab2)
  1393. .then(response => {
  1394. params.commit('setShareId',response)
  1395. alert('保存成功')
  1396. }, err => {
  1397. alert('保存失败')
  1398. })
  1399. },
  1400. //保存客户资料主要关联企业
  1401. savepage3(params={}){
  1402. for (var i = 0; i < params.state.tab3.length; i++) {
  1403. params.state.tab3[i].cusId = params.state.tab1.id;
  1404. }
  1405. return this.$axios.post('/associate/save',params.state.tab3)
  1406. .then(response => {
  1407. params.commit('setAssociate',response)
  1408. alert('保存成功')
  1409. }, err => {
  1410. alert('保存失败')
  1411. })
  1412. },
  1413. //保存客户资料高管信息
  1414. savepage4(params = {}){
  1415. let _this = this;
  1416. for (var i = 0; i < params.state.tab4.length; i++) {
  1417. params.state.tab4[i].cusId = params.state.tab1.id;
  1418. }
  1419. for (var i = 0; i < params.state.changeInstruction.length; i++) {
  1420. params.state.changeInstruction[i].cusId = params.state.tab1.id;
  1421. }
  1422. this.$axios.post('/customer/save',params.state.tab1)
  1423. .then(response =>{
  1424. params.commit('setcustomer',response.data)
  1425. savechange()
  1426. },err=>{
  1427. alert('保存失败')
  1428. })
  1429. var savechange = function(){
  1430. _this.$axios.post('/changesInstruction/save',params.state.changeInstruction)
  1431. .then(response =>{
  1432. params.commit('setChangeInstruction',response.data)
  1433. _this.$axios.post('/customerexcutive/save', params.state.tab4)
  1434. .then(function (response) {
  1435. params.commit('setExcutive',response.data)
  1436. alert('保存成功');
  1437. })
  1438. .catch(function (error) {
  1439. alert('保存管理层背景失败');
  1440. });
  1441. },err=>{
  1442. alert('保存失败')
  1443. })
  1444. }
  1445. },
  1446. //保存客户资料经营情况
  1447. savepage5(params={}){
  1448. let _this = this;
  1449. //设置外键值
  1450. params.state.condition.cusId = params.state.tab1.id;
  1451. for (var i = 0; i < params.state.tab5.length; i++) {
  1452. params.state.tab5[i].cusId = params.state.tab1.id;
  1453. }
  1454. //保存经营情况描述
  1455. return this.$axios.post('/businesscondition/save',params.state.condition)
  1456. .then(function (response) {
  1457. params.commit('setBusinessCon',response.data)
  1458. _this.$axios.post('/productmix/save', params.state.tab5)
  1459. .then(function (response) {
  1460. params.commit('setProductmix',response.data)
  1461. alert('保存成功');
  1462. })
  1463. .catch(function (error) {
  1464. alert('保存经营情况失败');
  1465. });
  1466. }),err=>{
  1467. alert('保存经营情况描述失败');
  1468. }
  1469. },
  1470. //保存客户资料贸易流程
  1471. savepage6(params={}){
  1472. let _this = this;
  1473. //设置外键值
  1474. params.state.condition.cusId = params.state.tab1.id;
  1475. for (var i = 0; i < params.state.tab6.length; i++) {
  1476. params.state.tab6[i].cusId = params.state.tab1.id;
  1477. }
  1478. for (var i = 0; i < params.state.tab6_2.length; i++) {
  1479. params.state.tab6_2[i].cusId = params.state.tab1.id;
  1480. }
  1481. //保存贸易情况描述
  1482. this.$axios.post('/businesscondition/save', params.state.condition)
  1483. .then(function (response) {
  1484. params.commit('setBusinessCon',response.data)
  1485. //保存前五大供应商
  1486. _this.$axios.post('/updowncast/save', params.state.tab6)
  1487. .then(function (response) {
  1488. params.commit('setUpdowncast',response.data)
  1489. //保存前五大客户
  1490. _this.$axios.post('/updowncast/save', params.state.tab6_2)
  1491. .then(function (response) {
  1492. params.commit('setUpdowncast2',response.data)
  1493. alert('保存成功');
  1494. })
  1495. .catch(function (error) {
  1496. alert('保存前五大客户失败');
  1497. });
  1498. })
  1499. .catch(function (error) {
  1500. alert('保存前五大供应商失败');
  1501. });
  1502. })
  1503. .catch(function (error) {
  1504. alert('保存贸易情况描述失败');
  1505. });
  1506. },
  1507. savepage7(params={}){
  1508. let _this = this;
  1509. //设置资产科目明细外键
  1510. for (var i = 0; i < params.state.tab7.length; i++) {
  1511. params.state.tab7[i].cusId = params.state.tab1.id;
  1512. }
  1513. for (var i = 0; i < params.state.tab8.length; i++) {
  1514. params.state.tab8[i].cusId = params.state.tab1.id;
  1515. }
  1516. for (var i = 0; i < params.state.tab9.length; i++) {
  1517. params.state.tab9[i].cusId = params.state.tab1.id;
  1518. }
  1519. for (var i = 0; i < params.state.tab10.length; i++) {
  1520. params.state.tab10[i].cusId = params.state.tab1.id;
  1521. }
  1522. for (var i = 0; i < params.state.tab11.length; i++) {
  1523. params.state.tab11[i].cusId = params.state.tab1.id;
  1524. }
  1525. params.state.financecondition.cusId = params.state.tab1.id;
  1526. //以下都是保存财务数据
  1527. this.$axios.post('/accountinfo/save', params.state.tab7)
  1528. .then(function (response) {
  1529. params.commit('setAccountInfo1',response.data)
  1530. a1();
  1531. })
  1532. .catch(function (error) {
  1533. alert('保存应收账目详情失败');
  1534. });
  1535. var a1 = function () {
  1536. if (params.state.financecondition.year != undefined && params.state.financecondition.month != undefined) {
  1537. if (params.state.financecondition.month.length == 1) {
  1538. params.state.financecondition.fc_yeatmonth = params.state.financecondition.year + '0' + params.state.financecondition.month;
  1539. } else {
  1540. params.state.financecondition.fc_yeatmonth = params.state.financecondition.year + params.state.financecondition.month;
  1541. }
  1542. }
  1543. //财务情况说明
  1544. _this.$axios.post('/financecondition/save', params.state.financecondition)
  1545. .then(function (response) {
  1546. params.commit('setFinanceCondition',response.data)
  1547. b1();
  1548. })
  1549. .catch(function (error) {
  1550. alert('保存财务情况说明失败');
  1551. });
  1552. }
  1553. var b1 = function () {
  1554. _this.$axios.post('/accountinfo/save', params.state.tab8)
  1555. .then(function (response) {
  1556. params.commit('setAccountInfo2',response.data)
  1557. c1();
  1558. })
  1559. .catch(function (error) {
  1560. alert('保存其他应收账款失败');
  1561. });
  1562. }
  1563. var c1 = function () {
  1564. _this.$axios.post('/accountinfo/save', params.state.tab9)
  1565. .then(function (response) {
  1566. params.commit('setAccountInfo3',response.data)
  1567. d1();
  1568. })
  1569. .catch(function (error) {
  1570. alert('保存预付账款失败');
  1571. });
  1572. }
  1573. var d1 = function () {
  1574. _this.$axios.post('/accountinfo/save', params.state.tab10)
  1575. .then(function (response) {
  1576. params.commit('setAccountInfo4',response.data)
  1577. e1();
  1578. })
  1579. .catch(function (error) {
  1580. alert('保存固定资产失败');
  1581. });
  1582. }
  1583. var e1 = function () {
  1584. _this.$axios.post('/accountinfo/save', params.state.tab11)
  1585. .then(function (response) {
  1586. params.commit('setAccountInfo5',response.data)
  1587. alert('保存成功');
  1588. })
  1589. .catch(function (error) {
  1590. alert('保存存货失败');
  1591. });
  1592. }
  1593. },
  1594. //保存负债科目明细v
  1595. savepage8(params={}){
  1596. let _this = this;
  1597. //给以下表设置客户基础资料主键id
  1598. for (var i = 0; i < params.state.tab12.length; i++) {
  1599. params.state.tab12[i].cusId = params.state.tab1.id;
  1600. }
  1601. for (var i = 0; i < params.state.tab13.length; i++) {
  1602. params.state.tab13[i].cusId = params.state.tab1.id;
  1603. }
  1604. for (var i = 0; i < params.state.tab14.length; i++) {
  1605. params.state.tab14[i].cusId = params.state.tab1.id;
  1606. }
  1607. for (var i = 0; i < params.state.tab15.length; i++) {
  1608. params.state.tab15[i].cusId = params.state.tab1.id;
  1609. }
  1610. params.state.financecondition.cusId = params.state.tab1.id;
  1611. //保存财务数据
  1612. this.$axios.post('/accountinfo/save', params.state.tab12)
  1613. .then(function (response) {
  1614. params.commit('setAccountInfo6',response.data)
  1615. a1();
  1616. }),err=>{
  1617. alert('保存短期借款失败');
  1618. }
  1619. var a1 = function () {
  1620. _this.$axios.post('/accountinfo/save', params.state.tab13)
  1621. .then(function (response) {
  1622. params.commit('setAccountInfo7',response.data)
  1623. b1();
  1624. }),err=>{
  1625. alert('保存应付账款失败');
  1626. }
  1627. };
  1628. var b1 = function () {
  1629. _this.$axios.post('/accountinfo/save', params.state.tab14)
  1630. .then(function (response) {
  1631. params.commit('setAccountInfo8',response.data)
  1632. c1();
  1633. }),err=>{
  1634. alert('保存其他应付账款失败');
  1635. }
  1636. }
  1637. var c1 = function () {
  1638. _this.$axios.post('/financecondition/save', params.state.financecondition)
  1639. .then(function (response) {
  1640. params.commit('setFinanceCondition',response.data)
  1641. d1();
  1642. }),err=>{
  1643. alert('保存说明失败');
  1644. }
  1645. }
  1646. var d1 = function () {
  1647. _this.$axios.post('/accountinfo/save', params.state.tab15)
  1648. .then(function (response) {
  1649. params.commit('setAccountInfo9',response.data)
  1650. alert('保存成功');
  1651. }),err=>{
  1652. alert('保存长期借款失败');
  1653. }
  1654. }
  1655. },
  1656. // 保存买方客户信息
  1657. savepage9(params={}) {
  1658. let _this = this;
  1659. var index;
  1660. for (var i = 0; i < params.state.mfmodal.length; i++) {
  1661. if (params.state.mfmodal[i].show == true) {
  1662. params.state.mfmodal[i].cusId = params.state.tab1.id;
  1663. index = i;
  1664. }
  1665. }
  1666. this.$axios.post('/mfcustinfo/save', params.state.mfmodal[index])
  1667. .then(function (response) {
  1668. for (var i = 0; i < params.state.mfmodal[index].mfCustInfoDetailList.length; i++) {
  1669. params.state.mfmodal[index].mfCustInfoDetailList[i].mfId = response.data.id;
  1670. }
  1671. _this.$axios.post('/mfcustinfodetail/save', params.state.mfmodal[index].mfCustInfoDetailList)
  1672. .then(function (response) {
  1673. params.commit('setMfDetail',{response:response.data,index:index})
  1674. alert('保存成功')
  1675. params.commit('cancleMf');
  1676. })
  1677. .catch(function (error) {
  1678. params.commit('cancleMf');
  1679. alert('保护近三年双方交易情况失败');
  1680. });
  1681. })
  1682. .catch(function (error) {
  1683. params.commit('cancleMf');
  1684. alert('保存买方客户失败');
  1685. });
  1686. },
  1687. //保理申请保存
  1688. saveapply: function (context) {
  1689. context.commit('setCusId',context.state.tab1.id)
  1690. return this.$axios.post('/financeapply/save', context.state.apply)
  1691. .then(function (response) {
  1692. context.state.apply = response.data
  1693. alert('保存成功')
  1694. }).catch(function () {
  1695. alert('保存失败');
  1696. })
  1697. },
  1698. //正式提交
  1699. submitinfo: function (context) {
  1700. return this.$axios.post('/financeapply/submit', context.state.apply)
  1701. .then(function (response) {
  1702. alert('成功提交');
  1703. })
  1704. .catch(function (error) {
  1705. alert('提交失败');
  1706. });
  1707. },
  1708. //获取登录人所有的金融保理单
  1709. findApplyList:function({commit},params = {}){
  1710. //找到登录人申请过的所有保理申请单
  1711. return this.$axios.get('/financeapply/findByEnuu',{params:params})
  1712. .then(response => {
  1713. commit('getApplyList',response.data)
  1714. }, err => {
  1715. console.log(err)
  1716. })
  1717. },
  1718. //相关文件下载
  1719. download: function (context) {
  1720. window.open("http://"+context.state.route.path+"/attach/download?fauu=10046945");
  1721. },
  1722. //查找登录用户下所有买方客户额度
  1723. findCredit:function({store,commit},params = {}){
  1724. return this.$axios.get('/sellerquota/findAll',{params:params})
  1725. .then(response => {
  1726. commit('getCreditList',response.data)
  1727. }, err => {
  1728. console.log(err)
  1729. })
  1730. },
  1731. getId:function(){
  1732. var a = window.location.href;
  1733. var index = a.lastIndexOf("=");
  1734. if(index>0){
  1735. var creditId = a.substring(index+1,a.length);
  1736. return creditId;
  1737. }
  1738. },
  1739. //查找某买方客户的所有出账申请
  1740. findTransfer:function(context){
  1741. return this.$axios.get("/accountapply/find",{params:{id:context.state.route.query.id}})
  1742. .then(function(response){
  1743. context.commit('getTransferList',response.data)
  1744. }).catch(function(){
  1745. alert('查找失败')
  1746. })
  1747. },
  1748. infoTransfer:function(transfer,index){
  1749. //只展示点击查看的出账申请
  1750. for (var i = 0; i < state.transfer.length; i++) {
  1751. _this.transfer[i].show = false || _this.$set(_this.transfer[i], 'show', false)
  1752. }
  1753. this.transfer[index].show = true;
  1754. return this.$axios.get('/accountapply/findone',{params:{aaid:this.transfer[index].id}})
  1755. .then(function(response){
  1756. _this.aafileList0=[]
  1757. _this.aafileList1=[]
  1758. _this.aafileList2=[]
  1759. _this.aafileList3=[]
  1760. _this.attaches=[]
  1761. for(var i=0;i<response.data.length;i++){
  1762. if(response.data[i].type=='交易买方贸易合同'){
  1763. _this.aafileList0.push(response.data[i])
  1764. }else if(response.data[i].type=='增值税发票'){
  1765. _this.aafileList1.push(response.data[i])
  1766. }else if(response.data[i].type=='货运单据'){
  1767. _this.aafileList2.push(response.data[i])
  1768. }else if(response.data[i].type=='其他'){
  1769. _this.aafileList3.push(response.data[i])
  1770. }
  1771. }
  1772. }).catch(function(){
  1773. })
  1774. },
  1775. //打开新的应收账款转让窗口
  1776. openTransfer:function(context,params={}){
  1777. window.open("http://"+context.state.route.path+"/transfer/transferList?id="+params.id);
  1778. },
  1779. savetransfer: function(context,params={}) {
  1780. let _this = this;
  1781. //保存出账申请单
  1782. this.$axios.post('/accountapply/save', params)
  1783. .then(function (response) {
  1784. //设置合同和支票的出账单外键
  1785. for (var i = 0; i < params.fsSaleList.length; i++) {
  1786. params.fsSaleList[i].aa_id = response.data.id;
  1787. }
  1788. for (var i = 0; i < params.receipts.length; i++) {
  1789. params.receipts[i].aa_id = response.data.id;
  1790. }
  1791. savefssale();
  1792. }).catch(function () {
  1793. alert('保存失败')
  1794. })
  1795. var savefssale = function () {
  1796. _this.$axios.post('/fssale/save', params.fsSaleList)
  1797. .then(function (response) {
  1798. savereceipt()
  1799. }).catch(function () {
  1800. alert("保存合同失败")
  1801. })
  1802. }
  1803. var savereceipt = function () {
  1804. _this.$axios.post('/receipt/save', params.receipts)
  1805. .then(function (response) {
  1806. alert('保存成功')
  1807. context.commit('cancleTransfer');
  1808. location.reload()
  1809. }).catch(function () {
  1810. alert("保存发票失败")
  1811. })
  1812. }
  1813. },
  1814. //提交出账申请转让
  1815. submittransfer: function (context,params={}) {
  1816. let _this = this;
  1817. var num = 0;
  1818. for (var j = 0; j < params.fsSaleList.length; j++) {
  1819. if (params.fsSaleList[j].sa_code != '') {
  1820. num++;
  1821. }
  1822. }
  1823. if (!params.aa_transferamount) {
  1824. alert('保理转让款不能为空')
  1825. } else if (!params.aa_dueamount) {
  1826. alert('保理首付款不能为空')
  1827. } else if (params.aa_dueamount > params.aa_transferamount) {
  1828. alert('保理首付款不能大于保理转让款')
  1829. } else if (!params.aa_maturitydate) {
  1830. alert('应收账款到期日不能为空')
  1831. } else if (params.fsSaleList.length == 0) {
  1832. alert('合同不能为空')
  1833. } else if (params.fsSaleList.length > num) {
  1834. alert('合同订单编号不能为空')
  1835. } else {
  1836. this.$axios.post('/accountapply/submit', params)
  1837. .then(function (response) {
  1838. //设置合同和支票的出账单外键
  1839. for (var i = 0; i < params.fsSaleList.length; i++) {
  1840. params.fsSaleList[i].aa_id = response.data.id;
  1841. }
  1842. for (var i = 0; i < params.receipts.length; i++) {
  1843. params.receipts[i].aa_id = response.data.id;
  1844. }
  1845. params = response.data
  1846. savefssale();
  1847. }).catch(function () {
  1848. })
  1849. var savefssale = function () {
  1850. _this.$axios.post('/fssale/save', params.fsSaleList)
  1851. .then(function (response) {
  1852. savereceipt()
  1853. }).catch(function () {
  1854. alert("保存合同失败")
  1855. })
  1856. }
  1857. var savereceipt = function () {
  1858. _this.$axios.post('/receipt/save', params.receipts)
  1859. .then(function (response) {
  1860. alert('保存成功')
  1861. context.commit('cancleTransfer');
  1862. location.reload()
  1863. }).catch(function () {
  1864. alert("保存发票失败")
  1865. })
  1866. }
  1867. }
  1868. },
  1869. //展示英唐保理下所有单据
  1870. showbaolilist:function (state,params) {
  1871. return this.$axios.get('/financeapply/findAll')
  1872. .then(function(response){
  1873. state.commit('showbaolilist',response.data)
  1874. })
  1875. },
  1876. //展示客户资料详情
  1877. showcustdetail:function (context,params) {
  1878. window.open("http://"+context.state.route.path+"/checkcustinfo/checkcust?id="+params);
  1879. },
  1880. //查找某一具体客户信息
  1881. findcustomer:function (context,params) {
  1882. return this.$axios.get('/customer/findone?id='+context.state.route.query.id)
  1883. .then(function(response){
  1884. context.commit('findcust',response.data)
  1885. })
  1886. },
  1887. findCustomerFiles: function (context, params) {
  1888. return this.$axios.get('/attach/findattaches?cuId='+context.state.route.query.id)
  1889. .then(function(response){
  1890. context.commit('setCustFiles',response.data)
  1891. })
  1892. },
  1893. //客户经理确认客户资料
  1894. checkinfo:function (state,params) {
  1895. return this.$axios.post('/financeapply/checkinfo?id='+params)
  1896. .then(function(response){
  1897. alert('确认客户资料成功');
  1898. window.location.reload();
  1899. })
  1900. }
  1901. }
  1902. })
  1903. export default store