Commit 1126e0b4 by 无尘

feat: 增加考勤组计算

parent d3810f59
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link href=./static/css/app.8ba7d91eb4b39a51fe58c2fce72aba2f.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.b413f1f58ab0cd401700.js></script><script type=text/javascript src=./static/js/vendor.0000e68e65e4a9dc3840.js></script><script type=text/javascript src=./static/js/app.0745446ec2231343c64b.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link href=./static/css/app.3a4a04e53545b15a9abc1d542aece914.css rel=stylesheet></head><body style="min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.44266600c9fb1a2815f0.js></script><script type=text/javascript src=./static/js/vendor.0000e68e65e4a9dc3840.js></script><script type=text/javascript src=./static/js/app.1f969cdde0e4733310c1.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
webpackJsonp([31],{"4HoI":function(t,s){},B9Yg:function(t,s,e){t.exports=e.p+"static/img/gic-error.8aba914.png"},"Q3j/":function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var i=e("B9Yg"),a=e.n(i),n={name:"page404",data:function(){return{img_404:a.a}},computed:{message:function(){return"登录遇到错误啦!请确认您是否已是好办管理员,如不是,请联系管理员。"}},mounted:function(){}},r={render:function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticStyle:{background:"#f0f2f5","margin-top":"-20px",height:"100%"}},[s("div",{staticClass:"wscn-http404"},[s("div",{staticClass:"pic-404"},[s("img",{staticClass:"pic-404__parent",attrs:{src:this.img_404,alt:"404"}})]),this._v(" "),s("div",{staticClass:"bullshit"},[s("div",{staticClass:"bullshit__headline"},[this._v(this._s(this.message))]),this._v(" "),s("a",{staticClass:"bullshit__return-home",attrs:{href:"#/login",rel:"noopener noreferrer"}},[this._v("返回好办登录页")])])])])},staticRenderFns:[]};var c=e("VU/8")(n,r,!1,function(t){e("4HoI")},"data-v-45ea1cc1",null);s.default=c.exports}}); webpackJsonp([32],{"4HoI":function(t,s){},B9Yg:function(t,s,e){t.exports=e.p+"static/img/gic-error.8aba914.png"},"Q3j/":function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var i=e("B9Yg"),a=e.n(i),n={name:"page404",data:function(){return{img_404:a.a}},computed:{message:function(){return"登录遇到错误啦!请确认您是否已是好办管理员,如不是,请联系管理员。"}},mounted:function(){}},r={render:function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticStyle:{background:"#f0f2f5","margin-top":"-20px",height:"100%"}},[s("div",{staticClass:"wscn-http404"},[s("div",{staticClass:"pic-404"},[s("img",{staticClass:"pic-404__parent",attrs:{src:this.img_404,alt:"404"}})]),this._v(" "),s("div",{staticClass:"bullshit"},[s("div",{staticClass:"bullshit__headline"},[this._v(this._s(this.message))]),this._v(" "),s("a",{staticClass:"bullshit__return-home",attrs:{href:"#/login",rel:"noopener noreferrer"}},[this._v("返回好办登录页")])])])])},staticRenderFns:[]};var c=e("VU/8")(n,r,!1,function(t){e("4HoI")},"data-v-45ea1cc1",null);s.default=c.exports}});
\ No newline at end of file \ No newline at end of file
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,d,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],b[t]&&u.push(b[t][0]),b[t]=0;for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(e[r]=d[r]);for(c&&c(a,d,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var a={},b={103:0};function f(c){if(a[c])return a[c].exports;var b=a[c]={i:c,l:!1,exports:{}};return e[c].call(b.exports,b,b.exports,f),b.l=!0,b.exports}f.e=function(e){var c=b[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,f){c=b[e]=[a,f]});c[2]=a;var d=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,f.nc&&n.setAttribute("nonce",f.nc),n.src=f.p+"static/js/"+e+"."+{0:"ab616832b6f6019a8690",1:"fe9dec1f31b04053fd7e",2:"54aabab28c7735d34c10",3:"b7e6d57d97174b75b050",4:"11254d7e3a102121b8ec",5:"330c91a0a9fe8490c0e7",6:"124ad8222f7b043b44ae",7:"ebad93a8c5bffffd9e98",8:"f1c9fb5c9212483138d8",9:"b5aae16b3951516573ad",10:"ebbed2d956a1376f014a",11:"59c7813cc972f62b1d18",12:"879536ae7ce46f0c54ec",13:"57e51fc1b6342003f25d",14:"9cf830eb000e3ac61f70",15:"fe35dfb0b5746285054c",16:"f483f95dbac654c7de5a",17:"ff6edf624b982c354977",18:"447fe4adcec70a86ea14",19:"d7d09ae4564d64842009",20:"455fd80bd8af15457c57",21:"c1b5e15e28768af52654",22:"2a873e819c6c369d5cd1",23:"d2380bf3c276e741313b",24:"b1832faa7c26cd1e9d72",25:"550aafc88ac4d0c8a14f",26:"e0ba8ad05ad14e4c0abc",27:"80efeaa8fe902850d85c",28:"70cb3f87bd69723dbd41",29:"c5bb15e8e1bd17cdc0f7",30:"ea05d43b99177823fbdc",31:"b8b827be7489c76082e9",32:"fa08375056ae64364bce",33:"518ec1acf6d38636eba4",34:"e5ba3c1688f3038d3d09",35:"d8abf87eeb477b4bc1f3",36:"2cadbd4ded3457625f52",37:"8dc3e1f0f3e416135406",38:"9f4a46d2ce3c9477a06b",39:"b33ea830129fb895dd77",40:"52567857be12ee835446",41:"7264f33d2c3cf44d63a5",42:"9cacb9b0dc2a83864afe",43:"2324b3155ba3e3fe67b2",44:"a899f81af77b5d1b6daf",45:"d4e2ecd5b9efc4c430de",46:"03ae66bfca82c8ffa033",47:"393792502b1faedfd75b",48:"e413bb6ddbf0598e75ed",49:"8be0d341bf9560ab91d8",50:"edc711153403cc5a63ed",51:"5996349b24bab60188ec",52:"4b670e09f79ed49e862d",53:"ec91f2b143d0b1e708b5",54:"31eed9c38748896262d1",55:"4f96191ae2c44c6f18f7",56:"99063bd3b07926595af4",57:"ba6530916d934b70d218",58:"2241679269f18e7f14c3",59:"5c336f6f4d119300c1d8",60:"d43c13d5c29feb45e864",61:"0806aac37bd2b86e8bc2",62:"8ef5c75f77376ecd8873",63:"bbe4da77ef31a0aa9150",64:"f26939887c305ec6f7fc",65:"069ccaf5f8e5b5f3c59d",66:"5f0382c9cb76b57ba778",67:"745b9621e5297c575b33",68:"aaaa125fb978b59c2cbf",69:"bb6a8bab41cac9f11bd4",70:"a226d330de7ebb2a4c5f",71:"9551ae81326c57064dec",72:"cb1b3985b92be4556fc1",73:"b6b1fb51b601c0fafcda",74:"6206c00744e77bc84fec",75:"93eb5a61daaa3a1df425",76:"78e5a422e9fecbbd255a",77:"b3f7cf4d2b54d306c522",78:"1fc3472c5f95a0a66979",79:"69811ba75d1fceae9737",80:"12442b543aff65f2c05d",81:"00a94b58ac2affb758dc",82:"1fa56152d6bdcfd4ec14",83:"976088a6ee120b8caa17",84:"45dae077c86a1a0050ff",85:"0c7635a15cceae31d981",86:"d0d0607a424156f2d88d",87:"aee44c25b8d252c44b6e",88:"9617b600ff0f73479a43",89:"8d513b9c9d7970a612c0",90:"57319965505945b3ae7e",91:"446342439ce97b19c84f",92:"09a5823b00d6180576b9",93:"e801fdd8bbd27a68d8ee",94:"0667cc1720cd56e116d9",95:"a08b7e730d57a7f096a5",96:"37acaa2f6f812ee7216b",97:"84d009afd65fa1e0cb42",98:"d54541a3a62bae3a075b",99:"b2c0b52f472168172ad5",102:"2c7e1d628bd2f4ac709c"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var c=b[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),b[e]=void 0)}return n.onerror=n.onload=t,d.appendChild(n),a},f.m=e,f.c=a,f.d=function(e,c,a){f.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},f.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(c,"a",c),c},f.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},f.p="./",f.oe=function(e){throw console.error(e),e}}([]); !function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,d,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],f[t]&&u.push(f[t][0]),f[t]=0;for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(e[r]=d[r]);for(c&&c(a,d,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=b(b.s=n[i]);return o};var a={},f={103:0};function b(c){if(a[c])return a[c].exports;var f=a[c]={i:c,l:!1,exports:{}};return e[c].call(f.exports,f,f.exports,b),f.l=!0,f.exports}b.e=function(e){var c=f[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,b){c=f[e]=[a,b]});c[2]=a;var d=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,b.nc&&n.setAttribute("nonce",b.nc),n.src=b.p+"static/js/"+e+"."+{0:"ab616832b6f6019a8690",1:"fe9dec1f31b04053fd7e",2:"54aabab28c7735d34c10",3:"b7e6d57d97174b75b050",4:"11254d7e3a102121b8ec",5:"330c91a0a9fe8490c0e7",6:"124ad8222f7b043b44ae",7:"ebad93a8c5bffffd9e98",8:"f1c9fb5c9212483138d8",9:"b5aae16b3951516573ad",10:"ebbed2d956a1376f014a",11:"59c7813cc972f62b1d18",12:"879536ae7ce46f0c54ec",13:"57e51fc1b6342003f25d",14:"9cf830eb000e3ac61f70",15:"0dadaaaa62fa31697636",16:"f483f95dbac654c7de5a",17:"ff6edf624b982c354977",18:"447fe4adcec70a86ea14",19:"d7d09ae4564d64842009",20:"455fd80bd8af15457c57",21:"c1b5e15e28768af52654",22:"2a873e819c6c369d5cd1",23:"d2380bf3c276e741313b",24:"b1832faa7c26cd1e9d72",25:"550aafc88ac4d0c8a14f",26:"e0ba8ad05ad14e4c0abc",27:"80efeaa8fe902850d85c",28:"70cb3f87bd69723dbd41",29:"c5bb15e8e1bd17cdc0f7",30:"c97e1c8ed1fca52c7eb7",31:"20f69d688df3827843c5",32:"0c7863fa05e5c75053c3",33:"0271e97189f869db78c7",34:"e5ba3c1688f3038d3d09",35:"d8abf87eeb477b4bc1f3",36:"2cadbd4ded3457625f52",37:"8dc3e1f0f3e416135406",38:"9f4a46d2ce3c9477a06b",39:"b33ea830129fb895dd77",40:"52567857be12ee835446",41:"7264f33d2c3cf44d63a5",42:"9cacb9b0dc2a83864afe",43:"2324b3155ba3e3fe67b2",44:"a899f81af77b5d1b6daf",45:"d4e2ecd5b9efc4c430de",46:"03ae66bfca82c8ffa033",47:"393792502b1faedfd75b",48:"e413bb6ddbf0598e75ed",49:"8be0d341bf9560ab91d8",50:"edc711153403cc5a63ed",51:"5996349b24bab60188ec",52:"4b670e09f79ed49e862d",53:"ec91f2b143d0b1e708b5",54:"31eed9c38748896262d1",55:"4f96191ae2c44c6f18f7",56:"99063bd3b07926595af4",57:"ba6530916d934b70d218",58:"2241679269f18e7f14c3",59:"5c336f6f4d119300c1d8",60:"d43c13d5c29feb45e864",61:"0806aac37bd2b86e8bc2",62:"8ef5c75f77376ecd8873",63:"bbe4da77ef31a0aa9150",64:"f26939887c305ec6f7fc",65:"069ccaf5f8e5b5f3c59d",66:"5f0382c9cb76b57ba778",67:"745b9621e5297c575b33",68:"aaaa125fb978b59c2cbf",69:"bb6a8bab41cac9f11bd4",70:"a226d330de7ebb2a4c5f",71:"9551ae81326c57064dec",72:"cb1b3985b92be4556fc1",73:"b6b1fb51b601c0fafcda",74:"6206c00744e77bc84fec",75:"93eb5a61daaa3a1df425",76:"78e5a422e9fecbbd255a",77:"b3f7cf4d2b54d306c522",78:"1fc3472c5f95a0a66979",79:"69811ba75d1fceae9737",80:"12442b543aff65f2c05d",81:"00a94b58ac2affb758dc",82:"1fa56152d6bdcfd4ec14",83:"976088a6ee120b8caa17",84:"45dae077c86a1a0050ff",85:"0c7635a15cceae31d981",86:"d0d0607a424156f2d88d",87:"aee44c25b8d252c44b6e",88:"9617b600ff0f73479a43",89:"8d513b9c9d7970a612c0",90:"57319965505945b3ae7e",91:"446342439ce97b19c84f",92:"09a5823b00d6180576b9",93:"e801fdd8bbd27a68d8ee",94:"0667cc1720cd56e116d9",95:"a08b7e730d57a7f096a5",96:"37acaa2f6f812ee7216b",97:"84d009afd65fa1e0cb42",98:"d54541a3a62bae3a075b",99:"b2c0b52f472168172ad5",102:"2c7e1d628bd2f4ac709c"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var c=f[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}return n.onerror=n.onload=t,d.appendChild(n),a},b.m=e,b.c=a,b.d=function(e,c,a){b.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},b.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(c,"a",c),c},b.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},b.p="./",b.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file \ No newline at end of file
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
console.log(that.classesData); // console.log(that.classesData);
that.getClassifyData(); that.getClassifyData();
if (that.classesData) { if (that.classesData) {
that.selClassesData = JSON.parse(JSON.stringify(that.classesData)); that.selClassesData = JSON.parse(JSON.stringify(that.classesData));
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<!-- <!--
<cycle-set <cycle-set
:rangeShow="rangeShow" :rangeShow="rangeShow"
:attenceGroupData="attenceGroupData"
:attenceGroupId="attenceGroupId" :attenceGroupId="attenceGroupId"
@hideCycleDialog="hideCycleDialog"> @hideCycleDialog="hideCycleDialog">
</cycle-set> </cycle-set>
...@@ -20,11 +21,11 @@ import cycleSet from '@/components/app/dailyAttendance/cycle-set.vue' ...@@ -20,11 +21,11 @@ import cycleSet from '@/components/app/dailyAttendance/cycle-set.vue'
<template> <template>
<el-dialog class="edit-dialog" title="选择班次" :visible.sync="customDialog" width="600px" :before-close="handleClose"> <el-dialog class="edit-dialog" title="选择班次" :visible.sync="customDialog" width="600px" :before-close="handleClose">
<div class="edit-dialog-body"> <div class="edit-dialog-body">
<el-form :model="ruleFormData" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleFormData" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item label="周期名称:" prop="rangeName"> <el-form-item label="周期名称:" prop="rangeName">
<limitInput :inputWidth="305" :inputValue.sync="ruleFormData.rangeName" :holder="'请输入周期名称'" :getByType="'word'" :maxLength="15"> </limitInput> <limitInput :inputWidth="305" :inputValue.sync="ruleFormData.rangeName" :holder="'请输入周期名称'" :getByType="'word'" :maxLength="15"> </limitInput>
</el-form-item> </el-form-item>
<el-form-item label="每个周期天数:" prop="day"> <el-form-item label="每个周期天数:" prop="">
<div> <div>
<el-input-number v-model="ruleFormData.day" controls-position="right" @change="handleRangeDay" :step="1" :step-strictly="true" :min="3" :max="31"></el-input-number> <el-input-number v-model="ruleFormData.day" controls-position="right" @change="handleRangeDay" :step="1" :step-strictly="true" :min="3" :max="31"></el-input-number>
<span class="font-12 color-909399">以3天为周期进行循环,最大周期天数为31天</span> <span class="font-12 color-909399">以3天为周期进行循环,最大周期天数为31天</span>
...@@ -35,7 +36,7 @@ import cycleSet from '@/components/app/dailyAttendance/cycle-set.vue' ...@@ -35,7 +36,7 @@ import cycleSet from '@/components/app/dailyAttendance/cycle-set.vue'
<li v-for="(item, index) in ruleFormData.classesList" :key="index + 'class'"> <li v-for="(item, index) in ruleFormData.classesList" :key="index + 'class'">
<span>{{ index + 1 }}天:</span> <span>{{ index + 1 }}天:</span>
<el-select v-model="item.classesId" placeholder="请选择" @change="changeClass($event, item)"> <el-select v-model="item.classesId" placeholder="请选择" @change="changeClass($event, item)">
<el-option v-for="item in tableData" :key="item.classesId" :label="item.classesName" :value="item.classesId"> </el-option> <el-option v-for="item in tableData" :key="item.classesId" :label="'班次' + item.classesName + item.label" :value="item.classesId"> </el-option>
</el-select> </el-select>
</li> </li>
</ul> </ul>
...@@ -66,6 +67,36 @@ export default { ...@@ -66,6 +67,36 @@ export default {
attenceGroupId: { attenceGroupId: {
type: String, type: String,
default: '' default: ''
},
classesJson: {
type: [Array, Object],
default() {
return [];
}
},
attenceGroupData: {
type: [Array, Object],
default() {
return {
classesRangeId: '',
day: 3,
rangeName: '',
classesList: [
{
classesId: '',
classesName: ''
},
{
classesId: '',
classesName: ''
},
{
classesId: '',
classesName: ''
}
]
};
}
} }
}, },
data() { data() {
...@@ -94,6 +125,9 @@ export default { ...@@ -94,6 +125,9 @@ export default {
classesName: '' classesName: ''
} }
] ]
},
rules: {
rangeName: [{ required: true, message: '请输入周期名称', trigger: 'blur' }]
} }
}; };
}, },
...@@ -142,24 +176,48 @@ export default { ...@@ -142,24 +176,48 @@ export default {
that.currentPage = 1; that.currentPage = 1;
that.getClassifyData(); that.getClassifyData();
}, },
customConfirm: _debounce(async function() { customConfirm: _debounce(async function(formName) {
const that = this; const that = this;
that.customDialog = false; let flag = true;
if (!that.selClassesId) { that.ruleFormData.classesList.forEach(ele => {
flag = !ele.classesId ? false : true;
});
if (!flag) {
showMsg.showmsg('请选择班次', 'warning'); showMsg.showmsg('请选择班次', 'warning');
return false; return false;
} }
let obj = {}; that.$refs[formName].validate(valid => {
that.tableData.forEach(ele => { if (valid) {
if (ele.attenceGroupId == that.selClassesId) { that.customDialog = false;
obj = ele; that.$emit('hideCycleDialog', that.ruleFormData);
that.resetData();
} }
}); });
that.$emit('hideClassDialog', obj); }, 300),
resetData() {
const that = this;
that.$nextTick(() => { that.$nextTick(() => {
that.selClassesId = ''; that.ruleFormData = {
classesRangeId: '',
day: 3,
rangeName: '',
classesList: [
{
classesId: '',
classesName: ''
},
{
classesId: '',
classesName: ''
},
{
classesId: '',
classesName: ''
}
]
};
}); });
}, 300), },
/** /**
* 关闭 * 关闭
*/ */
...@@ -182,41 +240,26 @@ export default { ...@@ -182,41 +240,26 @@ export default {
hideDialog() { hideDialog() {
const that = this; const that = this;
that.customDialog = false; that.customDialog = false;
that.$emit('hideClassDialog'); that.$emit('hideCycleDialog');
that.$nextTick(() => { that.resetData();
that.selClassesId = '';
});
}, },
/** /**
* 获取班次 * 获取班次
*/ */
getClassifyData() { getClassifyData() {
const that = this; const that = this;
let para = { console.log(that.classesJson);
enterpriseId: that.enterpriseId, if (that.classesJson && that.classesJson.length) {
classesName: that.classesName that.classesJson.forEach(ele => {
}; ele.label = ' ';
getRequest('/haoban-app-attence-web/attence-classes-list', para) if (!!ele.classessTimesJson && ele.classessTimesJson.length) {
.then(res => { ele.classessTimesJson.forEach(child => {
let resData = res.data; ele.label += child.startTime + '-' + child.endTime;
if (resData.errorCode == 1) { });
if (resData.result && resData.result.length) {
resData.result.forEach(ele => {
if (ele.classessTimesJson) {
ele.classessTimesJson = JSON.parse(ele.classessTimesJson);
}
});
}
// console.log(resData.result);
that.tableData = resData.result || [];
} }
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
}); });
}
that.tableData = that.classesJson || [];
}, },
/** /**
* 获取周期 * 获取周期
...@@ -231,7 +274,7 @@ export default { ...@@ -231,7 +274,7 @@ export default {
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
that.tableData = resData.result || []; that.ruleFormData = resData.result || [];
} }
}) })
.catch(function(error) { .catch(function(error) {
...@@ -252,17 +295,46 @@ export default { ...@@ -252,17 +295,46 @@ export default {
if (newData) { if (newData) {
that.getRangeData(); that.getRangeData();
} }
},
attenceGroupData(newData) {
const that = this;
if (newData) {
that.ruleFormData = JSON.parse(JSON.stringify(newData));
}
},
classesJson(newData) {
const that = this;
if (newData.length) {
that.getClassifyData();
}
} }
}, },
mounted() { mounted() {
const that = this; const that = this;
// console.log(that.attenceGroupId);
that.getClassifyData(); that.getClassifyData();
if (that.attenceGroupId) { if (that.attenceGroupId) {
that.getRangeData(); that.getRangeData();
} }
if (that.attenceGroupData) {
that.ruleFormData = JSON.parse(JSON.stringify(that.attenceGroupData));
}
if (that.classesJson.length) {
that.getClassifyData();
}
that.customDialog = that.rangeShow; that.customDialog = that.rangeShow;
} }
}; };
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped>
.range-classes {
margin-top: 20px;
padding: 10px 19px;
background: rgba(247, 248, 250, 1);
li {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
}
</style>
...@@ -193,21 +193,21 @@ ...@@ -193,21 +193,21 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item v-if="ruleFormData.attenceType == 2" label="排班周期:" prop=""> <el-form-item v-if="ruleFormData.attenceType == 2 && ruleFormData.classesJson.length" label="排班周期:" prop="">
<div v-if="!ruleFormData.attenceClassesRangeJSON.length" class="classes-btn"> <div v-if="!ruleFormData.attenceClassesRangeJSON.length" class="classes-btn">
<el-button type="primary" plain @click="toShowRangeMult">请设置排班周期</el-button> <el-button type="primary" plain @click="toShowRangeMult">请设置排班周期</el-button>
</div> </div>
<el-table v-else :data="ruleFormData.attenceClassesRangeJSON" tooltip-effect="dark" style="width: 567px"> <el-table v-else :data="ruleFormData.attenceClassesRangeJSON" tooltip-effect="dark" style="width: 567px">
<el-table-column prop="ranageName" label="周期名称"> <el-table-column prop="ranageName" label="周期名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.ranageName }}</template> <template slot-scope="scope">{{ scope.row.rangeName }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="周期班次"> <el-table-column prop="name" label="周期班次" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(item, index) in scope.row.classessTimesJson" :key="index + 'time'">{{ item.startTime }}-{{ item.endTime }}</div> <span v-for="(item, index) in scope.row.classesList" :key="index + 'time'">{{ index > 1 ? '-' : '' }}{{ item.classesName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="ranageName" label="周期天数"> <el-table-column prop="ranageName" label="周期天数">
<template slot-scope="scope">{{ scope.row.ranageName }}</template> <template slot-scope="scope">{{ scope.row.day }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" show-overflow-tooltip> <el-table-column prop="address" label="操作" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -249,7 +249,8 @@ ...@@ -249,7 +249,8 @@
<el-form-item> <el-form-item>
<div class="btn-wrap"> <div class="btn-wrap">
<el-button @click="cancelSend" plain>取消</el-button> <el-button @click="cancelSend" plain>取消</el-button>
<el-button @click="toSubmit('noteForm')" type="primary">保存</el-button> <el-button v-if="ruleFormData.attenceType == 1" @click="toSubmit('noteForm', '1')" type="primary">保存</el-button>
<el-button v-if="ruleFormData.attenceType == 2" @click="toSubmit('noteForm', '2')" type="primary">保存设置,开始排班 </el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -273,7 +274,7 @@ ...@@ -273,7 +274,7 @@
<class-select :workClassShow="workClassShow" :classesId="classesId" @hideClassDialog="hideClassDialog"> </class-select> <class-select :workClassShow="workClassShow" :classesId="classesId" @hideClassDialog="hideClassDialog"> </class-select>
<map-select :mapShow="mapShow" @hideMapDialog="hideMapDialog"> </map-select> <map-select :mapShow="mapShow" @hideMapDialog="hideMapDialog"> </map-select>
<class-select-mult :workClassMultShow="workClassMultShow" :classesData="ruleFormData.classesJson" @hideMultClassDialog="hideMultClassDialog"> </class-select-mult> <class-select-mult :workClassMultShow="workClassMultShow" :classesData="ruleFormData.classesJson" @hideMultClassDialog="hideMultClassDialog"> </class-select-mult>
<cycle-set :rangeShow="rangeShow" :attenceGroupId="$route.query.attenceGroupId" @hideCycleDialog="hideCycleDialog"> </cycle-set> <cycle-set :rangeShow="rangeShow" :classesJson="classesJson" :attenceGroupData="attenceGroupData" :attenceGroupId="$route.query.attenceGroupId" @hideCycleDialog="hideCycleDialog"> </cycle-set>
</div> </div>
</template> </template>
<script> <script>
...@@ -431,6 +432,26 @@ export default { ...@@ -431,6 +432,26 @@ export default {
mapShow: false, mapShow: false,
// 周期 // 周期
rangeShow: false, rangeShow: false,
classesJson: [],
attenceGroupData: {
classesRangeId: '',
day: 3,
rangeName: '',
classesList: [
{
classesId: '',
classesName: ''
},
{
classesId: '',
classesName: ''
},
{
classesId: '',
classesName: ''
}
]
},
workClassMultShow: false workClassMultShow: false
}; };
}, },
...@@ -441,13 +462,18 @@ export default { ...@@ -441,13 +462,18 @@ export default {
*/ */
toShowRangeMult() { toShowRangeMult() {
const that = this; const that = this;
that.classesJson = JSON.parse(JSON.stringify(that.ruleFormData.classesJson));
that.rangeShow = true; that.rangeShow = true;
}, },
hideCycleDialog(val) { hideCycleDialog(val) {
const that = this; const that = this;
// console.log(val); console.log(val);
that.rangeShow = false; that.rangeShow = false;
that.ruleFormData.attenceClassesRangeJSON = val; if (!val) {
return false;
}
that.ruleFormData.attenceClassesRangeJSON = JSON.parse(JSON.stringify([val]));
that.$forceUpdate();
}, },
/** /**
* 排班选择班次 * 排班选择班次
...@@ -465,12 +491,15 @@ export default { ...@@ -465,12 +491,15 @@ export default {
return false; return false;
} }
that.ruleFormData.classesJson = JSON.parse(JSON.stringify(val)); that.ruleFormData.classesJson = JSON.parse(JSON.stringify(val));
that.classesJson = JSON.parse(JSON.stringify(val));
}, },
/** /**
* 周期 * 周期
*/ */
editRange(index, row) { editRange(index, row) {
const that = this; const that = this;
that.classesJson = JSON.parse(JSON.stringify(that.ruleFormData.classesJson));
that.attenceGroupData = JSON.parse(JSON.stringify(row));
that.rangeShow = true; that.rangeShow = true;
}, },
/** /**
...@@ -669,7 +698,7 @@ export default { ...@@ -669,7 +698,7 @@ export default {
/** /**
* 保存 * 保存
*/ */
toSubmit(formName) { toSubmit(formName,type) {
const that = this; const that = this;
let adminStructor = []; let adminStructor = [];
if (that.ruleFormData.attenceRangeType && that.ruleFormData.adminList.length) { if (that.ruleFormData.attenceRangeType && that.ruleFormData.adminList.length) {
...@@ -746,7 +775,11 @@ export default { ...@@ -746,7 +775,11 @@ export default {
console.log(that.ruleFormData); console.log(that.ruleFormData);
that.$refs[formName].validate(valid => { that.$refs[formName].validate(valid => {
if (valid) { if (valid) {
that.showEffect = true; if (that.$route.query.attenceGroupId) {
that.sendData(formName, 1)
}else{
that.showEffect = true;
}
} }
}) })
}, },
...@@ -808,6 +841,7 @@ export default { ...@@ -808,6 +841,7 @@ export default {
if (ele.classessTimesJson) { if (ele.classessTimesJson) {
ele.classessTimesJson = JSON.parse(ele.classessTimesJson); ele.classessTimesJson = JSON.parse(ele.classessTimesJson);
} }
}); });
} }
that.classifyList = resData.result.list || []; that.classifyList = resData.result.list || [];
...@@ -871,6 +905,7 @@ export default { ...@@ -871,6 +905,7 @@ export default {
ele.workType = ele.workType==1? true : false; ele.workType = ele.workType==1? true : false;
}) })
} }
that.mustSelection = data.result.adminList; that.mustSelection = data.result.adminList;
that.mustStoreList = data.result.storeList; that.mustStoreList = data.result.storeList;
that.noSelection = data.result.noAdminList; that.noSelection = data.result.noAdminList;
......
...@@ -44,7 +44,16 @@ ...@@ -44,7 +44,16 @@
</el-table-column> </el-table-column>
<el-table-column prop="" label="考勤时间" show-overflow-tooltip> <el-table-column prop="" label="考勤时间" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.attenceTimeDesc }} <div v-if="scope.row.attenceType == 1">
<div v-for="(item, index) in scope.row.attenceWorkJson" :key="index + 'json'">
<span>{{ weekDays[item.weekDay] }}</span>
<span>{{ item.classesName }}</span>
<span v-if="!!item.classessTimesJson">
<span v-for="(child, cindex) in item.classessTimesJson" :key="cindex"> {{ child.startTime }}-{{ child.endTime }} </span>
</span>
</div>
</div>
<div v-if="scope.row.attenceType == 2"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="最近更新时间" show-overflow-tooltip> <el-table-column prop="" label="最近更新时间" show-overflow-tooltip>
...@@ -142,6 +151,15 @@ export default { ...@@ -142,6 +151,15 @@ export default {
activeGroup: this.activeGroupId, // 商户(品牌) groupId activeGroup: this.activeGroupId, // 商户(品牌) groupId
enterpriseId: JSON.parse(localStorage.getItem('userInfo')).enterpriseId, enterpriseId: JSON.parse(localStorage.getItem('userInfo')).enterpriseId,
// 搜索 // 搜索
weekDays: {
'0': '周日',
'1': '周一',
'2': '周二',
'3': '周三',
'4': '周四',
'5': '周五',
'6': '周六'
},
conditionObj: { conditionObj: {
attenceGroupName: '', attenceGroupName: '',
classesName: '' classesName: ''
...@@ -315,6 +333,22 @@ export default { ...@@ -315,6 +333,22 @@ export default {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
if (that.activeName == 'first') { if (that.activeName == 'first') {
if(resData.result.list && resData.result.list.length) {
resData.result.list.forEach(ele => {
if (ele.attenceWorkJson) {
ele.attenceWorkJson = JSON.parse(ele.attenceWorkJson)
}
})
resData.result.list.forEach(ele => {
console.log(ele.attenceWorkJson)
if (!!ele.attenceWorkJson && ele.attenceWorkJson.length) {
ele.attenceWorkJson.forEach(child => {
child.classessTimesJson = child.classessTimesJson? JSON.parse(child.classessTimesJson): []
});
}
})
}
console.log(resData.result.list)
that.groupListData = resData.result.list || []; that.groupListData = resData.result.list || [];
that.classifyList = []; that.classifyList = [];
}else { }else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment