zhangwencui
4 小时以前 5f3dea3fd930afde720677fba10b6bfb2e836a18
src/views/erp/purchase/order/modules/item-form.vue
@@ -10,11 +10,10 @@
  erpPriceMultiply,
} from '@vben/utils';
import { Input, InputNumber, Select } from 'ant-design-vue';
import { Input, InputNumber, Select, Switch } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getItemPage } from '#/api/mdm/item';
import { getStockCount } from '#/api/erp/stock/stock';
import { useFormItemColumns } from '../data';
@@ -124,16 +123,15 @@
  const newRow = {
    id: undefined,
    productId: undefined,
    productUnitName: undefined, // 产品单位
    productBarCode: undefined, // 产品条码
    productUnitName: undefined,
    productPrice: undefined,
    stockCount: undefined,
    count: 1,
    totalProductPrice: undefined,
    taxPercent: 0,
    taxPrice: undefined,
    totalPrice: undefined,
    remark: undefined,
    qcCheckFlag: false,
  };
  tableData.value.push(newRow);
  // 通知父组件更新
@@ -159,10 +157,8 @@
  }
  row.productId = productId;
  row.productUnitId = product.unitMeasureId;
  row.productBarCode = product.barCode;
  row.productUnitName = product.unitMeasureName;
  row.productName = product.name;
  row.stockCount = (await getStockCount(productId)) || 0;
  row.productPrice = product.purchasePrice || 0;
  row.count = row.count || 1;
  handleRowChange(row);
@@ -261,6 +257,16 @@
      <Input v-if="!disabled" v-model:value="row.remark" class="w-full" />
      <span v-else>{{ row.remark || '-' }}</span>
    </template>
    <template #qcCheckFlag="{ row }">
      <Switch
        v-if="!disabled"
        v-model:checked="row.qcCheckFlag"
        checked-children="是"
        un-checked-children="否"
        @change="handleRowChange(row)"
      />
      <span v-else>{{ row.qcCheckFlag ? '是' : '否' }}</span>
    </template>
    <template #taxPercent="{ row }">
      <InputNumber
        v-if="!disabled"