批量设置前判断是否可以编辑
This commit is contained in:
@@ -94,7 +94,7 @@ export default {
|
||||
// }
|
||||
// ],
|
||||
},
|
||||
ids: ''
|
||||
ids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
if (valid) {
|
||||
let query = {
|
||||
...this.formInline,
|
||||
ids:this.ids
|
||||
ids:this.ids.join(',')
|
||||
}
|
||||
this.confirmLoading = true
|
||||
getAction('/ota/otaManageApplyEO/applyRematch', query).then((res) => {
|
||||
@@ -131,6 +131,7 @@ export default {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.ids = []
|
||||
this.$emit('getList')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
@@ -142,7 +143,7 @@ export default {
|
||||
},
|
||||
handleCancel() {
|
||||
this.formInline = {}
|
||||
this.ids = ''
|
||||
this.ids = []
|
||||
this.visible = false
|
||||
},
|
||||
// dateChange(item) {
|
||||
|
||||
@@ -156,9 +156,10 @@ export default {
|
||||
handleOk() {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
let OtaManageApplyEO = JSON.parse(JSON.stringify(this.ids))
|
||||
let query = {
|
||||
list: OtaManageApplyEO,
|
||||
...this.formInline,
|
||||
ids:this.ids
|
||||
}
|
||||
this.confirmLoading = true
|
||||
postAction('/ota/otaManageApplyEO/updateVdrBatch', query).then((res) => {
|
||||
@@ -166,6 +167,7 @@ export default {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.ids = []
|
||||
this.$emit('getList')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
@@ -177,7 +179,7 @@ export default {
|
||||
},
|
||||
handleCancel() {
|
||||
this.formInline = {}
|
||||
this.ids = ''
|
||||
this.ids = []
|
||||
this.visible = false
|
||||
},
|
||||
// dateChange(item) {
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
<div style='font-size: 18px;margin-bottom: 20px;display: flex;justify-content: center'
|
||||
class="box-title-text-index" v-for='(item,key) in NotSelectedRowKeysValue'>
|
||||
<div>
|
||||
<span>{{ item.nioNumber }}</span>
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -942,6 +942,7 @@ export default {
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.selectedRowKeys = []
|
||||
this.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
@@ -961,6 +962,7 @@ export default {
|
||||
queryParam[val] = queryParam[val].join(',')
|
||||
}
|
||||
})
|
||||
this.selectedRowKeys = []
|
||||
queryParam.appliedVehicleProject = this.vehicleTypeCode == '全部'?queryParam.appliedVehicleProject:this.vehicleTypeCode
|
||||
queryParam.plannedBpLaunchBatch = this.$route.query.plannedBpLaunchBatch
|
||||
let query = {
|
||||
@@ -1040,18 +1042,18 @@ export default {
|
||||
// 批量设置
|
||||
BatchSetting(){
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
let disabledList = []
|
||||
let flag = 1
|
||||
this.selectedRowKeysRecord.forEach(item => {
|
||||
if(item.disabled){
|
||||
disabledList.push(item.disabled)
|
||||
if(item.disabled == true){
|
||||
flag = 2
|
||||
return
|
||||
}
|
||||
})
|
||||
const index = disabledList.indexOf(true);
|
||||
console.log(index)
|
||||
if (index !== -1) {
|
||||
console.log(flag)
|
||||
if (flag == 2) {
|
||||
this.$message.warning(this.$t('datacannotbeedited'))
|
||||
} else {
|
||||
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)),this.vehicleTypeCode)
|
||||
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeysRecord)),this.vehicleTypeCode)
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
@@ -1060,18 +1062,18 @@ export default {
|
||||
// 申请重新匹配
|
||||
applyforrematch(){
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
let statusList = []
|
||||
let flag = 1
|
||||
this.selectedRowKeysRecord.forEach(item => {
|
||||
if(item.status){
|
||||
statusList.push(item.status)
|
||||
if(item.matchStatus !== 'locked'){
|
||||
flag = 2
|
||||
return
|
||||
}
|
||||
})
|
||||
const index = statusList.indexOf('locked');
|
||||
console.log(index)
|
||||
if (index == -1) {
|
||||
this.$message.warning(this.$t('selectlocked'))
|
||||
} else {
|
||||
console.log(flag)
|
||||
if (flag !== 2) {
|
||||
this.$refs.applyforrematchRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)),this.vehicleTypeCode)
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectlocked'))
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
@@ -1150,10 +1152,11 @@ export default {
|
||||
postAction('/ota/otaManageApplyEO/submit', query).then((res) => {
|
||||
if (res.success) {
|
||||
if(res.result.msgList && res.result.msgList.length == 0){
|
||||
this.selectedRowKeys = []
|
||||
this.getList()
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
}else{
|
||||
this.selectedRowKeysValue = res.result.msgList
|
||||
this.NotSelectedRowKeysValue = res.result.msgList
|
||||
this.visibleoperationFailed = true
|
||||
}
|
||||
} else {
|
||||
@@ -1167,13 +1170,20 @@ export default {
|
||||
// 确认
|
||||
confirm(){
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
console.log(this.selectedRowKeys)
|
||||
let query = {
|
||||
ids:this.selectedRowKeys
|
||||
ids:this.selectedRowKeys.join(',')
|
||||
}
|
||||
getAction('/ota/otaManageApplyEO/confirm', query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.getList()
|
||||
if(res.result.msgList && res.result.msgList.length == 0){
|
||||
this.selectedRowKeys = []
|
||||
this.getList()
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
}else{
|
||||
this.NotSelectedRowKeysValue = res.result.msgList
|
||||
this.visibleoperationFailed = true
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
@@ -1334,7 +1344,7 @@ export default {
|
||||
},
|
||||
// 错误数据的弹框
|
||||
cancleoperationFailed() {
|
||||
this.selectedRowKeysValue = []
|
||||
this.NotSelectedRowKeysValue = []
|
||||
this.visibleoperationFailed = false
|
||||
this.getList()
|
||||
// this.GetgetTableList()
|
||||
@@ -1479,4 +1489,14 @@ popconfirmmize {
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
.imports-footer {
|
||||
.imports-footer-wrap {
|
||||
margin: 20px 0;
|
||||
text-align: center;
|
||||
|
||||
.imports-sub {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -78,7 +78,7 @@ export default {
|
||||
// }
|
||||
// ],
|
||||
},
|
||||
ids: ''
|
||||
ids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
if (valid) {
|
||||
let query = {
|
||||
...this.formInline,
|
||||
ids:this.ids
|
||||
ids:this.ids.join(',')
|
||||
}
|
||||
this.confirmLoading = true
|
||||
getAction('/ota/otaManageApplyEO/reject', query).then((res) => {
|
||||
@@ -105,6 +105,7 @@ export default {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.ids = []
|
||||
this.$emit('getList')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
@@ -116,7 +117,7 @@ export default {
|
||||
},
|
||||
handleCancel() {
|
||||
this.formInline = {}
|
||||
this.ids = ''
|
||||
this.ids = []
|
||||
this.visible = false
|
||||
},
|
||||
// dateChange(item) {
|
||||
|
||||
Reference in New Issue
Block a user