Mr.sun 2 years ago
parent 96841c2441
commit 40839deb06
  1. 120
      src/views/warehousing/otherStore/index.vue

@ -5,7 +5,7 @@
<el-form-item label="入库仓库"> <el-form-item label="入库仓库">
<el-select <el-select
style="width: 500px" style="width: 500px"
v-model="form.no" v-model="form.warehouseNo"
placeholder="请选择" placeholder="请选择"
clearable clearable
> >
@ -21,11 +21,11 @@
<el-form-item label="物料信息"> <el-form-item label="物料信息">
<div v-if="chooselist.length>0"> <div v-if="chooselist.length>0">
<div v-for="(item,index) in chooselist" :key="index" style="margin-top: 10px"> <div v-for="(item,index) in chooselist" :key="index" style="margin-top: 10px">
<span>{{ item.goodName+'-'+item.goodsNo+'-'+item.specifications }}</span> <span>{{ item.goodName+'-'+item.goodsNo+'-'+item.unitMsr }}</span>
<el-input v-model="item.qty" style="width: 100px;margin-left: 50px" placeholder="入库数量"></el-input> <el-input v-model="item.qty" style="width: 100px;margin-left: 50px" placeholder="入库数量"></el-input>
</div> </div>
</div> </div>
<el-button style="margin-top: 20px" @click="dialogVisible = true">选择物料</el-button> <el-button style="margin-top: 20px" @click="chooseGoods()">选择物料</el-button>
</el-form-item> </el-form-item>
<el-form-item label="容器编码"> <el-form-item label="容器编码">
<el-input style="width: 500px" v-model="form.containerNo" placeholder="请扫描或录入容器编码"></el-input> <el-input style="width: 500px" v-model="form.containerNo" placeholder="请扫描或录入容器编码"></el-input>
@ -62,7 +62,7 @@
> >
<el-input <el-input
v-model="searchForm.goodNo" v-model="searchForm.goodNo"
placeholder="请输入商品编码" placeholder="请输入物料编码"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -71,7 +71,7 @@
> >
<el-input <el-input
v-model="searchForm.goodName" v-model="searchForm.goodName"
placeholder="请输入商品名称" placeholder="请输入物料名称"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -128,7 +128,7 @@ import {getBranchList, InitInOrder} from "@/api/system/branch";
import {getGoods} from "@/api/basicData/goods"; import {getGoods} from "@/api/basicData/goods";
export default { export default {
name: "index", name: "index",
dicts: ["goods_classify"], dicts: ["good_class"],
data() { data() {
const _that=this const _that=this
return { return {
@ -137,27 +137,19 @@ export default {
searchForm:{ searchForm:{
}, },
tableData: [ tableData: [],
{
goodNo:1,
goodName:'shh'
},
{
goodNo:2,
goodName:'cdgf'
}],
tableProps:{}, tableProps:{},
config: [ config: [
// //
{ label: "复选框", type: "selection", prop: "selection", istrue: true }, { label: "复选框", type: "selection", prop: "selection", istrue: true },
{ {
label: '商品编号', label: '物料编号',
prop: 'goodNo', prop: 'goodNo',
width: 160, width: 160,
istrue: true istrue: true
}, },
{ {
label: '商品名称', label: '物料名称',
prop: 'goodName', prop: 'goodName',
width: 150, width: 150,
istrue: true istrue: true
@ -167,17 +159,17 @@ export default {
prop: 'specifications', prop: 'specifications',
istrue: true istrue: true
}, },
{ // {
label: '型号', // label: '',
prop: '', // prop: '',
istrue: true // istrue: true
}, // },
{ {
label: '所属分类', label: '所属分类',
prop: 'specialMana', prop: 'classify',
istrue: true, istrue: true,
filter(row, value) { 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:[], chooselist:[],
classifyList:[{ classifyList:[{
label: '物料分类', label: '物料分类',
children: [{ children: []
label: '成品',
id:110
},{
label: '铝合金锭',
id:100
},{
label: '锌合金锭',
id:101
},{
label: '模具配件',
id:111
},{
label: '配件',
id:102
},{
label: '辅料',
id:108
},{
label: '模具',
id:101
}]
}], }],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -222,13 +193,23 @@ export default {
}; };
}, },
mounted() { 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.getBranchList()
this.queryTable() this.queryTable()
}, },
methods: { methods: {
// //
handleNodeClick(data) { handleNodeClick(data) {
this.searchForm.chiff=data.id this.searchForm.classify=data.value
this.paging.page=1 this.paging.page=1
this.queryTable() this.queryTable()
}, },
@ -238,7 +219,7 @@ export default {
this.WarehousingList=res.rows this.WarehousingList=res.rows
}) })
}, },
// //
async queryTable() { async queryTable() {
this.loading = true this.loading = true
const request = { const request = {
@ -254,19 +235,30 @@ export default {
}, },
// //
onSubmit(){ onSubmit(){
if(!this.form.no){ if(!this.form.warehouseNo){
this.$message.error('请选择入库仓库!') this.$message.error('请选择入库仓库!')
return; return;
} }
if(this.chooselist.length==0){
this.$message.error('请选择物料!')
return;
}
if(!this.form.containerNo){
this.$message.error('请输入容器编码!')
return;
}
const obj={ const obj={
no:this.form.no, syncType:"A",
orderType:11, orderType:11,
orderDate:'2024-05-30',
containerNo:this.form.containerNo, containerNo:this.form.containerNo,
detail:this.chooselist detail:this.chooselist,
} }
// console.log('',obj)
InitInOrder(obj).then((res)=>{ 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.form={}
this.chooselist=[] this.chooselist=[]
}, },
//
handleCommand(command) {
this.$message('click on item ' + command);
},
// //
handleselection(row){ handleselection(row){
this.handleSelect = row this.handleSelect = row
}, },
// chooseGoods(){
if(!this.form.warehouseNo){
this.$message.error('请选择入库仓库!')
return;
}
this.dialogVisible = true
},
//
choose(){ choose(){
this.chooselist=[] this.chooselist=[]
this.handleSelect.forEach((item)=>{ this.handleSelect.forEach((item)=>{
@ -290,9 +285,8 @@ export default {
lineId:0, lineId:0,
goodsNo:item.goodNo, goodsNo:item.goodNo,
goodName:item.goodName, goodName:item.goodName,
specifications:item.specifications, unitMsr:item.specifications,
unitMsr:'kg', warehouseNo:this.form.warehouseNo,
warehouseNo:102
} }
this.chooselist.push(newItem) this.chooselist.push(newItem)
}) })
@ -304,7 +298,7 @@ export default {
this.searchForm={} this.searchForm={}
this.dialogVisible = false this.dialogVisible = false
}, },
// //
searchList(){ searchList(){
this.paging.page=1 this.paging.page=1
this.queryTable() this.queryTable()

Loading…
Cancel
Save