diff --git a/src/api/base/store/sysStoreApi.js b/src/api/base/store/sysStoreApi.js index cd38569..af2c6c4 100644 --- a/src/api/base/store/sysStoreApi.js +++ b/src/api/base/store/sysStoreApi.js @@ -28,5 +28,5 @@ export default { // 获取仓库树结构 sysStoreTree(data) { return request('tree', data, 'get') - }, + } } diff --git a/src/api/inventory/inventoryInboundApi.js b/src/api/inventory/inventoryInboundApi.js index b9b0a73..0a842f0 100644 --- a/src/api/inventory/inventoryInboundApi.js +++ b/src/api/inventory/inventoryInboundApi.js @@ -1,7 +1,7 @@ import { baseRequest } from '@/utils/request' const request = (url, ...arg) => baseRequest(`/inventory/inbound/` + url, ...arg) - +const produceRequest = (url, ...arg) => baseRequest(`/produce/inbound/` + url, ...arg) /** * 入库单Api接口管理器 * @@ -15,15 +15,15 @@ export default { }, // 获取入库单 明细列表 inventoryInboundDetailList(data) { - return request('/detail/list', data, 'get') + return request('detail/list', data, 'get') }, // 获取入库单 条码列表 inventoryInboundBarcodeTree(data) { - return request('/barcode/tree/list', data, 'get') + return produceRequest('barcode/tree/list', data, 'get') }, // 获取入库单 条码(子级)列表 inventoryInboundBarcodeTreeChildren(data) { - return request('/barcode/tree/childrenList', data, 'get') + return request('barcode/tree/childrenList', data, 'get') }, // 获取入库单详情 inventoryInboundDetail(data) { diff --git a/src/api/inventory/inventoryInvoiceApi.js b/src/api/inventory/inventoryInvoiceApi.js index 68c8dd3..19dc6a4 100644 --- a/src/api/inventory/inventoryInvoiceApi.js +++ b/src/api/inventory/inventoryInvoiceApi.js @@ -29,4 +29,8 @@ export default { inventoryInvoiceAuditPass(data, edit = false) { return request('audit/pass', data) }, + // 获取发货通知单明细列表 + inventoryInvoiceDetailList(data) { + return request('detail/list', data, 'get') + }, } diff --git a/src/api/production/produceTask/produceReportApi.js b/src/api/production/produceTask/produceReportApi.js index 66b8687..ff1b1ea 100644 --- a/src/api/production/produceTask/produceReportApi.js +++ b/src/api/production/produceTask/produceReportApi.js @@ -24,5 +24,14 @@ export default { // 获取生产汇报单详情 produceReportDetail(data) { return request('detail', data, 'get') + }, + // 产品包装条码 树 + produceReportTreeList(data) { + return request('barcode/tree/list', data, 'get') + }, + + // 产品包装条码 树 子级 + produceReportTreeChildrenList(data) { + return request('barcode/tree/childrenList', data, 'get') } } diff --git a/src/components/Selector/clientSelectorPlus.vue b/src/components/Selector/clientSelectorPlus.vue new file mode 100644 index 0000000..f916346 --- /dev/null +++ b/src/components/Selector/clientSelectorPlus.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/productionBusiness/basicData/supplier/detail/index.vue b/src/views/productionBusiness/basicData/supplier/detail/index.vue index 0e55398..8df6880 100644 --- a/src/views/productionBusiness/basicData/supplier/detail/index.vue +++ b/src/views/productionBusiness/basicData/supplier/detail/index.vue @@ -59,9 +59,7 @@ ref="formRef2" /> - - - + @@ -108,13 +106,10 @@ const formRef1 = ref(null) const formRef2 = ref(null) - const { formData, formRefs, onSubmit, handleBack, fetchData } = useFormHandler( - [...formItems, ...baseFormItems], - { - submitForm: supplierApi.supplierSubmitForm, - getDetail: supplierApi.supplierDetail - } - ) + const { formData, formRefs, onSubmit, handleBack, fetchData } = useFormHandler([...formItems, ...baseFormItems], { + submitForm: supplierApi.supplierSubmitForm, + getDetail: supplierApi.supplierDetail + }) const onSubmitForm = () => { onSubmit({ @@ -145,7 +140,8 @@ }) // 供应商分类 - supplierCategoryApi.supplierCategoryTree({ + supplierCategoryApi + .supplierCategoryTree({ enabledState: 'ENABLE' }) .then((res) => { @@ -155,12 +151,10 @@ } }) }) - }) let activeKey = ref('1') - // 省、市、县 数据回显 const cityOptionsObj = cityOptions.reduce((acc, item) => ((acc[item.value] = item.children), acc), {}) const getCityOptions = () => { diff --git a/src/views/productionBusiness/basicData/supplier/index.vue b/src/views/productionBusiness/basicData/supplier/index.vue index 867390a..f99a490 100644 --- a/src/views/productionBusiness/basicData/supplier/index.vue +++ b/src/views/productionBusiness/basicData/supplier/index.vue @@ -22,7 +22,7 @@ @delTree="delTree" @treeRefresh="treeRefresh" :toolConfig="{ - plus: hasPerm('supplierCategoryAdd'), + plus: true, edit: hasPerm('supplierCategoryEdit'), delete: hasPerm('supplierCategoryDelete'), refresh: true @@ -52,13 +52,11 @@ type: 'ADD' }) " - v-if="hasPerm('supplierAdd')" > 新增 @@ -117,7 +115,7 @@ - + diff --git a/src/views/productionBusiness/inventory/inbound/columns/tableColumn.js b/src/views/productionBusiness/inventory/inbound/columns/tableColumn.js index ea874c3..17e91b5 100644 --- a/src/views/productionBusiness/inventory/inbound/columns/tableColumn.js +++ b/src/views/productionBusiness/inventory/inbound/columns/tableColumn.js @@ -65,7 +65,7 @@ export const tableColumns = [ width: 200, ellipsis: true }, - + { title: '创建人', dataIndex: 'createUserName', diff --git a/src/views/productionBusiness/inventory/inbound/detail/detail.vue b/src/views/productionBusiness/inventory/inbound/detail/detail.vue new file mode 100644 index 0000000..3554a50 --- /dev/null +++ b/src/views/productionBusiness/inventory/inbound/detail/detail.vue @@ -0,0 +1,149 @@ + + + diff --git a/src/views/productionBusiness/inventory/inbound/formFields/detailFields.js b/src/views/productionBusiness/inventory/inbound/formFields/detailFields.js new file mode 100644 index 0000000..7022ad2 --- /dev/null +++ b/src/views/productionBusiness/inventory/inbound/formFields/detailFields.js @@ -0,0 +1,69 @@ +import { required } from '@/utils/formRules' +import tool from '@/utils/tool' + +export const unitFormItems = reactive([ + { + label: '单号:', + name: 'billNumber', + type: 'a-input-number', + span: 6, + attrs: { + placeholder: '请输入编码', + allowClear: true + } + }, + { + label: '业务日期:', + name: 'businessDate', + type: 'a-date-picker', + span: 6, + attrs: { + placeholder: '请输入业务日期', + allowClear: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '状态:', + name: 'state', + type: 'a-select', + span: 6, + attrs: { + placeholder: '请选择可用状态', + options: tool.dictList('PRODUCE_REPORT_STATE') + }, + defaultValue: '' + }, + { + label: '类型:', + name: 'produceType', + type: 'a-select', + span: 6, + attrs: { + options: tool.dictList('PRODUCE_TYPE') + } + }, + { + label: '生产线:', + name: 'productionLineName', + type: 'a-select', + span: 6, + attrs: { + placeholder: '请选择是否基本单位', + options: tool.dictList('YES_NO') + }, + defaultValue: 'NO' + }, + { + label: '备注:', + name: 'remarks', + type: 'a-textarea', + span: 24, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + } +]) + +export const formRules = {} diff --git a/src/views/productionBusiness/inventory/inbound/formFields/searchFields.js b/src/views/productionBusiness/inventory/inbound/formFields/searchFields.js index 2d4ce9d..e72142b 100644 --- a/src/views/productionBusiness/inventory/inbound/formFields/searchFields.js +++ b/src/views/productionBusiness/inventory/inbound/formFields/searchFields.js @@ -1,12 +1,13 @@ import tool from '@/utils/tool' export const searchFields = [ + { name: 'billNumber', label: '单号', component: 'a-input', props: { placeholder: '请输入单号' } }, { name: 'billNumber', label: '单号', component: 'a-input', props: { placeholder: '请输入单号' } }, { label: '类型:', name: 'type', - type: 'a-select', - attrs: { + component: 'a-select', + props: { placeholder: '请选择类型', allowClear: true, options: tool.dictList('INBOUND_TYPE') @@ -15,9 +16,8 @@ export const searchFields = [ { label: '仓库:', name: 'storeId', - type: 'a-tree-select', - span: 6, - attrs: { + component: 'a-tree-select', + props: { placeholder: '请选择仓库', treeData: [], fieldNames: { @@ -25,8 +25,7 @@ export const searchFields = [ label: 'name', value: 'id' } - }, - defaultValue: '' + } }, { name: 'customerName', label: '供货单位名称', component: 'a-input', props: { placeholder: '请输入供货单位名称' } }, { name: 'customerNumber', label: '供货单位编码', component: 'a-input', props: { placeholder: '请输入供货单位编码' } } diff --git a/src/views/productionBusiness/inventory/inbound/index.vue b/src/views/productionBusiness/inventory/inbound/index.vue index 1ac45af..18fdf17 100644 --- a/src/views/productionBusiness/inventory/inbound/index.vue +++ b/src/views/productionBusiness/inventory/inbound/index.vue @@ -1,14 +1,13 @@ + + + diff --git a/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.css b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.css new file mode 100644 index 0000000..430bba2 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.css @@ -0,0 +1,342 @@ +@font-face { + font-family: "iconfont"; /* Project id 3559670 */ + src: url("iconfont.woff2?t=1667531544868") format("woff2"), + url("iconfont.woff?t=1667531544868") format("woff"), + url("iconfont.ttf?t=1667531544868") format("truetype"); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.sv-edit-data:before { + content: "\e655"; +} + +.sv-shimmer:before { + content: "\e6d6"; +} + +.sv-origin:before { + content: "\e6ac"; +} + +.sv-zIndex:before { + content: "\e603"; +} + +.sv-structure:before { + content: "\ec6f"; +} + +.sv-list:before { + content: "\e742"; +} + +.sv-grid:before { + content: "\e849"; +} + +.sv-flow:before { + content: "\e611"; +} + +.sv-switch:before { + content: "\e6f6"; +} + +.sv-theme:before { + content: "\e644"; +} + +.sv-element:before { + content: "\e615"; +} + +.sv-pdf:before { + content: "\e67a"; +} + +.sv-browser:before { + content: "\e726"; +} + +.sv-font-big:before { + content: "\eb04"; +} + +.sv-font-small:before { + content: "\eb05"; +} + +.sv-font-bold:before { + content: "\ec83"; +} + +.sv-font-tiny:before { + content: "\e6c1"; +} + +.sv-options:before { + content: "\e607"; +} + +.sv-close:before { + content: "\e646"; +} + +.sv-clone:before { + content: "\ec7a"; +} + +.sv-cut:before { + content: "\e643"; +} + +.sv-preview:before { + content: "\e61c"; +} + +.sv-zoom-in:before { + content: "\e60f"; +} + +.sv-zoom-out:before { + content: "\e610"; +} + +.sv-edit:before { + content: "\e6b9"; +} + +.sv-paste:before { + content: "\e6c0"; +} + +.sv-copy:before { + content: "\e6c2"; +} + +.sv-unlock:before { + content: "\e6e7"; +} + +.sv-lock:before { + content: "\e6e8"; +} + +.sv-zIndex-plus:before { + content: "\e715"; +} + +.sv-zIndex-minus:before { + content: "\e716"; +} + +.sv-zIndex-top:before { + content: "\e71f"; +} + +.sv-sigh:before { + content: "\e724"; +} + +.sv-ask:before { + content: "\e725"; +} + +.sv-dev-code:before { + content: "\e733"; +} + +.sv-bug:before { + content: "\e73f"; +} + +.sv-zIndex-bottom:before { + content: "\e71d"; +} + +.sv-new:before { + content: "\e64d"; +} + +.sv-clear:before { + content: "\e62d"; +} + +.sv-base:before { + content: "\e7d0"; +} + +.sv-export:before { + content: "\eabf"; +} + +.sv-import:before { + content: "\eac0"; +} + +.sv-add:before { + content: "\eaf3"; +} + +.sv-printer:before { + content: "\eabe"; +} + +.sv-save:before { + content: "\eabd"; +} + +.sv-more:before { + content: "\e625"; +} + +.sv-menu:before { + content: "\e628"; +} + +.sv-nav-right:before { + content: "\e629"; +} + +.sv-nav-up:before { + content: "\e62a"; +} + +.sv-nav-left:before { + content: "\e62b"; +} + +.sv-nav-down:before { + content: "\e62c"; +} + +.sv-setting:before { + content: "\e62e"; +} + +.sv-delete:before { + content: "\e630"; +} + +.sv-undo:before { + content: "\e631"; +} + +.sv-redo:before { + content: "\e632"; +} + +.sv-refresh:before { + content: "\e634"; +} + +.sv-history:before { + content: "\e635"; +} + +.sv-html:before { + content: "\e633"; +} + +.sv-longText:before { + content: "\e64c"; +} + +.sv-table:before { + content: "\ec15"; +} + +.sv-qrcode:before { + content: "\e642"; +} + +.sv-image:before { + content: "\e8ba"; +} + +.sv-barcode:before { + content: "\eb64"; +} + +.sv-text:before { + content: "\e60b"; +} + +.sv-vline:before { + content: "\e63a"; +} + +.sv-oval:before { + content: "\eb99"; +} + +.sv-rect:before { + content: "\e620"; +} + +.sv-hline:before { + content: "\e60a"; +} + +.sv-print-c:before { + content: "\e602"; +} + +.sv-print:before { + content: "\e601"; +} + +.sv-c:before { + content: "\e600"; +} + +.sv-vertical:before { + content: "\e706"; +} + +.sv-distributeHor:before { + content: "\e707"; +} + +.sv-right:before { + content: "\e708"; +} + +.sv-left:before { + content: "\e709"; +} + +.sv-distributeVer:before { + content: "\e70f"; +} + +.sv-bottom:before { + content: "\e710"; +} + +.sv-top:before { + content: "\e711"; +} + +.sv-horizontal:before { + content: "\e712"; +} + +.sv-rotate:before { + content: "\e66f"; +} + +.sv-butongbu:before { + content: "\e636"; +} + +.sv-synchronization:before { + content: "\e676"; +} diff --git a/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.ttf b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.ttf new file mode 100644 index 0000000..9638e3d Binary files /dev/null and b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.ttf differ diff --git a/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.woff b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.woff new file mode 100644 index 0000000..6e19925 Binary files /dev/null and b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.woff differ diff --git a/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.woff2 b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.woff2 new file mode 100644 index 0000000..53f7d77 Binary files /dev/null and b/src/views/productionBusiness/labelPrinting/template/detail/css/iconfont.woff2 differ diff --git a/src/views/productionBusiness/labelPrinting/template/detail/css/style.css b/src/views/productionBusiness/labelPrinting/template/detail/css/style.css new file mode 100644 index 0000000..5829f91 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/css/style.css @@ -0,0 +1,174 @@ +/* 字体样式 */ +/*@import "./iconfont.css";*/ + +/* 定义全局样式 */ +/* 在 main.js 入库文件引入 */ +body { + margin: 0; +} + +/* scrollbar */ +::-webkit-scrollbar { + height: 4px; + width: 4px; +} +::-webkit-scrollbar-corner { + height: 4px; + width: 4px; +} +::-webkit-scrollbar-thumb { + background: purple; + border-radius: 2px; + background-image: -webkit-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.2) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.2) 50%, + rgba(255, 255, 255, 0.2) 75%, + transparent 75%, + transparent + ); +} +::-webkit-scrollbar-thumb:hover { + background: purple; +} + +/* flex */ +.flex-row { + display: flex; +} +.flex-col { + display: flex; + flex-direction: column; +} +.flex-wrap { + flex-wrap: wrap; +} +.align-center { + align-items: center; +} +.justify-center { + justify-content: center; +} + +.flex-1 { + flex: 1; +} +.flex-2 { + flex: 2; +} +.flex-3 { + flex: 3; +} +.flex-4 { + flex: 4; +} +.flex-5 { + flex: 5; +} + +.ml-10 { + margin-left: 10px; +} +.mr-10 { + margin-right: 10px; +} +.mt-10 { + margin-top: 10px; +} +.mb-10 { + margin-bottom: 10px; +} + +/* button 样式 为了好看点 */ +button { + padding: 10px; + min-width: 40px; + color: white; + opacity: 0.9; + cursor: pointer; + border-width: 0; + border: 1px solid #d9d9d9; +} +button:hover { + opacity: 1; +} +button i { + font-size: 16px !important; +} +.circle, +.circle-4 { + border-radius: 4px !important; +} +.circle-10 { + border-radius: 10px !important; +} +/* 按钮颜色 */ +.primary { + background: purple; +} +.info { + color: #000; + background: none; +} +.info:hover { + color: purple; + border-color: purple; +} +.secondary { + background: #1976d2; +} +.warning { + background: #d32f2f; +} + +/* modal */ +.modal { + padding: 0; + margin: 0; +} +.modal .mask { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1000; + height: 100%; + background-color: #00000073; +} +.modal .wrap { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1000; + overflow: auto; + background-color: #00000073; + outline: 0; +} +.modal .wrap .box { + position: relative; + margin: 10% auto; + width: 40%; + background: #fff; + border-radius: 4px; + z-index: 1001; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + transition: all 0.3s ease; +} +.modal-box__header { + padding: 10px 14px; + border-bottom: 1px solid #e9e9e9; +} +.modal-box__footer { + text-align: end; +} +.modal-box__footer button { + min-width: 100px; +} +.modal-box__footer button:not(:last-child) { + margin-right: 10px; +} diff --git a/src/views/productionBusiness/labelPrinting/template/detail/hooks/use-paper.js b/src/views/productionBusiness/labelPrinting/template/detail/hooks/use-paper.js new file mode 100644 index 0000000..b33b98e --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/hooks/use-paper.js @@ -0,0 +1,108 @@ +/* + * @Description: + * @Author: CcSimple + * @Github: https://github.com/CcSimple + * @Date: 2023-02-09 13:32:39 + * @LastEditors: CcSimple + * @LastEditTime: 2023-02-09 23:38:03 + */ +import { reactive, computed, toRefs } from "vue"; +import { getHiprintPrintTemplate } from "../utils/template-helper"; + +/** + * vue3 组合式函数 + * 把一些逻辑抽离出来,方便复用 + * 返回 使用方 可用的方法和数据 + */ +export function usePaper(key) { + // 数据 + const state = reactive({ + curPaper: { + type: "A4", + width: 210, + height: 296.6, + }, + paperTypes: { + A3: { + width: 420, + height: 296.6, + }, + A4: { + width: 210, + height: 296.6, + }, + A5: { + width: 210, + height: 147.6, + }, + B3: { + width: 500, + height: 352.6, + }, + B4: { + width: 250, + height: 352.6, + }, + B5: { + width: 250, + height: 175.6, + }, + }, + // 自定义纸张 + paperPopVisible: false, + paperWidth: "220", + paperHeight: "80", + }); + // 计算属性 + const curPaperType = computed(() => { + let type = "other"; + let types = state.paperTypes; + for (const key in types) { + let item = types[key]; + let { width, height } = state.curPaper; + if (item.width === width && item.height === height) { + type = key; + } + } + return type; + }); + const tp = () => { + return getHiprintPrintTemplate(key); + }; + // 方法 + const showPaperPop = () => { + state.paperPopVisible = true; + }; + const hidePaperPop = () => { + state.paperPopVisible = false; + }; + const setPaper = (type, value) => { + try { + if (Object.keys(state.paperTypes).includes(type)) { + state.curPaper = { type: type, width: value.width, height: value.height }; + tp().setPaper(value.width, value.height); + } else { + state.curPaper = { type: "other", width: value.width, height: value.height }; + tp().setPaper(value.width, value.height); + } + } catch (error) { + alert(`操作失败: ${error}`); + } + }; + const setPaperOther = () => { + let value = {}; + value.width = state.paperWidth; + value.height = state.paperHeight; + state.paperPopVisible = false; + setPaper("other", value); + }; + // 暴露给使用方 + return { + ...toRefs(state), + curPaperType, + showPaperPop, + hidePaperPop, + setPaper, + setPaperOther, + }; +} diff --git a/src/views/productionBusiness/labelPrinting/template/detail/hooks/use-zoom.js b/src/views/productionBusiness/labelPrinting/template/detail/hooks/use-zoom.js new file mode 100644 index 0000000..d17c545 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/hooks/use-zoom.js @@ -0,0 +1,49 @@ +/* + * @Description: + * @Author: CcSimple + * @Github: https://github.com/CcSimple + * @Date: 2023-02-09 13:32:39 + * @LastEditors: CcSimple + * @LastEditTime: 2023-02-10 16:00:54 + */ +import { reactive, toRefs } from "vue"; +import { getHiprintPrintTemplate } from "../utils/template-helper"; + +/** + * vue3 组合式函数 + * 把一些逻辑抽离出来,方便复用 + * 返回 使用方 可用的方法和数据 + */ +export function useZoom(key) { + // 数据 + const state = reactive({ + scaleValue: 1, + scaleMax: 5, + scaleMin: 0.5, + }); + // 获取 template + const tp = () => { + return getHiprintPrintTemplate(key); + }; + // 方法 + const changeScale = (big) => { + let scaleValue = state.scaleValue; + if (big) { + scaleValue += 0.1; + if (scaleValue > state.scaleMax) scaleValue = 5; + } else { + scaleValue -= 0.1; + if (scaleValue < state.scaleMin) scaleValue = 0.5; + } + if (tp()) { + // scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大 + tp().zoom(scaleValue); + state.scaleValue = scaleValue; + } + }; + // 暴露给使用方 + return { + ...toRefs(state), + changeScale, + }; +} \ No newline at end of file diff --git a/src/views/productionBusiness/labelPrinting/template/detail/js/printData.js b/src/views/productionBusiness/labelPrinting/template/detail/js/printData.js new file mode 100644 index 0000000..fa67008 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/js/printData.js @@ -0,0 +1,53 @@ +export default { + name: "黄磊", + logoTest: "https://portrait.gitee.com/uploads/avatars/user/1800/5400665_CcSimple_1591166830.png!avatar60", + password: "12346", + qrCode: '12313', + longText: + "浙江在线3月29日讯最近,\n一篇小学五年级学生写的作文引起了钱报记者的关注这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文《脏话风波》浙江在线3月29日讯最近,一篇小学五年级学生写的作文引起了钱报记者的关注。这篇作文的题目叫做《脏话风波》,讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文讲述的是小作者班级里发生的一种不文明现象——讲脏话的同学越来越多,有的人说话甚至句句“带把儿”。班主任为了遏制这种现象,煞费苦心想了很多办法,跟学生斗智斗勇……看到这篇作文,记者突然想到,自己读六年级的儿子有天突然冒出一句脏话。此前,他是从不说脏话的。问他怎么学会的,他也说不出个所以然来。于是,记者做了这个小学生脏话现象调查。经过了解才发现,小学生爱说脏话竟然较为普遍,一般三年级会冒出苗头。无论是学习成绩好的,还是平时不太起眼的,都会说脏话。而且,说脏话会“传染”,一旦冒头不制止,到了五六年级甚至可能在班里大爆发。以下为作文", + table: [ + { id: "1", name: "王小可", gender: "男", count: "120", amount: "9089元" }, + { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" }, + { id: "3", name: "梦之遥", gender: "女", count: "720", amount: "29089元" }, + { id: "4", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "5", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "6", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "7", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "8", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "9", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "10", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "11", name: "王小可", gender: "男", count: "120", amount: "9089元" }, + { id: "12", name: "梦之遥", gender: "女", count: "20", amount: "89元" }, + { id: "13", name: "梦之遥", gender: "女", count: "720", amount: "29089元" }, + { id: "14", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "15", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "16", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "17", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "18", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "19", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "20", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "21", name: "王小可", gender: "男", count: "120", amount: "9089元" }, + { id: "22", name: "梦之遥", gender: "女", count: "20", amount: "89元" }, + { id: "23", name: "梦之遥", gender: "女", count: "720", amount: "29089元" }, + { id: "24", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "25", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "26", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "27", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "28", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "29", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "21", name: "王小可", gender: "男", count: "120", amount: "9089元" }, + { id: "22", name: "梦之遥", gender: "女", count: "20", amount: "89元" }, + { id: "23", name: "梦之遥", gender: "女", count: "720", amount: "29089元" }, + { id: "24", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "25", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "26", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "27", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "28", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "29", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "21", name: "王小可", gender: "男", count: "120", amount: "9089元" }, + { id: "22", name: "梦之遥", gender: "女", count: "20", amount: "89元" }, + { id: "23", name: "梦之遥", gender: "女", count: "720", amount: "29089元" }, + { id: "29", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + { id: "30", name: "黄小菊", gender: "女", count: "420", amount: "19089元" }, + ], +}; diff --git a/src/views/productionBusiness/labelPrinting/template/detail/js/provider1.js b/src/views/productionBusiness/labelPrinting/template/detail/js/provider1.js new file mode 100644 index 0000000..a651145 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/js/provider1.js @@ -0,0 +1,127 @@ +/* + * @Description: + * @Author: CcSimple + * @Github: https://github.com/CcSimple + * @Date: 2023-02-09 10:40:26 + * @LastEditors: CcSimple + * @LastEditTime: 2023-02-09 11:37:21 + */ +import { hiprint } from 'vue-plugin-hiprint' +export const provider1 = function (options) { + var addElementTypes = function (context) { + context.removePrintElementTypes('providerModule1') + context.addPrintElementTypes('providerModule1', [ + new hiprint.PrintElementTypeGroup('', [ + // options.config, + { + tid: 'providerModule1.text', + title: '文本', + data: '文本', + type: 'text', + options: { + testData: '文本', + height: 17, + fontSize: 16.5, + fontWeight: '700', + textAlign: 'center', + hideTitle: true + } + }, + { tid: 'providerModule1.image', title: '图片', data: '', type: 'image' }, + { + tid: 'providerModule1.barcode', + title: '条形码', + data: 'XS888888888', + type: 'text', + options: { + field: 'barcode', + testData: 'XS888888888', + height: 32, + fontSize: 12, + lineHeight: 18, + textAlign: 'left', + textType: 'barcode' + } + }, + { + tid: 'providerModule1.qrcode', + title: '二维码', + data: 'XS888888888', + type: 'text', + options: { + field: 'qrcode', + testData: 'XS888888888', + height: 32, + fontSize: 12, + lineHeight: 18, + textType: 'qrcode' + } + }, + // { + // tid: 'providerModule1.type', + // title: '单据类型', + // data: '单据类型', + // type: 'text', + // options: { + // testData: '单据类型', + // height: 16, + // fontSize: 15, + // fontWeight: '700', + // textAlign: 'center', + // hideTitle: true + // } + // }, + { + tid: 'providerModule1.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' + } + } + ]) + // new hiprint.PrintElementTypeGroup('客户', [ + // { + // tid: 'providerModule1.khname', + // title: '客户名称', + // data: '高级客户', + // type: 'text', + // options: { + // field: 'name', + // testData: '高级客户', + // height: 16, + // fontSize: 6.75, + // fontWeight: '700', + // textAlign: 'left', + // textContentVerticalAlign: 'middle' + // } + // }, + // { + // tid: 'providerModule1.tel', + // title: '客户电话', + // data: '18888888888', + // type: 'text', + // options: { + // field: 'tel', + // testData: '18888888888', + // height: 16, + // fontSize: 6.75, + // fontWeight: '700', + // textAlign: 'left', + // textContentVerticalAlign: 'middle' + // } + // } + // ]) + ]) + } + return { + addElementTypes: addElementTypes + } +} diff --git a/src/views/productionBusiness/labelPrinting/template/detail/js/provider2.js b/src/views/productionBusiness/labelPrinting/template/detail/js/provider2.js new file mode 100644 index 0000000..623d7f4 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/js/provider2.js @@ -0,0 +1,90 @@ +/* + * @Description: + * @Author: CcSimple + * @Github: https://github.com/CcSimple + * @Date: 2023-02-09 10:40:26 + * @LastEditors: CcSimple + * @LastEditTime: 2023-02-09 10:50:02 + */ +import { hiprint } from 'vue-plugin-hiprint' +export const provider2 = function (options) { + console.log(options) + var addElementTypes = function (context) { + context.removePrintElementTypes('providerModule2') + context.addPrintElementTypes('providerModule2', [ + new hiprint.PrintElementTypeGroup('', [ + { + tid: 'providerModule2.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' } + ] + }, + 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) { + console.log(currentPageGridRowsData) + if (data && data['totalCap']) { + return `${'应收金额大写: ' + data['totalCap']}` + } + return '应收金额大写: ' + } + }, + { tid: 'providerModule2.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text' }, + { + tid: 'providerModule2.longText', + title: '长文本', + type: 'longText', + options: { + field: 'test.longText', + width: 200, + testData: '长文本分页/不分页测试' + } + } + ]), + new hiprint.PrintElementTypeGroup('', [ + { + tid: 'providerModule2.hline', + title: '横线', + type: 'hline' + }, + { + tid: 'providerModule2.vline', + title: '竖线', + type: 'vline' + }, + { + tid: 'providerModule2.rect', + title: '矩形', + type: 'rect' + }, + { + tid: 'providerModule2.oval', + title: '椭圆', + type: 'oval' + } + ]) + ]) + } + return { + addElementTypes: addElementTypes + } +} diff --git a/src/views/productionBusiness/labelPrinting/template/detail/js/template.js b/src/views/productionBusiness/labelPrinting/template/detail/js/template.js new file mode 100644 index 0000000..d6ea178 --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/js/template.js @@ -0,0 +1,365 @@ +export default { + panels: [ + { + index: 0, + height: 297, + width: 210, + paperHeader: 49.5, + paperFooter: 780, + printElements: [ + { + options: { + left: 175.5, + top: 10.5, + height: 27, + width: 259, + title: 'HiPrint自定义模块打印插件', + fontSize: 19, + fontWeight: '600', + textAlign: 'center', + lineHeight: 26, + coordinateSync: true, + widthHeightSync: true, + draggable: false + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 60, top: 27, height: 13, width: 52, title: '页眉线', textAlign: 'center' }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 25.5, top: 57, height: 705, width: 9, fixed: true, borderStyle: 'dotted' }, + printElementType: { type: 'vline' } + }, + { + options: { left: 60, top: 61.5, height: 48, width: 87, src: '', fit: 'contain' }, + printElementType: { title: '图片', type: 'image' } + }, + { + options: { + left: 153, + top: 64.5, + height: 39, + width: 276, + title: + '二维码以及条形码均采用svg格式打印。不同打印机打印不会造成失真。图片打印:不同DPI打印可能会导致失真,', + fontFamily: '微软雅黑', + textAlign: 'center', + lineHeight: 18 + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 457.5, + top: 79.5, + height: 13, + width: 120, + title: '姓名', + field: 'name', + testData: '古力娜扎', + color: '#f00808', + textDecoration: 'underline', + textAlign: 'center', + fields: [ + { text: 'id', field: 'id' }, + { text: '姓名', field: 'name' }, + { text: '性别', field: 'gender' }, + { text: '数量', field: 'count' } + ] + }, + printElementType: { title: '文本', type: 'text' } + }, + { + options: { + left: 483, + top: 124.5, + height: 43, + width: 51, + title: '123456789', + textType: 'qrcode' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 285, + top: 130.5, + height: 34, + width: 175, + title: '123456789', + fontFamily: '微软雅黑', + textAlign: 'center', + textType: 'barcode' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 60, + top: 132, + height: 19, + width: 213, + title: '所有打印元素都可已拖拽的方式来改变元素大小', + fontFamily: '微软雅黑', + textAlign: 'center', + lineHeight: 18 + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 153, + top: 189, + height: 13, + width: 238, + title: '单击元素,右侧可自定义元素属性', + textAlign: 'center', + fontFamily: '微软雅黑' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 60, top: 190.5, height: 13, width: 51, title: '横线', textAlign: 'center' }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 415.5, + top: 190.5, + height: 13, + width: 164, + title: '可以配置各属性的默认值', + textAlign: 'center', + fontFamily: '微软雅黑' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 60, top: 214.5, height: 10, width: 475.5 }, + printElementType: { title: '横线', type: 'hline' } + }, + { + options: { + left: 235.5, + top: 220.5, + height: 32, + width: 342, + title: + '自定义表格:用户可左键选中表头,右键查看可操作项,操作类似Excel,双击表头单元格可进行编辑。内容:title#field', + fontFamily: '微软雅黑', + textAlign: 'center', + lineHeight: 15 + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 156, + top: 265.5, + height: 13, + width: 94, + title: '表头列大小可拖动', + fontFamily: '微软雅黑', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 60, + top: 265.5, + height: 13, + width: 90, + title: '红色区域可拖动', + fontFamily: '微软雅黑', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 60, + top: 285, + height: 56, + width: 511.5, + field: 'table', + tableFooterRepeat: '', + fields: [ + { text: 'id', field: 'id' }, + { text: '姓名', field: 'name' }, + { text: '性别', field: 'gender' }, + { text: '数量', field: 'count' } + ], + columns: [ + [ + { width: 85.25, colspan: 1, rowspan: 1, checked: true }, + { + title: '性别', + field: 'gender', + width: 85.25, + colspan: 1, + rowspan: 1, + checked: false + }, + { + title: '姓名', + field: 'name', + width: 85.25, + align: 'center', + colspan: 1, + rowspan: 1, + checked: true, + tableSummary: 'count' + }, + { + title: '数量', + field: 'count', + width: 85.25, + align: 'center', + colspan: 1, + rowspan: 1, + checked: true, + tableSummary: 'sum' + }, + { + width: 85.25, + colspan: 1, + rowspan: 1, + checked: true + }, + { width: 85.25, colspan: 1, rowspan: 1, checked: true } + ] + ] + }, + printElementType: { + title: '表格', + type: 'table' + } + }, + { + options: { + left: 21, + top: 346.5, + height: 61.5, + width: 15, + title: '装订线', + lineHeight: 18, + fixed: true, + contentPaddingTop: 3.75, + backgroundColor: '#ffffff' + }, + printElementType: { type: 'text' } + }, + { + options: { + left: 225, + top: 355, + height: 13, + width: 346.5, + title: '自定义模块:主要为开发人员设计,能够快速,简单,实现自己功能', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 60, top: 370.5, height: 18, width: 79, title: '配置项表格', textAlign: 'center' }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 225, + top: 385.5, + height: 38, + width: 346.5, + title: '配置模块:主要为客户使用,开发人员可以配置属性,字段,标题等,客户直接使用,配置模块请参考实例2', + fontFamily: '微软雅黑', + lineHeight: 15, + textAlign: 'center', + color: '#d93838' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 60, + top: 487.5, + height: 13, + width: 123, + title: '长文本会自动分页', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 60, top: 507, height: 40, width: 511.5, field: 'longText' }, + printElementType: { title: '长文', type: 'longText' } + }, + { + options: { left: 475.5, top: 565.5, height: 100, width: 100 }, + printElementType: { title: '矩形', type: 'rect' } + }, + { + options: { left: 174, top: 568.5, height: 13, width: 90, title: '竖线', textAlign: 'center' }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 60, top: 574.5, height: 100, width: 10 }, + printElementType: { title: '竖线', type: 'vline' } + }, + { + options: { left: 210, top: 604.5, height: 13, width: 120, title: '横线', textAlign: 'center' }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 130.5, top: 625.5, height: 10, width: 277 }, + printElementType: { title: '横线', type: 'hline' } + }, + { + options: { + left: 364.5, + top: 649.5, + height: 13, + width: 101, + title: '矩形', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 525, top: 784.5, height: 13, width: 63, title: '页尾线', textAlign: 'center' }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { left: 12, top: 786, height: 49, width: 49 }, + printElementType: { title: 'html', type: 'html' } + }, + { + options: { + left: 75, + top: 790.5, + height: 13, + width: 137, + title: '红色原型是自动定义的Html', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + }, + { + options: { + left: 334.5, + top: 810, + height: 13, + width: 205, + title: '页眉线已上。页尾下以下每页都会重复打印', + textAlign: 'center' + }, + printElementType: { title: '自定义文本', type: 'text' } + } + ], + paperNumberLeft: 565.5, + paperNumberTop: 819 + } + ] +} diff --git a/src/views/productionBusiness/labelPrinting/template/detail/utils/template-helper.js b/src/views/productionBusiness/labelPrinting/template/detail/utils/template-helper.js new file mode 100644 index 0000000..6a8291a --- /dev/null +++ b/src/views/productionBusiness/labelPrinting/template/detail/utils/template-helper.js @@ -0,0 +1,21 @@ +/* + * @Description: + * @Author: CcSimple + * @Github: https://github.com/CcSimple + * @Date: 2023-02-09 23:26:18 + * @LastEditors: CcSimple + * @LastEditTime: 2023-02-09 23:35:20 + */ +import { hiprint } from "vue-plugin-hiprint"; + +const templateMap = {}; + +export function newHiprintPrintTemplate(key, options) { + let template = new hiprint.PrintTemplate(options); + templateMap[key] = template; + return template; +} + +export function getHiprintPrintTemplate(key) { + return templateMap[key]; +} diff --git a/src/views/productionBusiness/productionCenter/report/columns/detailColumns.js b/src/views/productionBusiness/productionCenter/report/columns/detailColumns.js index 384c39d..c8754e5 100644 --- a/src/views/productionBusiness/productionCenter/report/columns/detailColumns.js +++ b/src/views/productionBusiness/productionCenter/report/columns/detailColumns.js @@ -226,14 +226,14 @@ export const modalColumns = [ align: 'center', ellipsis: true }, - { + /*{ title: '打码时间', dataIndex: 'subAmount', width: 200, resizable: true, align: 'center', ellipsis: true - }, + },*/ { title: '扫描时间', dataIndex: 'scanTime', diff --git a/src/views/productionBusiness/productionCenter/report/detail/index.vue b/src/views/productionBusiness/productionCenter/report/detail/index.vue index e2234bf..a15056e 100644 --- a/src/views/productionBusiness/productionCenter/report/detail/index.vue +++ b/src/views/productionBusiness/productionCenter/report/detail/index.vue @@ -41,12 +41,14 @@ @@ -110,35 +112,38 @@ // 查看条码 let visible = ref(false) let scanTableList = ref([]) + let recordTable = {} const handleOpenViewScan = (record) => { + recordTable = record visible.value = true - producePackageBarcodeApi - .producePackageBarcodeTreeList({ - reportDetailId: record.id, - reportId: record.reportId + produceReportApi + .produceReportTreeList({ + docsDetailId: record.id, + docsId: record.reportId }) .then((res) => { scanTableList.value = res scanTableList.value.forEach((item) => { - // if (item.subAmount > 0) item.children = [] - item.children = [] + if (item.subAmount && item.subAmount > 0) item.children = [] }) }) } const columnsExpand = (expanded, record) => { if (expanded) { - producePackageBarcodeApi - .producePackageBarcodeTreeChildrenList({ - reportDetailId: record.reportDetailId, - reportId: record.reportId, + produceReportApi + .produceReportTreeChildrenList({ + docsDetailId: recordTable.id, + docsId: record.docsId, parentBarcode: record.barcode }) .then((res) => { record.children = res - record.children.forEach((item) => { - item.children = [] - }) + record.children && + record.children.forEach((item) => { + if (item.subAmount && item.subAmount > 0) + item.children = [] + }) }) } }