add打印功能,修改表单出库
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
<view class="setup-label">服务器地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
|
||||
</view>
|
||||
<view class="setup-item">
|
||||
<view class="setup-label">打印地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入打印地址" v-model="printip">
|
||||
</view>
|
||||
<!-- <view class="setup-item">
|
||||
<view class="setup-label">刷新时间(s)</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||
@@ -29,6 +33,7 @@
|
||||
return {
|
||||
addrip: this.$store.getters.baseUrl,
|
||||
acsip: this.$store.getters.acsUrl,
|
||||
printip: this.$store.getters.printUrl,
|
||||
setTime: this.$store.getters.setTime / 1000
|
||||
};
|
||||
},
|
||||
@@ -46,6 +51,13 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.printip === '') {
|
||||
uni.showToast({
|
||||
title: '请填写打印地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (this.setTime === '') {
|
||||
// uni.showToast({
|
||||
// title: '请填写刷新时间',
|
||||
@@ -54,7 +66,7 @@
|
||||
// return
|
||||
// }
|
||||
// 存值
|
||||
this.$store.dispatch('setConfig',{baseUrl: this.addrip, acsUrl: this.acsip, setTime: this.setTime * 1000})
|
||||
this.$store.dispatch('setConfig',{baseUrl: this.addrip, acsUrl: this.acsip, printUrl: this.printip, setTime: this.setTime * 1000})
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<view class="zd-col-6"><span class="filter_label">单位</span></view>
|
||||
<view class="zd-col-6"><span class="filter_input">{{currentData.unit_name}}</span></view>
|
||||
</view> -->
|
||||
<view class="zd-row">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6"><span class="filter_label">仓库</span></view>
|
||||
<view class="zd-col-6 filter_select">
|
||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||
@@ -32,6 +32,15 @@
|
||||
<uni-data-select v-model="currentData.product_area" :localdata="options2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row jcflexstart">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">加急单据</span>
|
||||
</view>
|
||||
<view class="relative zd-col-6">
|
||||
<switch :checked="isChecked" color="#4e6ef2" style="transform:scale(0.8); transform-origin: left;"/>
|
||||
<text @tap="setWStatus" style="position: absolute;display: inline-block;width: 52px; height: 32px;left: 0;"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="JSON.stringify(currentData) !== '{}'" class="grid-wraper">
|
||||
<view class="slide_new">
|
||||
@@ -100,7 +109,8 @@
|
||||
index1: '',
|
||||
options2: [{value: 'A1', text: 'A1车间'}, {value: 'A2', text: 'A2车间'}, {value: 'A3', text: 'A3车间'}],
|
||||
allCheck: false,
|
||||
formTypeName: ''
|
||||
formTypeName: '',
|
||||
isChecked: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
@@ -120,6 +130,9 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setWStatus () {
|
||||
this.isChecked = !this.isChecked
|
||||
},
|
||||
// 出库单类型
|
||||
async _outStorageOrder () {
|
||||
let res = await outStorageOrder()
|
||||
@@ -188,7 +201,8 @@
|
||||
return
|
||||
}
|
||||
let arr = this.dataList.filter(el => el.checked === true)
|
||||
let obj = Object.assign(this.currentData, {children: arr, stor_code: this.index1})
|
||||
let urgent = this.isChecked ? '1' : '0'
|
||||
let obj = Object.assign(this.currentData, {children: arr, stor_code: this.index1, urgent: urgent})
|
||||
try {
|
||||
let res = await outStorageConfirm(obj)
|
||||
if (res.code === '200') {
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCLodop} from "@/utils/CLodopfuncs.js"
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPick, savePickTask} from '@/utils/getData2.js'
|
||||
@@ -176,6 +177,8 @@
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
let data = Object.assign({}, this.data, {lxCode: this.val2})
|
||||
setTimeout(this.toPrint(data), 800)
|
||||
this.clearUp()
|
||||
} else {
|
||||
this.disabled = false
|
||||
@@ -183,6 +186,72 @@
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toPrint (data) {
|
||||
let iparr = this.$store.getters.printUrl.split(":")
|
||||
let printUrl = iparr[1].slice(2)
|
||||
let LODOP = getCLodop();
|
||||
if (!(LODOP.webskt && LODOP.webskt.readyState === 1)) {
|
||||
uni.showToast({
|
||||
title: '当前配置ip:' + printUrl + '网络不通,请检查',
|
||||
icon: 'none',
|
||||
duration: 5000
|
||||
})
|
||||
return
|
||||
}
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
LODOP.SET_LICENSES('浙江省烟草专卖局(公司)', 'C0C4A46A3A0D1F526D426018D9F11921', '', '')
|
||||
// 更换为打印服务器ip 不需要加前缀
|
||||
LODOP.PRINT_INIT(null, printUrl);
|
||||
// 打印机序号 规则为打印服务器打印机列表倒数从0开始 -1为默认打印机
|
||||
LODOP.SET_PRINTER_INDEX(-1);
|
||||
LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",true)
|
||||
// 设置打印纸大小
|
||||
// LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '');
|
||||
// LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1);
|
||||
// LODOP.SET_PRINT_STYLE('FontSize', 12);
|
||||
// LODOP.SET_PRINT_STYLE('Bold', 1);
|
||||
let tableHtml = `
|
||||
<div id="div1">
|
||||
<style>table{border:none} caption{height:20px;font-weight:bold;font-size: 20px;margin-bottom:20px;} td{border: 1px solid #000;height:28px;text-align: center}</style>
|
||||
|
||||
<table border=0 cellSpacing=0 cellPadding=0 width="100%" bordercolor="#000000" style="border-collapse:collapse">
|
||||
<caption>物料信息卡</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="40%">用料单号</td>
|
||||
<td width="60%">${data.prd_ppbom_no}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%">物料编码</td>
|
||||
<td width="60%">${data.material_code}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%">物料名称</td>
|
||||
<td width="60%">${data.material_name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%">物料规格</td>
|
||||
<td width="60%">${data.material_spec}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%">物料数量</td>
|
||||
<td width="60%">${data.assign_qty}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%">料箱号</td>
|
||||
<td width="60%">${data.lxCode}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>`
|
||||
LODOP.ADD_PRINT_TABLE("5%",20,"90%",220,tableHtml);
|
||||
LODOP.PRINT();
|
||||
// LODOP.PREVIEW()
|
||||
uni.showToast({
|
||||
title: '打印成功',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user