|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382 |
- <template>
- <div class="app-container">
- <!-- <van-nav-bar-->
- <!-- left-arrow-->
- <!-- fixed-->
- <!-- placeholder-->
- <!-- @click-left="$router.back(-1)"-->
- <!-- >-->
- <!-- <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>-->
-
- <div class="header_main">
- 添加备付金支出申请
- <div class="return_btn" @click="onClickLeft"></div>
- <div class="add_btn" @click="goFlow"></div>
- </div>
-
- <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
- readonly
- required
- label="使用总金额"
- v-model="form.expenditureAmount"
- placeholder="根据下方收款金额自动核算"
- input-align="right"
- label-width="auto"
- />
- <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>
- </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>
-
- <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
- <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 required :rules="[{ required: true , message:'请输入收款方全称' }]" v-model="item.payee" label="收款方" placeholder="请输入收款方全称" input-align="right" label-width="auto"/>
- <van-field required :rules="[{ required: true , message:'请输入联系方式' }]" v-model="item.phone" 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"/>
- <van-field required :rules="[{ required: true , message:'请输入资金用途' }]" v-model="item.remark" label="资金用途" placeholder="请输入资金用途" input-align="right" label-width="auto" />
- </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,
- cashSubmit , offlineCashSubmit, getAccount ,getQmyeFlow,listInfo ,getInfoto ,addInfoto ,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval";
- import request from '@/utils/request'
- import {
- addCash,
- addCashdetail, attachmentList,
- commonAttach, listAccount1,
- updateCash
- } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
- import Dialog from "vant/lib/dialog";
- import moment from "moment";
- export default {
- name: "approvalAdd11",
- 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:{},
- fileList1:[],
- fileList2:[],
- fileList3:[],
- capitalExpenditureType:'',
- payee:'',
- bankType:'',
-
- wfydlxDictionaries:[],
- jglxDictionaries:[],
- sysDictionaries:[],
- capitalExpenditureTypeOptions:[],
- bankTypeDictionaries:[],
- projectFundTypeOptions:[],
- projectFundTypeDictionaries:[],
- projectList:[],
- infoList:[],
- payerOptions:[],
-
- chargeItme:[],
- chargeItmeShow:[],
-
- payeeList:[],
- // 查询参数
- queryParams: {
- cashType:11,
- orderByColumn: "id",
- isAsc: "desc",
- },
- capitalExpenditureOpen:false,
- contractOpen:false,
- projectForm:{
- projectId:null,
- projectName:null,
- projectContractor:null,
- projectAmount:null,
- projectBillNum:null,
- projectFundType:'1',
- outId:null,
- ynType:'2'
- },
- 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:"",
- templateList:[],
- };
- },
- created() {
- this.getNowDate();
- this.reset();
- this.initProjectInfo();
- 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 queryParamsOld={
- accountType: "101",
- status: "N",
- }
- listAccount1(queryParamsOld).then((response) => {
- response.rows.map(res => {
- console.log(res)
- // res['accountName'] = this.$store.state.user.bookName
- // res['id'] = this.$store.state.user.loginBookId
- res['text'] = res.accountName+"余额:"+res.balance
- res['value'] = res.id
- res['bankAccountNumber'] = res.startDay
- res['payerFrom'] = '6'
- this.payerOptions.push(res)
- })
- });
- this.getDictionaries();
- this.addChargeItme();
- 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 :'3'
- };
- 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 = moment(new Date()).format("YYYY-MM-DD");
- },
- initProjectInfo(){
- let _this = this
- let queryParams={
- pageNum: 1,
- pageSize: 100,
- }
- listProject(queryParams).then(response => {
- _this.projectList = response.rows;
- 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 => {
- _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,
- cashType: 11,
- accountType: '2',
- 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:'2'
- }
- },
- getChange(){
- if(this.buttonType == 'update'){
- this.goUpdate();
- }else if(this.buttonType == 'add'){
- this.goAdd();
- }
- },
- getDictionaries(){
- this.getDicts("capital_expenditure_type").then((res) => {
- for (let i = 0; i < res.data.length; i++) {
- this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
- }
- });
- this.getPayeeList();
- },
- getError(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].drawer == ''){
- this.$notify({ type: 'danger', message: '请输入提款人!' });
- return;
- }else if(this.chargeItme.length>0&&this.chargeItme[index-1].remark == ''){
- this.$notify({ type: 'danger', message: '请输入资金用途!' });
- return;
- }
- this.chargeItme.splice(index + 1, 0, {
- payeeId: "", //收款方ID
- payee: "", //收款方全称
- payeeAccount: "", //收款账户
- drawer: "", //提款人
- incomeAmount: "", //提款金额
- bankType: "", //资金用途
- showPayee:false,
- showbankType:false
- });
- },
- getPayeeList() {
- //普通转账
- this.queryParams.accountType = this.form.accountType
- this.queryParams.status = "0"
- listPayee(this.queryParams).then((response) => {
- this.payeeList = response.rows;
- response.rows.map((res,index) => {
- this.payeeList[index].text = res.payee;
- this.payeeList[index].value = res.id;
- })
- });
- },
- payeeDictLabel(datas, value) {
- let 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){
- 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)
- },
- 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.queryParams.accountType = this.form.accountType
- this.queryParams.status = "0"
- listPayee(this.queryParams).then((response) => {
- this.payeeList = response.rows;
- response.rows.map((res,index) => {
- this.payeeList[index].text = res.payee;
- this.payeeList[index].value = res.id;
- })
- });
- },
- goAdd(){
- let _this = this
- if(this.form.payerAccount==0){
- this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });
- return false;
- }else {
- let total = 0;
- this.chargeItme.forEach((money) => {
- total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
- });
- this.$set(this.form, "expenditureAmount", total);
- if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
- this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
- return false;
- }else{
- if(this.chargeItme.length<1){
- this.$notify({ type: 'danger', message: '请添加收款方信息' });
- return false;
- }
- if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
- this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
- return false;
- }
- if(this.form.capitalExpenditureType==2){
- if(this.projectForm.projectName==""||this.projectForm.projectName==null){
- this.$notify({ type: 'danger', message: '请选择项目名称!' });
- return false;
- }
- if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
- this.$notify({ type: 'danger', message: '请输入工程发票号!' });
- return false;
- }
- }
- if(this.form.capitalExpenditureType==4){
- if(this.infoForm.name==""||this.infoForm.name==null){
- this.$notify({ type: 'danger', message: '请选择合同名称!' });
- return false;
- }
- if(this.infoForm.code==""||this.infoForm.code==null){
- this.$notify({ type: 'danger', message: '请输入合同编码!' });
- return false;
- }
- if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
- this.$notify({ type: 'danger', message: '请输入合同价款!' });
- return false;
- }
- }
- 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(() => {
- addCash(this.form).then((response) => {
- this.chargeItme.map((res,idx) => {
- res.cashId = response.data.id
- addCashdetail(res).then(r => {
- if(idx == (_this.chargeItme.length - 1)){
- if(_this.form.capitalExpenditureType==2){
- _this.projectForm.outId = response.data.id
- _this.$set(_this.projectForm, "ynType", '2');
- addProjectto(_this.projectForm).then(res => {
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else if(_this.form.capitalExpenditureType==4){
- _this.infoForm.transferId = response.data.id
- addInfoto(_this.infoForm).then(res => {
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- })
- }
- }
- }
- })
-
- })
- });
- })
- }else{
- addCash(this.form).then((response) => {
- this.chargeItme.map(res => {
- res.cashId = response.data.id
- addCashdetail(res).then(r => {})
- })
- this.projectForm.outId = response.data.id
- this.infoForm.transferId = response.data.id
- this.$set(this.projectForm, "ynType", '2');
- 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", "yinnong");
- 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", "yinnong");
- 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", "yinnong");
- 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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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", "yinnong");
- 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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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", "yinnong");
- 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", "yinnong");
- 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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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", "yinnong");
- 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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- })
- }else{
- if(_this.form.approvalMode === '1'){
- cashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- offlineCashSubmit(response.data.id).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('提交成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }
- }
- }
- });
- }
- }
- }
- },
- goUpdate(){
- let _this = this
- if(this.form.payerAccount==0){
- this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });;
- return false;
- }else {
- let total = 0;
- this.chargeItme.forEach((money) => {
- total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
- });
- this.$set(this.form, "expenditureAmount", total);
- if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
- this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
- return false;
- }else{
- if(this.chargeItme.length<1){
- this.$notify({ type: 'danger', message: '请添加收款方信息' });
- return false;
- }
- if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
- this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
- return false;
- }
- if(this.form.capitalExpenditureType==2){
- if(this.projectForm.projectName==""||this.projectForm.projectName==null){
- this.$notify({ type: 'danger', message: '请选择项目名称!' });
- return false;
- }
- if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
- this.$notify({ type: 'danger', message: '请输入工程发票号!' });
- return false;
- }
- }
- if(this.form.capitalExpenditureType==4){
- if(this.infoForm.name==""||this.infoForm.name==null){
- this.$notify({ type: 'danger', message: '请选择合同名称!' });
- return false;
- }
- if(this.infoForm.code==""||this.infoForm.code==null){
- this.$notify({ type: 'danger', message: '请输入合同编码!' });
- return false;
- }
- if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
- this.$notify({ type: 'danger', message: '请输入合同价款!' });
- return false;
- }
- }
- addCash(this.form).then(response => {
- this.projectForm.outId = response.data.id
- this.infoForm.transferId = response.data.id
- this.$set(this.projectForm, "ynType", '2');
- 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", "yinnong");
- 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", "yinnong");
- 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", "yinnong");
- 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.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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", "yinnong");
- 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.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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", "yinnong");
- 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", "yinnong");
- 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.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- }
- }
- })
- })
- }else{
- if(_this.form.capitalExpenditureType==2){
- addProjectto(_this.projectForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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", "yinnong");
- 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.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(_this.form.capitalExpenditureType==4){
- addInfoto(_this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- }
- }
- })
- })
- }else{
- if(this.form.capitalExpenditureType==2){
- addProjectto(this.projectForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- } else if(this.form.capitalExpenditureType==4){
- addInfoto(this.infoForm).then(res => {
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _this.$toast.success('保存成功');
- setTimeout(function(){
- history.go(-1)
- },2000)
- }
- })
- })
- })
- }else{
- _this.chargeItme.map((resD,b) => {
- resD.cashId = response.data.id
- addCashdetail(resD).then((a,rD) => {
- if(b == (_this.chargeItme.length-1)){
- _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 ; //筛选出匹配数据
- });
- if(this.chargeItme != [] && this.chargeItme.length>1){
- this.chargeItme.some((value, index) => {
- if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
- fuzhitype = 2;
- return true;
- }
- if(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);
- }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.$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.$notify({ type: 'danger', message: '收款方已存在!' });
- }
- },
- selectChange(select) {
- let obj = {};
- obj = this.payerOptions.find((account) => {
- //model就是上面的数据源
- return account.id === select; //筛选出匹配数据
- });
- if(obj.accountType == "101"){
- obj.accountPassword = "";
- }
- 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, "balance", obj.balance);
- 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==4){
- this.form.accountType = null
- this.form.isPeers = "Y"
- this.accountTypeChange1();
- }
- }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.id).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: "yinnong",
- 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: "yinnong",
- 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: "yinnong",
- 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(){
- window.history.go(-1)
- },
- //删除家庭成员
- deleteChargeItme(index){
- this.chargeItme.splice(index,1)
- },
- },
- }
- </script>
-
- <style scoped lang="scss">
- .app-container {
- padding-bottom: 2%;
- .header_main{
- height: 116px;
- background: url('../../../../assets/images/sunVillage_info/list_head.png') no-repeat;
- background-size: 100% 100%;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- font-size: 36px;
- line-height: 116px;
- text-align: center;
- color: #fff;
- position: relative;
- .return_btn{
- width: 24px;
- height: 43.2px;
- background: url('../../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
- background-size: 20px 36px;
- position: absolute;
- left: 38px;
- top: 36px;
- }
- .add_btn{
- width: 20PX;
- height: 20PX;
- background: url('../../../../../static/images/icon/icon_flow.png') center center no-repeat;
- background-size: 20PX 20PX;
- position: absolute;
- right: 38px;
- top: 36px;
- }
- }
- }
- .main_title{
- font-size: 0.4rem;
- color: #1D6FE9;
- margin: 0.2rem 6%;
- position: relative;
- }
- .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>
|