From 019f1c8bac7e8986d299aff70c123dedc1747d72 Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期四, 06 六月 2024 11:15:10 +0800 Subject: [PATCH] - --- jcdm-ui/src/views/main/bs/workshop/index.vue | 93 +++++++++++++++++++++++++++++++++------------- 1 files changed, 66 insertions(+), 27 deletions(-) diff --git a/jcdm-ui/src/views/main/bs/workshop/index.vue b/jcdm-ui/src/views/main/bs/workshop/index.vue index 44c0311..2cc0976 100644 --- a/jcdm-ui/src/views/main/bs/workshop/index.vue +++ b/jcdm-ui/src/views/main/bs/workshop/index.vue @@ -1,31 +1,39 @@ <template> <div class="app-container"> <el-card class="box-card"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="杞﹂棿缂栫爜" prop="workshopCode"> - <el-input - v-model="queryParams.workshopCode" - placeholder="璇疯緭鍏ヨ溅闂寸紪鐮�" - clearable - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <el-form-item label="杞﹂棿鍚嶇О" prop="workshopName"> - <el-input - v-model="queryParams.workshopName" - placeholder="璇疯緭鍏ヨ溅闂村悕绉�" - clearable - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <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>--> - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> - </el-form-item> - </el-form> - <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px"> - </el-form> +<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">--> +<!-- <el-form-item label="杞﹂棿缂栫爜" prop="workshopCode">--> +<!-- <el-input--> +<!-- v-model="queryParams.workshopCode"--> +<!-- placeholder="璇疯緭鍏ヨ溅闂寸紪鐮�"--> +<!-- clearable--> +<!-- @keyup.enter.native="handleQuery"--> +<!-- />--> +<!-- </el-form-item>--> +<!-- <el-form-item label="杞﹂棿鍚嶇О" prop="workshopName">--> +<!-- <el-input--> +<!-- v-model="queryParams.workshopName"--> +<!-- placeholder="璇疯緭鍏ヨ溅闂村悕绉�"--> +<!-- clearable--> +<!-- @keyup.enter.native="handleQuery"--> +<!-- />--> +<!-- </el-form-item>--> +<!-- <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>–>--> +<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>--> +<!-- </el-form-item>--> +<!-- </el-form>--> +<!-- <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px">--> +<!-- </el-form>--> + <div> + <div id="printMe"> + <div ref="canvasWrapper" id="canvasWrapper"></div> + <p>1111</p> + </div> + <el-button @click="print">鎵撳嵃</el-button> + <el-button @click="test1">鐢熸垚浜岀淮鐮�</el-button> + </div> </el-card> <el-card style="margin-top: 10px" class="box-card"> @@ -94,9 +102,9 @@ </el-table-column> <el-table-column label="鏇存柊浜�" align="center" prop="updateUser" width="150"> </el-table-column> - <el-table-column label="鏇存柊鏃堕棿" align="center" prop="updateTime" width="180"> + <el-table-column label="鏇存柊鏃堕棿" align="center" prop="updateTime"> </el-table-column> - <el-table-column fixed="right" label="鎿嶄綔" width="200" align="center" class-name="small-padding fixed-width"> + <el-table-column fixed="right" label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button size="mini" @@ -168,6 +176,7 @@ </template> <script> +import QRCode from 'qrcodejs2' import { listWorkshop, getWorkshop, delWorkshop, addWorkshop, updateWorkshop } from "@/api/main/bs/workshop/workshop"; export default { @@ -175,6 +184,7 @@ dicts: ['sys_normal_disable'], data() { return { + text: '1234', select: '', // 閬僵灞� loading: true, @@ -224,8 +234,37 @@ }, created() { this.getList(); + // this.test1(); }, methods: { + 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; + + // 鏂板紑椤甸潰鎵撳嵃 + 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: 50, + height: 50, + text: this.text, + colorDark: '#000', + colorLight: '#fff' + }) + }) + }, advancedQuery(){ this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true; }, -- Gitblit v1.9.3