打印服务
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
</view>
|
||||
<view class="zd_wrapper">
|
||||
<view class="input-wrap">
|
||||
<view class="input-label">刷新时间(s)</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||
<view class="input-label">打印地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入打印地址" v-model="printip">
|
||||
</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 class="input-label">刷新时间(s)</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -29,7 +29,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {virtualprintType} from '@/utils/getData2.js'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
export default {
|
||||
components: {
|
||||
@@ -37,37 +36,28 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
index: '',
|
||||
addrip: this.$store.getters.baseUrl,
|
||||
printip: this.$store.getters.printUrl,
|
||||
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.addrip)
|
||||
this.options = [...res.data]
|
||||
// if (this.$store.getters.setPrintName !== '') {
|
||||
// this.index = this.$store.getters.setPrintName
|
||||
// }
|
||||
},
|
||||
_submit () {
|
||||
if (this.addrip === '') {
|
||||
uni.showToast({
|
||||
title: '服务器地址',
|
||||
title: '请填写服务器地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.printip === '') {
|
||||
uni.showToast({
|
||||
title: '请填写打印地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -80,7 +70,7 @@
|
||||
return
|
||||
}
|
||||
// 存值
|
||||
this.$store.dispatch('setConfig',{baseUrl: this.addrip, setTime: this.setTime * 1000, setPrintName: this.index})
|
||||
this.$store.dispatch('setConfig',{baseUrl: this.addrip, printUrl: this.printip,setTime: this.setTime * 1000})
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
|
||||
@@ -71,15 +71,16 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar_new">
|
||||
<view class="zd-col-7">
|
||||
<view class="zd-row jcflexstart">
|
||||
<view class="iconfont icon_unchecked" :class="{'icon_checked': isV}" @tap="isVirtual"></view>
|
||||
<view class="zd-col-4">
|
||||
<view class="zd-row flexcol">
|
||||
<view class="iconfont icon_unchecked mgb10" :class="{'icon_checked': isV}" @tap="isVirtual"></view>
|
||||
<view class="filter_input_wraper_inn_text">是否配盘</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="zd-col-4 submit-button_new" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !index1 || !val1 || !val3 || !index2 || !$store.getters.publicObj}" :disabled="disabled1" @tap="_groupManual">开始组盘</button>
|
||||
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': checkArr.length === 0}" :disabled="disabled2" @tap="_groupLink">开始配盘</button>
|
||||
<button class="zd-col-5 submit-button_new" :class="{'btn-disabled': !index1 || !val1 || !val3 || !index2 || !$store.getters.publicObj}" :disabled="disabled1" @tap="_groupManual">开始组盘</button>
|
||||
<button class="zd-col-5 submit-button_new" :class="{'btn-disabled': checkArr.length === 0}" :disabled="disabled2" @tap="_groupLink">开始配盘</button>
|
||||
<button class="zd-col-4 submit-button_new" :class="{'btn-disabled': !val1 || (isV === true && printActive === false)}" :disabled="disabled3" @tap="_pdaPrintf">打印</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -87,7 +88,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPoints, getVehicleType, queryVehicleGroup, groupManual, groupLink} from '@/utils/getData2.js'
|
||||
import {queryPoints, getVehicleType, queryVehicleGroup, groupManual, groupLink, pdaPrintf} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -108,7 +109,9 @@
|
||||
isV: false,
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
checkArr: []
|
||||
disabled3: false,
|
||||
checkArr: [],
|
||||
printActive: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
@@ -179,7 +182,6 @@
|
||||
let res = await groupManual(this.index1, this.val1, this.index2, this.val4, this.val5, this.val3, this.isV)
|
||||
this.disabled1 = false
|
||||
this.checkArr = []
|
||||
this.clearUp()
|
||||
this._queryVehicleGroup()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
@@ -206,7 +208,7 @@
|
||||
let res = await groupLink(arr)
|
||||
this.disabled2 = false
|
||||
this.checkArr = []
|
||||
this.clearUp()
|
||||
this.printActive = true
|
||||
this._queryVehicleGroup()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
@@ -222,7 +224,22 @@
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.printActive = false
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
},
|
||||
/** 打印 */
|
||||
async _pdaPrintf () {
|
||||
this.disabled3 = true
|
||||
if (!this.val1 || (this.isV === true && this.printActive === false)) {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await pdaPrintf(this.val1)
|
||||
this.disabled3 = false
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user