|
@@ -8,7 +8,7 @@ import type { ColumnProps } from '@/components/TableBase/interface/index'
|
|
import { percentage_List, percentage_User_List,percentage_del,percentage_Excel } from '@/api/percentage/index'
|
|
import { percentage_List, percentage_User_List,percentage_del,percentage_Excel } from '@/api/percentage/index'
|
|
import { useTablePublic, options2 } from '@/hooks/useTablePublic'
|
|
import { useTablePublic, options2 } from '@/hooks/useTablePublic'
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
-import {percentage_Remit} from "@/api/mypercentage";
|
|
|
|
|
|
+import {percentage_Approval, percentage_Remit} from "@/api/mypercentage";
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
|
|
const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
|
|
@@ -21,8 +21,9 @@ const PercentageDetail1 = defineAsyncComponent({
|
|
timeout: 3000,
|
|
timeout: 3000,
|
|
suspensible: true
|
|
suspensible: true
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+const multipleSelection = ref<any[]>([])
|
|
const columns: ColumnProps[] = [
|
|
const columns: ColumnProps[] = [
|
|
|
|
+ { type: 'selection', width: '44px', fixed: 'left'},
|
|
{ type: 'index', label: '序号', width: 80 },
|
|
{ type: 'index', label: '序号', width: 80 },
|
|
{ prop: 'T_task_id', label: '任务编号'},
|
|
{ prop: 'T_task_id', label: '任务编号'},
|
|
{ prop: 'T_verifyCompany_name', label: '公司名称', name: 'T_verifyCompany_name'},
|
|
{ prop: 'T_verifyCompany_name', label: '公司名称', name: 'T_verifyCompany_name'},
|
|
@@ -132,16 +133,66 @@ const SubmitRemit = async (row: any) => {
|
|
ElMessage.success(reslut.Msg)
|
|
ElMessage.success(reslut.Msg)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// 保存选中的数据id,row-key就是要指定一个key标识这一行的数据
|
|
|
|
+const getRowKey = (row: any) => {
|
|
|
|
+ return row.Id
|
|
|
|
+}
|
|
|
|
+const handleSelectionChange = (val: any[]) => {
|
|
|
|
+ multipleSelection.value = val
|
|
|
|
+ console.log(multipleSelection.value)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 批量提交打款
|
|
|
|
+const batchSubmitRemit = async () => {
|
|
|
|
+ if (multipleSelection.value.length === 0) {
|
|
|
|
+ ElMessage.warning('请选择提成!!!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for await (let item of multipleSelection.value) {
|
|
|
|
+ percentage_Remit({ T_id: item.Id })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ElMessage.success('打款成功!!!')
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ multipleSelection.value = []
|
|
|
|
+ searchOnTableList(TableRef.value)
|
|
|
|
+ TableRef.value?.clearSelection()
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 批量提审核
|
|
|
|
+const batchSubmitApproval = async () => {
|
|
|
|
+ if (multipleSelection.value.length === 0) {
|
|
|
|
+ ElMessage.warning('请选择提成!!!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for await (let item of multipleSelection.value) {
|
|
|
|
+ percentage_Approval({ T_id: item.Id, T_state: 2 })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ElMessage.success('审核通过!!!')
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ multipleSelection.value = []
|
|
|
|
+ searchOnTableList(TableRef.value)
|
|
|
|
+ TableRef.value?.clearSelection()
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="contract">
|
|
<div class="contract">
|
|
- <TableBase ref="TableRef" :columns="columns" :requestApi="percentage_List" :initParam="initParam">
|
|
|
|
|
|
+ <TableBase ref="TableRef" :columns="columns" :requestApi="percentage_List" :initParam="initParam"
|
|
|
|
+ selectId="Id"
|
|
|
|
+ :getRowKey="getRowKey"
|
|
|
|
+ :selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
<template #table-header>
|
|
<template #table-header>
|
|
<div class="input-suffix">
|
|
<div class="input-suffix">
|
|
<el-row :gutter="20" style="margin-bottom: 0">
|
|
<el-row :gutter="20" style="margin-bottom: 0">
|
|
- <el-col :xl="6" :lg="7" :md="11" style="display: flex">
|
|
|
|
|
|
+ <el-col :xl="6" :lg="6" :md="5" style="display: flex">
|
|
<span class="inline-flex items-center">统计日期:</span>
|
|
<span class="inline-flex items-center">统计日期:</span>
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="T_date"
|
|
v-model="T_date"
|
|
@@ -153,29 +204,34 @@ const SubmitRemit = async (row: any) => {
|
|
value-format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xl="5" :md="6">
|
|
|
|
|
|
+ <el-col :xl="5" :lg="5" :md="4">
|
|
<span class="inline-flex items-center">关键字:</span>
|
|
<span class="inline-flex items-center">关键字:</span>
|
|
- <el-input v-model="initParam.T_name" type="text" class="w-50 m-2" placeholder="按任务编号编号、公司名称搜索" clearable
|
|
|
|
|
|
+ <el-input v-model="initParam.T_name" type="text" style="width: 150px;" placeholder="按任务编号、公司名称搜索" clearable
|
|
@change="searchOnTableList(TableRef)" />
|
|
@change="searchOnTableList(TableRef)" />
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xl="4" :md="6">
|
|
|
|
- <span class="inline-flex items-center">员工:</span>
|
|
|
|
- <el-select v-model="initParam.T_uuid" filterable remote reserve-keyword placeholder="员工"
|
|
|
|
- :remote-method="remoteMethod" :loading="loading" @click="click2" clearable style="width: 200px;">
|
|
|
|
|
|
+ <el-col :xl="4" :lg="5" :md="6">
|
|
|
|
+ <span class="inline-flex items-center">提成人:</span>
|
|
|
|
+ <el-select v-model="initParam.T_uuid" filterable remote reserve-keyword placeholder="提成人"
|
|
|
|
+ :remote-method="remoteMethod" :loading="loading" @click="click2" clearable style="width: 150px;">
|
|
<el-option v-for="item in optionsData" :key="item.value" :label="item.label" :value="item.value" />
|
|
<el-option v-for="item in optionsData" :key="item.value" :label="item.label" :value="item.value" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xl="4" :md="6">
|
|
|
|
|
|
+ <el-col :xl="6" :lg="8" :md="8">
|
|
<span class="inline-flex items-center">状态:</span>
|
|
<span class="inline-flex items-center">状态:</span>
|
|
<el-select v-model="initParam.T_state" class="w-50" clearable placeholder="请选择状态~">
|
|
<el-select v-model="initParam.T_state" class="w-50" clearable placeholder="请选择状态~">
|
|
<el-option v-for="item in options2" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in options2" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
- </el-col>
|
|
|
|
- <el-col :xl="5" :md="3" class="btn">
|
|
|
|
<el-button type="primary" @click="searchOnTableList(TableRef)">搜索</el-button>
|
|
<el-button type="primary" @click="searchOnTableList(TableRef)">搜索</el-button>
|
|
- <el-button type="primary" @click="exportPercentageExcel">导出表格</el-button>
|
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <el-row :gutter="20" class="btn" style="margin-top: 15px">
|
|
|
|
+ <el-col :xl="8" :md="8">
|
|
|
|
+ <el-button type="warning" @click="batchSubmitApproval">批量审核通过</el-button>
|
|
|
|
+ <el-button type="success" @click="batchSubmitRemit">批量打款</el-button>
|
|
|
|
+ <el-button type="primary" @click="exportPercentageExcel">导出表格</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<template #T_type="{ row }">
|
|
<template #T_type="{ row }">
|