排班及bug

This commit is contained in:
朱菊兰 2023-09-18 14:49:03 +08:00
부모 eff5e0d1e1
커밋 0371859d14
10개의 변경된 파일79개의 추가작업 그리고 186개의 파일을 삭제

파일 보기

@ -172,6 +172,7 @@ export default {
this.getTypeList() this.getTypeList()
this.getObjTree() this.getObjTree()
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value //
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
}, },
methods: { methods: {
getTypeList() { getTypeList() {
@ -276,7 +277,7 @@ export default {
this.$modal.msgError('请选择能源类型') this.$modal.msgError('请选择能源类型')
return false return false
} }
if (!this.objArr.length === 0) { if (this.objArr.length === 0) {
this.$modal.msgError('请选择对象') this.$modal.msgError('请选择对象')
return false return false
} else { } else {

파일 보기

@ -37,16 +37,6 @@ export default {
this.chartData = [] this.chartData = []
} }
}) })
// getEnergyTrend({
// energyTypeId: "1681183397517406210",
// objId: "1679031282510532610",
// timeDim: "2",
// startTime: "1690732800000",
// endTime: "1690992000000"
// }).then((res) => {
// console.log(res)
// this.chartData = res.data
// })
}, },
switchChart() { switchChart() {
if (this.activeName === 'bar') { if (this.activeName === 'bar') {

파일 보기

@ -92,7 +92,7 @@ export default {
type: 'input', type: 'input',
label: '标识名', label: '标识名',
placeholder: '标识名', placeholder: '标识名',
param: 'name' param: 'cnName'
}, },
{ {
type: 'button', type: 'button',
@ -149,7 +149,7 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null cnName: null
}, },
paramVisible: false, paramVisible: false,
energyTypeList: [], energyTypeList: [],
@ -173,7 +173,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.name = val.name this.queryParams.cnName = val.cnName
this.getList() this.getList()
break break
default: default:

파일 보기

@ -47,7 +47,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="消耗量阈值" prop="limitValue"> <el-form-item label="消耗量阈值" prop="limitValue">
<el-input v-model="form.limitValue"></el-input> <el-input-number v-model="form.limitValue" :min="0" :max="10000000000000000" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>

파일 보기

@ -118,16 +118,16 @@ export default {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
}) })
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()] if (this.$route.params.startTime && this.$route.params.endTime) {
this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
} else {
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[2].defaultSelect[0] this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
this.queryParams.endTime = this.formConfig[2].defaultSelect[1] this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
this.getList() this.getList()
this.getTypeList() this.getTypeList()
}, },
mounted() {
console.log(this.$route.params.name)
console.log('22222')
},
methods: { methods: {
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {

파일 보기

@ -75,7 +75,7 @@ export default {
{ {
type: 'input', type: 'input',
label: '参数名称', label: '参数名称',
placeholder: '方案名称', placeholder: '参数名称',
param: 'paramName' param: 'paramName'
}, },
{ {

파일 보기

@ -46,7 +46,7 @@
format='HH:mm' format='HH:mm'
value-format='HH:mm' value-format='HH:mm'
style="width: 100%;" style="width: 100%;"
@change="timeFun" @change="timeFun('start')"
> >
</el-time-picker> </el-time-picker>
</el-form-item> </el-form-item>
@ -58,7 +58,7 @@
format='HH:mm' format='HH:mm'
value-format='HH:mm' value-format='HH:mm'
style="width: 100%;" style="width: 100%;"
@change="timeFun" @change="timeFun('end')"
> >
</el-time-picker> </el-time-picker>
</el-form-item> </el-form-item>
@ -126,12 +126,19 @@ export default {
}) })
} }
}, },
timeFun() { timeFun(val) {
if (this.form.startTime && this.form.endTime) { if (this.form.startTime && this.form.endTime) {
if (this.form.startTime > this.form.endTime) { if (this.form.startTime > this.form.endTime) {
this.form.daySpan = 1 this.form.daySpan = 1
} else { } else if (this.form.startTime < this.form.endTime) {
this.form.daySpan = 0 this.form.daySpan = 0
} else {
if (val === 'start') {
this.form.startTime = ''
} else {
this.form.endTime = ''
}
this.$modal.msgWarning('班次开始时间和结束时间不能相同')
} }
} }
}, },

