spring
18 小时以前 30b15089e5000ab82af8dca4c335bda8940f0a7a
Merge branch 'dev_长治_健齿齿科器材' of http://114.132.189.42:9002/r/product-inventory-management into dev_长治_健齿齿科器材
已修改7个文件
442 ■■■■ 文件已修改
src/api/qualityManagement/rawMaterialInspection.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/qualityManagement/rawMaterialInspection.js
@@ -55,3 +55,12 @@
    })
}
// 下载出库检验报告
export function downloadOutReport(data) {
    return request({
        url: '/quality/qualityInspect/downOutReport',
        method: 'post',
        data: data,
        responseType: "blob",
    })
}
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -89,6 +89,50 @@
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检品数量:" prop="inspectedQuantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" placeholder="请输入,不大于总数量" clearable :precision="2" :disabled="quantityDisabled"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检验用粉剂/液情况:" prop="inspectMaterialCondition">
              <el-radio-group v-model="form.inspectMaterialCondition">
                <el-radio label="检验用粉剂情况">检验用粉剂情况</el-radio>
                <el-radio label="检验用液剂情况">检验用液剂情况</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="生产日期:" prop="productionDate">
              <el-date-picker
                  v-model="form.productionDate"
                  type="date"
                  placeholder="请选择日期"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
                  @change="calculateValidityDate"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="有效期:" prop="validityDate">
              <el-date-picker
                  v-model="form.validityDate"
                  type="date"
                  placeholder="自动计算或手动选择"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检测单位:" prop="checkCompany">
              <el-input v-model="form.checkCompany" placeholder="请输入" clearable/>
            </el-form-item>
@@ -154,10 +198,19 @@
          </el-select>
        </template>
        <template #deviceStatus="{ row }">
          <el-tag v-if="row.deviceStatus" :type="getDeviceStatusType(row.deviceStatus)">
            {{ row.deviceStatus }}
          </el-tag>
          <span v-else style="color: #999">-</span>
          <el-select
              v-model="row.deviceStatus"
              placeholder="请选择"
              default-first-option
              clearable
              style="width: 100%"
          >
            <el-option label="正常" value="正常" />
            <el-option label="停机" value="停机" />
            <el-option label="运行" value="运行" />
            <el-option label="维修" value="维修" />
            <el-option label="/" value="/" />
          </el-select>
        </template>
        <template #result="{ row }">
          <el-input v-model="row.result" placeholder="请输入" clearable />
@@ -218,6 +271,10 @@
    batchNo: "",
    inspectedQuantity: "",
    quantity: "",
    inspectedQuantity: "",
    inspectMaterialCondition: "",
    productionDate: "",
    validityDate: "",
    checkCompany: "",
    checkResult: "",
  },
@@ -231,6 +288,25 @@
    unit: [{ required: false, message: "请输入", trigger: "blur" }],
    inspectedQuantity: [{ required: true, message: "请输入", trigger: "blur" }],
    quantity: [{ required: true, message: "请输入", trigger: "blur" }],
    inspectedQuantity: [
      { required: true, message: "请输入检品数量", trigger: "blur" },
      {
        validator: (rule, value, callback) => {
          if (value !== '' && value !== null && value !== undefined) {
            const qty = Number(form.value.quantity);
            const inspectedQty = Number(value);
            if (!isNaN(qty) && !isNaN(inspectedQty) && inspectedQty > qty) {
              callback(new Error("检品数量不能大于总数量"));
            } else {
              callback();
            }
          } else {
            callback();
          }
        },
        trigger: "blur"
      }
    ],
    checkCompany: [{ required: false, message: "请输入", trigger: "blur" }],
    batchNo: [{ required: true, validator: validateBatchNo, trigger: "blur" }],
    checkResult: [{ required: true, message: "请输入", trigger: "change" }],
