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 data: row
}) })
} }
export const getPrintTemplate = (ids) => {
export const getTemplate = (row) => {
return request({ return request({
url: '/api/logpm-basicdata/goodsAllocation/getTemplate', url: '/api/logpm-basicdata/goodsAllocation/getPrintTemplate',
method: 'post', method: 'post',
responseType: 'blob', params:{
data: row ids
}
}) })
} }
export const getQRCode = (qrCode) => { export const getQRCode = (qrCode) => {
return request({ return request({
url: '/api/logpm-basicdata/goodsAllocation/QRCodeImg', url: '/api/logpm-basicdata/goodsAllocation/QRCodeImg',

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

@ -32,32 +32,35 @@
icon="el-icon-download" icon="el-icon-download"
@click="handleExport"> @click="handleExport">
</el-button> </el-button>
<!-- <el-button type="warning"--> <el-button type="warning"
<!-- plain--> plain
<!-- icon="el-icon-download"--> icon="el-icon-camera"
<!-- @click="handleqr">查看二维码--> @click="handleqr">查看二维码
<!-- </el-button>--> </el-button>
</template> </template>
</avue-crud> </avue-crud>
<el-dialog <el-dialog
title="提示" title="二维码"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="30%" width="600px"
v-model="dialogVisible"> v-model="dialogVisible">
<div > <div >
<div v-for="(item,index) in qrCodeObj" class="pdf-dom"> <!-- <div v-for="(item,index) in qrCodeObj" class="pdf-dom">-->
<el-divider></el-divider> <!-- <el-divider></el-divider>-->
<el-row> <!-- <el-row>-->
<el-col :span="24" > <!-- <el-col :span="24" >-->
<el-image width="10" height="10" w-full :key="index" :src="item " alt="Preview Image"/> <!-- <el-image width="10" height="10" w-full :key="index" :src="item " alt="Preview Image"/>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
</div> <!-- </div>-->
<!--startprint1-->
<div v-html="html"></div>
<!--endprint1-->
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="ddd"> </el-button>--> <!-- <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 type="primary" @click="dialogVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</span> </span>
@ -66,7 +69,7 @@
</template> </template>
<script> <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 option from "@/option/basicdata/basicdataGoodsAllocation";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common"; import {exportBlob} from "@/api/common";
@ -75,6 +78,8 @@
import {dateNow} from "@/utils/date"; import {dateNow} from "@/utils/date";
import NProgress from 'nprogress'; import NProgress from 'nprogress';
import 'nprogress/nprogress.css'; import 'nprogress/nprogress.css';
import {getStockTemplate, showOrderPackgeCode} from "@/api/distribution/distributionStockArticle";
import {getLodop} from "@/utils/LodopFuncs";
export default { export default {
data() { data() {
@ -94,7 +99,7 @@
imgUrl:'', imgUrl:'',
qrCodeObj:[], qrCodeObj:[],
dialogVisible:false, dialogVisible:false,
html: null, //
}; };
}, },
computed: { computed: {
@ -219,22 +224,78 @@
this.$refs.crud.toggleSelection(); 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(){ handleqr(){
if (this.selectionList.length === 0) { if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据"); this.$message.warning("请选择至少一条数据");
return; 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.dialogVisible = true;
this.qrCodeObj=[]; this.qrCodeObj=[];
this.selectionList.forEach(item=>{ this.selectionList.forEach(item=>{
console.log(">>>>>>>>>>",item); // console.log(">>>>>>>>>>",item);
// //
let params={} let params={}
getTemplate(Object.assign(params,item)).then(res=>{ getTemplate(Object.assign(params,item)).then(res=>{
let url = window.URL.createObjectURL(res.data); // data let url = window.URL.createObjectURL(res.data); // data
console.log(">>>>>>>>>>",url);
this.qrCodeObj.push(url); this.qrCodeObj.push(url);
}) })
})
})*/
}, },

Loading…
Cancel
Save