Merge remote-tracking branch 'origin/dev' into dev
| | |
| | | method: 'delete', |
| | | data: query, |
| | | }) |
| | | } |
| | | // 删除审批流程 |
| | | export function approveProcessDetails(query) { |
| | | return request({ |
| | | url: '/approveNode/details', |
| | | method: 'get', |
| | | params: query, |
| | | }) |
| | | } |
| | |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const total = ref(0); |
| | |
| | | :headers="upload.headers" |
| | | :action="upload.url + '?updateSupport=' + upload.updateSupport" |
| | | :disabled="upload.isUploading" |
| | | :showTip="false" |
| | | @success="handleFileSuccess" |
| | | /> |
| | | <template #footer> |
| | |
| | | > |
| | | 编辑 |
| | | </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; |
| | | }; |
| | | // 封装一个安全的确认框,彻底阻止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 = []; |
| | | ids.push(data.id); |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | 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, |
| | | }); |
| | | |
| | |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, ref} from "vue"; |
| | | import {approveProcessDetails} from "../../../../api/collaborativeApproval/approvalProcess.js"; |
| | | const emit = defineEmits(['close']) |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | |
| | | const openDialog = (type, row) => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | approveProcessDetails({id: row.approveId}).then((res) => { |
| | | console.log(res) |
| | | }) |
| | | } |
| | | // 提交审批 |
| | | const submitForm = () => { |
| | |
| | | <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"> |
| | |
| | | approverNodes.value = [ |
| | | { id: 1, userId: null } |
| | | ] |
| | | form.value.approveUser = userStore.nickName; |
| | | console.log(userStore) |
| | | form.value.approveUser = userStore.id; |
| | | form.value.approveTime = getCurrentDate(); |
| | | if (operationType.value === 'edit') { |
| | | approveProcessGetInfo({id: row.approveId,approveReason: '1'}).then(res => { |
| | |
| | | <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: "申请部门", |
| | |
| | | { |
| | | label: "审批事由", |
| | | prop: "approveReason", |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: "申请人", |
| | |
| | | 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; |
| | |
| | | <el-row> |
| | | <el-form-item label="产品信息:" prop="entryDate"> |
| | | <el-button type="primary" @click="openProductForm('add')">添加</el-button> |
| | | <el-button plain type="danger" @click="deleteProduct">删除</el-button> |
| | | <el-button plain type="danger" @click="deleteProduct" >删除</el-button> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary |
| | |
| | | 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("请添加产品信息"); |