123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635 |
- <template>
- <div v-loading.fullscreen.lock="fullscreenLoading">
- <div class="payroll-all">
- <div class="payroll-head">
- <div style="display: flex;" class="payroll-head-li">
- <el-date-picker
- style="width: 120px;"
- v-model="value2"
- :clearable="false"
- type="month"
- placeholder="选择月"
- @change="PickTime()">
- </el-date-picker>
- <el-select style="width: 220px;margin-left: 10px;" @change="companychange()" v-model="companyName" filterable placeholder="请选择公司">
- <el-option
- v-for="item in companylist"
- :key="item.id"
- :label="item.companyName"
- :value="item.id">
- </el-option>
- </el-select>
- <!-- <el-select v-model="depName" filterable placeholder="请选择部门">
- <el-option
- v-for="item in deplist"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select> -->
- <el-input @input="cnNamechange()" style="width: 220px;margin-left: 10px;" v-model="cnName" placeholder="请输入员工姓名"></el-input>
- <!-- <el-select v-model="cnName" filterable placeholder="请选择员工">
- <el-option
- v-for="item in comuserlist"
- :key="item.id"
- :label="item.cnName"
- :value="item.id">
- </el-option>
- </el-select> -->
- </div>
- <div class="payroll-head-li">
- <el-button type="primary" @click="addsalary()">新增员工薪资结构</el-button>
- <el-button type="primary" @click="openSalaryCalculator()">计算当月工资</el-button>
- <el-button @click="Download()" type="primary">导出工资单</el-button>
- <el-button type="primary" @click="DownloadTaxes()">下载个税模板</el-button>
- <el-button type="primary" @click="UploadTaxes=true">上传个税</el-button>
- <!--<el-button type="primary">四川公司工资单</el-button>
- <el-button type="primary">纽茵公司工资单</el-button> -->
- </div>
- </div>
- <div class="payroll-table">
- <template>
- <el-table
- height="760"
- :data="tableDatatwo"
- border
- style="width: 100%">
- <el-table-column
- prop="row_Number"
- label="序号"
- width="50">
- </el-table-column>
- <el-table-column
- prop="yearMonth"
- label="年月"
- width="80">
- </el-table-column>
- <el-table-column
- prop="name"
- label="员工"
- width="80">
- </el-table-column>
- <el-table-column
- prop="companyName"
- label="公司"
- width="170">
- </el-table-column>
- <el-table-column
- label="假勤/打卡"
- width="85">
- <template slot-scope="scope">
- <el-popover
- v-if="scope.row.ex_ItemsRemark!=''"
- placement="right"
- width="150"
- trigger="hover">
- <div v-for="(items,index) in scope.row.ex_ItemsRemark!=''?JSON.parse(scope.row.ex_ItemsRemark):''" :key="index">
- <div v-if="items.Type=='假勤'">
- <div class="title-popover">{{items.Type}}({{(items.Ex_ItemInfo).length}})</div>
- <!-- <div class="title-content" v-for="(itemss,index) in items.Ex_ItemInfo" :key="index">
- 请假类型:{{itemss.SubType}}
- </div> -->
- </div>
- <div v-if="items.Type=='打卡'">
- <div class="title-popover">{{items.Type}}异常({{(items.Ex_ItemInfo).length}})</div>
- </div>
- <div v-if="items=='[]'">
- <div class="title-popover">本月无假勤</div>
- </div>
- </div>
- <div style="cursor: pointer;" slot="reference">移上查看</div>
- </el-popover>
- <el-popover
- v-if="scope.row.ex_ItemsRemark==''"
- placement="right"
- width="150"
- trigger="hover">
- <span>无考勤异常</span>
- <div style="cursor: pointer;" slot="reference">移上查看</div>
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column
- prop="startDate"
- label="起止日期"
- width="190">
- <template slot-scope="scope">
- <div>{{scope.row.startDate+'~'+scope.row.endDate}}</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="workDays"
- label="应出勤天数"
- width="95">
- </el-table-column>
- <!-- <el-table-column
- prop="regularDays"
- label="正常出勤天数"
- width="110">
- </el-table-column> -->
- <el-table-column
- prop="should"
- label="应发合计"
- width="90"
- :formatter="rounding">
- </el-table-column>
- <el-table-column
- prop="totalDeductions"
- label="扣款合计"
- width="90"
- :formatter="rounding">
- </el-table-column>
- <el-table-column
- prop="beforeTax"
- label="税前合计 "
- width="90"
- :formatter="rounding">
- </el-table-column>
- <el-table-column
- prop="withholdingTax"
- label="代缴个税"
- width="90"
- :formatter="rounding">
- </el-table-column>
- <el-table-column
- prop="totalRealHair"
- label="税后合计"
- width="90"
- :formatter="rounding">
- </el-table-column>
- <el-table-column
- prop="lastUpdateUserName"
- label="最后操作人"
- width="100">
- </el-table-column>
- <el-table-column
- prop="lastUpdateDt"
- label="最后时间"
- width="180">
- </el-table-column>
- <el-table-column
- prop="name"
- label="操 作"
- width="100">
- <!-- eslint-disable-next-line -->
- <template slot-scope="scope">
- <el-button type="text" @click="SalaryDetails(scope.$index, scope.row)">修改</el-button>
- <el-button style="color: red;" type="text" @click="deleteaddsalary(scope.$index,scope.row,tableDatatwo)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </template>
- </div>
- <!-- 上传个税 -->
- <el-dialog title="上传个税" width="400px" :visible.sync="UploadTaxes">
- <div>
- <el-form :model="TaxesData" ref="TaxesData" :rules="Taxesrules">
- <el-form-item label="年月" prop="yearMonth" label-width="50">
- <el-date-picker style="width:86%" v-model="TaxesData.yearMonth" size="medium" type="month" placeholder="选择月"></el-date-picker>
- </el-form-item>
- </el-form>
- <el-upload drag
- :limit=limitNum
- :auto-upload="false"
- accept=".xlsx"
- :action="UploadUrl()"
- :before-upload="beforeUploadFile"
- :on-change="fileChange"
- :on-exceed="exceedFile"
- :on-success="handleSuccess"
- :on-error="handleError"
- :on-remove="removelist"
- :file-list="fileList">
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- <div class="el-upload__tip" slot="tip">只能上传xlsx文件,且不超过10M</div>
- </el-upload>
- <br/>
- <el-button size="small" type="primary" @click="uploadFile('TaxesData')">立即上传</el-button>
- <el-button size="small">取消</el-button>
- </div>
- </el-dialog>
- <!-- 计算工资 -->
- <el-dialog :close-on-click-modal="false" width="380px" title="选择计算当月工资日期" :visible.sync="gridTableVisible">
- <el-form :model="gridData" ref="gridData" :rules="gridrules">
- <el-form-item label="年月" prop="yearMonth" :label-width="formLabelWidth">
- <el-date-picker v-model="gridData.yearMonth" size="medium" type="month" placeholder="选择月"></el-date-picker>
- </el-form-item>
- <el-form-item label="工资日期起" prop="startDate" :label-width="formLabelWidth">
- <el-date-picker v-model="gridData.startDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
- </el-form-item>
- <el-form-item label="工资日期止" prop="endDate" :label-width="formLabelWidth">
- <el-date-picker v-model="gridData.endDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="SalaryCalculator('gridData')">计 算</el-button>
- <el-button @click="gridTableVisible = false">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 修改新增 -->
- <el-dialog :close-on-click-modal="false" width="960px" class="pan" top="2.5vh" title="薪资详细信息" :visible.sync="dialogFormVisible">
- <el-form :model="salaryinif" ref="salaryinif" :rules="rules">
- <div class="payroll-inif">
- <el-form-item label="员工" prop="userId" :label-width="formLabelWidth">
- <el-select size="medium" style="height:36px" :disabled="disabled" v-model="salaryinif.userId" filterable placeholder="请选择">
- <el-option
- v-for="item in userlist"
- :key="item.id"
- :label="item.cnName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="是否转正" :label-width="formLabelWidth">
- <el-switch v-model="salaryinif.regularization" active-color="" inactive-color="">
- </el-switch>
- </el-form-item> -->
- <el-form-item label="年月" prop="yearMonth" :label-width="formLabelWidth">
- <el-date-picker @change="Rangetime()" v-model="salaryinif.yearMonth" size="medium" type="month" placeholder="选择月"></el-date-picker>
- </el-form-item>
- <el-form-item label="工资日期起" prop="startDate" :label-width="formLabelWidth">
- <el-date-picker v-model="salaryinif.startDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
- </el-form-item>
- <el-form-item label="工资日期止" prop="endDate" :label-width="formLabelWidth">
- <el-date-picker v-model="salaryinif.endDate" size="medium" type="date" placeholder="选择日期"></el-date-picker>
- </el-form-item>
- <el-form-item label="基本工资" prop="basic" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.basic"></el-input-number>
- </el-form-item>
- <el-form-item label="绩效工资" prop="floats" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.floats"></el-input-number>
- </el-form-item>
- <el-form-item label="岗位津贴" prop="postAllowance" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.postAllowance"></el-input-number>
- </el-form-item>
- <!-- <el-form-item label="服装洗理补贴" prop="garmentWashSubsidies" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.garmentWashSubsidies"></el-input-number>
- </el-form-item> -->
- <!-- <el-form-item label="通讯补贴" prop="communicationSubsidies" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.communicationSubsidies"></el-input-number>
- </el-form-item> -->
- <el-form-item label="月度补贴" prop="otherSubsidies" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherSubsidies"></el-input-number>
- </el-form-item>
- <el-form-item label="保密费" prop="informationSecurityFee" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.informationSecurityFee"></el-input-number>
- </el-form-item>
- <!-- <el-form-item label="操作奖金" prop="operationBonus" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.operationBonus"></el-input-number>
- </el-form-item> -->
- <!-- <el-form-item label="部门团建费" prop="groupCost" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.groupCost"></el-input-number>
- </el-form-item> -->
- <!-- <el-form-item label="过节费" prop="specialAllowance" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.specialAllowance"></el-input-number>
- </el-form-item> -->
- <!-- <el-form-item label="其他补贴" prop="otherSubsidies" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherSubsidies"></el-input-number>
- </el-form-item> -->
- <el-form-item label="餐补" prop="mealsupplement" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="412"
- trigger="hover">
- <el-table height="500px" :border="border" :data="transfer" :default-sort="{prop:'StartTimeDt',order:'ascending'}">
- <el-table-column width="80" property="SubType" label="请假类型"></el-table-column>
- <el-table-column :sortable="true" width="108" property="StartTimeDt" :formatter="rounddadykaishi" label="开始时间"></el-table-column>
- <el-table-column width="100" property="EndTimeDt" :formatter="rounddadyjieshu" label="结束时间"></el-table-column>
- <el-table-column width="50" property="Duration" label="时长"></el-table-column>
- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
- <!-- <el-table-column width="80" property="Deduction" label="扣款金额" :formatter="rounding"></el-table-column> -->
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.mealsupplement">
- <span slot="reference"></span>
- </el-input-number>
- </el-popover>
- </el-form-item>
- <el-form-item label="其他应付" prop="otherHandle" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherHandle"></el-input-number>
- </el-form-item>
-
- </div>
- <div class="payroll-inif">
- <el-form-item label="代扣保险" prop="withholdingInsurance" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.withholdingInsurance"></el-input-number>
- </el-form-item>
- <el-form-item label="代扣公积金" prop="reservedFunds" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.reservedFunds"></el-input-number>
- </el-form-item>
- <el-form-item label="代缴个税" prop="withholdingTax" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.withholdingTax"></el-input-number>
- </el-form-item>
- </div>
- <div class="remark-box">
- <el-form-item label="其他扣款" prop="otherDeductions" :label-width="formLabelWidth">
- <el-input-number :precision="2" size="medium" :controls="false" v-model="salaryinif.otherDeductions"></el-input-number>
- <span class="ps-box">* 其他扣款 = 罚款 + 其他扣款;具体各项金额请在备注里描述。</span>
- </el-form-item>
- </div>
- <!-- <div style="margin: 0 80px;text-align: right;margin-bottom: 5px;">
- <el-button type="primary">获取企微假勤</el-button>
- </div> -->
- <div class="leave-inif">
- <el-form-item label="应出勤天数" :label-width="formLabelWidth">
- <span>{{salaryinif.workDays}}</span>
- </el-form-item>
- <el-form-item label="正常出勤天数" :label-width="formLabelWidth">
- <span>{{salaryinif.regularDays}}</span>
- </el-form-item>
- </div>
- <div class="leave-inif">
- <el-form-item class="biaoji" label="事假" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="412"
- trigger="hover">
- <el-table height="200px" :border="border" :data="leave">
- <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="开始时间"></el-table-column>
- <el-table-column width="100" property="EndTimeDt" :formatter="rounddadyjieshu" label="结束时间"></el-table-column>
- <el-table-column width="50" property="Duration" label="时长"></el-table-column>
- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
- <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.somethingFalse">
- <span slot="reference"></span>
- </el-input-number>
- <!-- <span slot="reference">{{salaryinif.somethingFalse.toFixed(2)}}</span> -->
- </el-popover>
- </el-form-item>
- <el-form-item class="biaoji" label="病假" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="412"
- trigger="hover">
- <div>
- <div>病假最低发放标准(月):1680=2100*0.8</div>
- <div>病假最低发放标准(天):1680/{{salaryinif.workDays}}(工作日)≈{{ (1680/salaryinif.workDays).toFixed(2) }}</div>
- <div>病假最低发放标准(小时):1680/{{salaryinif.workDays}}(工作日)/7.5(小时)≈{{ (1680/salaryinif.workDays/7.5).toFixed(2) }}</div>
- <span style="color:red;">
- 员工在病假医疗期限内的病假工资按照成都市最低工资标准的 80%发放
- </span>
- </div>
- <el-table height="200px" :border="border" :data="sickleave">
- <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="开始时间"></el-table-column>
- <el-table-column width="100" property="EndTimeDt" :formatter="rounddadyjieshu" label="结束时间"></el-table-column>
- <el-table-column width="50" property="Duration" label="时长"></el-table-column>
- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
- <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.sickLeave">
- <span slot="reference"></span>
- </el-input-number>
- <!-- <span slot="reference">{{salaryinif.sickLeave.toFixed(2)}}</span> -->
- </el-popover>
- </el-form-item>
- <el-form-item class="biaoji" label="迟到" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="382"
- trigger="hover">
- <el-table height="200px" :border="border" :data="late">
- <el-table-column width="170" property="StartTimeDt" :formatter="rounddadykaishi" label="迟到时间"></el-table-column>
- <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
- <el-table-column width="50" property="Duration" label="时长"></el-table-column>
- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
- <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.lateTo">
- <span slot="reference"></span>
- </el-input-number>
- <!-- <span slot="reference">{{salaryinif.lateTo.toFixed(2)}}</span> -->
- </el-popover>
- </el-form-item>
- <el-form-item class="biaoji" label="早退" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="412"
- trigger="hover">
- <el-table height="200px" :border="border" :data="early">
- <el-table-column width="150" property="StartTimeDt" :formatter="rounddadykaishi" label="早退时间"></el-table-column>
- <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
- <el-table-column width="100" property="Duration" label="时长"></el-table-column>
- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
- <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.leaveEarly">
- <span slot="reference"></span>
- </el-input-number>
- <!-- <span slot="reference">{{salaryinif.leaveEarly.toFixed(2)}}</span> -->
- </el-popover>
- </el-form-item>
- <el-form-item class="biaoji" label="旷工" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="512"
- trigger="hover">
- <el-table height="200px" :border="border" :data="absenteeism">
- <el-table-column width="100" property="StartTimeDt" :formatter="rounddadykaishi" label="旷工日期"></el-table-column>
- <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
- <el-table-column width="50" property="Duration" label="时长"></el-table-column>
- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column>
- <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
- <el-table-column width="200" property="Reason" label="原因"></el-table-column>
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.absenteeism">
- <span slot="reference"></span>
- </el-input-number>
- <!-- <span class="sx" slot="reference">{{salaryinif.absenteeism.toFixed(2)}}</span> -->
- </el-popover>
- </el-form-item>
- <el-form-item class="biaoji" label="补卡" :label-width="formLabelWidth">
- <el-popover
- placement="top"
- width="512"
- trigger="hover">
- <el-table height="200px" :border="border" :data="notout">
- <el-table-column width="200" property="StartTimeDt" :formatter="rounddadykaishi" label="补卡时间"></el-table-column>
- <!-- <el-table-column width="100" property="EndTimeDt" label="结束时间"></el-table-column> -->
- <!-- <el-table-column width="50" property="Duration" label="时长"></el-table-column> -->
- <!-- <el-table-column width="80" property="Unit" label="时长单位"></el-table-column> -->
- <el-table-column width="80" property="Deduction" :formatter="rounding" label="扣款金额"></el-table-column>
- <el-table-column width="230" property="Reason" label="原因"></el-table-column>
- </el-table>
- <el-input-number slot="reference" :precision="2" size="medium" :controls="false" v-model="salaryinif.notPunch">
- <span slot="reference"></span>
- </el-input-number>
- <!-- <span slot="reference">{{salaryinif.notPunch.toFixed(2)}}</span> -->
- </el-popover>
- </el-form-item>
- </div>
- <div class="salary-payments">
- <el-form-item label="应发合计" :label-width="formLabelWidth">
- <span>{{salaryinif.should.toFixed(2)}}</span>
- </el-form-item>
- <el-form-item label="扣款合计" :label-width="formLabelWidth">
- <span>{{salaryinif.totalDeductions.toFixed(2)}}</span>
- </el-form-item>
- <el-form-item label="税前合计" :label-width="formLabelWidth">
- <span>{{salaryinif.beforeTax.toFixed(2)}}</span>
- </el-form-item>
- <el-form-item label="税后合计" :label-width="formLabelWidth">
- <span>{{salaryinif.totalRealHair.toFixed(2)}}</span>
- </el-form-item>
- </div>
- <div class="remark-box">
- <el-form-item label="备注" :label-width="formLabelWidth">
- <el-input :rows="6" type="textarea" v-model="salaryinif.remark"></el-input>
- </el-form-item>
- </div>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <span class="ps-box">* 请先点击获取企微假勤,否则将无法保存或修改。</span>
- <el-button type="primary" @click="submitForm('salaryinif')">获取当月企微假勤</el-button>
- <el-button v-if="disabled" type="primary" @click="salaryAD('修改','salaryinif')">确认修改</el-button>
- <el-button v-if="preserve" type="primary" @click="salaryAD('新增','salaryinif')">保 存</el-button>
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- import { co, el } from '@fullcalendar/core/internal-common';
- export default {
- data() {
- return {
- limitNum: 1, // 上传excell时,同时允许上传的最大数
- fileList: [], // excel文件列表
- companyName:-1,//公司
- depName:'',//部门
- cnName:'',//员工
- gridTableVisible:false,
- fullscreenLoading:false,
- border:true,
- companylist:[],
- deplist:[],
- userlist:[],//全部员工
- comuserlist:[],//公司筛选员工
- loginuserid:'',
- value2:'',
- tableData: [],
- tableDatatwo: [],
- dialogTableVisible: false,
- dialogFormVisible: false,
- UploadTaxes:false,
- disabled:true,
- preserve:'',
- addaex_ItemsRemark:{},
- leave:[],//事假
- sickleave:[],//病假
- late:[],//迟到
- early:[],//早退
- transfer:[],//调休假
- absenteeism:[],//旷工
- notout:[],//补卡
- clicknot:false,//是否获取企业微信
- jsonstring:'',//企业微信json字符串
- //计算工资
- gridData:{
- yearMonth:"",//年月
- startDate:"",//工资日期 起
- endDate:"",//工资日期 止
- },
- gridrules:{
- yearMonth: [
- { type: 'date', required: true, trigger: 'blur',message:'选择年月' }
- ],
- startDate: [
- { type: 'date', required: true, trigger: 'blur',message:'选择工资日期起' }
- ],
- endDate: [
- { type: 'date', required: true, trigger: 'blur',message:'选择工资日期止' }
- ],
- },
- //上传个税
- TaxesData:{
- yearMonth:"",//年月
- },
- Taxesrules:{
- yearMonth: [
- { type: 'date', required: true, trigger: 'blur',message:'选择年月' }
- ],
- },
- //薪资详细
- salaryinif:{
- // regularization: true,//是否转正
- userId:"",//员工Id
- name:"",//姓名
- yearMonth:"",//年月
- startDate:"",//工资日期 起
- endDate:"",//工资日期 止
- basic:0,//基本工资
- floats:0,//绩效工资
- postAllowance:0,//岗位津贴
- //garmentWashSubsidies:0,//服装洗理补贴
- //communicationSubsidies:0,// 通讯补贴
- otherSubsidies:0,// 月度补贴
- informationSecurityFee:0,// 保密费
- //operationBonus:0,// 操作奖金
- //specialAllowance:0,// 特殊津贴
- //otherSubsidies:0,// 其他补贴
- withholdingInsurance:0,// 代扣保险
- mealsupplement:0,// 餐补
- reservedFunds:0,// 代扣公积金
- otherHandle:0,//其他应付
- //groupCost:0,// 部门集体团建费
- sickLeave:0,// 病假
- somethingFalse:0,// 事假
- lateTo:0,// 迟到
- leaveEarly:0,// 早退
- absenteeism:0,//旷工
- notPunch:0,//补卡
- otherDeductions:0,//其他扣款
- should:0,//应发合计
- workDays:0,//应出勤天数
- regularDays:0,//正常出勤天数
- totalDeductions:0,//扣款合计
- totalRealHair:0,//实发合计
- withholdingTax:0,//代扣个税
- afterTax:0,//税后工资
- isLock:0,//锁定标识
- lastUpdateUserId:"",//最后操作人
- lastUpdateUserName:"",//最后操作人Name
- lastUpdateDt:"",//最后操作时间
- remark:"",//备注
- beforeTax:0//税前合计
- },
- rules: {
- userId: [
- { required: true, trigger: 'blur' }
- ],
- yearMonth: [
- { type: 'date', required: true, trigger: 'blur' }
- ],
- startDate: [
- { type: 'date', required: true, trigger: 'blur' }
- ],
- endDate: [
- { type: 'date', required: true, trigger: 'blur' }
- ],
- basic: [
- { required: true, trigger: 'blur' },
- ],
- floats: [
- { required: true, trigger: 'blur' },
- ],
- postAllowance: [
- { required: true, trigger: 'blur' },
- ],
- // garmentWashSubsidies: [
- // { required: true, trigger: 'blur' },
- // ],
- // communicationSubsidies: [
- // { required: true, trigger: 'blur' },
- // ],
- otherSubsidies: [
- { required: true, trigger: 'blur' },
- ],
- otherHandle:[
- {required:true,trigger:'blur'}
- ],
- informationSecurityFee: [
- { required: true, trigger: 'blur' },
- ],
- // operationBonus: [
- // { required: true, trigger: 'blur' },
- // ],
- // otherSubsidies: [
- // { required: true, trigger: 'blur' },
- // ],
- // groupCost: [
- // { required: true, trigger: 'blur' },
- // ],
- // specialAllowance: [
- // { required: true, trigger: 'blur' },
- // ],
- mealsupplement: [
- { required: true, trigger: 'blur' },
- ],
- withholdingInsurance: [
- { required: true, trigger: 'blur' },
- ],
- reservedFunds: [
- { required: true, trigger: 'blur' },
- ],
- withholdingTax: [
- { required: true, trigger: 'blur' },
- ],
- otherDeductions: [
- { required: true, trigger: 'blur' },
- ],
- },
- form: {
- name: '',
- region: '',
- },
- formLabelWidth: '110px'
- }
- },
- methods:{
- submitForm(formName) {
- console.log(this.$refs[formName])
- this.$refs[formName].validate((valid) => {
- if (valid) {
- // alert('submit!');
- // this.clicknot=true;
- this.$confirm('是否获取企业微信假勤!', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.SalaryCalculatorSingle();
- }).catch(()=>{})
- } else {
- this.$message.error('请将红框内容补全!');
- return false;
- }
- });
- },
- Rangetime(){
- console.log('2023-10' instanceof Date)
- console.log(this.salaryinif.startDate instanceof Date)
- },
- getnewDate(){
- let nowDate = new Date()
- let date = {
- year: nowDate.getFullYear(),
- month: nowDate.getMonth() + 1,
- date: nowDate.getDate()
- }
- console.log(date.year + '-' + date.month)
- this.value2=date.year + '-' + date.month;
- this.GetWageSheetList();
- },
- //获取员工
- GetWageSheetBasicsDataSource(){
- var url = "/api/PersonnelModule/GetWageSheetBasicsDataSource"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- }
- }).then(function (res) {
- if(res.data.code==200){
- console.log(res)
- console.log(res.data.data)
- that.userlist=res.data.data.userNames;
- that.companylist=res.data.data.compnayData;
- that.companylist.push(
- {companyName:'全部',id:-1}
- )
- }else{
- that.$message({
- message: '加载失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //薪资列表
- GetWageSheetList(){
- this.fullscreenLoading = true;
- var url = "/api/PersonnelModule/GetWageSheetList"
- var that = this
- console.log(that.value2)
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- portType: 1,
- yearMonth: that.value2,
- }
- }).then(function (res) {
- that.tableData=[];
- if(res.data.code==200){
- console.log(res)
- that.tableData=res.data.data;
- that.tableDatatwo=that.tableData;
- console.log(that.tableData)
- that.fullscreenLoading = false;
- }else{
- that.fullscreenLoading = false;
- that.$message({
- message: '加载失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //日期处理(日)
- TimeProcessingri(val){
- if(val instanceof Date){
- let newsyear=val.getFullYear();
- let newsMonth=val.getMonth() + 1;
- let newsday=val.getDate();
- if((val.getMonth() + 1)<10){
- newsMonth='0'+newsMonth
- }else{
- newsMonth=val.getMonth() + 1
- }
- if(val.getDate()<10){
- newsday=newsday='0'+newsday
- }else{
- newsday=val.getDate()
- }
- return newsyear+ '-' +newsMonth+ '-' + newsday;
- }else{
- return val
- }
- },
- //日期处理(月)
- TimeProcessingyue(val){
- if(val instanceof Date){
- let newsyear=val.getFullYear();
- let newsMonth=val.getMonth() + 1;
- if((val.getMonth() + 1)<10){
- newsMonth='0'+newsMonth
- }else{
- newsMonth=val.getMonth() + 1
- }
- return newsyear+ '-' +newsMonth;
- }else{
- return val
- }
-
- },
- //时间切换
- PickTime(){
- this.tableDatatwo=[];
- this.companyName=-1;
- this.cnName='';
- let newyear=this.value2.getFullYear();
- let newMonth=this.value2.getMonth() + 1;
- if((this.value2.getMonth() + 1)<10){
- newMonth='0'+newMonth
- }else{
- newMonth=this.value2.getMonth() + 1
- }
- this.value2=newyear+ '-' +newMonth;
- console.log(this.value2)
- this.GetWageSheetList();
- },
- //薪资详细
- SalaryDetails(index, row){
- if (this.$refs.salaryinif){
- this.$nextTick(() => {
- this.$refs['salaryinif'].clearValidate();
- })
- }
- // this.clicknot=false;
- this.leave=[];//事假
- this.sickleave=[];//病假
- this.late=[];//迟到
- this.early=[];//早退
- this.transfer=[];//调休假
- this.absenteeism=[];//旷工
- this.notout=[];//补卡
- this.dialogFormVisible = true;
- this.disabled=true;
- this.preserve=false;
- console.log(row.id)
- var url = "/api/PersonnelModule/GetWageSheetById"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- portType: 1,
- id: row.id,
- }
- }).then(function (res) {
- if(res.data.code==200){
- console.log(res)
- that.salaryinif=res.data.data;
- that.salaryinif.yearMonth=new Date(res.data.data.yearMonth);
- that.salaryinif.startDate=new Date(res.data.data.startDate);
- that.salaryinif.endDate=new Date(res.data.data.endDate);
- that.jsonstring=res.data.data.ex_ItemsRemark;
- that.salaryinif.beforeTax=res.data.data.beforeTax;
- if(res.data.data.ex_ItemsRemark!=''){
- let ItemsRemark=JSON.parse(res.data.data.ex_ItemsRemark);
- console.log(ItemsRemark)
- let jiaqininif;
- let dakainif;
- for(let i=0;i<ItemsRemark.length;i++){
- if(ItemsRemark[i].Type=='假勤'){
- jiaqininif=ItemsRemark[i]
- }
- if(ItemsRemark[i].Type=='打卡'){
- dakainif=ItemsRemark[i]
- }
- }
- console.log(jiaqininif)
- console.log(dakainif)
- if(jiaqininif!=undefined){
- that.transfer=jiaqininif.Ex_ItemInfo
- for(let j=0;j<jiaqininif.Ex_ItemInfo.length;j++){
- if(jiaqininif.Ex_ItemInfo[j].SubType=="事假"){
- that.leave.push(jiaqininif.Ex_ItemInfo[j])
- }
- if(jiaqininif.Ex_ItemInfo[j].SubType=="病假"){
- that.sickleave.push(jiaqininif.Ex_ItemInfo[j])
- }
- // 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=="出差"){
- // that.transfer.push(jiaqininif.Ex_ItemInfo[j])
- // }
- }
- }
- console.log(that.transfer)
- if(dakainif!=undefined){
- for(let x=0;x<dakainif.Ex_ItemInfo.length;x++){
- if(dakainif.Ex_ItemInfo[x].SubType=="迟到"){
- that.late.push(dakainif.Ex_ItemInfo[x])
- }
- if(dakainif.Ex_ItemInfo[x].SubType=="早退"){
- that.early.push(dakainif.Ex_ItemInfo[x])
- }
- if(dakainif.Ex_ItemInfo[x].SubType=="旷工"){
- that.absenteeism.push(dakainif.Ex_ItemInfo[x])
- that.transfer.push(dakainif.Ex_ItemInfo[x])
- }
- if(dakainif.Ex_ItemInfo[x].SubType=="打卡补卡"){
- that.notout.push(dakainif.Ex_ItemInfo[x])
- }
- }
- }
- console.log(that.late)
- }
- }else{
- that.$message({
- message: '加载失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //薪资(新增,修改)API
- PostWageSheetAddOrEdit(inif){
- console.log(inif)
- var url = "/api/PersonnelModule/PostWageSheetAddOrEdit"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- status:inif.statuss,
- createUserId:that.loginuserid,
- userId:that.salaryinif.userId,
- id:inif.ids,
- remark:that.salaryinif.remark,
- yearMonth:that.TimeProcessingyue(that.salaryinif.yearMonth),
- startDate:that.TimeProcessingri(that.salaryinif.startDate),
- endDate:that.TimeProcessingri(that.salaryinif.endDate),
- basic:that.salaryinif.basic,
- floats:that.salaryinif.floats,
- postAllowance:that.salaryinif.postAllowance,
- // garmentWashSubsidies:that.salaryinif.garmentWashSubsidies,
- // communicationSubsidies:that.salaryinif.communicationSubsidies,
- otherSubsidies:that.salaryinif.otherSubsidies,
- otherHandle:that.salaryinif.otherHandle,
- informationSecurityFee:that.salaryinif.informationSecurityFee,
- // operationBonus:that.salaryinif.operationBonus,
- // specialAllowance:that.salaryinif.specialAllowance,
- // otherSubsidies:that.salaryinif.otherSubsidies,
- withholdingInsurance:that.salaryinif.withholdingInsurance,
- mealsupplement:that.salaryinif.mealsupplement,
- reservedFunds:that.salaryinif.reservedFunds,
- // groupCost:that.salaryinif.groupCost,
- sickLeave:that.salaryinif.sickLeave,
- somethingFalse:that.salaryinif.somethingFalse,
- lateTo:that.salaryinif.lateTo,
- leaveEarly:that.salaryinif.leaveEarly,
- absenteeism:that.salaryinif.absenteeism,
- notPunch:that.salaryinif.notPunch,
- otherDeductions:that.salaryinif.otherDeductions,
- should:that.salaryinif.should,
- totalDeductions:that.salaryinif.totalDeductions,
- totalRealHair:that.salaryinif.totalRealHair,
- withholdingTax:that.salaryinif.withholdingTax,
- afterTax:that.salaryinif.afterTax,
- workDays:that.salaryinif.workDays,
- regularDays:that.salaryinif.regularDays,
- ex_ItemsRemark:that.jsonstring
- }
- }).then(function (res) {
- if(res.data.code==200){
- console.log(res)
- that.GetWageSheetList();
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- }else{
- that.$message({
- message: '操作失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //薪资(新增,修改)
- salaryAD(text,formName){
- this.$refs[formName].validate((valid) => {
- if (valid) {
- // alert('submit!');
- this.dialogFormVisible = false;
- let inifadd={
- statuss:'',
- userIds:'',
- ids:''
- }
- if(text=='新增'){
- inifadd.statuss=1;
- inifadd.userIds=0;
- inifadd.ids=0;
- this.PostWageSheetAddOrEdit(inifadd)
- }else if(text=='修改'){
- inifadd.statuss=2;
- inifadd.userIds=this.salaryinif.userId;
- inifadd.ids=this.salaryinif.id;
- this.PostWageSheetAddOrEdit(inifadd)
- }
- } else {
- this.$message.error('请将红框内容补全!');
- return false;
- }
- });
- },
- //新增薪资
- addsalary(){
- // console.log(this.$refs.salaryinif)
- if (this.$refs.salaryinif){
- this.$nextTick(() => {
- this.$refs['salaryinif'].clearValidate();
- })
- }
- this.leave=[];//事假
- this.sickleave=[];//病假
- this.late=[];//迟到
- this.early=[];//早退
- this.transfer=[];//调休假
- this.absenteeism=[];//旷工
- this.notout=[];//补卡
- let myDate = new Date(this.value2);
- let month = myDate.getMonth() + 1;
- month = month < 10 ? "0" + month : month; //格式化月份,补0
- let statDateStart = new Date(myDate.getFullYear().toString() +'-'+ month +'-'+ "01"); //月初
- let dayEnd = new Date(myDate.getFullYear(), month, 0).getDate(); //获取当月一共有多少天
- let statDateEnd = new Date(myDate.getFullYear().toString() +'-'+ month +'-'+ dayEnd); //月末
- // this.clicknot=false;
- this.dialogFormVisible = true;
- this.disabled=false;
- this.preserve=true;
- this.salaryinif={
- // regularization:true,
- userId:"",//员工Id
- name:"",//姓名
- yearMonth:new Date(this.value2),//年月
- startDate:statDateStart,//工资日期 起
- endDate:statDateEnd,//工资日期 止
- basic:0,//基本工资
- floats:0,//绩效工资
- postAllowance:0,//岗位津贴
- // garmentWashSubsidies:0,//服装洗理补贴
- // communicationSubsidies:0,// 通讯补贴
- otherSubsidies:0,// 月度补贴
- otherHandle:0,//其他应付
- informationSecurityFee:0,// 保密费
- // operationBonus:0,// 操作奖金
- // specialAllowance:0,// 特殊津贴
- // otherSubsidies:0,// 其他补贴
- withholdingInsurance:0,// 代扣保险
- mealsupplement:0,// 餐补
- reservedFunds:0,// 代扣公积金
- // groupCost:0,// 部门集体团建费
- sickLeave:0,// 病假
- somethingFalse:0,// 事假
- lateTo:0,// 迟到
- leaveEarly:0,// 早退
- absenteeism:0,//旷工
- notPunch:0,//补卡
- otherDeductions:0,//其他扣款
- should:0,//应发合计
- workDays:0,//应出勤天数
- regularDays:0,//正常出勤天数
- totalDeductions:0,//扣款合计
- totalRealHair:0,//实发合计
- withholdingTax:0,//代扣个税
- afterTax:0,//税后工资
- isLock:0,//锁定标识
- lastUpdateUserId:"",//最后操作人
- lastUpdateUserName:"",//最后操作人Name
- lastUpdateDt:"",//最后操作时间
- remark:"",//备注
- beforeTax:0,//税前合计
- };
- },
- //删除薪资列表
- deleteaddsalary(index,row,rows){
- this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- var url = "/api/PersonnelModule/PostWageSheetDel"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- userId:that.loginuserid,
- id:row.id
- }
- }).then(function (res) {
- if(res.data.code==200){
- console.log(res)
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- rows.splice(index, 1);
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- })
- console.log(row)
-
- },
- //计算工资
- SalaryCalculator(formName){
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.fullscreenLoading=true;
- var url = "/api/PersonnelModule/SalaryCalculator"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- userId:that.loginuserid,
- yearMonth:that.TimeProcessingyue(that.gridData.yearMonth),
- startDt:that.TimeProcessingri(that.gridData.startDate),
- endDt:that.TimeProcessingri(that.gridData.endDate),
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- console.log(res)
- that.value2=that.TimeProcessingyue(that.gridData.yearMonth);
- that.gridTableVisible=false;
- that.fullscreenLoading=false;
- that.GetWageSheetList();
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- }else{
- that.value2=that.TimeProcessingyue(that.gridData.yearMonth);
- that.gridTableVisible=false;
- that.fullscreenLoading=false;
- that.GetWageSheetList();
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- } else {
- this.$message.error('请将红框内容补全!');
- return false;
- }
- });
- },
- //打开计算工资
- openSalaryCalculator(){
- this.gridTableVisible=true;
- this.gridData={
- yearMonth:"",//年月
- startDate:"",//工资日期 起
- endDate:"",//工资日期 止
- }
- },
- //获取企业微信假勤
- SalaryCalculatorSingle(){
- this.leave=[];//事假
- this.sickleave=[];//病假
- this.transfer=[];//调休假
- this.late=[];//迟到
- this.early=[];//早退
- this.absenteeism=[];//旷工
- this.notout=[];//补卡
- console.log('jin')
- var url = "/api/PersonnelModule/SalaryCalculatorSingle"
- var that = this
- this.fullscreenLoading = true;
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- userId:that.salaryinif.userId,
- yearMonth:that.TimeProcessingyue(that.salaryinif.yearMonth),
- startDate:that.TimeProcessingri(that.salaryinif.startDate),
- endDate:that.TimeProcessingri(that.salaryinif.endDate),
- basic:that.salaryinif.basic,
- floats:that.salaryinif.floats,
- postAllowance:that.salaryinif.postAllowance,
- // garmentWashSubsidies:that.salaryinif.garmentWashSubsidies,
- // communicationSubsidies:that.salaryinif.communicationSubsidies,
- otherSubsidies:that.salaryinif.otherSubsidies,
- informationSecurityFee:that.salaryinif.informationSecurityFee,
- // operationBonus:that.salaryinif.operationBonus,
- // specialAllowance:that.salaryinif.specialAllowance,
- // otherSubsidies:that.salaryinif.otherSubsidies,
- otherHandle:that.salaryinif.otherHandle,
- withholdingInsurance:that.salaryinif.withholdingInsurance,
- mealsupplement:that.salaryinif.mealsupplement,
- withholdingTax:that.salaryinif.withholdingTax,
- // groupCost:that.salaryinif.groupCost,
- reservedFunds:that.salaryinif.reservedFunds,
- withholdingInsurance:that.salaryinif.withholdingInsurance,
- otherDeductions:that.salaryinif.otherDeductions,
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.fullscreenLoading = false;
- console.log(res);
- that.jsonstring=res.data.data.ex_ItemsRemark;
- console.log(that.addaex_ItemsRemark)
- that.salaryinif.somethingFalse=res.data.data.somethingFalse;
- that.salaryinif.sickLeave=res.data.data.sickLeave;
- that.salaryinif.lateTo=res.data.data.lateTo;
- that.salaryinif.leaveEarly=res.data.data.leaveEarly;
- that.salaryinif.absenteeism=res.data.data.absenteeism;
- that.salaryinif.notPunch=res.data.data.notPunch;
- that.salaryinif.should=res.data.data.should;
- that.salaryinif.workDays=res.data.data.workDays;
- that.salaryinif.regularDays=res.data.data.regularDays;
- that.salaryinif.totalDeductions=res.data.data.totalDeductions;
- that.salaryinif.afterTax=res.data.data.afterTax;
- that.salaryinif.mealsupplement=res.data.data.mealsupplement;
- that.salaryinif.beforeTax=res.data.data.beforeTax;
- that.salaryinif.totalRealHair=res.data.data.totalRealHair;
- if(res.data.data.ex_ItemsRemark!=''){
- that.addaex_ItemsRemark=JSON.parse(res.data.data.ex_ItemsRemark);
- let jiaqin;
- let daka;
- for(let i=0;i<that.addaex_ItemsRemark.length;i++){
- if(that.addaex_ItemsRemark[i].Type=='假勤'){
- jiaqin=that.addaex_ItemsRemark[i]
- }
- if(that.addaex_ItemsRemark[i].Type=='打卡'){
- daka=that.addaex_ItemsRemark[i]
- }
- }
- console.log(jiaqin)
- console.log(daka)
- if(jiaqin!=undefined){
- that.transfer=jiaqin.Ex_ItemInfo;
- for(let j=0;j<jiaqin.Ex_ItemInfo.length;j++){
- if(jiaqin.Ex_ItemInfo[j].SubType=="事假"){
- that.leave.push(jiaqin.Ex_ItemInfo[j])
- }
- if(jiaqin.Ex_ItemInfo[j].SubType=="病假"){
- that.sickleave.push(jiaqin.Ex_ItemInfo[j])
- }
- // 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=="出差"){
- // that.transfer.push(jiaqin.Ex_ItemInfo[j])
- // }
- }
- }
- console.log(that.transfer)
- if(daka!=undefined){
- for(let x=0;x<daka.Ex_ItemInfo.length;x++){
- if(daka.Ex_ItemInfo[x].SubType=="迟到"){
- that.late.push(daka.Ex_ItemInfo[x])
- }
- if(daka.Ex_ItemInfo[x].SubType=="早退"){
- that.early.push(daka.Ex_ItemInfo[x])
- }
- if(daka.Ex_ItemInfo[x].SubType=="旷工"){
- that.absenteeism.push(daka.Ex_ItemInfo[x])
- that.transfer.push(daka.Ex_ItemInfo[x])
- }
- if(daka.Ex_ItemInfo[x].SubType=="打卡补卡"){
- that.notout.push(daka.Ex_ItemInfo[x])
- }
- }
- }
- that.GetWageSheetList();
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- }
- }else{
- that.fullscreenLoading = false;
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //保留两位小数
- rounding(row,column) {
- return parseFloat(row[column.property]).toFixed(2)
- },
- //处理时间
- rounddadykaishi(val){
- if(val.StartTimeDt.indexOf('T')!=-1){
- return val.StartTimeDt.replace('T',' ')
- }
-
- },
- rounddadyjieshu(val){
- if(val.EndTimeDt.indexOf('T')!=-1){
- return val.EndTimeDt.replace('T',' ')
- }
- },
- //选择公司
- companychange(){
- this.cnName='';
- this.tableDatatwo=[];
- let tableDataone=[];
- if(this.companyName!=-1){
- for(let i=0;i<this.tableData.length;i++){
- if(this.tableData[i].companyId==this.companyName){
- tableDataone.push(this.tableData[i]);
- }
- }
- this.tableDatatwo=tableDataone;
- }else{
- this.tableDatatwo=this.tableData;
- }
- },
- //选择员工
- cnNamechange(){
- let tableDatatheer=[];
- let tableDatafour=this.tableDatatwo;
- if(this.cnName!=''){
- for(let j=0;j<this.tableDatatwo.length;j++){
- if(this.tableDatatwo[j].name.indexOf(this.cnName)!=-1){
- tableDatatheer.push(this.tableDatatwo[j])
- }
- }
- this.tableDatatwo=tableDatatheer;
- }else{
- this.companychange()
- // this.tableDatatwo=this.tableDatatwo
- }
-
- },
- //下载
- Download(){
- this.$confirm('请确认左上角的日期,是否要导出'+this.value2+'的工资单!', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- console.log(this.value2)
- var url = "/api/PersonnelModule/ExportWageCard?yearMonth="+this.value2
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- }
- }).then(function (res) {
- if(res.data.code==200){
- console.log(res)
- window.open(res.data.data.fileUrl);
- that.$message({
- message:res.data.msg,
- type: 'success'
- });
- }else{
- that.$message({
- message: '导出失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- }).catch(()=>{})
- })
- },
- // 文件超出个数限制时的钩子
- exceedFile(files, fileList) {
- this.$message.warning(`只能选择 ${this.limitNum} 个文件,当前共选择了 ${files.length + fileList.length} 个`);
- },
- // 文件状态改变时的钩子
- fileChange(file, fileList) {
- console.log(file.raw);
- this.fileList.push(file.raw) ;
- console.log(this.fileList);
- },
- // 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传
- beforeUploadFile(file) {
- console.log('before upload');
- console.log(file);
- let extension = file.name.substring(file.name.lastIndexOf('.')+1);
- let size = file.size / 1024 / 1024;
- if(extension !== 'xlsx') {
- this.$message.warning('只能上传后缀是.xlsx的文件');
- }
- if(size > 10) {
- this.$message.warning('文件大小不得超过10M');
- }
- },
- // 文件上传成功时的钩子
- handleSuccess(res, file, fileList) {
- this.$message.success('文件上传成功');
- },
- // 文件上传失败时的钩子
- handleError(err, file, fileList) {
- this.$message.error('文件上传失败');
- },
- UploadUrl:function(){
- // 因为action参数是必填项,我们使用二次确认进行文件上传时,直接填上传文件的url会因为没有参数导致api报404,所以这里将action设置为一个返回为空的方法就行,避免抛错
- return ""
- },
- uploadFile(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- if (this.fileList.length === 0){
- this.$message.warning('请上传文件');
- } else {
- var form = new FormData();
- form.append('file', this.fileList[0]);
- // form.append('yearMonth', this.TaxesData.yearMonth);
- console.log("wenjian"+this.fileList)
- console.log(form)
- var that = this
- this.$axios({
- method:"post",
- url: "/api/PersonnelModule/UploadTax",
- headers: {
- 'Content-type': 'multipart/form-data',
- Authorization: 'Bearer ' + this.token,
- YearMonth: that.TimeProcessingyue(that.TaxesData.yearMonth)
- },
- data:form
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- console.log(res)
- that.UploadTaxes=false;
- that.value2=that.TimeProcessingyue(that.TaxesData.yearMonth)
- that.GetWageSheetList();
- that.$message({
- message:res.data.msg,
- type: 'success'
- });
- }else{
- that.$message({
- message: '上传失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- }).catch(()=>{})
- }
- } else {
- this.$message.error('请将红框内容补全!');
- return false;
- }
- });
-
- },
- removelist(file, fileList){
- console.log(file)
- console.log(fileList)
- console.log(this.fileList)
- this.fileList=[]
- },
- //下载模板
- DownloadTaxes(){
- var url = "/api/PersonnelModule/WageSheetTaxTemplate"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- }
- }).then(function (res) {
- if(res.data.code==200){
- console.log(res)
- window.open(res.data.data.fileUrl);
- that.$message({
- message:res.data.msg,
- type: 'success'
- });
- }else{
- that.$message({
- message: '下载失败!原因:'+res.data.msg,
- type: 'warning'
- });
- }
- }).catch(()=>{})
- }
- },
- mounted(){
- this.GetWageSheetBasicsDataSource()
- this.loginuserid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
- this.getnewDate();
- }
- }
- </script>
- <style>
- .payroll-all{
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- height: 100%;
- min-height: 830px;
- }
- .payroll-head-li label{
- color: #606266;
- font-size: 15px;
- font-weight: 600;
- }
- .payroll-head-li{
- margin-top: 5px;
- }
- .payroll-head{
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- margin-bottom: 20px;
- }
- .payroll-inif{
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- margin: 0 80px;
- }
- .payroll-inif .el-form-item{
- width: 350px;
- }
- .payroll-inif .el-input-number--medium{
- width: 218px;
- }
- .payroll-inif .el-form-item{
- margin-bottom: 2px;
- }
- .payroll-inif .el-input--medium .el-input__inner{
- text-align: left;
- }
- .leave-inif{
- margin: 0 80px;
- display: flex;
- flex-wrap: wrap;
- }
- .leave-inif .el-form-item{
- margin-bottom: 0px;
- width: 24%;
- }
- .salary-payments{
- display: flex;
- flex-wrap: wrap;
- margin: 0 80px;
- }
- .salary-payments .el-form-item{
- margin-bottom: 0px;
- font-size: 17px;
- font-weight: 600;
- width: 24%;
- }
- .payroll-all .el-dialog__body{
- padding: 16px 20px;
- }
- .remark-box{
- margin: 0 80px;
- }
- .payroll-inif .el-input--medium {
- width: 218px;
- }
- .remark-box.el-form-item{
- margin-bottom: 0px;
- }
- .remark-box .el-input--medium .el-input__inner{
- text-align: left;
- }
- .remark-box .el-input-number--medium{
- width: 218px;
- text-align:left;
- }
- .ps-box{
- font-size:12px ;
- color: red;
- }
- .pan .el-form-item__error{
- display: none;
- }
- .remark-box .el-textarea__inner{
- width: 96.5%;
- }
- .payroll-all::-webkit-scrollbar-track-piece {
- background-color: #f1f1f1;
- }
- .payroll-all::-webkit-scrollbar {
- width: 10px;
- height: 10px;
- }
- .payroll-all::-webkit-scrollbar-thumb {
- background-color: #c1c1c1;
- background-clip: padding-box;
- min-height: 28px;
- border-radius: 8px;
- }
- .payroll-all::-webkit-scrollbar-thumb:hover {
- background-color: #a8a8a8;
- }
- .biaoji .el-input-number--medium{
- width: 90px;
- }
- .biaoji .el-input--medium .el-input__inner{
- text-align: left;
- }
- .payroll-all .el-dialog{
- margin: 0 auto 23px;
- }
- </style>
|