gaoluyang
2025-12-04 cec42fd188b00a2f8fe8f6902ccfc58381d2a481
src/views/productionManagement/operationScheduling/components/formDia.vue
@@ -21,7 +21,20 @@
        </el-table-column>
        <el-table-column label="工序" prop="process" width="150">
          <template #default="scope">
                  <el-input v-model="scope.row.process" placeholder="请输入工序" />
                     <el-select
                        v-model="scope.row.process"
                        placeholder="选择工序"
                        style="width: 100%;"
                filterable
                clearable
                     >
                        <el-option
                           v-for="process in processList"
                           :key="process.id"
                           :label="process.name"
                           :value="process.name"
                        />
                     </el-select>
          </template>
        </el-table-column>
        <el-table-column label="单位" prop="unit" width="90">
@@ -47,7 +60,7 @@
                  />
          </template>
        </el-table-column>
        <el-table-column label="工时定额" width="200" prop="workHours">
        <el-table-column label="工资" width="200" prop="workHours">
          <template #default="scope">
                  <el-input-number
                     v-model="scope.row.workHours"
@@ -71,6 +84,9 @@
                     v-model="scope.row.schedulingUserId"
                     placeholder="选择人员"
                     style="width: 100%;"
              filterable
              default-first-option
              :reserve-keyword="false"
                  >
                     <el-option
                        v-for="user in userList"
@@ -106,6 +122,7 @@
import {ref, getCurrentInstance} from "vue";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {processScheduling} from "@/api/productionManagement/operationScheduling.js";
import {laborConfListPage} from "@/api/lavorissce/issue.js";
const { proxy } = getCurrentInstance()
const { work_step } = proxy.useDict("work_step")
const emit = defineEmits(['close'])
@@ -118,7 +135,10 @@
const specificationModelFromRow = ref('');
const pendingNum = ref(0);
const userList = ref([])
const processList = ref([])
const receive = ref('')
const productionLineIdFromRow = ref('');
const productionUserIdFromRow = ref('');
// 打开弹框
const openDialog = (type, row) => {
@@ -127,10 +147,18 @@
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
   });
   // 根据选中数据的productionLineId查询工序列表
   if (row?.productionLineId) {
      laborConfListPage({ id: row.productionLineId, current: -1, size: -1 }).then((res) => {
         processList.value = res.data.records || [];
      });
   }
   pendingNum.value = row?.pendingNum ?? 0;
   unitFromRow.value = row?.unit ?? '';
   idFromRow.value = row?.id ?? '';
   specificationModelFromRow.value = row?.specificationModel ?? '';
   productionLineIdFromRow.value = row?.productionLineId ?? '';
   productionUserIdFromRow.value = row?.productionUserId ?? '';
   tableData.value = [createRow()];
}
@@ -170,12 +198,14 @@
      proxy.$modal.msgError('排产数量合计不能超过待排产数量');
      return;
   }
   // 3. 将 receive 字段添加到每条数据中,并移除 loss 字段
   // 3. 将 receive、productionLineId、productionUserId 字段添加到每条数据中,并移除 loss 字段
   const submitData = tableData.value.map(row => {
      const { loss, ...rest } = row;
      return {
         ...rest,
         receive: receive.value
         receive: receive.value,
         productionLineId: productionLineIdFromRow.value,
         productionUserId: productionUserIdFromRow.value
      };
   });
   processScheduling(submitData).then((res) => {