移动端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

approvalAdd11.vue 112 KiB

3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
2 yıl önce
3 yıl önce
2 yıl önce
3 yıl önce
2 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
2 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
2 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">添加备付金支出申请</p>
  11. </template>
  12. <template #right>
  13. <van-icon name="../../../static/images/icon/icon_flow.png" size="20" @click="goFlow"/>
  14. </template>
  15. </van-nav-bar>
  16. <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  17. <p class="main_title">基础信息</p>
  18. <div class="main_box">
  19. <van-field
  20. readonly
  21. clickable
  22. required
  23. :rules="[{ required: true , message:'请选择申请时间' }]"
  24. v-model="form.applyDate"
  25. label="申请时间"
  26. placeholder="请选择申请时间"
  27. @click="showlasj = true"
  28. input-align="right"
  29. right-icon="arrow-down"
  30. />
  31. <van-popup v-model="showlasj" position="bottom">
  32. <van-datetime-picker
  33. v-model="currentDate"
  34. type="date"
  35. title="选择年月日"
  36. :min-date="minDate"
  37. :max-date="maxDate"
  38. @confirm="onConfirmLasj"
  39. @cancel="showlasj = false"
  40. />
  41. </van-popup>
  42. <van-field
  43. readonly
  44. clickable
  45. required
  46. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  47. label="资金支出类别"
  48. placeholder="请选择"
  49. v-model="capitalExpenditureType"
  50. @click="showcapital = true"
  51. input-align="right"
  52. right-icon="arrow-down"
  53. label-width="auto"
  54. />
  55. <van-popup v-model="showcapital" position="bottom">
  56. <van-picker
  57. show-toolbar
  58. :columns="capitalExpenditureTypeOptions"
  59. @confirm="onConfirmCapital"
  60. @cancel="showcapital = false"
  61. />
  62. </van-popup>
  63. <van-field
  64. readonly
  65. required
  66. label="使用总金额"
  67. v-model="form.expenditureAmount"
  68. placeholder="根据下方收款金额自动核算"
  69. input-align="right"
  70. label-width="auto"
  71. />
  72. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  73. :rules="[{ required: true , message:'请选择审批模式' }]">
  74. <template #input>
  75. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  76. <van-radio name="1">线上审批</van-radio>
  77. <van-radio name="2">线下审批</van-radio>
  78. </van-radio-group>
  79. </template>
  80. </van-field>
  81. <van-field
  82. v-if="form.approvalMode==1"
  83. readonly
  84. clickable
  85. label="审批流程"
  86. placeholder="请选择"
  87. v-model="form.approvalTemplateName"
  88. @click="showtemplate = true"
  89. input-align="right"
  90. right-icon="arrow-down"
  91. required
  92. :rules="[{ required: true , message:'请选择项目流程' }]"
  93. />
  94. <van-popup v-model="showtemplate" position="bottom">
  95. <van-picker
  96. show-toolbar
  97. value-key="name"
  98. :columns="templateList"
  99. @confirm="onConfirmTemplate"
  100. @cancel="showtemplate = false"
  101. />
  102. </van-popup>
  103. </div>
  104. <div class="main_box" style="margin-top: 10px;">
  105. <van-field
  106. label="转账附言"
  107. v-model="form.remark"
  108. type="textarea"
  109. placeholder="请输入转账附言"
  110. input-align="right"
  111. rows="3"
  112. label-width="auto"
  113. required
  114. :rules="[{ required: true , message:'请输入转账附言' }]"
  115. />
  116. </div>
  117. <div class="main_box" style="margin-top: 10px;">
  118. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  119. </div>
  120. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  121. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  122. <van-field
  123. readonly
  124. clickable
  125. label="项目名称"
  126. placeholder="请选择"
  127. v-model="projectForm.projectName"
  128. @click="showproject = true"
  129. input-align="right"
  130. right-icon="arrow-down"
  131. required
  132. :rules="[{ required: true , message:'请选择项目名称' }]"
  133. />
  134. <van-popup v-model="showproject" position="bottom">
  135. <van-picker
  136. show-toolbar
  137. :columns="projectList"
  138. @confirm="onConfirmProject"
  139. @cancel="showproject = false"
  140. />
  141. </van-popup>
  142. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  143. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  144. <van-field
  145. readonly
  146. clickable
  147. label="工程款类型"
  148. placeholder="请选择"
  149. v-model="projectFundType"
  150. @click="showFundType = true"
  151. input-align="right"
  152. right-icon="arrow-down"
  153. required
  154. :rules="[{ required: true , message:'请选择工程款类型' }]"
  155. />
  156. <van-popup v-model="showFundType" position="bottom">
  157. <van-picker
  158. show-toolbar
  159. :columns="projectFundTypeOptions"
  160. @confirm="onConfirmFundType"
  161. @cancel="showFundType = false"
  162. />
  163. </van-popup>
  164. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  165. </div>
  166. <p class="main_title" v-if="contractOpen">关联合同</p>
  167. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  168. <van-field
  169. readonly
  170. clickable
  171. label="合同"
  172. placeholder="请选择"
  173. v-model="infoForm.name"
  174. @click="showcontract = true"
  175. input-align="right"
  176. right-icon="arrow-down"
  177. required
  178. :rules="[{ required: true , message:'请选择项目名称' }]"
  179. />
  180. <van-popup v-model="showcontract" position="bottom">
  181. <van-picker
  182. show-toolbar
  183. :columns="infoList"
  184. @confirm="onConfirmContract"
  185. @cancel="showcontract = false"
  186. />
  187. </van-popup>
  188. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  189. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  190. </div>
  191. <p class="main_title">付款方信息</p>
  192. <div class="main_box">
  193. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  194. <van-field
  195. readonly
  196. clickable
  197. label="付款方"
  198. placeholder="请选择付款方"
  199. v-model="form.payer"
  200. @click="showpayer = true"
  201. input-align="right"
  202. right-icon="arrow-down"
  203. label-width="auto"
  204. required
  205. :rules="[{ required: true , message:'请选择付款方' }]"
  206. />
  207. <van-popup v-model="showpayer" position="bottom">
  208. <van-picker
  209. show-toolbar
  210. :columns="payerOptions"
  211. @confirm="onConfirmPayer($event)"
  212. @cancel="showpayer = false"
  213. />
  214. </van-popup>
  215. <van-field :rules="[{ required: true , message:'可用余额不能为空' }]" required label="可用余额(元)" v-model="form.payerAccount" placeholder="请输入可用余额" input-align="right" label-width="auto"/>
  216. </div>
  217. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  218. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  219. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  220. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  221. <van-field required :rules="[{ required: true , message:'请输入收款方全称' }]" v-model="item.payee" label="收款方" placeholder="请输入收款方全称" input-align="right" label-width="auto"/>
  222. <van-field required :rules="[{ required: true , message:'请输入联系方式' }]" v-model="item.phone" label="联系方式" placeholder="请输入联系方式" input-align="right" label-width="auto"/>
  223. <van-field required :rules="[{ required: true , message:'请输入申请使用金额' }]" v-model="item.incomeAmount" type="number" label="申请使用金额(元)" placeholder="请输入申请使用金额" input-align="right" label-width="auto"/>
  224. <van-field required :rules="[{ required: true , message:'请输入资金用途' }]" v-model="item.remark" label="资金用途" placeholder="请输入资金用途" input-align="right" label-width="auto" />
  225. </div>
  226. </div>
  227. <p class="main_title">上传附件</p>
  228. <div class="main_box" style="padding: 5px 0 0 0;">
  229. <van-cell value="收据" />
  230. <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
  231. <van-cell title="发票" />
  232. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
  233. <van-cell title="其他" />
  234. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></van-uploader>
  235. </div>
  236. <div style="padding: 16px 0;">
  237. <van-row>
  238. <van-col span="12" align="center">
  239. <!-- @click="goUpdate"-->
  240. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  241. </van-col>
  242. <van-col span="12" align="center">
  243. <!-- @click="goAdd"-->
  244. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  245. </van-col>
  246. </van-row>
  247. <div class="clear"></div>
  248. </div>
  249. </van-form>
  250. </div>
  251. </template>
  252. <script>
  253. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto ,selectApprovalByTemplateId,
  254. cashSubmit , offlineCashSubmit, getAccount ,getQmyeFlow,listInfo ,getInfoto ,addInfoto ,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  255. import request from '@/utils/request'
  256. import {
  257. addCash,
  258. addCashdetail, attachmentList,
  259. commonAttach, listAccount1,
  260. updateCash
  261. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  262. import Dialog from "vant/lib/dialog";
  263. export default {
  264. name: "approvalAdd11",
  265. data() {
  266. return {
  267. showtemplate:false,
  268. showcontract:false,
  269. showcapital:false,
  270. showpayee:false,
  271. showlasj:false,
  272. showbankType:false,
  273. showproject:false,
  274. showFundType:false,
  275. showpayer:false,
  276. buttonType:'a',
  277. minDate: new Date(2000, 1, 1),
  278. maxDate: new Date(2050, 12, 31),
  279. currentDate: new Date(),
  280. form:{},
  281. fileList1:[],
  282. fileList2:[],
  283. fileList3:[],
  284. capitalExpenditureType:'',
  285. payee:'',
  286. bankType:'',
  287. wfydlxDictionaries:[],
  288. jglxDictionaries:[],
  289. sysDictionaries:[],
  290. capitalExpenditureTypeOptions:[],
  291. bankTypeDictionaries:[],
  292. projectFundTypeOptions:[],
  293. projectFundTypeDictionaries:[],
  294. projectList:[],
  295. infoList:[],
  296. payerOptions:[],
  297. chargeItme:[],
  298. chargeItmeShow:[],
  299. payeeList:[],
  300. // 查询参数
  301. queryParams: {
  302. cashType:11,
  303. orderByColumn: "id",
  304. isAsc: "desc",
  305. },
  306. capitalExpenditureOpen:false,
  307. contractOpen:false,
  308. projectForm:{
  309. projectId:null,
  310. projectName:null,
  311. projectContractor:null,
  312. projectAmount:null,
  313. projectBillNum:null,
  314. projectFundType:'1',
  315. outId:null,
  316. ynType:'2'
  317. },
  318. infoForm:{
  319. infoId:null,
  320. name:null,
  321. code:null,
  322. totalAmount:null,
  323. contractionId:null,
  324. transferId:null
  325. },
  326. // 合同信息查询参数
  327. queryContractionParams: {
  328. pageNum: 1,
  329. pageSize: 100,
  330. contractionStatus: '1',
  331. orderByColumn: "endTime",
  332. isAsc: "desc",
  333. },
  334. projectFundType:'',
  335. uploadFiles1:[],
  336. uploadFiles2:[],
  337. uploadFiles3:[],
  338. nowDate:"",
  339. templateList:[],
  340. };
  341. },
  342. created() {
  343. this.getNowDate();
  344. this.reset();
  345. this.initProjectInfo();
  346. this.getDicts("project_fund_type").then((response) => {
  347. for (var i = 0; i < response.data.length; i++) {
  348. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  349. }
  350. this.projectFundTypeDictionaries = response.data;
  351. });
  352. let queryParamsOld={
  353. accountType: "101",
  354. status: "N",
  355. }
  356. listAccount1(queryParamsOld).then((response) => {
  357. response.rows.map(res => {
  358. console.log(res)
  359. // res['accountName'] = this.$store.state.user.bookName
  360. // res['id'] = this.$store.state.user.loginBookId
  361. res['text'] = res.accountName+"余额:"+res.balance
  362. res['value'] = res.id
  363. res['bankAccountNumber'] = res.startDay
  364. res['payerFrom'] = '6'
  365. this.payerOptions.push(res)
  366. })
  367. });
  368. this.getDictionaries();
  369. this.addChargeItme();
  370. this.getTemplateList();
  371. },
  372. methods: {
  373. goFlow(){
  374. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  375. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  376. }else{
  377. this.$notify({ type: 'danger', message: '无审批流程!' });
  378. }
  379. },
  380. getTemplateList(){
  381. let templateQueryParams = {
  382. // 分页
  383. pageNum: 1,
  384. pageSize: 999,
  385. type :'3'
  386. };
  387. listTemplate(templateQueryParams).then(response => {
  388. this.templateList = response.rows;
  389. });
  390. },
  391. onConfirmTemplate(data){
  392. selectApprovalByTemplateId(data.id).then(res => {
  393. this.showtemplate = false;
  394. if(res.approvalDetails.length>0){
  395. this.form.approvalTemplateName = data.name
  396. this.form.approvalTemplateId = data.id
  397. }else{
  398. this.form.approvalTemplateName = null
  399. this.form.approvalTemplateId = null
  400. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  401. }
  402. })
  403. },
  404. getNowDate(){
  405. var _this = this;
  406. let yy = new Date().getFullYear();
  407. let mm = new Date().getMonth()+1;
  408. let dd = new Date().getDate();
  409. _this.nowDate = yy+'-'+mm+'-'+dd
  410. },
  411. initProjectInfo(){
  412. let _this = this
  413. let queryParams={
  414. pageNum: 1,
  415. pageSize: 100,
  416. }
  417. listProject(queryParams).then(response => {
  418. _this.projectList = response.rows;
  419. for (let i = 0; i < response.rows.length; i++) {
  420. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  421. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  422. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  423. }
  424. });
  425. listInfo(this.queryContractionParams).then(response => {
  426. _this.infoList = response.rows;
  427. for (let i = 0; i < response.rows.length; i++) {
  428. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  429. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  430. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  431. }
  432. });
  433. },
  434. // 表单重置
  435. reset() {
  436. this.form = {
  437. id: null,
  438. upId: null,
  439. applyDate:this.nowDate,
  440. approvalMode:'1',
  441. downId: null,
  442. orderId: null,
  443. cashierId: null,
  444. cashType: 11,
  445. accountType: '2',
  446. explainSituation: null,
  447. succeedAmount: null,
  448. payer: null,
  449. payerAccount: null,
  450. operatorCode: null,
  451. enterpriseCode: null,
  452. expenditureAmount: null,
  453. capitalExpenditureType: '1',
  454. remark: null,
  455. transferStatus: "0",
  456. auditStatus: "0",
  457. paymentState: "1",
  458. bankPriority: "0",
  459. clientPriority: "0"
  460. };
  461. this.processList = {}
  462. this.projectForm={
  463. projectId:null,
  464. projectName:null,
  465. projectContractor:null,
  466. projectAmount:null,
  467. projectBillNum:null,
  468. projectFundType:'1',
  469. outId:null,
  470. ynType:'2'
  471. }
  472. },
  473. getChange(){
  474. if(this.buttonType == 'update'){
  475. this.goUpdate();
  476. }else if(this.buttonType == 'add'){
  477. this.goAdd();
  478. }
  479. },
  480. getDictionaries(){
  481. this.getDicts("capital_expenditure_type").then((res) => {
  482. for (let i = 0; i < res.data.length; i++) {
  483. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  484. }
  485. });
  486. this.getPayeeList();
  487. },
  488. getError(e){
  489. this.$notify({ type: 'danger', message: e.errors[0].message });
  490. },
  491. addChargeItme(index){
  492. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  493. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  494. return;
  495. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  496. this.$notify({ type: 'danger', message: '请输入提款金额!' });
  497. return;
  498. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].drawer == ''){
  499. this.$notify({ type: 'danger', message: '请输入提款人!' });
  500. return;
  501. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].remark == ''){
  502. this.$notify({ type: 'danger', message: '请输入资金用途!' });
  503. return;
  504. }
  505. this.chargeItme.splice(index + 1, 0, {
  506. payeeId: "", //收款方ID
  507. payee: "", //收款方全称
  508. payeeAccount: "", //收款账户
  509. drawer: "", //提款人
  510. incomeAmount: "", //提款金额
  511. bankType: "", //资金用途
  512. showPayee:false,
  513. showbankType:false
  514. });
  515. },
  516. getPayeeList() {
  517. //普通转账
  518. this.queryParams.accountType = this.form.accountType
  519. this.queryParams.status = "0"
  520. listPayee(this.queryParams).then((response) => {
  521. this.payeeList = response.rows;
  522. response.rows.map((res,index) => {
  523. this.payeeList[index].text = res.payee;
  524. this.payeeList[index].value = res.id;
  525. })
  526. });
  527. },
  528. payeeDictLabel(datas, value) {
  529. let actions = [];
  530. Object.keys(datas).some((key) => {
  531. if (datas[key].payeeId == ('' + value)) {
  532. actions.push(datas[key].payee);
  533. return true;
  534. }
  535. })
  536. return actions.join('');
  537. },
  538. onConfirmCapital(data){
  539. if (data.value == 2){
  540. this.capitalExpenditureOpen = true;
  541. this.contractOpen = false
  542. this.infoForm = {};
  543. }else if(data.value == 4){
  544. this.capitalExpenditureOpen = false;
  545. this.contractOpen = true
  546. this.projectForm = {};
  547. }else{
  548. this.capitalExpenditureOpen = false;
  549. this.contractOpen = false
  550. this.projectForm = {};
  551. this.infoForm = {};
  552. }
  553. this.capitalExpenditureType = data.text;
  554. this.form.capitalExpenditureType = data.value;
  555. this.showcapital = false;
  556. },
  557. onConfirmFundType(data){
  558. this.projectForm.projectFundType = data.value;
  559. this.projectFundType = data.text;
  560. this.showFundType = false;
  561. },
  562. onConfirmContract(data){
  563. this.infoList.map(res => {
  564. if(res.name==data.text){
  565. this.infoForm.contractionId = res.id;
  566. this.infoForm.name = res.name;
  567. this.infoForm.code = res.code;
  568. this.infoForm.totalAmount = res.totalAmount;
  569. }
  570. })
  571. this.showcontract = false;
  572. },
  573. onConfirmProject(data){
  574. this.projectList.map(res => {
  575. if(res.projectName==data.text){
  576. this.projectForm.projectId = res.id
  577. this.projectForm.projectName = res.projectName
  578. this.projectForm.projectContractor = res.projectContractor
  579. this.projectForm.projectAmount = res.projectAmount
  580. }
  581. })
  582. this.showproject = false;
  583. },
  584. onConfirmPayee(data,index){
  585. for (var i = 0 ; i < this.chargeItme.length ; i++){
  586. this.chargeItme[i].showPayee = false;
  587. }
  588. this.chargeItme[index].payee = data.text;
  589. this.chargeItme[index].payeeId = data.value;
  590. this.chargeItme[index].showpayee = false;
  591. this.payeeSelectChange(data.value , index)
  592. },
  593. onConfirmBankType(data,index){
  594. for (var i = 0 ; i < this.chargeItme.length ; i++){
  595. this.chargeItme[i].showbankType = false;
  596. }
  597. this.chargeItme[index].bankTypeText = data.text;
  598. this.chargeItme[index].bankType = data.value;
  599. this.chargeItme[index].showbankType = false;
  600. },
  601. onConfirmPayer(data){
  602. this.form.payer = data.text;
  603. this.form.cashierId = data.value;
  604. this.showpayer = false;
  605. this.selectChange(data.value)
  606. },
  607. onConfirmLasj(data){
  608. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  609. this.showlasj = false;
  610. },
  611. accountTypeChange(e){
  612. this.payeeList = [];
  613. this.queryParams.accountType = this.form.accountType
  614. this.queryParams.status = "0"
  615. listPayee(this.queryParams).then((response) => {
  616. this.payeeList = response.rows;
  617. response.rows.map((res,index) => {
  618. this.payeeList[index].text = res.payee;
  619. this.payeeList[index].value = res.id;
  620. })
  621. });
  622. },
  623. goAdd(){
  624. let _this = this
  625. if(this.form.payerAccount==0){
  626. this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });
  627. return false;
  628. }else {
  629. let total = 0;
  630. this.chargeItme.forEach((money) => {
  631. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  632. });
  633. this.$set(this.form, "expenditureAmount", total);
  634. if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
  635. this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
  636. return false;
  637. }else{
  638. if(this.chargeItme.length<1){
  639. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  640. return false;
  641. }
  642. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  643. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  644. return false;
  645. }
  646. if(this.form.capitalExpenditureType==2){
  647. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  648. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  649. return false;
  650. }
  651. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  652. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  653. return false;
  654. }
  655. }
  656. if(this.form.capitalExpenditureType==4){
  657. if(this.infoForm.name==""||this.infoForm.name==null){
  658. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  659. return false;
  660. }
  661. if(this.infoForm.code==""||this.infoForm.code==null){
  662. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  663. return false;
  664. }
  665. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  666. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  667. return false;
  668. }
  669. }
  670. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  671. Dialog.confirm({
  672. title: '提示',
  673. message: '此申请单中未上传任何附件,是否确认提交?',
  674. })
  675. .then(() => {
  676. addCash(this.form).then((response) => {
  677. this.chargeItme.map((res,idx) => {
  678. res.cashId = response.data.id
  679. addCashdetail(res).then(r => {
  680. if(idx == (_this.chargeItme.length - 1)){
  681. if(_this.form.capitalExpenditureType==2){
  682. _this.projectForm.outId = response.data.id
  683. _this.$set(_this.projectForm, "ynType", '2');
  684. addProjectto(_this.projectForm).then(res => {
  685. if(_this.form.approvalMode === '1'){
  686. cashSubmit(response.data.id).then(res => {
  687. _this.$toast.success('提交成功');
  688. setTimeout(function(){
  689. history.go(-1)
  690. },2000)
  691. })
  692. }else{
  693. offlineCashSubmit(response.data.id).then(res => {
  694. _this.$toast.success('提交成功');
  695. setTimeout(function(){
  696. history.go(-1)
  697. },2000)
  698. })
  699. }
  700. })
  701. }else if(_this.form.capitalExpenditureType==4){
  702. _this.infoForm.transferId = response.data.id
  703. addInfoto(_this.infoForm).then(res => {
  704. if(_this.form.approvalMode === '1'){
  705. cashSubmit(response.data.id).then(res => {
  706. _this.$toast.success('提交成功');
  707. setTimeout(function(){
  708. history.go(-1)
  709. },2000)
  710. })
  711. }else{
  712. offlineCashSubmit(response.data.id).then(res => {
  713. _this.$toast.success('提交成功');
  714. setTimeout(function(){
  715. history.go(-1)
  716. },2000)
  717. })
  718. }
  719. })
  720. }else{
  721. if(_this.form.approvalMode === '1'){
  722. cashSubmit(response.data.id).then(res => {
  723. _this.$toast.success('提交成功');
  724. setTimeout(function(){
  725. history.go(-1)
  726. },2000)
  727. })
  728. }else{
  729. offlineCashSubmit(response.data.id).then(res => {
  730. _this.$toast.success('提交成功');
  731. setTimeout(function(){
  732. history.go(-1)
  733. },2000)
  734. })
  735. }
  736. }
  737. }
  738. })
  739. })
  740. });
  741. })
  742. }else{
  743. addCash(this.form).then((response) => {
  744. this.chargeItme.map(res => {
  745. res.cashId = response.data.id
  746. addCashdetail(res).then(r => {})
  747. })
  748. this.projectForm.outId = response.data.id
  749. this.infoForm.transferId = response.data.id
  750. this.$set(this.projectForm, "ynType", '2');
  751. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  752. this.uploadFiles1.map((rr1,idx1) => {
  753. let params1 = new FormData();
  754. params1.append("tableId", response.data.id);
  755. params1.append("tableName", "t_yinnong_cash");
  756. params1.append("bizPath", "yinnong");
  757. params1.append("fileType", "1");
  758. params1.append("file", rr1);
  759. commonAttach(params1).then((r1) => {
  760. if(idx1 == (_this.uploadFiles1.length-1)){
  761. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  762. _this.uploadFiles2.map((rr2,idx2) => {
  763. let params2 = new FormData();
  764. params2.append("tableId", response.data.id);
  765. params2.append("tableName", "t_yinnong_cash");
  766. params2.append("bizPath", "yinnong");
  767. params2.append("fileType", "2");
  768. params2.append("file", rr2);
  769. commonAttach(params2).then((r2) => {
  770. if(idx2 == (_this.uploadFiles2.length-1)){
  771. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  772. _this.uploadFiles3.map((rr3,idx3) => {
  773. let params3 = new FormData();
  774. params3.append("tableId", response.data.id);
  775. params3.append("tableName", "t_yinnong_cash");
  776. params3.append("bizPath", "yinnong");
  777. params3.append("fileType", "3");
  778. params3.append("file", rr3);
  779. commonAttach(params3).then((r3) => {
  780. if(idx3 == (_this.uploadFiles3.length-1)){
  781. if(_this.form.capitalExpenditureType==2){
  782. addProjectto(_this.projectForm).then(res => {
  783. if(_this.form.approvalMode === '1'){
  784. cashSubmit(response.data.id).then(res => {
  785. _this.chargeItme.map((resD,b) => {
  786. resD.cashId = response.data.id
  787. addCashdetail(resD).then((a,rD) => {
  788. if(b == (_this.chargeItme.length-1)){
  789. _this.$toast.success('提交成功');
  790. setTimeout(function(){
  791. history.go(-1)
  792. },2000)
  793. }
  794. })
  795. })
  796. })
  797. }else{
  798. offlineCashSubmit(response.data.id).then(res => {
  799. _this.chargeItme.map((resD,b) => {
  800. resD.cashId = response.data.id
  801. addCashdetail(resD).then((a,rD) => {
  802. if(b == (_this.chargeItme.length-1)){
  803. _this.$toast.success('提交成功');
  804. setTimeout(function(){
  805. history.go(-1)
  806. },2000)
  807. }
  808. })
  809. })
  810. })
  811. }
  812. })
  813. } else if(_this.form.capitalExpenditureType==4){
  814. addInfoto(_this.infoForm).then(res => {
  815. if(_this.form.approvalMode === '1'){
  816. cashSubmit(response.data.id).then(res => {
  817. _this.chargeItme.map((resD,b) => {
  818. resD.cashId = response.data.id
  819. addCashdetail(resD).then((a,rD) => {
  820. if(b == (_this.chargeItme.length-1)){
  821. _this.$toast.success('提交成功');
  822. setTimeout(function(){
  823. history.go(-1)
  824. },2000)
  825. }
  826. })
  827. })
  828. })
  829. }else{
  830. offlineCashSubmit(response.data.id).then(res => {
  831. _this.chargeItme.map((resD,b) => {
  832. resD.cashId = response.data.id
  833. addCashdetail(resD).then((a,rD) => {
  834. if(b == (_this.chargeItme.length-1)){
  835. _this.$toast.success('提交成功');
  836. setTimeout(function(){
  837. history.go(-1)
  838. },2000)
  839. }
  840. })
  841. })
  842. })
  843. }
  844. })
  845. }else{
  846. if(_this.form.approvalMode === '1'){
  847. cashSubmit(response.data.id).then(res => {
  848. _this.chargeItme.map((resD,b) => {
  849. resD.cashId = response.data.id
  850. addCashdetail(resD).then((a,rD) => {
  851. if(b == (_this.chargeItme.length-1)){
  852. _this.$toast.success('提交成功');
  853. setTimeout(function(){
  854. history.go(-1)
  855. },2000)
  856. }
  857. })
  858. })
  859. })
  860. }else{
  861. offlineCashSubmit(response.data.id).then(res => {
  862. _this.chargeItme.map((resD,b) => {
  863. resD.cashId = response.data.id
  864. addCashdetail(resD).then((a,rD) => {
  865. if(b == (_this.chargeItme.length-1)){
  866. _this.$toast.success('提交成功');
  867. setTimeout(function(){
  868. history.go(-1)
  869. },2000)
  870. }
  871. })
  872. })
  873. })
  874. }
  875. }
  876. }
  877. })
  878. })
  879. }else{
  880. if(_this.form.capitalExpenditureType==2){
  881. addProjectto(_this.projectForm).then(res => {
  882. if(_this.form.approvalMode === '1'){
  883. cashSubmit(response.data.id).then(res => {
  884. _this.chargeItme.map((resD,b) => {
  885. resD.cashId = response.data.id
  886. addCashdetail(resD).then((a,rD) => {
  887. if(b == (_this.chargeItme.length-1)){
  888. _this.$toast.success('提交成功');
  889. setTimeout(function(){
  890. history.go(-1)
  891. },2000)
  892. }
  893. })
  894. })
  895. })
  896. }else{
  897. offlineCashSubmit(response.data.id).then(res => {
  898. _this.chargeItme.map((resD,b) => {
  899. resD.cashId = response.data.id
  900. addCashdetail(resD).then((a,rD) => {
  901. if(b == (_this.chargeItme.length-1)){
  902. _this.$toast.success('提交成功');
  903. setTimeout(function(){
  904. history.go(-1)
  905. },2000)
  906. }
  907. })
  908. })
  909. })
  910. }
  911. })
  912. } else if(_this.form.capitalExpenditureType==4){
  913. addInfoto(_this.infoForm).then(res => {
  914. if(_this.form.approvalMode === '1'){
  915. cashSubmit(response.data.id).then(res => {
  916. _this.chargeItme.map((resD,b) => {
  917. resD.cashId = response.data.id
  918. addCashdetail(resD).then((a,rD) => {
  919. if(b == (_this.chargeItme.length-1)){
  920. _this.$toast.success('提交成功');
  921. setTimeout(function(){
  922. history.go(-1)
  923. },2000)
  924. }
  925. })
  926. })
  927. })
  928. }else{
  929. offlineCashSubmit(response.data.id).then(res => {
  930. _this.chargeItme.map((resD,b) => {
  931. resD.cashId = response.data.id
  932. addCashdetail(resD).then((a,rD) => {
  933. if(b == (_this.chargeItme.length-1)){
  934. _this.$toast.success('提交成功');
  935. setTimeout(function(){
  936. history.go(-1)
  937. },2000)
  938. }
  939. })
  940. })
  941. })
  942. }
  943. })
  944. }else{
  945. if(_this.form.approvalMode === '1'){
  946. cashSubmit(response.data.id).then(res => {
  947. _this.chargeItme.map((resD,b) => {
  948. resD.cashId = response.data.id
  949. addCashdetail(resD).then((a,rD) => {
  950. if(b == (_this.chargeItme.length-1)){
  951. _this.$toast.success('提交成功');
  952. setTimeout(function(){
  953. history.go(-1)
  954. },2000)
  955. }
  956. })
  957. })
  958. })
  959. }else{
  960. offlineCashSubmit(response.data.id).then(res => {
  961. _this.chargeItme.map((resD,b) => {
  962. resD.cashId = response.data.id
  963. addCashdetail(resD).then((a,rD) => {
  964. if(b == (_this.chargeItme.length-1)){
  965. _this.$toast.success('提交成功');
  966. setTimeout(function(){
  967. history.go(-1)
  968. },2000)
  969. }
  970. })
  971. })
  972. })
  973. }
  974. }
  975. }
  976. }
  977. })
  978. })
  979. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  980. _this.uploadFiles3.map((rr3,idx3) => {
  981. let params3 = new FormData();
  982. params3.append("tableId", response.data.id);
  983. params3.append("tableName", "t_yinnong_cash");
  984. params3.append("bizPath", "yinnong");
  985. params3.append("fileType", "3");
  986. params3.append("file", rr3);
  987. commonAttach(params3).then((r3) => {
  988. if(idx3 ==(_this.uploadFiles3.length-1)){
  989. if(_this.form.capitalExpenditureType==2){
  990. addProjectto(_this.projectForm).then(res => {
  991. if(_this.form.approvalMode === '1'){
  992. cashSubmit(response.data.id).then(res => {
  993. _this.chargeItme.map((resD,b) => {
  994. resD.cashId = response.data.id
  995. addCashdetail(resD).then((a,rD) => {
  996. if(b == (_this.chargeItme.length-1)){
  997. _this.$toast.success('提交成功');
  998. setTimeout(function(){
  999. history.go(-1)
  1000. },2000)
  1001. }
  1002. })
  1003. })
  1004. })
  1005. }else{
  1006. offlineCashSubmit(response.data.id).then(res => {
  1007. _this.chargeItme.map((resD,b) => {
  1008. resD.cashId = response.data.id
  1009. addCashdetail(resD).then((a,rD) => {
  1010. if(b == (_this.chargeItme.length-1)){
  1011. _this.$toast.success('提交成功');
  1012. setTimeout(function(){
  1013. history.go(-1)
  1014. },2000)
  1015. }
  1016. })
  1017. })
  1018. })
  1019. }
  1020. })
  1021. } else if(_this.form.capitalExpenditureType==4){
  1022. addInfoto(_this.infoForm).then(res => {
  1023. if(_this.form.approvalMode === '1'){
  1024. cashSubmit(response.data.id).then(res => {
  1025. _this.chargeItme.map((resD,b) => {
  1026. resD.cashId = response.data.id
  1027. addCashdetail(resD).then((a,rD) => {
  1028. if(b == (_this.chargeItme.length-1)){
  1029. _this.$toast.success('提交成功');
  1030. setTimeout(function(){
  1031. history.go(-1)
  1032. },2000)
  1033. }
  1034. })
  1035. })
  1036. })
  1037. }else{
  1038. offlineCashSubmit(response.data.id).then(res => {
  1039. _this.chargeItme.map((resD,b) => {
  1040. resD.cashId = response.data.id
  1041. addCashdetail(resD).then((a,rD) => {
  1042. if(b == (_this.chargeItme.length-1)){
  1043. _this.$toast.success('提交成功');
  1044. setTimeout(function(){
  1045. history.go(-1)
  1046. },2000)
  1047. }
  1048. })
  1049. })
  1050. })
  1051. }
  1052. })
  1053. }else{
  1054. if(_this.form.approvalMode === '1'){
  1055. cashSubmit(response.data.id).then(res => {
  1056. _this.chargeItme.map((resD,b) => {
  1057. resD.cashId = response.data.id
  1058. addCashdetail(resD).then((a,rD) => {
  1059. if(b == (_this.chargeItme.length-1)){
  1060. _this.$toast.success('提交成功');
  1061. setTimeout(function(){
  1062. history.go(-1)
  1063. },2000)
  1064. }
  1065. })
  1066. })
  1067. })
  1068. }else{
  1069. offlineCashSubmit(response.data.id).then(res => {
  1070. _this.chargeItme.map((resD,b) => {
  1071. resD.cashId = response.data.id
  1072. addCashdetail(resD).then((a,rD) => {
  1073. if(b == (_this.chargeItme.length-1)){
  1074. _this.$toast.success('提交成功');
  1075. setTimeout(function(){
  1076. history.go(-1)
  1077. },2000)
  1078. }
  1079. })
  1080. })
  1081. })
  1082. }
  1083. }
  1084. }
  1085. })
  1086. })
  1087. }else{
  1088. if(_this.form.capitalExpenditureType==2){
  1089. addProjectto(_this.projectForm).then(res => {
  1090. if(_this.form.approvalMode === '1'){
  1091. cashSubmit(response.data.id).then(res => {
  1092. _this.chargeItme.map((resD,b) => {
  1093. resD.cashId = response.data.id
  1094. addCashdetail(resD).then((a,rD) => {
  1095. if(b == (_this.chargeItme.length-1)){
  1096. _this.$toast.success('提交成功');
  1097. setTimeout(function(){
  1098. history.go(-1)
  1099. },2000)
  1100. }
  1101. })
  1102. })
  1103. })
  1104. }else{
  1105. offlineCashSubmit(response.data.id).then(res => {
  1106. _this.chargeItme.map((resD,b) => {
  1107. resD.cashId = response.data.id
  1108. addCashdetail(resD).then((a,rD) => {
  1109. if(b == (_this.chargeItme.length-1)){
  1110. _this.$toast.success('提交成功');
  1111. setTimeout(function(){
  1112. history.go(-1)
  1113. },2000)
  1114. }
  1115. })
  1116. })
  1117. })
  1118. }
  1119. })
  1120. } else if(_this.form.capitalExpenditureType==4){
  1121. addInfoto(_this.infoForm).then(res => {
  1122. if(_this.form.approvalMode === '1'){
  1123. cashSubmit(response.data.id).then(res => {
  1124. _this.chargeItme.map((resD,b) => {
  1125. resD.cashId = response.data.id
  1126. addCashdetail(resD).then((a,rD) => {
  1127. if(b == (_this.chargeItme.length-1)){
  1128. _this.$toast.success('提交成功');
  1129. setTimeout(function(){
  1130. history.go(-1)
  1131. },2000)
  1132. }
  1133. })
  1134. })
  1135. })
  1136. }else{
  1137. offlineCashSubmit(response.data.id).then(res => {
  1138. _this.chargeItme.map((resD,b) => {
  1139. resD.cashId = response.data.id
  1140. addCashdetail(resD).then((a,rD) => {
  1141. if(b == (_this.chargeItme.length-1)){
  1142. _this.$toast.success('提交成功');
  1143. setTimeout(function(){
  1144. history.go(-1)
  1145. },2000)
  1146. }
  1147. })
  1148. })
  1149. })
  1150. }
  1151. })
  1152. }else{
  1153. if(_this.form.approvalMode === '1'){
  1154. cashSubmit(response.data.id).then(res => {
  1155. _this.chargeItme.map((resD,b) => {
  1156. resD.cashId = response.data.id
  1157. addCashdetail(resD).then((a,rD) => {
  1158. if(b == (_this.chargeItme.length-1)){
  1159. _this.$toast.success('提交成功');
  1160. setTimeout(function(){
  1161. history.go(-1)
  1162. },2000)
  1163. }
  1164. })
  1165. })
  1166. })
  1167. }else{
  1168. offlineCashSubmit(response.data.id).then(res => {
  1169. _this.chargeItme.map((resD,b) => {
  1170. resD.cashId = response.data.id
  1171. addCashdetail(resD).then((a,rD) => {
  1172. if(b == (_this.chargeItme.length-1)){
  1173. _this.$toast.success('提交成功');
  1174. setTimeout(function(){
  1175. history.go(-1)
  1176. },2000)
  1177. }
  1178. })
  1179. })
  1180. })
  1181. }
  1182. }
  1183. }
  1184. }
  1185. })
  1186. })
  1187. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1188. this.uploadFiles2.map((rr2,idx2) => {
  1189. let params = new FormData();
  1190. params.append("tableId", response.data.id);
  1191. params.append("tableName", "t_yinnong_cash");
  1192. params.append("bizPath", "yinnong");
  1193. params.append("fileType", "2");
  1194. params.append("file", rr2);
  1195. commonAttach(params).then((r2) => {
  1196. if(idx2 == (_this.uploadFiles2.length-1)){
  1197. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1198. _this.uploadFiles3.map((rr3,idx3) => {
  1199. let params3 = new FormData();
  1200. params3.append("tableId", response.data.id);
  1201. params3.append("tableName", "t_yinnong_cash");
  1202. params3.append("bizPath", "yinnong");
  1203. params3.append("fileType", "3");
  1204. params3.append("file", rr3);
  1205. commonAttach(params).then((r3) => {
  1206. if(idx3 == (_this.uploadFiles3.length-1)){
  1207. if(_this.form.capitalExpenditureType==2){
  1208. addProjectto(_this.projectForm).then(res => {
  1209. if(_this.form.approvalMode === '1'){
  1210. cashSubmit(response.data.id).then(res => {
  1211. _this.chargeItme.map((resD,b) => {
  1212. resD.cashId = response.data.id
  1213. addCashdetail(resD).then((a,rD) => {
  1214. if(b == (_this.chargeItme.length-1)){
  1215. _this.$toast.success('提交成功');
  1216. setTimeout(function(){
  1217. history.go(-1)
  1218. },2000)
  1219. }
  1220. })
  1221. })
  1222. })
  1223. }else{
  1224. offlineCashSubmit(response.data.id).then(res => {
  1225. _this.chargeItme.map((resD,b) => {
  1226. resD.cashId = response.data.id
  1227. addCashdetail(resD).then((a,rD) => {
  1228. if(b == (_this.chargeItme.length-1)){
  1229. _this.$toast.success('提交成功');
  1230. setTimeout(function(){
  1231. history.go(-1)
  1232. },2000)
  1233. }
  1234. })
  1235. })
  1236. })
  1237. }
  1238. })
  1239. } else if(_this.form.capitalExpenditureType==4){
  1240. addInfoto(_this.infoForm).then(res => {
  1241. if(_this.form.approvalMode === '1'){
  1242. cashSubmit(response.data.id).then(res => {
  1243. _this.chargeItme.map((resD,b) => {
  1244. resD.cashId = response.data.id
  1245. addCashdetail(resD).then((a,rD) => {
  1246. if(b == (_this.chargeItme.length-1)){
  1247. _this.$toast.success('提交成功');
  1248. setTimeout(function(){
  1249. history.go(-1)
  1250. },2000)
  1251. }
  1252. })
  1253. })
  1254. })
  1255. }else{
  1256. offlineCashSubmit(response.data.id).then(res => {
  1257. _this.chargeItme.map((resD,b) => {
  1258. resD.cashId = response.data.id
  1259. addCashdetail(resD).then((a,rD) => {
  1260. if(b == (_this.chargeItme.length-1)){
  1261. _this.$toast.success('提交成功');
  1262. setTimeout(function(){
  1263. history.go(-1)
  1264. },2000)
  1265. }
  1266. })
  1267. })
  1268. })
  1269. }
  1270. })
  1271. }else{
  1272. if(_this.form.approvalMode === '1'){
  1273. cashSubmit(response.data.id).then(res => {
  1274. _this.chargeItme.map((resD,b) => {
  1275. resD.cashId = response.data.id
  1276. addCashdetail(resD).then((a,rD) => {
  1277. if(b == (_this.chargeItme.length-1)){
  1278. _this.$toast.success('提交成功');
  1279. setTimeout(function(){
  1280. history.go(-1)
  1281. },2000)
  1282. }
  1283. })
  1284. })
  1285. })
  1286. }else{
  1287. offlineCashSubmit(response.data.id).then(res => {
  1288. _this.chargeItme.map((resD,b) => {
  1289. resD.cashId = response.data.id
  1290. addCashdetail(resD).then((a,rD) => {
  1291. if(b == (_this.chargeItme.length-1)){
  1292. _this.$toast.success('提交成功');
  1293. setTimeout(function(){
  1294. history.go(-1)
  1295. },2000)
  1296. }
  1297. })
  1298. })
  1299. })
  1300. }
  1301. }
  1302. }
  1303. })
  1304. })
  1305. }else{
  1306. if(_this.form.capitalExpenditureType==2){
  1307. addProjectto(_this.projectForm).then(res => {
  1308. if(_this.form.approvalMode === '1'){
  1309. cashSubmit(response.data.id).then(res => {
  1310. _this.chargeItme.map((resD,b) => {
  1311. resD.cashId = response.data.id
  1312. addCashdetail(resD).then((a,rD) => {
  1313. if(b == (_this.chargeItme.length-1)){
  1314. _this.$toast.success('提交成功');
  1315. setTimeout(function(){
  1316. history.go(-1)
  1317. },2000)
  1318. }
  1319. })
  1320. })
  1321. })
  1322. }else{
  1323. offlineCashSubmit(response.data.id).then(res => {
  1324. _this.chargeItme.map((resD,b) => {
  1325. resD.cashId = response.data.id
  1326. addCashdetail(resD).then((a,rD) => {
  1327. if(b == (_this.chargeItme.length-1)){
  1328. _this.$toast.success('提交成功');
  1329. setTimeout(function(){
  1330. history.go(-1)
  1331. },2000)
  1332. }
  1333. })
  1334. })
  1335. })
  1336. }
  1337. })
  1338. } else if(_this.form.capitalExpenditureType==4){
  1339. addInfoto(_this.infoForm).then(res => {
  1340. if(_this.form.approvalMode === '1'){
  1341. cashSubmit(response.data.id).then(res => {
  1342. _this.chargeItme.map((resD,b) => {
  1343. resD.cashId = response.data.id
  1344. addCashdetail(resD).then((a,rD) => {
  1345. if(b == (_this.chargeItme.length-1)){
  1346. _this.$toast.success('提交成功');
  1347. setTimeout(function(){
  1348. history.go(-1)
  1349. },2000)
  1350. }
  1351. })
  1352. })
  1353. })
  1354. }else{
  1355. offlineCashSubmit(response.data.id).then(res => {
  1356. _this.chargeItme.map((resD,b) => {
  1357. resD.cashId = response.data.id
  1358. addCashdetail(resD).then((a,rD) => {
  1359. if(b == (_this.chargeItme.length-1)){
  1360. _this.$toast.success('提交成功');
  1361. setTimeout(function(){
  1362. history.go(-1)
  1363. },2000)
  1364. }
  1365. })
  1366. })
  1367. })
  1368. }
  1369. })
  1370. }else{
  1371. if(_this.form.approvalMode === '1'){
  1372. cashSubmit(response.data.id).then(res => {
  1373. _this.chargeItme.map((resD,b) => {
  1374. resD.cashId = response.data.id
  1375. addCashdetail(resD).then((a,rD) => {
  1376. if(b == (_this.chargeItme.length-1)){
  1377. _this.$toast.success('提交成功');
  1378. setTimeout(function(){
  1379. history.go(-1)
  1380. },2000)
  1381. }
  1382. })
  1383. })
  1384. })
  1385. }else{
  1386. offlineCashSubmit(response.data.id).then(res => {
  1387. _this.chargeItme.map((resD,b) => {
  1388. resD.cashId = response.data.id
  1389. addCashdetail(resD).then((a,rD) => {
  1390. if(b == (_this.chargeItme.length-1)){
  1391. _this.$toast.success('提交成功');
  1392. setTimeout(function(){
  1393. history.go(-1)
  1394. },2000)
  1395. }
  1396. })
  1397. })
  1398. })
  1399. }
  1400. }
  1401. }
  1402. }
  1403. })
  1404. })
  1405. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1406. this.uploadFiles3.map((rr3,idx3) => {
  1407. let params = new FormData();
  1408. params.append("tableId", response.data.id);
  1409. params.append("tableName", "t_yinnong_cash");
  1410. params.append("bizPath", "yinnong");
  1411. params.append("fileType", "3");
  1412. params.append("file", rr3);
  1413. commonAttach(params).then((r) => {
  1414. if(idx3 == (_this.uploadFiles3.length-1)){
  1415. if(_this.form.capitalExpenditureType==2){
  1416. addProjectto(_this.projectForm).then(res => {
  1417. if(_this.form.approvalMode === '1'){
  1418. cashSubmit(response.data.id).then(res => {
  1419. _this.chargeItme.map((resD,b) => {
  1420. resD.cashId = response.data.id
  1421. addCashdetail(resD).then((a,rD) => {
  1422. if(b == (_this.chargeItme.length-1)){
  1423. _this.$toast.success('提交成功');
  1424. setTimeout(function(){
  1425. history.go(-1)
  1426. },2000)
  1427. }
  1428. })
  1429. })
  1430. })
  1431. }else{
  1432. offlineCashSubmit(response.data.id).then(res => {
  1433. _this.chargeItme.map((resD,b) => {
  1434. resD.cashId = response.data.id
  1435. addCashdetail(resD).then((a,rD) => {
  1436. if(b == (_this.chargeItme.length-1)){
  1437. _this.$toast.success('提交成功');
  1438. setTimeout(function(){
  1439. history.go(-1)
  1440. },2000)
  1441. }
  1442. })
  1443. })
  1444. })
  1445. }
  1446. })
  1447. } else if(_this.form.capitalExpenditureType==4){
  1448. addInfoto(_this.infoForm).then(res => {
  1449. if(_this.form.approvalMode === '1'){
  1450. cashSubmit(response.data.id).then(res => {
  1451. _this.chargeItme.map((resD,b) => {
  1452. resD.cashId = response.data.id
  1453. addCashdetail(resD).then((a,rD) => {
  1454. if(b == (_this.chargeItme.length-1)){
  1455. _this.$toast.success('提交成功');
  1456. setTimeout(function(){
  1457. history.go(-1)
  1458. },2000)
  1459. }
  1460. })
  1461. })
  1462. })
  1463. }else{
  1464. offlineCashSubmit(response.data.id).then(res => {
  1465. _this.chargeItme.map((resD,b) => {
  1466. resD.cashId = response.data.id
  1467. addCashdetail(resD).then((a,rD) => {
  1468. if(b == (_this.chargeItme.length-1)){
  1469. _this.$toast.success('提交成功');
  1470. setTimeout(function(){
  1471. history.go(-1)
  1472. },2000)
  1473. }
  1474. })
  1475. })
  1476. })
  1477. }
  1478. })
  1479. }else{
  1480. if(_this.form.approvalMode === '1'){
  1481. cashSubmit(response.data.id).then(res => {
  1482. _this.chargeItme.map((resD,b) => {
  1483. resD.cashId = response.data.id
  1484. addCashdetail(resD).then((a,rD) => {
  1485. if(b == (_this.chargeItme.length-1)){
  1486. _this.$toast.success('提交成功');
  1487. setTimeout(function(){
  1488. history.go(-1)
  1489. },2000)
  1490. }
  1491. })
  1492. })
  1493. })
  1494. }else{
  1495. offlineCashSubmit(response.data.id).then(res => {
  1496. _this.chargeItme.map((resD,b) => {
  1497. resD.cashId = response.data.id
  1498. addCashdetail(resD).then((a,rD) => {
  1499. if(b == (_this.chargeItme.length-1)){
  1500. _this.$toast.success('提交成功');
  1501. setTimeout(function(){
  1502. history.go(-1)
  1503. },2000)
  1504. }
  1505. })
  1506. })
  1507. })
  1508. }
  1509. }
  1510. }
  1511. })
  1512. })
  1513. }else{
  1514. if(this.form.capitalExpenditureType==2){
  1515. addProjectto(this.projectForm).then(res => {
  1516. if(_this.form.approvalMode === '1'){
  1517. cashSubmit(response.data.id).then(res => {
  1518. _this.chargeItme.map((resD,b) => {
  1519. resD.cashId = response.data.id
  1520. addCashdetail(resD).then((a,rD) => {
  1521. if(b == (_this.chargeItme.length-1)){
  1522. _this.$toast.success('提交成功');
  1523. setTimeout(function(){
  1524. history.go(-1)
  1525. },2000)
  1526. }
  1527. })
  1528. })
  1529. })
  1530. }else{
  1531. offlineCashSubmit(response.data.id).then(res => {
  1532. _this.chargeItme.map((resD,b) => {
  1533. resD.cashId = response.data.id
  1534. addCashdetail(resD).then((a,rD) => {
  1535. if(b == (_this.chargeItme.length-1)){
  1536. _this.$toast.success('提交成功');
  1537. setTimeout(function(){
  1538. history.go(-1)
  1539. },2000)
  1540. }
  1541. })
  1542. })
  1543. })
  1544. }
  1545. })
  1546. } else if(this.form.capitalExpenditureType==4){
  1547. addInfoto(this.infoForm).then(res => {
  1548. if(_this.form.approvalMode === '1'){
  1549. cashSubmit(response.data.id).then(res => {
  1550. _this.chargeItme.map((resD,b) => {
  1551. resD.cashId = response.data.id
  1552. addCashdetail(resD).then((a,rD) => {
  1553. if(b == (_this.chargeItme.length-1)){
  1554. _this.$toast.success('提交成功');
  1555. setTimeout(function(){
  1556. history.go(-1)
  1557. },2000)
  1558. }
  1559. })
  1560. })
  1561. })
  1562. }else{
  1563. offlineCashSubmit(response.data.id).then(res => {
  1564. _this.chargeItme.map((resD,b) => {
  1565. resD.cashId = response.data.id
  1566. addCashdetail(resD).then((a,rD) => {
  1567. if(b == (_this.chargeItme.length-1)){
  1568. _this.$toast.success('提交成功');
  1569. setTimeout(function(){
  1570. history.go(-1)
  1571. },2000)
  1572. }
  1573. })
  1574. })
  1575. })
  1576. }
  1577. })
  1578. }else{
  1579. if(_this.form.approvalMode === '1'){
  1580. cashSubmit(response.data.id).then(res => {
  1581. _this.chargeItme.map((resD,b) => {
  1582. resD.cashId = response.data.id
  1583. addCashdetail(resD).then((a,rD) => {
  1584. if(b == (_this.chargeItme.length-1)){
  1585. _this.$toast.success('提交成功');
  1586. setTimeout(function(){
  1587. history.go(-1)
  1588. },2000)
  1589. }
  1590. })
  1591. })
  1592. })
  1593. }else{
  1594. offlineCashSubmit(response.data.id).then(res => {
  1595. _this.chargeItme.map((resD,b) => {
  1596. resD.cashId = response.data.id
  1597. addCashdetail(resD).then((a,rD) => {
  1598. if(b == (_this.chargeItme.length-1)){
  1599. _this.$toast.success('提交成功');
  1600. setTimeout(function(){
  1601. history.go(-1)
  1602. },2000)
  1603. }
  1604. })
  1605. })
  1606. })
  1607. }
  1608. }
  1609. }
  1610. });
  1611. }
  1612. }
  1613. }
  1614. },
  1615. goUpdate(){
  1616. let _this = this
  1617. if(this.form.payerAccount==0){
  1618. this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });;
  1619. return false;
  1620. }else {
  1621. let total = 0;
  1622. this.chargeItme.forEach((money) => {
  1623. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  1624. });
  1625. this.$set(this.form, "expenditureAmount", total);
  1626. if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
  1627. this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
  1628. return false;
  1629. }else{
  1630. if(this.chargeItme.length<1){
  1631. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1632. return false;
  1633. }
  1634. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1635. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1636. return false;
  1637. }
  1638. if(this.form.capitalExpenditureType==2){
  1639. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1640. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1641. return false;
  1642. }
  1643. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1644. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1645. return false;
  1646. }
  1647. }
  1648. if(this.form.capitalExpenditureType==4){
  1649. if(this.infoForm.name==""||this.infoForm.name==null){
  1650. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1651. return false;
  1652. }
  1653. if(this.infoForm.code==""||this.infoForm.code==null){
  1654. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1655. return false;
  1656. }
  1657. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1658. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1659. return false;
  1660. }
  1661. }
  1662. addCash(this.form).then(response => {
  1663. this.projectForm.outId = response.data.id
  1664. this.infoForm.transferId = response.data.id
  1665. this.$set(this.projectForm, "ynType", '2');
  1666. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  1667. this.uploadFiles1.map((rr1,idx1) => {
  1668. let params1 = new FormData();
  1669. params1.append("tableId", response.data.id);
  1670. params1.append("tableName", "t_yinnong_cash");
  1671. params1.append("bizPath", "yinnong");
  1672. params1.append("fileType", "1");
  1673. params1.append("file", rr1);
  1674. commonAttach(params1).then((r1) => {
  1675. if(idx1 == (_this.uploadFiles1.length-1)){
  1676. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  1677. _this.uploadFiles2.map((rr2,idx2) => {
  1678. let params2 = new FormData();
  1679. params2.append("tableId", response.data.id);
  1680. params2.append("tableName", "t_yinnong_cash");
  1681. params2.append("bizPath", "yinnong");
  1682. params2.append("fileType", "2");
  1683. params2.append("file", rr2);
  1684. commonAttach(params2).then((r2) => {
  1685. if(idx2 == (_this.uploadFiles2.length-1)){
  1686. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1687. _this.uploadFiles3.map((rr3,idx3) => {
  1688. let params3 = new FormData();
  1689. params3.append("tableId", response.data.id);
  1690. params3.append("tableName", "t_yinnong_cash");
  1691. params3.append("bizPath", "yinnong");
  1692. params3.append("fileType", "3");
  1693. params3.append("file", rr3);
  1694. commonAttach(params3).then((r3) => {
  1695. if(idx3 == (_this.uploadFiles3.length-1)){
  1696. if(_this.form.capitalExpenditureType==2){
  1697. addProjectto(_this.projectForm).then(res => {
  1698. _this.chargeItme.map((resD,b) => {
  1699. resD.cashId = response.data.id
  1700. addCashdetail(resD).then((a,rD) => {
  1701. if(b == (_this.chargeItme.length-1)){
  1702. _this.$toast.success('保存成功');
  1703. setTimeout(function(){
  1704. history.go(-1)
  1705. },2000)
  1706. }
  1707. })
  1708. })
  1709. })
  1710. } else if(_this.form.capitalExpenditureType==4){
  1711. addInfoto(_this.infoForm).then(res => {
  1712. _this.chargeItme.map((resD,b) => {
  1713. resD.cashId = response.data.id
  1714. addCashdetail(resD).then((a,rD) => {
  1715. if(b == (_this.chargeItme.length-1)){
  1716. _this.$toast.success('保存成功');
  1717. setTimeout(function(){
  1718. history.go(-1)
  1719. },2000)
  1720. }
  1721. })
  1722. })
  1723. })
  1724. }else{
  1725. _this.chargeItme.map((resD,b) => {
  1726. resD.cashId = response.data.id
  1727. addCashdetail(resD).then((a,rD) => {
  1728. if(b == (_this.chargeItme.length-1)){
  1729. _this.$toast.success('保存成功');
  1730. setTimeout(function(){
  1731. history.go(-1)
  1732. },2000)
  1733. }
  1734. })
  1735. })
  1736. }
  1737. }
  1738. })
  1739. })
  1740. }else{
  1741. if(_this.form.capitalExpenditureType==2){
  1742. addProjectto(_this.projectForm).then(res => {
  1743. _this.chargeItme.map((resD,b) => {
  1744. resD.cashId = response.data.id
  1745. addCashdetail(resD).then((a,rD) => {
  1746. if(b == (_this.chargeItme.length-1)){
  1747. _this.$toast.success('保存成功');
  1748. setTimeout(function(){
  1749. history.go(-1)
  1750. },2000)
  1751. }
  1752. })
  1753. })
  1754. })
  1755. } else if(_this.form.capitalExpenditureType==4){
  1756. addInfoto(_this.infoForm).then(res => {
  1757. _this.chargeItme.map((resD,b) => {
  1758. resD.cashId = response.data.id
  1759. addCashdetail(resD).then((a,rD) => {
  1760. if(b == (_this.chargeItme.length-1)){
  1761. _this.$toast.success('保存成功');
  1762. setTimeout(function(){
  1763. history.go(-1)
  1764. },2000)
  1765. }
  1766. })
  1767. })
  1768. })
  1769. }else{
  1770. _this.chargeItme.map((resD,b) => {
  1771. resD.cashId = response.data.id
  1772. addCashdetail(resD).then((a,rD) => {
  1773. if(b == (_this.chargeItme.length-1)){
  1774. _this.$toast.success('保存成功');
  1775. setTimeout(function(){
  1776. history.go(-1)
  1777. },2000)
  1778. }
  1779. })
  1780. })
  1781. }
  1782. }
  1783. }
  1784. })
  1785. })
  1786. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1787. _this.uploadFiles3.map((rr3,idx3) => {
  1788. let params3 = new FormData();
  1789. params3.append("tableId", response.data.id);
  1790. params3.append("tableName", "t_yinnong_cash");
  1791. params3.append("bizPath", "yinnong");
  1792. params3.append("fileType", "3");
  1793. params3.append("file", rr3);
  1794. commonAttach(params3).then((r3) => {
  1795. if(idx3 ==(_this.uploadFiles3.length-1)){
  1796. if(_this.form.capitalExpenditureType==2){
  1797. addProjectto(_this.projectForm).then(res => {
  1798. _this.chargeItme.map((resD,b) => {
  1799. resD.cashId = response.data.id
  1800. addCashdetail(resD).then((a,rD) => {
  1801. if(b == (_this.chargeItme.length-1)){
  1802. _this.$toast.success('保存成功');
  1803. setTimeout(function(){
  1804. history.go(-1)
  1805. },2000)
  1806. }
  1807. })
  1808. })
  1809. })
  1810. } else if(_this.form.capitalExpenditureType==4){
  1811. addInfoto(_this.infoForm).then(res => {
  1812. _this.chargeItme.map((resD,b) => {
  1813. resD.cashId = response.data.id
  1814. addCashdetail(resD).then((a,rD) => {
  1815. if(b == (_this.chargeItme.length-1)){
  1816. _this.$toast.success('保存成功');
  1817. setTimeout(function(){
  1818. history.go(-1)
  1819. },2000)
  1820. }
  1821. })
  1822. })
  1823. })
  1824. }else{
  1825. _this.chargeItme.map((resD,b) => {
  1826. resD.cashId = response.data.id
  1827. addCashdetail(resD).then((a,rD) => {
  1828. if(b == (_this.chargeItme.length-1)){
  1829. _this.$toast.success('保存成功');
  1830. setTimeout(function(){
  1831. history.go(-1)
  1832. },2000)
  1833. }
  1834. })
  1835. })
  1836. }
  1837. }
  1838. })
  1839. })
  1840. }else{
  1841. if(_this.form.capitalExpenditureType==2){
  1842. addProjectto(_this.projectForm).then(res => {
  1843. _this.chargeItme.map((resD,b) => {
  1844. resD.cashId = response.data.id
  1845. addCashdetail(resD).then((a,rD) => {
  1846. if(b == (_this.chargeItme.length-1)){
  1847. _this.$toast.success('保存成功');
  1848. setTimeout(function(){
  1849. history.go(-1)
  1850. },2000)
  1851. }
  1852. })
  1853. })
  1854. })
  1855. } else if(_this.form.capitalExpenditureType==4){
  1856. addInfoto(_this.infoForm).then(res => {
  1857. _this.chargeItme.map((resD,b) => {
  1858. resD.cashId = response.data.id
  1859. addCashdetail(resD).then((a,rD) => {
  1860. if(b == (_this.chargeItme.length-1)){
  1861. _this.$toast.success('保存成功');
  1862. setTimeout(function(){
  1863. history.go(-1)
  1864. },2000)
  1865. }
  1866. })
  1867. })
  1868. })
  1869. }else{
  1870. _this.chargeItme.map((resD,b) => {
  1871. resD.cashId = response.data.id
  1872. addCashdetail(resD).then((a,rD) => {
  1873. if(b == (_this.chargeItme.length-1)){
  1874. _this.$toast.success('保存成功');
  1875. setTimeout(function(){
  1876. history.go(-1)
  1877. },2000)
  1878. }
  1879. })
  1880. })
  1881. }
  1882. }
  1883. }
  1884. })
  1885. })
  1886. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1887. this.uploadFiles2.map((rr2,idx2) => {
  1888. let params = new FormData();
  1889. params.append("tableId", response.data.id);
  1890. params.append("tableName", "t_yinnong_cash");
  1891. params.append("bizPath", "yinnong");
  1892. params.append("fileType", "2");
  1893. params.append("file", rr2);
  1894. commonAttach(params).then((r2) => {
  1895. if(idx2 == (_this.uploadFiles2.length-1)){
  1896. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1897. _this.uploadFiles3.map((rr3,idx3) => {
  1898. let params3 = new FormData();
  1899. params3.append("tableId", response.data.id);
  1900. params3.append("tableName", "t_yinnong_cash");
  1901. params3.append("bizPath", "yinnong");
  1902. params3.append("fileType", "3");
  1903. params3.append("file", rr3);
  1904. commonAttach(params).then((r3) => {
  1905. if(idx3 == (_this.uploadFiles3.length-1)){
  1906. if(_this.form.capitalExpenditureType==2){
  1907. addProjectto(_this.projectForm).then(res => {
  1908. _this.chargeItme.map((resD,b) => {
  1909. resD.cashId = response.data.id
  1910. addCashdetail(resD).then((a,rD) => {
  1911. if(b == (_this.chargeItme.length-1)){
  1912. _this.$toast.success('保存成功');
  1913. setTimeout(function(){
  1914. history.go(-1)
  1915. },2000)
  1916. }
  1917. })
  1918. })
  1919. })
  1920. } else if(_this.form.capitalExpenditureType==4){
  1921. addInfoto(_this.infoForm).then(res => {
  1922. _this.chargeItme.map((resD,b) => {
  1923. resD.cashId = response.data.id
  1924. addCashdetail(resD).then((a,rD) => {
  1925. if(b == (_this.chargeItme.length-1)){
  1926. _this.$toast.success('保存成功');
  1927. setTimeout(function(){
  1928. history.go(-1)
  1929. },2000)
  1930. }
  1931. })
  1932. })
  1933. })
  1934. }else{
  1935. _this.chargeItme.map((resD,b) => {
  1936. resD.cashId = response.data.id
  1937. addCashdetail(resD).then((a,rD) => {
  1938. if(b == (_this.chargeItme.length-1)){
  1939. _this.$toast.success('保存成功');
  1940. setTimeout(function(){
  1941. history.go(-1)
  1942. },2000)
  1943. }
  1944. })
  1945. })
  1946. }
  1947. }
  1948. })
  1949. })
  1950. }else{
  1951. if(_this.form.capitalExpenditureType==2){
  1952. addProjectto(_this.projectForm).then(res => {
  1953. _this.chargeItme.map((resD,b) => {
  1954. resD.cashId = response.data.id
  1955. addCashdetail(resD).then((a,rD) => {
  1956. if(b == (_this.chargeItme.length-1)){
  1957. _this.$toast.success('保存成功');
  1958. setTimeout(function(){
  1959. history.go(-1)
  1960. },2000)
  1961. }
  1962. })
  1963. })
  1964. })
  1965. } else if(_this.form.capitalExpenditureType==4){
  1966. addInfoto(_this.infoForm).then(res => {
  1967. _this.chargeItme.map((resD,b) => {
  1968. resD.cashId = response.data.id
  1969. addCashdetail(resD).then((a,rD) => {
  1970. if(b == (_this.chargeItme.length-1)){
  1971. _this.$toast.success('保存成功');
  1972. setTimeout(function(){
  1973. history.go(-1)
  1974. },2000)
  1975. }
  1976. })
  1977. })
  1978. })
  1979. }else{
  1980. _this.chargeItme.map((resD,b) => {
  1981. resD.cashId = response.data.id
  1982. addCashdetail(resD).then((a,rD) => {
  1983. if(b == (_this.chargeItme.length-1)){
  1984. _this.$toast.success('保存成功');
  1985. setTimeout(function(){
  1986. history.go(-1)
  1987. },2000)
  1988. }
  1989. })
  1990. })
  1991. }
  1992. }
  1993. }
  1994. })
  1995. })
  1996. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1997. this.uploadFiles3.map((rr3,idx3) => {
  1998. let params = new FormData();
  1999. params.append("tableId", response.data.id);
  2000. params.append("tableName", "t_yinnong_cash");
  2001. params.append("bizPath", "yinnong");
  2002. params.append("fileType", "3");
  2003. params.append("file", rr3);
  2004. commonAttach(params).then((r) => {
  2005. if(idx3 == (_this.uploadFiles3.length-1)){
  2006. if(_this.form.capitalExpenditureType==2){
  2007. addProjectto(_this.projectForm).then(res => {
  2008. _this.chargeItme.map((resD,b) => {
  2009. resD.cashId = response.data.id
  2010. addCashdetail(resD).then((a,rD) => {
  2011. if(b == (_this.chargeItme.length-1)){
  2012. _this.$toast.success('保存成功');
  2013. setTimeout(function(){
  2014. history.go(-1)
  2015. },2000)
  2016. }
  2017. })
  2018. })
  2019. })
  2020. } else if(_this.form.capitalExpenditureType==4){
  2021. addInfoto(_this.infoForm).then(res => {
  2022. _this.chargeItme.map((resD,b) => {
  2023. resD.cashId = response.data.id
  2024. addCashdetail(resD).then((a,rD) => {
  2025. if(b == (_this.chargeItme.length-1)){
  2026. _this.$toast.success('保存成功');
  2027. setTimeout(function(){
  2028. history.go(-1)
  2029. },2000)
  2030. }
  2031. })
  2032. })
  2033. })
  2034. }else{
  2035. _this.chargeItme.map((resD,b) => {
  2036. resD.cashId = response.data.id
  2037. addCashdetail(resD).then((a,rD) => {
  2038. if(b == (_this.chargeItme.length-1)){
  2039. _this.$toast.success('保存成功');
  2040. setTimeout(function(){
  2041. history.go(-1)
  2042. },2000)
  2043. }
  2044. })
  2045. })
  2046. }
  2047. }
  2048. })
  2049. })
  2050. }else{
  2051. if(this.form.capitalExpenditureType==2){
  2052. addProjectto(this.projectForm).then(res => {
  2053. _this.chargeItme.map((resD,b) => {
  2054. resD.cashId = response.data.id
  2055. addCashdetail(resD).then((a,rD) => {
  2056. if(b == (_this.chargeItme.length-1)){
  2057. _this.$toast.success('保存成功');
  2058. setTimeout(function(){
  2059. history.go(-1)
  2060. },2000)
  2061. }
  2062. })
  2063. })
  2064. })
  2065. } else if(this.form.capitalExpenditureType==4){
  2066. addInfoto(this.infoForm).then(res => {
  2067. _this.chargeItme.map((resD,b) => {
  2068. resD.cashId = response.data.id
  2069. addCashdetail(resD).then((a,rD) => {
  2070. if(b == (_this.chargeItme.length-1)){
  2071. _this.$toast.success('保存成功');
  2072. setTimeout(function(){
  2073. history.go(-1)
  2074. },2000)
  2075. }
  2076. })
  2077. })
  2078. })
  2079. }else{
  2080. _this.chargeItme.map((resD,b) => {
  2081. resD.cashId = response.data.id
  2082. addCashdetail(resD).then((a,rD) => {
  2083. if(b == (_this.chargeItme.length-1)){
  2084. _this.$toast.success('保存成功');
  2085. setTimeout(function(){
  2086. history.go(-1)
  2087. },2000)
  2088. }
  2089. })
  2090. })
  2091. }
  2092. }
  2093. });
  2094. }
  2095. }
  2096. },
  2097. payeeSelectChange(select, i) {
  2098. let obj = {};
  2099. let fuzhitype = 0;
  2100. obj = this.payeeList.find((account) => {
  2101. //model就是上面的数据源
  2102. return account.id === select ; //筛选出匹配数据
  2103. });
  2104. if(this.chargeItme != [] && this.chargeItme.length>1){
  2105. this.chargeItme.some((value, index) => {
  2106. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  2107. fuzhitype = 2;
  2108. return true;
  2109. }
  2110. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  2111. fuzhitype = 1;
  2112. return true;
  2113. }
  2114. });
  2115. }
  2116. if(fuzhitype == 0){
  2117. this.$set(this.chargeItme[i], "payee",obj.payee)
  2118. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  2119. this.$set(this.chargeItme[i], "payeeId", obj.id);
  2120. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  2121. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  2122. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  2123. }else if(fuzhitype == 1){
  2124. this.$set(this.chargeItme[i], "payee",'')
  2125. this.$set(this.chargeItme[i], "bankType",'')
  2126. this.$set(this.chargeItme[i], "payeeId", '');
  2127. this.$set(this.chargeItme[i], "payeeAccount", '');
  2128. this.$set(this.chargeItme[i], "bankDeposit", '');
  2129. this.$set(this.chargeItme[i], "accountType", '');
  2130. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  2131. }else if(fuzhitype == 2){
  2132. this.$set(this.chargeItme[i], "payee",'')
  2133. this.$set(this.chargeItme[i], "bankType",'')
  2134. this.$set(this.chargeItme[i], "payeeId", '');
  2135. this.$set(this.chargeItme[i], "payeeAccount", '');
  2136. this.$set(this.chargeItme[i], "bankDeposit", '');
  2137. this.$set(this.chargeItme[i], "accountType", '');
  2138. this.$notify({ type: 'danger', message: '收款方已存在!' });
  2139. }
  2140. },
  2141. selectChange(select) {
  2142. let obj = {};
  2143. obj = this.payerOptions.find((account) => {
  2144. //model就是上面的数据源
  2145. return account.id === select; //筛选出匹配数据
  2146. });
  2147. if(obj.accountType == "101"){
  2148. obj.accountPassword = "";
  2149. }
  2150. if(obj.accountPassword != null && obj.accountPassword != "" &&
  2151. obj.bankType != null && obj.bankType != ""){
  2152. this.$set(this.form, "bookId", obj.bookId);
  2153. this.$set(this.form, "deptId", obj.deptId);
  2154. this.$set(this.form, "cashierId", obj.id);
  2155. this.$set(this.form, "payer", obj.accountName);
  2156. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  2157. this.$set(this.form, "operatorCode", obj.operatorCode);
  2158. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  2159. this.$set(this.form, "bankType", obj.bankType);
  2160. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  2161. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  2162. this.$set(this.form, "taccountId", obj.taccountId);
  2163. this.$set(this.form, "accountNo", obj.accountNo);
  2164. this.$set(this.form, "cifNo", obj.cifNo);
  2165. this.$set(this.form, "balance", obj.balance);
  2166. this.$set(this.form, "payerFrom", '1');
  2167. if(obj.bankType==1){
  2168. this.form.accountType = "1"
  2169. this.form.isPeers = null
  2170. this.accountTypeChange();
  2171. }else if(obj.bankType==2||obj.bankType==4){
  2172. this.form.accountType = null
  2173. this.form.isPeers = "Y"
  2174. this.accountTypeChange1();
  2175. }
  2176. }else{
  2177. if(obj.payerFrom==1){
  2178. this.diglogStatus = false;
  2179. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  2180. this.$set(this.form,"payer","")
  2181. this.$set(this.form,"payerAccount","")
  2182. }else{
  2183. this.$set(this.form, "payerFrom", obj.parerFrom);
  2184. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  2185. this.$set(this.form, "operatorCode", obj.operatorCode);
  2186. }else{
  2187. this.$set(this.form, "operatorCode", '');
  2188. }
  2189. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  2190. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  2191. }else{
  2192. this.$set(this.form, "enterpriseCode", '');
  2193. }
  2194. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  2195. this.$set(this.form, "accountPassword", obj.accountPassword);
  2196. }else{
  2197. this.$set(this.form, "accountPassword", '');
  2198. }
  2199. this.$set(this.form, "bookId",'');
  2200. this.$set(this.form, "deptId", '');
  2201. this.$set(this.form, "cashierId", obj.id);
  2202. this.$set(this.form, "payer", obj.accountName);
  2203. this.$set(this.form, "bankType", obj.bankType);
  2204. if(obj.payerFrom==6){
  2205. getQmyeFlow(obj.id).then((response) => {
  2206. this.$set(this.form, "payerAccount", response.data);
  2207. });
  2208. }else {
  2209. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  2210. }
  2211. }
  2212. }
  2213. },
  2214. beforeRead1(file) {
  2215. this.uploadFiles1.push(file.file);
  2216. },
  2217. deleteFile1(file){
  2218. this.uploadFiles1.map((response,index) => {
  2219. if(file.file == response){
  2220. this.uploadFiles1.splice(index,1)
  2221. }
  2222. })
  2223. },
  2224. beforeRead2(file) {
  2225. this.uploadFiles2.push(file.file);
  2226. },
  2227. deleteFile2(file){
  2228. this.uploadFiles2.map((response,index) => {
  2229. if(file.file == response){
  2230. this.uploadFiles2.splice(index,1)
  2231. }
  2232. })
  2233. },
  2234. beforeRead3(file) {
  2235. this.uploadFiles3.push(file.file);
  2236. },
  2237. deleteFile3(file){
  2238. this.uploadFiles3.map((response,index) => {
  2239. if(file.file == response){
  2240. this.uploadFiles3.splice(index,1)
  2241. }
  2242. })
  2243. },
  2244. getFileList(){
  2245. let oData1= {
  2246. tableId: this.$route.query.id,
  2247. tableName: "t_yinnong_cash",
  2248. bizPath: "yinnong",
  2249. fileType: "1",
  2250. }
  2251. attachmentList(oData1).then(res => {
  2252. res.rows.map(r => {
  2253. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2254. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  2255. })
  2256. })
  2257. let oData2= {
  2258. tableId: this.$route.query.id,
  2259. tableName: "t_yinnong_cash",
  2260. bizPath: "yinnong",
  2261. fileType: "2",
  2262. }
  2263. attachmentList(oData2).then(res => {
  2264. res.rows.map(r => {
  2265. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2266. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  2267. })
  2268. })
  2269. let oData3= {
  2270. tableId: this.$route.query.id,
  2271. tableName: "t_yinnong_cash",
  2272. bizPath: "yinnong",
  2273. fileType: "3",
  2274. }
  2275. attachmentList(oData3).then(res => {
  2276. res.rows.map(r => {
  2277. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2278. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  2279. })
  2280. })
  2281. },
  2282. goBack(){
  2283. window.history.go(-1)
  2284. },
  2285. //删除家庭成员
  2286. deleteChargeItme(index){
  2287. this.chargeItme.splice(index,1)
  2288. },
  2289. },
  2290. }
  2291. </script>
  2292. <style scoped lang="scss">
  2293. .app-container {
  2294. padding: 2% 0;
  2295. }
  2296. .main_title{
  2297. font-size: 0.4rem;
  2298. color: #1D6FE9;
  2299. margin: 0.2rem 6%;
  2300. position: relative;
  2301. }
  2302. .main_box{
  2303. width: 96%;
  2304. margin: 0 auto;
  2305. border-radius: 6px;
  2306. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  2307. overflow: hidden;
  2308. background-color: #FFF;
  2309. }
  2310. .submitButton{
  2311. width: 80%;
  2312. margin: 0 auto;
  2313. background-color: #1D6FE9;
  2314. }
  2315. .addFamily{
  2316. position: absolute;
  2317. top: -2px;
  2318. right: 0;
  2319. border-radius: 50%;
  2320. }
  2321. .deleteFamily{
  2322. position: absolute;
  2323. top: 0rem;
  2324. right: 6%;
  2325. z-index: 9;
  2326. border-radius: 50%;
  2327. }
  2328. </style>