周宾
4 小时以前 cc70c20d119327faad948216963ac1b4c964be60
天津双奇点-仓储物流相关问题修复
已修改4个文件
368 ■■■■ 文件已修改
src/views/inventoryManagement/dispatchLog/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/index.vue 355 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue
@@ -675,7 +675,7 @@
      <div class="print-page">
        <div class="delivery-note">
          <div class="header">
            <div class="company-name">鼎诚瑞实业有限责任公司</div>
            <div class="company-name">双奇点有限责任公司</div>
            <div class="document-title">零售发货单</div>
          </div>
          
src/views/inventoryManagement/receiptManagement/index.vue
@@ -169,8 +169,8 @@
            <el-table-column fixed="right" label="操作" width="100" align="center">
              <template #default="scope">
                <el-button link type="primary" size="small" @click="openForm('edit', scope.row, 'manual');">编辑</el-button>
                <el-button link type="success" size="small" @click="showQRCode(scope.row,2)">生成条形码</el-button>
                <el-button link type="success" size="small" @click="showERCode(scope.row,2)">生成二维码</el-button>
                <!-- <el-button link type="success" size="small" @click="showQRCode(scope.row,2)">生成条形码</el-button>
                <el-button link type="success" size="small" @click="showERCode(scope.row,2)">生成二维码</el-button> -->
              </template>
            </el-table-column>
          </el-table>
