zhouwx
2 天以前 1ea0d85b0fe2e7e4427fd484a9342d964c831b3d
src/views/hazardousChemicals/warehouseManage/components/productTable.vue
@@ -112,6 +112,18 @@
    />
    <pro-dialog ref="dialogRef" @getList=getList></pro-dialog>
    <printcode ref="codeRef" @getList=getList></printcode>
    <printMorecodeDialog ref="codeMoreRef" @getList=getList></printMorecodeDialog>
    <el-dialog
        v-model="dialogVisible"
        title="打印纸张"
        width="350"
        :before-close="handlePrintClose"
    >
      <div style="display: flex;align-items: center;justify-content: center;height: 60px">
        <el-button type="primary" @click="openPrint('one')">单张打印</el-button>
        <el-button type="primary" @click="openPrint('more')">28张打印</el-button>
      </div>
    </el-dialog>
  </div>
</template>
@@ -120,6 +132,7 @@
import {ElMessage, ElMessageBox} from "element-plus";
import proDialog from "./addProDialog.vue";
import printcode from './printCode.vue'
import printMorecodeDialog from './printCodeMore.vue'
import {delWarehouse, getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse";
import {
  delProductRecord,
@@ -133,8 +146,10 @@
const loading = ref(false);
const dialogRef = ref();
const codeRef = ref();
const codeMoreRef = ref();
const router = useRouter()
const route = useRoute()
const dialogVisible =ref(false)
const data = reactive({
  queryParams: {
    pageNum: 1,
@@ -229,11 +244,14 @@
        }
      })
}
const entryItem = ref()
const printCode = (val) => {
  console.log("val",val)
  codeRef.value.openDialog('pro',val);
  entryItem.value = val
  dialogVisible.value = true
  // codeRef.value.openDialog('pro',val);
}
const toDetail = (val) => {
  const obj = {
    pageNum: data.queryParams.pageNum,
@@ -279,6 +297,17 @@
    ElMessage.warning(res.message)
  }
}
const handlePrintClose = () => {
  dialogVisible.value = false
}
const openPrint = (type) => {
  if(type === 'one'){
    codeRef.value.openDialog('pro',entryItem.value);
  }else {
    codeMoreRef.value.openDialog('pro',entryItem.value);
  }
}
defineExpose({
  getList