lishenao
2025-07-01 a686251b73f616532d6a9518faad49c7693a6e1c
src/views/inventoryManagement/issueManagement/index.vue
@@ -3,7 +3,7 @@
    <div class="search_form">
      <div>
        <span class="search_title">供应商名称:</span>
        <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请输入" @change="handleQuery"
        <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="请输入" @change="handleQuery"
          clearable prefix-icon="Search" />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
      </div>
@@ -19,18 +19,18 @@
        :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="customerContractNo" width="160" 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="160" show-overflow-tooltip />
        <el-table-column label="单位" prop="contractAmount" width="70" show-overflow-tooltip />
        <el-table-column label="入库数量" prop="entryPersonName" width="90" 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="80" 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 label="入库时间" prop="inboundTime" width="100" show-overflow-tooltip />
        <el-table-column label="入库批次" prop="inboundBatch" width="160" show-overflow-tooltip />
        <el-table-column label="供应商名称" prop="supplierName" width="160" show-overflow-tooltip />
        <el-table-column label="产品大类" prop="productCategory" width="100" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="specificationModel" width="160" show-overflow-tooltip />
        <el-table-column label="单位" prop="unit" width="70" show-overflow-tooltip />
        <el-table-column label="入库数量" prop="inboundQuantity" width="90" show-overflow-tooltip />
        <el-table-column label="含税单价" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
        <el-table-column label="含税总价" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="税率(%)" prop="taxRate" width="80" show-overflow-tooltip />
        <el-table-column label="不含税总价" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
        <el-table-column label="入库人" prop="nickname" 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(scope.row);">出库</el-button>
@@ -40,7 +40,7 @@
      <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="'新增出库'" width="70%" @close="closeDia">
    <el-dialog v-model="dialogFormVisible" :title="'新增出库'" width="40%" @close="closeDia">
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
        <el-form-item label="出库数量:" prop="salesContractNo">
          <el-input v-model="form.salesContractNo" placeholder="请输入" clearable />
@@ -77,6 +77,13 @@
  addOrUpdateSalesLedger,
  getSalesLedgerWithProducts, delLedger
} from "@/api/salesManagement/salesLedger.js";
import {
  getStockOutPage,
  addStockOut,
  updateStockOut,
  delStockOut,
  exportStockOut
} from "@/api/inventoryManagement/stockOut.js";
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const tableData = ref([])
@@ -93,11 +100,10 @@
const fileList = ref([])
// 用户信息表单弹框数据
const operationType = ref('')
const dialogFormVisible = ref(false)
const data = reactive({
  searchForm: {
    customerName: '',
    supplierName: '',
  },
  form: {
    salesContractNo: '',
@@ -136,9 +142,9 @@
}
const getList = () => {
  tableLoading.value = true
  ledgerListPage({ ...searchForm.value, ...page }).then(res => {
  getStockOutPage({ ...searchForm.value, ...page }).then(res => {
    tableLoading.value = false
    tableData.value = res.records
    tableData.value = res.data.records
    tableData.value.map(item => {
      item.children = []
    })
@@ -177,32 +183,31 @@
// 打开弹框
const openForm = async (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') {
    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
    })
  }
  // 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
  //   })
  // }
  // let userAll = await userStore.getInfo()
  // userList.value.forEach(element => {
  //   if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) {
  //     form.value.entryPerson = userAll.user.userId // 设置默认业务员为当前用户
  //   }
  // });
  form.value.entryDate = getCurrentDate() // 设置默认录入日期为当前日期
  // form.value.entryDate = getCurrentDate() // 设置默认录入日期为当前日期
  dialogFormVisible.value = true
}