test #47
@ -172,6 +172,7 @@ export default {
|
||||
this.getTypeList()
|
||||
this.getObjTree()
|
||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
||||
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
@ -276,7 +277,7 @@ export default {
|
||||
this.$modal.msgError('请选择能源类型')
|
||||
return false
|
||||
}
|
||||
if (!this.objArr.length === 0) {
|
||||
if (this.objArr.length === 0) {
|
||||
this.$modal.msgError('请选择对象')
|
||||
return false
|
||||
} else {
|
||||
|
@ -37,16 +37,6 @@ export default {
|
||||
this.chartData = []
|
||||
}
|
||||
})
|
||||
// getEnergyTrend({
|
||||
// energyTypeId: "1681183397517406210",
|
||||
// objId: "1679031282510532610",
|
||||
// timeDim: "2",
|
||||
// startTime: "1690732800000",
|
||||
// endTime: "1690992000000"
|
||||
// }).then((res) => {
|
||||
// console.log(res)
|
||||
// this.chartData = res.data
|
||||
// })
|
||||
},
|
||||
switchChart() {
|
||||
if (this.activeName === 'bar') {
|
||||
|
@ -92,7 +92,7 @@ export default {
|
||||
type: 'input',
|
||||
label: '标识名',
|
||||
placeholder: '标识名',
|
||||
param: 'name'
|
||||
param: 'cnName'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -149,7 +149,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null
|
||||
cnName: null
|
||||
},
|
||||
paramVisible: false,
|
||||
energyTypeList: [],
|
||||
@ -173,7 +173,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.name = val.name
|
||||
this.queryParams.cnName = val.cnName
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
|
@ -47,7 +47,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</template>
|
||||
|
@ -118,16 +118,16 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
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.endTime = this.formConfig[2].defaultSelect[1]
|
||||
this.getList()
|
||||
this.getTypeList()
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$route.params.name)
|
||||
console.log('22222')
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
|
@ -75,7 +75,7 @@ export default {
|
||||
{
|
||||
type: 'input',
|
||||
label: '参数名称',
|
||||
placeholder: '方案名称',
|
||||
placeholder: '参数名称',
|
||||
param: 'paramName'
|
||||
},
|
||||
{
|
||||
|
@ -46,7 +46,7 @@
|
||||
format='HH:mm'
|
||||
value-format='HH:mm'
|
||||
style="width: 100%;"
|
||||
@change="timeFun"
|
||||
@change="timeFun('start')"
|
||||
>
|
||||
</el-time-picker>
|
||||
</el-form-item>
|
||||
@ -58,7 +58,7 @@
|
||||
format='HH:mm'
|
||||
value-format='HH:mm'
|
||||
style="width: 100%;"
|
||||
@change="timeFun"
|
||||
@change="timeFun('end')"
|
||||
>
|
||||
</el-time-picker>
|
||||
</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) {
|
||||
this.form.daySpan = 1
|
||||
} else {
|
||||
} else if (this.form.startTime < this.form.endTime) {
|
||||
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,
|
||||
{
|
||||
type: 'cancel',
|
||||
btnName: '作废'
|
||||
btnName: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'unequal',
|
||||
name: 'status',
|
||||
value: '不可用'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
this.$auth.hasPermi('base:group-classes:delete')
|
||||
? {
|
||||
@ -225,8 +235,9 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
if (row.status) {
|
||||
console.log(row)
|
||||
let _this = this
|
||||
if (row.status === '可用') {// 可用
|
||||
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() {
|
||||
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
|
||||
return deleteGroupClasses(row.id);
|
||||
|
@ -7,7 +7,7 @@
|
||||
<el-input v-model="form.code" disabled></el-input>
|
||||
</el-form-item>
|
||||
<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 label="班组组长" prop="leaderName">
|
||||
<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('2')">班组能源查询</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>
|
||||
</div>
|
||||
@ -66,7 +65,7 @@
|
||||
</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
|
||||
v-for="i in teamList"
|
||||
:key="i.id"
|
||||
@ -100,129 +99,7 @@ export default {
|
||||
year: '',// 2023
|
||||
month: '',// 九月
|
||||
monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
|
||||
// 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: [],
|
||||
list: {},
|
||||
teamList: [],// 班组下拉
|
||||
showSetting: false,// 设置模式。自动排班,确认,取消按钮显示
|
||||
settingBtnDis: false,
|
||||
@ -269,9 +146,19 @@ export default {
|
||||
year: year,
|
||||
month: month
|
||||
}).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(() => {
|
||||
this.list = []
|
||||
this.list = {}
|
||||
this.settingBtnDis = true // 禁用设置按钮
|
||||
})
|
||||
},
|
||||
@ -287,10 +174,18 @@ export default {
|
||||
},
|
||||
// 确认
|
||||
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 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++) {
|
||||
arr.push(tempArr[i][j])
|
||||
}
|
||||
@ -298,6 +193,7 @@ export default {
|
||||
createOrUpdateList(arr).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.showSetting = !this.showSetting
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
this.getList() // 数据更新
|
||||
}
|
||||
})
|
||||
@ -314,9 +210,9 @@ export default {
|
||||
},
|
||||
// 自动排班
|
||||
schedulingBtn() {
|
||||
let tempData = this.list
|
||||
// 次月1号有值前端排班
|
||||
if (this.list[1][0].teamId) {
|
||||
console.log('次月1号有值前端排班')
|
||||
let tempArr = Object.values(this.list)
|
||||
let arr = []
|
||||
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 v = 0; v < tempArr[k].length; v++) {
|
||||
let t = (k*(k+1)+v) % arr.length
|
||||
// console.log(t)
|
||||
let t = tempNum % arr.length
|
||||
if (arr.length === 1) {
|
||||
this.list[k+1][v].teamId = arr[0]
|
||||
tempData[k+1][v].teamId = arr[0]
|
||||
} else {
|
||||
if (k === 0 && v === 0) {
|
||||
this.list[k+1][v].teamId = arr[0]
|
||||
} else {
|
||||
this.list[k+1][v].teamId = arr[t]
|
||||
}
|
||||
}
|
||||
tempData[k+1][v].teamId = arr[t]
|
||||
}
|
||||
tempNum++
|
||||
}
|
||||
}
|
||||
this.list = []
|
||||
this.list = tempData
|
||||
} else {
|
||||
// 次月1号没有值,接口排班
|
||||
console.log('次月1号没有值接口排班')
|
||||
autoSet().then(res => {
|
||||
this.list = res.data || []
|
||||
this.list = res.data || {}
|
||||
})
|
||||
}
|
||||
},
|
||||
@ -389,33 +282,24 @@ export default {
|
||||
switch (val) {
|
||||
case '1':
|
||||
this.$router.push({
|
||||
path: '/core/monitoring/production-line-data',
|
||||
// name: 'reportDesign',
|
||||
params: { startTime: '1111', endTime: '2222' }
|
||||
// path: '/core/monitoring/production-line-data',
|
||||
name: 'ProductionLineData',
|
||||
params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
|
||||
})
|
||||
break;
|
||||
case '2':
|
||||
case '2': // 能源
|
||||
this.$router.push({
|
||||
// path: '/energy/monitoring/energy-report-search',
|
||||
name: 'EnergyReportSearch',
|
||||
params: { startTime: '1111', endTime: '2222' }
|
||||
params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
|
||||
})
|
||||
console.log('aaa')
|
||||
break;
|
||||
default:
|
||||
this.$router.push({
|
||||
path: '/quality/monitoring/quality-statistics',
|
||||
// name: 'reportDesign',
|
||||
params: { startTime: '1111', endTime: '2222' }
|
||||
// path: '/quality/monitoring/quality-statistics',
|
||||
name: 'QualityStatistics',
|
||||
params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
|
||||
})
|
||||
}
|
||||
},
|
||||
aaa() {
|
||||
console.log(this.list)
|
||||
},
|
||||
a() {
|
||||
console.log('11111')
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user