Payroll.vue 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616
  1. <template>
  2. <div v-loading.fullscreen.lock="fullscreenLoading">
  3. <div class="payroll-all">
  4. <div class="payroll-head">
  5. <div style="display: flex;" class="payroll-head-li">
  6. <el-date-picker
  7. style="width: 120px;"
  8. v-model="value2"
  9. :clearable="false"
  10. type="month"
  11. placeholder="选择月"
  12. @change="PickTime()">
  13. </el-date-picker>
  14. <el-select style="width: 220px;margin-left: 10px;" @change="companychange()" v-model="companyName" filterable placeholder="请选择公司">
  15. <el-option
  16. v-for="item in companylist"
  17. :key="item.id"
  18. :label="item.companyName"
  19. :value="item.id">
  20. </el-option>
  21. </el-select>
  22. <!-- <el-select v-model="depName" filterable placeholder="请选择部门">
  23. <el-option
  24. v-for="item in deplist"
  25. :key="item.value"
  26. :label="item.label"
  27. :value="item.value">
  28. </el-option>
  29. </el-select> -->
  30. <el-input @input="cnNamechange()" style="width: 220px;margin-left: 10px;" v-model="cnName" placeholder="请输入员工姓名"></el-input>
  31. <!-- <el-select v-model="cnName" filterable placeholder="请选择员工">
  32. <el-option
  33. v-for="item in comuserlist"
  34. :key="item.id"
  35. :label="item.cnName"
  36. :value="item.id">
  37. </el-option>
  38. </el-select> -->
  39. </div>
  40. <div class="payroll-head-li">
  41. <el-button type="primary" @click="addsalary()">新增员工薪资结构</el-button>
  42. <el-button type="primary" @click="openSalaryCalculator()">计算当月工资</el-button>
  43. <el-button @click="Download()" type="primary">导出工资单</el-button>
  44. <el-button type="primary" @click="DownloadTaxes()">下载个税模板</el-button>
  45. <el-button type="primary" @click="UploadTaxes=true">上传个税</el-button>
  46. <!--<el-button type="primary">四川公司工资单</el-button>
  47. <el-button type="primary">纽茵公司工资单</el-button> -->
  48. </div>
  49. </div>
  50. <div class="payroll-table">
  51. <template>
  52. <el-table
  53. height="760"
  54. :data="tableDatatwo"
  55. border
  56. style="width: 100%">
  57. <el-table-column
  58. prop="row_Number"
  59. label="序号"
  60. width="50">
  61. </el-table-column>
  62. <el-table-column
  63. prop="yearMonth"
  64. label="年月"
  65. width="80">
  66. </el-table-column>
  67. <el-table-column
  68. prop="name"
  69. label="员工"
  70. width="80">
  71. </el-table-column>
  72. <el-table-column
  73. prop="companyName"
  74. label="公司"
  75. width="170">
  76. </el-table-column>
  77. <el-table-column
  78. label="假勤/打卡"
  79. width="85">
  80. <template slot-scope="scope">
  81. <el-popover
  82. v-if="scope.row.ex_ItemsRemark!=''"
  83. placement="right"
  84. width="150"
  85. trigger="hover">
  86. <div v-for="(items,index) in scope.row.ex_ItemsRemark!=''?JSON.parse(scope.row.ex_ItemsRemark):''" :key="index">
  87. <div v-if="items.Type=='假勤'">
  88. <div class="title-popover">{{items.Type}}({{(items.Ex_ItemInfo).length}})</div>
  89. <!-- <div class="title-content" v-for="(itemss,index) in items.Ex_ItemInfo" :key="index">
  90. 请假类型:{{itemss.SubType}}
  91. </div> -->
  92. </div>
  93. <div v-if="items.Type=='打卡'">
  94. <div class="title-popover">{{items.Type}}异常({{(items.Ex_ItemInfo).length}})</div>
  95. </div>
  96. <div v-if="items=='[]'">
  97. <div class="title-popover">本月无假勤</div>
  98. </div>
  99. </div>
  100. <div style="cursor: pointer;" slot="reference">移上查看</div>
  101. </el-popover>
  102. <el-popover
  103. v-if="scope.row.ex_ItemsRemark==''"
  104. placement="right"
  105. width="150"
  106. trigger="hover">
  107. <span>无考勤异常</span>
  108. <div style="cursor: pointer;" slot="reference">移上查看</div>
  109. </el-popover>
  110. </template>
  111. </el-table-column>
  112. <el-table-column
  113. prop="startDate"
  114. label="起止日期"
  115. width="190">
  116. <template slot-scope="scope">
  117. <div>{{scope.row.startDate+'~'+scope.row.endDate}}</div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column
  121. prop="workDays"
  122. label="应出勤天数"
  123. width="95">
  124. </el-table-column>
  125. <!-- <el-table-column
  126. prop="regularDays"
  127. label="正常出勤天数"
  128. width="110">
  129. </el-table-column> -->
  130. <el-table-column
  131. prop="should"
  132. label="应发合计"
  133. width="90"
  134. :formatter="rounding">
  135. </el-table-column>
  136. <el-table-column
  137. prop="totalDeductions"
  138. label="扣款合计"
  139. width="90"
  140. :formatter="rounding">
  141. </el-table-column>
  142. <el-table-column
  143. prop="beforeTax"
  144. label="税前合计 "
  145. width="90"
  146. :formatter="rounding">
  147. </el-table-column>
  148. <el-table-column
  149. prop="withholdingTax"
  150. label="代缴个税"
  151. width="90"
  152. :formatter="rounding">
  153. </el-table-column>
  154. <el-table-column
  155. prop="totalRealHair"
  156. label="税后合计"
  157. width="90"
  158. :formatter="rounding">
  159. </el-table-column>
  160. <el-table-column
  161. prop="lastUpdateUserName"
  162. label="最后操作人"
  163. width="100">
  164. </el-table-column>
  165. <el-table-column
  166. prop="lastUpdateDt"
  167. label="最后时间"
  168. width="180">
  169. </el-table-column>
  170. <el-table-column
  171. prop="name"
  172. label="操 作"
  173. width="100">
  174. <!-- eslint-disable-next-line -->
  175. <template slot-scope="scope">
  176. <el-button type="text" @click="SalaryDetails(scope.$index, scope.row)">修改</el-button>
  177. <el-button style="color: red;" type="text" @click="deleteaddsalary(scope.$index,scope.row,tableDatatwo)">删除</el-button>
  178. </template>
  179. </el-table-column>
  180. </el-table>
  181. </template>
  182. </div>
  183. <!-- 上传个税 -->
  184. <el-dialog title="上传个税" width="400px" :visible.sync="UploadTaxes">
  185. <div>
  186. <el-form :model="TaxesData" ref="TaxesData" :rules="Taxesrules">
  187. <el-form-item label="年月" prop="yearMonth" label-width="50">
  188. <el-date-picker style="width:86%" v-model="TaxesData.yearMonth" size="medium" type="month" placeholder="选择月"></el-date-picker>
  189. </el-form-item>
  190. </el-form>
  191. <el-upload drag
  192. :limit=limitNum
  193. :auto-upload="false"
  194. accept=".xlsx"
  195. :action="UploadUrl()"
  196. :before-upload="beforeUploadFile"
  197. :on-change="fileChange"
  198. :on-exceed="exceedFile"
  199. :on-success="handleSuccess"
  200. :on-error="handleError"
  201. :on-remove="removelist"
  202. :file-list="fileList">
  203. <i class="el-icon-upload"></i>
  204. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  205. <div class="el-upload__tip" slot="tip">只能上传xlsx文件,且不超过10M</div>
  206. </el-upload>
  207. <br/>
  208. <el-button size="small" type="primary" @click="uploadFile('TaxesData')">立即上传</el-button>
  209. <el-button size="small">取消</el-button>
  210. </div>
  211. </el-dialog>
  212. <!-- 计算工资 -->
  213. <el-dialog :close-on-click-modal="false" width="380px" title="选择计算当月工资日期" :visible.sync="gridTableVisible">
  214. <el-form :model="gridData" ref="gridData" :rules="gridrules">
  215. <el-form-item label="年月" prop="yearMonth" :label-width="formLabelWidth">
  216. <el-date-picker v-model="gridData.yearMonth" size="medium" type="month" placeholder="选择月"></el-date-picker>
  217. </el-form-item>
  218. <el-form-item label="工资日期起" prop="startDate" :label-width="formLabelWidth">
  219. <el-date-picker v-model="gridData.startDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
  220. </el-form-item>
  221. <el-form-item label="工资日期止" prop="endDate" :label-width="formLabelWidth">
  222. <el-date-picker v-model="gridData.endDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
  223. </el-form-item>
  224. </el-form>
  225. <div slot="footer" class="dialog-footer">
  226. <el-button type="primary" @click="SalaryCalculator('gridData')">计 算</el-button>
  227. <el-button @click="gridTableVisible = false">取 消</el-button>
  228. </div>
  229. </el-dialog>
  230. <!-- 修改新增 -->
  231. <el-dialog :close-on-click-modal="false" width="960px" class="pan" top="2.5vh" title="薪资详细信息" :visible.sync="dialogFormVisible">
  232. <el-form :model="salaryinif" ref="salaryinif" :rules="rules">
  233. <div class="payroll-inif">
  234. <el-form-item label="员工" prop="userId" :label-width="formLabelWidth">
  235. <el-select size="medium" style="height:36px" :disabled="disabled" v-model="salaryinif.userId" filterable placeholder="请选择">
  236. <el-option
  237. v-for="item in userlist"
  238. :key="item.id"
  239. :label="item.cnName"
  240. :value="item.id">
  241. </el-option>
  242. </el-select>
  243. </el-form-item>
  244. <!-- <el-form-item label="是否转正" :label-width="formLabelWidth">
  245. <el-switch v-model="salaryinif.regularization" active-color="" inactive-color="">
  246. </el-switch>
  247. </el-form-item> -->
  248. <el-form-item label="年月" prop="yearMonth" :label-width="formLabelWidth">
  249. <el-date-picker @change="Rangetime()" v-model="salaryinif.yearMonth" size="medium" type="month" placeholder="选择月"></el-date-picker>
  250. </el-form-item>
  251. <el-form-item label="工资日期起" prop="startDate" :label-width="formLabelWidth">
  252. <el-date-picker v-model="salaryinif.startDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
  253. </el-form-item>
  254. <el-form-item label="工资日期止" prop="endDate" :label-width="formLabelWidth">
  255. <el-date-picker v-model="salaryinif.endDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
  256. </el-form-item>
  257. <el-form-item label="基本工资" prop="basic" :label-width="formLabelWidth">
  258. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.basic"></el-input-number>
  259. </el-form-item>
  260. <el-form-item label="绩效工资" prop="floats" :label-width="formLabelWidth">
  261. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.floats"></el-input-number>
  262. </el-form-item>
  263. <el-form-item label="岗位津贴" prop="postAllowance" :label-width="formLabelWidth">
  264. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.postAllowance"></el-input-number>
  265. </el-form-item>
  266. <!-- <el-form-item label="服装洗理补贴" prop="garmentWashSubsidies" :label-width="formLabelWidth">
  267. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.garmentWashSubsidies"></el-input-number>
  268. </el-form-item> -->
  269. <!-- <el-form-item label="通讯补贴" prop="communicationSubsidies" :label-width="formLabelWidth">
  270. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.communicationSubsidies"></el-input-number>
  271. </el-form-item> -->
  272. <el-form-item label="月度补贴" prop="otherSubsidies" :label-width="formLabelWidth">
  273. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherSubsidies"></el-input-number>
  274. </el-form-item>
  275. <el-form-item label="保密费" prop="informationSecurityFee" :label-width="formLabelWidth">
  276. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.informationSecurityFee"></el-input-number>
  277. </el-form-item>
  278. <!-- <el-form-item label="操作奖金" prop="operationBonus" :label-width="formLabelWidth">
  279. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.operationBonus"></el-input-number>
  280. </el-form-item> -->
  281. <!-- <el-form-item label="部门团建费" prop="groupCost" :label-width="formLabelWidth">
  282. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.groupCost"></el-input-number>
  283. </el-form-item> -->
  284. <!-- <el-form-item label="过节费" prop="specialAllowance" :label-width="formLabelWidth">
  285. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.specialAllowance"></el-input-number>
  286. </el-form-item> -->
  287. <!-- <el-form-item label="其他补贴" prop="otherSubsidies" :label-width="formLabelWidth">
  288. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherSubsidies"></el-input-number>
  289. </el-form-item> -->
  290. <el-form-item label="餐补" prop="mealsupplement" :label-width="formLabelWidth">
  291. <el-popover
  292. placement="top"
  293. width="412"
  294. trigger="hover">
  295. <el-table height="500px" :border="border" :data="transfer">
  296. <el-table-column width="80" property="SubType" label="请假类型"></el-table-column>
  297. <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="开始时间"></el-table-column>
  298. <el-table-column width="100" property="EndTimeDt" :formatter="rounddadyjieshu" label="结束时间"></el-table-column>
  299. <el-table-column width="50" property="Duration" label="时长"></el-table-column>
  300. <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
  301. <!-- <el-table-column width="80" property="Deduction" label="扣款金额" :formatter="rounding"></el-table-column> -->
  302. </el-table>
  303. <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.mealsupplement">
  304. <span slot="reference"></span>
  305. </el-input-number>
  306. </el-popover>
  307. </el-form-item>
  308. <el-form-item label="其他应付" prop="otherHandle" :label-width="formLabelWidth">
  309. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherHandle"></el-input-number>
  310. </el-form-item>
  311. </div>
  312. <div class="payroll-inif">
  313. <el-form-item label="代扣保险" prop="withholdingInsurance" :label-width="formLabelWidth">
  314. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.withholdingInsurance"></el-input-number>
  315. </el-form-item>
  316. <el-form-item label="代扣公积金" prop="reservedFunds" :label-width="formLabelWidth">
  317. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.reservedFunds"></el-input-number>
  318. </el-form-item>
  319. <el-form-item label="代缴个税" prop="withholdingTax" :label-width="formLabelWidth">
  320. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.withholdingTax"></el-input-number>
  321. </el-form-item>
  322. </div>
  323. <div class="remark-box">
  324. <el-form-item label="其他扣款" prop="otherDeductions" :label-width="formLabelWidth">
  325. <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherDeductions"></el-input-number>
  326. <span class="ps-box">* 其他扣款 = 罚款 + 其他扣款;具体各项金额请在备注里描述。</span>
  327. </el-form-item>
  328. </div>
  329. <!-- <div style="margin: 0 80px;text-align: right;margin-bottom: 5px;">
  330. <el-button type="primary">获取企微假勤</el-button>
  331. </div> -->
  332. <div class="leave-inif">
  333. <el-form-item label="应出勤天数" :label-width="formLabelWidth">
  334. <span>{{salaryinif.workDays}}</span>
  335. </el-form-item>
  336. <el-form-item label="正常出勤天数" :label-width="formLabelWidth">
  337. <span>{{salaryinif.regularDays}}</span>
  338. </el-form-item>
  339. </div>
  340. <div class="leave-inif">
  341. <el-form-item label="事假" :label-width="formLabelWidth">
  342. <el-popover
  343. placement="top"
  344. width="412"
  345. trigger="hover">
  346. <el-table height="200px" :border="border" :data="leave">
  347. <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="开始时间"></el-table-column>
  348. <el-table-column width="100" property="EndTimeDt" :formatter="rounddadyjieshu" label="结束时间"></el-table-column>
  349. <el-table-column width="50" property="Duration" label="时长"></el-table-column>
  350. <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
  351. <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
  352. </el-table>
  353. <span slot="reference">{{salaryinif.somethingFalse.toFixed(2)}}</span>
  354. </el-popover>
  355. </el-form-item>
  356. <el-form-item label="病假" :label-width="formLabelWidth">
  357. <el-popover
  358. placement="top"
  359. width="412"
  360. trigger="hover">
  361. <div>
  362. <div>病假最低发放标准(月):1680=2100*0.8</div>
  363. <div>病假最低发放标准(天):1680/{{salaryinif.workDays}}(工作日)≈{{ (1680/salaryinif.workDays).toFixed(2) }}</div>
  364. <div>病假最低发放标准(小时):1680/{{salaryinif.workDays}}(工作日)/7.5(小时)≈{{ (1680/salaryinif.workDays/7.5).toFixed(2) }}</div>
  365. <span style="color:red;">
  366. 员工在病假医疗期限内的病假工资按照成都市最低工资标准的 80%发放
  367. </span>
  368. </div>
  369. <el-table height="200px" :border="border" :data="sickleave">
  370. <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="开始时间"></el-table-column>
  371. <el-table-column width="100" property="EndTimeDt" :formatter="rounddadyjieshu" label="结束时间"></el-table-column>
  372. <el-table-column width="50" property="Duration" label="时长"></el-table-column>
  373. <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
  374. <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
  375. </el-table>
  376. <span slot="reference">{{salaryinif.sickLeave.toFixed(2)}}</span>
  377. </el-popover>
  378. </el-form-item>
  379. <el-form-item label="迟到" :label-width="formLabelWidth">
  380. <el-popover
  381. placement="top"
  382. width="382"
  383. trigger="hover">
  384. <el-table height="200px" :border="border" :data="late">
  385. <el-table-column width="170" property="StartTimeDt" :formatter="rounddadykaishi" label="迟到时间"></el-table-column>
  386. <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
  387. <el-table-column width="50" property="Duration" label="时长"></el-table-column>
  388. <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
  389. <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
  390. </el-table>
  391. <span slot="reference">{{salaryinif.lateTo.toFixed(2)}}</span>
  392. </el-popover>
  393. </el-form-item>
  394. <el-form-item label="早退" :label-width="formLabelWidth">
  395. <el-popover
  396. placement="top"
  397. width="412"
  398. trigger="hover">
  399. <el-table height="200px" :border="border" :data="early">
  400. <el-table-column width="150" property="StartTimeDt" :formatter="rounddadykaishi" label="早退时间"></el-table-column>
  401. <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
  402. <el-table-column width="100" property="Duration" label="时长"></el-table-column>
  403. <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
  404. <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
  405. </el-table>
  406. <span slot="reference">{{salaryinif.leaveEarly.toFixed(2)}}</span>
  407. </el-popover>
  408. </el-form-item>
  409. <el-form-item label="旷工" :label-width="formLabelWidth">
  410. <el-popover
  411. placement="top"
  412. width="512"
  413. trigger="hover">
  414. <el-table height="200px" :border="border" :data="absenteeism">
  415. <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="旷工日期"></el-table-column>
  416. <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
  417. <el-table-column width="50" property="Duration" label="时长"></el-table-column>
  418. <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
  419. <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
  420. <el-table-column width="200" property="Reason" label="原因"></el-table-column>
  421. </el-table>
  422. <span class="sx" slot="reference">{{salaryinif.absenteeism.toFixed(2)}}</span>
  423. </el-popover>
  424. </el-form-item>
  425. <el-form-item class="biaoji" label="补卡" :label-width="formLabelWidth">
  426. <el-popover
  427. placement="top"
  428. width="512"
  429. trigger="hover">
  430. <el-table height="200px" :border="border" :data="notout">
  431. <el-table-column width="200" property="StartTimeDt" :formatter="rounddadykaishi" label="补卡时间"></el-table-column>
  432. <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
  433. <!-- <el-table-column width="50" property="Duration" label="时长"></el-table-column> -->
  434. <!-- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column> -->
  435. <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
  436. <el-table-column width="230" property="Reason" label="原因"></el-table-column>
  437. </el-table>
  438. <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.notPunch">
  439. <span slot="reference"></span>
  440. </el-input-number>
  441. <!-- <span slot="reference">{{salaryinif.notPunch.toFixed(2)}}</span> -->
  442. </el-popover>
  443. </el-form-item>
  444. </div>
  445. <div class="salary-payments">
  446. <el-form-item label="应发合计" :label-width="formLabelWidth">
  447. <span>{{salaryinif.should.toFixed(2)}}</span>
  448. </el-form-item>
  449. <el-form-item label="扣款合计" :label-width="formLabelWidth">
  450. <span>{{salaryinif.totalDeductions.toFixed(2)}}</span>
  451. </el-form-item>
  452. <el-form-item label="税前合计" :label-width="formLabelWidth">
  453. <span>{{salaryinif.beforeTax.toFixed(2)}}</span>
  454. </el-form-item>
  455. <el-form-item label="税后合计" :label-width="formLabelWidth">
  456. <span>{{salaryinif.totalRealHair.toFixed(2)}}</span>
  457. </el-form-item>
  458. </div>
  459. <div class="remark-box">
  460. <el-form-item label="备注" :label-width="formLabelWidth">
  461. <el-input :rows="6" type="textarea" v-model="salaryinif.remark"></el-input>
  462. </el-form-item>
  463. </div>
  464. </el-form>
  465. <div slot="footer" class="dialog-footer">
  466. <span class="ps-box">* 请先点击获取企微假勤,否则将无法保存或修改。</span>
  467. <el-button type="primary" @click="submitForm('salaryinif')">获取当月企微假勤</el-button>
  468. <el-button v-if="disabled" type="primary" @click="salaryAD('修改','salaryinif')">确认修改</el-button>
  469. <el-button v-if="preserve" type="primary" @click="salaryAD('新增','salaryinif')">保 存</el-button>
  470. <el-button @click="dialogFormVisible = false">取 消</el-button>
  471. </div>
  472. </el-dialog>
  473. </div>
  474. </div>
  475. </template>
  476. <script>
  477. import { co, el } from '@fullcalendar/core/internal-common';
  478. export default {
  479. data() {
  480. return {
  481. limitNum: 1, // 上传excell时,同时允许上传的最大数
  482. fileList: [], // excel文件列表
  483. companyName:-1,//公司
  484. depName:'',//部门
  485. cnName:'',//员工
  486. gridTableVisible:false,
  487. fullscreenLoading:false,
  488. border:true,
  489. companylist:[],
  490. deplist:[],
  491. userlist:[],//全部员工
  492. comuserlist:[],//公司筛选员工
  493. loginuserid:'',
  494. value2:'',
  495. tableData: [],
  496. tableDatatwo: [],
  497. dialogTableVisible: false,
  498. dialogFormVisible: false,
  499. UploadTaxes:false,
  500. disabled:true,
  501. preserve:'',
  502. addaex_ItemsRemark:{},
  503. leave:[],//事假
  504. sickleave:[],//病假
  505. late:[],//迟到
  506. early:[],//早退
  507. transfer:[],//调休假
  508. absenteeism:[],//旷工
  509. notout:[],//补卡
  510. clicknot:false,//是否获取企业微信
  511. jsonstring:'',//企业微信json字符串
  512. //计算工资
  513. gridData:{
  514. yearMonth:"",//年月
  515. startDate:"",//工资日期 起
  516. endDate:"",//工资日期 止
  517. },
  518. gridrules:{
  519. yearMonth: [
  520. { type: 'date', required: true, trigger: 'blur',message:'选择年月' }
  521. ],
  522. startDate: [
  523. { type: 'date', required: true, trigger: 'blur',message:'选择工资日期起' }
  524. ],
  525. endDate: [
  526. { type: 'date', required: true, trigger: 'blur',message:'选择工资日期止' }
  527. ],
  528. },
  529. //上传个税
  530. TaxesData:{
  531. yearMonth:"",//年月
  532. },
  533. Taxesrules:{
  534. yearMonth: [
  535. { type: 'date', required: true, trigger: 'blur',message:'选择年月' }
  536. ],
  537. },
  538. //薪资详细
  539. salaryinif:{
  540. // regularization: true,//是否转正
  541. userId:"",//员工Id
  542. name:"",//姓名
  543. yearMonth:"",//年月
  544. startDate:"",//工资日期 起
  545. endDate:"",//工资日期 止
  546. basic:0,//基本工资
  547. floats:0,//绩效工资
  548. postAllowance:0,//岗位津贴
  549. //garmentWashSubsidies:0,//服装洗理补贴
  550. //communicationSubsidies:0,// 通讯补贴
  551. otherSubsidies:0,// 月度补贴
  552. informationSecurityFee:0,// 保密费
  553. //operationBonus:0,// 操作奖金
  554. //specialAllowance:0,// 特殊津贴
  555. //otherSubsidies:0,// 其他补贴
  556. withholdingInsurance:0,// 代扣保险
  557. mealsupplement:0,// 餐补
  558. reservedFunds:0,// 代扣公积金
  559. otherHandle:0,//其他应付
  560. //groupCost:0,// 部门集体团建费
  561. sickLeave:0,// 病假
  562. somethingFalse:0,// 事假
  563. lateTo:0,// 迟到
  564. leaveEarly:0,// 早退
  565. absenteeism:0,//旷工
  566. notPunch:0,//补卡
  567. otherDeductions:0,//其他扣款
  568. should:0,//应发合计
  569. workDays:0,//应出勤天数
  570. regularDays:0,//正常出勤天数
  571. totalDeductions:0,//扣款合计
  572. totalRealHair:0,//实发合计
  573. withholdingTax:0,//代扣个税
  574. afterTax:0,//税后工资
  575. isLock:0,//锁定标识
  576. lastUpdateUserId:"",//最后操作人
  577. lastUpdateUserName:"",//最后操作人Name
  578. lastUpdateDt:"",//最后操作时间
  579. remark:"",//备注
  580. beforeTax:0//税前合计
  581. },
  582. rules: {
  583. userId: [
  584. { required: true, trigger: 'blur' }
  585. ],
  586. yearMonth: [
  587. { type: 'date', required: true, trigger: 'blur' }
  588. ],
  589. startDate: [
  590. { type: 'date', required: true, trigger: 'blur' }
  591. ],
  592. endDate: [
  593. { type: 'date', required: true, trigger: 'blur' }
  594. ],
  595. basic: [
  596. { required: true, trigger: 'blur' },
  597. ],
  598. floats: [
  599. { required: true, trigger: 'blur' },
  600. ],
  601. postAllowance: [
  602. { required: true, trigger: 'blur' },
  603. ],
  604. // garmentWashSubsidies: [
  605. // { required: true, trigger: 'blur' },
  606. // ],
  607. // communicationSubsidies: [
  608. // { required: true, trigger: 'blur' },
  609. // ],
  610. otherSubsidies: [
  611. { required: true, trigger: 'blur' },
  612. ],
  613. otherHandle:[
  614. {required:true,trigger:'blur'}
  615. ],
  616. informationSecurityFee: [
  617. { required: true, trigger: 'blur' },
  618. ],
  619. // operationBonus: [
  620. // { required: true, trigger: 'blur' },
  621. // ],
  622. // otherSubsidies: [
  623. // { required: true, trigger: 'blur' },
  624. // ],
  625. // groupCost: [
  626. // { required: true, trigger: 'blur' },
  627. // ],
  628. // specialAllowance: [
  629. // { required: true, trigger: 'blur' },
  630. // ],
  631. mealsupplement: [
  632. { required: true, trigger: 'blur' },
  633. ],
  634. withholdingInsurance: [
  635. { required: true, trigger: 'blur' },
  636. ],
  637. reservedFunds: [
  638. { required: true, trigger: 'blur' },
  639. ],
  640. withholdingTax: [
  641. { required: true, trigger: 'blur' },
  642. ],
  643. otherDeductions: [
  644. { required: true, trigger: 'blur' },
  645. ],
  646. },
  647. form: {
  648. name: '',
  649. region: '',
  650. },
  651. formLabelWidth: '110px'
  652. }
  653. },
  654. methods:{
  655. submitForm(formName) {
  656. console.log(this.$refs[formName])
  657. this.$refs[formName].validate((valid) => {
  658. if (valid) {
  659. // alert('submit!');
  660. // this.clicknot=true;
  661. this.$confirm('是否获取企业微信假勤!', '提示', {
  662. confirmButtonText: '确定',
  663. cancelButtonText: '取消',
  664. type: 'warning'
  665. }).then(() => {
  666. this.SalaryCalculatorSingle();
  667. }).catch(()=>{})
  668. } else {
  669. this.$message.error('请将红框内容补全!');
  670. return false;
  671. }
  672. });
  673. },
  674. Rangetime(){
  675. console.log('2023-10' instanceof Date)
  676. console.log(this.salaryinif.startDate instanceof Date)
  677. },
  678. getnewDate(){
  679. let nowDate = new Date()
  680. let date = {
  681. year: nowDate.getFullYear(),
  682. month: nowDate.getMonth() + 1,
  683. date: nowDate.getDate()
  684. }
  685. console.log(date.year + '-' + date.month)
  686. this.value2=date.year + '-' + date.month;
  687. this.GetWageSheetList();
  688. },
  689. //获取员工
  690. GetWageSheetBasicsDataSource(){
  691. var url = "/api/PersonnelModule/GetWageSheetBasicsDataSource"
  692. var that = this
  693. this.$axios({
  694. method: 'post',
  695. url: url,
  696. headers: {
  697. Authorization: 'Bearer ' + this.token
  698. }
  699. }).then(function (res) {
  700. if(res.data.code==200){
  701. console.log(res)
  702. console.log(res.data.data)
  703. that.userlist=res.data.data.userNames;
  704. that.companylist=res.data.data.compnayData;
  705. that.companylist.push(
  706. {companyName:'全部',id:-1}
  707. )
  708. }else{
  709. that.$message({
  710. message: '加载失败!原因:'+res.data.msg,
  711. type: 'warning'
  712. });
  713. }
  714. })
  715. },
  716. //薪资列表
  717. GetWageSheetList(){
  718. this.fullscreenLoading = true;
  719. var url = "/api/PersonnelModule/GetWageSheetList"
  720. var that = this
  721. console.log(that.value2)
  722. this.$axios({
  723. method: 'post',
  724. url: url,
  725. headers: {
  726. Authorization: 'Bearer ' + this.token
  727. },
  728. data:{
  729. portType: 1,
  730. yearMonth: that.value2,
  731. }
  732. }).then(function (res) {
  733. that.tableData=[];
  734. if(res.data.code==200){
  735. console.log(res)
  736. that.tableData=res.data.data;
  737. that.tableDatatwo=that.tableData;
  738. console.log(that.tableData)
  739. that.fullscreenLoading = false;
  740. }else{
  741. that.fullscreenLoading = false;
  742. that.$message({
  743. message: '加载失败!原因:'+res.data.msg,
  744. type: 'warning'
  745. });
  746. }
  747. })
  748. },
  749. //日期处理(日)
  750. TimeProcessingri(val){
  751. if(val instanceof Date){
  752. let newsyear=val.getFullYear();
  753. let newsMonth=val.getMonth() + 1;
  754. let newsday=val.getDate();
  755. if((val.getMonth() + 1)<10){
  756. newsMonth='0'+newsMonth
  757. }else{
  758. newsMonth=val.getMonth() + 1
  759. }
  760. if(val.getDate()<10){
  761. newsday=newsday='0'+newsday
  762. }else{
  763. newsday=val.getDate()
  764. }
  765. return newsyear+ '-' +newsMonth+ '-' + newsday;
  766. }else{
  767. return val
  768. }
  769. },
  770. //日期处理(月)
  771. TimeProcessingyue(val){
  772. if(val instanceof Date){
  773. let newsyear=val.getFullYear();
  774. let newsMonth=val.getMonth() + 1;
  775. if((val.getMonth() + 1)<10){
  776. newsMonth='0'+newsMonth
  777. }else{
  778. newsMonth=val.getMonth() + 1
  779. }
  780. return newsyear+ '-' +newsMonth;
  781. }else{
  782. return val
  783. }
  784. },
  785. //时间切换
  786. PickTime(){
  787. this.tableDatatwo=[];
  788. this.companyName=-1;
  789. this.cnName='';
  790. let newyear=this.value2.getFullYear();
  791. let newMonth=this.value2.getMonth() + 1;
  792. if((this.value2.getMonth() + 1)<10){
  793. newMonth='0'+newMonth
  794. }else{
  795. newMonth=this.value2.getMonth() + 1
  796. }
  797. this.value2=newyear+ '-' +newMonth;
  798. console.log(this.value2)
  799. this.GetWageSheetList();
  800. },
  801. //薪资详细
  802. SalaryDetails(index, row){
  803. if (this.$refs.salaryinif){
  804. this.$nextTick(() => {
  805. this.$refs['salaryinif'].clearValidate();
  806. })
  807. }
  808. // this.clicknot=false;
  809. this.leave=[];//事假
  810. this.sickleave=[];//病假
  811. this.late=[];//迟到
  812. this.early=[];//早退
  813. this.transfer=[];//调休假
  814. this.absenteeism=[];//旷工
  815. this.notout=[];//补卡
  816. this.dialogFormVisible = true;
  817. this.disabled=true;
  818. this.preserve=false;
  819. console.log(row.id)
  820. var url = "/api/PersonnelModule/GetWageSheetById"
  821. var that = this
  822. this.$axios({
  823. method: 'post',
  824. url: url,
  825. headers: {
  826. Authorization: 'Bearer ' + this.token
  827. },
  828. data:{
  829. portType: 1,
  830. id: row.id,
  831. }
  832. }).then(function (res) {
  833. if(res.data.code==200){
  834. console.log(res)
  835. that.salaryinif=res.data.data;
  836. that.salaryinif.yearMonth=new Date(res.data.data.yearMonth);
  837. that.salaryinif.startDate=new Date(res.data.data.startDate);
  838. that.salaryinif.endDate=new Date(res.data.data.endDate);
  839. that.jsonstring=res.data.data.ex_ItemsRemark;
  840. that.salaryinif.beforeTax=res.data.data.beforeTax;
  841. if(res.data.data.ex_ItemsRemark!=''){
  842. let ItemsRemark=JSON.parse(res.data.data.ex_ItemsRemark);
  843. console.log(ItemsRemark)
  844. let jiaqininif;
  845. let dakainif;
  846. for(let i=0;i<ItemsRemark.length;i++){
  847. if(ItemsRemark[i].Type=='假勤'){
  848. jiaqininif=ItemsRemark[i]
  849. }
  850. if(ItemsRemark[i].Type=='打卡'){
  851. dakainif=ItemsRemark[i]
  852. }
  853. }
  854. console.log(jiaqininif)
  855. console.log(dakainif)
  856. if(jiaqininif!=undefined){
  857. for(let j=0;j<jiaqininif.Ex_ItemInfo.length;j++){
  858. if(jiaqininif.Ex_ItemInfo[j].SubType=="事假"){
  859. that.leave.push(jiaqininif.Ex_ItemInfo[j])
  860. }
  861. if(jiaqininif.Ex_ItemInfo[j].SubType=="病假"){
  862. that.sickleave.push(jiaqininif.Ex_ItemInfo[j])
  863. }
  864. if(jiaqininif.Ex_ItemInfo[j].SubType=="调休假"||jiaqininif.Ex_ItemInfo[j].SubType=="年假"||jiaqininif.Ex_ItemInfo[j].SubType=="婚假"||jiaqininif.Ex_ItemInfo[j].SubType=="产假"||jiaqininif.Ex_ItemInfo[j].SubType=="陪产假"||jiaqininif.Ex_ItemInfo[j].SubType=="丧假"||jiaqininif.Ex_ItemInfo[j].SubType=="出差"){
  865. that.transfer.push(jiaqininif.Ex_ItemInfo[j])
  866. }
  867. }
  868. }
  869. console.log(that.transfer)
  870. if(dakainif!=undefined){
  871. for(let x=0;x<dakainif.Ex_ItemInfo.length;x++){
  872. if(dakainif.Ex_ItemInfo[x].SubType=="迟到"){
  873. that.late.push(dakainif.Ex_ItemInfo[x])
  874. }
  875. if(dakainif.Ex_ItemInfo[x].SubType=="早退"){
  876. that.early.push(dakainif.Ex_ItemInfo[x])
  877. }
  878. if(dakainif.Ex_ItemInfo[x].SubType=="旷工"){
  879. that.absenteeism.push(dakainif.Ex_ItemInfo[x])
  880. }
  881. if(dakainif.Ex_ItemInfo[x].SubType=="打卡补卡"){
  882. that.notout.push(dakainif.Ex_ItemInfo[x])
  883. }
  884. }
  885. }
  886. console.log(that.late)
  887. }
  888. }else{
  889. that.$message({
  890. message: '加载失败!原因:'+res.data.msg,
  891. type: 'warning'
  892. });
  893. }
  894. })
  895. },
  896. //薪资(新增,修改)API
  897. PostWageSheetAddOrEdit(inif){
  898. console.log(inif)
  899. var url = "/api/PersonnelModule/PostWageSheetAddOrEdit"
  900. var that = this
  901. this.$axios({
  902. method: 'post',
  903. url: url,
  904. headers: {
  905. Authorization: 'Bearer ' + this.token
  906. },
  907. data:{
  908. status:inif.statuss,
  909. createUserId:that.loginuserid,
  910. userId:that.salaryinif.userId,
  911. id:inif.ids,
  912. remark:that.salaryinif.remark,
  913. yearMonth:that.TimeProcessingyue(that.salaryinif.yearMonth),
  914. startDate:that.TimeProcessingri(that.salaryinif.startDate),
  915. endDate:that.TimeProcessingri(that.salaryinif.endDate),
  916. basic:that.salaryinif.basic,
  917. floats:that.salaryinif.floats,
  918. postAllowance:that.salaryinif.postAllowance,
  919. // garmentWashSubsidies:that.salaryinif.garmentWashSubsidies,
  920. // communicationSubsidies:that.salaryinif.communicationSubsidies,
  921. otherSubsidies:that.salaryinif.otherSubsidies,
  922. otherHandle:that.salaryinif.otherHandle,
  923. informationSecurityFee:that.salaryinif.informationSecurityFee,
  924. // operationBonus:that.salaryinif.operationBonus,
  925. // specialAllowance:that.salaryinif.specialAllowance,
  926. // otherSubsidies:that.salaryinif.otherSubsidies,
  927. withholdingInsurance:that.salaryinif.withholdingInsurance,
  928. mealsupplement:that.salaryinif.mealsupplement,
  929. reservedFunds:that.salaryinif.reservedFunds,
  930. // groupCost:that.salaryinif.groupCost,
  931. sickLeave:that.salaryinif.sickLeave,
  932. somethingFalse:that.salaryinif.somethingFalse,
  933. lateTo:that.salaryinif.lateTo,
  934. leaveEarly:that.salaryinif.leaveEarly,
  935. absenteeism:that.salaryinif.absenteeism,
  936. notPunch:that.salaryinif.notPunch,
  937. otherDeductions:that.salaryinif.otherDeductions,
  938. should:that.salaryinif.should,
  939. totalDeductions:that.salaryinif.totalDeductions,
  940. totalRealHair:that.salaryinif.totalRealHair,
  941. withholdingTax:that.salaryinif.withholdingTax,
  942. afterTax:that.salaryinif.afterTax,
  943. workDays:that.salaryinif.workDays,
  944. regularDays:that.salaryinif.regularDays,
  945. ex_ItemsRemark:that.jsonstring
  946. }
  947. }).then(function (res) {
  948. if(res.data.code==200){
  949. console.log(res)
  950. that.GetWageSheetList();
  951. that.$message({
  952. message: res.data.msg,
  953. type: 'success'
  954. });
  955. }else{
  956. that.$message({
  957. message: '操作失败!原因:'+res.data.msg,
  958. type: 'warning'
  959. });
  960. }
  961. })
  962. },
  963. //薪资(新增,修改)
  964. salaryAD(text,formName){
  965. this.$refs[formName].validate((valid) => {
  966. if (valid) {
  967. // alert('submit!');
  968. this.dialogFormVisible = false;
  969. let inifadd={
  970. statuss:'',
  971. userIds:'',
  972. ids:''
  973. }
  974. if(text=='新增'){
  975. inifadd.statuss=1;
  976. inifadd.userIds=0;
  977. inifadd.ids=0;
  978. this.PostWageSheetAddOrEdit(inifadd)
  979. }else if(text=='修改'){
  980. inifadd.statuss=2;
  981. inifadd.userIds=this.salaryinif.userId;
  982. inifadd.ids=this.salaryinif.id;
  983. this.PostWageSheetAddOrEdit(inifadd)
  984. }
  985. } else {
  986. this.$message.error('请将红框内容补全!');
  987. return false;
  988. }
  989. });
  990. },
  991. //新增薪资
  992. addsalary(){
  993. // console.log(this.$refs.salaryinif)
  994. if (this.$refs.salaryinif){
  995. this.$nextTick(() => {
  996. this.$refs['salaryinif'].clearValidate();
  997. })
  998. }
  999. this.leave=[];//事假
  1000. this.sickleave=[];//病假
  1001. this.late=[];//迟到
  1002. this.early=[];//早退
  1003. this.transfer=[];//调休假
  1004. this.absenteeism=[];//旷工
  1005. this.notout=[];//补卡
  1006. let myDate = new Date(this.value2);
  1007. let month = myDate.getMonth() + 1;
  1008. month = month < 10 ? "0" + month : month; //格式化月份,补0
  1009. let statDateStart = new Date(myDate.getFullYear().toString() +'-'+ month +'-'+ "01"); //月初
  1010. let dayEnd = new Date(myDate.getFullYear(), month, 0).getDate(); //获取当月一共有多少天
  1011. let statDateEnd = new Date(myDate.getFullYear().toString() +'-'+ month +'-'+ dayEnd); //月末
  1012. // this.clicknot=false;
  1013. this.dialogFormVisible = true;
  1014. this.disabled=false;
  1015. this.preserve=true;
  1016. this.salaryinif={
  1017. // regularization:true,
  1018. userId:"",//员工Id
  1019. name:"",//姓名
  1020. yearMonth:new Date(this.value2),//年月
  1021. startDate:statDateStart,//工资日期 起
  1022. endDate:statDateEnd,//工资日期 止
  1023. basic:0,//基本工资
  1024. floats:0,//绩效工资
  1025. postAllowance:0,//岗位津贴
  1026. // garmentWashSubsidies:0,//服装洗理补贴
  1027. // communicationSubsidies:0,// 通讯补贴
  1028. otherSubsidies:0,// 月度补贴
  1029. otherHandle:0,//其他应付
  1030. informationSecurityFee:0,// 保密费
  1031. // operationBonus:0,// 操作奖金
  1032. // specialAllowance:0,// 特殊津贴
  1033. // otherSubsidies:0,// 其他补贴
  1034. withholdingInsurance:0,// 代扣保险
  1035. mealsupplement:0,// 餐补
  1036. reservedFunds:0,// 代扣公积金
  1037. // groupCost:0,// 部门集体团建费
  1038. sickLeave:0,// 病假
  1039. somethingFalse:0,// 事假
  1040. lateTo:0,// 迟到
  1041. leaveEarly:0,// 早退
  1042. absenteeism:0,//旷工
  1043. notPunch:0,//补卡
  1044. otherDeductions:0,//其他扣款
  1045. should:0,//应发合计
  1046. workDays:0,//应出勤天数
  1047. regularDays:0,//正常出勤天数
  1048. totalDeductions:0,//扣款合计
  1049. totalRealHair:0,//实发合计
  1050. withholdingTax:0,//代扣个税
  1051. afterTax:0,//税后工资
  1052. isLock:0,//锁定标识
  1053. lastUpdateUserId:"",//最后操作人
  1054. lastUpdateUserName:"",//最后操作人Name
  1055. lastUpdateDt:"",//最后操作时间
  1056. remark:"",//备注
  1057. beforeTax:0,//税前合计
  1058. };
  1059. },
  1060. //删除薪资列表
  1061. deleteaddsalary(index,row,rows){
  1062. this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
  1063. confirmButtonText: '确定',
  1064. cancelButtonText: '取消',
  1065. type: 'warning'
  1066. }).then(() => {
  1067. var url = "/api/PersonnelModule/PostWageSheetDel"
  1068. var that = this
  1069. this.$axios({
  1070. method: 'post',
  1071. url: url,
  1072. headers: {
  1073. Authorization: 'Bearer ' + this.token
  1074. },
  1075. data:{
  1076. userId:that.loginuserid,
  1077. id:row.id
  1078. }
  1079. }).then(function (res) {
  1080. if(res.data.code==200){
  1081. console.log(res)
  1082. that.$message({
  1083. message: res.data.msg,
  1084. type: 'success'
  1085. });
  1086. rows.splice(index, 1);
  1087. }else{
  1088. that.$message({
  1089. message: res.data.msg,
  1090. type: 'warning'
  1091. });
  1092. }
  1093. })
  1094. })
  1095. console.log(row)
  1096. },
  1097. //计算工资
  1098. SalaryCalculator(formName){
  1099. this.$refs[formName].validate((valid) => {
  1100. if (valid) {
  1101. this.fullscreenLoading=true;
  1102. var url = "/api/PersonnelModule/SalaryCalculator"
  1103. var that = this
  1104. this.$axios({
  1105. method: 'post',
  1106. url: url,
  1107. headers: {
  1108. Authorization: 'Bearer ' + this.token
  1109. },
  1110. data:{
  1111. userId:that.loginuserid,
  1112. yearMonth:that.TimeProcessingyue(that.gridData.yearMonth),
  1113. startDt:that.TimeProcessingri(that.gridData.startDate),
  1114. endDt:that.TimeProcessingri(that.gridData.endDate),
  1115. }
  1116. }).then(function (res) {
  1117. console.log(res)
  1118. if(res.data.code==200){
  1119. console.log(res)
  1120. that.value2=that.TimeProcessingyue(that.gridData.yearMonth);
  1121. that.gridTableVisible=false;
  1122. that.fullscreenLoading=false;
  1123. that.GetWageSheetList();
  1124. that.$message({
  1125. message: res.data.msg,
  1126. type: 'success'
  1127. });
  1128. }else{
  1129. that.value2=that.TimeProcessingyue(that.gridData.yearMonth);
  1130. that.gridTableVisible=false;
  1131. that.fullscreenLoading=false;
  1132. that.GetWageSheetList();
  1133. that.$message({
  1134. message: res.data.msg,
  1135. type: 'warning'
  1136. });
  1137. }
  1138. })
  1139. } else {
  1140. this.$message.error('请将红框内容补全!');
  1141. return false;
  1142. }
  1143. });
  1144. },
  1145. //打开计算工资
  1146. openSalaryCalculator(){
  1147. this.gridTableVisible=true;
  1148. this.gridData={
  1149. yearMonth:"",//年月
  1150. startDate:"",//工资日期 起
  1151. endDate:"",//工资日期 止
  1152. }
  1153. },
  1154. //获取企业微信假勤
  1155. SalaryCalculatorSingle(){
  1156. this.leave=[];//事假
  1157. this.sickleave=[];//病假
  1158. this.transfer=[];//调休假
  1159. this.late=[];//迟到
  1160. this.early=[];//早退
  1161. this.absenteeism=[];//旷工
  1162. this.notout=[];//补卡
  1163. console.log('jin')
  1164. var url = "/api/PersonnelModule/SalaryCalculatorSingle"
  1165. var that = this
  1166. this.fullscreenLoading = true;
  1167. this.$axios({
  1168. method: 'post',
  1169. url: url,
  1170. headers: {
  1171. Authorization: 'Bearer ' + this.token
  1172. },
  1173. data:{
  1174. userId:that.salaryinif.userId,
  1175. yearMonth:that.TimeProcessingyue(that.salaryinif.yearMonth),
  1176. startDate:that.TimeProcessingri(that.salaryinif.startDate),
  1177. endDate:that.TimeProcessingri(that.salaryinif.endDate),
  1178. basic:that.salaryinif.basic,
  1179. floats:that.salaryinif.floats,
  1180. postAllowance:that.salaryinif.postAllowance,
  1181. // garmentWashSubsidies:that.salaryinif.garmentWashSubsidies,
  1182. // communicationSubsidies:that.salaryinif.communicationSubsidies,
  1183. otherSubsidies:that.salaryinif.otherSubsidies,
  1184. informationSecurityFee:that.salaryinif.informationSecurityFee,
  1185. // operationBonus:that.salaryinif.operationBonus,
  1186. // specialAllowance:that.salaryinif.specialAllowance,
  1187. // otherSubsidies:that.salaryinif.otherSubsidies,
  1188. otherHandle:that.salaryinif.otherHandle,
  1189. withholdingInsurance:that.salaryinif.withholdingInsurance,
  1190. mealsupplement:that.salaryinif.mealsupplement,
  1191. withholdingTax:that.salaryinif.withholdingTax,
  1192. // groupCost:that.salaryinif.groupCost,
  1193. reservedFunds:that.salaryinif.reservedFunds,
  1194. withholdingInsurance:that.salaryinif.withholdingInsurance,
  1195. otherDeductions:that.salaryinif.otherDeductions,
  1196. }
  1197. }).then(function (res) {
  1198. console.log(res)
  1199. if(res.data.code==200){
  1200. that.fullscreenLoading = false;
  1201. console.log(res);
  1202. that.jsonstring=res.data.data.ex_ItemsRemark;
  1203. console.log(that.addaex_ItemsRemark)
  1204. that.salaryinif.somethingFalse=res.data.data.somethingFalse;
  1205. that.salaryinif.sickLeave=res.data.data.sickLeave;
  1206. that.salaryinif.lateTo=res.data.data.lateTo;
  1207. that.salaryinif.leaveEarly=res.data.data.leaveEarly;
  1208. that.salaryinif.absenteeism=res.data.data.absenteeism;
  1209. that.salaryinif.notPunch=res.data.data.notPunch;
  1210. that.salaryinif.should=res.data.data.should;
  1211. that.salaryinif.workDays=res.data.data.workDays;
  1212. that.salaryinif.regularDays=res.data.data.regularDays;
  1213. that.salaryinif.totalDeductions=res.data.data.totalDeductions;
  1214. that.salaryinif.afterTax=res.data.data.afterTax;
  1215. that.salaryinif.mealsupplement=res.data.data.mealsupplement;
  1216. that.salaryinif.beforeTax=res.data.data.beforeTax;
  1217. that.salaryinif.totalRealHair=res.data.data.totalRealHair;
  1218. if(res.data.data.ex_ItemsRemark!=''){
  1219. that.addaex_ItemsRemark=JSON.parse(res.data.data.ex_ItemsRemark);
  1220. let jiaqin;
  1221. let daka;
  1222. for(let i=0;i<that.addaex_ItemsRemark.length;i++){
  1223. if(that.addaex_ItemsRemark[i].Type=='假勤'){
  1224. jiaqin=that.addaex_ItemsRemark[i]
  1225. }
  1226. if(that.addaex_ItemsRemark[i].Type=='打卡'){
  1227. daka=that.addaex_ItemsRemark[i]
  1228. }
  1229. }
  1230. console.log(jiaqin)
  1231. console.log(daka)
  1232. if(jiaqin!=undefined){
  1233. for(let j=0;j<jiaqin.Ex_ItemInfo.length;j++){
  1234. if(jiaqin.Ex_ItemInfo[j].SubType=="事假"){
  1235. that.leave.push(jiaqin.Ex_ItemInfo[j])
  1236. }
  1237. if(jiaqin.Ex_ItemInfo[j].SubType=="病假"){
  1238. that.sickleave.push(jiaqin.Ex_ItemInfo[j])
  1239. }
  1240. if(jiaqin.Ex_ItemInfo[j].SubType=="调休假"||jiaqin.Ex_ItemInfo[j].SubType=="年假"||jiaqin.Ex_ItemInfo[j].SubType=="婚假"||jiaqin.Ex_ItemInfo[j].SubType=="产假"||jiaqin.Ex_ItemInfo[j].SubType=="陪产假"||jiaqin.Ex_ItemInfo[j].SubType=="丧假"||jiaqin.Ex_ItemInfo[j].SubType=="出差"){
  1241. that.transfer.push(jiaqin.Ex_ItemInfo[j])
  1242. }
  1243. }
  1244. }
  1245. console.log(that.transfer)
  1246. if(daka!=undefined){
  1247. for(let x=0;x<daka.Ex_ItemInfo.length;x++){
  1248. if(daka.Ex_ItemInfo[x].SubType=="迟到"){
  1249. that.late.push(daka.Ex_ItemInfo[x])
  1250. }
  1251. if(daka.Ex_ItemInfo[x].SubType=="早退"){
  1252. that.early.push(daka.Ex_ItemInfo[x])
  1253. }
  1254. if(daka.Ex_ItemInfo[x].SubType=="旷工"){
  1255. that.absenteeism.push(daka.Ex_ItemInfo[x])
  1256. }
  1257. if(daka.Ex_ItemInfo[x].SubType=="打卡补卡"){
  1258. that.notout.push(daka.Ex_ItemInfo[x])
  1259. }
  1260. }
  1261. }
  1262. that.GetWageSheetList();
  1263. that.$message({
  1264. message: res.data.msg,
  1265. type: 'success'
  1266. });
  1267. }
  1268. }else{
  1269. that.fullscreenLoading = false;
  1270. that.$message({
  1271. message: res.data.msg,
  1272. type: 'warning'
  1273. });
  1274. }
  1275. })
  1276. },
  1277. //保留两位小数
  1278. rounding(row,column) {
  1279. return parseFloat(row[column.property]).toFixed(2)
  1280. },
  1281. //处理时间
  1282. rounddadykaishi(val){
  1283. if(val.StartTimeDt.indexOf('T')!=-1){
  1284. return val.StartTimeDt.replace('T',' ')
  1285. }
  1286. },
  1287. rounddadyjieshu(val){
  1288. if(val.EndTimeDt.indexOf('T')!=-1){
  1289. return val.EndTimeDt.replace('T',' ')
  1290. }
  1291. },
  1292. //选择公司
  1293. companychange(){
  1294. this.cnName='';
  1295. this.tableDatatwo=[];
  1296. let tableDataone=[];
  1297. if(this.companyName!=-1){
  1298. for(let i=0;i<this.tableData.length;i++){
  1299. if(this.tableData[i].companyId==this.companyName){
  1300. tableDataone.push(this.tableData[i]);
  1301. }
  1302. }
  1303. this.tableDatatwo=tableDataone;
  1304. }else{
  1305. this.tableDatatwo=this.tableData;
  1306. }
  1307. },
  1308. //选择员工
  1309. cnNamechange(){
  1310. let tableDatatheer=[];
  1311. let tableDatafour=this.tableDatatwo;
  1312. if(this.cnName!=''){
  1313. for(let j=0;j<this.tableDatatwo.length;j++){
  1314. if(this.tableDatatwo[j].name.indexOf(this.cnName)!=-1){
  1315. tableDatatheer.push(this.tableDatatwo[j])
  1316. }
  1317. }
  1318. this.tableDatatwo=tableDatatheer;
  1319. }else{
  1320. this.companychange()
  1321. // this.tableDatatwo=this.tableDatatwo
  1322. }
  1323. },
  1324. //下载
  1325. Download(){
  1326. this.$confirm('请确认左上角的日期,是否要导出'+this.value2+'的工资单!', '提示', {
  1327. confirmButtonText: '确定',
  1328. cancelButtonText: '取消',
  1329. type: 'warning'
  1330. }).then(() => {
  1331. console.log(this.value2)
  1332. var url = "/api/PersonnelModule/ExportWageCard?yearMonth="+this.value2
  1333. var that = this
  1334. this.$axios({
  1335. method: 'post',
  1336. url: url,
  1337. headers: {
  1338. Authorization: 'Bearer ' + this.token
  1339. }
  1340. }).then(function (res) {
  1341. if(res.data.code==200){
  1342. console.log(res)
  1343. window.open(res.data.data.fileUrl);
  1344. that.$message({
  1345. message:res.data.msg,
  1346. type: 'success'
  1347. });
  1348. }else{
  1349. that.$message({
  1350. message: '导出失败!原因:'+res.data.msg,
  1351. type: 'warning'
  1352. });
  1353. }
  1354. }).catch(()=>{})
  1355. })
  1356. },
  1357. // 文件超出个数限制时的钩子
  1358. exceedFile(files, fileList) {
  1359. this.$message.warning(`只能选择 ${this.limitNum} 个文件,当前共选择了 ${files.length + fileList.length} 个`);
  1360. },
  1361. // 文件状态改变时的钩子
  1362. fileChange(file, fileList) {
  1363. console.log(file.raw);
  1364. this.fileList.push(file.raw) ;
  1365. console.log(this.fileList);
  1366. },
  1367. // 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传
  1368. beforeUploadFile(file) {
  1369. console.log('before upload');
  1370. console.log(file);
  1371. let extension = file.name.substring(file.name.lastIndexOf('.')+1);
  1372. let size = file.size / 1024 / 1024;
  1373. if(extension !== 'xlsx') {
  1374. this.$message.warning('只能上传后缀是.xlsx的文件');
  1375. }
  1376. if(size > 10) {
  1377. this.$message.warning('文件大小不得超过10M');
  1378. }
  1379. },
  1380. // 文件上传成功时的钩子
  1381. handleSuccess(res, file, fileList) {
  1382. this.$message.success('文件上传成功');
  1383. },
  1384. // 文件上传失败时的钩子
  1385. handleError(err, file, fileList) {
  1386. this.$message.error('文件上传失败');
  1387. },
  1388. UploadUrl:function(){
  1389. // 因为action参数是必填项,我们使用二次确认进行文件上传时,直接填上传文件的url会因为没有参数导致api报404,所以这里将action设置为一个返回为空的方法就行,避免抛错
  1390. return ""
  1391. },
  1392. uploadFile(formName) {
  1393. this.$refs[formName].validate((valid) => {
  1394. if (valid) {
  1395. if (this.fileList.length === 0){
  1396. this.$message.warning('请上传文件');
  1397. } else {
  1398. var form = new FormData();
  1399. form.append('file', this.fileList[0]);
  1400. // form.append('yearMonth', this.TaxesData.yearMonth);
  1401. console.log("wenjian"+this.fileList)
  1402. console.log(form)
  1403. var that = this
  1404. this.$axios({
  1405. method:"post",
  1406. url: "/api/PersonnelModule/UploadTax",
  1407. headers: {
  1408. 'Content-type': 'multipart/form-data',
  1409. Authorization: 'Bearer ' + this.token,
  1410. YearMonth: that.TimeProcessingyue(that.TaxesData.yearMonth)
  1411. },
  1412. data:form
  1413. }).then(function (res) {
  1414. console.log(res)
  1415. if(res.data.code==200){
  1416. console.log(res)
  1417. that.UploadTaxes=false;
  1418. that.value2=that.TimeProcessingyue(that.TaxesData.yearMonth)
  1419. that.GetWageSheetList();
  1420. that.$message({
  1421. message:res.data.msg,
  1422. type: 'success'
  1423. });
  1424. }else{
  1425. that.$message({
  1426. message: '上传失败!原因:'+res.data.msg,
  1427. type: 'warning'
  1428. });
  1429. }
  1430. }).catch(()=>{})
  1431. }
  1432. } else {
  1433. this.$message.error('请将红框内容补全!');
  1434. return false;
  1435. }
  1436. });
  1437. },
  1438. removelist(file, fileList){
  1439. console.log(file)
  1440. console.log(fileList)
  1441. console.log(this.fileList)
  1442. this.fileList=[]
  1443. },
  1444. //下载模板
  1445. DownloadTaxes(){
  1446. var url = "/api/PersonnelModule/WageSheetTaxTemplate"
  1447. var that = this
  1448. this.$axios({
  1449. method: 'post',
  1450. url: url,
  1451. headers: {
  1452. Authorization: 'Bearer ' + this.token
  1453. }
  1454. }).then(function (res) {
  1455. if(res.data.code==200){
  1456. console.log(res)
  1457. window.open(res.data.data.fileUrl);
  1458. that.$message({
  1459. message:res.data.msg,
  1460. type: 'success'
  1461. });
  1462. }else{
  1463. that.$message({
  1464. message: '下载失败!原因:'+res.data.msg,
  1465. type: 'warning'
  1466. });
  1467. }
  1468. }).catch(()=>{})
  1469. }
  1470. },
  1471. mounted(){
  1472. this.GetWageSheetBasicsDataSource()
  1473. this.loginuserid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  1474. this.getnewDate();
  1475. }
  1476. }
  1477. </script>
  1478. <style>
  1479. .payroll-all{
  1480. background-color: #fff;
  1481. padding: 10px;
  1482. box-shadow: 0 0 5px #0005;
  1483. border-radius: 10px;
  1484. height: 100%;
  1485. min-height: 830px;
  1486. }
  1487. .payroll-head-li label{
  1488. color: #606266;
  1489. font-size: 15px;
  1490. font-weight: 600;
  1491. }
  1492. .payroll-head-li{
  1493. margin-top: 5px;
  1494. }
  1495. .payroll-head{
  1496. display: flex;
  1497. justify-content: space-between;
  1498. flex-wrap: wrap;
  1499. margin-bottom: 20px;
  1500. }
  1501. .payroll-inif{
  1502. display: flex;
  1503. flex-wrap: wrap;
  1504. justify-content: space-between;
  1505. margin: 0 80px;
  1506. }
  1507. .payroll-inif .el-form-item{
  1508. width: 350px;
  1509. }
  1510. .payroll-inif .el-input-number--medium{
  1511. width: 218px;
  1512. }
  1513. .payroll-inif .el-form-item{
  1514. margin-bottom: 2px;
  1515. }
  1516. .payroll-inif .el-input--medium .el-input__inner{
  1517. text-align: left;
  1518. }
  1519. .leave-inif{
  1520. margin: 0 80px;
  1521. display: flex;
  1522. flex-wrap: wrap;
  1523. }
  1524. .leave-inif .el-form-item{
  1525. margin-bottom: 0px;
  1526. width: 24%;
  1527. }
  1528. .salary-payments{
  1529. display: flex;
  1530. flex-wrap: wrap;
  1531. margin: 0 80px;
  1532. }
  1533. .salary-payments .el-form-item{
  1534. margin-bottom: 0px;
  1535. font-size: 17px;
  1536. font-weight: 600;
  1537. width: 24%;
  1538. }
  1539. .payroll-all .el-dialog__body{
  1540. padding: 16px 20px;
  1541. }
  1542. .remark-box{
  1543. margin: 0 80px;
  1544. }
  1545. .payroll-inif .el-input--medium {
  1546. width: 218px;
  1547. }
  1548. .remark-box.el-form-item{
  1549. margin-bottom: 0px;
  1550. }
  1551. .remark-box .el-input--medium .el-input__inner{
  1552. text-align: left;
  1553. }
  1554. .remark-box .el-input-number--medium{
  1555. width: 218px;
  1556. text-align:left;
  1557. }
  1558. .ps-box{
  1559. font-size:12px ;
  1560. color: red;
  1561. }
  1562. .pan .el-form-item__error{
  1563. display: none;
  1564. }
  1565. .remark-box .el-textarea__inner{
  1566. width: 96.5%;
  1567. }
  1568. .payroll-all::-webkit-scrollbar-track-piece {
  1569. background-color: #f1f1f1;
  1570. }
  1571. .payroll-all::-webkit-scrollbar {
  1572. width: 10px;
  1573. height: 10px;
  1574. }
  1575. .payroll-all::-webkit-scrollbar-thumb {
  1576. background-color: #c1c1c1;
  1577. background-clip: padding-box;
  1578. min-height: 28px;
  1579. border-radius: 8px;
  1580. }
  1581. .payroll-all::-webkit-scrollbar-thumb:hover {
  1582. background-color: #a8a8a8;
  1583. }
  1584. .biaoji .el-input-number--medium{
  1585. width: 90px;
  1586. }
  1587. .biaoji .el-input--medium .el-input__inner{
  1588. text-align: left;
  1589. }
  1590. .payroll-all .el-dialog{
  1591. margin: 0 auto 23px;
  1592. }
  1593. </style>