Payroll.vue 77 KB

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