expense.vue 113 KB

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