@@ -255,32 +331,32 @@
        prop: "standardValue",
        width: 180
    },
    {
        label: "单位",
        prop: "unit",
        width: 80
    },
    {
        label: "检测器具",
        prop: "instrument",
        dataType: 'slot',
        slot: 'instrument',
        width: 220
    },
    {
        label: "设备状态",
        prop: "deviceStatus",
        dataType: 'slot',
        slot: 'deviceStatus',
        width: 120
    },
    {
        label: "检测结果",
        prop: "result",
        dataType: 'slot',
        slot: 'result',
        minWidth: 150
    },
  {
    label: "单位",
    prop: "unit",
    width: 70
  },
  {
    label: "检测器具",
    prop: "instrument",
    dataType: 'slot',
    slot: 'instrument',
    width: 220
  },
  {
    label: "设备状态",
    prop: "deviceStatus",
    dataType: 'slot',
    slot: 'deviceStatus',
    width: 120
  },
  {
    label: "检测结果",
    prop: "result",
    dataType: 'slot',
    slot: 'result',
    width: 150
  },
    {
        label: "结果判断",
        prop: "resultJudgment",
@@ -412,6 +488,10 @@
  form.value.model = modelOptions.value.find(item => item.id == value)?.model || '';
  form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || '';
  form.value.uidNo = modelOptions.value.find(item => item.id == value)?.uidNo || '';
  // 选择规格型号后,如果已有生产日期则重新计算有效期
  if (form.value.productionDate) {
    calculateValidityDate();
  }
}
const findNodeById = (nodes, productId) => {
@@ -509,6 +589,24 @@
    })
}
// 计算有效期(生产日期 + 规格型号中的有效期)
const calculateValidityDate = async () => {
  if (!form.value.productionDate) {
    form.value.validityDate = '';
    return;
  }
  // 获取规格型号的有效期
  const selectedModel = modelOptions.value.find(item => item.id == form.value.productModelId);
  if (selectedModel && selectedModel.validityPeriod) {
    const productionDate = new Date(form.value.productionDate);
    const validityPeriod = parseFloat(selectedModel.validityPeriod);
    const validityDate = new Date(productionDate);
    validityDate.setFullYear(validityDate.getFullYear() + Math.floor(validityPeriod));
    validityDate.setMonth(validityDate.getMonth() + Math.round((validityPeriod % 1) * 12));
    form.value.validityDate = validityDate.toISOString().split('T')[0];
  }
};
// 获取设备台账列表
const loadDeviceList = () => {
    qualityInspectParamDeviceList().then(res => {
src/views/qualityManagement/finalInspection/index.vue
@@ -68,6 +68,7 @@
import {ElMessageBox} from "element-plus";
import {
    downloadQualityInspect,
    downloadOutReport,
    qualityInspectDel,
    qualityInspectListPage, qualityInspectUpdate,
    submitQualityInspect
@@ -190,7 +191,7 @@
                    return false;
                }
      },
      {
      /*{
        name: "填写检验记录",
        type: "text",
        clickFun: (row) => {
@@ -203,7 +204,7 @@
                    }
                    return false;
                }
      },
      },*/
      {
        name: "附件",
        type: "text",
@@ -246,6 +247,13 @@
                type: "text",
                clickFun: (row) => {
                    downLoadFile(row);
                },
            },
            {
                name: "报告",
                type: "text",
                clickFun: (row) => {
                    downloadReport(row);
                },
            },
    ],
@@ -408,13 +416,31 @@
            type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
        })
        const downloadUrl = window.URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.href = downloadUrl
        link.download = '原材料检验报告.docx'
        document.body.appendChild(link)
        link.click()
        document.body.removeChild(link)
        window.URL.revokeObjectURL(downloadUrl)
    })
};
const downloadReport = (row) => {
    downloadOutReport({ id: row.id }).then((blobData) => {
        const blob = new Blob([blobData], {
            type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
        })
        const downloadUrl = window.URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.href = downloadUrl
        link.download = '出库检验报告.docx'
        document.body.appendChild(link)
        link.click()
        document.body.removeChild(link)
        window.URL.revokeObjectURL(downloadUrl)
    })
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -66,8 +66,52 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数量:" prop="quantity">
            <el-form-item label="总数量:" prop="quantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" clearable :precision="2" :disabled="processQuantityDisabled"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检品数量:" prop="inspectedQuantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" placeholder="请输入,不大于总数量" clearable :precision="2" :disabled="processQuantityDisabled"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检验用粉剂/液情况:" prop="inspectMaterialCondition">
              <el-radio-group v-model="form.inspectMaterialCondition">
                <el-radio label="粉剂">粉剂</el-radio>
                <el-radio label="液体">液体</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="生产日期:" prop="productionDate">
              <el-date-picker
                  v-model="form.productionDate"
                  type="date"
                  placeholder="请选择日期"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
                  @change="calculateValidityDate"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="有效期:" prop="validityDate">
              <el-date-picker
                  v-model="form.validityDate"
                  type="date"
                  placeholder="自动计算或手动选择"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -155,10 +199,19 @@
          </el-select>
        </template>
        <template #deviceStatus="{ row }">
          <el-tag v-if="row.deviceStatus" :type="getDeviceStatusType(row.deviceStatus)">
            {{ row.deviceStatus }}
          </el-tag>
          <span v-else style="color: #999">-</span>
          <el-select
              v-model="row.deviceStatus"
              placeholder="请选择"
              default-first-option
              clearable
              style="width: 100%"
          >
            <el-option label="正常" value="正常" />
            <el-option label="停机" value="停机" />
            <el-option label="运行" value="运行" />
            <el-option label="维修" value="维修" />
            <el-option label="/" value="/" />
          </el-select>
        </template>
        <template #result="{ row }">
          <el-input v-model="row.result" placeholder="请输入" clearable />
@@ -221,6 +274,10 @@
    testStandardId: "",
    unit: "",
    quantity: "",
    inspectedQuantity: "",
    inspectMaterialCondition: "",
    productionDate: "",
    validityDate: "",
    checkCompany: "",
    checkResult: "",
  },