파일 보기

@ -116,7 +116,17 @@ export default {
: undefined, : undefined,
{ {
type: 'cancel', type: 'cancel',
btnName: '作废' btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: '不可用'
}
]
}
}, },
this.$auth.hasPermi('base:group-classes:delete') this.$auth.hasPermi('base:group-classes:delete')
? { ? {
@ -225,8 +235,9 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
if (row.status) { console.log(row)
let _this = this let _this = this
if (row.status === '可用') {//
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() { _this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() {
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() { return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
return deleteGroupClasses(row.id); return deleteGroupClasses(row.id);

파일 보기

@ -7,7 +7,7 @@
<el-input v-model="form.code" disabled></el-input> <el-input v-model="form.code" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="班组人数" prop="num"> <el-form-item label="班组人数" prop="num">
<el-input v-model="form.num"></el-input> <el-input-number v-model="form.num" :min="1" :max="99999999" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="班组组长" prop="leaderName"> <el-form-item label="班组组长" prop="leaderName">
<el-input v-model="form.leaderName"></el-input> <el-input v-model="form.leaderName"></el-input>

파일 보기

@ -37,7 +37,6 @@
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button>
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button> <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button>
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button> <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button>
<el-button type="primary" size="small" @click="aaa">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -66,7 +65,7 @@
</div> </div>
<!-- 不能选择班组 --> <!-- 不能选择班组 -->
<div class="toggle-icon-hide" v-show="!(showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true))"></div> <div class="toggle-icon-hide" v-show="!(showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true))"></div>
<el-select v-model="item.teamId" size='small' :disabled="!showSetting || (new Date(data.day).valueOf() > new Date().valueOf() ? false: true)" @change="a"> <el-select v-model="item.teamId" size='small' :disabled="!showSetting || (new Date(data.day).valueOf() > new Date().valueOf() ? false: true)">
<el-option <el-option
v-for="i in teamList" v-for="i in teamList"
:key="i.id" :key="i.id"
@ -100,129 +99,7 @@ export default {
year: '',// 2023 year: '',// 2023
month: '',// month: '',//
monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"], monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
// list: { list: {},
// 1:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-01",
// startTime: 1690848000000,
// teamId: "1685934333821423617",
// teamName: "S"
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-01",
// startTime: 1690894000000,
// teamId: "1685926036653445121",
// teamName: "test3"
// }
// ],
// 2:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-02",
// startTime: 1690848000000,
// teamId: "1685934333821423617",
// teamName: "S"
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-02",
// startTime: 1690894000000,
// teamId: "1685926036653445121",
// teamName: "test3"
// }
// ],
// 3:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-03",
// startTime: 1690848000000
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-03",
// startTime: 1690894000000
// }
// ],
// 4:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-04",
// startTime: 1690848000000
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-04",
// startTime: 1690894000000
// }
// ],
// 5:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-15",
// startTime: 1690848000000
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-15",
// startTime: 1690894000000
// }
// ],
// 6:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-16",
// startTime: 1690848000000
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-16",
// startTime: 1690894000000
// }
// ],
// 7:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-17",
// startTime: 1690848000000
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-17",
// startTime: 1690894000000
// }
// ],
// 18:[
// {
// classesId: "1674293974662062081",
// endTime: 1690891200000,
// startDay:"2023-09-18",
// startTime: 1690848000000
// },
// {
// classesId: "1674293974662062081",
// endTime: 1690934400000,
// startDay:"2023-09-18",
// startTime: 1690894000000
// }
// ]
// },//
list: [],
teamList: [],// teamList: [],//
showSetting: false,// showSetting: false,//
settingBtnDis: false, settingBtnDis: false,
@ -269,9 +146,19 @@ export default {
year: year, year: year,
month: month month: month
}).then(res => { }).then(res => {
this.list = res.data || [] let obj = res.data || {}
if (obj) {
for (let item in obj) {
for (let i = 0; i < obj[item].length; i++) {
if (!obj[item][i].teamId) {
obj[item][i].teamId = ''
}
}
}
}
this.list = obj
}).catch(() => { }).catch(() => {
this.list = [] this.list = {}
this.settingBtnDis = true // this.settingBtnDis = true //
}) })
}, },
@ -287,10 +174,18 @@ export default {
}, },
// //
confirmSetting() { confirmSetting() {
let num = 0
//
if (moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')) {
num = Number(moment().format('DD'))
} else {
num = 0
}
//
// //
let tempArr = Object.values(this.list) let tempArr = Object.values(this.list)
let arr = [] let arr = []
for (let i = 0; i < tempArr.length; i++) { for (let i = num; i < tempArr.length; i++) {
for (let j = 0; j < tempArr[i].length; j++) { for (let j = 0; j < tempArr[i].length; j++) {
arr.push(tempArr[i][j]) arr.push(tempArr[i][j])
} }
@ -298,6 +193,7 @@ export default {
createOrUpdateList(arr).then(res => { createOrUpdateList(arr).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.showSetting = !this.showSetting this.showSetting = !this.showSetting
this.$modal.msgSuccess("操作成功")
this.getList() // this.getList() //
} }
}) })
@ -314,9 +210,9 @@ export default {
}, },
// //
schedulingBtn() { schedulingBtn() {
let tempData = this.list
// 1 // 1
if (this.list[1][0].teamId) { if (this.list[1][0].teamId) {
console.log('次月1号有值前端排班')
let tempArr = Object.values(this.list) let tempArr = Object.values(this.list)
let arr = [] let arr = []
let n = 0 let n = 0
@ -332,27 +228,24 @@ export default {
} }
} }
} }
console.log(arr) let tempNum = 0
for (let k = 0; k < tempArr.length; k++) { for (let k = 0; k < tempArr.length; k++) {
for (let v = 0; v < tempArr[k].length; v++) { for (let v = 0; v < tempArr[k].length; v++) {
let t = (k*(k+1)+v) % arr.length let t = tempNum % arr.length
// console.log(t)
if (arr.length === 1) { if (arr.length === 1) {
this.list[k+1][v].teamId = arr[0] tempData[k+1][v].teamId = arr[0]
} else { } else {
if (k === 0 && v === 0) { tempData[k+1][v].teamId = arr[t]
this.list[k+1][v].teamId = arr[0]
} else {
this.list[k+1][v].teamId = arr[t]
}
} }
tempNum++
} }
} }
this.list = []
this.list = tempData
} else { } else {
// 1, // 1,
console.log('次月1号没有值接口排班')
autoSet().then(res => { autoSet().then(res => {
this.list = res.data || [] this.list = res.data || {}
}) })
} }
}, },
@ -389,33 +282,24 @@ export default {
switch (val) { switch (val) {
case '1': case '1':
this.$router.push({ this.$router.push({
path: '/core/monitoring/production-line-data', // path: '/core/monitoring/production-line-data',
// name: 'reportDesign', name: 'ProductionLineData',
params: { startTime: '1111', endTime: '2222' } params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
}) })
break; break;
case '2': case '2': //
this.$router.push({ this.$router.push({
// path: '/energy/monitoring/energy-report-search',
name: 'EnergyReportSearch', name: 'EnergyReportSearch',
params: { startTime: '1111', endTime: '2222' } params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
}) })
console.log('aaa')
break; break;
default: default:
this.$router.push({ this.$router.push({
path: '/quality/monitoring/quality-statistics', // path: '/quality/monitoring/quality-statistics',
// name: 'reportDesign', name: 'QualityStatistics',
params: { startTime: '1111', endTime: '2222' } params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
}) })
} }
},
aaa() {
console.log(this.list)
},
a() {
console.log('11111')
this.$forceUpdate()
} }
} }
} }