1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-10d6c9a7"],{"08da":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("el-dialog",{attrs:{title:e.title,visible:e.classesDialogVisible,width:"700px","close-on-press-escape":!1,"close-on-click-modal":!1,"before-close":e.beforeClose},on:{"update:visible":function(t){e.classesDialogVisible=t},close:e.beforeClose}},[r("el-button",{staticStyle:{"margin-bottom":"10px"},on:{click:e.add}},[e._v("新增")]),r("el-table",{staticStyle:{width:"100%","max-height":"65vh",overflow:"auto"},attrs:{data:e.tableData}},[r("el-table-column",{attrs:{label:"状态名称",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(" "+e._s(t.row.statusName?t.row.statusName:"-")+" ")])]}}])}),r("el-table-column",{attrs:{label:"开始时间",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(" "+e._s(t.row.startTime?t.row.startTime:"-")+" ")])]}}])}),r("el-table-column",{attrs:{label:"结束时间",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(" "+e._s(t.row.endTime?t.row.endTime:"-")+" ")])]}}])}),r("el-table-column",{attrs:{label:"颜色",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(e){return[r("span",{staticClass:"span_color_box",style:{backgroundColor:e.row.color}})]}}])}),r("el-table-column",{attrs:{label:"排序",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(" "+e._s(t.row.orderNum)+" ")])]}}])}),r("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.edit(t.row)}}},[e._v("编辑")]),r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.del(t.row)}}},[e._v("删除")])]}}])})],1)],1),e.SamllDialogVisible?r("el-dialog",{attrs:{title:e.titleSamll,visible:e.SamllDialogVisible,width:"700px","close-on-press-escape":!1,"close-on-click-modal":!1,"before-close":e.cancel},on:{"update:visible":function(t){e.SamllDialogVisible=t},close:e.cancel}},[r("el-form",{ref:"formRef",attrs:{model:e.form,rules:e.rules,"label-position":"right","label-width":"100px"}},[r("el-form-item",{attrs:{prop:"statusName",label:"状态名称"}},[r("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请输入状态名称"},model:{value:e.form.statusName,callback:function(t){e.$set(e.form,"statusName",t)},expression:"form.statusName"}})],1),r("el-form-item",{attrs:{prop:"workStatus",label:"是否休息"}},[r("el-radio-group",{model:{value:e.form.workStatus,callback:function(t){e.$set(e.form,"workStatus",t)},expression:"form.workStatus"}},[r("el-radio",{attrs:{label:1}},[e._v("工作")]),r("el-radio",{attrs:{label:0}},[e._v("休息")])],1)],1),1==e.form.workStatus?r("el-form-item",{attrs:{label:"开始时间",prop:"startTime"}},[r("el-time-select",{attrs:{placeholder:"开始时间","picker-options":{start:"06:00",step:"00:30",end:"21:30"}},model:{value:e.form.startTime,callback:function(t){e.$set(e.form,"startTime",t)},expression:"form.startTime"}})],1):e._e(),1==e.form.workStatus?r("el-form-item",{attrs:{label:"结束时间",prop:"endTime"}},[r("el-time-select",{attrs:{placeholder:"结束时间","picker-options":{start:"06:00",step:"00:30",end:"21:30",minTime:e.form.startTime}},model:{value:e.form.endTime,callback:function(t){e.$set(e.form,"endTime",t)},expression:"form.endTime"}})],1):e._e(),r("el-form-item",{attrs:{label:"请输入颜色",prop:"color"}},[r("el-color-picker",{model:{value:e.form.color,callback:function(t){e.$set(e.form,"color",t)},expression:"form.color"}})],1),r("el-form-item",{attrs:{prop:"orderNum",label:"排序"}},[r("el-input-number",{attrs:{min:0,placeholder:"请输入排序"},model:{value:e.form.orderNum,callback:function(t){e.$set(e.form,"orderNum",t)},expression:"form.orderNum"}})],1)],1),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:e.cancel}},[e._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 认")])],1)],1):e._e()],1)},o=[],s=r("5530"),l=r("c7eb"),n=r("1da1"),i=r("943d"),c={name:"EitcErmPcTagDialog",props:{title:{type:String,default:""},dictType:{type:String,default:""},classesDialogVisible:{type:Boolean,default:""}},data:function(){return{tableData:[],titleSamll:"",SamllDialogVisible:!1,form:{startTime:null,endTime:null,color:null,workStatus:1},rules:{statusName:[{required:!0,message:"请输入状态名称",trigger:"blur"}],color:[{required:!0,message:"请选择颜色",trigger:"change"}],startTime:[{required:!0,message:"请选择开始时间",trigger:"change"}],endTime:[{required:!0,message:"请选择结束时间",trigger:"change"}]}}},mounted:function(){},methods:{initList:function(){var e=this;return Object(n["a"])(Object(l["a"])().mark((function t(){var r;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["rb"])();case 2:r=t.sent,e.tableData=r.data;case 4:case"end":return t.stop()}}),t)})))()},beforeClose:function(){this.tableData=[],this.$emit("closeDialog")},add:function(){this.titleSamll="新增",this.form={startTime:"",endTime:"",color:"",workStatus:1,statusName:""},this.form.orderNum=this.tableData.length+1,this.SamllDialogVisible=!0},edit:function(e){this.titleSamll="编辑",this.form=Object(s["a"])({},e),this.SamllDialogVisible=!0},del:function(e){var t=this;this.$confirm("此操作将永久删除该项, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(n["a"])(Object(l["a"])().mark((function r(){var a;return Object(l["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(i["sb"])(e.id);case 2:if(a=r.sent,200===a.code){r.next=5;break}return r.abrupt("return",t.$message.error(a.msg));case 5:t.initList(),t.$message({type:"success",message:"删除成功!"});case 7:case"end":return r.stop()}}),r)})))).catch((function(){t.$message({type:"info",message:"已取消删除"})}))},cancel:function(){this.SamllDialogVisible=!1},changeStatus:function(e){var t=this;return Object(n["a"])(Object(l["a"])().mark((function r(){var a;return Object(l["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.form=Object(s["a"])({},e),t.form.dictType=t.dictType,r.next=4,Object(i["tb"])(t.form);case 4:if(a=r.sent,200===a.code){r.next=7;break}return r.abrupt("return",t.$message.error(a.msg));case 7:t.$message.success("修改成功!"),t.initList();case 9:case"end":return r.stop()}}),r)})))()},submitForm:function(){var e=this;this.$refs.formRef.validate(function(){var t=Object(n["a"])(Object(l["a"])().mark((function t(r){var a,o;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=20;break}if(e.form.dictType=e.dictType,"新增"!=e.titleSamll){t.next=10;break}return t.next=5,Object(i["qb"])(e.form);case 5:if(a=t.sent,200===a.code){t.next=8;break}return t.abrupt("return",e.$message.error(a.msg));case 8:t.next=15;break;case 10:return t.next=12,Object(i["tb"])(e.form);case 12:if(o=t.sent,200===o.code){t.next=15;break}return t.abrupt("return",e.$message.error(o.msg));case 15:e.SamllDialogVisible=!1,e.$message.success("".concat(e.titleSamll,"成功!")),e.initList(),t.next=22;break;case 20:return console.log("error submit!!"),t.abrupt("return",!1);case 22:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},resetForm:function(){this.$refs.formRef.resetFields()}}},u=c,m=(r("6fc2"),r("2877")),f=Object(m["a"])(u,a,o,!1,null,"1e6782cc",null);t["default"]=f.exports},"6fc2":function(e,t,r){"use strict";r("ae53")},ae53:function(e,t,r){}}]);
|