移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

approvalAdd12.vue 108 KiB

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