This commit is contained in:
zjf committed 2025-04-08 16:37:44 +08:00
commit c915904223
24 files changed
+339 -55

No files matched your search

+4 -4
View File
@@ -115,10 +115,10 @@ export function validateUsername(rule: any, value: any, callback: any, isEdit: b
if (isEdit) {
return callback()
}
const flag = new RegExp(/^([a-z\d]+?)$/).test(value)
if (!flag) {
callback(new Error("用户名支持小写英文、数字"))
}
// const flag = new RegExp(/^([a-z\d]+?)$/).test(value)
// if (!flag) {
// callback(new Error("用户名支持小写英文、数字"))
// }
getDetails({ username: value }).then((response) => {
const result = response.data
if (result !== null) {
+9
View File
@@ -107,6 +107,15 @@ export function completeTask(param: Object) {
})
}
// 批量完成任务
export function batchCompleteTask(param: Object) {
return request({
url: "/task/task/batchCompleteTask",
method: "post",
data: param,
})
}
// 完成任务
export function transferTask(param: Object) {
return request({
+2 -2
View File
@@ -1,8 +1,8 @@
import request from "/@/utils/request"
export function select(query?: Object) {
export function pageJoin(query?: Object) {
return request({
url: "/hard/hard-spu-repertory/select",
url: "/hard/hard-spu-repertory/page-join",
method: "get",
params: query,
})
+1 -1
View File
@@ -40,7 +40,7 @@ export function putObj(obj?: Object) {
}
// 获取货商下拉列表
export function getSupplierSimpleAll(params: any): any {
export function getSupplierSimpleAll(params?: any): any {
return request({
url: "/supermarket/smErpSupplier/selectSimpleAll",
method: "get",
@@ -1,5 +1,7 @@
<template>
<span v-if="isDisplayName">{{ state.options.find((item: any) => item.id == selectId)?.nameWithMobile }}</span>
<el-select
v-else
style="width: 100%"
v-model="state.selectId"
:placeholder="props.placeholder"
@@ -32,9 +34,11 @@ const selectId = defineModel()
export type Props = {
placeholder?: string
isDisplayName?: boolean
}
const props = withDefaults(defineProps<Props>(), {
placeholder: "请选择",
isDisplayName: false,
})
const queryForm = reactive<any>({})
+4
View File
@@ -1,5 +1,7 @@
<template>
<span v-if="isDisplayName">{{ state.options.find((item: any) => item.supplierId == selectId)?.supplierName }}</span>
<el-select
v-else
style="width: 100%"
v-model="state.selectId"
:placeholder="props.placeholder"
@@ -32,9 +34,11 @@ const selectId = defineModel()
export type Props = {
placeholder?: string
isDisplayName?: boolean
}
const props = withDefaults(defineProps<Props>(), {
placeholder: "请选择",
isDisplayName: false,
})
const queryForm = reactive<any>({})
+1
View File
@@ -12,6 +12,7 @@ export interface TaskData {
taskId: string
processInstanceId: string
flowId: string
nodeId?: string
}
export interface TaskSubmitParam {
+1
View File
@@ -36,6 +36,7 @@ export function useSmProcessTableAction(
processFormState.showForm = false
processFormState.formId = undefined
processFormState.formDisabled = true
fetchList()
}
// 点击开始处理
const deal = (row: tableRow) => {
+70
View File
@@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="批量审批" :width="400">
<el-input v-model="submitDesc" type="textarea" maxlength="100" :rows="5" placeholder="请输入审核意见..." show-word-limit />
<template #footer>
<el-button size="large" type="danger" icon="Close" @click="submit(0)">拒绝</el-button>
<el-button size="large" type="primary" icon="Check" @click="submit(1)">提交</el-button>
<el-button size="large" @click="visible = false">取消</el-button>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from "vue"
import { ElLoading } from "element-plus"
import { useMessage } from "/@/hooks/message"
import { batchCompleteTask } from "/@/api/flow/task"
const emit = defineEmits<{
(e: "taskSubmitEvent"): void
}>()
const visible = ref(false)
const submitDesc = ref("")
const processIds = ref<string[]>([])
const loading = ref<any>()
const openDialog = (ids: string[]) => {
submitDesc.value = ""
visible.value = true
processIds.value = ids
}
// 全屏loading
const loadingStart = () => {
loading.value = ElLoading.service({
lock: true,
text: "提交中...",
background: "rgba(0, 0, 0, 0.7)",
})
}
const submit = async (isSuccess: number) => {
const param = {
isSuccess,
processInstances: processIds.value,
taskLocalParamMap: {
approveDesc: submitDesc.value,
},
}
console.log(param)
try {
loadingStart()
const res = await batchCompleteTask(param).finally(() => loading.value.close())
if (res.code == 0) {
visible.value = false
emit("taskSubmitEvent")
useMessage().success("通过成功")
return
}
useMessage().error("通过失败")
} catch (error) {
useMessage().error("错误")
} finally {
loading.value.close()
}
}
defineExpose({ openDialog })
</script>
+7 -7
View File
@@ -10,7 +10,7 @@
<el-row :gutter="20">
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysuser.username')" prop="username">
<el-input :disabled="dataForm.userId !== ''" placeholder="请输入用户名" v-model.trim="dataForm.username"></el-input>
<el-input :disabled="dataForm.userId !== ''" placeholder="请输入用户名" v-model.trim="dataForm.username" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
@@ -157,12 +157,12 @@ const dataRules = ref({
{ required: true, message: "用户名不能为空", trigger: "blur" },
{ min: 5, max: 60, message: "用户名称长度必须介于5-20个字符之间", trigger: "blur" },
{ pattern: /^[^\u4e00-\u9fa5]+$/, message: "用户名称不能包含中文", trigger: "blur" },
// {
// validator: (rule: any, value: any, callback: any) => {
// validateUsername(rule, value, callback, dataForm.userId !== "")
// },
// trigger: "blur",
// },
{
validator: (rule: any, value: any, callback: any) => {
validateUsername(rule, value, callback, dataForm.userId !== "")
},
trigger: "blur",
},
],
password: [
{ required: true, message: "密码不能为空", trigger: "blur" },
+9 -12
View File
@@ -198,6 +198,9 @@
<!-- 审批抽屉 -->
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
<!-- 批量审批对话框 -->
<batch-deal ref="batchDealRef" @task-submit-event="taskSubmitEvent" />
</div>
</template>
@@ -214,6 +217,7 @@ import ProcessDrawer from "/@/components/processDrawer/index.vue"
const UserForm = defineAsyncComponent(() => import("./form.vue"))
const FaceManage = defineAsyncComponent(() => import("./face-manage.vue"))
const PopoverInput = defineAsyncComponent(() => import("/@/components/PopoverInput/index.vue"))
const BatchDeal = defineAsyncComponent(() => import("./batchDeal.vue"))
const { t } = useI18n()
@@ -227,6 +231,7 @@ const draggableDepTreeRef = ref() // 树组件ref引用
const activeName = ref("2")
const tabItems = ref<any>([{}])
const processDrawerRef = ref()
const batchDealRef = ref()
// 多选rows
const selectObjs = ref([]) as any
@@ -284,16 +289,8 @@ const deal = (row: any) => {
// 批量开始处理
const doBatchDeal = () => {
if (!selectObjs.value.length) return useMessage().warning("流程id不存在")
const processIds = []
for (const i of selectObjs.value) {
for (const j of state.dataList!) {
if (i == j.id) {
processIds.push(j.processId)
break
}
}
}
if (!processIds.length) return useMessage().warning("流程id不存在")
const processIds = selectObjs.value.filter((item: any) => item.processId).map((item: any) => item.processId)
batchDealRef.value.openDialog(processIds)
}
// 审批提交事件
@@ -312,8 +309,8 @@ const handleSelectable = (row: any) => {
}
// 多选事件
const handleSelectionChange = (objs: { userId: string }[]) => {
selectObjs.value = objs.map(({ userId }) => userId)
const handleSelectionChange = (objs: { userId: string; processId: string | null }[]) => {
selectObjs.value = objs.map(({ userId, processId }) => ({ userId, processId }))
multiple.value = !objs.length
}
+1 -1
View File
@@ -226,7 +226,7 @@ const getDishByType = async () => {
// foodData.breakfast = r.dailyMenuVOS
break
case 2:
foodData.lunch = r.dailyMenuVOS.filter((v: any, index: number) => index < 15)
foodData.lunch = r.dailyMenuVOS.filter((v: any, index: number) => index < 11)
break
case 3:
// foodData.dinner = r.dailyMenuVOS
+4 -1
View File
@@ -10,7 +10,7 @@
<dict-select v-model="state.queryForm.merchantType" dict-code="merchant_type" />
</el-form-item>
<el-form-item style="width: 300px" label="商户" prop="mchIds">
<select-mch v-model="state.queryForm.mchIds" />
<select-mch v-model="state.queryForm.mchIds" :apiParams="{ parentIsNull: false }" />
</el-form-item>
<el-form-item style="width: 300px" label="设备类型" prop="hardTypeCode">
<dict-select v-model="state.queryForm.hardTypeCode" dict-code="hard_type" />
@@ -21,6 +21,9 @@
<el-form-item style="width: 300px" label="用餐时间段" prop="hourType">
<dict-select v-model="state.queryForm.hourType" dict-code="daily_menu" />
</el-form-item>
<el-form-item style="width: 300px" label="订单状态" prop="orderStatus">
<dict-select v-model="state.queryForm.orderStatus" dict-code="hard_order_status" />
</el-form-item>
<el-form-item style="width: 450px" label="创建时间" prop="payTimeList">
<el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
</el-form-item>
+1 -1
View File
@@ -21,7 +21,7 @@
<dict-select v-model="state.queryForm.merchantType" dict-code="merchant_type" />
</el-form-item>
<el-form-item style="width: 250px" label="商户" prop="merchantId">
<select-mch v-model="state.queryForm.merchantId" />
<select-mch v-model="state.queryForm.merchantId" :apiParams="{ parentIsNull: false }" />
</el-form-item>
<el-form-item style="width: 450px" label="创建时间" prop="payTimeList">
<el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
+1 -1
View File
@@ -41,7 +41,7 @@ const form = reactive({
userId: "",
hardId: "",
spuId: "",
count: "",
count: 5,
})
// 定义校验规则
+111 -9
View File
@@ -36,11 +36,59 @@
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="userId" label="用户id" show-overflow-tooltip />
<el-table-column prop="hardId" label="设备id" show-overflow-tooltip />
<el-table-column prop="spuId" label="商品id" show-overflow-tooltip />
<el-table-column prop="count" label="更新库存数量" show-overflow-tooltip />
<el-table-column type="index" label="#" width="80" />
<el-table-column prop="userId" label="上架">
<el-table-column min-width="120" label="上架人">
<template #default="{ row }">
<span> {{ row.username }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" min-width="120" label="上架时间" />
<el-table-column label="上架类型">
<template #default="{ row }">
<dict-tag :options="hard_spu_repertory_type" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="beforeCount" min-width="120" label="上架前数量" />
<el-table-column prop="count" min-width="120" label="上架数量" />
</el-table-column>
<el-table-column label="商品">
<el-table-column min-width="120" label="商品">
<template #default="{ row }">
<span class="color-primary">
{{ row.spuName }}
</span>
</template>
</el-table-column>
<el-table-column min-width="120" label="分类">
<template #default="{ row }">
<span class="color-success">
{{ row.spuCategoryName }}
</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="hardId" label="设备">
<el-table-column min-width="120" label="所属商家">
<template #default="{ row }">
<span class="color-primary">
{{ row.merchantName }}
</span>
</template>
</el-table-column>
<el-table-column min-width="120" label="设备名称">
<template #default="{ row }">
<span class="color-primary">
{{ row.hardName }}
</span>
</template>
</el-table-column>
<el-table-column min-width="120" label="放置层数">
<template #default="{ row }">
<span class="color-primary"> {{ row.hardDoorNumber }}层 </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button
@@ -67,14 +115,14 @@
<script setup lang="ts" name="systemHardSpuRepertory">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/hard/hard-spu-repertory"
import * as hardSpuRepertory from "/@/api/hard/hard-spu-repertory"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
const { hard_spu_repertory_type } = useDict("hard_spu_repertory_type")
// 定义变量内容
const formDialogRef = ref()
// 搜索变量
@@ -86,7 +134,7 @@ const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
pageList: hardSpuRepertory.pageJoin,
})
// table hook
@@ -121,7 +169,7 @@ const handleDelete = async (ids: string[]) => {
}
try {
await delObjs(ids)
await hardSpuRepertory.delObjs(ids)
getDataList()
useMessage().success("删除成功")
} catch (err: any) {
@@ -129,3 +177,57 @@ const handleDelete = async (ids: string[]) => {
}
}
</script>
<style scoped lang="scss">
.text-line {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.desc {
display: flex;
align-items: center;
margin-bottom: 2px;
span {
display: inline-block;
}
span:nth-child(1) {
min-width: 60px;
max-width: 100px;
text-align: left;
}
span:nth-child(2) {
flex: 1;
min-width: 50px;
}
}
.status {
display: flex;
align-items: center;
margin-bottom: 2px;
span {
display: inline-block;
}
span:nth-child(1) {
min-width: 60px;
max-width: 100px;
text-align: left;
}
span:nth-child(2) {
flex: 1;
min-width: 50px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>
+2 -2
View File
@@ -10,7 +10,7 @@
<el-col :span="24" class="mb20">
<el-form-item prop="hardDoorNumber">
<template #label>
<span>商品层数</span>
<span>放置层数</span>
<tip content="商品在智能柜的层数,按层数放置会提高识别率" />
</template>
<el-input-number :min="0" :step="1" v-model="form.hardDoorNumber" placeholder="" />
@@ -101,7 +101,7 @@ const form = reactive({
salesCount: 0,
repertoryCount: 0,
sort: 0,
hardDoorNumber: "",
hardDoorNumber: 1,
status: "1",
isDefault: "0",
})
+5
View File
@@ -42,6 +42,11 @@
<span>{{ row.merchantName }}</span>
</template>
</el-table-column>
<el-table-column width="150" label="放置层数">
<template #default="{ row }">
<span>{{ row.hardDoorNumber }}层</span>
</template>
</el-table-column>
<el-table-column width="150" label="设备名">
<template #default="{ row }">
<span>{{ row.hardName }}</span>
@@ -51,9 +51,21 @@
<vxe-column type="checkbox" width="60" align="center"></vxe-column>
<vxe-column field="unit" title="包装单位" align="center" width="200"></vxe-column>
<vxe-column field="quantity" title="数量" align="center" width="100"></vxe-column>
<vxe-column field="purchasePrice" title="进价" align="center" width="100"></vxe-column>
<vxe-column field="unitPrice" title="单价" align="center" width="100"></vxe-column>
<vxe-column field="totalAmount" title="累计总金额" align="center" width="100"></vxe-column>
<vxe-column field="purchasePrice" title="进价" align="center" width="100">
<template #default="{ row }">
{{ displayPrice(row.purchasePrice) }}
</template>
</vxe-column>
<vxe-column field="unitPrice" title="单价" align="center" width="100">
<template #default="{ row }">
{{ displayPrice(row.unitPrice) }}
</template>
</vxe-column>
<vxe-column field="totalAmount" title="累计总金额" align="center" width="100">
<template #default="{ row }">
{{ displayPrice(row.totalAmount) }}
</template>
</vxe-column>
<vxe-column field="remark" title="备注" show-overflow align="center" min-width="100"></vxe-column>
</vxe-table>
@@ -71,6 +83,7 @@ import { ref } from "vue"
import { VxeTableEvents } from "vxe-table"
import { getSimpleUserAll } from "/@/api/admin/user"
import { useDict } from "/@/hooks/dict"
import { displayPrice } from "/@/utils/formatMoney"
const { check_status } = useDict("check_status")
const linkCodeDialogVisible = defineModel()
@@ -75,12 +75,20 @@
<dict-tag :options="check_status" :value="row.checkStatus" />
</template>
</el-table-column>
<el-table-column prop="supplierId" label="货商" show-overflow-tooltip />
<el-table-column prop="supplierName" label="货商" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<!-- <el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />-->
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button
v-else
icon="edit-pen"
@@ -100,7 +108,14 @@
>
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
@@ -50,14 +50,29 @@
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button v-else icon="edit-pen" text type="primary" v-auth="'supermarket_smErpCgDd_edit'" @click="edit(scope.row)">
编辑
</el-button>
<el-button icon="delete" text type="primary" v-auth="'supermarket_smErpCgDd_del'" @click="handleDelete([scope.row.id])">
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus != '2' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
@@ -80,7 +80,15 @@
<el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button
v-else
icon="edit-pen"
@@ -100,7 +108,14 @@
>
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
@@ -80,7 +80,15 @@
<el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button
v-else
icon="edit-pen"
@@ -100,7 +108,14 @@
>
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
+17 -2
View File
@@ -68,10 +68,25 @@
<!-- <el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip /> -->
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button v-else icon="edit-pen" text type="primary" @click="edit(scope.row)">编辑</el-button>
<el-button icon="delete" text type="primary" @click="handleDelete([scope.row.id])">删除</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>