gaoluyang
5 天以前 a0a35be4065d75b80ba4a9a51da7031e03166766
湟水峡
1.成品入库添加编辑功能
已修改3个文件
59 ■■■■ 文件已修改
src/views/collaborativeApproval/vehicleManagement/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/vehicleManagement/index.vue
@@ -82,10 +82,8 @@
        </template>
        <template #operation="{ row }">
          <el-button link type="primary" size="small" @click="openForm('edit', row)">编辑</el-button>
          <el-button link type="primary" size="small" v-if="row.usageStatus === '空闲'"
            @click="openUseForm(row)">用车</el-button>
          <el-button link type="primary" size="small" v-if="row.usageStatus === '使用中'"
            @click="openReturnForm(row)">还车</el-button>
          <el-button link type="primary" size="small" v-if="row.usageStatus === '空闲'" @click="openUseForm(row)">用车</el-button>
          <el-button link type="primary" size="small" v-if="row.usageStatus === '使用中'" @click="openReturnForm(row)">还车</el-button>
          <el-button link type="primary" size="small" @click="openUsageRecordsDialog(row)">使用记录</el-button>
        </template>
      </PIMTable>
src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
@@ -1,5 +1,5 @@
<template>
  <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增自定义入库' : '编辑自定义入库'" width="70%"
  <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增成品入库' : '编辑成品入库'" width="70%"
    @close="closeDia">
    <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
      <div style="margin-bottom: 10px;" v-if="operationType === 'add'">
@@ -17,38 +17,16 @@
          width="60"
        />
        <el-table-column label="产品大类" prop="productCategory" width="200">
          <template #default="scope">
            <el-input v-model="scope.row.productCategory" placeholder="请输入产品大类" />
          </template>
        </el-table-column>
        <el-table-column label="规格型号" prop="specificationModel" width="200">
          <template #default="scope">
            <el-input v-model="scope.row.specificationModel" placeholder="请输入规格型号" />
          </template>
        </el-table-column>
        <el-table-column label="单位" prop="unit" width="100">
          <template #default="scope">
            <el-input v-model="scope.row.unit" placeholder="请输入单位" />
          </template>
        </el-table-column>
        <el-table-column label="入库数量" prop="inboundNum" width="150">
          <template #default="scope">
            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
          </template>
        </el-table-column>
        <el-table-column label="入库日期" prop="inboundDate" width="180">
          <template #default="scope">
            <el-date-picker
              v-model="scope.row.inboundDate"
              type="date"
              placeholder="请选择入库日期"
              value-format="YYYY-MM-DD"
              format="YYYY-MM-DD"
              style="width: 100%"
            />
          </template>
        </el-table-column>
        <el-table-column label="单价(元)" prop="unitPrice" width="150">
        <el-table-column label="单价(元)" prop="unitPrice" width="210">
          <template #default="scope">
            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.unitPrice" @change="() => calculateTotalPrice(scope.row)" />
          </template>
@@ -58,11 +36,6 @@
           prop="totalPrice" 
           width="150" 
         >
        </el-table-column>
        <el-table-column label="操作" width="80" v-if="operationType === 'add'">
          <template #default="scope">
            <el-button type="danger" size="small" @click="removeProductRow(scope.$index)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-form>
@@ -91,6 +64,7 @@
const productList = ref([]);// 产品列表数据
const loadingProducts = ref(false);// 产品加载状态
const loading = ref(false);
const currentTabType = ref('');// 当前标签页类型 ('production' for 成品入库, etc.)
function formatDateTime(date = new Date(), includeTime = true) {
  const d = new Date(date);
@@ -225,7 +199,12 @@
    loading.value = true
    if (operationType.value === 'edit') {
      const editPayload = payloadList[0]
      await updateProduct(editPayload)
      // 如果是成品入库编辑,添加type: 3参数
      if (currentTabType.value === 'production') {
        await updateProduct({...editPayload, type: 3})
      } else {
        await updateProduct(editPayload)
      }
    } else {
      await addStockInCustom(payloadList)
    }
@@ -251,8 +230,9 @@
  emit('close')
}
const openDialog = async (type, row) => {
const openDialog = async (type, row, tabType) => {
  operationType.value = type
  currentTabType.value = tabType || '' // 存储标签页类型
  dialogFormVisible.value = true
  if (type === 'add') {
src/views/inventoryManagement/receiptManagement/index.vue
@@ -53,10 +53,7 @@
            <el-table-column label="入库时间"
                             prop="createTime"
                             show-overflow-tooltip/>
            <el-table-column label="销售合同号"
                             prop="salesContractNo"
                             width="180"
                             show-overflow-tooltip/>
            <el-table-column label="产品大类"
                             prop="productCategory"
                             show-overflow-tooltip/>
@@ -77,7 +74,7 @@
            <el-table-column label="总价(元)"
                             prop="totalPrice"
                             width="150"></el-table-column>
            <!-- <el-table-column fixed="right"
            <el-table-column fixed="right"
                             label="操作"
                             min-width="60"
                             align="center">
@@ -87,7 +84,7 @@
                           size="small"
                           @click="openForm('edit', scope.row, 'production');">编辑</el-button>
              </template>
            </el-table-column> -->
            </el-table-column>
          </el-table>
          <pagination v-show="total > 0"
                      :total="total"
@@ -361,7 +358,7 @@
  const currentTab = tabType || activeTab.value;
  await nextTick(() => {
    if (currentTab === "production") {
      formDiaProduct.value?.openDialog(type, row);
      formDiaProduct.value?.openDialog(type, row, currentTab);
    } else {
      formDia.value?.openDialog(type, row);
    }