shasha 1 mese fa
parent
commit
d699e056bd

+ 1 - 0
snowy-admin-web/src/views/biz/bizloadpoint/index.vue

@@ -47,6 +47,7 @@
 			</template>
 		</s-table>
 	</a-card>
+	
 	<Form ref="formRef" @successful="tableRef.refresh()" />
 	<UserIndex ref="userIndexRef" @successful="tableRef.refresh()" />
 	<TimeIndex ref="timeIndexRef" @successful="tableRef.refresh()" />

+ 73 - 89
snowy-admin-web/src/views/biz/bizloadpoint/timeIndex.vue

@@ -1,70 +1,59 @@
 <template>
-	<a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
-		<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
-			<a-row :gutter="24">
-				<a-col :span="6">
-					<a-form-item label="点位名称" name="loadPoint">
-						<a-input v-model:value="searchFormState.loadPoint" placeholder="查询点位名称" allow-clear  />
-					</a-form-item>
-				</a-col>
-				<a-col :span="9">
-					<a-form-item label="装货开始时间" name="confStartTime">
-						<a-range-picker v-model:value="searchFormState.confStartTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear  />
-					</a-form-item>
-				</a-col>
-				<a-col :span="9">
-					<a-form-item label="装货结束时间" name="confEndTime">
-						<a-range-picker v-model:value="searchFormState.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear  />
-					</a-form-item>
-				</a-col>
-			</a-row>
-			<a-row :gutter="24">
-				<a-col :span="6">
-					<a-form-item label="装货员" name="loadUser">
-						<a-input v-model:value="searchFormState.loadUser" placeholder="查询货品名称" allow-clear  />
-					</a-form-item>
-				</a-col>
-				<a-col :span="9"></a-col>
-				<a-col :span="9">
-					<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
-					<a-button style="margin: 0 8px" @click="reset">重置</a-button>
-					
-					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizLoadTimeAdd')">
-						<template #icon><plus-outlined /></template>
-						新增
-					</a-button>
-				</a-col>
-			</a-row>
-		</a-form>
-	</a-card>
-	<a-card :bordered="false">
-		<s-table
-			ref="tableRef"
-			:columns="columns"
-			:data="loadData"
-			bordered
-			:row-key="(record) => record.id"
-		>
-			<template #bodyCell="{ column, record, index }">
-				<template v-if="column.dataIndex === 'serial'">
-					{{ index + 1 }}
+	<a-drawer title="装货时间配置" :width="650" :open="visible" :destroy-on-close="true" @close="onClose">
+		<a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
+			<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
+				<a-row :gutter="24">
+					<a-col :span="9">
+						<a-form-item label="装货开始时间" name="confStartTime">
+							<a-range-picker v-model:value="searchFormState.confStartTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear  />
+						</a-form-item>
+					</a-col>
+					<a-col :span="9">
+						<a-form-item label="装货结束时间" name="confEndTime">
+							<a-range-picker v-model:value="searchFormState.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear  />
+						</a-form-item>
+					</a-col>
+					<a-col :span="6">
+						<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
+						<a-button style="margin: 0 8px" @click="reset">重置</a-button>
+						
+						<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizLoadTimeAdd')">
+							<template #icon><plus-outlined /></template>
+							新增
+						</a-button>
+					</a-col>
+				</a-row>
+			</a-form>
+		</a-card>
+		<a-card :bordered="false">
+			<s-table
+				ref="tableRef"
+				:columns="columns"
+				:data="loadData"
+				bordered
+				:row-key="(record) => record.id"
+			>
+				<template #bodyCell="{ column, record, index }">
+					<template v-if="column.dataIndex === 'serial'">
+						{{ index + 1 }}
+					</template>
+					<template v-if="column.dataIndex === 'action'">
+						<a-space>
+							<a @click="formRef.onOpen(record)" v-if="hasPerm('bizLoadTimeEdit')">编辑</a>
+							<a-divider type="vertical" v-if="hasPerm(['bizLoadTimeEdit', 'bizLoadTimeDelete'], 'and')" />
+							<a-button type="link" danger size="small" v-if="hasPerm('bizLoadTimeDelete')" @click="deleteConfig(record)">删除</a-button>
+						</a-space>
+					</template>
 				</template>
-				<template v-if="column.dataIndex === 'action'">
-					<a-space>
-						<a @click="formRef.onOpen(record)" v-if="hasPerm('bizLoadTimeEdit')">编辑</a>
-						<a-divider type="vertical" v-if="hasPerm(['bizLoadTimeEdit', 'bizLoadTimeDelete'], 'and')" />
-						<a-button type="link" danger size="small" v-if="hasPerm('bizLoadTimeDelete')" @click="deleteConfig(record)">删除</a-button>
-					</a-space>
-				</template>
-			</template>
-		</s-table>
-	</a-card>
+			</s-table>
+		</a-card>
+	</a-drawer>
 	<Form ref="formRef" @successful="tableRef.refresh()" />
 </template>
 
 <script setup name="bizloadtime">
 	import { cloneDeep } from 'lodash-es'
