89d713a.js 15 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[120],{570:function(e,t,r){},714:function(e,t,r){"use strict";r(570)},839:function(e,t,r){"use strict";r.r(t);var n=r(6),o=(r(30),1),c={data:function(){return{total:0,reminds:[],remind:"",job_id:"",period_id:"",is_invoice:!1,dev_is_invoice:!1,is_use_deposit:!1,detail:null,clientChangeDialog:!1,clients:[],clientSelected:""}},computed:{orderHref:function(){var e=this.detail,t="/rooter/cloudjobitem/".concat(e.job_id);return t=this.$store.state.domainConfig.siteUrl+"".concat(t)},devServiceRate:function(){var e=this.rate,t=+e.person_service_fee_rate-+e.person_service_fee_rate_reduce;return t<0?0:t},devRate:function(){var e=this.rate;return+e.person_tax_rate+ +e.person_tax_service_fee_rate},salary:function(){return this.detail.salary},vipMinus:function(){var e=this.salary,t=this.rate;return this.keepDecimal(((1*e.normal_salary+1*e.probation_salary)*(this.detail.work_hour.work_rate/100)-1*e.deduction_fee)*((t.person_service_fee_rate-t.person_service_fee_rate_reduce)/100))},rate:function(){return this.detail.rate},shouldRate:function(){var e=this.rate;return this.keepDecimal(+this.baseSalary*(1-+e.origin_person_service_fee_rate/100+ +e.person_service_fee_rate_reduce/100)*this.devRate/100)},baseSalary:function(){var e=this.salary;return this.keepDecimal((+e.normal_salary+ +e.probation_salary)*+this.detail.work_hour.work_rate/100-+e.deduction_fee)},returnMoney:function(){if(this.is_use_deposit)return 0;var e=this.salary,t=+this.detail.company.company_pay>0?1:0,r="1"==this.detail.is_invoice?1+ +this.detail.rate.company_tax_rate/100:1;return this.keepDecimal((+e.normal_salary+ +e.probation_salary-+this.baseSalary)*(1+ +this.detail.rate.company_service_fee_rate/100)*r)*t},personPrice:function(){var e=this.salary,t=this.detail.rate,r=this.detail.work_hour,n=this.dev_is_invoice?1-t.person_tax_rate/100-t.person_tax_service_fee_rate/100:1,o=((e.normal_salary-0+(e.probation_salary-0))*r.work_rate/100-+e.deduction_fee)*(1-t.person_service_fee_rate/100+t.person_service_fee_rate_reduce/100)*n;return this.keepDecimal(o)},companyPrice:function(){var e=this.salary,t=this.detail.rate,r=this.detail.work_hour,n=this.is_invoice?1+t.company_tax_rate/100:1,o=((e.normal_salary-0+(e.probation_salary-0))*r.work_rate/100-+e.deduction_fee)*(1+t.company_service_fee_rate/100)*n;return this.keepDecimal(o)},isInvoice:function(){return this.detail[this.isDev?"dev_is_invoice":"is_invoice"]}},filters:{dateFormat:function(e){return new Date(1e3*+e).toLocaleDateString()}},mounted:function(){this.job_id=this.$route.query.job_id,this.period_id=this.$route.query.period_id,this.getClients(),this.getData(),this.getReminds()},methods:{changePagination:function(e){this.getReminds(e)},getReminds:function(){var e=arguments,t=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n,c,_,data;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:o,t.reminds=[],r.next=4,t.$post("/api/admin/job/getPeriodNote",{period_id:t.period_id,page:n});case 4:c=r.sent,_=c.status,data=c.data,o=n,console.log(data),_&&(t.total=data.total,t.reminds=data.list);case 10:case"end":return r.stop()}}),r)})))()},clickRemindSave:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var content,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log(e.remind),e.remind.length){t.next=4;break}return e.$message({message:"请输入备注",type:"warning"}),t.abrupt("return");case 4:return content="".concat(e.remind," -账单ID").concat(e.period_id),t.next=7,e.$post("/api/admin/job/note",{id:e.job_id,period_id:e.period_id,content:content});case 7:r=t.sent,console.log(r),r.status?(e.$message({message:"保存成功",type:"success"}),setTimeout((function(){location.reload()}),1500)):e.$message({message:"保存失败",type:"error"});case 10:case"end":return t.stop()}}),t)})))()},keepDecimal:function(e){return e.toFixed(2)},jobPeriodSettle:function(e){var t=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var body,n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(t.returnMoney<0||t.detail.work_hour.work_rate>100)){r.next=3;break}return t.$message({message:"退还金额不能小于0 且 结算比例不能大于100",type:"error"}),r.abrupt("return");case 3:return(body={period_id:t.period_id,job_id:t.job_id,action:e,work_rate:t.detail.work_hour.work_rate,deduction_fee:t.salary.deduction_fee,return_money:t.returnMoney,remark:t.detail.remark,is_use_deposit:t.is_use_deposit?1:0,person_service_fee_rate:t.detail.rate.origin_person_service_fee_rate}).dev_is_invoice=t.dev_is_invoice?1:0,r.next=7,t.$post("/api/admin/job/job_period_settle",body);case 7:if(n=r.sent){r.next=10;break}return r.abrupt("return");case 10:n.status>0?(t.$message({message:n.info,type:"success"}),setTimeout((function(){location.reload()}),1e3)):(n.info||console.log(n),t.$message({message:n.info?n.info:"接口返回数据异常",type:"error"}));case 11:case"end":return r.stop()}}),r)})))()},getData:function(i){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$post("/api/admin/job/get_job_period_detail",{job_id:e.job_id,period_id:e.period_id,is_cal_workrate:1});case 2:if((r=t.sent).data){t.next=5;break}return t.abrupt("return");case 5:data=r.data,data.current_env,e.detail=data,e.isDev=data.is_dev,e.is_invoice="1"===e.detail.is_invoice,e.dev_is_invoice="1"==e.detail.dev_is_invoice,e.is_use_deposit="1"===data.can_use_deposit,e.clientSelected=e.detail.user_manager?e.detail.user_manager.uid:"";case 13:case"end":return t.stop()}}),t)})))()},getClients:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$post("/api/admin/user_manager/get_manager",{});case 2:if((r=t.sent).data){t.next=5;break}return t.abrupt("return");case 5:data=r.data,console.log(data),e.clients=data.managers;case 8:case"end":return t.stop()}}),t)})))()},handleClientChange:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.clientSelected||e.$message.error("请选择客户经理"),t.next=3,e.$post("/api/admin/user_manager/change_manager_record",{manager_id:e.clientSelected,period_id:e.period_id});case 3:1===(r=t.sent).status?(e.$message({message:"修改成功",type:"success"}),e.getData(),e.clientSelected="",e.clientChangeDialog=!1):e.$message.error("修改失败!"+r.info);case 5:case"end":return t.stop()}}),t)})))()}}},_=c,l=(r(714),r(4)),component=Object(l.a)(_,(function(){var e=this,t=e._self._c;return e.detail?t("section",{attrs:{id:"wage-settlement"}},[t("section",{staticClass:"left"},[t("h3",[e._v("工资结算")]),e._v(" "),t("h4",[e._v("\n 【\n "),t("a",{attrs:{href:e.orderHref}},[e._v(e._s(e.detail.job.title_count))]),e._v("\n 】"+e._s(e.detail.time.month)+"工资账单\n "),t("el-tag",{attrs:{size:"small"}},[e._v(e._s(e.detail.statusName))]),e._v(" "),t("el-tag",{attrs:{size:"small"}},[e._v(e._s(e.detail.invoiceName))]),e._v(" "),"1"==e.detail.is_use_deposit?t("el-tag",{attrs:{size:"small"}},[e._v("使用押金结算")]):e._e()],1),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("每月薪资:")]),e._v("\n ¥"+e._s(e.salary.job_salary)+"/月\n ")]),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("工作周期:")]),e._v("\n "+e._s(e._f("dateFormat")(e.detail.time.start_time))+" 至 "+e._s(e._f("dateFormat")(e.detail.time.end_time))+" ("+e._s(e.detail.days)+"天)\n ")]),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("托管金额:")]),e._v("\n ¥"+e._s(e.detail.company.company_pay)+"\n ")]),e._v(" "),e.detail.normal_days>0?t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("正式工资:")]),e._v("\n ¥"+e._s(e.salary.normal_salary)+"("+e._s(e.detail.normal_days)+"天)\n ")]):e._e(),e._v(" "),e.detail.probation_days>0?t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("试用工资:")]),e._v("\n ¥"+e._s(e.salary.probation_salary)+"("+e._s(e.detail.probation_days)+"天,按月工资"+e._s(e.rate.probation_rate)+"%结算)\n ")]):e._e(),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("结算比例:")]),e._v(" "),t("el-input",{attrs:{type:"number"},model:{value:e.detail.work_hour.work_rate,callback:function(t){e.$set(e.detail.work_hour,"work_rate",t)},expression:"detail.work_hour.work_rate"}}),e._v("\n % (工作工时:"+e._s(e.detail.work_hour.worked_hours)+"/"+e._s(e.detail.work_hour.should_work_hours)+")\n ")],1),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("扣减工资:")]),e._v(" "),t("el-input",{attrs:{type:"number"},model:{value:e.salary.deduction_fee,callback:function(t){e.$set(e.salary,"deduction_fee",t)},expression:"salary.deduction_fee"}}),e._v("元\n ")],1),e._v(" "),t("section",{staticClass:"container salary-container"},[t("span",{staticClass:"title"},[e._v("本月工资:")]),e._v(" "),t("section",[t("div",{staticClass:"salary-result"},[e._v("¥"+e._s(e.baseSalary))]),e._v(" "),t("div",{staticClass:"salary-calc"},[e._v("=("+e._s(e.salary.normal_salary)+"+"+e._s(e.salary.probation_salary)+")*"+e._s(e.detail.work_hour.work_rate)+"%-"+e._s(e.salary.deduction_fee))])])]),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("核对时服务费:")]),e._v(" "),t("el-input",{attrs:{type:"number",disabled:"disabled"},model:{value:e.rate.person_service_fee_rate,callback:function(t){e.$set(e.rate,"person_service_fee_rate",t)},expression:"rate.person_service_fee_rate"}}),e._v("\n VIP会员减免"+e._s(e.rate.person_service_fee_rate_reduce)+"% ¥"+e._s(e.vipMinus)+" (开发者服务费率"+e._s(e.devServiceRate)+"%)\n ")],1),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("应缴税费:")]),e._v(" "),t("el-checkbox",{attrs:{type:"checkbox"},model:{value:e.dev_is_invoice,callback:function(t){e.dev_is_invoice=t},expression:"dev_is_invoice"}}),e._v("\n ¥"+e._s(e.shouldRate)+" (开发者税率"+e._s(e.devRate)+"%)\n ")],1),e._v(" "),t("section",{staticClass:"container salary-container"},[t("span",{staticClass:"title"},[e._v("实际工资:")]),e._v(" "),t("section",[t("div",{staticClass:"salary-result"},[e._v("¥"+e._s(e.personPrice))]),e._v(" "),t("div",{staticClass:"salary-calc"},[t("span",[e._v("=(("+e._s(e.salary.normal_salary)+"+"+e._s(e.salary.probation_salary)+")*"+e._s(e.detail.work_hour.work_rate)+"%-"+e._s(1*e.salary.deduction_fee)+")*(1-"+e._s(e.rate.person_service_fee_rate)+"%)")]),e._v(" "),e.dev_is_invoice?t("span",[e._v("*(1-"+e._s(e.rate.person_tax_rate)+"%-"+e._s(e.rate.person_tax_service_fee_rate)+"%)")]):e._e()])])]),e._v(" "),e.detail.can_use_deposit?t("section",{staticClass:"container"},[t("el-checkbox",{staticStyle:{margin:"0 4px 0 0"},attrs:{disabled:"",checked:""},model:{value:e.is_use_deposit,callback:function(t){e.is_use_deposit=t},expression:"is_use_deposit"}}),e._v("\n 使用押金结算(¥"+e._s(e.detail.company.company_left_deposit)+")(企业方费用:¥"+e._s(e.companyPrice)+")\n ")],1):e._e(),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("退还金额:")]),e._v(" "),t("el-input",{attrs:{type:"text",value:e.returnMoney,disabled:""}}),e._v("\n =(("+e._s(e.salary.normal_salary)+"+"+e._s(e.salary.probation_salary)+")-"+e._s(e.baseSalary)+")*(1+"+e._s(e.rate.company_service_fee_rate)+"%)\n "),e.is_invoice?t("span",[e._v("*(1+"+e._s(this.is_invoice?e.rate.company_tax_rate:0)+"%)")]):e._e(),e._v("元\n ")],1),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("备注说明:")]),e._v(" "),t("el-input",{model:{value:e.detail.remark,callback:function(t){e.$set(e.detail,"remark",t)},expression:"detail.remark"}})],1),e._v(" "),t("section",{staticClass:"container"},[t("span",{staticClass:"title"},[e._v("提成客户经理")]),e._v("\n "+e._s(e.detail.user_manager?"".concat(e.detail.user_manager.nickname,"(").concat(e.detail.user_manager.uid,")"):"")+"\n "),t("el-button",{attrs:{type:"text"},on:{click:function(t){e.clientChangeDialog=!0}}},[e._v("更换")]),e._v(" "),t("el-dialog",{attrs:{title:"更换提成客户经理",visible:e.clientChangeDialog,width:"30%"},on:{"update:visible":function(t){e.clientChangeDialog=t}}},[t("div",[e._v("客户昵称:"+e._s(e.detail.company_info?"".concat(e.detail.company_info.nickname,"(").concat(e.detail.company_info.uid,")"):""))]),e._v(" "),t("div",[e._v("\n 客户经理:\n "),t("el-select",{attrs:{placeholder:"请选择"},model:{value:e.clientSelected,callback:function(t){e.clientSelected=t},expression:"clientSelected"}},e._l(e.clients,(function(e){return t("el-option",{key:e.uid,attrs:{label:"".concat(e.nickname,"(").concat(e.uid,")"),value:e.uid}})})),1)],1),e._v(" "),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.clientChangeDialog=!1}}},[e._v("取 消")]),e._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:e.handleClientChange}},[e._v("确 定")])],1)])],1),e._v(" "),t("el-button",{directives:[{name:"show",rawName:"v-show",value:2==e.detail.status||3==e.detail.status,expression:"detail.status == 2 || detail.status == 3"}],on:{click:function(t){return e.jobPeriodSettle("save")}}},[e._v("保存")]),e._v(" "),e.detail.can_send_salary?t("section",{staticClass:"container",staticStyle:{"margin-top":"20px"}},[t("el-button",{directives:[{name:"show",rawName:"v-show",value:3==e.detail.status,expression:"detail.status == 3"}],attrs:{type:"primary"},on:{click:function(t){return e.jobPeriodSettle("confirm")}}},[e._v("确定支付工资")])],1):e._e()],1),e._v(" "),t("section",{staticClass:"right"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.remind,expression:"remind"}],attrs:{placeholder:"请输入备注",maxlength:"200"},domProps:{value:e.remind},on:{input:function(t){t.target.composing||(e.remind=t.target.value)}}}),e._v(" "),t("el-button",{staticStyle:{width:"100px"},attrs:{type:"primary"},on:{click:e.clickRemindSave}},[e._v("保存")]),e._v(" "),t("section",{staticClass:"reminds"},e._l(e.reminds,(function(r){return t("section",{key:r.id,staticClass:"remind"},[t("img",{staticClass:"remind-head",attrs:{src:r.icon_url,alt:"icon"}}),e._v(" "),t("section",{staticClass:"remind-right"},[t("section",{staticClass:"remind-top"},[t("span",{staticClass:"remind-nickname"},[e._v(e._s(r.nickname))]),e._v(" "),t("span",{staticClass:"remind-date"},[e._v(e._s(r.create_date))])]),e._v(" "),t("p",{staticClass:"remind-content"},[e._v(e._s(r.content))])])])})),0),e._v(" "),t("el-pagination",{attrs:{layout:"prev, pager, next",total:e.total,"page-size":20},on:{"current-change":e.changePagination}})],1)]):e._e()}),[],!1,null,"227f2d1a",null);t.default=component.exports}}]);