曹睿
6 天以前 8a9cd5221a7ac6d00cb259e395bda003ae42ca57
fix: 修复部分
已修改3个文件
已添加1个文件
548 ■■■■■ 文件已修改
src/api/procurementManagement/taxComparison.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue 486 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/reportAnalysis/taxComparison/index.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/invoiceRegistration/index.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/procurementManagement/taxComparison.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
import request from "@/utils/request";
// åˆ†é¡µæŸ¥è¯¢
export function getTaxList(query) {
  return request({
    url: "/purchase/report/listVat",
    method: "get",
    params: query,
  });
}
src/views/inventoryManagement/dispatchLog/index.vue
@@ -3,9 +3,17 @@
    <div class="search_form">
      <div>
        <span class="search_title">供应商名称:</span>
        <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请输入" @change="handleQuery"
          clearable prefix-icon="Search" />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
        <el-input
          v-model="searchForm.customerName"
          style="width: 240px"
          placeholder="请输入"
          @change="handleQuery"
          clearable
          prefix-icon="Search"
        />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
          >搜索</el-button
        >
      </div>
      <div>
        <el-button type="primary" @click="openForm('add')">新增</el-button>
@@ -14,45 +22,144 @@
      </div>
    </div>
    <div class="table_list">
      <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
        :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%"
        :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
      <el-table
        :data="tableData"
        border
        v-loading="tableLoading"
        @selection-change="handleSelectionChange"
        :expand-row-keys="expandedRowKeys"
        :row-key="(row) => row.id"
        show-summary
        style="width: 100%"
        :summary-method="summarizeMainTable"
        height="calc(100vh - 18.5em)"
      >
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column label="出库日期" prop="salesContractNo" width="100" show-overflow-tooltip />
        <el-table-column label="供应商名称" prop="customerName" width="160" show-overflow-tooltip />
        <el-table-column label="产品大类" prop="salesman" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="projectName" width="100" show-overflow-tooltip />
        <el-table-column label="单位" prop="contractAmount" width="80" show-overflow-tooltip />
        <el-table-column label="出库数量" prop="entryPersonName" width="100" show-overflow-tooltip />
        <el-table-column label="含税单价" prop="entryDate" width="100" show-overflow-tooltip />
        <el-table-column label="含税总价" prop="executionDate" width="100" show-overflow-tooltip />
        <el-table-column label="税率" prop="executionDate" width="100" show-overflow-tooltip />
        <el-table-column label="不含税总价" prop="executionDate" width="100" show-overflow-tooltip />
        <el-table-column label="出库人" prop="executionDate" width="80" show-overflow-tooltip />
        <el-table-column fixed="right" label="操作" min-width="60" align="center">
        <el-table-column
          label="出库日期"
          prop="salesContractNo"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="供应商名称"
          prop="customerName"
          width="160"
          show-overflow-tooltip
        />
        <el-table-column
          label="产品大类"
          prop="salesman"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="规格型号"
          prop="projectName"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="单位"
          prop="contractAmount"
          width="80"
          show-overflow-tooltip
        />
        <el-table-column
          label="出库数量"
          prop="entryPersonName"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="含税单价"
          prop="entryDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="含税总价"
          prop="executionDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="税率"
          prop="executionDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="不含税总价"
          prop="executionDate"
          width="100"
          show-overflow-tooltip
        />
        <el-table-column
          label="出库人"
          prop="executionDate"
          width="80"
          show-overflow-tooltip
        />
        <el-table-column
          fixed="right"
          label="操作"
          min-width="60"
          align="center"
        >
          <template #default="scope">
            <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">编辑</el-button>
            <el-button
              link
              type="primary"
              size="small"
              @click="openForm('edit', scope.row)"
              >编辑</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
        :page="page.current" :limit="page.size" @pagination="paginationChange" />
      <pagination
        v-show="total > 0"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        :page="page.current"
        :limit="page.size"
        @pagination="paginationChange"
      />
    </div>
    <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">
    <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"
      >
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="供应商名称:" prop="salesContractNo">
              <el-input v-model="form.salesContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.salesContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品大类:" prop="salesman">
              <el-select v-model="form.salesman" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                  :value="item.nickName" />
                <el-option
                  v-for="item in userList"
                  :key="item.nickName"
                  :label="item.nickName"
                  :value="item.nickName"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -60,60 +167,101 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="规格型号:" prop="customerContractNo">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单位:" prop="customerId">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="出库时间:" prop="projectName">
              <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
                type="date" placeholder="请选择" clearable />
              <el-date-picker
                style="width: 100%"
                v-model="form.entryDate"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                type="date"
                placeholder="请选择"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出库数量:" prop="customerContractNo">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="含税单价:" prop="customerId">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="含税总价:" prop="customerContractNo">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="税率:" prop="customerId">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不含税总价:" prop="entryDate">
              <el-input v-model="form.customerContractNo" placeholder="请输入" clearable />
              <el-input
                v-model="form.customerContractNo"
                placeholder="请输入"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="出库人:" prop="entryPerson">
              <el-select v-model="form.entryPerson" placeholder="请选择" clearable>
                <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
              <el-select
                v-model="form.entryPerson"
                placeholder="请选择"
                clearable
              >
                <el-option
                  v-for="item in userList"
                  :key="item.userId"
                  :label="item.nickName"
                  :value="item.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
