Browse Source

货位码调整

fix_bug_pro20231227
big-y 2 years ago
parent
commit
5a9b63bad6
  1. 13
      src/api/basicdata/basicdataGoodsAllocation.js
  2. 101
      src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation.vue

13
src/api/basicdata/basicdataGoodsAllocation.js

@ -47,18 +47,17 @@ export const update = (row) => {
data: row
})
}
export const getTemplate = (row) => {
export const getPrintTemplate = (ids) => {
return request({
url: '/api/logpm-basicdata/goodsAllocation/getTemplate',
url: '/api/logpm-basicdata/goodsAllocation/getPrintTemplate',
method: 'post',
responseType: 'blob',
data: row
params:{
ids
}
})
}
export const getQRCode = (qrCode) => {
return request({
url: '/api/logpm-basicdata/goodsAllocation/QRCodeImg',

101
src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation.vue

@ -32,32 +32,35 @@
icon="el-icon-download"
@click="handleExport">
</el-button>
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleqr">查看二维码-->
<!-- </el-button>-->
<el-button type="warning"
plain
icon="el-icon-camera"
@click="handleqr">查看二维码
</el-button>
</template>
</avue-crud>
<el-dialog
title="提示"
title="二维码"
:visible.sync="dialogVisible"
width="30%"
width="600px"
v-model="dialogVisible">
<div >
<div v-for="(item,index) in qrCodeObj" class="pdf-dom">
<el-divider></el-divider>
<!-- <div v-for="(item,index) in qrCodeObj" class="pdf-dom">-->
<!-- <el-divider></el-divider>-->
<el-row>
<el-col :span="24" >
<el-image width="10" height="10" w-full :key="index" :src="item " alt="Preview Image"/>
</el-col>
</el-row>
</div>
<!-- <el-row>-->
<!-- <el-col :span="24" >-->
<!-- <el-image width="10" height="10" w-full :key="index" :src="item " alt="Preview Image"/>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!--startprint1-->
<div v-html="html"></div>
<!--endprint1-->
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="ddd"> </el-button>-->
<el-button type="primary" @click="handleqr"> </el-button>
<el-button type="primary" @click="printTemplate"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</span>
@ -66,7 +69,7 @@
</template>
<script>
import {getList, getDetail, add, update, remove,getTemplate,getQRCode} from "@/api/basicdata/basicdataGoodsAllocation";
import {getList, getDetail, add, update, remove,getPrintTemplate,getQRCode} from "@/api/basicdata/basicdataGoodsAllocation";
import option from "@/option/basicdata/basicdataGoodsAllocation";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@ -75,6 +78,8 @@
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import {getStockTemplate, showOrderPackgeCode} from "@/api/distribution/distributionStockArticle";
import {getLodop} from "@/utils/LodopFuncs";
export default {
data() {
@ -94,7 +99,7 @@
imgUrl:'',
qrCodeObj:[],
dialogVisible:false,
html: null, //
};
},
computed: {
@ -219,22 +224,78 @@
this.$refs.crud.toggleSelection();
});
},
//
printTemplate() {
let that=this;
this.selectionList.map(item=>{
let ids=item.id;
console.log(ids);
getPrintTemplate(ids).then(res => {
let pri_html="";
pri_html=this.getHtmls(res.data.data.dataList,res.data.data.templateHtml)
// console.log(pri_html);
that.w_print(pri_html);
});
// checkcode.push(item.orderPackageCode)
})
},
//
w_print(templateData){
let LODOP = getLodop();
// let templateData = "res.data.data";
// console.log(templateData);
LODOP.PRINT_INITA(1, 1, 900, 660, '测试预览功能');
LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
LODOP.SET_PRINT_STYLEA(0,"TextNeatRow",true);//
// //
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Auto-Width');
// //
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
// // datahtml
LODOP.ADD_PRINT_HTM('0%', '0%', '100%', '100%', templateData);
// LODOP.PREVIEW(); //()
LODOP.PRINT(); //
},
handleqr(){
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
let checkcode=[]
this.selectionList.map(item=>{
checkcode.push(item.id)
// checkcode.push(item.orderPackageCode)
})
let qr=checkcode.join(',');
console.log(qr);
getPrintTemplate(qr).then(res => {
// this.orderPackageCode = res.data
console.log(res.data);
this.html=''
this.html=this.getHtmls(res.data.data.dataList,res.data.data.templateHtml)
});
this.dialogVisible = true;
/* this.dialogVisible = true;
this.qrCodeObj=[];
this.selectionList.forEach(item=>{
console.log(">>>>>>>>>>",item);
// console.log(">>>>>>>>>>",item);
//
let params={}
getTemplate(Object.assign(params,item)).then(res=>{
let url = window.URL.createObjectURL(res.data); // data
console.log(">>>>>>>>>>",url);
this.qrCodeObj.push(url);
})
})
})*/
},

Loading…
Cancel
Save