移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

approvalModify.vue 55 KiB

2年前
3年前
3年前
3年前
2年前
1年前
1年前
1年前
2年前
3年前
2年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
3年前
2年前
2年前
2年前
2年前
2年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="goBack"
  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. maxlength="10"
  114. required
  115. show-word-limit
  116. v-if="form.bankType == '5'"
  117. :rules="[{ required: true , message:'请输入转账附言' }]"
  118. />
  119. <van-field
  120. label="转账附言"
  121. v-model="form.remark"
  122. type="textarea"
  123. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  124. input-align="right"
  125. rows="3"
  126. label-width="auto"
  127. maxlength="20"
  128. required
  129. show-word-limit
  130. v-if="form.bankType == '6'"
  131. :rules="[{ required: true , message:'请输入转账附言' }]"
  132. />
  133. <van-field
  134. label="转账附言"
  135. v-model="form.remark"
  136. type="textarea"
  137. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  138. input-align="right"
  139. rows="3"
  140. label-width="auto"
  141. maxlength="30"
  142. required
  143. show-word-limit
  144. v-if="form.bankType != '5' && form.bankType != '6'"
  145. :rules="[{ required: true , message:'请输入转账附言' }]"
  146. />
  147. </div>
  148. <div class="main_box" style="margin-top: 10px;">
  149. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况"
  150. input-align="right" rows="3" label-width="auto"/>
  151. </div>
  152. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  153. <div class="main_box" v-if="capitalExpenditureOpen"
  154. style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  155. <van-field
  156. readonly
  157. clickable
  158. label="项目名称"
  159. placeholder="请选择"
  160. v-model="projectForm.projectName"
  161. @click="showproject = true"
  162. input-align="right"
  163. right-icon="arrow-down"
  164. required
  165. :rules="[{ required: true , message:'请选择项目名称' }]"
  166. />
  167. <van-popup v-model="showproject" position="bottom">
  168. <van-picker
  169. show-toolbar
  170. :columns="projectList"
  171. @confirm="onConfirmProject"
  172. @cancel="showproject = false"
  173. />
  174. </van-popup>
  175. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor"
  176. label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  177. <van-field required :rules="[{ required: true , message:'请输入合同价款(元)' }]" v-model="projectForm.projectAmount"
  178. label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  179. <van-field
  180. readonly
  181. clickable
  182. label="工程款类型"
  183. placeholder="请选择"
  184. v-model="projectFundType"
  185. @click="showFundType = true"
  186. input-align="right"
  187. right-icon="arrow-down"
  188. required
  189. :rules="[{ required: true , message:'请选择工程款类型' }]"
  190. />
  191. <van-popup v-model="showFundType" position="bottom">
  192. <van-picker
  193. show-toolbar
  194. :columns="projectFundTypeOptions"
  195. @confirm="onConfirmFundType"
  196. @cancel="showFundType = false"
  197. />
  198. </van-popup>
  199. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum"
  200. label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  201. </div>
  202. <p class="main_title" v-if="contractOpen">关联合同</p>
  203. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  204. <van-field
  205. readonly
  206. clickable
  207. label="合同"
  208. placeholder="请选择"
  209. v-model="infoForm.name"
  210. @click="showcontract = true"
  211. input-align="right"
  212. right-icon="arrow-down"
  213. required
  214. :rules="[{ required: true , message:'请选择项目名称' }]"
  215. />
  216. <van-popup v-model="showcontract" position="bottom">
  217. <van-picker
  218. show-toolbar
  219. :columns="infoList"
  220. @confirm="onConfirmContract"
  221. @cancel="showcontract = false"
  222. />
  223. </van-popup>
  224. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码"
  225. placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  226. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount"
  227. label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  228. </div>
  229. <p class="main_title">付款方信息</p>
  230. <div class="main_box">
  231. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  232. <van-field
  233. readonly
  234. clickable
  235. label="付款方"
  236. placeholder="请选择付款方"
  237. v-model="form.payer"
  238. @click="showpayer = true"
  239. input-align="right"
  240. right-icon="arrow-down"
  241. label-width="auto"
  242. required
  243. :rules="[{ required: true , message:'请选择付款方' }]"
  244. />
  245. <van-popup v-model="showpayer" position="bottom">
  246. <van-picker
  247. show-toolbar
  248. :columns="payerOptions"
  249. @confirm="onConfirmPayer($event)"
  250. @cancel="showpayer = false"
  251. />
  252. </van-popup>
  253. <van-field :rules="[{ required: true , message:'请输入账户' }]" required label="付款方账户" v-model="form.payerAccount"
  254. placeholder="请输入账户" input-align="right" label-width="auto"/>
  255. </div>
  256. <p class="main_title">收款方信息
  257. <van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button"
  258. class="addFamily"/>
  259. </p>
  260. <!-- <div class="main_title main_title_box">-->
  261. <!-- <p>收款方信息</p>-->
  262. <!-- <router-link :to="{name:'collectionApprovalAdd', params: {accountType:form.accountType,isPeers:form.isPeers,bankType:form.bankType,option:form}}">添加收款方</router-link>-->
  263. <!-- <van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/>-->
  264. <!-- </div>-->
  265. <div class="main_box" style="margin-bottom: 15px;">
  266. <van-cell title="收款账户类型" v-if="form.bankType==1">
  267. <template #right-icon>
  268. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  269. <van-radio name="1">公户</van-radio>
  270. <van-radio name="2">私户</van-radio>
  271. </van-radio-group>
  272. </template>
  273. </van-cell>
  274. <van-cell title="行内转账" v-if="form.bankType==2||form.bankType==3">
  275. <template #right-icon>
  276. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  277. <van-radio name="Y">是</van-radio>
  278. <van-radio name="N">否</van-radio>
  279. </van-radio-group>
  280. </template>
  281. </van-cell>
  282. </div>
  283. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme"
  284. :key="index">
  285. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0"
  286. @click="deleteChargeItme(index)"/>
  287. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  288. <van-field
  289. readonly
  290. clickable
  291. label="收款方"
  292. placeholder="请选择"
  293. v-model="item.payee"
  294. @click="item.showPayee = true"
  295. input-align="right"
  296. right-icon="arrow-down"
  297. required
  298. :rules="[{ required: true , message:'请选择收款方' }]"
  299. />
  300. <van-popup v-model="item.showPayee" position="bottom" @close="payeeSearchValue = ''" @closed="payeeSearch">
  301. <van-search v-model="payeeSearchValue" show-action placeholder="请输入收款方名称搜索" >
  302. <template #action>
  303. <div @click="payeeSearch">搜索</div>
  304. </template>
  305. </van-search>
  306. <van-picker
  307. show-toolbar
  308. :columns="payeeList"
  309. @confirm="onConfirmPayee($event,index)"
  310. @cancel="item.showPayee = false"
  311. />
  312. </van-popup>
  313. <van-field readonly required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户"
  314. placeholder="请输入账户" input-align="right" label-width="auto"/>
  315. <van-field readonly required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行"
  316. placeholder="请输入银行" input-align="right" label-width="auto"/>
  317. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" label="收入金额"
  318. placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  319. <van-field
  320. readonly
  321. label="所属银行"
  322. placeholder="请选择"
  323. v-model="item.bankTypeText"
  324. input-align="right"
  325. required
  326. :rules="[{ required: true , message:'请选择所属银行' }]"
  327. />
  328. <van-popup v-model="item.showbankType" position="bottom">
  329. <van-picker
  330. show-toolbar
  331. :columns="bankTypeDictionaries"
  332. @confirm="onConfirmBankType($event,index)"
  333. @cancel="item.showbankType = false"
  334. />
  335. </van-popup>
  336. </div>
  337. </div>
  338. <p class="main_title" style="margin: 0.2rem 3%;">上传附件<i style="margin-right: 0.5em;"></i><span
  339. style="font-size: 12px;color: red;">(若申请单未变动可不必点击底部的修改按钮)</span></p>
  340. <div class="main_box" style="padding: 5px 0 0 0;">
  341. <van-cell value="收据"/>
  342. <van-uploader v-model="fileList1" :after-read="beforeRead('1')" @click-preview="previewPreview"
  343. @delete="deleteFile" style="margin-left:8px;">
  344. <template #preview-cover="file">
  345. <div class="preview-cover">
  346. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  347. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  348. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  349. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  350. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  351. </div>
  352. </template>
  353. </van-uploader>
  354. <van-cell title="发票"/>
  355. <van-uploader v-model="fileList2" :after-read="beforeRead('2')" @click-preview="previewPreview"
  356. @delete="deleteFile" style="margin-left:8px;">
  357. <template #preview-cover="file">
  358. <div class="preview-cover">
  359. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  360. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  361. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  362. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  363. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  364. </div>
  365. </template>
  366. </van-uploader>
  367. <van-cell title="其他"/>
  368. <van-uploader v-model="fileList3" :after-read="beforeRead('3')" @click-preview="previewPreview"
  369. @delete="deleteFile" style="margin-left:8px;">
  370. <template #preview-cover="file">
  371. <div class="preview-cover">
  372. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  373. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  374. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  375. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  376. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  377. </div>
  378. </template>
  379. </van-uploader>
  380. </div>
  381. <div style="padding: 16px 0;">
  382. <van-row>
  383. <van-col span="12" align="center">
  384. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">修<i
  385. style="margin-right: 1em;"></i>改
  386. </van-button>
  387. </van-col>
  388. <van-col span="12" align="center">
  389. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">提<i
  390. style="margin-right: 1em;"></i>交
  391. </van-button>
  392. </van-col>
  393. </van-row>
  394. <div class="clear"></div>
  395. </div>
  396. </van-form>
  397. </div>
  398. </template>
  399. <script>
  400. import {
  401. getAccount,
  402. getTransfer,
  403. queryTransferDetail,
  404. listPayee,
  405. updateTransfer,
  406. getProjectto,
  407. listProject,
  408. addProjectto,
  409. customSubmit,
  410. offlineCustomSubmit,
  411. getQmyeFlow,
  412. listInfo,
  413. getInfoto,
  414. addInfoto,
  415. listTemplate,
  416. selectApprovalByTemplateId
  417. } from "@/api/onlineHome/bankAgriculture/paymentApproval";
  418. import {
  419. attachmentList,
  420. commonAttach,
  421. systemAttachment
  422. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  423. import request from '@/utils/request';
  424. import Dialog from "vant/lib/dialog";
  425. export default {
  426. name: "approvalModify",
  427. data() {
  428. return {
  429. showtemplate: false,
  430. showcontract: false,
  431. showcapital: false,
  432. showpayee: false,
  433. showlasj: false,
  434. showbankType: false,
  435. showproject: false,
  436. showFundType: false,
  437. showpayer: false,
  438. minDate: new Date(2000, 1, 1),
  439. maxDate: new Date(2050, 12, 31),
  440. currentDate: new Date(),
  441. form: {},
  442. capitalExpenditureType: '',
  443. payee: '',
  444. bankType: '',
  445. buttonType: 'a',
  446. fileType:"",
  447. wfydlxDictionaries: [],
  448. jglxDictionaries: [],
  449. sysDictionaries: [],
  450. capitalExpenditureTypeOptions: [],
  451. bankTypeDictionaries: [],
  452. infoList: [],
  453. projectList: [],
  454. projectFundTypeOptions: [],
  455. projectFundTypeDictionaries: [],
  456. payerOptions: [],
  457. chargeItme: [],
  458. chargeItmeShow: [],
  459. payeeList: [],
  460. payeeSearchValue:'',
  461. bankTypeList:[],
  462. // 查询参数
  463. queryParams: {
  464. transferType: "",
  465. orderByColumn: "id",
  466. isAsc: "desc",
  467. },
  468. capitalExpenditureOpen: false,
  469. contractOpen: false,
  470. projectForm: {
  471. projectId: null,
  472. projectName: null,
  473. projectContractor: null,
  474. projectAmount: null,
  475. projectBillNum: null,
  476. projectFundType: '1',
  477. outId: null,
  478. ynType: '1'
  479. },
  480. infoForm: {
  481. infoId: null,
  482. name: null,
  483. code: null,
  484. totalAmount: null,
  485. contractionId: null,
  486. transferId: null
  487. },
  488. // 合同信息查询参数
  489. queryContractionParams: {
  490. pageNum: 1,
  491. pageSize: 100,
  492. contractionStatus: '1',
  493. orderByColumn: "endTime",
  494. isAsc: "desc",
  495. },
  496. projectFundType: '',
  497. fileList1: [],
  498. fileList2: [],
  499. fileList3: [],
  500. templateList: [],
  501. };
  502. },
  503. activated: function () {
  504. this.getDictionaries();
  505. },
  506. created() {
  507. let queryParams = {
  508. pageNum: 1,
  509. pageSize: 100,
  510. }
  511. this.getFileList();
  512. listProject(queryParams).then(response => {
  513. this.projectList = response.rows;
  514. for (let i = 0; i < response.rows.length; i++) {
  515. this.$set(this.projectList[i], "text", response.rows[i].projectName)
  516. this.$set(this.projectList[i], "value", response.rows[i].id)
  517. }
  518. });
  519. listInfo(this.queryContractionParams).then(response => {
  520. this.infoList = response.rows;
  521. for (let i = 0; i < response.rows.length; i++) {
  522. this.$set(this.infoList[i], "text", response.rows[i].name)
  523. this.$set(this.infoList[i], "value", response.rows[i].code)
  524. }
  525. });
  526. this.getDicts("project_fund_type").then((response) => {
  527. for (var i = 0; i < response.data.length; i++) {
  528. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  529. }
  530. this.projectFundTypeDictionaries = response.data;
  531. });
  532. this.getDicts("bank_type").then((response) => {
  533. for (var i = 0; i < response.data.length; i++) {
  534. this.bankTypeList.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  535. }
  536. });
  537. let params1 = {
  538. accountType: "102",
  539. // "params":{townAccountType:'0'},
  540. status: "N",
  541. }
  542. getAccount(params1).then((response) => {
  543. this.payerOptions = response.rows;
  544. response.rows.map((res, index) => {
  545. res['payerFrom'] = '1'
  546. this.payerOptions[index].text = res.accountName;
  547. this.payerOptions[index].value = res.id;
  548. })
  549. });
  550. this.getDictionaries();
  551. },
  552. methods: {
  553. payeeSearch(val){
  554. console.log(val);
  555. this.payeeList = [];
  556. this.queryParams.payee = this.payeeSearchValue;
  557. listPayee(this.queryParams).then((response) => {
  558. response.rows.map((res,index) => {
  559. if(res.payeeType==1||res.payeeType==2){
  560. response.rows[index].text = res.payee;
  561. response.rows[index].value = res.id;
  562. this.payeeList.push(res)
  563. }
  564. })
  565. });
  566. },
  567. goFlow() {
  568. if (this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined") {
  569. window.location = 'approvalProcess3?approvalTemplateId=' + this.form.approvalTemplateId + '&approvalMode=' + this.form.approvalMode;
  570. } else {
  571. this.$notify({type: 'danger', message: '无审批流程!'});
  572. }
  573. },
  574. onConfirmTemplate(data) {
  575. selectApprovalByTemplateId(data.id).then(res => {
  576. this.showtemplate = false;
  577. if (res.approvalDetails.length > 0) {
  578. this.form.approvalTemplateName = data.name
  579. this.form.approvalTemplateId = data.id
  580. } else {
  581. this.form.approvalTemplateName = null
  582. this.form.approvalTemplateId = null
  583. this.$notify({type: 'danger', message: '此流程无节点,无法选择!'});
  584. }
  585. })
  586. },
  587. getDictionaries() {
  588. getTransfer(this.$route.query.id).then((response) => {
  589. this.getDicts("capital_expenditure_type").then((res) => {
  590. for (var i = 0; i < res.data.length; i++) {
  591. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  592. }
  593. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  594. });
  595. if (response.data.capitalExpenditureType == 2) {
  596. this.capitalExpenditureOpen = true
  597. let param = {
  598. 'outId': response.data.id,
  599. 'ynType': '1'
  600. }
  601. getProjectto(param).then(res => {
  602. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  603. this.projectForm = res.data
  604. })
  605. } else if (response.data.capitalExpenditureType == 4) {
  606. this.contractOpen = true
  607. let param = {
  608. 'transferId': response.data.id
  609. }
  610. getInfoto(param).then(res => {
  611. this.infoForm = res.data
  612. })
  613. } else {
  614. this.showproject = false
  615. }
  616. this.form = response.data;
  617. this.getPayeeList();
  618. let _this = this
  619. let templateQueryParams = {
  620. // 分页
  621. pageNum: 1,
  622. pageSize: 999,
  623. type: '1'
  624. };
  625. listTemplate(templateQueryParams).then(rrr => {
  626. this.templateList = rrr.rows;
  627. this.templateList.map(ra => {
  628. if (ra.id == response.data.approvalTemplateId) {
  629. _this.form.approvalTemplateName = ra.name
  630. }
  631. })
  632. });
  633. });
  634. queryTransferDetail(this.$route.query.id).then((response) => {
  635. this.getDicts("bank_type_all").then(res => {
  636. for (var i = 0; i < res.data.length; i++) {
  637. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  638. }
  639. for (var j = 0; j < response.rows.length; j++) {
  640. // response.rows[j].payeeText = response.rows[j].payee;
  641. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  642. response.rows[j].showPayee = false;
  643. }
  644. this.chargeItme = response.rows;
  645. });
  646. });
  647. },
  648. getChange() {
  649. if (this.buttonType == 'update') {
  650. this.goUpdate();
  651. } else if (this.buttonType == 'add') {
  652. this.goAdd();
  653. }
  654. },
  655. getError(e) {
  656. this.$notify({type: 'danger', message: e.errors[0].message});
  657. },
  658. addChargeItme(index) {
  659. if (this.chargeItme.length > 0 && this.chargeItme[this.chargeItme.length - 1].payee == '') {
  660. this.$notify({type: 'danger', message: '请勿添加多个空列表信息'});
  661. return;
  662. } else if (this.chargeItme.length > 0 && this.chargeItme[index - 1].incomeAmount == '') {
  663. this.$notify({type: 'danger', message: '请输入收入金额!'});
  664. return;
  665. } else if (this.chargeItme.length > 0 && this.chargeItme[index - 1].payeeAccount == '') {
  666. this.$notify({type: 'danger', message: '请输入收款账户!'});
  667. return;
  668. } else if (this.chargeItme.length > 0 && this.chargeItme[index - 1].bankDeposit == '') {
  669. this.$notify({type: 'danger', message: '请输入开户银行!'});
  670. return;
  671. } else if (this.chargeItme.length > 0 && this.chargeItme[index - 1].bankType == '') {
  672. this.$notify({type: 'danger', message: '请选择所属银行!'});
  673. return;
  674. }
  675. // if(this.form.bankType == '2' && this.form.isPeers == 'N' && this.chargeItme.length==1){
  676. // this.$notify({ type: 'danger', message: '目前农商行仅支持单笔跨行转账,即仅能有一个收款方!' });
  677. // }else
  678. var heilongjiang = false;
  679. this.bankTypeList.map(res => {
  680. if(res.value == 7 && res.text.includes("黑龙江")){
  681. heilongjiang = true;
  682. }
  683. });
  684. if(heilongjiang && this.form.bankType == '7' && this.chargeItme.length==1){
  685. this.$notify({ type: 'danger', message: '目前黑龙江农商行仅支持单笔转账,即仅能有一个收款方!' });
  686. }else{
  687. this.getDicts("bank_type_all").then(res => {
  688. this.chargeItme.splice(index + 1, 0, {
  689. payeeId: "", //收款方ID
  690. payee: "", //收款方
  691. payeeAccount: "", //收款账户
  692. bankDeposit: "", //开户银行
  693. incomeAmount: "", //收入金额
  694. bankType: null, //所属银行
  695. bankTypeText: "", //所属银行
  696. showPayee: false,
  697. showbankType: false
  698. });
  699. });
  700. }
  701. },
  702. getPayeeList() {
  703. //普通转账
  704. this.queryParams.isPeers = this.form.isPeers ? this.form.isPeers : null
  705. this.queryParams.accountType = this.form.accountType ? this.form.accountType : null
  706. this.queryParams.bankType = this.form.bankType
  707. this.queryParams.status = "0"
  708. listPayee(this.queryParams).then((response) => {
  709. response.rows.map((res, index) => {
  710. if (res.payeeType == 1 || res.payeeType == 2) {
  711. res.text = res.payee;
  712. res.value = res.id;
  713. this.payeeList.push(res)
  714. }
  715. })
  716. });
  717. },
  718. payeeDictLabel(datas, value) {
  719. var actions = [];
  720. Object.keys(datas).some((key) => {
  721. if (datas[key].payeeId == ('' + value)) {
  722. actions.push(datas[key].payee);
  723. return true;
  724. }
  725. })
  726. return actions.join('');
  727. },
  728. previewPreview(file, index, len) {
  729. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  730. if (file.url) {
  731. //已上传文件
  732. let fileName = file.file.name || file.url;
  733. let subIndex = fileName.lastIndexOf(".");
  734. let ext = fileName.substring(subIndex + 1, fileName.length);
  735. this.fileType = ext;
  736. let imgi = file.listIndex
  737. //console.log(ext)
  738. let allUrl = file.url;
  739. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  740. const link = document.createElement("a");
  741. link.style.display = "none";
  742. link.target = "_blank"
  743. link.href = allUrl;
  744. document.body.appendChild(link);
  745. link.click();
  746. document.body.removeChild(link);
  747. }
  748. } else {
  749. //新上传文件
  750. let fileName = file.file.name;
  751. // console.info(file.file.name)
  752. let subIndex = fileName.lastIndexOf(".");
  753. let ext = fileName.substring(subIndex + 1, fileName.length);
  754. this.fileType = ext;
  755. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  756. let type = this.getfileType(ext);
  757. // 将文件转换为base64编码
  758. this.fileToBase64(file.file, ext).then(res => {
  759. this.downloadFile(res, fileName, ext, type);
  760. })
  761. }
  762. }
  763. },
  764. getfileType(type) {
  765. switch (type) {
  766. case 'txt':
  767. return 'text/plain';
  768. case 'doc':
  769. return 'application/msword';
  770. case 'docx':
  771. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  772. case 'xls':
  773. return 'application/vnd.ms-excel';
  774. case 'xlsx':
  775. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  776. case 'pdf':
  777. return 'application/pdf';
  778. case 'pptx':
  779. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  780. case 'png':
  781. return 'image/png';
  782. case 'jpg':
  783. return 'image/jpeg';
  784. case 'gif':
  785. return 'image/gif';
  786. case 'svg':
  787. return 'image/svg+xml';
  788. case 'ico':
  789. return 'image/x-icon';
  790. case 'gif':
  791. return 'image/gif';
  792. case 'svg':
  793. return 'image/svg+xml';
  794. case 'ico':
  795. return 'image/x-icon';
  796. case 'bmp':
  797. return 'image/bmp,';
  798. }
  799. },
  800. downloadFile(base64, fileName, fileType, mimetype) {
  801. const typeHeader = 'data:application/' + fileType + ';base64,';
  802. const blob = this.base64ToBlob(base64, mimetype);
  803. this.downloadFileDownload(blob, fileName, fileType);
  804. },
  805. base64ToBlob(base64, mime) {
  806. //解码base64得到二进制字符串
  807. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  808. let rawLength = raw.length
  809. //创建8位无符号整数值的类型化数组
  810. let uInt8Array = new Uint8Array(rawLength)
  811. for (let i = 0; i < rawLength; ++i) {
  812. uInt8Array[i] = raw.charCodeAt(i);
  813. }
  814. return new Blob([uInt8Array], {type: mime})
  815. },
  816. downloadFileDownload(blob, fileName, fileType) {
  817. const downloadElement = document.createElement('a');
  818. let href = blob;
  819. if (typeof blob === 'string') {
  820. downloadElement.target = '_blank'
  821. } else {
  822. href = window.URL.createObjectURL(blob)
  823. }
  824. downloadElement.href = href;
  825. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  826. document.body.appendChild(downloadElement);
  827. downloadElement.click();
  828. document.body.removeChild(downloadElement)
  829. if (typeof blob !== 'string') {
  830. window.URL.revokeObjectURL(href)
  831. }
  832. },
  833. fileToBase64(file, fileType) {
  834. return new Promise((resolve, reject) => {
  835. //创建一个新的FileReader 对象
  836. const reader = new FileReader();
  837. //读取file对象
  838. reader.readAsDataURL(file);
  839. reader.onload = function () {
  840. const base64String = reader.result.split(",")[1];
  841. resolve('data:application/' + fileType + ';base64,' + base64String);
  842. }
  843. reader.onerror = function () {
  844. reject(new Error("Failed to load file"))
  845. }
  846. })
  847. },
  848. onConfirmCapital(data) {
  849. if (data.value == 2) {
  850. this.capitalExpenditureOpen = true;
  851. this.contractOpen = false
  852. this.infoForm = {};
  853. } else if (data.value == 4) {
  854. this.capitalExpenditureOpen = false;
  855. this.contractOpen = true
  856. this.projectForm = {};
  857. } else {
  858. this.capitalExpenditureOpen = false;
  859. this.contractOpen = false
  860. this.projectForm = {};
  861. this.infoForm = {};
  862. }
  863. this.capitalExpenditureType = data.text;
  864. this.form.capitalExpenditureType = data.value;
  865. this.showcapital = false;
  866. },
  867. onConfirmFundType(data) {
  868. this.projectForm.projectFundType = data.value;
  869. this.projectFundType = data.text;
  870. this.showFundType = false;
  871. },
  872. onConfirmProject(data) {
  873. this.projectList.map(res => {
  874. if (res.projectName == data.text) {
  875. this.projectForm.projectId = res.id
  876. this.projectForm.projectName = res.projectName
  877. this.projectForm.projectContractor = res.projectContractor
  878. this.projectForm.projectAmount = res.projectAmount
  879. }
  880. })
  881. this.showproject = false;
  882. },
  883. onConfirmContract(data) {
  884. this.infoList.map(res => {
  885. if (res.name == data.text) {
  886. this.infoForm.contractionId = res.id;
  887. this.infoForm.name = res.name;
  888. this.infoForm.code = res.code;
  889. this.infoForm.totalAmount = res.totalAmount;
  890. }
  891. })
  892. this.showcontract = false;
  893. },
  894. onConfirmPayee(data, index) {
  895. for (var i = 0; i < this.chargeItme.length; i++) {
  896. this.chargeItme[i].showPayee = false;
  897. }
  898. this.chargeItme[index].payee = data.text;
  899. this.chargeItme[index].payeeId = data.value;
  900. this.payeeSelectChange(data.value, index)
  901. },
  902. onConfirmBankType(data, index) {
  903. for (var i = 0; i < this.chargeItme.length; i++) {
  904. this.chargeItme[i].showbankType = false;
  905. }
  906. this.chargeItme[index].bankTypeText = data.text;
  907. this.chargeItme[index].bankType = data.value;
  908. this.chargeItme[index].showbankType = false;
  909. },
  910. onConfirmPayer(data) {
  911. this.form.payer = data.text;
  912. this.form.cashierId = data.value;
  913. this.showpayer = false;
  914. this.selectChange(data.value)
  915. },
  916. onConfirmLasj(data) {
  917. this.form.applyDate = this.getNowFormatDate(data).substr(0, 10);
  918. this.showlasj = false;
  919. },
  920. accountTypeChange(e) {
  921. this.payeeList = [];
  922. this.chargeItme = [];
  923. this.queryParams.accountType = this.form.accountType
  924. this.queryParams.isPeers = this.form.isPeers
  925. this.queryParams.bankType = this.form.bankType
  926. this.queryParams.status = "0"
  927. listPayee(this.queryParams).then((response) => {
  928. response.rows.map((res, index) => {
  929. if (res.payeeType == 1 || res.payeeType == 2) {
  930. response.rows[index].text = res.payee;
  931. response.rows[index].value = res.id;
  932. this.payeeList.push(res)
  933. }
  934. })
  935. });
  936. },
  937. accountTypeChange1(e) {
  938. this.payeeList = [];
  939. this.chargeItme = [];
  940. this.queryParams.accountType = this.form.accountType
  941. this.queryParams.isPeers = this.form.isPeers
  942. this.queryParams.bankType = this.form.bankType
  943. this.queryParams.status = "0"
  944. listPayee(this.queryParams).then((response) => {
  945. response.rows.map((res, index) => {
  946. if (res.payeeType == 1 || res.payeeType == 2) {
  947. response.rows[index].text = res.payee;
  948. response.rows[index].value = res.id;
  949. this.payeeList.push(res)
  950. }
  951. })
  952. });
  953. },
  954. // 钱计算
  955. moneyChange(input) {
  956. let obj = {};
  957. obj = this.chargeItme.find((account) => {
  958. //model就是上面的数据源
  959. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  960. });
  961. let total = 0;
  962. this.chargeItme.forEach((money) => {
  963. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  964. });
  965. this.$set(this.form, "expenditureAmount", total);
  966. },
  967. goAdd() {
  968. let _this = this
  969. if (this.chargeItme.length < 1) {
  970. this.$notify({type: 'danger', message: '请添加收款方信息'});
  971. return;
  972. }
  973. if (this.form.remark != null && this.form.remark.indexOf("|") != -1) {
  974. this.$notify({type: 'danger', message: '转账附言禁止包含!'});
  975. return;
  976. }
  977. if (this.form.capitalExpenditureType == 2) {
  978. if (this.projectForm.projectName == "" || this.projectForm.projectName == null) {
  979. this.$notify({type: 'danger', message: '请选择项目名称!'});
  980. return;
  981. }
  982. if (this.projectForm.projectBillNum == "" || this.projectForm.projectBillNum == null) {
  983. this.$notify({type: 'danger', message: '请输入工程发票号!'});
  984. return;
  985. }
  986. }
  987. if (this.form.capitalExpenditureType == 4) {
  988. if (this.infoForm.name == "" || this.infoForm.name == null) {
  989. this.$notify({type: 'danger', message: '请选择合同名称!'});
  990. return;
  991. }
  992. if (this.infoForm.code == "" || this.infoForm.code == null) {
  993. this.$notify({type: 'danger', message: '请输入合同编码!'});
  994. return;
  995. }
  996. if (this.infoForm.totalAmount == "" || this.infoForm.totalAmount == null) {
  997. this.$notify({type: 'danger', message: '请输入合同价款!'});
  998. return;
  999. }
  1000. }
  1001. if (
  1002. this.fileList1.length == 0 &&
  1003. this.fileList2.length == 0 &&
  1004. this.fileList3.length == 0) {
  1005. Dialog.confirm({
  1006. title: '提示',
  1007. message: '此申请单中未上传任何附件,是否确认提交?',
  1008. })
  1009. .then(() => {
  1010. this.saveRelease()
  1011. })
  1012. .catch(() => {
  1013. return false;
  1014. });
  1015. } else {
  1016. this.saveRelease()
  1017. }
  1018. },
  1019. saveRelease() {
  1020. let _this = this;
  1021. this.$set(this.form, "payeeList", this.chargeItme);
  1022. this.$set(this.form, "bankTypeList", this.chargeItme);
  1023. this.$set(this.form, "accountTypeList", this.chargeItme);
  1024. this.$set(this.form, "transferStatusList", this.chargeItme);
  1025. updateTransfer(this.form).then(response => {
  1026. this.projectForm.outId = this.form.id
  1027. this.infoForm.transferId = this.form.id
  1028. this.$set(this.projectForm, "ynType", '1');
  1029. if (this.form.capitalExpenditureType == 2) {
  1030. addProjectto(this.projectForm).then(res => {
  1031. offlineCustomSubmit(this.form.id).then(res => {
  1032. this.$toast.success('提交成功');
  1033. setTimeout(function () {
  1034. _this.$router.push('/yinnong/approvalList')
  1035. }, 1000)
  1036. })
  1037. })
  1038. } else if (this.form.capitalExpenditureType == 4) {
  1039. addInfoto(this.infoForm).then(res => {
  1040. offlineCustomSubmit(this.form.id).then(res => {
  1041. this.$toast.success('提交成功');
  1042. setTimeout(function () {
  1043. _this.$router.push('/yinnong/approvalList')
  1044. }, 1000)
  1045. })
  1046. })
  1047. } else {
  1048. offlineCustomSubmit(this.form.id).then(res => {
  1049. this.$toast.success('提交成功');
  1050. setTimeout(function () {
  1051. _this.$router.push('/yinnong/approvalList')
  1052. }, 1000)
  1053. })
  1054. }
  1055. });
  1056. },
  1057. goUpdate() {
  1058. let _this = this
  1059. if (this.chargeItme.length < 1) {
  1060. this.$notify({type: 'danger', message: '请添加收款方信息'});
  1061. return;
  1062. }
  1063. if (this.form.remark != null && this.form.remark.indexOf("|") != -1) {
  1064. this.$notify({type: 'danger', message: '转账附言禁止包含!'});
  1065. return;
  1066. }
  1067. if (this.form.capitalExpenditureType == 2) {
  1068. if (this.projectForm.projectName == "" || this.projectForm.projectName == null) {
  1069. this.$notify({type: 'danger', message: '请选择项目名称!'});
  1070. return;
  1071. }
  1072. if (this.projectForm.projectBillNum == "" || this.projectForm.projectBillNum == null) {
  1073. this.$notify({type: 'danger', message: '请输入工程发票号!'});
  1074. return;
  1075. }
  1076. }
  1077. if (this.form.capitalExpenditureType == 4) {
  1078. if (this.infoForm.name == "" || this.infoForm.name == null) {
  1079. this.$notify({type: 'danger', message: '请选择合同名称!'});
  1080. return;
  1081. }
  1082. if (this.infoForm.code == "" || this.infoForm.code == null) {
  1083. this.$notify({type: 'danger', message: '请输入合同编码!'});
  1084. return;
  1085. }
  1086. if (this.infoForm.totalAmount == "" || this.infoForm.totalAmount == null) {
  1087. this.$notify({type: 'danger', message: '请输入合同价款!'});
  1088. return;
  1089. }
  1090. }
  1091. this.$set(this.form, "payeeList", this.chargeItme);
  1092. this.$set(this.form, "bankTypeList", this.chargeItme);
  1093. this.$set(this.form, "accountTypeList", this.chargeItme);
  1094. this.$set(this.form, "transferStatusList", this.chargeItme);
  1095. updateTransfer(this.form).then(response => {
  1096. this.projectForm.outId = this.form.id
  1097. this.infoForm.transferId = this.form.id
  1098. this.$set(this.projectForm, "ynType", '1');
  1099. if (this.form.capitalExpenditureType == 2) {
  1100. addProjectto(this.projectForm).then(res => {
  1101. this.$toast.success('保存成功');
  1102. setTimeout(function () {
  1103. _this.$router.push('/yinnong/approvalList')
  1104. }, 1000)
  1105. })
  1106. } else if (this.form.capitalExpenditureType == 4) {
  1107. addInfoto(this.infoForm).then(res => {
  1108. this.$toast.success('保存成功');
  1109. setTimeout(function () {
  1110. _this.$router.push('/yinnong/approvalList')
  1111. }, 1000)
  1112. })
  1113. } else {
  1114. this.$toast.success('保存成功');
  1115. setTimeout(function () {
  1116. _this.$router.push('/yinnong/approvalList')
  1117. }, 1000)
  1118. }
  1119. });
  1120. },
  1121. payeeSelectChange(select, i) {
  1122. let obj = {};
  1123. let fuzhitype = 0;
  1124. let _this = this
  1125. obj = this.payeeList.find((account) => {
  1126. //model就是上面的数据源
  1127. return account.id === select; //筛选出匹配数据
  1128. });
  1129. if (this.chargeItme != [] && this.chargeItme.length > 1) {
  1130. this.chargeItme.some((value, index) => {
  1131. if (value.payeeAccount != undefined && value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount && index != i) {
  1132. fuzhitype = 2;
  1133. return true;
  1134. }
  1135. if (_this.form.isPeers != undefined && _this.form.isPeers != null && _this.form.isPeers == 'N') {
  1136. } else {
  1137. if (obj.bankType == 1 && value.accountType != undefined && value.accountType != '' && obj.accountType != value.accountType && index != i) {
  1138. fuzhitype = 1;
  1139. return true;
  1140. }
  1141. }
  1142. });
  1143. }
  1144. if (fuzhitype == 0) {
  1145. this.$set(this.chargeItme[i], "payee", obj.payee)
  1146. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1147. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1148. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1149. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1150. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1151. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  1152. _this.bankTypeDictionaries.map(rr => {
  1153. if (rr.value == obj.bankType) {
  1154. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  1155. }
  1156. })
  1157. } else if (fuzhitype == 1) {
  1158. this.$set(this.chargeItme[i], "payee", '')
  1159. this.$set(this.chargeItme[i], "bankType", '')
  1160. this.$set(this.chargeItme[i], "payeeId", '');
  1161. this.$set(this.chargeItme[i], "payeeAccount", '');
  1162. this.$set(this.chargeItme[i], "bankDeposit", '');
  1163. this.$set(this.chargeItme[i], "accountType", '');
  1164. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1165. this.$set(this.chargeItme[i], "bankTypeText", '');
  1166. this.$notify({type: 'danger', message: '请选择账户类型相同的收款方!'});
  1167. } else if (fuzhitype == 2) {
  1168. this.$set(this.chargeItme[i], "payee", '')
  1169. this.$set(this.chargeItme[i], "bankType", '')
  1170. this.$set(this.chargeItme[i], "payeeId", '');
  1171. this.$set(this.chargeItme[i], "payeeAccount", '');
  1172. this.$set(this.chargeItme[i], "bankDeposit", '');
  1173. this.$set(this.chargeItme[i], "accountType", '');
  1174. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1175. this.$set(this.chargeItme[i], "bankTypeText", '');
  1176. this.$notify({type: 'danger', message: '收款方已存在!'});
  1177. }
  1178. },
  1179. selectChange(select) {
  1180. let obj = {};
  1181. obj = this.payerOptions.find((account) => {
  1182. //model就是上面的数据源
  1183. return account.id === select; //筛选出匹配数据
  1184. });
  1185. if (obj.accountPassword != null && obj.accountPassword != "" &&
  1186. obj.bankType != null && obj.bankType != "") {
  1187. this.$set(this.form, "bookId", obj.bookId);
  1188. this.$set(this.form, "deptId", obj.deptId);
  1189. this.$set(this.form, "cashierId", obj.id);
  1190. this.$set(this.form, "payer", obj.accountName);
  1191. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1192. this.$set(this.form, "operatorCode", obj.operatorCode);
  1193. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1194. this.$set(this.form, "bankType", obj.bankType);
  1195. this.$set(this.form, "payerFrom", '1');
  1196. if (obj.bankType == 1) {
  1197. this.form.accountType = "1"
  1198. this.form.isPeers = null
  1199. this.accountTypeChange();
  1200. } else if (obj.bankType == 2 || obj.bankType == 3) {
  1201. this.form.accountType = null
  1202. this.form.isPeers = "Y"
  1203. this.accountTypeChange1();
  1204. }
  1205. } else {
  1206. if (obj.payerFrom == 1) {
  1207. this.diglogStatus = false;
  1208. this.$notify({type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!"});
  1209. this.$set(this.form, "payer", "")
  1210. this.$set(this.form, "payerAccount", "")
  1211. } else {
  1212. this.$set(this.form, "payerFrom", obj.parerFrom);
  1213. if (obj.operatorCode != null && obj.operatorCode != '') {
  1214. this.$set(this.form, "operatorCode", obj.operatorCode);
  1215. } else {
  1216. this.$set(this.form, "operatorCode", '');
  1217. }
  1218. if (obj.enterpriseCode != null && obj.enterpriseCode != '') {
  1219. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1220. } else {
  1221. this.$set(this.form, "enterpriseCode", '');
  1222. }
  1223. if (obj.accountPassword != null && obj.accountPassword != '') {
  1224. this.$set(this.form, "accountPassword", obj.accountPassword);
  1225. } else {
  1226. this.$set(this.form, "accountPassword", '');
  1227. }
  1228. this.$set(this.form, "bookId", '');
  1229. this.$set(this.form, "deptId", '');
  1230. this.$set(this.form, "cashierId", obj.id);
  1231. this.$set(this.form, "payer", obj.accountName);
  1232. if (obj.payerFrom == 6) {
  1233. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1234. this.$set(this.form, "payerAccount", response.data);
  1235. });
  1236. } else {
  1237. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1238. }
  1239. }
  1240. }
  1241. },
  1242. beforeRead(obj) {
  1243. return (file) => {
  1244. let params1 = new FormData();
  1245. params1.append("tableId", this.form.id);
  1246. params1.append("tableName", "t_yinnong_transfer");
  1247. params1.append("bizPath", "transfer");
  1248. params1.append("fileType", obj);
  1249. params1.append("file", file.file);
  1250. commonAttach(params1).then((r1) => {
  1251. file.id = r1.id;
  1252. file.fileUrl = r1.fileUrl;
  1253. let subIndex = r1.fileUrl.lastIndexOf(".");
  1254. let ext = r1.fileUrl.substring(subIndex + 1, r1.fileUrl.length);
  1255. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL;
  1256. let fileData = {"url": baseUrl + r1.fileUrl, "file": new File([], "name", {}), "id": r1.id,"type":ext};
  1257. if(obj === '1'){
  1258. this.fileList1.splice(-1, 1);
  1259. this.fileList1.push(fileData);
  1260. }else if(obj === '2'){
  1261. this.fileList2.splice(-1, 1);
  1262. this.fileList2.push(fileData);
  1263. }else{
  1264. this.fileList3.splice(-1, 1);
  1265. this.fileList3.push(fileData);
  1266. }
  1267. })
  1268. }
  1269. },
  1270. deleteFile(file) {
  1271. systemAttachment(file.id).then((res) => {
  1272. });
  1273. },
  1274. getFileList() {
  1275. let oData1 = {
  1276. tableId: this.$route.query.id,
  1277. tableName: "t_yinnong_transfer",
  1278. bizPath: "transfer",
  1279. fileType: "1",
  1280. }
  1281. attachmentList(oData1).then(res => {
  1282. let arr = [];
  1283. res.rows.map(r => {
  1284. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL;
  1285. let subIndex = r.fileName.lastIndexOf(".");
  1286. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1287. arr.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1288. })
  1289. this.fileList1 = arr;
  1290. this.$forceUpdate()
  1291. })
  1292. let oData2 = {
  1293. tableId: this.$route.query.id,
  1294. tableName: "t_yinnong_transfer",
  1295. bizPath: "transfer",
  1296. fileType: "2",
  1297. }
  1298. attachmentList(oData2).then(res => {
  1299. let arr = [];
  1300. res.rows.map(r => {
  1301. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL
  1302. let subIndex = r.fileName.lastIndexOf(".");
  1303. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1304. arr.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1305. })
  1306. this.fileList2 = arr;
  1307. this.$forceUpdate()
  1308. })
  1309. let oData3 = {
  1310. tableId: this.$route.query.id,
  1311. tableName: "t_yinnong_transfer",
  1312. bizPath: "transfer",
  1313. fileType: "3",
  1314. }
  1315. attachmentList(oData3).then(res => {
  1316. let arr = [];
  1317. res.rows.map(r => {
  1318. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL
  1319. let subIndex = r.fileName.lastIndexOf(".");
  1320. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1321. arr.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1322. })
  1323. this.fileList3 = arr;
  1324. this.$forceUpdate()
  1325. })
  1326. },
  1327. goBack() {
  1328. this.$router.push({path: '/yinnong/approvalList'})
  1329. },
  1330. //删除家庭成员
  1331. deleteChargeItme(index) {
  1332. this.chargeItme.splice(index, 1)
  1333. },
  1334. },
  1335. watch: {
  1336. $route(to, from) {
  1337. // 监听路由变化, 实现类似 小程序的 onShow 事件
  1338. if (to.path === '/yinnong/approvalModify') {
  1339. // do anything you want
  1340. if (this.$route.params.payeeForm) {
  1341. this.chargeItme.push(this.$route.params.payeeForm)
  1342. }
  1343. }
  1344. }
  1345. },
  1346. }
  1347. </script>
  1348. <style scoped lang="scss">
  1349. .app-container {
  1350. padding: 2% 0;
  1351. }
  1352. .main_title_box {
  1353. display: flex;
  1354. justify-content: space-between;
  1355. align-items: center;
  1356. }
  1357. .main_title {
  1358. font-size: 0.4rem;
  1359. color: #1D6FE9;
  1360. margin: 0.2rem 6%;
  1361. position: relative;
  1362. /*a{*/
  1363. /* background: #1989fa;*/
  1364. /* color: #ffffff;*/
  1365. /* padding: 0.05rem 0.3rem;*/
  1366. /* border-radius: 5PX;*/
  1367. /*}*/
  1368. }
  1369. .main_box {
  1370. width: 96%;
  1371. margin: 0 auto;
  1372. border-radius: 6px;
  1373. box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
  1374. overflow: hidden;
  1375. background-color: #FFF;
  1376. }
  1377. .submitButton {
  1378. width: 80%;
  1379. margin: 0 auto;
  1380. background-color: #1D6FE9;
  1381. }
  1382. .addFamily {
  1383. position: absolute;
  1384. top: -2px;
  1385. right: 0;
  1386. border-radius: 50%;
  1387. }
  1388. .deleteFamily {
  1389. position: absolute;
  1390. top: 0rem;
  1391. right: 6%;
  1392. z-index: 9;
  1393. border-radius: 50%;
  1394. }
  1395. </style>