接口
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<search-box v-model="code1"/>
|
||||
<search-box v-model="vehicleCode"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -17,7 +17,7 @@
|
||||
<span class="filter_label">物料编码</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<search-box v-model="code2"/>
|
||||
<search-box v-model="materialData.material_code"/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="toJump('material?title=物料维护')">查询</button>
|
||||
</view>
|
||||
@@ -26,7 +26,7 @@
|
||||
<span class="filter_label filter_input_disabled">物料名称</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" class="filter_input filter_input_disabled" disabled>
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_name" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -34,7 +34,7 @@
|
||||
<span class="filter_label">供应商编码</span>
|
||||
</view>
|
||||
<view class="zd-col-13">
|
||||
<search-box v-model="code3"/>
|
||||
<search-box v-model="suppData.supp_code"/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="toJump('supplier?title=供应商维护')">查询</button>
|
||||
</view>
|
||||
@@ -43,7 +43,7 @@
|
||||
<span class="filter_label filter_input_disabled">供应商名称</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" class="filter_input filter_input_disabled" disabled>
|
||||
<input type="text" v-model="suppData.supp_name" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -51,7 +51,7 @@
|
||||
<span class="filter_label">批次</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="text" class="filter_input">
|
||||
<input type="text" v-model="pcsn" class="filter_input">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -69,7 +69,7 @@
|
||||
<span class="filter_label">重量</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<input type="number" class="filter_input">
|
||||
<input type="number" v-model="qty" class="filter_input">
|
||||
</view>
|
||||
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
|
||||
</view>
|
||||
@@ -78,7 +78,15 @@
|
||||
<span class="filter_label">品质类型</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
|
||||
<uni-data-select v-model="index1" :localdata="options1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">料箱类型</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_select">
|
||||
<uni-data-select v-model="index2" :localdata="options2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -86,42 +94,48 @@
|
||||
<span class="filter_label">烘干次数</span>
|
||||
</view>
|
||||
<view class="zd-col-18">
|
||||
<input type="number" class="filter_input">
|
||||
<input type="number" v-model="num" class="filter_input">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': !code1}" :disabled="disabled">确认组箱</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': !code1}" :disabled="disabled">标签打印</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': !vehicleCode || JSON.stringify(materialData) === '{}' || JSON.stringify(suppData) === '{}'}" :disabled="disabled" @tap="_confirmBox">确认组箱</button>
|
||||
<button class="zd-col-9 button-primary" :class="{'button-info': !vehicleCode || JSON.stringify(materialData) === '{}' || JSON.stringify(suppData) === '{}'}" :disabled="disabled1" @tap="labelPrint">标签打印</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCLodop} from '@/utils/CLodopfuncs.js'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getDate} from '@/utils/utils.js'
|
||||
import {getStructCount, inStorageOrder, getBillNoInfo, storList, inStorageConfirm} from '@/utils/getData2.js'
|
||||
const currentDate = getDate({format: true})
|
||||
import {queryGroupQuality, queryBoxType} from '@/utils/mork2.js'
|
||||
import {confirmBox} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
const currentDate = getDate({
|
||||
format: true
|
||||
})
|
||||
return {
|
||||
title: '',
|
||||
code1: '',
|
||||
code2: '',
|
||||
code3: '',
|
||||
vehicleCode: '',
|
||||
date: currentDate,
|
||||
options: [],
|
||||
index: '',
|
||||
disabled: false
|
||||
options1: [],
|
||||
index1: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
materialData: {},
|
||||
suppData: {},
|
||||
pcsn: null,
|
||||
qty: null,
|
||||
num: 0,
|
||||
disabled: false,
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -134,6 +148,18 @@
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryGroupQuality()
|
||||
this._queryBoxType()
|
||||
},
|
||||
onShow () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.materialData = this.$store.getters.publicObj
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
if (this.$store.getters.formData !== '') {
|
||||
this.suppData = this.$store.getters.formData
|
||||
this.$store.dispatch('setFormData', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toJump (name) {
|
||||
@@ -145,37 +171,107 @@
|
||||
this.date = e.detail.value
|
||||
},
|
||||
/** 下拉框*/
|
||||
async _inStorageOrder () {
|
||||
let res = await inStorageOrder()
|
||||
this.options1 = [...res]
|
||||
async _queryGroupQuality () {
|
||||
try {
|
||||
let res = await queryGroupQuality()
|
||||
if (res && res.data) {
|
||||
this.options1 = [...res.data]
|
||||
} else {
|
||||
this.options1 = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options1 = []
|
||||
}
|
||||
},
|
||||
handleChange1 (e) {
|
||||
if (e) {
|
||||
this._getBillNoInfo(e)
|
||||
async _queryBoxType () {
|
||||
try {
|
||||
let res = await queryBoxType()
|
||||
if (res && res.data) {
|
||||
this.options2 = [...res.data]
|
||||
} else {
|
||||
this.options2 = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.code1 = ''
|
||||
this.vehicleCode = ''
|
||||
this.date = currentDate
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.materialData = {}
|
||||
this.suppData = {}
|
||||
this.pcsn = null
|
||||
this.qty = null
|
||||
this.num = 0
|
||||
},
|
||||
async _inStorageConfirm () {
|
||||
async _confirmBox () {
|
||||
this.disabled = true
|
||||
if (!this.index) {
|
||||
if (!this.vehicleCode || JSON.stringify(this.materialData) === '{}' || JSON.stringify(this.suppData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await inStorageConfirm()
|
||||
if (res.code === '200') {
|
||||
this.index = ''
|
||||
let res = await confirmBox(this.vehicleCode, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.suppData.supp_code, this.suppData.supp_name, this.pcsn, this.date, this.qty, this.index1, this.index2, this.num)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
labelPrint () {
|
||||
this.disabled = true
|
||||
let data = Object.assign({}, this.materialData, this.suppData, {pcsn: this.pcsn, produce_time: this.date, bake_num: this.num})
|
||||
this.toPrint(data)
|
||||
},
|
||||
toPrint (data) {
|
||||
let iparr = this.$store.getters.printUrl.split(":")
|
||||
let printUrl = iparr[1].slice(2)
|
||||
let LODOP = getCLodop();
|
||||
if (!(LODOP.webskt && LODOP.webskt.readyState === 1)) {
|
||||
uni.showToast({
|
||||
title: '当前配置ip:' + printUrl + '网络不通,请检查',
|
||||
icon: 'none',
|
||||
duration: 5000
|
||||
})
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
LODOP.SET_LICENSES('浙江省烟草专卖局(公司)', 'C0C4A46A3A0D1F526D426018D9F11921', '', '')
|
||||
// 更换为打印服务器ip 不需要加前缀
|
||||
LODOP.PRINT_INIT(null, printUrl);
|
||||
// 打印机序号 规则为打印服务器打印机列表倒数从0开始 -1为默认打印机
|
||||
LODOP.SET_PRINTER_INDEX(-1);
|
||||
// 设置打印纸大小
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '130mm', '67mm', '');
|
||||
LODOP.ADD_PRINT_RECT('1mm', '3mm', '124mm', '61mm', 0, 1);
|
||||
LODOP.SET_PRINT_STYLE('FontSize', 12);
|
||||
LODOP.SET_PRINT_STYLE('Bold', 1);
|
||||
LODOP.ADD_PRINT_BARCODE('2mm', '4mm', '33mm', '33mm', 'QRCode', data.material_code + '##' + data.supp_code);
|
||||
LODOP.ADD_PRINT_TEXT('5mm', '35mm', '80mm', '15mm', '物料编码:' + data.material_code);
|
||||
LODOP.ADD_PRINT_TEXT('12mm', '35mm', '80mm', '15mm', '物料名称:' + data.material_name);
|
||||
LODOP.ADD_PRINT_TEXT('19mm', '35mm', '80mm', '15mm', ' 规格:' + data.material_spec);
|
||||
LODOP.ADD_PRINT_TEXT('26mm', '35mm', '80mm', '15mm', ' 型号:' + data.material_model);
|
||||
LODOP.ADD_PRINT_TEXT('34mm', '5mm', '80mm', '15mm', ' 执行标准:' + data.execution_stand)
|
||||
LODOP.ADD_PRINT_TEXT('34mm', '59mm', '80mm', '15mm', '有效期(天):' + data.quality_time)
|
||||
LODOP.ADD_PRINT_TEXT('41mm', '5mm', '80mm', '15mm', ' 批次:' + data.pcsn)
|
||||
LODOP.ADD_PRINT_TEXT('41mm', '59mm', '80mm', '15mm', ' 生产日期:' + data.produce_time)
|
||||
LODOP.ADD_PRINT_TEXT('48mm', '5mm', '80mm', '15mm', '供应商编码:' + data.supp_code)
|
||||
LODOP.ADD_PRINT_TEXT('48mm', '59mm', '80mm', '15mm', '供应商名称:' + data.supp_name)
|
||||
LODOP.ADD_PRINT_TEXT('55mm', '5mm', '80mm', '15mm', ' 烘干次数:' + data.bake_num)
|
||||
// LODOP.PRINT();
|
||||
LODOP.PREVIEW()
|
||||
uni.showToast({
|
||||
title: '打印成功',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user