fix bug
This commit is contained in:
@@ -200,8 +200,14 @@ export default {
|
||||
);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'$route.query.detailNo'(detailNo) {
|
||||
if (detailNo) this.openRouteDetail(detailNo);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.loadTable();
|
||||
this.openRouteDetail();
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -267,6 +273,19 @@ export default {
|
||||
openView(row) {
|
||||
this.editor = { visible: true, id: row.id, readonly: true };
|
||||
},
|
||||
async openRouteDetail(detailNo = this.$route.query.detailNo) {
|
||||
const formalSettlementNo = String(detailNo || '').trim();
|
||||
if (!formalSettlementNo) return;
|
||||
const response = await api.getList(1, 10, { formalSettlementNo });
|
||||
const data = this.unwrapData(response);
|
||||
const row = (data.records || []).find(item => item.formalSettlementNo === formalSettlementNo);
|
||||
if (!row) {
|
||||
this.$message.warning('未找到对应的正式结算单');
|
||||
return;
|
||||
}
|
||||
this.activeSettlementType = row.settlementType || this.activeSettlementType;
|
||||
this.openView(row);
|
||||
},
|
||||
async handleDelete(row) {
|
||||
await this.$confirm('确认删除该正式结算草稿?', '提示', { type: 'warning' });
|
||||
await api.remove(row.id);
|
||||
|
||||
Reference in New Issue
Block a user