已修改8个文件
380 ■■■■ 文件已修改
src/views/basicData/product/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/components/Detail.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/index.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 198 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/index.vue
@@ -140,6 +140,18 @@
      >
        <el-row>
          <el-col :span="24">
            <el-form-item label="物料编号:" prop="materialCode">
              <el-input
                  v-model="modelForm.materialCode"
                  placeholder="请输入物料编号"
                  clearable
                  @keydown.enter.prevent
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="规格型号:" prop="model">
              <el-input
                v-model="modelForm.model"
@@ -202,6 +214,10 @@
const expandedKeys = ref([]);
const tableColumn = ref([
  {
    label: "物料编号",
    prop: "materialCode",
  },
  {
    label: "规格型号",
    prop: "model",
  },
@@ -244,10 +260,12 @@
    ],
  },
  modelForm: {
    materialCode: "",
    model: "",
    unit: "",
  },
  modelRules: {
    materialCode: [{ required: true, message: "请输入", trigger: "blur" }, { max: 200, message: "物料编号不能超过200个字符", trigger: "blur" }],
    model: [{ required: true, message: "请输入", trigger: "blur" }],
    unit: [{ required: true, message: "请输入", trigger: "blur" }],
  },
src/views/productionManagement/productionReporting/components/Detail.vue
@@ -54,11 +54,11 @@
      <el-descriptions-item label="报工人员">{{ row.nickName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="工序">{{ row.process || '-' }}</el-descriptions-item>
      <el-descriptions-item label="工单编号">{{ row.workOrderNo || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产品名称">{{ row.salesContractNo || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产品规格型号">{{ row.productName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产出数量">{{ row.productModelName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="报废数量">{{ row.quantity || '-' }}</el-descriptions-item>
      <el-descriptions-item label="单位">{{ row.scrapQty || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产品名称">{{ row.productName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产品规格型号">{{ row.productModelName || '-' }}</el-descriptions-item>
      <el-descriptions-item label="产出数量">{{ row.quantity  || '-' }}</el-descriptions-item>
      <el-descriptions-item label="报废数量">{{ row.scrapQty || '-' }}</el-descriptions-item>
      <el-descriptions-item label="单位">{{ row.unit || '-' }}</el-descriptions-item>
      <el-descriptions-item label="创建时间">{{ row.createTime || '-' }}</el-descriptions-item>
      <el-descriptions-item
          v-for="item in otherDataEntries"
src/views/productionManagement/workOrder/index.vue
@@ -301,7 +301,7 @@
  //   width: "80",
  // },
  {
    label: "工单编号1",
    label: "工单编号",
    prop: "workOrderNo",
    width: "140",
  },
@@ -729,6 +729,9 @@
const handleReport = async () => {
  const data = await productionRecordFormRef.value.submitData()
  if (!data) {
    return;
  }
  reportForm.otherData.rows = data || [];
  reportFormRef.value?.validate((valid) => {
    if (!valid) {
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -62,20 +62,32 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不良数量:" prop="defectiveQuantity">
              <el-input v-model="form.defectiveQuantity" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="不良原因:" prop="defectiveReason">
              <el-select v-model="form.defectiveReason" placeholder="请选择" clearable style="width: 100%">
                <el-option :label="item.label" :value="item.value" v-for="(item,index) in defective_reason" :key="index" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合格数量:" prop="qualifiedQuantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请输入" clearable :precision="2" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="不良数量:" prop="defectiveQuantity">
              <el-input v-model="form.defectiveQuantity" placeholder="请输入" clearable disabled/>
            <el-form-item label="检测单位:" prop="checkCompany">
              <el-input v-model="form.checkCompany" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult">
@@ -87,8 +99,11 @@
        </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 label="检验员:" prop="checkName">
                            <el-select v-model="form.checkName" placeholder="请选择" clearable>
                                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                                                     :value="item.nickName"/>
                            </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -102,16 +117,6 @@
                  clearable
                  style="width: 100%"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检验员:" prop="checkName">
                            <el-select v-model="form.checkName" placeholder="请选择" clearable>
                                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                                                     :value="item.nickName"/>
                            </el-select>
            </el-form-item>
          </el-col>
        </el-row>
@@ -162,6 +167,7 @@
    testStandardId: "",
    defectiveReason: undefined,
    unit: "",
    qualifiedQuantity: "",
    quantity: "",
    checkCompany: "",
    checkResult: "",
@@ -219,6 +225,29 @@
const testStandardOptions = ref([]); // 指标选择下拉框数据
const modelOptions = ref([]);
// 监听不良数量变化,自动更新数量
// 当 defectiveQuantity 增加时,quantity 减少;当 defectiveQuantity 减少时,quantity 增加
watch(() => form.value.defectiveQuantity, (newVal, oldVal) => {
  if (newVal > form.value.quantity) {
    form.value.defectiveQuantity = form.value.quantity;
  }
  form.value.qualifiedQuantity = Number((form.value.quantity - newVal).toFixed(2));
});
// 监听总数量变化,自动更新合格数量
watch(() => form.value.quantity, (newVal, oldVal) => {
  const totalQty = Number(newVal) || 0;
  const defectiveQty = Number(form.value.defectiveQuantity) || 0;
  // 确保不良数量不超过总数量
  if (defectiveQty > totalQty) {
    form.value.defectiveQuantity = totalQty;
  }
  // 计算合格数量
  form.value.qualifiedQuantity = Number((totalQty - defectiveQty).toFixed(2));
});
// 打开弹框
const openDialog = async (type, row) => {
  operationType.value = type;
src/views/qualityManagement/finalInspection/index.vue
@@ -122,6 +122,11 @@
    width: 100
  },
  {
    label: "合格数量",
    prop: "qualifiedQuantity",
    width: 100
  },
  {
    label: "不良数量",
    prop: "defectiveQuantity",
    width: 100
@@ -339,7 +344,7 @@
    type: "warning",
  })
      .then(() => {
        proxy.download("/quality/qualityInspect/export", {inspectType: 2}, "出厂检验.xlsx");
        proxy.download("/quality/qualityInspect/export", {inspectType: 2}, "成品检验.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -81,15 +81,8 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不良原因:" prop="defectiveReason">
              <el-select v-model="form.defectiveReason" placeholder="请选择" clearable style="width: 100%">
                <el-option
                  v-for="dict in defective_reason"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            <el-form-item label="合格数量:" prop="qualifiedQuantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请输入" clearable :precision="2" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -100,27 +93,40 @@
        </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 label="不良原因:" prop="defectiveReason">
              <el-select v-model="form.defectiveReason" placeholder="请选择" clearable style="width: 100%">
                <el-option
                    v-for="dict in defective_reason"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult">
                <el-option label="合格" value="合格" />
                <el-option label="不合格" value="不合格" />
              </el-select>
            <el-form-item label="检测单位:" prop="checkCompany">
              <el-input v-model="form.checkCompany" placeholder="请输入" clearable/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="检验员:" prop="checkName">
                            <el-select v-model="form.checkName" placeholder="请选择" clearable>
                                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                                                     :value="item.nickName"/>
                            </el-select>
              <el-select v-model="form.checkName" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                           :value="item.nickName"/>
              </el-select>
            </el-form-item>
            <el-form-item label="检测结果:" prop="checkResult">
              <el-select v-model="form.checkResult">
                <el-option label="合格" value="合格" />
                <el-option label="不合格" value="不合格" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检测日期:" prop="checkTime">
@@ -256,15 +262,24 @@
// 监听不良数量变化,自动更新数量
// 当 defectiveQuantity 增加时,quantity 减少;当 defectiveQuantity 减少时,quantity 增加
watch(() => form.value.defectiveQuantity, (newVal, oldVal) => {
  const newDefectiveQty = Number(newVal) || 0;
  const oldDefectiveQty = Number(oldVal) || 0;
  const currentQuantity = Number(form.value.quantity) || 0;
  // 计算变化量:新值 - 旧值
  const changeAmount = newDefectiveQty - oldDefectiveQty;
  // quantity 反向变化
  form.value.quantity = Number((currentQuantity - changeAmount).toFixed(2));
  if (newVal > form.value.quantity) {
    form.value.defectiveQuantity = form.value.quantity;
  }
  form.value.qualifiedQuantity = Number((form.value.quantity - newVal).toFixed(2));
});
// 监听总数量变化,自动更新合格数量
watch(() => form.value.quantity, (newVal, oldVal) => {
  const totalQty = Number(newVal) || 0;
  const defectiveQty = Number(form.value.defectiveQuantity) || 0;
  // 确保不良数量不超过总数量
  if (defectiveQty > totalQty) {
    form.value.defectiveQuantity = totalQty;
  }
  // 计算合格数量
  form.value.qualifiedQuantity = Number((totalQty - defectiveQty).toFixed(2));
});
// 打开弹框
src/views/qualityManagement/processInspection/index.vue
@@ -122,6 +122,16 @@
    prop: "unit",
  },
  {
    label: "合格数量",
    prop: "qualifiedQuantity",
    width: 100
  },
  {
    label: "不良数量",
    prop: "defectiveQuantity",
    width: 100
  },
  {
    label: "数量",
    prop: "quantity",
    width: 100
src/views/salesManagement/salesLedger/index.vue
@@ -547,7 +547,7 @@
                                    <tbody>
                                    <tr v-for="(product, index) in item.products" :key="product.id">
                                        <td>{{ index + 1 }}</td>
                                        <td>{{ product.productNo || '' }}</td>
                                        <td>{{ product.materialCode || '' }}</td>
                                        <td>{{`${product.productCategory || ''}/${product.specificationModel || ''}` }}</td>
                                        <td>{{ product.unit || '' }}</td>
                                        <td>{{ product.quantity || '0' }}</td>
@@ -1609,10 +1609,11 @@
          min-width: 80px;
          font-size: 12px;
        }
                 .table-section {
                 margin-bottom: 40px;
          //  flex: 0.6;
         }
        .table-section {
          margin-bottom: 4px;
          flex: 1;
          display: flex;
        }
        .product-table {
          width: 100%;
          border-collapse: collapse;
@@ -1640,6 +1641,59 @@
          line-height: 22px;
          justify-content: space-between;
        }
        .remarks-section {
          margin: 10px 0;
          .remark-item {
            display: flex;
            align-items: flex-start;
            .label {
              font-weight: bold;
              min-width: 30px;
              font-size: 14px;
              margin-right: 10px;
              white-space: nowrap;
            }
            .value {
              flex: 1;
              font-size: 14px;
              line-height: 1.4;
            }
          }
        }
        .sign-section {
          margin-top: 15px;
          .sign-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            .sign-item {
              display: flex;
              align-items: center;
              width: 48%;
              .label {
                font-weight: bold;
                font-size: 14px;
                margin-right: 10px;
                white-space: nowrap;
              }
              .value {
                flex: 1;
                min-height: 30px;
                border-bottom: 1px solid #000;
                font-size: 14px;
              }
            }
          }
        }
        .footer-item {
          display: flex;
          margin-right: 20px;
@@ -1683,93 +1737,125 @@
      <div class="print-page">
        <div class="delivery-note">
          <div class="header">
            <div class="company-name">湖南鹏创电子有限公司</div>
            <div class="document-title">零售发货单</div>
              <div class="company-name">湖南鹏创电子有限公司</div>
              <div class="document-title">送货单</div>
          </div>
          <div class="info-section">
            <div class="info-row">
              <div>
                <span class="label">发货日期:</span>
                <span class="value">${formatDate(item.createTime)}</span>
              <div class="info-row">
                <div>
                  <span class="label">客户名称:</span>
                  <span class="value">${item.customerName || ''}</span>
                </div>
                <div>
                  <span class="label">送货地址:</span>
                  <span class="value">${item.companyAddress || ''}</span>
                </div>
              </div>
              <div>
                <span class="label">客户名称:</span>
                <span class="value">${item.customerName || '张爱有'}</span>
              </div>
            </div>
            <div class="info-row">
              <span class="label">单号:</span>
              <span class="value">${item.salesContractNo || ''}</span>
            </div>
          </div>
              <div class="info-row">
                <div>
                  <span class="label">单据编号:</span>
                  <span class="value">${item.salesContractNo || ''}</span>
                </div>
                <div>
                  <span class="label">送货日期:</span>
                  <span class="value">${ formatDate(null)}</span>
                </div>
                <div>
                  <span class="label">联系电话:</span>
                  <span class="value">${item.contactPhone || ''}</span>
                </div>
              </div>
            </div>
          <div class="info-section">
              <div class="info-row">
                <div>
                  <span class="label">联系方式:</span>
                  <span class="value"></span>
                </div>
                <div>
                  <span class="label">送货单位:</span>
                  <span class="value">湖南鹏创电子有限公司</span>
                </div>
                <div>
                  <span class="label">地址:</span>
                  <span class="value">湖南耒阳市创新创业园A1栋</span>
                </div>
              </div>
            </div>
          <span style="font-size: 16px;">货物详细信息:</span>
          <div class="table-section">
            <table class="product-table">
              <thead>
                <tr>
                  <th>产品名称</th>
                  <th>规格型号</th>
                  <th>序号</th>
                  <th>物料编号</th>
                  <th>品名/规格</th>
                  <th>单位</th>
                  <th>单价</th>
                  <th>零售数量</th>
                  <th>零售金额</th>
                  <th>数量</th>
                  <th>订单号</th>
                </tr>
              </thead>
              <tbody>
                  <tbody>
                ${item.products && item.products.length > 0 ?
            item.products.map(product => `
        item.products.map((product, index) => `
                    <tr>
                      <td>${product.productCategory || ''}</td>
                      <td>${product.specificationModel || ''}</td>
                      <td>${index + 1}</td>
                      <td>${product.materialCode || ''}</td>
                      <td>${product.productCategory || ''}/${product.specificationModel || ''}</td>
                      <td>${product.unit || ''}</td>
                      <td>${product.taxInclusiveUnitPrice || '0'}</td>
                      <td>${product.quantity || '0'}</td>
                      <td>${product.taxInclusiveTotalPrice || '0'}</td>
                      <td>${item.salesContractNo || ''}</td>
                    </tr>
                  `).join('') :
            '<tr><td colspan="6" style="text-align: center; color: #999;">暂无产品数据</td></tr>'
        }
        '<tr><td colspan="6" style="text-align: center; color: #999;">暂无产品数据</td></tr>'
    }
              </tbody>
              <tfoot>
                <tr>
                  <td></td>
                  <td class="label">合计</td>
                  <td class="total-value"></td>
                  <td class="total-value"></td>
                  <td class="total-value">${ getTotalQuantity(item.products) || '0'}</td>
                  <td class="total-value"></td>
                  <td class="total-value">${getTotalQuantityForPrint(item.products)}</td>
                  <td class="total-value">${getTotalAmountForPrint(item.products)}</td>
                </tr>
              </tfoot>
            </table>
            <div style="width: 30px;">
              共四联存根回单客户仓库
            </div>
          </div>
          <div class="footer-section">
            <div class="footer-row">
              <div class="footer-item">
                <span class="label">收货电话:</span>
                <span class="value"></span>
          <div class="remarks-section">
            <div class="remark-item">
              <span class="label">备注:</span>
              <span class="value">贵公司在收货后请即刻核实数量及品质,若有异议,请在3日内提出,否则视为收妥。</span>
            </div>
          </div>
          <div class="sign-section">
            <div class="sign-row">
              <div class="sign-item">
                <span class="label">送货单位(签章):</span>
              </div>
              <div class="footer-item">
                <span class="label">收货人:</span>
                <span class="value"></span>
              </div>
              <div class="footer-item address-item">
                <span class="label">收货地址:</span>
                <span class="value address-value"></span>
              <div class="sign-item">
                <span class="label">收货单位:</span>
              </div>
            </div>
            <div class="footer-row">
              <div class="footer-item">
                <span class="label">操作员:</span>
                <span class="value">${userStore.nickName || '撕开前'}</span>
            <div class="sign-row">
              <div class="sign-item">
                <span class="label">送货人:</span>
              </div>
              <div class="footer-item">
                <span class="label">打印日期:</span>
                <span class="value">${formatDateTime(new Date())}</span>
              <div class="sign-item">
                <span class="label">收货人:</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    `;