gaoluyang
6 天以前 e359d2ea235e208c2e0df15100c153d379721473
src/views/salesOutbound/index.vue
@@ -1,34 +1,21 @@
<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item label="搜索">
        <el-input
            v-model="queryParams.searchText"
            placeholder="请输入关键词"
            clearable
            :style="{ width: '100%' }"
        />
      <el-form-item label="销售日期">
            <el-date-picker
               v-model="queryParams.saleDate"
               type="date"
               value-format="YYYY-MM-DD"
               format="YYYY-MM-DD"
               clearable
               style="width: 100%"
               placeholder="请选择日期"
            />
      </el-form-item>
      <el-form-item label="供应商名称">
      <el-form-item label="煤种">
        <el-input
            v-model="queryParams.supplierName"
            placeholder="请输入"
            clearable
            :style="{ width: '100%' }"
        />
      </el-form-item>
      <el-form-item label="统一人识别号">
        <el-input
            v-model="queryParams.identifyNumber"
            placeholder="请输入"
            clearable
            :style="{ width: '100%' }"
        />
      </el-form-item>
      <el-form-item label="经营地址">
        <el-input
            v-model="queryParams.address"
            placeholder="请输入"
            v-model="queryParams.coal"
            placeholder="请输入煤种"
            clearable
            :style="{ width: '100%' }"
        />
@@ -50,9 +37,9 @@
      </el-tabs>
      <!-- 操作按钮区 -->
      <el-space>
        <el-button type="primary" :icon="Plus" @click="openDia('add')">新建</el-button>
        <el-button type="primary" :icon="Plus" @click="openDia(undefined, 'add')">新建</el-button>
        <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
        <el-button type="info" plain :icon="Download" @click="handleExport">导出</el-button>
        <!-- <el-button type="info" plain :icon="Download" @click="handleExport">导出</el-button> -->
      </el-space>
      <!-- 表格组件 -->
      <div>
@@ -62,15 +49,18 @@
                @selection-change="handleSelectionChange"
                :show-selection="true"
                :border="true"
                :maxHeight="480"
                @edit="openDia"></ETable>
                :operations="operationsArr"
                style="width: 100%;height: calc(100vh - 30em)"
                @edit="(row) => openDia(row, 'edit')"
                @viewRow="(row) => openDia(row, 'view')"
        ></ETable>
      </div>
      <pagination
          v-if="total>0"
          :page-num="pageNum"
          :page-size="pageSize"
          :page="pageNum"
          :limit="pageSize"
          :total="total"
          @pagination="handleQuery"
          @pagination="handlePagination"
          :layout="'total, prev, pager, next, jumper'"
      />
    </el-card>
@@ -85,7 +75,7 @@
import ETable from "@/components/Table/ETable.vue";
import Pagination from "@/components/Pagination/index.vue";
import FormDia from "@/views/salesOutbound/components/formDia.vue";
import {salesRecordList} from "../../api/salesOutbound/index.js";
import {delSalesRecord, salesRecordList} from "@/api/salesOutbound/index.js";
const formDia = ref()
const activeTab = ref("out");
@@ -94,6 +84,7 @@
  { name: "out", label: "销售出库" },
]);
// 表格数据
const operationsArr = ref(['edit', 'viewRow']);
const tableLoading = ref(false);
const tableData = ref([]);
const columns = ref([
@@ -106,6 +97,7 @@
  { prop: "saleQuantity", label: "销售数量", minWidth: 120 },
  { prop: "salePrice", label: "销售单价(含税)", minWidth: 150 },
  { prop: "totalAmount", label: "销售总价(含税)", minWidth: 120 },
  { prop: "freight", label: "运费", minWidth: 90 },
  { prop: "taxCoal", label: "购销煤税率(%)", minWidth: 120 },
  { prop: "taxTrans", label: "运输税率(%)", minWidth: 120 },
  { prop: "grossProfit", label: "毛利润", minWidth: 90 },
@@ -119,10 +111,8 @@
const pageSize = ref(10);
// 查询参数
const queryParams = reactive({
  searchText: "",
  supplierName: "",
  identifyNumber: "",
  address: "",
   saleDate: "",
   coal: "",
})
onMounted(() => {
  handleQuery()
@@ -150,15 +140,32 @@
  });
  handleQuery();
};
// 分页处理
const handlePagination = (val) => {
   pageNum.value = val.page;
   pageSize.value = val.limit;
   getList();
};
// 新增出库
const openDia = (type, row) => {
const openDia = (row, type) => {
  console.log(row)
  nextTick(() => {
    formDia.value?.openDialog(type, row)
  })
};
// 删除出库
const handleDelete = () => {
  if (selectedRows.value.length === 0) {
    proxy.$modal.msgWarning("请选择要删除的数据");
    return;
  }
  const deleteIds = selectedRows.value.map(item => item.id);
  proxy.$modal.confirm('是否确认删除所选数据项?').then(function() {
    return delSalesRecord(deleteIds)
  }).then(() => {
    handleQuery()
    proxy.$modal.msgSuccess("删除成功")
  }).catch(() => {})
};
// 导出出库
const handleExport = () => {