移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

approvalAdd11.vue 98 KiB

3 年前
3 年前
3 年前
2 年前
2 年前
2 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
1年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
1年前
3 年前
3 年前
3 年前
2 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
2 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107
  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" @click-preview="previewPreview" style="margin-left:8px;"></van-uploader>
  231. <van-cell title="发票" />
  232. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" @click-preview="previewPreview" style="margin-left:8px;"></van-uploader>
  233. <van-cell title="其他" />
  234. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" @click-preview="previewPreview" 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. offlineCustomSubmit , 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. import moment from "moment";
  264. export default {
  265. name: "approvalAdd11",
  266. data() {
  267. return {
  268. showtemplate:false,
  269. showcontract:false,
  270. showcapital:false,
  271. showpayee:false,
  272. showlasj:false,
  273. showbankType:false,
  274. showproject:false,
  275. showFundType:false,
  276. showpayer:false,
  277. buttonType:'a',
  278. minDate: new Date(2000, 1, 1),
  279. maxDate: new Date(2050, 12, 31),
  280. currentDate: new Date(),
  281. form:{},
  282. fileList1:[],
  283. fileList2:[],
  284. fileList3:[],
  285. capitalExpenditureType:'',
  286. payee:'',
  287. bankType:'',
  288. wfydlxDictionaries:[],
  289. jglxDictionaries:[],
  290. sysDictionaries:[],
  291. capitalExpenditureTypeOptions:[],
  292. bankTypeDictionaries:[],
  293. projectFundTypeOptions:[],
  294. projectFundTypeDictionaries:[],
  295. projectList:[],
  296. infoList:[],
  297. payerOptions:[],
  298. chargeItme:[],
  299. chargeItmeShow:[],
  300. payeeList:[],
  301. // 查询参数
  302. queryParams: {
  303. cashType:11,
  304. orderByColumn: "id",
  305. isAsc: "desc",
  306. },
  307. capitalExpenditureOpen:false,
  308. contractOpen:false,
  309. projectForm:{
  310. projectId:null,
  311. projectName:null,
  312. projectContractor:null,
  313. projectAmount:null,
  314. projectBillNum:null,
  315. projectFundType:'1',
  316. outId:null,
  317. ynType:'2'
  318. },
  319. infoForm:{
  320. infoId:null,
  321. name:null,
  322. code:null,
  323. totalAmount:null,
  324. contractionId:null,
  325. transferId:null
  326. },
  327. // 合同信息查询参数
  328. queryContractionParams: {
  329. pageNum: 1,
  330. pageSize: 100,
  331. contractionStatus: '1',
  332. orderByColumn: "endTime",
  333. isAsc: "desc",
  334. },
  335. projectFundType:'',
  336. uploadFiles1:[],
  337. uploadFiles2:[],
  338. uploadFiles3:[],
  339. nowDate:"",
  340. templateList:[],
  341. };
  342. },
  343. created() {
  344. this.getNowDate();
  345. this.reset();
  346. this.initProjectInfo();
  347. this.getDicts("project_fund_type").then((response) => {
  348. for (var i = 0; i < response.data.length; i++) {
  349. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  350. }
  351. this.projectFundTypeDictionaries = response.data;
  352. });
  353. let queryParamsOld={
  354. accountType: "101",
  355. status: "N",
  356. }
  357. console.log(1111111111111111111111111)
  358. listAccount1(queryParamsOld).then((response) => {
  359. console.log(response)
  360. response.rows.map(res => {
  361. // res['accountName'] = this.$store.state.user.bookName
  362. // res['id'] = this.$store.state.user.loginBookId
  363. res['text'] = res.accountName+"余额:"+res.balance
  364. res['value'] = res.id
  365. res['bankAccountNumber'] = res.startDay
  366. res['payerFrom'] = '6'
  367. this.payerOptions.push(res)
  368. })
  369. });
  370. this.getDictionaries();
  371. this.addChargeItme();
  372. this.getTemplateList();
  373. },
  374. methods: {
  375. goFlow(){
  376. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  377. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  378. }else{
  379. this.$notify({ type: 'danger', message: '无审批流程!' });
  380. }
  381. },
  382. getTemplateList(){
  383. let templateQueryParams = {
  384. // 分页
  385. pageNum: 1,
  386. pageSize: 999,
  387. type :'3'
  388. };
  389. listTemplate(templateQueryParams).then(response => {
  390. this.templateList = response.rows;
  391. });
  392. },
  393. onConfirmTemplate(data){
  394. selectApprovalByTemplateId(data.id).then(res => {
  395. this.showtemplate = false;
  396. if(res.approvalDetails.length>0){
  397. this.form.approvalTemplateName = data.name
  398. this.form.approvalTemplateId = data.id
  399. }else{
  400. this.form.approvalTemplateName = null
  401. this.form.approvalTemplateId = null
  402. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  403. }
  404. })
  405. },
  406. getNowDate(){
  407. var _this = this;
  408. let yy = new Date().getFullYear();
  409. let mm = new Date().getMonth()+1;
  410. let dd = new Date().getDate();
  411. _this.nowDate = moment(new Date()).format("YYYY-MM-DD");
  412. },
  413. initProjectInfo(){
  414. let _this = this
  415. let queryParams={
  416. pageNum: 1,
  417. pageSize: 100,
  418. }
  419. listProject(queryParams).then(response => {
  420. _this.projectList = response.rows;
  421. for (let i = 0; i < response.rows.length; i++) {
  422. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  423. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  424. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  425. }
  426. });
  427. listInfo(this.queryContractionParams).then(response => {
  428. _this.infoList = response.rows;
  429. for (let i = 0; i < response.rows.length; i++) {
  430. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  431. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  432. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  433. }
  434. });
  435. },
  436. previewPreview(file, index, len) {
  437. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  438. if (file.url) {
  439. //已上传文件
  440. let fileName = file.file.name || file.url;
  441. let subIndex = fileName.lastIndexOf(".");
  442. let ext = fileName.substring(subIndex + 1, fileName.length);
  443. let imgi = file.listIndex
  444. //console.log(ext)
  445. let allUrl = file.url;
  446. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  447. const link = document.createElement("a");
  448. link.style.display = "none";
  449. link.target = "_blank"
  450. link.href = allUrl;
  451. document.body.appendChild(link);
  452. link.click();
  453. document.body.removeChild(link);
  454. }
  455. } else {
  456. //新上传文件
  457. let fileName = file.file.name;
  458. // console.info(file.file.name)
  459. let subIndex = fileName.lastIndexOf(".");
  460. let ext = fileName.substring(subIndex + 1, fileName.length);
  461. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  462. let type = this.getfileType(ext);
  463. // 将文件转换为base64编码
  464. this.fileToBase64(file.file, ext).then(res => {
  465. this.downloadFile(res, fileName, ext, type);
  466. })
  467. }
  468. }
  469. },
  470. getfileType(type) {
  471. switch (type) {
  472. case 'txt':
  473. return 'text/plain';
  474. case 'doc':
  475. return 'application/msword';
  476. case 'docx':
  477. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  478. case 'xls':
  479. return 'application/vnd.ms-excel';
  480. case 'xlsx':
  481. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  482. case 'pdf':
  483. return 'application/pdf';
  484. case 'pptx':
  485. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  486. case 'png':
  487. return 'image/png';
  488. case 'jpg':
  489. return 'image/jpeg';
  490. case 'gif':
  491. return 'image/gif';
  492. case 'svg':
  493. return 'image/svg+xml';
  494. case 'ico':
  495. return 'image/x-icon';
  496. case 'bmp':
  497. return 'image/bmp,';
  498. }
  499. },
  500. downloadFile(base64, fileName, fileType, mimetype) {
  501. const typeHeader = 'data:application/' + fileType + ';base64,';
  502. const blob = this.base64ToBlob(base64, mimetype);
  503. this.downloadFileDownload(blob, fileName, fileType);
  504. },
  505. base64ToBlob(base64, mime) {
  506. //解码base64得到二进制字符串
  507. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  508. let rawLength = raw.length
  509. //创建8位无符号整数值的类型化数组
  510. let uInt8Array = new Uint8Array(rawLength)
  511. for (let i = 0; i < rawLength; ++i) {
  512. uInt8Array[i] = raw.charCodeAt(i);
  513. }
  514. return new Blob([uInt8Array], {type: mime})
  515. },
  516. downloadFileDownload(blob, fileName, fileType) {
  517. const downloadElement = document.createElement('a');
  518. let href = blob;
  519. if (typeof blob === 'string') {
  520. downloadElement.target = '_blank'
  521. } else {
  522. href = window.URL.createObjectURL(blob)
  523. }
  524. downloadElement.href = href;
  525. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  526. document.body.appendChild(downloadElement);
  527. downloadElement.click();
  528. document.body.removeChild(downloadElement)
  529. if (typeof blob !== 'string') {
  530. window.URL.revokeObjectURL(href)
  531. }
  532. },
  533. fileToBase64(file,fileType){
  534. return new Promise((resolve,reject)=>{
  535. //创建一个新的FileReader 对象
  536. const reader = new FileReader();
  537. //读取file对象
  538. reader.readAsDataURL(file);
  539. reader.onload=function () {
  540. const base64String = reader.result.split(",")[1];
  541. resolve('data:application/' + fileType + ';base64,'+base64String);
  542. }
  543. reader.onerror=function () {
  544. reject(new Error("Failed to load file") )
  545. }
  546. })
  547. },
  548. // 表单重置
  549. reset() {
  550. this.form = {
  551. id: null,
  552. upId: null,
  553. applyDate:this.nowDate,
  554. approvalMode:'1',
  555. downId: null,
  556. orderId: null,
  557. cashierId: null,
  558. cashType: 11,
  559. accountType: '2',
  560. explainSituation: null,
  561. succeedAmount: null,
  562. payer: null,
  563. payerAccount: null,
  564. operatorCode: null,
  565. enterpriseCode: null,
  566. expenditureAmount: null,
  567. capitalExpenditureType: '1',
  568. remark: null,
  569. transferStatus: "0",
  570. auditStatus: "0",
  571. paymentState: "1",
  572. bankPriority: "0",
  573. clientPriority: "0"
  574. };
  575. this.processList = {}
  576. this.projectForm={
  577. projectId:null,
  578. projectName:null,
  579. projectContractor:null,
  580. projectAmount:null,
  581. projectBillNum:null,
  582. projectFundType:'1',
  583. outId:null,
  584. ynType:'2'
  585. }
  586. },
  587. getChange(){
  588. if(this.buttonType == 'update'){
  589. this.goUpdate();
  590. }else if(this.buttonType == 'add'){
  591. this.goAdd();
  592. }
  593. },
  594. getDictionaries(){
  595. this.getDicts("capital_expenditure_type").then((res) => {
  596. for (let i = 0; i < res.data.length; i++) {
  597. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  598. }
  599. });
  600. this.getPayeeList();
  601. },
  602. getError(e){
  603. this.$notify({ type: 'danger', message: e.errors[0].message });
  604. },
  605. addChargeItme(index){
  606. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  607. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  608. return;
  609. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  610. this.$notify({ type: 'danger', message: '请输入提款金额!' });
  611. return;
  612. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].drawer == ''){
  613. this.$notify({ type: 'danger', message: '请输入提款人!' });
  614. return;
  615. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].remark == ''){
  616. this.$notify({ type: 'danger', message: '请输入资金用途!' });
  617. return;
  618. }
  619. this.chargeItme.splice(index + 1, 0, {
  620. payeeId: "", //收款方ID
  621. payee: "", //收款方全称
  622. payeeAccount: "", //收款账户
  623. drawer: "", //提款人
  624. incomeAmount: "", //提款金额
  625. bankType: "", //资金用途
  626. showPayee:false,
  627. showbankType:false
  628. });
  629. },
  630. getPayeeList() {
  631. //普通转账
  632. this.queryParams.accountType = this.form.accountType
  633. this.queryParams.status = "0"
  634. listPayee(this.queryParams).then((response) => {
  635. this.payeeList = response.rows;
  636. response.rows.map((res,index) => {
  637. this.payeeList[index].text = res.payee;
  638. this.payeeList[index].value = res.id;
  639. })
  640. });
  641. },
  642. payeeDictLabel(datas, value) {
  643. let actions = [];
  644. Object.keys(datas).some((key) => {
  645. if (datas[key].payeeId == ('' + value)) {
  646. actions.push(datas[key].payee);
  647. return true;
  648. }
  649. })
  650. return actions.join('');
  651. },
  652. onConfirmCapital(data){
  653. if (data.value == 2){
  654. this.capitalExpenditureOpen = true;
  655. this.contractOpen = false
  656. this.infoForm = {};
  657. }else if(data.value == 4){
  658. this.capitalExpenditureOpen = false;
  659. this.contractOpen = true
  660. this.projectForm = {};
  661. }else{
  662. this.capitalExpenditureOpen = false;
  663. this.contractOpen = false
  664. this.projectForm = {};
  665. this.infoForm = {};
  666. }
  667. this.capitalExpenditureType = data.text;
  668. this.form.capitalExpenditureType = data.value;
  669. this.showcapital = false;
  670. },
  671. onConfirmFundType(data){
  672. this.projectForm.projectFundType = data.value;
  673. this.projectFundType = data.text;
  674. this.showFundType = false;
  675. },
  676. onConfirmContract(data){
  677. this.infoList.map(res => {
  678. if(res.name==data.text){
  679. this.infoForm.contractionId = res.id;
  680. this.infoForm.name = res.name;
  681. this.infoForm.code = res.code;
  682. this.infoForm.totalAmount = res.totalAmount;
  683. }
  684. })
  685. this.showcontract = false;
  686. },
  687. onConfirmProject(data){
  688. this.projectList.map(res => {
  689. if(res.projectName==data.text){
  690. this.projectForm.projectId = res.id
  691. this.projectForm.projectName = res.projectName
  692. this.projectForm.projectContractor = res.projectContractor
  693. this.projectForm.projectAmount = res.projectAmount
  694. }
  695. })
  696. this.showproject = false;
  697. },
  698. onConfirmPayee(data,index){
  699. for (var i = 0 ; i < this.chargeItme.length ; i++){
  700. this.chargeItme[i].showPayee = false;
  701. }
  702. this.chargeItme[index].payee = data.text;
  703. this.chargeItme[index].payeeId = data.value;
  704. this.chargeItme[index].showpayee = false;
  705. this.payeeSelectChange(data.value , index)
  706. },
  707. onConfirmBankType(data,index){
  708. for (var i = 0 ; i < this.chargeItme.length ; i++){
  709. this.chargeItme[i].showbankType = false;
  710. }
  711. this.chargeItme[index].bankTypeText = data.text;
  712. this.chargeItme[index].bankType = data.value;
  713. this.chargeItme[index].showbankType = false;
  714. },
  715. onConfirmPayer(data){
  716. this.form.payer = data.text;
  717. this.form.cashierId = data.value;
  718. this.showpayer = false;
  719. this.selectChange(data.value)
  720. },
  721. onConfirmLasj(data){
  722. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  723. this.showlasj = false;
  724. },
  725. accountTypeChange(e){
  726. this.payeeList = [];
  727. this.queryParams.accountType = this.form.accountType
  728. this.queryParams.status = "0"
  729. listPayee(this.queryParams).then((response) => {
  730. this.payeeList = response.rows;
  731. response.rows.map((res,index) => {
  732. this.payeeList[index].text = res.payee;
  733. this.payeeList[index].value = res.id;
  734. })
  735. });
  736. },
  737. goAdd(){
  738. let _this = this
  739. if(this.form.payerAccount==0){
  740. this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });
  741. return false;
  742. }else {
  743. let total = 0;
  744. this.chargeItme.forEach((money) => {
  745. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  746. });
  747. this.$set(this.form, "expenditureAmount", total);
  748. if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
  749. this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
  750. return false;
  751. }else{
  752. if(this.chargeItme.length<1){
  753. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  754. return false;
  755. }
  756. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  757. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  758. return false;
  759. }
  760. if(this.form.capitalExpenditureType==2){
  761. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  762. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  763. return false;
  764. }
  765. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  766. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  767. return false;
  768. }
  769. }
  770. if(this.form.capitalExpenditureType==4){
  771. if(this.infoForm.name==""||this.infoForm.name==null){
  772. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  773. return false;
  774. }
  775. if(this.infoForm.code==""||this.infoForm.code==null){
  776. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  777. return false;
  778. }
  779. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  780. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  781. return false;
  782. }
  783. }
  784. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  785. Dialog.confirm({
  786. title: '提示',
  787. message: '此申请单中未上传任何附件,是否确认提交?',
  788. })
  789. .then(() => {
  790. addCash(this.form).then((response) => {
  791. this.chargeItme.map((res,idx) => {
  792. res.cashId = response.data.id
  793. addCashdetail(res).then(r => {
  794. if(idx == (_this.chargeItme.length - 1)){
  795. if(_this.form.capitalExpenditureType==2){
  796. _this.projectForm.outId = response.data.id
  797. _this.$set(_this.projectForm, "ynType", '2');
  798. addProjectto(_this.projectForm).then(res => {
  799. offlineCustomSubmit(response.data.id).then(res => {
  800. _this.$toast.success('提交成功');
  801. setTimeout(function(){
  802. history.go(-1)
  803. window.location.reload();
  804. },2000)
  805. })
  806. })
  807. }else if(_this.form.capitalExpenditureType==4){
  808. _this.infoForm.transferId = response.data.id
  809. addInfoto(_this.infoForm).then(res => {
  810. offlineCustomSubmit(response.data.id).then(res => {
  811. _this.$toast.success('提交成功');
  812. setTimeout(function(){
  813. history.go(-1)
  814. window.location.reload();
  815. },2000)
  816. })
  817. })
  818. }else{
  819. offlineCustomSubmit(response.data.id).then(res => {
  820. _this.$toast.success('提交成功');
  821. setTimeout(function(){
  822. history.go(-1)
  823. window.location.reload();
  824. },2000)
  825. })
  826. }
  827. }
  828. })
  829. })
  830. });
  831. })
  832. }else{
  833. addCash(this.form).then((response) => {
  834. this.chargeItme.map(res => {
  835. res.cashId = response.data.id
  836. addCashdetail(res).then(r => {})
  837. })
  838. this.projectForm.outId = response.data.id
  839. this.infoForm.transferId = response.data.id
  840. this.$set(this.projectForm, "ynType", '2');
  841. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  842. this.uploadFiles1.map((rr1,idx1) => {
  843. let params1 = new FormData();
  844. params1.append("tableId", response.data.id);
  845. params1.append("tableName", "t_yinnong_cash");
  846. params1.append("bizPath", "yinnong");
  847. params1.append("fileType", "1");
  848. params1.append("file", rr1);
  849. commonAttach(params1).then((r1) => {
  850. if(idx1 == (_this.uploadFiles1.length-1)){
  851. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  852. _this.uploadFiles2.map((rr2,idx2) => {
  853. let params2 = new FormData();
  854. params2.append("tableId", response.data.id);
  855. params2.append("tableName", "t_yinnong_cash");
  856. params2.append("bizPath", "yinnong");
  857. params2.append("fileType", "2");
  858. params2.append("file", rr2);
  859. commonAttach(params2).then((r2) => {
  860. if(idx2 == (_this.uploadFiles2.length-1)){
  861. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  862. _this.uploadFiles3.map((rr3,idx3) => {
  863. let params3 = new FormData();
  864. params3.append("tableId", response.data.id);
  865. params3.append("tableName", "t_yinnong_cash");
  866. params3.append("bizPath", "yinnong");
  867. params3.append("fileType", "3");
  868. params3.append("file", rr3);
  869. commonAttach(params3).then((r3) => {
  870. if(idx3 == (_this.uploadFiles3.length-1)){
  871. if(_this.form.capitalExpenditureType==2){
  872. addProjectto(_this.projectForm).then(res => {
  873. offlineCustomSubmit(response.data.id).then(res => {
  874. _this.chargeItme.map((resD,b) => {
  875. resD.cashId = response.data.id
  876. addCashdetail(resD).then((a,rD) => {
  877. if(b == (_this.chargeItme.length-1)){
  878. _this.$toast.success('提交成功');
  879. setTimeout(function(){
  880. history.go(-1)
  881. window.location.reload();
  882. },2000)
  883. }
  884. })
  885. })
  886. })
  887. })
  888. } else if(_this.form.capitalExpenditureType==4){
  889. addInfoto(_this.infoForm).then(res => {
  890. offlineCustomSubmit(response.data.id).then(res => {
  891. _this.chargeItme.map((resD,b) => {
  892. resD.cashId = response.data.id
  893. addCashdetail(resD).then((a,rD) => {
  894. if(b == (_this.chargeItme.length-1)){
  895. _this.$toast.success('提交成功');
  896. setTimeout(function(){
  897. history.go(-1)
  898. window.location.reload();
  899. },2000)
  900. }
  901. })
  902. })
  903. })
  904. })
  905. }else{
  906. offlineCustomSubmit(response.data.id).then(res => {
  907. _this.chargeItme.map((resD,b) => {
  908. resD.cashId = response.data.id
  909. addCashdetail(resD).then((a,rD) => {
  910. if(b == (_this.chargeItme.length-1)){
  911. _this.$toast.success('提交成功');
  912. setTimeout(function(){
  913. history.go(-1)
  914. window.location.reload();
  915. },2000)
  916. }
  917. })
  918. })
  919. })
  920. }
  921. }
  922. })
  923. })
  924. }else{
  925. if(_this.form.capitalExpenditureType==2){
  926. addProjectto(_this.projectForm).then(res => {
  927. offlineCustomSubmit(response.data.id).then(res => {
  928. _this.chargeItme.map((resD,b) => {
  929. resD.cashId = response.data.id
  930. addCashdetail(resD).then((a,rD) => {
  931. if(b == (_this.chargeItme.length-1)){
  932. _this.$toast.success('提交成功');
  933. setTimeout(function(){
  934. history.go(-1)
  935. window.location.reload();
  936. },2000)
  937. }
  938. })
  939. })
  940. })
  941. })
  942. } else if(_this.form.capitalExpenditureType==4){
  943. addInfoto(_this.infoForm).then(res => {
  944. offlineCustomSubmit(response.data.id).then(res => {
  945. _this.chargeItme.map((resD,b) => {
  946. resD.cashId = response.data.id
  947. addCashdetail(resD).then((a,rD) => {
  948. if(b == (_this.chargeItme.length-1)){
  949. _this.$toast.success('提交成功');
  950. setTimeout(function(){
  951. history.go(-1)
  952. window.location.reload();
  953. },2000)
  954. }
  955. })
  956. })
  957. })
  958. })
  959. }else{
  960. offlineCustomSubmit(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. window.location.reload();
  969. },2000)
  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. offlineCustomSubmit(response.data.id).then(res => {
  992. _this.chargeItme.map((resD,b) => {
  993. resD.cashId = response.data.id
  994. addCashdetail(resD).then((a,rD) => {
  995. if(b == (_this.chargeItme.length-1)){
  996. _this.$toast.success('提交成功');
  997. setTimeout(function(){
  998. history.go(-1)
  999. window.location.reload();
  1000. },2000)
  1001. }
  1002. })
  1003. })
  1004. })
  1005. })
  1006. } else if(_this.form.capitalExpenditureType==4){
  1007. addInfoto(_this.infoForm).then(res => {
  1008. offlineCustomSubmit(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. window.location.reload();
  1017. },2000)
  1018. }
  1019. })
  1020. })
  1021. })
  1022. })
  1023. }else{
  1024. offlineCustomSubmit(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. window.location.reload();
  1033. },2000)
  1034. }
  1035. })
  1036. })
  1037. })
  1038. }
  1039. }
  1040. })
  1041. })
  1042. }else{
  1043. if(_this.form.capitalExpenditureType==2){
  1044. addProjectto(_this.projectForm).then(res => {
  1045. offlineCustomSubmit(response.data.id).then(res => {
  1046. _this.chargeItme.map((resD,b) => {
  1047. resD.cashId = response.data.id
  1048. addCashdetail(resD).then((a,rD) => {
  1049. if(b == (_this.chargeItme.length-1)){
  1050. _this.$toast.success('提交成功');
  1051. setTimeout(function(){
  1052. history.go(-1)
  1053. window.location.reload();
  1054. },2000)
  1055. }
  1056. })
  1057. })
  1058. })
  1059. })
  1060. } else if(_this.form.capitalExpenditureType==4){
  1061. addInfoto(_this.infoForm).then(res => {
  1062. offlineCustomSubmit(response.data.id).then(res => {
  1063. _this.chargeItme.map((resD,b) => {
  1064. resD.cashId = response.data.id
  1065. addCashdetail(resD).then((a,rD) => {
  1066. if(b == (_this.chargeItme.length-1)){
  1067. _this.$toast.success('提交成功');
  1068. setTimeout(function(){
  1069. history.go(-1)
  1070. window.location.reload();
  1071. },2000)
  1072. }
  1073. })
  1074. })
  1075. })
  1076. })
  1077. }else{
  1078. offlineCustomSubmit(response.data.id).then(res => {
  1079. _this.chargeItme.map((resD,b) => {
  1080. resD.cashId = response.data.id
  1081. addCashdetail(resD).then((a,rD) => {
  1082. if(b == (_this.chargeItme.length-1)){
  1083. _this.$toast.success('提交成功');
  1084. setTimeout(function(){
  1085. history.go(-1)
  1086. window.location.reload();
  1087. },2000)
  1088. }
  1089. })
  1090. })
  1091. })
  1092. }
  1093. }
  1094. }
  1095. })
  1096. })
  1097. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1098. this.uploadFiles2.map((rr2,idx2) => {
  1099. let params = new FormData();
  1100. params.append("tableId", response.data.id);
  1101. params.append("tableName", "t_yinnong_cash");
  1102. params.append("bizPath", "yinnong");
  1103. params.append("fileType", "2");
  1104. params.append("file", rr2);
  1105. commonAttach(params).then((r2) => {
  1106. if(idx2 == (_this.uploadFiles2.length-1)){
  1107. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1108. _this.uploadFiles3.map((rr3,idx3) => {
  1109. let params3 = new FormData();
  1110. params3.append("tableId", response.data.id);
  1111. params3.append("tableName", "t_yinnong_cash");
  1112. params3.append("bizPath", "yinnong");
  1113. params3.append("fileType", "3");
  1114. params3.append("file", rr3);
  1115. commonAttach(params).then((r3) => {
  1116. if(idx3 == (_this.uploadFiles3.length-1)){
  1117. if(_this.form.capitalExpenditureType==2){
  1118. addProjectto(_this.projectForm).then(res => {
  1119. offlineCustomSubmit(response.data.id).then(res => {
  1120. _this.chargeItme.map((resD,b) => {
  1121. resD.cashId = response.data.id
  1122. addCashdetail(resD).then((a,rD) => {
  1123. if(b == (_this.chargeItme.length-1)){
  1124. _this.$toast.success('提交成功');
  1125. setTimeout(function(){
  1126. history.go(-1)
  1127. window.location.reload();
  1128. },2000)
  1129. }
  1130. })
  1131. })
  1132. })
  1133. })
  1134. } else if(_this.form.capitalExpenditureType==4){
  1135. addInfoto(_this.infoForm).then(res => {
  1136. offlineCustomSubmit(response.data.id).then(res => {
  1137. _this.chargeItme.map((resD,b) => {
  1138. resD.cashId = response.data.id
  1139. addCashdetail(resD).then((a,rD) => {
  1140. if(b == (_this.chargeItme.length-1)){
  1141. _this.$toast.success('提交成功');
  1142. setTimeout(function(){
  1143. history.go(-1)
  1144. window.location.reload();
  1145. },2000)
  1146. }
  1147. })
  1148. })
  1149. })
  1150. })
  1151. }else{
  1152. offlineCustomSubmit(response.data.id).then(res => {
  1153. _this.chargeItme.map((resD,b) => {
  1154. resD.cashId = response.data.id
  1155. addCashdetail(resD).then((a,rD) => {
  1156. if(b == (_this.chargeItme.length-1)){
  1157. _this.$toast.success('提交成功');
  1158. setTimeout(function(){
  1159. history.go(-1)
  1160. window.location.reload();
  1161. },2000)
  1162. }
  1163. })
  1164. })
  1165. })
  1166. }
  1167. }
  1168. })
  1169. })
  1170. }else{
  1171. if(_this.form.capitalExpenditureType==2){
  1172. addProjectto(_this.projectForm).then(res => {
  1173. offlineCustomSubmit(response.data.id).then(res => {
  1174. _this.chargeItme.map((resD,b) => {
  1175. resD.cashId = response.data.id
  1176. addCashdetail(resD).then((a,rD) => {
  1177. if(b == (_this.chargeItme.length-1)){
  1178. _this.$toast.success('提交成功');
  1179. setTimeout(function(){
  1180. history.go(-1)
  1181. window.location.reload();
  1182. },2000)
  1183. }
  1184. })
  1185. })
  1186. })
  1187. })
  1188. } else if(_this.form.capitalExpenditureType==4){
  1189. addInfoto(_this.infoForm).then(res => {
  1190. offlineCustomSubmit(response.data.id).then(res => {
  1191. _this.chargeItme.map((resD,b) => {
  1192. resD.cashId = response.data.id
  1193. addCashdetail(resD).then((a,rD) => {
  1194. if(b == (_this.chargeItme.length-1)){
  1195. _this.$toast.success('提交成功');
  1196. setTimeout(function(){
  1197. history.go(-1)
  1198. window.location.reload();
  1199. },2000)
  1200. }
  1201. })
  1202. })
  1203. })
  1204. })
  1205. }else{
  1206. offlineCustomSubmit(response.data.id).then(res => {
  1207. _this.chargeItme.map((resD,b) => {
  1208. resD.cashId = response.data.id
  1209. addCashdetail(resD).then((a,rD) => {
  1210. if(b == (_this.chargeItme.length-1)){
  1211. _this.$toast.success('提交成功');
  1212. setTimeout(function(){
  1213. history.go(-1)
  1214. window.location.reload();
  1215. },2000)
  1216. }
  1217. })
  1218. })
  1219. })
  1220. }
  1221. }
  1222. }
  1223. })
  1224. })
  1225. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1226. this.uploadFiles3.map((rr3,idx3) => {
  1227. let params = new FormData();
  1228. params.append("tableId", response.data.id);
  1229. params.append("tableName", "t_yinnong_cash");
  1230. params.append("bizPath", "yinnong");
  1231. params.append("fileType", "3");
  1232. params.append("file", rr3);
  1233. commonAttach(params).then((r) => {
  1234. if(idx3 == (_this.uploadFiles3.length-1)){
  1235. if(_this.form.capitalExpenditureType==2){
  1236. addProjectto(_this.projectForm).then(res => {
  1237. offlineCustomSubmit(response.data.id).then(res => {
  1238. _this.chargeItme.map((resD,b) => {
  1239. resD.cashId = response.data.id
  1240. addCashdetail(resD).then((a,rD) => {
  1241. if(b == (_this.chargeItme.length-1)){
  1242. _this.$toast.success('提交成功');
  1243. setTimeout(function(){
  1244. history.go(-1)
  1245. window.location.reload();
  1246. },2000)
  1247. }
  1248. })
  1249. })
  1250. })
  1251. })
  1252. } else if(_this.form.capitalExpenditureType==4){
  1253. addInfoto(_this.infoForm).then(res => {
  1254. offlineCustomSubmit(response.data.id).then(res => {
  1255. _this.chargeItme.map((resD,b) => {
  1256. resD.cashId = response.data.id
  1257. addCashdetail(resD).then((a,rD) => {
  1258. if(b == (_this.chargeItme.length-1)){
  1259. _this.$toast.success('提交成功');
  1260. setTimeout(function(){
  1261. history.go(-1)
  1262. window.location.reload();
  1263. },2000)
  1264. }
  1265. })
  1266. })
  1267. })
  1268. })
  1269. }else{
  1270. offlineCustomSubmit(response.data.id).then(res => {
  1271. _this.chargeItme.map((resD,b) => {
  1272. resD.cashId = response.data.id
  1273. addCashdetail(resD).then((a,rD) => {
  1274. if(b == (_this.chargeItme.length-1)){
  1275. _this.$toast.success('提交成功');
  1276. setTimeout(function(){
  1277. history.go(-1)
  1278. window.location.reload();
  1279. },2000)
  1280. }
  1281. })
  1282. })
  1283. })
  1284. }
  1285. }
  1286. })
  1287. })
  1288. }else{
  1289. if(this.form.capitalExpenditureType==2){
  1290. addProjectto(this.projectForm).then(res => {
  1291. offlineCustomSubmit(response.data.id).then(res => {
  1292. _this.chargeItme.map((resD,b) => {
  1293. resD.cashId = response.data.id
  1294. addCashdetail(resD).then((a,rD) => {
  1295. if(b == (_this.chargeItme.length-1)){
  1296. _this.$toast.success('提交成功');
  1297. setTimeout(function(){
  1298. history.go(-1)
  1299. window.location.reload();
  1300. },2000)
  1301. }
  1302. })
  1303. })
  1304. })
  1305. })
  1306. } else if(this.form.capitalExpenditureType==4){
  1307. addInfoto(this.infoForm).then(res => {
  1308. offlineCustomSubmit(response.data.id).then(res => {
  1309. _this.chargeItme.map((resD,b) => {
  1310. resD.cashId = response.data.id
  1311. addCashdetail(resD).then((a,rD) => {
  1312. if(b == (_this.chargeItme.length-1)){
  1313. _this.$toast.success('提交成功');
  1314. setTimeout(function(){
  1315. history.go(-1)
  1316. window.location.reload();
  1317. },2000)
  1318. }
  1319. })
  1320. })
  1321. })
  1322. })
  1323. }else{
  1324. offlineCustomSubmit(response.data.id).then(res => {
  1325. _this.chargeItme.map((resD,b) => {
  1326. resD.cashId = response.data.id
  1327. addCashdetail(resD).then((a,rD) => {
  1328. if(b == (_this.chargeItme.length-1)){
  1329. _this.$toast.success('提交成功');
  1330. setTimeout(function(){
  1331. history.go(-1)
  1332. window.location.reload();
  1333. },2000)
  1334. }
  1335. })
  1336. })
  1337. })
  1338. }
  1339. }
  1340. });
  1341. }
  1342. }
  1343. }
  1344. },
  1345. goUpdate(){
  1346. let _this = this
  1347. if(this.form.payerAccount==0){
  1348. this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });;
  1349. return false;
  1350. }else {
  1351. let total = 0;
  1352. this.chargeItme.forEach((money) => {
  1353. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  1354. });
  1355. this.$set(this.form, "expenditureAmount", total);
  1356. if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
  1357. this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
  1358. return false;
  1359. }else{
  1360. if(this.chargeItme.length<1){
  1361. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1362. return false;
  1363. }
  1364. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1365. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1366. return false;
  1367. }
  1368. if(this.form.capitalExpenditureType==2){
  1369. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1370. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1371. return false;
  1372. }
  1373. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1374. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1375. return false;
  1376. }
  1377. }
  1378. if(this.form.capitalExpenditureType==4){
  1379. if(this.infoForm.name==""||this.infoForm.name==null){
  1380. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1381. return false;
  1382. }
  1383. if(this.infoForm.code==""||this.infoForm.code==null){
  1384. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1385. return false;
  1386. }
  1387. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1388. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1389. return false;
  1390. }
  1391. }
  1392. addCash(this.form).then(response => {
  1393. this.projectForm.outId = response.data.id
  1394. this.infoForm.transferId = response.data.id
  1395. this.$set(this.projectForm, "ynType", '2');
  1396. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  1397. this.uploadFiles1.map((rr1,idx1) => {
  1398. let params1 = new FormData();
  1399. params1.append("tableId", response.data.id);
  1400. params1.append("tableName", "t_yinnong_cash");
  1401. params1.append("bizPath", "yinnong");
  1402. params1.append("fileType", "1");
  1403. params1.append("file", rr1);
  1404. commonAttach(params1).then((r1) => {
  1405. if(idx1 == (_this.uploadFiles1.length-1)){
  1406. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  1407. _this.uploadFiles2.map((rr2,idx2) => {
  1408. let params2 = new FormData();
  1409. params2.append("tableId", response.data.id);
  1410. params2.append("tableName", "t_yinnong_cash");
  1411. params2.append("bizPath", "yinnong");
  1412. params2.append("fileType", "2");
  1413. params2.append("file", rr2);
  1414. commonAttach(params2).then((r2) => {
  1415. if(idx2 == (_this.uploadFiles2.length-1)){
  1416. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1417. _this.uploadFiles3.map((rr3,idx3) => {
  1418. let params3 = new FormData();
  1419. params3.append("tableId", response.data.id);
  1420. params3.append("tableName", "t_yinnong_cash");
  1421. params3.append("bizPath", "yinnong");
  1422. params3.append("fileType", "3");
  1423. params3.append("file", rr3);
  1424. commonAttach(params3).then((r3) => {
  1425. if(idx3 == (_this.uploadFiles3.length-1)){
  1426. if(_this.form.capitalExpenditureType==2){
  1427. addProjectto(_this.projectForm).then(res => {
  1428. _this.chargeItme.map((resD,b) => {
  1429. resD.cashId = response.data.id
  1430. addCashdetail(resD).then((a,rD) => {
  1431. if(b == (_this.chargeItme.length-1)){
  1432. _this.$toast.success('保存成功');
  1433. setTimeout(function(){
  1434. history.go(-1)
  1435. window.location.reload();
  1436. },2000)
  1437. }
  1438. })
  1439. })
  1440. })
  1441. } else if(_this.form.capitalExpenditureType==4){
  1442. addInfoto(_this.infoForm).then(res => {
  1443. _this.chargeItme.map((resD,b) => {
  1444. resD.cashId = response.data.id
  1445. addCashdetail(resD).then((a,rD) => {
  1446. if(b == (_this.chargeItme.length-1)){
  1447. _this.$toast.success('保存成功');
  1448. setTimeout(function(){
  1449. history.go(-1)
  1450. window.location.reload();
  1451. },2000)
  1452. }
  1453. })
  1454. })
  1455. })
  1456. }else{
  1457. _this.chargeItme.map((resD,b) => {
  1458. resD.cashId = response.data.id
  1459. addCashdetail(resD).then((a,rD) => {
  1460. if(b == (_this.chargeItme.length-1)){
  1461. _this.$toast.success('保存成功');
  1462. setTimeout(function(){
  1463. history.go(-1)
  1464. window.location.reload();
  1465. },2000)
  1466. }
  1467. })
  1468. })
  1469. }
  1470. }
  1471. })
  1472. })
  1473. }else{
  1474. if(_this.form.capitalExpenditureType==2){
  1475. addProjectto(_this.projectForm).then(res => {
  1476. _this.chargeItme.map((resD,b) => {
  1477. resD.cashId = response.data.id
  1478. addCashdetail(resD).then((a,rD) => {
  1479. if(b == (_this.chargeItme.length-1)){
  1480. _this.$toast.success('保存成功');
  1481. setTimeout(function(){
  1482. history.go(-1)
  1483. window.location.reload();
  1484. },2000)
  1485. }
  1486. })
  1487. })
  1488. })
  1489. } else if(_this.form.capitalExpenditureType==4){
  1490. addInfoto(_this.infoForm).then(res => {
  1491. _this.chargeItme.map((resD,b) => {
  1492. resD.cashId = response.data.id
  1493. addCashdetail(resD).then((a,rD) => {
  1494. if(b == (_this.chargeItme.length-1)){
  1495. _this.$toast.success('保存成功');
  1496. setTimeout(function(){
  1497. history.go(-1)
  1498. window.location.reload();
  1499. },2000)
  1500. }
  1501. })
  1502. })
  1503. })
  1504. }else{
  1505. _this.chargeItme.map((resD,b) => {
  1506. resD.cashId = response.data.id
  1507. addCashdetail(resD).then((a,rD) => {
  1508. if(b == (_this.chargeItme.length-1)){
  1509. _this.$toast.success('保存成功');
  1510. setTimeout(function(){
  1511. history.go(-1)
  1512. window.location.reload();
  1513. },2000)
  1514. }
  1515. })
  1516. })
  1517. }
  1518. }
  1519. }
  1520. })
  1521. })
  1522. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1523. _this.uploadFiles3.map((rr3,idx3) => {
  1524. let params3 = new FormData();
  1525. params3.append("tableId", response.data.id);
  1526. params3.append("tableName", "t_yinnong_cash");
  1527. params3.append("bizPath", "yinnong");
  1528. params3.append("fileType", "3");
  1529. params3.append("file", rr3);
  1530. commonAttach(params3).then((r3) => {
  1531. if(idx3 ==(_this.uploadFiles3.length-1)){
  1532. if(_this.form.capitalExpenditureType==2){
  1533. addProjectto(_this.projectForm).then(res => {
  1534. _this.chargeItme.map((resD,b) => {
  1535. resD.cashId = response.data.id
  1536. addCashdetail(resD).then((a,rD) => {
  1537. if(b == (_this.chargeItme.length-1)){
  1538. _this.$toast.success('保存成功');
  1539. setTimeout(function(){
  1540. history.go(-1)
  1541. window.location.reload();
  1542. },2000)
  1543. }
  1544. })
  1545. })
  1546. })
  1547. } else if(_this.form.capitalExpenditureType==4){
  1548. addInfoto(_this.infoForm).then(res => {
  1549. _this.chargeItme.map((resD,b) => {
  1550. resD.cashId = response.data.id
  1551. addCashdetail(resD).then((a,rD) => {
  1552. if(b == (_this.chargeItme.length-1)){
  1553. _this.$toast.success('保存成功');
  1554. setTimeout(function(){
  1555. history.go(-1)
  1556. window.location.reload();
  1557. },2000)
  1558. }
  1559. })
  1560. })
  1561. })
  1562. }else{
  1563. _this.chargeItme.map((resD,b) => {
  1564. resD.cashId = response.data.id
  1565. addCashdetail(resD).then((a,rD) => {
  1566. if(b == (_this.chargeItme.length-1)){
  1567. _this.$toast.success('保存成功');
  1568. setTimeout(function(){
  1569. history.go(-1)
  1570. window.location.reload();
  1571. },2000)
  1572. }
  1573. })
  1574. })
  1575. }
  1576. }
  1577. })
  1578. })
  1579. }else{
  1580. if(_this.form.capitalExpenditureType==2){
  1581. addProjectto(_this.projectForm).then(res => {
  1582. _this.chargeItme.map((resD,b) => {
  1583. resD.cashId = response.data.id
  1584. addCashdetail(resD).then((a,rD) => {
  1585. if(b == (_this.chargeItme.length-1)){
  1586. _this.$toast.success('保存成功');
  1587. setTimeout(function(){
  1588. history.go(-1)
  1589. window.location.reload();
  1590. },2000)
  1591. }
  1592. })
  1593. })
  1594. })
  1595. } else if(_this.form.capitalExpenditureType==4){
  1596. addInfoto(_this.infoForm).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. window.location.reload();
  1605. },2000)
  1606. }
  1607. })
  1608. })
  1609. })
  1610. }else{
  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. window.location.reload();
  1619. },2000)
  1620. }
  1621. })
  1622. })
  1623. }
  1624. }
  1625. }
  1626. })
  1627. })
  1628. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1629. this.uploadFiles2.map((rr2,idx2) => {
  1630. let params = new FormData();
  1631. params.append("tableId", response.data.id);
  1632. params.append("tableName", "t_yinnong_cash");
  1633. params.append("bizPath", "yinnong");
  1634. params.append("fileType", "2");
  1635. params.append("file", rr2);
  1636. commonAttach(params).then((r2) => {
  1637. if(idx2 == (_this.uploadFiles2.length-1)){
  1638. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1639. _this.uploadFiles3.map((rr3,idx3) => {
  1640. let params3 = new FormData();
  1641. params3.append("tableId", response.data.id);
  1642. params3.append("tableName", "t_yinnong_cash");
  1643. params3.append("bizPath", "yinnong");
  1644. params3.append("fileType", "3");
  1645. params3.append("file", rr3);
  1646. commonAttach(params).then((r3) => {
  1647. if(idx3 == (_this.uploadFiles3.length-1)){
  1648. if(_this.form.capitalExpenditureType==2){
  1649. addProjectto(_this.projectForm).then(res => {
  1650. _this.chargeItme.map((resD,b) => {
  1651. resD.cashId = response.data.id
  1652. addCashdetail(resD).then((a,rD) => {
  1653. if(b == (_this.chargeItme.length-1)){
  1654. _this.$toast.success('保存成功');
  1655. setTimeout(function(){
  1656. history.go(-1)
  1657. window.location.reload();
  1658. },2000)
  1659. }
  1660. })
  1661. })
  1662. })
  1663. } else if(_this.form.capitalExpenditureType==4){
  1664. addInfoto(_this.infoForm).then(res => {
  1665. _this.chargeItme.map((resD,b) => {
  1666. resD.cashId = response.data.id
  1667. addCashdetail(resD).then((a,rD) => {
  1668. if(b == (_this.chargeItme.length-1)){
  1669. _this.$toast.success('保存成功');
  1670. setTimeout(function(){
  1671. history.go(-1)
  1672. window.location.reload();
  1673. },2000)
  1674. }
  1675. })
  1676. })
  1677. })
  1678. }else{
  1679. _this.chargeItme.map((resD,b) => {
  1680. resD.cashId = response.data.id
  1681. addCashdetail(resD).then((a,rD) => {
  1682. if(b == (_this.chargeItme.length-1)){
  1683. _this.$toast.success('保存成功');
  1684. setTimeout(function(){
  1685. history.go(-1)
  1686. window.location.reload();
  1687. },2000)
  1688. }
  1689. })
  1690. })
  1691. }
  1692. }
  1693. })
  1694. })
  1695. }else{
  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. window.location.reload();
  1706. },2000)
  1707. }
  1708. })
  1709. })
  1710. })
  1711. } else if(_this.form.capitalExpenditureType==4){
  1712. addInfoto(_this.infoForm).then(res => {
  1713. _this.chargeItme.map((resD,b) => {
  1714. resD.cashId = response.data.id
  1715. addCashdetail(resD).then((a,rD) => {
  1716. if(b == (_this.chargeItme.length-1)){
  1717. _this.$toast.success('保存成功');
  1718. setTimeout(function(){
  1719. history.go(-1)
  1720. window.location.reload();
  1721. },2000)
  1722. }
  1723. })
  1724. })
  1725. })
  1726. }else{
  1727. _this.chargeItme.map((resD,b) => {
  1728. resD.cashId = response.data.id
  1729. addCashdetail(resD).then((a,rD) => {
  1730. if(b == (_this.chargeItme.length-1)){
  1731. _this.$toast.success('保存成功');
  1732. setTimeout(function(){
  1733. history.go(-1)
  1734. window.location.reload();
  1735. },2000)
  1736. }
  1737. })
  1738. })
  1739. }
  1740. }
  1741. }
  1742. })
  1743. })
  1744. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1745. this.uploadFiles3.map((rr3,idx3) => {
  1746. let params = new FormData();
  1747. params.append("tableId", response.data.id);
  1748. params.append("tableName", "t_yinnong_cash");
  1749. params.append("bizPath", "yinnong");
  1750. params.append("fileType", "3");
  1751. params.append("file", rr3);
  1752. commonAttach(params).then((r) => {
  1753. if(idx3 == (_this.uploadFiles3.length-1)){
  1754. if(_this.form.capitalExpenditureType==2){
  1755. addProjectto(_this.projectForm).then(res => {
  1756. _this.chargeItme.map((resD,b) => {
  1757. resD.cashId = response.data.id
  1758. addCashdetail(resD).then((a,rD) => {
  1759. if(b == (_this.chargeItme.length-1)){
  1760. _this.$toast.success('保存成功');
  1761. setTimeout(function(){
  1762. history.go(-1)
  1763. window.location.reload();
  1764. },2000)
  1765. }
  1766. })
  1767. })
  1768. })
  1769. } else if(_this.form.capitalExpenditureType==4){
  1770. addInfoto(_this.infoForm).then(res => {
  1771. _this.chargeItme.map((resD,b) => {
  1772. resD.cashId = response.data.id
  1773. addCashdetail(resD).then((a,rD) => {
  1774. if(b == (_this.chargeItme.length-1)){
  1775. _this.$toast.success('保存成功');
  1776. setTimeout(function(){
  1777. history.go(-1)
  1778. window.location.reload();
  1779. },2000)
  1780. }
  1781. })
  1782. })
  1783. })
  1784. }else{
  1785. _this.chargeItme.map((resD,b) => {
  1786. resD.cashId = response.data.id
  1787. addCashdetail(resD).then((a,rD) => {
  1788. if(b == (_this.chargeItme.length-1)){
  1789. _this.$toast.success('保存成功');
  1790. setTimeout(function(){
  1791. history.go(-1)
  1792. window.location.reload();
  1793. },2000)
  1794. }
  1795. })
  1796. })
  1797. }
  1798. }
  1799. })
  1800. })
  1801. }else{
  1802. if(this.form.capitalExpenditureType==2){
  1803. addProjectto(this.projectForm).then(res => {
  1804. _this.chargeItme.map((resD,b) => {
  1805. resD.cashId = response.data.id
  1806. addCashdetail(resD).then((a,rD) => {
  1807. if(b == (_this.chargeItme.length-1)){
  1808. _this.$toast.success('保存成功');
  1809. setTimeout(function(){
  1810. history.go(-1)
  1811. window.location.reload();
  1812. },2000)
  1813. }
  1814. })
  1815. })
  1816. })
  1817. } else if(this.form.capitalExpenditureType==4){
  1818. addInfoto(this.infoForm).then(res => {
  1819. _this.chargeItme.map((resD,b) => {
  1820. resD.cashId = response.data.id
  1821. addCashdetail(resD).then((a,rD) => {
  1822. if(b == (_this.chargeItme.length-1)){
  1823. _this.$toast.success('保存成功');
  1824. setTimeout(function(){
  1825. history.go(-1)
  1826. window.location.reload();
  1827. },2000)
  1828. }
  1829. })
  1830. })
  1831. })
  1832. }else{
  1833. _this.chargeItme.map((resD,b) => {
  1834. resD.cashId = response.data.id
  1835. addCashdetail(resD).then((a,rD) => {
  1836. if(b == (_this.chargeItme.length-1)){
  1837. _this.$toast.success('保存成功');
  1838. setTimeout(function(){
  1839. history.go(-1)
  1840. window.location.reload();
  1841. },2000)
  1842. }
  1843. })
  1844. })
  1845. }
  1846. }
  1847. });
  1848. }
  1849. }
  1850. },
  1851. payeeSelectChange(select, i) {
  1852. let obj = {};
  1853. let fuzhitype = 0;
  1854. obj = this.payeeList.find((account) => {
  1855. //model就是上面的数据源
  1856. return account.id === select ; //筛选出匹配数据
  1857. });
  1858. if(this.chargeItme != [] && this.chargeItme.length>1){
  1859. this.chargeItme.some((value, index) => {
  1860. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  1861. fuzhitype = 2;
  1862. return true;
  1863. }
  1864. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  1865. fuzhitype = 1;
  1866. return true;
  1867. }
  1868. });
  1869. }
  1870. if(fuzhitype == 0){
  1871. this.$set(this.chargeItme[i], "payee",obj.payee)
  1872. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1873. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1874. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1875. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1876. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1877. }else if(fuzhitype == 1){
  1878. this.$set(this.chargeItme[i], "payee",'')
  1879. this.$set(this.chargeItme[i], "bankType",'')
  1880. this.$set(this.chargeItme[i], "payeeId", '');
  1881. this.$set(this.chargeItme[i], "payeeAccount", '');
  1882. this.$set(this.chargeItme[i], "bankDeposit", '');
  1883. this.$set(this.chargeItme[i], "accountType", '');
  1884. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  1885. }else if(fuzhitype == 2){
  1886. this.$set(this.chargeItme[i], "payee",'')
  1887. this.$set(this.chargeItme[i], "bankType",'')
  1888. this.$set(this.chargeItme[i], "payeeId", '');
  1889. this.$set(this.chargeItme[i], "payeeAccount", '');
  1890. this.$set(this.chargeItme[i], "bankDeposit", '');
  1891. this.$set(this.chargeItme[i], "accountType", '');
  1892. this.$notify({ type: 'danger', message: '收款方已存在!' });
  1893. }
  1894. },
  1895. selectChange(select) {
  1896. let obj = {};
  1897. obj = this.payerOptions.find((account) => {
  1898. //model就是上面的数据源
  1899. return account.id === select; //筛选出匹配数据
  1900. });
  1901. if(obj.accountType == "101"){
  1902. obj.accountPassword = "";
  1903. }
  1904. if(obj.accountPassword != null && obj.accountPassword != "" &&
  1905. obj.bankType != null && obj.bankType != ""){
  1906. this.$set(this.form, "bookId", obj.bookId);
  1907. this.$set(this.form, "deptId", obj.deptId);
  1908. this.$set(this.form, "cashierId", obj.id);
  1909. this.$set(this.form, "payer", obj.accountName);
  1910. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1911. this.$set(this.form, "operatorCode", obj.operatorCode);
  1912. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1913. this.$set(this.form, "bankType", obj.bankType);
  1914. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  1915. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  1916. this.$set(this.form, "taccountId", obj.taccountId);
  1917. this.$set(this.form, "accountNo", obj.accountNo);
  1918. this.$set(this.form, "cifNo", obj.cifNo);
  1919. this.$set(this.form, "balance", obj.balance);
  1920. this.$set(this.form, "payerFrom", '1');
  1921. if(obj.bankType==1){
  1922. this.form.accountType = "1"
  1923. this.form.isPeers = null
  1924. this.accountTypeChange();
  1925. }else if(obj.bankType==2||obj.bankType==4){
  1926. this.form.accountType = null
  1927. this.form.isPeers = "Y"
  1928. this.accountTypeChange1();
  1929. }
  1930. }else{
  1931. if(obj.payerFrom==1){
  1932. this.diglogStatus = false;
  1933. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1934. this.$set(this.form,"payer","")
  1935. this.$set(this.form,"payerAccount","")
  1936. }else{
  1937. this.$set(this.form, "payerFrom", obj.parerFrom);
  1938. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1939. this.$set(this.form, "operatorCode", obj.operatorCode);
  1940. }else{
  1941. this.$set(this.form, "operatorCode", '');
  1942. }
  1943. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1944. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1945. }else{
  1946. this.$set(this.form, "enterpriseCode", '');
  1947. }
  1948. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1949. this.$set(this.form, "accountPassword", obj.accountPassword);
  1950. }else{
  1951. this.$set(this.form, "accountPassword", '');
  1952. }
  1953. this.$set(this.form, "bookId",'');
  1954. this.$set(this.form, "deptId", '');
  1955. this.$set(this.form, "cashierId", obj.id);
  1956. this.$set(this.form, "payer", obj.accountName);
  1957. this.$set(this.form, "bankType", obj.bankType);
  1958. if(obj.payerFrom==6){
  1959. getQmyeFlow(obj.id).then((response) => {
  1960. this.$set(this.form, "payerAccount", response.data);
  1961. });
  1962. }else {
  1963. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1964. }
  1965. }
  1966. }
  1967. },
  1968. beforeRead1(file) {
  1969. this.uploadFiles1.push(file.file);
  1970. },
  1971. deleteFile1(file){
  1972. this.uploadFiles1.map((response,index) => {
  1973. if(file.file == response){
  1974. this.uploadFiles1.splice(index,1)
  1975. }
  1976. })
  1977. },
  1978. beforeRead2(file) {
  1979. this.uploadFiles2.push(file.file);
  1980. },
  1981. deleteFile2(file){
  1982. this.uploadFiles2.map((response,index) => {
  1983. if(file.file == response){
  1984. this.uploadFiles2.splice(index,1)
  1985. }
  1986. })
  1987. },
  1988. beforeRead3(file) {
  1989. this.uploadFiles3.push(file.file);
  1990. },
  1991. deleteFile3(file){
  1992. this.uploadFiles3.map((response,index) => {
  1993. if(file.file == response){
  1994. this.uploadFiles3.splice(index,1)
  1995. }
  1996. })
  1997. },
  1998. getFileList(){
  1999. let oData1= {
  2000. tableId: this.$route.query.id,
  2001. tableName: "t_yinnong_transfer",
  2002. bizPath: "yinnong",
  2003. fileType: "1",
  2004. }
  2005. attachmentList(oData1).then(res => {
  2006. res.rows.map(r => {
  2007. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2008. let subIndex = r.fileName.lastIndexOf(".");
  2009. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  2010. this.fileList1.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  2011. })
  2012. })
  2013. let oData2= {
  2014. tableId: this.$route.query.id,
  2015. tableName: "t_yinnong_transfer",
  2016. bizPath: "yinnong",
  2017. fileType: "2",
  2018. }
  2019. attachmentList(oData2).then(res => {
  2020. res.rows.map(r => {
  2021. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2022. let subIndex = r.fileName.lastIndexOf(".");
  2023. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  2024. this.fileList2.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  2025. })
  2026. })
  2027. let oData3= {
  2028. tableId: this.$route.query.id,
  2029. tableName: "t_yinnong_transfer",
  2030. bizPath: "yinnong",
  2031. fileType: "3",
  2032. }
  2033. attachmentList(oData3).then(res => {
  2034. res.rows.map(r => {
  2035. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2036. let subIndex = r.fileName.lastIndexOf(".");
  2037. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  2038. this.fileList3.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  2039. })
  2040. })
  2041. },
  2042. goBack(){
  2043. window.history.go(-1)
  2044. },
  2045. //删除家庭成员
  2046. deleteChargeItme(index){
  2047. this.chargeItme.splice(index,1)
  2048. },
  2049. },
  2050. }
  2051. </script>
  2052. <style scoped lang="scss">
  2053. .app-container {
  2054. padding: 2% 0;
  2055. }
  2056. .main_title{
  2057. font-size: 0.4rem;
  2058. color: #1D6FE9;
  2059. margin: 0.2rem 6%;
  2060. position: relative;
  2061. }
  2062. .main_box{
  2063. width: 96%;
  2064. margin: 0 auto;
  2065. border-radius: 6px;
  2066. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  2067. overflow: hidden;
  2068. background-color: #FFF;
  2069. }
  2070. .submitButton{
  2071. width: 80%;
  2072. margin: 0 auto;
  2073. background-color: #1D6FE9;
  2074. }
  2075. .addFamily{
  2076. position: absolute;
  2077. top: -2px;
  2078. right: 0;
  2079. border-radius: 50%;
  2080. }
  2081. .deleteFamily{
  2082. position: absolute;
  2083. top: 0rem;
  2084. right: 6%;
  2085. z-index: 9;
  2086. border-radius: 50%;
  2087. }
  2088. </style>