From d7ec91aa0ed193f8347af2cead65f245f42a1e0d Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Fri, 30 Jun 2023 17:28:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E6=88=90=E5=93=81=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/config/filter.js | 8 + src/config/getData2.js | 6 +- src/config/http.js | 2 +- src/main.js | 6 + .../modules/semifinished/mater-search.vue | 39 +++- .../modules/semifinished/out-mater-search.vue | 29 ++- .../semi-finished-instore-search.vue | 5 + .../semifinished/semi-finished-instore.vue | 18 +- .../semifinished/semi-finished-outstore.vue | 183 ++++++++++++++---- src/style/layout.styl | 4 + yarn.lock | 5 + 12 files changed, 260 insertions(+), 46 deletions(-) create mode 100644 src/config/filter.js diff --git a/package.json b/package.json index c63d5c3..d0f72b4 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "fastclick": "^1.0.6", "jsencrypt": "^3.3.2", "vue": "^2.5.2", + "vue-infinite-scroll": "^2.0.2", "vue-router": "^3.0.1", "vuex": "^3.0.1" }, diff --git a/src/config/filter.js b/src/config/filter.js new file mode 100644 index 0000000..3d0058e --- /dev/null +++ b/src/config/filter.js @@ -0,0 +1,8 @@ +const filter = { + numeric (value, bit) { + if (!value) return '' + return Number(value).toFixed(bit) + } +} + +export default filter diff --git a/src/config/getData2.js b/src/config/getData2.js index 60c9ebb..13f92bf 100644 --- a/src/config/getData2.js +++ b/src/config/getData2.js @@ -123,8 +123,10 @@ export const getBcpStor = () => post('api/pda/bcp/in/getBcpStor', {}) // 1.2单据类型下拉框 export const getBillType = () => post('api/pda/bcp/in/getBillType', {}) // 1.3物料选择页面 -export const getMaterial = (code) => post('api/pda/bcp/in/getMaterial', { - material_code: code +export const getMaterial = (code, page, size) => post('api/pda/bcp/in/getMaterial', { + material_code: code, + page: page, + size: size }) // export const getMaterial = (code) => { // let res = { diff --git a/src/config/http.js b/src/config/http.js index 2f069ef..7ac5793 100644 --- a/src/config/http.js +++ b/src/config/http.js @@ -3,7 +3,7 @@ import { Dialog } from './utils.js' import store from '../vuex/store' import router from '@/router' -axios.defaults.timeout = 50000 +axios.defaults.timeout = 5000 axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' axios.interceptors.request.use( diff --git a/src/main.js b/src/main.js index ae983c2..1347c70 100644 --- a/src/main.js +++ b/src/main.js @@ -7,13 +7,16 @@ import store from './vuex/store' import '@style/reset.css' import '@style/layout.styl' import fastClick from 'fastclick' +import infiniteScroll from 'vue-infinite-scroll' import { DatePicker, Select, Option } from 'element-ui' import '@config/rem.js' import {post} from '@config/http.js' import { Dialog, toast } from '@config/utils.js' +import filter from '@config/filter.js' import JSEncrypt from 'jsencrypt' fastClick.attach(document.body) +Vue.use(infiniteScroll) Vue.use(DatePicker) Vue.use(Select) Vue.use(Option) @@ -21,6 +24,9 @@ Vue.prototype.$post = post Vue.prototype.Dialog = Dialog Vue.prototype.toast = toast Vue.config.productionTip = false +for (let k in filter) { + Vue.filter(k, filter[k]) +} const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' + '2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ==' diff --git a/src/pages/modules/semifinished/mater-search.vue b/src/pages/modules/semifinished/mater-search.vue index 7fba69c..54451f0 100644 --- a/src/pages/modules/semifinished/mater-search.vue +++ b/src/pages/modules/semifinished/mater-search.vue @@ -22,21 +22,23 @@
- +
-
+
+ + @@ -45,11 +47,14 @@ + +
序号 物料编号 物料名称物料规格 物料类别单重 重量单位
{{ i+1 }} {{e.material_code}} {{e.material_name}}{{ e.material_spec }} {{e.class_code}}{{ e.net_weight | numeric(3) }} {{e.unit_name}}
+
{{desc}}
@@ -64,7 +69,11 @@ export default { val1: '', dataList: [], pkId: '', - pkObj: {} + pkObj: {}, + page: 1, + size: '30', + busy: false, + desc: '' } }, created () { @@ -73,8 +82,30 @@ export default { methods: { // grid async _getMaterial () { - let res = await getMaterial(this.val1) + this.page = 1 + this.busy = false + this.desc = '' + let res = await getMaterial(this.val1, this.page + '', this.size) this.dataList = [...res.data] + + this.dataList = [] + this.dataList = [...res.data] + if (res.data.length < 30) { + this.busy = true + this.desc = '已加载全部数据' + } + }, + async loadMore () { + this.busy = true + this.page++ + let res = await getMaterial(this.val1, this.page + '', this.size) + this.dataList = [...this.dataList, ...res.data] + if (res.data.length < 30) { + this.busy = true + this.desc = '已加载全部数据' + } else { + this.busy = false + } }, colseUp () { this.$router.push('/semifinishedinstore') diff --git a/src/pages/modules/semifinished/out-mater-search.vue b/src/pages/modules/semifinished/out-mater-search.vue index 7fba69c..51c9e92 100644 --- a/src/pages/modules/semifinished/out-mater-search.vue +++ b/src/pages/modules/semifinished/out-mater-search.vue @@ -16,13 +16,23 @@ -->
-
物料
+
货位
-
- +
+
物料
+
+ +
+
+
+
+ +
已挑料
+
+ @@ -62,6 +72,8 @@ export default { options1: [], value1: '', val1: '', + val2: '', + val3: '', dataList: [], pkId: '', pkObj: {} @@ -96,4 +108,15 @@ export default { diff --git a/src/pages/modules/semifinished/semi-finished-instore-search.vue b/src/pages/modules/semifinished/semi-finished-instore-search.vue index dc47a70..7505bde 100644 --- a/src/pages/modules/semifinished/semi-finished-instore-search.vue +++ b/src/pages/modules/semifinished/semi-finished-instore-search.vue @@ -122,6 +122,11 @@ export default { pkObj: {} } }, + created () { + this._getBcpStor() + this._getBillType() + this._getAll() + }, methods: { // 仓库下拉框 async _getBcpStor () { diff --git a/src/pages/modules/semifinished/semi-finished-instore.vue b/src/pages/modules/semifinished/semi-finished-instore.vue index 9eb422c..b2cefc8 100644 --- a/src/pages/modules/semifinished/semi-finished-instore.vue +++ b/src/pages/modules/semifinished/semi-finished-instore.vue @@ -124,9 +124,18 @@ export default { let res = '' let res1 = accMul(this.total_qty, 1000) res = accDiv(res1, this.unit_weight) + res = Number(res).toFixed(3) return res } }, + watch: { + total_qty () { + this.total_qty = this.total_qty.indexOf('.') > -1 ? this.total_qty.slice(0, this.total_qty.indexOf('.') + 4) : this.total_qty + }, + unit_weight () { + this.unit_weight = this.unit_weight.indexOf('.') > -1 ? this.unit_weight.slice(0, this.unit_weight.indexOf('.') + 4) : this.unit_weight + } + }, beforeRouteLeave (to, from, next) { if (to.path === '/home' || to.path === '/login') { this.$store.dispatch('setKeepAlive', []) @@ -138,12 +147,13 @@ export default { this.material_id = JSON.parse(this.$store.getters.materObj).material_id this.material_code = JSON.parse(this.$store.getters.materObj).material_code this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec - this.unit_weight = JSON.parse(this.$store.getters.materObj).net_weight + this.unit_weight = Number(JSON.parse(this.$store.getters.materObj).net_weight).toFixed(3) } }, created () { this._getBcpStor() this._getBillType() + this._getPoint() }, methods: { // 仓库下拉框 @@ -216,7 +226,11 @@ export default { this.$router.push('/matersearch') }, toJumpSearch () { - this.$router.push('/semifinishedinstoresearch') + console.log(this.unit_weight) + // this.$router.push('/semifinishedinstoresearch') + }, + handleBlur ($event) { + $event.target.value = Number($event.target.value).toFixed(3) } } } diff --git a/src/pages/modules/semifinished/semi-finished-outstore.vue b/src/pages/modules/semifinished/semi-finished-outstore.vue index 5204c6b..56b7476 100644 --- a/src/pages/modules/semifinished/semi-finished-outstore.vue +++ b/src/pages/modules/semifinished/semi-finished-outstore.vue @@ -8,9 +8,9 @@ + :key="item.stor_id" + :label="item.stor_name" + :value="item.stor_id">
@@ -21,77 +21,74 @@ + :key="item.value" + :label="item.label" + :value="item.value">
物料
-
- +
+
规格
- -
-
-
-
数量
-
- -
-
-
-
单重(g)
-
- +
重量(kg)
- +
-
货位
+
单重(g)
- +
-
载具号
+
数量
- +
-
出库点
+
入库点
+ :key="item.point_code" + :label="item.point_name" + :value="item.point_code">
+
+
载具号
+
+ +
+
+ +
+
备注
- +
- - + +
@@ -99,7 +96,10 @@