曹睿
3 天以前 2362a3399f333aec47afc83caf0bfb1887af24a5
Merge branch 'dev' of http://114.132.189.42:9002/r/product-inventory-management into dev
已修改12个文件
232 ■■■■■ 文件已修改
src/api/collaborativeApproval/approvalProcess.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/user.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/user.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/index.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/issueManagement/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/collaborativeApproval/approvalProcess.js
@@ -38,6 +38,14 @@
        data: query,
    })
}
// 提交审批
export function updateApproveNode(query) {
    return request({
        url: '/approveNode/updateApproveNode',
        method: 'post',
        data: query,
    })
}
// 删除审批流程
export function approveProcessDelete(query) {
    return request({
@@ -45,4 +53,11 @@
        method: 'delete',
        data: query,
    })
}
// 查询审批流程
export function approveProcessDetails(query) {
    return request({
        url: '/approveNode/details/' + query,
        method: 'get',
    })
}
src/api/system/user.js
@@ -135,6 +135,14 @@
  })
}
// 查询用户列表
export function userListNoPageByTenantId() {
  return request({
    url: '/system/user/userListNoPageByTenantId',
    method: 'get'
  })
}
// 查询用户列表
export function userListNoPage() {
  return request({
    url: '/system/user/userListNoPage',
src/store/modules/user.js
@@ -52,6 +52,7 @@
            this.avatar = avatar
            this.currentFactoryName = user.currentFactoryName
            this.nickName = user.nickName
            this.currentDeptId = user.currentDeptId
            resolve(res)
          }).catch(error => {
            reject(error)
src/views/basicData/customerFile/index.vue
@@ -309,7 +309,7 @@
const tableLoading = ref(false);
const page = reactive({
  current: 1,
  size: 10,
  size: 100,
  total: 0,
});
const total = ref(0);
src/views/basicData/product/index.vue
@@ -55,7 +55,7 @@
                >
                  编辑
                </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
@@ -99,7 +99,7 @@
        @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"
@@ -114,6 +114,7 @@
                v-model="form.productName"
                placeholder="请输入产品名称"
                clearable
                @keydown.enter.prevent
              />
            </el-form-item>
          </el-col>
@@ -131,6 +132,7 @@
      title="规格型号"
      width="400px"
      @close="closeModelDia"
      @keydown.enter.prevent
    >
      <el-form
        :model="modelForm"
@@ -146,6 +148,7 @@
                v-model="modelForm.model"
                placeholder="请输入规格型号"
                clearable
                @keydown.enter.prevent
              />
            </el-form-item>
          </el-col>
@@ -157,6 +160,7 @@
                v-model="modelForm.unit"
                placeholder="请输入单位"
                clearable
                @keydown.enter.prevent
              />
            </el-form-item>
          </el-col>
@@ -315,16 +319,53 @@
  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) => {
@@ -400,11 +441,7 @@
    proxy.$modal.msgWarning("请选择数据");
    return;
  }
  ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
  safeConfirm("选中的内容将被删除,是否确认删除?", "删除提示")
    .then(() => {
      tableLoading.value = true;
      delProductModel(ids)
src/views/basicData/supplierManage/index.vue
@@ -35,6 +35,7 @@
        :isSelection="true"
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
                @pagination="pagination"
      ></PIMTable>
    </div>
    <el-dialog
@@ -297,7 +298,7 @@
const tableLoading = ref(false);
const page = reactive({
  current: 1,
  size: 10,
  size: 100,
  total: 0,
});
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -13,24 +13,24 @@
              :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>
@@ -39,7 +39,8 @@
      </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>
@@ -49,44 +50,32 @@
<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();
    })
}
// 关闭弹框
const closeDia = () => {
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
@@ -18,6 +18,7 @@
          <el-col :span="24">
            <el-form-item label="申请部门:" prop="approveDeptId">
                            <el-select
                                disabled
                                v-model="form.approveDeptId"
                                placeholder="选择部门"
                            >
@@ -81,7 +82,17 @@
        <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">
@@ -116,7 +127,7 @@
  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";
@@ -171,26 +182,27 @@
    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
      }
    })
  }
}
@@ -216,7 +228,7 @@
// 提交产品表单
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) {
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -2,11 +2,11 @@
  <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"
@@ -43,14 +43,13 @@
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);
@@ -85,19 +84,21 @@
  {
    label: "流程编号",
    prop: "approveId",
    width: 230
    width: 170
  },
  {
    label: "申请部门",
    prop: "approveDeptName",
        width: 220
  },
  {
    label: "审批事由",
    prop: "approveReason",
        width: 200
  },
  {
    label: "申请人",
    prop: "approveUser",
    prop: "approveUserName",
  },
  {
    label: "申请日期",
@@ -110,7 +111,7 @@
  },
  {
    label: "当前审批人",
    prop: "checkCompany",
    prop: "approveUserCurrentName",
    width: 120
  },
  {
@@ -199,7 +200,7 @@
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;
src/views/inventoryManagement/issueManagement/index.vue
@@ -71,7 +71,7 @@
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";
@@ -185,7 +185,7 @@
  console.log('form',form.value)
  // 加载用户列表
  try {
    const userLists = await userListNoPage()
    const userLists = await userListNoPageByTenantId()
    userList.value = userLists.data
  } catch (error) {
    console.error('加载用户列表失败:', error)
src/views/inventoryManagement/stockManagement/index.vue
@@ -140,7 +140,7 @@
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 ,
@@ -257,7 +257,7 @@
  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
src/views/salesManagement/salesLedger/index.vue
@@ -153,7 +153,7 @@
        <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
@@ -631,14 +631,15 @@
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;
@@ -682,6 +683,7 @@
};
const submitProductEdit = () => {
  productForm.value.salesLedgerId = currentId.value;
  productForm.value.type = 1
  addOrUpdateSalesLedgerProduct(productForm.value).then((res) => {
    proxy.$modal.msgSuccess("提交成功");
    closeProductDia();