@@ -233,6 +290,25 @@
    testStandardId: [{required: false, message: "请选择指标", trigger: "change"}],
    unit: [{ required: false, message: "请输入", trigger: "blur" }],
    quantity: [{ required: true, message: "请输入", trigger: "blur" }],
    inspectedQuantity: [
      { required: true, message: "请输入检品数量", trigger: "blur" },
      {
        validator: (rule, value, callback) => {
          if (value !== '' && value !== null && value !== undefined) {
            const qty = Number(form.value.quantity);
            const inspectedQty = Number(value);
            if (!isNaN(qty) && !isNaN(inspectedQty) && inspectedQty > qty) {
              callback(new Error("检品数量不能大于总数量"));
            } else {
              callback();
            }
          } else {
            callback();
          }
        },
        trigger: "blur"
      }
    ],
    checkCompany: [{ required: false, message: "请输入", trigger: "blur" }],
    batchNo: [{ required: true, validator: validateBatchNo, trigger: "blur" }],
    checkResult: [{ required: true, message: "请输入", trigger: "change" }],
@@ -262,7 +338,7 @@
    {
        label: "单位",
        prop: "unit",
        width: 80
        width: 70
    },
    {
        label: "检测器具",
@@ -283,7 +359,7 @@
        prop: "result",
        dataType: 'slot',
        slot: 'result',
        minWidth: 150
    width: 150
    },
    {
        label: "结果判断",
@@ -332,6 +408,10 @@
        uidNo: "",
        batchNo: "",
        quantity: "",
        inspectedQuantity: "",
        inspectMaterialCondition: "",
        productionDate: "",
        validityDate: "",
        checkCompany: "",
        checkResult: "",
    }
