Ver código fonte

服务客户账户流水

shasha 1 mês atrás
pai
commit
6be20a4062

+ 1 - 1
snowy-admin-web/src/views/biz/bizservicecustomer/accountIndex.vue

@@ -37,7 +37,7 @@
 	</a-drawer>
 
 	<Form ref="formRef" @successful="tableRef.refresh()" />
-	<FlowIndex ref="flowIndexRef" @onclose="tableRef.refresh()" />
+	<FlowIndex ref="flowIndexRef" @successful="tableRef.refresh()" />
 </template>
 
 <script setup name="bizservicecustomeraccount">

+ 80 - 0
snowy-admin-web/src/views/biz/bizservicecustomer/flowCancelForm.vue

@@ -0,0 +1,80 @@
+<template>
+	<xn-form-container
+		title="服务客户账户取消说明"
+		:width="700"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+			<a-form-item label="取消说明:" name="operateExplain">
+				<a-input v-model:value="formData.operateExplain" placeholder="请输入取消说明" allow-clear />
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="bizServiceCustomerFlowForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import bizServiceCustomerFlowApi from '@/api/biz/bizServiceCustomerFlowApi'
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	//设置表单样式
+	const labelCol = ref({ span: 4})
+	const wrapperCol = ref({ span: 16})
+
+	// 打开抽屉
+	const onOpen = (record, servicecustomerId, scAccountId) => {
+		open.value = true
+		formData.value.servicecustomerId = servicecustomerId
+		formData.value.scAccountId = scAccountId
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+		operateExplain: [required("请输入取消说明")]
+	}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				bizServiceCustomerFlowApi
+					.bizServiceCustomerFlowCancelForm(formDataParam)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 81 - 0
snowy-admin-web/src/views/biz/bizservicecustomer/flowConsumeForm.vue

@@ -0,0 +1,81 @@
+<template>
+	<xn-form-container
+		title="服务客户账户扣费"
+		:width="700"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+			<a-form-item label="消费金额:" name="operateAmount">
+				<a-input v-model:value="formData.operateAmount" placeholder="请输入消费金额" allow-clear />
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="bizServiceCustomerFlowForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import bizServiceCustomerFlowApi from '@/api/biz/bizServiceCustomerFlowApi'
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	//设置表单样式
+	const labelCol = ref({ span: 4})
+	const wrapperCol = ref({ span: 16})
+
+	// 打开抽屉
+	const onOpen = (record, servicecustomerId, scAccountId) => {
+		open.value = true
+		formData.value.servicecustomerId = servicecustomerId
+		formData.value.scAccountId = scAccountId
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+		operateAmount: [required("请输入消费金额")]
+	}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				formDataParam.operateType = "2" // 消费
+				bizServiceCustomerFlowApi
+					.bizServiceCustomerFlowSubmitForm(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 18 - 35
snowy-admin-web/src/views/biz/bizservicecustomer/flowIndex.vue

@@ -24,9 +24,15 @@
 					<template v-if="column.dataIndex === 'serial'">
 						{{ index + 1 }}
 					</template>
+					<template v-if="column.dataIndex === 'operateType'">
+						{{ $TOOL.dictTypeData('operate_type', record.operateType) }}
+					</template>
+					<template v-if="column.dataIndex === 'dataStatus'">
+						{{ $TOOL.dictTypeData('data_status', record.dataStatus) }}
+					</template>
 					<template v-if="column.dataIndex === 'action'">
 						<a-space>
-							<a @click="cancelRef.onOpen(record, serviceCustomerId, scAccountId)" v-if="hasPerm('bizServiceCustomerFlowCancel')">取消</a>
+							<a @click="cancelRef.onOpen(record, serviceCustomerId, scAccountId)" v-if="hasPerm('bizServiceCustomerFlowCancel') && record.dataStatus == '0'">取消</a>
 						</a-space>
 					</template>
 				</template>
@@ -45,14 +51,10 @@
 	import ConsumeForm from './flowConsumeForm.vue'
 	import CancelForm from './flowCancelForm.vue'	
 	import bizServiceCustomerFlowApi from '@/api/biz/bizServiceCustomerFlowApi'
-	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
-	import {Modal} from 'ant-design-vue';
-	import {createVNode} from 'vue';
 	
-	const submitLoading = ref(false)
-	const toolConfig = { refresh: true, height: false, columnSetting: false, striped: false }
 	// 默认是关闭状态
 	const visible = ref(false)
+	const emit = defineEmits({ successful: null })
 	const searchFormState = ref({})
 	const tableRef = ref()
 	const rechargeFormRef = ref()
@@ -78,19 +80,19 @@
 		},
 		{
 			title: '操作前余额',
-			width: 150,
+			width: 130,
 			dataIndex: 'operateAmountBegin',
 			align:'center'
 		},
 		{
 			title: '操作金额',
-			width: 150,
+			width: 130,
 			dataIndex: 'operateAmount',
 			align:'center'
 		},
 		{
 			title: '操作后余额',
-			width: 150,
+			width: 130,
 			dataIndex: 'operateAmountAfter',
 			align:'center'
 		},
