expense.vue 118 KB

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