12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035 |
- <template>
- <section>
- <div class="sidebars" ref="sidebars" style="width: 200px;display: block;background: #fff;">
- <div ref="abbisd" style="width: 100%;overflow: hidden;">
- <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>{{ $t('expensereimbursementmodule')
- }}</h3>
- <el-divider></el-divider>
- <el-col :span="12">
- <el-menu default-active="1-1" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff"
- text-color="#666666" :active-text-color="themeColor" style="width:100%">
- <el-submenu index="1">
- <template slot="title">
- <i class="iconfont firerock-icontianbao"></i>
- <span>{{ $t('fillinthestaffexpenses') }}</span>
- </template>
- <el-menu-item index="1-1">
- <p> {{ $t('expenses') }}</p>
- </el-menu-item>
- <!-- <el-menu-item index="1-2"><p @click="ssl(1)">{{ $t('travelexpensess') }}</p></el-menu-item>
- <el-menu-item index="1-3"><p @click="ssl(2)">{{ $t('outsourcingcostshouldbereported') }}</p></el-menu-item> -->
- </el-submenu>
- <el-submenu index="2">
- <template slot="title">
- <i class="iconfont firerock-iconbaoxiaodan"></i>
- <span>{{ permissions.costAll ? $t('listofreimbursementvouchers') : $t('myexpensevoucher') }}</span>
- </template>
- <el-menu-item index="2-1">
- <p @click="bills(false)">{{ $t('documentlist') }}</p>
- </el-menu-item>
- <el-menu-item index="2-2">
- <p @click="bills(true)">{{ $t('documentreview') }}</p>
- </el-menu-item>
- </el-submenu>
- <!-- <el-menu-item index="3" @select="bills" @click="bills(false)" v-if="user.role == 0">
- <i class="iconfont firerock-iconbaoxiaodan"></i>
- <span slot="title">{{user.role == 0?"我的报销凭证":"报销凭证列表"}}</span>
- </el-menu-item> -->
- </el-menu>
- </el-col>
- </div>
- <div class="side" @click="side" ref="sid" style="left: 200px">
- <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
- </div>
- </div>
- <!-- 侧边栏点击事件 -->
- <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
- <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
- </div> -->
- <!-- 内容主体区域 -->
- <div class="contents">
- <div v-if="!displayTable" class="headine" ref="headine">
- <!-- <h3 ref="headHe" style="padding-left: 220px">{{shuz[ins]}}</h3> -->
- <h3 ref="headHe" style="padding-left: 220px">{{ $t('expenses') }}</h3>
- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits" size="mini">{{
- $t('btn.submit') }}</el-button></p>
- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submitUpload" size="mini">{{
- $t('batchupload') }}</el-button></p>
- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="customTypeOp" size="mini"
- v-if="permissions.costAll">{{ $t('expensetypemanagement') }}</el-button></p>
- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="expenseTypeOp" size="mini"
- v-if="permissions.costAll">{{ $t('feiYongZhuLeiXingGuanLi') }}</el-button></p>
- </div>
- <!-- 上面部分 -->
- <div ref="staff" style="margin: 20px 20px 0 220px; width: 81.5%">
- <div class="staff" v-if="!displayTable">
- <!-- 公共 -->
- <div class="public">
- <el-form :model="addForm" ref="mainAddForm" label-width="100px" :rules="addFormRules">
- <!-- <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> -->
- <!-- 报销人 -->
- <el-form-item :label="$t('peopleconcerned')" prop="ownerId">
- <!--普通员工只能自己填报自己的 -->
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.ownerId"
- :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="!permissions.costAudit"
- filterable="true">
- <span v-for="(item, index) in users" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'1'"
- :subject="users" :disabled="!permissions.costAudit" :subjectId="addForm.ownerId" ref="selectCat"
- @selectCal="selectCal"></selectCat>
- </el-form-item>
- <!-- 填报日期 -->
- <el-form-item :label="$t('fillinthedate')" style="position: relative;top: 38px;">
- <el-col :span="11">
- <el-date-picker type="date" :placeholder="$t('optiondate')" v-model="addForm.createDate"
- value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
- </el-col>
- </el-form-item>
- <!-- 发票张数 -->
- <el-form-item :label="$t('invoicenumber')" v-if="this.user.timeType.easyExpense == 0">
- <el-input v-model="addForm.ticketNum" style="width: 150px"></el-input>
- </el-form-item>
- <!-- 费用主类型 -->
- <el-form-item :label="$t('feiYongZhuLeiXing')">
- <el-select v-model="expenseMainTypeValue" style="width: 150px" @change="costMainTypeSwitching">
- <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name"
- :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!-- 第一审核人 -->
- <el-form-item :label="$t('di-yi-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.firstCheckerId"
- :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px"
- filterable="true" :disabled="expenseMainTypeValue == 14454">
- <span v-for="(item, index) in usersNoInfo" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'4'" :disabled="expenseMainTypeValue == 14454"
- :subject="usersNoInfo" :subjectId="addForm.firstCheckerId" ref="selectCat"
- @selectCal="selectCal"></selectCat>
- </el-form-item>
- <!-- 第二审核人 -->
- <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2 && user.companyId != 4811">
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.secondCheckerId"
- :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px"
- filterable="true">
- <span v-for="(item, index) in usersNoInfo" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'5'"
- :subject="usersNoInfo" :subjectId="addForm.secondCheckerId" ref="selectCat"
- @selectCal="selectCal"></selectCat>
- </el-form-item>
- <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2 && user.companyId == 4811 && expenseMainTypeValue != 14454">
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.secondCheckerId"
- :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px"
- filterable="true">
- <span v-for="(item, index) in usersNoInfo" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'5'"
- :subject="usersNoInfo" :subjectId="addForm.secondCheckerId" ref="selectCat"
- @selectCal="selectCal"></selectCat>
- </el-form-item>
- <!-- 备注 -->
- <el-form-item :label="$t('bei-zhu')" style="display: block; width: 70%">
- <el-input type="textarea" v-model="addForm.remark" :autosize="{ minRows: 2, maxRows: 2 }"
- maxlength="100"></el-input>
- </el-form-item>
- <!-- 总费用 -->
- <!-- <div style="float: left; line-height: 55px;margin-left:20px">总费用 <el-link disabled v-model="addForm.totalAmount">{{addForm.totalAmount}}</el-link> 元</div> -->
- </el-form>
- </div>
- <!-- 按钮 -->
- <div class="pu_button">
- <span v-if="totalCost <= 0" style="color:#606266;">{{ $t('totalcostos') }} {{ totalCost }} {{ $t('yuan')
- }}</span>
- <span v-else style="color:#606266;">{{ $t('totalcostos') }} ¥{{ totalCost | numberToCurrency }} {{ $t('yuan')
- }}</span>
- <span class="pu_bu_x" style="margin-left:10px;" @click="addxz"> <i class="el-icon-circle-plus-outline"></i> {{
- $t('newinvoice') }}</span>
- </div>
- <!-- 表格 -->
- <div class="pu_table">
- <el-table :data="invoiceList" border style="width: 100%;height:100%" height="386px" @row-dblclick="dbclick">
- <el-table-column prop="projectName" :label="$t('subordinatetotheproject')" width="180">
- <template slot-scope="scope">
- <el-select size="small" v-model="scope.row.projectId" :placeholder="$t('other.project')"
- style="width: 150px" filterable popper-class="projectSelectPopperClass">
- <el-option v-for="(item, index) in projectList" :key="index"
- :label="item.projectName + item.projectCode" :value="item.id" @click="ok(item)">
- <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="happenDate" :label="$t('forthedate')" width="170px">
- <template slot-scope="scope">
- <el-date-picker size="small" v-model="scope.row.happenDate" type="date" style=" width: 145px"
- value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
- </el-date-picker>
- </template>
- </el-table-column>
- <el-table-column :label="$t('invoices')" width="175px" v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-select size="small" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')"
- style="width: 150px;">
- <el-option :label="$t('vATspecialinvoice')" value="0"></el-option>
- <el-option :label="$t('vATgeneralinvoice')" value="1"></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column :label="$t('costtype')" width="175px">
- <template slot-scope="scope">
- <el-select size="small" v-model="scope.row.expenseType" :placeholder="$t('costtype')"
- style="width: 150px">
- <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName"
- :value="item.typeName"></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column :label="this.user.timeType.easyExpense == 0 ? $t('amountoffees') : '费用金额'" width="135px">
- <template slot-scope="scope">
- <el-input size="small" :id="'upam' + scope.$index" v-model="scope.row.amount" @input="zhi(scope.$index)"
- @change="shiqu(scope.row.amount)" @keyup.native="restrictNumber('upam' + scope.$index)" :disabled="user.companyId == 4811 && user.id != addForm.ownerId && expenseMainTypeValue == 14454"></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="135px"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-model.number="scope.row.invoiceNo"></el-input>
- </template>
- </el-table-column>
- <el-table-column :label="$t('shui-shuai')" width="135px" v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" type="number" v-model="scope.row.taxPercent"
- @input="zhi(scope.$index)"></el-input>
- </template>
- </el-table-column>
- <el-table-column :label="$t('taxs')" width="135px" v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-model="scope.row.taxValue" @input="zhis(scope.$index)" :disabled="user.companyId == 4811 && user.id != addForm.ownerId && expenseMainTypeValue == 14454"></el-input>
- </template>
- </el-table-column>
- <el-table-column :label="$t('bei-zhu')" width="135px">
- <template slot-scope="scope">
- <el-input size="small" v-model="scope.row.remark" :disabled="user.companyId == 4811 && user.id != addForm.ownerId && expenseMainTypeValue == 14454"></el-input>
- </template>
- </el-table-column>
- <el-table-column :label="$t('expensereimbursementvoucher')" width="135px">
- <template slot-scope="scope">
- <!--
- <div @click="abl(scope.$index)">
- <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :before-remove="beforeRemove"
- :http-request="fileonLoad" limit="1" name="multipartFile">
- <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
- </el-upload>
- </div>
- -->
- <div>
- <div v-if="scope.row.pic && scope.row.pic.length > 0">
- <el-button size="small" @click="viewDetailsImage(scope.$index)">{{ $t('Checkthedetails') }}</el-button>
- </div>
- <div v-else>
- <el-button type="primary" size="small" @click="performCustomization(scope.$index)" :loading="listLoading">{{ $t('clickupload') }}</el-button>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column fixed="right" :label="$t('operation')">
- <template slot-scope="scope">
- <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px"
- @click="chanc(scope.$index)">{{ $t('btn.delete') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- <el-button class="submits" type="warning" @click="submits">提交</el-button> -->
- </div>
- </div>
- </div>
- <!-- 多张图片查看详情 -->
- <el-dialog :title="$t('Checkthedetails')" :visible.sync="dialogVisibleImage" width="745px" :before-close="handleClose">
- <div class="dayImge">
- <div class="dayImgeItem" v-if="dialogVisibleImageList">
- <viewer :images="dialogVisibleImageList" v-viewer="viewerOptions" class="dayImgeItem">
- <template v-for="src,i in dialogVisibleImageList" :id="src.url">
- <!-- 图片 -->
- <div class="xiaoImg" v-if="isFileType(src.url) == 'image'">
- <img ref="imgsa" :src="src.url">
- <div class="imgIcon" @click.stop="deteleIpc(apl)" v-if="imgLoadType==1"><i class="el-icon-circle-close"></i></div>
- <div class="imgIcon" @click.stop="deteleIpc(apl, 'ParticularsList', 'invoiceList')" v-if="imgLoadType==2"><i class="el-icon-circle-close"></i></div>
- </div>
- <!-- 文件 -->
- <div class="xiaoImg" v-if="isFileType(src.url) == 'pdf'" @click.stop="openViewPdf(src.url)">
- <img :src="pdfIcons">
- <div class="imgIcon" @click.stop="deteleIpc(apl)" v-if="imgLoadType==1"><i class="el-icon-circle-close"></i></div>
- <div class="imgIcon" @click.stop="deteleIpc(apl, 'ParticularsList', 'invoiceList')" v-if="imgLoadType==2"><i class="el-icon-circle-close"></i></div>
- </div>
- </template>
- <img @click.stop="performCustomization(apl, imgLoadType)" v-if="dialogVisibleImageList.length < 10" :src="require('../../assets/image/aacbc.png')" class="xiaoImg" style="margin-right: 0" />
- </viewer>
- </div>
- </div>
- </el-dialog>
- <!-- 下面部分 -->
- <div class="xiamian" ref="xiaomian"
- :style="'width: ' + (xiamianWidth - 400) + 'px;float:right;background: #fff;position: relative;'">
- <div v-if="displayTable">
- <div style="padding-left:10px;padding-right:10px;">
- <div>
- <el-form label-width="100px" inline>
- <!-- 报销人 -->
- <el-form-item :label="$t('peopleconcerned')">
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ownerId" size="small" clearable
- :placeholder="$t('selecttheapplicant')" style="width: 120px" :disabled="!permissions.costAudit"
- filterable="true">
- <span v-for="(item, index) in users" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :widthStr="'120'" :distinction="'2'"
- :clearable="true" :subject="users" :disabled="!permissions.costAudit" :subjectId="ownerId"
- ref="selectCat" @selectCal="selectCal" :filterable="true"></selectCat>
- </el-form-item>
- <!-- 单据编号 -->
- <el-form-item :label="$t('receiptnumber')">
- <el-input v-model="code" size="small" :placeholder="$t('receiptnumber')" clearable="true"
- style="width: 120px"></el-input>
- </el-form-item>
- <!-- 费用主类型 -->
- <el-form-item :label="$t('feiYongZhuLeiXing')">
- <el-select size="small" v-model="queryExpenseMainType" style="width: 150px" clearable :placeholder="$t('typesof')">
- <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name"
- :value="item.id"></el-option>
- <!-- <el-option :label="$t('yi-ban')" :value="0"></el-option>
- <el-option :label="$t('cha-lv')" :value="1"></el-option>
- <el-option :label="$t('wai-bao')" :value="2"></el-option> -->
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('faFangZhuangTai')" v-if="permissions.costExpenseRelease">
- <el-select v-model="sendState" size="small" style="width: 150px"
- clearable>
- <el-option :label="$t('weiFaFang')" :value="0"></el-option>
- <el-option :label="$t('yiFaFang')" :value="1"></el-option>
- </el-select>
- </el-form-item>
- <!-- 填报日期 -->
- <div style="display: inline-block;">
- <el-form-item :label="$t('other.project')">
- <el-select v-model="selectProject" size="small" style="width: 162px" clearable filterable>
- <el-option v-for="item in projectList" :label="item.projectName" :value="item.id" :key="item.id">
- <span style="float: left">{{ item.projectName }}</span>
- <span style="float: right; color: #8492a6;">{{ item.projectCode }}</span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('fillinthedate')">
- <el-date-picker v-model="date" type="daterange" value-format="yyyy-MM-dd" size="small"
- :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')" style="width: 280px">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button @click="getList" size="small">{{ $t('find') }}</el-button>
- </el-form-item>
- <el-form-item v-if="currentClick == '2-1'">
- <el-button :loading="exportingData" @click="exportDocument()" size="small">{{ $t('danJuDaoChu') }}</el-button>
- </el-form-item>
- <el-form-item v-if="currentClick == '2-1'">
- <el-button :loading="exportingData" @click="exportDocumentFile()" size="small">{{ $t('baoXiaoPingZhengDaoChu') }}</el-button>
- </el-form-item>
- <el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
- <el-button @click="documentIssuance(1)" size="small">{{ $t('faFang') }}</el-button>
- </el-form-item>
- <el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
- <el-button @click="documentIssuance(0)" size="small">{{ $t('quXiaoFaFang') }}</el-button>
- </el-form-item>
- <!-- <span>审核模式:{{ auditTypeItem.auditType }}</span> -->
- </div>
- </el-form>
- </div>
- <el-divider></el-divider>
- <!--列表-->
- <el-table ref="tab" :data="list" @selection-change="handleSelectionChange" highlight-current-row
- v-loading="listLoading" :height="tableHeight - currentClickNum" style="width: 100%;"
- :summary-method="getSummaries" show-summary>
- <el-table-column type="selection" width="55"></el-table-column>
- <el-table-column prop="code" :label="$t('ticketnumber')" width="120"></el-table-column>
- <el-table-column prop="totalAmount" :label="$t('amountof') + '(' + $t('yuan') + ')'" align="center" width="120">
- <template slot-scope="scope">
- <span style="float:right;margin-right:20px">{{ scope.row.totalAmount ? scope.row.totalAmount.toFixed(2) :
- '0' }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="ownerName" :label="$t('peopleconcerned')">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate != 1">
- {{ scope.row.ownerName }}
- </span>
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='scope.row.ownerName'></TranslationOpenDataText>
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="createDate" :label="$t('fillinthedate')" width="100"></el-table-column>
- <el-table-column prop="ticketNum" :label="$t('invoicenumber')"
- v-if="this.user.timeType.easyExpense == 0"></el-table-column>
- <el-table-column prop="type" :label="$t('ppertype')" v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- {{ scope.row.expenseMainTypeName }}
- </template>
- </el-table-column>
- <el-table-column prop="remark" :label="$t('bei-zhu')" width="180">
- <template slot-scope="scope">
- <span style="font-size:12px;">{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="status" :label="$t('state.states')" width="80">
- <template slot-scope="scope">
- <span v-if="scope.row.status == 1" class="waiting">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 2" class="rejected">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 0 || scope.row.status == 3">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 4" style="color: red">{{ statusTxt[scope.row.status] }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="reviewProcess" :label="$t('title.reviewProcess')" width="180" v-if="auditTypeItem.auditType == 2">
- <template slot-scope="scope">
- <span v-if="scope.row.reviewProcess == 0">{{ $t('daiDiYiShenHeRenShenHe') }}</span>
- <span v-if="scope.row.reviewProcess == 1">{{ $t('daiDiErShenHeRenShenHe') }}</span>
- <span v-if="scope.row.reviewProcess == 2">{{ $t('shenHeWanCheng') }}</span>
- <span v-if="scope.row.reviewProcess == 3">未提交</span>
- <span v-if="scope.row.reviewProcess == 4">已驳回</span>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="denyReason" :label="$t('dismissreason')" width="180">
- <template slot-scope="scope">
- <span style="font-size:12px;">{{scope.row.denyReason}}</span>
- </template>
- </el-table-column> -->
- <el-table-column prop="sendState" :label="$t('faFangZhuangTai')" width="80" v-if="permissions.costExpenseRelease">
- <template slot-scope="scope">
- <span :style="`color: ${scope.row.sendState == 0 ? '#FFA500' : ''}`">{{ scope.row.sendState == 1 ? $t('yiFaFang') :
- '未发放' }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="payWayName" :label="$t('zhiFuFangShi')" width="80" v-if="permissions.costExpenseRelease">
- </el-table-column>
- <el-table-column fixed="right" :label="$t('operation')" :width="isAuditList ? 220 : 160">
- <template slot-scope="scope">
- <div v-if="!isAuditList">
- <el-button icon="el-icon-view" circle size="mini"
- @click.stop.native="downloadByA(scope.row)"></el-button>
- <el-button icon="el-icon-edit" circle size="mini" style="margin-left:10px;"
- @click.stop.native="showEditName(scope.row)"
- v-show="permissions.costAudit || scope.row.status == 1 || scope.row.status == 2"></el-button>
- <el-button icon="el-icon-delete" circle size="mini" style="margin-left:10px;"
- @click.stop.native="deleteItem(scope.row)"
- v-show="permissions.costAudit || scope.row.status == 1 || scope.row.status == 2"></el-button>
- </div>
- <div v-if="isAuditList">
- <div v-if="auditTypeItem.auditType == 0 || auditTypeItem.auditType == 2">
- <el-button size="mini" @click.stop.native="downloadByA(scope.row)">{{ $t('cha-kan') }}</el-button>
- <el-button size="mini" style="margin-left:5px;" @click.stop.native="approve(scope.row)">{{
- $t('btn.through') }}</el-button>
- <el-button size="mini" style="margin-left:5px;" @click.stop.native="denyReason(scope.row)">{{
- $t('btn.rejected') }}</el-button>
- </div>
- <div v-if="auditTypeItem.auditType == 1">
- <el-button size="mini" @click.stop.native="approve(scope.row)">{{ $t('other.audit') }}</el-button>
- </div>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条-->
- <el-col :span="24" class="toolbar">
- <el-pagination key="expenseListTblPager" @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :page-sizes="[20, 50, 80, 100]" :page-size="20" :current-page.sync="page"
- layout="total, sizes, prev, pager, next" :total="total" style="float:right;"></el-pagination>
- </el-col>
- </div>
- </div>
- </div>
- <!-- 我的单据报销展示 -->
- <el-dialog :title="$t('detailsofReimbursementvoucher')" :visible.sync="dialog" width="1000px">
- <!-- 内容主体 -->
- <div class="informant"><!-- 报销人 -->
- <el-form :model="ParticularsList" label-width="100px">
- <el-form-item :label="$t('peopleconcerned')" style="width: 270px"
- :rules="{ required: true, message: $t('pleaseselecttheapplicant'), trigger: 'blur' }">
- <el-input v-model="ParticularsList.ownerName"
- :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId"
- v-if="user.userNameNeedTranslate != '1'"></el-input>
- <!-- <el-select v-model="ParticularsList.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
- <span v-for="(item, index) in users" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select> -->
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'"
- :subject="users" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId"
- :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
- </el-form-item>
- <!-- 第一审核人 -->
- <el-form-item :label="$t('di-yi-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ParticularsList.firstCheckerId"
- :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 0 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
- filterable="true">
- <span v-for="(item, index) in users" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'6'"
- :subject="users" :subjectId="ParticularsList.firstCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 0 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
- @selectCal="selectCal"></selectCat>
- </el-form-item>
- <!-- 第二审核人 -->
- <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
- <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ParticularsList.secondCheckerId"
- :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 1 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
- filterable="true">
- <span v-for="(item, index) in users" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'7'"
- :subject="users" :subjectId="ParticularsList.secondCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 1 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
- @selectCal="selectCal"></selectCat>
- </el-form-item>
- <el-form-item :label="$t('fillinthedate')">
- <!-- <el-input v-model="ParticularsList.createDate" :disabled="flg"></el-input> -->
- <el-date-picker type="date" :disabled="flg" :placeholder="$t('optiondate')"
- v-model="ParticularsList.createDate" value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('invoicenumber')">
- <el-input v-enter-number v-model="ParticularsList.ticketNum" :disabled="flg"></el-input>
- </el-form-item>
- <el-form-item :label="$t('costtype')" style="width: 270px">
- <el-select size="small" v-model="ParticularsList.type" style="width: 150px" :disabled="flg">
- <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('bei-zhu')" style="width: 280px">
- <el-input v-model="ParticularsList.remark" :disabled="flg" maxlength="100"></el-input>
- </el-form-item>
- <el-form-item :label="$t('totalcostos')">
- ¥{{ ParticularsList.totalAmount | numberToCurrency }} {{ $t('yuan') }}
- </el-form-item>
- </el-form>
- <div style="height:0;position:relative;" v-if="!flg">
- <span class="newInvoice" @click="addNewInvoice"> <i class="el-icon-circle-plus-outline"></i> {{ $t('newinvoice')
- }}</span>
- </div>
- <el-table :data="ParticularsList.invoiceList" border style="width: 100%">
- <el-table-column prop="status" :label="$t('other.approvalStatus')" width="172" v-if="auditTypeItem.auditType == 1">
- <template slot-scope="scope">
- <span v-if="scope.row.status == 1" class="waiting">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 2" class="rejected">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 0 || scope.row.status == 3">{{ statusTxt[scope.row.status] }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="auditTypeItem.auditType == 1" width="172" :label="$t('other.reviewer')">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='scope.row.projectManagerName'></TranslationOpenDataText>
- </span>
- <span v-else>{{ scope.row.projectManagerName }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="projectId" :label="$t('other.project')" width="155">
- <template slot-scope="scope">
- <el-select size="small" v-if="!flg" v-model="scope.row.projectId" :placeholder="$t('other.project')"
- style="width: 130px">
- <el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName + item.projectCode"
- :value="item.id" @click="ok(item)">
- <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
- <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- <div v-else>
- <span>{{ scope.row.projectName }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="happenDate" :label="$t('forthedate')" width="172">
- <template slot-scope="scope">
- <el-date-picker size="small" v-if="!flg" v-model="scope.row.happenDate" type="date" style=" width: 145px"
- value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
- </el-date-picker>
- <span v-else>{{ scope.row.happenDate }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceType" :label="$t('invoices')" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType"
- :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
- <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
- <el-option :label="$t('vATgeneralinvoice')" :value="1"></el-option>
- </el-select>
- <span v-else>{{ typeInvoic[scope.row.invoiceType] }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceType" :label="$t('costtype')" width="172">
- <template slot-scope="scope">
- <el-select v-if="!flg" size="small" v-model="scope.row.expenseType"
- :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px">
- <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName"
- :value="item.typeName"></el-option>
- </el-select>
- <span v-else>{{ scope.row.expenseType }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="amount" :label="this.user.timeType.easyExpense == 0 ? $t('amountoffees') : '费用金额'"
- width="172">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" :id="'am' + scope.$index" v-model="scope.row.amount"
- @input="zhiNum(scope.$index, scope)" @change="kan"
- @keyup.native="restrictNumber('am' + scope.$index)" :disabled="user.companyId == 4811 && user.id != ParticularsList.ownerId && ParticularsList.type == 14454"></el-input>
- <span v-else>¥{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
- <span v-else>{{ scope.row.invoiceNo }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model="scope.row.taxPercent"
- @input="zhiNum(scope.$index, scope)"></el-input>
- <span v-else>{{ scope.row.taxPercent }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="taxValue" :label="$t('taxs') + '(' + $t('yuan') + ')'" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model="scope.row.taxValue" :disabled="user.companyId == 4811 && user.id != ParticularsList.ownerId && ParticularsList.type == 14454"></el-input>
- <span v-else>¥{{ scope.row.taxValue }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="remark" :label="$t('bei-zhu')" width="300">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model="scope.row.remark" maxlength="100" :disabled="user.companyId == 4811 && user.id != ParticularsList.ownerId && ParticularsList.type == 14454"></el-input>
- <span v-else>{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="pic" :label="$t('expensereimbursementvoucher')" width="300">
- <template slot-scope="scope">
- <!-- <div v-if="!flg">
- <div @click="abl(scope.$index)" style="height: 35px;overflow: hidden;">
- <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :file-list="scope.row.pic"
- :before-remove="beforeRemoves" :http-request="fileonLoads" limit="1" name="multipartFile">
- <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
- </el-upload>
- </div>
- </div>
- <div v-else>
- <span v-if="scope.row.pic">
- <div class="tups">
- <viewer :images="scope.row.pic">
- <img ref="imgsa" v-for="src in scope.row.pic" :src="src.url" :key="src.title">
- </viewer>
- </div>
- </span>
- <span v-else>{{ $t('nodocuments') }}</span>
- </div> -->
- <div>
- <div v-if="scope.row.pic && scope.row.pic.length > 0">
- <el-button size="small" @click="viewDetailsImage(scope.$index, 'ParticularsList', 'invoiceList')">{{ $t('Checkthedetails') }}</el-button>
- </div>
- <div v-else>
- <el-button type="primary" size="small" @click="performCustomization(scope.$index, 2)" :loading="listLoading">{{ $t('clickupload') }}</el-button>
- </div>
- </div>
- </template>
- </el-table-column>
- <!-- 删除 -->
- <el-table-column fixed="right" :label="$t('operation')" v-if="!flg">
- <template slot-scope="scope">
- <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px"
- @click="delec(scope.$index)">{{ $t('btn.delete') }}</el-button>
- </template>
- </el-table-column>
- <el-table-column prop="status" :label="$t('other.audit')" width="172" v-if="auditTypeItem.auditType == 1 && showSingleAudit"
- fixed="right">
- <template slot-scope="scope">
- <el-button v-if="scope.row.isIncharger && scope.row.status == 1"
- @click="approveSingle(scope.row)">{{ $t('btn.through') }}</el-button><el-button
- v-if="scope.row.isIncharger && scope.row.status == 1" @click="denySingle(scope.row)">{{ $t('btn.rejected') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- <viewer :images="imgs">
- <img ref="imgsa" v-for="src in imgs" :src="src.url" :key="src.title">
- </viewer> -->
- <!-- 取消和确定 -->
- <span slot="footer" class="dialog-footer">
- <!-- <el-button @click="print()">打印</el-button> -->
- <el-button @click="dialog = false">{{ $t('btn.cancel') }}</el-button>
- <el-button v-if="!flg" type="primary" @click="present()">{{ $t('btn.determine') }}</el-button>
- <el-button v-else type="primary" @click="dialog = false">{{ $t('btn.determine') }}</el-button>
- </span>
- </el-dialog>
- <!-- 批量上传 -->
- <el-dialog :title="$t('batchupload')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth"
- width="500px">
- <p>1. {{ $t('other.download') }}
- <span>{{ $t('expensereimbursementimporttemplate') }}</span>
- <el-link type="primary" style="margin-left:5px;" :underline="false"
- :href="'./upload/' + $t('expensereimbursementimporttemplate') + '.xlsx'"
- :download="$t('expensereimbursementimporttemplate') + '.xlsx'">{{ $t('expensereimbursementimporttemplate')
- }}.xlsx</el-link>
- </p>
- <p>2. {{ $t('exceltemplateanduploadit') }}。</p>
- <div style="padding-bottom:1em;">
- <div style="width:300px;margin:0 auto">
- <el-upload ref="upload" action="#" :auto-upload="false" multiple :on-change="fileListAdd"
- :on-remove="fileListDel">
- <el-button slot="trigger" size="small" type="primary" style="">{{ $t('selecthefile') }}</el-button>
- <el-button type="primary" size="small" style="margin-left:30px" :underline="false" :loading="importingData"
- @click="submitUploadSure" :disabled="fileList.length == 0">{{ $t('toupload') }}</el-button>
- <el-button size="small" style="margin-left:30px" @click="fileListClear">{{ $t('clears') }}</el-button>
- </el-upload>
- </div>
- </div>
- </el-dialog>
- <!-- 主费用类型自定义 -->
- <el-dialog :title="$t('feiYongLeiXingDaLeiGuanLi')" v-if="expenseTypeDialog" :visible.sync="expenseTypeDialog" customClass="customWidth"
- width="600px">
- <el-table :data="expenseMainTypes" style="width:100%" height="400" :loading="expenseTypeListLoading">
- <el-table-column :label="$t('typename ')" min-width="150">
- <template slot-scope="scope">
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('duiYingChengBenXiang')" min-width="150">
- <template slot-scope="scope">
- <span>{{ scope.row.basecostSettingName }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" width="150">
- <template slot-scope="scope">
- <el-button @click="expenseTypeEditOp(scope.row)" size="small" type="primary">{{ $t('bian-ji') }}</el-button>
- <el-button @click="expenseTypeEditDelete(scope.row)" size="small" type="danger">{{ $t('btn.delete')
- }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="expenseTypeDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="expenseTypeEditOp()" size="medium">{{ $t('newtype') }}</el-button>
- </span>
- <!-- 新增/编辑费用类型 -->
- <el-dialog :title="$t('addeditfeetypes')" v-if="expenseTypeEditDialog" :visible.sync="expenseTypeEditDialog"
- customClass="customWidth" width="400px" append-to-body>
- <el-form label-width="100px" :rules="editExpenseTypeDataRules" ref="editExpenseTypeDataForm"
- :model="editExpenseTypeData">
- <el-form-item :label="$t('typename ')" style="margin:30px 0" prop="typeName">
- <el-input id="editExpenseTypeDataInput" size="medium" v-model="editExpenseTypeData.name"
- :placeholder="$t('customizethfeetypename')" style="width:90%"
- @keyup.native="editExpenseTypeDataInput('editExpenseTypeDataInput')"></el-input>
- </el-form-item>
- <el-form-item :label="$t('duiYingChengBenXiang')" style="margin:30px 0" prop="basecostSettingId">
- <el-select v-model="editExpenseTypeData.basecostSettingId" size="medium" style="width:90%" clearable>
- <el-option v-for="item in basecostSettingList" :key="item.id" :label="item.name" :value="item.id"
- :disabled="item.alarmType == 1"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="expenseTypeEditDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="expenseTypeEditSure" size="medium">{{ $t('btn.determine') }}</el-button>
- </span>
- </el-dialog>
- </el-dialog>
- <!-- 费用类型自定义 -->
- <el-dialog :title="$t('expensetypemanagement')" v-if="customTypeDialog" :visible.sync="customTypeDialog"
- customClass="customWidth" width="600px">
- <el-table :data="customTypeList" style="width:100%" height="400" :loading="customTypeListLoading">
- <el-table-column prop="typeName" :label="$t('costofname')" min-width="150"></el-table-column>
- <el-table-column :label="$t('costtype')" min-width="150">
- <template slot-scope="scope">
- <span>{{ scope.row.expenseMainTypeName }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" width="150">
- <template slot-scope="scope">
- <el-button @click="customTypeEditOp(scope.row)" size="small" type="primary">{{ $t('bian-ji') }}</el-button>
- <el-button @click="customTypeEditDelete(scope.row)" size="small" type="danger">{{ $t('btn.delete')
- }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="customTypeDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="customTypeEditOp()" size="medium">{{ $t('newtype') }}</el-button>
- </span>
- <!-- 新增/编辑费用类型 -->
- <el-dialog :title="$t('addeditfeetypes')" v-if="customTypeEditDialog" :visible.sync="customTypeEditDialog"
- customClass="customWidth" width="400px" append-to-body>
- <el-form label-width="80px" :rules="editTypeDataRules" ref="editTypeDataForm" :model="editTypeData">
- <el-form-item :label="$t('belongstype')" style="margin:30px 0">
- <el-select v-model="editTypeData.mainType" size="medium" style="width:90%">
- <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('typename ')" style="margin:30px 0" prop="typeName">
- <el-input id="editTypeDataInput" size="medium" v-model="editTypeData.typeName"
- :placeholder="$t('customizethfeetypename')" style="width:90%"
- @keyup.native="editTypeDataInput('editTypeDataInput')"></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="customTypeEditDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="customTypeEditSure" size="medium">{{ $t('btn.determine') }}</el-button>
- </span>
- </el-dialog>
- </el-dialog>
- <!-- 驳回弹出框 -->
- <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog"
- :close-on-click-modal="false" customClass="customWidth" width="500px">
- <div>
- <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="denyReasonDialog = false">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="deny()">{{ $t('btn.determine') }}</el-button>
- </div>
- </el-dialog>
- <!-- 详情查看弹出框 -->
- <el-dialog :title="$t('detailsofReimbursementvoucher')" :visible.sync="detailDialog" width="1100px" :before-close="handleClose">
- <div ref="printContent" class="printContent">
- <div class="printContent-detail">
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('peopleconcerned') }}</span> </span>
- <span class="detail-item-content">
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='ParticularsList.ownerName'></TranslationOpenDataText>
- </span>
- <span v-else>{{ ParticularsList.ownerName }}</span>
- </span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"><span class="printBox">{{ $t('tianBaoShiJian') }}</span></span>
- <span class="detail-item-content">{{ ParticularsList.createDate }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"><span class="printBox">{{ $t('invoicenumber') }}</span></span>
- <span class="detail-item-content">{{ ParticularsList.ticketNum }} {{ $t('zhang') }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"><span class="printBox">{{ $t('feiYongLeiXing') }}</span></span>
- <span class="detail-item-content">{{ detaExpenseMainTypeName }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"><span class="printBox">{{ $t('totalcostos') }}</span></span>
- <span class="detail-item-content">¥ {{ ParticularsList.totalAmount | numberToCurrency }}</span>
- </div>
- <div class="detail-item" style="width: 100%">
- <span class="detail-item-title"><span class="printBox">{{ $t('bei-zhu') }}</span></span>
- <span class="detail-item-content">{{ ParticularsList.remark }}</span>
- </div>
- </div>
- <!-- <el-table :data="ParticularsList.invoiceList" border style="width: 100%">
- <el-table-column prop="projectId" :label="$t('other.project')" width="155">
- <el-table-column prop="status" label="审核状态" width="172" v-if="auditTypeItem.auditType == 1">
- <template slot-scope="scope">
- <span v-if="scope.row.status == 1" class="waiting">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 2" class="rejected">{{ statusTxt[scope.row.status] }}</span>
- <span v-if="scope.row.status == 0 || scope.row.status == 3">{{ statusTxt[scope.row.status] }}</span>
- </template>
- </el-table-column>
- <template slot-scope="scope">
- <el-select size="small" v-if="!flg" v-model="scope.row.projectId" :placeholder="$t('other.project')"
- style="width: 130px">
- <el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName + item.projectCode"
- :value="item.id" @click="ok(item)">
- <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
- <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- <div v-else>
- <div v-for="(item, index) in projectIdName" :key="index">
- <span v-if="item.id == scope.row.projectId">{{ item.projectName }}</span>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="happenDate" :label="$t('forthedate')" width="172">
- <template slot-scope="scope">
- <el-date-picker size="small" v-if="!flg" v-model="scope.row.happenDate" type="date" style=" width: 145px"
- value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
- </el-date-picker>
- <span v-else>{{ scope.row.happenDate }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceType" :label="$t('invoices')" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType"
- :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
- <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
- <el-option :label="$t('vATgeneralinvoice')" :value="1"></el-option>
- </el-select>
- <span v-else>{{ typeInvoic[scope.row.invoiceType] }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceType" :label="$t('costtype')" width="172">
- <template slot-scope="scope">
- <el-select v-if="!flg" size="small" v-model="scope.row.expenseType"
- :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px">
- <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName"
- :value="item.typeName"></el-option>
- </el-select>
- <span v-else>{{ scope.row.expenseType }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="amount" :label="this.user.timeType.easyExpense == 0 ? $t('amountoffees') : '费用金额'"
- width="172">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" :id="'am' + scope.$index" v-model="scope.row.amount"
- @input="zhiNum(scope.$index, scope)" @change="kan"
- @keyup.native="restrictNumber('am' + scope.$index)"></el-input>
- <span v-else>¥{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
- <span v-else>{{ scope.row.invoiceNo }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model="scope.row.taxPercent"
- @input="zhiNum(scope.$index, scope)"></el-input>
- <span v-else>{{ scope.row.taxPercent }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="taxValue" :label="$t('taxs') + '(' + $t('yuan') + ')'" width="172"
- v-if="this.user.timeType.easyExpense == 0">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model="scope.row.taxValue"></el-input>
- <span v-else>¥{{ scope.row.taxValue }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="remark" :label="$t('bei-zhu')" width="300">
- <template slot-scope="scope">
- <el-input size="small" v-if="!flg" v-model="scope.row.remark" maxlength="100"></el-input>
- <span v-else>{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="pic" :label="$t('expensereimbursementvoucher')" width="300">
- <template slot-scope="scope">
- <div v-if="!flg">
- <div @click="abl(scope.$index)" style="height: 35px;overflow: hidden;">
- <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :file-list="scope.row.pic"
- :before-remove="beforeRemoves" :http-request="fileonLoads" limit="1" name="multipartFile">
- <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
- </el-upload>
- </div>
- </div>
- <div v-else>
- <span v-if="scope.row.pic">
- <div class="tups">
- <viewer :images="scope.row.pic">
- <img ref="imgsa" v-for="src in scope.row.pic" :src="src.url" :key="src.title">
- </viewer>
- </div>
- </span>
- <span v-else>{{ $t('nodocuments') }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column fixed="right" :label="$t('operation')" v-if="!flg">
- <template slot-scope="scope">
- <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px"
- @click="delec(scope.$index)">{{ $t('btn.delete') }}</el-button>
- </template>
- </el-table-column>
- </el-table> -->
- <!-- 卡片列表 -->
- <div class="conter-box">
- <div class="conter-border" v-for="item, index in ParticularsList.invoiceList" :key="index">
- <div class="detail-item" v-if="auditTypeItem.auditType != 1">
- <span class="detail-item-title"> <span class="printBox">{{ $t('other.project') }}</span> </span>
- <span class="detail-item-content">
- {{ item.projectName }}
- <!-- <el-select size="small" v-if="!flg" v-model="item.projectId" :placeholder="$t('other.project')"
- style="width: 130px">
- <el-option v-for="(item, index) in projectList" :key="index"
- :label="item.projectName + item.projectCode" :value="item.id" @click="ok(item)">
- <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
- <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- <div v-else>
- <div v-for="(item, index) in projectIdName" :key="index">
- <span v-if="item.id == item.projectId">{{ item.projectName }}</span>
- </div>
- </div> -->
- </span>
- </div>
- <div class="detail-item" v-if="auditTypeItem.auditType == 1">
- <span class="detail-item-title"> <span class="printBox">{{ $t('xiangMuShenHeZhuangTai') }}</span> </span>
- <span class="detail-item-content">
- <span v-if="item.status == 1" class="waiting">{{ statusTxt[item.status] }}</span>
- <span v-if="item.status == 2" class="rejected">{{ statusTxt[item.status] }}</span>
- <span v-if="item.status == 0 || item.status == 3">{{ statusTxt[item.status] }}</span>
- </span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('forthedate') }}</span> </span>
- <span class="detail-item-content">{{ item.happenDate }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('invoices') }}</span> </span>
- <span class="detail-item-content">{{ typeInvoic[item.invoiceType] }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('costtype') }}</span> </span>
- <span class="detail-item-content">{{ item.expenseType }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title single"> <span class="printBox">{{ $t('feiYongJineHanShui') }}</span> </span>
- <span class="detail-item-content">{{ item.amount }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('invoiceno') }}</span> </span>
- <span class="detail-item-content">{{ item.invoiceNo }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('shui-shuai') }}</span> </span>
- <span class="detail-item-content">{{ item.taxValue }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('taxs') }}</span> </span>
- <span class="detail-item-content">{{ item.taxValue ? `¥${item.taxValue}` : '' }}</span>
- </div>
- <div class="detail-item">
- <span class="detail-item-title"> <span class="printBox">{{ $t('bei-zhu') }}</span> </span>
- <span class="detail-item-content">{{ item.remark }}</span>
- </div>
- <div class="detail-item" style="display: flex">
- <span class="detail-item-title"> <span class="printBox">{{ $t('expensereimbursementvoucher') }}</span> </span>
- <div class="detail-item-content">
- <div v-if="item.pic" style="display: inline-block;">
- <div class="tups">
- <!-- <viewer :images="item.pic">
- <img ref="imgsa" v-for="src in item.pic" :src="src.url" :key="src.title">
- </viewer> -->
- <viewer :images="item.pic">
- <template v-for="src,i in item.pic" :id="src.url">
- <img ref="imgsa" :src="src.url" v-if="isFileType(src.url) == 'image'">
- <img :src="pdfIcons" v-if="isFileType(src.url) == 'pdf'" @click.stop="openViewPdf(src.url)">
- </template>
- </viewer>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="print()">{{ $t('daYin') }}</el-button>
- <el-button @click="detailDialog = false">{{ $t('guanBi') }}</el-button>
- </span>
- </el-dialog>
- <!-- 自定义图片上传 -->
- <div class="customIamgeLoad">
- <input id="uploadInput" ref="uploadInput" type="file" class="file" @change="fileMultLoad" multiple accept="image/jpg,image/png,application/pdf" />
- </div>
- <!-- 发放支付方式 -->
- <el-dialog :title="$t('faFangFangShi')" :visible.sync="dialogVisibleRelease" width="400px" :before-close="handleClose">
- <div>
- <el-select v-model="releaseData.id" :placeholder="$t('qingXuanZeZhiFuFangShi')" style="width: 100%" clearable>
- <el-option v-for="item in sendStateList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleRelease = false">{{ $t('quXiao') }}</el-button>
- <el-button type="primary" @click="callingInterface(1, releaseData.data)">{{ $t('queDing') }}</el-button>
- </span>
- </el-dialog>
- </section>
- </template>
- <script>
- // 自定义select组件
- import selectCat from "@/components/select.vue"
- // 引入自定义级联组件
- import vueCascader from "@/components/cascader.vue"
- import { getThemeColor } from '@/utils/commonMethod.js'
- export default {
- name: "expense",
- components: {
- selectCat,
- vueCascader
- },
- props: {},
- data() {
- return {
- themeColor: getThemeColor(),
- pdfIcons: require('@/assets/image/pdfIcon.png'),
- showSingleAudit: false,
- auditTypeItem: { auditType: 0 },
- queryExpenseMainType: null,
- denyReasonDialog: false,
- denyForm: {
- reason: '',
- id: null
- },
- basecostSettingList: [],
- exportingData:false,
- fileList: [],
- muHeight: document.documentElement.clientHeight || document.body.clientHeight,
- xiamianWidth: document.documentElement.clientWidth || document.body.clientWidth,
- imgs: [],
- addFormRules: {
- ownerId: [{ required: true, message: this.$t('pleaseselecttheapplicant'), trigger: "blur" }],
- createDate: [{ required: true, message: this.$t('pleaseselectadate'), trigger: "blur" }],
- },
- isAuditList: false,
- statusTxt: [this.$t('state.approved'), this.$t('state.WaitingAudit'), this.$t('state.rejected'), this.$t('state.undone'), '未填写'],
- user: JSON.parse(sessionStorage.getItem("user")),
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- allExpList: [],
- expenseTypeList: [],
- tian: { a: null, b: null, c: null, d: null, e: null, f: null, g: null, h: null, },
- typeInvoic: [this.$t('vATspecialinvoice'), this.$t('vATgeneralinvoice')],
- listLoading: false,
- tableHeight: 0,
- list: [],
- total: 0,
- code: null,
- date: null,
- type: null,
- ownerId: null,
- users: [], // 人员信息
- usersNoInfo: [], // 人员信息,去掉自己
- displayTable: false,
- getLists: [],
- ProjectList: [], // 项目列表
- companyId: [], // 人员的id
- dialogVisible: false,
- code: null,
- addForm: { code: null, ownerId: null, createDate: null, ticketNum: 1, type: 0, remark: null, totalAmount: 0, },
- page: 1,
- size: 20,
- form: { happenDate: null, invoiceType: null, amount: null, invoiceNo: null, taxPercent: null, taxValue: null, remark: null },
- invoiceList: [],
- kkk: null, //
- ddId: null,
- dldl: [],
- isOK: false,
- z: null,
- value: null,
- dialog: false, // 单据查看展示
- ParticularsList: [],
- projectIdName: [], // 点击查看的项目名
- flg: false, // 是否禁用
- shuz: [this.$t('generalexpenses'), this.$t('travelexpensess'), this.$t('outsourcingcostshouldbereported')],
- ins: 0,
- apl: '',
- diz: 'http://worktime.ttkuaiban.com',
- importDialog: false,
- importingData: false,
- currentClick: '',
- currentClickNum: 0,
- // 费用类型自定义
- customTypeDialog: false,
- customTypeList: [],
- customTypeListLoading: false,
- customTypeEditDialog: false,
- editTypeData: {},
- editTypeDataRules: {
- typeName: [{ required: true, message: this.$t('pleaseentercustomfeetypename'), trigger: "blur" }],
- },
- expenseMainTypes: [],
- expenseMainTypeValue: '',
- expenseTypeDialog: false,
- expenseTypeListLoading: false,
- expenseTypeEditDialog: false,
- editExpenseTypeData: {},
- editExpenseTypeDataRules: {
- name: [{ required: true, message: this.$t('pleaseentercustomfeetypename'), trigger: "blur" }],
- },
- // 详情弹出框
- detailDialog: false,
- detaExpenseMainTypeName: '',
- multipleSelection: [],
- sendState: '',
- dialogVisibleImage: false,
- dialogVisibleImageList: [],
- imgLoadType: 1, // 1 为 费用填报的图片上传 2 单据修改的图片上传
- releaseData: {
- id: '',
- data: '',
- }, // 发放数据
- sendStateList: [], // 发放状态列表
- dialogVisibleRelease: false, // 发放弹出框
- selectProject: null, // 项目选择
- };
- },
- computed: {
- totalCost: function () {
- let num = 0
- for (let i in this.invoiceList) {
- if (this.invoiceList[i].amount) {
- num += this.invoiceList[i].amount * 1
- }
- }
- return num
- }
- },
- watch: {},
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 195;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 195;
- };
- },
- mounted() {
- this.getNextCode();
- this.getUsers() // 获取人员信息
- this.getList() // 获取单据列表
- this.getProjectList();
- this.getExpensMainTypes();
- this.getExpList();
- this.getBasecostItemList();
- this.getAuditType();
- this.getSendStateList();
- },
- filters: {
- numberToCurrency(value) {
- if (!value) return '0.00'
- // console.log('v=='+value);
- value = value.toFixed(2)
- const intPart = Math.trunc(value)
- const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
- let floatPart = '.00'
- const valueArray = value.toString().split('.')
- if (valueArray.length === 2) { // 有小数部分
- floatPart = valueArray[1].toString() // 取得小数部分
- return intPartFormat + '.' + floatPart
- }
- return intPartFormat + floatPart
- }
- },
- methods: {
- getBasecostItemList() {
- this.http.post('/project-basecost-setting/list', {},
- res => {
- if (res.code == 'ok') {
- this.basecostSettingList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- }, err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 费用类型自定义
- customTypeOp() {
- this.customTypeDialog = true
- this.customTypeListLoading = true
- },
- customTypeEditOp(row) {
- this.customTypeEditDialog = true
- if (row) {
- this.editTypeData = row
- } else {
- this.editTypeData = {
- mainType: '',
- typeName: '',
- companyId: this.user.companyId
- }
- }
- },
- customTypeEditSure() {
- this.$refs.editTypeDataForm.validate(valid => {
- if (valid) {
- this.http.post('/expense-type/addOrMod', this.editTypeData,
- res => {
- if (res.code == 'ok') {
- this.customTypeEditDialog = false
- this.customTypeOp()
- this.getExpList()
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- }, err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- }
- })
- },
- customTypeEditDelete(row) {
- this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'warning'
- }).then(() => {
- this.http.post('/expense-type/delete', {
- id: row.id
- },
- res => {
- if (res.code == 'ok') {
- this.customTypeEditDialog = false
- this.customTypeOp()
- this.getExpList()
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- }, err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: this.$t('thedeletionhasbeencancelled')
- })
- })
- },
- editTypeDataInput(typeName) {
- let inpu = document.getElementById(typeName);
- inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
- },
- // 费用主类型自定义
- expenseTypeOp() {
- this.expenseTypeDialog = true
- this.customTypeListLoading = true
- },
- expenseTypeEditOp(row) {
- this.expenseTypeEditDialog = true
- if (row) {
- this.editExpenseTypeData = row
- } else {
- this.editExpenseTypeData = {
- isSystem: 0,
- name: '',
- companyId: this.user.companyId
- }
- }
- },
- expenseTypeEditSure() {
- this.$refs.editExpenseTypeDataForm.validate(valid => {
- if (valid) {
- this.http.post('/expense-main-type/addOrMod', this.editExpenseTypeData,
- res => {
- if (res.code == 'ok') {
- this.expenseTypeEditDialog = false
- this.expenseTypeOp()
- this.getExpensMainTypes()
- this.getExpList()
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- }, err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- }
- })
- },
- expenseTypeEditDelete(row) {
- this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'warning'
- }).then(() => {
- this.http.post('/expense-main-type/delete', {
- id: row.id
- },
- res => {
- if (res.code == 'ok') {
- this.expenseTypeEditDialog = false
- this.expenseTypeOp()
- this.getExpensMainTypes()
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- }, err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: this.$t('thedeletionhasbeencancelled')
- })
- })
- },
- expenseTypeDataInput(typeName) {
- let inpu = document.getElementById(typeName);
- inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
- },
- editExpenseTypeDataInput(name) {
- let inpu = document.getElementById(name);
- inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
- },
- submitUpload() {
- this.importDialog = true
- },
- fileListAdd(file, fileList) {
- let str = file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- fileList.splice(fileList.length - 1)
- }
- this.fileList = fileList
- },
- fileListDel(file, fileList) {
- this.fileList = fileList
- },
- fileListClear() {
- this.$refs.upload.clearFiles();
- this.fileList = []
- },
- submitUploadSure() {
- this.$confirm(this.$t('confirmtoupload'), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'success'
- }).then(() => {
- let formData = new FormData();
- for (let i in this.fileList) {
- formData.append("files", this.fileList[i].raw);
- }
- this.importingData = true
- // console.log(formData,this.fileList);
- // return
- this.http.uploadFile('/expense-sheet/importData', formData,
- res => {
- if (res.code == "ok") {
- this.importingData = false
- this.$refs.upload.clearFiles();
- this.fileList = []
- this.$message({
- message: this.$t('uploadedsuccessfully'),
- type: "success"
- });
- } else {
- this.importingData = false
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- }, error => {
- this.importingData = false
- this.$message({
- message: error,
- type: "error"
- });
- });
- }).catch(() => { })
- },
- restrictNumber(targetId) {
- let inpu = document.getElementById(targetId);
- inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
- inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
- inpu.value = inpu.value.replace(".", "$#*").replace(/\./g, '').replace('$#*', '.');//去除其他"."
- inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
- if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
- inpu.value = parseFloat(inpu.value);
- }
- },
- approveSingle(item) {
- this.http.post('/expense-sheet/approveSingleProject', {
- id: item.id
- },
- res => {
- if (res.code == "ok") {
- this.getList();
- // this.dialog = false;
- this.getParticulars(item.expenseId);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- approve(item) {
- if (this.auditTypeItem.auditType == 0 || this.auditTypeItem.auditType == 2) {
- //默认模式,按有审核权限的人直接审核
- this.showSingleAudit = false;
- //审核通过
- this.http.post('/expense-sheet/approve', {
- id: item.id
- },
- res => {
- if (res.code == "ok") {
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- } else if (this.auditTypeItem.auditType == 1){
- //项目经理按项目逐条审核
- this.showSingleAudit = true;
- this.downloadByA(item);
- }
-
- },
- denySingle(item) {
- //项目经理审核模式
- this.http.post('/expense-sheet/denySingleProject', {
- id: item.id
- },
- res => {
- if (res.code == "ok") {
- this.dialog = false;
- this.showSingleAudit = false;
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- denyReason(item) {
- if (this.auditTypeItem.auditType == 0 || this.auditTypeItem.auditType == 2) {
- this.denyForm.id = item.id
- this.denyForm.reason = ''
- // this.denyReasonDialog = true
- this.deny()
- } else {
- this.downloadByA(item);
- this.showSingleAudit = true;
- }
- },
- deny() {
- //审核驳回
- this.http.post('/expense-sheet/deny', {
- id: this.denyForm.id,
- denyReason: this.denyForm.reason
- },
- res => {
- if (res.code == "ok") {
- this.denyReasonDialog = false
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- costMainTypeSwitching() {
- if(this.user.companyId == 4811 && this.expenseMainTypeValue == 14454) {
- this.addForm.firstCheckerId = this.user.id
- }
- this.getExpList()
- },
- getExpList() {
- this.http.post('/expense-type/getList', {
- },
- res => {
- this.customTypeListLoading = false
- if (res.code == "ok") {
- this.allExpList = res.data;
- this.customTypeList = res.data
- this.addForm.type = this.expenseMainTypeValue
- this.expenseTypeList = this.allExpList.filter(a => a.mainType == this.expenseMainTypeValue);
- this.invoiceList = []
- if (!res.data != res.data.length == 0) {
- this.http.post('/company/settingExpenseType', {}, res => {
- if (res.code == 'ok') { } else { this.$message({ message: res.msg, type: 'error' }) }
- }, err => { this.$message({ message: err, type: 'error' }) })
- }
- for (let i in this.invoiceList) {
- this.invoiceList[i].expenseType = ''
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.customTypeListLoading = false
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getExpensMainTypes() {
- this.http.post('/expense-main-type/list', {
- },
- res => {
- if (res.code == "ok") {
- this.expenseMainTypes = res.data
- this.expenseMainTypeValue = this.expenseMainTypes[0].id
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 单据查看
- downloadByA(val) {
- if (val.status == 0) {
- this.detailDialog = true
- } else {
- this.dialog = true
- }
- console.log(val, '看看数据来源')
- this.detaExpenseMainTypeName = val.expenseMainTypeName
- this.flg = true;
- this.getParticulars(val.id);
- this.expenseTypeList = this.allExpList.filter(a => a.mainType == val.type);
- },
- // 单据编辑
- showEditName(val) {
- this.dialog = true,
- this.flg = false,
- delete val.invoiceList
- this.getParticulars(val.id)
- this.expenseTypeList = this.allExpList.filter(a => a.mainType == val.type);
- },
- staffs(key, keyPath) { // 控制员工费用报表
- if (keyPath[0] == '1') {
- this.displayTable = false;
- } else {
- this.displayTable = true;
- this.getList();
- }
- // currentClick
- // console.log(key, keyPath)
- this.currentClick = key
- key == '2-1' ? this.currentClickNum = 70 : this.currentClickNum = 0
- },
- bills(audit) { // 控制
- this.isAuditList = audit;
- this.displayTable = true;
- },
- present() {
- this.adds();
- },
- // 删除操作
- delec(ids) {
- // console.log('删除操作', ids);
- this.ParticularsList.invoiceList.splice(ids, 1)
- this.ParticularsList.ticketNum = this.ParticularsList.invoiceList.length
- this.kan()
- },
- adds() {
- var paramData = JSON.parse(JSON.stringify(this.ParticularsList));
- var spl = paramData.invoiceList
- for (var i in spl) {
- if (spl[i].pic) {
- spl[i].pic = spl[i].pic.map(a => a.name).join(',')
- }
- }
- console.log(paramData, '<== paramData')
- let noAmount = paramData.invoiceList.filter(item => !item.amount)
- if(noAmount.length > 0) {
- if(this.user.companyId != 4811 && this.ParticularsList.type != 14454 && this.user.id != this.ParticularsList.ownerId) {
- this.$message({
- message: this.$t('qingTianXieWanZhengFeiYongJinE'),
- type: "error"
- });
- return;
- }
- }
- paramData.items = JSON.stringify(paramData.invoiceList)//这里要传发票列表的json转string
- // console.log(paramData, '<== paramData')
- // return
- delete paramData.invoiceList
- this.http.post('/expense-sheet/add', paramData,
- res => {
- if (res.code == "ok") {
- this.dialog = false;
- this.bills(this.isAuditList);
- this.getList()
- this.$message({
- message: this.$t('editsuccess'),
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取人员信息
- getUsers() {
- // this.http.post(this.port.manage.list, {
- // departmentId: -1,
- // pageIndex: 1,
- // // pageSize: 99999
- // pageSize: -1
- // },
- this.http.post('/user/getSimpleActiveUserList', {},
- res => {
- if (res.code == "ok") {
- // this.users = res.data.records;
- const { id } = JSON.parse(sessionStorage.getItem('user'))
- this.users = res.data;
- // this.usersNoInfo = res.data.filter(item => item.id != id)
- this.usersNoInfo = res.data
- if (!this.permissions.costAudit) {
- this.addForm.ownerId = this.user.id;
- this.addForm.status = 1;
- this.$forceUpdate()
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 提交事件
- submits() {
- this.$refs.mainAddForm.validate(valid => {
- if (valid) {
- if(this.auditTypeItem.auditType == 2 && (!this.addForm.firstCheckerId || !this.addForm.secondCheckerId)) {
- if(this.user.id != 4811 && this.expenseMainTypeValue != 14454) {
- this.$message({
- message: !this.addForm.firstCheckerId ? this.$t('qingXuanZeDiYiShenHeRen') : this.$t('qingXuanZeDiErShenHeRen'),
- type: "error"
- });
- return;
- }
- }
- if (this.invoiceList.length == 0) {
- this.$message({
- message: this.$t('pleaseaddtheinvoice'),
- type: "error"
- });
- return;
- }
- let strObj = {
- project: '',
- datas: '',
- fptype: '',
- fyType: '',
- rmb: '',
- flg: false
- }
- for (var i in this.invoiceList) {
- if (!this.invoiceList[i].projectId) {
- strObj.project = this.$t('subordinatetotheproject')
- strObj.flg = true
- }
- // if(!this.invoiceList[i].invoiceType || this.invoiceList[i].invoiceType == '') {
- // strObj.fptype = '发票种类'
- // strObj.flg = true
- // }
- if (!this.invoiceList[i].expenseType || this.invoiceList[i].expenseType == '') {
- strObj.fyType = this.$t('costtype')
- strObj.flg = true
- }
- if (!this.invoiceList[i].happenDate || this.invoiceList[i].happenDate == '') {
- strObj.datas = this.$t('forthedate')
- strObj.flg = true
- }
- if(this.user.companyId != 4811 && this.expenseMainTypeValue != 14454 && this.user.id != this.addForm.ownerId) {
- if (!this.invoiceList[i].amount || this.invoiceList[i].amount == '') {
- strObj.rmb = this.$t('feiYongJinE')
- strObj.flg = true
- }
- }
- }
- if (strObj.flg) {
- this.$message({
- message: `${strObj.project} ${strObj.fptype} ${strObj.fyType} ${strObj.datas} ${strObj.rmb} ${this.$t('qingTianXieWanZheng')}`,
- type: "error"
- });
- return;
- }
- // return
- this.add();
- }
- });
- },
- // 点击新增
- addxz() {
- this.form = { happenDate: null, invoiceType: null, amount: null, invoiceNo: null, taxPercent: null, taxValue: null, remark: null, pic: null },
- this.invoiceList.push(this.form)
- },
- addNewInvoice() {
- this.form = { happenDate: null, invoiceType: null, amount: null, invoiceNo: null, taxPercent: null, taxValue: null, remark: null, pic: null },
- this.ParticularsList.invoiceList.push(this.form)
- this.ParticularsList.ticketNum = this.ParticularsList.invoiceList.length
- },
- //获取项目列表
- getProjectList() {
- this.http.post(this.port.project.list, {},
- res => {
- if (res.code == "ok") {
- //费用报销界面选择项目只针对进行中的
- this.projectList = res.data.filter(i =>i.status==1);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取审核模式
- getAuditType() {
- this.http.post('/expense-audit-setting/get', {},
- res => {
- if (res.code == "ok") {
- this.auditTypeItem = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取单据列表
- getList() {
- // console.log(this.date)
- var stat = ''
- var end = ''
- if (this.date) {
- stat = this.date[0]
- end = this.date[1]
- }
- var param = {
- pageIndex: this.page,
- pageSize: this.size,
- code: this.code,
- // createDate: this.date,
- startDate: stat,
- endDate: end,
- ownerId: this.ownerId,
- type: this.queryExpenseMainType,
- projectId: this.selectProject ? this.selectProject : null,
- };
- if (this.isAuditList) {
- param.status = 1;
- }
- if (this.permissions.costExpenseRelease) {
- param.sendState = this.sendState
- }
- this.list = [];
- // this.total = 0;
- this.http.post('/expense-sheet/list', param,
- res => {
- if (res.code == "ok") {
- this.list = res.data.records;
- this.total = res.data.total || 0;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //删除单据
- deletes(id) {
- this.http.post('/expense-sheet/delete', { id: id },
- res => {
- if (res.code == "ok") {
- this.getList()
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //创建单据
- add() {
- let newInvoiceList = JSON.parse(JSON.stringify(this.invoiceList))
- for(var i in newInvoiceList) {
- if(newInvoiceList[i].pic) {
- newInvoiceList[i].pic = newInvoiceList[i].pic.map(item => item.name).join(',')
- }
- }
- console.log(newInvoiceList)
- this.addForm.items = JSON.stringify(newInvoiceList)//这里要传发票列表的json转string
- this.addForm.totalAmount = this.totalCost
- this.http.post('/expense-sheet/add', this.addForm,
- res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.fillinsuccessfully'),
- type: "success"
- });
- this.addForm = {
- code: null,
- ownerId: this.user.id,
- createDate: null,
- type: this.expenseMainTypeValue,
- ticketNum: 1, remark: null, totalAmount: 0,
- }
- this.invoiceList = []
- this.getNextCode()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取单据编码
- getNextCode() {
- this.http.post('/expense-sheet/getNextCode', {
- },
- res => {
- if (res.code == "ok") {
- this.addForm.code = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取查看单据的数据
- getParticulars(id) {
- this.http.post('/expense-sheet/getDetail', {
- id: id,
- projectId: this.selectProject ? this.selectProject : '',
- },
- res => {
- if (res.code == "ok") {
- // this
- console.log(res, '<=== 详情数据')
- // this.ParticularsList = res.data
- // this.expenseMainTypeValue = res.data.type
- var s = []
- // var b = []
- for (var i in res.data.invoiceList) {
- if (res.data.invoiceList[i].pic) {
- let newPic = res.data.invoiceList[i].pic.split(',')
- res.data.invoiceList[i].pic = newPic.map(item => {
- return {
- name: item,
- url: `/upload/${item}`,
- // url: `http://47.101.180.183/upload/${item}`,
- title: this.$t('expensereimbursementvoucher')
- }
- })
- }
- }
- this.ParticularsList = res.data
- for (var i = 0; i <= this.ParticularsList.invoiceList.length - 1; i++) {
- s.push(this.ParticularsList.invoiceList[i].projectId)
- }
- this.projectIdName = this.projectList.filter(item => { return s.indexOf(item.id) !== -1 })
- // this.projectIdName = this.projectList.filter(p => p.id == this.ParticularsList.invoiceList[0].projectId)[0].projectName
- // console.log(res.data, '查看当前状态');
- // console.log(this.ParticularsList)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- //分页
- handleCurrentChange(val) {
- this.page = val;
- console.log('page=======', this.page);
- this.getList();
- },
- handleSizeChange(val) {
- this.size = val;
- this.getList();
- },
- deleteItem(item) {
- this.$confirm(this.$t('yousureyouwanttodelete'), this.$t('other.prompts'), {
- //type: 'warning'
- }).then(() => {
- this.http.post('/expense-sheet/delete', { id: item.id },
- res => {
- if (res.code == "ok") {
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- });
- },
- // 点击删除
- chanc(k) {
- this.invoiceList.splice(k, 1)
- },
- // 双击
- dbclick(row, event, column) {
- this.isOK = true
- },
- oosk(s) {
- this.isOK = false
- },
- ssl(index) {
- this.z = index
- this.addForm.type = index
- this.ins = index;
- this.expenseTypeList = this.allExpList.filter(a => a.mainType == this.ins);
- this.addForm.ownerId = this.user.id;
- this.getNextCode();
- },
- // 点击侧边栏事件
- side() {
- if (this.$refs.side.style.left < '0px') {
- this.$refs.sidebars.style.width = '1px'
- this.$refs.sid.style.left = '1px'
- this.$refs.side.style.left = '1px'
- this.$refs.sideI.className = 'el-icon-arrow-right'
- this.$refs.staff.style.margin = '20px 20px 0 20px'
- this.$refs.staff.style.width = '95%'
- this.$refs.xiaomian.style.width = '100%'
- this.$refs.headHe.style.paddingLeft = '20px'
- this.currentClickNum = 0
- } else {
- this.$refs.sidebars.style.width = '200px'
- this.$refs.sid.style.left = '200px'
- this.$refs.side.style.left = '-19px'
- this.$refs.sideI.className = 'el-icon-arrow-left'
- this.$refs.staff.style.margin = '20px 20px 0 220px'
- this.$refs.staff.style.width = '81%'
- this.$refs.xiaomian.style.width = '85%'
- this.$refs.headHe.style.paddingLeft = '220px'
- this.currentClickNum = 70
- }
- },
- // 费用金额失去焦点时触发
- shiqu() {
- this.addForm.totalAmount = this.invoiceList.reduce((prev, next) => {
- return prev + parseFloat(next.amount);
- }, 0)
- },
- kan() {
- this.ParticularsList.totalAmount = this.ParticularsList.invoiceList.reduce((prev, next) => {
- return prev + parseFloat(next.amount)
- }, 0)
- },
- zhi(e) {
- // console.log('看看值', e)
- var i = e
- if (this.invoiceList[i].amount == null || this.invoiceList[i].amount == 'null' || this.invoiceList[i].taxPercent == null || this.invoiceList[i].taxPercent == 'null') {
- return
- }
- this.invoiceList[i].taxValue = this.invoiceList[i].amount * this.invoiceList[i].taxPercent / 100
- // console.log(this.invoiceList[i].amount, this.invoiceList[i].taxPercent)
- var shui = this.invoiceList[i].taxPercent / 100 // 税率
- var zhi = this.invoiceList[i].amount / (1 + shui) * shui
- this.invoiceList[i].taxValue = zhi.toFixed(2)
- },
- zhiNum(i, val) {
- // console.log('看看值', i, val)
- // console.log(this.ParticularsList.invoiceList)
- if (this.ParticularsList.invoiceList[i].amount == null || this.ParticularsList.invoiceList[i].amount == 'null' || this.ParticularsList.invoiceList[i].taxPercent == null || this.ParticularsList.invoiceList[i].taxPercent == 'null') {
- return
- }
- var shui = this.ParticularsList.invoiceList[i].taxPercent / 100
- var zhi = this.ParticularsList.invoiceList[i].amount / (1 + shui) * shui
- this.ParticularsList.invoiceList[i].taxValue = zhi.toFixed(2)
- },
- zhis(e) {
- var i = e
- this.invoiceList[i].taxValue = this.invoiceList[i].taxValue.toFixed(2)
- },
- fileonLoad(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "jpg" && format != "png" && format != "pdf") {
- this.$message({
- message: this.$t('pleaseselectpictures'),
- type: "error"
- });
- } else {
- this.listLoading = true;
- let formData = new FormData();
- formData.append("multipartFile", item.file);
- this.http.uploadFile('/common/uploadFile', formData,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('uploadedsuccessfully'),
- type: "success"
- });
- // this.getList();
- this.invoiceList[this.apl].pic = res.data
- // console.log(this.invoiceList)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- abl(e) {
- this.apl = e
- },
- beforeRemove(file, fileList) {
- var that = this
- setTimeout(function () {
- that.invoiceList[that.apl].pic = null
- }, 200)
- },
- fileonLoads(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "jpg" && format != "png" && format != "pdf") {
- this.$message({
- message: this.$t('pleaseselectpictures'),
- type: "error"
- });
- } else {
- this.listLoading = true;
- let formData = new FormData();
- formData.append("multipartFile", item.file);
- this.http.uploadFile('/common/uploadFile', formData,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('uploadedsuccessfully'),
- type: "success"
- });
- // this.getList();
- this.ParticularsList.invoiceList[this.apl].pic = res.data
- // console.log(this.invoiceList)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- beforeRemoves(file, fileList) {
- var that = this
- setTimeout(function () {
- // this.ParticularsList.invoiceList
- that.ParticularsList.invoiceList[that.apl].pic = null
- }, 200)
- },
- imgUrl(img) {
- // var imgss = this.diz + '/upload/' + img
- // var sp = []
- // var is = {}
- // is.url = imgss
- // is.title = 1
- // sp.push(is)
- // this.imgs = sp
- // console.log(imgss)
- // console.log(this.$refs.imgsa)
- // this.$refs.imgsa.click()
- // console.log(location.protocol, location.host)
- // console.log(location.protocol + '//' + location.host + imgs)
- },
- // 合计
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 1) {
- sums[index] = this.$t('benYeJineheJi');//this.$t('other.totals');
- return;
- }
- if (index === 2) {
- const values = data.map(item => Number(item[column.property]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- var zhi = +sums[index] + 0
- var sl = zhi.toFixed(2)
- sl += this.$t('yuan');
- sums[index] = sl;
- } else {
- sums[index] = '';
- }
- } else {
- sums[index] = '';
- }
- });
- // console.log(sums, 123)
- this.$nextTick(() => { this.$refs.tab.doLayout() })
- return sums;
- },
- // 自定义组件事件
- selectCal(obj) {
- if (obj.distinction == '1') {
- this.addForm.ownerId = obj.id
- } else if (obj.distinction == '2') {
- this.ownerId = obj.id
- } else if (obj.distinction == '3') {
- this.ParticularsList.ownerId = obj.id
- } else if (obj.distinction == '4') {
- this.addForm.firstCheckerId = obj.id
- } else if (obj.distinction == '5') {
- this.addForm.secondCheckerId = obj.id
- } else if (obj.distinction == '6') {
- this.ParticularsList.firstCheckerId = obj.id
- } else if (obj.distinction == '7') {
- this.ParticularsList.secondCheckerId = obj.id
- }
- },
- // 单据导出
- exportDocument() {
- this.exportingData = true;
- var stat = ''
- var end = ''
- if (this.date) {
- stat = this.date[0]
- end = this.date[1]
- }
- this.http.post('/expense-sheet/exportList', {
- code: this.code,
- startDate: stat,
- endDate: end,
- ownerId: this.ownerId,
- type: this.type,
- projectId: this.selectProject ? this.selectProject : null,
- sendState: this.sendState
- },
- res => {
- this.exportingData = false;
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', this.$t('feiYongBaoXiaoDanJuLieBiao'));// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //报销凭证导出
- exportDocumentFile() {
- var stat = ''
- var end = ''
- if (this.date) {
- stat = this.date[0]
- end = this.date[1]
- }
- this.exportingData=true
- var that = this;
- this.http.downloadFile(`/expense-sheet/export`, {
- code: this.code,
- startDate: stat,
- endDate: end,
- ownerId: this.ownerId,
- type: this.type,
- projectId: this.selectProject ? this.selectProject : null,
- sendState: this.sendState
- }, '报销凭证导出.zip', function(err) {
- that.exportingData = false;
- that.$message({
- message: err,
- type: "error"
- });
- }, function() {
- console.log('55555555555')
- that.exportingData = false;
- })
- },
- // 单据发放
- documentIssuance(type) {
- const newList = this.multipleSelection.filter(item => item.status == 1 || item.status == 2);
- const unissueds = this.multipleSelection.filter(item => item.status != 1 && item.status != 2 && item.sendState == 0).map(item => item.id);
- const Issueds = this.multipleSelection.filter(item => item.status != 1 && item.status != 2 && item.sendState == 1).map(item => item.id);
- const showMessage = (msg, messageType) => {
- this.$message({
- message: msg,
- type: messageType
- });
- };
- if (newList.length > 0) {
- showMessage(this.$t('cunZaiDaiShenHeHuoYiBoHuiDeDanJu'), 'warning');
- return;
- }
- if (type == 1 && unissueds.length == 0) {
- showMessage(this.$t('qingXuanZeWeiFaFangDeDanJu'), 'warning');
- return;
- }
- if (type == 0 && Issueds.length == 0) {
- showMessage(this.$t('qingXuanZeYiFaFangDeDanJu'), 'warning');
- return;
- }
- if(type == 1 && this.sendStateList.length > 0) {
- this.releaseData = {
- id: '',
- data: unissueds
- }
- this.dialogVisibleRelease = true
- return
- }
- this.callingInterface(type, type == 1 ? unissueds : Issueds);
- },
- callingInterface(type, ids) {
- this.http.post('/expense-sheet/editSendExpense', {
- expenseIds: ids.join(','),
- sendState: type,
- payWayId: this.releaseData.id || ''
- },
- res => {
- this.dialogVisibleRelease = false
- if (res.code == "ok") {
- this.$message({
- message: this.$t('operationissuccessful'),
- type: "success"
- });
- this.getList()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.dialogVisibleRelease = false
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- // 打印
- print() {
- this.$print(this.$refs.printContent)
- },
- // 触发自定义函数
- performCustomization(index, type = 1) {
- this.apl = index
- this.imgLoadType = type
- this.$refs.uploadInput.click()
- },
- // 查看详情
- viewDetailsImage(index, fields = 'invoiceList', fieldsCope) {
- if(fieldsCope) {
- this.imgLoadType = 2
- this.dialogVisibleImageList = this[fields][fieldsCope][index].pic
- } else{
- this.imgLoadType = 1
- this.dialogVisibleImageList = this[fields][index].pic
- }
- console.log(this.dialogVisibleImageList, '查看详情')
- this.apl = index
- this.dialogVisibleImage = true
- },
- // 删除图片
- deteleIpc(index, fields = 'invoiceList', fieldsCope) {
- if(fieldsCope) {
- this[fields][fieldsCope][index].pic.splice(index, 1)
- this.dialogVisibleImageList = this[fields][fieldsCope][index].pic
- } else{
- this[fields][index].pic.splice(index, 1)
- this.dialogVisibleImageList = this[fields][index].pic
- }
- },
- // 费用报销图片上传(多选)
- fileMultLoad() {
- let fileArr = this.$refs.uploadInput.files
- this.listLoading = true;
- let formData = new FormData();
- for (let i = 0; i < fileArr.length; i++) {
- formData.append("multipartFiles", fileArr[i]);
- }
- this.http.uploadFile('/common/uploadFileArray', formData,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('uploadedsuccessfully'),
- type: "success"
- });
- if(res.data) {
- let newList = res.data.split(';')
- let newArr = newList.map(item => {
- return {
- name: item,
- url: '/upload/' + item,
- // url: `http://47.101.180.183/upload/${item}`,
- title: this.$t('expensereimbursementvoucher')
- }
- })
- if(this.imgLoadType == 1) {
- let oldList = this.invoiceList[this.apl].pic || []
- this.$set(this.invoiceList[this.apl], 'pic', [...oldList, ...newArr])
- this.dialogVisibleImageList = [...oldList, ...newArr]
- }
- if(this.imgLoadType == 2) {
- let oldList = this.ParticularsList.invoiceList[this.apl].pic || []
- this.$set(this.ParticularsList.invoiceList[this.apl], 'pic', [...oldList, ...newArr])
- this.dialogVisibleImageList = [...oldList, ...newArr]
- }
- }
- console.log(this.apl, '<< === 赋值的索引')
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 判断当前数据的文件类型
- isFileType(item) {
- let str = item.split('.');
- let format = str[str.length - 1];
- if (['jpg', 'png', 'jpeg', 'JPG', 'PNG', 'JPEG'].includes(format)) {
- return 'image'
- } else if (format == "pdf") {
- return 'pdf'
- }
- },
- // 查看pdf
- openViewPdf(urls) {
- // 新窗口打开pdf
- window.open(urls)
- },
- // 获取发放方式
- getSendStateList() {
- this.http.post('/expense-pay-way/get', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.sendStateList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- beforeDestroy() {
- }
- };
- </script>
- <style scoped lang="scss">
- @import "../../assets/scss/handle";
- .tups {
- width: 100%;
- height: 25px;
- position: relative;
- z-index: 99;
- overflow: hidden;
- }
- .tups img {
- // height: 25px !important;
- // position: relative;
- // z-index: 99;
- width: 30px;
- height: 30px;
- margin-right: 4px;
- }
- .viewer-canvas {
- position: absolute;
- z-index: 9 !important;
- }
- .icl {
- margin-top: -25px !important;
- }
- /* 费用报销标题 */
- .headine {
- width: 100%;
- height: 46.4px;
- line-height: 46.4px;
- background: #fff;
- box-sizing: border-box;
- }
- .headine h3 {
- margin: 0;
- display: inline-block;
- box-sizing: border-box;
- color: #999;
- }
- .headine p {
- display: inline-block;
- margin: 0;
- }
- /* /费用报销标题 */
- .sidebars {
- height: 100%;
- position: absolute;
- border-right: 1px solid #E6E6E6;
- z-index: 2;
- top: 0;
- }
- .sidebars h3 {
- margin: 0;
- line-height: 45px;
- background: #ffffff;
- font-weight: normal;
- color: #666;
- padding-left: 20px;
- }
- .sidebars .el-col-12 {
- width: 100%
- }
- .public {
- // height: 180px;
- border-bottom: 1px solid #ddd;
- }
- .public .el-form-item {
- display: inline-block;
- }
- .pu_button {
- text-align: right;
- width: 100%;
- padding: 24px 30px;
- box-sizing: border-box;
- }
- .pu_bu_x .pu_bu_t {
- display: inline-block;
- }
- .pu_bu_x {
- margin-right: 20px;
- color: #20A0F7;
- cursor: pointer;
- }
- .pu_bu_t {
- color: #20A0F7;
- cursor: pointer;
- display: block;
- float: right;
- position:
- relative;
- top: -20px;
- right: 63px;
- }
- .pu_table {
- margin-left: 10px;
- }
- .pu_bu_t:hover {
- color: #7bbcff;
- }
- .pu_bu_x:hover {
- color: #7bbcff;
- }
- /* 我的单据报销凭证 */
- .staff {
- border-left: 1px solid #fff;
- border-top: 1px solid #fff;
- border-right: 1px solid #fff;
- background: #fff;
- }
- /* */
- .sdat {
- display: inline-block;
- width: 260px;
- margin-left: 13px;
- }
- .messages .el-form-item {
- display: inline-block;
- }
- .messages .el-date-editor.el-input,
- .el-date-editor.el-input__inner {
- width: 190px;
- }
- /* 我的报销凭证 */
- .search {
- position: relative;
- top: 20px;
- left: 20px;
- }
- .tables {
- margin-top: 50px;
- box-sizing: border-box;
- padding: 10px;
- }
- .informant .el-form-item {
- display: inline-block;
- }
- /* 侧边栏收索 */
- .side {
- position: absolute;
- z-index: 2;
- border-right: 2px solid #DDDDDD;
- height: 100%;
- top: 0;
- width: 0;
- }
- .side .spans {
- width: 20px;
- height: 30px;
- border: 1px solid #DDDDDD;
- box-sizing: border-box;
- position: absolute;
- top: 50%;
- margin-top: -50%;
- text-align: center;
- z-index: 1;
- background: #fff;
- }
- .side .spans i {
- margin-top: 7px;
- color: #C0BFBF
- }
- .side:hover {
- border-right: 2px solid;
- @include border_color("border_color");
- }
- .side:hover .spans {
- border: 1px solid;
- @include border_color("border_color");
- @include background_color("background_color");
- }
- .side:hover .spans i {
- color: #fff;
- }
- /* 右边整体页面 */
- .contents {
- height: 100%;
- /* padding: 30px; */
- background: #F7F7F7;
- /* position: absolute; */
- }
- .submits {
- margin-left: 50%;
- }
- .waiting {
- color: orange;
- }
- .rejected {
- color: red;
- }
- .newInvoice {
- position: absolute;
- right: 10px;
- top: -20px;
- height: 20px;
- line-height: 20px;
- cursor: pointer;
- color: #20a0f7;
- font-size: 14px;
- }
- .newInvoice:hover {
- color: #7bbcff;
- }
- /* 新增打印的费用报销类型 */
- .printContent {
- .printContent-detail {
- display: flex;
- flex-wrap: wrap;
- }
- .detail-item {
- width: 33%;
- font-size: 16px;
- margin-bottom: 10px;
- color: #000;
- .detail-item-title {
- color: #999;
- }
- .single {
- font-size: 14px;
- }
- .printBox {
- display: inline-block;
- width: 125px;
- text-align-last: justify;
- box-sizing: border-box;
- padding-right: 10px;
- }
- }
- .conter-box {
- .conter-border {
- width: 100%;
- box-sizing: border-box;
- padding: 15px;
- border: 1px solid #ddd;
- border-radius: 4px;
- display: flex;
- flex-wrap: wrap;
- margin-top: 20px;
- .detail-item {
- width: 50%;
- margin-top: 10px;
- }
- }
- }
- }
- .customIamgeLoad {
- opacity: 0;
- position: absolute;
- top: -300vh;
- left: -300vw;
- }
- .dayImge {
- .xiaoImg {
- width: 120px;
- height: 120px;
- margin-right: 25px;
- margin-bottom: 20px;
- position: relative;
- display: inline-block;
- img {
- width: 100%;
- height: 100%;
- }
- .imgIcon {
- position: absolute;
- right: 0px;
- font-size: 20px;
- top: 0px;
- cursor: pointer;
- background: rgba($color: #000000, $alpha: .6);
- width: 30px;
- height: 30px;
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 4px;
- z-index: 5;
- }
- }
- .xiaoImg:nth-child(5n) {
- margin-right: 0;
- }
- .dayImgeItem {
- display: flex;
- flex-wrap: wrap;
- }
- .dayImgeItemFile {
- width: 100%;
- .title {
- font-size: 20px;
- }
- .text {
- margin: 10px 30px;
- }
- }
- }
- </style>
|