市场认证清单-导入,导入成功后没有自动刷新列表

This commit is contained in:
范强强
2023-03-24 15:02:59 +08:00
parent 018b59fd6b
commit 0d4544f85c
5 changed files with 50 additions and 23 deletions
+1 -1
View File
@@ -1708,6 +1708,6 @@ module.exports = {
vehicleshavenotcompletedonlineupgrade:'The reason why some vehicles have not completed online upgrade', vehicleshavenotcompletedonlineupgrade:'The reason why some vehicles have not completed online upgrade',
cause:'cause', cause:'cause',
implementationrecords:'Fault handling measures and emergency response implementation records', implementationrecords:'Fault handling measures and emergency response implementation records',
onlyDataWithListStatusDraftCanBeDeleted:'Only data with a list status of Draft can be deleted',
} }
+1
View File
@@ -1808,4 +1808,5 @@ module.exports = {
vehicleshavenotcompletedonlineupgrade:'部分车辆未完在线升级的原因', vehicleshavenotcompletedonlineupgrade:'部分车辆未完在线升级的原因',
cause:'原因', cause:'原因',
implementationrecords:'故障处置措施和应急响应实施记录', implementationrecords:'故障处置措施和应急响应实施记录',
onlyDataWithListStatusDraftCanBeDeleted:'只能删除清单状态为草稿的数据',
} }
@@ -55,7 +55,7 @@
:loading="loading" :loading="loading"
:pagination="false" :pagination="false"
:scroll="{x: '100%'}" :scroll="{x: '100%'}"
rowKey="id" :rowKey="(record)=>JSON.stringify(record)"
:data-source="dataSource" :data-source="dataSource"
@change="tableOnChange" @change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@@ -69,13 +69,13 @@
<a class="text-operation" @click="edit(record)" <a class="text-operation" @click="edit(record)"
v-has="'dummyInventoryBase:deleteBatch'" v-has="'dummyInventoryBase:deleteBatch'"
:disabled="record.state == 1?true:false">{{$t('edit')}}</a> :disabled="record.state == 1?true:false">{{$t('edit')}}</a>
<!-- v-if="record.createBy == userData.username || administrators"--> <!-- v-if="record.createBy == userData.username || administrators"-->
<a class="text-operation" <a class="text-operation"
v-has="'dummyInventoryBase:issue'" v-has="'dummyInventoryBase:issue'"
@click="withdraw(record)"> @click="withdraw(record)">
{{record.state == 2 ? $t('release') : $t('withdraw')}} {{record.state == 2 ? $t('release') : $t('withdraw')}}
</a> </a>
<!-- v-if="record.createBy == userData.username || administrators"--> <!-- v-if="record.createBy == userData.username || administrators"-->
<a class="text-operation" :disabled="record.state == 1?true:false" <a class="text-operation" :disabled="record.state == 1?true:false"
v-has="'dummyInventoryBase:deleteBatch'" v-has="'dummyInventoryBase:deleteBatch'"
@click="maintenanceList(record)">{{$t('maintenanceList')}}</a> @click="maintenanceList(record)">{{$t('maintenanceList')}}</a>
@@ -84,7 +84,7 @@
:disabled="record.state == 2?true:false" @click="subscribe(record)"> :disabled="record.state == 2?true:false" @click="subscribe(record)">
{{!record.readFlag || record.readFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}} {{!record.readFlag || record.readFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}}
</a> </a>
<!-- v-if="record.createBy == userData.username || administrators"--> <!-- v-if="record.createBy == userData.username || administrators"-->
<a class="text-operation" :disabled="record.state == 1?true:false" <a class="text-operation" :disabled="record.state == 1?true:false"
v-has="'dummyInventoryBase:deleteBatch'" v-has="'dummyInventoryBase:deleteBatch'"
@click="deleteLib(record)">{{$t('deleteLib')}}</a> @click="deleteLib(record)">{{$t('deleteLib')}}</a>
@@ -248,7 +248,7 @@
} }
], ],
queryParam: {}, queryParam: {},
administrators:false, administrators: false,
orderBy: '1', orderBy: '1',
orderByField: '' orderByField: ''
} }
@@ -282,7 +282,12 @@
setCreatorClick() { setCreatorClick() {
if (this.selectedRowKeys.length > 0) { if (this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
this.$refs.setCreatorRef.getPush(selectedRowKeys.join(',')) let idList = []
for (let i = 0; i < selectedRowKeys.length; i++) {
selectedRowKeys[i] = JSON.parse(selectedRowKeys[i])
idList.push(selectedRowKeys[i].id)
}
this.$refs.setCreatorRef.getPush(idList.join(','))
} else { } else {
this.$message.warning(this.$t('PleaseSelectData')) this.$message.warning(this.$t('PleaseSelectData'))
} }
@@ -300,21 +305,37 @@
handleDel() { handleDel() {
if (this.selectedRowKeys.length > 0) { if (this.selectedRowKeys.length > 0) {
let _this = this let _this = this
this.$confirm({ let idList = []
content: _this.$t('ConfirmBatchDeletion'), let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
onOk() { let isTrue
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys)) for (let i = 0; i < selectedRowKeys.length; i++) {
getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => { selectedRowKeys[i] = JSON.parse(selectedRowKeys[i])
if (res.success) { if (selectedRowKeys[i].state == 1) {
_this.$message.success(_this.$t('OperationSuccessful')) isTrue = false
_this.selectedRowKeys = [] break
_this.getList() } else {
} else { isTrue = true
_this.$message.warning(res.message) idList.push(selectedRowKeys[i].id)
}
})
} }
}) }
if (isTrue) {
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
} else {
this.$message.warning(this.$t('onlyDataWithListStatusDraftCanBeDeleted'))
}
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
@@ -280,6 +280,7 @@
let _this = this let _this = this
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let isTrue let isTrue
let idList = []
for (let i = 0; i < selectedRowKeys.length; i++) { for (let i = 0; i < selectedRowKeys.length; i++) {
selectedRowKeys[i] = JSON.parse(selectedRowKeys[i]) selectedRowKeys[i] = JSON.parse(selectedRowKeys[i])
if (selectedRowKeys[i].state == 1) { if (selectedRowKeys[i].state == 1) {
@@ -287,13 +288,13 @@
break break
} else { } else {
isTrue = true isTrue = true
idList.push(selectedRowKeys[i].id)
} }
} }
if (isTrue){ if (isTrue){
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmBatchDeletion'), content: _this.$t('ConfirmBatchDeletion'),
onOk() { onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => { deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
@@ -306,7 +307,7 @@
} }
}) })
}else{ }else{
this.$message.warning(this.$t('')) this.$message.warning(this.$t('onlyDataWithListStatusDraftCanBeDeleted'))
} }
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
@@ -103,6 +103,7 @@
<!-- v-if="isTrue"--> <!-- v-if="isTrue"-->
<div v-if="isTrue" class="operator-text" v-has="'dummyInventoryInfo:importData'"> <div v-if="isTrue" class="operator-text" v-has="'dummyInventoryInfo:importData'">
<ImportFile :url="url" :authDummyInventoryBaseId="$route.query.id" :isTrue="true" <ImportFile :url="url" :authDummyInventoryBaseId="$route.query.id" :isTrue="true"
@getList="getPersonnelList"
:accept="'.zip'"/> :accept="'.zip'"/>
</div> </div>
<!-- 模板下载--> <!-- 模板下载-->
@@ -498,6 +499,9 @@
} }
this.getList() this.getList()
}, },
getPersonnelList(){
this.getList()
},
getList() { getList() {
let query = { let query = {
...this.queryParam, ...this.queryParam,