移动端
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 43 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  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==4">
  203. <template #right-icon>
  204. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange">
  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. });
  431. queryTransferDetail(this.$route.query.id).then((response) => {
  432. this.getDicts("bank_type").then(res => {
  433. for (var i = 0; i < res.data.length; i++) {
  434. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  435. }
  436. for (var j = 0 ; j < response.rows.length ; j++){
  437. // response.rows[j].payeeText = response.rows[j].payee;
  438. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  439. response.rows[j].showPayee = false;
  440. }
  441. this.chargeItme = response.rows;
  442. });
  443. this.getPayeeList();
  444. });
  445. },
  446. getChange(){
  447. if(this.buttonType == 'update'){
  448. this.goUpdate();
  449. }else if(this.buttonType == 'add'){
  450. this.goAdd();
  451. }
  452. },
  453. getError(e){
  454. this.$notify({ type: 'danger', message: e.errors[0].message });
  455. },
  456. addChargeItme(index){
  457. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  458. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  459. return;
  460. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  461. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  462. return;
  463. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  464. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  465. return;
  466. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  467. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  468. return;
  469. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  470. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  471. return;
  472. }
  473. this.getDicts("bank_type").then(res => {
  474. this.chargeItme.splice(index + 1, 0, {
  475. payeeId: "", //收款方ID
  476. payee: "", //收款方
  477. payeeAccount: "", //收款账户
  478. bankDeposit: "", //开户银行
  479. incomeAmount: "", //收入金额
  480. bankType: null, //所属银行
  481. bankTypeText:"", //所属银行
  482. showPayee:false,
  483. showbankType:false
  484. });
  485. });
  486. },
  487. getPayeeList() {
  488. //普通转账
  489. this.queryParams.accountType = this.form.accountType
  490. this.queryParams.status = "0"
  491. listPayee(this.queryParams).then((response) => {
  492. this.payeeList = response.rows;
  493. response.rows.map((res,index) => {
  494. if(res.payeeType==1||res.payeeType==2){
  495. this.payeeList[index].text = res.payee;
  496. this.payeeList[index].value = res.id;}
  497. })
  498. });
  499. },
  500. payeeDictLabel(datas, value) {
  501. var actions = [];
  502. Object.keys(datas).some((key) => {
  503. if (datas[key].payeeId == ('' + value)) {
  504. actions.push(datas[key].payee);
  505. return true;
  506. }
  507. })
  508. return actions.join('');
  509. },
  510. onConfirmCapital(data){
  511. if (data.value == 2){
  512. this.capitalExpenditureOpen = true;
  513. this.contractOpen = false
  514. this.infoForm = {};
  515. }else if(data.value == 4){
  516. this.capitalExpenditureOpen = false;
  517. this.contractOpen = true
  518. this.projectForm = {};
  519. }else{
  520. this.capitalExpenditureOpen = false;
  521. this.contractOpen = false
  522. this.projectForm = {};
  523. this.infoForm = {};
  524. }
  525. this.capitalExpenditureType = data.text;
  526. this.form.capitalExpenditureType = data.value;
  527. this.showcapital = false;
  528. },
  529. onConfirmFundType(data){
  530. console.log(data)
  531. this.projectForm.projectFundType = data.value;
  532. this.projectFundType = data.text;
  533. this.showFundType = false;
  534. },
  535. onConfirmProject(data){
  536. this.projectList.map(res => {
  537. if(res.projectName==data.text){
  538. this.projectForm.projectId = res.id
  539. this.projectForm.projectName = res.projectName
  540. this.projectForm.projectContractor = res.projectContractor
  541. this.projectForm.projectAmount = res.projectAmount
  542. }
  543. })
  544. this.showproject = false;
  545. },
  546. onConfirmContract(data){
  547. this.infoList.map(res => {
  548. if(res.name==data.text){
  549. this.infoForm.contractionId = res.id;
  550. this.infoForm.name = res.name;
  551. this.infoForm.code = res.code;
  552. this.infoForm.totalAmount = res.totalAmount;
  553. }
  554. })
  555. this.showcontract = false;
  556. },
  557. onConfirmPayee(data,index){
  558. console.log(data)
  559. for (var i = 0 ; i < this.chargeItme.length ; i++){
  560. this.chargeItme[i].showPayee = false;
  561. }
  562. this.chargeItme[index].payee = data.text;
  563. this.chargeItme[index].payeeId = data.value;
  564. this.payeeSelectChange(data.value , index)
  565. },
  566. onConfirmBankType(data,index){
  567. for (var i = 0 ; i < this.chargeItme.length ; i++){
  568. this.chargeItme[i].showbankType = false;
  569. }
  570. this.chargeItme[index].bankTypeText = data.text;
  571. this.chargeItme[index].bankType = data.value;
  572. this.chargeItme[index].showbankType = false;
  573. },
  574. onConfirmPayer(data){
  575. this.form.payer = data.text;
  576. this.form.cashierId = data.value;
  577. this.showpayer = false;
  578. this.selectChange(data.value)
  579. },
  580. onConfirmLasj(data){
  581. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  582. this.showlasj = false;
  583. },
  584. accountTypeChange(e){
  585. this.payeeList = [];
  586. this.chargeItme = [];
  587. this.queryParams.accountType = this.form.accountType
  588. this.queryParams.isPeers = this.form.isPeers
  589. this.queryParams.bankType = this.form.bankType
  590. this.queryParams.status = "0"
  591. listPayee(this.queryParams).then((response) => {
  592. response.rows.map((res,index) => {
  593. if(res.payeeType==1||res.payeeType==2){
  594. response.rows[index].text = res.payee;
  595. response.rows[index].value = res.id;
  596. this.payeeList.push(res)
  597. }
  598. })
  599. });
  600. },
  601. accountTypeChange1(e){
  602. this.payeeList = [];
  603. this.chargeItme = [];
  604. this.queryParams.accountType = this.form.accountType
  605. this.queryParams.isPeers = this.form.isPeers
  606. this.queryParams.bankType = this.form.bankType
  607. this.queryParams.status = "0"
  608. listPayee(this.queryParams).then((response) => {
  609. response.rows.map((res,index) => {
  610. if(res.payeeType==1||res.payeeType==2){
  611. response.rows[index].text = res.payee;
  612. response.rows[index].value = res.id;
  613. this.payeeList.push(res)
  614. }
  615. })
  616. });
  617. },
  618. // 钱计算
  619. moneyChange(input) {
  620. console.log(input)
  621. let obj = {};
  622. obj = this.chargeItme.find((account) => {
  623. //model就是上面的数据源
  624. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  625. });
  626. let total = 0;
  627. this.chargeItme.forEach((money) => {
  628. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  629. });
  630. this.$set(this.form, "expenditureAmount", total);
  631. },
  632. goAdd(){
  633. if(this.chargeItme.length<1){
  634. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  635. return;
  636. }
  637. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  638. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  639. return;
  640. }
  641. if(this.form.capitalExpenditureType==2){
  642. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  643. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  644. return;
  645. }
  646. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  647. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  648. return;
  649. }
  650. }
  651. if(this.form.capitalExpenditureType==4){
  652. if(this.infoForm.name==""||this.infoForm.name==null){
  653. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  654. return;
  655. }
  656. if(this.infoForm.code==""||this.infoForm.code==null){
  657. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  658. return;
  659. }
  660. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  661. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  662. return;
  663. }
  664. }
  665. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  666. Dialog.confirm({
  667. title: '提示',
  668. message: '此申请单中未上传任何附件,是否确认提交?',
  669. })
  670. .then(() => {
  671. this.$set(this.form, "payeeList", this.chargeItme);
  672. this.$set(this.form, "bankTypeList", this.chargeItme);
  673. this.$set(this.form, "accountTypeList", this.chargeItme);
  674. this.$set(this.form, "transferStatusList", this.chargeItme);
  675. updateTransfer(this.form).then(response => {
  676. this.projectForm.outId = this.form.id
  677. this.infoForm.transferId = this.form.id
  678. this.$set(this.projectForm, "ynType", '1');
  679. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  680. this.uploadFiles.map(rr => {
  681. const params = new FormData();
  682. params.append("tableId", this.form.id);
  683. params.append("tableName", "t_yinnong_transfer");
  684. params.append("bizPath", "upload");
  685. params.append("fileType", "0");
  686. params.append("file", rr);
  687. commonAttach(params).then((r) => {
  688. })
  689. })
  690. if(this.form.capitalExpenditureType==2){
  691. addProjectto(this.projectForm).then(res => {
  692. customSubmit(this.form.id).then(res => {
  693. this.$toast.success('提交成功');
  694. setTimeout(function(){
  695. history.go(-1)
  696. },2000)
  697. })
  698. })
  699. }else if(this.form.capitalExpenditureType==4){
  700. addInfoto(this.infoForm).then(res => {
  701. customSubmit(this.form.id).then(res => {
  702. this.$toast.success('提交成功');
  703. setTimeout(function(){
  704. history.go(-1)
  705. },2000)
  706. })
  707. })
  708. }else{
  709. customSubmit(this.form.id).then(res => {
  710. this.$toast.success('提交成功');
  711. setTimeout(function(){
  712. history.go(-1)
  713. },2000)
  714. })
  715. }
  716. }else{
  717. if(this.form.capitalExpenditureType==2){
  718. addProjectto(this.projectForm).then(res => {
  719. customSubmit(this.form.id).then(res => {
  720. this.$toast.success('提交成功');
  721. setTimeout(function(){
  722. history.go(-1)
  723. },2000)
  724. })
  725. })
  726. }else if(this.form.capitalExpenditureType==4){
  727. addInfoto(this.infoForm).then(res => {
  728. customSubmit(this.form.id).then(res => {
  729. this.$toast.success('提交成功');
  730. setTimeout(function(){
  731. history.go(-1)
  732. },2000)
  733. })
  734. })
  735. }else{
  736. customSubmit(this.form.id).then(res => {
  737. this.$toast.success('提交成功');
  738. setTimeout(function(){
  739. history.go(-1)
  740. },2000)
  741. })
  742. }
  743. }
  744. });
  745. })
  746. .catch(() => {
  747. return false;
  748. });
  749. }else{
  750. this.$set(this.form, "payeeList", this.chargeItme);
  751. this.$set(this.form, "bankTypeList", this.chargeItme);
  752. this.$set(this.form, "accountTypeList", this.chargeItme);
  753. this.$set(this.form, "transferStatusList", this.chargeItme);
  754. updateTransfer(this.form).then(response => {
  755. this.projectForm.outId = this.form.id
  756. this.infoForm.transferId = this.form.id
  757. this.$set(this.projectForm, "ynType", '1');
  758. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  759. this.uploadFiles.map(rr => {
  760. const params = new FormData();
  761. params.append("tableId", this.form.id);
  762. params.append("tableName", "t_yinnong_transfer");
  763. params.append("bizPath", "upload");
  764. params.append("fileType", "0");
  765. params.append("file", rr);
  766. commonAttach(params).then((r) => {
  767. })
  768. })
  769. if(this.form.capitalExpenditureType==2){
  770. addProjectto(this.projectForm).then(res => {
  771. customSubmit(this.form.id).then(res => {
  772. this.$toast.success('提交成功');
  773. setTimeout(function(){
  774. history.go(-1)
  775. },2000)
  776. })
  777. })
  778. } else if(this.form.capitalExpenditureType==4){
  779. addInfoto(this.infoForm).then(res => {
  780. customSubmit(this.form.id).then(res => {
  781. this.$toast.success('提交成功');
  782. setTimeout(function(){
  783. history.go(-1)
  784. },2000)
  785. })
  786. })
  787. }else{
  788. customSubmit(this.form.id).then(res => {
  789. this.$toast.success('提交成功');
  790. setTimeout(function(){
  791. history.go(-1)
  792. },2000)
  793. })
  794. }
  795. }else{
  796. if(this.form.capitalExpenditureType==2){
  797. addProjectto(this.projectForm).then(res => {
  798. customSubmit(this.form.id).then(res => {
  799. this.$toast.success('提交成功');
  800. setTimeout(function(){
  801. history.go(-1)
  802. },2000)
  803. })
  804. })
  805. } else if(this.form.capitalExpenditureType==4){
  806. addInfoto(this.infoForm).then(res => {
  807. customSubmit(this.form.id).then(res => {
  808. this.$toast.success('提交成功');
  809. setTimeout(function(){
  810. history.go(-1)
  811. },2000)
  812. })
  813. })
  814. }else{
  815. customSubmit(this.form.id).then(res => {
  816. this.$toast.success('提交成功');
  817. setTimeout(function(){
  818. history.go(-1)
  819. },2000)
  820. })
  821. }
  822. }
  823. });
  824. }
  825. },
  826. goUpdate(){
  827. if(this.chargeItme.length<1){
  828. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  829. return;
  830. }
  831. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  832. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  833. return;
  834. }
  835. if(this.form.capitalExpenditureType==2){
  836. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  837. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  838. return;
  839. }
  840. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  841. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  842. return;
  843. }
  844. }
  845. if(this.form.capitalExpenditureType==4){
  846. if(this.infoForm.name==""||this.infoForm.name==null){
  847. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  848. return;
  849. }
  850. if(this.infoForm.code==""||this.infoForm.code==null){
  851. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  852. return;
  853. }
  854. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  855. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  856. return;
  857. }
  858. }
  859. this.$set(this.form, "payeeList", this.chargeItme);
  860. this.$set(this.form, "bankTypeList", this.chargeItme);
  861. this.$set(this.form, "accountTypeList", this.chargeItme);
  862. this.$set(this.form, "transferStatusList", this.chargeItme);
  863. updateTransfer(this.form).then((response) => {
  864. this.projectForm.outId = this.form.id
  865. this.infoForm.transferId = this.form.id
  866. this.$set(this.projectForm, "ynType", '1');
  867. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  868. this.uploadFiles.map(rr => {
  869. const params = new FormData();
  870. params.append("tableId", this.form.id);
  871. params.append("tableName", "t_yinnong_transfer");
  872. params.append("bizPath", "upload");
  873. params.append("fileType", "0");
  874. params.append("file", rr);
  875. commonAttach(params).then((r) => {
  876. })
  877. })
  878. if(this.form.capitalExpenditureType==2){
  879. addProjectto(this.projectForm).then(res => {
  880. this.$toast.success('保存成功');
  881. setTimeout(function(){
  882. history.go(-1)
  883. },2000)
  884. })
  885. }else if(this.form.capitalExpenditureType==4){
  886. addInfoto(this.infoForm).then(res => {
  887. this.$toast.success('保存成功');
  888. setTimeout(function(){
  889. history.go(-1)
  890. },2000)
  891. })
  892. }else{
  893. this.$toast.success('保存成功');
  894. setTimeout(function(){
  895. history.go(-1)
  896. },2000)
  897. }
  898. }else{
  899. if(this.form.capitalExpenditureType==2){
  900. addProjectto(this.projectForm).then(res => {
  901. this.$toast.success('保存成功');
  902. setTimeout(function(){
  903. history.go(-1)
  904. },2000)
  905. })
  906. }else if(this.form.capitalExpenditureType==4){
  907. addInfoto(this.infoForm).then(res => {
  908. this.$toast.success('保存成功');
  909. setTimeout(function(){
  910. history.go(-1)
  911. },2000)
  912. })
  913. }else{
  914. this.$toast.success('保存成功');
  915. setTimeout(function(){
  916. history.go(-1)
  917. },2000)
  918. }
  919. }
  920. });
  921. },
  922. payeeSelectChange(select, i) {
  923. let obj = {};
  924. let fuzhitype = 0;
  925. let _this = this
  926. obj = this.payeeList.find((account) => {
  927. //model就是上面的数据源
  928. return account.id === select ; //筛选出匹配数据
  929. });
  930. if(this.chargeItme != [] && this.chargeItme.length>1){
  931. this.chargeItme.some((value, index) => {
  932. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  933. fuzhitype = 2;
  934. return true;
  935. }
  936. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  937. fuzhitype = 1;
  938. return true;
  939. }
  940. });
  941. }
  942. if(fuzhitype == 0){
  943. this.$set(this.chargeItme[i], "payee",obj.payee)
  944. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  945. this.$set(this.chargeItme[i], "payeeId", obj.id);
  946. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  947. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  948. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  949. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  950. _this.bankTypeDictionaries.map(rr => {
  951. if(rr.value==obj.bankType){
  952. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  953. }
  954. })
  955. }else if(fuzhitype == 1){
  956. this.$set(this.chargeItme[i], "payee",'')
  957. this.$set(this.chargeItme[i], "bankType",'')
  958. this.$set(this.chargeItme[i], "payeeId", '');
  959. this.$set(this.chargeItme[i], "payeeAccount", '');
  960. this.$set(this.chargeItme[i], "bankDeposit", '');
  961. this.$set(this.chargeItme[i], "accountType", '');
  962. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  963. this.$set(this.chargeItme[i], "bankTypeText", '');
  964. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  965. }else if(fuzhitype == 2){
  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. }
  976. },
  977. selectChange(select) {
  978. let obj = {};
  979. obj = this.payerOptions.find((account) => {
  980. //model就是上面的数据源
  981. return account.id === select; //筛选出匹配数据
  982. });
  983. if(obj.accountPassword != null && obj.accountPassword != "" &&
  984. obj.bankType != null && obj.bankType != ""){
  985. this.$set(this.form, "bookId", obj.bookId);
  986. this.$set(this.form, "deptId", obj.deptId);
  987. this.$set(this.form, "cashierId", obj.id);
  988. this.$set(this.form, "payer", obj.accountName);
  989. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  990. this.$set(this.form, "operatorCode", obj.operatorCode);
  991. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  992. this.$set(this.form, "bankType", obj.bankType);
  993. this.$set(this.form, "payerFrom", '1');
  994. console.log(obj.bankType)
  995. if(obj.bankType==1){
  996. this.form.accountType = "1"
  997. this.form.isPeers = null
  998. this.accountTypeChange();
  999. }else if(obj.bankType==2||obj.bankType==4){
  1000. this.form.accountType = null
  1001. this.form.isPeers = "Y"
  1002. this.accountTypeChange1();
  1003. }
  1004. }else{
  1005. if(obj.payerFrom==1){
  1006. this.diglogStatus = false;
  1007. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1008. this.$set(this.form,"payer","")
  1009. this.$set(this.form,"payerAccount","")
  1010. }else{
  1011. this.$set(this.form, "payerFrom", obj.parerFrom);
  1012. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1013. this.$set(this.form, "operatorCode", obj.operatorCode);
  1014. }else{
  1015. this.$set(this.form, "operatorCode", '');
  1016. }
  1017. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1018. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1019. }else{
  1020. this.$set(this.form, "enterpriseCode", '');
  1021. }
  1022. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1023. this.$set(this.form, "accountPassword", obj.accountPassword);
  1024. }else{
  1025. this.$set(this.form, "accountPassword", '');
  1026. }
  1027. this.$set(this.form, "bookId",'');
  1028. this.$set(this.form, "deptId", '');
  1029. this.$set(this.form, "cashierId", obj.id);
  1030. this.$set(this.form, "payer", obj.accountName);
  1031. if(obj.payerFrom==6){
  1032. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1033. this.$set(this.form, "payerAccount", response.data);
  1034. });
  1035. }else {
  1036. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1037. }
  1038. }
  1039. }
  1040. },
  1041. beforeRead(file) {
  1042. this.uploadFiles.push(file.file);
  1043. },
  1044. deleteFile(file){
  1045. this.uploadFiles.map((response,index) => {
  1046. if(file.file == response){
  1047. this.uploadFiles.splice(index,1)
  1048. }
  1049. })
  1050. if(file.id){
  1051. systemAttachment(file.id).then((res) => {
  1052. });
  1053. }
  1054. },
  1055. getFileList(){
  1056. let oData= {
  1057. tableId: this.$route.query.id,
  1058. tableName: "t_yinnong_transfer",
  1059. bizPath: "upload",
  1060. fileType: "0",
  1061. }
  1062. attachmentList(oData).then(res => {
  1063. res.rows.map(r => {
  1064. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1065. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1066. })
  1067. })
  1068. },
  1069. goBack(){
  1070. window.history.go(-1)
  1071. },
  1072. //删除家庭成员
  1073. deleteChargeItme(index){
  1074. this.chargeItme.splice(index,1)
  1075. },
  1076. },
  1077. }
  1078. </script>
  1079. <style scoped lang="scss">
  1080. .app-container {
  1081. padding: 2% 0;
  1082. }
  1083. .main_title{
  1084. font-size: 0.4rem;
  1085. color: #1D6FE9;
  1086. margin: 0.2rem 6%;
  1087. position: relative;
  1088. }
  1089. .main_box{
  1090. width: 96%;
  1091. margin: 0 auto;
  1092. border-radius: 6px;
  1093. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1094. overflow: hidden;
  1095. background-color: #FFF;
  1096. }
  1097. .submitButton{
  1098. width: 80%;
  1099. margin: 0 auto;
  1100. background-color: #1D6FE9;
  1101. }
  1102. .addFamily{
  1103. position: absolute;
  1104. top: -2px;
  1105. right: 0;
  1106. border-radius: 50%;
  1107. }
  1108. .deleteFamily{
  1109. position: absolute;
  1110. top: 0rem;
  1111. right: 6%;
  1112. z-index: 9;
  1113. border-radius: 50%;
  1114. }
  1115. </style>