|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000 |
- <template>
- <div class="app-container">
- <van-nav-bar
- left-arrow
- fixed
- placeholder
- @click-left="goBack"
- >
- <template #title>
- <p style="font-weight: bold;">添加银行卡转账申请</p>
- </template>
- <template #right>
- <van-icon name="../../../static/images/icon/icon_flow.png" size="20" @click="goFlow"/>
- </template>
- </van-nav-bar>
- <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
- <p class="main_title">基础信息</p>
- <div class="main_box">
- <van-field
- readonly
- clickable
- required
- :rules="[{ required: true , message:'请选择申请时间' }]"
- v-model="form.applyDate"
- label="申请时间"
- placeholder="请选择申请时间"
- @click="showlasj = true"
- input-align="right"
- right-icon="arrow-down"
- />
- <van-popup v-model="showlasj" position="bottom">
- <van-datetime-picker
- v-model="currentDate"
- type="date"
- title="选择年月日"
- :min-date="minDate"
- :max-date="maxDate"
- @confirm="onConfirmLasj"
- @cancel="showlasj = false"
- />
- </van-popup>
- <van-field
- readonly
- clickable
- required
- :rules="[{ required: true , message:'请选择资金支出类别' }]"
- label="资金支出类别"
- placeholder="请选择"
- v-model="capitalExpenditureType"
- @click="showcapital = true"
- input-align="right"
- right-icon="arrow-down"
- label-width="auto"
- />
- <van-popup v-model="showcapital" position="bottom">
- <van-picker
- show-toolbar
- :columns="capitalExpenditureTypeOptions"
- @confirm="onConfirmCapital"
- @cancel="showcapital = false"
- />
- </van-popup>
- <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
- :rules="[{ required: true , message:'请选择审批模式' }]">
- <template #input>
- <van-radio-group v-model="form.approvalMode" direction="horizontal">
- <van-radio name="1">线上审批</van-radio>
- <van-radio name="2">线下审批</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field
- v-if="form.approvalMode==1"
- readonly
- clickable
- label="审批流程"
- placeholder="请选择"
- v-model="form.approvalTemplateName"
- @click="showtemplate = true"
- input-align="right"
- right-icon="arrow-down"
- required
- :rules="[{ required: true , message:'请选择项目流程' }]"
- />
- <van-popup v-model="showtemplate" position="bottom">
- <van-picker
- show-toolbar
- value-key="name"
- :columns="templateList"
- @confirm="onConfirmTemplate"
- @cancel="showtemplate = false"
- />
- </van-popup>
- <van-field
- readonly
- required
- label="支出总金额"
- v-model="form.expenditureAmount"
- placeholder="根据下方收款金额自动核算"
- input-align="right"
- label-width="auto"
- />
- </div>
-
- <div class="main_box" style="margin-top: 10px;">
- <van-field
- label="转账附言"
- v-model="form.remark"
- type="textarea"
- placeholder="请输入转账附言"
- input-align="right"
- rows="3"
- label-width="auto"
- required
- :rules="[{ required: true , message:'请输入转账附言' }]"
- />
- </div>
-
- <div class="main_box" style="margin-top: 10px;">
- <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
- </div>
-
- <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
- <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
- <van-field
- readonly
- clickable
- label="项目名称"
- placeholder="请选择"
- v-model="projectForm.projectName"
- @click="showproject = true"
- input-align="right"
- right-icon="arrow-down"
- required
- :rules="[{ required: true , message:'请选择项目名称' }]"
- />
- <van-popup v-model="showproject" position="bottom">
- <van-picker
- show-toolbar
- :columns="projectList"
- @confirm="onConfirmProject"
- @cancel="showproject = false"
- />
- </van-popup>
- <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
- <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
- <van-field
- readonly
- clickable
- label="工程款类型"
- placeholder="请选择"
- v-model="projectFundType"
- @click="showFundType = true"
- input-align="right"
- right-icon="arrow-down"
- required
- :rules="[{ required: true , message:'请选择工程款类型' }]"
- />
- <van-popup v-model="showFundType" position="bottom">
- <van-picker
- show-toolbar
- :columns="projectFundTypeOptions"
- @confirm="onConfirmFundType"
- @cancel="showFundType = false"
- />
- </van-popup>
- <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
- </div>
- <p class="main_title" v-if="contractOpen">关联合同</p>
- <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
- <van-field
- readonly
- clickable
- label="合同"
- placeholder="请选择"
- v-model="infoForm.name"
- @click="showcontract = true"
- input-align="right"
- right-icon="arrow-down"
- required
- :rules="[{ required: true , message:'请选择项目名称' }]"
- />
- <van-popup v-model="showcontract" position="bottom">
- <van-picker
- show-toolbar
- :columns="infoList"
- @confirm="onConfirmContract"
- @cancel="showcontract = false"
- />
- </van-popup>
- <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
- <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
- </div>
-
- <p class="main_title">付款方信息</p>
- <div class="main_box">
- <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
- <van-field
- readonly
- clickable
- label="付款方"
- placeholder="请选择付款方"
- v-model="form.payer"
- @click="showpayer = true"
- input-align="right"
- right-icon="arrow-down"
- label-width="auto"
- required
- :rules="[{ required: true , message:'请选择付款方' }]"
- />
- <van-popup v-model="showpayer" position="bottom">
- <van-picker
- show-toolbar
- :columns="payerOptions"
- @confirm="onConfirmPayer($event)"
- @cancel="showpayer = false"
- />
- </van-popup>
- <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
- </div>
-
- <div class="main_title main_title_box">
- <p>收款方信息</p>
- <router-link :to="{name:'approvalCollectionAdd', params: {accountType:form.accountType,isPeers:form.isPeers,bankType:form.bankType,option:form}}">添加收款方</router-link>
- <van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/>
- </div>
-
- <div class="main_box" style="margin-bottom: 15px;" v-if="form.bankType==1||form.bankType==2||form.bankType==3||form.bankType==4">
- <van-cell title="收款账户类型" v-if="form.bankType==1">
- <template #right-icon>
- <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange" >
- <van-radio name="1">公户</van-radio>
- <van-radio name="2">私户</van-radio>
- </van-radio-group>
- </template>
- </van-cell>
- <van-cell title="是否与付款方同行" v-if="form.bankType==2||form.bankType==3||form.bankType==4" >
- <template #right-icon>
- <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-cell>
- </div>
- <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
- <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
- <div class="main_box" style="margin-bottom: 10px;position:relative;">
- <van-field
- readonly
- clickable
- label="收款方"
- placeholder="请选择"
- v-model="item.payee"
- @click="item.showPayee = true"
- input-align="right"
- right-icon="arrow-down"
- required
- :rules="[{ required: true , message:'请选择收款方' }]"
- />
- <van-popup v-model="item.showPayee" position="bottom">
- <van-picker
- show-toolbar
- :columns="payeeList"
- @confirm="onConfirmPayee($event,index)"
- @cancel="item.showPayee = false"
- />
- </van-popup>
- <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
- <van-field required :rules="[{ required: true , message:'请输入开户银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入开户银行银行" input-align="right" label-width="auto"/>
- <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
- <van-field
- readonly
- clickable
- label="所属银行"
- placeholder=""
- v-model="item.bankTypeText"
- input-align="right"
- placeholder="请输入所属银行"
- required
- :rules="[{ required: true , message:'请选择所属银行' }]"
- />
- <!--<van-popup v-model="item.showbankType" position="bottom">
- <van-picker
- show-toolbar
- :columns="bankTypeDictionaries"
- @confirm="onConfirmBankType($event,index)"
- @cancel="item.showbankType = false"
- />
- </van-popup>-->
- </div>
- </div>
- <p class="main_title">上传附件</p>
- <div class="main_box" style="padding: 5px 0 0 0;">
- <van-cell value="收据" />
- <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
- <van-cell title="发票" />
- <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
- <van-cell title="其他" />
- <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></van-uploader>
- </div>
- <div style="padding: 16px 0;">
- <van-row>
- <van-col span="12" align="center">
- <!-- @click="goUpdate"-->
- <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
- </van-col>
- <van-col span="12" align="center">
- <!-- @click="goAdd"-->
- <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
- </van-col>
- </van-row>
- <div class="clear"></div>
- </div>
- </van-form>
- </div>
- </template>
-
- <script>
- import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto ,selectApprovalByTemplateId,
- customSubmit ,offlineCustomSubmit, getAccount ,getQmyeFlow , attach ,listInfo ,getInfoto ,addInfoto,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval";
- import request from '@/utils/request'
- import {attachmentList, commonAttach} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
- import Dialog from "vant/lib/dialog";
- export default {
- name: "approvalAdd",
- data() {
- return {
- showtemplate:false,
- showcontract:false,
- showcapital:false,
- showpayee:false,
- showlasj:false,
- showbankType:false,
- showproject:false,
- showFundType:false,
- showpayer:false,
-
- buttonType:'a',
-
- minDate: new Date(2000, 1, 1),
- maxDate: new Date(2050, 12, 31),
- currentDate: new Date(),
- form:{
- id: null,
- upId: null,
- applyDate:this.nowDate,
- approvalMode:'1',
- downId: null,
- orderId: null,
- cashierId: null,
- transferType: '1',
- accountType: null,
- isPeers:null,
- explainSituation: null,
- succeedAmount: null,
- payer: null,
- payerAccount: null,
- operatorCode: null,
- enterpriseCode: null,
- expenditureAmount: null,
- capitalExpenditureType: '1',
- remark: null,
- transferStatus: "0",
- auditStatus: "0",
- paymentState: "1",
- bankPriority: "0",
- clientPriority: "0"
- },
- fileList1:[],
- fileList2:[],
- fileList3:[],
- capitalExpenditureType:'',
- payee:'',
- bankType:'',
-
- wfydlxDictionaries:[],
- jglxDictionaries:[],
- sysDictionaries:[],
- capitalExpenditureTypeOptions:[],
- bankTypeDictionaries:[],
- projectList:[],
- projectFundTypeOptions:[],
- projectFundTypeDictionaries:[],
- infoList:[],
- payerOptions:[],
-
- chargeItme:[],
- chargeItmeShow:[],
- templateList:[],
- payeeList:[],
- // 查询参数
- queryParams: {
- transferType:"",
- orderByColumn: "id",
- isAsc: "desc",
- },
- capitalExpenditureOpen:false,
- contractOpen:false,
- projectForm:{
- projectId:null,
- projectName:null,
- projectContractor:null,
- projectAmount:null,
- projectBillNum:null,
- projectFundType:'1',
- outId:null,
- ynType:'1'
- },
- infoForm:{
- infoId:null,
- name:null,
- code:null,
- totalAmount:null,
- contractionId:null,
- transferId:null
- },
- // 合同信息查询参数
- queryContractionParams: {
- pageNum: 1,
- pageSize: 100,
- contractionStatus: '1',
- orderByColumn: "endTime",
- isAsc: "desc",
- },
- projectFundType:'',
- uploadFiles1:[],
- uploadFiles2:[],
- uploadFiles3:[],
- nowDate:""
- };
- },
- created() {
- this.getNowDate();
- this.reset();
- this.initProjectInfo();
- this.capitalExpenditureOpen = false
- this.getDicts("project_fund_type").then((response) => {
- for (var i = 0; i < response.data.length; i++) {
- this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
- }
- this.projectFundTypeDictionaries = response.data;
- });
- let params1={
- accountType: "102",
- // "params":{townAccountType:'0'},
- status: "N",
- }
- getAccount(params1).then((response) => {
- this.payerOptions = response.rows;
- response.rows.map((res,index) => {
- res['payerFrom'] = '1'
- this.payerOptions[index].text = res.accountName;
- this.payerOptions[index].value = res.id;
- })
- });
- this.getDictionaries();
- this.getTemplateList();
-
-
- },
- methods: {
- goFlow(){
- if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
- window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
- }else{
- this.$notify({ type: 'danger', message: '无审批流程!' });
- }
- },
- getTemplateList(){
- let templateQueryParams = {
- // 分页
- pageNum: 1,
- pageSize: 999,
- type:'1'
- };
- listTemplate(templateQueryParams).then(response => {
- this.templateList = response.rows;
- });
- },
- onConfirmTemplate(data){
- selectApprovalByTemplateId(data.id).then(res => {
- this.showtemplate = false;
- if(res.approvalDetails.length>0){
- this.form.approvalTemplateName = data.name
- this.form.approvalTemplateId = data.id
- }else{
- this.form.approvalTemplateName = null
- this.form.approvalTemplateId = null
- this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
- }
- })
- },
- getNowDate(){
- var _this = this;
- let yy = new Date().getFullYear();
- let mm = new Date().getMonth()+1;
- let dd = new Date().getDate();
- _this.nowDate = yy+'-'+mm+'-'+dd
- },
- initProjectInfo(){
- let _this = this
- let queryParams={
- pageNum: 1,
- pageSize: 100,
- }
- listProject(queryParams).then(response => {
- _this.projectList = response.rows;
- console.log(response)
- for (let i = 0; i < response.rows.length; i++) {
- //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
- _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
- _this.$set(_this.projectList[i],"value",response.rows[i].id)
- }
- });
- listInfo(this.queryContractionParams).then(response => {
- console.log(response)
- _this.infoList = response.rows;
- for (let i = 0; i < response.rows.length; i++) {
- //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
- _this.$set(_this.infoList[i],"text",response.rows[i].name)
- _this.$set(_this.infoList[i],"value",response.rows[i].code)
- }
- });
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- upId: null,
- applyDate:this.nowDate,
- approvalMode:'1',
- downId: null,
- orderId: null,
- cashierId: null,
- transferType: '1',
- accountType: null,
- isPeers:null,
- explainSituation: null,
- succeedAmount: null,
- payer: null,
- payerAccount: null,
- operatorCode: null,
- enterpriseCode: null,
- expenditureAmount: null,
- capitalExpenditureType: '1',
- remark: null,
- transferStatus: "0",
- auditStatus: "0",
- paymentState: "1",
- bankPriority: "0",
- clientPriority: "0"
- };
- this.processList = {}
- this.projectForm={
- projectId:null,
- projectName:null,
- projectContractor:null,
- projectAmount:null,
- projectBillNum:null,
- projectFundType:'1',
- outId:null,
- ynType:'1'
- }
- },
- getChange(){
- if(this.buttonType == 'update'){
- this.goUpdate();
- }else if(this.buttonType == 'add'){
- this.goAdd();
- }
- },
- getDictionaries(){
- this.getDicts("capital_expenditure_type").then((res) => {
- for (var i = 0; i < res.data.length; i++) {
- this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
- }
- });
- this.getDicts("bank_type_all").then(res => {
- for (var i = 0; i < res.data.length; i++) {
- this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
- }
- });
- },
- getError(e){
- console.log(e)
- this.$notify({ type: 'danger', message: e.errors[0].message });
- },
- addChargeItme(index){
- if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
- this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
- return;
- }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
- this.$notify({ type: 'danger', message: '请输入收入金额!' });
- return;
- }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
- this.$notify({ type: 'danger', message: '请输入收款账户!' });
- return;
- }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
- this.$notify({ type: 'danger', message: '请输入开户银行!' });
- return;
- }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
- this.$notify({ type: 'danger', message: '请选择所属银行!' });
- return;
- }
- if(this.form.bankType == '2' && this.form.isPeers == 'N' && this.chargeItme.length>0 && this.chargeItme != []){
- this.$notify({ type: 'danger', message: '目前农商行仅支持单笔跨行转账,即仅能有一个收款方!' });
- }else{
- this.getDicts("bank_type").then(res => {
- this.chargeItme.splice(index + 1, 0, {
- payeeId: "", //收款方ID
- payee: "", //收款方
- payeeAccount: "", //收款账户
- bankDeposit: "", //开户银行
- incomeAmount: "", //收入金额
- bankType: null, //所属银行
- bankTypeText:"", //所属银行
- showPayee:false,
- showbankType:false
- });
- });}
- },
- getPayeeList() {
- //普通转账
- this.queryParams.status = "0"
- listPayee(this.queryParams).then((response) => {
- response.rows.map((res,index) => {
- if(res.payeeType==1||res.payeeType==2){
- res.text = res.payee;
- res.value = res.id;
- this.payeeList.push(res)
- }
- })
- });
- },
- payeeDictLabel(datas, value) {
- var actions = [];
- Object.keys(datas).some((key) => {
- if (datas[key].payeeId == ('' + value)) {
- actions.push(datas[key].payee);
- return true;
- }
- })
- return actions.join('');
- },
- onConfirmCapital(data){
- if (data.value == 2){
- this.capitalExpenditureOpen = true;
- this.contractOpen = false
- this.infoForm = {};
- }else if(data.value == 4){
- this.capitalExpenditureOpen = false;
- this.contractOpen = true
- this.projectForm = {};
- }else{
- this.capitalExpenditureOpen = false;
- this.contractOpen = false
- this.projectForm = {};
- this.infoForm = {};
- }
- this.capitalExpenditureType = data.text;
- this.form.capitalExpenditureType = data.value;
- this.showcapital = false;
- },
- onConfirmFundType(data){
- console.log(data)
- this.projectForm.projectFundType = data.value;
- this.projectFundType = data.text;
- this.showFundType = false;
- },
- onConfirmContract(data){
- this.infoList.map(res => {
- if(res.name==data.text){
- this.infoForm.contractionId = res.id;
- this.infoForm.name = res.name;
- this.infoForm.code = res.code;
- this.infoForm.totalAmount = res.totalAmount;
- }
- })
- this.showcontract = false;
- },
-
- onConfirmProject(data){
- this.projectList.map(res => {
- if(res.projectName==data.text){
- this.projectForm.projectId = res.id
- this.projectForm.projectName = res.projectName
- this.projectForm.projectContractor = res.projectContractor
- this.projectForm.projectAmount = res.projectAmount
- }
- })
- this.showproject = false;
- },
- onConfirmPayee(data,index){
- for (var i = 0 ; i < this.chargeItme.length ; i++){
- this.chargeItme[i].showPayee = false;
- }
- this.chargeItme[index].payee = data.text;
- this.chargeItme[index].payeeId = data.value;
- this.chargeItme[index].showpayee = false;
- this.payeeSelectChange(data.value , index)
- console.log(data)
- },
- onConfirmBankType(data,index){
- for (var i = 0 ; i < this.chargeItme.length ; i++){
- this.chargeItme[i].showbankType = false;
- }
- this.chargeItme[index].bankTypeText = data.text;
- this.chargeItme[index].bankType = data.value;
- this.chargeItme[index].showbankType = false;
- },
- onConfirmPayer(data){
- this.form.payer = data.text;
- this.form.cashierId = data.value;
- this.showpayer = false;
- this.selectChange(data.value)
- },
- onConfirmLasj(data){
- this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
- this.showlasj = false;
- },
- accountTypeChange(e){
- this.payeeList = [];
- this.chargeItme = [];
- this.queryParams.isPeers = this.form.isPeers
- this.queryParams.accountType = this.form.accountType
- this.queryParams.bankType = this.form.bankType
- this.queryParams.status = "0"
- listPayee(this.queryParams).then((response) => {
- response.rows.map((res,index) => {
- if(res.payeeType==1||res.payeeType==2){
- response.rows[index].text = res.payee;
- response.rows[index].value = res.id;
- this.payeeList.push(res)
- }
- })
- });
- },
- accountTypeChange1(e){
- this.payeeList = [];
- this.chargeItme = [];
- this.queryParams.isPeers = this.form.isPeers
- this.queryParams.accountType = this.form.accountType
- this.queryParams.bankType = this.form.bankType
- this.queryParams.status = "0"
- listPayee(this.queryParams).then((response) => {
- response.rows.map((res,index) => {
- if(res.payeeType==1||res.payeeType==2){
- response.rows[index].text = res.payee;
- response.rows[index].value = res.id;
- this.payeeList.push(res)
- }
- })
- });
- },
- // 钱计算
- moneyChange(input) {
- console.log(input)
- let obj = {};
- obj = this.chargeItme.find((account) => {
- //model就是上面的数据源
- return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
- });
- let total = 0;
- this.chargeItme.forEach((money) => {
- total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
- });
- this.$set(this.form, "expenditureAmount", total);
- },
- goAdd(){
- let _this = this
-
- if(this.chargeItme.length<1){
- this.$notify({ type: 'danger', message: '请添加收款方信息' });
- return;
- }
- if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
- this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
- return;
- }
- if(this.form.capitalExpenditureType==2){
- if(this.projectForm.projectName==""||this.projectForm.projectName==null){
- this.$notify({ type: 'danger', message: '请选择项目名称!' });
- return;
- }
- if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
- this.$notify({ type: 'danger', message: '请输入工程发票号!' });
- return;
- }
- }
- if(this.form.capitalExpenditureType==4){
- if(this.infoForm.name==""||this.infoForm.name==null){
- this.$notify({ type: 'danger', message: '请选择合同名称!' });
- return;
- }
- if(this.infoForm.code==""||this.infoForm.code==null){
- this.$notify({ type: 'danger', message: '请输入合同编码!' });
- return;
- }
- if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
- this.$notify({ type: 'danger', message: '请输入合同价款!' });
- return;
- }
- }
- if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
- Dialog.confirm({
- title: '提示',
- message: '此申请单中未上传任何附件,是否确认提交?',
- })
- .then(() => {
- this.$set(this.form, "payeeList", this.chargeItme);
- this.$set(this.form, "bankTypeList", this.chargeItme);
- this.$set(this.form, "accountTypeList", this.chargeItme);
- this.$set(this.form, "transferStatusList", this.chargeItme);
- addTransfer(this.form).then(response => {
- this.projectForm.outId = response.data.id
- this.infoForm.transferId = response.data.id
- this.$set(this.projectForm, "ynType", '1');
- if(this.form.capitalExpenditureType==2){
- addProjectto(this.projectForm).then(res => {
- if(this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
-
- })
- }else if(this.form.capitalExpenditureType==4){
- addInfoto(this.infoForm).then(res => {
- if(this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- });
- })
- .catch(() => {
- return false;
- });
- }else{
- this.$set(this.form, "payeeList", this.chargeItme);
- this.$set(this.form, "bankTypeList", this.chargeItme);
- this.$set(this.form, "accountTypeList", this.chargeItme);
- this.$set(this.form, "transferStatusList", this.chargeItme);
- addTransfer(this.form).then(response => {
- this.projectForm.outId = response.data.id
- this.infoForm.transferId = response.data.id
- this.$set(this.projectForm, "ynType", '1');
- if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
- this.uploadFiles1.map((rr1,idx1) => {
- let params1 = new FormData();
- params1.append("tableId", response.data.id);
- params1.append("tableName", "t_yinnong_transfer");
- params1.append("bizPath", "transfer");
- params1.append("fileType", "1");
- params1.append("file", rr1);
- commonAttach(params1).then((r1) => {
- if(idx1 == (_this.uploadFiles1.length-1)){
- if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
- _this.uploadFiles2.map((rr2,idx2) => {
- let params2 = new FormData();
- params2.append("tableId", response.data.id);
- params2.append("tableName", "t_yinnong_transfer");
- params2.append("bizPath", "transfer");
- params2.append("fileType", "2");
- params2.append("file", rr2);
- commonAttach(params2).then((r2) => {
- if(idx2 == (_this.uploadFiles2.length-1)){
- if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
- _this.uploadFiles3.map((rr3,idx3) => {
- let params3 = new FormData();
- params3.append("tableId", response.data.id);
- params3.append("tableName", "t_yinnong_transfer");
- params3.append("bizPath", "transfer");
- params3.append("fileType", "3");
- params3.append("file", rr3);
- commonAttach(params3).then((r3) => {
- if(idx3 == (_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- }
- })
- })
- }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
- _this.uploadFiles3.map((rr3,idx3) => {
- let params3 = new FormData();
- params3.append("tableId", response.data.id);
- params3.append("tableName", "t_yinnong_transfer");
- params3.append("bizPath", "transfer");
- params3.append("fileType", "3");
- params3.append("file", rr3);
- commonAttach(params3).then((r3) => {
- if(idx3 ==(_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- }
- })
- })
- }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
- this.uploadFiles2.map((rr2,idx2) => {
- let params = new FormData();
- params.append("tableId", response.data.id);
- params.append("tableName", "t_yinnong_transfer");
- params.append("bizPath", "transfer");
- params.append("fileType", "2");
- params.append("file", rr2);
- commonAttach(params).then((r2) => {
- if(idx2 == (_this.uploadFiles2.length-1)){
- if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
- _this.uploadFiles3.map((rr3,idx3) => {
- let params3 = new FormData();
- params3.append("tableId", response.data.id);
- params3.append("tableName", "t_yinnong_transfer");
- params3.append("bizPath", "transfer");
- params3.append("fileType", "3");
- params3.append("file", rr3);
- commonAttach(params).then((r3) => {
- if(idx3 == (_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- }
- })
- })
- }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
- this.uploadFiles3.map((rr3,idx3) => {
- let params = new FormData();
- params.append("tableId", response.data.id);
- params.append("tableName", "t_yinnong_transfer");
- params.append("bizPath", "transfer");
- params.append("fileType", "3");
- params.append("file", rr3);
- commonAttach(params).then((r) => {
- if(idx3 == (_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- })
- })
- }else{
- if(this.form.capitalExpenditureType==2){
- addProjectto(this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- } else if(this.form.capitalExpenditureType==4){
- addInfoto(this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- customSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCustomSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- });
- }
- },
- goUpdate(){
- let _this = this
- if(this.chargeItme.length<1){
- this.$notify({ type: 'danger', message: '请添加收款方信息' });
- return;
- }
- if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
- this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
- return;
- }
- if(this.form.capitalExpenditureType==2){
- if(this.projectForm.projectName==""||this.projectForm.projectName==null){
- this.$notify({ type: 'danger', message: '请选择项目名称!' });
- return;
- }
- if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
- this.$notify({ type: 'danger', message: '请输入工程发票号!' });
- return;
- }
- }
- if(this.form.capitalExpenditureType==4){
- if(this.infoForm.name==""||this.infoForm.name==null){
- this.$notify({ type: 'danger', message: '请选择合同名称!' });
- return;
- }
- if(this.infoForm.code==""||this.infoForm.code==null){
- this.$notify({ type: 'danger', message: '请输入合同编码!' });
- return;
- }
- if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
- this.$notify({ type: 'danger', message: '请输入合同价款!' });
- return;
- }
- }
- this.$set(this.form, "payeeList", this.chargeItme);
- this.$set(this.form, "bankTypeList", this.chargeItme);
- this.$set(this.form, "accountTypeList", this.chargeItme);
- this.$set(this.form, "transferStatusList", this.chargeItme);
- addTransfer(this.form).then(response => {
- this.projectForm.outId = response.data.id
- this.infoForm.transferId = response.data.id
- this.$set(this.projectForm, "ynType", '1');
- if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
- this.uploadFiles1.map((rr1,idx1) => {
- let params1 = new FormData();
- params1.append("tableId", response.data.id);
- params1.append("tableName", "t_yinnong_transfer");
- params1.append("bizPath", "transfer");
- params1.append("fileType", "1");
- params1.append("file", rr1);
- commonAttach(params1).then((r1) => {
- if(idx1 == (_this.uploadFiles1.length-1)){
- if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
- _this.uploadFiles2.map((rr2,idx2) => {
- let params2 = new FormData();
- params2.append("tableId", response.data.id);
- params2.append("tableName", "t_yinnong_transfer");
- params2.append("bizPath", "transfer");
- params2.append("fileType", "2");
- params2.append("file", rr2);
- commonAttach(params2).then((r2) => {
- if(idx2 == (_this.uploadFiles2.length-1)){
- if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
- _this.uploadFiles3.map((rr3,idx3) => {
- let params3 = new FormData();
- params3.append("tableId", response.data.id);
- params3.append("tableName", "t_yinnong_transfer");
- params3.append("bizPath", "transfer");
- params3.append("fileType", "3");
- params3.append("file", rr3);
- commonAttach(params3).then((r3) => {
- if(idx3 == (_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- }
- })
- })
- }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
- _this.uploadFiles3.map((rr3,idx3) => {
- let params3 = new FormData();
- params3.append("tableId", response.data.id);
- params3.append("tableName", "t_yinnong_transfer");
- params3.append("bizPath", "transfer");
- params3.append("fileType", "3");
- params3.append("file", rr3);
- commonAttach(params3).then((r3) => {
- if(idx3 ==(_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- }
- })
- })
- }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
- this.uploadFiles2.map((rr2,idx2) => {
- let params = new FormData();
- params.append("tableId", response.data.id);
- params.append("tableName", "t_yinnong_transfer");
- params.append("bizPath", "transfer");
- params.append("fileType", "2");
- params.append("file", rr2);
- commonAttach(params).then((r2) => {
- if(idx2 == (_this.uploadFiles2.length-1)){
- if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
- _this.uploadFiles3.map((rr3,idx3) => {
- let params3 = new FormData();
- params3.append("tableId", response.data.id);
- params3.append("tableName", "t_yinnong_transfer");
- params3.append("bizPath", "transfer");
- params3.append("fileType", "3");
- params3.append("file", rr3);
- commonAttach(params).then((r3) => {
- if(idx3 == (_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- }
- })
- })
- }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
- this.uploadFiles3.map((rr3,idx3) => {
- let params = new FormData();
- params.append("tableId", response.data.id);
- params.append("tableName", "t_yinnong_transfer");
- params.append("bizPath", "transfer");
- params.append("fileType", "3");
- params.append("file", rr3);
- commonAttach(params).then((r) => {
- if(idx3 == (_this.uploadFiles3.length-1)){
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- })
- })
- }else{
- if(this.form.capitalExpenditureType==2){
- addProjectto(this.projectForm).then(res => {
- this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- } else if(this.form.capitalExpenditureType==4){
- addInfoto(this.infoForm).then(res => {
- this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- }
- });
- },
- payeeSelectChange(select, i) {
- let obj = {};
- let fuzhitype = 0;
- obj = this.payeeList.find((account) => {
- //model就是上面的数据源
- return account.id === select ; //筛选出匹配数据
- });
- let _this = this
- if(this.chargeItme != [] && this.chargeItme.length>1){
- this.chargeItme.some((value, index) => {
- if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i&&this.form.bankType != 2){
- fuzhitype = 2;
- return true;
- }
- if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
-
- }else{
- if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
- fuzhitype = 1;
- return true;
- }
- }
- });
- }
- if(fuzhitype == 0){
- this.$set(this.chargeItme[i], "payee",obj.payee)
- this.$set(this.chargeItme[i], "bankType", obj.bankType)
- this.$set(this.chargeItme[i], "payeeId", obj.id);
- this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
- this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
- this.$set(this.chargeItme[i], "accountType", obj.accountType);
- this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
- _this.bankTypeDictionaries.map(rr => {
- if(rr.value==obj.bankType){
- this.$set(this.chargeItme[i], "bankTypeText", rr.text);
- }
- })
-
- }else if(fuzhitype == 1){
- this.$set(this.chargeItme[i], "payee",'')
- this.$set(this.chargeItme[i], "bankType",'')
- this.$set(this.chargeItme[i], "payeeId", '');
- this.$set(this.chargeItme[i], "payeeAccount", '');
- this.$set(this.chargeItme[i], "bankDeposit", '');
- this.$set(this.chargeItme[i], "accountType", '');
- this.$set(this.chargeItme[i], "payeePaymentLines", '');
- this.$set(this.chargeItme[i], "bankTypeText", '');
- this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
- }else if(fuzhitype == 2){
- this.$set(this.chargeItme[i], "payee",'')
- this.$set(this.chargeItme[i], "bankType",'')
- this.$set(this.chargeItme[i], "payeeId", '');
- this.$set(this.chargeItme[i], "payeeAccount", '');
- this.$set(this.chargeItme[i], "bankDeposit", '');
- this.$set(this.chargeItme[i], "accountType", '');
- this.$set(this.chargeItme[i], "payeePaymentLines", '');
- this.$set(this.chargeItme[i], "bankTypeText", '');
- this.$notify({ type: 'danger', message: '收款方已存在!' });
- }
- },
- selectChange(select) {
- let obj = {};
- obj = this.payerOptions.find((account) => {
- //model就是上面的数据源
- return account.id === select; //筛选出匹配数据
- });
- if(obj.accountPassword != null && obj.accountPassword != "" &&
- obj.bankType != null && obj.bankType != ""){
- this.$set(this.form, "bookId", obj.bookId);
- this.$set(this.form, "deptId", obj.deptId);
- this.$set(this.form, "cashierId", obj.id);
- this.$set(this.form, "payer", obj.accountName);
- this.$set(this.form, "payerAccount", obj.bankAccountNumber);
- this.$set(this.form, "operatorCode", obj.operatorCode);
- this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
- this.$set(this.form, "bankType", obj.bankType);
- this.$set(this.form, "bankAccountType", obj.bankAccountType);
- this.$set(this.form, "villageAccountType", obj.villageAccountType);
- this.$set(this.form, "taccountId", obj.taccountId);
- this.$set(this.form, "accountNo", obj.accountNo);
- this.$set(this.form, "cifNo", obj.cifNo);
- this.$set(this.form, "payerFrom", '1');
- if(obj.bankType==1){
- this.form.accountType = "1"
- this.form.isPeers = null
- this.accountTypeChange();
- }else if(obj.bankType==2||obj.bankType==3||obj.bankType==4){
- this.form.accountType = null
- this.form.isPeers = "Y"
- this.accountTypeChange1();
- }else{
- this.payeeList = [];
- this.chargeItme = [];
- this.queryParams.isPeers = null
- this.queryParams.accountType = ""
- this.queryParams.bankType = ""
- this.queryParams.status = "0"
- listPayee(this.queryParams).then((response) => {
- response.rows.map((res,index) => {
- if(res.payeeType==1||res.payeeType==2){
- response.rows[index].text = res.payee;
- response.rows[index].value = res.id;
- this.payeeList.push(res)
- }
- })
- });
- }
- }else{
- if(obj.payerFrom==1){
- this.diglogStatus = false;
- this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
- this.$set(this.form,"payer","")
- this.$set(this.form,"payerAccount","")
- }else{
- this.$set(this.form, "payerFrom", obj.parerFrom);
- if(obj.operatorCode!=null&&obj.operatorCode!=''){
- this.$set(this.form, "operatorCode", obj.operatorCode);
- }else{
- this.$set(this.form, "operatorCode", '');
- }
- if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
- this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
- }else{
- this.$set(this.form, "enterpriseCode", '');
- }
- if(obj.accountPassword!=null&&obj.accountPassword!=''){
- this.$set(this.form, "accountPassword", obj.accountPassword);
- }else{
- this.$set(this.form, "accountPassword", '');
- }
- this.$set(this.form, "bookId",'');
- this.$set(this.form, "deptId", '');
- this.$set(this.form, "cashierId", obj.id);
- this.$set(this.form, "payer", obj.accountName);
- this.$set(this.form, "bankType", obj.bankType);
- if(obj.payerFrom==6){
- getQmyeFlow(obj.bankAccountNumber).then((response) => {
- this.$set(this.form, "payerAccount", response.data);
- });
- }else {
- this.$set(this.form, "payerAccount", obj.bankAccountNumber);
- }
- }
- }
- },
- beforeRead1(file) {
- this.uploadFiles1.push(file.file);
- },
- deleteFile1(file){
- this.uploadFiles1.map((response,index) => {
- if(file.file == response){
- this.uploadFiles1.splice(index,1)
- }
- })
- },
- beforeRead2(file) {
- this.uploadFiles2.push(file.file);
- },
- deleteFile2(file){
- this.uploadFiles2.map((response,index) => {
- if(file.file == response){
- this.uploadFiles2.splice(index,1)
- }
- })
- },
- beforeRead3(file) {
- this.uploadFiles3.push(file.file);
- },
- deleteFile3(file){
- this.uploadFiles3.map((response,index) => {
- if(file.file == response){
- this.uploadFiles3.splice(index,1)
- }
- })
- },
- getFileList(){
- let oData1= {
- tableId: this.$route.query.id,
- tableName: "t_yinnong_transfer",
- bizPath: "transfer",
- fileType: "1",
- }
- attachmentList(oData1).then(res => {
- res.rows.map(r => {
- let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
- this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
- })
- })
- let oData2= {
- tableId: this.$route.query.id,
- tableName: "t_yinnong_transfer",
- bizPath: "transfer",
- fileType: "2",
- }
- attachmentList(oData2).then(res => {
- res.rows.map(r => {
- let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
- this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
- })
- })
- let oData3= {
- tableId: this.$route.query.id,
- tableName: "t_yinnong_transfer",
- bizPath: "transfer",
- fileType: "3",
- }
- attachmentList(oData3).then(res => {
- res.rows.map(r => {
- let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
- this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
- })
- })
- },
- goBack(){
- this.$router.push({path:'/yinnong/approvalList'})
- },
- deleteChargeItme(index){
- this.chargeItme.splice(index,1)
- },
- },
- watch: {
- $route (to, from ) {
- // 监听路由变化, 实现类似 小程序的 onShow 事件
- if (to.path === '/yinnong/approvalAdd') {
- // do anything you want
- console.log("aaa")
- if (this.$route.params.payeeForm){
- this.chargeItme.push(this.$route.params.payeeForm)
- console.log(this.$route.params.payeeForm)
- }
- }
- }
- },
- }
- </script>
-
- <style scoped lang="scss">
- .app-container {
- padding: 2% 0;
- }
- .main_title_box{
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .main_title{
- font-size: 0.4rem;
- color: #1D6FE9;
- margin: 0.2rem 6%;
- position: relative;
- a{
- background: #1989fa;
- color: #ffffff;
- padding: 0.05rem 0.3rem;
- border-radius: 5PX;
- }
- }
- .main_box{
- width: 96%;
- margin: 0 auto;
- border-radius: 6px;
- box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
- overflow: hidden;
- background-color: #FFF;
- }
- .submitButton{
- width: 80%;
- margin: 0 auto;
- background-color: #1D6FE9;
- }
-
- .addFamily{
- //position: absolute;
- //top: -2px;
- //right: 0;
- border-radius: 50%;
- }
- .deleteFamily{
- position: absolute;
- top: 0rem;
- right: 6%;
- z-index: 9;
- border-radius: 50%;
- }
- </style>
|