expense.vue 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715
  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') }}</h3>
  6. <el-divider ></el-divider>
  7. <el-col :span="12">
  8. <el-menu
  9. default-active="1-1"
  10. class="el-menu-vertical-demo"
  11. @select="staffs"
  12. background-color="#ffffff"
  13. text-color="#666666"
  14. active-text-color="#20A0FF"
  15. style="width:100%">
  16. <el-submenu index="1">
  17. <template slot="title">
  18. <i class="iconfont firerock-icontianbao"></i>
  19. <span>{{ $t('fillinthestaffexpenses') }}</span>
  20. </template>
  21. <el-menu-item index="1-1"><p @click="ssl(0)"> {{ $t('generalexpenses') }}</p></el-menu-item>
  22. <el-menu-item index="1-2"><p @click="ssl(1)">{{ $t('travelexpensess') }}</p></el-menu-item>
  23. <el-menu-item index="1-3"><p @click="ssl(2)">{{ $t('outsourcingcostshouldbereported') }}</p></el-menu-item>
  24. </el-submenu>
  25. <el-submenu index="2">
  26. <template slot="title">
  27. <i class="iconfont firerock-iconbaoxiaodan"></i>
  28. <span>{{permissions.costAll?$t('listofreimbursementvouchers'):$t('myexpensevoucher')}}</span>
  29. </template>
  30. <el-menu-item index="2-1" ><p @click="bills(false)" >{{ $t('documentlist') }}</p></el-menu-item>
  31. <el-menu-item index="2-2" v-if="permissions.costAudit"><p @click="bills(true)">{{ $t('documentreview') }}</p></el-menu-item>
  32. </el-submenu>
  33. <!-- <el-menu-item index="3" @select="bills" @click="bills(false)" v-if="user.role == 0">
  34. <i class="iconfont firerock-iconbaoxiaodan"></i>
  35. <span slot="title">{{user.role == 0?"我的报销凭证":"报销凭证列表"}}</span>
  36. </el-menu-item> -->
  37. </el-menu>
  38. </el-col>
  39. </div>
  40. <div class="side" @click="side" ref="sid" style="left: 200px">
  41. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  42. </div>
  43. </div>
  44. <!-- 侧边栏点击事件 -->
  45. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  46. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  47. </div> -->
  48. <!-- 内容主体区域 -->
  49. <div class="contents">
  50. <div v-if="!displayTable" class="headine" ref="headine">
  51. <h3 ref="headHe" style="padding-left: 220px">{{shuz[ins]}}</h3>
  52. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits" size="mini">{{ $t('btn.submit') }}</el-button></p>
  53. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submitUpload" size="mini">{{ $t('batchupload') }}</el-button></p>
  54. <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="customTypeOp" size="mini" v-if="permissions.costAll">{{ $t('expensetypemanagement') }}</el-button></p>
  55. </div>
  56. <!-- 上面部分 -->
  57. <div ref="staff" style="margin: 20px 20px 0 220px; width: 81.5%" >
  58. <div class="staff" v-if="!displayTable">
  59. <!-- 公共 -->
  60. <div class="public">
  61. <el-form :model="addForm" ref="mainAddForm" label-width="80px" :rules="addFormRules">
  62. <!-- <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> -->
  63. <!-- 报销人 -->
  64. <el-form-item :label="$t('peopleconcerned')" prop="ownerId">
  65. <!--普通员工只能自己填报自己的 -->
  66. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="!permissions.costAudit" filterable="true">
  67. <span v-for="(item, index) in users" :key="index">
  68. <el-option :label="item.name" :value="item.id"></el-option>
  69. </span>
  70. </el-select>
  71. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'1'" :subject="users" :disabled="!permissions.costAudit" :subjectId="addForm.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
  72. </el-form-item>
  73. <!-- 填报日期 -->
  74. <el-form-item :label="$t('fillinthedate')" style="position: relative;top: 38px;" prop="createDate">
  75. <el-col :span="11">
  76. <el-date-picker type="date" :placeholder="$t('optiondate')" v-model="addForm.createDate" value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
  77. </el-col>
  78. </el-form-item>
  79. <!-- 发票张数 -->
  80. <el-form-item :label="$t('invoicenumber')">
  81. <el-input v-model="addForm.ticketNum" style="width: 150px"></el-input>
  82. </el-form-item>
  83. <!-- 费用类型 -->
  84. <el-form-item :label="$t('costtype')">
  85. <el-select v-model="addForm.type" disabled style="width: 150px" >
  86. <el-option :label="$t('yi-ban')" :value="0"></el-option>
  87. <el-option :label="$t('cha-lv')" :value="1"></el-option>
  88. <el-option :label="$t('wai-bao')" :value="2"></el-option>
  89. </el-select>
  90. </el-form-item>
  91. <!-- 备注 -->
  92. <el-form-item :label="$t('bei-zhu')" style="display: block; width: 70%; float: left;">
  93. <el-input type="textarea" v-model="addForm.remark" :autosize="{minRows: 2, maxRows: 2}"></el-input>
  94. </el-form-item>
  95. <!-- 总费用 -->
  96. <!-- <div style="float: left; line-height: 55px;margin-left:20px">总费用 <el-link disabled v-model="addForm.totalAmount">{{addForm.totalAmount}}</el-link> 元</div> -->
  97. </el-form>
  98. </div>
  99. <!-- 按钮 -->
  100. <div class="pu_button">
  101. <span v-if="totalCost <= 0" style="color:#606266;">{{ $t('totalcostos') }} {{totalCost}} {{ $t('yuan') }}</span>
  102. <span v-else style="color:#606266;">{{ $t('totalcostos') }} ¥{{totalCost | numberToCurrency}} {{ $t('yuan') }}</span>
  103. <span class="pu_bu_x" style="margin-left:10px;" @click="addxz"> <i class="el-icon-circle-plus-outline"></i> {{ $t('newinvoice') }}</span>
  104. </div>
  105. <!-- 表格 -->
  106. <div class="pu_table">
  107. <el-table
  108. :data="invoiceList"
  109. border
  110. style="width: 100%;height:100%"
  111. height="386px"
  112. @row-dblclick="dbclick">
  113. <el-table-column prop="projectName" :label="$t('subordinatetotheproject')" width="180">
  114. <template slot-scope="scope">
  115. <el-select size="small" v-model="scope.row.projectId" :placeholder="$t('other.project')" style="width: 150px" filterable popper-class="projectSelectPopperClass">
  116. <el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName + item.projectCode" :value="item.id" @click="ok(item)">
  117. <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  118. <span style="float: right;">{{ item.projectName }}</span>
  119. </el-option>
  120. </el-select>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="happenDate" :label="$t('forthedate')" width="170px">
  124. <template slot-scope="scope">
  125. <el-date-picker size="small" v-model="scope.row.happenDate" type="date" style=" width: 145px" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
  126. </el-date-picker>
  127. </template>
  128. </el-table-column>
  129. <el-table-column :label="$t('invoices')" width="175px">
  130. <template slot-scope="scope">
  131. <el-select size="small" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
  132. <el-option :label="$t('vATspecialinvoice')" value="0"></el-option>
  133. <el-option :label="$t('vATgeneralinvoice')" value="1"></el-option>
  134. </el-select>
  135. </template>
  136. </el-table-column>
  137. <el-table-column :label="$t('costtype')" width="175px">
  138. <template slot-scope="scope">
  139. <el-select size="small" v-model="scope.row.expenseType" :placeholder="$t('costtype')" style="width: 150px" >
  140. <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName" :value="item.typeName" ></el-option>
  141. </el-select>
  142. </template>
  143. </el-table-column>
  144. <el-table-column :label="$t('amountoffees')" width="135px">
  145. <template slot-scope="scope">
  146. <el-input size="small" :id="'upam'+scope.$index" v-model="scope.row.amount" @input="zhi(scope.$index)" @change="shiqu(scope.row.amount)" @keyup.native="restrictNumber('upam'+scope.$index)"></el-input>
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="135px">
  150. <template slot-scope="scope">
  151. <el-input size="small" v-model.number="scope.row.invoiceNo"></el-input>
  152. </template>
  153. </el-table-column>
  154. <el-table-column :label="$t('shui-shuai')" width="135px">
  155. <template slot-scope="scope">
  156. <el-input size="small" type= "number" v-model="scope.row.taxPercent" @input="zhi(scope.$index)"></el-input>
  157. </template>
  158. </el-table-column>
  159. <el-table-column :label="$t('taxs')" width="135px">
  160. <template slot-scope="scope">
  161. <el-input size="small" v-model="scope.row.taxValue" @input="zhis(scope.$index)"></el-input>
  162. </template>
  163. </el-table-column>
  164. <el-table-column :label="$t('bei-zhu')" width="135px">
  165. <template slot-scope="scope">
  166. <el-input size="small" v-model="scope.row.remark"></el-input>
  167. </template>
  168. </el-table-column>
  169. <el-table-column :label="$t('expensereimbursementvoucher')" width="135px">
  170. <template slot-scope="scope">
  171. <div @click="abl(scope.$index)">
  172. <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :before-remove="beforeRemove" :http-request="fileonLoad" limit="1" name="multipartFile">
  173. <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
  174. </el-upload>
  175. </div>
  176. </template>
  177. </el-table-column>
  178. <el-table-column fixed="right"
  179. :label="$t('operation')">
  180. <template slot-scope="scope">
  181. <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px" @click="chanc(scope.$index)">{{ $t('btn.delete') }}</el-button>
  182. </template>
  183. </el-table-column>
  184. </el-table>
  185. </div>
  186. <!-- <el-button class="submits" type="warning" @click="submits">提交</el-button> -->
  187. </div>
  188. </div>
  189. </div>
  190. <!-- 下面部分 -->
  191. <div class="xiamian" ref="xiaomian" :style="'width: '+ (xiamianWidth - 400) +'px;float:right;background: #fff;position: relative;'">
  192. <div v-if="displayTable">
  193. <div style="padding-left:10px;padding-right:10px;">
  194. <div>
  195. <el-form label-width="70px" inline >
  196. <!-- 报销人 -->
  197. <el-form-item :label="$t('peopleconcerned')">
  198. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="ownerId" size="small" clearable :placeholder="$t('selecttheapplicant')" style="width: 120px" :disabled="!permissions.costAudit" filterable="true">
  199. <span v-for="(item, index) in users" :key="index">
  200. <el-option :label="item.name" :value="item.id"></el-option>
  201. </span>
  202. </el-select>
  203. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :widthStr="'120'" :distinction="'2'" :clearable="true" :subject="users" :disabled="!permissions.costAudit" :subjectId="ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
  204. </el-form-item>
  205. <!-- 单据编号 -->
  206. <el-form-item :label="$t('receiptnumber')" >
  207. <el-input v-model="code" size="small" :placeholder="$t('receiptnumber')" clearable="true" style="width: 120px"></el-input>
  208. </el-form-item>
  209. <!-- 费用类型 -->
  210. <el-form-item :label="$t('costtype')">
  211. <el-select v-model="type" size="small" :placeholder="$t('pleaseselectthetypeoffee')" clearable="true" style="width: 150px">
  212. <el-option :label="$t('generalcost')" value="0"></el-option>
  213. <el-option :label="$t('travelexpenses')" value="1"></el-option>
  214. <el-option :label="$t('outsourcingcost')" value="2"></el-option>
  215. </el-select>
  216. </el-form-item>
  217. <!-- 填报日期 -->
  218. <el-form-item :label="$t('fillinthedate')" >
  219. <el-date-picker
  220. v-model="date"
  221. type="daterange"
  222. value-format="yyyy-MM-dd"
  223. size="small"
  224. :range-separator="$t('other.to')"
  225. :start-placeholder="$t('time.startDate')"
  226. :end-placeholder="$t('time.endDate')"
  227. style="width: 280px">
  228. </el-date-picker>
  229. </el-form-item>
  230. <el-form-item>
  231. <el-button @click="getList" size="small">{{ $t('find') }}</el-button>
  232. </el-form-item>
  233. </el-form>
  234. </div>
  235. <el-divider ></el-divider>
  236. <!--列表-->
  237. <el-table ref="tab" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" :summary-method="getSummaries" show-summary>
  238. <el-table-column prop="code" :label="$t('ticketnumber')"></el-table-column>
  239. <el-table-column prop="totalAmount" :label="$t('amountof')+ '('+$t('yuan')+')'" align="center">
  240. <template slot-scope="scope" >
  241. <span style="float:right;margin-right:20px">{{scope.row.totalAmount ? scope.row.totalAmount.toFixed(2) : '0'}}</span>
  242. </template>
  243. </el-table-column>
  244. <el-table-column prop="ownerName" :label="$t('peopleconcerned')" >
  245. <template slot-scope="scope">
  246. <div>
  247. <span v-if="user.userNameNeedTranslate != 1">
  248. {{scope.row.ownerName}}
  249. </span>
  250. <span v-if="user.userNameNeedTranslate == 1">
  251. <ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data>
  252. </span>
  253. </div>
  254. </template>
  255. </el-table-column>
  256. <el-table-column prop="createDate" :label="$t('fillinthedate')" ></el-table-column>
  257. <el-table-column prop="ticketNum" :label="$t('invoicenumber')" ></el-table-column>
  258. <el-table-column prop="type" :label="$t('ppertype')" >
  259. <template slot-scope="scope">
  260. {{feeType[scope.row.type]}}
  261. </template>
  262. </el-table-column>
  263. <el-table-column prop="remark" :label="$t('bei-zhu')" width="180">
  264. <template slot-scope="scope">
  265. <span style="font-size:12px;">{{scope.row.remark}}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column prop="status" :label="$t('state.states')" width="80">
  269. <template slot-scope="scope">
  270. <span v-if="scope.row.status == 1" class="waiting">{{statusTxt[scope.row.status]}}</span>
  271. <span v-if="scope.row.status == 2" class="rejected">{{statusTxt[scope.row.status]}}</span>
  272. <span v-if="scope.row.status == 0 || scope.row.status == 3" >{{statusTxt[scope.row.status]}}</span>
  273. </template>
  274. </el-table-column>
  275. <!-- <el-table-column prop="denyReason" :label="$t('dismissreason')" width="180">
  276. <template slot-scope="scope">
  277. <span style="font-size:12px;">{{scope.row.denyReason}}</span>
  278. </template>
  279. </el-table-column> -->
  280. <el-table-column fixed="right" :label="$t('operation')" :width="isAuditList?220:160">
  281. <template slot-scope="scope" >
  282. <div v-if="!isAuditList">
  283. <el-button icon="el-icon-view" circle size="mini" @click.stop.native="downloadByA(scope.row)" ></el-button>
  284. <el-button icon="el-icon-edit" circle size="mini" style="margin-left:10px;" @click.stop.native="showEditName(scope.row)" v-show="permissions.costAudit || scope.row.status == 1 || scope.row.status == 2 "></el-button>
  285. <el-button icon="el-icon-delete" circle size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.row)" v-show="permissions.costAudit || scope.row.status == 1 || scope.row.status == 2 "></el-button>
  286. </div>
  287. <div v-if="isAuditList">
  288. <el-button size="mini" @click.stop.native="downloadByA(scope.row)" >{{ $t('cha-kan') }}</el-button>
  289. <el-button size="mini" style="margin-left:5px;" @click.stop.native="approve(scope.row)" >{{ $t('btn.through') }}</el-button>
  290. <el-button size="mini" style="margin-left:5px;" @click.stop.native="denyReason(scope.row)" >{{ $t('btn.rejected') }}</el-button>
  291. </div>
  292. </template>
  293. </el-table-column>
  294. </el-table>
  295. <!--工具条-->
  296. <el-col :span="24" class="toolbar">
  297. <el-pagination
  298. @size-change="handleSizeChange"
  299. @current-change="handleCurrentChange"
  300. :page-sizes="[20 , 50 , 80 , 100]"
  301. :page-size="20"
  302. layout="total, sizes, prev, pager, next"
  303. :total="total"
  304. style="float:right;"
  305. ></el-pagination>
  306. </el-col>
  307. </div>
  308. </div>
  309. </div>
  310. <!-- 我的单据报销展示 -->
  311. <el-dialog :title="$t('detailsofReimbursementvoucher')" :visible.sync="dialog" width="1000px">
  312. <!-- 内容主体 -->
  313. <div class="informant"><!-- 报销人 -->
  314. <el-form :model="ParticularsList" label-width="80px">
  315. <el-form-item :label="$t('peopleconcerned')" style="width: 270px" :rules="{ required: true, message: $t('pleaseselecttheapplicant'), trigger: 'blur' }">
  316. <el-input v-model="ParticularsList.ownerName" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId" v-if="user.userNameNeedTranslate != '1'"></el-input>
  317. <!-- <el-select v-model="ParticularsList.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
  318. <span v-for="(item, index) in users" :key="index">
  319. <el-option :label="item.name" :value="item.id"></el-option>
  320. </span>
  321. </el-select> -->
  322. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'" :subject="users" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId" :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
  323. </el-form-item>
  324. <el-form-item :label="$t('fillinthedate')">
  325. <!-- <el-input v-model="ParticularsList.createDate" :disabled="flg"></el-input> -->
  326. <el-date-picker type="date" :disabled="flg" :placeholder="$t('optiondate')" v-model="ParticularsList.createDate" value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
  327. </el-form-item>
  328. <el-form-item :label="$t('invoicenumber')">
  329. <el-input v-enter-number v-model="ParticularsList.ticketNum" :disabled="flg"></el-input>
  330. </el-form-item>
  331. <el-form-item :label="$t('costtype')" style="width: 270px">
  332. <el-select v-model="ParticularsList.type" :placeholder="$t('defaultText.pleaseChoose')" :disabled="flg">
  333. <el-option :label="$t('yi-ban')" :value="0"></el-option>
  334. <el-option :label="$t('cha-lv')" :value="1"></el-option>
  335. <el-option :label="$t('wai-bao')" :value="2"></el-option>
  336. </el-select>
  337. </el-form-item>
  338. <el-form-item :label="$t('bei-zhu')" style="width: 280px">
  339. <el-input v-model="ParticularsList.remark" :disabled="flg"></el-input>
  340. </el-form-item>
  341. <el-form-item :label="$t('totalcostos')">
  342. ¥{{ParticularsList.totalAmount | numberToCurrency}}&nbsp;&nbsp;{{$t('yuan')}}
  343. </el-form-item>
  344. <!-- <template slot-scope="scope">
  345. <el-input v-model="scope.row.totalAmount" v-if="!flg"></el-input> 元
  346. <span v-else>{{scope.row.totalAmount}} 元</span>
  347. </template> -->
  348. </el-form>
  349. <div style="height:0;position:relative;">
  350. <span class="newInvoice" @click="addNewInvoice"> <i class="el-icon-circle-plus-outline"></i> {{ $t('newinvoice') }}</span>
  351. </div>
  352. <el-table :data="ParticularsList.invoiceList" border style="width: 100%">
  353. <el-table-column prop="projectId" :label="$t('other.project')" width="155">
  354. <template slot-scope="scope">
  355. <el-select size="small" v-if="!flg" v-model="scope.row.projectId" :placeholder="$t('other.project')" style="width: 130px">
  356. <el-option v-for="(item, index) in projectList" :key="index" :label="item.projectName + item.projectCode" :value="item.id" @click="ok(item)">
  357. <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  358. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  359. </el-option>
  360. </el-select>
  361. <!-- <span v-else>{{projectIdName[scope.$index].projectName}}</span> -->
  362. <div v-else>
  363. <div v-for="(item, index) in projectIdName" :key="index">
  364. <span v-if="item.id == scope.row.projectId">{{item.projectName}}</span>
  365. </div>
  366. </div>
  367. </template>
  368. </el-table-column>
  369. <el-table-column prop="happenDate" :label="$t('forthedate')" width="172">
  370. <template slot-scope="scope">
  371. <el-date-picker size="small" v-if="!flg" v-model="scope.row.happenDate" type="date" style=" width: 145px" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')">
  372. </el-date-picker>
  373. <span v-else>{{scope.row.happenDate}}</span>
  374. </template>
  375. </el-table-column>
  376. <el-table-column prop="invoiceType" :label="$t('invoices')" width="172">
  377. <template slot-scope="scope">
  378. <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
  379. <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
  380. <el-option :label="$t('vATgeneralinvoice')" :value="1"></el-option>
  381. </el-select>
  382. <span v-else>{{typeInvoic[scope.row.invoiceType]}}</span>
  383. </template>
  384. </el-table-column>
  385. <el-table-column prop="invoiceType" :label="$t('costtype')" width="172">
  386. <template slot-scope="scope">
  387. <el-select v-if="!flg" size="small" v-model="scope.row.expenseType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px" >
  388. <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName" :value="item.typeName" ></el-option>
  389. </el-select>
  390. <span v-else>{{scope.row.expenseType}}</span>
  391. </template>
  392. </el-table-column>
  393. <el-table-column prop="amount" :label="$t('amountoffees')" width="172">
  394. <template slot-scope="scope">
  395. <el-input size="small" v-if="!flg" :id="'am'+scope.$index" v-model="scope.row.amount" @input="zhiNum(scope.$index, scope)" @change="kan" @keyup.native="restrictNumber('am'+scope.$index)"></el-input>
  396. <span v-else>¥{{scope.row.amount}}</span>
  397. </template>
  398. </el-table-column>
  399. <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172">
  400. <template slot-scope="scope">
  401. <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
  402. <span v-else>{{scope.row.invoiceNo}}</span>
  403. </template>
  404. </el-table-column>
  405. <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172">
  406. <template slot-scope="scope">
  407. <el-input size="small" v-if="!flg" v-model="scope.row.taxPercent" @input="zhiNum(scope.$index, scope)"></el-input>
  408. <span v-else>{{scope.row.taxPercent}}</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column prop="taxValue" :label="$t('taxs')+'('+$t('yuan')+')'" width="172">
  412. <template slot-scope="scope">
  413. <el-input size="small" v-if="!flg" v-model="scope.row.taxValue"></el-input>
  414. <span v-else>¥{{scope.row.taxValue}}</span>
  415. </template>
  416. </el-table-column>
  417. <el-table-column prop="remark" :label="$t('bei-zhu')" width="300">
  418. <template slot-scope="scope">
  419. <el-input size="small" v-if="!flg" v-model="scope.row.remark"></el-input>
  420. <span v-else>{{scope.row.remark}}</span>
  421. </template>
  422. </el-table-column>
  423. <el-table-column prop="pic" :label="$t('expensereimbursementvoucher')" width="300">
  424. <template slot-scope="scope">
  425. <div v-if="!flg">
  426. <div @click="abl(scope.$index)" style="height: 35px;overflow: hidden;">
  427. <el-upload :class="!scope.row.pic ? 'upload-demo' : 'upload-demo icl'" :file-list="scope.row.pic" :before-remove="beforeRemoves" :http-request="fileonLoads" limit="1" name="multipartFile">
  428. <el-button size="small" type="primary" v-if="!scope.row.pic">{{ $t('clickupload') }}</el-button>
  429. </el-upload>
  430. </div>
  431. </div>
  432. <div v-else>
  433. <span v-if="scope.row.pic">
  434. <div class="tups">
  435. <viewer :images="scope.row.pic">
  436. <img ref="imgsa" v-for="src in scope.row.pic" :src="src.url" :key="src.title">
  437. </viewer>
  438. </div>
  439. </span>
  440. <span v-else>{{ $t('nodocuments') }}</span>
  441. </div>
  442. </template>
  443. </el-table-column>
  444. <!-- 删除 -->
  445. <el-table-column fixed="right"
  446. :label="$t('operation')" v-if="!flg">
  447. <template slot-scope="scope">
  448. <el-button type="default" size="mini" style="display: inline-block;margin-left:0;margin-top: 3px" @click="delec(scope.$index)">{{ $t('btn.delete') }}</el-button>
  449. </template>
  450. </el-table-column>
  451. </el-table>
  452. </div>
  453. <!-- <viewer :images="imgs">
  454. <img ref="imgsa" v-for="src in imgs" :src="src.url" :key="src.title">
  455. </viewer> -->
  456. <!-- 取消和确定 -->
  457. <span slot="footer" class="dialog-footer">
  458. <el-button @click="dialog = false">{{ $t('btn.cancel') }}</el-button>
  459. <el-button v-if="!flg" type="primary" @click="present()">{{ $t('btn.determine') }}</el-button>
  460. <el-button v-else type="primary" @click="dialog = false">{{ $t('btn.determine') }}</el-button>
  461. </span>
  462. </el-dialog>
  463. <!-- 批量上传 -->
  464. <el-dialog :title="$t('batchupload')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  465. <p>1. {{ $t('other.download') }}
  466. <span>{{ $t('expensereimbursementimporttemplate') }}</span>
  467. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('expensereimbursementimporttemplate')+'.xlsx'" :download="$t('expensereimbursementimporttemplate')+'.xlsx'">{{$t('expensereimbursementimporttemplate')}}.xlsx</el-link>
  468. </p>
  469. <p>2. {{ $t('exceltemplateanduploadit') }}。</p>
  470. <div style="padding-bottom:1em;">
  471. <div style="width:300px;margin:0 auto">
  472. <el-upload ref="upload" action="#" :auto-upload="false" multiple :on-change="fileListAdd" :on-remove="fileListDel">
  473. <el-button slot="trigger" size="small" type="primary" style="">{{ $t('selecthefile') }}</el-button>
  474. <el-button type="primary" size="small" style="margin-left:30px" :underline="false" :loading="importingData" @click="submitUploadSure" :disabled="fileList.length == 0">{{ $t('toupload') }}</el-button>
  475. <el-button size="small" style="margin-left:30px" @click="fileListClear">{{ $t('clears') }}</el-button>
  476. </el-upload>
  477. </div>
  478. </div>
  479. </el-dialog>
  480. <!-- 费用类型自定义 -->
  481. <el-dialog :title="$t('expensetypemanagement')" v-if="customTypeDialog" :visible.sync="customTypeDialog" customClass="customWidth" width="600px">
  482. <el-table :data="customTypeList" style="width:100%" height="400" :loading="customTypeListLoading">
  483. <el-table-column prop="typeName" :label="$t('costofname')" min-width="150"></el-table-column>
  484. <el-table-column :label="$t('costtype')" min-width="150">
  485. <template slot-scope="scope">
  486. <span>{{scope.row.mainType == 0 ? $t('generalcost') : (scope.row.mainType == 1 ? $t('travelexpenses') : $t('outsourcingcost'))}}</span>
  487. </template>
  488. </el-table-column>
  489. <el-table-column :label="$t('operation')" width="150">
  490. <template slot-scope="scope">
  491. <el-button @click="customTypeEditOp(scope.row)" size="small" type="primary">{{ $t('bian-ji') }}</el-button>
  492. <el-button @click="customTypeEditDelete(scope.row)" size="small" type="danger">{{ $t('btn.delete') }}</el-button>
  493. </template>
  494. </el-table-column>
  495. </el-table>
  496. <span slot="footer" class="dialog-footer">
  497. <el-button @click="customTypeDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
  498. <el-button type="primary" @click="customTypeEditOp()" size="medium">{{ $t('newtype') }}</el-button>
  499. </span>
  500. <!-- 新增/编辑费用类型 -->
  501. <el-dialog :title="$t('addeditfeetypes')" v-if="customTypeEditDialog" :visible.sync="customTypeEditDialog" customClass="customWidth" width="400px" append-to-body>
  502. <el-form label-width="80px" :rules="editTypeDataRules" ref="editTypeDataForm" :model="editTypeData">
  503. <el-form-item :label="$t('belongstype')" style="margin:30px 0">
  504. <el-select v-model="editTypeData.mainType" size="medium" style="width:90%">
  505. <el-option :label="$t('generalcost')" :value="0"></el-option>
  506. <el-option :label="$t('travelexpenses')" :value="1"></el-option>
  507. <el-option :label="$t('outsourcingcost')" :value="2"></el-option>
  508. </el-select>
  509. </el-form-item>
  510. <el-form-item :label="$t('typename ')" style="margin:30px 0" prop="typeName">
  511. <el-input id="editTypeDataInput" size="medium" v-model="editTypeData.typeName" :placeholder="$t('customizethfeetypename')" style="width:90%" @keyup.native="editTypeDataInput('editTypeDataInput')"></el-input>
  512. </el-form-item>
  513. </el-form>
  514. <span slot="footer" class="dialog-footer">
  515. <el-button @click="customTypeEditDialog = false" size="medium">{{ $t('btn.cancel') }}</el-button>
  516. <el-button type="primary" @click="customTypeEditSure" size="medium">{{ $t('btn.determine') }}</el-button>
  517. </span>
  518. </el-dialog>
  519. </el-dialog>
  520. <!-- 驳回弹出框 -->
  521. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  522. <div>
  523. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
  524. </div>
  525. <div slot="footer" class="dialog-footer">
  526. <el-button @click="denyReasonDialog = false" >{{ $t('btn.cancel') }}</el-button>
  527. <el-button type="primary" @click="deny()" >{{ $t('btn.determine') }}</el-button>
  528. </div>
  529. </el-dialog>
  530. </section>
  531. </template>
  532. <script>
  533. // 自定义select组件
  534. import selectCat from "@/components/select.vue"
  535. // 引入自定义级联组件
  536. import vueCascader from "@/components/cascader.vue"
  537. export default {
  538. name: "expense",
  539. components: {
  540. selectCat,
  541. vueCascader
  542. },
  543. props: {},
  544. data() {
  545. return {
  546. denyReasonDialog: false,
  547. denyForm:{
  548. reason: '',
  549. id: null
  550. },
  551. fileList: [],
  552. muHeight: document.documentElement.clientHeight || document.body.clientHeight,
  553. xiamianWidth: document.documentElement.clientWidth || document.body.clientWidth,
  554. imgs: [],
  555. addFormRules: {
  556. ownerId: [{ required: true, message: this.$t('pleaseselecttheapplicant'), trigger: "blur" }],
  557. createDate: [{ required: true, message: this.$t('pleaseselectadate'), trigger: "blur" }],
  558. },
  559. isAuditList: false,
  560. statusTxt:[this.$t('state.approved'),this.$t('state.WaitingAudit'), this.$t('state.rejected'), this.$t('state.undone')],
  561. user: JSON.parse(sessionStorage.getItem("user")),
  562. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  563. allExpList:[],
  564. expenseTypeList:[],
  565. tian:{a: null,b: null,c: null,d: null,e: null,f: null,g: null,h: null,},
  566. feeType:[this.$t('generalcost'),this.$t('travelexpenses'),this.$t('outsourcingcost')],
  567. typeInvoic: [this.$t('vATspecialinvoice'), this.$t('vATgeneralinvoice')],
  568. listLoading:false,
  569. tableHeight:0,
  570. list:[],
  571. total:0,
  572. code:null,
  573. date:null,
  574. type:null,
  575. ownerId: null,
  576. users: [], // 人员信息
  577. displayTable: false,
  578. getLists: [],
  579. ProjectList: [], // 项目列表
  580. companyId: [], // 人员的id
  581. dialogVisible: false,
  582. code: null,
  583. addForm:{code:null,ownerId:null,createDate: null, ticketNum:1,type:0,remark:null,totalAmount:0,},
  584. page: 1,
  585. size:20,
  586. form: {happenDate: null,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null},
  587. invoiceList: [],
  588. kkk: null, //
  589. ddId: null,
  590. dldl: [],
  591. isOK: false,
  592. z : null,
  593. value: null,
  594. dialog: false, // 单据查看展示
  595. ParticularsList: [],
  596. projectIdName: [], // 点击查看的项目名
  597. flg: false, // 是否禁用
  598. shuz: [this.$t('generalexpenses'), this.$t('travelexpensess'), this.$t('outsourcingcostshouldbereported')],
  599. ins: 0,
  600. apl: '',
  601. diz: 'http://worktime.ttkuaiban.com',
  602. importDialog: false,
  603. importingData: false,
  604. // 费用类型自定义
  605. customTypeDialog: false,
  606. customTypeList: [],
  607. customTypeListLoading: false,
  608. customTypeEditDialog: false,
  609. editTypeData: {},
  610. editTypeDataRules:{
  611. typeName: [{ required: true, message: this.$t('pleaseentercustomfeetypename'), trigger: "blur" }],
  612. },
  613. };
  614. },
  615. computed: {
  616. totalCost : function(){
  617. let num = 0
  618. for(let i in this.invoiceList){
  619. if(this.invoiceList[i].amount){
  620. num += this.invoiceList[i].amount*1
  621. }
  622. }
  623. return num
  624. }
  625. },
  626. watch: {},
  627. created() {
  628. let height = window.innerHeight;
  629. this.tableHeight = height - 195;
  630. const that = this;
  631. window.onresize = function temp() {
  632. that.tableHeight = window.innerHeight - 195;
  633. };
  634. },
  635. mounted() {
  636. this.getNextCode();
  637. this.getUsers() // 获取人员信息
  638. this.getList() // 获取单据列表
  639. this.getProjectList();
  640. this.getExpList();
  641. },
  642. filters: {
  643. numberToCurrency(value) {
  644. if (!value) return '0.00'
  645. // console.log('v=='+value);
  646. value = value.toFixed(2)
  647. const intPart = Math.trunc(value)
  648. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  649. let floatPart = '.00'
  650. const valueArray = value.toString().split('.')
  651. if (valueArray.length === 2) { // 有小数部分
  652. floatPart = valueArray[1].toString() // 取得小数部分
  653. return intPartFormat + '.' + floatPart
  654. }
  655. return intPartFormat + floatPart
  656. }
  657. },
  658. methods: {
  659. // 费用类型自定义
  660. customTypeOp(){
  661. this.customTypeDialog = true
  662. this.customTypeListLoading = true
  663. this.getExpList()
  664. },
  665. customTypeEditOp(row){
  666. this.customTypeEditDialog = true
  667. if(row){
  668. this.editTypeData = row
  669. }else{
  670. this.editTypeData = {
  671. mainType: 0,
  672. typeName: '',
  673. companyId: this.user.companyId
  674. }
  675. }
  676. },
  677. customTypeEditSure(){
  678. this.$refs.editTypeDataForm.validate(valid => {
  679. if (valid) {
  680. this.http.post('/expense-type/addOrMod',this.editTypeData,
  681. res => {
  682. if(res.code == 'ok'){
  683. this.customTypeEditDialog = false
  684. this.customTypeOp()
  685. }else{
  686. this.$message({
  687. message: res.msg,
  688. type: 'error'
  689. })
  690. }
  691. },err => {
  692. this.$message({
  693. message: err,
  694. type: 'error'
  695. })
  696. })
  697. }})
  698. },
  699. customTypeEditDelete(row){
  700. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('other.prompts'),{
  701. confirmButtonText: this.$t('btn.determine'),
  702. cancelButtonText: this.$t('btn.cancel'),
  703. type: 'warning'
  704. }).then(()=>{
  705. this.http.post('/expense-type/delete',{
  706. id: row.id
  707. },
  708. res => {
  709. if(res.code == 'ok'){
  710. this.customTypeEditDialog = false
  711. this.customTypeOp()
  712. }else{
  713. this.$message({
  714. message: res.msg,
  715. type: 'error'
  716. })
  717. }
  718. },err => {
  719. this.$message({
  720. message: err,
  721. type: 'error'
  722. })
  723. })
  724. }).catch(()=>{
  725. this.$message({
  726. type: 'info',
  727. message: this.$t('thedeletionhasbeencancelled')
  728. })
  729. })
  730. },
  731. editTypeDataInput(typeName){
  732. let inpu = document.getElementById(typeName);
  733. inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
  734. },
  735. submitUpload(){
  736. this.importDialog = true
  737. },
  738. fileListAdd(file,fileList){
  739. let str = file.name.split(".");
  740. let format = str[str.length - 1];
  741. if (format != "xls" && format != "xlsx") {
  742. this.$message({
  743. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  744. type: "error"
  745. });
  746. fileList.splice(fileList.length-1)
  747. }
  748. this.fileList = fileList
  749. },
  750. fileListDel(file,fileList){
  751. this.fileList = fileList
  752. },
  753. fileListClear(){
  754. this.$refs.upload.clearFiles();
  755. this.fileList = []
  756. },
  757. submitUploadSure(){
  758. this.$confirm(this.$t('confirmtoupload'),this.$t('other.prompts'),{
  759. confirmButtonText: this.$t('btn.determine'),
  760. cancelButtonText: this.$t('btn.cancel'),
  761. type: 'success'
  762. }).then(()=>{
  763. let formData = new FormData();
  764. for(let i in this.fileList){
  765. formData.append("files", this.fileList[i].raw);
  766. }
  767. this.importingData = true
  768. // console.log(formData,this.fileList);
  769. // return
  770. this.http.uploadFile( '/expense-sheet/importData', formData,
  771. res => {
  772. if (res.code == "ok") {
  773. this.importingData = false
  774. this.$refs.upload.clearFiles();
  775. this.fileList = []
  776. this.$message({
  777. message: this.$t('uploadedsuccessfully'),
  778. type: "success"
  779. });
  780. } else {
  781. this.importingData = false
  782. this.$message({
  783. message: res.msg,
  784. type: "error"
  785. });
  786. }
  787. },error => {
  788. this.importingData = false
  789. this.$message({
  790. message: error,
  791. type: "error"
  792. });
  793. });
  794. }).catch(()=>{})
  795. },
  796. restrictNumber(targetId) {
  797. let inpu = document.getElementById(targetId);
  798. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  799. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  800. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  801. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  802. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  803. inpu.value = parseFloat(inpu.value);
  804. }
  805. },
  806. approve(item) {
  807. //审核通过
  808. this.http.post('/expense-sheet/approve', {id:item.id
  809. },
  810. res => {
  811. if (res.code == "ok") {
  812. this.getList();
  813. } else {
  814. this.$message({
  815. message: res.msg,
  816. type: "error"
  817. });
  818. }
  819. },
  820. error => {
  821. this.$message({
  822. message: error,
  823. type: "error"
  824. });
  825. });
  826. },
  827. denyReason(item){
  828. this.denyForm.id = item.id
  829. this.denyForm.reason = ''
  830. // this.denyReasonDialog = true
  831. this.deny()
  832. },
  833. deny() {
  834. //审核驳回
  835. this.http.post('/expense-sheet/deny', {
  836. id: this.denyForm.id,
  837. denyReason: this.denyForm.reason
  838. },
  839. res => {
  840. if (res.code == "ok") {
  841. this.denyReasonDialog = false
  842. this.getList();
  843. } else {
  844. this.$message({
  845. message: res.msg,
  846. type: "error"
  847. });
  848. }
  849. },
  850. error => {
  851. this.$message({
  852. message: error,
  853. type: "error"
  854. });
  855. });
  856. },
  857. getExpList() {
  858. this.http.post('/expense-type/getList', {
  859. },
  860. res => {
  861. this.customTypeListLoading = false
  862. if (res.code == "ok") {
  863. this.allExpList = res.data;
  864. this.customTypeList = res.data
  865. this.expenseTypeList = this.allExpList.filter(a=>a.mainType == 0);
  866. if(!res.data != res.data.length == 0){
  867. this.http.post('/company/settingExpenseType',{},res => {
  868. if(res.code == 'ok'){}else{this.$message({message: res.msg,type: 'error'})}
  869. },err => {this.$message({message: err,type: 'error'})})
  870. }
  871. } else {
  872. this.$message({
  873. message: res.msg,
  874. type: "error"
  875. });
  876. }
  877. },
  878. error => {
  879. this.customTypeListLoading = false
  880. this.$message({
  881. message: error,
  882. type: "error"
  883. });
  884. });
  885. },
  886. // 单据查看
  887. downloadByA(val) {
  888. this.dialog = true
  889. this.flg = true;
  890. this.getParticulars(val.id);
  891. this.expenseTypeList = this.allExpList.filter(a=>a.mainType == val.type);
  892. },
  893. // 单据编辑
  894. showEditName(val) {
  895. this.dialog = true,
  896. this.flg = false,
  897. delete val.invoiceList
  898. this.getParticulars(val.id)
  899. this.expenseTypeList = this.allExpList.filter(a=>a.mainType == val.type);
  900. },
  901. staffs(key, keyPath) { // 控制员工费用报表
  902. if (keyPath[0] == '1') {
  903. this.displayTable = false;
  904. } else {
  905. this.displayTable = true;
  906. this.getList();
  907. }
  908. },
  909. bills(audit) { // 控制
  910. this.isAuditList = audit;
  911. this.getList();
  912. this.displayTable = true;
  913. },
  914. present(){
  915. this.dialog = false
  916. this.adds();
  917. },
  918. // 删除操作
  919. delec(ids) {
  920. // console.log('删除操作', ids);
  921. this.ParticularsList.invoiceList.splice(ids, 1)
  922. this.ParticularsList.ticketNum = this.ParticularsList.invoiceList.length
  923. this.kan()
  924. },
  925. adds() {
  926. // happenDate
  927. // console.log(this.ParticularsList.invoiceList, '123')
  928. var spl = this.ParticularsList.invoiceList
  929. for(var i in spl) {
  930. if(spl[i].pic) {
  931. if(spl[i].pic[0].name) {
  932. spl[i].pic = spl[i].pic[0].name
  933. }
  934. }
  935. }
  936. // console.log(spl)
  937. // return
  938. this.ParticularsList.items = JSON.stringify(this.ParticularsList.invoiceList)//这里要传发票列表的json转string
  939. delete this.ParticularsList.invoiceList
  940. this.http.post('/expense-sheet/add', this.ParticularsList,
  941. res => {
  942. if (res.code == "ok") {
  943. this.bills(this.isAuditList);
  944. this.$message({
  945. message: this.$t('editsuccess'),
  946. type: "success"
  947. });
  948. } else {
  949. this.$message({
  950. message: res.msg,
  951. type: "error"
  952. });
  953. }
  954. },
  955. error => {
  956. this.$message({
  957. message: error,
  958. type: "error"
  959. });
  960. });
  961. },
  962. // 获取人员信息
  963. getUsers() {
  964. // this.http.post(this.port.manage.list, {
  965. // departmentId: -1,
  966. // pageIndex: 1,
  967. // // pageSize: 99999
  968. // pageSize: -1
  969. // },
  970. this.http.post('/user/getSimpleActiveUserList', {},
  971. res => {
  972. if (res.code == "ok") {
  973. // this.users = res.data.records;
  974. this.users = res.data;
  975. if (!this.permissions.costAudit) {
  976. this.addForm.ownerId = this.user.id;
  977. this.addForm.status = 1;
  978. this.$forceUpdate()
  979. }
  980. } else {
  981. this.$message({
  982. message: res.msg,
  983. type: "error"
  984. });
  985. }
  986. },
  987. error => {
  988. this.$message({
  989. message: error,
  990. type: "error"
  991. });
  992. });
  993. },
  994. // 提交事件
  995. submits() {
  996. this.$refs.mainAddForm.validate(valid => {
  997. if (valid) {
  998. if (this.invoiceList.length == 0) {
  999. this.$message({
  1000. message: this.$t('pleaseaddtheinvoice'),
  1001. type: "error"
  1002. });
  1003. return;
  1004. }
  1005. this.add();
  1006. this.addForm = {
  1007. code:null,
  1008. ownerId:this.user.id,
  1009. createDate: null,
  1010. type:this.z,
  1011. ticketNum:1,remark:null,totalAmount:0,}
  1012. this.invoiceList = []
  1013. }
  1014. });
  1015. },
  1016. // 点击新增
  1017. addxz() {
  1018. this.form = {happenDate: null,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null,pic: null},
  1019. this.invoiceList.push(this.form)
  1020. },
  1021. addNewInvoice(){
  1022. this.form = {happenDate: null,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null,pic: null},
  1023. this.ParticularsList.invoiceList.push(this.form)
  1024. this.ParticularsList.ticketNum = this.ParticularsList.invoiceList.length
  1025. },
  1026. //获取项目列表
  1027. getProjectList() {
  1028. this.http.post( this.port.project.list, {},
  1029. res => {
  1030. if (res.code == "ok") {
  1031. this.projectList = res.data;
  1032. } else {
  1033. this.$message({
  1034. message: res.msg,
  1035. type: "error"
  1036. });
  1037. }
  1038. },
  1039. error => {
  1040. this.$message({
  1041. message: error,
  1042. type: "error"
  1043. });
  1044. });
  1045. },
  1046. //获取单据列表
  1047. getList() {
  1048. // console.log(this.date)
  1049. var stat = ''
  1050. var end = ''
  1051. if(this.date) {
  1052. stat = this.date[0]
  1053. end = this.date[1]
  1054. }
  1055. var param = {pageIndex: this.page,
  1056. pageSize: this.size,
  1057. code: this.code,
  1058. // createDate: this.date,
  1059. startDate: stat,
  1060. endDate: end,
  1061. ownerId:this.ownerId,
  1062. type:this.type,
  1063. };
  1064. if (this.isAuditList) {
  1065. param.status = 1;
  1066. }
  1067. this.list = [];
  1068. this.total = 0;
  1069. this.http.post('/expense-sheet/list', param,
  1070. res => {
  1071. if (res.code == "ok") {
  1072. this.list = res.data.records;
  1073. this.total = res.data.total;
  1074. } else {
  1075. this.$message({
  1076. message: res.msg,
  1077. type: "error"
  1078. });
  1079. }
  1080. },
  1081. error => {
  1082. this.$message({
  1083. message: error,
  1084. type: "error"
  1085. });
  1086. });
  1087. },
  1088. //删除单据
  1089. deletes(id) {
  1090. this.http.post('/expense-sheet/delete', {id: id},
  1091. res => {
  1092. if (res.code == "ok") {
  1093. this.getList()
  1094. this.$message({
  1095. message: this.$t('message.successfullyDeleted'),
  1096. type: "success"
  1097. });
  1098. } else {
  1099. this.$message({
  1100. message: res.msg,
  1101. type: "error"
  1102. });
  1103. }
  1104. },
  1105. error => {
  1106. this.$message({
  1107. message: error,
  1108. type: "error"
  1109. });
  1110. });
  1111. },
  1112. //创建单据
  1113. add() {
  1114. // happenDate
  1115. this.addForm.items = JSON.stringify(this.invoiceList)//这里要传发票列表的json转string
  1116. this.addForm.totalAmount = this.totalCost
  1117. this.http.post('/expense-sheet/add', this.addForm,
  1118. res => {
  1119. if (res.code == "ok") {
  1120. this.$message({
  1121. message: this.$t('message.fillinsuccessfully'),
  1122. type: "success"
  1123. });
  1124. this.getNextCode()
  1125. } else {
  1126. this.$message({
  1127. message: res.msg,
  1128. type: "error"
  1129. });
  1130. }
  1131. },
  1132. error => {
  1133. this.$message({
  1134. message: error,
  1135. type: "error"
  1136. });
  1137. });
  1138. },
  1139. //获取单据编码
  1140. getNextCode() {
  1141. this.http.post('/expense-sheet/getNextCode', {
  1142. },
  1143. res => {
  1144. if (res.code == "ok") {
  1145. this.addForm.code = res.data;
  1146. } else {
  1147. this.$message({
  1148. message: res.msg,
  1149. type: "error"
  1150. });
  1151. }
  1152. },
  1153. error => {
  1154. this.$message({
  1155. message: error,
  1156. type: "error"
  1157. });
  1158. });
  1159. },
  1160. // 获取查看单据的数据
  1161. getParticulars(id) {
  1162. this.http.post('/expense-sheet/getDetail', {id: id},
  1163. res => {
  1164. if (res.code == "ok") {this
  1165. // this.ParticularsList = res.data
  1166. var s = []
  1167. // var b = []
  1168. for(var i in res.data.invoiceList) {
  1169. if(res.data.invoiceList[i].pic) {
  1170. var b = []
  1171. var j = {}
  1172. var img = this.diz + '/upload/' + res.data.invoiceList[i].pic
  1173. j.url = img
  1174. j.title = this.$t('expensereimbursementvoucher'),
  1175. j.name = res.data.invoiceList[i].pic
  1176. b.push(j)
  1177. res.data.invoiceList[i].pic = b
  1178. // console.log(res.data.invoiceList[i].pic)
  1179. }
  1180. }
  1181. this.ParticularsList = res.data
  1182. for(var i = 0; i <= this.ParticularsList.invoiceList.length - 1; i++) {
  1183. s.push(this.ParticularsList.invoiceList[i].projectId)
  1184. }
  1185. this.projectIdName = this.projectList.filter( item => {return s.indexOf(item.id) !== -1})
  1186. // this.projectIdName = this.projectList.filter(p => p.id == this.ParticularsList.invoiceList[0].projectId)[0].projectName
  1187. // console.log(res.data, '查看当前状态');
  1188. // console.log(this.ParticularsList)
  1189. } else {
  1190. this.$message({
  1191. message: res.msg,
  1192. type: "error"
  1193. });
  1194. }
  1195. },
  1196. error => {
  1197. this.$message({
  1198. message: error,
  1199. type: "error"
  1200. });
  1201. })
  1202. },
  1203. //分页
  1204. handleCurrentChange(val) {
  1205. this.page = val;
  1206. this.getList();
  1207. },
  1208. handleSizeChange(val) {
  1209. this.size = val;
  1210. this.getList();
  1211. },
  1212. deleteItem(item) {
  1213. this.$confirm(this.$t('yousureyouwanttodelete'), this.$t('other.prompts'), {
  1214. //type: 'warning'
  1215. }).then(() => {
  1216. this.http.post('/expense-sheet/delete', {id:item.id},
  1217. res => {
  1218. if (res.code == "ok") {
  1219. this.getList();
  1220. } else {
  1221. this.$message({
  1222. message: res.msg,
  1223. type: "error"
  1224. });
  1225. }
  1226. },
  1227. error => {
  1228. this.$message({
  1229. message: error,
  1230. type: "error"
  1231. });
  1232. });
  1233. });
  1234. },
  1235. // 点击删除
  1236. chanc(k) {
  1237. this.invoiceList.splice(k, 1)
  1238. },
  1239. // 双击
  1240. dbclick(row, event, column){
  1241. this.isOK = true
  1242. },
  1243. oosk(s){
  1244. this.isOK = false
  1245. },
  1246. ssl(index) {
  1247. this.z = index
  1248. this.addForm.type = index
  1249. this.ins = index;
  1250. this.expenseTypeList = this.allExpList.filter(a=>a.mainType == this.ins);
  1251. this.addForm.ownerId = this.user.id;
  1252. this.getNextCode();
  1253. },
  1254. // 点击侧边栏事件
  1255. side() {
  1256. if(this.$refs.side.style.left < '0px') {
  1257. this.$refs.sidebars.style.width = '1px'
  1258. this.$refs.sid.style.left = '1px'
  1259. this.$refs.side.style.left = '1px'
  1260. this.$refs.sideI.className = 'el-icon-arrow-right'
  1261. this.$refs.staff.style.margin = '20px 20px 0 20px'
  1262. this.$refs.staff.style.width = '95%'
  1263. this.$refs.xiaomian.style.width = '100%'
  1264. this.$refs.headHe.style.paddingLeft = '20px'
  1265. } else {
  1266. this.$refs.sidebars.style.width = '200px'
  1267. this.$refs.sid.style.left = '200px'
  1268. this.$refs.side.style.left = '-19px'
  1269. this.$refs.sideI.className = 'el-icon-arrow-left'
  1270. this.$refs.staff.style.margin = '20px 20px 0 220px'
  1271. this.$refs.staff.style.width = '81%'
  1272. this.$refs.xiaomian.style.width = '85%'
  1273. this.$refs.headHe.style.paddingLeft = '220px'
  1274. }
  1275. },
  1276. // 费用金额失去焦点时触发
  1277. shiqu(){
  1278. this.addForm.totalAmount = this.invoiceList.reduce((prev, next) => {
  1279. return prev + parseFloat(next.amount);
  1280. }, 0)
  1281. },
  1282. kan(){
  1283. this.ParticularsList.totalAmount = this.ParticularsList.invoiceList.reduce((prev, next) => {
  1284. return prev + parseFloat(next.amount)
  1285. }, 0)
  1286. },
  1287. zhi(e) {
  1288. // console.log('看看值', e)
  1289. var i = e
  1290. if(this.invoiceList[i].amount == null || this.invoiceList[i].amount == 'null' || this.invoiceList[i].taxPercent == null || this.invoiceList[i].taxPercent == 'null') {
  1291. return
  1292. }
  1293. this.invoiceList[i].taxValue = this.invoiceList[i].amount * this.invoiceList[i].taxPercent / 100
  1294. // console.log(this.invoiceList[i].amount, this.invoiceList[i].taxPercent)
  1295. var shui = this.invoiceList[i].taxPercent / 100 // 税率
  1296. var zhi = this.invoiceList[i].amount / (1 + shui) * shui
  1297. this.invoiceList[i].taxValue = zhi.toFixed(2)
  1298. },
  1299. zhiNum(i, val) {
  1300. // console.log('看看值', i, val)
  1301. // console.log(this.ParticularsList.invoiceList)
  1302. 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') {
  1303. return
  1304. }
  1305. var shui = this.ParticularsList.invoiceList[i].taxPercent / 100
  1306. var zhi = this.ParticularsList.invoiceList[i].amount / (1 + shui) * shui
  1307. this.ParticularsList.invoiceList[i].taxValue = zhi.toFixed(2)
  1308. },
  1309. zhis(e) {
  1310. var i = e
  1311. this.invoiceList[i].taxValue = this.invoiceList[i].taxValue.toFixed(2)
  1312. },
  1313. fileonLoad(item) {
  1314. //首先判断文件类型
  1315. let str = item.file.name.split(".");
  1316. let format = str[str.length - 1];
  1317. if (format != "jpg" && format != "png") {
  1318. this.$message({
  1319. message: this.$t('pleaseselectpictures'),
  1320. type: "error"
  1321. });
  1322. } else {
  1323. this.listLoading = true;
  1324. let formData = new FormData();
  1325. formData.append("multipartFile", item.file);
  1326. this.http.uploadFile('/common/uploadFile', formData,
  1327. res => {
  1328. this.listLoading = false;
  1329. if (res.code == "ok") {
  1330. this.$message({
  1331. message: this.$t('uploadedsuccessfully'),
  1332. type: "success"
  1333. });
  1334. // this.getList();
  1335. this.invoiceList[this.apl].pic = res.data
  1336. // console.log(this.invoiceList)
  1337. } else {
  1338. this.$message({
  1339. message: res.msg,
  1340. type: "error"
  1341. });
  1342. }
  1343. },
  1344. error => {
  1345. this.listLoading = false;
  1346. this.$message({
  1347. message: error,
  1348. type: "error"
  1349. });
  1350. });
  1351. }
  1352. },
  1353. abl(e) {
  1354. this.apl = e
  1355. },
  1356. beforeRemove(file, fileList) {
  1357. var that = this
  1358. setTimeout(function () {
  1359. that.invoiceList[that.apl].pic = null
  1360. }, 200)
  1361. },
  1362. fileonLoads(item) {
  1363. //首先判断文件类型
  1364. let str = item.file.name.split(".");
  1365. let format = str[str.length - 1];
  1366. if (format != "jpg" && format != "png") {
  1367. this.$message({
  1368. message: this.$t('pleaseselectpictures'),
  1369. type: "error"
  1370. });
  1371. } else {
  1372. this.listLoading = true;
  1373. let formData = new FormData();
  1374. formData.append("multipartFile", item.file);
  1375. this.http.uploadFile('/common/uploadFile', formData,
  1376. res => {
  1377. this.listLoading = false;
  1378. if (res.code == "ok") {
  1379. this.$message({
  1380. message: this.$t('uploadedsuccessfully'),
  1381. type: "success"
  1382. });
  1383. // this.getList();
  1384. this.ParticularsList.invoiceList[this.apl].pic = res.data
  1385. // console.log(this.invoiceList)
  1386. } else {
  1387. this.$message({
  1388. message: res.msg,
  1389. type: "error"
  1390. });
  1391. }
  1392. },
  1393. error => {
  1394. this.listLoading = false;
  1395. this.$message({
  1396. message: error,
  1397. type: "error"
  1398. });
  1399. });
  1400. }
  1401. },
  1402. beforeRemoves(file, fileList) {
  1403. var that = this
  1404. setTimeout(function () {
  1405. // this.ParticularsList.invoiceList
  1406. that.ParticularsList.invoiceList[that.apl].pic = null
  1407. }, 200)
  1408. },
  1409. imgUrl(img) {
  1410. // var imgss = this.diz + '/upload/' + img
  1411. // var sp = []
  1412. // var is = {}
  1413. // is.url = imgss
  1414. // is.title = 1
  1415. // sp.push(is)
  1416. // this.imgs = sp
  1417. // console.log(imgss)
  1418. // console.log(this.$refs.imgsa)
  1419. // this.$refs.imgsa.click()
  1420. // console.log(location.protocol, location.host)
  1421. // console.log(location.protocol + '//' + location.host + imgs)
  1422. },
  1423. // 合计
  1424. getSummaries(param) {
  1425. const { columns, data } = param;
  1426. const sums = [];
  1427. columns.forEach((column, index) => {
  1428. if (index === 0) {
  1429. sums[index] = this.$t('other.totals');
  1430. return;
  1431. }
  1432. if(index === 1) {
  1433. const values = data.map(item => Number(item[column.property]));
  1434. if (!values.every(value => isNaN(value))) {
  1435. sums[index] = values.reduce((prev, curr) => {
  1436. const value = Number(curr);
  1437. if (!isNaN(value)) {
  1438. return prev + curr;
  1439. } else {
  1440. return prev;
  1441. }
  1442. }, 0);
  1443. var zhi = +sums[index] + 0
  1444. var sl = zhi.toFixed(2)
  1445. sl += this.$t('yuan');
  1446. } else {
  1447. sums[index] = '';
  1448. }
  1449. } else {
  1450. sums[index] = '';
  1451. }
  1452. });
  1453. // console.log(sums, 123)
  1454. this.$nextTick(()=>{ this.$refs.tab.doLayout()})
  1455. return sums;
  1456. },
  1457. // 自定义组件事件
  1458. selectCal(obj) {
  1459. if(obj.distinction == '1') {
  1460. this.addForm.ownerId = obj.id
  1461. } else if(obj.distinction == '2') {
  1462. this.ownerId = obj.id
  1463. } else if(obj.distinction == '3') {
  1464. this.ParticularsList.ownerId = obj.id
  1465. }
  1466. }
  1467. },
  1468. };
  1469. </script>
  1470. <style scoped>
  1471. .tups {
  1472. width: 100%;
  1473. height: 25px;
  1474. position: relative;
  1475. z-index: 99;
  1476. overflow: hidden;
  1477. }
  1478. .tups img {
  1479. height: 25px !important;
  1480. position: relative;
  1481. z-index: 99;
  1482. }
  1483. .viewer-canvas {
  1484. position: absolute;
  1485. z-index: 9 !important;
  1486. }
  1487. .icl {
  1488. margin-top: -25px !important;
  1489. }
  1490. /* 费用报销标题 */
  1491. .headine {
  1492. width: 100%;
  1493. height: 46.4px;
  1494. line-height: 46.4px;
  1495. background: #fff;
  1496. box-sizing: border-box;
  1497. }
  1498. .headine h3 {
  1499. margin: 0;
  1500. display: inline-block;
  1501. box-sizing: border-box;
  1502. color: #999;
  1503. }
  1504. .headine p {
  1505. display: inline-block;
  1506. margin: 0;
  1507. }
  1508. /* /费用报销标题 */
  1509. .sidebars {
  1510. height: 100%;
  1511. position: absolute;
  1512. border-right: 1px solid #E6E6E6;
  1513. z-index: 2;
  1514. top: 0;
  1515. }
  1516. .sidebars h3 {
  1517. margin: 0;
  1518. line-height: 45px;
  1519. background: #ffffff;
  1520. font-weight: normal;
  1521. color: #666;
  1522. padding-left: 20px;
  1523. }
  1524. .sidebars .el-col-12 {
  1525. width: 100%
  1526. }
  1527. .public {
  1528. height: 180px;
  1529. border-bottom: 1px solid #ddd;
  1530. }
  1531. .public .el-form-item {
  1532. display: inline-block;
  1533. }
  1534. .pu_button {
  1535. text-align: right;
  1536. width: 100%;
  1537. padding: 24px 30px;
  1538. box-sizing: border-box;
  1539. }
  1540. .pu_bu_x .pu_bu_t {
  1541. display: inline-block;
  1542. }
  1543. .pu_bu_x {
  1544. margin-right: 20px;
  1545. color: #20A0F7;
  1546. cursor: pointer;
  1547. }
  1548. .pu_bu_t {
  1549. color: #20A0F7;
  1550. cursor: pointer;
  1551. display: block;
  1552. float: right;
  1553. position:
  1554. relative;
  1555. top: -20px;
  1556. right: 63px;
  1557. }
  1558. .pu_table {
  1559. margin-left: 10px;
  1560. }
  1561. .pu_bu_t:hover {
  1562. color: #7bbcff;
  1563. }
  1564. .pu_bu_x:hover {
  1565. color: #7bbcff;
  1566. }
  1567. /* 我的单据报销凭证 */
  1568. .staff{
  1569. border-left: 1px solid #fff;
  1570. border-top: 1px solid #fff;
  1571. border-right: 1px solid #fff;
  1572. background: #fff;
  1573. }
  1574. /* */
  1575. .sdat{
  1576. display: inline-block;
  1577. width: 260px;
  1578. margin-left: 13px;
  1579. }
  1580. .messages .el-form-item{
  1581. display: inline-block;
  1582. }
  1583. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  1584. width: 190px;
  1585. }
  1586. /* 我的报销凭证 */
  1587. .search {
  1588. position: relative;
  1589. top: 20px;
  1590. left: 20px;
  1591. }
  1592. .tables {
  1593. margin-top: 50px;
  1594. box-sizing: border-box;
  1595. padding: 10px;
  1596. }
  1597. .informant .el-form-item {
  1598. display: inline-block;
  1599. }
  1600. /* 侧边栏收索 */
  1601. .side {
  1602. position: absolute;
  1603. z-index: 2;
  1604. border-right: 2px solid #DDDDDD;
  1605. height: 100%;
  1606. top: 0;
  1607. width: 0;
  1608. }
  1609. .side .spans {
  1610. width: 20px;
  1611. height: 30px;
  1612. border: 1px solid #DDDDDD;
  1613. box-sizing: border-box;
  1614. position: absolute;
  1615. top: 50%;
  1616. margin-top: -50%;
  1617. text-align: center;
  1618. z-index: 1;
  1619. background: #fff;
  1620. }
  1621. .side .spans i{
  1622. margin-top: 7px;
  1623. color: #C0BFBF
  1624. }
  1625. .side:hover {
  1626. border-right: 2px solid #20A0FF;
  1627. }
  1628. .side:hover .spans {
  1629. border: 1px solid #20A0FF;
  1630. background: #20A0FF;
  1631. }
  1632. .side:hover .spans i{
  1633. color: #fff;
  1634. }
  1635. /* 右边整体页面 */
  1636. .contents {
  1637. height: 100%;
  1638. /* padding: 30px; */
  1639. background: #F7F7F7;
  1640. /* position: absolute; */
  1641. }
  1642. .submits {
  1643. margin-left: 50%;
  1644. }
  1645. .waiting {
  1646. color:orange;
  1647. }
  1648. .rejected {
  1649. color:red;
  1650. }
  1651. .newInvoice{
  1652. position: absolute;
  1653. right: 10px;
  1654. top: -20px;
  1655. height: 20px;
  1656. line-height: 20px;
  1657. cursor: pointer;
  1658. color: #20a0f7;
  1659. font-size: 14px;
  1660. }
  1661. .newInvoice:hover{
  1662. color: #7bbcff;
  1663. }
  1664. </style>