lion 2 years ago
parent 763e8f92f8
commit ea7952e139

10485
public/jquery.js vendored

File diff suppressed because it is too large Load Diff

@ -4,41 +4,54 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>打印</title>
<script language="javascript" src="/jquery-1.11.2.min.js"></script>
<script language="javascript" src="/jquery.qrcode.js"></script>
<script language="javascript" src="/admin/jquery.js"></script>
<script language="javascript" src="/admin/jquery.qrcode.js"></script>
<script>
//二维码宽高
var qrcodewidth = 120;
var qrcodeheight = 120;
var qrcodewidth = 110;
var qrcodeheight = 110;
var qrcodeleft = 30;
var qrcodetop = 50;
//canvas宽高
var canvaswidth = 340;
var canvaswidth = 302;
var canvasheight = 188;
//logo宽高
var logowidth = 100;
var logoheight = 100;
//文字描述位置
var textleft = qrcodewidth / 2;
var texttop = qrcodeheight + 70;
//logo位置
var logoleft = (qrcodewidth - logowidth) / 2;
var logotop = (qrcodeheight - logoheight) / 2;
$(function() {
var printObj = JSON.parse(getCookie('objs'))
$(".wrap").html("")
for (var i = 0; i < printObj.length; i++) {
var index = parseInt(i) + 1
$(".wrap").append("<li id='page" + index + "' style='width: 9cm; height: 5cm;'>" +
"<img src='' style='display: block;width:9cm; height:5cm;'>" +
"</li>")
createCode("#page" + index, printObj[i])
var ids = getIds('ids').split(",")
for (var i = 0; i < ids.length; i++) {
getListByid(i + 1, ids[i])
}
// createCode()
console.log(printObj)
})
function getListByid(index, id) {
$.ajax({
type: "get",
timeout: 15000,
async: false,
contentType: 'application/json',
data: {
id: id,
table_name: 'inventorys'
},
url: 'http://hd-wuziguanli-test.ali251.langye.net/api/admin/base-form/show',
dataType: "json",
success: function(result) {
var printObj = result
$(".wrap").append("<li id='page" + index + "' style='width: 9cm; height: 5cm;'>" +
"<img src='' style='display: block;width:8cm; height:5cm;'>" +
"</li>")
createCode("#page" + index, printObj)
$(".load").remove()
},
complete: function(xhr, textStatus) {
}
});
}
// 生成二维码
function utf16to8(str) {
var out, i, len, c;
@ -60,8 +73,8 @@
return out;
}
function createCode(id, printObji) {
console.log(printObji)
function createCode(id, printObji) {
// alert(id)
var qrcode = $(id).qrcode({
render: 'canvas',
text: utf16to8(printObji['wuzibianma'] + "-" + printObji['id']),
@ -81,13 +94,13 @@
ctx.fillRect(0, 0, canvas.width, canvas.height);
//设置文字样式
ctx.fillStyle = '#000000';
ctx.font = 'bold ' + 16 + 'px Arial';
ctx.font = 'bold ' + 18 + 'px Arial';
ctx.textAlign = 'left';
//文字描述
ctx.fillText("苏州河道处", 130, 30);
ctx.fillText("物资编码:" + decodeURI(decodeURI(printObji['wuzibianma'])), qrcodeleft + 140, 65);
ctx.fillText("资产名称:" + decodeURI(decodeURI(printObji['zichanmingcheng'])), qrcodeleft + 140, 95);
ctx.fillText("物资类型:" + decodeURI(decodeURI(printObji['wuzileixing'])), qrcodeleft + 140, 125);
ctx.fillText("苏州河道管理处", 100, 30);
ctx.fillText("物资编码:" + decodeURI(decodeURI(printObji['wuzibianma'])), qrcodeleft + 120, 65);
ctx.fillText("资产名称:" + decodeURI(decodeURI(printObji['zichanmingcheng'])), qrcodeleft + 120, 95);
ctx.fillText("物资类型:" + decodeURI(decodeURI(printObji['wuzileixing'])), qrcodeleft + 120, 125);
// ctx.fillText("入库数量:" + printObji['rukushuliang'], qrcodeleft + 140, 155);
ctx.drawImage(img, qrcodeleft, qrcodetop);
var data = canvas.toDataURL('image/png', 1);
@ -117,7 +130,7 @@
marginIgnored: true,
copyrights: '杰创软件拥有版权 www.jatools.com'
};
document.getElementById("jatoolsPrinter").print(myDoc, false); // 直接打印,不弹出打印机设置对话框
document.getElementById("jatoolsPrinter").print(myDoc, false); // 直接打印,不弹出打印机设置对话框
// delCookie('objs')
}
@ -158,6 +171,15 @@
var cookieValue = unescape(totalCookie.substring(valueStartAt, valueEndAt));
return cookieValue;
}
function getIds(name) {
var reg = new RegExp("(^|&)" + name.toLowerCase() + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).toLowerCase().match(reg);
if (r != null) {
return unescape(r[2].replace(new RegExp(/(%25)/g), '%').replace(new RegExp(/(%25)/g), '%'));
}
return null
}
</script>
<style>
body {
@ -167,7 +189,10 @@
margin: 0;
background: #000;
}
.load{
color: #fff;
font-size: 20px;
}
ul,
li {
padding: 0;
@ -229,7 +254,8 @@
</style>
</head>
<body>
<div class="lists">
<div class="lists">
<div class="load">加载中...</div>
<ul class="wrap">
<div class="clear"></div>
@ -239,7 +265,7 @@
<div class="wp">
<div class="left">生成打印单<br />
本打印功能只能在IE浏览器使用非IE浏览器请采用兼容模式<br />
使用之前需要安装插件(<a href="/jatoolsPrinter_free.zip" target="_blank">点击下载</a>),并正确设置打印机
使用之前需要安装插件(<a href="/admin/jatoolsPrinter_free.zip" target="_blank">点击下载</a>),并正确设置打印机
</div>
<div class="right">
<input type="button" value="打印" onClick='doPrint(this);'>

@ -265,12 +265,17 @@ export default {
top: 0;
}
}
.ivu-modal-body::-webkit-scrollbar {
display: none;
}
.ivu-modal-body{
max-height: 65vh !important;
min-height: 300px;
overflow: scroll;
overflow-y: auto;
}
.xy-table-item{
display: flex;
align-items: center;

@ -1,6 +1,6 @@
import Cookies from 'js-cookie'
const TokenKey = 'starter_token'
const TokenKey = 'patrol_wzgl_token'
export function getToken() {
return Cookies.get(TokenKey)

@ -142,39 +142,43 @@
width: 180,
prop: 'suozaihuojia'
},
{
label: "二维码",
width: 180,
prop: 'erweima',
customFn: (row) => {
return (<Button type='primary' size='small'
on=
{
{
["click"]: (e) => (this.showCode(e, row))
}
}
>生成二维码</Button>)
}
},
// {
// label: "",
// width: 180,
// prop: 'erweima',
// customFn: (row) => {
// return (<Button type='primary' size='small'
// on=
// {
// {
// ["click"]: (e) => (this.showCode(e, row))
// }
// }
// ></Button>)
// }
// },
],
printObj:[]
printObj:[],
printArr:[]
}
},
methods: {
selectionChange(e){
console.log(e)
let _arrs = []
if(e.length>0){
// for(var m of e){
// m = escape(m)
// }
this.printObj = e
for(var m of e){
_arrs.push(m.id)
}
console.log(_arrs)
// this.printObj = e
this.printArr = _arrs.join(",")
}
},
toprint(){
if(this.printObj.length<1){
if(this.printArr.length<1){
Message({
type: 'warning',
message: '请先选择'
@ -182,17 +186,17 @@
return
}
// let _obj = JSON.parse(JSON.stringify(this.printObj))
let _objs = []
for(var m of this.printObj){
_objs.push({
'wuzibianma':encodeURI(encodeURI(m['wuzibianma'])),
'zichanmingcheng':encodeURI(encodeURI(m['zichanmingcheng'])),
'wuzileixing':encodeURI(encodeURI(m['wuzileixing']))
})
}
Cookies.remove('objs')
Cookies.set('objs',JSON.stringify(_objs))
window.open('/admin/print.html','_blank')
// let _objs = []
// for(var m of this.printObj){
// _objs.push({
// 'wuzibianma':encodeURI(encodeURI(m['wuzibianma'])),
// 'zichanmingcheng':encodeURI(encodeURI(m['zichanmingcheng'])),
// 'wuzileixing':encodeURI(encodeURI(m['wuzileixing']))
// })
// }
// Cookies.remove('objs')
// Cookies.set('objs',JSON.stringify(_objs))
window.open('/admin/print.html?ids='+this.printArr,'_blank')
},
async exportExcel(sheetName) {
const res = await index(Object.assign(this.select,{ page: 1,page_size: 9999,table_name: 'inventorys'}))

@ -192,6 +192,7 @@
<div class="xy-table-item-content">
<el-select
v-model="mingxiObj.rukupici"
ref='piciref'
v-if="form.rukuleixing!='回库'"
style="width: 300px;"
filterable
@ -202,7 +203,7 @@
<el-option
v-for="item in rukupiciList"
:key="item.value"
:label="item.label"
:label="item.value"
:value="item.value">
</el-option>
</el-select>
@ -444,7 +445,8 @@
}
},
created() {
this.getCangku()
this.getCangku()
// this.getWuzi()
// this.getKucun()
@ -742,7 +744,8 @@
})
})
},
submit() {
submit() {
this.form.id_stocks_items_stocks_id_relation = this.mingxiList
// return
if (this.type === 'add') {

@ -87,7 +87,10 @@
label: "入库时间",
width: 180,
prop: 'rukushijian',
align: 'center'
align: 'center',
formatter:(cell,data,value)=>{
return value?value.substring(0,10):''
}
},
{
label: "入库类型",

@ -27,7 +27,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/szhedao/app/patrol-wzgl-service/public/admin',
outputDir: '/Users/mac/Documents/朗业/2023/w-河道物资/hd-wuziguanli-test/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save