|
|
|
@ -181,21 +181,6 @@
|
|
|
|
|
<el-col :span="20" :offset="4" :xs="20">
|
|
|
|
|
<el-divider content-position="center">库位库存明细信息</el-divider>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-shopping-cart-1"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleTransfer"
|
|
|
|
|
v-hasPermi="['wms:stocktotal:transfer']"
|
|
|
|
|
v-if="type === STOCK_TYPE.RAW"
|
|
|
|
|
>转库存
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loadingTwo" :data="rawstockList" @selection-change="handleRawStockSelectionChange">
|
|
|
|
|
<!-- <el-table-column label="原材料库存ID" align="center" prop="rawStockId" />-->
|
|
|
|
@ -235,6 +220,23 @@
|
|
|
|
|
<dict-tag :options="dict.type.wms_stock_complete_flag" :value="scope.row.completeFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-shopping-cart-1"
|
|
|
|
|
v-if="type === STOCK_TYPE.RAW && scope.row.instockBatch.indexOf(RAW_BARCODE_VIRTUAL.EXTERNAL_VIRTUAL) < 0 && scope.row.instockBatch.indexOf(RAW_BARCODE_VIRTUAL.INTERNAL_VIRTUAL)<0"
|
|
|
|
|
@click="handleTransfer(scope.row)"
|
|
|
|
|
v-hasPermi="['wms:stocktotal:transfer']"
|
|
|
|
|
>转库存
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="twoPTotal>0"
|
|
|
|
@ -269,7 +271,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="待转数量" prop="transferAmount" v-if="this.transferType==='1'">
|
|
|
|
|
<el-input-number v-model="form.transferAmount" placeholder="请输入待转库存数量"/>
|
|
|
|
|
<el-input-number v-model="form.transferAmount" :min="1" step="1" placeholder="请输入待转库存数量"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -283,7 +285,7 @@
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button type="primary" :loading="submitLoading" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
@ -298,14 +300,13 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="物料明细" :visible.sync="materialListOpen" width="560px" append-to-body>
|
|
|
|
|
|
|
|
|
|
<el-table :data="materialList">
|
|
|
|
|
<el-table :data="materialList">
|
|
|
|
|
<el-table-column label="序号" type="index" align="center"/>
|
|
|
|
|
<el-table-column label="物料编码" align="center" prop="materialCode" />
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="materialName" />
|
|
|
|
|
<el-table-column label="物料规格" align="center" prop="materialSpec" />
|
|
|
|
|
<el-table-column label="物料编码" align="center" prop="materialCode"/>
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="materialName"/>
|
|
|
|
|
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
@ -436,15 +437,15 @@ export default {
|
|
|
|
|
VIRTUAL: "2"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
RAW_BARCODE_VIRTUAL:{
|
|
|
|
|
EXTERNAL_VIRTUAL:"VR",//外部采购合并的虚拟物料条码标识
|
|
|
|
|
INTERNAL_VIRTUAL:"RN",//内部生产合并的虚拟物料条码标识
|
|
|
|
|
RAW_BARCODE_VIRTUAL: {
|
|
|
|
|
EXTERNAL_VIRTUAL: "VR",//外部采购合并的虚拟物料条码标识
|
|
|
|
|
INTERNAL_VIRTUAL: "RN",//内部生产合并的虚拟物料条码标识
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
selectSaleOrderVisible: false,
|
|
|
|
|
|
|
|
|
|
materialListOpen : false,
|
|
|
|
|
materialList:[]
|
|
|
|
|
submitLoading:false,
|
|
|
|
|
materialListOpen: false,
|
|
|
|
|
materialList: []
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
@ -637,10 +638,9 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 库位库存明细信息多选框选中数据
|
|
|
|
|
handleRawStockSelectionChange(selection) {
|
|
|
|
|
return;
|
|
|
|
|
let index = 0;
|
|
|
|
|
selection.forEach(row => {
|
|
|
|
|
index = this.rawstockList.indexOf(row);
|
|
|
|
|
index = this.rawstockList.indexOf(row);
|
|
|
|
|
});
|
|
|
|
|
this.instockBatches = selection.map((item, index1) => index + "-" + item.instockBatch);
|
|
|
|
|
this.rawStockIds = selection.map((item, index1) => index + "-" + item.rawStockId);
|
|
|
|
@ -649,13 +649,25 @@ export default {
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleTransfer() {
|
|
|
|
|
handleTransfer(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.transferType = "2";
|
|
|
|
|
this.rawStockInfosStr = this.rawStockInfos.join("<br>");
|
|
|
|
|
let index = this.rawstockList.indexOf(row)
|
|
|
|
|
this.form.instockBatch = row.instockBatch
|
|
|
|
|
this.form.rawStockId = row.rawStockId
|
|
|
|
|
this.form.indexStockIds =[index + "-" + row.rawStockId];
|
|
|
|
|
this.form.index = index;
|
|
|
|
|
this.rawStockInfosStr = "序号:" + (index + 1) + ",物料编码:" + row.materialCode + " 物料名称:" + row.materialName + " 物料规格:" + row.materialSpec + " 数量:" + row.totalAmount + " 销售订单:" + (row.saleorderCode ? row.saleorderCode : "无");
|
|
|
|
|
this.open = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// handleTransfer() {
|
|
|
|
|
// this.reset();
|
|
|
|
|
// this.transferType = "2";
|
|
|
|
|
// this.rawStockInfosStr = this.rawStockInfos.join("<br>");
|
|
|
|
|
// this.open = true;
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
handleSaleOrderSelect() {
|
|
|
|
|
this.selectSaleOrderVisible = true;
|
|
|
|
|
},
|
|
|
|
@ -663,7 +675,8 @@ export default {
|
|
|
|
|
/** 提交选择销售订单按钮 */
|
|
|
|
|
submitSelectSaleOrderForm() {
|
|
|
|
|
let selectedRow = this.$refs.selectSaleOrderRef.selectedRow;
|
|
|
|
|
if(selectedRow.materialId!==this.form.materialId){
|
|
|
|
|
//成品库存需要校验物料信息是否相同
|
|
|
|
|
if (this.type === this.STOCK_TYPE.PRODUCT && selectedRow.materialId !== this.form.materialId) {
|
|
|
|
|
this.$modal.msgWarning("请选择相同物料的销售订单");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -675,36 +688,60 @@ export default {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.submitLoading = true;
|
|
|
|
|
if (this.form.safeFlag === this.SAFE_FLAG.YES) {
|
|
|
|
|
this.form.saleOrderId = 0;
|
|
|
|
|
this.form.saleorderCode = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.type === this.STOCK_TYPE.PRODUCT) {
|
|
|
|
|
if (this.type === this.STOCK_TYPE.PRODUCT) { //转成品库存
|
|
|
|
|
if(this.form.transferAmount < 1){
|
|
|
|
|
this.$modal.msgWarning('请输入整数');
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
return;
|
|
|
|
|
}else if (!Number.isInteger(this.form.transferAmount)) {
|
|
|
|
|
this.$modal.msgWarning('请输入整数');
|
|
|
|
|
// this.value = Math.floor(value); // 重置为最接近的整数
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
transferProductStockTotal(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("转库存成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getTwoList();
|
|
|
|
|
}).finally(e=>{
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
});
|
|
|
|
|
} else if (this.type === this.STOCK_TYPE.RAW) {
|
|
|
|
|
if (this.transferType === '1') {
|
|
|
|
|
if (this.transferType === '1') {//转总库存的原材料库存
|
|
|
|
|
if(this.form.transferAmount < 1){
|
|
|
|
|
this.$modal.msgWarning('待转数量请输入整数');
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
return;
|
|
|
|
|
}else if (!Number.isInteger(this.form.transferAmount)) {
|
|
|
|
|
this.$modal.msgWarning('待转数量请输入整数');
|
|
|
|
|
// this.value = Math.floor(value); // 重置为最接近的整数
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
transferRawStockTotal(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("转库存成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getTwoList();
|
|
|
|
|
}).finally(e=>{
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
});
|
|
|
|
|
} else if (this.transferType === '2') {
|
|
|
|
|
this.form.indexStockIds = this.rawStockIds;
|
|
|
|
|
for(const instockBatchStr of this.instockBatches){
|
|
|
|
|
let instockBatchStrArr = instockBatchStr.split("-");
|
|
|
|
|
let instockBatchIndex = parseInt(instockBatchStrArr[0]);
|
|
|
|
|
let instockBatch = instockBatchStrArr[1];
|
|
|
|
|
if(instockBatch.indexOf(this.RAW_BARCODE_VIRTUAL.EXTERNAL_VIRTUAL) >=0 || instockBatch.indexOf(this.RAW_BARCODE_VIRTUAL.INTERNAL_VIRTUAL) >=0){
|
|
|
|
|
this.$modal.msgSuccess("序号:"+(instockBatchIndex+1)+",是虚拟合并的物料,不能转库存");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.instockBatch.indexOf(this.RAW_BARCODE_VIRTUAL.EXTERNAL_VIRTUAL) >= 0 || this.form.instockBatch.indexOf(this.RAW_BARCODE_VIRTUAL.INTERNAL_VIRTUAL) >= 0) {
|
|
|
|
|
this.$modal.msgWarning("序号:" + (parseInt(this.form.index) + 1) + ",是虚拟合并的物料,不能转库存");
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
transferRaw(this.form).then(response => {
|
|
|
|
@ -712,6 +749,8 @@ export default {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getTwoList();
|
|
|
|
|
}).finally(e=>{
|
|
|
|
|
this.submitLoading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -733,9 +772,9 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleViewMaterialInfos(row){
|
|
|
|
|
handleViewMaterialInfos(row) {
|
|
|
|
|
this.materialListOpen = true;
|
|
|
|
|
selectMaterialInfosByVirtualMaterialId({materialId:row.materialId}).then(response => {
|
|
|
|
|
selectMaterialInfosByVirtualMaterialId({materialId: row.materialId}).then(response => {
|
|
|
|
|
this.materialList = response.rows;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|