chunk-947a1ac8.747e5976.js 8.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-947a1ac8"],{"0cbd":function(t,e,n){"use strict";n("3a70")},"3a70":function(t,e,n){},a6e9:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var r=n("b775"),a=(n("4328"),"/api-web");function o(t){return Object(r["a"])({url:a+"/sysConfig/list",method:"get",params:t})}function c(t){return Object(r["a"])({url:a+"/sysConfig/batchUpdate",method:"post",data:t,headers:{"Content-Type":"application/json"}})}},a7ba:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return c}));var r=n("829b"),a=function(t){return Object(r["a"])({url:"/api-web/sysTenantConfig/queryAll",params:t,method:"get"})},o=function(t){return Object(r["a"])({url:"/api-web/questionnaireTopic/queryPage",params:t,method:"get"})},c=function(t){return Object(r["a"])({url:"/api-web/sysTenantConfig/batchUpSet",data:t,method:"post",requestType:"json"})}},c457:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"m-container"},[n("h2",[t._v("预警课酬设置")]),t._v(" "),n("div",{staticClass:"m-core"},[n("save-form",{ref:"searchForm",staticClass:"searchForm",attrs:{inline:!0,model:t.searchForm},on:{"update:model":function(e){t.searchForm=e}}},[n("el-form-item",{attrs:{prop:"organId"}},[n("el-select",{attrs:{placeholder:"请选择分部",clearable:"",filterable:""},model:{value:t.searchForm.organId,callback:function(e){t.$set(t.searchForm,"organId","string"===typeof e?e.trim():e)},expression:"searchForm.organId"}},t._l(t.selects.branchs,(function(t){return n("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})})),1)],1),t._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"danger"},on:{click:t.search}},[t._v("搜索")])],1)],1),t._v(" "),n("auth",{staticStyle:{"margin-bottom":"20px"},attrs:{auths:"sysConfig/update/insert"}},[n("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:function(e){return t.openTypes("create")}}},[t._v("添加")])],1),t._v(" "),n("div",{staticClass:"tableWrap"},[n("el-table",{attrs:{data:t.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[n("el-table-column",{attrs:{align:"center",prop:"branchName",label:"分部"}}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"money",label:"预警课酬"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("moneyFormat")(e.row.money))+"元\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("auth",{attrs:{auths:"sysConfig/update/update"}},[n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.openTypes("update",e.row)}}},[t._v("修改")])],1),t._v(" "),n("auth",{attrs:{auths:"sysConfig/update/del"}},[n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.onTypesDel(e.row)}}},[t._v("删除")])],1)]}}])})],1)],1)],1),t._v(" "),n("el-dialog",{attrs:{title:t.formTitle[t.formActionTitle],visible:t.typeStatus,width:"600px"},on:{"update:visible":function(e){t.typeStatus=e},close:function(e){return t.onFormClose("ruleForm")}}},[n("el-form",{ref:"ruleForm",attrs:{model:t.form,rules:t.rules}},[n("el-form-item",{attrs:{label:"预警课酬(元)",prop:"money","label-width":t.formLabelWidth}},[n("el-input",{attrs:{type:"number",placeholder:"请输入预警课酬",autocomplete:"off"},on:{input:function(e){return t.checkNumber(t.form.money)}},model:{value:t.form.money,callback:function(e){t.$set(t.form,"money","string"===typeof e?e.trim():e)},expression:"form.money"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"适用分部",prop:"branchId","label-width":t.formLabelWidth}},[n("el-select",{attrs:{clearable:"",filterable:"",placeholder:"请选择适用分部"},model:{value:t.form.branchId,callback:function(e){t.$set(t.form,"branchId",e)},expression:"form.branchId"}},t._l(t.selects.branchs,(function(t){return n("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})})),1)],1)],1),t._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.typeStatus=!1}}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onTypesSubmit("ruleForm")}}},[t._v("确 定")])],1)],1)],1)},a=[],o=(n("7f7f"),n("386d"),n("ac6a"),n("4917"),n("c7eb")),c=(n("96cf"),n("1da1")),s=n("a6e9"),i=n("a7ba"),u={name:"earlyWarning",data:function(){return{searchForm:{organId:null},tableList:[],tempTableList:[],formActionTitle:"create",formTitle:{create:"添加预警课酬设置",update:"修改预警课酬设置"},typeStatus:!1,formLabelWidth:"120px",form:{id:null,money:null,branchId:null},formRow:null,rules:{money:[{required:!0,message:"请输入预警课酬",trigger:"blur"}],branchId:[{required:!0,message:"请选择适用分部",trigger:"blur"}]}}},mounted:function(){var t=Object(c["a"])(Object(o["a"])().mark((function t(){return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$store.dispatch("setBranchs");case 2:this.getList();case 3:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{checkNumber:function(t){this.form.money=t.match(/^\d*(\.?\d{0,2})/g)[0]||null},onTypesSubmit:function(t){var e=this;this.$refs[t].validate(function(){var t=Object(c["a"])(Object(o["a"])().mark((function t(n){var r,a,c,s,u;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=15;break}if(r=e.form,a=!1,c=null,s={},e.tempTableList.forEach((function(t){"update"==e.formActionTitle?t.branchId==r.branchId&&e.formRow.branchId!=r.branchId&&(a=!0,c=t.branchName):t.branchId==r.branchId&&(a=!0,c=t.branchName),s[t.branchId]=t.money})),!a){t.next=9;break}return e.$message.error("[".concat(c,"]分部已设置预警课酬")),t.abrupt("return");case 9:return s[r.branchId]=r.money,u=[{id:r.id,paranValue:JSON.stringify(s),paramName:"warning_min_course_salary"}],t.next=13,Object(i["c"])(u).then((function(t){var n="create"==e.formActionTitle?"添加":"修改";e.messageTips(n,t)}));case 13:t.next=16;break;case 15:return t.abrupt("return",!1);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},search:function(){var t=this.searchForm.organId,e=[];this.tempTableList.forEach((function(n){n.branchId!=t&&t||e.push(n)})),this.tableList=e},onTypesDel:function(){var t=Object(c["a"])(Object(o["a"])().mark((function t(e){var n,r,a=this;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:n={},this.tempTableList.forEach((function(t){e.branchId!=t.branchId&&(n[t.branchId]=t.money)})),r={id:this.form.id,paranValue:JSON.stringify(n),paramName:"warning_min_course_salary"},this.$confirm("是否删除预警课酬","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(c["a"])(Object(o["a"])().mark((function t(){return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["b"])(r).then((function(t){a.messageTips("删除",t)}));case 2:case"end":return t.stop()}}),t)})))).catch((function(){}));case 4:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),messageTips:function(){var t=Object(c["a"])(Object(o["a"])().mark((function t(e,n){return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(200!=n.code){t.next=9;break}return this.$message.success(e+"成功"),this.typeStatus=!1,t.next=5,this.getList();case 5:return t.next=7,this.search();case 7:t.next=10;break;case 9:this.$message.error(n.msg);case 10:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}(),getList:function(){var t=Object(c["a"])(Object(o["a"])().mark((function t(){var e=this;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["a"])({group:"WARN_COURSE_SALARY"}).then((function(t){var n=t.data[0];200==t.code&&function(){var t=n.paranValue?JSON.parse(n.paranValue):{};e.form.id=n.id;var r=e.selects.branchs,a=[],o=function(e){var n=[];r.forEach((function(r){e==r.id&&(n=r.name,a.push({branchId:e,branchName:n,money:t[e]}))}))};for(var c in t)o(c);e.tableList=a,e.tempTableList=a}()}));case 2:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),openTypes:function(t,e){var n=this;this.typeStatus=!0,this.formActionTitle=t,"update"==t&&(this.formRow=e,this.$nextTick((function(){n.form.money=e.money,n.form.branchId=parseInt(e.branchId)})))},onFormClose:function(t){this.$refs[t].resetFields()}}},l=u,f=(n("0cbd"),n("2877")),m=Object(f["a"])(l,r,a,!1,null,"a6ff43e2",null);e["default"]=m.exports}}]);