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

approvalModify.vue 44 KiB

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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. </van-nav-bar>
  13. <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  14. <p class="main_title">基础信息</p>
  15. <div class="main_box">
  16. <van-field
  17. readonly
  18. clickable
  19. required
  20. :rules="[{ required: true , message:'请选择申请时间' }]"
  21. v-model="form.applyDate"
  22. label="申请时间"
  23. placeholder="请选择申请时间"
  24. @click="showlasj = true"
  25. input-align="right"
  26. right-icon="arrow-down"
  27. />
  28. <van-popup v-model="showlasj" position="bottom">
  29. <van-datetime-picker
  30. v-model="currentDate"
  31. type="date"
  32. title="选择年月日"
  33. :min-date="minDate"
  34. :max-date="maxDate"
  35. @confirm="onConfirmLasj"
  36. @cancel="showlasj = false"
  37. />
  38. </van-popup>
  39. <van-field
  40. readonly
  41. clickable
  42. required
  43. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  44. label="资金支出类别"
  45. placeholder="请选择"
  46. v-model="capitalExpenditureType"
  47. @click="showcapital = true"
  48. input-align="right"
  49. right-icon="arrow-down"
  50. label-width="auto"
  51. />
  52. <van-popup v-model="showcapital" position="bottom">
  53. <van-picker
  54. show-toolbar
  55. :columns="capitalExpenditureTypeOptions"
  56. @confirm="onConfirmCapital"
  57. @cancel="showcapital = false"
  58. />
  59. </van-popup>
  60. <van-field
  61. readonly
  62. required
  63. label="支出总金额"
  64. v-model="form.expenditureAmount"
  65. placeholder="根据下方收款金额自动核算"
  66. input-align="right"
  67. label-width="auto"
  68. />
  69. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  70. :rules="[{ required: true , message:'请选择审批模式' }]">
  71. <template #input>
  72. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  73. <van-radio name="1">线上支付</van-radio>
  74. <van-radio name="2">线下支付</van-radio>
  75. </van-radio-group>
  76. </template>
  77. </van-field>
  78. </div>
  79. <div class="main_box" style="margin-top: 10px;">
  80. <van-field
  81. label="付款事由"
  82. v-model="form.remark"
  83. type="textarea"
  84. placeholder="请输入付款事由"
  85. input-align="right"
  86. rows="3"
  87. label-width="auto"
  88. required
  89. :rules="[{ required: true , message:'请输入付款事由' }]"
  90. />
  91. </div>
  92. <div class="main_box" style="margin-top: 10px;">
  93. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  94. </div>
  95. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  96. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  97. <van-field
  98. readonly
  99. clickable
  100. label="项目名称"
  101. placeholder="请选择"
  102. v-model="projectForm.projectName"
  103. @click="showproject = true"
  104. input-align="right"
  105. right-icon="arrow-down"
  106. required
  107. :rules="[{ required: true , message:'请选择项目名称' }]"
  108. />
  109. <van-popup v-model="showproject" position="bottom">
  110. <van-picker
  111. show-toolbar
  112. :columns="projectList"
  113. @confirm="onConfirmProject"
  114. @cancel="showproject = false"
  115. />
  116. </van-popup>
  117. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  118. <van-field required :rules="[{ required: true , message:'请输入合同价款(元)' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  119. <van-field
  120. readonly
  121. clickable
  122. label="工程款类型"
  123. placeholder="请选择"
  124. v-model="projectFundType"
  125. @click="showFundType = true"
  126. input-align="right"
  127. right-icon="arrow-down"
  128. required
  129. :rules="[{ required: true , message:'请选择工程款类型' }]"
  130. />
  131. <van-popup v-model="showFundType" position="bottom">
  132. <van-picker
  133. show-toolbar
  134. :columns="projectFundTypeOptions"
  135. @confirm="onConfirmFundType"
  136. @cancel="showFundType = false"
  137. />
  138. </van-popup>
  139. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  140. </div>
  141. <p class="main_title" v-if="contractOpen">关联合同</p>
  142. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  143. <van-field
  144. readonly
  145. clickable
  146. label="合同"
  147. placeholder="请选择"
  148. v-model="infoForm.name"
  149. @click="showcontract = true"
  150. input-align="right"
  151. right-icon="arrow-down"
  152. required
  153. :rules="[{ required: true , message:'请选择项目名称' }]"
  154. />
  155. <van-popup v-model="showcontract" position="bottom">
  156. <van-picker
  157. show-toolbar
  158. :columns="infoList"
  159. @confirm="onConfirmContract"
  160. @cancel="showcontract = false"
  161. />
  162. </van-popup>
  163. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  164. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  165. </div>
  166. <p class="main_title">付款方信息</p>
  167. <div class="main_box">
  168. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  169. <van-field
  170. readonly
  171. clickable
  172. label="付款方"
  173. placeholder="请选择付款方"
  174. v-model="form.payer"
  175. @click="showpayer = true"
  176. input-align="right"
  177. right-icon="arrow-down"
  178. label-width="auto"
  179. required
  180. :rules="[{ required: true , message:'请选择付款方' }]"
  181. />
  182. <van-popup v-model="showpayer" position="bottom">
  183. <van-picker
  184. show-toolbar
  185. :columns="payerOptions"
  186. @confirm="onConfirmPayer($event)"
  187. @cancel="showpayer = false"
  188. />
  189. </van-popup>
  190. <van-field :rules="[{ required: true , message:'请输入账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  191. </div>
  192. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  193. <div class="main_box" style="margin-bottom: 15px;">
  194. <van-cell title="收款账户类型" v-if="form.bankType==1">
  195. <template #right-icon>
  196. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange" >
  197. <van-radio name="1">公户</van-radio>
  198. <van-radio name="2">私户</van-radio>
  199. </van-radio-group>
  200. </template>
  201. </van-cell>
  202. <van-cell title="是否与付款方同行" v-if="form.bankType==2||form.bankType==3||form.bankType==4" >
  203. <template #right-icon>
  204. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  205. <van-radio name="Y">是</van-radio>
  206. <van-radio name="N">否</van-radio>
  207. </van-radio-group>
  208. </template>
  209. </van-cell>
  210. </div>
  211. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  212. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  213. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  214. <van-field
  215. readonly
  216. clickable
  217. label="收款方"
  218. placeholder="请选择"
  219. v-model="item.payee"
  220. @click="item.showPayee = true"
  221. input-align="right"
  222. right-icon="arrow-down"
  223. required
  224. :rules="[{ required: true , message:'请选择收款方' }]"
  225. />
  226. <van-popup v-model="item.showPayee" position="bottom">
  227. <van-picker
  228. show-toolbar
  229. :columns="payeeList"
  230. @confirm="onConfirmPayee($event,index)"
  231. @cancel="item.showPayee = false"
  232. />
  233. </van-popup>
  234. <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  235. <van-field required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  236. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  237. <van-field
  238. readonly
  239. clickable
  240. label="所属银行"
  241. placeholder="请选择"
  242. v-model="item.bankTypeText"
  243. input-align="right"
  244. required
  245. :rules="[{ required: true , message:'请选择所属银行' }]"
  246. />
  247. <van-popup v-model="item.showbankType" position="bottom">
  248. <van-picker
  249. show-toolbar
  250. :columns="bankTypeDictionaries"
  251. @confirm="onConfirmBankType($event,index)"
  252. @cancel="item.showbankType = false"
  253. />
  254. </van-popup>
  255. </div>
  256. </div>
  257. <p class="main_title">上传附件</p>
  258. <div class="main_box" style="padding: 5px 0 0 8px;">
  259. <van-uploader v-model="fileList" :after-read="beforeRead" @delete="deleteFile"></van-uploader>
  260. </div>
  261. <div style="padding: 16px 0;">
  262. <van-row>
  263. <van-col span="12" align="center">
  264. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  265. </van-col>
  266. <van-col span="12" align="center">
  267. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  268. </van-col>
  269. </van-row>
  270. <div class="clear"></div>
  271. </div>
  272. </van-form>
  273. </div>
  274. </template>
  275. <script>
  276. import { getAccount , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit ,getQmyeFlow ,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  277. import {
  278. attachmentList,
  279. commonAttach,
  280. systemAttachment
  281. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  282. import request from '@/utils/request';
  283. import Dialog from "vant/lib/dialog";
  284. export default {
  285. name: "approvalModify",
  286. data() {
  287. return {
  288. showcontract:false,
  289. showcapital:false,
  290. showpayee:false,
  291. showlasj:false,
  292. showbankType:false,
  293. showproject:false,
  294. showFundType:false,
  295. showpayer:false,
  296. minDate: new Date(2000, 1, 1),
  297. maxDate: new Date(2050, 12, 31),
  298. currentDate: new Date(),
  299. form:{},
  300. capitalExpenditureType:'',
  301. payee:'',
  302. bankType:'',
  303. buttonType:'a',
  304. wfydlxDictionaries:[],
  305. jglxDictionaries:[],
  306. sysDictionaries:[],
  307. capitalExpenditureTypeOptions:[],
  308. bankTypeDictionaries:[],
  309. infoList:[],
  310. projectList:[],
  311. projectFundTypeOptions:[],
  312. projectFundTypeDictionaries:[],
  313. payerOptions:[],
  314. chargeItme:[],
  315. chargeItmeShow:[],
  316. payeeList:[],
  317. // 查询参数
  318. queryParams: {
  319. transferType:"",
  320. orderByColumn: "id",
  321. isAsc: "desc",
  322. },
  323. capitalExpenditureOpen:false,
  324. contractOpen:false,
  325. projectForm:{
  326. projectId:null,
  327. projectName:null,
  328. projectContractor:null,
  329. projectAmount:null,
  330. projectBillNum:null,
  331. projectFundType:'1',
  332. outId:null,
  333. ynType:'1'
  334. },
  335. infoForm:{
  336. infoId:null,
  337. name:null,
  338. code:null,
  339. totalAmount:null,
  340. contractionId:null,
  341. transferId:null
  342. },
  343. // 合同信息查询参数
  344. queryContractionParams: {
  345. pageNum: 1,
  346. pageSize: 100,
  347. contractionStatus: '1',
  348. orderByColumn: "endTime",
  349. isAsc: "desc",
  350. },
  351. projectFundType:'',
  352. fileList:[],
  353. uploadFiles:[],
  354. };
  355. },
  356. created() {
  357. let queryParams={
  358. pageNum: 1,
  359. pageSize: 100,
  360. }
  361. listProject(queryParams).then(response => {
  362. this.projectList = response.rows;
  363. for (let i = 0; i < response.rows.length; i++) {
  364. this.$set(this.projectList[i],"text",response.rows[i].projectName)
  365. this.$set(this.projectList[i],"value",response.rows[i].id)
  366. }
  367. });
  368. listInfo(this.queryContractionParams).then(response => {
  369. this.infoList = response.rows;
  370. for (let i = 0; i < response.rows.length; i++) {
  371. this.$set(this.infoList[i],"text",response.rows[i].name)
  372. this.$set(this.infoList[i],"value",response.rows[i].code)
  373. }
  374. });
  375. this.getDicts("project_fund_type").then((response) => {
  376. for (var i = 0; i < response.data.length; i++) {
  377. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  378. }
  379. this.projectFundTypeDictionaries = response.data;
  380. });
  381. let params1={
  382. accountType: "102",
  383. "params":{townAccountType:'0'},
  384. status: "N",
  385. }
  386. getAccount(params1).then((response) => {
  387. this.payerOptions = response.rows;
  388. response.rows.map((res,index) => {
  389. res['payerFrom'] = '1'
  390. this.payerOptions[index].text = res.accountName;
  391. this.payerOptions[index].value = res.id;
  392. })
  393. });
  394. this.getDictionaries();
  395. this.getFileList();
  396. },
  397. methods: {
  398. getDictionaries(){
  399. getTransfer(this.$route.query.id).then((response) => {
  400. this.getDicts("capital_expenditure_type").then((res) => {
  401. for (var i = 0; i < res.data.length; i++) {
  402. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  403. }
  404. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  405. });
  406. if(response.data.capitalExpenditureType==2){
  407. this.capitalExpenditureOpen = true
  408. let param={
  409. 'outId' : response.data.id,
  410. 'ynType' : '1'
  411. }
  412. getProjectto(param).then(res => {
  413. console.log(this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType))
  414. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  415. this.projectForm = res.data
  416. console.log(res.data)
  417. })
  418. }else if(response.data.capitalExpenditureType==4){
  419. this.contractOpen = true
  420. let param={
  421. 'transferId' : response.data.id
  422. }
  423. getInfoto(param).then(res => {
  424. this.infoForm = res.data
  425. })
  426. }else{
  427. this.showproject = false
  428. }
  429. this.form = response.data;
  430. this.getPayeeList();
  431. });
  432. queryTransferDetail(this.$route.query.id).then((response) => {
  433. this.getDicts("bank_type").then(res => {
  434. for (var i = 0; i < res.data.length; i++) {
  435. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  436. }
  437. for (var j = 0 ; j < response.rows.length ; j++){
  438. // response.rows[j].payeeText = response.rows[j].payee;
  439. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  440. response.rows[j].showPayee = false;
  441. }
  442. this.chargeItme = response.rows;
  443. console.log(this.chargeItme)
  444. });
  445. });
  446. },
  447. getChange(){
  448. if(this.buttonType == 'update'){
  449. this.goUpdate();
  450. }else if(this.buttonType == 'add'){
  451. this.goAdd();
  452. }
  453. },
  454. getError(e){
  455. this.$notify({ type: 'danger', message: e.errors[0].message });
  456. },
  457. addChargeItme(index){
  458. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  459. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  460. return;
  461. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  462. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  463. return;
  464. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  465. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  466. return;
  467. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  468. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  469. return;
  470. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  471. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  472. return;
  473. }
  474. if(this.form.bankType == '2' && this.form.isPeers == 'N' && this.chargeItme.length>1){
  475. this.$notify({ type: 'danger', message: '目前农商行仅支持单笔跨行转账,即仅能有一个收款方!' });
  476. }else{
  477. this.getDicts("bank_type").then(res => {
  478. this.chargeItme.splice(index + 1, 0, {
  479. payeeId: "", //收款方ID
  480. payee: "", //收款方
  481. payeeAccount: "", //收款账户
  482. bankDeposit: "", //开户银行
  483. incomeAmount: "", //收入金额
  484. bankType: null, //所属银行
  485. bankTypeText:"", //所属银行
  486. showPayee:false,
  487. showbankType:false
  488. });
  489. });}
  490. },
  491. getPayeeList() {
  492. //普通转账
  493. this.queryParams.isPeers = this.form.isPeers?this.form.isPeers:null
  494. this.queryParams.accountType = this.form.accountType?this.form.accountType:null
  495. this.queryParams.bankType = this.form.bankType
  496. this.queryParams.status = "0"
  497. listPayee(this.queryParams).then((response) => {
  498. response.rows.map((res,index) => {
  499. if(res.payeeType==1||res.payeeType==2){
  500. res.text = res.payee;
  501. res.value = res.id;
  502. this.payeeList.push(res)
  503. }
  504. })
  505. });
  506. },
  507. payeeDictLabel(datas, value) {
  508. var actions = [];
  509. Object.keys(datas).some((key) => {
  510. if (datas[key].payeeId == ('' + value)) {
  511. actions.push(datas[key].payee);
  512. return true;
  513. }
  514. })
  515. return actions.join('');
  516. },
  517. onConfirmCapital(data){
  518. if (data.value == 2){
  519. this.capitalExpenditureOpen = true;
  520. this.contractOpen = false
  521. this.infoForm = {};
  522. }else if(data.value == 4){
  523. this.capitalExpenditureOpen = false;
  524. this.contractOpen = true
  525. this.projectForm = {};
  526. }else{
  527. this.capitalExpenditureOpen = false;
  528. this.contractOpen = false
  529. this.projectForm = {};
  530. this.infoForm = {};
  531. }
  532. this.capitalExpenditureType = data.text;
  533. this.form.capitalExpenditureType = data.value;
  534. this.showcapital = false;
  535. },
  536. onConfirmFundType(data){
  537. console.log(data)
  538. this.projectForm.projectFundType = data.value;
  539. this.projectFundType = data.text;
  540. this.showFundType = false;
  541. },
  542. onConfirmProject(data){
  543. this.projectList.map(res => {
  544. if(res.projectName==data.text){
  545. this.projectForm.projectId = res.id
  546. this.projectForm.projectName = res.projectName
  547. this.projectForm.projectContractor = res.projectContractor
  548. this.projectForm.projectAmount = res.projectAmount
  549. }
  550. })
  551. this.showproject = false;
  552. },
  553. onConfirmContract(data){
  554. this.infoList.map(res => {
  555. if(res.name==data.text){
  556. this.infoForm.contractionId = res.id;
  557. this.infoForm.name = res.name;
  558. this.infoForm.code = res.code;
  559. this.infoForm.totalAmount = res.totalAmount;
  560. }
  561. })
  562. this.showcontract = false;
  563. },
  564. onConfirmPayee(data,index){
  565. console.log(data)
  566. for (var i = 0 ; i < this.chargeItme.length ; i++){
  567. this.chargeItme[i].showPayee = false;
  568. }
  569. this.chargeItme[index].payee = data.text;
  570. this.chargeItme[index].payeeId = data.value;
  571. this.payeeSelectChange(data.value , index)
  572. },
  573. onConfirmBankType(data,index){
  574. for (var i = 0 ; i < this.chargeItme.length ; i++){
  575. this.chargeItme[i].showbankType = false;
  576. }
  577. this.chargeItme[index].bankTypeText = data.text;
  578. this.chargeItme[index].bankType = data.value;
  579. this.chargeItme[index].showbankType = false;
  580. },
  581. onConfirmPayer(data){
  582. this.form.payer = data.text;
  583. this.form.cashierId = data.value;
  584. this.showpayer = false;
  585. this.selectChange(data.value)
  586. },
  587. onConfirmLasj(data){
  588. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  589. this.showlasj = false;
  590. },
  591. accountTypeChange(e){
  592. this.payeeList = [];
  593. this.chargeItme = [];
  594. this.queryParams.accountType = this.form.accountType
  595. this.queryParams.isPeers = this.form.isPeers
  596. this.queryParams.bankType = this.form.bankType
  597. this.queryParams.status = "0"
  598. listPayee(this.queryParams).then((response) => {
  599. response.rows.map((res,index) => {
  600. if(res.payeeType==1||res.payeeType==2){
  601. response.rows[index].text = res.payee;
  602. response.rows[index].value = res.id;
  603. this.payeeList.push(res)
  604. }
  605. })
  606. });
  607. },
  608. accountTypeChange1(e){
  609. this.payeeList = [];
  610. this.chargeItme = [];
  611. this.queryParams.accountType = this.form.accountType
  612. this.queryParams.isPeers = this.form.isPeers
  613. this.queryParams.bankType = this.form.bankType
  614. this.queryParams.status = "0"
  615. listPayee(this.queryParams).then((response) => {
  616. response.rows.map((res,index) => {
  617. if(res.payeeType==1||res.payeeType==2){
  618. response.rows[index].text = res.payee;
  619. response.rows[index].value = res.id;
  620. this.payeeList.push(res)
  621. }
  622. })
  623. });
  624. },
  625. // 钱计算
  626. moneyChange(input) {
  627. console.log(input)
  628. let obj = {};
  629. obj = this.chargeItme.find((account) => {
  630. //model就是上面的数据源
  631. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  632. });
  633. let total = 0;
  634. this.chargeItme.forEach((money) => {
  635. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  636. });
  637. this.$set(this.form, "expenditureAmount", total);
  638. },
  639. goAdd(){
  640. if(this.chargeItme.length<1){
  641. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  642. return;
  643. }
  644. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  645. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  646. return;
  647. }
  648. if(this.form.capitalExpenditureType==2){
  649. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  650. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  651. return;
  652. }
  653. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  654. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  655. return;
  656. }
  657. }
  658. if(this.form.capitalExpenditureType==4){
  659. if(this.infoForm.name==""||this.infoForm.name==null){
  660. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  661. return;
  662. }
  663. if(this.infoForm.code==""||this.infoForm.code==null){
  664. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  665. return;
  666. }
  667. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  668. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  669. return;
  670. }
  671. }
  672. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  673. Dialog.confirm({
  674. title: '提示',
  675. message: '此申请单中未上传任何附件,是否确认提交?',
  676. })
  677. .then(() => {
  678. this.$set(this.form, "payeeList", this.chargeItme);
  679. this.$set(this.form, "bankTypeList", this.chargeItme);
  680. this.$set(this.form, "accountTypeList", this.chargeItme);
  681. this.$set(this.form, "transferStatusList", this.chargeItme);
  682. updateTransfer(this.form).then(response => {
  683. this.projectForm.outId = this.form.id
  684. this.infoForm.transferId = this.form.id
  685. this.$set(this.projectForm, "ynType", '1');
  686. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  687. this.uploadFiles.map(rr => {
  688. const params = new FormData();
  689. params.append("tableId", this.form.id);
  690. params.append("tableName", "t_yinnong_transfer");
  691. params.append("bizPath", "upload");
  692. params.append("fileType", "0");
  693. params.append("file", rr);
  694. commonAttach(params).then((r) => {
  695. })
  696. })
  697. if(this.form.capitalExpenditureType==2){
  698. addProjectto(this.projectForm).then(res => {
  699. customSubmit(this.form.id).then(res => {
  700. this.$toast.success('提交成功');
  701. setTimeout(function(){
  702. history.go(-1)
  703. },2000)
  704. })
  705. })
  706. }else if(this.form.capitalExpenditureType==4){
  707. addInfoto(this.infoForm).then(res => {
  708. customSubmit(this.form.id).then(res => {
  709. this.$toast.success('提交成功');
  710. setTimeout(function(){
  711. history.go(-1)
  712. },2000)
  713. })
  714. })
  715. }else{
  716. customSubmit(this.form.id).then(res => {
  717. this.$toast.success('提交成功');
  718. setTimeout(function(){
  719. history.go(-1)
  720. },2000)
  721. })
  722. }
  723. }else{
  724. if(this.form.capitalExpenditureType==2){
  725. addProjectto(this.projectForm).then(res => {
  726. customSubmit(this.form.id).then(res => {
  727. this.$toast.success('提交成功');
  728. setTimeout(function(){
  729. history.go(-1)
  730. },2000)
  731. })
  732. })
  733. }else if(this.form.capitalExpenditureType==4){
  734. addInfoto(this.infoForm).then(res => {
  735. customSubmit(this.form.id).then(res => {
  736. this.$toast.success('提交成功');
  737. setTimeout(function(){
  738. history.go(-1)
  739. },2000)
  740. })
  741. })
  742. }else{
  743. customSubmit(this.form.id).then(res => {
  744. this.$toast.success('提交成功');
  745. setTimeout(function(){
  746. history.go(-1)
  747. },2000)
  748. })
  749. }
  750. }
  751. });
  752. })
  753. .catch(() => {
  754. return false;
  755. });
  756. }else{
  757. this.$set(this.form, "payeeList", this.chargeItme);
  758. this.$set(this.form, "bankTypeList", this.chargeItme);
  759. this.$set(this.form, "accountTypeList", this.chargeItme);
  760. this.$set(this.form, "transferStatusList", this.chargeItme);
  761. updateTransfer(this.form).then(response => {
  762. this.projectForm.outId = this.form.id
  763. this.infoForm.transferId = this.form.id
  764. this.$set(this.projectForm, "ynType", '1');
  765. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  766. this.uploadFiles.map(rr => {
  767. const params = new FormData();
  768. params.append("tableId", this.form.id);
  769. params.append("tableName", "t_yinnong_transfer");
  770. params.append("bizPath", "upload");
  771. params.append("fileType", "0");
  772. params.append("file", rr);
  773. commonAttach(params).then((r) => {
  774. })
  775. })
  776. if(this.form.capitalExpenditureType==2){
  777. addProjectto(this.projectForm).then(res => {
  778. customSubmit(this.form.id).then(res => {
  779. this.$toast.success('提交成功');
  780. setTimeout(function(){
  781. history.go(-1)
  782. },2000)
  783. })
  784. })
  785. } else if(this.form.capitalExpenditureType==4){
  786. addInfoto(this.infoForm).then(res => {
  787. customSubmit(this.form.id).then(res => {
  788. this.$toast.success('提交成功');
  789. setTimeout(function(){
  790. history.go(-1)
  791. },2000)
  792. })
  793. })
  794. }else{
  795. customSubmit(this.form.id).then(res => {
  796. this.$toast.success('提交成功');
  797. setTimeout(function(){
  798. history.go(-1)
  799. },2000)
  800. })
  801. }
  802. }else{
  803. if(this.form.capitalExpenditureType==2){
  804. addProjectto(this.projectForm).then(res => {
  805. customSubmit(this.form.id).then(res => {
  806. this.$toast.success('提交成功');
  807. setTimeout(function(){
  808. history.go(-1)
  809. },2000)
  810. })
  811. })
  812. } else if(this.form.capitalExpenditureType==4){
  813. addInfoto(this.infoForm).then(res => {
  814. customSubmit(this.form.id).then(res => {
  815. this.$toast.success('提交成功');
  816. setTimeout(function(){
  817. history.go(-1)
  818. },2000)
  819. })
  820. })
  821. }else{
  822. customSubmit(this.form.id).then(res => {
  823. this.$toast.success('提交成功');
  824. setTimeout(function(){
  825. history.go(-1)
  826. },2000)
  827. })
  828. }
  829. }
  830. });
  831. }
  832. },
  833. goUpdate(){
  834. if(this.chargeItme.length<1){
  835. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  836. return;
  837. }
  838. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  839. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  840. return;
  841. }
  842. if(this.form.capitalExpenditureType==2){
  843. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  844. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  845. return;
  846. }
  847. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  848. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  849. return;
  850. }
  851. }
  852. if(this.form.capitalExpenditureType==4){
  853. if(this.infoForm.name==""||this.infoForm.name==null){
  854. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  855. return;
  856. }
  857. if(this.infoForm.code==""||this.infoForm.code==null){
  858. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  859. return;
  860. }
  861. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  862. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  863. return;
  864. }
  865. }
  866. this.$set(this.form, "payeeList", this.chargeItme);
  867. this.$set(this.form, "bankTypeList", this.chargeItme);
  868. this.$set(this.form, "accountTypeList", this.chargeItme);
  869. this.$set(this.form, "transferStatusList", this.chargeItme);
  870. updateTransfer(this.form).then((response) => {
  871. this.projectForm.outId = this.form.id
  872. this.infoForm.transferId = this.form.id
  873. this.$set(this.projectForm, "ynType", '1');
  874. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  875. this.uploadFiles.map(rr => {
  876. const params = new FormData();
  877. params.append("tableId", this.form.id);
  878. params.append("tableName", "t_yinnong_transfer");
  879. params.append("bizPath", "upload");
  880. params.append("fileType", "0");
  881. params.append("file", rr);
  882. commonAttach(params).then((r) => {
  883. })
  884. })
  885. if(this.form.capitalExpenditureType==2){
  886. addProjectto(this.projectForm).then(res => {
  887. this.$toast.success('保存成功');
  888. setTimeout(function(){
  889. history.go(-1)
  890. },2000)
  891. })
  892. }else if(this.form.capitalExpenditureType==4){
  893. addInfoto(this.infoForm).then(res => {
  894. this.$toast.success('保存成功');
  895. setTimeout(function(){
  896. history.go(-1)
  897. },2000)
  898. })
  899. }else{
  900. this.$toast.success('保存成功');
  901. setTimeout(function(){
  902. history.go(-1)
  903. },2000)
  904. }
  905. }else{
  906. if(this.form.capitalExpenditureType==2){
  907. addProjectto(this.projectForm).then(res => {
  908. this.$toast.success('保存成功');
  909. setTimeout(function(){
  910. history.go(-1)
  911. },2000)
  912. })
  913. }else if(this.form.capitalExpenditureType==4){
  914. addInfoto(this.infoForm).then(res => {
  915. this.$toast.success('保存成功');
  916. setTimeout(function(){
  917. history.go(-1)
  918. },2000)
  919. })
  920. }else{
  921. this.$toast.success('保存成功');
  922. setTimeout(function(){
  923. history.go(-1)
  924. },2000)
  925. }
  926. }
  927. });
  928. },
  929. payeeSelectChange(select, i) {
  930. let obj = {};
  931. let fuzhitype = 0;
  932. let _this = this
  933. obj = this.payeeList.find((account) => {
  934. //model就是上面的数据源
  935. return account.id === select ; //筛选出匹配数据
  936. });
  937. if(this.chargeItme != [] && this.chargeItme.length>1){
  938. this.chargeItme.some((value, index) => {
  939. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  940. fuzhitype = 2;
  941. return true;
  942. }
  943. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  944. }else{
  945. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  946. fuzhitype = 1;
  947. return true;
  948. }
  949. }
  950. });
  951. }
  952. if(fuzhitype == 0){
  953. this.$set(this.chargeItme[i], "payee",obj.payee)
  954. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  955. this.$set(this.chargeItme[i], "payeeId", obj.id);
  956. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  957. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  958. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  959. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  960. _this.bankTypeDictionaries.map(rr => {
  961. if(rr.value==obj.bankType){
  962. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  963. }
  964. })
  965. }else if(fuzhitype == 1){
  966. this.$set(this.chargeItme[i], "payee",'')
  967. this.$set(this.chargeItme[i], "bankType",'')
  968. this.$set(this.chargeItme[i], "payeeId", '');
  969. this.$set(this.chargeItme[i], "payeeAccount", '');
  970. this.$set(this.chargeItme[i], "bankDeposit", '');
  971. this.$set(this.chargeItme[i], "accountType", '');
  972. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  973. this.$set(this.chargeItme[i], "bankTypeText", '');
  974. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  975. }else if(fuzhitype == 2){
  976. this.$set(this.chargeItme[i], "payee",'')
  977. this.$set(this.chargeItme[i], "bankType",'')
  978. this.$set(this.chargeItme[i], "payeeId", '');
  979. this.$set(this.chargeItme[i], "payeeAccount", '');
  980. this.$set(this.chargeItme[i], "bankDeposit", '');
  981. this.$set(this.chargeItme[i], "accountType", '');
  982. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  983. this.$set(this.chargeItme[i], "bankTypeText", '');
  984. this.$notify({ type: 'danger', message: '收款方已存在!' });
  985. }
  986. },
  987. selectChange(select) {
  988. let obj = {};
  989. obj = this.payerOptions.find((account) => {
  990. //model就是上面的数据源
  991. return account.id === select; //筛选出匹配数据
  992. });
  993. if(obj.accountPassword != null && obj.accountPassword != "" &&
  994. obj.bankType != null && obj.bankType != ""){
  995. this.$set(this.form, "bookId", obj.bookId);
  996. this.$set(this.form, "deptId", obj.deptId);
  997. this.$set(this.form, "cashierId", obj.id);
  998. this.$set(this.form, "payer", obj.accountName);
  999. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1000. this.$set(this.form, "operatorCode", obj.operatorCode);
  1001. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1002. this.$set(this.form, "bankType", obj.bankType);
  1003. this.$set(this.form, "payerFrom", '1');
  1004. console.log(obj.bankType)
  1005. if(obj.bankType==1){
  1006. this.form.accountType = "1"
  1007. this.form.isPeers = null
  1008. this.accountTypeChange();
  1009. }else if(obj.bankType==2||obj.bankType==4){
  1010. this.form.accountType = null
  1011. this.form.isPeers = "Y"
  1012. this.accountTypeChange1();
  1013. }
  1014. }else{
  1015. if(obj.payerFrom==1){
  1016. this.diglogStatus = false;
  1017. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1018. this.$set(this.form,"payer","")
  1019. this.$set(this.form,"payerAccount","")
  1020. }else{
  1021. this.$set(this.form, "payerFrom", obj.parerFrom);
  1022. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1023. this.$set(this.form, "operatorCode", obj.operatorCode);
  1024. }else{
  1025. this.$set(this.form, "operatorCode", '');
  1026. }
  1027. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1028. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1029. }else{
  1030. this.$set(this.form, "enterpriseCode", '');
  1031. }
  1032. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1033. this.$set(this.form, "accountPassword", obj.accountPassword);
  1034. }else{
  1035. this.$set(this.form, "accountPassword", '');
  1036. }
  1037. this.$set(this.form, "bookId",'');
  1038. this.$set(this.form, "deptId", '');
  1039. this.$set(this.form, "cashierId", obj.id);
  1040. this.$set(this.form, "payer", obj.accountName);
  1041. if(obj.payerFrom==6){
  1042. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1043. this.$set(this.form, "payerAccount", response.data);
  1044. });
  1045. }else {
  1046. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1047. }
  1048. }
  1049. }
  1050. },
  1051. beforeRead(file) {
  1052. this.uploadFiles.push(file.file);
  1053. },
  1054. deleteFile(file){
  1055. this.uploadFiles.map((response,index) => {
  1056. if(file.file == response){
  1057. this.uploadFiles.splice(index,1)
  1058. }
  1059. })
  1060. console.log(file)
  1061. if(file.id){
  1062. systemAttachment(file.id).then((res) => {
  1063. });
  1064. }
  1065. },
  1066. getFileList(){
  1067. let oData= {
  1068. tableId: this.$route.query.id,
  1069. tableName: "t_yinnong_transfer",
  1070. bizPath: "upload",
  1071. fileType: "0",
  1072. }
  1073. attachmentList(oData).then(res => {
  1074. res.rows.map(r => {
  1075. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1076. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1077. })
  1078. })
  1079. },
  1080. goBack(){
  1081. window.history.go(-1)
  1082. },
  1083. //删除家庭成员
  1084. deleteChargeItme(index){
  1085. this.chargeItme.splice(index,1)
  1086. },
  1087. },
  1088. }
  1089. </script>
  1090. <style scoped lang="scss">
  1091. .app-container {
  1092. padding: 2% 0;
  1093. }
  1094. .main_title{
  1095. font-size: 0.4rem;
  1096. color: #1D6FE9;
  1097. margin: 0.2rem 6%;
  1098. position: relative;
  1099. }
  1100. .main_box{
  1101. width: 96%;
  1102. margin: 0 auto;
  1103. border-radius: 6px;
  1104. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1105. overflow: hidden;
  1106. background-color: #FFF;
  1107. }
  1108. .submitButton{
  1109. width: 80%;
  1110. margin: 0 auto;
  1111. background-color: #1D6FE9;
  1112. }
  1113. .addFamily{
  1114. position: absolute;
  1115. top: -2px;
  1116. right: 0;
  1117. border-radius: 50%;
  1118. }
  1119. .deleteFamily{
  1120. position: absolute;
  1121. top: 0rem;
  1122. right: 6%;
  1123. z-index: 9;
  1124. border-radius: 50%;
  1125. }
  1126. </style>