diff --git a/pages/hdyy/zpgl/mater-zudai.vue b/pages/hdyy/zpgl/mater-zudai.vue
index 70c65d3..99b2f3d 100644
--- a/pages/hdyy/zpgl/mater-zudai.vue
+++ b/pages/hdyy/zpgl/mater-zudai.vue
@@ -9,8 +9,8 @@
袋号
-
-
+
+
@@ -79,6 +79,17 @@
+
+
+ 有效期至
+
+
+
+ {{date}}
+
+
+
+
计量单位
@@ -91,8 +102,8 @@
-
-
+
+
@@ -103,14 +114,19 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getDate} from '@/utils/utils.js'
- import {queryRecordNo, byBagCodeInfo, confirmBagAssembly, printBag} from '@/utils/getData3.js'
+ import {queryRecordNo, byBagCodeInfo, confirmBagAssembly, queryBagInfo, printBag} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
+ const currentDate = getDate({
+ format: true
+ })
return {
+ nowDate: currentDate,
+ date: currentDate,
title: '',
val1: '',
recordNo: '',
@@ -119,9 +135,19 @@
unit: 'KG',
disabled: false,
disabled1: false,
- pcsn: ''
+ pcsn: '',
+ flag: false
};
},
+ computed: {
+ startDate() {
+ return this.nowDate
+ // return getDate('start');
+ },
+ endDate() {
+ return getDate('end');
+ }
+ },
onLoad (options) {
this.title = options.title
this._queryRecordNo()
@@ -133,6 +159,36 @@
}
},
methods: {
+ bindDateChange: function(e) {
+ this.date = e.detail.value
+ },
+ bindDel () {
+ this.date = ''
+ },
+ handleChange (e) {
+ if (e) {
+ this._queryBagInfo(e)
+ }
+ },
+ async _queryBagInfo (e) {
+ try {
+ let res = await queryBagInfo(e)
+ if (res) {
+ this.materialData = res.data
+ this.pcsn = this.materialData.pcsn
+ this.num = this.materialData.qty
+ this.date = this.materialData.validity_period
+ // 调用此接口后并成功返回结构后,页面所有操作禁用,【标签打印】按钮可以正常使用。
+ this.flag = true
+ } else {
+ this.materialData = {}
+ this.flag = false
+ }
+ } catch (e) {
+ this.materialData = {}
+ this.flag = false
+ }
+ },
async _queryRecordNo () {
try {
let res = await queryRecordNo()
@@ -167,12 +223,15 @@
this.disabled1 = false
},
toZdPrint () {
+ if (this.flag) {
+ return
+ }
this._confirmBagAssembly()
this.labelPrint()
},
async _confirmBagAssembly () {
this.disabled = true
- if (!this.val1 || !this.num || !this.pcsn || JSON.stringify(this.materialData) === '{}') {
+ if (this.flag || !this.val1 || !this.num || !this.pcsn || JSON.stringify(this.materialData) === '{}') {
this.disabled = false
return
}
@@ -202,6 +261,7 @@
// },
async labelPrint () {
this.disabled1 = true
+ this.flag = false
if (!this.val1 || JSON.stringify(this.materialData) === '{}') {
this.disabled1 = false
return
diff --git a/pages/hdyy/zpgl/mater-zutong.vue b/pages/hdyy/zpgl/mater-zutong.vue
index 05565a8..df48d47 100644
--- a/pages/hdyy/zpgl/mater-zutong.vue
+++ b/pages/hdyy/zpgl/mater-zutong.vue
@@ -9,7 +9,7 @@
桶号
-
+
@@ -74,8 +74,8 @@
-
-
+
+
@@ -87,7 +87,7 @@
import SearchBox from '@/components/SearchBox.vue'
import NumberInput from '@/components/NumberInput.vue'
import {getDate} from '@/utils/utils.js'
- import {queryRecordNoBucked, confirmBucketAssembly, printBucked} from '@/utils/getData3.js'
+ import {queryBuckInfo, queryRecordNoBucked, confirmBucketAssembly, printBucked} from '@/utils/getData3.js'
export default {
components: {
NavBar,
@@ -105,7 +105,8 @@
unit: 'KG',
disabled: false,
disabled1: false,
- pcsn: ''
+ pcsn: '',
+ flag: false
};
},
onLoad (options) {
@@ -119,6 +120,30 @@
}
},
methods: {
+ handleChange (e) {
+ if (e) {
+ this._queryBuckInfo(e)
+ }
+ },
+ async _queryBuckInfo (e) {
+ try {
+ let res = await queryBuckInfo(e)
+ if (res) {
+ this.materialData = res.data
+ this.pcsn = this.materialData.pcsn
+ this.weight = this.materialData.bucket_weight
+ this.num = this.materialData.qty
+ // 调用此接口后并成功返回结构后,页面所有操作禁用,【标签打印】按钮可以正常使用。
+ this.flag = true
+ } else {
+ this.materialData = {}
+ this.flag = false
+ }
+ } catch (e) {
+ this.materialData = {}
+ this.flag = false
+ }
+ },
async _queryRecordNoBucked () {
try {
let res = await queryRecordNoBucked()
@@ -144,12 +169,15 @@
this.disabled1 = false
},
toZtPrint () {
+ if (this.flag) {
+ return
+ }
this._confirmBucketAssembly()
this.labelPrint()
},
async _confirmBucketAssembly () {
this.disabled = true
- if (!this.val1 || !this.weight || !this.pcsn || JSON.stringify(this.materialData) === '{}') {
+ if (this.flag || !this.val1 || !this.weight || !this.pcsn || JSON.stringify(this.materialData) === '{}') {
this.disabled = false
return
}
@@ -178,6 +206,7 @@
// },
async labelPrint () {
this.disabled1 = true
+ this.flag = false
if (!this.val1 || JSON.stringify(this.materialData) === '{}' || JSON.stringify(this.suppData) === '{}') {
this.disabled1 = false
return
diff --git a/utils/getData3.js b/utils/getData3.js
index 1a216c7..db992e4 100644
--- a/utils/getData3.js
+++ b/utils/getData3.js
@@ -158,6 +158,11 @@ export const printBag = (row, printId) => request({
url:'api/print/printBag',
data: {row: row, print_id: printId}
})
+// 根据扫袋码查询组袋信息
+export const queryBagInfo = (bagNo) => request({
+ url:'api/pdaCommon/queryBagInfo',
+ data: {bagNo: bagNo}
+})
// 物料组盘
// 获取组盘信息
@@ -187,6 +192,12 @@ export const printBucked = (row, printId) => request({
url:'api/print/printBucked',
data: {row: row, print_id: printId}
})
+// 根据扫桶码获取组桶信息
+export const queryBuckInfo = (bcode) => request({
+ url:'api/pdaCommon/queryBuckInfo',
+ data: {bucket_code: bcode}
+})
+
/**
* 仓储管理