Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-02-25 18:35:27 +08:00
commit 7a525815e2
17 files changed
+220 -161

No files matched your search

+3 -1
View File
@@ -4,7 +4,9 @@ import request from "/@/utils/request"
// type:2 获取采购订单编号
// type:3 获取采购入库编号
// type:4 获取采购退货编号
export function getPlanCode(params: { type: 1 | 2 | 3 | 4 }) {
// type:5 获取零售出库编号
// type:4 获取零售退货编号
export function getPlanCode(params: { type: 1 | 2 | 3 | 4 | 5 | 6 }) {
return request({
url: "/supermarket/sm/common/getSequence",
method: "get",
@@ -1,4 +1,5 @@
import request from "/@/utils/request"
export function fetchList(query?: Object) {
return request({
url: "/supermarket/smErpInventoryRecords/page",
File renamed without changes.
+123
View File
@@ -0,0 +1,123 @@
<template>
<!--右侧抽屉-->
<el-drawer v-model="taskDrawerVisible" direction="rtl" size="400px">
<template #header>
<h3>{{ currentData?.processName }}</h3>
</template>
<template #default>
<el-card class="box-card">
<form-render
@addLayoutOneItem="addLayoutOneItem"
@deleteLayoutOneItem="deleteLayoutOneItem"
ref="formRenderRef"
:form-list="currentOpenFlowForm"
/>
</el-card>
<flow-node-format
:disableSelect="true"
:formData="formValue"
:task-id="currentData.taskId"
:processInstanceId="currentData.processInstanceId"
:flow-id="currentData.flowId"
ref="flowNodeFormatRef"
class="mt-4"
/>
</template>
<template #footer>
<div style="flex: auto">
<el-button size="large" type="danger" icon="Close" @click="refuseTask">拒绝</el-button>
<el-button size="large" type="primary" icon="Check" @click="submitTask">提交</el-button>
<el-button size="large" type="info" icon="Share" @click="transferTask">转办</el-button>
</div>
</template>
</el-drawer>
<!--同意提交处理-->
<agree-handle @taskSubmitEvent="taskSubmitEvent" ref="agreeHandler"></agree-handle>
<!--拒绝审核处理-->
<refuse-handle @taskSubmitEvent="taskSubmitEvent" ref="refuseHandler"></refuse-handle>
<!--转办处理-->
<transfer-handle @taskSubmitEvent="taskSubmitEvent" ref="transferHandler"></transfer-handle>
</template>
<script setup lang="ts">
import FormRender from "/@/views/flow/form/render/FormRender.vue"
import FlowNodeFormat from "/@/views/flow/form/tools/FlowNodeFormatData.vue"
import AgreeHandle from "./agree.vue"
import RefuseHandle from "./refuse.vue"
import TransferHandle from "./transfer.vue"
import other from "/@/utils/other"
import { FlowFormItem, TaskData } from "./types"
const taskDrawerVisible = defineModel<boolean>()
const props = withDefaults(
defineProps<{
currentData: TaskData
currentOpenFlowForm: FlowFormItem[]
}>(),
{
currentData: (): TaskData => ({
processName: "",
taskId: "",
processInstanceId: "",
flowId: "",
}),
currentOpenFlowForm: () => [],
},
)
const emit = defineEmits(["taskSubmitEvent"])
const agreeHandler = ref()
const refuseHandler = ref()
const transferHandler = ref()
const addLayoutOneItem = (id: number | string) => {
for (const item of props.currentOpenFlowForm) {
if (item.id !== id) {
continue
}
let value = item.props.value
let oriForm = item.props.oriForm
value.push(other.deepClone(oriForm))
item.props.value = value
}
}
const deleteLayoutOneItem = (id: any, index: any) => {
for (const item of props.currentOpenFlowForm) {
if (item.id !== id) {
continue
}
item.props.value.splice(index, 1)
}
}
// 提交任务
const submitTask = () => {
agreeHandler.value.handle(props.currentData, props.currentOpenFlowForm)
}
// 拒绝任务
const refuseTask = () => {
refuseHandler.value.handle(props.currentData, props.currentOpenFlowForm)
}
// 转办任务
const transferTask = () => {
transferHandler.value.handle(props.currentData, props.currentOpenFlowForm)
}
// 流程提交
const taskSubmitEvent = () => emit("taskSubmitEvent")
const formValue = computed(() => {
const obj: any = {}
for (var item of props.currentOpenFlowForm) {
obj[item.id] = item.props.value
}
return obj
})
</script>
File renamed without changes.
+24
View File
@@ -0,0 +1,24 @@
// First let's create types for our form data
export interface FlowFormItem {
id: string
type: string
props: {
value: any
[key: string]: any
}
}
export interface TaskData {
processName: string
taskId: string
processInstanceId: string
flowId: string
}
export interface TaskSubmitParam {
paramMap: Record<string, any>
taskId: string
taskLocalParamMap: {
approveDesc: string
}
}
-22
View File
@@ -1,22 +0,0 @@
// First let's create types for our form data
export interface FlowFormItem {
id: string
type: string
props: {
value: any
[key: string]: any
}
}
export interface TaskData {
taskId: string
nodeId: string
}
export interface TaskSubmitParam {
paramMap: Record<string, any>
taskId: string
taskLocalParamMap: {
approveDesc: string
}
}
+16 -97
View File
@@ -52,73 +52,35 @@
<el-table-column label="任务时间" prop="taskCreateTime" />
<el-table-column fixed="right" label="操作" width="200">
<template #default="scope">
<el-button type="primary" size="small" link icon="VideoPlay" @click="deal(scope.row)"> 开始处理 </el-button>
<el-button type="primary" size="small" link icon="VideoPlay" @click="deal(scope.row)">开始处理</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination"></pagination>
<!--右侧抽屉-->
<el-drawer v-model="rightDrawerVisible" direction="rtl" size="400px">
<template #header>
<h3>{{ currentData?.processName }}</h3>
</template>
<template #default>
<el-card class="box-card">
<form-render
@addLayoutOneItem="addLayoutOneItem"
@deleteLayoutOneItem="deleteLayoutOneItem"
ref="formRenderRef"
:form-list="currentOpenFlowForm"
></form-render>
</el-card>
<flow-node-format
:disableSelect="true"
:formData="formValue"
:task-id="currentData.taskId"
:processInstanceId="currentData.processInstanceId"
:flow-id="currentData.flowId"
ref="flowNodeFormatRef"
class="mt-4"
/>
</template>
<template #footer>
<div style="flex: auto">
<el-button size="large" type="danger" icon="Close" @click="refuseTask">拒绝</el-button>
<el-button size="large" type="primary" icon="Check" @click="submitTask">提交</el-button>
<el-button size="large" type="info" icon="Share" @click="transferTask">转办</el-button>
</div>
</template>
</el-drawer>
<!--同意提交处理-->
<agree-handle @taskSubmitEvent="taskSubmitEvent" ref="agreeHandler"></agree-handle>
<!--拒绝审核处理-->
<refuse-handle @taskSubmitEvent="taskSubmitEvent" ref="refuseHandler"></refuse-handle>
<!--转办处理-->
<transfer-handle @taskSubmitEvent="taskSubmitEvent" ref="transferHandler"></transfer-handle>
<!-- 右侧抽屉 -->
<taskDrawer
v-model="taskDrawerVisible"
:current-data="currentData"
:current-open-flow-form="currentOpenFlowForm"
@task-submit-event="taskSubmitEvent"
/>
</div>
</div>
</template>
<script setup lang="ts">
import FormRender from "/@/views/flow/form/render/FormRender.vue"
import AgreeHandle from "./handler/agree.vue"
import RefuseHandle from "./handler/refuse.vue"
import TransferHandle from "./handler/transfer.vue"
import FlowNodeFormat from "/@/views/flow/form/tools/FlowNodeFormatData.vue"
import other from "/@/utils/other"
import { queryMineTask, queryTask } from "/@/api/flow/task"
import { BasicTableProps, useTable } from "/@/hooks/table"
import taskDrawer from "/@/components/taskDrawer/index.vue"
const rightDrawerVisible = ref(false)
const taskDrawerVisible = ref(false)
const showSearch = ref(true)
const loading = ref(false)
const queryRef = ref()
const currentData = ref()
const currentOpenFlowForm = ref()
const state: BasicTableProps = reactive<BasicTableProps>({
pageList: queryMineTask,
queryForm: {
@@ -137,33 +99,9 @@ const deal = (row: any) => {
currentData.value = row
queryTask(row.taskId, false).then((res) => {
currentOpenFlowForm.value = res.data.formItems
rightDrawerVisible.value = true
taskDrawerVisible.value = true
})
}
const currentOpenFlowForm = ref()
const addLayoutOneItem = (id: Number) => {
for (const item of currentOpenFlowForm.value) {
if (item.id !== id) {
continue
}
let value = item.props.value
let oriForm = item.props.oriForm
value.push(other.deepClone(oriForm))
item.props.value = value
}
}
const deleteLayoutOneItem = (id, index) => {
for (const item of currentOpenFlowForm.value) {
if (item.id !== id) {
continue
}
item.props.value.splice(index, 1)
}
}
const agreeHandler = ref()
const refuseHandler = ref()
const transferHandler = ref()
// 清空搜索条件
const resetQuery = () => {
@@ -171,37 +109,18 @@ const resetQuery = () => {
getDataList()
}
// 任务提交事件
const taskSubmitEvent = () => {
rightDrawerVisible.value = false
taskDrawerVisible.value = false
getDataList()
}
/**
* 提交任务
*/
const submitTask = () => {
agreeHandler.value.handle(currentData.value, currentOpenFlowForm.value)
}
/**
* 拒绝任务
*/
const refuseTask = () => {
refuseHandler.value.handle(currentData.value, currentOpenFlowForm.value)
}
/**
* 转办任务
*/
const transferTask = () => {
transferHandler.value.handle(currentData.value, currentOpenFlowForm.value)
}
onMounted(() => {
getDataList()
})
const formValue = computed(() => {
const obj = {}
const obj: any = {}
for (var item of currentOpenFlowForm.value) {
obj[item.id] = item.props.value
+8 -31
View File
@@ -16,7 +16,7 @@
<el-col :span="24" class="mb20">
<el-form-item label="商品轮播图" prop="sliderPicUrls">
<upload-img v-model:imageUrl="form.sliderPicUrls"></upload-img>
<upload-imgs v-model:imageUrls="form.sliderPicUrls"></upload-imgs>
</el-form-item>
</el-col>
@@ -29,21 +29,14 @@
<el-col :span="24" class="mb20">
<el-form-item label="商品状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio :label="item.value" v-for="(item, index) in spu_status" border :key="index"
>{{ item.label }}
</el-radio>
<el-radio :label="item.value" v-for="(item, index) in spu_status" border :key="index">{{ item.label }} </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="赠送积分" prop="giveIntegral">
<el-input-number
:min="0"
:max="1000"
v-model="form.giveIntegral"
placeholder="请输入赠送积分"
></el-input-number>
<el-input-number :min="0" :max="1000" v-model="form.giveIntegral" placeholder="请输入赠送积分"></el-input-number>
</el-form-item>
</el-col>
</el-row>
@@ -62,14 +55,7 @@
</el-dialog>
<!-- 库存商品选择对话框 -->
<el-dialog
v-model="spuSelectDialogVisible"
title="选择商品"
width="60%"
:close-on-click-modal="false"
draggable
@close=""
>
<el-dialog v-model="spuSelectDialogVisible" title="选择商品" width="60%" :close-on-click-modal="false" draggable @close="">
<el-row>
<el-form :inline="true" @keyup.enter="getDataList">
<el-form-item label="商品名称" prop="name">
@@ -82,12 +68,7 @@
</el-form>
</el-row>
<el-table
v-loading="state.loading"
:data="state.dataList"
@row-click="handleRowClick"
:row-style="{ cursor: 'pointer' }"
>
<el-table v-loading="state.loading" :data="state.dataList" @row-click="handleRowClick" :row-style="{ cursor: 'pointer' }">
<el-table-column type="index" label="#" width="50" align="center" />
<el-table-column prop="productName" label="商品名称" width="100px" align="center" show-overflow-tooltip />
<el-table-column prop="brandId" label="商品品牌" width="100px" align="center" show-overflow-tooltip />
@@ -178,11 +159,8 @@ const openDialog = (id: string) => {
visible.value = true
form.id = ""
// 重置表单数据
nextTick(() => {
dataFormRef.value?.resetFields()
form.erpSpuName = ""
})
dataFormRef.value?.resetFields()
form.erpSpuName = ""
// 获取smSpu信息
if (id) {
@@ -228,8 +206,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
pageList: getOnlineSpuPage,
})
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
const resetQuery = () => {
state.queryForm.productName = ""
@@ -427,8 +427,8 @@ const cgPlanSpuItems = computed(() => {
id: item.isNew ? undefined : item.id,
erpSpuId: item.erpSpuId,
quantity: item.quantity,
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
totalAmount: Number(item.unitPrice || 0) * item.quantity,
unitPrice: item.purchasePrice ? Number(item.purchasePrice) : 0,
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
}
@@ -431,8 +431,8 @@ const cgPlanSpuItems = computed(() => {
id: item.isNew ? undefined : item.id,
erpSpuId: item.erpSpuId,
quantity: item.quantity,
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
totalAmount: Number(item.unitPrice || 0) * item.quantity,
unitPrice: item.purchasePrice ? Number(item.purchasePrice) : 0,
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
}
@@ -6,6 +6,7 @@
<el-form-item label="编号" prop="planCode">
<el-input v-model="baseDataForm.planCode" readonly style="width: 200px" />
</el-form-item>
<el-form-item label="单据日期" prop="planDate">
<el-input v-model="baseDataForm.planDate" readonly style="width: 200px" />
</el-form-item>
@@ -431,8 +431,8 @@ const cgPlanSpuItems = computed(() => {
id: item.isNew ? undefined : item.id,
erpSpuId: item.erpSpuId,
quantity: item.quantity,
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
totalAmount: Number(item.unitPrice || 0) * item.quantity,
unitPrice: item.purchasePrice ? Number(item.purchasePrice) : 0,
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
}
@@ -469,8 +469,8 @@ const cgPlanSpuItems = computed(() => {
id: item.isNew ? undefined : item.id,
erpSpuId: item.erpSpuId,
quantity: item.quantity,
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
totalAmount: item.unitPrice ? Number(item.unitPrice) * item.quantity : 0,
unitPrice: item.purchasePrice ? Number(item.purchasePrice) : 0,
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
}
@@ -469,8 +469,8 @@ const cgPlanSpuItems = computed(() => {
id: item.isNew ? undefined : item.id,
erpSpuId: item.erpSpuId,
quantity: item.quantity,
unitPrice: item.unitPrice ? Number(item.unitPrice) : 0,
totalAmount: item.unitPrice ? Number(item.unitPrice) * item.quantity : 0,
unitPrice: item.purchasePrice ? Number(item.purchasePrice) : 0,
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
}
@@ -110,6 +110,9 @@
@click="handleDelete([row.id])"
>删除</el-button
>
<el-button type="primary" size="small" link icon="VideoPlay" @click="deal(row)" v-auth="'wallet_walletRechargeApply_check'">
开始处理
</el-button>
</template>
</el-table-column>
</el-table>
@@ -126,6 +129,14 @@
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx"
@refreshDataList="getDataList(false)"
/>
<!-- 右侧抽屉 -->
<taskDrawer
v-model="taskDrawerVisible"
:current-data="currentData"
:current-open-flow-form="currentOpenFlowForm"
@task-submit-event="taskSubmitEvent"
/>
</div>
</template>
@@ -135,6 +146,8 @@ import * as walletRechargeApplyApi from "/@/api/wallet/wallet-recharge-apply"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { ElLoading } from "element-plus"
import { queryTask } from "/@/api/flow/task"
import taskDrawer from "/@/components/taskDrawer/index.vue"
const { push } = useRouter()
@@ -151,6 +164,9 @@ const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
const taskDrawerVisible = ref<boolean>()
const currentData = ref()
const currentOpenFlowForm = ref()
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
@@ -221,4 +237,22 @@ const handleDelete = async (ids: string[]) => {
useMessage().error(err.msg)
}
}
/**
* 点击开始处理
* @param row
*/
const deal = (row: any) => {
currentData.value = row
queryTask(row.processId, false).then((res) => {
currentOpenFlowForm.value = res.data.formItems
taskDrawerVisible.value = true
})
}
// 任务提交事件
const taskSubmitEvent = () => {
taskDrawerVisible.value = false
getDataList()
}
</script>