添加入库单据
This commit is contained in:
@@ -197,7 +197,7 @@
|
||||
|
||||
<el-table v-loading="loading" :data="stockInList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" v-if="false" />
|
||||
<el-table-column label="入库订单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="入库类型" align="center" prop="inType">
|
||||
<template slot-scope="scope">
|
||||
@@ -256,7 +256,7 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-table v-loading="loading" :data="stockInDetailList" @selection-change="handleSelectionChange" >
|
||||
<el-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockinGuid" />
|
||||
@@ -405,12 +405,14 @@ export default {
|
||||
this.stockInList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
if (this.stockInList.length > 0){
|
||||
var length = this.stockInList.length;
|
||||
if (length > 0){
|
||||
var data = this.stockInList.at(0);
|
||||
this.getDetailList(data.stockinId);
|
||||
}else {
|
||||
console.log("没有数据")
|
||||
this.stockInDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
521
ruoyi-ui/src/views/receive/stockInDetail/index.vue
Normal file
521
ruoyi-ui/src/views/receive/stockInDetail/index.vue
Normal file
@@ -0,0 +1,521 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="主单GUID" prop="stockinGuid">
|
||||
<el-input
|
||||
v-model="queryParams.stockinGuid"
|
||||
placeholder="请输入主单GUID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主单ID" prop="stockinId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinId"
|
||||
placeholder="请输入主单ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="lotNo">
|
||||
<el-input
|
||||
v-model="queryParams.lotNo"
|
||||
placeholder="请输入批次号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料ID" prop="productGuid">
|
||||
<el-input
|
||||
v-model="queryParams.productGuid"
|
||||
placeholder="请输入物料ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入物料编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参考单价" prop="price">
|
||||
<el-input
|
||||
v-model="queryParams.price"
|
||||
placeholder="请输入参考单价"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="cargoNo">
|
||||
<el-input
|
||||
v-model="queryParams.cargoNo"
|
||||
placeholder="请输入品牌"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="printDate">
|
||||
<el-input
|
||||
v-model="queryParams.printDate"
|
||||
placeholder="请输入入库日期"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="供应商编码" prop="supplierId">
|
||||
<el-input
|
||||
v-model="queryParams.supplierId"
|
||||
placeholder="请输入供应商编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customerId">
|
||||
<el-input
|
||||
v-model="queryParams.customerId"
|
||||
placeholder="请输入客户编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="单位" prop="unit">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请输入单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input
|
||||
v-model="queryParams.spec"
|
||||
placeholder="请输入规格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="请输入备用字段1"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.spare2"
|
||||
placeholder="请输入备用字段2"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.spare3"
|
||||
placeholder="请输入备用字段3"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input
|
||||
v-model="queryParams.spare4"
|
||||
placeholder="请输入备用字段4"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入备用字段5"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段6" prop="spare6">
|
||||
<el-input
|
||||
v-model="queryParams.spare6"
|
||||
placeholder="请输入备用字段6"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['receive:stockInDetail:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['receive:stockInDetail: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="['receive:stockInDetail: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="['receive:stockInDetail:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stockInDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="主单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<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="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="printDate" />
|
||||
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
||||
<el-table-column label="客户编码" align="center" prop="customerId" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<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="备用字段6" align="center" prop="spare6" />
|
||||
<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="['receive:stockInDetail:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['receive:stockInDetail:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改收货单据子单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="主单GUID" prop="stockinGuid">
|
||||
<el-input v-model="form.stockinGuid" placeholder="请输入主单GUID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主单ID" prop="stockinId">
|
||||
<el-input v-model="form.stockinId" placeholder="请输入主单ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="lotNo">
|
||||
<el-input v-model="form.lotNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料ID" prop="productGuid">
|
||||
<el-input v-model="form.productGuid" placeholder="请输入物料ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参考单价" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入参考单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="cargoNo">
|
||||
<el-input v-model="form.cargoNo" placeholder="请输入品牌" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="printDate">
|
||||
<el-input v-model="form.printDate" placeholder="请输入入库日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplierId">
|
||||
<el-input v-model="form.supplierId" placeholder="请输入供应商编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customerId">
|
||||
<el-input v-model="form.customerId" placeholder="请输入客户编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input v-model="form.spec" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入备用字段1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="请输入备用字段2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="请输入备用字段3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input v-model="form.spare4" placeholder="请输入备用字段4" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input v-model="form.spare5" placeholder="请输入备用字段5" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段6" prop="spare6">
|
||||
<el-input v-model="form.spare6" placeholder="请输入备用字段6" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockInDetail, getStockInDetail, delStockInDetail, addStockInDetail, updateStockInDetail } from "@/api/receive/stockInDetail"
|
||||
|
||||
export default {
|
||||
name: "StockInDetail",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 收货单据子单表格数据
|
||||
stockInDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockinGuid: null,
|
||||
stockinId: null,
|
||||
lotNo: null,
|
||||
productGuid: null,
|
||||
productId: null,
|
||||
quantity: null,
|
||||
quantityX: null,
|
||||
quantityJ: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
assignNum: null,
|
||||
assignNumX: null,
|
||||
assignNumJ: null,
|
||||
printDate: null,
|
||||
stockStatus: null,
|
||||
supplierId: null,
|
||||
customerId: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockinGuid: [
|
||||
{ required: true, message: "主单GUID不能为空", trigger: "blur" }
|
||||
],
|
||||
stockinId: [
|
||||
{ required: true, message: "主单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
lotNo: [
|
||||
{ required: true, message: "批次号不能为空", trigger: "blur" }
|
||||
],
|
||||
productId: [
|
||||
{ required: true, message: "物料编码不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询收货单据子单列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listStockInDetail(this.queryParams).then(response => {
|
||||
this.stockInDetailList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockinDetailId: null,
|
||||
stockinGuid: null,
|
||||
stockinId: null,
|
||||
lotNo: null,
|
||||
productGuid: null,
|
||||
productId: null,
|
||||
quantity: null,
|
||||
quantityX: null,
|
||||
quantityJ: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
remark: null,
|
||||
assignNum: null,
|
||||
assignNumX: null,
|
||||
assignNumJ: null,
|
||||
printDate: null,
|
||||
stockStatus: null,
|
||||
supplierId: null,
|
||||
customerId: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stockinDetailId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加收货单据子单"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockinDetailId = row.stockinDetailId || this.ids
|
||||
getStockInDetail(stockinDetailId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改收货单据子单"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.stockinDetailId != null) {
|
||||
updateStockInDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addStockInDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockinDetailIds = row.stockinDetailId || this.ids
|
||||
this.$modal.confirm('是否确认删除收货单据子单编号为"' + stockinDetailIds + '"的数据项?').then(function() {
|
||||
return delStockInDetail(stockinDetailIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('receive/stockInDetail/export', {
|
||||
...this.queryParams
|
||||
}, `stockInDetail_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
453
ruoyi-ui/src/views/receive/stockin/add/index.vue
Normal file
453
ruoyi-ui/src/views/receive/stockin/add/index.vue
Normal file
@@ -0,0 +1,453 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="form-container">
|
||||
<div class="form-header">
|
||||
<span>新增入库单</span>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select v-model="form.warehouseId" placeholder="请选择仓库">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="form.supplierId" placeholder="请选择供应商">
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.supplierNo"
|
||||
:label="item.simpleName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="批次号" prop="batchNo">
|
||||
<el-input v-model="form.batchNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注信息"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="product-container">
|
||||
<div class="product-header">
|
||||
<span>入库物料</span>
|
||||
<el-row>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleAddProduct" v-hasPermi="['bas:BasProduct:list']">添加物料</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-download" size="mini" @click="handleImport" v-hasPermi="['receive:stockin:import']">导入物料</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-table :data="productList" border>
|
||||
<el-table-column type="index" label="序号" width="50" align="center"/>
|
||||
<el-table-column label="GUID" align="center" prop="productGuid"/>
|
||||
<el-table-column label="父节点id" align="center" prop="parentId"/>
|
||||
<el-table-column label="物料编码" align="center" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="center" prop="productName"/>
|
||||
<el-table-column label="价格" align="center" prop="price"/>
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo"/>
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="规格" align="center" prop="spec"/>
|
||||
<el-table-column label="描述" align="center" prop="remark"/>
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" v-if="false"/> -->
|
||||
<!-- <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="备用字段6" align="center" prop="spare6" />-->
|
||||
<el-table-column label="批号" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.lotNo"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
@change="calculateTotal"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库数量" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.quantity"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
@change="calculateTotal"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.price"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
@change="calculateTotal"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quantity * scope.row.price).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDeleteProduct(scope.$index)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="total-info" style="margin-top: 15px; text-align: right">
|
||||
<span>总数量:{{ totalQuantity }}</span>
|
||||
<span style="margin-left: 20px">总金额:{{ totalAmount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="submit-block" style="margin-top: 20px; text-align: right">
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['receive:stockin:add']">提交收货单</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 选择物料对话框 -->
|
||||
<el-dialog :title="'选择物料'" :visible.sync="productSelectVisible" width="800px" append-to-body>
|
||||
<el-table :data="productOptions" border @selection-change="handleProductSelectionChange">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column label="GUID" align="center" prop="productGuid"/>
|
||||
<el-table-column label="父节点id" align="center" prop="parentId"/>
|
||||
<el-table-column label="物料编码" align="center" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="center" prop="productName"/>
|
||||
<el-table-column label="价格" align="center" prop="price"/>
|
||||
<el-table-column label="品牌" align="center" prop="cargoNo"/>
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="规格" align="center" prop="spec"/>
|
||||
<el-table-column label="描述" align="center" prop="remark"/>
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" v-if="false"/> -->
|
||||
<!-- <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="备用字段6" align="center" prop="spare6" />-->
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="productTotal>0"
|
||||
:total="productTotal"
|
||||
:page.sync="queryProductParams.pageNum"
|
||||
:limit.sync="queryProductParams.pageSize"
|
||||
@pagination="getProductList"
|
||||
/>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelectProduct">确 定</el-button>
|
||||
<el-button @click="productSelectVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 物料导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addStockin} from "@/api/receive/stockin";
|
||||
import {listBasProduct} from "@/api/bas/BasProduct";
|
||||
import {listBasSupplier} from "@/api/bas/BasSupplier";
|
||||
import { getToken } from "@/utils/auth"
|
||||
|
||||
|
||||
export default {
|
||||
name: "InAdd",
|
||||
dicts: ['sys_normal_disable', 'is_active', 'storage_cond'],
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
form: {
|
||||
warehouseId: undefined,
|
||||
supplierId: undefined,
|
||||
remark: undefined,
|
||||
totalQuantity: 0,
|
||||
totalAmount: 0,
|
||||
file: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
warehouseId: [
|
||||
{required: true, message: "请选择仓库", trigger: "change"}
|
||||
],
|
||||
supplierId: [
|
||||
{required: true, message: "请选择供应商", trigger: "change"}
|
||||
],
|
||||
|
||||
|
||||
},
|
||||
// 仓库选项
|
||||
warehouseOptions: [
|
||||
{warehouseId: 1, warehouseName: "主仓库"},
|
||||
{warehouseId: 2, warehouseName: "次仓库"}
|
||||
],
|
||||
// 供应商选项
|
||||
supplierOptions: [],
|
||||
// 物料列表
|
||||
productList: [],
|
||||
// 物料选择对话框
|
||||
productSelectVisible: false,
|
||||
// 物料选项,
|
||||
productOptions: [],
|
||||
// 已选物料
|
||||
selectedProducts: [],
|
||||
// 总数量
|
||||
totalQuantity: 0,
|
||||
// 总金额
|
||||
totalAmount: 0,
|
||||
//物料总数
|
||||
productTotal: 0,
|
||||
//物料查询参数
|
||||
queryProductParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
//物料遮盖
|
||||
productLoading: true,
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/receive/stockin/analyseExportFile",
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//this.getWarehouseList();
|
||||
this.getSupplierList();
|
||||
console.log(this.supplierOptions)
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 获取物料列表 */
|
||||
getProductList() {
|
||||
listBasProduct(this.queryProductParams).then(response => {
|
||||
this.productOptions = response.rows;
|
||||
this.productTotal = response.total;
|
||||
this.productLoading = false;
|
||||
});
|
||||
},
|
||||
/** 获取供应商列表 */
|
||||
getSupplierList() {
|
||||
listBasSupplier().then(response => {
|
||||
this.supplierOptions = response.rows;
|
||||
});
|
||||
},
|
||||
|
||||
/** 添加物料按钮操作 */
|
||||
handleAddProduct() {
|
||||
this.getProductList();
|
||||
this.productSelectVisible = true;
|
||||
},
|
||||
handleExportProduct() {
|
||||
},
|
||||
/** 物料选择变更 */
|
||||
handleProductSelectionChange(selection) {
|
||||
this.selectedProducts = selection;
|
||||
},
|
||||
/** 确认选择物料 */
|
||||
confirmSelectProduct() {
|
||||
const newProducts = this.selectedProducts.map(item => ({
|
||||
productGuid: item.productGuid,
|
||||
productId: item.productId,
|
||||
parentId: item.parentId,
|
||||
price: item.price,
|
||||
cargoNo: item.cargoNo,
|
||||
unit: item.unit,
|
||||
spec: item.spec,
|
||||
remark: item.remark,
|
||||
productName: item.productName,
|
||||
quantity: 1,
|
||||
}));
|
||||
this.productList.push(...newProducts);
|
||||
this.productSelectVisible = false;
|
||||
this.calculateTotal();
|
||||
},
|
||||
/** 删除物料 */
|
||||
handleDeleteProduct(index) {
|
||||
this.productList.splice(index, 1);
|
||||
this.calculateTotal();
|
||||
},
|
||||
/** 计算总计 */
|
||||
calculateTotal() {
|
||||
this.totalQuantity = this.productList.reduce((sum, item) => sum + (item.quantity || 0), 0);
|
||||
this.totalAmount = this.productList.reduce((sum, item) => sum + ((item.quantity || 0) * (item.price || 0)), 0);
|
||||
this.form.totalQuantity = this.totalQuantity;
|
||||
this.form.totalAmount = this.totalAmount;
|
||||
},
|
||||
/** 表单提交 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.productList.length === 0) {
|
||||
this.$modal.msgError("请添加入库物料");
|
||||
return;
|
||||
}
|
||||
|
||||
// 构建请求数据
|
||||
const data = {
|
||||
warehouseId: this.form.warehouseId,
|
||||
supplierId: this.form.supplierId,
|
||||
//batchId: this.form.batchNo,
|
||||
productVoList: this.productList.map(item => ({
|
||||
productGuid: item.productGuid,
|
||||
quantity: item.quantity,
|
||||
lotNo: item.lotNo
|
||||
}))
|
||||
};
|
||||
|
||||
// 提交收货单
|
||||
addStockin(data).then(() => {
|
||||
this.$modal.msgSuccess("新增收货单成功");
|
||||
// 重置表单数据
|
||||
this.form = {
|
||||
warehouseId: undefined,
|
||||
supplierId: undefined,
|
||||
remark: undefined,
|
||||
totalQuantity: 0,
|
||||
totalAmount: 0,
|
||||
};
|
||||
// 清空物料列表
|
||||
this.productList = [];
|
||||
// 重置计数器
|
||||
this.totalQuantity = 0;
|
||||
this.totalAmount = 0;
|
||||
// 重置表单校验结果
|
||||
this.$refs["form"].resetFields();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.productSelectVisible = false;
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "物料导入"
|
||||
this.upload.open = true
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('/receive/stockin/importTemplate', {
|
||||
}, `product_template_${new Date().getTime()}.xlsx`)
|
||||
},// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
if (response.code === 200) {
|
||||
this.$modal.msgSuccess("导入成功");
|
||||
this.productList.push(...response.data)
|
||||
this.upload.open = false;
|
||||
} else {
|
||||
this.$modal.msgError(response.msg);
|
||||
}
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.form-header {
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.product-container {
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin-top: 10px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.product-header {
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.total-info span {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
558
ruoyi-ui/src/views/receive/stockin/index.vue
Normal file
558
ruoyi-ui/src/views/receive/stockin/index.vue
Normal file
@@ -0,0 +1,558 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="入库订单ID" prop="stockinId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinId"
|
||||
placeholder="请输入入库订单ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="建立时间" prop="createDate">
|
||||
<el-input
|
||||
v-model="queryParams.createDate"
|
||||
placeholder="请输入建立时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createManId">
|
||||
<el-input
|
||||
v-model="queryParams.createManId"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请输入仓库ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入备用字段5"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input
|
||||
v-model="queryParams.spare4"
|
||||
placeholder="请输入备用字段4"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.spare3"
|
||||
placeholder="请输入备用字段3"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label=" 完成日期" prop="finishDate">
|
||||
<el-input
|
||||
v-model="queryParams.finishDate"
|
||||
placeholder="请输入 完成日期"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.spare2"
|
||||
placeholder="请输入备用字段2"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="请输入备用字段1"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="erp单号" prop="erpBill">
|
||||
<el-input
|
||||
v-model="queryParams.erpBill"
|
||||
placeholder="请输入erp单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据来源" prop="stockSource">
|
||||
<el-input
|
||||
v-model="queryParams.stockSource"
|
||||
placeholder="请输入单据来源"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="客户编码" prop="customerNo">
|
||||
<el-input
|
||||
v-model="queryParams.customerNo"
|
||||
placeholder="请输入客户编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编码" prop="classNo">
|
||||
<el-input
|
||||
v-model="queryParams.classNo"
|
||||
placeholder="请输入班组编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplierNo">
|
||||
<el-input
|
||||
v-model="queryParams.supplierNo"
|
||||
placeholder="请输入供应商编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['receive:stockin:add']"
|
||||
>新增</el-button>
|
||||
</el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['receive:stockin: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="['receive:stockin: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="['receive:stockin:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="stockinList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="入库订单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="入库类型" align="center" prop="inType" />
|
||||
<el-table-column label="建立时间" align="center" prop="createDate" />
|
||||
<el-table-column label="创建人" align="center" prop="createManId" />
|
||||
<el-table-column label="单据状态" align="center" prop="status" />
|
||||
<el-table-column label="仓库ID" align="center" prop="warehouseId" />
|
||||
<el-table-column label="备用字段5" align="center" prop="spare5" />
|
||||
<el-table-column label="备用字段4" align="center" prop="spare4" />
|
||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||
<el-table-column label=" 完成日期" align="center" prop="finishDate" />
|
||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||
<el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||
<el-table-column label="erp单号" align="center" prop="erpBill" />
|
||||
<el-table-column label="单据来源" align="center" prop="stockSource" />
|
||||
<el-table-column label="部门编码" align="center" prop="departmentNo" />
|
||||
<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="操作" 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="['receive:stockin:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['receive:stockin:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="主单GUID" align="center" prop="stockinGuid" />
|
||||
<el-table-column label="主单ID" align="center" prop="stockinId" />
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<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="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="printDate" />
|
||||
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
||||
<el-table-column label="客户编码" align="center" prop="customerId" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<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="备用字段6" align="center" prop="spare6" />
|
||||
<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="['receive:stockInDetail:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['receive:stockInDetail:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改收货单据对话框 -->
|
||||
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="入库订单ID" prop="stockinId">
|
||||
<el-input v-model="form.stockinId" placeholder="请输入入库订单ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="建立时间" prop="createDate">
|
||||
<el-input v-model="form.createDate" placeholder="请输入建立时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createManId">
|
||||
<el-input v-model="form.createManId" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input v-model="form.spare5" placeholder="请输入备用字段5" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input v-model="form.spare4" placeholder="请输入备用字段4" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="请输入备用字段3" />
|
||||
</el-form-item>
|
||||
<el-form-item label=" 完成日期" prop="finishDate">
|
||||
<el-input v-model="form.finishDate" placeholder="请输入 完成日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="请输入备用字段2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入备用字段1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="erp单号" prop="erpBill">
|
||||
<el-input v-model="form.erpBill" placeholder="请输入erp单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据来源" prop="stockSource">
|
||||
<el-input v-model="form.stockSource" placeholder="请输入单据来源" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门编码" prop="departmentNo">
|
||||
<el-input v-model="form.departmentNo" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编码" prop="classNo">
|
||||
<el-input v-model="form.classNo" placeholder="请输入班组编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplierNo">
|
||||
<el-input v-model="form.supplierNo" placeholder="请输入供应商编码" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStockin, getStockin, delStockin, addStockin, updateStockin } from "@/api/receive/stockin"
|
||||
import { listStockInDetail } from "@/api/receive/stockInDetail"
|
||||
|
||||
export default {
|
||||
name: "Stockin",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
detailLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 收货单据表格数据
|
||||
stockinList: [],
|
||||
stockInDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
createDate: null,
|
||||
createManId: null,
|
||||
status: null,
|
||||
warehouseId: null,
|
||||
spare5: null,
|
||||
spare4: null,
|
||||
spare3: null,
|
||||
finishDate: null,
|
||||
spare2: null,
|
||||
spare1: null,
|
||||
erpBill: null,
|
||||
stockSource: null,
|
||||
departmentNo: null,
|
||||
customerNo: null,
|
||||
classNo: null,
|
||||
supplierNo: null
|
||||
},
|
||||
queryDetailParams:{
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockinId:null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockinId: [
|
||||
{ required: true, message: "入库订单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
inType: [
|
||||
{ required: true, message: "入库类型不能为空", trigger: "change" }
|
||||
],
|
||||
createDate: [
|
||||
{ required: true, message: "建立时间不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "单据状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询收货单据列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listStockin(this.queryParams).then(response => {
|
||||
this.stockinList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
var length = this.stockinList.length;
|
||||
if (length > 0){
|
||||
var data = this.stockInList.at(0);
|
||||
this.getDetailList(data.stockinId);
|
||||
}else {
|
||||
console.log("没有数据")
|
||||
this.stockInDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockinGuid: null,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
createDate: null,
|
||||
createManId: null,
|
||||
status: null,
|
||||
warehouseId: null,
|
||||
spare5: null,
|
||||
spare4: null,
|
||||
spare3: null,
|
||||
finishDate: null,
|
||||
spare2: null,
|
||||
spare1: null,
|
||||
erpBill: null,
|
||||
stockSource: null,
|
||||
departmentNo: null,
|
||||
customerNo: null,
|
||||
classNo: null,
|
||||
supplierNo: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stockinGuid)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加收货单据"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockinGuid = row.stockinGuid || this.ids
|
||||
getStockin(stockinGuid).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改收货单据"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.stockinGuid != null) {
|
||||
updateStockin(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addStockin(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockinGuids = row.stockinGuid || this.ids
|
||||
this.$modal.confirm('是否确认删除收货单据编号为"' + stockinGuids + '"的数据项?').then(function() {
|
||||
return delStockin(stockinGuids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('receive/stockin/export', {
|
||||
...this.queryParams
|
||||
}, `stockin_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
getDetailList(stockinId) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
handleRowClick(selection){
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = selection.stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user