master
lion 3 years ago
parent d97c3c0914
commit e475c8572b

@ -61,6 +61,7 @@
}
function createCode(id, printObji) {
console.log(printObji)
var qrcode = $(id).qrcode({
render: 'canvas',
text: utf16to8(printObji['wuzibianma'] + "-" + printObji['id']),
@ -84,12 +85,13 @@
//设置文字样式
ctx.fillStyle = '#000000';
ctx.font = 'bold ' + 16 + 'px Arial';
ctx.textAlign = 'center';
ctx.textAlign = 'left';
//文字描述
ctx.fillText("苏州河道处", 160, 30);
// ctx.fillText("资产名称:"+decodeURI(decodeURI(printObji['zichanmingcheng'])), qrcodeleft+180,80);
// ctx.fillText("物资类型:"+"123", qrcodeleft+180,110);
// ctx.fillText("入库数量:"+printObji['rukushuliang'], qrcodeleft+180,140);
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("入库数量:"+printObji['rukushuliang'], qrcodeleft+140,155);
//绘制二维码
ctx.drawImage(img, qrcodeleft, qrcodetop);
@ -100,7 +102,7 @@
// ctx.drawImage(logo, logoleft, logotop, logowidth, logoheight);
// }
}
console.log(img)
// img.src=canvas.toDataURL("image/png");
// $(id).children("img").attr("src",img.src)
}
@ -152,6 +154,7 @@
function getCookie(cookieName) {
//获取所有的cookie "psw=1234we; rememberme=true; user=Annie"
var totalCookie = document.cookie;
//获取参数所在的位置
var cookieStartAt = totalCookie.indexOf(cookieName + "=");
@ -261,7 +264,7 @@
</div>
<div class="bar">
<div class="wp">
<div class="left">生成打印单4张耗时0.40861988067627秒<br />
<div class="left">生成打印单<br />
本打印功能只能在IE浏览器使用非IE浏览器请采用兼容模式<br />
使用之前需要安装插件(<a href="/jatoolsPrinter_free.zip" target="_blank">点击下载</a>),并正确设置打印机
</div>

@ -165,9 +165,9 @@
selectionChange(e){
console.log(e)
if(e.length>0){
for(var m of e){
m = escape(m)
}
// for(var m of e){
// m = escape(m)
// }
this.printObj = e
}
@ -181,6 +181,11 @@
})
return
}
for(var m of this.printObj){
for(var k in m){
m[k] = encodeURI(encodeURI(m[k]))
}
}
Cookies.set('objs', this.printObj)
window.open('/admin/print.html','_blank')
},

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增出库' : '编辑出库'" :form="form" :rules="rules" @submit="submit">
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增出库' : '编辑出库'" :form="form" :rules="rules" @submit="submit">
<template v-slot:chukushijian>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -101,7 +101,7 @@
<Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增出库明细</Button>
<xy-table style="width: 620px" :height="260" :is-page="false" :list="mingxiList"
<xy-table style="width: 75%" :height="260" :is-page="false" :list="mingxiList"
:table-item="mingxiTable">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
@ -125,7 +125,7 @@
<div class="mingxiwrap">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资编码
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>物资编码
</div>
<div class="xy-table-item-content">
<el-input type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma" placeholder="请选择物资编码"
@ -170,7 +170,7 @@
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>借用/报废数量
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>借用/报废数量
</div>
<div class="xy-table-item-content">
<el-input type="text" @blur='jieyong' v-model="mingxiObj.jieyongshuliang" placeholder="请填写借用/报废数量"
@ -179,7 +179,7 @@
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否回库
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否回库
</div>
<div class="xy-table-item-content">
<el-select v-model="mingxiObj.shifouhuiku" style="width: 300px;" placeholder="请选择">
@ -289,7 +289,10 @@ export default {
},
isShowMingxi:false,
mingxiObj:{
wuzibianma:'',
jieyongshuliang:'',
shifouhuiku:'',
huikushijian:''
},
mingxiObjBefore:{},
mingxiList: [],
@ -366,6 +369,14 @@ export default {
{
title:'名称',
key:'names',
},
{
title:'在库数量',
key:'zaikushuliang',
},
{
title:'物资类型',
key:'wuzileixing',
}
],
wuziList:[]
@ -377,8 +388,6 @@ export default {
},
methods: {
jieyong(){
console.log(this.mingxiObj.jieyongshuliang,this.mingxiObj.zaikushuliang)
console.log(parseInt(this.mingxiObj.jieyongshuliang)>parseInt(this.mingxiObj.zaikushuliang))
if(parseInt(this.mingxiObj.jieyongshuliang)>parseInt(this.mingxiObj.zaikushuliang)){
Message({
type:'warning',
@ -388,6 +397,20 @@ export default {
}
},
mingxiConfirm(){
setTimeout(() => {
this.showLoading = false
this.$nextTick(() => {
this.showLoading = true
})
}, 500)
if(this.mingxiObj.wuzibianma==''||this.mingxiObj.jieyongshuliang==''||this.mingxiObj.shifouhuiku==''){
Message({
type:'warning',
message:'请填写完整数据'
})
this.showLoading = false
return
}
if(this.mingxiIndex!=''){
//
@ -399,13 +422,30 @@ export default {
}else{
this.mingxiList.push(this.mingxiObj)
}
this.mingxiObj = {}
this.wuziList.forEach((items) => {
this.$set(items, 'isSelect', false)
});
this.mingxiObj = {
wuzibianma:'',
jieyongshuliang:'',
shifouhuiku:'',
huikushijian:''
}
this.mingxiObjBefore = {}
this.mingxiIndex = ''
this.isShowMingxi = false
},
mingxiCancel(){
this.mingxiObj = {}
this.wuziList.forEach((items) => {
this.$set(items, 'isSelect', false)
});
this.mingxiObj = {
wuzibianma:'',
jieyongshuliang:'',
shifouhuiku:'',
huikushijian:''
}
this.mingxiObjBefore = {}
this.mingxiIndex = ''
this.isShowMingxi = false
@ -442,8 +482,6 @@ export default {
this.$set(items, 'isSelect', false)
if(items.id==e.id){
this.$set(items, 'isSelect', true)
}
});
this.mingxiObj.wuzibianma = e.wuzibianma
this.mingxiObj.zichanmingcheng = e.zichanmingcheng
this.mingxiObj.wuzileixing = e.wuzileixing
@ -451,6 +489,14 @@ export default {
this.mingxiObj.zaikushuliang = e.zaikushuliang
this.mingxiObj.jiliangdanwei = e.jiliangdanwei
this.mingxiObj.inventorys_id = e.id
}
});
// this.$nextTick(function(){
// this.wuziList.forEach((items) => {
// this.$set(items, 'isSelect', false)
// });
// })
},
wuziPageChange(e){

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增入库' : '编辑入库'" :form="form"
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增入库' : '编辑入库'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:rukushijian>
<div class="xy-table-item">
@ -93,7 +93,7 @@
@click="isShowMingxi=true">新增入库明细</Button>
<Button v-if="form.rukuleixing==''" type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增回库明细</Button>
<xy-table style="width: 620px" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<xy-table style="width: 75%" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
<template v-slot:default="scope">
@ -117,7 +117,7 @@
<div class="mingxiwrap">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资编码
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>物资编码
</div>
<div class="xy-table-item-content" style="display: flex;align-items: center;">
<el-input v-if="form.rukuleixing!=''" type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma"
@ -146,6 +146,15 @@
style="width: 300px;"></el-input>
</div>
</div>
<div class="xy-table-item" v-if="form.rukuleixing!='回库'">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资分类
</div>
<div class="xy-table-item-content">
<el-input type="text" v-model="mingxiObj.fenlei" placeholder="请选择物资分类" disabled
style="width: 300px;"></el-input>
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>计量单位
@ -200,7 +209,7 @@
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库数量
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>入库数量
</div>
<div class="xy-table-item-content">
<el-input type="text" v-model="mingxiObj.rukushuliang" placeholder="请填写入库数量"
@ -288,7 +297,8 @@
isShowMingxi: false,
showLoading: true,
mingxiObj: {
wuzibianma:'',
rukushuliang:''
},
mingxiObjBefore: {},
mingxiList: [],
@ -308,6 +318,7 @@
prop: "wuzileixing",
width: 200
},
{
label: "入库数量",
prop: "rukushuliang",
@ -357,6 +368,9 @@
}, {
title: '名称',
key: 'names',
},{
title:'物资类型',
key:'wuzileixing',
}]
}
},
@ -374,15 +388,14 @@
})
}, 500)
// if (this.mingxiObj.rukushuliang > this.mingxiObj.zaikushuliang) {
// Message({
// type: 'warning',
// message: ''
// })
// this.showLoading = false
// return
// }
console.log("123")
if(this.mingxiObj.wuzibianma==''||this.mingxiObj.rukushuliang==''){
Message({
type:'warning',
message:'请填写完整数据'
})
this.showLoading = false
return
}
if (this.mingxiIndex != '') {
//
@ -394,7 +407,10 @@
} else {
this.mingxiList.push(this.mingxiObj)
}
this.mingxiObj = {}
this.mingxiObj = {
wuzibianma:'',
rukushuliang:''
}
this.mingxiObjBefore = {}
this.mingxiIndex = ''
this.isShowMingxi = false
@ -404,7 +420,10 @@
this.wuziPageIndex = 1
},
mingxiCancel() {
this.mingxiObj = {}
this.mingxiObj = {
wuzibianma:'',
rukushuliang:''
}
this.mingxiObjBefore = {}
this.mingxiIndex = ''
this.isShowMingxi = false
@ -566,6 +585,7 @@
this.mingxiObj.zichanmingcheng = e.zichanmingcheng
this.mingxiObj.wuzileixing = e.wuzileixing
this.mingxiObj.jiliangdanwei = e.jiliangdanwei
this.mingxiObj.fenlei = e.fenlei
if(this.mingxiObj.wuzileixing=='一类一码'){
this.getPici()

Loading…
Cancel
Save