设置添加打印机

This commit is contained in:
2022-11-24 17:55:16 +08:00
parent e0ae9c5daa
commit dc86889653
3 changed files with 35 additions and 1 deletions

View File

@@ -14,14 +14,22 @@
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
</view>
</view>
<view class="zd_wrapper">
<view class="input-wrap">
<view class="input-label" style="margin-right: 20upx;">打印机选择</view>
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" @click="_submit">确认</button>
<button class="submit-button" @click="_virtualprintType">查询</button>
</view>
</view>
</template>
<script>
import {virtualprintType} from '@/utils/getData2.js'
import NavBar from '@/components/NavBar.vue'
export default {
components: {
@@ -29,16 +37,33 @@
},
data() {
return {
options: [],
index: '',
addrip: this.$store.getters.baseUrl,
setTime: this.$store.getters.setTime / 1000
};
},
created () {
// this._virtualprintType()
},
methods: {
goIn () {
uni.redirectTo({
url: '/pages/login/login'
})
},
/** 选择器 */
selectChange(e) {
this.index = e
},
/** 打印机类型下拉框查询 */
async _virtualprintType () {
let res = await virtualprintType()
this.options = [...res.data]
// if (this.$store.getters.setPrintName !== '') {
// this.index = this.$store.getters.setPrintName
// }
},
_submit () {
if (this.addrip === '') {
uni.showToast({
@@ -55,7 +80,7 @@
return
}
// 存值
this.$store.dispatch('setConfig',{baseUrl: this.addrip, setTime: this.setTime * 1000})
this.$store.dispatch('setConfig',{baseUrl: this.addrip, setTime: this.setTime * 1000, setPrintName: this.index})
uni.redirectTo({
url: '/pages/login/login'
})