Commit 848a6202 by 无尘

fix: 修改班次

parent b379d80b
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link href=./static/css/app.0618c35f1ac19ab3a5e60a3daa42f2f6.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.6bcb8847b794a526153a.js></script><script type=text/javascript src=./static/js/vendor.0000e68e65e4a9dc3840.js></script><script type=text/javascript src=./static/js/app.1b0d1c4a3af4aeb6c6a1.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.e48b0cc01af08a5f0d0acdab32dd2797.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.cd03d453a72b4d463e9c.js></script><script type=text/javascript src=./static/js/vendor.0000e68e65e4a9dc3840.js></script><script type=text/javascript src=./static/js/app.1b0d1c4a3af4aeb6c6a1.js></script></body></html>
\ No newline at end of file \ No newline at end of file
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,b,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],d[t]&&u.push(d[t][0]),d[t]=0;for(r in b)Object.prototype.hasOwnProperty.call(b,r)&&(e[r]=b[r]);for(c&&c(a,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var a={},d={103:0};function f(c){if(a[c])return a[c].exports;var d=a[c]={i:c,l:!1,exports:{}};return e[c].call(d.exports,d,d.exports,f),d.l=!0,d.exports}f.e=function(e){var c=d[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,f){c=d[e]=[a,f]});c[2]=a;var b=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:"2baca21202cf454cd7b0",1:"fe9dec1f31b04053fd7e",2:"54aabab28c7735d34c10",3:"b7e6d57d97174b75b050",4:"11254d7e3a102121b8ec",5:"b5e24a58d047a2ec70f5",6:"124ad8222f7b043b44ae",7:"ebad93a8c5bffffd9e98",8:"f1c9fb5c9212483138d8",9:"b5aae16b3951516573ad",10:"ebbed2d956a1376f014a",11:"59c7813cc972f62b1d18",12:"879536ae7ce46f0c54ec",13:"57e51fc1b6342003f25d",14:"dce1b92c12422c24e840",15:"edc4bcf9ced54c365562",16:"f483f95dbac654c7de5a",17:"ff6edf624b982c354977",18:"d50ec99b96f7acbb4d42",19:"d7d09ae4564d64842009",20:"455fd80bd8af15457c57",21:"c1b5e15e28768af52654",22:"2a873e819c6c369d5cd1",23:"d2380bf3c276e741313b",24:"56085041ae784faf3c32",25:"e23f42a6b2180b63c129",26:"606394f2e20eb1a455fa",27:"4a1c52078d154a141023",28:"70cb3f87bd69723dbd41",29:"c5bb15e8e1bd17cdc0f7",30:"feb81cd112a60d4701eb",31:"20f69d688df3827843c5",32:"0c7863fa05e5c75053c3",33:"f4e32fc6846aa744ee48",34:"0fb2eb67d47b9ecbd519",35:"e64c33855b455bcdd9a2",36:"8615782328f743c5f783",37:"8d599976023acb79bef4",38:"6620399d71206af0621b",39:"d4c5c80a09712ce552be",40:"2437eb589d6ed60c9252",41:"17121c9227dddf24b37d",42:"54f2f4850c109391114a",43:"fb46c0bad10552e7ef89",44:"3d32c7e1954754671303",45:"c0accd45711184d0044d",46:"785c8076b8d217da747e",47:"b477848570e876912bdb",48:"32a6d29de6b93cd9201c",49:"1a7182d9cdf2e08ff7f0",50:"4235ecfe09e1fc4e1ca4",51:"2f363aaad04264e9f159",52:"d56e883ddcbef7c6b221",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:"6583c4b0dc7a8f908fa2",89:"8d513b9c9d7970a612c0",90:"57319965505945b3ae7e",91:"446342439ce97b19c84f",92:"09a5823b00d6180576b9",93:"e801fdd8bbd27a68d8ee",94:"c50da77d4e1d5a44b971",95:"04507f6fadd31b01a746",96:"d4a4beef007fa347bd93",97:"8b0f08b3974b32d7bc2a",98:"69c8efc82743796dc255",99:"58cc1884c4f80303999a",102:"2c7e1d628bd2f4ac709c"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var c=d[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),d[e]=void 0)}return n.onerror=n.onload=t,b.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,b,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],d[t]&&u.push(d[t][0]),d[t]=0;for(r in b)Object.prototype.hasOwnProperty.call(b,r)&&(e[r]=b[r]);for(c&&c(a,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var a={},d={103:0};function f(c){if(a[c])return a[c].exports;var d=a[c]={i:c,l:!1,exports:{}};return e[c].call(d.exports,d,d.exports,f),d.l=!0,d.exports}f.e=function(e){var c=d[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,f){c=d[e]=[a,f]});c[2]=a;var b=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:"2baca21202cf454cd7b0",1:"fe9dec1f31b04053fd7e",2:"54aabab28c7735d34c10",3:"b7e6d57d97174b75b050",4:"11254d7e3a102121b8ec",5:"b5e24a58d047a2ec70f5",6:"124ad8222f7b043b44ae",7:"ebad93a8c5bffffd9e98",8:"f1c9fb5c9212483138d8",9:"b5aae16b3951516573ad",10:"ebbed2d956a1376f014a",11:"59c7813cc972f62b1d18",12:"879536ae7ce46f0c54ec",13:"57e51fc1b6342003f25d",14:"dce1b92c12422c24e840",15:"d7df4d8b6f2781d87acc",16:"f483f95dbac654c7de5a",17:"ff6edf624b982c354977",18:"d50ec99b96f7acbb4d42",19:"d7d09ae4564d64842009",20:"455fd80bd8af15457c57",21:"c1b5e15e28768af52654",22:"2a873e819c6c369d5cd1",23:"d2380bf3c276e741313b",24:"56085041ae784faf3c32",25:"e23f42a6b2180b63c129",26:"606394f2e20eb1a455fa",27:"4a1c52078d154a141023",28:"70cb3f87bd69723dbd41",29:"c5bb15e8e1bd17cdc0f7",30:"491a34d95550f930cbcc",31:"20f69d688df3827843c5",32:"0c7863fa05e5c75053c3",33:"f4e32fc6846aa744ee48",34:"0fb2eb67d47b9ecbd519",35:"e64c33855b455bcdd9a2",36:"8615782328f743c5f783",37:"8d599976023acb79bef4",38:"6620399d71206af0621b",39:"d4c5c80a09712ce552be",40:"2437eb589d6ed60c9252",41:"17121c9227dddf24b37d",42:"54f2f4850c109391114a",43:"fb46c0bad10552e7ef89",44:"3d32c7e1954754671303",45:"c0accd45711184d0044d",46:"785c8076b8d217da747e",47:"b477848570e876912bdb",48:"32a6d29de6b93cd9201c",49:"1a7182d9cdf2e08ff7f0",50:"4235ecfe09e1fc4e1ca4",51:"2f363aaad04264e9f159",52:"d56e883ddcbef7c6b221",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:"6583c4b0dc7a8f908fa2",89:"8d513b9c9d7970a612c0",90:"57319965505945b3ae7e",91:"446342439ce97b19c84f",92:"09a5823b00d6180576b9",93:"e801fdd8bbd27a68d8ee",94:"c50da77d4e1d5a44b971",95:"04507f6fadd31b01a746",96:"d4a4beef007fa347bd93",97:"8b0f08b3974b32d7bc2a",98:"69c8efc82743796dc255",99:"58cc1884c4f80303999a",102:"2c7e1d628bd2f4ac709c"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var c=d[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),d[e]=void 0)}return n.onerror=n.onload=t,b.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}}([]);
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-12-17 09:40:42 * @Date: 2019-12-17 09:40:42
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2019-12-25 19:44:41 * @LastEditTime : 2019-12-26 15:17:20
--> -->
<!-- <!--
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
customConfirm: _debounce(async function() { customConfirm: _debounce(async function() {
const that = this; const that = this;
that.customDialog = false; that.customDialog = false;
if (!that.selClassesId) { if (!that.selClassesId && that.selClassesId != -1) {
showMsg.showmsg('请选择班次', 'warning'); showMsg.showmsg('请选择班次', 'warning');
return false; return false;
} }
...@@ -155,6 +155,7 @@ export default { ...@@ -155,6 +155,7 @@ export default {
}); });
} }
that.tableData = resData.result || []; that.tableData = resData.result || [];
that.tableData.push({ workType: false, classesName: '休息', classesId: '-1', classessTimesJson: [] });
return false; return false;
} }
errMsg.errorMsg(resData); errMsg.errorMsg(resData);
...@@ -174,7 +175,7 @@ export default { ...@@ -174,7 +175,7 @@ export default {
}, },
classesId(newData) { classesId(newData) {
const that = this; const that = this;
if (newData) { if (newData || newData == '-1') {
that.selClassesId = newData; that.selClassesId = newData;
} else { } else {
that.selClassesId = ''; that.selClassesId = '';
...@@ -184,7 +185,7 @@ export default { ...@@ -184,7 +185,7 @@ export default {
mounted() { mounted() {
const that = this; const that = this;
that.getClassifyData(); that.getClassifyData();
if (that.classesId) { if (that.classesId || that.classesId == '-1') {
that.selClassesId = that.classesId; that.selClassesId = that.classesId;
} else { } else {
that.selClassesId = ''; that.selClassesId = '';
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-10-21 14:27:29 * @Date: 2019-10-21 14:27:29
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2019-12-25 18:30:01 * @LastEditTime : 2019-12-26 14:45:28
--> -->
<!-- <!--
...@@ -38,7 +38,7 @@ import createWorkClass from '@/components/app/dailyAttendance/create-work-class. ...@@ -38,7 +38,7 @@ import createWorkClass from '@/components/app/dailyAttendance/create-work-class.
<span class="font-12 color-606266">上班</span> <span class="font-12 color-606266">上班</span>
<el-time-picker :clearable="false" :editable="false" class="w-106" v-model="item.startTime" format="HH:mm" value-format="HH:mm" @change="changeStart($event, item)"> </el-time-picker> <el-time-picker :clearable="false" :editable="false" class="w-106" v-model="item.startTime" format="HH:mm" value-format="HH:mm" @change="changeStart($event, item)"> </el-time-picker>
<span class="font-12 color-606266">下班</span> <span class="font-12 color-606266">下班</span>
<el-time-picker :clearable="false" :editable="false" class="w-106" v-model="item.endTime" format="HH:mm" value-format="HH:mm" @change="changeEnd($event, item)"> </el-time-picker> <el-time-picker :clearable="false" :editable="false" :picker-options="{ selectableRange: endAableRange }" class="w-106" v-model="item.endTime" format="HH:mm" value-format="HH:mm" @change="changeEnd($event, item)"> </el-time-picker>
<el-tag v-if="Number(item.endTime.split(':')[0]) <= Number(item.startTime.split(':')[0]) && Number(item.endTime.split(':')[1]) <= Number(item.startTime.split(':')[1])" class="across-tag" type="danger">次日</el-tag> <el-tag v-if="Number(item.endTime.split(':')[0]) <= Number(item.startTime.split(':')[0]) && Number(item.endTime.split(':')[1]) <= Number(item.startTime.split(':')[1])" class="across-tag" type="danger">次日</el-tag>
</li> </li>
</ul> </ul>
...@@ -58,7 +58,7 @@ import createWorkClass from '@/components/app/dailyAttendance/create-work-class. ...@@ -58,7 +58,7 @@ import createWorkClass from '@/components/app/dailyAttendance/create-work-class.
</div> </div>
<div class="cell m-t-20"> <div class="cell m-t-20">
<span class="font-12 color-606266">下班</span> <span class="font-12 color-606266">下班</span>
<el-time-picker :clearable="false" :editable="false" class="w-106" v-model="scope.row.endTime" format="HH:mm" value-format="HH:mm" @change="changeEnd($event, scope.row)"> </el-time-picker> <el-time-picker :clearable="false" :editable="false" :picker-options="{ selectableRange: endAableRange }" class="w-106" v-model="scope.row.endTime" format="HH:mm" value-format="HH:mm" @change="changeEnd($event, scope.row)"> </el-time-picker>
<el-tag v-if="checkNextFlag(scope.row.startTime, scope.row.endTime)" class="across-tag" type="danger">次日</el-tag> <el-tag v-if="checkNextFlag(scope.row.startTime, scope.row.endTime)" class="across-tag" type="danger">次日</el-tag>
</div> </div>
</template> </template>
...@@ -267,12 +267,29 @@ export default { ...@@ -267,12 +267,29 @@ export default {
classesName: [{ required: true, message: '请输入班次名称', trigger: 'blur' }], classesName: [{ required: true, message: '请输入班次名称', trigger: 'blur' }],
times: [{ required: true, validator: checkTime, trigger: 'change' }] times: [{ required: true, validator: checkTime, trigger: 'change' }]
}, },
endAableRange: [], // 下班时间点设置
// 动态计算晚到时间 // 动态计算晚到时间
maxLate: 10.0 maxLate: 10.0
}; };
}, },
methods: { methods: {
/** /**
* 设置下班时间区间
*/
async setEndRange() {
const that = this;
const start = that.formData.classessTimesJson[0].startTime;
if (start == '00:00') {
that.endAableRange = ['00:01:00 - 23:59:00'];
} else if (start == '23:59') {
that.endAableRange = ['00:00:00 - 23:58:00'];
} else {
const startA = await that.hmMinuxhm(start, '00:01');
const startB = await that.hmPlushm(start, '00:01');
that.endAableRange = ['00:00:00 - ' + startA + ':00', startB + ':00' + '-23:59:00'];
}
},
/**
* 判断次日 * 判断次日
*/ */
checkNextFlag(start, end) { checkNextFlag(start, end) {
...@@ -536,6 +553,7 @@ export default { ...@@ -536,6 +553,7 @@ export default {
async changeStart(e, item) { async changeStart(e, item) {
const that = this; const that = this;
await that.setLateHours(); await that.setLateHours();
await that.setEndRange();
// 计算当前禁用时间段 // 计算当前禁用时间段
item.forbidStartBeginTime = await that.forbidStartBeginTime(item); item.forbidStartBeginTime = await that.forbidStartBeginTime(item);
item.forbidStartEndTime = await that.forbidStartEndTime(item); item.forbidStartEndTime = await that.forbidStartEndTime(item);
...@@ -978,6 +996,7 @@ export default { ...@@ -978,6 +996,7 @@ export default {
await that.setDefaultRangeData(); await that.setDefaultRangeData();
} }
await that.setLateHours(); await that.setLateHours();
await that.setEndRange();
}, },
/** /**
* 获取编辑数据 * 获取编辑数据
...@@ -1076,6 +1095,7 @@ export default { ...@@ -1076,6 +1095,7 @@ export default {
const that = this; const that = this;
that.customDialog = that.workClassShow; that.customDialog = that.workClassShow;
await that.setLateHours(); await that.setLateHours();
await that.setEndRange();
if (that.classesId) { if (that.classesId) {
that.conditionObj.classesId = that.classesId; that.conditionObj.classesId = that.classesId;
that.getData(); that.getData();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-04-12 17:56:45 * @Date: 2019-04-12 17:56:45
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2019-12-26 13:57:00 * @LastEditTime : 2019-12-26 15:25:33
--> -->
<template> <template>
<div class="notice-list-wrap"> <div class="notice-list-wrap">
...@@ -514,8 +514,6 @@ export default { ...@@ -514,8 +514,6 @@ export default {
}, },
hideMapDialog(obj) { hideMapDialog(obj) {
const that = this; const that = this;
/* eslint-disable */
console.log(obj);
that.mapShow = false; that.mapShow = false;
if (!obj) { if (!obj) {
return false; return false;
...@@ -540,11 +538,9 @@ export default { ...@@ -540,11 +538,9 @@ export default {
}, },
modClasses(index, row) { modClasses(index, row) {
const that = this; const that = this;
/* eslint-disable*/
console.log(row);
that.modIndex = index; that.modIndex = index;
that.modRow = row; that.modRow = row;
that.classesId = row.classesId || ''; that.classesId = row.classesId == -1 ? String(row.classesId) : row.classesId || '';
that.workClassShow = true; that.workClassShow = true;
}, },
hideClassDialog(val) { hideClassDialog(val) {
...@@ -554,7 +550,7 @@ export default { ...@@ -554,7 +550,7 @@ export default {
if (!val) { if (!val) {
return false; return false;
} }
that.modRow.workType = true; that.modRow.workType = val.classesId == -1 ? false : true;
const obj = JSON.parse(JSON.stringify(val)); const obj = JSON.parse(JSON.stringify(val));
that.modRow.classesName = obj.classesName; that.modRow.classesName = obj.classesName;
that.modRow.classesId = obj.classesId; that.modRow.classesId = obj.classesId;
...@@ -643,7 +639,6 @@ export default { ...@@ -643,7 +639,6 @@ export default {
handleMustList(group) { handleMustList(group) {
// type: 1:员工,2:部门,3:门店; // type: 1:员工,2:部门,3:门店;
const that = this; const that = this;
console.log(group);
if (that.mustType === 'store') { if (that.mustType === 'store') {
that.ruleFormData.storeList = group; that.ruleFormData.storeList = group;
that.mustStoreList = group; that.mustStoreList = group;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2019-12-24 15:59:57 * @LastEditTime : 2019-12-26 14:58:35
--> -->
<!-- <!--
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
const that = this; const that = this;
that.pageSize = 20; that.pageSize = 20;
that.currentPage = 1; that.currentPage = 1;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, },
/** /**
* 新建考勤组 * 新建考勤组
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
that.workClassShow = false; that.workClassShow = false;
that.classesId = ''; that.classesId = '';
that.currentPage = 1; that.currentPage = 1;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, },
/** /**
* 删除 * 删除
...@@ -271,7 +271,7 @@ export default { ...@@ -271,7 +271,7 @@ export default {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success'); showMsg.showmsg('删除成功', 'success');
that.getTableList(); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
return; return;
} }
errMsg.errorMsg(resData); errMsg.errorMsg(resData);
...@@ -290,18 +290,18 @@ export default { ...@@ -290,18 +290,18 @@ export default {
toInput: _debounce(function(e, value) { toInput: _debounce(function(e, value) {
const that = this; const that = this;
that.currentPage = 1; that.currentPage = 1;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, 500), }, 500),
// 搜索清除 // 搜索清除
clearInput() { clearInput() {
const that = this; const that = this;
that.currentPage = 1; that.currentPage = 1;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, },
changeCondition() { changeCondition() {
const that = this; const that = this;
that.currentPage = 1; that.currentPage = 1;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, },
/** /**
...@@ -310,7 +310,7 @@ export default { ...@@ -310,7 +310,7 @@ export default {
handleSizeChange(val) { handleSizeChange(val) {
const that = this; const that = this;
that.pageSize = val; that.pageSize = val;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, },
/** /**
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
handleCurrentChange(val) { handleCurrentChange(val) {
const that = this; const that = this;
that.currentPage = val; that.currentPage = val;
that.getTableList(that.brandId); that.activeName == 'first' ? that.getTableList(that.brandId) : that.getClassesList(that.brandId);
}, },
/** /**
...@@ -335,47 +335,67 @@ export default { ...@@ -335,47 +335,67 @@ export default {
pageNum: that.currentPage, pageNum: that.currentPage,
pageSize: that.pageSize pageSize: that.pageSize
}; };
postRequest(that.activeName == 'first'?'/haoban-app-attence-web/attence-list' :'/haoban-app-attence-web/classes-page', para) postRequest('/haoban-app-attence-web/attence-list', para)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
if (that.activeName == 'first') { if(resData.result.list && resData.result.list.length) {
if(resData.result.list && resData.result.list.length) { resData.result.list.forEach(ele => {
resData.result.list.forEach(ele => { if (ele.attenceWorkJson) {
if (ele.attenceWorkJson) { ele.attenceWorkJson = JSON.parse(ele.attenceWorkJson)
ele.attenceWorkJson = JSON.parse(ele.attenceWorkJson) }
} if (!!ele.classesJson) {
if (!!ele.classesJson) { ele.classesJson = JSON.parse(ele.classesJson)
ele.classesJson = JSON.parse(ele.classesJson) }
} })
}) resData.result.list.forEach(ele => {
resData.result.list.forEach(ele => { if (!!ele.attenceWorkJson && ele.attenceWorkJson.length) {
if (!!ele.attenceWorkJson && ele.attenceWorkJson.length) { ele.attenceWorkJson.forEach(child => {
ele.attenceWorkJson.forEach(child => { child.classessTimesJson = child.classessTimesJson? JSON.parse(child.classessTimesJson): []
child.classessTimesJson = child.classessTimesJson? JSON.parse(child.classessTimesJson): [] });
}); }
} if (!!ele.classesJson&& ele.classesJson.length) {
if (!!ele.classesJson&& ele.classesJson.length) { ele.classesJson.forEach(child => {
ele.classesJson.forEach(child => { child.classessTimesJson = child.classessTimesJson? JSON.parse(child.classessTimesJson): []
child.classessTimesJson = child.classessTimesJson? JSON.parse(child.classessTimesJson): [] })
}) }
} })
})
}
console.log(resData.result.list)
that.groupListData = resData.result.list || [];
that.classifyList = [];
}else {
that.groupListData = [];
if(resData.result.list && resData.result.list.length) {
resData.result.list.forEach(ele => {
if (ele.classessTimesJson) {
ele.classessTimesJson = JSON.parse(ele.classessTimesJson)
}
})
}
that.classifyList = resData.result.list || [];
} }
that.groupListData = resData.result.list || [];
that.total = resData.result.total;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
getClassesList(brandId) {
const that = this;
let para = {
brandId: brandId || that.activeBrand,
enterpriseId: that.enterpriseId,
attenceGroupName: that.conditionObj.attenceGroupName,
classesName: that.conditionObj.classesName,
pageNum: that.currentPage,
pageSize: that.pageSize
};
postRequest('/haoban-app-attence-web/classes-page', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
if(resData.result.list && resData.result.list.length) {
resData.result.list.forEach(ele => {
if (ele.classessTimesJson) {
ele.classessTimesJson = JSON.parse(ele.classessTimesJson)
}
})
}
that.classifyList = resData.result.list || [];
that.total = resData.result.total; that.total = resData.result.total;
return; return;
} }
......
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