@@ -588,7 +588,7 @@
const scanBarcodeInput = ref('');
const barcodeDetail = ref({})
// 扫码函数
const scanBarcode = (e) => {
function scanBarcode (e){
  if(!e||!e.target||!e.target.tagName){
    return;
  }
@@ -639,6 +639,7 @@
onMounted(() => {
  // 添加扫码枪监听事件
  document.removeEventListener('keypress',scanBarcode)
  document.addEventListener('keypress', scanBarcode)
  getList()
})
src/views/inventoryManagement/stockManagement/index.vue
@@ -47,121 +47,95 @@
              <template #default="scope">
                <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" />
        </div>
      </el-tab-pane> -->
</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" />
</div>
</el-tab-pane> -->
     <el-tab-pane label="采购库存" name="purchase">
       <div class="search_form">
         <div>
           <span class="search_title ml10">入库日期:</span>
           <el-date-picker
             v-model="searchForm.timeStr"
             type="date"
             placeholder="请选择日期"
             value-format="YYYY-MM-DD"
             format="YYYY-MM-DD"
             clearable
             @change="handleQuery"
           />
                            <span class="search_title ml10">产品大类:</span>
                            <el-input
                                v-model="searchForm.productCategory"
                                style="width: 240px"
                                placeholder="请输入"
                                clearable
                            />
           <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
         </div>
         <div>
           <el-button @click="handleOut">导出</el-button>
         </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%"
           :row-class-name="tableRowClassName"
           :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="createTime" width="100" show-overflow-tooltip />
                        <el-table-column label="产品名称" prop="productCategory" show-overflow-tooltip />
                        <el-table-column label="产品高度" prop="specificationModel" width="100" show-overflow-tooltip>
                        <template #default="scope">
                            <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
                        </template>
                        </el-table-column>
                        <el-table-column label="每件数量/支" prop="boxNum" width="100" show-overflow-tooltip />
                        <el-table-column label="入库数量" prop="inboundNum" width="100" show-overflow-tooltip />
            <el-table-column label="单价(元)/件" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
                        <el-table-column label="单价(美元)/件" prop="dollarPrice" width="150"></el-table-column>
                        <el-table-column label="已出库数量" prop="totalInboundNum" width="100" show-overflow-tooltip />
                        <el-table-column label="剩余库存" prop="inboundNum0" width="100" show-overflow-tooltip />
            <el-table-column label="纸箱规格" prop="cartonSpecifications" width="150"></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" />
       </div>
     </el-tab-pane>
      <el-tab-pane label="成品库存" name="manual">
      <el-tab-pane label="采购库存" name="purchase">
        <div class="search_form">
          <div>
<!--            <span class="search_title">供应商名称:</span>-->
<!--            <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="请输入" @change="handleQuery"-->
<!--              clearable prefix-icon="Search" />-->
            <span class="search_title ml10">入库日期:</span>
            <el-date-picker
              v-model="searchForm.timeStr"
              type="date"
              placeholder="请选择日期"
              value-format="YYYY-MM-DD"
              format="YYYY-MM-DD"
              clearable
              @change="handleQuery"
            />
                            <span class="search_title ml10">产品大类:</span>
                            <el-input
                                v-model="searchForm.productCategory"
                                style="width: 240px"
                                placeholder="请输入"
                                clearable
                            />
            <el-date-picker v-model="searchForm.timeStr" type="date" placeholder="请选择日期" value-format="YYYY-MM-DD"
              format="YYYY-MM-DD" clearable @change="handleQuery" />
            <span class="search_title ml10">产品大类:</span>
            <el-input v-model="searchForm.productCategory" style="width: 240px" placeholder="请输入" clearable />
            <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
          </div>
          <div>
            <el-button @click="handleOut">导出</el-button>
<!--            <el-button type="danger" plain @click="handleDelete">删除</el-button>-->
          </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%"
            :row-class-name="tableRowClassName"
            :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
            :row-class-name="tableRowClassName" :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="createTime" width="100" show-overflow-tooltip />
            <el-table-column label="产品名称" prop="productCategory" show-overflow-tooltip />
            <el-table-column label="产品高度" prop="specificationModel" width="100" show-overflow-tooltip>
              <template #default="scope">
                <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
              </template>
            </el-table-column>
            <el-table-column label="每件数量/支" prop="boxNum" width="100" show-overflow-tooltip />
            <el-table-column label="入库数量" prop="inboundNum" width="100" show-overflow-tooltip />
            <el-table-column label="单价(元)/件" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
            <el-table-column label="单价(美元)/件" prop="dollarPrice" width="150"></el-table-column>
            <el-table-column label="已出库数量" prop="totalInboundNum" width="100" show-overflow-tooltip />
            <el-table-column label="剩余库存" prop="inboundNum0" width="100" show-overflow-tooltip />
            <el-table-column label="纸箱规格" prop="cartonSpecifications" width="150"></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" />
        </div>
      </el-tab-pane>
      <el-tab-pane label="成品库存" name="manual">
        <div class="search_form">
          <div>
            <!--            <span class="search_title">供应商名称:</span>-->
            <!--            <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="请输入" @change="handleQuery"-->
            <!--              clearable prefix-icon="Search" />-->
            <span class="search_title ml10">入库日期:</span>
            <el-date-picker v-model="searchForm.timeStr" type="date" placeholder="请选择日期" value-format="YYYY-MM-DD"
              format="YYYY-MM-DD" clearable @change="handleQuery" />
            <span class="search_title ml10">产品大类:</span>
            <el-input v-model="searchForm.productCategory" style="width: 240px" placeholder="请输入" clearable />
            <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
          </div>
          <div>
            <el-button @click="handleOut">导出</el-button>
            <!--            <el-button type="danger" plain @click="handleDelete">删除</el-button>-->
          </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%"
            :row-class-name="tableRowClassName" :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="产品图片" width="100" align="center">
                            <template #default="scope">
                                <img class="barcode-img" :src="javaApiUrl+scope.row.url"></img>
                            </template>
                        </el-table-column>
                        <el-table-column label="入库时间" prop="inboundDate" width="100" show-overflow-tooltip />
                        <el-table-column label="产品名称" prop="productCategory" show-overflow-tooltip />
                        <el-table-column label="产品高度" prop="specificationModel" width="100" show-overflow-tooltip>
                        <template #default="scope">
                            <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
                        </template>
                        </el-table-column>
              <template #default="scope">
                <img class="barcode-img" :src="javaApiUrl + scope.row.url"></img>
              </template>
            </el-table-column>
            <el-table-column label="入库时间" prop="inboundDate" width="100" show-overflow-tooltip />
            <el-table-column label="产品名称" prop="productCategory" show-overflow-tooltip />
            <el-table-column label="产品高度" prop="specificationModel" width="100" show-overflow-tooltip>
              <template #default="scope">
                <div>{{ scope.row.specificationModel }}{{ scope.row.unit }}</div>
              </template>
            </el-table-column>
            <el-table-column label="单价(元)/件" prop="taxInclusiveUnitPrice" width="150"></el-table-column>
                        <el-table-column label="单价(美元)/件" prop="dollarPrice" width="150"></el-table-column>
                        <el-table-column label="每件数量/支" prop="boxNum" width="100" show-overflow-tooltip />
                        <el-table-column label="入库数量" prop="inboundNum" width="100" show-overflow-tooltip />
                        <el-table-column label="已出库数量" prop="totalInboundNum" width="100" show-overflow-tooltip />
                        <el-table-column label="剩余库存" prop="inboundNum0" width="100" show-overflow-tooltip />
            <el-table-column label="单价(美元)/件" prop="dollarPrice" width="150"></el-table-column>
            <el-table-column label="每件数量/支" prop="boxNum" width="100" show-overflow-tooltip />
            <el-table-column label="入库数量" prop="inboundNum" width="100" show-overflow-tooltip />
            <el-table-column label="已出库数量" prop="totalInboundNum" width="100" show-overflow-tooltip />
            <el-table-column label="剩余库存" prop="inboundNum0" width="100" show-overflow-tooltip />
            <el-table-column label="纸箱规格" prop="cartonSpecifications" width="150"></el-table-column>
            <!-- <el-table-column fixed="right" label="操作" width="100" align="center">
              <template #default="scope">
@@ -174,79 +148,64 @@
        </div>
      </el-tab-pane>
    </el-tabs>
    <!-- 成品库存弹框 -->
    <FormDiaProduction
      v-model:dialogFormVisible="productionDialogVisible"
      :operationType="operationType"
      :formData="form"
      @submit="submitForm"
      @close="closeDia"
    />
    <FormDiaProduction v-model:dialogFormVisible="productionDialogVisible" :operationType="operationType"
      :formData="form" @submit="submitForm" @close="closeDia" />
    <!-- 原料库存弹框 -->
    <FormDiaPurchase
      v-model:dialogFormVisible="purchaseDialogVisible"
      :operationType="operationType"
      :formData="form"
      @submit="submitForm"
      @close="closeDia"
    />
    <FormDiaPurchase v-model:dialogFormVisible="purchaseDialogVisible" :operationType="operationType" :formData="form"
      @submit="submitForm" @close="closeDia" />
    <!-- 材料库存弹框 -->
    <FormDiaManual
      v-model:dialogFormVisible="manualDialogVisible"
      :operationType="operationType"
      :formData="form"
      @submit="submitForm"
      @close="closeDia"
    />
    <FormDiaManual v-model:dialogFormVisible="manualDialogVisible" :operationType="operationType" :formData="form"
      @submit="submitForm" @close="closeDia" />
  </div>
  <el-dialog v-model="barcodeDia" title="产品信息" width="70%" @close="closeBarcodeDia">
      <div>
        <el-row :gutter="30">
          <el-col :span="12">
            <div class="barcode-item">
              <div class="barcode-label">名称</div>
              <div class="barcode-value">{{barcodeDetail.barcode}}</div>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="barcode-item">
              <div class="barcode-label">单价</div>
              <div class="barcode-value">xxx元</div>
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <div class="barcode-item">
              <div class="barcode-label">产品高度</div>
              <div class="barcode-value">222cm</div>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="barcode-item">
              <div class="barcode-label">数量/件</div>
              <div class="barcode-value">120</div>
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <div class="barcode-item">
              <div class="barcode-label">规格</div>
              <div class="barcode-value">12*20*30</div>
            </div>
          </el-col>
        </el-row>
    <div>
      <el-row :gutter="30">
        <el-col :span="12">
          <div class="barcode-item">
            <div class="barcode-label">名称</div>
            <div class="barcode-value">{{ barcodeDetail.barcode }}</div>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="barcode-item">
            <div class="barcode-label">单价</div>
            <div class="barcode-value">xxx元</div>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <div class="barcode-item">
            <div class="barcode-label">产品高度</div>
            <div class="barcode-value">222cm</div>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="barcode-item">
            <div class="barcode-label">数量/件</div>
            <div class="barcode-value">120</div>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <div class="barcode-item">
            <div class="barcode-label">规格</div>
            <div class="barcode-value">12*20*30</div>
          </div>
        </el-col>
      </el-row>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="closeBarcodeDia">关闭</el-button>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeBarcodeDia">关闭</el-button>
        </div>
      </template>
    </el-dialog>
    </template>
  </el-dialog>
</template>
<script setup>
@@ -255,7 +214,7 @@
import { ElMessageBox } from "element-plus";
import useUserStore from '@/store/modules/user'
import { userListNoPageByTenantId } from "@/api/system/user.js";
import { productTreeList,modelList } from "@/api/basicData/product.js"
import { productTreeList, modelList } from "@/api/basicData/product.js"
import {
  getStockManagePage,
  getStockManagePageByProduction,
@@ -263,7 +222,7 @@
  delStockManage,
} from "@/api/inventoryManagement/stockManage.js";
import {
    updateManagement, updateManagementByCustom, updateStockIn
  updateManagement, updateManagementByCustom, updateStockIn
} from "@/api/inventoryManagement/stockIn.js";
const javaApiUrl = __BASE_API__;
@@ -301,7 +260,7 @@
const data = reactive({
  searchForm: {
    // supplierName: '',
    productCategory:'',
    productCategory: '',
    customerName: '',
    timeStr: getCurrentDate(),
  },
@@ -325,7 +284,7 @@
    inboundBatch: '',
    stockQuantity: '',
    boundTime: '',
        warnNum: '', // 新增最低库存字段
    warnNum: '', // 新增最低库存字段
    salesLedgerProductId: null,
  },
  rules: {
@@ -342,7 +301,7 @@
    boundTime: [{ required: true, message: '请选择库存时间', trigger: 'change' }],
    inboundTime: [{ required: true, message: '请选择入库时间', trigger: 'change' }],
    inboundPerson: [{ required: true, message: '请选择出库人', trigger: 'change' }],
        warnNum: [{ required: true, message: '请输入最低库存', trigger: 'blur' }],
    warnNum: [{ required: true, message: '请输入最低库存', trigger: 'blur' }],
  }
})
const { searchForm, form, rules } = toRefs(data)
@@ -386,14 +345,14 @@
  apiCall.then(res => {
    tableLoading.value = false
    tableData.value = res.data.records
    // 为表格数据自动计算总价
    tableData.value = tableData.value.map(item => {
      // 计算剩余库存
      const stockQuantity = parseFloat(item.inboundNum) || 0
      const outboundQuantity = parseFloat(item.totalInboundNum) || 0
      const remainingStock = Math.max(stockQuantity - outboundQuantity, 0)
      // 根据标签页类型计算总价
      if (activeTab.value === 'production') {
        // 成品库存:总价 = 单价 × 剩余库存
@@ -408,10 +367,10 @@
        const taxInclusiveUnitPrice = parseFloat(item.taxInclusiveUnitPrice) || 0
        item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * remainingStock).toFixed(2)
      }
      return item
    })
    total.value = res.data.total
    // 数据加载完成后检查库存
    // checkStockAndCreatePurchase();
@@ -464,9 +423,9 @@
  userList.value = userLists.data
  if (type === 'edit') {
    form.value = { ...row }
    productTreeList().then(res =>{
    productTreeList().then(res => {
      productList.value = res
      productList.value.forEach(i =>{
      productList.value.forEach(i => {
        if (i.label === row.productCategory) {
          modelList({ id: i.id }).then((res) => {
            productModelList.value = res;
@@ -476,7 +435,7 @@
    })
  }
  form.value.entryDate = getCurrentDate() // 设置默认录入日期为当前日期
  // 根据当前标签页显示对应的弹框
  if (activeTab.value === 'production') {
    productionDialogVisible.value = true
@@ -490,10 +449,10 @@
// 提交表单
const submitForm = (submittedData) => {
  console.log('子组件提交的数据:', submittedData)
  // 使用子组件提交的数据,而不是父组件的form对象
  const submitData = { ...submittedData }
  // 根据当前标签页移除对应的总价字段
  if (activeTab.value === 'production') {
    // 成品库存:移除总价字段
@@ -505,12 +464,12 @@
    // 材料库存:移除含税总价字段
    delete submitData.taxInclusiveTotalPrice
  }
  // 移除其他可能的总价字段
  delete submitData.taxExclusiveTotalPrice
  console.log('提交给后端的数据(已移除总价字段):', submitData)
  submitData.inboundNum = parseFloat(submitData.inboundNum)||0
  submitData.inboundNum = parseFloat(submitData.inboundNum) || 0
  // 根据当前标签页调用不同的提交接口
  let apiCall
  if (activeTab.value === 'production') {
@@ -523,7 +482,7 @@
    // 原料库存使用 updateManagementByCustom 接口
    apiCall = updateManagementByCustom(submitData)
  }
  apiCall.then(res => {
    proxy.$modal.msgSuccess("提交成功")
    closeDia()
@@ -605,7 +564,7 @@
    type: 'warning',
  }
  ).then(() => {
    delStockManage({ids:ids}).then(res => {
    delStockManage({ ids: ids }).then(res => {
      proxy.$modal.msgSuccess("删除成功")
      getList()
    })
@@ -628,7 +587,7 @@
const barcodeDetail = ref({})
// 扫码函数
const scanBarcode = (e) => {
  if(!e||!e.target||!e.target.tagName){
  if (!e || !e.target || !e.target.tagName) {
    return;
  }
  if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') {
@@ -642,9 +601,9 @@
    scanBarcodeInput.value += e.key
  }
}
const getDetail = (barcode)=>{
const getDetail = (barcode) => {
  barcodeDetail.value = {
    barcode:barcode
    barcode: barcode
  }
  barcodeDia.value = true
}
@@ -657,13 +616,13 @@
  // document.addEventListener('keypress', scanBarcode)
  getList()
  // checkStockAndCreatePurchase();
    // 每小时检查一次库存
    // const intervalId = setInterval(checkStockAndCreatePurchase, 60 * 60 * 1000);
  // 每小时检查一次库存
  // const intervalId = setInterval(checkStockAndCreatePurchase, 60 * 60 * 1000);
// onUnmounted(() => {
//   // 组件卸载时清除定时器
//   clearInterval(intervalId);
// });
  // onUnmounted(() => {
  //   // 组件卸载时清除定时器
  //   clearInterval(intervalId);
  // });
})
onUnmounted(() => {
  // 移除键盘监听事件
@@ -681,9 +640,17 @@
:deep(.row-low-stock:hover > td) {
  background-color: #fcd4d4;
}
.barcode-item{
.barcode-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}
.barcode-img {
  width: 80px;
  height: 80px;
  border-radius: 5px;
  background-color: #F5F5F5;
}
</style>
src/views/salesManagement/salesLedger/index.vue
@@ -350,7 +350,7 @@
                    <div v-for="(item, index) in printData" :key="index" class="print-page">
                        <div class="delivery-note">
                            <div class="header">
                                <div class="company-name">鼎诚瑞实业有限责任公司</div>
                                <div class="company-name">双奇点有限责任公司</div>
                                <div class="document-title">零售发货单</div>
                            </div>
                            
@@ -1209,7 +1209,7 @@
      <div class="print-page">
        <div class="delivery-note">
          <div class="header">
            <div class="company-name">鼎诚瑞实业有限责任公司</div>
            <div class="company-name">双奇点有限责任公司</div>
            <div class="document-title">零售发货单</div>
          </div>