diff --git a/package.json b/package.json index 55e9b65..19b8841 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "vue-count-to": "1.0.13", "vue-cropper": "0.5.8", "vue-meta": "^2.4.0", + "vue-plugin-hiprint": "0.0.54-fix", "vue-quill-editor": "^3.0.6", "vue-router": "3.4.9", "vue-video-player": "^5.0.2", diff --git a/public/index.html b/public/index.html index be59532..a4e6349 100644 --- a/public/index.html +++ b/public/index.html @@ -6,6 +6,7 @@ + <%= webpackConfig.name %> @@ -213,4 +214,4 @@ </div> </body> -</html> \ No newline at end of file +</html> diff --git a/public/print-lock.css b/public/print-lock.css new file mode 100644 index 0000000..93e654a --- /dev/null +++ b/public/print-lock.css @@ -0,0 +1,339 @@ +@media print { + body { + margin: 0px; + padding: 0px; + } +} + +@page { + margin: 0; +} + +.hiprint-printPaper * { + box-sizing: border-box; + -moz-box-sizing: border-box; /* Firefox */ + -webkit-box-sizing: border-box; /* Safari */ +} + +.hiprint-printPaper *:focus { + outline: -webkit-focus-ring-color auto 0px; +} + +.hiprint-printPaper { + position: relative; + padding: 0 0 0 0; + page-break-after: always; + -webkit-user-select: none; /* Chrome/Safari/Opera */ + -moz-user-select: none; /* Firefox */ + user-select: none; + overflow-x: hidden; + overflow: hidden; +} + +.hiprint-printPaper .hiprint-printPaper-content { + position: relative; +} + +/* 火狐浏览器打印 第一页过后 重叠问题 */ +@-moz-document url-prefix() { + .hiprint-printPaper .hiprint-printPaper-content { + position: relative; + margin-top: 20px; + top: -20px + } +} + +.hiprint-printPaper.design { + overflow: visible; +} + + +.hiprint-printTemplate .hiprint-printPanel { + page-break-after: always; +} + +.hiprint-printPaper, hiprint-printPanel { + box-sizing: border-box; + border: 0px; +} + +.hiprint-printPanel .hiprint-printPaper:last-child { + page-break-after: avoid; +} + +.hiprint-printTemplate .hiprint-printPanel:last-child { + page-break-after: avoid; +} + +.hiprint-printPaper .hideheaderLinetarget { + border-top: 0px dashed rgb(201, 190, 190) !important; +} + +.hiprint-printPaper .hidefooterLinetarget { + border-top: 0px dashed rgb(201, 190, 190) !important; +} + +.hiprint-printPaper.design { + border: 1px dashed rgba(170, 170, 170, 0.7); +} + +.design .hiprint-printElement-table-content, .design .hiprint-printElement-longText-content { + overflow: hidden; + box-sizing: border-box; +} + +.design .resize-panel { + box-sizing: border-box; + border: 1px dotted; +} + +.hiprint-printElement-text { + background-color: transparent; + background-repeat: repeat; + padding: 0 0 0 0; + border: 0.75pt none rgb(0, 0, 0); + direction: ltr; + font-family: 'SimSun'; + font-size: 9pt; + font-style: normal; + font-weight: normal; + padding-bottom: 0pt; + padding-left: 0pt; + padding-right: 0pt; + padding-top: 0pt; + text-align: left; + text-decoration: none; + line-height: 9.75pt; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +.design .hiprint-printElement-text-content { + border: 1px dashed rgb(206, 188, 188); + box-sizing: border-box; +} + +.hiprint-printElement-longText { + background-color: transparent; + background-repeat: repeat; + border: 0.75pt none rgb(0, 0, 0); + direction: ltr; + font-family: 'SimSun'; + font-size: 9pt; + font-style: normal; + font-weight: normal; + padding-bottom: 0pt; + padding-left: 0pt; + padding-right: 0pt; + padding-top: 0pt; + text-align: left; + text-decoration: none; + line-height: 9.75pt; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; + /*white-space: pre-wrap*/ +} + + +.hiprint-printElement-table { + background-color: transparent; + background-repeat: repeat; + color: rgb(0, 0, 0); + border-color: rgb(0, 0, 0); + border-style: none; + direction: ltr; + font-family: 'SimSun'; + font-size: 9pt; + font-style: normal; + font-weight: normal; + padding-bottom: 0pt; + padding-left: 0pt; + padding-right: 0pt; + padding-top: 0pt; + text-align: left; + text-decoration: none; + padding: 0 0 0 0; + box-sizing: border-box; + line-height: 9.75pt; +} + +.hiprint-printElement-table thead { + background: #e8e8e8; + font-weight: 700; +} + +.hiprint-printElement-tableTarget, .hiprint-printElement-tableTarget tr, .hiprint-printElement-tableTarget td { + border-color: rgb(0, 0, 0); + /*border-style: none;*/ + /*border: 1px solid rgb(0, 0, 0);*/ + font-weight: normal; + direction: ltr; + padding-bottom: 0pt; + padding-left: 4pt; + padding-right: 4pt; + padding-top: 0pt; + text-decoration: none; + vertical-align: middle; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; + /*line-height: 9.75pt; + font-size: 9pt;*/ +} + +.hiprint-printElement-tableTarget-border-all { + border: 1px solid; +} +.hiprint-printElement-tableTarget-border-none { + border: 0px solid; +} +.hiprint-printElement-tableTarget-border-lr { + border-left: 1px solid; + border-right: 1px solid; +} +.hiprint-printElement-tableTarget-border-left { + border-left: 1px solid; +} +.hiprint-printElement-tableTarget-border-right { + border-right: 1px solid; +} +.hiprint-printElement-tableTarget-border-tb { + border-top: 1px solid; + border-bottom: 1px solid; +} +.hiprint-printElement-tableTarget-border-top { + border-top: 1px solid; +} +.hiprint-printElement-tableTarget-border-bottom { + border-bottom: 1px solid; +} + +.hiprint-printElement-tableTarget-border-td-none td { + border: 0px solid; +} +.hiprint-printElement-tableTarget-border-td-all td:not(:last-child) { + border-right: 1px solid; +} + +/*.hiprint-printElement-tableTarget tr,*/ +.hiprint-printElement-tableTarget td { + height: 18pt; +} + +.hiprint-printPaper .hiprint-paperNumber { + font-size: 9pt; +} + +.design .hiprint-printElement-table-handle { + position: absolute; + height: 21pt; + width: 21pt; + background: red; + z-index: 1; +} + +.hiprint-printPaper .hiprint-paperNumber-disabled { + float: right !important; + right: 0 !important; + color: gainsboro !important; +} + +.hiprint-printElement-vline, .hiprint-printElement-hline { + border: 0px none rgb(0, 0, 0); + +} + +.hiprint-printElement-vline { + border-left: 0.75pt solid #000; + border-right: 0px none rgb(0, 0, 0) !important; + border-bottom: 0px none rgb(0, 0, 0) !important; + border-top: 0px none rgb(0, 0, 0) !important; +} + +.hiprint-printElement-hline { + border-top: 0.75pt solid #000; + border-right: 0px none rgb(0, 0, 0) !important; + border-bottom: 0px none rgb(0, 0, 0) !important; + border-left: 0px none rgb(0, 0, 0) !important; +} + +.hiprint-printElement-oval, .hiprint-printElement-rect { + border: 0.75pt solid #000; +} + +.hiprint-text-content-middle { +} + +.hiprint-text-content-middle > div { + display: grid; + align-items: center; +} + +.hiprint-text-content-bottom { +} + +.hiprint-text-content-bottom > div { + display: grid; + align-items: flex-end; +} + +.hiprint-text-content-wrap { +} + +.hiprint-text-content-wrap .hiprint-text-content-wrap-nowrap { + white-space: nowrap; +} + +.hiprint-text-content-wrap .hiprint-text-content-wrap-clip { + white-space: nowrap; + overflow: hidden; + text-overflow: clip; +} + +.hiprint-text-content-wrap .hiprint-text-content-wrap-ellipsis { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/*hi-grid-row */ +.hi-grid-row { + position: relative; + height: auto; + margin-right: 0; + margin-left: 0; + zoom: 1; + display: block; + box-sizing: border-box; +} + +.hi-grid-row::after, .hi-grid-row::before { + display: table; + content: ''; + box-sizing: border-box; +} + +.hi-grid-col { + display: block; + box-sizing: border-box; + position: relative; + float: left; + flex: 0 0 auto; +} + +.table-grid-row { + margin-left: -0pt; + margin-right: -0pt; +} + +.tableGridColumnsGutterRow { + padding-left: 0pt; + padding-right: 0pt; +} + +.hiprint-gridColumnsFooter { + text-align: left; + clear: both; +} diff --git a/src/main.js b/src/main.js index 4d69873..3e24639 100644 --- a/src/main.js +++ b/src/main.js @@ -9,7 +9,7 @@ import store from './store'; import router from './router'; import directive from './directive'; // directive import plugins from './plugins'; // plugins - +import { hiPrintPlugin,disAutoConnect } from 'vue-plugin-hiprint' import './assets/icons'; // icon import './permission'; // permission control // import './tongji' // 百度统计 @@ -64,7 +64,8 @@ import DocAlert from '@/components/DocAlert'; // 头部标签插件 import VueMeta from 'vue-meta'; import CodeBrickZj from 'code-brick-zj'; - +disAutoConnect(); +Vue.use(hiPrintPlugin) Vue.use(CodeBrickZj) Vue.use(directive); Vue.use(plugins); diff --git a/src/views/packing/custom/SmallTitle.vue b/src/views/packing/custom/SmallTitle.vue new file mode 100644 index 0000000..93b4a18 --- /dev/null +++ b/src/views/packing/custom/SmallTitle.vue @@ -0,0 +1,65 @@ +<!-- + * @Author: zwq + * @Date: 2023-08-01 15:27:31 + * @LastEditors: zwq + * @LastEditTime: 2023-08-01 16:25:54 + * @Description: +--> +<template> + <div :class="[className, { 'p-0': noPadding }]"> + <slot /> + </div> +</template> + +<script> +export default { + props: { + size: { + // 取值范围: xl lg md sm + type: String, + default: 'de', + validator: function (val) { + return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; + }, + }, + noPadding: { + type: Boolean, + default: false, + }, + }, + computed: { + className: function () { + return `${this.size}-title`; + }, + }, +}; +</script> + +<style lang="scss" scoped> +$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); +$mgr: 8px; +@each $size, $height in $pxls { + .#{$size}-title { + font-size: 18px; + line-height: $height; + color: #000; + font-weight: 500; + font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; + + &::before { + content: ''; + display: inline-block; + vertical-align: top; + width: 4px; + height: $height + 2px; + border-radius: 1px; + margin-right: $mgr; + background-color: #0b58ff; + } + } +} + +.p-0 { + padding: 0; +} +</style> diff --git a/src/views/packing/custom/index.vue b/src/views/packing/custom/index.vue new file mode 100644 index 0000000..de80da1 --- /dev/null +++ b/src/views/packing/custom/index.vue @@ -0,0 +1,412 @@ +<template> + <el-drawer :visible.sync="drawer" :append-to-body="true" size="80%"> + <small-title slot="title" :no-padding="true"> + <!-- <template v-for="demo in demoList"> --> + <!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> --> + <!-- {{ $t('module.packingManage.printModelDesign') }} --> + 模板设计 + <!-- </el-button> --> + <!-- </template> --> + </small-title> + <el-card> + <el-row style="margin-bottom: 10px"> + <el-col :span="4"> + <!-- 模板选择 --> + + <!-- <el-select + v-model="mode" + filterable + :default-value="0" + option-label-prop="label" + style="width: 100%;" + @change="changeMode" + > + <el-option v-for="(opt,idx) in modeList" :key="idx" :label="opt.name" :value="idx"> + {{ opt.name }} + </el-option> + </el-select> --> + </el-col> + <el-col :span="20"> + <!-- 纸张设置 --> + <el-button-group style="margin:0 10px"> + <el-button + v-for="(value,type) in paperTypes" + :key="type" + :type="curPaperType === type ? 'primary' : ' '" + @click="setPaper(type,value)" + > + {{ type }} + </el-button> + </el-button-group> + <el-input-number + style="margin:0 10px" + :value="scaleValue " + :precision="2" + :step="0.1" + :min="scaleMin" + :max="scaleMax" + @change="changeScale" + /> + <el-popover v-model="paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)"> + <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px"> + <el-input v-model="paperWidth" type="number" style=" width: 100px; text-align: center" place="宽(mm)" />~ + <el-input v-model="paperHeight" type="number" style=" width: 100px; text-align: center" place="高(mm)" /> + </div> + <div> + <el-button type="primary" style="width: 100%" size="mini" @click="otherPaper">确定</el-button> + </div> + <el-button slot="reference" type="primary" style="margin:0 10px">自定义宽高</el-button> + </el-popover> + + <!-- <a-button-group>--> + <!-- <template v-for="(value,type) in paperTypes">--> + <!-- <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">--> + <!-- {{ type }}--> + <!-- </a-button>--> + <!-- </template>--> + <!-- <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">--> + <!-- <div slot="content">--> + <!-- <a-input-group compact style="margin: 10px 10px">--> + <!-- <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"--> + <!-- placeholder="宽(mm)"/>--> + <!-- <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"--> + <!-- placeholder="~" disabled--> + <!-- />--> + <!-- <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"--> + <!-- placeholder="高(mm)"/>--> + <!-- </a-input-group>--> + <!-- <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>--> + <!-- </div>--> + <!-- <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>--> + <!-- </a-popover>--> + <!-- </a-button-group>--> + + <!-- 预览/打印 --> + <el-button-group> + <el-button type="primary" icon="redo" @click="rotatePaper()">旋转</el-button> + <el-button type="primary" icon="el-icon-view" @click="preView"> + 预览 + </el-button> + <!-- <el-button type="primary" icon="el-icon-printer" @click="print"> + 直接打印 + </el-button> --> + <el-button type="primary" icon="el-icon-s-management" @click="save"> + 保存 + </el-button> + <el-button type="danger" icon="el-icon-delete" @click="clearPaper"> + 清空 + </el-button> + </el-button-group> + <!-- 保存/清空 --> + + </el-col> + </el-row> + <el-row :gutter="24"> + <el-col :span="4"> + <el-card style="height: 100vh"> + <el-row> + <el-col :span="24" class="rect-printElement-types hiprintEpContainer" /> + </el-row> + </el-card> + </el-col> + <el-col :span="16"> + <el-card class="card-design"> + <div id="hiprint-printTemplate" class="hiprint-printTemplate" /> + </el-card> + </el-col> + <el-col :span="4" class="params_setting_container"> + <el-card> + <el-row class="hinnn-layout-sider"> + <div id="PrintElementOptionSetting" /> + </el-row> + </el-card> + </el-col> + </el-row> + <!-- 预览 --> + <print-preview ref="preView" /> + </el-card> + </el-drawer> +</template> + +<script> + +import printPreview from './preview' +import { MessageBox } from 'element-ui' +import { hiprint } from 'vue-plugin-hiprint' +import providers from './providers' +// import printData from './print-data' +import $ from 'jquery' +import SmallTitle from './SmallTitle.vue' +let hiprintTemplate = null +export default { + name: 'PrintCustom', + components: { printPreview, SmallTitle }, + // props: { + // modelData: { + // type: String, + // default: '' + // } + // }, + data() { + return { + // paperPopVisible: false, + // 模板选择 + mode: 0, + template: null, + modeList: [], + // 当前纸张 + curPaper: { + // type: 'other', + // width: 220, + // height: 80 + }, + printData:{}, + drawer: false, + // 纸张类型 + paperTypes: { + 'A3': { + width: 420, + height: 296.6 + }, + 'A4': { + width: 210, + height: 297 + }, + 'A5': { + width: 210, + height: 147.6 + }, + 'B3': { + width: 500, + height: 352.6 + }, + 'B4': { + width: 250, + height: 352.6 + }, + 'B5': { + width: 250, + height: 175.6 + } + }, + scaleValue: 1, + scaleMax: 5, + scaleMin: 0.5, + // 自定义纸张 + paperPopVisible: false, + paperWidth: '210', + paperHeight: '297' + } + }, + computed: { + curPaperType() { + let type = 'other' + const types = this.paperTypes + for (const key in types) { + const item = types[key] + const { width, height } = this.curPaper + if (item.width === width && item.height === height) { + type = key + } + } + return type + } + }, + mounted() { + this.init() + // console.log('aaaaaa') + // this.otherPaper() + }, + destroyed () { + $('.hiprintEpContainer').empty() + }, + methods: { + // handleClose() { + // $('.hiprintEpContainer').empty() + // }, + init(data) { + this.drawer = true + this.modelData = data + this.modeList = providers.map((e) => { + return { type: e.type, name: e.name, value: e.value } + }) + this.changeMode() + }, + changeMode() { + // hiprintTemplate.clear() + // console.log(this.modelData) + const { mode } = this + const provider = providers[mode] + hiprint.init({ + providers: [provider.f] + }) + + // $('#hiprint-printTemplate').empty() + // console.log(JSON.parse(this.modelData)) + hiprint.setConfig() + // 替换配置 + hiprint.setConfig({ + movingDistance: 2.5, + text: { + supportOptions: [ + { + name: 'styler', + hidden: true + }, + { + name: 'formatter', + hidden: true + } + ] + } + }) + + // console.log(this.modelData) + // console.log($('#hiprint-printTemplate').empty()) + if (this.modelData) { + $('.hiprintEpContainer').empty() + hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value) + $('.hiprint-printTemplate').empty() + hiprintTemplate = new hiprint.PrintTemplate({ + template: JSON.parse(this.modelData), + settingContainer: '#PrintElementOptionSetting', + paginationContainer: '.hiprint-printPagination' + }) + } else { + $('.hiprintEpContainer').empty() + hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value) + $('.hiprint-printTemplate').empty() + // const templates = this.$ls.get('KEY_TEMPLATES', {}) + const template = provider.value + console.log(template) + hiprintTemplate = new hiprint.PrintTemplate({ + template: template, + settingContainer: '#PrintElementOptionSetting', + paginationContainer: '.hiprint-printPagination' + }) + } + // hiprintTemplate.design('#hiprint-printTemplate') + // console.log(hiprintTemplate) + hiprintTemplate.design('#hiprint-printTemplate', { grid: true }) + // 获取当前放大比例, 当zoom时传true 才会有 + this.scaleValue = hiprintTemplate.editingPanel.scale || 1 + // this.scaleValue = hiprintTemplate.editingPanel.scale || 1 + }, + /** + * 设置纸张大小 + * @param type [A3, A4, A5, B3, B4, B5, other] + * @param value {width,height} mm + */ + setPaper(type, value) { + try { + if (Object.keys(this.paperTypes).includes(type)) { + this.curPaper = { type: type, width: value.width, height: value.height } + hiprintTemplate.setPaper(value.width, value.height) + } else { + this.curPaper = { type: 'other', width: value.width, height: value.height } + hiprintTemplate.setPaper(value.width, value.height) + } + } catch (error) { + this.$message.error(`操作失败: ${error}`) + } + }, + changeScale(currentValue, oldValue) { + let big = false + currentValue <= oldValue ? big = false : big = true + let scaleValue = this.scaleValue + if (big) { + scaleValue += 0.1 + if (scaleValue > this.scaleMax) scaleValue = 5 + } else { + scaleValue -= 0.1 + if (scaleValue < this.scaleMin) scaleValue = 0.5 + } + if (hiprintTemplate) { + // scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大 + hiprintTemplate.zoom(scaleValue) + this.scaleValue = scaleValue + } + }, + clearPaper() { + MessageBox.confirm('是否确认清空模板信息?', '警告', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + try { + hiprintTemplate.clear() + } catch (error) { + this.$message.error(`操作失败: ${error}`) + } + }).catch((err) => { + console.log(err) + }) + }, + otherPaper() { + const value = {} + value.width = this.paperWidth + value.height = this.paperHeight + this.paperPopVisible = false + this.setPaper('other', value) + }, + rotatePaper() { + if (hiprintTemplate) { + hiprintTemplate.rotatePaper() + } + }, + preView() { + const { width } = this.curPaper + this.$refs.preView.show(hiprintTemplate, this.printData, width) + }, + print() { + // if (window.hiwebSocket.opened) { + const printerList = hiprintTemplate.getPrinterList() + console.log(printerList) + hiprintTemplate.print2(this.printData, { printer: '', title: '预览打印' }) + // return + // } + // this.$message.error('客户端未连接,无法直接打印') + }, + save() { + // console.log(hiprintTemplate.getJson()) + const { mode } = this + const provider = providers[mode] + // console.log(hiprintTemplate.getJson()) + this.setTemplate({ + name: provider.value, + json: hiprintTemplate.getJson() + }) + }, + setTemplate(payload) { + // const templates = this.$ls.get('KEY_TEMPLATES', {}) + // console.log(payload.json) + // templates[payload.name] = payload.json + // this.$ls.set('KEY_TEMPLATES', templates) + this.$message.info('保存成功') + // console.log(JSON.stringify(payload.json)) + this.drawer = false + // this.$emit('saveData', payload.json) + $('.hiprintEpContainer').empty() + // this.$parent.$parent.getModelData(payload.json) + } + } +} +</script> + +<style lang="scss" scoped> +// build 拖拽 +::v-deep .hiprint-printElement-type >li>ul>li>a { + padding: 4px 4px; + color: #1296db; + line-height: 1; + height: auto; + text-overflow: ellipsis; +} +// 设计容器 +.card-design { + // overflow: hidden; + overflow-x: auto; + overflow-y: auto; +} + +</style> diff --git a/src/views/packing/custom/preview.vue b/src/views/packing/custom/preview.vue new file mode 100644 index 0000000..f7d18de --- /dev/null +++ b/src/views/packing/custom/preview.vue @@ -0,0 +1,89 @@ +<!-- + * @Author: zhp + * @Date: 2023-09-27 14:23:54 + * @LastEditTime: 2023-10-19 11:20:36 + * @LastEditors: zhp + * @Description: +--> +<template> + <el-dialog :visible="visible" :mask-closable="false" width="50%" @close="hideModal" :append-to-body="true"> + <div id="preview_content" /> + <template slot="title"> + <div style="margin-right: 20px">打印预览</div> + <el-button :loading="waitShowPrinter" type="primary" icon="printer" @click.stop="print">打印</el-button> + <el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button> + </template> + <template slot="footer"> + <el-button key="close" type="info" @click="hideModal"> + 关闭 + </el-button> + </template> + </el-dialog> +</template> + +<script> +export default { + name: 'PrintPreview', + props: {}, + data() { + return { + visible: false, + spinning: true, + waitShowPrinter: false, + // 纸张宽 mm + width: 0, + // 模板 + hiprintTemplate: {}, + // 数据 + printData: {} + } + }, + computed: {}, + watch: {}, + created() { + }, + mounted() { + }, + methods: { + hideModal() { + this.visible = false + }, + show(hiprintTemplate, printData, width = '210') { + this.visible = true + this.spinning = true + this.width = width + this.hiprintTemplate = hiprintTemplate + this.printData = printData + console.log(hiprintTemplate) + console.log(printData) + setTimeout(() => { + // eslint-disable-next-line no-undef + $('#preview_content').html(hiprintTemplate.getHtml(printData)) + this.spinning = false + }, 500) + }, + print() { + this.waitShowPrinter = true + this.hiprintTemplate.print(this.printData, {}, { + callback: () => { + console.log('callback') + this.waitShowPrinter = false + } + }) + }, + toPdf() { + this.hiprintTemplate.toPdf({}, '打印预览') + } + } +} + +</script> +<!-- <style lang="less" scoped> +/deep/ .ant-modal-body { + padding: 0px; +} + +/deep/ .ant-modal-content { + margin-bottom: 24px; +} +</style> --> diff --git a/src/views/packing/custom/print-data.js b/src/views/packing/custom/print-data.js new file mode 100644 index 0000000..077f838 --- /dev/null +++ b/src/views/packing/custom/print-data.js @@ -0,0 +1,90 @@ +/* + * @Author: zhp + * @Date: 2023-09-27 14:23:54 + * @LastEditTime: 2023-09-27 14:29:59 + * @LastEditors: zhp + * @Description: + */ +export default { + totalCap: '壹佰元整', + test: { + a: '111', + b: '222', + longText: '浙江在线3月29日讯最近,\n一篇小学五年级学生写的作文引起了钱报记者的关注这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文' + }, + testaaa: { + a: { + b: { + c: { + d: 'dddddddddddd' + } + } + } + }, + table_test: { + a: [ + { NAME: '测试商品01', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品02', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品03', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品04', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品05', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品06', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品07', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品08', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品09', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品10', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品11', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品12', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品13', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品14', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品15', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品16', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品17', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品18', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品19', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品20', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品21', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品22', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品23', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品24', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品25', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品26', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品27', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品28', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品29', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品30', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' } + ] + }, + table: [ + { NAME: '测试商品01', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品02', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品03', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品04', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品05', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品06', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品07', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品08', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品09', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品10', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品11', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品12', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品13', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品14', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品15', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品16', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品17', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品18', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品19', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品20', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品21', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品22', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品23', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品24', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品25', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品26', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品27', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品28', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品29', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' }, + { NAME: '测试商品30', SL: 2, GG: '1*24g', TM: '2O22010100110', DJ: '6.8', JE: '13.6' } + ] +} diff --git a/src/views/packing/custom/providers.js b/src/views/packing/custom/providers.js new file mode 100644 index 0000000..fa8996d --- /dev/null +++ b/src/views/packing/custom/providers.js @@ -0,0 +1,447 @@ +/* eslint-disable */ +import {hiprint} from 'vue-plugin-hiprint' + +/* eslint-disable */ +// import {hiprint} from '../../index' + +// 自定义设计元素1 +export const aProvider = function (ops) { + var addElementTypes = function (context) { + context.removePrintElementTypes("aProviderModule"); + context.addPrintElementTypes( + "aProviderModule", + [ + new hiprint.PrintElementTypeGroup("平台", [ + { + tid: 'aProviderModule.header', title: '单据表头', data: '单据表头', type: 'text', + options: { + testData: '单据表头', + height: 17, + fontSize: 16.5, + fontWeight: "700", + textAlign: "center", + hideTitle: true + } + }, + { + tid: 'aProviderModule.type', title: '单据类型', data: '单据类型', type: 'text', + options: { + testData: '单据类型', + height: 16, + fontSize: 15, + fontWeight: "700", + textAlign: "center", + hideTitle: true + } + }, + { + tid: 'aProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text', + options: { + field: 'orderId', + testData: 'XS888888888', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'aProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text', + options: { + field: 'date', + testData: '2020-01-01', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'aProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text', + options: { + field: 'barcode', + testData: 'XS888888888', + height: 32, + fontSize: 12, + lineHeight: 18, + textType: "barcode" + } + }, + { + tid: 'aProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text', + options: { + field: 'qrcode', + testData: 'XS888888888', + height: 32, + fontSize: 12, + lineHeight: 18, + textType: "qrcode" + } + }, + { + tid: 'aProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text', + options: { + testData: '平台名称', + height: 17, + fontSize: 16.5, + fontWeight: "700", + textAlign: "center", + hideTitle: true + } + }, + {tid: 'aProviderModule.logo', title: 'Logo', data: '', type: 'image'}, + ]), + new hiprint.PrintElementTypeGroup("库管", [ + { + tid: 'aProviderModule.creater', title: '制单人', data: '李四', type: 'text', + options: { + field: 'creater', + testData: '李四', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'aProviderModule.printDate', title: '打印时间', data: '2022-01-01 09:00', type: 'text', + options: { + field: 'printDate', + testData: '2022-01-01 09:00', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'aProviderModule.signer', title: '库管签字', data: '', type: 'text', + options: { + title: '库管签字:', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + ]), + new hiprint.PrintElementTypeGroup("表格/其他", [ + { + tid: 'aProviderModule.table', title: '订单数据', + type: 'table', + options: { + field: 'table', + tableHeaderRepeat: 'first', + tableFooterRepeat: 'last', + fields: [ + {text: '名称', field: 'NAME'}, + {text: '数量', field: 'SL'}, + {text: '规格', field: 'GG'}, + {text: '条码', field: 'TM'}, + {text: '单价', field: 'DJ'}, + {text: '金额', field: 'JE'}, + ], + }, + editable: true, + columnDisplayEditable: true,//列显示是否能编辑 + columnDisplayIndexEditable: true,//列顺序显示是否能编辑 + columnTitleEditable: true,//列标题是否能编辑 + columnResizable: true, //列宽是否能调整 + columnAlignEditable: true,//列对齐是否调整 + isEnableEditField: true, //编辑字段 + isEnableContextMenu: true, //开启右键菜单 默认true + isEnableInsertRow: true, //插入行 + isEnableDeleteRow: true, //删除行 + isEnableInsertColumn: true, //插入列 + isEnableDeleteColumn: true, //删除列 + isEnableMergeCell: true, //合并单元格 + columns: [ + [ + {title: '名称', align: 'center', field: 'NAME', width: 150}, + {title: '数量', align: 'center', field: 'SL', width: 80}, + {title: '规格', align: 'center', field: 'GG', width: 80, checked: false}, + {title: '条码', align: 'center', field: 'TM', width: 100, checked: false}, + {title: '单价', align: 'center', field: 'DJ', width: 100}, + {title: '金额', align: 'center', field: 'JE', width: 100, checked: false}, + ], + ], + rowsColumnsMerge: function (data, col, index) { + // 返回一个数组,参数一为行(rowspan)合并数,参数二为列(colspan)合并数, 被合并的行或者列值设为0 + if (index == 0) { + return [1, data.INDEX % 2 == 1 ? 2 : 1] + } else if (index > 0 && index < 2) { + return [data.INDEX % 2 == 1 ? 0 : 1, 1] + } else { + return [data.INDEX % 2 == 1 ? 2 : 0, 1] + } + }, + footerFormatter: function (options, rows, data, currentPageGridRowsData) { + if (data && data['totalCap']) { + return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>` + } + return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>' + }, + }, + {tid: 'aProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'}, + { + tid: 'aProviderModule.longText', title: '长文本', type: 'longText', options: { + field: 'test.longText', + width: 200, + testData: '长文本分页/不分页测试' + }, + } + ]), + new hiprint.PrintElementTypeGroup("辅助", [ + { + tid: 'aProviderModule.hline', + title: '横线', + type: 'hline' + }, + { + tid: 'aProviderModule.vline', + title: '竖线', + type: 'vline' + }, + { + tid: 'aProviderModule.rect', + title: '矩形', + type: 'rect' + }, + { + tid: 'aProviderModule.oval', + title: '椭圆', + type: 'oval' + }, + { + tid: 'aProviderModule.barcode', + title: '条形码', + type: 'barcode', + }, + { + tid: 'aProviderModule.qrcode', + title: '二维码', + type: 'qrcode', + } + ]) + ] + ); + }; + return { + addElementTypes: addElementTypes + }; +}; + +// 自定义设计元素2 +export const bProvider = function (ops) { + var addElementTypes = function (context) { + context.removePrintElementTypes("bProviderModule"); + context.addPrintElementTypes( + "bProviderModule", + [ + new hiprint.PrintElementTypeGroup("常规", [ + { + tid: 'bProviderModule.header', title: '单据表头', data: '单据表头', type: 'text', + options: { + testData: '单据表头', + height: 17, + fontSize: 16.5, + fontWeight: "700", + textAlign: "center", + hideTitle: true + } + }, + { + tid: 'bProviderModule.type', title: '单据类型', data: '单据类型', type: 'text', + options: { + testData: '单据类型', + height: 16, + fontSize: 15, + fontWeight: "700", + textAlign: "center", + hideTitle: true + } + }, + { + tid: 'bProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text', + options: { + field: 'orderId', + testData: 'XS888888888', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'bProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text', + options: { + field: 'date', + testData: '2020-01-01', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'bProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text', + options: { + field: 'barcode', + testData: 'XS888888888', + height: 32, + fontSize: 12, + lineHeight: 18, + textType: "barcode" + } + }, + { + tid: 'bProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text', + options: { + field: 'qrcode', + testData: 'XS888888888', + height: 32, + fontSize: 12, + lineHeight: 18, + textType: "qrcode" + } + }, + { + tid: 'bProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text', + options: { + testData: '平台名称', + height: 17, + fontSize: 16.5, + fontWeight: "700", + textAlign: "center", + hideTitle: true + } + }, + {tid: 'bProviderModule.image', title: 'Logo', data: 'data: image/png;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', type: 'image', options: { + src: 'data: image/png;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', + fit: 'none' + }}, + ]), + new hiprint.PrintElementTypeGroup("客户", [ + { + tid: 'bProviderModule.khname', title: '客户名称', data: '高级客户', type: 'text', + options: { + field: 'name', + testData: '高级客户', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + { + tid: 'bProviderModule.tel', title: '客户电话', data: '18888888888', type: 'text', + options: { + field: 'tel', + testData: '18888888888', + height: 16, + fontSize: 6.75, + fontWeight: "700", + textAlign: "left", + textContentVerticalAlign: "middle" + } + }, + ]), + new hiprint.PrintElementTypeGroup("表格/其他", [ + { + tid: 'bProviderModule.table', title: '订单数据', + type: 'table', + options: { + field: 'table', + fields: [ + {text: '名称', field: 'NAME'}, + {text: '数量', field: 'SL'}, + {text: '规格', field: 'GG'}, + {text: '条码', field: 'TM'}, + {text: '单价', field: 'DJ'}, + {text: '金额', field: 'JE'}, + {text: '备注', field: 'DETAIL'}, + ], + }, + editable: true, + columnDisplayEditable: true,//列显示是否能编辑 + columnDisplayIndexEditable: true,//列顺序显示是否能编辑 + columnTitleEditable: true,//列标题是否能编辑 + columnResizable: true, //列宽是否能调整 + columnAlignEditable: true,//列对齐是否调整 + columns: [ + [ + {title: '名称', align: 'center', field: 'NAME', width: 100}, + {title: '数量', align: 'center', field: 'SL', width: 100}, + {title: '条码', align: 'center', field: 'TM', width: 100}, + {title: '规格', align: 'center', field: 'GG', width: 100}, + {title: '单价', align: 'center', field: 'DJ', width: 100}, + {title: '金额', align: 'center', field: 'JE', width: 100}, + {title: '备注', align: 'center', field: 'DETAIL', width: 100}, + ] + ], + footerFormatter: function (options, rows, data, currentPageGridRowsData) { + if (data && data['totalCap']) { + return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>` + } + return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>' + }, + }, + {tid: 'bProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'}, + { + tid: 'bProviderModule.longText', title: '长文本', type: 'longText', options: { + field: 'test.longText', + width: 200, + testData: '长文本分页/不分页测试' + }, + } + ]), + new hiprint.PrintElementTypeGroup("辅助", [ + { + tid: 'bProviderModule.hline', + title: '横线', + type: 'hline' + }, + { + tid: 'bProviderModule.vline', + title: '竖线', + type: 'vline' + }, + { + tid: 'bProviderModule.rect', + title: '矩形', + type: 'rect' + }, + { + tid: 'bProviderModule.oval', + title: '椭圆', + type: 'oval' + } + ]) + ] + ); + }; + return { + addElementTypes: addElementTypes + }; +}; + +// type: 1供货商 2经销商 +export default [{ + name: 'A设计', + value: 'aProviderModule', + type: 1, + f: aProvider() +}, { + name: 'B设计', + value: 'bProviderModule', + type: 2, + f: bProvider() +}] diff --git a/src/views/packing/mixins/basic-add.js b/src/views/packing/mixins/basic-add.js new file mode 100644 index 0000000..0b9acd2 --- /dev/null +++ b/src/views/packing/mixins/basic-add.js @@ -0,0 +1,100 @@ +/* + * @Author: zwq + * @Date: 2022-08-24 11:19:43 + * @LastEditors: zwq + * @LastEditTime: 2023-08-03 14:21:04 + * @Description: + */ +export default { + data() { + /* eslint-disable */ + return { + urlOptions: { + createURL: '', + updateURL: '', + infoURL: '', + codeURL: '', + getOption: false, + isGetCode: false, + optionArrUrl: [], + optionArr: {} + }, + visible: false, + setData: false + } + }, + created() { + }, + activated() { + }, + methods: { + init(id) { + this.dataForm.id = id || ""; + this.visible = true; + if (this.urlOptions.getOption) { + this.getArr() + } + this.$nextTick(() => { + this.$refs["dataForm"].resetFields(); + if (this.dataForm.id) { + this.urlOptions.infoURL(id).then(response => { + this.dataForm = response.data; + if (this.setData) { + this.setDataForm() + } + }); + } else { + if (this.urlOptions.isGetCode) { + this.getCode() + } + } + }); + }, + getCode() { + this.urlOptions.codeURL() + .then(({ data: res }) => { + this.dataForm.code = res; + }) + .catch(() => {}); + }, + getArr() { + const params = { + pageSize: 100, + pageNo: 1, + } + this.urlOptions.optionArrUrl.forEach((item, index) => { + item(params).then(({ data: res }) => { + this.$set(this.urlOptions.optionArr, `arr${index}`, res.list) + }) + .catch(() => { + }); + }); + }, + // 表单提交 + dataFormSubmit() { + this.$refs["dataForm"].validate((valid) => { + if (!valid) { + return false; + } + // 修改的提交 + if (this.dataForm.id) { + this.urlOptions.updateURL(this.dataForm).then(response => { + this.$modal.msgSuccess("修改成功"); + this.visible = false; + this.$emit("refreshDataList"); + }); + return; + } + // 添加的提交 + this.urlOptions.createURL(this.dataForm).then(response => { + this.$modal.msgSuccess("新增成功"); + this.visible = false; + this.$emit("refreshDataList"); + }); + }); + }, + formClear() { + this.$refs.dataForm.resetFields() + } + } +} diff --git a/src/views/packing/mixins/basic-page.js b/src/views/packing/mixins/basic-page.js new file mode 100644 index 0000000..b3b14aa --- /dev/null +++ b/src/views/packing/mixins/basic-page.js @@ -0,0 +1,168 @@ +/* + * @Author: zwq + * @Date: 2022-08-24 11:19:43 + * @LastEditors: zhp + * @LastEditTime: 2023-11-01 10:30:12 + * @Description: + */ +export default { + data() { + /* eslint-disable */ + return { + urlOptions: { + getDataListURL: '', + deleteURL: '', + statusUrl: '', + exportURL: '' + }, + tableData: [], + listQuery: { + pageSize: 10, + pageNo: 1, + total: 1, + }, + exportLoading: false, + dataListLoading: false, + addOrEditTitle: '', + addOrUpdateVisible: false, + } + }, + created() { + }, + mounted() { + this.getDataList() + }, + methods: { + // 获取数据列表 + getDataList() { + this.dataListLoading = true; + this.urlOptions.getDataListURL(this.listQuery).then(response => { + this.tableData = response.data.list; + this.listQuery.total = response.data.total; + this.dataListLoading = false; + }); + }, + // 每页数 + sizeChangeHandle(val) { + this.listQuery.pageSize = val; + this.listQuery.pageNo = 1; + this.getDataList(); + }, + // 当前页 + currentChangeHandle(val) { + this.listQuery.pageNo = val; + this.getDataList(); + }, + // 新增 / 修改 + addOrUpdateHandle(id) { + this.addOrUpdateVisible = true; + this.$nextTick(() => { + this.$refs.addOrUpdate.init(id); + }); + }, + cancel(id) { + this.$refs["popover-" + id].showPopper = false; + }, + //改变状态 + changeStatus(id) { + this.$http + .post(this.urlOptions.statusUrl, { id }) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } + this.$refs["popover-" + id].showPopper = false; + this.$message({ + message: this.$t("prompt.success"), + type: "success", + duration: 500, + onClose: () => { + this.getDataList(); + }, + }); + }) + .catch(() => { }); + }, + //tableBtn点击 + handleClick(val) { + if (val.type === "edit") { + this.addOrUpdateVisible = true; + this.addOrEditTitle = "编辑"; + this.$nextTick(() => { + this.$refs.addOrUpdate.init(val.data.id); + }); + } else if (val.type === "delete") { + this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex) + } else if (val.type === "change") { + this.changeStatus(val.data.id) + } else { + this.otherMethods(val) + } + }, + // 删除 + deleteHandle(id, name, index) { + this.$confirm(`是否确认删除${name ? '[' + name + ']' : '[' + index + ']'}数据项?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.urlOptions.deleteURL(id).then(({ data }) => { + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.getDataList(); + }, + }); + }); + }) + .catch(() => { }); + }, + //search-bar点击 + buttonClick(val) { + switch (val.btnName) { + case "search": + this.listQuery.xm1 = val.xm1; + this.listQuery.xm2 = val.xm2; + this.listQuery.pageNo = 1; + this.getDataList(); + break; + case "add": + this.addOrEditTitle = '新增' + this.addOrUpdateVisible = true; + this.addOrUpdateHandle() + break; + default: + console.log(val) + } + }, + handleCancel() { + this.$refs.addOrUpdate.formClear() + this.addOrUpdateVisible = false + this.addOrEditTitle = '' + }, + handleConfirm() { + this.$refs.addOrUpdate.dataFormSubmit() + }, + successSubmit() { + this.handleCancel() + this.getDataList() + }, + /** 导出按钮操作 */ + handleExport() { + // 处理查询参数 + let params = { ...this.queryParams }; + params.pageNo = undefined; + params.pageSize = undefined; + this.$modal.confirm('是否确认导出所有数据项?').then(() => { + this.exportLoading = true; + return this.urlOptions.exportURL(params); + }).then(response => { + this.$download.excel(response, '工厂.xls'); + this.exportLoading = false; + }).catch(() => { }); + } + } +} diff --git a/src/views/packing/mixins/code-filter.js b/src/views/packing/mixins/code-filter.js new file mode 100644 index 0000000..30c5f12 --- /dev/null +++ b/src/views/packing/mixins/code-filter.js @@ -0,0 +1,69 @@ + +/* + * @Date: 2020-12-29 16:49:28 + * @LastEditors: DY + * @LastEditTime: 2023-09-12 11:13:34 + * @FilePath: \basic-admin\src\filters\basicData\index.js + * @Description: + */ + +const table = { + lineStatus: { + 1: '生产中', + 2: '停止', + 3: '未知', + }, + reportType: { + 1: '日', + 2: '周', + 3: '月' + } +} + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),''); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value] + } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} +export default function (dictTable) { + return function (val) { + return table?.[dictTable]?.[val] + } +} diff --git a/src/views/packing/packagingPrintLog/SmallTitle.vue b/src/views/packing/packagingPrintLog/SmallTitle.vue new file mode 100644 index 0000000..93b4a18 --- /dev/null +++ b/src/views/packing/packagingPrintLog/SmallTitle.vue @@ -0,0 +1,65 @@ +<!-- + * @Author: zwq + * @Date: 2023-08-01 15:27:31 + * @LastEditors: zwq + * @LastEditTime: 2023-08-01 16:25:54 + * @Description: +--> +<template> + <div :class="[className, { 'p-0': noPadding }]"> + <slot /> + </div> +</template> + +<script> +export default { + props: { + size: { + // 取值范围: xl lg md sm + type: String, + default: 'de', + validator: function (val) { + return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; + }, + }, + noPadding: { + type: Boolean, + default: false, + }, + }, + computed: { + className: function () { + return `${this.size}-title`; + }, + }, +}; +</script> + +<style lang="scss" scoped> +$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); +$mgr: 8px; +@each $size, $height in $pxls { + .#{$size}-title { + font-size: 18px; + line-height: $height; + color: #000; + font-weight: 500; + font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; + + &::before { + content: ''; + display: inline-block; + vertical-align: top; + width: 4px; + height: $height + 2px; + border-radius: 1px; + margin-right: $mgr; + background-color: #0b58ff; + } + } +} + +.p-0 { + padding: 0; +} +</style> diff --git a/src/views/packing/packagingPrintLog/add-or-updata.vue b/src/views/packing/packagingPrintLog/add-or-updata.vue new file mode 100644 index 0000000..a7d4cbc --- /dev/null +++ b/src/views/packing/packagingPrintLog/add-or-updata.vue @@ -0,0 +1,418 @@ +<!-- + * @Author: zhp + * @Date: 2023-10-17 16:50:19 + * @LastEditTime: 2023-11-04 14:28:45 + * @LastEditors: zhp + * @Description: +--> +<template> + <el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%"> + <small-title slot="title" :no-padding="true"> + {{ !dataForm.id ? '新增' : '编辑' }} + </small-title> + + <div class="content"> + <div class="visual-part"> + <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" + @keyup.enter.native="dataFormSubmit"> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="包装流水号" prop="packagingCode"> + <el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="内容" prop="content"> + <el-input v-model="dataForm.content" clearable placeholder="请输入内容" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="所属工单" prop="workOrderId"> + <el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable> + <el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" /> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="客户" prop="customerId"> + <el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable> + <el-option v-for="dict in customerList" :key="dict.id" :label="dict.name" :value="dict.id" /> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="标签模板" prop="modelId"> + <el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable> + <el-option v-for="dict in modelList" :key="dict.id" :label="dict.name" :value="dict.id" /> + </el-select> + </el-form-item> + </el-col> + <!-- <el-col :span="12"> + <el-form-item label="单位平方数" prop="area"> + <el-input v-model="dataForm.area" placeholder="请输入单位平方数" /> + </el-form-item> + </el-col> --> + </el-row> + <!-- <el-row :gutter="20"> + <el-col :span="24"> + <el-form-item label="完成单位产品用时" prop="processTime"> + <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" /> + </el-form-item> + </el-col> + </el-row> --> + </el-form> + + <!-- <small-title + style="margin: 16px 0; padding-left: 8px" + :no-padding="true"> + 产品属性列表 + </small-title> + + <div class="attr-list"> + <base-table + :table-props="tableProps" + :page="listQuery.pageNo" + :limit="listQuery.pageSize" + :add-button-show="isdetail ? null : '添加属性'" + @emitButtonClick="addNew()" + :table-data="productAttributeList"> + <method-btn + v-if="!isdetail" + slot="handleBtn" + :width="120" + label="操作" + :method-list="tableBtn" + @clickBtn="handleClick" /> + </base-table> + <pagination + v-show="listQuery.total > 0" + :total="listQuery.total" + :page.sync="listQuery.pageNo" + :limit.sync="listQuery.pageSize" + :page-sizes="[5, 10, 15]" + @pagination="getList" /> + </div> --> + </div> + </div> + + <!-- <div style="position: absolute; bottom: 24px; right: 24px"> + <el-button style="margin-right: 10px" @click="goback()">返回</el-button> + <el-button v-if="isdetail" type="primary" @click="goEdit()"> + 编辑 + </el-button> + <span v-if="!isdetail"> + <el-button type="primary" @click="dataFormSubmit()">保存</el-button> + <el-button + v-if="dataForm.id && !isdetail" + type="primary" + @click="addNew()"> + 添加属性 + </el-button> + </span> + </div> --> + <template slot="footer"> + <el-button style="" @click="goback()">取消</el-button> + <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> + 编辑 + </el-button> --> + <el-button type="primary" @click="dataFormSubmit()">确定</el-button> + </template> + </el-dialog> +</template> + +<script> + +// import { +// createPacking, +// updatePacking, +// getPacking, +// getWorkOrderList, +// getCode, +// getCustomerList, +// getModelList +// } from '@/api/base/packingInfo.js'; +// import productAttrAdd from './attr-add'; +import { parseTime } from '../mixins/code-filter'; +import SmallTitle from './SmallTitle'; + +const tableBtn = [ + { + type: 'edit', + btnName: '编辑', + }, + { + type: 'delete', + btnName: '删除', + }, +]; +const tableProps = [ + { + prop: 'createTime', + label: '添加时间', + filter: parseTime, + }, + { + prop: 'name', + label: '属性名', + }, + { + prop: 'value', + label: '属性值', + }, +]; + +export default { + components: { SmallTitle }, + data() { + return { + visible: false, + addOrUpdateVisible: false, + tableBtn, + tableProps, + customerList: [], + modelList:[], + workOrderList:[], + productAttributeList: [], + dataForm: { + id: null, + // name: '', // 产品名称 + packagingCode: '', // 产品编码 + // area: 0, // 单位平方数(float only) + modelId: null, // 产品类型id + workOrderId: null, // 单位产品用时 (s) + customerId: '', // 规格 + content: '', // 单位id + }, + listQuery: { + pageSize: 10, + pageNo: 1, + total: 0, + }, + dataRule: { + content: [ + { + required: true, + message: '内容不能为空', + trigger: 'blur', + }, + // { + // type: 'number', + // message: '产品编码为数字类型', + // trigger: 'blur', + // transfom: 'val => Number(val)', + // }, + ], + workOrderId: [ + { + required: true, + message: '所属工单不能为空', + trigger: 'change', + }, + ], + typeDictValue: [ + { + required: true, + message: '产品类型不能为空', + trigger: 'blur', + }, + ], + area: [ + { + type: 'number', + message: '请输入正确的数值', + trigger: 'change', + transform: (val) => Number(val), + }, + ], + processTime: [ + { + required: true, + message: '完成单位产品用时不能为空', + trigger: 'blur', + }, + { + type: 'number', + message: '请输入正确的数值', + trigger: 'blur', + transform: (val) => Number(val), + }, + ], + }, + // isdetail: false, + }; + }, + methods: { + // initData() { + // this.productAttributeList.splice(0); + // this.listQuery.total = 0; + // }, + init(id) { + this.getDict() + // this.initData(); + // this.isdetail = isdetail || false; + this.dataForm.id = id || null; + this.visible = true; + + this.$nextTick(() => { + this.$refs['dataForm'].resetFields(); + + if (this.dataForm.id) { + // 获取产品详情 + getPacking(id).then((response) => { + this.dataForm = response.data; + }); + // 获取产品的属性列表 + // this.getList(); + } else { + getCode().then((res) => { + this.dataForm.packagingCode = res.data; + }); + } + }); + }, + + getDict() { + // 获取产品的属性列表 + getCustomerList().then((response) => { + console.log(response); + this.customerList = response.data + // this.listQuery.total = response.data.total; + }) + getModelList().then((response) => { + console.log(response); + this.modelList = response.data + // this.listQuery.total = response.data.total; + }) + getWorkOrderList().then((response) => { + // console.log(response); + this.workOrderList = response.data + // this.listQuery.total = response.data.total; + }) + }, + // handleClick(raw) { + // if (raw.type === 'delete') { + // this.$confirm( + // `确定对${ + // raw.data.name + // ? '[名称=' + raw.data.name + ']' + // : '[序号=' + raw.data._pageIndex + ']' + // }进行删除操作?`, + // '提示', + // { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // type: 'warning', + // } + // ) + // .then(() => { + // deleteProductAttr(raw.data.id).then(({ data }) => { + // this.$message({ + // message: '操作成功', + // type: 'success', + // duration: 1500, + // onClose: () => { + // this.getList(); + // }, + // }); + // }); + // }) + // .catch(() => {}); + // } else { + // this.addNew(raw.data.id); + // } + // }, + // 表单提交 + dataFormSubmit() { + this.$refs['dataForm'].validate((valid) => { + if (valid) { + // 修改的提交 + if (this.dataForm.id) { + updatePacking(this.dataForm).then((response) => { + this.$modal.msgSuccess('修改成功'); + this.visible = false; + this.$emit('refreshDataList'); + }); + return; + } + // 添加的提交 + createPacking(this.dataForm).then((response) => { + this.$modal.msgSuccess('新增成功'); + this.visible = false; + this.$emit('refreshDataList'); + }); + } + }); + }, + // goEdit() { + // this.isdetail = false; + // }, + // // 新增 / 修改 + // addNew(id) { + // this.addOrUpdateVisible = true; + // this.$nextTick(() => { + // this.$refs.addOrUpdate.init(id); + // }); + // }, + goback() { + this.$emit('refreshDataList'); + this.visible = false; + // this.initData(); + }, + }, +}; +</script> + +<!-- <style scoped> +.drawer >>> .el-drawer { + border-radius: 8px 0 0 8px; + display: flex; + flex-direction: column; +} + +.drawer >>> .el-form-item__label { + padding: 0; +} + +.drawer >>> .el-drawer__header { + margin: 0; + padding: 32px 32px 24px; + border-bottom: 1px solid #dcdfe6; +} +.drawer >>> .el-drawer__body { + flex: 1; + height: 1px; + display: flex; + flex-direction: column; +} + +.drawer >>> .content { + padding: 30px 24px; + flex: 1; + display: flex; + flex-direction: column; + /* height: 100%; */ +} + +.drawer >>> .visual-part { + flex: 1 auto; + max-height: 76vh; + overflow: hidden; + overflow-y: scroll; + padding-right: 10px; /* 调整滚动条样式 */ +} + +.drawer >>> .el-form, +.drawer >>> .attr-list { + padding: 0 16px; +} + +.drawer-body__footer { + display: flex; + justify-content: flex-end; + padding: 18px; +} +</style> --> diff --git a/src/views/packing/packagingPrintLog/index.vue b/src/views/packing/packagingPrintLog/index.vue new file mode 100644 index 0000000..df1d0fb --- /dev/null +++ b/src/views/packing/packagingPrintLog/index.vue @@ -0,0 +1,343 @@ +<!-- + * @Author: zwq + * @Date: 2023-08-01 14:55:51 + * @LastEditors: zhp + * @LastEditTime: 2023-11-04 14:45:25 + * @Description: +--> +<template> + <div class="app-container"> + <search-bar + :formConfigs="formConfig" + ref="searchBarForm" + @headBtnClick="buttonClick" /> + <base-table + :table-props="tableProps" + :page="listQuery.pageNo" + :limit="listQuery.pageSize" + :table-data="tableData"> + <method-btn + v-if="tableBtn.length" + slot="handleBtn" + :width="120" + label="操作" + :method-list="tableBtn" + @clickBtn="handleClick" /> + </base-table> + <pagination + :limit.sync="listQuery.pageSize" + :page.sync="listQuery.pageNo" + :total="listQuery.total" + @pagination="getDataList" /> + <add-or-update + v-if="addOrUpdateVisible" + ref="addOrUpdate" + @refreshDataList="getDataList" /> + </div> +</template> + +<script> +import AddOrUpdate from './add-or-updata'; +// import unitDict from './unitDict'; +import basicPage from '../mixins/basic-page'; +import { parseTime } from '../mixins/code-filter'; +// import { +// getPackingModel, +// } from '@/api/base/printModel.js' +// import { +// deletePacking, +// getPackingPage, +// getWorkOrderList, +// exportPackingExcel, +// } from '@/api/base/packingInfo'; + +const tableProps = [ + { + prop: 'packagingCode', + label: '包装流水号' + }, + { + prop: 'workOrderName', + label: '所属工单' + }, + { + prop: 'customerName', + label: '客户' + }, + { + prop: 'content', + label: '内容', + // subcomponent: unitDict, + }, + { + prop: 'modelName', + label: '标签模板', + // subcomponent: unitDict, + }, + // { + // prop: 'printStatus', + // label: '打印状态', + // // subcomponent: unitDict, + // }, + { + prop: 'createTime', + label: '生成日期', + filter: parseTime + }, +]; + +export default { + mixins: [basicPage], + data() { + return { + // urlOptions: { + // getDataListURL: getPackingPage, + // deleteURL: deletePacking, + // exportURL: exportPackingExcel, + // }, + tableProps, + tableBtn: [ + this.$auth.hasPermi(`base:packaging-print-log:update`) + ? { + type: 'edit', + btnName: '编辑', + } + : undefined, + this.$auth.hasPermi(`base:packaging-print-log:delete`) + ? { + type: 'delete', + btnName: '删除', + } + : undefined, + { + type: 'print', + btnName: '打印', + }, + ].filter((v) => v), + tableData: [], + listQuery: { + pageNo: 1, + pageSize: 10, + total:0 + }, + formConfig: [ + // { + // type: 'select', + // label: '工单', + // selectOptions: [], + // labelField: 'name', + // valueField: 'id', + // param: 'workOrderId' + // }, + // { + // // parent: 'dateFilterType', + // // 时间段选择 + // type: 'datePicker', + // // label: '时间段', + // dateType: 'daterange', + // format: 'yyyy-MM-dd HH:mm:ss', + // valueFormat: 'yyyy-MM-dd HH:mm:ss', + // defaultTime: ['00:00:00', '00:00:00'], + // rangeSeparator: '-', + // startPlaceholder: '开始时间', + // endPlaceholder: '结束时间', + // param: 'createTime', + // }, + { + type: 'button', + btnName: '搜索', + name: 'search', + color: 'primary', + }, + // { + // type: 'separate', + // }, + // { + // type: 'button', + // btnName: '重置', + // name: 'reset', + // }, + // { + // type: 'separate', + // }, + // { + // type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', + // btnName: '新增', + // name: 'add', + // color: 'success', + // plain: true, + // }, + // { + // type: 'separate', + // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', + // }, + // { + // type: this.$auth.hasPermi('base:product:export') ? 'button' : '', + // btnName: '导出', + // name: 'export', + // color: 'warning', + // }, + ], + }; + }, + components: { + AddOrUpdate, + }, + created() { + // this.getDict() + this.getDataList() + }, + methods: { + getDataList() { + this.tableData = [{ + packagingCode: 123, + workOrderName: '测试', + customerName: '客户111', + content: '22323232', + modelName: '测试模板', + createTime: '2023 10 31' + }] + }, + getDict() { + // 获取产品的属性列表 + // getCustomerList().then((response) => { + // console.log(response); + // this.customerList = response.data + // // this.listQuery.total = response.data.total; + // }) + // getModelList().then((response) => { + // console.log(response); + // this.modelList = response.data + // // this.listQuery.total = response.data.total; + // }) + getWorkOrderList().then((response) => { + // console.log(response); + this.formConfig[0].selectOptions = response.data.map((item) => { + return { + name: item.name, + id: item.id + } + }) + console.log(this.formConfig[0].selectOptions); + // this.listQuery.total = response.data.total; + }) + }, + handlePrint(id) { + // if (id) { + // getPackingModel(id).then(res => { + var obj = { + code: '11111222', + test: '11111', + test2: '3333333', + test1: '222222', + } + // console.log(res); + // getPackingListInfo({ + // size: 20, + // current: 1, + // boxNo: printModel.boxNo + // }).then(result => { + // this.substrateList = result.data.records + // var obj = { + // // time: this.getNewDate(), + // boxNo: this.currentData.boxNo, + // orderNum: this.currentData.orderNum, + // powerLevel: this.currentData.powerLevel, + // sapMaterial: this.currentData.sapMaterial, + // img: 'data:image/png;base64,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', + // // lineBody: this.currentData.lineBody == 1 ? 'F ' : 'S', + // createTime: moment(this.currentData.createTime).format('YYYY-MM-DD HH:mm:ss') + // // modul1: '20210320000012', + // // modul2: '20210320000012', + // // modul3: '20210320000012' + // } + // for (var i = 0; i < this.substrateList.length; i++) { + // var model = 'model' + Number(i + 1) + // var pmpp = 'PMPP' + Number(i + 1) + // var m = 'm' + Number(i + 1) + + // console.log(model) + // // console.log(this.list[i].woSubstrateId) + // // console.log(this.list[i].woSubstrateId) + // obj['' + model + ''] = this.substrateList[i].woSubstrateId + // obj['' + pmpp + ''] = this.substrateList[i].pmpp + // obj['' + m + ''] = i + 1 + // } + // console.log(obj) + // this.printPreview('预览', res.data) + const hiprintTemplate = this.$print(undefined, { "panels": [{ "index": 0, "name": 1, "height": 210, "width": 297, "paperHeader": 0, "paperFooter": 595.2755905511812, "printElements": [{ "options": { "left": 445.5, "top": 10.5, "height": 9.75, "width": 112.5, "title": "2023-09-11 09:09:09", "coordinateSync": false, "widthHeightSync": false, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 558, "bottom": 19.5, "vCenter": 501.75, "hCenter": 14.625 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 747, "top": 10.5, "height": 24, "width": 22.5, "right": 780.99609375, "bottom": 24.99609375, "vCenter": 769.74609375, "hCenter": 12.99609375, "field": "img", "fit": "", "coordinateSync": false, "widthHeightSync": false }, "printElementType": { "title": "Logo", "type": "image" } }, { "options": { "left": 322.5, "top": 10.5, "height": 24, "width": 22.5, "right": 351, "bottom": 30.75, "vCenter": 339.75, "hCenter": 18.75, "field": "img", "fit": "", "coordinateSync": false, "widthHeightSync": false }, "printElementType": { "title": "Logo", "type": "image" } }, { "options": { "left": 346.5, "top": 12, "height": 17, "width": 54, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "TPVM", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 283.5, "bottom": 18.5, "vCenter": 259.5, "hCenter": 10 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 778.5, "top": 13.5, "height": 17, "width": 54, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "TPVM", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 838.74609375, "bottom": 20.99609375, "vCenter": 814.74609375, "hCenter": 12.49609375 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 10.5, "top": 13.5, "height": 9.75, "width": 112.5, "title": "2023-09-11 09:09:09", "coordinateSync": false, "widthHeightSync": false, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 123, "bottom": 15, "vCenter": 66.75, "hCenter": 10.125, "field": "createTime", "hideTitle": true }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 439.5, "top": 34.5, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "Order", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 565.5, "bottom": 47.75, "vCenter": 505.5, "hCenter": 39.25 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 280.5, "top": 34.5, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "BOX", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 399.99609375, "bottom": 43.49609375, "vCenter": 339.99609375, "hCenter": 34.99609375 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 141, "top": 34.5, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "SAP Material", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 273.24609375, "bottom": 41.99609375, "vCenter": 213.24609375, "hCenter": 33.49609375 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 571.5, "top": 34.5, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "SAP Material", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 733.74609375, "bottom": 44.24609375, "vCenter": 673.74609375, "hCenter": 35.74609375 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 10.5, "top": 34.5, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "Order", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 130.5, "bottom": 48.5, "vCenter": 70.5, "hCenter": 40 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 700.5, "top": 34.5, "height": 17, "width": 135, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "BOX", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 859.5, "bottom": 50.75, "vCenter": 797.25, "hCenter": 42.25 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 10.5, "top": 52.5, "height": 17, "width": 120, "testData": "Productive 2019 10 27", "fontSize": 6.75, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "Productive 2019 10 27", "right": 130.5, "bottom": 69.5, "vCenter": 70.5, "hCenter": 61, "field": "orderNum", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 280.5, "top": 54, "height": 32, "width": 120, "field": "boxNo", "testData": "301150010006191105100", "fontSize": 9.75, "lineHeight": 18, "textType": "barcode", "title": "301150010006191105100", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 400.5, "bottom": 86, "vCenter": 340.5, "hCenter": 70 }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 703.5, "top": 54, "height": 32, "width": 120, "field": "boxNo", "testData": "301150010006191105100", "fontSize": 9.75, "lineHeight": 18, "textType": "barcode", "title": "301150010006191105100", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 849, "bottom": 87.5, "vCenter": 789, "hCenter": 71.5 }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 141, "top": 54, "height": 17, "width": 120, "testData": "50010006", "fontSize": 6.75, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "50010006", "right": 261, "bottom": 69.5, "vCenter": 201, "hCenter": 61, "field": "sapMaterial", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 439.5, "top": 55.5, "height": 17, "width": 120, "testData": "Productive 2019 10 27", "fontSize": 6.75, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "Productive 2019 10 27", "right": 566.49609375, "bottom": 68.99609375, "vCenter": 506.49609375, "hCenter": 60.49609375, "field": "orderNum", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 583.5, "top": 55.5, "height": 17, "width": 120, "testData": "50010006", "fontSize": 6.75, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "50010006", "right": 701.49609375, "bottom": 68.99609375, "vCenter": 641.49609375, "hCenter": 60.49609375, "field": "sapMaterial", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 616.5, "top": 73.5, "height": 24, "width": 54, "testData": "135", "fontSize": 18.75, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "135", "right": 672.99609375, "bottom": 97.74609375, "vCenter": 645.99609375, "hCenter": 85.74609375, "field": "powerLevel", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 171, "top": 73.5, "height": 24, "width": 54, "testData": "135", "fontSize": 18.75, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "135", "right": 225.75, "bottom": 96.75, "vCenter": 198.75, "hCenter": 84.75, "field": "powerLevel", "coordinateSync": false, "widthHeightSync": false, "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 441, "top": 81, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "Power", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 567.99609375, "bottom": 98.24609375, "vCenter": 507.99609375, "hCenter": 89.74609375 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 10.5, "top": 81, "height": 17, "width": 120, "testData": "单据表头", "fontSize": 16.5, "fontWeight": "700", "textAlign": "center", "hideTitle": true, "title": "Power", "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 130.5, "bottom": 98, "vCenter": 70.5, "hCenter": 89.5 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 441, "top": 102, "height": 17, "width": 186, "testData": "单据表头", "fontSize": 16.5, "textAlign": "center", "hideTitle": true, "title": "Model1-10", "right": 632.49609375, "bottom": 124.49609375, "vCenter": 539.49609375, "hCenter": 115.99609375, "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 219, "top": 102, "height": 17, "width": 186, "testData": "单据表头", "fontSize": 16.5, "textAlign": "center", "hideTitle": true, "title": "Model11-20", "right": 405, "bottom": 126.5, "vCenter": 312, "hCenter": 118, "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 654, "top": 102, "height": 17, "width": 186, "testData": "单据表头", "fontSize": 16.5, "textAlign": "center", "hideTitle": true, "title": "Model11-20", "right": 888.99609375, "bottom": 124.49609375, "vCenter": 795.99609375, "hCenter": 115.99609375, "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 10.5, "top": 102, "height": 17, "width": 186, "testData": "单据表头", "fontSize": 16.5, "textAlign": "center", "hideTitle": true, "title": "Model1-10", "right": 196.5, "bottom": 126.5, "vCenter": 103.5, "hCenter": 118, "coordinateSync": false, "widthHeightSync": false, "backgroundColor": "#696969", "textContentVerticalAlign": "middle", "qrCodeLevel": 0 }, "printElementType": { "title": "单据表头", "type": "text" } }, { "options": { "left": 273, "top": 121.5, "height": 32, "width": 120, "field": "model11", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 393.24609375, "bottom": 154.49609375, "vCenter": 333.24609375, "hCenter": 138.49609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 121.5, "height": 32, "width": 120, "field": "model11", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 11.25, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 832.74609375, "bottom": 155.99609375, "vCenter": 772.74609375, "hCenter": 139.99609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 121.5, "height": 32, "width": 120, "field": "model1", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 121.5, "height": 32, "width": 120, "field": "model1", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 622.5, "bottom": 150.5, "vCenter": 562.5, "hCenter": 134.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 462, "top": 129, "height": 16.5, "width": 19.5, "title": "文本", "field": "m1", "testData": "1", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 480.24609375, "bottom": 145.74609375, "vCenter": 470.49609375, "hCenter": 137.49609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 129, "height": 16.5, "width": 25.5, "title": "文本", "field": "m11", "testData": "11", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 258.24609375, "bottom": 144.99609375, "vCenter": 248.49609375, "hCenter": 136.74609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 672, "top": 129, "height": 16.5, "width": 25.5, "title": "文本", "field": "m11", "testData": "11", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 709.5, "bottom": 144, "vCenter": 696.75, "hCenter": 135.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 129, "height": 16.5, "width": 19.5, "field": "m1", "testData": "1", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 35.25, "bottom": 145.5, "vCenter": 25.5, "hCenter": 137.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 273, "top": 166.5, "height": 32, "width": 120, "field": "model12", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 393, "bottom": 198.5, "vCenter": 333, "hCenter": 182.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 166.5, "height": 32, "width": 120, "field": "model2", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 618, "bottom": 198.5, "vCenter": 558, "hCenter": 182.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 166.5, "height": 32, "width": 120, "field": "model12", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 828.99609375, "bottom": 197.99609375, "vCenter": 768.99609375, "hCenter": 181.99609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 166.5, "height": 32, "width": 120, "field": "model2", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 177.24609375, "bottom": 198.74609375, "vCenter": 117.24609375, "hCenter": 182.74609375, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 238.5, "top": 171, "height": 16.5, "width": 25.5, "field": "m12", "testData": "12", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 265.5, "bottom": 187.5, "vCenter": 252.75, "hCenter": 179.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 670.5, "top": 171, "height": 16.5, "width": 25.5, "field": "m12", "testData": "12", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 702.99609375, "bottom": 187.74609375, "vCenter": 690.24609375, "hCenter": 179.49609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 174, "height": 16.5, "width": 19.5, "field": "m2", "testData": "2", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 36, "bottom": 190.5, "vCenter": 26.25, "hCenter": 182.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 462, "top": 175.5, "height": 16.5, "width": 19.5, "title": "文本", "field": "m2", "testData": "2", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 487.74609375, "bottom": 188.49609375, "vCenter": 477.99609375, "hCenter": 180.24609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 706.5, "top": 208.5, "height": 32, "width": 120, "field": "model13", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 832.5, "bottom": 243.5, "vCenter": 772.5, "hCenter": 227.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 273, "top": 213, "height": 32, "width": 120, "field": "model13", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 394.74609375, "bottom": 244.49609375, "vCenter": 334.74609375, "hCenter": 228.49609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 213, "height": 32, "width": 120, "field": "model3", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 614.25, "bottom": 245, "vCenter": 554.25, "hCenter": 229, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 213, "height": 32, "width": 120, "field": "model3", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 177.99609375, "bottom": 242.99609375, "vCenter": 117.99609375, "hCenter": 226.99609375, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 672, "top": 219, "height": 16.5, "width": 25.5, "title": "文本", "field": "m13", "testData": "13", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 705, "bottom": 235.5, "vCenter": 692.25, "hCenter": 227.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 462, "top": 220.5, "height": 16.5, "width": 19.5, "title": "文本", "field": "m3", "testData": "3", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 481.5, "bottom": 237, "vCenter": 471.75, "hCenter": 228.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 220.5, "height": 16.5, "width": 25.5, "field": "m13", "testData": "13", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 264.99609375, "bottom": 235.74609375, "vCenter": 252.24609375, "hCenter": 227.49609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 15, "top": 220.5, "height": 16.5, "width": 19.5, "field": "m3", "testData": "3", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 34.5, "bottom": 237, "vCenter": 24.75, "hCenter": 228.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 706.5, "top": 258, "height": 32, "width": 120, "field": "model14", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 833.49609375, "bottom": 287.99609375, "vCenter": 773.49609375, "hCenter": 271.99609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 273, "top": 259.5, "height": 32, "width": 120, "field": "model14", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 393.99609375, "bottom": 290.99609375, "vCenter": 333.99609375, "hCenter": 274.99609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 259.5, "height": 32, "width": 120, "field": "model4", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "title": "条形码", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 617.49609375, "bottom": 290.99609375, "vCenter": 557.49609375, "hCenter": 274.99609375 }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 259.5, "height": 32, "width": 120, "field": "model4", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 178.5, "bottom": 288.5, "vCenter": 118.5, "hCenter": 272.5, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 672, "top": 265.5, "height": 16.5, "width": 25.5, "field": "m14", "testData": "14", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 700.74609375, "bottom": 280.74609375, "vCenter": 687.99609375, "hCenter": 272.49609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 462, "top": 267, "height": 16.5, "width": 19.5, "title": "文本", "field": "m4", "testData": "4", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 481.74609375, "bottom": 285.24609375, "vCenter": 471.99609375, "hCenter": 276.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 267, "height": 16.5, "width": 25.5, "field": "m14", "testData": "14", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 264.99609375, "bottom": 285.99609375, "vCenter": 252.24609375, "hCenter": 277.74609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 268.5, "height": 16.5, "width": 19.5, "field": "m4", "testData": "4", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 37.5, "bottom": 283.5, "vCenter": 27.75, "hCenter": 275.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 706.5, "top": 304.5, "height": 32, "width": 120, "field": "model15", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 831, "bottom": 336.5, "vCenter": 771, "hCenter": 320.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 273, "top": 306, "height": 32, "width": 120, "field": "model15", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 387.99609375, "bottom": 337.49609375, "vCenter": 327.99609375, "hCenter": 321.49609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 306, "height": 32, "width": 120, "field": "model5", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 618.24609375, "bottom": 337.49609375, "vCenter": 558.24609375, "hCenter": 321.49609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 306, "height": 32, "width": 120, "field": "model5", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 175.74609375, "bottom": 333.74609375, "vCenter": 115.74609375, "hCenter": 317.74609375, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 672, "top": 312, "height": 16.5, "width": 25.5, "title": "文本", "field": "m15", "testData": "15", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 700.74609375, "bottom": 327.99609375, "vCenter": 687.99609375, "hCenter": 319.74609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 462, "top": 313.5, "height": 16.5, "width": 19.5, "title": "文本", "field": "m5", "testData": "5", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 480.99609375, "bottom": 330.99609375, "vCenter": 471.24609375, "hCenter": 322.74609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 313.5, "height": 16.5, "width": 25.5, "title": "文本", "field": "m15", "testData": "15", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 264, "bottom": 330, "vCenter": 251.25, "hCenter": 321.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 15, "top": 313.5, "height": 16.5, "width": 19.5, "field": "m5", "testData": "5", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 33.75, "bottom": 330, "vCenter": 24, "hCenter": 321.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 273, "top": 354, "height": 32, "width": 120, "field": "model16", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "title": "条形码", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 393, "bottom": 387.5, "vCenter": 333, "hCenter": 371.5 }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 354, "height": 32, "width": 120, "field": "model6", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 616.5, "bottom": 386, "vCenter": 556.5, "hCenter": 370, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 354, "height": 32, "width": 120, "field": "model16", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "title": "条形码", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 832.5, "bottom": 384.5, "vCenter": 772.5, "hCenter": 368.5 }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 354, "height": 32, "width": 120, "field": "model6", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 178.5, "bottom": 386, "vCenter": 118.5, "hCenter": 370, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 462, "top": 361.5, "height": 16.5, "width": 19.5, "title": "文本", "field": "m6", "testData": "6", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 480.24609375, "bottom": 377.49609375, "vCenter": 470.49609375, "hCenter": 369.24609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 672, "top": 361.5, "height": 16.5, "width": 25.5, "title": "16", "field": "m16", "testData": "16", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 699.24609375, "bottom": 376.74609375, "vCenter": 686.49609375, "hCenter": 368.49609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 18, "top": 361.5, "height": 16.5, "width": 19.5, "field": "m6", "testData": "6", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 36, "bottom": 378, "vCenter": 26.25, "hCenter": 369.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 363, "height": 16.5, "width": 25.5, "title": "16", "field": "m16", "testData": "16", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 265.5, "bottom": 379.5, "vCenter": 252.75, "hCenter": 371.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 273, "top": 400.5, "height": 32, "width": 120, "field": "model17", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 389.49609375, "bottom": 431.24609375, "vCenter": 329.49609375, "hCenter": 415.24609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 400.5, "height": 32, "width": 120, "field": "model7", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 620.49609375, "bottom": 432.74609375, "vCenter": 560.49609375, "hCenter": 416.74609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 400.5, "height": 32, "width": 120, "field": "model17", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 828.99609375, "bottom": 432.74609375, "vCenter": 768.99609375, "hCenter": 416.74609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 400.5, "height": 32, "width": 120, "field": "model7", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 180.99609375, "bottom": 424.49609375, "vCenter": 120.99609375, "hCenter": 408.49609375, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 238.5, "top": 406.5, "height": 16.5, "width": 25.5, "field": "m17", "testData": "17", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 265.74609375, "bottom": 422.49609375, "vCenter": 252.99609375, "hCenter": 414.24609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 462, "top": 408, "height": 16.5, "width": 19.5, "title": "文本", "field": "m7", "testData": "7", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 480.24609375, "bottom": 423.24609375, "vCenter": 470.49609375, "hCenter": 414.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 672, "top": 408, "height": 16.5, "width": 25.5, "field": "m17", "testData": "17", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 702, "bottom": 423, "vCenter": 689.25, "hCenter": 414.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 408, "height": 16.5, "width": 19.5, "field": "m7", "testData": "7", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 36.24609375, "bottom": 426.24609375, "vCenter": 26.49609375, "hCenter": 417.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 273, "top": 447, "height": 32, "width": 120, "field": "model18", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 388.5, "bottom": 387.5, "vCenter": 328.5, "hCenter": 371.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 447, "height": 32, "width": 120, "field": "model8", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 613.74609375, "bottom": 478.49609375, "vCenter": 553.74609375, "hCenter": 462.49609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 447, "height": 32, "width": 120, "field": "model18", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 831.24609375, "bottom": 479.24609375, "vCenter": 771.24609375, "hCenter": 463.24609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 448.5, "height": 32, "width": 120, "field": "model8", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 178.5, "bottom": 480.5, "vCenter": 118.5, "hCenter": 464.5, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 462, "top": 454.5, "height": 16.5, "width": 19.5, "title": "文本", "field": "m8", "testData": "8", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 480.24609375, "bottom": 474.24609375, "vCenter": 470.49609375, "hCenter": 465.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 454.5, "height": 16.5, "width": 25.5, "field": "m18", "testData": "18", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 264.99609375, "bottom": 471.24609375, "vCenter": 252.24609375, "hCenter": 462.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 459, "height": 16.5, "width": 19.5, "field": "m8", "testData": "8", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 38.25, "bottom": 472.5, "vCenter": 28.5, "hCenter": 464.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 495, "top": 493.5, "height": 32, "width": 120, "field": "model9", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 616.74609375, "bottom": 525.74609375, "vCenter": 556.74609375, "hCenter": 509.74609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 273, "top": 495, "height": 32, "width": 120, "field": "model19", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 393, "bottom": 526.25, "vCenter": 333, "hCenter": 510.25, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 495, "height": 32, "width": 120, "field": "model19", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 831.99609375, "bottom": 527.24609375, "vCenter": 771.99609375, "hCenter": 511.24609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 495, "height": 32, "width": 120, "field": "model9", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 178.5, "bottom": 521, "vCenter": 118.5, "hCenter": 505, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 462, "top": 501, "height": 16.5, "width": 19.5, "title": "文本", "field": "m9", "testData": "9", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 477.99609375, "bottom": 516.99609375, "vCenter": 468.24609375, "hCenter": 508.74609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 502.5, "height": 16.5, "width": 25.5, "field": "m19", "testData": "19", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 264, "bottom": 519, "vCenter": 251.25, "hCenter": 510.75 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 672, "top": 502.5, "height": 16.5, "width": 25.5, "field": "m19", "testData": "19", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 700.74609375, "bottom": 518.49609375, "vCenter": 687.99609375, "hCenter": 510.24609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 502.5, "height": 16.5, "width": 19.5, "field": "m9", "testData": "9", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 37.74609375, "bottom": 522.24609375, "vCenter": 27.99609375, "hCenter": 513.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 273, "top": 541.5, "height": 32, "width": 120, "field": "model20", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 393.75, "bottom": 573.5, "vCenter": 333.75, "hCenter": 557.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 706.5, "top": 541.5, "height": 32, "width": 120, "field": "model20", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 828.99609375, "bottom": 573.74609375, "vCenter": 768.99609375, "hCenter": 557.74609375, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 58.5, "top": 541.5, "height": 32, "width": 120, "field": "model10", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "right": 180, "bottom": 574.25, "vCenter": 120, "hCenter": 558.25, "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 495, "top": 543, "height": 32, "width": 120, "field": "model10", "testData": "XS888888888", "fontSize": 10.5, "lineHeight": 12.75, "textType": "barcode", "coordinateSync": false, "widthHeightSync": false, "qrCodeLevel": 0, "right": 616.5, "bottom": 573.5, "vCenter": 556.5, "hCenter": 557.5, "title": "条形码" }, "printElementType": { "title": "条形码", "type": "text" } }, { "options": { "left": 459, "top": 549, "height": 16.5, "width": 22.5, "title": "文本", "field": "m10", "testData": "10", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 477.24609375, "bottom": 567.24609375, "vCenter": 465.99609375, "hCenter": 558.99609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 238.5, "top": 549, "height": 16.5, "width": 25.5, "title": "文本", "field": "m20", "testData": "20", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 262.5, "bottom": 565.5, "vCenter": 249.75, "hCenter": 557.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 672, "top": 549, "height": 16.5, "width": 25.5, "title": "文本", "field": "m20", "testData": "20", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 699.24609375, "bottom": 565.74609375, "vCenter": 686.49609375, "hCenter": 557.49609375 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 16.5, "top": 549, "height": 16.5, "width": 22.5, "field": "m10", "testData": "10", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 36, "bottom": 565.5, "vCenter": 26.25, "hCenter": 557.25 }, "printElementType": { "title": "文本", "type": "text" } }, { "options": { "left": 673.5, "top": 454.5, "height": 16.5, "width": 25.5, "field": "m18", "testData": "18", "coordinateSync": false, "widthHeightSync": false, "hideTitle": true, "fontSize": 16.5, "textAlign": "center", "textContentVerticalAlign": "middle", "qrCodeLevel": 0, "right": 699.24609375, "bottom": 471.24609375, "vCenter": 686.49609375, "hCenter": 462.99609375, "title": "文本" }, "printElementType": { "title": "文本", "type": "text" } }], "paperNumberLeft": 822, "paperNumberTop": 592.5, "rotate": true, "watermarkOptions": {} }] }, obj, {}, { + // styleHandler: () => { + // const css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">' + // return css + // } + }) + + hiprintTemplate.on('printSuccess', function () { + console.log(1111); + // that.$notification.success({ + // // key: key, + // placement: 'topRight', + // message: key + ' 打印成功', + // description: 'Api单独直接打印回调', + // }); + }); + console.log(hiprintTemplate) + // }) + // } else { + // this.$message({ + // message: '请选择打印标签模板', + // type: 'warning' + // }); + // } + }, + closeCallback(vue) { + console.log('关闭了打印工具') + }, + buttonClick(val) { + switch (val.btnName) { + case 'search': + this.listQuery.pageNo = 1; + this.listQuery.pageSize = 10; + this.listQuery.workOrderId = val.workOrderId; + if (val.createTime && val.createTime.length != 0) { + this.listQuery.createTime = val.createTime + // this.listQuery.createTime[1] = val.timeVal[1] + } else { + this.listQuery.createTime = undefined + // this.listQuery.endTime = undefined + } + this.getDataList(); + console.log(this.tableData) + break; + case 'reset': + this.$refs.searchBarForm.resetForm(); + this.listQuery = { + pageSize: 10, + pageNo: 1, + total: 1, + }; + this.getDataList(); + break; + case 'add': + this.addOrEditTitle = '新增'; + this.addOrUpdateVisible = true; + this.addOrUpdateHandle(); + break; + case 'export': + this.handleExport(); + break; + default: + console.log(val); + } + }, + otherMethods(val) { + this.handlePrint(val.data.modelId) + // this.addOrUpdateVisible = true; + // this.addOrEditTitle = '详情'; + // this.$nextTick(() => { + // this.$refs.addOrUpdate.init(val.data.id, true); + // }); + }, + }, +}; +</script> diff --git a/src/views/packing/packagingPrintLog/unitDict.vue b/src/views/packing/packagingPrintLog/unitDict.vue new file mode 100644 index 0000000..94702ab --- /dev/null +++ b/src/views/packing/packagingPrintLog/unitDict.vue @@ -0,0 +1,15 @@ +<template> + <dict-tag + :type="DICT_TYPE.UNIT_DICT" + :value="injectData.unitDictValue" /> +</template> +<script> +export default { + props: { + injectData: { + type: Object, + default: () => ({}), + }, + }, +}; +</script> diff --git a/src/views/packing/packagingPrintModel/SmallTitle.vue b/src/views/packing/packagingPrintModel/SmallTitle.vue new file mode 100644 index 0000000..93b4a18 --- /dev/null +++ b/src/views/packing/packagingPrintModel/SmallTitle.vue @@ -0,0 +1,65 @@ +<!-- + * @Author: zwq + * @Date: 2023-08-01 15:27:31 + * @LastEditors: zwq + * @LastEditTime: 2023-08-01 16:25:54 + * @Description: +--> +<template> + <div :class="[className, { 'p-0': noPadding }]"> + <slot /> + </div> +</template> + +<script> +export default { + props: { + size: { + // 取值范围: xl lg md sm + type: String, + default: 'de', + validator: function (val) { + return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; + }, + }, + noPadding: { + type: Boolean, + default: false, + }, + }, + computed: { + className: function () { + return `${this.size}-title`; + }, + }, +}; +</script> + +<style lang="scss" scoped> +$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); +$mgr: 8px; +@each $size, $height in $pxls { + .#{$size}-title { + font-size: 18px; + line-height: $height; + color: #000; + font-weight: 500; + font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; + + &::before { + content: ''; + display: inline-block; + vertical-align: top; + width: 4px; + height: $height + 2px; + border-radius: 1px; + margin-right: $mgr; + background-color: #0b58ff; + } + } +} + +.p-0 { + padding: 0; +} +</style> diff --git a/src/views/packing/packagingPrintModel/add-or-updata.vue b/src/views/packing/packagingPrintModel/add-or-updata.vue new file mode 100644 index 0000000..a9cff3c --- /dev/null +++ b/src/views/packing/packagingPrintModel/add-or-updata.vue @@ -0,0 +1,441 @@ +<!-- + * @Author: zhp + * @Date: 2023-10-17 16:50:19 + * @LastEditTime: 2023-11-04 14:28:57 + * @LastEditors: zhp + * @Description: +--> +<template> + <el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%"> + <small-title slot="title" :no-padding="true"> + {{ !dataForm.id ? '新增' : '编辑' }} + </small-title> + + <div class="content"> + <div class="visual-part"> + <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" + @keyup.enter.native="dataFormSubmit"> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="模板名称" prop="name"> + <el-input v-model="dataForm.name" clearable placeholder="请输入模板名称" /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="标签类型" prop="typeId"> + <el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择打印方式" clearable> + <el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" /> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="打印方式" prop="printModel"> + <el-select v-model="dataForm.printModel" style="width: 100%;" placeholder="请选择打印方式" clearable> + <el-option v-for="dict in printModelList" :key="dict.id" :label="dict.name" :value="dict.id" /> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="标签备注" prop="remark"> + <el-input v-model="dataForm.remark" clearable placeholder="请输入标签备注" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="模板设计" prop="content"> + <el-button type="primary" @click="btnClickDesign()">模板设计</el-button> + </el-form-item> + </el-col> + <!-- <el-col :span="12"> + <el-form-item label="单位平方数" prop="area"> + <el-input v-model="dataForm.area" placeholder="请输入单位平方数" /> + </el-form-item> + </el-col> --> + </el-row> + <!-- <el-row :gutter="20"> + <el-col :span="24"> + <el-form-item label="完成单位产品用时" prop="processTime"> + <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" /> + </el-form-item> + </el-col> + </el-row> --> + </el-form> + + <!-- <small-title + style="margin: 16px 0; padding-left: 8px" + :no-padding="true"> + 产品属性列表 + </small-title> + + <div class="attr-list"> + <base-table + :table-props="tableProps" + :page="listQuery.pageNo" + :limit="listQuery.pageSize" + :add-button-show="isdetail ? null : '添加属性'" + @emitButtonClick="addNew()" + :table-data="productAttributeList"> + <method-btn + v-if="!isdetail" + slot="handleBtn" + :width="120" + label="操作" + :method-list="tableBtn" + @clickBtn="handleClick" /> + </base-table> + <pagination + v-show="listQuery.total > 0" + :total="listQuery.total" + :page.sync="listQuery.pageNo" + :limit.sync="listQuery.pageSize" + :page-sizes="[5, 10, 15]" + @pagination="getList" /> + </div> --> + </div> + </div> + + <!-- <div style="position: absolute; bottom: 24px; right: 24px"> + <el-button style="margin-right: 10px" @click="goback()">返回</el-button> + <el-button v-if="isdetail" type="primary" @click="goEdit()"> + 编辑 + </el-button> + <span v-if="!isdetail"> + <el-button type="primary" @click="dataFormSubmit()">保存</el-button> + <el-button + v-if="dataForm.id && !isdetail" + type="primary" + @click="addNew()"> + 添加属性 + </el-button> + </span> + </div> --> + <template slot="footer"> + <el-button style="" @click="goback()">取消</el-button> + <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> + 编辑 + </el-button> --> + <el-button type="primary" @click="dataFormSubmit()">确定</el-button> + </template> + <print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" /> + </el-dialog> +</template> + +<script> + +// import { +// createPackingModel, +// updatePackingModel, +// getPackingModel, +// // getWorkOrderList, +// // getCode, +// // getCustomerList, +// getTypeList +// } from '@/api/base/printModel.js'; +// import productAttrAdd from './attr-add'; +import { parseTime } from '../mixins/code-filter'; +import SmallTitle from './SmallTitle'; +import printModelDesign from '../custom/index' + +const tableBtn = [ + { + type: 'edit', + btnName: '编辑', + }, + { + type: 'delete', + btnName: '删除', + }, +]; +const tableProps = [ + { + prop: 'createTime', + label: '添加时间', + filter: parseTime, + }, + { + prop: 'name', + label: '属性名', + }, + { + prop: 'value', + label: '属性值', + }, +]; + +export default { + components: { SmallTitle, printModelDesign }, + data() { + return { + visible: false, + addOrUpdateVisible: false, + tableBtn, + tableProps, + modelShow:false, + typeList:[], + dataForm: { + id: null, + // name: '', // 产品名称 + name: '', // 产品编码 + // area: 0, // 单位平方数(float only) + typeId: null, // 产品类型id + printModel: null, // 单位产品用时 (s) + content: '', // 规格 + remark: '', // 单位id + }, + printModelList: [ + { + id: 1, + name:'自动' + }, + { + id: 2, + name: '手动' + }, + ], + listQuery: { + pageSize: 10, + pageNo: 1, + total: 0, + }, + dataRule: { + typeId: [ + { + required: true, + message: '打印类型不能为空', + trigger: 'blur', + }, + // { + // type: 'number', + // message: '产品编码为数字类型', + // trigger: 'blur', + // transfom: 'val => Number(val)', + // }, + ], + name: [ + { + required: true, + message: '模板名称不能为空', + trigger: 'blur', + }, + ], + printModel: [ + { + required: true, + message: '模板类型不能为空', + trigger: 'blur', + }, + ], + content: [ + { + required: true, + message: '模板不能为空', + trigger: 'blur', + }, + ], + processTime: [ + { + required: true, + message: '完成单位产品用时不能为空', + trigger: 'blur', + }, + { + type: 'number', + message: '请输入正确的数值', + trigger: 'blur', + transform: (val) => Number(val), + }, + ], + }, + // isdetail: false, + }; + }, + methods: { + getModelData(data) { + console.log(data) + this.content = JSON.stringify(data) + this.dataForm.content = JSON.stringify(data) + }, + btnClickDesign() { + console.log(11111) + this.modelShow = true + this.$nextTick(() => { + this.$refs.printModelDesign.init(this.dataForm.content) + console.log(this.dataForm.content) + }) + // this.$router.push({ + // path: '/printModelDesign' + // }) + }, + // initData() { + // this.productAttributeList.splice(0); + // this.listQuery.total = 0; + // }, + init(id) { + this.getDict() + // this.initData(); + // this.isdetail = isdetail || false; + this.dataForm.id = id || null; + this.visible = true; + + this.$nextTick(() => { + this.$refs['dataForm'].resetFields(); + + if (this.dataForm.id) { + // 获取产品详情 + getPackingModel(id).then((response) => { + this.dataForm = response.data; + }); + // 获取产品的属性列表 + // this.getList(); + } else { + // getCode().then((res) => { + // this.dataForm.packagingCode = res.data; + // }); + } + }); + }, + + getDict() { + // 获取产品的属性列表 + // getCustomerList().then((response) => { + // console.log(response); + // this.customerList = response.data + // // this.listQuery.total = response.data.total; + // }) + getTypeList().then((response) => { + console.log(response); + this.typeList = response.data + // this.listQuery.total = response.data.total; + }) + // getWorkOrderList().then((response) => { + // // console.log(response); + // this.workOrderList = response.data + // // this.listQuery.total = response.data.total; + // }) + }, + // handleClick(raw) { + // if (raw.type === 'delete') { + // this.$confirm( + // `确定对${ + // raw.data.name + // ? '[名称=' + raw.data.name + ']' + // : '[序号=' + raw.data._pageIndex + ']' + // }进行删除操作?`, + // '提示', + // { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // type: 'warning', + // } + // ) + // .then(() => { + // deleteProductAttr(raw.data.id).then(({ data }) => { + // this.$message({ + // message: '操作成功', + // type: 'success', + // duration: 1500, + // onClose: () => { + // this.getList(); + // }, + // }); + // }); + // }) + // .catch(() => {}); + // } else { + // this.addNew(raw.data.id); + // } + // }, + // 表单提交 + dataFormSubmit() { + this.$refs['dataForm'].validate((valid) => { + if (valid) { + // 修改的提交 + if (this.dataForm.id) { + updatePackingModel(this.dataForm).then((response) => { + this.$modal.msgSuccess('修改成功'); + this.visible = false; + this.$emit('refreshDataList'); + }); + return; + } + // 添加的提交 + createPackingModel(this.dataForm).then((response) => { + this.$modal.msgSuccess('新增成功'); + this.visible = false; + this.$emit('refreshDataList'); + }); + } + }); + }, + // goEdit() { + // this.isdetail = false; + // }, + // // 新增 / 修改 + // addNew(id) { + // this.addOrUpdateVisible = true; + // this.$nextTick(() => { + // this.$refs.addOrUpdate.init(id); + // }); + // }, + goback() { + this.$emit('refreshDataList'); + this.visible = false; + // this.initData(); + }, + }, +}; +</script> + +<!-- <style scoped> +.drawer >>> .el-drawer { + border-radius: 8px 0 0 8px; + display: flex; + flex-direction: column; +} + +.drawer >>> .el-form-item__label { + padding: 0; +} + +.drawer >>> .el-drawer__header { + margin: 0; + padding: 32px 32px 24px; + border-bottom: 1px solid #dcdfe6; +} +.drawer >>> .el-drawer__body { + flex: 1; + height: 1px; + display: flex; + flex-direction: column; +} + +.drawer >>> .content { + padding: 30px 24px; + flex: 1; + display: flex; + flex-direction: column; + /* height: 100%; */ +} + +.drawer >>> .visual-part { + flex: 1 auto; + max-height: 76vh; + overflow: hidden; + overflow-y: scroll; + padding-right: 10px; /* 调整滚动条样式 */ +} + +.drawer >>> .el-form, +.drawer >>> .attr-list { + padding: 0 16px; +} + +.drawer-body__footer { + display: flex; + justify-content: flex-end; + padding: 18px; +} +</style> --> diff --git a/src/views/packing/packagingPrintModel/index.vue b/src/views/packing/packagingPrintModel/index.vue new file mode 100644 index 0000000..11fdd54 --- /dev/null +++ b/src/views/packing/packagingPrintModel/index.vue @@ -0,0 +1,218 @@ +<!-- + * @Author: zwq + * @Date: 2023-08-01 14:55:51 + * @LastEditors: zhp + * @LastEditTime: 2023-11-04 14:41:36 + * @Description: +--> +<template> + <div class="app-container"> + <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> + <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData"> + <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" + @clickBtn="handleClick" /> + </base-table> + <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" + @pagination="getDataList" /> + <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> + <print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" /> + </div> +</template> + +<script> +import AddOrUpdate from './add-or-updata'; +// import unitDict from './unitDict'; +import basicPage from '../mixins/basic-page'; +import { parseTime } from '../mixins/code-filter'; +import printModelDesign from '../custom/index' +// import { updatePackingModel,} from '@/api/base/printModel.js'; +// import { +// deletePackingModel, +// getPackingModelPage, +// // exportPackingExcel, +// } from '@/api/base/printModel'; + +const tableProps = [ + { + prop: 'name', + label: '模板名称' + }, + // { + // prop: 'typeName', + // label: '标签类型' + // }, + { + prop: 'printModel', + label: '打印方式', + filter: (val) => val ==1 ? '自动打印' : '手动打印', + }, + { + prop: 'remark', + label: '备注', + // subcomponent: unitDict, + }, +]; + +export default { + mixins: [basicPage], + data() { + return { + // urlOptions: { + // getDataListURL: getPackingModelPage, + // deleteURL: deletePackingModel, + // // exportURL: exportPackingExcel, + // }, + listQuery: { + pageNo: 1, + pageSize: 10, + total: 0 + }, + tableProps, + modelShow:false, + tableBtn: [ + this.$auth.hasPermi(`base:packaging-print-model:update`) + ? { + type: 'edit', + btnName: '编辑', + } + : undefined, + this.$auth.hasPermi(`base:packaging-print-model:delete`) + ? { + type: 'delete', + btnName: '删除', + } + : undefined, + { + type: 'print', + btnName: '查看', + }, + ].filter((v) => v), + tableData: [], + formConfig: [ + // { + // type: 'input', + // label: '工单', + // placeholder: '工单', + // param: 'workOrderId', + // }, + // { + // // parent: 'dateFilterType', + // // 日期选择 + // type: 'datePicker', + // label: '时间', + // dateType: 'date', + // placeholder: '选择日期', + // format: 'yyyy-MM-dd', + // valueFormat: 'yyyy-MM-dd', + // param: 'createTime', + // }, + { + type: 'button', + btnName: '搜索', + name: 'search', + color: 'primary', + }, + // { + // type: 'separate', + // }, + // { + // type: 'button', + // btnName: '重置', + // name: 'reset', + // }, + { + type: 'separate', + }, + { + type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '', + btnName: '新增模板', + name: 'add', + color: 'success', + plain: true, + }, + // { + // type: 'separate', + // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', + // }, + // { + // type: this.$auth.hasPermi('base:product:export') ? 'button' : '', + // btnName: '导出', + // name: 'export', + // color: 'warning', + // }, + ], + }; + }, + components: { + AddOrUpdate, + printModelDesign + }, + created() { + this.getDataList() + }, + methods: { + getDataList() { + this.tableData = [{ + // packagingCode: 123, + remark: '测试', + // customerName: '客户111', + printModel: '自动打印', + name: '测试模板', + // createTime: '2023 10 31' + }] + }, + buttonClick(val) { + switch (val.btnName) { + case 'search': + this.listQuery.pageNo = 1; + this.listQuery.pageSize = 10; + this.listQuery.packagingCode = val.packagingCode; + this.listQuery.createTime = val.createTime; + this.getDataList(); + break; + case 'reset': + this.$refs.searchBarForm.resetForm(); + this.listQuery = { + pageSize: 10, + pageNo: 1, + total: 1, + }; + this.getDataList(); + break; + case 'add': + this.addOrEditTitle = '新增'; + this.addOrUpdateVisible = true; + this.addOrUpdateHandle(); + break; + case 'export': + this.handleExport(); + break; + default: + console.log(val); + } + }, + getModelData(data) { + // console.log(data) + // this.content = JSON.stringify(data) + // this.dataForm.content = JSON.stringify(data) + console.log(data) + // this.content = JSON.stringify(data) + this.obj.content = JSON.stringify(data) + updatePackingModel(this.obj).then((response) => { + // this.$modal.msgSuccess('修改成功'); + // this.visible = false; + // this.$emit('refreshDataList'); + }); + + }, + otherMethods(val) { + console.log(val) + this.modelShow = true + this.$nextTick(() => { + this.obj = val.data + this.$refs.printModelDesign.init(val.data.content) + }) + }, + }, +}; +</script> diff --git a/src/views/packing/packagingPrintModel/unitDict.vue b/src/views/packing/packagingPrintModel/unitDict.vue new file mode 100644 index 0000000..94702ab --- /dev/null +++ b/src/views/packing/packagingPrintModel/unitDict.vue @@ -0,0 +1,15 @@ +<template> + <dict-tag + :type="DICT_TYPE.UNIT_DICT" + :value="injectData.unitDictValue" /> +</template> +<script> +export default { + props: { + injectData: { + type: Object, + default: () => ({}), + }, + }, +}; +</script>