|
@@ -17,7 +17,7 @@
|
|
|
<el-dialog
|
|
|
:title="'任务流转'"
|
|
|
v-model="dialogVisible"
|
|
|
- width="700"
|
|
|
+ :width="submitType == '20' ? '60%' : '600'"
|
|
|
v-loading="loading"
|
|
|
destroy-on-close
|
|
|
>
|
|
@@ -28,6 +28,42 @@
|
|
|
:rules="rules"
|
|
|
ref="byform"
|
|
|
>
|
|
|
+ <template #right>
|
|
|
+ <div style="width: 100%; padding-left: 54%; margin-bottom: -330px">
|
|
|
+ <el-form-item label="条形码">
|
|
|
+ <div id="pdfDom" style="border: 1px solid #000; padding: 10px">
|
|
|
+ <svg id="barCode"></svg>
|
|
|
+ <div>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ font: 14px fantasy;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #000;
|
|
|
+ line-height: 32px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 产品名称:
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ font: 14px fantasy;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #000;
|
|
|
+ line-height: 32px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 客户名称:
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <div style="text-align: center; margin-top: 10px">
|
|
|
+ <el-button type="primary" v-print="printObj" size="large"
|
|
|
+ >打 印</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #file>
|
|
|
<div style="width: 100%">
|
|
|
<el-upload
|
|
@@ -70,6 +106,8 @@
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
+import JsBarcode from "jsbarcode";
|
|
|
+
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
@@ -124,6 +162,12 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "规格型号",
|
|
|
+ prop: "productSpec",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "产品SN",
|
|
|
prop: "productSn",
|
|
|
},
|
|
@@ -179,6 +223,12 @@ const byform = ref(null);
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
+ type: "slot",
|
|
|
+ slotName: "right",
|
|
|
+ label: "",
|
|
|
+ isShow: submitType.value == "20",
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "input",
|
|
|
itemType: "text",
|
|
|
prop: "productName",
|
|
@@ -191,6 +241,16 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "input",
|
|
|
itemType: "text",
|
|
|
+ prop: "productSpec",
|
|
|
+ label: "规格型号",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
prop: "productSn",
|
|
|
label: "产品SN",
|
|
|
disabled: true,
|
|
@@ -358,6 +418,18 @@ const getDtl = (row) => {
|
|
|
// formOption.disabled = true;
|
|
|
formData.data = { ...row, fileList: [] };
|
|
|
dialogVisible.value = true;
|
|
|
+ let barCode = row.productSn;
|
|
|
+ nextTick(() => {
|
|
|
+ JsBarcode("#barCode", barCode, {
|
|
|
+ format: "CODE128", //选择要使用的条形码类型
|
|
|
+ text: barCode, //显示文本
|
|
|
+ displayValue: true, //是否在条形码下方显示文字
|
|
|
+ textPosition: "bottom", //设置文本的垂直位置
|
|
|
+ // background: "#eee", //设置条形码的背景
|
|
|
+ font: "fantasy", //设置文本的字体
|
|
|
+ margin: 15, //设置条形码周围的空白边距
|
|
|
+ });
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
getList();
|
|
@@ -372,6 +444,14 @@ const uploadFile = async (file) => {
|
|
|
const onPreviewFile = (file) => {
|
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
|
};
|
|
|
+
|
|
|
+const printObj = ref({
|
|
|
+ id: "pdfDom",
|
|
|
+ popTitle: "",
|
|
|
+ extraCss:
|
|
|
+ "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
+ extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|