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