yaowanxin
4 天以前 b02312bc17dcfd15f4852efc5145c3551e69b9aa
src/views/salesManagement/salesLedger/index.vue
@@ -45,16 +45,22 @@
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column type="expand">
          <template #default="props">
            <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable">
              <el-table-column align="center" label="序号" type="index" width="60" />
              <el-table-column label="产品大类" prop="productCategory" />
              <el-table-column label="规格型号" prop="specificationModel" />
              <el-table-column label="单位" prop="unit" />
              <el-table-column label="数量" prop="quantity" />
              <el-table-column label="税率(%)" prop="taxRate" />
              <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
            <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable" style="min-width: 1200px;"
                      scrollbar-always-on>
              <el-table-column align="center" label="序号" type="index" width="70" />
              <el-table-column label="产品大类" prop="productCategory" width="160" />
              <el-table-column label="规格型号" prop="specificationModel" width="220" />
              <el-table-column label="单位" prop="unit" width="100" />
              <el-table-column label="数量" prop="quantity" width="120" />
              <el-table-column label="税率(%)" prop="taxRate" width="120" />
              <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" width="160" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" width="180" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" width="180" />
<!--              <el-table-column fixed="right" label="操作" width="150" align="center">-->
<!--                <template #default="scope">-->
<!--                  <el-button link type="primary" size="small" @click="openDeliveryForm(props.row, scope.row)">发货</el-button>-->
<!--                </template>-->
<!--              </el-table-column>-->
            </el-table>
          </template>
        </el-table-column>
@@ -70,9 +76,9 @@
        <el-table-column label="录入人" prop="entryPersonName" width="100" show-overflow-tooltip />
        <el-table-column label="录入日期" prop="entryDate" width="120" show-overflow-tooltip />
        <el-table-column label="签订日期" prop="executionDate" width="120" show-overflow-tooltip />
        <el-table-column fixed="right" label="操作" min-width="200" align="center">
        <el-table-column fixed="right" label="操作" min-width="150" align="center">
          <template #default="scope">
            <el-button link type="primary" size="small" :disabled="scope.row.invoiceTotal>0 || scope.row.entryPersonName !== userStore.nickName" @click="openForm('edit', scope.row)">编辑</el-button>
            <el-button link type="primary" size="small" @click="openForm('edit', scope.row)">编辑</el-button>
<!--            <el-button link type="primary" size="small" @click="openForm('view', scope.row)">详情</el-button>-->
            <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">附件</el-button>
            <el-button link type="primary" size="small" @click="openDeliveryForm(scope.row)">发货</el-button>
@@ -459,7 +465,7 @@
import pagination from "@/components/PIMTable/Pagination.vue";
import {onMounted, ref} from "vue";
import { addShippingInfo } from "@/api/salesManagement/deliveryLedger.js";
import { ElMessageBox } from "element-plus";
import {ElMessage, ElMessageBox} from "element-plus";
import useUserStore from "@/store/modules/user";
import { userListNoPage } from "@/api/system/user.js";
import FileList from "./fileList.vue";
@@ -472,11 +478,15 @@
  delLedger,
  addOrUpdateSalesLedgerProduct,
  delProduct,
  delLedgerFile,
  delLedgerFile, getProductInventory,
} from "@/api/salesManagement/salesLedger.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
import dayjs from "dayjs";
import {
  getStockInPage
} from "@/api/inventoryManagement/stockIn.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
@@ -588,7 +598,7 @@
// 发货相关
const deliveryFormVisible = ref(false);
const currentDeliveryRow = ref(null);
const currentDeliveryContext = ref(null);
const deliveryFormData = reactive({
  deliveryForm: {
    shippingDate: "",
@@ -1524,12 +1534,16 @@
// 打开发货弹框
const openDeliveryForm = (row) => {
  currentDeliveryRow.value = row;
  deliveryForm.value = {
    shippingDate: getCurrentDate(),
    shippingCarNumber: "",
  };
  deliveryFormVisible.value = true;
  getProductInventory({ salesLedgerId: row.id, type:1 }).then((res) => {
    currentDeliveryRow.value = row;
    deliveryForm.value = {
      shippingDate: getCurrentDate(),
      shippingCarNumber: "",
    };
    deliveryFormVisible.value = true;
  }).catch(err => {
    ElMessage.error(err.msg);
  });
};
// 提交发货表单
@@ -1537,14 +1551,14 @@
  proxy.$refs["deliveryFormRef"].validate((valid) => {
    if (valid) {
      addShippingInfo({
        salesLedgerId: currentDeliveryRow.value.id,
        salesLedgerId: currentDeliveryContext.value.parentRow.id,
        salesLedgerProductId: currentDeliveryContext.value.productRow.id,
        shippingDate: deliveryForm.value.shippingDate,
        shippingCarNumber: deliveryForm.value.shippingCarNumber,
      })
        .then(() => {
          proxy.$modal.msgSuccess("发货成功");
          closeDeliveryDia();
          getList();
        })
        .catch(() => {
          proxy.$modal.msgError("发货失败,请重试");
@@ -1557,7 +1571,7 @@
const closeDeliveryDia = () => {
  proxy.resetForm("deliveryFormRef");
  deliveryFormVisible.value = false;
  currentDeliveryRow.value = null;
  currentDeliveryContext.value = null;
};
onMounted(() => {