@@ -130,87 +278,92 @@
</template>
<script setup>
import pagination from '@/components/PIMTable/Pagination.vue'
import { ref } from 'vue'
import pagination from "@/components/PIMTable/Pagination.vue";
import { ref } from "vue";
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import useUserStore from "@/store/modules/user";
import { userListNoPage } from "@/api/system/user.js";
import {
  ledgerListPage,
  customerList,
  addOrUpdateSalesLedger,
  getSalesLedgerWithProducts, delLedger
  getSalesLedgerWithProducts,
  delLedger,
} from "@/api/salesManagement/salesLedger.js";
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const tableData = ref([])
const productData = ref([])
const selectedRows = ref([])
const userList = ref([])
const customerOption = ref([])
const tableLoading = ref(false)
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const productData = ref([]);
const selectedRows = ref([]);
const userList = ref([]);
const customerOption = ref([]);
const tableLoading = ref(false);
const page = reactive({
  current: 1,
  size: 100,
})
const total = ref(0)
const fileList = ref([])
});
const total = ref(0);
const fileList = ref([]);
// ç”¨æˆ·ä¿¡æ¯è¡¨å•弹框数据
const operationType = ref('')
const dialogFormVisible = ref(false)
const operationType = ref("");
const dialogFormVisible = ref(false);
const data = reactive({
  searchForm: {
    customerName: '',
    customerName: "",
  },
  form: {
    salesContractNo: '',
    salesman: '',
    customerContractNo: '',
    customerId: '',
    projectName: '',
    entryPerson: '',
    entryDate: '',
    maintenanceTime: '',
    salesContractNo: "",
    salesman: "",
    customerContractNo: "",
    customerId: "",
    projectName: "",
    entryPerson: "",
    entryDate: "",
    maintenanceTime: "",
    productData: [],
    executionDate: ''
    executionDate: "",
  },
  rules: {
    salesman: [{ required: true, message: "请选择", trigger: "change" }],
    customerContractNo: [{ required: true, message: "请输入", trigger: "blur" }],
    customerContractNo: [
      { required: true, message: "请输入", trigger: "blur" },
    ],
    customerId: [{ required: true, message: "请选择", trigger: "change" }],
    projectName: [{ required: true, message: "请输入", trigger: "blur" }],
    entryPerson: [{ required: true, message: "请选择", trigger: "change" }],
    entryDate: [{ required: true, message: "请选择", trigger: "change" }],
    executionDate: [{ required: true, message: "请选择", trigger: "change" }],
  }
})
const { searchForm, form, rules } = toRefs(data)
  },
});
const { searchForm, form, rules } = toRefs(data);
// æŸ¥è¯¢åˆ—表
/** æœç´¢æŒ‰é’®æ“ä½œ */
const handleQuery = () => {
  page.current = 1
  getList()
}
  page.current = 1;
  getList();
};
const paginationChange = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
  getList()
}
  getList();
};
const getList = () => {
  tableLoading.value = true
  ledgerListPage({ ...searchForm.value, ...page }).then(res => {
    tableLoading.value = false
    tableData.value = res.records
    tableData.value.map(item => {
      item.children = []
  tableLoading.value = true;
  ledgerListPage({ ...searchForm.value, ...page })
    .then((res) => {
      tableLoading.value = false;
      tableData.value = res.records;
      tableData.value.map((item) => {
        item.children = [];
      });
      total.value = res.total;
    })
    total.value = res.total
  }).catch(() => {
    tableLoading.value = false
  })
}
    .catch(() => {
      tableLoading.value = false;
    });
};
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
@@ -227,38 +380,41 @@
};
// è¡¨æ ¼é€‰æ‹©æ•°æ®
const handleSelectionChange = (selection) => {
  // è¿‡æ»¤æŽ‰å­æ•°æ®
  selectedRows.value = selection.filter(item => item.children !== undefined);
  console.log('selection', selectedRows.value)
}
const expandedRowKeys = ref([])
  selectedRows.value = selection.filter((item) => item.children !== undefined);
  console.log("selection", selectedRows.value);
};
const expandedRowKeys = ref([]);
// ä¸»è¡¨åˆè®¡æ–¹æ³•
const summarizeMainTable = (param) => {
  return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']);
  return proxy.summarizeTable(param, [
    "contractAmount",
    "taxInclusiveTotalPrice",
    "taxExclusiveTotalPrice",
  ]);
};
// æ‰“开弹框
const openForm = async (type, row) => {
  operationType.value = type
  form.value = {}
  productData.value = []
  let userLists = await userListNoPage()
  userList.value = userLists.data
  customerList().then(res => {
    customerOption.value = res
  })
  console.log('userStore.id', userStore.id)
  form.value.entryPerson = userStore.id
  if (type === 'edit') {
  operationType.value = type;
  form.value = {};
  productData.value = [];
  let userLists = await userListNoPage();
  userList.value = userLists.data;
  customerList().then((res) => {
    customerOption.value = res;
  });
  console.log("userStore.id", userStore.id);
  form.value.entryPerson = userStore.id;
  if (type === "edit") {
    currentId.value = row.id;
    getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => {
      form.value = { ...res }
      form.value.entryPerson = Number(res.entryPerson)
      productData.value = form.value.productData
      fileList.value = form.value.salesLedgerFiles
    })
    getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => {
      form.value = { ...res };
      form.value.entryPerson = Number(res.entryPerson);
      productData.value = form.value.productData;
      fileList.value = form.value.salesLedgerFiles;
    });
  }
  // let userAll = await userStore.getInfo()
  // userList.value.forEach(element => {
