From 616f9896be815a60b5c4063116b7d138892dcfaf Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期二, 14 五月 2024 14:59:25 +0800 Subject: [PATCH] - --- jcdm-ui/src/views/main/om/productionOrde/index.vue | 83 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 81 insertions(+), 2 deletions(-) diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue index b053002..ddb4020 100644 --- a/jcdm-ui/src/views/main/om/productionOrde/index.vue +++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue @@ -28,6 +28,14 @@ /> </el-select> </el-form-item> + <div style="display: none"> + <div id="printMe" style="width: 500px;"> + <div ref="canvasWrapper" id="canvasWrapper" style="display: flex;justify-content: center;"></div> + <p style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;">{{packCode}}</p> + </div> + <el-button @click="print">鎵撳嵃</el-button> + <el-button @click="test1">鐢熸垚浜岀淮鐮�</el-button> + </div> <el-form-item style="float: right"> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> <el-button type="warning" icon="el-icon-copy-document" size="mini" @click="advancedQuery">楂樼骇鏌ヨ</el-button> @@ -120,6 +128,15 @@ v-hasPermi="['om:productionOrde:export']" >瀵煎嚭</el-button> </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="getWorkOrders" + >鎺ユ敹</el-button> + </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -134,6 +151,10 @@ </el-table-column> <!-- <el-table-column label="璁㈠崟缂栧彿" width="140" align="center" prop="salesOrderCode">--> <!-- </el-table-column>--> + <el-table-column :show-overflow-tooltip='true' label="pack鐮�" width="160" align="center" prop="productNum"> + </el-table-column> + <el-table-column :show-overflow-tooltip='true' label="灏忚溅鐮�" width="160" align="center" prop="trolleyYard"> + </el-table-column> <el-table-column label="浜у搧缂栧彿" width="110" align="center" prop="productCode"> </el-table-column> <el-table-column label="浜у搧鍚嶇О" width="120" align="center" prop="productName"> @@ -260,7 +281,17 @@ import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom"; import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute"; import ItemSelect from "@/components/itemSelect/single.vue"; -import { importTemplate, upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde"; +import { + importTemplate, + upDownMove, + listProductionOrde, + getProductionOrde, + delProductionOrde, + addProductionOrde, + updateProductionOrde, + receivingWorkOrders +} from "@/api/main/om/productionOrde/productionOrde"; +import QRCode from "qrcodejs2"; export default { name: "ProductionOrde", @@ -270,6 +301,8 @@ }, data() { return { + // packCode: '0RSPB001139E3AE4X0000011', + packCode: 'test111', titleName: '', options: [], lineOptions: [], @@ -361,7 +394,53 @@ this.getList(); this.initWorkshop(); }, + mounted() { + this.test1() + }, methods: { + async getWorkOrders(){ + await receivingWorkOrders().then(response => { + this.getList() + this.packCode = response.msg; + this.test1() + }); + setTimeout(() => { + this.print() + },50) + }, + print() { + // 鏈〉闈㈢洿鎺ユ墦鍗帮紙鏈塨ug鍗曞瞾鍏堜笉瑕佸垹锛� + // let oldStr = window.document.body.innerHTML; + // let newStr = document.getElementById('printMe').innerHTML; + // document.body.innerHTML = newStr; + // window.print(); + // document.body.innerHTML = oldStr; + // return false; + + // 鏂板紑椤甸潰鎵撳嵃 + // document.getElementById('canvasWrapper').innerHTML = ''; + let newStr = document.getElementById('printMe').innerHTML; + let newWin = window.open('', '_blank'); + newWin.document.body.innerHTML = newStr; + newWin.print(); + return false; + }, + test1(){ + document.getElementById('canvasWrapper').innerHTML = '' + this.$nextTick(() => { + let qrCode = new QRCode('canvasWrapper',{ + width: 80, + height: 80, + padding: 0, + margin: 0, + text: this.packCode, + colorDark: '#000', + colorLight: '#fff' + }) + }) + // console.log(this.packCode) + // this.print() + }, /** 瀵煎叆鎸夐挳鎿嶄綔 */ handleImport() { this.upload.title = "璁㈠崟淇℃伅瀵煎叆"; @@ -485,7 +564,7 @@ marketAreaCode: null, softwareVersionCode: null, productCompanyCode: null, - spareField1: null, + trolleyYard: null, spareField2: null, spareField3: null, spareField4: null, -- Gitblit v1.9.3