-	import Form from './loadtimeform.vue'
+	import Form from './timeform.vue'
 	import bizLoadTimeApi from '@/api/biz/bizLoadTimeApi'
 
 	const searchFormState = ref({})
@@ -77,20 +66,20 @@
 			title: '装货点位',
 			dataIndex: 'loadPoint'
 		},
-		{
-			title: '装货员',
-			dataIndex: 'loadUser'
-		},
 		{
 			title: '装货时间段',
 			dataIndex: 'beginTime-endTime'
 		},
 		{
-			title: '可约次数',
+			title: '可约次数',
 			dataIndex: 'availableNumber'
 		},
 		{
-			title: '已约次数',
+			title: '已预约日期',
+			dataIndex: 'alreadyDate'
+		},
+		{
+			title: '已预约次数',
 			dataIndex: 'alreadyNumber'
 		},
 	]
@@ -103,32 +92,23 @@
 			width: 150
 		})
 	}
-	const selectedRowKeys = ref([])
-	// 列表选择配置
-	const options = {
-		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
-		alert: {
-			show: true,
-			clear: () => {
-				selectedRowKeys.value = ref([])
-			}
-		},
-		rowSelection: {
-			onChange: (selectedRowKey, selectedRows) => {
-				selectedRowKeys.value = selectedRowKey
-			}
+	// 打开抽屉
+	const onOpen = (record) => {
+		recordData.value = record
+		searchFormState.value = {
+			loadPointId: record.id
 		}
+		visible.value = true
 	}
+	// 加载字段数据
 	const loadData = (parameter) => {
-		const searchFormParam = cloneDeep(searchFormState.value)
-		return bizLoadTimeApi.bizLoadTimePage(Object.assign(parameter, searchFormParam)).then((data) => {
-			return data
+		return bizLoadTimeApi.bizLoadTimePage(Object.assign(parameter, searchFormState.value)).then((res) => {
+			return res
 		})
 	}
-	// 重置
-	const reset = () => {
-		searchFormRef.value.resetFields()
-		tableRef.value.refresh(true)
+	// 关闭抽屉
+	const onClose = () => {
+		visible.value = false
 	}
 	// 删除
 	const deleteConfig = (record) => {
@@ -144,8 +124,8 @@
 					}
 				]
 
-				customerApi
-					.customerDelete(params)
+				customerAccountApi
+					.customerAccountDelete(params)
 					.then(() => {
 						tableRef.value.refresh(true)
 					})
@@ -156,4 +136,8 @@
 			onCancel() {}
 		})
 	}
+	// 调用这个函数将子组件的一些数据和方法暴露出去
+	defineExpose({
+		onOpen
+	})
 </script>

+ 76 - 91
snowy-admin-web/src/views/biz/bizloadpoint/userIndex.vue

@@ -1,62 +1,78 @@
 <template>
-	<a-card :bordered="false">
-		<s-table
-			ref="tableRef"
-			:columns="columns"
-			:data="loadData"
-			:alert="options.alert.show"
-			bordered
-			:row-key="(record) => record.id"
-			:tool-config="toolConfig"
-			:row-selection="options.rowSelection"
-		>
-			<template #operator class="table-operator">
-				<a-space>
-					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizLoadUserAdd')">
-						<template #icon><plus-outlined /></template>
-						新增
-					</a-button>
-					<xn-batch-button
-						v-if="hasPerm('bizLoadUserBatchDelete')"
-						buttonName="批量删除"
-                        icon="DeleteOutlined"
-						:selectedRowKeys="selectedRowKeys"
-						@batchCallBack="deleteBatchBizLoadUser"
-					/>
-				</a-space>
-			</template>
-			<template #bodyCell="{ column, record }">
-				<template v-if="column.dataIndex === 'action'">
-					<a-space>
-						<a @click="formRef.onOpen(record)" v-if="hasPerm('bizLoadUserEdit')">编辑</a>
-						<a-divider type="vertical" v-if="hasPerm(['bizLoadUserEdit', 'bizLoadUserDelete'], 'and')" />
-						<a-button type="link" danger size="small" v-if="hasPerm('bizLoadUserDelete')" @click="deleteConfig(record)">删除</a-button>
-					</a-space>
+	<a-drawer title="装货员配置" :width="650" :open="visible" :destroy-on-close="true" @close="onClose">
+		<a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
+			<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
+				<a-row :gutter="24">
+					<a-col :span="6">
+						<a-form-item label="装货员" name="account">
+							<a-input v-model:value="searchFormState.account" placeholder="查询装货员" allow-clear  />
+						</a-form-item>
+					</a-col>
+					<a-col :span="6">
+						<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
+						<a-button style="margin: 0 8px" @click="reset">重置</a-button>
+						
+						<a-button type="primary" @click="userFormRef.onOpen(recordData)" v-if="hasPerm('bizLoadTimeAdd')">
+							<template #icon><plus-outlined /></template>
+							新增
+						</a-button>
+					</a-col>
+				</a-row>
+			</a-form>
+		</a-card>
+		<a-card :bordered="false">
+			<s-table
+				ref="tableRef"
+				:columns="columns"
+				:data="loadData"
+				bordered
+				:row-key="(record) => record.id"
+			>
+				<template #bodyCell="{ column, record, index }">
+					<template v-if="column.dataIndex === 'serial'">
+						{{ index + 1 }}
+					</template>
+					<template v-if="column.dataIndex === 'action'">
+						<a-space>
+							<a @click="formRef.onOpen(record)" v-if="hasPerm('bizLoadUserEdit')">编辑</a>
+							<a-divider type="vertical" v-if="hasPerm(['bizLoadUserEdit', 'bizLoadUserDelete'], 'and')" />
+							<a-button type="link" danger size="small" v-if="hasPerm('bizLoadUserDelete')" @click="deleteConfig(record)">删除</a-button>
+						</a-space>
+					</template>
 				</template>
-			</template>
-		</s-table>
-	</a-card>
-	<Form ref="formRef" @successful="tableRef.refresh()" />
+			</s-table>
+		</a-card>
+	</a-drawer>
+
+	<UserForm ref="userFormRef" @successful="tableRef.refresh()" />
 </template>
 
 <script setup name="bizloaduser">
 	import { cloneDeep } from 'lodash-es'
-	import Form from './loadUserForm.vue'
+	import UserForm from './userForm.vue'
 	import bizLoadUserApi from '@/api/biz/bizLoadUserApi'
 
+	const submitLoading = ref(false)
+	const toolConfig = { refresh: true, height: false, columnSetting: false, striped: false }
+	// 默认是关闭状态
+	const visible = ref(false)
 	const searchFormState = ref({})
 	const searchFormRef = ref()
 	const tableRef = ref()
-	const formRef = ref()
-	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
+	const userFormRef = ref()
+	const recordData = ref()
 	const columns = [
 		{
-			title: '装货点位id',
-			dataIndex: 'loadId'
+			title: '装货点位',
+			dataIndex: 'loadPoint'
+		},
+		{
+			title: '装货员账号',
+			dataIndex: 'account'
 		},
 		{
-			title: '点位人员信息',
-			dataIndex: 'userId'
+			title: '创建时间',
+			dataIndex: 'createTime'
 		},
 	]
 	// 操作栏通过权限判断是否显示
@@ -68,57 +84,26 @@
 			width: 150
 		})
 	}