@@ -266,91 +422,89 @@
  //     form.value.entryPerson = userAll.user.userId // è®¾ç½®é»˜è®¤ä¸šåŠ¡å‘˜ä¸ºå½“å‰ç”¨æˆ·
  //   }
  // });
  form.value.entryDate = getCurrentDate() // è®¾ç½®é»˜è®¤å½•入日期为当前日期
  dialogFormVisible.value = true
}
  form.value.entryDate = getCurrentDate(); // è®¾ç½®é»˜è®¤å½•入日期为当前日期
  dialogFormVisible.value = true;
};
// æäº¤è¡¨å•
const submitForm = () => {
  proxy.$refs["formRef"].validate(valid => {
  proxy.$refs["formRef"].validate((valid) => {
    if (valid) {
      if (productData.value.length > 0) {
        form.value.productData = proxy.HaveJson(productData.value)
        form.value.productData = proxy.HaveJson(productData.value);
      } else {
        proxy.$modal.msgWarning('请添加产品信息')
        return
        proxy.$modal.msgWarning("请添加产品信息");
        return;
      }
      let tempFileIds = []
      let tempFileIds = [];
      if (fileList.value.length > 0) {
        tempFileIds = fileList.value.map(item => item.tempId)
        tempFileIds = fileList.value.map((item) => item.tempId);
      }
      form.value.tempFileIds = tempFileIds
      form.value.type = 1
      addOrUpdateSalesLedger(form.value).then(res => {
        proxy.$modal.msgSuccess("提交成功")
        closeDia()
        getList()
      })
      form.value.tempFileIds = tempFileIds;
      form.value.type = 1;
      addOrUpdateSalesLedger(form.value).then((res) => {
        proxy.$modal.msgSuccess("提交成功");
        closeDia();
        getList();
      });
    }
  })
}
  });
};
// å…³é—­å¼¹æ¡†
const closeDia = () => {
  proxy.resetForm("formRef")
  dialogFormVisible.value = false
}
  proxy.resetForm("formRef");
  dialogFormVisible.value = false;
};
// å¯¼å‡º
const handleOut = () => {
  ElMessageBox.confirm(
    '选中的内容将被导出,是否确认导出?',
    '导出', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning',
  }
  ).then(() => {
    proxy.download("/sales/ledger/export", {}, '出库台账.xlsx')
  }).catch(() => {
    proxy.$modal.msg("已取消")
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
}
    .then(() => {
      proxy.download("/sales/ledger/export", {}, "出库台账.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
// åˆ é™¤
const handleDelete = () => {
  let ids = []
  let ids = [];
  if (selectedRows.value.length > 0) {
    ids = selectedRows.value.map(item => item.id);
    ids = selectedRows.value.map((item) => item.id);
  } else {
    proxy.$modal.msgWarning('请选择数据')
    return
    proxy.$modal.msgWarning("请选择数据");
    return;
  }
  ElMessageBox.confirm(
    '选中的内容将被删除,是否确认删除?',
    '导出', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning',
  }
  ).then(() => {
    delLedger(ids).then(res => {
      proxy.$modal.msgSuccess("删除成功")
      getList()
  ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
    })
  }).catch(() => {
    proxy.$modal.msg("已取消")
    .then(() => {
      delLedger(ids).then((res) => {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      });
  })
}
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
// èŽ·å–å½“å‰æ—¥æœŸå¹¶æ ¼å¼åŒ–ä¸º YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0'); // æœˆä»½ä»Ž0开始
  const day = String(today.getDate()).padStart(2, '0');
  const month = String(today.getMonth() + 1).padStart(2, "0"); // æœˆä»½ä»Ž0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
onMounted(() => {
  getList()
})
  getList();
});
</script>
<style scoped lang="scss"></style>
src/views/procurementManagement/reportAnalysis/taxComparison/index.vue
@@ -5,11 +5,10 @@
        <el-date-picker
          style="width: 240px"
          v-model="filters.dateRange"
          value-format="YYYY-MM-DD"
          format="YYYY-MM-DD"
          type="daterange"
          start-placeholder="开始时间"
          end-placeholder="结束时间"
          value-format="YYYY-MM"
          format="YYYY-MM"
          type="month"
          placeholder="选择月份"
          clearable
          @change="getTableData"
        />
@@ -37,6 +36,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { onMounted } from "vue";
import { getTaxList } from "@/api/procurementManagement/taxComparison";
defineOptions({
  name: "增值税比对",
@@ -52,31 +52,33 @@
  resetFilters,
  onCurrentChange,
} = usePaginationApi(
  () => {},
  getTaxList,
  {
    dateRange: [], // æ¥ç¥¨æ—¥æœŸ
  },
  [
    {
      label: "月份",
      prop: "month",
      align: "center",
    },
    {
      label: "销项税额",
      prop: "jtaxAmount",
      align: "center",
    },
    {
      label: "进项税额",
      prop: "xtaxAmount",
      align: "center",
    },
    {
      label: "销-进",
      prop: "taxAmount",
      align: "center",
    },
  ],
  {},
  {
    dateRange: (aim) => ({
      dateRangeStart: aim[0],
      dateRangeEnd: aim[1],
    }),
  }
  {}
);
onMounted(() => {
src/views/salesManagement/invoiceRegistration/index.vue
@@ -246,8 +246,6 @@
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="发票号码:" prop="invoiceNo">
              <el-input
@@ -347,6 +345,24 @@
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column label="登记人" prop="register">
            <template #default="{ row }">
              <el-input v-model="row.register" placeholder="请输入登记人" />
            </template>
          </el-table-column>
          <el-table-column label="登记日期" prop="registerDate">
            <template #default="{ row }">
              <el-date-picker
                style="width: 100%"
                v-model="row.registerDate"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                type="date"
                placeholder="请选择"
                clearable
              />
            </template>
          </el-table-column>
        </el-table>
      </el-form>
      <template #footer>
@@ -372,8 +388,10 @@
} from "@/api/salesManagement/salesLedger.js";
import { invoiceRegistrationSave } from "@/api/salesManagement/invoiceRegistration.js";
import useFormData from "@/hooks/useFormData";
import useUserStore from "@/store/modules/user";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const tableData = ref([]);
const productData = ref([]);
const selectedRows = ref([]);
@@ -392,7 +410,7 @@
    status: false,
    customerContractNo: undefined, // å®¢æˆ·åˆåŒå·
    projectName: undefined, // é¡¹ç›®åç§°
    createUer: undefined, // å½•入人
    createUer: undefined, // ç™»è®°äºº
    issueDate: undefined, // å¼€ç¥¨æ—¥æœŸ
    createTime: undefined, // å½•入日期:
  },