超市审批相关编辑方案和按钮权限修改
This commit is contained in:
1 parent
1b0c1d8b0a
commit
217968cd63
16 files changed
+289
-375
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-loading="loading" :element-loading-svg="svg" element-loading-svg-view-box="-10, -10, 50, 50" class="layout-padding">
|
||||
<div v-loading="loading" :element-loading-svg="svg" element-loading-svg-view-box="-10, -10, 50, 50" class="w-full h-full">
|
||||
<div v-if="baseDataForm.inventoryCode" class="layout-padding-auto layout-padding-view" style="overflow: scroll">
|
||||
<el-form v-if="!disabled" ref="baseDataFormRef" :model="baseDataForm" :rules="dataRules" label-width="100px">
|
||||
<div class="flex flex-wrap">
|
||||
@@ -74,7 +74,7 @@
|
||||
ref="editableTableRef"
|
||||
border
|
||||
:loading="loading"
|
||||
max-height="400"
|
||||
max-height="410"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'cell',
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
<el-row class="my-3">
|
||||
<el-tooltip effect="dark" content="返回列表页面" placement="top">
|
||||
<el-button type="primary" plain @click="router.back()">取消</el-button>
|
||||
<el-button type="primary" plain @click="emit('close')">取消</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="!baseDataForm.id" effect="dark" content="保存并清空数据" placement="top">
|
||||
<el-button type="primary" plain @click="onContinueAdd">继续添加</el-button>
|
||||
@@ -223,7 +223,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import { getStockTakingDeatil, stockTakingAdd } from "/@/api/supermarketerp/stockTaking"
|
||||
@@ -232,11 +231,20 @@ import { formatDate } from "/@/utils/formatTime"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import barCodeEnter from "./barCodeEnter.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { usePurchase } from "/@/stores/purchase"
|
||||
import { tablePrint } from "../supermarketUtils"
|
||||
|
||||
const purchaseStore = usePurchase()
|
||||
const router = useRouter()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
formId: string | undefined
|
||||
disabled: boolean
|
||||
}>(),
|
||||
{
|
||||
formId: undefined,
|
||||
disabled: true,
|
||||
},
|
||||
)
|
||||
const emit = defineEmits(["close"])
|
||||
|
||||
const loading = ref(false) // 采购计划加载
|
||||
const disabled = ref(false)
|
||||
const erpSpuSelectDialogRef = ref() // 商品选择对话框ref
|
||||
@@ -298,9 +306,8 @@ const validRules = ref<VxeTablePropTypes.EditRules<any>>({
|
||||
// 初始化数据
|
||||
const getInitData = async () => {
|
||||
baseDataForm.id = undefined
|
||||
// const id = route.query.id as string
|
||||
const id = purchaseStore.purchaseFormState.id
|
||||
disabled.value = purchaseStore.purchaseFormState.disabled
|
||||
const id = props.formId
|
||||
disabled.value = props.disabled
|
||||
if (id) {
|
||||
loading.value = true
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
@@ -555,7 +562,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/stockTaking/index" })
|
||||
emit("close")
|
||||
}
|
||||
|
||||
// 校验基本数据表单 成功返回 true 失败返回 undefined
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<div v-if="!processFormState.showForm" class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="单据编号" prop="inventoryCode">
|
||||
@@ -31,8 +31,8 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="handleClickCreateStockTaking()"> 新 增 </el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" @click="handleDelete(selectObjs)"> 删 除 </el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create()">新 增</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" @click="handleDelete(selectObjs)">删 除</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@exportExcel="exportExcel"
|
||||
@@ -68,34 +68,35 @@
|
||||
<!-- <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="handleClickEditStockTaking(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button v-else icon="edit-pen" text type="primary" @click="handleClickEditStockTaking(scope.row)">编辑</el-button>
|
||||
<el-button v-if="scope.row.checkStatus == '2'" 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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<sm-form v-else :formId="processFormState.formId" :disabled="processFormState.formDisabled" @close="formClose" />
|
||||
|
||||
<!-- 审批抽屉 -->
|
||||
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { fetchList } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { usePurchase } from "/@/stores/purchase"
|
||||
import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
||||
import { useSmProcessTableAction } from "/@/hooks/smProcessTableAction"
|
||||
|
||||
const SmForm = defineAsyncComponent(() => import("./form.vue"))
|
||||
|
||||
const router = useRouter()
|
||||
const { check_status } = useDict("check_status")
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
@@ -103,6 +104,12 @@ const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const processFormState = reactive<{ formId: string | undefined; formDisabled: boolean; showForm: boolean }>({
|
||||
formId: undefined,
|
||||
formDisabled: true,
|
||||
showForm: false,
|
||||
})
|
||||
const processDrawerRef = ref<InstanceType<typeof ProcessDrawer> | null>(null)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
@@ -110,7 +117,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
},
|
||||
pageList: fetchList,
|
||||
})
|
||||
const purchaseStore = usePurchase()
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
@@ -135,20 +141,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
const handleClickCreateStockTaking = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/stockTaking/form" })
|
||||
}
|
||||
const handleClickEditStockTaking = (row: any) => {
|
||||
row.id ? purchaseStore.setPurchaseFormId(row.id) : useMessage().warning("清单id不存在")
|
||||
if (row.checkStatus == 2) {
|
||||
purchaseStore.setPurchaseFormDisabled(true)
|
||||
} else {
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
}
|
||||
router.push({ path: "/supermarketerp/stockTaking/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
|
||||
Reference in new issue
Block a user