Browse Source

修改拆包物料

dev-warehouse
caoyizhong 2 years ago
parent
commit
e068938914
  1. 10
      src/api/distribution/distributionStockArticle.js
  2. 29
      src/views/distribution/inventory/distributionStockArticleDetails.vue
  3. 116
      src/views/distribution/inventory/distributionStockList.vue
  4. 17
      src/views/distribution/inventory/distributionStockListDetails.vue

10
src/api/distribution/distributionStockArticle.js

@ -66,6 +66,16 @@ export const getQueryQRCode = (params) => {
})
}
export const getStockTemplate = (params) => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/getPrintTemplate',
method: 'get',
params:{
...params
}
})
}
export const remove = (ids) => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/remove',

29
src/views/distribution/inventory/distributionStockArticleDetails.vue

@ -247,7 +247,7 @@
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="ddd"> </el-button>-->
<!-- <el-button type="primary" @click="printTemplate"> </el-button>-->
<el-button type="primary" @click="printTemplate"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</span>
@ -274,6 +274,8 @@ import option from "@/option/distribution/distributionStockArticle";
import { mapGetters } from "vuex";
import { getDictionaryBiz } from '@/api/system/dict';
import { getListMaterial } from '@/api/basic/basicMaterial';
import { getLodop } from '@/utils/LodopFuncs';
import { getStockTemplate } from '@/api/distribution/distributionStockArticle';
export default {
data () {
@ -310,6 +312,7 @@ export default {
formCall: {},//
formService: {}, //
formCustomer: {}, //
materialQRCode: {}, //
//
selectionList: [],
//
@ -365,7 +368,28 @@ export default {
}
},
methods: {
printTemplate(){
let lodop = getLodop();
// console.log("this.ids>>>>>",this.ids);
// console.log("this.ids>>>>>",this.selectionList);
// if (this.selectionList.length === 0){
// this.$message.warning("");
// return;
// }
getStockTemplate({id: this.materialQRCode.id }).then(res=>{
console.log("返回的数据",res.data.data);
let templateData = res.data.data;
// let templateData = "res.data.data";
// console.log(templateData);
LODOP.PRINT_INITA(1,1,770,660,"测试预览功能");
LODOP.SET_PRINT_MODE("WINDOW_DEFPRINTER","Godex G500");
// //
LODOP.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW", 1);
// // datahtml
LODOP.ADD_PRINT_HTM("0%","0%","100%","100%",templateData);
LODOP.PREVIEW(); //()
})
},
//
handleSubmitMethod(){
// console.log(">>>",this.formMaterial);
@ -696,6 +720,7 @@ export default {
// this.title = ''
// this.view = true;
// this.box = true;
this.materialQRCode = row;
this.dialogVisible = true;
let qr ={
id : row.id,

116
src/views/distribution/inventory/distributionStockList.vue

@ -112,7 +112,26 @@
<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-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%;"
@ -127,13 +146,19 @@
v-for="item in distributionUnit"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
<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-form-item>
@ -560,6 +585,7 @@ export default {
option: option,
//
data: [],
optionsName: [],
excelOption: {
submitBtn: false,
emptyBtn: false,
@ -706,6 +732,56 @@ 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
@ -820,8 +896,6 @@ export default {
});
});
this.onLoad(this.page);
},
@ -851,20 +925,15 @@ export default {
// 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 ;
@ -875,12 +944,11 @@ export default {
this.formInline.storeNum = parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity);
}
this.formInline.id =this.stockList.id;
// 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);
addParcels(this.formInline).then(() => {
this.box = false;
@ -924,10 +992,12 @@ export default {
});
},
handleViewDetails (row) {
console.log("row>>>>",row.row);
this.$router.push({
path: '/distribution/inventory/distributionStockListDetails',
query:{
id: row.row.id,
marketId: row.row.marketId,
materialId: row.row.materialId,
name: row.row.descriptionGoods+" — 明细"
}
});
@ -952,7 +1022,7 @@ export default {
console.log("adfadsfvasd",aa.data.data);
this.getQuery = aa.data.data.records[0];
this.getQuery.quantityStock = row.row.quantityStock;
this.formInline.descriptionGoods = this.getQuery.name;
// this.formInline.descriptionGoods = this.getQuery.name;
let q = this.distributionUnit.find( i => i.dictKey == this.getQuery.logpmUnit);
this.getQuery.logpmUnitName = q.dictValue;
// getListParcelDetails(this.pageDetails.currentPage,this.pageDetails.pageSize,par).then(res => {
@ -1043,7 +1113,9 @@ export default {
this.data = data.records;
this.data.forEach( i =>{
let a = this.distributionType.find( d =>d.dictKey == i.serviceType);
i.serviceTypeName = a.dictValue;
if(!!a){
i.serviceTypeName = a.dictValue;
}
if(i.unpack == false){
i.unpack = '否'
}else{

17
src/views/distribution/inventory/distributionStockListDetails.vue

@ -39,7 +39,7 @@
</el-col>
<el-col :span="10">
<el-form-item label="门店:">
<span>{{!!queryOwn.storeName ? queryOwn.storeName : '无' }}</span>
<span>{{!queryOwn.storeName ? '无' : queryOwn.storeName }}</span>
</el-form-item>
</el-col>
</el-row>
@ -483,7 +483,8 @@ export default {
//
async getOnChu(page, params = {}){
this.query={};
this.query.stockListId = this.$route.query.id;
this.query.marketId = this.$route.query.marketId;
this.query.materialId = this.$route.query.materialId;
let b =await getListStock(page.currentPage, page.pageSize, Object.assign(params, this.query));
this.data1 = b.data.data.records;
this.data1.forEach( i =>{
@ -510,7 +511,7 @@ export default {
this.query.serviceType = this.queryOwn.serviceType;
this.query.materialId = this.queryOwn.materialId;
this.query.warehouseId = this.queryOwn.warehouseId;
this.query.storeId = !!this.queryOwn.storeId ? this.queryOwn.storeId : null;
this.query.storeId = !!this.queryOwn.storeId && this.queryOwn.storeId != '-1' ? this.queryOwn.storeId : null;
if(this.queryOwn.pid != '-1' ){
this.query.pid = this.queryOwn.pid
}
@ -526,7 +527,7 @@ export default {
this.query.serviceType = this.queryOwn.serviceType;
this.query.materialId = this.queryOwn.materialId;
this.query.warehouseId = this.queryOwn.warehouseId;
this.query.storeId = !!this.queryOwn.storeId ? this.queryOwn.storeId : null;
this.query.storeId = !!this.queryOwn.storeId && this.queryOwn.storeId != '-1' ? this.queryOwn.storeId : null;
let b =await getList(page.currentPage, page.pageSize, Object.assign(params, this.query));
this.data = b.data.data.records;
console.log("库存品信息",this.data);
@ -535,7 +536,9 @@ export default {
},
async onLoad (page, params = {}) {
this.loading = true;
this.query.id = this.$route.query.id;
this.query.marketId = this.$route.query.marketId;
this.query.materialId = this.$route.query.materialId;
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// const data = res.data.data;
// this.page.total = data.total;
@ -546,11 +549,13 @@ export default {
let a =await getList(page.currentPage, page.pageSize, Object.assign(params, this.query));
console.log("aaaa",a.data.data.records);
this.queryOwn = a.data.data.records[0];
if(this.queryOwn.pid == '-1' ){
if(this.queryOwn.pid == '-1' || !this.queryOwn.pid ){
console.log("11111111111");
//
await this.getOnKu(page, params = {});
}else{
//
console.log("2222222222");
await this.getOnKu(page, params = { pid: this.queryOwn.pid });
}

Loading…
Cancel
Save