-	const selectedRowKeys = ref([])
-	// 列表选择配置
-	const options = {
-		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
-		alert: {
-			show: true,
-			clear: () => {
-				selectedRowKeys.value = ref([])
-			}
-		},
-		rowSelection: {
-			onChange: (selectedRowKey, selectedRows) => {
-				selectedRowKeys.value = selectedRowKey
-			}
+	// 打开抽屉
+	const onOpen = (record) => {
+		recordData.value = record
+		searchFormState.value = {
+			loadPointId: record.id
 		}
+		visible.value = true
 	}
+	// 加载字段数据
 	const loadData = (parameter) => {
-		const searchFormParam = cloneDeep(searchFormState.value)
-		return bizLoadUserApi.bizLoadUserPage(Object.assign(parameter, searchFormParam)).then((data) => {
-			return data
+		return bizLoadUserApi.bizLoadUserPage(Object.assign(parameter, searchFormState.value)).then((res) => {
+			return res
 		})
 	}
-	// 重置
-	const reset = () => {
-		searchFormRef.value.resetFields()
-		tableRef.value.refresh(true)
-	}
-	// 删除
-	const deleteConfig = (record) => {
-		Modal.confirm({
-			title: '确定删除该数据吗?',
-			icon: createVNode(ExclamationCircleOutlined),
-			content: '',
-			onOk() {
-				submitLoading.value = true
-				let params = [
-					{
-						id: record.id
-					}
-				]
-
-				customerApi
-					.customerDelete(params)
-					.then(() => {
-						tableRef.value.refresh(true)
-					})
-					.finally(() => {
-						submitLoading.value = false
-					})
-			},
-			onCancel() {}
-		})
+	// 关闭抽屉
+	const onClose = () => {
+		visible.value = false
 	}
+	// 调用这个函数将子组件的一些数据和方法暴露出去
+	defineExpose({
+		onOpen
+	})
 </script>

+ 1 - 1
snowy-admin-web/src/views/biz/bizloadtime/index.vue

@@ -64,7 +64,7 @@
 
 <script setup name="bizloadtime">
 	import { cloneDeep } from 'lodash-es'
-	import Form from './loadtimeform.vue'
+	import Form from './form.vue'
 	import bizLoadTimeApi from '@/api/biz/bizLoadTimeApi'
 
 	const searchFormState = ref({})

+ 1 - 1
snowy-admin-web/src/views/biz/bizloaduser/index.vue

@@ -41,7 +41,7 @@
 
 <script setup name="bizloaduser">
 	import { cloneDeep } from 'lodash-es'
-	import Form from './loadUserForm.vue'
+	import Form from './form.vue'
 	import bizLoadUserApi from '@/api/biz/bizLoadUserApi'
 
 	const searchFormState = ref({})