1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2c7e7910"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),Math.easeInOutQuad=function(e,t,a,r){return e/=r/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(e,t,a){var i=o(),s=e-i,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var o=Math.easeInOutQuad(c,i,s,t);n(o),c<t?r(e):a&&"function"===typeof a&&a()};u()}},"78ff":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"m-container"},[e._m(0),e._v(" "),a("div",{staticClass:"m-core"},[a("div",{directives:[{name:"permission",rawName:"v-permission",value:"organization/add",expression:"'organization/add'"}],staticClass:"newBand",on:{click:function(t){return e.onBranchOperation("create")}}},[e._v("添加")]),e._v(" "),a("div",{staticClass:"tableWrap"},[a("el-table",{attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[a("el-table-column",{attrs:{align:"center",prop:"id",label:"分部编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"name",label:"分部名称"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"areaName",label:"城市"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"address",label:"分部地址"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"成立时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("formatTimer")(t.row.registerDate))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"organization/update",expression:"'organization/update'"}],attrs:{type:"text"},on:{click:function(a){return e.onBranchOperation("update",t.row)}}},[e._v("修改")])]}}])})],1),e._v(" "),a("pagination",{attrs:{total:e.pageInfo.total,page:e.pageInfo.page,limit:e.pageInfo.limit,"page-sizes":e.pageInfo.page_size},on:{"update:page":function(t){return e.$set(e.pageInfo,"page",t)},"update:limit":function(t){return e.$set(e.pageInfo,"limit",t)},pagination:e.getList}})],1)]),e._v(" "),a("el-dialog",{attrs:{title:e.formTitle[e.formActionTitle],visible:e.branchStatus,width:"500px"},on:{"update:visible":function(t){e.branchStatus=t},close:function(t){return e.onFormClose("ruleForm")}}},[a("el-form",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"分部名称",prop:"name","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"城市",required:"","label-width":e.formLabelWidth}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"province"}},[a("el-select",{attrs:{filterable:"",clearable:""},on:{change:e.onChangeProvince},model:{value:e.form.province,callback:function(t){e.$set(e.form,"province","string"===typeof t?t.trim():t)},expression:"form.province"}},e._l(e.provinceList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"city"}},[a("el-select",{attrs:{filterable:"",clearable:""},model:{value:e.form.city,callback:function(t){e.$set(e.form,"city","string"===typeof t?t.trim():t)},expression:"form.city"}},e._l(e.cityList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"分部地址",prop:"address","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address","string"===typeof t?t.trim():t)},expression:"form.address"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"成立时间",prop:"registerDate","label-width":e.formLabelWidth}},[a("el-date-picker",{attrs:{type:"date","value-format":"yyyy-MM-dd","picker-options":{firstDayOfWeek:1},placeholder:"选择日期"},model:{value:e.form.registerDate,callback:function(t){e.$set(e.form,"registerDate","string"===typeof t?t.trim():t)},expression:"form.registerDate"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.branchStatus=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onBranchSubmit("ruleForm")}}},[e._v("确 定")])],1)],1)],1)},n=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h2",[a("div",{staticClass:"squrt"}),e._v("分部设置\n ")])}],o=(a("7f7f"),a("ac6a"),a("333d")),i=a("d349"),s=(a("4360"),{name:"branchSetting",components:{pagination:o["a"]},data:function(){return{tableList:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},organId:null,formActionTitle:"create",formTitle:{create:"添加分部",update:"修改分部"},formLabelWidth:"100px",branchStatus:!1,provinceList:[],cityList:[],form:{name:null,province:null,city:null,address:null,registerDate:null},rules:{name:[{required:!0,message:"请输入分部名称",trigger:"blur"}],province:[{required:!0,message:"请选择省",trigger:"change"}],city:[{required:!0,message:"请选择市",trigger:"change"}],address:[{required:!0,message:"请输入分部地址",trigger:"blur"}],registerDate:[{required:!0,message:"请选择成立时间",trigger:"change"}]}}},mounted:function(){this.getList(),this.getAreaList()},methods:{onBranchSubmit:function(e){var t=this;this.$refs[e].validate((function(e){e&&(t.form.areaId=t.form.city,"create"==t.formActionTitle?(t.form.id&&delete t.form.id,Object(i["d"])(t.form).then((function(e){t.messageTips("添加",e)}))):"update"==t.formActionTitle&&Object(i["f"])(t.form).then((function(e){t.messageTips("修改",e)})))}))},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.branchStatus=!1,this.getList()):this.$message.error(t.msg)},getList:function(){var e=this;Object(i["e"])({rows:this.pageInfo.limit,page:this.pageInfo.page}).then((function(t){200==t.code&&t.data&&(e.tableList=t.data.rows,e.pageInfo.total=t.data.total)}))},onFormClose:function(e){this.$refs[e].resetFields()},getAreaList:function(e,t){var a=this;e=e||0,Object(i["c"])({parentId:e}).then((function(r){if(200==r.code&&r.data){var n=[];r.data.forEach((function(e){n.push({label:e.name,value:e.id})})),e?a.cityList=n:a.provinceList=n,t&&"function"==typeof t&&t()}}))},onChangeProvince:function(e){this.form.city=null,this.getAreaList(e)},onBranchOperation:function(e,t){var a=this;this.formActionTitle=e,this.branchStatus=!0,"update"==e&&Object(i["s"])({id:t.areaId}).then((function(e){200==e.code&&e.data&&a.getAreaList(e.data.id,(function(){a.form={id:t.id,name:t.name,province:e.data.id,city:t.areaId,address:t.address,registerDate:t.registerDate}}))}))}}}),l=s,c=(a("c130"),a("2877")),u=Object(c["a"])(l,r,n,!1,null,"50ef84fc",null);t["default"]=u.exports},c130:function(e,t,a){"use strict";a("f62e")},f62e:function(e,t,a){}}]);
|