盘点管理 单据确认 单据审核 单据作废 盘点新增
This commit is contained in:
@@ -19,10 +19,10 @@
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据类型" prop="outType" required>
|
||||
<el-select v-model="formData.outType" placeholder="请选择单据类型" clearable>
|
||||
<el-form-item label="单据类型" prop="checkType" required>
|
||||
<el-select v-model="formData.checkType" placeholder="请选择单据类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.out_bill_type"
|
||||
v-for="dict in dict.type.check_stock_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@@ -44,7 +44,11 @@
|
||||
<el-table v-loading="loading" :data="materialList">
|
||||
<el-table-column label="物资编号" align="center" prop="productId" />
|
||||
<el-table-column label="物资名称" align="center" prop="productName" />
|
||||
<el-table-column label="批号" align="center" prop="lotNo" />
|
||||
<el-table-column label="批号" align="center" prop="lotNo">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.lotNo" size="mini" placeholder="请输入批号" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
|
||||
@@ -102,7 +106,11 @@
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="物资编码" align="center" prop="productId" />
|
||||
<el-table-column label="物资名称" align="center" prop="productName" />
|
||||
<el-table-column label="批号" align="center" prop="lotNo" />
|
||||
<!-- <el-table-column label="批号" align="center" prop="lotNo">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.lotNo" size="mini" placeholder="请输入批号" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<!-- <el-table-column label="仓库" align="center" prop="warehouseId" /> -->
|
||||
</el-table>
|
||||
@@ -116,12 +124,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProductAndStock,saveOutStock } from "@/api/out/outStockout";
|
||||
import { listProductAndStock } from "@/api/out/outStockout";
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import {saveCheckStock} from "@/api/check/stockCheck";
|
||||
|
||||
export default {
|
||||
name: "AddOutStock",
|
||||
dicts: ['out_bill_type', 'bill_status'],
|
||||
dicts: ['check_stock_type', 'bill_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -143,7 +152,7 @@
|
||||
formData: {
|
||||
warehouseId: null,
|
||||
customerNo: null,
|
||||
outType: null
|
||||
checkType: null
|
||||
},
|
||||
// 仓库选项
|
||||
warehouseOptions: [],
|
||||
@@ -215,6 +224,7 @@
|
||||
this.materialList = this.materialList.concat(
|
||||
newMaterials.map(item => ({
|
||||
productId: item.productId,
|
||||
productGuId: item.productGuid,
|
||||
productName: item.productName,
|
||||
quantity: item.quantity,
|
||||
quantityOrignal: item.quantity,
|
||||
@@ -263,11 +273,11 @@
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
outStockout: this.formData,
|
||||
checkStockin: this.formData,
|
||||
detailList: this.materialList
|
||||
};
|
||||
// 这里需要调用保存接口
|
||||
saveOutStock(data).then(response => {
|
||||
saveCheckStock(data).then(response => {
|
||||
console.log(response)
|
||||
this.$modal.msgSuccess("单据"+response.msg+"保存成功");
|
||||
this.$tab.refreshPage(this.$route);
|
||||
|
||||
@@ -150,15 +150,26 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleInvalidated"
|
||||
v-hasPermi="['check:stockCheck:edit']"
|
||||
>单据作废</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['check:stockCheck:add']"
|
||||
>新增</el-button>
|
||||
@click="handleReview"
|
||||
v-hasPermi="['check:stockCheck:edit']"
|
||||
>单据审核</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -167,37 +178,17 @@
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
@click="handleConfirmation"
|
||||
v-hasPermi="['check:stockCheck:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['check:stockCheck:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['check:stockCheck:export']"
|
||||
>导出</el-button>
|
||||
>单据确认</el-button>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stockCheckList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="GUID" align="center" prop="stockGuid" />
|
||||
<!-- <el-table-column label="GUID" align="center" prop="stockGuid" /> -->
|
||||
<el-table-column label="盘点单据ID" align="center" prop="stockCheckId" />
|
||||
<el-table-column label="盘库类型" align="center" prop="checkType">
|
||||
<template slot-scope="scope">
|
||||
@@ -217,34 +208,6 @@
|
||||
<el-table-column label="创建人" align="center" prop="createManId" />
|
||||
<el-table-column label="建立时间" align="center" prop="createDate" />
|
||||
<el-table-column label=" 完成日期" align="center" prop="finishDate" />
|
||||
<!-- <el-table-column label="erp单号" align="center" prop="erpBill" />-->
|
||||
|
||||
<!-- <el-table-column label="客户编码" align="center" prop="customerNo" />
|
||||
<el-table-column label="班组编码" align="center" prop="classNo" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierNo" />-->
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||
<el-table-column label="备用字段4" align="center" prop="spare4" />
|
||||
<el-table-column label="备用字段5" align="center" prop="spare5" />
|
||||
<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-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['check:stockCheck:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['check:stockCheck:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@@ -258,20 +221,20 @@
|
||||
<el-table v-loading="detailLoading" :data="stockCheckDetailList" @selection-change="handleDetailSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="子单ID" align="center" prop="stockCheckDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockCheckGuid" />
|
||||
<!-- <el-table-column label="主单GUID" align="center" prop="stockCheckGuid" /> -->
|
||||
<el-table-column label="主单ID" align="center" prop="stockCheckId" />
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<el-table-column label="物料ID" align="center" prop="productGuid" />
|
||||
<!-- <el-table-column label="物料ID" align="center" prop="productGuid" /> -->
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||
<el-table-column label="计划数量(箱)" align="center" prop="quantityX" />
|
||||
<el-table-column label="计划数量(件)" align="center" prop="quantityJ" />
|
||||
<!-- <el-table-column label="计划数量(箱)" align="center" prop="quantityX" />-->
|
||||
<!-- <el-table-column label="计划数量(件)" align="center" prop="quantityJ" />-->
|
||||
<el-table-column label="参考单价" align="center" prop="price" />
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="实际数量" align="center" prop="assignNum" />
|
||||
<el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />
|
||||
<el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />
|
||||
<!-- <el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />-->
|
||||
<!-- <el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />-->
|
||||
<el-table-column label="入库日期" align="center" prop="printDate" />
|
||||
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
||||
@@ -279,8 +242,8 @@
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<el-table-column label="扫码数量" align="center" prop="scanNum" />
|
||||
<el-table-column label="扫码数量(箱)" align="center" prop="scanNumX" />
|
||||
<el-table-column label="扫码数量(件)" align="center" prop="scanNumJ" />
|
||||
<!-- <el-table-column label="扫码数量(箱)" align="center" prop="scanNumX" />-->
|
||||
<!-- <el-table-column label="扫码数量(件)" align="center" prop="scanNumJ" />-->
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||
@@ -484,22 +447,8 @@ export default {
|
||||
this.detailTotal = 0
|
||||
}
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加盘库单据主信息"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockGuid = row.stockGuid || this.ids
|
||||
getStockCheck(stockGuid).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改盘库单据主信息"
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
@@ -520,22 +469,58 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockGuids = row.stockGuid || this.ids
|
||||
this.$modal.confirm('是否确认删除盘库单据主信息编号为"' + stockGuids + '"的数据项?').then(function() {
|
||||
return delStockCheck(stockGuids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
/** 作废按钮操作 */
|
||||
handleInvalidated(row) {
|
||||
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row.stockGuid || this.ids[0]));
|
||||
if (stockCheck.status === "1") {
|
||||
let data = {
|
||||
"stockGuid": stockCheck.stockGuid,
|
||||
"status": "5"
|
||||
}
|
||||
updateStockCheck(data).then(response => {
|
||||
this.$modal.msgSuccess("作废成功")
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
this.$modal.msgError("只有未审核的单据可以作废")
|
||||
}
|
||||
},
|
||||
/** 审核按钮操作 */
|
||||
handleReview(row) {
|
||||
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
|
||||
if (stockCheck.status === "2") {
|
||||
this.$modal.msgError("单据已审核,请勿重复审核")
|
||||
return
|
||||
}
|
||||
if (stockCheck.status === "1") {
|
||||
let data = {
|
||||
"stockGuid": stockCheck.stockGuid,
|
||||
"status": "2"
|
||||
}
|
||||
updateStockCheck(data).then(response => {
|
||||
this.$modal.msgSuccess("审核成功")
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
this.$modal.msgError("只有未审核的单据可以审核")
|
||||
}
|
||||
},
|
||||
/** 确认按钮操作 */
|
||||
handleConfirmation(row) {
|
||||
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
|
||||
if (stockCheck.status === "3") {
|
||||
let data = {
|
||||
"stockGuid": stockCheck.stockGuid,
|
||||
"status": "4"
|
||||
}
|
||||
updateStockCheck(data).then(response => {
|
||||
this.$modal.msgSuccess("确认成功")
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
this.$modal.msgError("只有已审核的单据可以确认")
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('check/stockCheck/export', {
|
||||
...this.queryParams
|
||||
}, `stockCheck_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user