Merge branch 'dev' of http://114.132.189.42:9002/r/product-inventory-management into dev
| | |
| | | data: query, |
| | | }) |
| | | } |
| | | // 提交审批 |
| | | export function updateApproveNode(query) { |
| | | return request({ |
| | | url: '/approveNode/updateApproveNode', |
| | | method: 'post', |
| | | data: query, |
| | | }) |
| | | } |
| | | // 删除审批流程 |
| | | export function approveProcessDelete(query) { |
| | | return request({ |
| | |
| | | data: query, |
| | | }) |
| | | } |
| | | // 查询审批流程 |
| | | export function approveProcessDetails(query) { |
| | | return request({ |
| | | url: '/approveNode/details/' + query, |
| | | method: 'get', |
| | | }) |
| | | } |
| | |
| | | })
|
| | | }
|
| | | // 查询用户列表
|
| | | export function userListNoPageByTenantId() {
|
| | | return request({
|
| | | url: '/system/user/userListNoPageByTenantId',
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // 查询用户列表
|
| | | export function userListNoPage() {
|
| | | return request({
|
| | | url: '/system/user/userListNoPage',
|
| | |
| | | this.avatar = avatar
|
| | | this.currentFactoryName = user.currentFactoryName
|
| | | this.nickName = user.nickName
|
| | | this.currentDeptId = user.currentDeptId
|
| | | resolve(res)
|
| | | }).catch(error => {
|
| | | reject(error)
|
| | |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const total = ref(0); |
| | |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="primary" link @click="openProDia('add', data)"> |
| | | <el-button type="primary" link @click="openProDia('add', data)" :disabled="node.level >= 3"> |
| | | 添加产品 |
| | | </el-button> |
| | | <el-button |
| | |
| | | @pagination="pagination" |
| | | ></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="productDia" title="产品" width="400px"> |
| | | <el-dialog v-model="productDia" title="产品" width="400px" @keydown.enter.prevent> |
| | | <el-form |
| | | :model="form" |
| | | label-width="140px" |
| | |
| | | v-model="form.productName" |
| | | placeholder="请输入产品名称" |
| | | clearable |
| | | @keydown.enter.prevent |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | title="规格型号" |
| | | width="400px" |
| | | @close="closeModelDia" |
| | | @keydown.enter.prevent |
| | | > |
| | | <el-form |
| | | :model="modelForm" |
| | |
| | | v-model="modelForm.model" |
| | | placeholder="请输入规格型号" |
| | | clearable |
| | | @keydown.enter.prevent |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | v-model="modelForm.unit" |
| | | placeholder="请输入单位" |
| | | clearable |
| | | @keydown.enter.prevent |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | proxy.$refs.formRef.resetFields(); |
| | | productDia.value = false; |
| | | }; |
| | | // 删除产品 |
| | | const remove = (node, data) => { |
| | | let ids = []; |
| | | ids.push(data.id); |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", { |
| | | // 封装一个安全的确认框,彻底阻止Enter键触发 |
| | | const safeConfirm = (message, title) => { |
| | | // 标记是否是鼠标点击(点击按钮会触发focus事件) |
| | | let isMouseClick = false; |
| | | |
| | | return new Promise((resolve, reject) => { |
| | | const box = ElMessageBox.confirm(message, title, { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | beforeClose: (action, instance, done) => { |
| | | if (action === "confirm") { |
| | | // 只有鼠标点击时才允许确认 |
| | | if (isMouseClick) { |
| | | done(); |
| | | resolve(); |
| | | } else { |
| | | // Enter键触发时阻止 |
| | | done(false); |
| | | } |
| | | } else { |
| | | // 取消操作直接允许 |
| | | done(); |
| | | reject(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 监听确认按钮的focus事件(鼠标点击会触发,Enter键不会) |
| | | setTimeout(() => { |
| | | const confirmBtn = document.querySelector('.el-message-box__btns .el-button--primary'); |
| | | if (confirmBtn) { |
| | | confirmBtn.addEventListener('focus', () => { |
| | | isMouseClick = true; |
| | | }); |
| | | } |
| | | }, 0); // 延迟获取,确保DOM已渲染 |
| | | }); |
| | | }; |
| | | // 删除产品 |
| | | // 删除产品 |
| | | const remove = (node, data) => { |
| | | let ids = [data.id]; |
| | | // 使用封装的safeConfirm |
| | | safeConfirm("选中的内容将被删除,是否确认删除?", "删除提示") |
| | | .then(() => { |
| | | // 确认删除逻辑 |
| | | tableLoading.value = true; |
| | | delProduct(ids) |
| | | .then((res) => { |
| | |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | safeConfirm("选中的内容将被删除,是否确认删除?", "删除提示") |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | delProductModel(ids) |
| | |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | ></PIMTable> |
| | | </div> |
| | | <el-dialog |
| | |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | |
| | |
| | | :key="index" |
| | | :type="activity.current ? 'primary' : ''" |
| | | :hollow="activity.current" |
| | | :timestamp="activity.timestamp" |
| | | :timestamp="activity.approveNodeTime" |
| | | > |
| | | <el-card> |
| | | <span style="font-size: 18px;font-weight: 700">{{activity.content}}</span> |
| | | <span style="font-size: 18px;font-weight: 700">节点{{activity.approveNodeOrder}}</span> |
| | | <div style="margin: 10px 0"> |
| | | <span style="font-size: 16px;font-weight: 600">审批人:{{activity.people}}</span> |
| | | <span style="font-size: 16px;font-weight: 600">审批人:{{activity.approveNodeUser}}</span> |
| | | </div> |
| | | <div> |
| | | <span style="margin-bottom: 8px;display: inline-block;font-size: 16px;font-weight: 600">审批意见:</span> |
| | | <el-form-item |
| | | v-if="activity.current" |
| | | :prop="'activities.' + index + '.value'" |
| | | v-if="activity.approveNodeRemark == 1" |
| | | :prop="'activities.' + index + '.approveNodeReason'" |
| | | :rules="[{ required: true, message: '审批意见不能为空', trigger: 'blur' }]" |
| | | > |
| | | <el-input v-model="activity.value" clearable type="textarea" :disabled="operationType === 'view'"></el-input> |
| | | <el-input v-model="activity.approveNodeReason" clearable type="textarea" :disabled="operationType === 'view'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-else> |
| | | <el-input v-model="activity.value" clearable type="textarea" disabled></el-input> |
| | | <el-input v-model="activity.approveNodeReason" clearable type="textarea" disabled></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </el-card> |
| | |
| | | </el-form> |
| | | <template #footer v-if="operationType === 'approval'"> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button type="primary" @click="submitForm(2)">不通过</el-button> |
| | | <el-button type="primary" @click="submitForm(1)">通过</el-button> |
| | | <el-button @click="closeDia">取消</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, ref} from "vue"; |
| | | import {approveProcessDetails, updateApproveNode} from "../../../../api/collaborativeApproval/approvalProcess.js"; |
| | | const emit = defineEmits(['close']) |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | | const activities = ref([ |
| | | { |
| | | content: '节点1', |
| | | timestamp: '', |
| | | type: 'primary', |
| | | hollow: true, |
| | | people: 'admin', |
| | | value: '' |
| | | }, |
| | | { |
| | | content: '节点2', |
| | | timestamp: '', |
| | | type: '', |
| | | hollow: false, |
| | | current: true, |
| | | people: 'admin', |
| | | value: '' |
| | | }, |
| | | ]) |
| | | const activities = ref([]) |
| | | const formRef = ref(null); |
| | | |
| | | // 打开弹框 |
| | | const openDialog = (type, row) => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | approveProcessDetails(row.approveId).then((res) => { |
| | | console.log(res) |
| | | activities.value = res.data |
| | | }) |
| | | } |
| | | // 提交审批 |
| | | const submitForm = () => { |
| | | formRef.value.validate(valid => { |
| | | if (valid) { |
| | | // 校验通过后的逻辑 |
| | | } |
| | | const submitForm = (status) => { |
| | | const filteredActivities = activities.value.filter(activity => activity.approveNodeRemark == 1); |
| | | filteredActivities[0].approveNodeStatus = status |
| | | updateApproveNode(filteredActivities[0]).then(() => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | | }) |
| | | } |
| | | // 关闭弹框 |
| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="申请部门:" prop="approveDeptId"> |
| | | <el-select |
| | | disabled |
| | | v-model="form.approveDeptId" |
| | | placeholder="选择部门" |
| | | > |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="申请人:" prop="approveUser"> |
| | | <el-input v-model="form.approveUser" placeholder="请输入" clearable/> |
| | | <el-select |
| | | v-model="form.approveUser" |
| | | placeholder="选择人员" |
| | | > |
| | | <el-option |
| | | v-for="user in userList" |
| | | :key="user.userId" |
| | | :label="user.nickName" |
| | | :value="user.userId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | approveProcessUpdate, |
| | | getDept |
| | | } from "../../../../api/collaborativeApproval/approvalProcess.js"; |
| | | import {userListNoPage} from "../../../../api/system/user.js"; |
| | | import {userListNoPage, getUserProfile} from "../../../../api/system/user.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | import useUserStore from "@/store/modules/user"; |
| | |
| | | approverNodes.value = [ |
| | | { id: 1, userId: null } |
| | | ] |
| | | form.value.approveUser = userStore.nickName; |
| | | console.log(userStore) |
| | | form.value.approveUser = userStore.id; |
| | | form.value.approveTime = getCurrentDate(); |
| | | |
| | | // 获取当前用户信息并设置部门ID |
| | | form.value.approveDeptId = userStore.currentDeptId |
| | | if (operationType.value === 'edit') { |
| | | approveProcessGetInfo({id: row.approveId,approveReason: '1'}).then(res => { |
| | | form.value = {...res.data} |
| | | // 反显审批人 |
| | | // if (res.data && res.data.approverIds) { |
| | | // const nameArr = res.data.approverIds.split(',') |
| | | // approverNodes.value = nameArr.map((name, idx) => { |
| | | // const user = userList.value.find(u => u.name === name) |
| | | // return { id: idx + 1, userId: user ? user.id : null } |
| | | // }) |
| | | // nextApproverId = nameArr.length + 1 |
| | | // } else if (row.approverList && Array.isArray(row.approverList) && row.approverList.length > 0) { |
| | | // approverNodes.value = row.approverList.map((userId, idx) => ({ id: idx + 1, userId })) |
| | | // nextApproverId = row.approverList.length + 1 |
| | | // } else { |
| | | // approverNodes.value = [{ id: 1, userId: null }] |
| | | // nextApproverId = 2 |
| | | // } |
| | | if (res.data && res.data.approveUserIds) { |
| | | const userIds = res.data.approveUserIds.split(',') |
| | | approverNodes.value = userIds.map((userId, idx) => ({ |
| | | id: idx + 1, |
| | | userId: parseInt(userId.trim()) |
| | | })) |
| | | nextApproverId = userIds.length + 1 |
| | | } else { |
| | | approverNodes.value = [{ id: 1, userId: null }] |
| | | nextApproverId = 2 |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | // 提交产品表单 |
| | | const submitForm = () => { |
| | | // 收集所有节点的审批人id |
| | | form.value.approverIds = approverNodes.value.map(node => node.userId).join(',') |
| | | form.value.approveUserIds = approverNodes.value.map(node => node.userId).join(',') |
| | | // 审批人必填校验 |
| | | const hasEmptyApprover = approverNodes.value.some(node => !node.userId) |
| | | if (hasEmptyApprover) { |
| | |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">供应商:</span> |
| | | <span class="search_title">流程编号:</span> |
| | | <el-input |
| | | v-model="searchForm.supplier" |
| | | v-model="searchForm.approveId" |
| | | style="width: 240px" |
| | | placeholder="请输入供应商搜索" |
| | | placeholder="请输入流程编号搜索" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {qualityInspectDel, qualityInspectListPage} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue"; |
| | | import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue"; |
| | | import {approveProcessDelete, approveProcessListPage} from "../../../api/collaborativeApproval/approvalProcess.js"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | supplier: "", |
| | | approveId: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | { |
| | | label: "流程编号", |
| | | prop: "approveId", |
| | | width: 230 |
| | | width: 170 |
| | | }, |
| | | { |
| | | label: "申请部门", |
| | | prop: "approveDeptName", |
| | | width: 220 |
| | | }, |
| | | { |
| | | label: "审批事由", |
| | | prop: "approveReason", |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: "申请人", |
| | | prop: "approveUser", |
| | | prop: "approveUserName", |
| | | }, |
| | | { |
| | | label: "申请日期", |
| | |
| | | }, |
| | | { |
| | | label: "当前审批人", |
| | | prop: "checkCompany", |
| | | prop: "approveUserCurrentName", |
| | | width: 120 |
| | | }, |
| | | { |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | ids = selectedRows.value.map((item) => item.approveId); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { |
| | | getStockInPage |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | |
| | | console.log('form',form.value) |
| | | // 加载用户列表 |
| | | try { |
| | | const userLists = await userListNoPage() |
| | | const userLists = await userListNoPageByTenantId() |
| | | userList.value = userLists.data |
| | | } catch (error) { |
| | | console.error('加载用户列表失败:', error) |
| | |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { productTreeList,modelList } from "@/api/basicData/product.js" |
| | | import { |
| | | getStockManagePage , |
| | |
| | | operationType.value = type |
| | | form.value = {} |
| | | productData.value = [] |
| | | let userLists = await userListNoPage() |
| | | let userLists = await userListNoPageByTenantId() |
| | | userList.value = userLists.data |
| | | // customerList().then(res => { |
| | | // customerOption.value = res |
| | |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (productData.value.length > 0) { |
| | | console.log('productData.value--', productData.value) |
| | | if (productData.value !== null && productData.value.length > 0) { |
| | | form.value.productData = proxy.HaveJson(productData.value); |
| | | } else { |
| | | proxy.$modal.msgWarning("请添加产品信息"); |
| | | return; |
| | | } |
| | | let tempFileIds = []; |
| | | if (fileList.value.length > 0) { |
| | | if (fileList.value !== null && fileList.value.length > 0) { |
| | | tempFileIds = fileList.value.map((item) => item.tempId); |
| | | } |
| | | form.value.tempFileIds = tempFileIds; |
| | |
| | | }; |
| | | const submitProductEdit = () => { |
| | | productForm.value.salesLedgerId = currentId.value; |
| | | productForm.value.type = 1 |
| | | addOrUpdateSalesLedgerProduct(productForm.value).then((res) => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeProductDia(); |