进销存升级
1.销售台账不能删除和编辑别人维护的数据
2.产品维护固定产品大类为:成品、半成品、原材料。
| | |
| | | import auth from '@/plugins/auth'
|
| | | import router, { constantRoutes, dynamicRoutes } from '@/router'
|
| | | import router, { constantRoutes, dynamicRoutes, financialRoutes } from '@/router'
|
| | | import { getRouters } from '@/api/menu'
|
| | | import Layout from '@/layout/index'
|
| | | import ParentView from '@/components/ParentView'
|
| | |
| | | const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
|
| | | asyncRoutes.forEach(route => { router.addRoute(route) })
|
| | | this.setRoutes(rewriteRoutes)
|
| | | this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
|
| | | this.setDefaultRoutes(sidebarRoutes)
|
| | | this.setTopbarRoutes(defaultRoutes)
|
| | | // 将财务管理路由合并到侧边栏
|
| | | this.setSidebarRouters(constantRoutes.concat(sidebarRoutes).concat(financialRoutes))
|
| | | this.setDefaultRoutes(sidebarRoutes.concat(financialRoutes))
|
| | | this.setTopbarRoutes(defaultRoutes.concat(financialRoutes))
|
| | | // 添加财务管理模块路由
|
| | | financialRoutes.forEach(route => {
|
| | | router.addRoute(route)
|
| | | })
|
| | | resolve(rewriteRoutes)
|
| | | })
|
| | | })
|
| | |
| | | prefix-icon="Search" |
| | | /> |
| | | <el-button |
| | | v-if="false" |
| | | type="primary" |
| | | @click="openProDia('addOne')" |
| | | style="margin-left: 10px" |
| | |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | :disabled="isTopLevelNode(data, node)" |
| | | @click="openProDia('edit', data)" |
| | | > |
| | | 编辑 |
| | |
| | | style="margin-left: 4px" |
| | | type="danger" |
| | | link |
| | | :disabled="isTopLevelNode(data, node)" |
| | | @click="remove(node, data)" |
| | | > |
| | | 删除 |
| | |
| | | const searchFilter = () => { |
| | | proxy.$refs.tree.filter(search.value); |
| | | }; |
| | | const isTopLevelNode = (data, node) => { |
| | | if (node?.level !== undefined) { |
| | | return node.level === 1; |
| | | } |
| | | return [null, undefined, "", 0, "0"].includes(data?.parentId); |
| | | }; |
| | | // 打开产品弹框 |
| | | const openProDia = (type, data) => { |
| | | if (data && type === "edit" && isTopLevelNode(data)) { |
| | | proxy.$modal.msgWarning("一级节点不能编辑或删除"); |
| | | return; |
| | | } |
| | | operationType.value = type; |
| | | productDia.value = true; |
| | | form.value.productName = ""; |
| | |
| | | |
| | | // 删除产品 |
| | | const remove = (node, data) => { |
| | | if (isTopLevelNode(data, node)) { |
| | | proxy.$modal.msgWarning("一级节点不能编辑或删除"); |
| | | return; |
| | | } |
| | | let ids = []; |
| | | ids.push(data.id); |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", { |
| | |
| | | <script setup> |
| | | import { reactive, ref, toRefs, getCurrentInstance } from "vue"; |
| | | import { returnManagementAdd, returnManagementUpdate, returnManagementGetByShippingId, getSalesLedger, returnManagementGetById } from "@/api/salesManagement/returnOrder.js"; |
| | | import { getAllCustomerList } from "@/api/customerService/index.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { listProject } from "@/api/oaSystem/projectManagement.js"; |
| | | import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(['close']) |
| | |
| | | }; |
| | | |
| | | const initCustomers = async () => { |
| | | const res = await getAllCustomerList({}); |
| | | if (res?.records) { |
| | | customerNameOptions.value = res.records.map(item => ({ |
| | | label: item.customerName, |
| | | value: item.customerName, // Keep value as name if needed for other logic, but request says customerId |
| | | id: item.id, |
| | | code: item.customerCode |
| | | })); |
| | | } |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | customerNameOptions.value = res.data.records.map(item => ({ |
| | | label: item.customerName, |
| | | value: item.customerName, // Keep value as name if needed for other logic, but request says customerId |
| | | id: item.id, |
| | | code: item.customerCode |
| | | })); |
| | | }); |
| | | }; |
| | | |
| | | const initUsers = async () => { |
| | |
| | | return true; |
| | | }; |
| | | const canEditLedger = (row) => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = (row) => isCurrentUserMaintainer(row); |
| | | const sensitiveAmountFormatter = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | return "*****"; |
| | |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | const unauthorizedRows = selectedRows.value.filter((row) => !canDeleteLedger(row)); |
| | | if (unauthorizedRows.length > 0) { |
| | | proxy.$modal.msgWarning("当前登录用户不是录入人,不能删除该数据"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | |
| | | // 检查是否有已进行发货或发货完成的销售订单,若有则不允许删除 |