移动端
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.

approvalModify3.vue 36 KiB

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