From d192e73b232851ad44d9c3837d90519eda106626 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Sat, 3 Jun 2023 13:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=BA=93=20kucun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/views/inventorys/index.vue | 143 +++++++++++++++++++------ src/views/stocks/component/addRuku.vue | 124 +++++++++++++++++---- 3 files changed, 212 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index 962d2e2..a836e11 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "normalize.css": "7.0.0", "nprogress": "0.2.0", "path-to-regexp": "2.4.0", + "qrcodejs2": "0.0.2", "tinymce": "^5.10.7", "view-design": "^4.7.0", "vue": "2.6.10", diff --git a/src/views/inventorys/index.vue b/src/views/inventorys/index.vue index c83db5b..5f24541 100644 --- a/src/views/inventorys/index.vue +++ b/src/views/inventorys/index.vue @@ -2,13 +2,13 @@
- +
- + @@ -18,23 +18,29 @@
- - + +
+
+
+ + @@ -46,7 +52,8 @@ index, destroy } from "@/api/system/baseForm.js" - // import addRuku from "./component/addRuku.vue" + // import addRuku from "./component/addRuku.vue" + import QRCode from 'qrcodejs2'; import { Message } from 'element-ui' @@ -63,7 +70,8 @@ pageSize: 10, pageIndex: 1, keyword: "" - }, + }, + showcode:false, customForm: { customFormId: "", tableName: "" @@ -74,53 +82,102 @@ table: [{ label:'序号', type:'index', - fixed:'left' + fixed:'left', + width:80, }, { - label: "入库时间", + label: "物资编码", width: 180, - prop: 'rukushijian', + prop: 'wuzibianma', align: 'center' }, { - label: "入库类型", - width: 180, - prop: 'rukuleixing', + label: "资产名称", + prop: 'zichanmingcheng', align: 'center' }, { - label: "经办人", + label: "物资类型", width: 120, - prop: 'jingbanren', + prop: 'wuzileixing', align: 'center' }, { - label: "记录人员", - width: 220, - prop: 'jilurenyuan', + label: "计量单位", + width: 120, + prop: 'jiliangdanwei', align: 'left' }, { - label: "保管人员", - width: 140, - prop: 'baoguanrenyuan' + label: "入库数量", + width: 120, + prop: 'rukushuliang' + }, + { + label: "在库数量", + width: 120, + prop: 'zaikushuliang' + }, + { + label: "入库批次", + width: 120, + prop: 'rukupici' + }, + { + label: "所在仓库", + width: 180, + prop: 'suozaicangku' + }, + { + label: "所在货架", + width: 180, + prop: 'suozaihuojia' + }, + { + label: "二维码", + width: 180, + prop: 'erweima', + customFn: (row) => { + return () + } }, - { - label: "备注", - width: 200, - prop: 'beizhu', - align: 'left' - } ] } }, - methods: { + methods: { + showCode(e,row){ + console.log(e,row) + this.showcode = true + this.$nextTick(function(){ + new QRCode(this.$refs.qrCodeDiv, { + text: row.wuzibianma+'-'+row.id, + width: 200, + height: 200, + colorDark: "#333333", //二维码颜色 + colorLight: "#ffffff", //二维码背景色 + correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H + }) + }) + + + }, + closeCode(){ + this.$refs.qrCodeDiv.innerHTML = "" + this.showcode = false + }, async getindex() { const res = await index({ rows: this.select.pageSize, page: this.select.pageIndex, - table_name: 'stocks', + table_name: 'inventorys', keyword: this.select.keyword }) this.list = res.data @@ -206,5 +263,21 @@ } - diff --git a/src/views/stocks/component/addRuku.vue b/src/views/stocks/component/addRuku.vue index 4a4aabb..3e7ff6e 100644 --- a/src/views/stocks/component/addRuku.vue +++ b/src/views/stocks/component/addRuku.vue @@ -100,9 +100,10 @@ 入库明细 :
- - + @@ -281,10 +287,14 @@ ], // 物资 isShowWuzi: false, - wuziList: [], + wuziList: [], + kucunList:[], + showList:[], wuziPageIndex: 1, - keyword:'', - wuziTotal: 0, + keyword:'', + showTotal:0, + wuziTotal: 0, + kucunTotal:0, wuziColumns: [{ title: '名称', key: 'names', @@ -293,7 +303,8 @@ }, created() { this.getCangku() - this.getWuzi() + // this.getWuzi() + // this.getKucun() }, methods: { mingxiConfirm(){ @@ -313,12 +324,18 @@ this.mingxiObjBefore = {} this.mingxiIndex = '' this.isShowMingxi = false + this.showList = [] + this.showTotal = 0 + this.wuziPageIndex = 1 }, mingxiCancel(){ this.mingxiObj = {} this.mingxiObjBefore = {} this.mingxiIndex = '' this.isShowMingxi = false + this.showList = [] + this.showTotal = 0 + this.wuziPageIndex = 1 }, editMingxi(index){ const before = this.mingxiList[index] @@ -329,10 +346,40 @@ this.mingxiIndex = index+1 // 为0时!=‘’为false this.isShowMingxi = true }, - showWuzi() { - console.log("123") - this.isShowWuzi = true + showWuzi(type) { + if(this.form.rukuleixing==''){ + Message({ + type: 'warning', + message: '请先选择入库类型' + }) + return + } + this.isShowWuzi = true + if(type=='回库'){ + this.$nextTick(() => { + this.$refs.huikubianma.focus() + }) + this.getKucun() + // this.showList = this.kucunList + // this.showTotal = this.kucunTotal + }else{ + this.getWuzi() + // this.showList = this.wuziList + // this.showTotal = this.wuziTotal + } + + }, + getList(){ + if(this.form.rukuleixing=='回库'){ + this.getKucun() + // this.showList = this.kucunList + // this.showTotal = this.kucunTotal + }else{ + this.getWuzi() + // this.showList = this.wuziList + // this.showTotal = this.wuziTotal + } }, async getWuzi() { let res = await index({ @@ -344,8 +391,43 @@ for (var m of res.data) { m.names = m.wuzibianma + "--" + m.zichanmingcheng } - this.wuziList = res.data - this.wuziTotal = res.total + this.showList = res.data + this.showTotal = res.total + }, + async getKucun() { + let res = await index({ + page_size: 10, + page: this.wuziPageIndex, + table_name: 'inventorys', + filter:[{"key":"zichanmingcheng","op":"like","value":this.keyword}] + }) + for (var m of res.data) { + m.names = m.wuzibianma + "--" + m.zichanmingcheng + } + this.showList = res.data + this.showTotal = res.total + }, + async getKucunShow(e){ + console.log(e) + let id = '' + if(e){ + id = e.split('-')[1] + this.$nextTick(() => { + this.$refs.huikubianma.blur() + }) + + }else{ + return + } + const res = await show({ + id: id, + table_name: "inventorys" + }) + this.mingxiObj.wuzibianma = res.wuzibianma + this.mingxiObj.zichanmingcheng = res.zichanmingcheng + this.mingxiObj.wuzileixing = res.wuzileixing + this.mingxiObj.jiliangdanwei = res.jiliangdanwei + this.mingxiObj.id = res.id }, async getCangku() { let res = await index({ @@ -361,9 +443,10 @@ this.mingxiObj.wuzileixing = e.wuzileixing this.mingxiObj.jiliangdanwei = e.jiliangdanwei }, - wuziPageChange(e) { + wuziPageChange(e) { + console.log("e",e) this.wuziPageIndex = e - this.getWuzi() + this.getList() }, showWuzimingxi() { @@ -404,7 +487,6 @@ type: 'success', message: '编辑成功' }) - callback }) }, submit() {