expense.vue 117 KB

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