Merge remote-tracking branch 'origin/dev_天津_阳光印刷' into dev_天津_阳光印刷
已修改7个文件
150 ■■■■ 文件已修改
src/api/productionManagement/workOrder.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionCosting/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/safeWorkApproval/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/productionManagement/workOrder.js
@@ -24,6 +24,15 @@
  });
}
// 报工弹窗数据查询(返回默认班组成员 reportPersons)
export function getProductWorkOrderById(id) {
  return request({
    url: "/productWorkOrder/getProductWorkOrderById",
    method: "get",
    params: { id },
  });
}
// 下载工单流转卡(返回文件流)
export function downProductWorkOrder(id) {
  return request({
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -17,18 +17,7 @@
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="申请部门:">
                            <el-select
                                disabled
                                v-model="form.approveDeptId"
                                placeholder="选择部门"
                            >
                                <el-option
                                    v-for="user in productOptions"
                                    :key="user.deptId"
                                    :label="user.deptName"
                                    :value="user.deptId"
                                />
                            </el-select>
                            <el-input v-model="form.approveDeptName" placeholder="申请部门" disabled />
                        </el-form-item>
                    </el-col>
                </el-row>
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -148,6 +148,11 @@
);
const route = useRoute();
// 管理员账号(角色为 普通2 / admin / 最高1)可审批任意流程,不受审批人限制
const isAdminUser = computed(() =>
  ["admin", "普通2", "最高1"].some(r => (userStore.roles || []).includes(r))
);
// 当前选中的标签页,默认为公出管理
const activeTab = ref('1');
src/views/productionManagement/productionCosting/index.vue
@@ -67,7 +67,11 @@
              :tableLoading="tableLoading1"
              style="margin-right: 20px;"
              @pagination="pagination1"
          ></PIMTable>
          >
            <template #personWorkMinutes="{ row }">
              {{ row.personWorkMinutes ?? row.workMinutes ?? '-' }}
            </template>
          </PIMTable>
                </div>
            </el-col>
        </el-row>
@@ -173,6 +177,13 @@
    prop: "workMinutes",
    width: 110,
  },
  {
    label: "人员工时(分钟)",
    prop: "personWorkMinutes",
    width: 120,
    dataType: "slot",
    slot: "personWorkMinutes",
  },
]);
// 左侧汇总台账列(生产人、产量、工资、合格率)
src/views/productionManagement/workOrder/index.vue
@@ -24,13 +24,7 @@
                :tableData="tableData"
                :page="page"
                :tableLoading="tableLoading"
                @pagination="pagination">
        <template #completionStatus="{ row }">
          <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
                       :color="progressColor(toProgressPercentage(row?.completionStatus))"
                       :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
        </template>
      </PIMTable>
                @pagination="pagination" />
    </div>
    <el-dialog v-model="editDialogVisible"
               title="编辑时间"
@@ -289,6 +283,19 @@
          <!--          </el-col>-->
        </el-row>
      </el-form>
      <el-table :data="personList" border style="margin-top: 12px;">
        <el-table-column label="生产人" prop="userName" min-width="100" align="center" />
        <el-table-column label="产量" min-width="120" align="center">
          <template #default="scope">
            <el-input-number v-model="scope.row.quantity" :min="0" :controls="false" placeholder="产量" style="width: 100%" />
          </template>
        </el-table-column>
        <el-table-column label="生产时长(分钟)" min-width="140" align="center">
          <template #default="scope">
            <el-input-number v-model="scope.row.workHour" :min="0" :controls="false" placeholder="时长(分钟)" style="width: 100%" />
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary"
@@ -490,6 +497,7 @@
    productWorkOrderPage,
    updateProductWorkOrder,
    addProductMain,
    getProductWorkOrderById,
    downProductWorkOrder,
    addProductionMachineRecord,
    productionMachineRecordListPage,
