Forráskód Böngészése

add:提成管理添加批量审核、批量打款

zoie 4 napja
szülő
commit
5c351dc961

+ 5 - 2
src/components/TableBase/index.vue

@@ -35,6 +35,8 @@ const props = withDefaults(defineProps<ProTableProps>(), {
   searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 })
 })
 
+const multipleTableRef = ref()
+const clearSelection = () => multipleTableRef.value?.clearSelection()
 // 表格操作 Hooks
 const { tableData, pageable, loading, getTableList, searchTable, handleSizeChange, handleCurrentChange } = useTable(
   props.requestApi,
@@ -50,7 +52,8 @@ onMounted(() => {
 
 defineExpose({
   getTableList,
-  searchTable
+  searchTable,
+  clearSelection
 })
 </script>
 
@@ -60,7 +63,7 @@ defineExpose({
   </div>
 
   <div class="card table">
-    <el-table
+    <el-table ref="multipleTableRef"
       v-loading="loading"
       :data="tableData"
       @row-click="props.rowClick"

+ 8 - 4
src/views/storehouse/inventory/IOTNetworkCard.vue

@@ -35,6 +35,7 @@ const editStateVisible = ref(false)
 const columns: ColumnProps[] = [
 	{type: 'selection', width: '44px', fixed: 'left'},
 	{type: 'index', label: '序号', width: 80},
+	{prop: 'T_company_name', label: '公司名称'},
 	{prop: 'T_in_date', label: '入库日期'},
 	{prop: 'T_meal_type', label: '套餐类型'},
 	{prop: 'T_meal', label: '套餐'},
@@ -45,7 +46,7 @@ const columns: ColumnProps[] = [
 	{prop: 'T_out_date', label: '出库日期'},
 	{prop: 'T_out_project', label: '出库项目'},
 	{prop: 'T_receive_name', label: '领用人'},
-	{prop: 'T_remark', label: '备注'},
+	// {prop: 'T_remark', label: '备注'},
 	// {prop: 'operation', label: '操作', width: 150, fixed: 'right'}
 ]
 
@@ -62,6 +63,7 @@ const editStateRules = reactive<FormRules>({
 })
 const form: any = ref({
 	T_id: "",
+	T_company_name: '',
 	T_in_date: '',
 	T_meal_type: '',
 	T_meal: '',
@@ -117,6 +119,7 @@ const openDrawer = (type: string, row?: any) => {
 		}
 	} else {
 		delete form.value.T_id
+		form.value.T_company_name = ''
 		form.value.T_in_date = ''
 		form.value.T_meal_type = ''
 		form.value.T_meal = ''
@@ -345,7 +348,7 @@ const preview = (list:any) => {
 						v-model="initParam.T_name"
 						type="text"
 						class="w-50 m-2"
-						placeholder="按串码、MSISDN搜索"
+						placeholder="按串码、MSISDN、公司名称搜索"
 						@change="searchOnTableList"
 					/>
 				</el-col>
@@ -414,8 +417,6 @@ const preview = (list:any) => {
 
 				</template>
 
-
-
 				<el-table-column
 					fixed="right"
 					label="操作"
@@ -449,6 +450,9 @@ const preview = (list:any) => {
 				<h4 :id="params.titleId" :class="params.titleClass">{{ isNew ? '入库' : '编辑' }} - 物联网卡</h4>
 			</template>
 			<el-form ref="ruleFormRef" :model="form" :rules="rules">
+				<el-form-item label="公司名称:" class="m-b-6" :label-width="formLabelWidth" prop="T_company_name">
+					<el-input v-model="form.T_company_name" type="text" class="w-50" placeholder="请填写公司名称"/>
+				</el-form-item>
 				<el-form-item label="入库日期:" class="m-b-6" :label-width="formLabelWidth" prop="T_in_date">
 					<el-date-picker
 						class="my-date-picker"

+ 5 - 1
src/views/storehouse/inventory/InStorage.vue

@@ -7,7 +7,7 @@ import InStorageForm from './InStorageForm.vue'
 import InStorageEdit from './InStorageEdit.vue'
 
 
-import { ref, reactive } from 'vue'
+import {ref, reactive, nextTick} from 'vue'
 import TableBase from '@/components/TableBase/index.vue'
 import type { ColumnProps } from '@/components/TableBase/interface/index'
 import {Storehouse_StockIn_List, Storehouse_StockIn_del, stockInExcelBatch} from '@/api/storehouse/index'
@@ -117,6 +117,10 @@ const stockInexcelFun = async ()=>{
 	if (result.Code === 200) {
 		window.open(result.Data)
 	}
+	nextTick(() => {
+		multipleSelection.value = []
+		TableRef.value?.clearSelection()
+	})
 }
 const handleSelectionChange = (val: any[]) => {
 	multipleSelection.value = val

+ 4 - 0
src/views/storehouse/outStock/OutStock.vue

@@ -163,6 +163,10 @@ const stockOutExcelFun = async ()=>{
 	if (result.Code === 200) {
 		window.open(result.Data)
 	}
+	nextTick(() => {
+		multipleSelection.value = []
+		TableRef.value?.clearSelection()
+	})
 }
 const handleSelectionChange = (val: any[]) => {
 	multipleSelection.value = val

+ 70 - 14
src/views/storehouse/sales/Percentage.vue

@@ -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 { useTablePublic, options2 } from '@/hooks/useTablePublic'
 import {ElMessage} from "element-plus";
-import {percentage_Remit} from "@/api/mypercentage";
+import {percentage_Approval, percentage_Remit} from "@/api/mypercentage";
 
 const router = useRouter()
 const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
@@ -21,8 +21,9 @@ const PercentageDetail1 = defineAsyncComponent({
   timeout: 3000,
   suspensible: true
 })
-
+const multipleSelection = ref<any[]>([])
 const columns: ColumnProps[] = [
+  { type: 'selection', width: '44px', fixed: 'left'},
   { type: 'index', label: '序号', width: 80 },
   { prop: 'T_task_id', label: '任务编号'},
   { prop: 'T_verifyCompany_name', label: '公司名称', name: 'T_verifyCompany_name'},
@@ -132,16 +133,66 @@ const SubmitRemit = async (row: any) => {
 		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>
 
 <template>
   <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>
         <div class="input-suffix">
           <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>
 				  <el-date-picker
 					  v-model="T_date"
@@ -153,29 +204,34 @@ const SubmitRemit = async (row: any) => {
 					  value-format="YYYY-MM-DD"
 				  />
 			  </el-col>
-            <el-col :xl="5" :md="6">
+            <el-col :xl="5" :lg="5"  :md="4">
               <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)" />
             </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-select>
             </el-col>
-            <el-col :xl="4" :md="6">
+            <el-col :xl="6" :lg="8"  :md="8">
               <span class="inline-flex items-center">状态:</span>
               <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-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="exportPercentageExcel">导出表格</el-button>
 			</el-col>
+
           </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>
       </template>
       <template #T_type="{ row }">