|
@@ -0,0 +1,384 @@
|
|
|
+<template>
|
|
|
+ <div style="height: 100vh">
|
|
|
+ <div class="header">
|
|
|
+ <div style="font-size: 20px;margin: 15px;font-weight: bold; text-shadow:1px 1px 1px #4FC9F2;
|
|
|
+ letter-spacing: 2px;">芯片打印</div>
|
|
|
+ <div style="width: 30%;display: flex;align-items: center;justify-content: space-between">
|
|
|
+ <label style="width: 100px;color: #FFFFFF">选择时间:</label><Input size="large" clearable placeholder="请选择时间" @on-focus="is_time=true" v-model="time"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <Button style="margin:15px;width: 6rem" :ghost="is_all" size="large" @click="handleChooseAll">{{is_all?'取消全选':'全选'}}</Button>
|
|
|
+ <Button @click="handleReturn" style="margin:15px" size="large">返回</Button>
|
|
|
+ <Button ghost style="margin: 15px" @click="handlePrint1" size="large">打印(203)</Button>
|
|
|
+ <Button ghost style="margin: 15px" @click="handlePrint1" size="large">打印(300)</Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bdy">
|
|
|
+ <div v-for="(item,index) in list" :key="index" :class="item.is_choose?'choose_item':'item'" @click="handleClick(index)">
|
|
|
+ <div style="margin-bottom:10px">
|
|
|
+ <span>包装单号:</span>
|
|
|
+ <span>{{item.box_no}}</span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom:10px">
|
|
|
+ <span>产品名称:</span>
|
|
|
+ <span>{{item.product_title}}</span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom:10px">
|
|
|
+ <span>规格型号:</span>
|
|
|
+ <span>{{item.product_size}}</span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom:10px">
|
|
|
+ <span>包装数量:</span>
|
|
|
+ <span>{{item.num}}</span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom:10px">
|
|
|
+ <span>包装日期:</span>
|
|
|
+ <span>{{item.box_date}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <van-calendar v-model="is_time" type="range" @confirm="onConfirm" title="选择日期" color="#0765f7" :min-date="new Date(2020,0,1)" :default-date="[new Date(),new Date()]" :allow-same-day="true"/>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+document.title = '芯片打印'
|
|
|
+import $ from 'jquery'
|
|
|
+export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ selectData: [],
|
|
|
+ is_time:false,
|
|
|
+ time:'',
|
|
|
+ minDate: new Date(1990, 1, 1),
|
|
|
+ is_all:false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ if(!localStorage.getItem('dwy_url')){
|
|
|
+ this.$router.push('/cms/chipScreen')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ let order_no = this.$route.query.order_no;
|
|
|
+ const data3 = {
|
|
|
+ url: `${localStorage.getItem('dwy_url')}jbl/api/module-data/box_orders_list/page`,
|
|
|
+ post: {
|
|
|
+ debugFlag: false,
|
|
|
+ developmentSystemId: null,
|
|
|
+ direction: "DESC",
|
|
|
+ dynamicFormCode: "box_orders",
|
|
|
+ fromClientType: "pc",
|
|
|
+ number: 0,
|
|
|
+ property: "id",
|
|
|
+ rules: [{field: "box_orders_product.order_no", option: "LIKE_ANYWHERE", values: [order_no]}],
|
|
|
+ size: 999,
|
|
|
+ sorts: [],
|
|
|
+ specialConditions: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwy', { ...data3 }).then(res => {
|
|
|
+ this.list = [];
|
|
|
+ res.data.content = res.data.content.filter(v=>v.status=="PACKAGED")
|
|
|
+ res.data.content.forEach(v=>{
|
|
|
+ let obj = {};
|
|
|
+ obj.order_number = v.box_orders_product.order_no;
|
|
|
+ obj.customer = v.box_orders_product.customer_name;
|
|
|
+ obj.product_title = v.box_orders_product.product_title;
|
|
|
+ obj.process = v.box_orders_product.process_title;
|
|
|
+ obj.color = v.box_orders_product.color;
|
|
|
+ obj.num = v.box_orders_product.box_num;
|
|
|
+ obj.box_no = v.defective_order_no;
|
|
|
+ obj.product_size = v.box_orders_product.product_size? v.box_orders_product.product_size:'';
|
|
|
+ obj.box_date = v.box_time.split('T')[0];
|
|
|
+ this.list.push(obj);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleChooseAll(){
|
|
|
+ this.is_all = !this.is_all;
|
|
|
+ let list;
|
|
|
+ if(this.is_all){
|
|
|
+ list = JSON.parse(JSON.stringify(this.list))
|
|
|
+ list.forEach(v=>{
|
|
|
+ v.is_choose = true;
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ list = JSON.parse(JSON.stringify(this.list))
|
|
|
+ list.forEach(v=>{
|
|
|
+ v.is_choose = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$set(this,'list',list)
|
|
|
+ },
|
|
|
+ formatDate(date) {
|
|
|
+ return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
|
|
|
+ },
|
|
|
+ onConfirm(date) {
|
|
|
+ const [start, end] = date;
|
|
|
+ this.is_time = false;
|
|
|
+ this.time = `${this.formatDate(start)} - ${this.formatDate(end)}`;
|
|
|
+ let order_no = this.$route.query.order_no;
|
|
|
+ const data3 = {
|
|
|
+ url: `${localStorage.getItem('dwy_url')}jbl/api/module-data/box_orders_list/page`,
|
|
|
+ post: {
|
|
|
+ debugFlag: false,
|
|
|
+ developmentSystemId: null,
|
|
|
+ direction: "DESC",
|
|
|
+ dynamicFormCode: "box_orders",
|
|
|
+ fromClientType: "pc",
|
|
|
+ number: 0,
|
|
|
+ property: "id",
|
|
|
+ rules: [
|
|
|
+ {field: "box_orders_product.order_no", option: "LIKE_ANYWHERE", values: [order_no]},
|
|
|
+ {field: "box_time", option: "BTS", values: [new Date(this.formatDate(start)).toISOString(),new Date(Date.parse(this.formatDate(end))+86400000-1).toISOString()]}
|
|
|
+ ],
|
|
|
+ size: 999,
|
|
|
+ sorts: [],
|
|
|
+ specialConditions: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwy', { ...data3 }).then(res => {
|
|
|
+ this.list = [];
|
|
|
+ res.data.content = res.data.content.filter(v=>v.status=="PACKAGED")
|
|
|
+ res.data.content.forEach(v=>{
|
|
|
+ let obj = {};
|
|
|
+ obj.order_number = v.box_orders_product.order_no;
|
|
|
+ obj.customer = v.box_orders_product.customer_name;
|
|
|
+ obj.product_title = v.box_orders_product.product_title;
|
|
|
+ obj.process = v.box_orders_product.process_title;
|
|
|
+ obj.color = v.box_orders_product.color;
|
|
|
+ obj.num = v.box_orders_product.box_num;
|
|
|
+ obj.box_no = v.defective_order_no;
|
|
|
+ obj.product_size = v.box_orders_product.product_size? v.box_orders_product.product_size:'';
|
|
|
+ obj.box_date = v.box_time.split('T')[0];
|
|
|
+ this.list.push(obj);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleReturn () {
|
|
|
+ this.$router.go(-1)
|
|
|
+ },
|
|
|
+ handleClick (index) {
|
|
|
+ this.list[index].is_choose = !this.list[index].is_choose
|
|
|
+ this.selectData = this.list.filter(v => v.is_choose)
|
|
|
+ if(this.selectData.length==this.list.length){
|
|
|
+ this.is_all = true
|
|
|
+ }else {
|
|
|
+ this.is_all = false
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ close(){
|
|
|
+ window.location.replace("about:blank");
|
|
|
+ window.close();
|
|
|
+ },
|
|
|
+ handlePrint1(){
|
|
|
+ if (this.selectData.length === 0) {
|
|
|
+ return this.$Message.warning('请选择需要打印的标签')
|
|
|
+ }
|
|
|
+ this.$Message.success('操作成功!')
|
|
|
+ },
|
|
|
+ handlePrint (type) {
|
|
|
+ if (this.selectData.length === 0) {
|
|
|
+ return this.$Message.warning('请选择需要打印的标签')
|
|
|
+ }
|
|
|
+ let arr = [{ PTK_OpenUSBPort: 255 }, { PTK_ClearBuffer: "" }, { PTK_SetDarkness: 10 }, { PTK_SetPrintSpeed: 4 }, { PTK_SetDirection: "B" }, { PTK_SetLabelHeight: type==1?"640,32,0,false":"960,48,0,false" }, { PTK_SetLabelWidth: type==1?784:1176 }]
|
|
|
+ // { PTK_SetLabelHeight: "204,24,0,false" }, { PTK_SetLabelWidth: 800 }
|
|
|
+ this.selectData.forEach(v => {
|
|
|
+ // v.order_number = 'SO202309140003'
|
|
|
+ // v.customer = '安庆市锦饰贸易有限公司cece'
|
|
|
+ v.customer = v.customer?v.customer:' ';
|
|
|
+ v.product_title = v.product_title?v.product_title:' ';
|
|
|
+ v.order_number = v.order_number?v.order_number:' ';
|
|
|
+ v.color = v.color?v.color:' ';
|
|
|
+ v.box_date = v.box_date?v.box_date:'';
|
|
|
+ v.process = v.process?v.process:' ';
|
|
|
+ v.num = v.num?v.num:' ';
|
|
|
+ v.customer1 = v.customer && v.customer.length > 11 ? v.customer.slice(0,11):v.customer.slice(0)
|
|
|
+ v.customer2 = v.customer && v.customer.length > 11 ? v.customer.slice(11):''
|
|
|
+ // v.product_title = '大王椰500经典型E0杨桉-双面免漆板W'
|
|
|
+ v.product_title1 = v.product_title && v.product_title.length > 12 ? v.product_title.slice(0,12):v.product_title.slice(0)
|
|
|
+ v.product_title2 = v.product_title && v.product_title.length > 12 ? v.product_title.slice(12):''
|
|
|
+ // v.process = '零度艾格麻/零度艾格麻cecece'
|
|
|
+ v.process1 = v.process && v.process.length > 11 ? v.process.slice(0,11):v.process.slice(0)
|
|
|
+ v.process2 = v.process && v.process.length > 11 ? v.process.slice(11):''
|
|
|
+ // v.color = '尼克橡木-3/尼克橡木-3cecee'
|
|
|
+ v.color1 = v.color && v.color.length > 12 ? v.color.slice(0,12):v.color.slice(0)
|
|
|
+ v.color2 = v.color && v.color.length > 12 ? v.color.slice(12):''
|
|
|
+ // v.num = '120'
|
|
|
+ v.order_no = v.dispatch_no ? v.dispatch_no : v.box_no
|
|
|
+ v.is_s = v.dispatch_no ? true :false
|
|
|
+ let cont = (this.func.stringToHex(v.order_no).length)%4;
|
|
|
+ v.chip = this.func.stringToHex(v.order_no)
|
|
|
+ for(let i = 0;i<cont;i++){
|
|
|
+ v.chip = '0'+ v.chip
|
|
|
+ }
|
|
|
+ let obj;
|
|
|
+ if (type === 1) {
|
|
|
+ obj = [
|
|
|
+ { PTK_DrawText_TrueType: '130,70,60,0,微软雅黑,1,700,0,0,0,订单号:' },
|
|
|
+ { PTK_DrawText_TrueType: `300,70,60,0,微软雅黑,1,700,0,0,0,${v.order_number}` },
|
|
|
+ { PTK_DrawText_TrueType: '700,70,60,0,微软雅黑,1,700,0,0,0,客户:' },
|
|
|
+ { PTK_DrawText_TrueType: `820,70,50,0,微软雅黑,1,700,0,0,0,${v.customer1}` },
|
|
|
+ v.customer2 ? { PTK_DrawText_TrueType: `820,120,50,0,微软雅黑,1,700,0,0,0,${v.customer2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '150,170,60,0,微软雅黑,1,700,0,0,0,产品:' },
|
|
|
+ { PTK_DrawText_TrueType: `300,170,50,0,微软雅黑,1,700,0,0,0,${v.product_title1}` },
|
|
|
+ v.product_title2 ? { PTK_DrawText_TrueType: `300,220,50,0,微软雅黑,1,700,0,0,0,${v.product_title2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '700,170,60,0,微软雅黑,1,700,0,0,0,工艺:' },
|
|
|
+ { PTK_DrawText_TrueType: `820,170,50,0,微软雅黑,1,700,0,0,0,${v.process1}` },
|
|
|
+ v.process2 ? { PTK_DrawText_TrueType: `820,220,50,0,微软雅黑,1,700,0,0,0,${v.process2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '150,270,60,0,微软雅黑,1,700,0,0,0,花色:' },
|
|
|
+ { PTK_DrawText_TrueType: `300,270,50,0,微软雅黑,1,700,0,0,0,${v.color1}` },
|
|
|
+ v.color2 ? { PTK_DrawText_TrueType: `300,320,50,0,微软雅黑,1,700,0,0,0,${v.color2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '700,270,60,0,微软雅黑,1,700,0,0,0,数量:' },
|
|
|
+ { PTK_DrawText_TrueType: `820,270,60,0,微软雅黑,1,700,0,0,0,${v.num}` },
|
|
|
+ { PTK_DrawText_TrueType: `130,370,60,0,微软雅黑,1,700,0,0,0,${v.is_s ? '派工单号:' : '包装单号:'}` },
|
|
|
+ { PTK_DrawText_TrueType: `330,370,60,0,微软雅黑,1,700,0,0,0,${v.dispatch_no ? v.dispatch_no:v.box_no}` },
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: '700,370,60,0,微软雅黑,1,700,0,0,0,包装日期:' } : {},
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: `900,370,60,0,微软雅黑,1,700,0,0,0,${v.box_date}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '130,525,60,0,微软雅黑,1,700,0,0,0,订单号:' },
|
|
|
+ { PTK_DrawText_TrueType: `300,525,60,0,微软雅黑,1,700,0,0,0,${v.order_number}` },
|
|
|
+ { PTK_DrawText_TrueType: '700,525,60,0,微软雅黑,1,700,0,0,0,客户:' },
|
|
|
+ { PTK_DrawText_TrueType: `820,525,50,0,微软雅黑,1,700,0,0,0,${v.customer1}` },
|
|
|
+ v.customer2 ? { PTK_DrawText_TrueType: `820,575,50,0,微软雅黑,1,700,0,0,0,${v.customer2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '150,625,60,0,微软雅黑,1,700,0,0,0,产品:' },
|
|
|
+ { PTK_DrawText_TrueType: `300,625,50,0,微软雅黑,1,700,0,0,0,${v.product_title1}` },
|
|
|
+ v.product_title2 ? { PTK_DrawText_TrueType: `300,675,50,0,微软雅黑,1,700,0,0,0,${v.product_title2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '700,625,60,0,微软雅黑,1,700,0,0,0,工艺:' },
|
|
|
+ { PTK_DrawText_TrueType: `820,625,50,0,微软雅黑,1,700,0,0,0,${v.process1}` },
|
|
|
+ v.process2 ? { PTK_DrawText_TrueType: `820,675,50,0,微软雅黑,1,700,0,0,0,${v.process2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '150,725,60,0,微软雅黑,1,700,0,0,0,花色:' },
|
|
|
+ { PTK_DrawText_TrueType: `300,725,50,0,微软雅黑,1,700,0,0,0,${v.color1}` },
|
|
|
+ v.color2 ? { PTK_DrawText_TrueType: `300,775,50,0,微软雅黑,1,700,0,0,0,${v.color2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '700,725,60,0,微软雅黑,1,700,0,0,0,数量:' },
|
|
|
+ { PTK_DrawText_TrueType: `820,725,60,0,微软雅黑,1,700,0,0,0,${v.num}` },
|
|
|
+ { PTK_DrawText_TrueType: `130,825,60,0,微软雅黑,1,700,0,0,0,${v.is_s ? '派工单号:' : '包装单号:'}` },
|
|
|
+ { PTK_DrawText_TrueType: `330,825,60,0,微软雅黑,1,700,0,0,0,${v.dispatch_no ? v.dispatch_no : v.box_no}` },
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: '700,825,60,0,微软雅黑,1,700,0,0,0,包装日期:' } : {},
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: `900,825,60,0,微软雅黑,1,700,0,0,0,${v.box_date}` } : {},
|
|
|
+ { PTK_RWRFIDLabel: `1,0,0,${v.chip.length / 2},1,${v.chip}` }, { PTK_PrintLabel: "1,1" }]
|
|
|
+ } else {
|
|
|
+ obj = [
|
|
|
+ { PTK_DrawText_TrueType: '30,70,60,0,微软雅黑,1,700,0,0,0,订单号:' },
|
|
|
+ { PTK_DrawText_TrueType: `200,70,60,0,微软雅黑,1,700,0,0,0,${v.order_number}` },
|
|
|
+ { PTK_DrawText_TrueType: '600,70,60,0,微软雅黑,1,700,0,0,0,客户:' },
|
|
|
+ { PTK_DrawText_TrueType: `720,70,50,0,微软雅黑,1,700,0,0,0,${v.customer1}` },
|
|
|
+ v.customer2 ? { PTK_DrawText_TrueType: `720,120,50,0,微软雅黑,1,700,0,0,0,${v.customer2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '50,170,60,0,微软雅黑,1,700,0,0,0,产品:' },
|
|
|
+ { PTK_DrawText_TrueType: `200,170,50,0,微软雅黑,1,700,0,0,0,${v.product_title1}` },
|
|
|
+ v.product_title2 ? { PTK_DrawText_TrueType: `200,220,50,0,微软雅黑,1,700,0,0,0,${v.product_title2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '600,170,60,0,微软雅黑,1,700,0,0,0,工艺:' },
|
|
|
+ { PTK_DrawText_TrueType: `720,170,50,0,微软雅黑,1,700,0,0,0,${v.process1}` },
|
|
|
+ v.process2 ? { PTK_DrawText_TrueType: `720,220,50,0,微软雅黑,1,700,0,0,0,${v.process2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '50,270,60,0,微软雅黑,1,700,0,0,0,花色:' },
|
|
|
+ { PTK_DrawText_TrueType: `200,270,50,0,微软雅黑,1,700,0,0,0,${v.color1}` },
|
|
|
+ v.color2 ? { PTK_DrawText_TrueType: `200,320,50,0,微软雅黑,1,700,0,0,0,${v.color2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '600,270,60,0,微软雅黑,1,700,0,0,0,数量:' },
|
|
|
+ { PTK_DrawText_TrueType: `720,270,60,0,微软雅黑,1,700,0,0,0,${v.num}` },
|
|
|
+ { PTK_DrawText_TrueType: `30,370,60,0,微软雅黑,1,700,0,0,0,${v.is_s ? '派工单号:' : '包装单号:'}` },
|
|
|
+ { PTK_DrawText_TrueType: `230,370,60,0,微软雅黑,1,700,0,0,0,${v.dispatch_no ? v.dispatch_no:v.box_no}` },
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: '600,370,60,0,微软雅黑,1,700,0,0,0,包装日期:' } : {},
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: `800,370,60,0,微软雅黑,1,700,0,0,0,${v.box_date}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '30,525,60,0,微软雅黑,1,700,0,0,0,订单号:' },
|
|
|
+ { PTK_DrawText_TrueType: `200,525,60,0,微软雅黑,1,700,0,0,0,${v.order_number}` },
|
|
|
+ { PTK_DrawText_TrueType: '600,525,60,0,微软雅黑,1,700,0,0,0,客户:' },
|
|
|
+ { PTK_DrawText_TrueType: `720,525,50,0,微软雅黑,1,700,0,0,0,${v.customer1}` },
|
|
|
+ v.customer2 ? { PTK_DrawText_TrueType: `720,575,50,0,微软雅黑,1,700,0,0,0,${v.customer2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '50,625,60,0,微软雅黑,1,700,0,0,0,产品:' },
|
|
|
+ { PTK_DrawText_TrueType: `200,625,50,0,微软雅黑,1,700,0,0,0,${v.product_title1}` },
|
|
|
+ v.product_title2 ? { PTK_DrawText_TrueType: `200,675,50,0,微软雅黑,1,700,0,0,0,${v.product_title2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '600,625,60,0,微软雅黑,1,700,0,0,0,工艺:' },
|
|
|
+ { PTK_DrawText_TrueType: `720,625,50,0,微软雅黑,1,700,0,0,0,${v.process1}` },
|
|
|
+ v.process2 ? { PTK_DrawText_TrueType: `720,675,50,0,微软雅黑,1,700,0,0,0,${v.process2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '50,725,60,0,微软雅黑,1,700,0,0,0,花色:' },
|
|
|
+ { PTK_DrawText_TrueType: `200,725,50,0,微软雅黑,1,700,0,0,0,${v.color1}` },
|
|
|
+ v.color2 ? { PTK_DrawText_TrueType: `200,775,50,0,微软雅黑,1,700,0,0,0,${v.color2}` } : {},
|
|
|
+ { PTK_DrawText_TrueType: '600,725,60,0,微软雅黑,1,700,0,0,0,数量:' },
|
|
|
+ { PTK_DrawText_TrueType: `720,725,60,0,微软雅黑,1,700,0,0,0,${v.num}` },
|
|
|
+ { PTK_DrawText_TrueType: `30,825,60,0,微软雅黑,1,700,0,0,0,${v.is_s ? '派工单号:' : '包装单号:'}` },
|
|
|
+ { PTK_DrawText_TrueType: `230,825,60,0,微软雅黑,1,700,0,0,0,${v.dispatch_no ? v.dispatch_no : v.box_no}` },
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: '600,825,60,0,微软雅黑,1,700,0,0,0,包装日期:' } : {},
|
|
|
+ !v.is_s ? { PTK_DrawText_TrueType: `800,825,60,0,微软雅黑,1,700,0,0,0,${v.box_date}` } : {},
|
|
|
+ { PTK_RWRFIDLabel: `1,0,0,${v.chip.length / 2},1,${v.chip}` }, { PTK_PrintLabel: "1,1" }]
|
|
|
+ }
|
|
|
+ arr.push(...obj)
|
|
|
+ })
|
|
|
+ arr.push({ PTK_CloseUSBPort: "" })
|
|
|
+ let _this = this
|
|
|
+ let printparams = JSON.stringify(arr)
|
|
|
+ console.log(arr)
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: 'http://127.0.0.1:888/postek/print',
|
|
|
+ data: { reqParam: 1, printparams },
|
|
|
+ dataType: "json",
|
|
|
+ timeout: 5000,
|
|
|
+ success: function (result) {
|
|
|
+ // _this.getChipDetail();
|
|
|
+ if (result.retval == "0") {
|
|
|
+ _this.$Message.success("发送成功");
|
|
|
+ setTimeout(()=>{
|
|
|
+ // this.close()
|
|
|
+ },200)
|
|
|
+ } else {
|
|
|
+ _this.$Message.error("发送失败,返回结果:" + result.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.header{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 1px solid #356070;
|
|
|
+}
|
|
|
+.bdy{
|
|
|
+ height: calc(100% - 5rem);
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+.bdy::-webkit-scrollbar{
|
|
|
+ width: 8px;
|
|
|
+}
|
|
|
+.bdy::-webkit-scrollbar-track{
|
|
|
+ background: linear-gradient(to bottom,#f5f5f5, #002359);
|
|
|
+}
|
|
|
+.bdy::-webkit-scrollbar-thumb{
|
|
|
+ background: linear-gradient(to bottom, #a1a1a1, #3b4169);
|
|
|
+ border-radius: 5px;
|
|
|
+ box-shadow: inset 0 0 6px rgba(0,0,0,.3);
|
|
|
+}
|
|
|
+::v-deep .van-calendar__body::-webkit-scrollbar{
|
|
|
+ width: 0;
|
|
|
+}
|
|
|
+.choose_item{
|
|
|
+ cursor: pointer;
|
|
|
+ border-radius: 20px;
|
|
|
+ background: #ffffff;
|
|
|
+ color: black;
|
|
|
+ padding: 10px;
|
|
|
+ margin: 20px 0 20px 2.5%;
|
|
|
+ width: 30%;
|
|
|
+ height: 180px;
|
|
|
+}
|
|
|
+.item{
|
|
|
+ cursor: pointer;
|
|
|
+ border: 1px solid #797878;
|
|
|
+ color: #797878;
|
|
|
+ border-radius: 20px;
|
|
|
+ padding: 10px;
|
|
|
+ margin: 20px 0 20px 2.5%;
|
|
|
+ width: 30%;
|
|
|
+ height: 180px;
|
|
|
+}
|
|
|
+</style>
|