From 40839deb065c47137ea26b3d4dae8bc6a81a1268 Mon Sep 17 00:00:00 2001 From: "Mr.sun" <2290907227@qq.com> Date: Thu, 30 May 2024 17:20:18 +0800 Subject: [PATCH] 11 --- src/views/warehousing/otherStore/index.vue | 120 ++++++++++----------- 1 file changed, 57 insertions(+), 63 deletions(-) diff --git a/src/views/warehousing/otherStore/index.vue b/src/views/warehousing/otherStore/index.vue index 5fd605c..97b48f2 100644 --- a/src/views/warehousing/otherStore/index.vue +++ b/src/views/warehousing/otherStore/index.vue @@ -5,7 +5,7 @@ @@ -21,11 +21,11 @@
- {{ item.goodName+'-'+item.goodsNo+'-'+item.specifications }} + {{ item.goodName+'-'+item.goodsNo+'-'+item.unitMsr }}
- 选择物料 + 选择物料
@@ -62,7 +62,7 @@ > @@ -71,7 +71,7 @@ >
@@ -128,7 +128,7 @@ import {getBranchList, InitInOrder} from "@/api/system/branch"; import {getGoods} from "@/api/basicData/goods"; export default { name: "index", - dicts: ["goods_classify"], + dicts: ["good_class"], data() { const _that=this return { @@ -137,27 +137,19 @@ export default { searchForm:{ }, - tableData: [ - { - goodNo:1, - goodName:'shh' - }, - { - goodNo:2, - goodName:'cdgf' - }], + tableData: [], tableProps:{}, config: [ // 表头数据 { label: "复选框", type: "selection", prop: "selection", istrue: true }, { - label: '商品编号', + label: '物料编号', prop: 'goodNo', width: 160, istrue: true }, { - label: '商品名称', + label: '物料名称', prop: 'goodName', width: 150, istrue: true @@ -167,17 +159,17 @@ export default { prop: 'specifications', istrue: true }, - { - label: '型号', - prop: '', - istrue: true - }, + // { + // label: '型号', + // prop: '', + // istrue: true + // }, { label: '所属分类', - prop: 'specialMana', + prop: 'classify', istrue: true, filter(row, value) { - return getDictLabel(value, _that.dict.type.goods_classify); + return getDictLabel(value, _that.dict.type.good_class); }, }, ], @@ -192,28 +184,7 @@ export default { chooselist:[], classifyList:[{ label: '物料分类', - children: [{ - label: '成品', - id:110 - },{ - label: '铝合金锭', - id:100 - },{ - label: '锌合金锭', - id:101 - },{ - label: '模具配件', - id:111 - },{ - label: '配件', - id:102 - },{ - label: '辅料', - id:108 - },{ - label: '模具', - id:101 - }] + children: [] }], defaultProps: { children: 'children', @@ -222,13 +193,23 @@ export default { }; }, mounted() { + // 物料分类的树结构 + this.getDicts("good_class").then((res)=>{ + res.data.forEach((item) => { + let newItem = { + label: item.dictLabel, + value: item.dictValue + }; + this.classifyList[0].children.push(newItem); + }) + }) this.getBranchList() this.queryTable() }, methods: { - //商品分类点击某个(树) + //物料分类点击某个(树) handleNodeClick(data) { - this.searchForm.chiff=data.id + this.searchForm.classify=data.value this.paging.page=1 this.queryTable() }, @@ -238,7 +219,7 @@ export default { this.WarehousingList=res.rows }) }, - // 商品列表 + // 物料列表 async queryTable() { this.loading = true const request = { @@ -254,19 +235,30 @@ export default { }, // 确定入库 onSubmit(){ - if(!this.form.no){ + if(!this.form.warehouseNo){ this.$message.error('请选择入库仓库!') return; } + if(this.chooselist.length==0){ + this.$message.error('请选择物料!') + return; + } + if(!this.form.containerNo){ + this.$message.error('请输入容器编码!') + return; + } const obj={ - no:this.form.no, + syncType:"A", orderType:11, + orderDate:'2024-05-30', containerNo:this.form.containerNo, - detail:this.chooselist + detail:this.chooselist, } - // console.log('确定入库',obj) InitInOrder(obj).then((res)=>{ - console.log(res) + if(res.code==200){ + this.$message.success('入库成功!') + this.reset() + } }) }, // 重置 @@ -274,15 +266,18 @@ export default { this.form={} this.chooselist=[] }, - //商品分类 - handleCommand(command) { - this.$message('click on item ' + command); - }, // 复选框 handleselection(row){ this.handleSelect = row }, - // 选择商品 + chooseGoods(){ + if(!this.form.warehouseNo){ + this.$message.error('请选择入库仓库!') + return; + } + this.dialogVisible = true + }, + // 选择物料 choose(){ this.chooselist=[] this.handleSelect.forEach((item)=>{ @@ -290,9 +285,8 @@ export default { lineId:0, goodsNo:item.goodNo, goodName:item.goodName, - specifications:item.specifications, - unitMsr:'kg', - warehouseNo:102 + unitMsr:item.specifications, + warehouseNo:this.form.warehouseNo, } this.chooselist.push(newItem) }) @@ -304,7 +298,7 @@ export default { this.searchForm={} this.dialogVisible = false }, - // 商品列表条件查询 + // 物料列表条件查询 searchList(){ this.paging.page=1 this.queryTable()