gaoluyang
2025-12-09 012aa7fd84c4de6216f5be6e8a05ed52f7fdf429
src/views/productionManagement/operationScheduling/components/formDia.vue
@@ -122,27 +122,35 @@
const pendingNum = ref(0);
const userList = ref([])
const receive = ref('')
const sunqianUserId = ref('')
// 打开弹框
const openDialog = (type, row) => {
  operationType.value = type;
  dialogFormVisible.value = true;
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
   });
   pendingNum.value = row?.pendingNum ?? 0;
   unitFromRow.value = row?.unit ?? '';
   idFromRow.value = row?.id ?? '';
   specificationModelFromRow.value = row?.specificationModel ?? '';
   tableData.value = [createRow()];
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
      // 找到孙倩的用户ID并设置为默认值
      const sunqianUser = userList.value.find(user => user.nickName === '孙倩');
      if (sunqianUser) {
         sunqianUserId.value = sunqianUser.userId;
      }
      // 在用户列表加载完成后创建行数据
      tableData.value = [createRow()];
   });
}
const createRow = () => ({
   id: idFromRow.value,
   process: '',
   process: '包装',
   schedulingDate: '',
   schedulingNum: null,
   schedulingUserId: '',
   schedulingUserId: sunqianUserId.value, // 默认设置为孙倩的用户ID
   workHours: null,
   unit: unitFromRow.value,
   remark: '',