src/views/inventoryManagement/receiptManagement/Record.vue
@@ -47,81 +47,98 @@
                :expand-row-keys="expandedRowKeys"
                :row-key="row => row.id"
                style="width: 100%"
                height="calc(100vh - 18.5em)">
                height="calc(100vh - 18.5em)"
                :fit="true">
        <el-table-column align="center"
                         type="selection"
                         width="55"/>
                         min-width="55"
                         fixed="left"/>
        <el-table-column align="center"
                         label="序号"
                         type="index"
                         width="60"/>
                         min-width="60"
                         fixed="left"/>
        <el-table-column label="产品类型"
                         prop="productType"
                         width="100"
                         prop="parentName"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="入库批次"
                         prop="inboundBatches"
                         width="280"
                         show-overflow-tooltip/>
        <el-table-column label="入库时间"
                         prop="createTime"
                         show-overflow-tooltip/>
        <el-table-column label="产品大类"
                         prop="productName"
                         show-overflow-tooltip/>
        <el-table-column label="规格型号"
                         prop="model"
                         show-overflow-tooltip/>
        <el-table-column label="单位"
                         prop="unit"
                         show-overflow-tooltip/>
        <!-- <el-table-column label="入库数量"
                         prop="stockInNum"
                         show-overflow-tooltip/> -->
        <el-table-column label="车牌号"
                         prop="licensePlateNo"
                         v-if="type === '0'"
                         min-width="120"
                         show-overflow-tooltip/>
        <el-table-column label="产品名称"
                         prop="productName"
                         min-width="120"
                         show-overflow-tooltip/>
        <el-table-column label="规格型号"
                         prop="model"
                         min-width="150"
                         show-overflow-tooltip/>
        <el-table-column label="入库数量"
                         prop="stockInNum"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="毛重"
                         prop="grossWeight"
                         v-if="type === '0'"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="皮重"
                         prop="tareWeight"
                         v-if="type === '0'"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="净重"
                         prop="netWeight"
                         v-if="type === '0'"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="单位"
                         prop="unit"
                         min-width="80"
                         show-overflow-tooltip/>
        <el-table-column label="过磅日期"
                         prop="weighingDate"
                         v-if="type === '0'"
                         min-width="160"
                         show-overflow-tooltip/>
        <el-table-column label="过磅员"
                         prop="weighingOperator"
                         v-if="type === '0'"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="入库人"
                         prop="createBy"
                         min-width="100"
                         show-overflow-tooltip/>
        <el-table-column label="入库时间"
                         prop="createTime"
                         min-width="160"
                         show-overflow-tooltip/>
        <el-table-column label="入库批次"
                         prop="inboundBatches"
                         min-width="150"
                         show-overflow-tooltip/>
        <el-table-column label="来源"
                         prop="recordType"
                         min-width="100"
                         show-overflow-tooltip>
          <template #default="scope">
            {{ getRecordType(scope.row.recordType) }}
          </template>
        </el-table-column>
        <el-table-column label="过磅日期"
                         prop="weighingDate"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="过磅员"
                         prop="weighingOperator"
                         v-if="type === '0'"
                         show-overflow-tooltip/>
        <el-table-column label="操作"
                         width="260"
                         align="center">
                         min-width="200"
                         align="center"
                         fixed="right">
          <template #default="scope">
            <el-button v-if="scope.row.recordType === '0' && hasReceiptEdit"
              type="primary"
              size="mini"
              @click="handleEdit(scope.row)"
            >编辑</el-button>
            <el-button v-if="scope.row.recordType === '0'"
            <el-button v-if="scope.row.recordType === '0' && scope.row.parentName === '原材料'"
                       type="primary"
                       size="mini"
                       @click="handlePreview(scope.row)">导出过磅单</el-button>
@@ -135,24 +152,25 @@
        @close="closeEditModal"
      >
        <el-form label-width="140px" :model="editForm" label-position="top" ref="editFormRef">
          <!-- <el-form-item
            label="入库数量"
            prop="stockInNum"
          >
            <el-input-number
              v-model="editForm.stockInNum"
              :min="0"
              :step="1"
              :precision="0"
              controls-position="right"
              style="width: 100%"
              disabled
            />
          </el-form-item> -->
          <!-- 原材料显示入库数量 -->
          <template v-if="editForm.parentName !== '原材料'">
            <el-form-item
              label="入库数量"
              prop="stockInNum"
            >
              <el-input-number
                v-model="editForm.stockInNum"
                :min="0"
                :step="1"
                :precision="0"
                controls-position="right"
                style="width: 100%"
              />
            </el-form-item>
          </template>
          <template v-if="type === '0'">
          <!-- 非原材料显示过磅相关字段 -->
          <template v-if="type === '0' && editForm.parentName === '原材料'">
            <el-form-item
              label="车牌号"
              prop="licensePlateNo"
@@ -409,7 +427,12 @@
const handleEditSubmit = () => {
  editFormRef.value?.validate?.((valid) => {
    if (!valid) return;
    editStockInStock(editForm.value).then(() => {
    const submitData = {
      ...editForm.value,
      productType: editForm.value.parentName === '原材料' ? 0 : 1,
      netWeight: editForm.value.parentName === '原材料' ? editForm.value.netWeight : editForm.value.stockInNum
    };
    editStockInStock(submitData).then(() => {
      closeEditModal();
      proxy.$modal.msgSuccess("编辑成功");
      getList();