|
|
|
@ -59,14 +59,14 @@
|
|
|
|
|
<div class="avue-crud__pagination" style="width:100%"> |
|
|
|
|
<!-- 分页模块 --> |
|
|
|
|
<el-pagination align="right" |
|
|
|
|
background |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
:current-page="page.currentPage" |
|
|
|
|
:page-sizes="[30, 50,80, 120]" |
|
|
|
|
:page-size="page.pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
:total="page.total"> |
|
|
|
|
background |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
:current-page="page.currentPage" |
|
|
|
|
:page-sizes="[30, 50,80, 120]" |
|
|
|
|
:page-size="page.pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
:total="page.total"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-row> |
|
|
|
@ -108,20 +108,40 @@
|
|
|
|
|
</div> |
|
|
|
|
<div style="border-width: 1px 0 0 0; border-style: solid; border-color: black;margin-top: 5%;padding-top: 2%;padding-left: 1%"> |
|
|
|
|
<el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="100"> |
|
|
|
|
<el-form-item label="SKU" style="width: 40%"> |
|
|
|
|
<el-form-item label="SKU" style="width: 40%"> |
|
|
|
|
<el-input v-model="formInline.sku" placeholder="请输入sku" clearable /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="货物名称" style="width: 40%"> |
|
|
|
|
<el-input v-model="formInline.descriptionGoods" placeholder="请输入货物名称" clearable /> |
|
|
|
|
<el-form-item label="货物名称" style="width: 40%"> |
|
|
|
|
<!-- <el-input v-model="formInline.descriptionGoods" placeholder="请输入货物名称" clearable />--> |
|
|
|
|
<el-select |
|
|
|
|
style="width: 100%" |
|
|
|
|
v-model="formInline.materialIdName" |
|
|
|
|
filterable |
|
|
|
|
remote |
|
|
|
|
reserve-keyword |
|
|
|
|
placeholder="请输入物料名称" |
|
|
|
|
:remote-method="remoteMethodName" |
|
|
|
|
@change="getMethodName($event, '1')" |
|
|
|
|
@blur="selectBlur" |
|
|
|
|
:loading="loading" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in optionsName" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="货物单位" style="width: 40%"> |
|
|
|
|
<el-select style="width: 100%;" |
|
|
|
|
v-model="formInline.cargoUnit" |
|
|
|
|
filterable |
|
|
|
|
remote |
|
|
|
|
reserve-keyword |
|
|
|
|
remote-show-suffix |
|
|
|
|
placeholder="请选择货物单位" |
|
|
|
|
<el-form-item label="货物单位" style="width: 40%"> |
|
|
|
|
<el-select |
|
|
|
|
style="width: 100%" |
|
|
|
|
v-model="formInline.cargoUnit" |
|
|
|
|
filterable |
|
|
|
|
remote |
|
|
|
|
reserve-keyword |
|
|
|
|
remote-show-suffix |
|
|
|
|
placeholder="请选择货物单位" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in distributionUnit" |
|
|
|
@ -134,8 +154,18 @@
|
|
|
|
|
<el-form-item label="规格" style="width: 40%"> |
|
|
|
|
<el-input v-model="formInline.cargoNorms" placeholder="请输入规格" clearable /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="产品编码" style="width: 40%"> |
|
|
|
|
<el-input v-model="formInline.cargoNumber" placeholder="请输入产品编码" clearable /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="包装数量" style="width: 40%"> |
|
|
|
|
<el-input v-model="formInline.packageNum" placeholder="请输入包装数量" clearable /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="拆箱数" style="width: 40%"> |
|
|
|
|
<el-input v-model="formInline.unpackingQuantity" placeholder="请输入拆箱数" clearable /> |
|
|
|
|
<el-input |
|
|
|
|
v-model="formInline.unpackingQuantity" |
|
|
|
|
placeholder="请输入拆箱数" |
|
|
|
|
clearable |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
@ -706,6 +736,59 @@ export default {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
selectBlur(e) { |
|
|
|
|
// console.log(">>>>>><<<<<<<",e); |
|
|
|
|
let value = e.target.value; // 输入框值 |
|
|
|
|
if (value) { |
|
|
|
|
// 只有输入才有这个值,下拉框选择的话 这个值为空 |
|
|
|
|
// this.form.produce = value; |
|
|
|
|
// console.log("获取的值",value); |
|
|
|
|
this.formInline.materialIdName = value; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 查询 |
|
|
|
|
* */ |
|
|
|
|
async remoteMethodName(query) { |
|
|
|
|
if (query) { |
|
|
|
|
this.loading = true; |
|
|
|
|
//查询物料数据 |
|
|
|
|
let asd = await getListMaterial(this.page.currentPage, this.page.pageSize, { |
|
|
|
|
name: query, |
|
|
|
|
pid: this.stockList.materialId, |
|
|
|
|
}).then(); |
|
|
|
|
console.log('物料信息', asd.data.data); |
|
|
|
|
if (!!asd.data.data) { |
|
|
|
|
this.optionsName = asd.data.data.records; |
|
|
|
|
} |
|
|
|
|
this.loading = false; |
|
|
|
|
} else { |
|
|
|
|
this.optionsName = []; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 物料选择赋值 |
|
|
|
|
* */ |
|
|
|
|
getMethodName(row, num) { |
|
|
|
|
console.log('名称选择事件', row); |
|
|
|
|
switch (num) { |
|
|
|
|
case '1': |
|
|
|
|
let a = this.optionsName.find(i => i.id == row); |
|
|
|
|
console.log('aaaa>>', a); |
|
|
|
|
if (!!a) { |
|
|
|
|
this.formInline.materialCode = a.productCode; |
|
|
|
|
this.formInline.cargoUnit = a.logpmUnit; |
|
|
|
|
this.formInline.cargoNorms = a.packingSpecification; |
|
|
|
|
this.formInline.cargoNumber = a.productCode; |
|
|
|
|
this.formInline.packageNum = a.packageNum; |
|
|
|
|
this.formInline.descriptionGoods = a.descriptionGoods; |
|
|
|
|
this.formInline.sku = a.sku; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case '2': |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
showdrawer(value){ |
|
|
|
|
this.drawerShow=value |
|
|
|
@ -837,50 +920,49 @@ export default {
|
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
//拆包提交 |
|
|
|
|
handleSubmit () { |
|
|
|
|
handleSubmit() { |
|
|
|
|
// if(this.selectionListDismantle.length < 1){ |
|
|
|
|
// this.$message.warning("请选择一条数据!!!"); |
|
|
|
|
// return ; |
|
|
|
|
// } |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
/* const regex = /^\d+$/; |
|
|
|
|
if (regex.test(this.formInline.materialId)) { |
|
|
|
|
// console.log("全是数字"); |
|
|
|
|
asm.materialId = this.formInline.materialId |
|
|
|
|
} else { |
|
|
|
|
// console.log("包含非数字字符"); |
|
|
|
|
asm.materialId = this.formInline.materialCode; |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
// if(this.selectionListDismantle.length > 0){ |
|
|
|
|
// console.log(this.selectionListDismantle); |
|
|
|
|
// let shi = []; |
|
|
|
|
// this.selectionListDismantle.forEach( i =>{ |
|
|
|
|
// let a = { |
|
|
|
|
// parcelsId : i.id, |
|
|
|
|
// unpackingQuantity : i.need |
|
|
|
|
// } |
|
|
|
|
// shi.push(a); |
|
|
|
|
// }) |
|
|
|
|
// this.form.parcels = shi; |
|
|
|
|
// } |
|
|
|
|
// console.log("提交了"); |
|
|
|
|
if(parseInt(this.formInline.unpackingQuantity) >parseInt(this.getQuery.quantityStock)){ |
|
|
|
|
this.$message.warning("拆包数量大于在库数量!!!") |
|
|
|
|
return ; |
|
|
|
|
}else{ |
|
|
|
|
if (parseInt(this.formInline.unpackingQuantity) > parseInt(this.getQuery.quantityStock)) { |
|
|
|
|
this.$message.warning('拆包数量大于在库数量!!!'); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
const regex = /\d+/g; // 正则表达式匹配数字 |
|
|
|
|
const numbers = this.getQuery.packageNum.match(regex); // 使用match方法获取匹配到的数字数组 |
|
|
|
|
parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity); |
|
|
|
|
|
|
|
|
|
this.formInline.storeNum = parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity); |
|
|
|
|
this.formInline.storeNum = |
|
|
|
|
parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity); |
|
|
|
|
} |
|
|
|
|
this.formInline.id =this.stockList.id; |
|
|
|
|
this.formInline.materialId =this.stockList.materialId; |
|
|
|
|
this.formInline.marketId =this.stockList.marketId; |
|
|
|
|
this.formInline.storeId =this.stockList.storeId; |
|
|
|
|
|
|
|
|
|
// this.formInline.id =this.stockList.id; |
|
|
|
|
this.formInline.materialId = this.stockList.materialId; |
|
|
|
|
this.formInline.marketId = this.stockList.marketId; |
|
|
|
|
this.formInline.storeId = |
|
|
|
|
!!this.stockList.storeId && this.stockList.storeId != '-1' |
|
|
|
|
? this.stockList.storeId |
|
|
|
|
: null; |
|
|
|
|
|
|
|
|
|
console.log("提交的值",this.formInline); |
|
|
|
|
console.log('提交的值', this.formInline); |
|
|
|
|
this.formInline.descriptionGoods = '' |
|
|
|
|
addParcels(this.formInline).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.dismantle = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
}); |
|
|
|
|
this.formInline = {}; |
|
|
|
|
}); |
|
|
|
@ -889,10 +971,10 @@ export default {
|
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleAdd () { |
|
|
|
|