expense.vue 117 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035
  1. <template>
  2. <section>
  3. <div class="sidebars" ref="sidebars" style="width: 200px;display: block;background: #fff;">
  4. <div ref="abbisd" style="width: 100%;overflow: hidden;">
  5. <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>{{ $t('expensereimbursementmodule')
  6. }}</h3>
  7. <el-divider></el-divider>
  8. <el-col :span="12">
  9. <el-menu default-active="1-1" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff"
  10. text-color="#666666" :active-text-color="themeColor" style="width:100%">
  11. <el-submenu index="1">
  12. <template slot="title">
  13. <i class="iconfont firerock-icontianbao"></i>
  14. <span>{{ $t('fillinthestaffexpenses') }}</span>
  15. </template>
  16. <el-menu-item index="1-1">
  17. <p> {{ $t('expenses') }}</p>
  18. </el-menu-item>
  19. <!-- <el-menu-item index="1-2"><p @click="ssl(1)">{{ $t('travelexpensess') }}</p></el-menu-item>
  20. <el-menu-item index="1-3"><p @click="ssl(2)">{{ $t('outsourcingcostshouldbereported') }}</p></el-menu-item> -->
  21. </el-submenu>
  22. <el-submenu index="2">
  23. <template slot="title">
  24. <i class="iconfont firerock-iconbaoxiaodan"></i>
  25. <span>{{ permissions.costAll ? $t('listofreimbursementvouchers') : $t('myexpensevoucher') }}</span>
  26. </template>
  27. <el-menu-item index="2-1">
  28. <p @click="bills(false)">{{ $t('documentlist') }}</p>
  29. </el-menu-item>
  30. <el-menu-item index="2-2">
  31. <p @click="bills(true)">{{ $t('documentreview') }}</p>
  32. </el-menu-item>
  33. </el-submenu>
  34. <!-- <el-menu-item index="3" @select="bills" @click="bills(false)" v-if="user.role == 0">
  35. <i class="iconfont firerock-iconbaoxiaodan"></i>
  36. <span slot="title">{{user.role == 0?"我的报销凭证":"报销凭证列表"}}</span>
  37. </el-menu-item> -->
  38. </el-menu>
  39. </el-col>
  40. </div>
  41. <div class="side" @click="side" ref="sid" style="left: 200px">
  42. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  43. </div>
  44. </div>
  45. <!-- 侧边栏点击事件 -->
  46. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  47. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  48. </div> -->
  49. <!-- 内容主体区域 -->
  50. <div class="contents">
  51. <div v-if="!displayTable" class="headine" ref="headine">
  52. <!-- <h3 ref="headHe" style="padding-left: 220px">{{shuz[ins]}}</h3> -->
  53. <h3 ref="headHe" style="padding-left: 220px">{{ $t('expenses') }}</h3>
  54. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits" size="mini">{{
  55. $t('btn.submit') }}</el-button></p>
  56. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submitUpload" size="mini">{{
  57. $t('batchupload') }}</el-button></p>
  58. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="customTypeOp" size="mini"
  59. v-if="permissions.costAll">{{ $t('expensetypemanagement') }}</el-button></p>
  60. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="expenseTypeOp" size="mini"
  61. v-if="permissions.costAll">{{ $t('feiYongZhuLeiXingGuanLi') }}</el-button></p>
  62. </div>
  63. <!-- 上面部分 -->
  64. <div ref="staff" style="margin: 20px 20px 0 220px; width: 81.5%">
  65. <div class="staff" v-if="!displayTable">
  66. <!-- 公共 -->
  67. <div class="public">
  68. <el-form :model="addForm" ref="mainAddForm" label-width="100px" :rules="addFormRules">
  69. <!-- <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> -->
  70. <!-- 报销人 -->
  71. <el-form-item :label="$t('peopleconcerned')" prop="ownerId">
  72. <!--普通员工只能自己填报自己的 -->
  73. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.ownerId"
  74. :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="!permissions.costAudit"
  75. filterable="true">
  76. <span v-for="(item, index) in users" :key="index">
  77. <el-option :label="item.name" :value="item.id"></el-option>
  78. </span>
  79. </el-select>
  80. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'1'"
  81. :subject="users" :disabled="!permissions.costAudit" :subjectId="addForm.ownerId" ref="selectCat"
  82. @selectCal="selectCal"></selectCat>
  83. </el-form-item>
  84. <!-- 填报日期 -->
  85. <el-form-item :label="$t('fillinthedate')" style="position: relative;top: 38px;">
  86. <el-col :span="11">
  87. <el-date-picker type="date" :placeholder="$t('optiondate')" v-model="addForm.createDate"
  88. value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
  89. </el-col>
  90. </el-form-item>
  91. <!-- 发票张数 -->
  92. <el-form-item :label="$t('invoicenumber')" v-if="this.user.timeType.easyExpense == 0">
  93. <el-input v-model="addForm.ticketNum" style="width: 150px"></el-input>
  94. </el-form-item>
  95. <!-- 费用主类型 -->
  96. <el-form-item :label="$t('feiYongZhuLeiXing')">
  97. <el-select v-model="expenseMainTypeValue" style="width: 150px" @change="costMainTypeSwitching">
  98. <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name"
  99. :value="item.id"></el-option>
  100. </el-select>
  101. </el-form-item>
  102. <!-- 第一审核人 -->
  103. <el-form-item :label="$t('di-yi-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
  104. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.firstCheckerId"
  105. :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px"
  106. filterable="true" :disabled="expenseMainTypeValue == 14454">
  107. <span v-for="(item, index) in usersNoInfo" :key="index">
  108. <el-option :label="item.name" :value="item.id"></el-option>
  109. </span>
  110. </el-select>
  111. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'4'" :disabled="expenseMainTypeValue == 14454"
  112. :subject="usersNoInfo" :subjectId="addForm.firstCheckerId" ref="selectCat"
  113. @selectCal="selectCal"></selectCat>
  114. </el-form-item>
  115. <!-- 第二审核人 -->
  116. <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2 && user.companyId != 4811">
  117. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.secondCheckerId"
  118. :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px"
  119. filterable="true">
  120. <span v-for="(item, index) in usersNoInfo" :key="index">
  121. <el-option :label="item.name" :value="item.id"></el-option>
  122. </span>
  123. </el-select>
  124. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'5'"
  125. :subject="usersNoInfo" :subjectId="addForm.secondCheckerId" ref="selectCat"
  126. @selectCal="selectCal"></selectCat>
  127. </el-form-item>
  128. <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2 && user.companyId == 4811 && expenseMainTypeValue != 14454">
  129. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.secondCheckerId"
  130. :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px"
  131. filterable="true">
  132. <span v-for="(item, index) in usersNoInfo" :key="index">
  133. <el-option :label="item.name" :value="item.id"></el-option>
  134. </span>
  135. </el-select>
  136. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'5'"
  137. :subject="usersNoInfo" :subjectId="addForm.secondCheckerId" ref="selectCat"
  138. @selectCal="selectCal"></selectCat>
  139. </el-form-item>
  140. <!-- 备注 -->
  141. <el-form-item :label="$t('bei-zhu')" style="display: block; width: 70%">
  142. <el-input type="textarea" v-model="addForm.remark" :autosize="{ minRows: 2, maxRows: 2 }"
  143. maxlength="100"></el-input>
  144. </el-form-item>
  145. <!-- 总费用 -->
  146. <!-- <div style="float: left; line-height: 55px;margin-left:20px">总费用 <el-link disabled v-model="addForm.totalAmount">{{addForm.totalAmount}}</el-link> 元</div> -->
  147. </el-form>
  148. </div>
  149. <!-- 按钮 -->
  150. <div class="pu_button">
  151. <span v-if="totalCost <= 0" style="color:#606266;">{{ $t('totalcostos') }} {{ totalCost }} {{ $t('yuan')
  152. }}</span>
  153. <span v-else style="color:#606266;">{{ $t('totalcostos') }} ¥{{ totalCost | numberToCurrency }} {{ $t('yuan')
  154. }}</span>
  155. <span class="pu_bu_x" style="margin-left:10px;" @click="addxz"> <i class="el-icon-circle-plus-outline"></i> {{
  156. $t('newinvoice') }}</span>
  157. </div>
  158. <!-- 表格 -->
  159. <div class="pu_table">
  160. <el-table :data="invoiceList" border style="width: 100%;height:100%" height="386px" @row-dblclick="dbclick">
  161. <el-table-column prop="projectName" :label="$t('subordinatetotheproject')" width="180">
  162. <template slot-scope="scope">
  163. <el-select size="small" v-model="scope.row.projectId" :placeholder="$t('other.project')"
  164. style="width: 150px" filterable popper-class="projectSelectPopperClass">
  165. <el-option v-for="(item, index) in projectList" :key="index"
  166. :label="item.projectName + item.projectCode" :value="item.id" @click="ok(item)">
  167. <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  168. <span style="float: right;">{{ item.projectName }}</span>
  169. </el-option>
  170. </el-select>
  171. </template>
  172. </el-table-column>
  173. <el-table-column prop="happenDate" :label="$t('forthedate')" width="170px">
  174. <template slot-scope="scope">
  175. <el-date-picker size="small" v-model="scope.row.happenDate" type="date" style=" width: 145px"
  176. value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
  177. </el-date-picker>
  178. </template>
  179. </el-table-column>
  180. <el-table-column :label="$t('invoices')" width="175px" v-if="this.user.timeType.easyExpense == 0">
  181. <template slot-scope="scope">
  182. <el-select size="small" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')"
  183. style="width: 150px;">
  184. <el-option :label="$t('vATspecialinvoice')" value="0"></el-option>
  185. <el-option :label="$t('vATgeneralinvoice')" value="1"></el-option>
  186. </el-select>
  187. </template>
  188. </el-table-column>
  189. <el-table-column :label="$t('costtype')" width="175px">
  190. <template slot-scope="scope">
  191. <el-select size="small" v-model="scope.row.expenseType" :placeholder="$t('costtype')"
  192. style="width: 150px">
  193. <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName"
  194. :value="item.typeName"></el-option>
  195. </el-select>
  196. </template>
  197. </el-table-column>
  198. <el-table-column :label="this.user.timeType.easyExpense == 0 ? $t('amountoffees') : '费用金额'" width="135px">
  199. <template slot-scope="scope">
  200. <el-input size="small" :id="'upam' + scope.$index" v-model="scope.row.amount" @input="zhi(scope.$index)"
  201. @change="shiqu(scope.row.amount)" @keyup.native="restrictNumber('upam' + scope.$index)" :disabled="user.companyId == 4811 && user.id != addForm.ownerId && expenseMainTypeValue == 14454"></el-input>
  202. </template>
  203. </el-table-column>
  204. <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="135px"
  205. v-if="this.user.timeType.easyExpense == 0">
  206. <template slot-scope="scope">
  207. <el-input size="small" v-model.number="scope.row.invoiceNo"></el-input>
  208. </template>
  209. </el-table-column>
  210. <el-table-column :label="$t('shui-shuai')" width="135px" v-if="this.user.timeType.easyExpense == 0">
  211. <template slot-scope="scope">
  212. <el-input size="small" type="number" v-model="scope.row.taxPercent"
  213. @input="zhi(scope.$index)"></el-input>
  214. </template>
  215. </el-table-column>
  216. <el-table-column :label="$t('taxs')" width="135px" v-if="this.user.timeType.easyExpense == 0">
  217. <template slot-scope="scope">
  218. <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>
  219. </template>
  220. </el-table-column>
  221. <el-table-column :label="$t('bei-zhu')" width="135px">
  222. <template slot-scope="scope">
  223. <el-input size="small" v-model="scope.row.remark" :disabled="user.companyId == 4811 && user.id != addForm.ownerId && expenseMainTypeValue == 14454"></el-input>
  224. </template>
  225. </el-table-column>
  226. <el-table-column :label="$t('expensereimbursementvoucher')" width="135px">
  227. <template slot-scope="scope">
  228. <!--
  229. <div @click="abl(scope.$index)">
  230. <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :before-remove="beforeRemove"
  231. :http-request="fileonLoad" limit="1" name="multipartFile">
  232. <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
  233. </el-upload>
  234. </div>
  235. -->
  236. <div>
  237. <div v-if="scope.row.pic && scope.row.pic.length > 0">
  238. <el-button size="small" @click="viewDetailsImage(scope.$index)">{{ $t('Checkthedetails') }}</el-button>
  239. </div>
  240. <div v-else>
  241. <el-button type="primary" size="small" @click="performCustomization(scope.$index)" :loading="listLoading">{{ $t('clickupload') }}</el-button>
  242. </div>
  243. </div>
  244. </template>
  245. </el-table-column>
  246. <el-table-column fixed="right" :label="$t('operation')">
  247. <template slot-scope="scope">
  248. <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px"
  249. @click="chanc(scope.$index)">{{ $t('btn.delete') }}</el-button>
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. </div>
  254. <!-- <el-button class="submits" type="warning" @click="submits">提交</el-button> -->
  255. </div>
  256. </div>
  257. </div>
  258. <!-- 多张图片查看详情 -->
  259. <el-dialog :title="$t('Checkthedetails')" :visible.sync="dialogVisibleImage" width="745px" :before-close="handleClose">
  260. <div class="dayImge">
  261. <div class="dayImgeItem" v-if="dialogVisibleImageList">
  262. <viewer :images="dialogVisibleImageList" v-viewer="viewerOptions" class="dayImgeItem">
  263. <template v-for="src,i in dialogVisibleImageList" :id="src.url">
  264. <!-- 图片 -->
  265. <div class="xiaoImg" v-if="isFileType(src.url) == 'image'">
  266. <img ref="imgsa" :src="src.url">
  267. <div class="imgIcon" @click.stop="deteleIpc(apl)" v-if="imgLoadType==1"><i class="el-icon-circle-close"></i></div>
  268. <div class="imgIcon" @click.stop="deteleIpc(apl, 'ParticularsList', 'invoiceList')" v-if="imgLoadType==2"><i class="el-icon-circle-close"></i></div>
  269. </div>
  270. <!-- 文件 -->
  271. <div class="xiaoImg" v-if="isFileType(src.url) == 'pdf'" @click.stop="openViewPdf(src.url)">
  272. <img :src="pdfIcons">
  273. <div class="imgIcon" @click.stop="deteleIpc(apl)" v-if="imgLoadType==1"><i class="el-icon-circle-close"></i></div>
  274. <div class="imgIcon" @click.stop="deteleIpc(apl, 'ParticularsList', 'invoiceList')" v-if="imgLoadType==2"><i class="el-icon-circle-close"></i></div>
  275. </div>
  276. </template>
  277. <img @click.stop="performCustomization(apl, imgLoadType)" v-if="dialogVisibleImageList.length < 10" :src="require('../../assets/image/aacbc.png')" class="xiaoImg" style="margin-right: 0" />
  278. </viewer>
  279. </div>
  280. </div>
  281. </el-dialog>
  282. <!-- 下面部分 -->
  283. <div class="xiamian" ref="xiaomian"
  284. :style="'width: ' + (xiamianWidth - 400) + 'px;float:right;background: #fff;position: relative;'">
  285. <div v-if="displayTable">
  286. <div style="padding-left:10px;padding-right:10px;">
  287. <div>
  288. <el-form label-width="100px" inline>
  289. <!-- 报销人 -->
  290. <el-form-item :label="$t('peopleconcerned')">
  291. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ownerId" size="small" clearable
  292. :placeholder="$t('selecttheapplicant')" style="width: 120px" :disabled="!permissions.costAudit"
  293. filterable="true">
  294. <span v-for="(item, index) in users" :key="index">
  295. <el-option :label="item.name" :value="item.id"></el-option>
  296. </span>
  297. </el-select>
  298. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :widthStr="'120'" :distinction="'2'"
  299. :clearable="true" :subject="users" :disabled="!permissions.costAudit" :subjectId="ownerId"
  300. ref="selectCat" @selectCal="selectCal" :filterable="true"></selectCat>
  301. </el-form-item>
  302. <!-- 单据编号 -->
  303. <el-form-item :label="$t('receiptnumber')">
  304. <el-input v-model="code" size="small" :placeholder="$t('receiptnumber')" clearable="true"
  305. style="width: 120px"></el-input>
  306. </el-form-item>
  307. <!-- 费用主类型 -->
  308. <el-form-item :label="$t('feiYongZhuLeiXing')">
  309. <el-select size="small" v-model="queryExpenseMainType" style="width: 150px" clearable :placeholder="$t('typesof')">
  310. <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name"
  311. :value="item.id"></el-option>
  312. <!-- <el-option :label="$t('yi-ban')" :value="0"></el-option>
  313. <el-option :label="$t('cha-lv')" :value="1"></el-option>
  314. <el-option :label="$t('wai-bao')" :value="2"></el-option> -->
  315. </el-select>
  316. </el-form-item>
  317. <el-form-item :label="$t('faFangZhuangTai')" v-if="permissions.costExpenseRelease">
  318. <el-select v-model="sendState" size="small" style="width: 150px"
  319. clearable>
  320. <el-option :label="$t('weiFaFang')" :value="0"></el-option>
  321. <el-option :label="$t('yiFaFang')" :value="1"></el-option>
  322. </el-select>
  323. </el-form-item>
  324. <!-- 填报日期 -->
  325. <div style="display: inline-block;">
  326. <el-form-item :label="$t('other.project')">
  327. <el-select v-model="selectProject" size="small" style="width: 162px" clearable filterable>
  328. <el-option v-for="item in projectList" :label="item.projectName" :value="item.id" :key="item.id">
  329. <span style="float: left">{{ item.projectName }}</span>
  330. <span style="float: right; color: #8492a6;">{{ item.projectCode }}</span>
  331. </el-option>
  332. </el-select>
  333. </el-form-item>
  334. <el-form-item :label="$t('fillinthedate')">
  335. <el-date-picker v-model="date" type="daterange" value-format="yyyy-MM-dd" size="small"
  336. :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')"
  337. :end-placeholder="$t('time.endDate')" style="width: 280px">
  338. </el-date-picker>
  339. </el-form-item>
  340. <el-form-item>
  341. <el-button @click="getList" size="small">{{ $t('find') }}</el-button>
  342. </el-form-item>
  343. <el-form-item v-if="currentClick == '2-1'">
  344. <el-button :loading="exportingData" @click="exportDocument()" size="small">{{ $t('danJuDaoChu') }}</el-button>
  345. </el-form-item>
  346. <el-form-item v-if="currentClick == '2-1'">
  347. <el-button :loading="exportingData" @click="exportDocumentFile()" size="small">{{ $t('baoXiaoPingZhengDaoChu') }}</el-button>
  348. </el-form-item>
  349. <el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
  350. <el-button @click="documentIssuance(1)" size="small">{{ $t('faFang') }}</el-button>
  351. </el-form-item>
  352. <el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
  353. <el-button @click="documentIssuance(0)" size="small">{{ $t('quXiaoFaFang') }}</el-button>
  354. </el-form-item>
  355. <!-- <span>审核模式:{{ auditTypeItem.auditType }}</span> -->
  356. </div>
  357. </el-form>
  358. </div>
  359. <el-divider></el-divider>
  360. <!--列表-->
  361. <el-table ref="tab" :data="list" @selection-change="handleSelectionChange" highlight-current-row
  362. v-loading="listLoading" :height="tableHeight - currentClickNum" style="width: 100%;"
  363. :summary-method="getSummaries" show-summary>
  364. <el-table-column type="selection" width="55"></el-table-column>
  365. <el-table-column prop="code" :label="$t('ticketnumber')" width="120"></el-table-column>
  366. <el-table-column prop="totalAmount" :label="$t('amountof') + '(' + $t('yuan') + ')'" align="center" width="120">
  367. <template slot-scope="scope">
  368. <span style="float:right;margin-right:20px">{{ scope.row.totalAmount ? scope.row.totalAmount.toFixed(2) :
  369. '0' }}</span>
  370. </template>
  371. </el-table-column>
  372. <el-table-column prop="ownerName" :label="$t('peopleconcerned')">
  373. <template slot-scope="scope">
  374. <div>
  375. <span v-if="user.userNameNeedTranslate != 1">
  376. {{ scope.row.ownerName }}
  377. </span>
  378. <span v-if="user.userNameNeedTranslate == 1">
  379. <TranslationOpenDataText type='userName' :openid='scope.row.ownerName'></TranslationOpenDataText>
  380. </span>
  381. </div>
  382. </template>
  383. </el-table-column>
  384. <el-table-column prop="createDate" :label="$t('fillinthedate')" width="100"></el-table-column>
  385. <el-table-column prop="ticketNum" :label="$t('invoicenumber')"
  386. v-if="this.user.timeType.easyExpense == 0"></el-table-column>
  387. <el-table-column prop="type" :label="$t('ppertype')" v-if="this.user.timeType.easyExpense == 0">
  388. <template slot-scope="scope">
  389. {{ scope.row.expenseMainTypeName }}
  390. </template>
  391. </el-table-column>
  392. <el-table-column prop="remark" :label="$t('bei-zhu')" width="180">
  393. <template slot-scope="scope">
  394. <span style="font-size:12px;">{{ scope.row.remark }}</span>
  395. </template>
  396. </el-table-column>
  397. <el-table-column prop="status" :label="$t('state.states')" width="80">
  398. <template slot-scope="scope">
  399. <span v-if="scope.row.status == 1" class="waiting">{{ statusTxt[scope.row.status] }}</span>
  400. <span v-if="scope.row.status == 2" class="rejected">{{ statusTxt[scope.row.status] }}</span>
  401. <span v-if="scope.row.status == 0 || scope.row.status == 3">{{ statusTxt[scope.row.status] }}</span>
  402. <span v-if="scope.row.status == 4" style="color: red">{{ statusTxt[scope.row.status] }}</span>
  403. </template>
  404. </el-table-column>
  405. <el-table-column prop="reviewProcess" :label="$t('title.reviewProcess')" width="180" v-if="auditTypeItem.auditType == 2">
  406. <template slot-scope="scope">
  407. <span v-if="scope.row.reviewProcess == 0">{{ $t('daiDiYiShenHeRenShenHe') }}</span>
  408. <span v-if="scope.row.reviewProcess == 1">{{ $t('daiDiErShenHeRenShenHe') }}</span>
  409. <span v-if="scope.row.reviewProcess == 2">{{ $t('shenHeWanCheng') }}</span>
  410. <span v-if="scope.row.reviewProcess == 3">未提交</span>
  411. <span v-if="scope.row.reviewProcess == 4">已驳回</span>
  412. </template>
  413. </el-table-column>
  414. <!-- <el-table-column prop="denyReason" :label="$t('dismissreason')" width="180">
  415. <template slot-scope="scope">
  416. <span style="font-size:12px;">{{scope.row.denyReason}}</span>
  417. </template>
  418. </el-table-column> -->
  419. <el-table-column prop="sendState" :label="$t('faFangZhuangTai')" width="80" v-if="permissions.costExpenseRelease">
  420. <template slot-scope="scope">
  421. <span :style="`color: ${scope.row.sendState == 0 ? '#FFA500' : ''}`">{{ scope.row.sendState == 1 ? $t('yiFaFang') :
  422. '未发放' }}</span>
  423. </template>
  424. </el-table-column>
  425. <el-table-column prop="payWayName" :label="$t('zhiFuFangShi')" width="80" v-if="permissions.costExpenseRelease">
  426. </el-table-column>
  427. <el-table-column fixed="right" :label="$t('operation')" :width="isAuditList ? 220 : 160">
  428. <template slot-scope="scope">
  429. <div v-if="!isAuditList">
  430. <el-button icon="el-icon-view" circle size="mini"
  431. @click.stop.native="downloadByA(scope.row)"></el-button>
  432. <el-button icon="el-icon-edit" circle size="mini" style="margin-left:10px;"
  433. @click.stop.native="showEditName(scope.row)"
  434. v-show="permissions.costAudit || scope.row.status == 1 || scope.row.status == 2"></el-button>
  435. <el-button icon="el-icon-delete" circle size="mini" style="margin-left:10px;"
  436. @click.stop.native="deleteItem(scope.row)"
  437. v-show="permissions.costAudit || scope.row.status == 1 || scope.row.status == 2"></el-button>
  438. </div>
  439. <div v-if="isAuditList">
  440. <div v-if="auditTypeItem.auditType == 0 || auditTypeItem.auditType == 2">
  441. <el-button size="mini" @click.stop.native="downloadByA(scope.row)">{{ $t('cha-kan') }}</el-button>
  442. <el-button size="mini" style="margin-left:5px;" @click.stop.native="approve(scope.row)">{{
  443. $t('btn.through') }}</el-button>
  444. <el-button size="mini" style="margin-left:5px;" @click.stop.native="denyReason(scope.row)">{{
  445. $t('btn.rejected') }}</el-button>
  446. </div>
  447. <div v-if="auditTypeItem.auditType == 1">
  448. <el-button size="mini" @click.stop.native="approve(scope.row)">{{ $t('other.audit') }}</el-button>
  449. </div>
  450. </div>
  451. </template>
  452. </el-table-column>
  453. </el-table>
  454. <!--工具条-->
  455. <el-col :span="24" class="toolbar">
  456. <el-pagination key="expenseListTblPager" @size-change="handleSizeChange" @current-change="handleCurrentChange"
  457. :page-sizes="[20, 50, 80, 100]" :page-size="20" :current-page.sync="page"
  458. layout="total, sizes, prev, pager, next" :total="total" style="float:right;"></el-pagination>
  459. </el-col>
  460. </div>
  461. </div>
  462. </div>
  463. <!-- 我的单据报销展示 -->
  464. <el-dialog :title="$t('detailsofReimbursementvoucher')" :visible.sync="dialog" width="1000px">
  465. <!-- 内容主体 -->
  466. <div class="informant"><!-- 报销人 -->
  467. <el-form :model="ParticularsList" label-width="100px">
  468. <el-form-item :label="$t('peopleconcerned')" style="width: 270px"
  469. :rules="{ required: true, message: $t('pleaseselecttheapplicant'), trigger: 'blur' }">
  470. <el-input v-model="ParticularsList.ownerName"
  471. :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId"
  472. v-if="user.userNameNeedTranslate != '1'"></el-input>
  473. <!-- <el-select v-model="ParticularsList.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
  474. <span v-for="(item, index) in users" :key="index">
  475. <el-option :label="item.name" :value="item.id"></el-option>
  476. </span>
  477. </el-select> -->
  478. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'"
  479. :subject="users" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId"
  480. :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
  481. </el-form-item>
  482. <!-- 第一审核人 -->
  483. <el-form-item :label="$t('di-yi-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
  484. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ParticularsList.firstCheckerId"
  485. :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 0 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
  486. filterable="true">
  487. <span v-for="(item, index) in users" :key="index">
  488. <el-option :label="item.name" :value="item.id"></el-option>
  489. </span>
  490. </el-select>
  491. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'6'"
  492. :subject="users" :subjectId="ParticularsList.firstCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 0 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
  493. @selectCal="selectCal"></selectCat>
  494. </el-form-item>
  495. <!-- 第二审核人 -->
  496. <el-form-item :label="$t('di-er-shen-he-ren')" v-if="auditTypeItem.auditType == 2">
  497. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ParticularsList.secondCheckerId"
  498. :placeholder="$t('message.Pleaseselectareviewer')" style="width: 150px" :disabled="ParticularsList.reviewProcess > 1 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
  499. filterable="true">
  500. <span v-for="(item, index) in users" :key="index">
  501. <el-option :label="item.name" :value="item.id"></el-option>
  502. </span>
  503. </el-select>
  504. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'7'"
  505. :subject="users" :subjectId="ParticularsList.secondCheckerId" ref="selectCat" :disabled="ParticularsList.reviewProcess > 1 || (flg || ParticularsList.ownerId == ParticularsList.operatorId)"
  506. @selectCal="selectCal"></selectCat>
  507. </el-form-item>
  508. <el-form-item :label="$t('fillinthedate')">
  509. <!-- <el-input v-model="ParticularsList.createDate" :disabled="flg"></el-input> -->
  510. <el-date-picker type="date" :disabled="flg" :placeholder="$t('optiondate')"
  511. v-model="ParticularsList.createDate" value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
  512. </el-form-item>
  513. <el-form-item :label="$t('invoicenumber')">
  514. <el-input v-enter-number v-model="ParticularsList.ticketNum" :disabled="flg"></el-input>
  515. </el-form-item>
  516. <el-form-item :label="$t('costtype')" style="width: 270px">
  517. <el-select size="small" v-model="ParticularsList.type" style="width: 150px" :disabled="flg">
  518. <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
  519. </el-select>
  520. </el-form-item>
  521. <el-form-item :label="$t('bei-zhu')" style="width: 280px">
  522. <el-input v-model="ParticularsList.remark" :disabled="flg" maxlength="100"></el-input>
  523. </el-form-item>
  524. <el-form-item :label="$t('totalcostos')">
  525. ¥{{ ParticularsList.totalAmount | numberToCurrency }}&nbsp;&nbsp;{{ $t('yuan') }}
  526. </el-form-item>
  527. </el-form>
  528. <div style="height:0;position:relative;" v-if="!flg">
  529. <span class="newInvoice" @click="addNewInvoice"> <i class="el-icon-circle-plus-outline"></i> {{ $t('newinvoice')
  530. }}</span>
  531. </div>
  532. <el-table :data="ParticularsList.invoiceList" border style="width: 100%">
  533. <el-table-column prop="status" :label="$t('other.approvalStatus')" width="172" v-if="auditTypeItem.auditType == 1">
  534. <template slot-scope="scope">
  535. <span v-if="scope.row.status == 1" class="waiting">{{ statusTxt[scope.row.status] }}</span>
  536. <span v-if="scope.row.status == 2" class="rejected">{{ statusTxt[scope.row.status] }}</span>
  537. <span v-if="scope.row.status == 0 || scope.row.status == 3">{{ statusTxt[scope.row.status] }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column v-if="auditTypeItem.auditType == 1" width="172" :label="$t('other.reviewer')">
  541. <template slot-scope="scope">
  542. <span v-if="user.userNameNeedTranslate == 1">
  543. <TranslationOpenDataText type='userName' :openid='scope.row.projectManagerName'></TranslationOpenDataText>
  544. </span>
  545. <span v-else>{{ scope.row.projectManagerName }}</span>
  546. </template>
  547. </el-table-column>
  548. <el-table-column prop="projectId" :label="$t('other.project')" width="155">
  549. <template slot-scope="scope">
  550. <el-select size="small" v-if="!flg" v-model="scope.row.projectId" :placeholder="$t('other.project')"
  551. style="width: 130px">
  552. <el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName + item.projectCode"
  553. :value="item.id" @click="ok(item)">
  554. <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  555. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  556. </el-option>
  557. </el-select>
  558. <div v-else>
  559. <span>{{ scope.row.projectName }}</span>
  560. </div>
  561. </template>
  562. </el-table-column>
  563. <el-table-column prop="happenDate" :label="$t('forthedate')" width="172">
  564. <template slot-scope="scope">
  565. <el-date-picker size="small" v-if="!flg" v-model="scope.row.happenDate" type="date" style=" width: 145px"
  566. value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
  567. </el-date-picker>
  568. <span v-else>{{ scope.row.happenDate }}</span>
  569. </template>
  570. </el-table-column>
  571. <el-table-column prop="invoiceType" :label="$t('invoices')" width="172"
  572. v-if="this.user.timeType.easyExpense == 0">
  573. <template slot-scope="scope">
  574. <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType"
  575. :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
  576. <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
  577. <el-option :label="$t('vATgeneralinvoice')" :value="1"></el-option>
  578. </el-select>
  579. <span v-else>{{ typeInvoic[scope.row.invoiceType] }}</span>
  580. </template>
  581. </el-table-column>
  582. <el-table-column prop="invoiceType" :label="$t('costtype')" width="172">
  583. <template slot-scope="scope">
  584. <el-select v-if="!flg" size="small" v-model="scope.row.expenseType"
  585. :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px">
  586. <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName"
  587. :value="item.typeName"></el-option>
  588. </el-select>
  589. <span v-else>{{ scope.row.expenseType }}</span>
  590. </template>
  591. </el-table-column>
  592. <el-table-column prop="amount" :label="this.user.timeType.easyExpense == 0 ? $t('amountoffees') : '费用金额'"
  593. width="172">
  594. <template slot-scope="scope">
  595. <el-input size="small" v-if="!flg" :id="'am' + scope.$index" v-model="scope.row.amount"
  596. @input="zhiNum(scope.$index, scope)" @change="kan"
  597. @keyup.native="restrictNumber('am' + scope.$index)" :disabled="user.companyId == 4811 && user.id != ParticularsList.ownerId && ParticularsList.type == 14454"></el-input>
  598. <span v-else>¥{{ scope.row.amount }}</span>
  599. </template>
  600. </el-table-column>
  601. <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172"
  602. v-if="this.user.timeType.easyExpense == 0">
  603. <template slot-scope="scope">
  604. <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
  605. <span v-else>{{ scope.row.invoiceNo }}</span>
  606. </template>
  607. </el-table-column>
  608. <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172"
  609. v-if="this.user.timeType.easyExpense == 0">
  610. <template slot-scope="scope">
  611. <el-input size="small" v-if="!flg" v-model="scope.row.taxPercent"
  612. @input="zhiNum(scope.$index, scope)"></el-input>
  613. <span v-else>{{ scope.row.taxPercent }}</span>
  614. </template>
  615. </el-table-column>
  616. <el-table-column prop="taxValue" :label="$t('taxs') + '(' + $t('yuan') + ')'" width="172"
  617. v-if="this.user.timeType.easyExpense == 0">
  618. <template slot-scope="scope">
  619. <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>
  620. <span v-else>¥{{ scope.row.taxValue }}</span>
  621. </template>
  622. </el-table-column>
  623. <el-table-column prop="remark" :label="$t('bei-zhu')" width="300">
  624. <template slot-scope="scope">
  625. <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>
  626. <span v-else>{{ scope.row.remark }}</span>
  627. </template>
  628. </el-table-column>
  629. <el-table-column prop="pic" :label="$t('expensereimbursementvoucher')" width="300">
  630. <template slot-scope="scope">
  631. <!-- <div v-if="!flg">
  632. <div @click="abl(scope.$index)" style="height: 35px;overflow: hidden;">
  633. <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :file-list="scope.row.pic"
  634. :before-remove="beforeRemoves" :http-request="fileonLoads" limit="1" name="multipartFile">
  635. <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
  636. </el-upload>
  637. </div>
  638. </div>
  639. <div v-else>
  640. <span v-if="scope.row.pic">
  641. <div class="tups">
  642. <viewer :images="scope.row.pic">
  643. <img ref="imgsa" v-for="src in scope.row.pic" :src="src.url" :key="src.title">
  644. </viewer>
  645. </div>
  646. </span>
  647. <span v-else>{{ $t('nodocuments') }}</span>
  648. </div> -->
  649. <div>
  650. <div v-if="scope.row.pic && scope.row.pic.length > 0">
  651. <el-button size="small" @click="viewDetailsImage(scope.$index, 'ParticularsList', 'invoiceList')">{{ $t('Checkthedetails') }}</el-button>
  652. </div>
  653. <div v-else>
  654. <el-button type="primary" size="small" @click="performCustomization(scope.$index, 2)" :loading="listLoading">{{ $t('clickupload') }}</el-button>
  655. </div>
  656. </div>
  657. </template>
  658. </el-table-column>
  659. <!-- 删除 -->
  660. <el-table-column fixed="right" :label="$t('operation')" v-if="!flg">
  661. <template slot-scope="scope">
  662. <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px"
  663. @click="delec(scope.$index)">{{ $t('btn.delete') }}</el-button>
  664. </template>
  665. </el-table-column>
  666. <el-table-column prop="status" :label="$t('other.audit')" width="172" v-if="auditTypeItem.auditType == 1 && showSingleAudit"
  667. fixed="right">
  668. <template slot-scope="scope">
  669. <el-button v-if="scope.row.isIncharger && scope.row.status == 1"
  670. @click="approveSingle(scope.row)">{{ $t('btn.through') }}</el-button><el-button
  671. v-if="scope.row.isIncharger && scope.row.status == 1" @click="denySingle(scope.row)">{{ $t('btn.rejected') }}</el-button>
  672. </template>
  673. </el-table-column>
  674. </el-table>
  675. </div>
  676. <!-- <viewer :images="imgs">
  677. <img ref="imgsa" v-for="src in imgs" :src="src.url" :key="src.title">
  678. </viewer> -->
  679. <!-- 取消和确定 -->
  680. <span slot="footer" class="dialog-footer">
  681. <!-- <el-button @click="print()">打印</el-button> -->
  682. <el-button @click="dialog = false">{{ $t('btn.cancel') }}</el-button>
  683. <el-button v-if="!flg" type="primary" @click="present()">{{ $t('btn.determine') }}</el-button>
  684. <el-button v-else type="primary" @click="dialog = false">{{ $t('btn.determine') }}</el-button>
  685. </span>
  686. </el-dialog>
  687. <!-- 批量上传 -->
  688. <el-dialog :title="$t('batchupload')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth"
  689. width="500px">
  690. <p>1. {{ $t('other.download') }}
  691. <span>{{ $t('expensereimbursementimporttemplate') }}</span>
  692. <el-link type="primary" style="margin-left:5px;" :underline="false"
  693. :href="'./upload/' + $t('expensereimbursementimporttemplate') + '.xlsx'"
  694. :download="$t('expensereimbursementimporttemplate') + '.xlsx'">{{ $t('expensereimbursementimporttemplate')
  695. }}.xlsx</el-link>
  696. </p>
  697. <p>2. {{ $t('exceltemplateanduploadit') }}。</p>
  698. <div style="padding-bottom:1em;">
  699. <div style="width:300px;margin:0 auto">
  700. <el-upload ref="upload" action="#" :auto-upload="false" multiple :on-change="fileListAdd"
  701. :on-remove="fileListDel">
  702. <el-button slot="trigger" size="small" type="primary" style="">{{ $t('selecthefile') }}</el-button>
  703. <el-button type="primary" size="small" style="margin-left:30px" :underline="false" :loading="importingData"
  704. @click="submitUploadSure" :disabled="fileList.length == 0">{{ $t('toupload') }}</el-button>
  705. <el-button size="small" style="margin-left:30px" @click="fileListClear">{{ $t('clears') }}</el-button>
  706. </el-upload>
  707. </div>
  708. </div>
  709. </el-dialog>
  710. <!-- 主费用类型自定义 -->
  711. <el-dialog :title="$t('feiYongLeiXingDaLeiGuanLi')" v-if="expenseTypeDialog" :visible.sync="expenseTypeDialog" customClass="customWidth"
  712. width="600px">
  713. <el-table :data="expenseMainTypes" style="width:100%" height="400" :loading="expenseTypeListLoading">
  714. <el-table-column :label="$t('typename ')" min-width="150">
  715. <template slot-scope="scope">
  716. <span>{{ scope.row.name }}</span>
  717. </template>
  718. </el-table-column>
  719. <el-table-column :label="$t('duiYingChengBenXiang')" min-width="150">
  720. <template slot-scope="scope">
  721. <span>{{ scope.row.basecostSettingName }}</span>
  722. </template>
  723. </el-table-column>
  724. <el-table-column :label="$t('operation')" width="150">
  725. <template slot-scope="scope">
  726. <el-button @click="expenseTypeEditOp(scope.row)" size="small" type="primary">{{ $t('bian-ji') }}</el-button>
  727. <el-button @click="expenseTypeEditDelete(scope.row)" size="small" type="danger">{{ $t('btn.delete')
  728. }}</el-button>
  729. </template>
  730. </el-table-column>
  731. </el-table>
  732. <span slot="footer" class="dialog-footer">
  733. <el-button @click="expenseTypeDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
  734. <el-button type="primary" @click="expenseTypeEditOp()" size="medium">{{ $t('newtype') }}</el-button>
  735. </span>
  736. <!-- 新增/编辑费用类型 -->
  737. <el-dialog :title="$t('addeditfeetypes')" v-if="expenseTypeEditDialog" :visible.sync="expenseTypeEditDialog"
  738. customClass="customWidth" width="400px" append-to-body>
  739. <el-form label-width="100px" :rules="editExpenseTypeDataRules" ref="editExpenseTypeDataForm"
  740. :model="editExpenseTypeData">
  741. <el-form-item :label="$t('typename ')" style="margin:30px 0" prop="typeName">
  742. <el-input id="editExpenseTypeDataInput" size="medium" v-model="editExpenseTypeData.name"
  743. :placeholder="$t('customizethfeetypename')" style="width:90%"
  744. @keyup.native="editExpenseTypeDataInput('editExpenseTypeDataInput')"></el-input>
  745. </el-form-item>
  746. <el-form-item :label="$t('duiYingChengBenXiang')" style="margin:30px 0" prop="basecostSettingId">
  747. <el-select v-model="editExpenseTypeData.basecostSettingId" size="medium" style="width:90%" clearable>
  748. <el-option v-for="item in basecostSettingList" :key="item.id" :label="item.name" :value="item.id"
  749. :disabled="item.alarmType == 1"></el-option>
  750. </el-select>
  751. </el-form-item>
  752. </el-form>
  753. <span slot="footer" class="dialog-footer">
  754. <el-button @click="expenseTypeEditDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
  755. <el-button type="primary" @click="expenseTypeEditSure" size="medium">{{ $t('btn.determine') }}</el-button>
  756. </span>
  757. </el-dialog>
  758. </el-dialog>
  759. <!-- 费用类型自定义 -->
  760. <el-dialog :title="$t('expensetypemanagement')" v-if="customTypeDialog" :visible.sync="customTypeDialog"
  761. customClass="customWidth" width="600px">
  762. <el-table :data="customTypeList" style="width:100%" height="400" :loading="customTypeListLoading">
  763. <el-table-column prop="typeName" :label="$t('costofname')" min-width="150"></el-table-column>
  764. <el-table-column :label="$t('costtype')" min-width="150">
  765. <template slot-scope="scope">
  766. <span>{{ scope.row.expenseMainTypeName }}</span>
  767. </template>
  768. </el-table-column>
  769. <el-table-column :label="$t('operation')" width="150">
  770. <template slot-scope="scope">
  771. <el-button @click="customTypeEditOp(scope.row)" size="small" type="primary">{{ $t('bian-ji') }}</el-button>
  772. <el-button @click="customTypeEditDelete(scope.row)" size="small" type="danger">{{ $t('btn.delete')
  773. }}</el-button>
  774. </template>
  775. </el-table-column>
  776. </el-table>
  777. <span slot="footer" class="dialog-footer">
  778. <el-button @click="customTypeDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
  779. <el-button type="primary" @click="customTypeEditOp()" size="medium">{{ $t('newtype') }}</el-button>
  780. </span>
  781. <!-- 新增/编辑费用类型 -->
  782. <el-dialog :title="$t('addeditfeetypes')" v-if="customTypeEditDialog" :visible.sync="customTypeEditDialog"
  783. customClass="customWidth" width="400px" append-to-body>
  784. <el-form label-width="80px" :rules="editTypeDataRules" ref="editTypeDataForm" :model="editTypeData">
  785. <el-form-item :label="$t('belongstype')" style="margin:30px 0">
  786. <el-select v-model="editTypeData.mainType" size="medium" style="width:90%">
  787. <el-option v-for="item in expenseMainTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
  788. </el-select>
  789. </el-form-item>
  790. <el-form-item :label="$t('typename ')" style="margin:30px 0" prop="typeName">
  791. <el-input id="editTypeDataInput" size="medium" v-model="editTypeData.typeName"
  792. :placeholder="$t('customizethfeetypename')" style="width:90%"
  793. @keyup.native="editTypeDataInput('editTypeDataInput')"></el-input>
  794. </el-form-item>
  795. </el-form>
  796. <span slot="footer" class="dialog-footer">
  797. <el-button @click="customTypeEditDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
  798. <el-button type="primary" @click="customTypeEditSure" size="medium">{{ $t('btn.determine') }}</el-button>
  799. </span>
  800. </el-dialog>
  801. </el-dialog>
  802. <!-- 驳回弹出框 -->
  803. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog"
  804. :close-on-click-modal="false" customClass="customWidth" width="500px">
  805. <div>
  806. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
  807. </div>
  808. <div slot="footer" class="dialog-footer">
  809. <el-button @click="denyReasonDialog = false">{{ $t('btn.cancel') }}</el-button>
  810. <el-button type="primary" @click="deny()">{{ $t('btn.determine') }}</el-button>
  811. </div>
  812. </el-dialog>
  813. <!-- 详情查看弹出框 -->
  814. <el-dialog :title="$t('detailsofReimbursementvoucher')" :visible.sync="detailDialog" width="1100px" :before-close="handleClose">
  815. <div ref="printContent" class="printContent">
  816. <div class="printContent-detail">
  817. <div class="detail-item">
  818. <span class="detail-item-title"> <span class="printBox">{{ $t('peopleconcerned') }}</span> </span>
  819. <span class="detail-item-content">
  820. <span v-if="user.userNameNeedTranslate == 1">
  821. <TranslationOpenDataText type='userName' :openid='ParticularsList.ownerName'></TranslationOpenDataText>
  822. </span>
  823. <span v-else>{{ ParticularsList.ownerName }}</span>
  824. </span>
  825. </div>
  826. <div class="detail-item">
  827. <span class="detail-item-title"><span class="printBox">{{ $t('tianBaoShiJian') }}</span></span>
  828. <span class="detail-item-content">{{ ParticularsList.createDate }}</span>
  829. </div>
  830. <div class="detail-item">
  831. <span class="detail-item-title"><span class="printBox">{{ $t('invoicenumber') }}</span></span>
  832. <span class="detail-item-content">{{ ParticularsList.ticketNum }} {{ $t('zhang') }}</span>
  833. </div>
  834. <div class="detail-item">
  835. <span class="detail-item-title"><span class="printBox">{{ $t('feiYongLeiXing') }}</span></span>
  836. <span class="detail-item-content">{{ detaExpenseMainTypeName }}</span>
  837. </div>
  838. <div class="detail-item">
  839. <span class="detail-item-title"><span class="printBox">{{ $t('totalcostos') }}</span></span>
  840. <span class="detail-item-content">¥ {{ ParticularsList.totalAmount | numberToCurrency }}</span>
  841. </div>
  842. <div class="detail-item" style="width: 100%">
  843. <span class="detail-item-title"><span class="printBox">{{ $t('bei-zhu') }}</span></span>
  844. <span class="detail-item-content">{{ ParticularsList.remark }}</span>
  845. </div>
  846. </div>
  847. <!-- <el-table :data="ParticularsList.invoiceList" border style="width: 100%">
  848. <el-table-column prop="projectId" :label="$t('other.project')" width="155">
  849. <el-table-column prop="status" label="审核状态" width="172" v-if="auditTypeItem.auditType == 1">
  850. <template slot-scope="scope">
  851. <span v-if="scope.row.status == 1" class="waiting">{{ statusTxt[scope.row.status] }}</span>
  852. <span v-if="scope.row.status == 2" class="rejected">{{ statusTxt[scope.row.status] }}</span>
  853. <span v-if="scope.row.status == 0 || scope.row.status == 3">{{ statusTxt[scope.row.status] }}</span>
  854. </template>
  855. </el-table-column>
  856. <template slot-scope="scope">
  857. <el-select size="small" v-if="!flg" v-model="scope.row.projectId" :placeholder="$t('other.project')"
  858. style="width: 130px">
  859. <el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName + item.projectCode"
  860. :value="item.id" @click="ok(item)">
  861. <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  862. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  863. </el-option>
  864. </el-select>
  865. <div v-else>
  866. <div v-for="(item, index) in projectIdName" :key="index">
  867. <span v-if="item.id == scope.row.projectId">{{ item.projectName }}</span>
  868. </div>
  869. </div>
  870. </template>
  871. </el-table-column>
  872. <el-table-column prop="happenDate" :label="$t('forthedate')" width="172">
  873. <template slot-scope="scope">
  874. <el-date-picker size="small" v-if="!flg" v-model="scope.row.happenDate" type="date" style=" width: 145px"
  875. value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
  876. </el-date-picker>
  877. <span v-else>{{ scope.row.happenDate }}</span>
  878. </template>
  879. </el-table-column>
  880. <el-table-column prop="invoiceType" :label="$t('invoices')" width="172"
  881. v-if="this.user.timeType.easyExpense == 0">
  882. <template slot-scope="scope">
  883. <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType"
  884. :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
  885. <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
  886. <el-option :label="$t('vATgeneralinvoice')" :value="1"></el-option>
  887. </el-select>
  888. <span v-else>{{ typeInvoic[scope.row.invoiceType] }}</span>
  889. </template>
  890. </el-table-column>
  891. <el-table-column prop="invoiceType" :label="$t('costtype')" width="172">
  892. <template slot-scope="scope">
  893. <el-select v-if="!flg" size="small" v-model="scope.row.expenseType"
  894. :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px">
  895. <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName"
  896. :value="item.typeName"></el-option>
  897. </el-select>
  898. <span v-else>{{ scope.row.expenseType }}</span>
  899. </template>
  900. </el-table-column>
  901. <el-table-column prop="amount" :label="this.user.timeType.easyExpense == 0 ? $t('amountoffees') : '费用金额'"
  902. width="172">
  903. <template slot-scope="scope">
  904. <el-input size="small" v-if="!flg" :id="'am' + scope.$index" v-model="scope.row.amount"
  905. @input="zhiNum(scope.$index, scope)" @change="kan"
  906. @keyup.native="restrictNumber('am' + scope.$index)"></el-input>
  907. <span v-else>¥{{ scope.row.amount }}</span>
  908. </template>
  909. </el-table-column>
  910. <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172"
  911. v-if="this.user.timeType.easyExpense == 0">
  912. <template slot-scope="scope">
  913. <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
  914. <span v-else>{{ scope.row.invoiceNo }}</span>
  915. </template>
  916. </el-table-column>
  917. <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172"
  918. v-if="this.user.timeType.easyExpense == 0">
  919. <template slot-scope="scope">
  920. <el-input size="small" v-if="!flg" v-model="scope.row.taxPercent"
  921. @input="zhiNum(scope.$index, scope)"></el-input>
  922. <span v-else>{{ scope.row.taxPercent }}</span>
  923. </template>
  924. </el-table-column>
  925. <el-table-column prop="taxValue" :label="$t('taxs') + '(' + $t('yuan') + ')'" width="172"
  926. v-if="this.user.timeType.easyExpense == 0">
  927. <template slot-scope="scope">
  928. <el-input size="small" v-if="!flg" v-model="scope.row.taxValue"></el-input>
  929. <span v-else>¥{{ scope.row.taxValue }}</span>
  930. </template>
  931. </el-table-column>
  932. <el-table-column prop="remark" :label="$t('bei-zhu')" width="300">
  933. <template slot-scope="scope">
  934. <el-input size="small" v-if="!flg" v-model="scope.row.remark" maxlength="100"></el-input>
  935. <span v-else>{{ scope.row.remark }}</span>
  936. </template>
  937. </el-table-column>
  938. <el-table-column prop="pic" :label="$t('expensereimbursementvoucher')" width="300">
  939. <template slot-scope="scope">
  940. <div v-if="!flg">
  941. <div @click="abl(scope.$index)" style="height: 35px;overflow: hidden;">
  942. <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :file-list="scope.row.pic"
  943. :before-remove="beforeRemoves" :http-request="fileonLoads" limit="1" name="multipartFile">
  944. <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
  945. </el-upload>
  946. </div>
  947. </div>
  948. <div v-else>
  949. <span v-if="scope.row.pic">
  950. <div class="tups">
  951. <viewer :images="scope.row.pic">
  952. <img ref="imgsa" v-for="src in scope.row.pic" :src="src.url" :key="src.title">
  953. </viewer>
  954. </div>
  955. </span>
  956. <span v-else>{{ $t('nodocuments') }}</span>
  957. </div>
  958. </template>
  959. </el-table-column>
  960. <el-table-column fixed="right" :label="$t('operation')" v-if="!flg">
  961. <template slot-scope="scope">
  962. <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px"
  963. @click="delec(scope.$index)">{{ $t('btn.delete') }}</el-button>
  964. </template>
  965. </el-table-column>
  966. </el-table> -->
  967. <!-- 卡片列表 -->
  968. <div class="conter-box">
  969. <div class="conter-border" v-for="item, index in ParticularsList.invoiceList" :key="index">
  970. <div class="detail-item" v-if="auditTypeItem.auditType != 1">
  971. <span class="detail-item-title"> <span class="printBox">{{ $t('other.project') }}</span> </span>
  972. <span class="detail-item-content">
  973. {{ item.projectName }}
  974. <!-- <el-select size="small" v-if="!flg" v-model="item.projectId" :placeholder="$t('other.project')"
  975. style="width: 130px">
  976. <el-option v-for="(item, index) in projectList" :key="index"
  977. :label="item.projectName + item.projectCode" :value="item.id" @click="ok(item)">
  978. <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  979. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  980. </el-option>
  981. </el-select>
  982. <div v-else>
  983. <div v-for="(item, index) in projectIdName" :key="index">
  984. <span v-if="item.id == item.projectId">{{ item.projectName }}</span>
  985. </div>
  986. </div> -->
  987. </span>
  988. </div>
  989. <div class="detail-item" v-if="auditTypeItem.auditType == 1">
  990. <span class="detail-item-title"> <span class="printBox">{{ $t('xiangMuShenHeZhuangTai') }}</span> </span>
  991. <span class="detail-item-content">
  992. <span v-if="item.status == 1" class="waiting">{{ statusTxt[item.status] }}</span>
  993. <span v-if="item.status == 2" class="rejected">{{ statusTxt[item.status] }}</span>
  994. <span v-if="item.status == 0 || item.status == 3">{{ statusTxt[item.status] }}</span>
  995. </span>
  996. </div>
  997. <div class="detail-item">
  998. <span class="detail-item-title"> <span class="printBox">{{ $t('forthedate') }}</span> </span>
  999. <span class="detail-item-content">{{ item.happenDate }}</span>
  1000. </div>
  1001. <div class="detail-item">
  1002. <span class="detail-item-title"> <span class="printBox">{{ $t('invoices') }}</span> </span>
  1003. <span class="detail-item-content">{{ typeInvoic[item.invoiceType] }}</span>
  1004. </div>
  1005. <div class="detail-item">
  1006. <span class="detail-item-title"> <span class="printBox">{{ $t('costtype') }}</span> </span>
  1007. <span class="detail-item-content">{{ item.expenseType }}</span>
  1008. </div>
  1009. <div class="detail-item">
  1010. <span class="detail-item-title single"> <span class="printBox">{{ $t('feiYongJineHanShui') }}</span> </span>
  1011. <span class="detail-item-content">{{ item.amount }}</span>
  1012. </div>
  1013. <div class="detail-item">
  1014. <span class="detail-item-title"> <span class="printBox">{{ $t('invoiceno') }}</span> </span>
  1015. <span class="detail-item-content">{{ item.invoiceNo }}</span>
  1016. </div>
  1017. <div class="detail-item">
  1018. <span class="detail-item-title"> <span class="printBox">{{ $t('shui-shuai') }}</span> </span>
  1019. <span class="detail-item-content">{{ item.taxValue }}</span>
  1020. </div>
  1021. <div class="detail-item">
  1022. <span class="detail-item-title"> <span class="printBox">{{ $t('taxs') }}</span> </span>
  1023. <span class="detail-item-content">{{ item.taxValue ? `¥${item.taxValue}` : '' }}</span>
  1024. </div>
  1025. <div class="detail-item">
  1026. <span class="detail-item-title"> <span class="printBox">{{ $t('bei-zhu') }}</span> </span>
  1027. <span class="detail-item-content">{{ item.remark }}</span>
  1028. </div>
  1029. <div class="detail-item" style="display: flex">
  1030. <span class="detail-item-title"> <span class="printBox">{{ $t('expensereimbursementvoucher') }}</span> </span>
  1031. <div class="detail-item-content">
  1032. <div v-if="item.pic" style="display: inline-block;">
  1033. <div class="tups">
  1034. <!-- <viewer :images="item.pic">
  1035. <img ref="imgsa" v-for="src in item.pic" :src="src.url" :key="src.title">
  1036. </viewer> -->
  1037. <viewer :images="item.pic">
  1038. <template v-for="src,i in item.pic" :id="src.url">
  1039. <img ref="imgsa" :src="src.url" v-if="isFileType(src.url) == 'image'">
  1040. <img :src="pdfIcons" v-if="isFileType(src.url) == 'pdf'" @click.stop="openViewPdf(src.url)">
  1041. </template>
  1042. </viewer>
  1043. </div>
  1044. </div>
  1045. </div>
  1046. </div>
  1047. </div>
  1048. </div>
  1049. </div>
  1050. <span slot="footer" class="dialog-footer">
  1051. <el-button @click="print()">{{ $t('daYin') }}</el-button>
  1052. <el-button @click="detailDialog = false">{{ $t('guanBi') }}</el-button>
  1053. </span>
  1054. </el-dialog>
  1055. <!-- 自定义图片上传 -->
  1056. <div class="customIamgeLoad">
  1057. <input id="uploadInput" ref="uploadInput" type="file" class="file" @change="fileMultLoad" multiple accept="image/jpg,image/png,application/pdf" />
  1058. </div>
  1059. <!-- 发放支付方式 -->
  1060. <el-dialog :title="$t('faFangFangShi')" :visible.sync="dialogVisibleRelease" width="400px" :before-close="handleClose">
  1061. <div>
  1062. <el-select v-model="releaseData.id" :placeholder="$t('qingXuanZeZhiFuFangShi')" style="width: 100%" clearable>
  1063. <el-option v-for="item in sendStateList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1064. </el-select>
  1065. </div>
  1066. <span slot="footer" class="dialog-footer">
  1067. <el-button @click="dialogVisibleRelease = false">{{ $t('quXiao') }}</el-button>
  1068. <el-button type="primary" @click="callingInterface(1, releaseData.data)">{{ $t('queDing') }}</el-button>
  1069. </span>
  1070. </el-dialog>
  1071. </section>
  1072. </template>
  1073. <script>
  1074. // 自定义select组件
  1075. import selectCat from "@/components/select.vue"
  1076. // 引入自定义级联组件
  1077. import vueCascader from "@/components/cascader.vue"
  1078. import { getThemeColor } from '@/utils/commonMethod.js'
  1079. export default {
  1080. name: "expense",
  1081. components: {
  1082. selectCat,
  1083. vueCascader
  1084. },
  1085. props: {},
  1086. data() {
  1087. return {
  1088. themeColor: getThemeColor(),
  1089. pdfIcons: require('@/assets/image/pdfIcon.png'),
  1090. showSingleAudit: false,
  1091. auditTypeItem: { auditType: 0 },
  1092. queryExpenseMainType: null,
  1093. denyReasonDialog: false,
  1094. denyForm: {
  1095. reason: '',
  1096. id: null
  1097. },
  1098. basecostSettingList: [],
  1099. exportingData:false,
  1100. fileList: [],
  1101. muHeight: document.documentElement.clientHeight || document.body.clientHeight,
  1102. xiamianWidth: document.documentElement.clientWidth || document.body.clientWidth,
  1103. imgs: [],
  1104. addFormRules: {
  1105. ownerId: [{ required: true, message: this.$t('pleaseselecttheapplicant'), trigger: "blur" }],
  1106. createDate: [{ required: true, message: this.$t('pleaseselectadate'), trigger: "blur" }],
  1107. },
  1108. isAuditList: false,
  1109. statusTxt: [this.$t('state.approved'), this.$t('state.WaitingAudit'), this.$t('state.rejected'), this.$t('state.undone'), '未填写'],
  1110. user: JSON.parse(sessionStorage.getItem("user")),
  1111. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1112. allExpList: [],
  1113. expenseTypeList: [],
  1114. tian: { a: null, b: null, c: null, d: null, e: null, f: null, g: null, h: null, },
  1115. typeInvoic: [this.$t('vATspecialinvoice'), this.$t('vATgeneralinvoice')],
  1116. listLoading: false,
  1117. tableHeight: 0,
  1118. list: [],
  1119. total: 0,
  1120. code: null,
  1121. date: null,
  1122. type: null,
  1123. ownerId: null,
  1124. users: [], // 人员信息
  1125. usersNoInfo: [], // 人员信息,去掉自己
  1126. displayTable: false,
  1127. getLists: [],
  1128. ProjectList: [], // 项目列表
  1129. companyId: [], // 人员的id
  1130. dialogVisible: false,
  1131. code: null,
  1132. addForm: { code: null, ownerId: null, createDate: null, ticketNum: 1, type: 0, remark: null, totalAmount: 0, },
  1133. page: 1,
  1134. size: 20,
  1135. form: { happenDate: null, invoiceType: null, amount: null, invoiceNo: null, taxPercent: null, taxValue: null, remark: null },
  1136. invoiceList: [],
  1137. kkk: null, //
  1138. ddId: null,
  1139. dldl: [],
  1140. isOK: false,
  1141. z: null,
  1142. value: null,
  1143. dialog: false, // 单据查看展示
  1144. ParticularsList: [],
  1145. projectIdName: [], // 点击查看的项目名
  1146. flg: false, // 是否禁用
  1147. shuz: [this.$t('generalexpenses'), this.$t('travelexpensess'), this.$t('outsourcingcostshouldbereported')],
  1148. ins: 0,
  1149. apl: '',
  1150. diz: 'http://worktime.ttkuaiban.com',
  1151. importDialog: false,
  1152. importingData: false,
  1153. currentClick: '',
  1154. currentClickNum: 0,
  1155. // 费用类型自定义
  1156. customTypeDialog: false,
  1157. customTypeList: [],
  1158. customTypeListLoading: false,
  1159. customTypeEditDialog: false,
  1160. editTypeData: {},
  1161. editTypeDataRules: {
  1162. typeName: [{ required: true, message: this.$t('pleaseentercustomfeetypename'), trigger: "blur" }],
  1163. },
  1164. expenseMainTypes: [],
  1165. expenseMainTypeValue: '',
  1166. expenseTypeDialog: false,
  1167. expenseTypeListLoading: false,
  1168. expenseTypeEditDialog: false,
  1169. editExpenseTypeData: {},
  1170. editExpenseTypeDataRules: {
  1171. name: [{ required: true, message: this.$t('pleaseentercustomfeetypename'), trigger: "blur" }],
  1172. },
  1173. // 详情弹出框
  1174. detailDialog: false,
  1175. detaExpenseMainTypeName: '',
  1176. multipleSelection: [],
  1177. sendState: '',
  1178. dialogVisibleImage: false,
  1179. dialogVisibleImageList: [],
  1180. imgLoadType: 1, // 1 为 费用填报的图片上传 2 单据修改的图片上传
  1181. releaseData: {
  1182. id: '',
  1183. data: '',
  1184. }, // 发放数据
  1185. sendStateList: [], // 发放状态列表
  1186. dialogVisibleRelease: false, // 发放弹出框
  1187. selectProject: null, // 项目选择
  1188. };
  1189. },
  1190. computed: {
  1191. totalCost: function () {
  1192. let num = 0
  1193. for (let i in this.invoiceList) {
  1194. if (this.invoiceList[i].amount) {
  1195. num += this.invoiceList[i].amount * 1
  1196. }
  1197. }
  1198. return num
  1199. }
  1200. },
  1201. watch: {},
  1202. created() {
  1203. let height = window.innerHeight;
  1204. this.tableHeight = height - 195;
  1205. const that = this;
  1206. window.onresize = function temp() {
  1207. that.tableHeight = window.innerHeight - 195;
  1208. };
  1209. },
  1210. mounted() {
  1211. this.getNextCode();
  1212. this.getUsers() // 获取人员信息
  1213. this.getList() // 获取单据列表
  1214. this.getProjectList();
  1215. this.getExpensMainTypes();
  1216. this.getExpList();
  1217. this.getBasecostItemList();
  1218. this.getAuditType();
  1219. this.getSendStateList();
  1220. },
  1221. filters: {
  1222. numberToCurrency(value) {
  1223. if (!value) return '0.00'
  1224. // console.log('v=='+value);
  1225. value = value.toFixed(2)
  1226. const intPart = Math.trunc(value)
  1227. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  1228. let floatPart = '.00'
  1229. const valueArray = value.toString().split('.')
  1230. if (valueArray.length === 2) { // 有小数部分
  1231. floatPart = valueArray[1].toString() // 取得小数部分
  1232. return intPartFormat + '.' + floatPart
  1233. }
  1234. return intPartFormat + floatPart
  1235. }
  1236. },
  1237. methods: {
  1238. getBasecostItemList() {
  1239. this.http.post('/project-basecost-setting/list', {},
  1240. res => {
  1241. if (res.code == 'ok') {
  1242. this.basecostSettingList = res.data;
  1243. } else {
  1244. this.$message({
  1245. message: res.msg,
  1246. type: 'error'
  1247. })
  1248. }
  1249. }, err => {
  1250. this.$message({
  1251. message: err,
  1252. type: 'error'
  1253. })
  1254. })
  1255. },
  1256. // 费用类型自定义
  1257. customTypeOp() {
  1258. this.customTypeDialog = true
  1259. this.customTypeListLoading = true
  1260. },
  1261. customTypeEditOp(row) {
  1262. this.customTypeEditDialog = true
  1263. if (row) {
  1264. this.editTypeData = row
  1265. } else {
  1266. this.editTypeData = {
  1267. mainType: '',
  1268. typeName: '',
  1269. companyId: this.user.companyId
  1270. }
  1271. }
  1272. },
  1273. customTypeEditSure() {
  1274. this.$refs.editTypeDataForm.validate(valid => {
  1275. if (valid) {
  1276. this.http.post('/expense-type/addOrMod', this.editTypeData,
  1277. res => {
  1278. if (res.code == 'ok') {
  1279. this.customTypeEditDialog = false
  1280. this.customTypeOp()
  1281. this.getExpList()
  1282. } else {
  1283. this.$message({
  1284. message: res.msg,
  1285. type: 'error'
  1286. })
  1287. }
  1288. }, err => {
  1289. this.$message({
  1290. message: err,
  1291. type: 'error'
  1292. })
  1293. })
  1294. }
  1295. })
  1296. },
  1297. customTypeEditDelete(row) {
  1298. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'), this.$t('other.prompts'), {
  1299. confirmButtonText: this.$t('btn.determine'),
  1300. cancelButtonText: this.$t('btn.cancel'),
  1301. type: 'warning'
  1302. }).then(() => {
  1303. this.http.post('/expense-type/delete', {
  1304. id: row.id
  1305. },
  1306. res => {
  1307. if (res.code == 'ok') {
  1308. this.customTypeEditDialog = false
  1309. this.customTypeOp()
  1310. this.getExpList()
  1311. } else {
  1312. this.$message({
  1313. message: res.msg,
  1314. type: 'error'
  1315. })
  1316. }
  1317. }, err => {
  1318. this.$message({
  1319. message: err,
  1320. type: 'error'
  1321. })
  1322. })
  1323. }).catch(() => {
  1324. this.$message({
  1325. type: 'info',
  1326. message: this.$t('thedeletionhasbeencancelled')
  1327. })
  1328. })
  1329. },
  1330. editTypeDataInput(typeName) {
  1331. let inpu = document.getElementById(typeName);
  1332. inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
  1333. },
  1334. // 费用主类型自定义
  1335. expenseTypeOp() {
  1336. this.expenseTypeDialog = true
  1337. this.customTypeListLoading = true
  1338. },
  1339. expenseTypeEditOp(row) {
  1340. this.expenseTypeEditDialog = true
  1341. if (row) {
  1342. this.editExpenseTypeData = row
  1343. } else {
  1344. this.editExpenseTypeData = {
  1345. isSystem: 0,
  1346. name: '',
  1347. companyId: this.user.companyId
  1348. }
  1349. }
  1350. },
  1351. expenseTypeEditSure() {
  1352. this.$refs.editExpenseTypeDataForm.validate(valid => {
  1353. if (valid) {
  1354. this.http.post('/expense-main-type/addOrMod', this.editExpenseTypeData,
  1355. res => {
  1356. if (res.code == 'ok') {
  1357. this.expenseTypeEditDialog = false
  1358. this.expenseTypeOp()
  1359. this.getExpensMainTypes()
  1360. this.getExpList()
  1361. } else {
  1362. this.$message({
  1363. message: res.msg,
  1364. type: 'error'
  1365. })
  1366. }
  1367. }, err => {
  1368. this.$message({
  1369. message: err,
  1370. type: 'error'
  1371. })
  1372. })
  1373. }
  1374. })
  1375. },
  1376. expenseTypeEditDelete(row) {
  1377. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'), this.$t('other.prompts'), {
  1378. confirmButtonText: this.$t('btn.determine'),
  1379. cancelButtonText: this.$t('btn.cancel'),
  1380. type: 'warning'
  1381. }).then(() => {
  1382. this.http.post('/expense-main-type/delete', {
  1383. id: row.id
  1384. },
  1385. res => {
  1386. if (res.code == 'ok') {
  1387. this.expenseTypeEditDialog = false
  1388. this.expenseTypeOp()
  1389. this.getExpensMainTypes()
  1390. } else {
  1391. this.$message({
  1392. message: res.msg,
  1393. type: 'error'
  1394. })
  1395. }
  1396. }, err => {
  1397. this.$message({
  1398. message: err,
  1399. type: 'error'
  1400. })
  1401. })
  1402. }).catch(() => {
  1403. this.$message({
  1404. type: 'info',
  1405. message: this.$t('thedeletionhasbeencancelled')
  1406. })
  1407. })
  1408. },
  1409. expenseTypeDataInput(typeName) {
  1410. let inpu = document.getElementById(typeName);
  1411. inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
  1412. },
  1413. editExpenseTypeDataInput(name) {
  1414. let inpu = document.getElementById(name);
  1415. inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
  1416. },
  1417. submitUpload() {
  1418. this.importDialog = true
  1419. },
  1420. fileListAdd(file, fileList) {
  1421. let str = file.name.split(".");
  1422. let format = str[str.length - 1];
  1423. if (format != "xls" && format != "xlsx") {
  1424. this.$message({
  1425. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  1426. type: "error"
  1427. });
  1428. fileList.splice(fileList.length - 1)
  1429. }
  1430. this.fileList = fileList
  1431. },
  1432. fileListDel(file, fileList) {
  1433. this.fileList = fileList
  1434. },
  1435. fileListClear() {
  1436. this.$refs.upload.clearFiles();
  1437. this.fileList = []
  1438. },
  1439. submitUploadSure() {
  1440. this.$confirm(this.$t('confirmtoupload'), this.$t('other.prompts'), {
  1441. confirmButtonText: this.$t('btn.determine'),
  1442. cancelButtonText: this.$t('btn.cancel'),
  1443. type: 'success'
  1444. }).then(() => {
  1445. let formData = new FormData();
  1446. for (let i in this.fileList) {
  1447. formData.append("files", this.fileList[i].raw);
  1448. }
  1449. this.importingData = true
  1450. // console.log(formData,this.fileList);
  1451. // return
  1452. this.http.uploadFile('/expense-sheet/importData', formData,
  1453. res => {
  1454. if (res.code == "ok") {
  1455. this.importingData = false
  1456. this.$refs.upload.clearFiles();
  1457. this.fileList = []
  1458. this.$message({
  1459. message: this.$t('uploadedsuccessfully'),
  1460. type: "success"
  1461. });
  1462. } else {
  1463. this.importingData = false
  1464. this.$message({
  1465. message: res.msg,
  1466. type: "error"
  1467. });
  1468. }
  1469. }, error => {
  1470. this.importingData = false
  1471. this.$message({
  1472. message: error,
  1473. type: "error"
  1474. });
  1475. });
  1476. }).catch(() => { })
  1477. },
  1478. restrictNumber(targetId) {
  1479. let inpu = document.getElementById(targetId);
  1480. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1481. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1482. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g, '').replace('$#*', '.');//去除其他"."
  1483. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1484. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1485. inpu.value = parseFloat(inpu.value);
  1486. }
  1487. },
  1488. approveSingle(item) {
  1489. this.http.post('/expense-sheet/approveSingleProject', {
  1490. id: item.id
  1491. },
  1492. res => {
  1493. if (res.code == "ok") {
  1494. this.getList();
  1495. // this.dialog = false;
  1496. this.getParticulars(item.expenseId);
  1497. } else {
  1498. this.$message({
  1499. message: res.msg,
  1500. type: "error"
  1501. });
  1502. }
  1503. },
  1504. error => {
  1505. this.$message({
  1506. message: error,
  1507. type: "error"
  1508. });
  1509. });
  1510. },
  1511. approve(item) {
  1512. if (this.auditTypeItem.auditType == 0 || this.auditTypeItem.auditType == 2) {
  1513. //默认模式,按有审核权限的人直接审核
  1514. this.showSingleAudit = false;
  1515. //审核通过
  1516. this.http.post('/expense-sheet/approve', {
  1517. id: item.id
  1518. },
  1519. res => {
  1520. if (res.code == "ok") {
  1521. this.getList();
  1522. } else {
  1523. this.$message({
  1524. message: res.msg,
  1525. type: "error"
  1526. });
  1527. }
  1528. },
  1529. error => {
  1530. this.$message({
  1531. message: error,
  1532. type: "error"
  1533. });
  1534. });
  1535. } else if (this.auditTypeItem.auditType == 1){
  1536. //项目经理按项目逐条审核
  1537. this.showSingleAudit = true;
  1538. this.downloadByA(item);
  1539. }
  1540. },
  1541. denySingle(item) {
  1542. //项目经理审核模式
  1543. this.http.post('/expense-sheet/denySingleProject', {
  1544. id: item.id
  1545. },
  1546. res => {
  1547. if (res.code == "ok") {
  1548. this.dialog = false;
  1549. this.showSingleAudit = false;
  1550. this.getList();
  1551. } else {
  1552. this.$message({
  1553. message: res.msg,
  1554. type: "error"
  1555. });
  1556. }
  1557. },
  1558. error => {
  1559. this.$message({
  1560. message: error,
  1561. type: "error"
  1562. });
  1563. });
  1564. },
  1565. denyReason(item) {
  1566. if (this.auditTypeItem.auditType == 0 || this.auditTypeItem.auditType == 2) {
  1567. this.denyForm.id = item.id
  1568. this.denyForm.reason = ''
  1569. // this.denyReasonDialog = true
  1570. this.deny()
  1571. } else {
  1572. this.downloadByA(item);
  1573. this.showSingleAudit = true;
  1574. }
  1575. },
  1576. deny() {
  1577. //审核驳回
  1578. this.http.post('/expense-sheet/deny', {
  1579. id: this.denyForm.id,
  1580. denyReason: this.denyForm.reason
  1581. },
  1582. res => {
  1583. if (res.code == "ok") {
  1584. this.denyReasonDialog = false
  1585. this.getList();
  1586. } else {
  1587. this.$message({
  1588. message: res.msg,
  1589. type: "error"
  1590. });
  1591. }
  1592. },
  1593. error => {
  1594. this.$message({
  1595. message: error,
  1596. type: "error"
  1597. });
  1598. });
  1599. },
  1600. costMainTypeSwitching() {
  1601. if(this.user.companyId == 4811 && this.expenseMainTypeValue == 14454) {
  1602. this.addForm.firstCheckerId = this.user.id
  1603. }
  1604. this.getExpList()
  1605. },
  1606. getExpList() {
  1607. this.http.post('/expense-type/getList', {
  1608. },
  1609. res => {
  1610. this.customTypeListLoading = false
  1611. if (res.code == "ok") {
  1612. this.allExpList = res.data;
  1613. this.customTypeList = res.data
  1614. this.addForm.type = this.expenseMainTypeValue
  1615. this.expenseTypeList = this.allExpList.filter(a => a.mainType == this.expenseMainTypeValue);
  1616. this.invoiceList = []
  1617. if (!res.data != res.data.length == 0) {
  1618. this.http.post('/company/settingExpenseType', {}, res => {
  1619. if (res.code == 'ok') { } else { this.$message({ message: res.msg, type: 'error' }) }
  1620. }, err => { this.$message({ message: err, type: 'error' }) })
  1621. }
  1622. for (let i in this.invoiceList) {
  1623. this.invoiceList[i].expenseType = ''
  1624. }
  1625. } else {
  1626. this.$message({
  1627. message: res.msg,
  1628. type: "error"
  1629. });
  1630. }
  1631. },
  1632. error => {
  1633. this.customTypeListLoading = false
  1634. this.$message({
  1635. message: error,
  1636. type: "error"
  1637. });
  1638. });
  1639. },
  1640. getExpensMainTypes() {
  1641. this.http.post('/expense-main-type/list', {
  1642. },
  1643. res => {
  1644. if (res.code == "ok") {
  1645. this.expenseMainTypes = res.data
  1646. this.expenseMainTypeValue = this.expenseMainTypes[0].id
  1647. } else {
  1648. this.$message({
  1649. message: res.msg,
  1650. type: "error"
  1651. });
  1652. }
  1653. },
  1654. error => {
  1655. this.$message({
  1656. message: error,
  1657. type: "error"
  1658. });
  1659. });
  1660. },
  1661. // 单据查看
  1662. downloadByA(val) {
  1663. if (val.status == 0) {
  1664. this.detailDialog = true
  1665. } else {
  1666. this.dialog = true
  1667. }
  1668. console.log(val, '看看数据来源')
  1669. this.detaExpenseMainTypeName = val.expenseMainTypeName
  1670. this.flg = true;
  1671. this.getParticulars(val.id);
  1672. this.expenseTypeList = this.allExpList.filter(a => a.mainType == val.type);
  1673. },
  1674. // 单据编辑
  1675. showEditName(val) {
  1676. this.dialog = true,
  1677. this.flg = false,
  1678. delete val.invoiceList
  1679. this.getParticulars(val.id)
  1680. this.expenseTypeList = this.allExpList.filter(a => a.mainType == val.type);
  1681. },
  1682. staffs(key, keyPath) { // 控制员工费用报表
  1683. if (keyPath[0] == '1') {
  1684. this.displayTable = false;
  1685. } else {
  1686. this.displayTable = true;
  1687. this.getList();
  1688. }
  1689. // currentClick
  1690. // console.log(key, keyPath)
  1691. this.currentClick = key
  1692. key == '2-1' ? this.currentClickNum = 70 : this.currentClickNum = 0
  1693. },
  1694. bills(audit) { // 控制
  1695. this.isAuditList = audit;
  1696. this.displayTable = true;
  1697. },
  1698. present() {
  1699. this.adds();
  1700. },
  1701. // 删除操作
  1702. delec(ids) {
  1703. // console.log('删除操作', ids);
  1704. this.ParticularsList.invoiceList.splice(ids, 1)
  1705. this.ParticularsList.ticketNum = this.ParticularsList.invoiceList.length
  1706. this.kan()
  1707. },
  1708. adds() {
  1709. var paramData = JSON.parse(JSON.stringify(this.ParticularsList));
  1710. var spl = paramData.invoiceList
  1711. for (var i in spl) {
  1712. if (spl[i].pic) {
  1713. spl[i].pic = spl[i].pic.map(a => a.name).join(',')
  1714. }
  1715. }
  1716. console.log(paramData, '<== paramData')
  1717. let noAmount = paramData.invoiceList.filter(item => !item.amount)
  1718. if(noAmount.length > 0) {
  1719. if(this.user.companyId != 4811 && this.ParticularsList.type != 14454 && this.user.id != this.ParticularsList.ownerId) {
  1720. this.$message({
  1721. message: this.$t('qingTianXieWanZhengFeiYongJinE'),
  1722. type: "error"
  1723. });
  1724. return;
  1725. }
  1726. }
  1727. paramData.items = JSON.stringify(paramData.invoiceList)//这里要传发票列表的json转string
  1728. // console.log(paramData, '<== paramData')
  1729. // return
  1730. delete paramData.invoiceList
  1731. this.http.post('/expense-sheet/add', paramData,
  1732. res => {
  1733. if (res.code == "ok") {
  1734. this.dialog = false;
  1735. this.bills(this.isAuditList);
  1736. this.getList()
  1737. this.$message({
  1738. message: this.$t('editsuccess'),
  1739. type: "success"
  1740. });
  1741. } else {
  1742. this.$message({
  1743. message: res.msg,
  1744. type: "error"
  1745. });
  1746. }
  1747. },
  1748. error => {
  1749. this.$message({
  1750. message: error,
  1751. type: "error"
  1752. });
  1753. });
  1754. },
  1755. // 获取人员信息
  1756. getUsers() {
  1757. // this.http.post(this.port.manage.list, {
  1758. // departmentId: -1,
  1759. // pageIndex: 1,
  1760. // // pageSize: 99999
  1761. // pageSize: -1
  1762. // },
  1763. this.http.post('/user/getSimpleActiveUserList', {},
  1764. res => {
  1765. if (res.code == "ok") {
  1766. // this.users = res.data.records;
  1767. const { id } = JSON.parse(sessionStorage.getItem('user'))
  1768. this.users = res.data;
  1769. // this.usersNoInfo = res.data.filter(item => item.id != id)
  1770. this.usersNoInfo = res.data
  1771. if (!this.permissions.costAudit) {
  1772. this.addForm.ownerId = this.user.id;
  1773. this.addForm.status = 1;
  1774. this.$forceUpdate()
  1775. }
  1776. } else {
  1777. this.$message({
  1778. message: res.msg,
  1779. type: "error"
  1780. });
  1781. }
  1782. },
  1783. error => {
  1784. this.$message({
  1785. message: error,
  1786. type: "error"
  1787. });
  1788. });
  1789. },
  1790. // 提交事件
  1791. submits() {
  1792. this.$refs.mainAddForm.validate(valid => {
  1793. if (valid) {
  1794. if(this.auditTypeItem.auditType == 2 && (!this.addForm.firstCheckerId || !this.addForm.secondCheckerId)) {
  1795. if(this.user.id != 4811 && this.expenseMainTypeValue != 14454) {
  1796. this.$message({
  1797. message: !this.addForm.firstCheckerId ? this.$t('qingXuanZeDiYiShenHeRen') : this.$t('qingXuanZeDiErShenHeRen'),
  1798. type: "error"
  1799. });
  1800. return;
  1801. }
  1802. }
  1803. if (this.invoiceList.length == 0) {
  1804. this.$message({
  1805. message: this.$t('pleaseaddtheinvoice'),
  1806. type: "error"
  1807. });
  1808. return;
  1809. }
  1810. let strObj = {
  1811. project: '',
  1812. datas: '',
  1813. fptype: '',
  1814. fyType: '',
  1815. rmb: '',
  1816. flg: false
  1817. }
  1818. for (var i in this.invoiceList) {
  1819. if (!this.invoiceList[i].projectId) {
  1820. strObj.project = this.$t('subordinatetotheproject')
  1821. strObj.flg = true
  1822. }
  1823. // if(!this.invoiceList[i].invoiceType || this.invoiceList[i].invoiceType == '') {
  1824. // strObj.fptype = '发票种类'
  1825. // strObj.flg = true
  1826. // }
  1827. if (!this.invoiceList[i].expenseType || this.invoiceList[i].expenseType == '') {
  1828. strObj.fyType = this.$t('costtype')
  1829. strObj.flg = true
  1830. }
  1831. if (!this.invoiceList[i].happenDate || this.invoiceList[i].happenDate == '') {
  1832. strObj.datas = this.$t('forthedate')
  1833. strObj.flg = true
  1834. }
  1835. if(this.user.companyId != 4811 && this.expenseMainTypeValue != 14454 && this.user.id != this.addForm.ownerId) {
  1836. if (!this.invoiceList[i].amount || this.invoiceList[i].amount == '') {
  1837. strObj.rmb = this.$t('feiYongJinE')
  1838. strObj.flg = true
  1839. }
  1840. }
  1841. }
  1842. if (strObj.flg) {
  1843. this.$message({
  1844. message: `${strObj.project} ${strObj.fptype} ${strObj.fyType} ${strObj.datas} ${strObj.rmb} ${this.$t('qingTianXieWanZheng')}`,
  1845. type: "error"
  1846. });
  1847. return;
  1848. }
  1849. // return
  1850. this.add();
  1851. }
  1852. });
  1853. },
  1854. // 点击新增
  1855. addxz() {
  1856. this.form = { happenDate: null, invoiceType: null, amount: null, invoiceNo: null, taxPercent: null, taxValue: null, remark: null, pic: null },
  1857. this.invoiceList.push(this.form)
  1858. },
  1859. addNewInvoice() {
  1860. this.form = { happenDate: null, invoiceType: null, amount: null, invoiceNo: null, taxPercent: null, taxValue: null, remark: null, pic: null },
  1861. this.ParticularsList.invoiceList.push(this.form)
  1862. this.ParticularsList.ticketNum = this.ParticularsList.invoiceList.length
  1863. },
  1864. //获取项目列表
  1865. getProjectList() {
  1866. this.http.post(this.port.project.list, {},
  1867. res => {
  1868. if (res.code == "ok") {
  1869. //费用报销界面选择项目只针对进行中的
  1870. this.projectList = res.data.filter(i =>i.status==1);
  1871. } else {
  1872. this.$message({
  1873. message: res.msg,
  1874. type: "error"
  1875. });
  1876. }
  1877. },
  1878. error => {
  1879. this.$message({
  1880. message: error,
  1881. type: "error"
  1882. });
  1883. });
  1884. },
  1885. //获取审核模式
  1886. getAuditType() {
  1887. this.http.post('/expense-audit-setting/get', {},
  1888. res => {
  1889. if (res.code == "ok") {
  1890. this.auditTypeItem = res.data;
  1891. } else {
  1892. this.$message({
  1893. message: res.msg,
  1894. type: "error"
  1895. });
  1896. }
  1897. },
  1898. error => {
  1899. this.$message({
  1900. message: error,
  1901. type: "error"
  1902. });
  1903. });
  1904. },
  1905. //获取单据列表
  1906. getList() {
  1907. // console.log(this.date)
  1908. var stat = ''
  1909. var end = ''
  1910. if (this.date) {
  1911. stat = this.date[0]
  1912. end = this.date[1]
  1913. }
  1914. var param = {
  1915. pageIndex: this.page,
  1916. pageSize: this.size,
  1917. code: this.code,
  1918. // createDate: this.date,
  1919. startDate: stat,
  1920. endDate: end,
  1921. ownerId: this.ownerId,
  1922. type: this.queryExpenseMainType,
  1923. projectId: this.selectProject ? this.selectProject : null,
  1924. };
  1925. if (this.isAuditList) {
  1926. param.status = 1;
  1927. }
  1928. if (this.permissions.costExpenseRelease) {
  1929. param.sendState = this.sendState
  1930. }
  1931. this.list = [];
  1932. // this.total = 0;
  1933. this.http.post('/expense-sheet/list', param,
  1934. res => {
  1935. if (res.code == "ok") {
  1936. this.list = res.data.records;
  1937. this.total = res.data.total || 0;
  1938. } else {
  1939. this.$message({
  1940. message: res.msg,
  1941. type: "error"
  1942. });
  1943. }
  1944. },
  1945. error => {
  1946. this.$message({
  1947. message: error,
  1948. type: "error"
  1949. });
  1950. });
  1951. },
  1952. //删除单据
  1953. deletes(id) {
  1954. this.http.post('/expense-sheet/delete', { id: id },
  1955. res => {
  1956. if (res.code == "ok") {
  1957. this.getList()
  1958. this.$message({
  1959. message: this.$t('message.successfullyDeleted'),
  1960. type: "success"
  1961. });
  1962. } else {
  1963. this.$message({
  1964. message: res.msg,
  1965. type: "error"
  1966. });
  1967. }
  1968. },
  1969. error => {
  1970. this.$message({
  1971. message: error,
  1972. type: "error"
  1973. });
  1974. });
  1975. },
  1976. //创建单据
  1977. add() {
  1978. let newInvoiceList = JSON.parse(JSON.stringify(this.invoiceList))
  1979. for(var i in newInvoiceList) {
  1980. if(newInvoiceList[i].pic) {
  1981. newInvoiceList[i].pic = newInvoiceList[i].pic.map(item => item.name).join(',')
  1982. }
  1983. }
  1984. console.log(newInvoiceList)
  1985. this.addForm.items = JSON.stringify(newInvoiceList)//这里要传发票列表的json转string
  1986. this.addForm.totalAmount = this.totalCost
  1987. this.http.post('/expense-sheet/add', this.addForm,
  1988. res => {
  1989. if (res.code == "ok") {
  1990. this.$message({
  1991. message: this.$t('message.fillinsuccessfully'),
  1992. type: "success"
  1993. });
  1994. this.addForm = {
  1995. code: null,
  1996. ownerId: this.user.id,
  1997. createDate: null,
  1998. type: this.expenseMainTypeValue,
  1999. ticketNum: 1, remark: null, totalAmount: 0,
  2000. }
  2001. this.invoiceList = []
  2002. this.getNextCode()
  2003. } else {
  2004. this.$message({
  2005. message: res.msg,
  2006. type: "error"
  2007. });
  2008. }
  2009. },
  2010. error => {
  2011. this.$message({
  2012. message: error,
  2013. type: "error"
  2014. });
  2015. });
  2016. },
  2017. //获取单据编码
  2018. getNextCode() {
  2019. this.http.post('/expense-sheet/getNextCode', {
  2020. },
  2021. res => {
  2022. if (res.code == "ok") {
  2023. this.addForm.code = res.data;
  2024. } else {
  2025. this.$message({
  2026. message: res.msg,
  2027. type: "error"
  2028. });
  2029. }
  2030. },
  2031. error => {
  2032. this.$message({
  2033. message: error,
  2034. type: "error"
  2035. });
  2036. });
  2037. },
  2038. // 获取查看单据的数据
  2039. getParticulars(id) {
  2040. this.http.post('/expense-sheet/getDetail', {
  2041. id: id,
  2042. projectId: this.selectProject ? this.selectProject : '',
  2043. },
  2044. res => {
  2045. if (res.code == "ok") {
  2046. // this
  2047. console.log(res, '<=== 详情数据')
  2048. // this.ParticularsList = res.data
  2049. // this.expenseMainTypeValue = res.data.type
  2050. var s = []
  2051. // var b = []
  2052. for (var i in res.data.invoiceList) {
  2053. if (res.data.invoiceList[i].pic) {
  2054. let newPic = res.data.invoiceList[i].pic.split(',')
  2055. res.data.invoiceList[i].pic = newPic.map(item => {
  2056. return {
  2057. name: item,
  2058. url: `/upload/${item}`,
  2059. // url: `http://47.101.180.183/upload/${item}`,
  2060. title: this.$t('expensereimbursementvoucher')
  2061. }
  2062. })
  2063. }
  2064. }
  2065. this.ParticularsList = res.data
  2066. for (var i = 0; i <= this.ParticularsList.invoiceList.length - 1; i++) {
  2067. s.push(this.ParticularsList.invoiceList[i].projectId)
  2068. }
  2069. this.projectIdName = this.projectList.filter(item => { return s.indexOf(item.id) !== -1 })
  2070. // this.projectIdName = this.projectList.filter(p => p.id == this.ParticularsList.invoiceList[0].projectId)[0].projectName
  2071. // console.log(res.data, '查看当前状态');
  2072. // console.log(this.ParticularsList)
  2073. } else {
  2074. this.$message({
  2075. message: res.msg,
  2076. type: "error"
  2077. });
  2078. }
  2079. },
  2080. error => {
  2081. this.$message({
  2082. message: error,
  2083. type: "error"
  2084. });
  2085. })
  2086. },
  2087. //分页
  2088. handleCurrentChange(val) {
  2089. this.page = val;
  2090. console.log('page=======', this.page);
  2091. this.getList();
  2092. },
  2093. handleSizeChange(val) {
  2094. this.size = val;
  2095. this.getList();
  2096. },
  2097. deleteItem(item) {
  2098. this.$confirm(this.$t('yousureyouwanttodelete'), this.$t('other.prompts'), {
  2099. //type: 'warning'
  2100. }).then(() => {
  2101. this.http.post('/expense-sheet/delete', { id: item.id },
  2102. res => {
  2103. if (res.code == "ok") {
  2104. this.getList();
  2105. } else {
  2106. this.$message({
  2107. message: res.msg,
  2108. type: "error"
  2109. });
  2110. }
  2111. },
  2112. error => {
  2113. this.$message({
  2114. message: error,
  2115. type: "error"
  2116. });
  2117. });
  2118. });
  2119. },
  2120. // 点击删除
  2121. chanc(k) {
  2122. this.invoiceList.splice(k, 1)
  2123. },
  2124. // 双击
  2125. dbclick(row, event, column) {
  2126. this.isOK = true
  2127. },
  2128. oosk(s) {
  2129. this.isOK = false
  2130. },
  2131. ssl(index) {
  2132. this.z = index
  2133. this.addForm.type = index
  2134. this.ins = index;
  2135. this.expenseTypeList = this.allExpList.filter(a => a.mainType == this.ins);
  2136. this.addForm.ownerId = this.user.id;
  2137. this.getNextCode();
  2138. },
  2139. // 点击侧边栏事件
  2140. side() {
  2141. if (this.$refs.side.style.left < '0px') {
  2142. this.$refs.sidebars.style.width = '1px'
  2143. this.$refs.sid.style.left = '1px'
  2144. this.$refs.side.style.left = '1px'
  2145. this.$refs.sideI.className = 'el-icon-arrow-right'
  2146. this.$refs.staff.style.margin = '20px 20px 0 20px'
  2147. this.$refs.staff.style.width = '95%'
  2148. this.$refs.xiaomian.style.width = '100%'
  2149. this.$refs.headHe.style.paddingLeft = '20px'
  2150. this.currentClickNum = 0
  2151. } else {
  2152. this.$refs.sidebars.style.width = '200px'
  2153. this.$refs.sid.style.left = '200px'
  2154. this.$refs.side.style.left = '-19px'
  2155. this.$refs.sideI.className = 'el-icon-arrow-left'
  2156. this.$refs.staff.style.margin = '20px 20px 0 220px'
  2157. this.$refs.staff.style.width = '81%'
  2158. this.$refs.xiaomian.style.width = '85%'
  2159. this.$refs.headHe.style.paddingLeft = '220px'
  2160. this.currentClickNum = 70
  2161. }
  2162. },
  2163. // 费用金额失去焦点时触发
  2164. shiqu() {
  2165. this.addForm.totalAmount = this.invoiceList.reduce((prev, next) => {
  2166. return prev + parseFloat(next.amount);
  2167. }, 0)
  2168. },
  2169. kan() {
  2170. this.ParticularsList.totalAmount = this.ParticularsList.invoiceList.reduce((prev, next) => {
  2171. return prev + parseFloat(next.amount)
  2172. }, 0)
  2173. },
  2174. zhi(e) {
  2175. // console.log('看看值', e)
  2176. var i = e
  2177. if (this.invoiceList[i].amount == null || this.invoiceList[i].amount == 'null' || this.invoiceList[i].taxPercent == null || this.invoiceList[i].taxPercent == 'null') {
  2178. return
  2179. }
  2180. this.invoiceList[i].taxValue = this.invoiceList[i].amount * this.invoiceList[i].taxPercent / 100
  2181. // console.log(this.invoiceList[i].amount, this.invoiceList[i].taxPercent)
  2182. var shui = this.invoiceList[i].taxPercent / 100 // 税率
  2183. var zhi = this.invoiceList[i].amount / (1 + shui) * shui
  2184. this.invoiceList[i].taxValue = zhi.toFixed(2)
  2185. },
  2186. zhiNum(i, val) {
  2187. // console.log('看看值', i, val)
  2188. // console.log(this.ParticularsList.invoiceList)
  2189. 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') {
  2190. return
  2191. }
  2192. var shui = this.ParticularsList.invoiceList[i].taxPercent / 100
  2193. var zhi = this.ParticularsList.invoiceList[i].amount / (1 + shui) * shui
  2194. this.ParticularsList.invoiceList[i].taxValue = zhi.toFixed(2)
  2195. },
  2196. zhis(e) {
  2197. var i = e
  2198. this.invoiceList[i].taxValue = this.invoiceList[i].taxValue.toFixed(2)
  2199. },
  2200. fileonLoad(item) {
  2201. //首先判断文件类型
  2202. let str = item.file.name.split(".");
  2203. let format = str[str.length - 1];
  2204. if (format != "jpg" && format != "png" && format != "pdf") {
  2205. this.$message({
  2206. message: this.$t('pleaseselectpictures'),
  2207. type: "error"
  2208. });
  2209. } else {
  2210. this.listLoading = true;
  2211. let formData = new FormData();
  2212. formData.append("multipartFile", item.file);
  2213. this.http.uploadFile('/common/uploadFile', formData,
  2214. res => {
  2215. this.listLoading = false;
  2216. if (res.code == "ok") {
  2217. this.$message({
  2218. message: this.$t('uploadedsuccessfully'),
  2219. type: "success"
  2220. });
  2221. // this.getList();
  2222. this.invoiceList[this.apl].pic = res.data
  2223. // console.log(this.invoiceList)
  2224. } else {
  2225. this.$message({
  2226. message: res.msg,
  2227. type: "error"
  2228. });
  2229. }
  2230. },
  2231. error => {
  2232. this.listLoading = false;
  2233. this.$message({
  2234. message: error,
  2235. type: "error"
  2236. });
  2237. });
  2238. }
  2239. },
  2240. abl(e) {
  2241. this.apl = e
  2242. },
  2243. beforeRemove(file, fileList) {
  2244. var that = this
  2245. setTimeout(function () {
  2246. that.invoiceList[that.apl].pic = null
  2247. }, 200)
  2248. },
  2249. fileonLoads(item) {
  2250. //首先判断文件类型
  2251. let str = item.file.name.split(".");
  2252. let format = str[str.length - 1];
  2253. if (format != "jpg" && format != "png" && format != "pdf") {
  2254. this.$message({
  2255. message: this.$t('pleaseselectpictures'),
  2256. type: "error"
  2257. });
  2258. } else {
  2259. this.listLoading = true;
  2260. let formData = new FormData();
  2261. formData.append("multipartFile", item.file);
  2262. this.http.uploadFile('/common/uploadFile', formData,
  2263. res => {
  2264. this.listLoading = false;
  2265. if (res.code == "ok") {
  2266. this.$message({
  2267. message: this.$t('uploadedsuccessfully'),
  2268. type: "success"
  2269. });
  2270. // this.getList();
  2271. this.ParticularsList.invoiceList[this.apl].pic = res.data
  2272. // console.log(this.invoiceList)
  2273. } else {
  2274. this.$message({
  2275. message: res.msg,
  2276. type: "error"
  2277. });
  2278. }
  2279. },
  2280. error => {
  2281. this.listLoading = false;
  2282. this.$message({
  2283. message: error,
  2284. type: "error"
  2285. });
  2286. });
  2287. }
  2288. },
  2289. beforeRemoves(file, fileList) {
  2290. var that = this
  2291. setTimeout(function () {
  2292. // this.ParticularsList.invoiceList
  2293. that.ParticularsList.invoiceList[that.apl].pic = null
  2294. }, 200)
  2295. },
  2296. imgUrl(img) {
  2297. // var imgss = this.diz + '/upload/' + img
  2298. // var sp = []
  2299. // var is = {}
  2300. // is.url = imgss
  2301. // is.title = 1
  2302. // sp.push(is)
  2303. // this.imgs = sp
  2304. // console.log(imgss)
  2305. // console.log(this.$refs.imgsa)
  2306. // this.$refs.imgsa.click()
  2307. // console.log(location.protocol, location.host)
  2308. // console.log(location.protocol + '//' + location.host + imgs)
  2309. },
  2310. // 合计
  2311. getSummaries(param) {
  2312. const { columns, data } = param;
  2313. const sums = [];
  2314. columns.forEach((column, index) => {
  2315. if (index === 1) {
  2316. sums[index] = this.$t('benYeJineheJi');//this.$t('other.totals');
  2317. return;
  2318. }
  2319. if (index === 2) {
  2320. const values = data.map(item => Number(item[column.property]));
  2321. if (!values.every(value => isNaN(value))) {
  2322. sums[index] = values.reduce((prev, curr) => {
  2323. const value = Number(curr);
  2324. if (!isNaN(value)) {
  2325. return prev + curr;
  2326. } else {
  2327. return prev;
  2328. }
  2329. }, 0);
  2330. var zhi = +sums[index] + 0
  2331. var sl = zhi.toFixed(2)
  2332. sl += this.$t('yuan');
  2333. sums[index] = sl;
  2334. } else {
  2335. sums[index] = '';
  2336. }
  2337. } else {
  2338. sums[index] = '';
  2339. }
  2340. });
  2341. // console.log(sums, 123)
  2342. this.$nextTick(() => { this.$refs.tab.doLayout() })
  2343. return sums;
  2344. },
  2345. // 自定义组件事件
  2346. selectCal(obj) {
  2347. if (obj.distinction == '1') {
  2348. this.addForm.ownerId = obj.id
  2349. } else if (obj.distinction == '2') {
  2350. this.ownerId = obj.id
  2351. } else if (obj.distinction == '3') {
  2352. this.ParticularsList.ownerId = obj.id
  2353. } else if (obj.distinction == '4') {
  2354. this.addForm.firstCheckerId = obj.id
  2355. } else if (obj.distinction == '5') {
  2356. this.addForm.secondCheckerId = obj.id
  2357. } else if (obj.distinction == '6') {
  2358. this.ParticularsList.firstCheckerId = obj.id
  2359. } else if (obj.distinction == '7') {
  2360. this.ParticularsList.secondCheckerId = obj.id
  2361. }
  2362. },
  2363. // 单据导出
  2364. exportDocument() {
  2365. this.exportingData = true;
  2366. var stat = ''
  2367. var end = ''
  2368. if (this.date) {
  2369. stat = this.date[0]
  2370. end = this.date[1]
  2371. }
  2372. this.http.post('/expense-sheet/exportList', {
  2373. code: this.code,
  2374. startDate: stat,
  2375. endDate: end,
  2376. ownerId: this.ownerId,
  2377. type: this.type,
  2378. projectId: this.selectProject ? this.selectProject : null,
  2379. sendState: this.sendState
  2380. },
  2381. res => {
  2382. this.exportingData = false;
  2383. if (res.code == "ok") {
  2384. var filePath = res.data;
  2385. const a = document.createElement('a'); // 创建a标签
  2386. a.setAttribute('download', this.$t('feiYongBaoXiaoDanJuLieBiao'));// download属性
  2387. a.setAttribute('href', filePath);// href链接
  2388. a.click(); //自执行点击事件
  2389. a.remove();
  2390. } else {
  2391. this.$message({
  2392. message: res.msg,
  2393. type: "error"
  2394. });
  2395. }
  2396. },
  2397. error => {
  2398. this.$message({
  2399. message: error,
  2400. type: "error"
  2401. });
  2402. });
  2403. },
  2404. //报销凭证导出
  2405. exportDocumentFile() {
  2406. var stat = ''
  2407. var end = ''
  2408. if (this.date) {
  2409. stat = this.date[0]
  2410. end = this.date[1]
  2411. }
  2412. this.exportingData=true
  2413. var that = this;
  2414. this.http.downloadFile(`/expense-sheet/export`, {
  2415. code: this.code,
  2416. startDate: stat,
  2417. endDate: end,
  2418. ownerId: this.ownerId,
  2419. type: this.type,
  2420. projectId: this.selectProject ? this.selectProject : null,
  2421. sendState: this.sendState
  2422. }, '报销凭证导出.zip', function(err) {
  2423. that.exportingData = false;
  2424. that.$message({
  2425. message: err,
  2426. type: "error"
  2427. });
  2428. }, function() {
  2429. console.log('55555555555')
  2430. that.exportingData = false;
  2431. })
  2432. },
  2433. // 单据发放
  2434. documentIssuance(type) {
  2435. const newList = this.multipleSelection.filter(item => item.status == 1 || item.status == 2);
  2436. const unissueds = this.multipleSelection.filter(item => item.status != 1 && item.status != 2 && item.sendState == 0).map(item => item.id);
  2437. const Issueds = this.multipleSelection.filter(item => item.status != 1 && item.status != 2 && item.sendState == 1).map(item => item.id);
  2438. const showMessage = (msg, messageType) => {
  2439. this.$message({
  2440. message: msg,
  2441. type: messageType
  2442. });
  2443. };
  2444. if (newList.length > 0) {
  2445. showMessage(this.$t('cunZaiDaiShenHeHuoYiBoHuiDeDanJu'), 'warning');
  2446. return;
  2447. }
  2448. if (type == 1 && unissueds.length == 0) {
  2449. showMessage(this.$t('qingXuanZeWeiFaFangDeDanJu'), 'warning');
  2450. return;
  2451. }
  2452. if (type == 0 && Issueds.length == 0) {
  2453. showMessage(this.$t('qingXuanZeYiFaFangDeDanJu'), 'warning');
  2454. return;
  2455. }
  2456. if(type == 1 && this.sendStateList.length > 0) {
  2457. this.releaseData = {
  2458. id: '',
  2459. data: unissueds
  2460. }
  2461. this.dialogVisibleRelease = true
  2462. return
  2463. }
  2464. this.callingInterface(type, type == 1 ? unissueds : Issueds);
  2465. },
  2466. callingInterface(type, ids) {
  2467. this.http.post('/expense-sheet/editSendExpense', {
  2468. expenseIds: ids.join(','),
  2469. sendState: type,
  2470. payWayId: this.releaseData.id || ''
  2471. },
  2472. res => {
  2473. this.dialogVisibleRelease = false
  2474. if (res.code == "ok") {
  2475. this.$message({
  2476. message: this.$t('operationissuccessful'),
  2477. type: "success"
  2478. });
  2479. this.getList()
  2480. } else {
  2481. this.$message({
  2482. message: res.msg,
  2483. type: "error"
  2484. });
  2485. }
  2486. },
  2487. error => {
  2488. this.dialogVisibleRelease = false
  2489. this.$message({
  2490. message: error,
  2491. type: "error"
  2492. });
  2493. });
  2494. },
  2495. handleSelectionChange(val) {
  2496. this.multipleSelection = val;
  2497. },
  2498. // 打印
  2499. print() {
  2500. this.$print(this.$refs.printContent)
  2501. },
  2502. // 触发自定义函数
  2503. performCustomization(index, type = 1) {
  2504. this.apl = index
  2505. this.imgLoadType = type
  2506. this.$refs.uploadInput.click()
  2507. },
  2508. // 查看详情
  2509. viewDetailsImage(index, fields = 'invoiceList', fieldsCope) {
  2510. if(fieldsCope) {
  2511. this.imgLoadType = 2
  2512. this.dialogVisibleImageList = this[fields][fieldsCope][index].pic
  2513. } else{
  2514. this.imgLoadType = 1
  2515. this.dialogVisibleImageList = this[fields][index].pic
  2516. }
  2517. console.log(this.dialogVisibleImageList, '查看详情')
  2518. this.apl = index
  2519. this.dialogVisibleImage = true
  2520. },
  2521. // 删除图片
  2522. deteleIpc(index, fields = 'invoiceList', fieldsCope) {
  2523. if(fieldsCope) {
  2524. this[fields][fieldsCope][index].pic.splice(index, 1)
  2525. this.dialogVisibleImageList = this[fields][fieldsCope][index].pic
  2526. } else{
  2527. this[fields][index].pic.splice(index, 1)
  2528. this.dialogVisibleImageList = this[fields][index].pic
  2529. }
  2530. },
  2531. // 费用报销图片上传(多选)
  2532. fileMultLoad() {
  2533. let fileArr = this.$refs.uploadInput.files
  2534. this.listLoading = true;
  2535. let formData = new FormData();
  2536. for (let i = 0; i < fileArr.length; i++) {
  2537. formData.append("multipartFiles", fileArr[i]);
  2538. }
  2539. this.http.uploadFile('/common/uploadFileArray', formData,
  2540. res => {
  2541. this.listLoading = false;
  2542. if (res.code == "ok") {
  2543. this.$message({
  2544. message: this.$t('uploadedsuccessfully'),
  2545. type: "success"
  2546. });
  2547. if(res.data) {
  2548. let newList = res.data.split(';')
  2549. let newArr = newList.map(item => {
  2550. return {
  2551. name: item,
  2552. url: '/upload/' + item,
  2553. // url: `http://47.101.180.183/upload/${item}`,
  2554. title: this.$t('expensereimbursementvoucher')
  2555. }
  2556. })
  2557. if(this.imgLoadType == 1) {
  2558. let oldList = this.invoiceList[this.apl].pic || []
  2559. this.$set(this.invoiceList[this.apl], 'pic', [...oldList, ...newArr])
  2560. this.dialogVisibleImageList = [...oldList, ...newArr]
  2561. }
  2562. if(this.imgLoadType == 2) {
  2563. let oldList = this.ParticularsList.invoiceList[this.apl].pic || []
  2564. this.$set(this.ParticularsList.invoiceList[this.apl], 'pic', [...oldList, ...newArr])
  2565. this.dialogVisibleImageList = [...oldList, ...newArr]
  2566. }
  2567. }
  2568. console.log(this.apl, '<< === 赋值的索引')
  2569. } else {
  2570. this.$message({
  2571. message: res.msg,
  2572. type: "error"
  2573. });
  2574. }
  2575. },
  2576. error => {
  2577. this.listLoading = false;
  2578. this.$message({
  2579. message: error,
  2580. type: "error"
  2581. });
  2582. });
  2583. },
  2584. // 判断当前数据的文件类型
  2585. isFileType(item) {
  2586. let str = item.split('.');
  2587. let format = str[str.length - 1];
  2588. if (['jpg', 'png', 'jpeg', 'JPG', 'PNG', 'JPEG'].includes(format)) {
  2589. return 'image'
  2590. } else if (format == "pdf") {
  2591. return 'pdf'
  2592. }
  2593. },
  2594. // 查看pdf
  2595. openViewPdf(urls) {
  2596. // 新窗口打开pdf
  2597. window.open(urls)
  2598. },
  2599. // 获取发放方式
  2600. getSendStateList() {
  2601. this.http.post('/expense-pay-way/get', {
  2602. companyId: this.user.companyId
  2603. },
  2604. res => {
  2605. if (res.code == "ok") {
  2606. this.sendStateList = res.data;
  2607. } else {
  2608. this.$message({
  2609. message: res.msg,
  2610. type: "error"
  2611. });
  2612. }
  2613. },
  2614. error => {
  2615. this.$message({
  2616. message: error,
  2617. type: "error"
  2618. });
  2619. });
  2620. }
  2621. },
  2622. beforeDestroy() {
  2623. }
  2624. };
  2625. </script>
  2626. <style scoped lang="scss">
  2627. @import "../../assets/scss/handle";
  2628. .tups {
  2629. width: 100%;
  2630. height: 25px;
  2631. position: relative;
  2632. z-index: 99;
  2633. overflow: hidden;
  2634. }
  2635. .tups img {
  2636. // height: 25px !important;
  2637. // position: relative;
  2638. // z-index: 99;
  2639. width: 30px;
  2640. height: 30px;
  2641. margin-right: 4px;
  2642. }
  2643. .viewer-canvas {
  2644. position: absolute;
  2645. z-index: 9 !important;
  2646. }
  2647. .icl {
  2648. margin-top: -25px !important;
  2649. }
  2650. /* 费用报销标题 */
  2651. .headine {
  2652. width: 100%;
  2653. height: 46.4px;
  2654. line-height: 46.4px;
  2655. background: #fff;
  2656. box-sizing: border-box;
  2657. }
  2658. .headine h3 {
  2659. margin: 0;
  2660. display: inline-block;
  2661. box-sizing: border-box;
  2662. color: #999;
  2663. }
  2664. .headine p {
  2665. display: inline-block;
  2666. margin: 0;
  2667. }
  2668. /* /费用报销标题 */
  2669. .sidebars {
  2670. height: 100%;
  2671. position: absolute;
  2672. border-right: 1px solid #E6E6E6;
  2673. z-index: 2;
  2674. top: 0;
  2675. }
  2676. .sidebars h3 {
  2677. margin: 0;
  2678. line-height: 45px;
  2679. background: #ffffff;
  2680. font-weight: normal;
  2681. color: #666;
  2682. padding-left: 20px;
  2683. }
  2684. .sidebars .el-col-12 {
  2685. width: 100%
  2686. }
  2687. .public {
  2688. // height: 180px;
  2689. border-bottom: 1px solid #ddd;
  2690. }
  2691. .public .el-form-item {
  2692. display: inline-block;
  2693. }
  2694. .pu_button {
  2695. text-align: right;
  2696. width: 100%;
  2697. padding: 24px 30px;
  2698. box-sizing: border-box;
  2699. }
  2700. .pu_bu_x .pu_bu_t {
  2701. display: inline-block;
  2702. }
  2703. .pu_bu_x {
  2704. margin-right: 20px;
  2705. color: #20A0F7;
  2706. cursor: pointer;
  2707. }
  2708. .pu_bu_t {
  2709. color: #20A0F7;
  2710. cursor: pointer;
  2711. display: block;
  2712. float: right;
  2713. position:
  2714. relative;
  2715. top: -20px;
  2716. right: 63px;
  2717. }
  2718. .pu_table {
  2719. margin-left: 10px;
  2720. }
  2721. .pu_bu_t:hover {
  2722. color: #7bbcff;
  2723. }
  2724. .pu_bu_x:hover {
  2725. color: #7bbcff;
  2726. }
  2727. /* 我的单据报销凭证 */
  2728. .staff {
  2729. border-left: 1px solid #fff;
  2730. border-top: 1px solid #fff;
  2731. border-right: 1px solid #fff;
  2732. background: #fff;
  2733. }
  2734. /* */
  2735. .sdat {
  2736. display: inline-block;
  2737. width: 260px;
  2738. margin-left: 13px;
  2739. }
  2740. .messages .el-form-item {
  2741. display: inline-block;
  2742. }
  2743. .messages .el-date-editor.el-input,
  2744. .el-date-editor.el-input__inner {
  2745. width: 190px;
  2746. }
  2747. /* 我的报销凭证 */
  2748. .search {
  2749. position: relative;
  2750. top: 20px;
  2751. left: 20px;
  2752. }
  2753. .tables {
  2754. margin-top: 50px;
  2755. box-sizing: border-box;
  2756. padding: 10px;
  2757. }
  2758. .informant .el-form-item {
  2759. display: inline-block;
  2760. }
  2761. /* 侧边栏收索 */
  2762. .side {
  2763. position: absolute;
  2764. z-index: 2;
  2765. border-right: 2px solid #DDDDDD;
  2766. height: 100%;
  2767. top: 0;
  2768. width: 0;
  2769. }
  2770. .side .spans {
  2771. width: 20px;
  2772. height: 30px;
  2773. border: 1px solid #DDDDDD;
  2774. box-sizing: border-box;
  2775. position: absolute;
  2776. top: 50%;
  2777. margin-top: -50%;
  2778. text-align: center;
  2779. z-index: 1;
  2780. background: #fff;
  2781. }
  2782. .side .spans i {
  2783. margin-top: 7px;
  2784. color: #C0BFBF
  2785. }
  2786. .side:hover {
  2787. border-right: 2px solid;
  2788. @include border_color("border_color");
  2789. }
  2790. .side:hover .spans {
  2791. border: 1px solid;
  2792. @include border_color("border_color");
  2793. @include background_color("background_color");
  2794. }
  2795. .side:hover .spans i {
  2796. color: #fff;
  2797. }
  2798. /* 右边整体页面 */
  2799. .contents {
  2800. height: 100%;
  2801. /* padding: 30px; */
  2802. background: #F7F7F7;
  2803. /* position: absolute; */
  2804. }
  2805. .submits {
  2806. margin-left: 50%;
  2807. }
  2808. .waiting {
  2809. color: orange;
  2810. }
  2811. .rejected {
  2812. color: red;
  2813. }
  2814. .newInvoice {
  2815. position: absolute;
  2816. right: 10px;
  2817. top: -20px;
  2818. height: 20px;
  2819. line-height: 20px;
  2820. cursor: pointer;
  2821. color: #20a0f7;
  2822. font-size: 14px;
  2823. }
  2824. .newInvoice:hover {
  2825. color: #7bbcff;
  2826. }
  2827. /* 新增打印的费用报销类型 */
  2828. .printContent {
  2829. .printContent-detail {
  2830. display: flex;
  2831. flex-wrap: wrap;
  2832. }
  2833. .detail-item {
  2834. width: 33%;
  2835. font-size: 16px;
  2836. margin-bottom: 10px;
  2837. color: #000;
  2838. .detail-item-title {
  2839. color: #999;
  2840. }
  2841. .single {
  2842. font-size: 14px;
  2843. }
  2844. .printBox {
  2845. display: inline-block;
  2846. width: 125px;
  2847. text-align-last: justify;
  2848. box-sizing: border-box;
  2849. padding-right: 10px;
  2850. }
  2851. }
  2852. .conter-box {
  2853. .conter-border {
  2854. width: 100%;
  2855. box-sizing: border-box;
  2856. padding: 15px;
  2857. border: 1px solid #ddd;
  2858. border-radius: 4px;
  2859. display: flex;
  2860. flex-wrap: wrap;
  2861. margin-top: 20px;
  2862. .detail-item {
  2863. width: 50%;
  2864. margin-top: 10px;
  2865. }
  2866. }
  2867. }
  2868. }
  2869. .customIamgeLoad {
  2870. opacity: 0;
  2871. position: absolute;
  2872. top: -300vh;
  2873. left: -300vw;
  2874. }
  2875. .dayImge {
  2876. .xiaoImg {
  2877. width: 120px;
  2878. height: 120px;
  2879. margin-right: 25px;
  2880. margin-bottom: 20px;
  2881. position: relative;
  2882. display: inline-block;
  2883. img {
  2884. width: 100%;
  2885. height: 100%;
  2886. }
  2887. .imgIcon {
  2888. position: absolute;
  2889. right: 0px;
  2890. font-size: 20px;
  2891. top: 0px;
  2892. cursor: pointer;
  2893. background: rgba($color: #000000, $alpha: .6);
  2894. width: 30px;
  2895. height: 30px;
  2896. display: flex;
  2897. justify-content: center;
  2898. align-items: center;
  2899. border-radius: 4px;
  2900. z-index: 5;
  2901. }
  2902. }
  2903. .xiaoImg:nth-child(5n) {
  2904. margin-right: 0;
  2905. }
  2906. .dayImgeItem {
  2907. display: flex;
  2908. flex-wrap: wrap;
  2909. }
  2910. .dayImgeItemFile {
  2911. width: 100%;
  2912. .title {
  2913. font-size: 20px;
  2914. }
  2915. .text {
  2916. margin: 10px 30px;
  2917. }
  2918. }
  2919. }
  2920. </style>