|
|
@@ -33,7 +33,7 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- props:['data','paytype','addList'],
|
|
|
+ props:['data','paytype','addList','type','delList'],
|
|
|
data() {
|
|
|
return {
|
|
|
tableSelectData:[],
|
|
|
@@ -65,28 +65,58 @@
|
|
|
const res = await this.$api.requested(this.params)
|
|
|
|
|
|
// this.tableData = res.data
|
|
|
-
|
|
|
- if (this.addList && this.addList.length > 0){
|
|
|
- let indexof = 0
|
|
|
- let dataNew = []
|
|
|
- res.data.forEach((t,indexs)=>{
|
|
|
- let float = 0
|
|
|
- this.addList.forEach((i,index)=>{
|
|
|
- if (t.sa_dispatchid == i.sa_dispatchid){
|
|
|
- float = 1
|
|
|
+ if (this.type == '编辑'){
|
|
|
+ if (this.addList && this.addList.length > 0){
|
|
|
+ let indexof = 0
|
|
|
+ let dataNew = []
|
|
|
+ res.data.forEach((t,indexs)=>{
|
|
|
+ let float = 0
|
|
|
+ this.addList.forEach((i,index)=>{
|
|
|
+ if (t.sa_dispatchid == i.sa_dispatchid){
|
|
|
+ float = 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (float != 1){
|
|
|
+ dataNew[indexof] = res.data[indexs]
|
|
|
+ indexof = indexof + 1
|
|
|
}
|
|
|
})
|
|
|
- if (float != 1){
|
|
|
- dataNew[indexof] = res.data[indexs]
|
|
|
- indexof = indexof + 1
|
|
|
+ if (this.delList && this.delList.length > 0){
|
|
|
+ this.tableData = [...dataNew,...this.delList]
|
|
|
+ }else {
|
|
|
+ this.tableData = dataNew
|
|
|
}
|
|
|
- })
|
|
|
- this.tableData = dataNew
|
|
|
-
|
|
|
+ }else {
|
|
|
+ if (this.delList && this.delList.length > 0){
|
|
|
+ this.tableData = [...res.data,...this.delList]
|
|
|
+ }else {
|
|
|
+ this.tableData = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
}else {
|
|
|
- this.tableData = res.data
|
|
|
+ if (this.addList && this.addList.length > 0){
|
|
|
+ let indexof = 0
|
|
|
+ let dataNew = []
|
|
|
+ res.data.forEach((t,indexs)=>{
|
|
|
+ let float = 0
|
|
|
+ this.addList.forEach((i,index)=>{
|
|
|
+ if (t.sa_dispatchid == i.sa_dispatchid){
|
|
|
+ float = 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (float != 1){
|
|
|
+ dataNew[indexof] = res.data[indexs]
|
|
|
+ indexof = indexof + 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tableData = dataNew
|
|
|
+
|
|
|
+ }else {
|
|
|
+ this.tableData = res.data
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// this.total = res.total
|
|
|
// this.currentPage = res.pageNumber
|
|
|
},
|