From 656ce346afe1b0ea56b6f89e4453a49a536abef6 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Wed, 27 Sep 2023 18:58:43 +0800
Subject: [PATCH] Merge branch 'feature_1.0' into qa
---
src/views/list/Unit.vue | 109 +++++++++++++++++++++++-------------------------------
1 files changed, 46 insertions(+), 63 deletions(-)
diff --git a/src/views/list/Unit.vue b/src/views/list/Unit.vue
index 91a2dd4..57c01f8 100644
--- a/src/views/list/Unit.vue
+++ b/src/views/list/Unit.vue
@@ -80,6 +80,7 @@
<a-cascader
v-model="editForm.parentCode"
placeholder="���������"
+ change-on-select
:options="newParentListOptions"
@change="positionLevel"
:disabled="pageState === 'view'"
@@ -200,7 +201,7 @@
unitName:'',
parentCode: [],
areaCode:'',
- state:Number,
+ state:'0',
}
private pagination:any={
@@ -295,7 +296,8 @@
page:1,
size: 20
}).then(res=>{
- this.dataSource =res.data.data.item
+ this.dataSource = res.data.data.item
+ this.pagination.total = res.data.data.total
})
.catch(err=>{
console.log(err);
@@ -326,7 +328,7 @@
parentCode: code,
parentCodeList:this.editForm.parentCode,
areaCode: this.editForm.areaCode,
- state:this.editForm.state
+ state:parseInt(this.editForm.state)
}).then((res: any) => {
this.handleSearch()
this.visibleCreateModal = false
@@ -334,7 +336,7 @@
unitName:'',
parentCode: [],
areaCode:'',
- state: Number,
+ state: '0',
parentCodeList:[]
}
}).catch((err)=>{
@@ -350,10 +352,24 @@
}
private handleCreateModalCancel(): any {
- this.visibleCreateModal = false;
+ this.visibleCreateModal = false;
+ this.editForm = {
+ unitName:'',
+ parentCode: [],
+ areaCode:'',
+ state: '0',
+ parentCodeList:[]
+ }
}
- private handleInvalidityModalCancel(): any {
- this.visibleInvalidityModal = false;
+ private handleInvalidityModalCancel(): any {
+ this.editForm = {
+ unitName:'',
+ parentCode: [],
+ areaCode:'',
+ state: '0',
+ parentCodeList:[]
+ }
+ this.visibleInvalidityModal = false;
}
private cityData() {
@@ -377,7 +393,7 @@
})
}
- private positionLevel(val: any) {
+ private positionLevel(val: any) {
this.serch.areaCode = ''
this.editForm.areaCode = ''
let code =val[val.length-1]
@@ -406,10 +422,11 @@
private handleAssert(record: any){
get("unit/state",{
- id: record.unitId,
+ unitId: record.unitId,
- }).then(res => {
- <a-alert message="������������" type="success" />
+ }).then(res => {
+ this.handleSearch()
+ this.$message.success('������������')
})
.catch(err=>{
console.log(err);
@@ -430,8 +447,9 @@
unitId: this.recordTableData.unitId,
invalidReason:this.createForm.getFieldValue('code')
}).then(res => {
- <a-alert message="���������" type="success" />
- this.visibleInvalidityModal=false
+ this.$message.success('������������')
+ this.visibleInvalidityModal = false
+ this.handleSearch()
})
.catch(err=>{
console.log(err);
@@ -440,15 +458,15 @@
}
private progressStateRender(text: string) {
- if (text === 0) {
+ if (text === '0') {
return <a-badge status = 'success' text = '������' />;
}
return <a-badge status = 'processing' text = '���������' />;
}
- private handleUpdateModalVisible(visible: boolean, record: any): void {
+ private async handleUpdateModalVisible(visible: boolean, record: any): void {
this.visibleCreateModal = true;
- this.positionLevel(record.parentCodeList)
+ await this.positionLevel(record.parentCodeList)
this.title = '������������������'
let params = _.cloneDeep(record)
console.log(params)
@@ -457,10 +475,14 @@
this.pageState='edit'
console.log('editForm',record)
}
- private handleDetailModalVisible(visible: boolean, record: any): void {
+ private async handleDetailModalVisible(visible: boolean, record: any): void {
this.visibleCreateModal = true;
+ await this.positionLevel(record.parentCodeList)
this.title = '������������������'
- this.editForm = record
+ let params = _.cloneDeep(record)
+ console.log(params)
+ params.parentCode=record.parentCodeList
+ this.editForm = params
this.pageState='view'
}
private opRender(text: string, record: any, index: number) {
@@ -468,46 +490,8 @@
console.log('1111',text)
console.log('2222',record)
console.log('333', index)
- if (record.state==='1') {
- if (record.isInvalid ===0) {
+ if (record.state ==='0') {
return <div>
- <a onClick = {
- () => this.handleUpdateModalVisible(true, record)
- } > ������ </a>
- <a-divider type='vertical' />
- <a onClick = {
- () => this.handleDetailModalVisible(true, record)
- } > ������ </a>
- <a-divider type = 'vertical' / >
- <a v-show="record.state !=='1'" onClick={ () => this.handleAssert(record)
- } >������</a>
- <a-divider type = 'vertical' />
- <a v-show="record.isInvalid !=='0'" onClick = {
- () => this.handleInvalidity(record)
- } >������</a>
- </div>
- } else {
- return <div>
- <a onClick = {
- () => this.handleUpdateModalVisible(true, record)
- } > ������ </a>
- <a-divider type='vertical' />
- <a onClick = {
- () => this.handleDetailModalVisible(true, record)
- } > ������ </a>
- <a-divider type = 'vertical' / >
- <a v-show="record.state !=='1'" onClick={ () => this.handleAssert(record)
- } >������</a>
-
- </div>
- }
- } else {
- if (record.isInvalid ===0) {
- return <div>
- <a onClick = {
- () => this.handleUpdateModalVisible(true, record)
- } > ������ </a>
- <a-divider type='vertical' />
<a onClick = {
() => this.handleDetailModalVisible(true, record)
} > ������ </a>
@@ -518,17 +502,16 @@
</div>
} else {
return <div>
- <a onClick = {
- () => this.handleUpdateModalVisible(true, record)
- } > ������ </a>
- <a-divider type='vertical' />
<a onClick = {
() => this.handleDetailModalVisible(true, record)
} > ������ </a>
- <a-divider type = 'vertical' / >
+ <a-divider type='vertical' />
+ <a onClick = {
+ () => this.handleUpdateModalVisible(true, record)
+ } > ������ </a>
</div>
}
- }
+ this.handleSearch();
}
}
--
Gitblit v1.8.0