Browse Source

修改翻包打印功能

hella_online_20240829
lijuncheng 2 months ago
parent
commit
5a42a54da9
  1. 2
      src/common/config.js
  2. 150
      src/mycomponents/print/print.vue
  3. 5
      src/pages/index/index.vue
  4. 7
      src/pages/login/index.vue
  5. 13
      src/pages/package/record/overPackageRecord.vue
  6. 4
      src/pages/setter/index.vue

2
src/common/config.js

@ -0,0 +1,2 @@
export const overPagePrint="overPage_print"
export const overPageTemplate="overPage_Template"

150
src/mycomponents/print/print.vue

@ -0,0 +1,150 @@
<template>
<view class="uni-flex uni-column" style="width: 100%; ">
<view class="title " style="display: flex; align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0;width: 22%; font-size: 35rpx; font-weight: bold;">打印机 :</text>
<view class="uni-flex" style="uni-row; width: 78%; justify-content: space-between; align-items: center; ">
<view class="customerBorder" @click="showSelectPrint">
{{printName}}
</view>
<u-select v-model="showPrintSelect" mode="mutil-column-auto"
:list="printList" @confirm="confirmSelectPrint"></u-select>
<view class="" style="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelectPrint">
</image>
</view>
</view>
</view>
<view class='split_line'></view>
<view class="title " style="display: flex; align-items: center;padding: 10rpx;">
<text style="flex-shrink: 0;width: 22%; font-size: 35rpx; font-weight: bold;">模版 :</text>
<view class="uni-flex" style="uni-row; width: 78%; justify-content: space-between; align-items: center; ">
<view class="customerBorder" @click="showSelectTemplate">
{{templateName}}
</view>
<u-select v-model="showTemplateSelect" mode="mutil-column-auto"
:list="templateList" @confirm="confirmSelectTemplate"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelectTemplate">
</image>
</view>
</view>
</view>
<view class='split_line'></view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getPrintList,
getPrintTemplateList
} from '@/api/request2.js';
export default {
data() {
return {
showPrintSelect:false,
printName:"请选择打印机",
printCode:"",
showTemplateSelect:false,
templateName:"请选择打印模版",
templateCode:"",
printList:[],
templateList:[]
};
},
//
props: {
// printList: {
// type: Array,
// default() {
// return [];
// }
// },
// templateList: {
// type: Array,
// default() {
// return [];
// }
// },
// printDeafult:{
// type:String,
// default:""
// },
// templateDeafult:{
// type:String,
// default:""
// },
},
methods: {
setDefaultData(printDeafult,templateDeafult){
this.templateName =printDeafult.name
this.printCode =printDeafult.code
this.templateName =templateDeafult.name
this.templateCode =templateDeafult.code
},
showErrorMessage(message, type) {
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {})
})
},
showSelectPrint(){
this.showPrintSelect =true
uni.showLoading({
title:"加载中",
mask:true
})
getPrintList().then(res=>{
this.printList =[]
}).catch(error=>{
})
},
confirmSelectPrint(){
this.printCode =""
this.$emit("printCode",this.printCode)
},
showSelectTemplate(){
this.showTemplateSelect =true
uni.showLoading({
title:"加载中",
mask:true
})
getPrintTemplateList().then(res=>{
this.templateList =[]
}).catch(error=>{
})
},
confirmSelectTemplate(){
this.templateCode =""
this.$emit("templateCode",this.templateCode)
}
}
}
</script>
<style lang="scss">
.customerBorder {
width: 100%;
border: 1rpx solid lightgray;
border-radius: 5rpx;
padding: 15rpx;
}
</style>
<style>
</style>

5
src/pages/index/index.vue

@ -78,6 +78,11 @@
getBusinessType getBusinessType
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
overPagePrint,
overPageTemplate
} from '@/common/config.js';
export default { export default {
components: {}, components: {},
data() { data() {

7
src/pages/login/index.vue

@ -97,6 +97,7 @@
import { import {
getCaptchaImage getCaptchaImage
} from '@/api/request2.js'; } from '@/api/request2.js';
import storage from '@/common/utils/storage'
import { import {
mapState, mapState,
mapMutations mapMutations
@ -124,8 +125,10 @@
// computed: mapState(['forcedLogin', 'hasLogin']), // computed: mapState(['forcedLogin', 'hasLogin']),
mounted() { mounted() {
this.tenantValue = this.tenantArray[0].value this.tenantValue = this.tenantArray[0].value
uni.clearStorageSync() // uni.clearStorageSync()
uni.clearStorage(); // // uni.clearStorage(); //
storage.clearStorage()
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
this.username = "admin" this.username = "admin"
this.password = "win123456"; this.password = "win123456";

13
src/pages/package/record/overPackageRecord.vue

@ -4,6 +4,8 @@
<view class=""> <view class="">
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="cen_card" style="background-color: #fff; margin:10px 0px 0px 10px;"> <view class="cen_card" style="background-color: #fff; margin:10px 0px 0px 10px;">
<view class="cell_box uni-flex uni-row"> <view class="cell_box uni-flex uni-row">
@ -110,7 +112,7 @@
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import packUnit from '@/mycomponents/qty/packUnit.vue' import packUnit from '@/mycomponents/qty/packUnit.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import print from '@/mycomponents/print/print.vue'
import { import {
getCurrDateTime getCurrDateTime
@ -128,7 +130,8 @@
packageTarget, packageTarget,
recordComDetailCard, recordComDetailCard,
packUnit, packUnit,
winComScanBalance winComScanBalance,
print
}, },
onLoad(option){ onLoad(option){
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -235,6 +238,12 @@
}, },
getScanResult(result) { getScanResult(result) {
this.setData(result); this.setData(result);
setTimeout(res=>{
this.$res.printService.setDefaultData()
})
}, },
setData(result) { setData(result) {

4
src/pages/setter/index.vue

@ -42,6 +42,8 @@
removeToken removeToken
} from '@/common/utils/auth' } from '@/common/utils/auth'
import storage from '@/common/utils/storage'
// #ifdef APP-PLUS // #ifdef APP-PLUS
import { import {
appUpdate appUpdate
@ -109,7 +111,7 @@
}; };
function clearStorage() { function clearStorage() {
uni.clearStorageSync() storage.clearStorage()
removeToken(); removeToken();
}; };

Loading…
Cancel
Save