@@ -432,6 +512,10 @@
  form.value.model = modelOptions.value.find(item => item.id == value)?.model || '';
  form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || '';
  form.value.uidNo = modelOptions.value.find(item => item.id == value)?.uidNo || '';
  // 选择规格型号后,如果已有生产日期则重新计算有效期
  if (form.value.productionDate) {
    calculateValidityDate();
  }
}
const findNodeById = (nodes, productId) => {
@@ -575,6 +659,24 @@
    }
};
// 计算有效期(生产日期 + 规格型号中的有效期)
const calculateValidityDate = async () => {
  if (!form.value.productionDate) {
    form.value.validityDate = '';
    return;
  }
  // 获取规格型号的有效期
  const selectedModel = modelOptions.value.find(item => item.id == form.value.productModelId);
  if (selectedModel && selectedModel.validityPeriod) {
    const productionDate = new Date(form.value.productionDate);
    const validityPeriod = parseFloat(selectedModel.validityPeriod);
    const validityDate = new Date(productionDate);
    validityDate.setFullYear(validityDate.getFullYear() + Math.floor(validityPeriod));
    validityDate.setMonth(validityDate.getMonth() + Math.round((validityPeriod % 1) * 12));
    form.value.validityDate = validityDate.toISOString().split('T')[0];
  }
};
// 关闭弹框
const closeDia = () => {
  proxy.resetForm("formRef");
src/views/qualityManagement/processInspection/index.vue
@@ -188,7 +188,7 @@
                    return false;
                }
      },
      {
      /*{
        name: "填写检验记录",
        type: "text",
        clickFun: (row) => {
@@ -201,7 +201,7 @@
                    }
                    return false;
                }
      },
      },*/
      {
        name: "附件",
        type: "text",
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -76,9 +76,54 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数量:" prop="quantity">
            <el-form-item label="总数量:" prop="quantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入"
                               clearable :precision="2" :disabled="supplierQuantityDisabled"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检品数量:" prop="inspectedQuantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" placeholder="请输入,不大于总数量"
                               clearable :precision="2" :disabled="supplierQuantityDisabled"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检验用粉剂/液情况:" prop="inspectMaterialCondition">
              <el-radio-group v-model="form.inspectMaterialCondition">
                <el-radio label="粉剂">粉剂</el-radio>
                <el-radio label="液体">液体</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="生产日期:" prop="productionDate">
              <el-date-picker
                  v-model="form.productionDate"
                  type="date"
                  placeholder="请选择日期"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
                  @change="calculateValidityDate"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="有效期:" prop="validityDate">
              <el-date-picker
                  v-model="form.validityDate"
                  type="date"
                  placeholder="自动计算或手动选择"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  clearable
                  style="width: 100%"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -168,10 +213,19 @@
          </el-select>
        </template>
        <template #deviceStatus="{ row }">
          <el-tag v-if="row.deviceStatus" :type="getDeviceStatusType(row.deviceStatus)">
            {{ row.deviceStatus }}
          </el-tag>
          <span v-else style="color: #999">-</span>
          <el-select
              v-model="row.deviceStatus"
              placeholder="请选择"
              default-first-option
              clearable
              style="width: 100%"
          >
            <el-option label="正常" value="正常" />
            <el-option label="停机" value="停机" />
            <el-option label="运行" value="运行" />
            <el-option label="维修" value="维修" />
            <el-option label="/" value="/" />
          </el-select>
        </template>
        <template #result="{ row }">
          <el-input v-model="row.result" placeholder="请输入" clearable />
@@ -232,6 +286,10 @@
    testStandardId: "",
    unit: "",
    quantity: "",
    inspectedQuantity: "",
    inspectMaterialCondition: "",
    productionDate: "",
    validityDate: "",
    checkCompany: "",
    checkResult: "",
  },
@@ -244,6 +302,25 @@
    testStandardId: [{required: false, message: "请选择指标", trigger: "change"}],
    unit: [{required: false, message: "请输入", trigger: "blur"}],
    quantity: [{required: true, message: "请输入", trigger: "blur"}],
    inspectedQuantity: [
      {required: true, message: "请输入检品数量", trigger: "blur"},
      {
        validator: (rule, value, callback) => {
          if (value !== '' && value !== null && value !== undefined) {
            const qty = Number(form.value.quantity);
            const inspectedQty = Number(value);
            if (!isNaN(qty) && !isNaN(inspectedQty) && inspectedQty > qty) {
              callback(new Error("检品数量不能大于总数量"));
            } else {
              callback();
            }
          } else {
            callback();
          }
        },
        trigger: "blur"
      }
    ],
    checkCompany: [{required: false, message: "请输入", trigger: "blur"}],
    batchNo: [{ required: true, validator: validateBatchNo, trigger: "blur" }],
    checkResult: [{required: true, message: "请选择检测结果", trigger: "change"}],
@@ -263,7 +340,7 @@
  {
    label: "单位",
    prop: "unit",
    width: 80
    width: 70
  },
  {
    label: "检测器具",
@@ -284,7 +361,7 @@
    prop: "result",
    dataType: 'slot',
    slot: 'result',
    minWidth: 150
    width: 150
  },
  {
    label: "结果判断",
@@ -343,6 +420,10 @@
    testStandardId: "",
    unit: "",
    quantity: "",
    inspectedQuantity: "",
    inspectMaterialCondition: "",
    productionDate: "",
    validityDate: "",
    checkCompany: "",
    checkResult: "",
  }
@@ -441,6 +522,10 @@
  form.value.model = modelOptions.value.find(item => item.id == value)?.model || '';
  form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || '';
  form.value.uidNo = modelOptions.value.find(item => item.id == value)?.uidNo || '';
  // 选择规格型号后,如果已有生产日期则重新计算有效期
  if (form.value.productionDate) {
    calculateValidityDate();
  }
}
const findNodeById = (nodes, productId) => {
@@ -580,6 +665,24 @@
  }
};
// 计算有效期(生产日期 + 规格型号中的有效期)
const calculateValidityDate = async () => {
  if (!form.value.productionDate) {
    form.value.validityDate = '';
    return;
  }
  // 获取规格型号的有效期
  const selectedModel = modelOptions.value.find(item => item.id == form.value.productModelId);
  if (selectedModel && selectedModel.validityPeriod) {
    const productionDate = new Date(form.value.productionDate);
    const validityPeriod = parseFloat(selectedModel.validityPeriod);
    const validityDate = new Date(productionDate);
    validityDate.setFullYear(validityDate.getFullYear() + Math.floor(validityPeriod));
    validityDate.setMonth(validityDate.getMonth() + Math.round((validityPeriod % 1) * 12));
    form.value.validityDate = validityDate.toISOString().split('T')[0];
  }
};
// 关闭弹框
const closeDia = () => {
  proxy.resetForm("formRef");
src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -190,7 +190,7 @@
                    return false;
                }
      },
      {
      /*{
        name: "填写检验记录",
        type: "text",
        clickFun: (row) => {
@@ -203,7 +203,7 @@
                    }
                    return false;
                }
      },
      },*/
      {
        name: "附件",
        type: "text",