|
@@ -184,13 +184,13 @@
|
|
|
<el-tab-pane label="两拼车辆排队链表" name="fourth">
|
|
|
<el-table
|
|
|
:data="tableData2"
|
|
|
- :span-method="objectSpanMethod"
|
|
|
+ :span-method="objectSpanMethod1"
|
|
|
border
|
|
|
style="width: 100%; margin-top: 20px"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ @selection-change="handleSelectionChangeSpelling"
|
|
|
:row-key="getRowKey"
|
|
|
max-height="500px"
|
|
|
- ref="spellData"
|
|
|
+ ref="twoSpellData"
|
|
|
>
|
|
|
<el-table-column
|
|
|
type="selection"
|
|
@@ -263,7 +263,7 @@
|
|
|
:span-method="objectSpanMethod"
|
|
|
border
|
|
|
style="width: 100%; margin-top: 20px"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ @selection-change="handleSelectionChangeSpelling"
|
|
|
:row-key="getRowKey"
|
|
|
max-height="500px"
|
|
|
ref="spellData"
|
|
@@ -373,10 +373,11 @@ export default {
|
|
|
activeName: 'first',
|
|
|
tableData: [],
|
|
|
tableData1: [],
|
|
|
- tableData2:[],
|
|
|
+ tableData2: [],
|
|
|
tableData3: [],
|
|
|
//存放每一行记录的合并数
|
|
|
spanArr: [],
|
|
|
+ spanArr1: [],
|
|
|
maplist: [],
|
|
|
id: null,
|
|
|
option: [],
|
|
@@ -443,9 +444,10 @@ export default {
|
|
|
})
|
|
|
this.getNoSpellingArray()
|
|
|
this.getSpellingArray()
|
|
|
+ this.getSpellingArrayTwo()
|
|
|
} else {
|
|
|
this.$message({
|
|
|
- message: '撤单失败',
|
|
|
+ message: '撤销失败',
|
|
|
type: 'error',
|
|
|
duration: 2000,
|
|
|
center: true,
|
|
@@ -470,12 +472,15 @@ export default {
|
|
|
refresh() {
|
|
|
this.getSpellingArray()
|
|
|
this.getNoSpellingArray()
|
|
|
+ this.getSpellingArrayTwo()
|
|
|
this.getSteelOrderNum()
|
|
|
this.getStoreArray()
|
|
|
this.redDotNum = null
|
|
|
this.totalQueueNum = null
|
|
|
this.totalQueueNumFirst = null
|
|
|
this.isQueryCapacity = null
|
|
|
+ this.maplist = []
|
|
|
+ this.filterArr1 = []
|
|
|
this.i = 0
|
|
|
clearInterval(this.timer)
|
|
|
this.start()
|
|
@@ -498,7 +503,11 @@ export default {
|
|
|
} else {
|
|
|
if (
|
|
|
this.maplist.some(e => {
|
|
|
- return e.ROW_ID == row.ROW_ID || e.ROW_ID + 1 == row.ROW_ID
|
|
|
+ return (
|
|
|
+ e.ROW_ID == row.ROW_ID ||
|
|
|
+ e.ROW_ID + 1 == row.ROW_ID ||
|
|
|
+ typeof row.ROW_ID == 'undefined'
|
|
|
+ )
|
|
|
})
|
|
|
) {
|
|
|
return true
|
|
@@ -509,7 +518,7 @@ export default {
|
|
|
},
|
|
|
selectInitSplleing(row) {
|
|
|
if (this.maplist.length == 0) {
|
|
|
- if (row.ROW_ID == 1) {
|
|
|
+ if (row.group + 1 == 1) {
|
|
|
return true
|
|
|
} else {
|
|
|
return false
|
|
@@ -517,7 +526,7 @@ export default {
|
|
|
} else {
|
|
|
if (
|
|
|
this.maplist.some(e => {
|
|
|
- return e.ROW_ID == row.ROW_ID || e.ROW_ID + 1 == row.ROW_ID
|
|
|
+ return e.group == row.group || e.group + 1 == row.group
|
|
|
})
|
|
|
) {
|
|
|
return true
|
|
@@ -569,19 +578,19 @@ export default {
|
|
|
.then(res => {
|
|
|
this.tableData1 = res.data.data
|
|
|
})
|
|
|
- } else if(this.activeName ==second){
|
|
|
+ } else if (this.activeName == second) {
|
|
|
this.axios
|
|
|
.post('/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1', map)
|
|
|
.then(res => {
|
|
|
this.tableData = res.data.data
|
|
|
this.getSpanArr(this.tableData)
|
|
|
})
|
|
|
- }else if (this.activeName == fourth){
|
|
|
+ } else if (this.activeName == fourth) {
|
|
|
this.axios
|
|
|
.post('/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2', map)
|
|
|
.then(res => {
|
|
|
this.tableData2 = res.data.data
|
|
|
- this.getSpanArr(this.tableData2)
|
|
|
+ this.getSpanArr1(this.tableData2)
|
|
|
})
|
|
|
}
|
|
|
this.table1 = false
|
|
@@ -601,19 +610,39 @@ export default {
|
|
|
this.spanArr.push(1)
|
|
|
this.pos = 0
|
|
|
data[i].group = i
|
|
|
- data[i].ROW_ID = i + 1
|
|
|
} else {
|
|
|
// 判断当前元素与上一个元素是否相同
|
|
|
if (data[i].resultTotalId === data[i - 1].resultTotalId) {
|
|
|
this.spanArr[this.pos] += 1
|
|
|
this.spanArr.push(0)
|
|
|
data[i].group = data[i - 1].group
|
|
|
- data[i].ROW_ID = data[i - 1].ROW_ID
|
|
|
} else {
|
|
|
this.spanArr.push(1)
|
|
|
this.pos = i
|
|
|
data[i].group = data[i - 1].group + 1
|
|
|
- data[i].ROW_ID = data[i - 1].ROW_ID + 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //记录每一行的合并数
|
|
|
+ getSpanArr1(data) {
|
|
|
+ //每次调用方法初始化
|
|
|
+ this.spanArr1 = []
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (i === 0) {
|
|
|
+ this.spanArr1.push(1)
|
|
|
+ this.pos = 0
|
|
|
+ data[i].group = i
|
|
|
+ } else {
|
|
|
+ // 判断当前元素与上一个元素是否相同
|
|
|
+ if (data[i].resultTotalId === data[i - 1].resultTotalId) {
|
|
|
+ this.spanArr1[this.pos] += 1
|
|
|
+ this.spanArr1.push(0)
|
|
|
+ data[i].group = data[i - 1].group
|
|
|
+ } else {
|
|
|
+ this.spanArr1.push(1)
|
|
|
+ this.pos = i
|
|
|
+ data[i].group = data[i - 1].group + 1
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -640,6 +669,28 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
|
|
|
+ if (
|
|
|
+ columnIndex === 0 ||
|
|
|
+ columnIndex === 1 ||
|
|
|
+ columnIndex === 2 ||
|
|
|
+ columnIndex === 3 ||
|
|
|
+ columnIndex === 4 ||
|
|
|
+ columnIndex === 10 ||
|
|
|
+ columnIndex === 11 ||
|
|
|
+ columnIndex === 12 ||
|
|
|
+ columnIndex === 13 ||
|
|
|
+ columnIndex === 14 ||
|
|
|
+ columnIndex === 15
|
|
|
+ ) {
|
|
|
+ const _row = this.spanArr1[rowIndex]
|
|
|
+ const _col = _row > 0 ? 1 : 0
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: _col
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
handleClick() {
|
|
|
this.redDotNum = null
|
|
|
this.totalQueueNum = null
|
|
@@ -649,7 +700,7 @@ export default {
|
|
|
this.getNoSpellingArray()
|
|
|
} else if (this.activeName == 'second') {
|
|
|
this.getSpellingArray()
|
|
|
- }else if (this.activeName == 'fourth'){
|
|
|
+ } else if (this.activeName == 'fourth') {
|
|
|
this.getSpellingArrayTwo()
|
|
|
} else {
|
|
|
this.getStoreArray()
|
|
@@ -681,13 +732,13 @@ export default {
|
|
|
this.axios
|
|
|
.post(
|
|
|
'/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
|
|
|
- new Date()
|
|
|
+ new Date()
|
|
|
)
|
|
|
.then(res => {
|
|
|
this.tableData2 = res.data.data
|
|
|
this.isQueryCapacity = null
|
|
|
console.log(this.tableData2)
|
|
|
- this.getSpanArr(this.tableData2)
|
|
|
+ this.getSpanArr1(this.tableData2)
|
|
|
})
|
|
|
},
|
|
|
getStoreArray() {
|
|
@@ -710,7 +761,7 @@ export default {
|
|
|
this.tableData1 = res.data.data
|
|
|
})
|
|
|
console.log('wzxxx')
|
|
|
- } else if (this.activeName == second){
|
|
|
+ } else if (this.activeName == second) {
|
|
|
this.axios
|
|
|
.post(
|
|
|
'/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=' +
|
|
@@ -723,24 +774,25 @@ export default {
|
|
|
this.tableData = res.data.data
|
|
|
this.getSpanArr(this.tableData)
|
|
|
})
|
|
|
- }else if (this.activeName ==fourth){
|
|
|
+ } else if (this.activeName == fourth) {
|
|
|
this.axios
|
|
|
.post(
|
|
|
'/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
|
|
|
- new Date() +
|
|
|
- '&capacityNumber=' +
|
|
|
- this.capacityNo
|
|
|
+ new Date() +
|
|
|
+ '&capacityNumber=' +
|
|
|
+ this.capacityNo
|
|
|
)
|
|
|
.then(res => {
|
|
|
this.isQueryCapacity = 1
|
|
|
this.tableData2 = res.data.data
|
|
|
- this.getSpanArr(this.tableData2)
|
|
|
+ this.getSpanArr1(this.tableData2)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
handleSelectionChange(selection) {
|
|
|
this.maplist = []
|
|
|
this.maplist = selection
|
|
|
+ console.log(selection)
|
|
|
for (let i = 0; i < this.maplist.length; i++) {
|
|
|
if (i + 1 < this.maplist.length) {
|
|
|
if (this.maplist[i].ROW_ID + 1 != this.maplist[i + 1].ROW_ID) {
|
|
@@ -756,7 +808,28 @@ export default {
|
|
|
})
|
|
|
) {
|
|
|
this.$refs.mutiData.clearSelection()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSelectionChangeSpelling(selection) {
|
|
|
+ this.maplist = []
|
|
|
+ this.maplist = selection
|
|
|
+ console.log(selection)
|
|
|
+ for (let i = 0; i < this.maplist.length; i++) {
|
|
|
+ if (i + 1 < this.maplist.length) {
|
|
|
+ if (this.maplist[i].group + 1 != this.maplist[i + 1].group) {
|
|
|
+ this.$refs.spellData.clearSelection()
|
|
|
+ this.$refs.twoSpellData.clearSelection()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 限制只取第一个去掉
|
|
|
+ if (
|
|
|
+ !this.maplist.some(e => {
|
|
|
+ return e.group == 0
|
|
|
+ })
|
|
|
+ ) {
|
|
|
this.$refs.spellData.clearSelection()
|
|
|
+ this.$refs.twoSpellData.clearSelection()
|
|
|
}
|
|
|
},
|
|
|
updateBill(scope) {
|
|
@@ -767,9 +840,20 @@ export default {
|
|
|
},
|
|
|
filterArr(resultId) {
|
|
|
console.log('fdhjsaj')
|
|
|
- this.filterArr1 = this.filterArr1.concat(
|
|
|
- this.tableData.filter(ele => ele.resultId == resultId)
|
|
|
- )
|
|
|
+ this.filterArr1 = []
|
|
|
+ if (this.activeName == 'first') {
|
|
|
+ this.filterArr1 = this.filterArr1.concat(
|
|
|
+ this.tableData1.filter(ele => ele.resultId == resultId)
|
|
|
+ )
|
|
|
+ } else if (this.activeName == 'second') {
|
|
|
+ this.filterArr1 = this.filterArr1.concat(
|
|
|
+ this.tableData.filter(ele => ele.resultId == resultId)
|
|
|
+ )
|
|
|
+ } else if (this.activeName == 'fourth') {
|
|
|
+ this.filterArr1 = this.filterArr1.concat(
|
|
|
+ this.tableData2.filter(ele => ele.resultId == resultId)
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
allow() {
|
|
|
if (this.maplist.length == 0) {
|
|
@@ -814,6 +898,7 @@ export default {
|
|
|
}
|
|
|
this.filterArr(this.maplist[i].resultId)
|
|
|
}
|
|
|
+ console.log(this.filterArr1, 'this.fil')
|
|
|
var filterArr2 = []
|
|
|
this.filterArr1.forEach(e => {
|
|
|
if (filterArr2.indexOf(e) === -1) {
|
|
@@ -828,50 +913,77 @@ export default {
|
|
|
if (this.activeName == 'first') {
|
|
|
map.mapList = this.maplist
|
|
|
}
|
|
|
- console.log("勾选的数据")
|
|
|
+ console.log('勾选的数据')
|
|
|
console.log(map)
|
|
|
- this.axios.post('/api/v1/qms/allowEnFactory', map).then(res => {
|
|
|
- if (res.data.code == '200') {
|
|
|
- this.$message({
|
|
|
- message: '放行成功,等待进厂',
|
|
|
- type: 'success',
|
|
|
- duration: 2000,
|
|
|
- center: true,
|
|
|
- offset: 100
|
|
|
- })
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/qms/allowEnFactory', map)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '放行成功,等待进厂',
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000,
|
|
|
+ center: true,
|
|
|
+ offset: 100
|
|
|
+ })
|
|
|
+ this.maplist = []
|
|
|
+ this.filterArr1 = []
|
|
|
+ this.$refs.mutiData.clearSelection()
|
|
|
+ this.$refs.spellData.clearSelection()
|
|
|
+ this.$refs.twoSpellData.clearSelection()
|
|
|
+ this.getNoSpellingArray()
|
|
|
+ this.getSpellingArray()
|
|
|
+ this.getSpellingArrayTwo()
|
|
|
+ this.getStoreArray()
|
|
|
+ this.redDotNum = null
|
|
|
+ this.totalQueueNum = null
|
|
|
+ this.totalQueueNumFirst = null
|
|
|
+ this.i = 0
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.start()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '请按顺序勾选',
|
|
|
+ type: 'error',
|
|
|
+ duration: 2000,
|
|
|
+ center: true,
|
|
|
+ offset: 100
|
|
|
+ })
|
|
|
+ this.maplist = []
|
|
|
+ this.filterArr1 = []
|
|
|
+ this.$refs.mutiData.clearSelection()
|
|
|
+ this.$refs.spellData.clearSelection()
|
|
|
+ this.$refs.twoSpellData.clearSelection()
|
|
|
+ this.getNoSpellingArray()
|
|
|
+ this.getSpellingArray()
|
|
|
+ this.getStoreArray()
|
|
|
+ this.getSpellingArrayTwo()
|
|
|
+ this.redDotNum = null
|
|
|
+ this.totalQueueNum = null
|
|
|
+ this.totalQueueNumFirst = null
|
|
|
+ this.i = 0
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.start()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e)
|
|
|
this.maplist = []
|
|
|
+ this.filterArr1 = []
|
|
|
this.$refs.mutiData.clearSelection()
|
|
|
this.$refs.spellData.clearSelection()
|
|
|
+ this.$refs.twoSpellData.clearSelection()
|
|
|
this.getNoSpellingArray()
|
|
|
this.getSpellingArray()
|
|
|
this.getStoreArray()
|
|
|
+ this.getSpellingArrayTwo()
|
|
|
this.redDotNum = null
|
|
|
this.totalQueueNum = null
|
|
|
this.totalQueueNumFirst = null
|
|
|
this.i = 0
|
|
|
clearInterval(this.timer)
|
|
|
this.start()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: '请按顺序勾选',
|
|
|
- type: 'error',
|
|
|
- duration: 2000,
|
|
|
- center: true,
|
|
|
- offset: 100
|
|
|
- })
|
|
|
- this.maplist = []
|
|
|
- this.$refs.mutiData.clearSelection()
|
|
|
- this.getNoSpellingArray()
|
|
|
- this.getSpellingArray()
|
|
|
- this.getStoreArray()
|
|
|
- this.redDotNum = null
|
|
|
- this.totalQueueNum = null
|
|
|
- this.totalQueueNumFirst = null
|
|
|
- this.i = 0
|
|
|
- clearInterval(this.timer)
|
|
|
- this.start()
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
},
|
|
|
changePriority(row) {
|
|
|
console.log('装货点:' + row.id)
|