@@ -100,6 +102,12 @@
 			dataIndex: 'createTime',
 			align: 'center'
 		},
+		{
+			title: '状态',
+			width: 80,
+			dataIndex: 'dataStatus',
+			align: 'center'
+		},
 	]
 	// 操作栏通过权限判断是否显示
 	if (hasPerm(['bizServiceCustomerFlowCancel'])) {
@@ -130,32 +138,7 @@
 	// 关闭抽屉
 	const onClose = () => {
 		visible.value = false
-	}
-	// 删除
-	const deleteConfig = (record) => {
-		Modal.confirm({
-			title: '确定删除该数据吗?',
-			icon: createVNode(ExclamationCircleOutlined),
-			content: '',
-			onOk() {
-				submitLoading.value = true
-				let params = [
-					{
-						id: record.id
-					}
-				]
-
-				bizServiceCustomerFlowApi
-					.bizServiceCustomerFlowDelete(params)
-					.then(() => {
-						tableRef.value.refresh(true)
-					})
-					.finally(() => {
-						submitLoading.value = false
-					})
-			},
-			onCancel() {}
-		})
+		emit('successful')
 	}
 	// 调用这个函数将子组件的一些数据和方法暴露出去
 	defineExpose({

+ 81 - 0
snowy-admin-web/src/views/biz/bizservicecustomer/flowRechargeForm.vue

@@ -0,0 +1,81 @@
+<template>
+	<xn-form-container
+		title="服务客户账户充值"
+		:width="700"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+			<a-form-item label="充值金额:" name="operateAmount">
+				<a-input v-model:value="formData.operateAmount" placeholder="请输入充值金额" allow-clear />
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="bizServiceCustomerFlowForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import bizServiceCustomerFlowApi from '@/api/biz/bizServiceCustomerFlowApi'
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	//设置表单样式
+	const labelCol = ref({ span: 4})
+	const wrapperCol = ref({ span: 16})
+
+	// 打开抽屉
+	const onOpen = (record, serviceCustomerId, scAccountId) => {
+		open.value = true
+		formData.value.serviceCustomerId = serviceCustomerId
+		formData.value.scAccountId = scAccountId
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+		operateAmount: [required("请输入充值金额")]
+	}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				formDataParam.operateType = "1" // 充值
+				bizServiceCustomerFlowApi
+					.bizServiceCustomerFlowSubmitForm(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 38 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizservicecustomer/param/BizServiceCustomerAccountLockParam.java

@@ -0,0 +1,38 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.bizservicecustomer.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * 服务客户资金流水添加参数
+ *
+ * @author fanzherong
+ * @date  2025/05/29 14:40
+ **/
+@Getter
+@Setter
+public class BizServiceCustomerAccountLockParam {
+
+    /** 服务客户账户id */
+    @Schema(description = "服务客户账户id")
+    private String id;
+
+    /** 锁定金额 */
+    @Schema(description = "锁定金额")
+    private BigDecimal lockAmount;
+}