|
@@ -39,7 +39,7 @@
|
|
<rangeDate ref="rangeDate" @change="dateChange" />
|
|
<rangeDate ref="rangeDate" @change="dateChange" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="5" :sm="24">
|
|
|
|
|
|
+ <a-col :md="8" :sm="24">
|
|
<a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseBillModal-refresh">查询</a-button>
|
|
<a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseBillModal-refresh">查询</a-button>
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseBillModal-reset">重置</a-button>
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseBillModal-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -47,7 +47,8 @@
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
<div class="btn-cont">
|
|
<div class="btn-cont">
|
|
- <a-button type="primary" ghost id="chooseBillModal-modal-save" @click="handleSave">批量更新</a-button>
|
|
|
|
|
|
+ <a-button type="primary" ghost id="chooseBillModal-modal-save" @click="handleSave">批量添加</a-button>
|
|
|
|
+ <span v-if="totalNums" style="margin-left: 15px;">已选{{ totalNums }}项</span>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
@@ -55,7 +56,7 @@
|
|
ref="table"
|
|
ref="table"
|
|
size="small"
|
|
size="small"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
- :row-selection="{ columnWidth: 40 }"
|
|
|
|
|
|
+ :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.checked } })}"
|
|
@rowSelection="rowSelectionFun"
|
|
@rowSelection="rowSelectionFun"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
@@ -98,6 +99,11 @@ export default {
|
|
default: ''
|
|
default: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed:{
|
|
|
|
+ totalNums(){
|
|
|
|
+ return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length
|
|
|
|
+ }
|
|
|
|
+ },
|
|
data () {
|
|
data () {
|
|
const _this = this
|
|
const _this = this
|
|
return {
|
|
return {
|
|
@@ -116,33 +122,29 @@ export default {
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
|
|
- { title: '单据号', dataIndex: 'bizNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '单据号', dataIndex: 'bizNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单据类型', dataIndex: 'bizTypeDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单据类型', dataIndex: 'bizTypeDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '关联单据创建时间', dataIndex: 'bizCreateDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '关联单据创建时间', dataIndex: 'bizCreateDate', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
{ title: '金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
- { title: '余额', dataIndex: 'unsettleAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
|
|
|
|
|
|
+ { title: '余额', dataIndex: 'unsettleAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
+ { title: '状态', dataIndex: 'checked', width: '6%', align: 'center', customRender: function (text) { return text ? '已选' : '--' } }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
|
|
+ const _this = this
|
|
return settleInfoAllList(Object.assign(this.queryParam, { settleClientType: this.settleClientType, settleClientSn: this.settleClientSn, notEqZero: 1 })).then(res => {
|
|
return settleInfoAllList(Object.assign(this.queryParam, { settleClientType: this.settleClientType, settleClientSn: this.settleClientSn, notEqZero: 1 })).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
- const selectedRowKeys = []
|
|
|
|
- const selectedRows = []
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
data[i].no = i + 1
|
|
data[i].no = i + 1
|
|
data[i].settleAmount = data[i].unsettleAmount
|
|
data[i].settleAmount = data[i].unsettleAmount
|
|
- const ind = this.nowChoose.findIndex(item => item.id == data[i].id)
|
|
|
|
- if (ind != -1) {
|
|
|
|
- selectedRowKeys.push(data[i].id)
|
|
|
|
- selectedRows.push(data[i])
|
|
|
|
- }
|
|
|
|
|
|
+ const has = _this.nowChoose.find(item => item.id == data[i].id)
|
|
|
|
+ data[i].checked = !!has
|
|
}
|
|
}
|
|
- this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
|
|
|
|
this.disabled = false
|
|
this.disabled = false
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -155,6 +157,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 表格选中项
|
|
// 表格选中项
|
|
rowSelectionFun (obj) {
|
|
rowSelectionFun (obj) {
|
|
|
|
+ console.log(obj)
|
|
this.rowSelectionInfo = obj || null
|
|
this.rowSelectionInfo = obj || null
|
|
},
|
|
},
|
|
// 关联单据创建时间
|
|
// 关联单据创建时间
|
|
@@ -169,8 +172,12 @@ export default {
|
|
},
|
|
},
|
|
// 确定
|
|
// 确定
|
|
handleSave () {
|
|
handleSave () {
|
|
- this.$emit('ok', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
|
|
|
|
- this.isShow = false
|
|
|
|
|
|
+ if(this.totalNums){
|
|
|
|
+ this.$emit('ok', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
|
|
|
|
+ this.resetSearchForm()
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.info("请选择单据")
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
@@ -183,6 +190,7 @@ export default {
|
|
this.queryParam.bizNo = ''
|
|
this.queryParam.bizNo = ''
|
|
this.queryParam.bizType = undefined
|
|
this.queryParam.bizType = undefined
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -196,6 +204,8 @@ export default {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
_this.$emit('close')
|
|
_this.$emit('close')
|
|
_this.$refs.table.clearSelected() // 清空表格选中项
|
|
_this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
|
+ _this.selectedRowKeys = []
|
|
|
|
+ _this.selectedRows = []
|
|
_this.resetSearchForm()
|
|
_this.resetSearchForm()
|
|
} else {
|
|
} else {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|