@@ -1075,25 +1083,13 @@
      width: "140",
    },
    {
      label: "加放数",
      prop: "processRouteAddNum",
      width: "100",
    },
    {
      label: "完成数量",
      prop: "completeQuantity",
      width: "140",
    },
    {
      label: "完成进度",
      prop: "completionStatus",
      dataType: "slot",
      slot: "completionStatus",
      width: "140",
    },
    {
      label: "计划开始时间",
      prop: "planStartTime",
      width: "140",
    },
    {
      label: "计划结束时间",
      prop: "planEndTime",
      width: "140",
    },
    {
@@ -1217,6 +1213,8 @@
    teamList: [],
    deviceId: null,
  });
  // 班组人员产量时长明细 [{ userId, userName, quantity, workHour }]
  const personList = ref([]);
  const teamSelectOptions = computed(() => {
    const base =
      Array.isArray(reportForm.userIdsList) && reportForm.userIdsList.length > 0
@@ -1544,7 +1542,7 @@
      });
  };
  const showReportDialog = row => {
  const showReportDialog = async row => {
    currentReportRowData.value = row;
    reportForm.planQuantity = row.planQuantity - row.completeQuantity;
    reportForm.quantity = row.planQuantity - row.completeQuantity;
@@ -1557,7 +1555,7 @@
    reportForm.replenishQty = 0;
    reportForm.teamList = [];
    reportForm.scrapQty = 0;
    reportForm.addQty = 0;
    reportForm.addQty = row.processRouteAddNum ? Number(row.processRouteAddNum) : 0;
    reportForm.userIds = row.userIds || [];
    // 合并工单报工人和工序报工人,去重
@@ -1576,6 +1574,34 @@
        userId: item.userId,
        nickName: item.nickName,
      }));
    // 获取报工弹窗数据,带出默认班组成员(合并排产人员与机台操作员,去重)
    personList.value = [];
    try {
      const res = await getProductWorkOrderById(row.id);
      const reportPersons = (Array.isArray(res?.data?.reportPersons)
        ? res.data.reportPersons
        : []
      )
        .filter(p => p && typeof p === "object")
        .map(p => ({
          userId: p.userId ?? p.id ?? "",
          userName: String(p.userName || p.nickName || "").trim(),
        }))
        .filter(p => p.userName !== "");
      personList.value = reportPersons.map(p => ({
        userId: p.userId,
        userName: p.userName,
        quantity: null,
        workHour: null,
      }));
      reportForm.teamList = reportPersons.map(p => ({
        userId: p.userId,
        userName: p.userName,
      }));
    } catch (err) {
      console.error("获取报工弹窗数据失败", err);
    }
    nextTick(() => {
      reportFormRef.value?.clearValidate();
@@ -1648,10 +1674,23 @@
      //   return;
      // }
      // 校验各班组产量之和等于报工总产量
      const personQuantityTotal = personList.value.reduce(
        (sum, p) => sum + (Number(p.quantity) || 0),
        0
      );
      if (personQuantityTotal !== quantity) {
        ElMessageBox.alert("各班组产量之和必须等于报工总产量", "提示", {
          confirmButtonText: "确定",
        });
        return;
      }
      const submitData = {
        ...reportForm,
        quantity: quantity,
        scrapQty: scrapQty,
        personList: personList.value,
      };
      addProductMain(submitData).then(res => {
        if (res.code === 200) {
src/views/safeProduction/safeWorkApproval/index.vue
@@ -89,6 +89,11 @@
  );
  const route = useRoute();
  // 管理员账号(角色为 普通2 / admin / 最高1)可审批任意流程,不受审批人限制
  const isAdminUser = computed(() =>
    ["admin", "普通2", "最高1"].some(r => (userStore.roles || []).includes(r))
  );
  // 当前审批类型,根据选中的标签页计算
  const currentApproveType = computed(() => {
    return Number(8);
src/views/salesManagement/salesLedger/index.vue
@@ -647,7 +647,7 @@
                               :min="0"
                               v-model="productForm.taxInclusiveUnitPrice"
                               style="width: 100%"
                               :precision="4"
                               :precision="5"
                               placeholder="请输入"
                               clearable
                               @change="calculateFromQuantity" />
@@ -1179,6 +1179,12 @@
    if (Number.isNaN(num)) return "0.0000";
    return num.toFixed(4);
  };
  const formatAmount5 = value => {
    if (value === undefined || value === null || value === "") return "0.00000";
    const num = Number(value);
    if (Number.isNaN(num)) return "0.00000";
    return num.toFixed(5);
  };
  const findLedgerRecordByRow = row => {
    if (!row) return null;
    if (
@@ -1663,7 +1669,7 @@
          productForm.value.taxInclusiveUnitPrice !== null &&
          productForm.value.taxInclusiveUnitPrice !== ""
        ) {
          productForm.value.taxInclusiveUnitPrice = formatAmount4(
          productForm.value.taxInclusiveUnitPrice = formatAmount5(
            productForm.value.taxInclusiveUnitPrice
          );
        }
@@ -2298,7 +2304,7 @@
    productForm.value.taxInclusiveTotalPrice = totalPrice.toFixed(4);
    // 计算含税单价 = 含税总价 / 数量
    productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4);
    productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(5);
    // 如果有税率,计算不含税总价
    if (productForm.value.taxRate) {
@@ -2342,7 +2348,7 @@
    // 计算含税单价 = 含税总价 / 数量
    productForm.value.taxInclusiveUnitPrice = (
      inclusiveTotalPrice / quantity
    ).toFixed(4);
    ).toFixed(5);
    isCalculating.value = false;
  };