|
@@ -133,7 +133,7 @@
|
|
|
@change="handleTableChange"
|
|
|
:pagination="pagination"
|
|
|
:scroll="{ x: 3500, y: 400 }"
|
|
|
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
+ :rowSelection="{ onSelect: onSelect, onSelectAll: onSelectAll,selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
>
|
|
|
</a-table>
|
|
|
</a-card>
|
|
@@ -299,7 +299,7 @@
|
|
|
});
|
|
|
const dataSource =ref([]);
|
|
|
let selectedRowKeys = ref([]);
|
|
|
- let selectedRows = ref([]);
|
|
|
+ let selectionRows = ref([]);
|
|
|
const toggleSearchStatus = ref(false);
|
|
|
var billDate = ref([])
|
|
|
const queryParams = ref({
|
|
@@ -386,6 +386,8 @@
|
|
|
}
|
|
|
function searchQuery(){
|
|
|
pagination.value.current = 1
|
|
|
+ selectedRowKeys.value = []
|
|
|
+ selectionRows.value=[]
|
|
|
loadData();
|
|
|
}
|
|
|
function searchReset(){
|
|
@@ -409,34 +411,73 @@
|
|
|
}
|
|
|
pagination.value.current =1;
|
|
|
pagination.value.pageSize = 10;
|
|
|
+ selectedRowKeys.value = []
|
|
|
+ selectionRows.value=[]
|
|
|
loadData();
|
|
|
}
|
|
|
function handleToggleSearch(){
|
|
|
toggleSearchStatus.value = !toggleSearchStatus.value;
|
|
|
}
|
|
|
- function onSelectChange(keys,rows){
|
|
|
- selectedRowKeys.value = keys
|
|
|
- selectedRows.value = rows
|
|
|
+ function onSelectChange(selectedRowKeys1, selectionRows1) {
|
|
|
+ var arr = []
|
|
|
+ selectionRows.value.map(item=>{
|
|
|
+ arr.push(item.childId)
|
|
|
+ })
|
|
|
+ selectedRowKeys.value = arr
|
|
|
+ }
|
|
|
+ function onSelect(record, selected, selectionRows1, nativeEvent) {
|
|
|
+ if (selected) {
|
|
|
+ selectionRows.value.push(record)
|
|
|
+ console.log( selectionRows.value);
|
|
|
+ }else{
|
|
|
+ const delIndex = selectionRows.value.findIndex((val) => {
|
|
|
+ return val.childId === record.childId
|
|
|
+ })
|
|
|
+ selectionRows.value.splice(delIndex, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function onSelectAll(selected, selectionRows1, changeRows) {
|
|
|
+ if (selected) {
|
|
|
+ selectionRows.value = selectionRows.value.concat(changeRows)
|
|
|
+ }
|
|
|
+ if (!selected) {
|
|
|
+ let selectionRows2 = JSON.parse(JSON.stringify(selectionRows.value))
|
|
|
+ const delIndex = []
|
|
|
+ selectionRows2.forEach((item, index) => {
|
|
|
+ changeRows.forEach((val, itemIndex) => {
|
|
|
+ if (item.childId === val.childId) {
|
|
|
+ delIndex.push(index)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ delIndex.forEach((item) => {
|
|
|
+ delete selectionRows2[item]
|
|
|
+ })
|
|
|
+ selectionRows2 = selectionRows2.filter((item) => {
|
|
|
+ return item !== undefined
|
|
|
+ })
|
|
|
+ selectionRows.value = selectionRows2
|
|
|
+ }
|
|
|
}
|
|
|
function handleOk(){
|
|
|
var arr = []
|
|
|
- selectedRows.value.map(item=>arr.push(item.billCode))
|
|
|
+ selectionRows.value.map(item=>arr.push(item.billCode))
|
|
|
if(fatherSourceCode.value&&fatherSourceCode.value!==''){
|
|
|
arr.push(fatherSourceCode.value)
|
|
|
}
|
|
|
if(selectedRowKeys.value.length==0){
|
|
|
message.error('请勾选数据');
|
|
|
}else if(new Set(arr).size!==1){
|
|
|
- message.error('请勾选询价单号相同的数据');
|
|
|
+ message.error('请勾选合同编号相同的数据');
|
|
|
}else{
|
|
|
- emit('selectContract', selectedRows.value)
|
|
|
+ emit('selectContract', selectionRows.value)
|
|
|
handleCancel()
|
|
|
}
|
|
|
}
|
|
|
function handleCancel(){
|
|
|
visible.value = false
|
|
|
selectedRowKeys.value = []
|
|
|
- selectedRows.value=[]
|
|
|
+ selectionRows.value=[]
|
|
|
billDate.value = []
|
|
|
queryParams.value = {
|
|
|
billCode:'',
|