crm_second_opening_mini/pagesA/punchclock/clockrules/addRules.js

1 line
4.3 KiB
JavaScript

require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/punchclock/clockrules/addRules"],{"07b1":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("dc92"),o={components:{selectRuleType:function(){n.e("pagesA/punchclock/clockrules/ruleType").then(function(){return resolve(n("f87b"))}.bind(null,n)).catch(n.oe)}},data:function(){return{noClick:!0,time_id:"",timeArr:[],positionArr:[],typeObj:{},typeArr:[{id:0,title:"固定上下班",label:"支持弹性打卡",p:"所有人按照相同时间打卡",text:"适用于办公室坐班,例如朝九晚五"}],staffArr:[],name:"",rule_id:""}},onLoad:function(e){e.id&&(this.rule_id=e.id,this.getDetail()),t.removeStorageSync("remindlist")},onShow:function(){var e=t.getStorageSync("remindlist")?t.getStorageSync("remindlist"):[];this.staffArr=this.$deWeight(e),this.getClockTime(),this.getPosition()},methods:{getDetail:function(){var e=this;(0,i.netRulesDetail)({id:this.rule_id}).then((function(n){n=n.data,e.name=n.name,t.setStorageSync("remindlist",n.staff_info),e.staffArr=n.staff_info,e.typeArr.forEach((function(t){t.id==n.type&&(e.typeObj=t)}))}))},getClockTime:function(){var t=this;(0,i.netTimeSlotList)({time_id:this.time_id}).then((function(e){t.timeArr=e.data}))},getPosition:function(){var t=this;(0,i.netAddressList)().then((function(e){t.positionArr=e.data}))},selectStaff:function(){t.navigateTo({url:"/pagesA/crm/selectMember/selectMember"})},changeRulesType:function(){this.$refs.ruleTypeChild.init()},selectType:function(t){this.typeObj=t},toSetTime:function(){t.navigateTo({url:"/pagesA/punchclock/clockrules/clockTime"})},selectPosition:function(){t.navigateTo({url:"/pagesA/punchclock/clockrules/punchPosition"})},toSave:function(){if(0!=this.staffArr.length)if(this.name)if(this.typeObj.title)if(0!=this.timeArr.length)if(0!=this.positionArr.length){var e=[];this.staffArr.forEach((function(t){e.push(t.id)}));var n={name:this.name,type:this.typeObj.id,staff_id:e.join(",")};this.rule_id?(n.id=this.rule_id,(0,i.netEditRules)(n).then((function(e){t.showToast({title:e.msg,icon:"none"}),setTimeout((function(){t.navigateBack({delta:1})}),2e3)}))):(0,i.netAddRules)(n).then((function(e){t.showToast({title:e.msg,icon:"none"}),setTimeout((function(){t.navigateBack({delta:1})}),2e3)}))}else t.showToast({title:"请添加打卡位置",icon:"none"});else t.showToast({title:"请添加打卡时间",icon:"none"});else t.showToast({title:"请选择规则类型",icon:"none"});else t.showToast({title:"请填写规则名称",icon:"none"});else t.showToast({title:"请选择打卡人员",icon:"none"})},sureDel:function(){var e=this;t.showModal({title:"提示",content:"请确认是否删除?",complete:function(n){n.confirm&&(0,i.netDelRules)({id:e.rule_id}).then((function(e){t.showToast({title:e.msg,icon:"none"}),setTimeout((function(){t.navigateBack({delta:1})}),2e3)}))}})}}};e.default=o}).call(this,n("543d")["default"])},"0df4":function(t,e,n){"use strict";(function(t,e){var i=n("4ea4");n("8886");i(n("66fd"));var o=i(n("82cf"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"0f2e":function(t,e,n){},"20e9":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.staffArr.length),i=0!=n?t.staffArr.length:null,o=t.timeArr.length,s=t.timeArr.length,r=0!=s?t.timeArr.length:null,c=0!=s&&r>1?t.timeArr.length:null,l=t.positionArr.length,a=t.positionArr.length,u=0!=a?t.positionArr.length:null,f=0!=a&&u>1?t.positionArr.length:null;t.$mp.data=Object.assign({},{$root:{g0:n,g1:i,g2:o,g3:s,g4:r,g5:c,g6:l,g7:a,g8:u,g9:f}})},o=[]},"5f54":function(t,e,n){"use strict";n.r(e);var i=n("07b1"),o=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=o.a},"82cf":function(t,e,n){"use strict";n.r(e);var i=n("20e9"),o=n("5f54");for(var s in o)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(s);n("87e6");var r=n("f0c5"),c=Object(r["a"])(o["default"],i["b"],i["c"],!1,null,"dbeebb92",null,!1,i["a"],void 0);e["default"]=c.exports},"87e6":function(t,e,n){"use strict";var i=n("0f2e"),o=n.n(i);o.a}},[["0df4","common/runtime","common/vendor"]]]);