酸轧数据同步,轧辊新增产线新增各种产线
This commit is contained in:
@@ -381,6 +381,7 @@
|
||||
import { getCurrentRolls, listRollChange, addRollChange, updateRollChange, delRollChange, getRollPerformance } from '@/api/mes/roll/rollChange'
|
||||
import { listRollStandby, addRollStandby, delRollStandby, clearRollStandby } from '@/api/mes/roll/rollStandby'
|
||||
import { listRollOptions, listRollInfo } from '@/api/mes/roll/rollInfo'
|
||||
import rollLineMixin from '../rollLineMixin'
|
||||
|
||||
const ParamCell = {
|
||||
name: 'ParamCell',
|
||||
@@ -409,6 +410,7 @@ const PerfCell = {
|
||||
export default {
|
||||
name: 'WorkingRoll',
|
||||
components: { ParamCell, PerfCell },
|
||||
mixins: [rollLineMixin],
|
||||
data() {
|
||||
return {
|
||||
current: { '1#': {}, '2#': {} },
|
||||
@@ -576,11 +578,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.loadAll()
|
||||
this.loadRollOptions()
|
||||
this.loadRollInfoMap()
|
||||
},
|
||||
created() {},
|
||||
|
||||
mounted() {
|
||||
this.$nextTick(this.syncAsideHeight)
|
||||
@@ -592,6 +590,12 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
onLineResolved() {
|
||||
this.loadAll()
|
||||
this.loadRollOptions()
|
||||
this.loadRollInfoMap()
|
||||
},
|
||||
|
||||
getDefaultChangeForm(standNo) {
|
||||
return {
|
||||
standNo: standNo || undefined,
|
||||
@@ -631,14 +635,14 @@ export default {
|
||||
|
||||
loadRollPerformance() {
|
||||
this.perfLoading = true
|
||||
getRollPerformance().then(res => {
|
||||
getRollPerformance(this.lineId).then(res => {
|
||||
this.perfData = res.data || {}
|
||||
}).finally(() => { this.perfLoading = false })
|
||||
},
|
||||
|
||||
loadCurrent(standNo) {
|
||||
this.$set(this.loadingCurrent, standNo, true)
|
||||
getCurrentRolls(standNo).then(res => {
|
||||
getCurrentRolls(this.lineId, standNo).then(res => {
|
||||
this.$set(this.current, standNo, res.data || {})
|
||||
this.$set(this.loadingCurrent, standNo, false)
|
||||
this.$nextTick(this.syncAsideHeight)
|
||||
@@ -647,7 +651,7 @@ export default {
|
||||
|
||||
loadStandby(standNo) {
|
||||
this.$set(this.loadingStandby, standNo, true)
|
||||
listRollStandby(standNo).then(res => {
|
||||
listRollStandby(this.lineId, standNo).then(res => {
|
||||
this.$set(this.standbyList, standNo, res.data || [])
|
||||
this.$set(this.loadingStandby, standNo, false)
|
||||
}).catch(() => { this.$set(this.loadingStandby, standNo, false) })
|
||||
@@ -655,7 +659,7 @@ export default {
|
||||
|
||||
loadHistory() {
|
||||
this.historyLoading = true
|
||||
listRollChange(this.historyQuery).then(res => {
|
||||
listRollChange({ ...this.historyQuery, lineId: this.lineId }).then(res => {
|
||||
this.historyList = res.rows || []
|
||||
this.historyTotal = res.total || 0
|
||||
this.historyLoading = false
|
||||
@@ -663,13 +667,13 @@ export default {
|
||||
},
|
||||
|
||||
loadRollOptions() {
|
||||
// 下批辊选择只显示离线(Offline)状态的轧辊
|
||||
listRollOptions('WR', 'Offline').then(res => { this.wrOptions = res.data || [] })
|
||||
listRollOptions('BR', 'Offline').then(res => { this.brOptions = res.data || [] })
|
||||
// 下批辊选择只显示离线(Offline)状态的轧辊,限定当前产线
|
||||
listRollOptions(this.lineId, 'WR', 'Offline').then(res => { this.wrOptions = res.data || [] })
|
||||
listRollOptions(this.lineId, 'BR', 'Offline').then(res => { this.brOptions = res.data || [] })
|
||||
},
|
||||
|
||||
loadRollInfoMap() {
|
||||
listRollInfo({ pageNum: 1, pageSize: 500 }).then(res => {
|
||||
listRollInfo({ lineId: this.lineId, pageNum: 1, pageSize: 500 }).then(res => {
|
||||
const map = {}
|
||||
;(res.rows || []).forEach(r => { map[r.rollNo] = r })
|
||||
this.rollInfoMap = map
|
||||
@@ -708,6 +712,7 @@ export default {
|
||||
|
||||
this.changeForm = {
|
||||
...this.getDefaultChangeForm(standNo),
|
||||
lineId: this.lineId,
|
||||
upperWrNo: uwr.no, upperWrDia: uwr.dia,
|
||||
lowerWrNo: lwr.no, lowerWrDia: lwr.dia,
|
||||
upperBrNo: ubr.no, upperBrDia: ubr.dia,
|
||||
@@ -722,7 +727,7 @@ export default {
|
||||
addRollChange(this.changeForm).then(() => {
|
||||
this.$modal.msgSuccess('换辊成功')
|
||||
this.changeOpen = false
|
||||
clearRollStandby(standNo).finally(() => {
|
||||
clearRollStandby(this.lineId, standNo).finally(() => {
|
||||
this.loadCurrent(standNo)
|
||||
this.loadStandby(standNo)
|
||||
this.loadHistory()
|
||||
@@ -761,7 +766,7 @@ export default {
|
||||
submitStandby() {
|
||||
this.$refs.standbyForm.validate(valid => {
|
||||
if (!valid) return
|
||||
addRollStandby(this.standbyForm).then(() => {
|
||||
addRollStandby({ ...this.standbyForm, lineId: this.lineId }).then(() => {
|
||||
this.$modal.msgSuccess('已添加到下批轧辊')
|
||||
this.standbyOpen = false
|
||||
this.loadStandby(this.standbyForm.standNo)
|
||||
@@ -787,7 +792,7 @@ export default {
|
||||
},
|
||||
handleClearStandby(standNo) {
|
||||
this.$modal.confirm('确认清空 ' + standNo + ' 机架的全部下批轧辊?').then(() => {
|
||||
return clearRollStandby(standNo)
|
||||
return clearRollStandby(this.lineId, standNo)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('已清空')
|
||||
this.loadStandby(standNo)
|
||||
@@ -818,7 +823,7 @@ export default {
|
||||
// ── 可用离线辊列表 ────────────────────────────────────────
|
||||
loadOfflineRolls() {
|
||||
this.offlineLoading = true
|
||||
listRollInfo({ status: 'Offline', pageNum: 1, pageSize: 30 }).then(res => {
|
||||
listRollInfo({ lineId: this.lineId, status: 'Offline', pageNum: 1, pageSize: 30 }).then(res => {
|
||||
this.offlineRolls = res.rows || []
|
||||
}).finally(() => {
|
||||
this.offlineLoading = false
|
||||
|
||||
Reference in New Issue
Block a user