周宾
4 天以前 a04643cd0707a00e265d0ea5aa4e77273a44b6c3
src/views/inventoryManagement/receiptManagement/index.vue
@@ -104,8 +104,8 @@
           <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, 'purchase');">编辑</el-button>
                <el-button link type="success" size="small" @click="showQRCode(scope.row,1)">生成条形码</el-button>
                <el-button link type="success" size="small" @click="showERCode(scope.row,1)">生成二维码</el-button>
                <!-- <el-button link type="success" size="small" @click="showQRCode(scope.row,1)">生成条形码</el-button>
                <el-button link type="success" size="small" @click="showERCode(scope.row,1)">生成二维码</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;
  }
@@ -604,7 +604,6 @@
  }
}
const getDetail = (barcode)=>{
  console.log('barcode',barcode)
  if(barcode.indexOf(",")==-1){
    proxy.$modal.msgWarning("请扫描正确的条形码")
    return
@@ -624,7 +623,14 @@
    return
  }
  detailApi({id:barcodeId}).then((resp) => {
    if(resp.code!=200||!resp.data)return
    if(!resp.data){
      proxy.$modal.msgError("商品不存在")
      return
    }
    if(resp.code!=200){
      proxy.$modal.msgError(res.msg)
      return
    }
    barcodeDetail.value = resp.data
    barcodeDia.value = true
  }).catch(() => {
@@ -639,6 +645,7 @@
onMounted(() => {
  // 添加扫码枪监听事件
  document.removeEventListener('keypress',scanBarcode)
  document.addEventListener('keypress', scanBarcode)
  getList()
})