设置添加打印机
This commit is contained in:
@@ -14,14 +14,22 @@
|
|||||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||||
</view>
|
</view>
|
||||||
</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>
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<button class="submit-button" @click="_submit">确认</button>
|
<button class="submit-button" @click="_submit">确认</button>
|
||||||
|
<button class="submit-button" @click="_virtualprintType">查询</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {virtualprintType} from '@/utils/getData2.js'
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -29,16 +37,33 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
options: [],
|
||||||
|
index: '',
|
||||||
addrip: this.$store.getters.baseUrl,
|
addrip: this.$store.getters.baseUrl,
|
||||||
setTime: this.$store.getters.setTime / 1000
|
setTime: this.$store.getters.setTime / 1000
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
// this._virtualprintType()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goIn () {
|
goIn () {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/login/login'
|
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 () {
|
_submit () {
|
||||||
if (this.addrip === '') {
|
if (this.addrip === '') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -55,7 +80,7 @@
|
|||||||
return
|
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({
|
uni.redirectTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -274,3 +274,8 @@ export const customerPrint = (box_no) => request({
|
|||||||
box_no: box_no
|
box_no: box_no
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 1.3打印机类型
|
||||||
|
export const virtualprintType = () => request({
|
||||||
|
url:'api/pda/virtual/printType',
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
@@ -4,6 +4,7 @@ const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.198:
|
|||||||
const state = {
|
const state = {
|
||||||
baseUrl: uni.getStorageSync('baseUrl') || baseUrl,
|
baseUrl: uni.getStorageSync('baseUrl') || baseUrl,
|
||||||
setTime: uni.getStorageSync('setTime') || 5000,
|
setTime: uni.getStorageSync('setTime') || 5000,
|
||||||
|
setPrintName: uni.getStorageSync('setPrintName') || '',
|
||||||
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
||||||
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
||||||
saveToken: uni.getStorageSync('saveToken') || ''
|
saveToken: uni.getStorageSync('saveToken') || ''
|
||||||
@@ -11,6 +12,7 @@ const state = {
|
|||||||
const getters = {
|
const getters = {
|
||||||
baseUrl: state => state.baseUrl,
|
baseUrl: state => state.baseUrl,
|
||||||
setTime: state => state.setTime,
|
setTime: state => state.setTime,
|
||||||
|
setPrintName: state => state.setPrintName,
|
||||||
loginName: state => state.loginName,
|
loginName: state => state.loginName,
|
||||||
userInfo: state => state.userInfo,
|
userInfo: state => state.userInfo,
|
||||||
saveToken: state => state.saveToken
|
saveToken: state => state.saveToken
|
||||||
@@ -19,6 +21,7 @@ const actions = {
|
|||||||
setConfig ({commit}, res) {
|
setConfig ({commit}, res) {
|
||||||
uni.setStorageSync('baseUrl', res.baseUrl)
|
uni.setStorageSync('baseUrl', res.baseUrl)
|
||||||
uni.setStorageSync('setTime', res.setTime)
|
uni.setStorageSync('setTime', res.setTime)
|
||||||
|
uni.setStorageSync('setPrintName', res.setPrintName)
|
||||||
commit(types.COM_CONFIG, res)
|
commit(types.COM_CONFIG, res)
|
||||||
},
|
},
|
||||||
saveLoginName({commit}, res) {
|
saveLoginName({commit}, res) {
|
||||||
@@ -47,6 +50,7 @@ const mutations = {
|
|||||||
[types.COM_CONFIG] (state, res) {
|
[types.COM_CONFIG] (state, res) {
|
||||||
state.baseUrl = res.baseUrl
|
state.baseUrl = res.baseUrl
|
||||||
state.setTime = res.setTime
|
state.setTime = res.setTime
|
||||||
|
state.setPrintName = res.setPrintName
|
||||||
},
|
},
|
||||||
[types.SAVE_LOGIN_NAME] (state, res) {
|
[types.SAVE_LOGIN_NAME] (state, res) {
|
||||||
state.loginName = res
|
state.loginName = res
|
||||||
|
|||||||
Reference in New Issue
Block a user