zhangwencui
2026-04-20 af06b4d2623314446670ea9f0f1ff44b40c9d036
工序管理模块完善
已修改2个文件
71 ■■■■ 文件已修改
src/api/productionManagement/productionProcess.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionProcess/index.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/productionManagement/productionProcess.js
@@ -70,9 +70,9 @@
}
// 获取工序参数列表
export function getProcessParamList(processId, params) {
export function getProcessParamList(params) {
  return request({
    url: `/productProcessParam/list/${processId}`,
    url: `/technologyOperationParam/list`,
    method: "get",
    params,
  });
@@ -81,7 +81,7 @@
// 添加工序参数
export function addProcessParam(data) {
  return request({
    url: "/productProcessParam/add",
    url: "/technologyOperationParam/",
    method: "post",
    data: data,
  });
@@ -90,8 +90,8 @@
// 编辑工序参数
export function editProcessParam(data) {
  return request({
    url: "/productProcessParam/edit",
    method: "put",
    url: "/technologyOperationParam/",
    method: "post",
    data: data,
  });
}
@@ -99,7 +99,7 @@
// 删除工序参数
export function deleteProcessParam(id) {
  return request({
    url: `/productProcessParam/${id}`,
    url: `/technologyOperationParam/batchDelete/${id}`,
    method: "delete",
  });
}
src/views/productionManagement/productionProcess/index.vue
@@ -44,16 +44,12 @@
            <div class="card-body">
              <!-- <div class="process-name">{{ process.name }}</div> -->
              <div class="process-desc">{{ process.remark || '暂无描述' }}</div>
              <div class="process-device">关联设备: {{ process.deviceName || '未关联' }}</div>
              <div class="process-device">关联设备: {{ deviceOptions.find(item => item.id === Number(process.deviceLedgerId)).deviceName|| '未关联' }}</div>
            </div>
            <div class="card-footer">
              <div class="status-tag"> <el-tag size="small"
                        :type="process.status ? 'success' : 'info'">
                  {{ process.status ? '启用' : '停用' }}
                </el-tag>
              <div class="status-tag">
                <el-tag size="small"
                        :type="process.isQuality ? 'warning' : 'info'"
                        style="margin-left: 8px">
                        :type="process.isQuality ? 'warning' : 'info'">
                  {{ process.isQuality ? '质检' : '非质检' }}
                </el-tag>
                <el-tag v-if="process.type !== null && process.type !== undefined"
@@ -154,13 +150,6 @@
                    :rows="3"
                    placeholder="请输入工序描述" />
        </el-form-item>
        <el-form-item label="状态"
                      prop="status">
          <el-radio-group v-model="processForm.status">
            <el-radio :label="true">启用</el-radio>
            <el-radio :label="false">停用</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
@@ -245,7 +234,6 @@
            </el-form-item>
            <el-form-item label="标准值">
              <el-input v-model="selectedParam.standardValue"
                        type="number"
                        placeholder="请输入默认值" />
            </el-form-item>
          </el-form>
@@ -276,7 +264,6 @@
        <el-form-item label="标准值"
                      prop="standardValue">
          <el-input v-model="editParamForm.standardValue"
                    type="number"
                    placeholder="请输入标准值" />
        </el-form-item>
      </el-form>
@@ -335,7 +322,6 @@
    salaryQuota: null,
    isQuality: false,
    remark: "",
    status: true,
    deviceLedgerId: null,
    type: 0,
  });
@@ -381,11 +367,10 @@
  const editParamFormRef = ref(null);
  const editParamForm = reactive({
    id: null,
    processId: null,
    paramId: null,
    technologyOperationId: null,
    technologyParamId: null,
    paramName: "",
    standardValue: null,
    tenantId: 1,
  });
  const editParamRules = {
    standardValue: [
@@ -436,13 +421,6 @@
    {
      label: "取值格式",
      prop: "paramFormat",
      formatData: (val, row) => {
        if (row.paramType == "3") {
          const dict = dictTypes.value.find(item => item.dictType === val);
          return dict ? "字典:" + dict.dictName : val;
        }
        return val;
      },
    },
    {
      label: "标准值",
@@ -472,7 +450,7 @@
  // 获取工序列表
  const getProcessList = () => {
    processLoading.value = true;
    getProcessListApi()
    getProcessListApi({ size: -1, current: -1 })
      .then(res => {
        processValueList.value = res.data.records || [];
      })
@@ -503,13 +481,11 @@
  const getParamList = processId => {
    paramLoading.value = true;
    console.log(paramPage2.value, "paramPage2.value");
    getProcessParamList(processId, {
      current: paramPage2.value.current,
      size: paramPage2.value.size,
    })
    getProcessParamList({ technologyOperationId: processId })
      .then(res => {
        paramList.value = res.data.records || [];
        paramPage2.value.total = res.data.total;
        console.log(res, "res");
        paramList.value = res.data || [];
        paramPage2.value.total = 0;
      })
      .catch(() => {
        ElMessage.error("获取参数列表失败");
@@ -534,23 +510,19 @@
    processForm.salaryQuota = null;
    processForm.isQuality = false;
    processForm.remark = "";
    processForm.status = true;
    processForm.deviceLedgerId = null;
    processForm.type = 0;
    loadDeviceName();
    processDialogVisible.value = true;
  };
  const handleEditProcess = async process => {
    isProcessEdit.value = true;
    await loadDeviceName(); // Ensure deviceOptions is loaded before setting deviceLedgerId
    processForm.id = process.id;
    processForm.no = process.no;
    processForm.name = process.name;
    processForm.salaryQuota = process.salaryQuota;
    processForm.isQuality = !!process.isQuality;
    processForm.remark = process.remark || "";
    processForm.status = process.status;
    processForm.deviceLedgerId = Number(process.deviceLedgerId);
    processForm.type = process.type;
    processDialogVisible.value = true;
@@ -712,11 +684,10 @@
  const handleEditParam = row => {
    editParamForm.id = row.id;
    editParamForm.processId = row.processId;
    editParamForm.paramId = row.paramId;
    editParamForm.technologyOperationId = row.technologyOperationId;
    editParamForm.technologyParamId = row.technologyParamId;
    editParamForm.paramName = row.paramName;
    editParamForm.standardValue = row.standardValue;
    editParamForm.tenantId = 1;
    editParamDialogVisible.value = true;
  };
@@ -742,10 +713,9 @@
      return;
    }
    addProcessParam({
      processId: selectedProcess.value.id,
      paramId: selectedParam.value.id,
      technologyOperationId: selectedProcess.value.id,
      technologyParamId: selectedParam.value.id,
      standardValue: selectedParam.value.standardValue,
      tenantId: 1,
    })
      .then(() => {
        ElMessage.success("添加成功");
@@ -772,6 +742,7 @@
  };
  onMounted(() => {
    loadDeviceName();
    getProcessList();
    getDictTypes();
  });