超市审批相关编辑方案和按钮权限修改
This commit is contained in:
1 parent
1b0c1d8b0a
commit
217968cd63
16 files changed
+289
-375
No files matched your search
+4
-4
@@ -8,18 +8,18 @@ VITE_OPEN = true
|
||||
ENV = 'development'
|
||||
|
||||
# ADMIN 服务地址
|
||||
# VITE_ADMIN_PROXY_PATH = http://47.96.250.9:8089/api/ # 测试线上
|
||||
VITE_ADMIN_PROXY_PATH = http://47.96.250.9:8089/api/ # 测试线上
|
||||
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
||||
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
|
||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.64:9999/ # 邓-本地
|
||||
# VITE_ADMIN_PROXY_PATH = http://192.168.101.81:9999/ # 邓-本地
|
||||
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
|
||||
|
||||
# 图片访问基础地址
|
||||
# VITE_IMAGE_BASE_PATH = http://47.96.250.9:8089/api # 测试线上
|
||||
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
|
||||
# VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.64:9999 # 邓-本地
|
||||
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
||||
# VITE_IMAGE_BASE_PATH = http://192.168.101.81:9999 # 邓-本地
|
||||
VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
||||
|
||||
# 代码生成服务地址
|
||||
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
|
||||
@@ -1,27 +0,0 @@
|
||||
import { defineStore } from "pinia"
|
||||
|
||||
export const usePurchase = defineStore("purchase", {
|
||||
state: () => ({
|
||||
purchaseFormState: {
|
||||
id: "",
|
||||
disabled: false,
|
||||
},
|
||||
}),
|
||||
actions: {
|
||||
setPurchaseFormId(id: string) {
|
||||
this.purchaseFormState.id = id
|
||||
},
|
||||
setPurchaseFormDisabled(disabled: boolean) {
|
||||
this.purchaseFormState.disabled = disabled
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
enabled: true,
|
||||
strategies: [
|
||||
{
|
||||
key: "purchaseFormState", //自定义 Key值
|
||||
storage: localStorage, // 选择存储方式
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
@@ -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">
|
||||
@@ -96,7 +96,7 @@
|
||||
border
|
||||
:loading="loading"
|
||||
show-overflow
|
||||
max-height="400"
|
||||
max-height="410"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'cell',
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
<el-row class="my-3">
|
||||
<el-tooltip effect="dark" content="返回列表页面" placement="top">
|
||||
<el-button type="primary" plain @click="router.back()">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
<el-button type="primary" plain @click="emit('close')">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="!baseDataForm.id" effect="dark" content="保存并清空数据" placement="top">
|
||||
<el-button type="primary" plain @click="onContinueAdd">继续添加</el-button>
|
||||
@@ -212,7 +212,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { getPlanCode, getErpSpuSimpleAll, getCgInventoryPage } from "/@/api/supermarketerp/common"
|
||||
@@ -222,11 +221,20 @@ import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCodeDialog from "/@/views/supermarketerp/components/linkCodeDialog.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
|
||||
@@ -295,9 +303,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
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
@@ -497,7 +504,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/purchaseManagement/smErpCgBack/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,13 +31,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleClickCreateInventoryRecord()"
|
||||
v-auth="'supermarket_smErpInventoryRecords_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create()" v-auth="'supermarket_smErpInventoryRecords_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -86,22 +80,14 @@
|
||||
<!-- <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="handleClickEditInventoryRecord(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"
|
||||
v-auth="'supermarket_smErpInventoryRecords_edit'"
|
||||
@click="handleClickEditInventoryRecord(scope.row)"
|
||||
@click="edit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -114,23 +100,32 @@
|
||||
>
|
||||
删除
|
||||
</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 { fetchList, delObjs } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
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()
|
||||
@@ -138,6 +133,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: {
|
||||
@@ -145,7 +146,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
},
|
||||
pageList: fetchList,
|
||||
})
|
||||
const purchaseStore = usePurchase()
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
@@ -170,22 +170,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 点击创建出库入库记录表
|
||||
const handleClickCreateInventoryRecord = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/purchaseManagement/smErpCgBack/form" })
|
||||
}
|
||||
// 点击编辑出库入库记录表
|
||||
const handleClickEditInventoryRecord = (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/purchaseManagement/smErpCgBack/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
|
||||
@@ -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.code" 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">
|
||||
@@ -96,7 +96,7 @@
|
||||
border
|
||||
:loading="loading"
|
||||
show-overflow
|
||||
max-height="400"
|
||||
max-height="410"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'cell',
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
<el-row class="my-3">
|
||||
<el-tooltip effect="dark" content="返回列表页面" placement="top">
|
||||
<el-button type="primary" plain @click="router.back()">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
<el-button type="primary" plain @click="emit('close')">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="!baseDataForm.id" effect="dark" content="保存并清空数据" placement="top">
|
||||
<el-button type="primary" plain @click="onContinueAdd">继续添加</el-button>
|
||||
@@ -212,7 +212,6 @@
|
||||
|
||||
<script setup lang="ts" name="smErpCgDd">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgDd"
|
||||
import { getPlanCode, getErpSpuSimpleAll, getCgsqPage } from "/@/api/supermarketerp/common"
|
||||
@@ -222,11 +221,20 @@ import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCodeDialog from "/@/views/supermarketerp/components/linkCodeDialog.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
|
||||
@@ -295,9 +303,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
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
@@ -497,7 +504,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/purchaseManagement/smErpCgDd/index" })
|
||||
emit("close")
|
||||
}
|
||||
|
||||
// 校验基本数据表单 成功返回 true 失败返回 undefined
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<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>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="handleClickCreateCgPlan" v-auth="'supermarket_smErpCgDd_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create" v-auth="'supermarket_smErpCgDd_add'">新 增</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
@@ -52,45 +50,50 @@
|
||||
<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="handleClickEditCgPlan(scope.row)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_smErpCgDd_edit'"
|
||||
@click="handleClickEditCgPlan(scope.row)"
|
||||
>
|
||||
<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" 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>
|
||||
</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" name="index">
|
||||
import { useRouter } from "vue-router"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/supermarketerp/smErpCgDd"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
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 showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const purchaseStore = usePurchase()
|
||||
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: {},
|
||||
@@ -120,22 +123,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 点击创建采购清单
|
||||
const handleClickCreateCgPlan = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/purchaseManagement/smErpCgDd/form" })
|
||||
}
|
||||
// 点击编辑采购清单
|
||||
const handleClickEditCgPlan = (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/purchaseManagement/smErpCgDd/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
|
||||
@@ -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">
|
||||
@@ -96,7 +96,7 @@
|
||||
border
|
||||
:loading="loading"
|
||||
show-overflow
|
||||
max-height="400"
|
||||
max-height="410"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'cell',
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
<el-row class="my-3">
|
||||
<el-tooltip effect="dark" content="返回列表页面" placement="top">
|
||||
<el-button type="primary" plain @click="router.back()">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
<el-button type="primary" plain @click="emit('close')">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="!baseDataForm.id" effect="dark" content="保存并清空数据" placement="top">
|
||||
<el-button type="primary" plain @click="onContinueAdd">继续添加</el-button>
|
||||
@@ -212,7 +212,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { getPlanCode, getErpSpuSimpleAll, getCgddPage } from "/@/api/supermarketerp/common"
|
||||
@@ -222,11 +221,20 @@ import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCodeDialog from "/@/views/supermarketerp/components/linkCodeDialog.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
|
||||
@@ -295,9 +303,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
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
@@ -497,7 +504,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/purchaseManagement/smErpCgInventory/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,13 +31,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleClickCreateInventoryRecord()"
|
||||
v-auth="'supermarket_smErpInventoryRecords_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create()" v-auth="'supermarket_smErpInventoryRecords_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -86,22 +80,14 @@
|
||||
<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="handleClickEditInventoryRecord(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"
|
||||
v-auth="'supermarket_smErpInventoryRecords_edit'"
|
||||
@click="handleClickEditInventoryRecord(scope.row)"
|
||||
@click="edit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -115,23 +101,32 @@
|
||||
>
|
||||
删除
|
||||
</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 { fetchList, delObjs } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
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()
|
||||
@@ -139,6 +134,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: {
|
||||
@@ -146,7 +147,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
},
|
||||
pageList: fetchList,
|
||||
})
|
||||
const purchaseStore = usePurchase()
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
@@ -171,22 +171,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 点击创建出库入库记录表
|
||||
const handleClickCreateInventoryRecord = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/purchaseManagement/smErpCgInventory/form" })
|
||||
}
|
||||
// 点击编辑出库入库记录表
|
||||
const handleClickEditInventoryRecord = (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/purchaseManagement/smErpCgInventory/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
|
||||
@@ -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.planCode" 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">
|
||||
@@ -80,7 +80,7 @@
|
||||
border
|
||||
:loading="loading"
|
||||
show-overflow
|
||||
max-height="400"
|
||||
max-height="410"
|
||||
:edit-config="{
|
||||
trigger: 'click',
|
||||
mode: 'cell',
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
<el-row class="my-3">
|
||||
<el-tooltip effect="dark" content="返回列表页面" placement="top">
|
||||
<el-button type="primary" plain @click="router.back()">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
<el-button type="primary" plain @click="emit('close')">{{ disabled ? "返回" : "取消" }}</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="!baseDataForm.id" effect="dark" content="保存并清空数据" placement="top">
|
||||
<el-button type="primary" plain @click="onContinueAdd">继续添加</el-button>
|
||||
@@ -197,21 +197,29 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgPlan"
|
||||
import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
import { usePurchase } from "/@/stores/purchase"
|
||||
import { tablePrint } from "../../supermarketUtils"
|
||||
|
||||
const purchaseStore = usePurchase()
|
||||
const router = useRouter()
|
||||
const erpSpuSelectDialogRef = ref() // 商品选择对话框ref
|
||||
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
|
||||
const baseDataFormRef = ref() // 基本数据表单ref
|
||||
const editableTableRef = ref<VxeTableInstance<any>>() // 可编辑表格ref
|
||||
const baseDataInfoRef = ref() // 基本信息ref
|
||||
@@ -263,9 +271,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
|
||||
// 获取补货申请编号 & 获取简要商品列表
|
||||
@@ -440,7 +447,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/purchaseManagement/smErpCgPlan/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="planCode">
|
||||
@@ -25,7 +25,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="handleClickCreateCgPlan" v-auth="'supermarket_smErpCgPlan_add'">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create" v-auth="'supermarket_smErpCgPlan_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -72,17 +72,8 @@
|
||||
<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="handleClickEditCgPlan(scope.row)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'supermarket_smErpCgPlan_edit'"
|
||||
@click="handleClickEditCgPlan(scope.row)"
|
||||
>
|
||||
<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" v-auth="'supermarket_smErpCgPlan_edit'" @click="edit(scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'supermarket_smErpCgPlan_del'" @click="handleDelete([scope.row.id])">
|
||||
@@ -97,30 +88,36 @@
|
||||
<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" name="systemSmErpCgPlan">
|
||||
import { useRouter } from "vue-router"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/supermarketerp/smErpCgPlan"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { usePurchase } from "/@/stores/purchase"
|
||||
import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
||||
import { useSmProcessTableAction } from "/@/hooks/smProcessTableAction"
|
||||
|
||||
const SmForm = defineAsyncComponent(() => import("./form.vue"))
|
||||
|
||||
const { check_status } = useDict("check_status")
|
||||
const router = useRouter()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const purchaseStore = usePurchase()
|
||||
const processDrawerRef = ref()
|
||||
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: {},
|
||||
@@ -149,22 +146,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 点击创建采购清单
|
||||
const handleClickCreateCgPlan = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/purchaseManagement/smErpCgPlan/form" })
|
||||
}
|
||||
// 点击编辑采购清单
|
||||
const handleClickEditCgPlan = (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/purchaseManagement/smErpCgPlan/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
@@ -182,15 +164,4 @@ const handleDelete = async (ids: string[]) => {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
|
||||
// 点击开始处理
|
||||
const deal = (row: any) => {
|
||||
if (!row.processInstanceId) return useMessage().warning("流程id不存在")
|
||||
processDrawerRef.value.openProcessDrawer(row)
|
||||
}
|
||||
|
||||
// 审批提交事件
|
||||
const taskSubmitEvent = () => {
|
||||
getDataList()
|
||||
}
|
||||
</script>
|
||||
@@ -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">
|
||||
@@ -217,7 +217,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>
|
||||
@@ -251,7 +251,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { getPlanCode, getErpSpuSimpleAll, getCgInventoryPage } from "/@/api/supermarketerp/common"
|
||||
@@ -262,11 +261,20 @@ import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectD
|
||||
import linkCodeDialog from "/@/views/supermarketerp/components/linkCodeDialog.vue"
|
||||
import { displayPrice, storePrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
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
|
||||
@@ -349,9 +357,8 @@ const receiveAmountFormRules = ref({
|
||||
// 初始化数据
|
||||
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
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
@@ -554,7 +561,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/retailManagement/smErpRetailBack/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,13 +31,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleClickCreateInventoryRecord()"
|
||||
v-auth="'supermarket_smErpInventoryRecords_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create()" v-auth="'supermarket_smErpInventoryRecords_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -76,32 +70,24 @@
|
||||
<el-table-column prop="inventoryDate" label="单据日期" show-overflow-tooltip />
|
||||
<el-table-column prop="inventoryDate" label="入库商品" show-overflow-tooltip />
|
||||
<el-table-column prop="handlerUserName" label="经办人" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="checkStatus" label="审批状态" show-overflow-tooltip>-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="checkStatus" label="审批状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierId" 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="handleClickEditInventoryRecord(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"
|
||||
v-auth="'supermarket_smErpInventoryRecords_edit'"
|
||||
@click="handleClickEditInventoryRecord(scope.row)"
|
||||
@click="edit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -114,30 +100,45 @@
|
||||
>
|
||||
删除
|
||||
</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 { fetchList, delObjs } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { usePurchase } from "/@/stores/purchase"
|
||||
import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
||||
import { useSmProcessTableAction } from "/@/hooks/smProcessTableAction"
|
||||
|
||||
const SmForm = defineAsyncComponent(() => import("./form.vue"))
|
||||
|
||||
const { check_status } = useDict("check_status")
|
||||
const router = useRouter()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
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: {
|
||||
@@ -145,7 +146,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
},
|
||||
pageList: fetchList,
|
||||
})
|
||||
const purchaseStore = usePurchase()
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
@@ -170,22 +170,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 点击创建出库入库记录表
|
||||
const handleClickCreateInventoryRecord = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/retailManagement/smErpRetailBack/form" })
|
||||
}
|
||||
// 点击编辑出库入库记录表
|
||||
const handleClickEditInventoryRecord = (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/retailManagement/smErpRetailBack/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
|
||||
@@ -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">
|
||||
@@ -207,7 +207,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>
|
||||
@@ -241,7 +241,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue"
|
||||
import { useRouter } from "vue-router"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { getPlanCode, getErpSpuSimpleAll, getCgddPage } from "/@/api/supermarketerp/common"
|
||||
@@ -252,11 +251,20 @@ import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectD
|
||||
import linkCodeDialog from "/@/views/supermarketerp/components/linkCodeDialog.vue"
|
||||
import { displayPrice, storePrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
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
|
||||
@@ -339,9 +347,8 @@ const receiveAmountFormRules = ref({
|
||||
// 初始化数据
|
||||
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
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
@@ -544,7 +551,7 @@ const onSave = async () => {
|
||||
(await editableTableValidate()) &&
|
||||
(await submitData()) &&
|
||||
clearData() &&
|
||||
router.replace({ path: "/supermarketerp/retailManagement/smErpRetailDelivery/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,13 +31,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleClickCreateInventoryRecord()"
|
||||
v-auth="'supermarket_smErpInventoryRecords_add'"
|
||||
>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="create()" v-auth="'supermarket_smErpInventoryRecords_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -86,22 +80,14 @@
|
||||
<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="handleClickEditInventoryRecord(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"
|
||||
v-auth="'supermarket_smErpInventoryRecords_edit'"
|
||||
@click="handleClickEditInventoryRecord(scope.row)"
|
||||
@click="edit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -114,23 +100,32 @@
|
||||
>
|
||||
删除
|
||||
</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 { fetchList, delObjs } from "/@/api/supermarketerp/smErpInventoryRecords"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
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()
|
||||
@@ -138,6 +133,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: {
|
||||
@@ -145,7 +146,6 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
},
|
||||
pageList: fetchList,
|
||||
})
|
||||
const purchaseStore = usePurchase()
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
@@ -170,22 +170,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 点击创建出库入库记录表
|
||||
const handleClickCreateInventoryRecord = () => {
|
||||
purchaseStore.setPurchaseFormId("")
|
||||
purchaseStore.setPurchaseFormDisabled(false)
|
||||
router.push({ path: "/supermarketerp/retailManagement/smErpRetailDelivery/form" })
|
||||
}
|
||||
// 点击编辑出库入库记录表
|
||||
const handleClickEditInventoryRecord = (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/retailManagement/smErpRetailDelivery/form" })
|
||||
}
|
||||
const { create, edit, formClose, deal, taskSubmitEvent } = useSmProcessTableAction(processFormState, processDrawerRef, getDataList)
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
|
||||
@@ -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