|
@@ -97,7 +97,7 @@
|
|
|
</el-container>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="close()">关闭</el-button>
|
|
|
- <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" v-noMoreClick>({{dataListAllSelections.length}}) 确定</el-button>
|
|
|
+ <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" v-noMoreClick><span v-if="checkType === '1'">({{dataListAllSelections.length}})</span> 确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -203,42 +203,44 @@
|
|
|
this.$emit('getProgram', rows)
|
|
|
},
|
|
|
list () {
|
|
|
- this.loading = true
|
|
|
- this.searchForm.showInvoiceFlag = '1' // showInvoiceFlag = '1'时,查询关联发票的开票状态。showInvoiceFlag为其他值或者为空时,不查询
|
|
|
- this.programProjectListInfoService.list({
|
|
|
- 'current': this.tablePage.currentPage,
|
|
|
- 'size': this.tablePage.pageSize,
|
|
|
- 'orders': this.tablePage.orders,
|
|
|
- ...this.searchForm
|
|
|
- }).then(async ({data}) => {
|
|
|
- this.dataList = data.records
|
|
|
- this.tablePage.total = data.total
|
|
|
- this.loading = false
|
|
|
- // 在切换页后,将页面不需要勾选的数据取消勾选
|
|
|
- let isCheck = []
|
|
|
- for (let i = 0; i < this.tablePage.pageSize; i++) {
|
|
|
- for (let j = 0; j < this.dataListAllSelections.length; j++) {
|
|
|
- if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
|
|
|
- if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
|
|
|
- isCheck.push(this.dataList[i].id)
|
|
|
+ if (this.checkType === '1') {
|
|
|
+ this.loading = true
|
|
|
+ this.searchForm.showInvoiceFlag = '1' // showInvoiceFlag = '1'时,查询关联发票的开票状态。showInvoiceFlag为其他值或者为空时,不查询
|
|
|
+ this.programProjectListInfoService.list({
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
+ ...this.searchForm
|
|
|
+ }).then(async ({data}) => {
|
|
|
+ this.dataList = data.records
|
|
|
+ this.tablePage.total = data.total
|
|
|
+ this.loading = false
|
|
|
+ // 在切换页后,将页面不需要勾选的数据取消勾选
|
|
|
+ let isCheck = []
|
|
|
+ for (let i = 0; i < this.tablePage.pageSize; i++) {
|
|
|
+ for (let j = 0; j < this.dataListAllSelections.length; j++) {
|
|
|
+ if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
|
|
|
+ if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
|
|
|
+ isCheck.push(this.dataList[i].id)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (this.commonJS.isNotEmpty(isCheck)) {
|
|
|
- for (let i = 0; i < this.tablePage.pageSize; i++) {
|
|
|
- if (isCheck.includes(this.dataList[i].id)) {
|
|
|
- await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
|
|
|
- } else {
|
|
|
+ if (this.commonJS.isNotEmpty(isCheck)) {
|
|
|
+ for (let i = 0; i < this.tablePage.pageSize; i++) {
|
|
|
+ if (isCheck.includes(this.dataList[i].id)) {
|
|
|
+ await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
|
|
|
+ } else {
|
|
|
+ await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < this.tablePage.pageSize; i++) {
|
|
|
await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- for (let i = 0; i < this.tablePage.pageSize; i++) {
|
|
|
- await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 当前页
|
|
|
currentChangeHandle ({currentPage, pageSize}) {
|
|
@@ -258,7 +260,9 @@
|
|
|
this.list()
|
|
|
},
|
|
|
close () {
|
|
|
- this.$refs.programTable.clearCheckboxReserve()
|
|
|
+ if (this.$refs.programTable) {
|
|
|
+ this.$refs.programTable.clearCheckboxReserve()
|
|
|
+ }
|
|
|
this.dataListAllSelections = []
|
|
|
this.detail = ''
|
|
|
this.visible = false
|