667 lines
25 KiB
Vue
667 lines
25 KiB
Vue
<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>
|
|
<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="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="$t('inReceiveStockin.stockinId')" prop="stockinId"><!--入库订单ID-->
|
|
<el-input
|
|
v-model="queryParams.stockinId"
|
|
:placeholder="$t('inReceiveStockin.inputstockinId')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<!-- <el-form-item :label="$t('inReceiveStockin.supplierNo')" prop="supplierNo"><!–供应商编码–>-->
|
|
<!-- <el-input-->
|
|
<!-- v-model="queryParams.supplierNo"-->
|
|
<!-- :placeholder="$t('inReceiveStockin.inputSupplierNo')"-->
|
|
<!-- clearable-->
|
|
<!-- @keyup.enter.native="handleQuery"-->
|
|
<!-- />-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item :label="$t('inReceiveStockin.stockSource')" prop="stockSource"><!–单据来源–>-->
|
|
<!-- <el-input-->
|
|
<!-- v-model="queryParams.stockSource"-->
|
|
<!-- :placeholder="$t('inReceiveStockin.inputStockSource')"-->
|
|
<!-- clearable-->
|
|
<!-- @keyup.enter.native="handleQuery"-->
|
|
<!-- />-->
|
|
<!-- </el-form-item>-->
|
|
<el-form-item :label="$t('inReceiveStockin.materialDesc')" prop="stockSource"><!--物料描述-->
|
|
<el-input
|
|
v-model="queryParams.materialDesc"
|
|
:placeholder="$t('inReceiveStockin.inputMaterialDesc')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('inReceiveStockin.lotNo')" prop="stockSource"><!--批号-->
|
|
<el-input
|
|
v-model="queryParams.lotNo"
|
|
:placeholder="$t('inReceiveStockin.inputLotNo')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('inReceiveStockin.warehouseId')" prop="warehouseId"><!--仓库-->
|
|
<el-select
|
|
v-model="queryParams.warehouseId"
|
|
:placeholder="$t('inReceiveStockin.selectWarehouseId')"
|
|
clearable
|
|
@change="handleQuery"
|
|
>
|
|
<el-option
|
|
v-for="item in warehouseOptions"
|
|
:key="item.warehouseId"
|
|
:label="item.warehouseName"
|
|
:value="item.warehouseId"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('inReceiveStockin.status')" prop="status"><!--单据状态-->
|
|
<el-select
|
|
v-model="queryParams.status"
|
|
:placeholder="$t('inReceiveStockin.selectStatus')"
|
|
clearable
|
|
@change="handleQuery"
|
|
>
|
|
<el-option
|
|
v-for="dict in statusOptions"
|
|
:key="dict.dictValue"
|
|
:label="dict.dictLabel"
|
|
:value="dict.dictValue"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('inReceiveStockin.search')}}</el-button><!--搜索-->
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('inReceiveStockin.reset')}}</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="handleCreateInStockIn"
|
|
v-hasPermi="['receive:stockin:edit']"
|
|
>{{$t('inReceiveStockin.generateStockin')}}<!--生成入库单据-->
|
|
</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']"
|
|
>{{$t('inReceiveStockin.delet')}}<!--删除-->
|
|
</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="$t('inReceiveStockin.stockinId')" align="center" prop="stockinId"/><!--入库订单-->
|
|
<el-table-column :label="$t('inReceiveStockin.inType')" align="center" prop="inType"/><!--入库类型-->
|
|
<el-table-column :label="$t('inReceiveStockin.createDate')" align="center" prop="createDate"/><!--建立时间-->
|
|
<el-table-column :label="$t('inReceiveStockin.createManName')" align="center" prop="createManName"/><!--创建人-->
|
|
<el-table-column :label="$t('inReceiveStockin.status')" align="center" prop="status"><!--单据状态-->
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('inReceiveStockin.warehouseName')" align="center" prop="warehouseName"/><!--仓库-->
|
|
<!-- <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="$t('inReceiveStockin.stockSource')" align="center" prop="stockSource"/><!--单据来源-->
|
|
<el-table-column :label="$t('inReceiveStockin.departmentName')" align="center" prop="departmentName"/><!--部门-->
|
|
<!-- <el-table-column label="客户编码" align="center" prop="customerNo"/>-->
|
|
<!-- <el-table-column label="班组编码" align="center" prop="classNo"/>-->
|
|
<el-table-column :label="$t('inReceiveStockin.supplierName')" align="center" prop="supplierName"/><!--供应商-->
|
|
<!-- <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-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="success"
|
|
plain
|
|
icon="el-icon-edit"
|
|
size="mini"
|
|
:detailDisabled="single"
|
|
@click="handleQualityInspection"
|
|
v-hasPermi="['receive:stockInDetail:qualityInspection']"
|
|
>{{$t('inReceiveStockin.testing')}}<!--质检-->
|
|
</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="danger"
|
|
plain
|
|
icon="el-icon-delete"
|
|
size="mini"
|
|
:detailDisabled="multiple"
|
|
@click="handleStockinDetailDelete"
|
|
v-hasPermi="['receive:stockInDetail:remove']"
|
|
>{{$t('inReceiveStockin.delet')}}<!--删除-->
|
|
</el-button>
|
|
</el-col>
|
|
</el-row>
|
|
<el-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleDetailSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
<el-table-column :label="$t('inReceiveStockin.stockinDetailId')" align="center" prop="stockinDetailId"/><!--子单ID-->
|
|
<!-- <el-table-column label="主单GUID" align="center" prop="stockinGuid" /> -->
|
|
<el-table-column :label="$t('inReceiveStockin.stockinId')" align="center" prop="stockinId"/><!--主单ID-->
|
|
<el-table-column :label="$t('inReceiveStockin.lotNo')" align="center" prop="lotNo"/><!--批次号-->
|
|
<!-- <el-table-column label="物料ID" align="center" prop="productGuid"/>-->
|
|
<el-table-column :label="$t('inReceiveStockin.productId')" align="center" prop="productId"/><!--物料编码-->
|
|
<el-table-column :label="$t('inReceiveStockin.materialDesc')" align="center" prop="extraField.materialDesc"/><!--物料描述-->
|
|
<el-table-column :label="$t('inReceiveStockin.englishDesc')" align="center" prop="extraField.englishDesc"/><!--英文描述-->
|
|
<el-table-column :label="$t('inReceiveStockin.cartonNo')" align="center" prop="extraField.cartonNo"/><!--箱号-->
|
|
<el-table-column :label="$t('inReceiveStockin.packingMethod')" align="center" prop="extraField.packingMethod"/><!--包装方式-->
|
|
<el-table-column :label="$t('inReceiveStockin.quantity')" width="120" align="center"><!--计划数量-->
|
|
<template slot-scope="scope">
|
|
<el-input-number
|
|
v-model="scope.row.quantity"
|
|
:min="1"
|
|
controls-position="right"
|
|
required="required"
|
|
/>
|
|
</template>
|
|
</el-table-column>
|
|
<!-- <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="$t('inReceiveStockin.stockStatus')" align="center" prop="stockStatus"><!--单据状态-->
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="statusOptions" :value="scope.row.stockStatus"/>
|
|
</template>
|
|
</el-table-column>
|
|
<!-- <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="$t('inReceiveStockin.operate')" align="center" class-name="small-padding fixed-width"><!--操作-->
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
@click="handleQualityInspection(scope.row)"
|
|
v-hasPermi="['receive:stockInDetail:qualityInspection']"
|
|
>{{$t('inReceiveStockin.testing')}}<!--质检-->
|
|
</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="handleStockinDetailDelete(scope.row)"
|
|
v-hasPermi="['receive:stockInDetail:remove']"
|
|
>{{$t('inReceiveStockin.delet')}}<!--删除-->
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<pagination
|
|
v-show="detailTotal>0"
|
|
:total="detailTotal"
|
|
:page.sync="queryDetailParams.pageNum"
|
|
:limit.sync="queryDetailParams.pageSize"
|
|
@pagination="getDetailList"
|
|
/>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {listStockin, getStockin, delStockin, addStockin, updateStockin, createStockin} from "@/api/receive/stockin"
|
|
import {listStockInDetail, delStockInDetail,qualityInspection} from "@/api/receive/stockInDetail"
|
|
import {listWarehouse} from "@/api/bas/warehouse"
|
|
import { getDicts } from "@/api/system/dict/data"
|
|
|
|
export default {
|
|
name: "Stockin",
|
|
dicts: ['receive_bill_status'],
|
|
data() {
|
|
return {
|
|
// 仓库选项列表
|
|
warehouseOptions: [],
|
|
// 单据状态字典
|
|
statusOptions: [],
|
|
// 遮罩层
|
|
loading: true,
|
|
detailLoading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
detailIds: [], // 子表格选中数组
|
|
// 非单个禁用
|
|
single: true,
|
|
detailSingle: true, // 子表格非单个禁用
|
|
// 非多个禁用
|
|
multiple: true,
|
|
detailMultiple: true, // 子表格非多个禁用
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 总条数
|
|
total: 0,
|
|
detailTotal: 0,
|
|
// 收货单据表格数据
|
|
stockinList: [],
|
|
stockInDetailList: [],
|
|
// 弹出层标题
|
|
title: "",
|
|
// 是否显示弹出层
|
|
open: false,
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
stockinId: null,
|
|
inType: null,
|
|
createDate: null,
|
|
createManId: null,
|
|
status: '0',
|
|
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()
|
|
this.getWarehouseList()
|
|
this.getDictList()
|
|
},
|
|
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[0];
|
|
this.getDetailList(data.stockinId);
|
|
} else {
|
|
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
|
|
},
|
|
// 子表格多选框选中数据
|
|
handleDetailSelectionChange(selection) {
|
|
this.detailIds = selection.map(item => item.stockinDetailId)
|
|
this.detailSingle = selection.length !== 1
|
|
this.detailMultiple = !selection.length
|
|
},
|
|
/** 删除按钮操作 */
|
|
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;
|
|
this.queryDetailParams.status = this.queryParams.status;
|
|
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;
|
|
});
|
|
},
|
|
// 删除子单据按钮操作
|
|
handleStockinDetailDelete(row) {
|
|
const stockinDetailIds = row.stockinDetailId || this.detailIds
|
|
|
|
this.$modal.confirm('是否确认删除收货子单据编号为"' + stockinDetailIds + '"的数据项?').then(function () {
|
|
return delStockInDetail(stockinDetailIds)
|
|
}).then(() => {
|
|
this.getDetailList(this.queryDetailParams.stockinId)
|
|
this.$modal.msgSuccess("删除成功")
|
|
}).catch(() => {
|
|
})
|
|
},
|
|
//质检功能
|
|
handleQualityInspection(row) {
|
|
const stockinDetailIds = row.stockinDetailId || this.detailIds
|
|
|
|
if (!stockinDetailIds || (Array.isArray(stockinDetailIds) && stockinDetailIds.length === 0)) {
|
|
this.$modal.msgError("请选择需要质检的记录");
|
|
return;
|
|
}
|
|
|
|
let selectedDetails = [];
|
|
// 如果是点击批量质检按钮,获取所有选中行的数据
|
|
selectedDetails = this.stockInDetailList.filter(item =>
|
|
stockinDetailIds.includes(item.stockinDetailId)
|
|
).map(item => ({
|
|
stockinDetailId: item.stockinDetailId,
|
|
quantity: item.quantity,
|
|
stockinId: item.stockinId
|
|
}));
|
|
|
|
if (selectedDetails.length === 0) {
|
|
this.$modal.msgError("未找到需要质检的记录");
|
|
return;
|
|
}
|
|
|
|
let data = {
|
|
list: selectedDetails,
|
|
stockinId: selectedDetails[0].stockinId
|
|
};
|
|
|
|
qualityInspection(data).then(response => {
|
|
this.getDetailList(data.stockinId)
|
|
this.$modal.msgSuccess("质检成功");
|
|
}).catch(error => {
|
|
this.$modal.msgError("质检失败:" + error.message);
|
|
});
|
|
},/**
|
|
* 创建入库单
|
|
* @param row
|
|
*/
|
|
handleCreateInStockIn(row) {
|
|
this.reset()
|
|
const stockinGuid = row.stockinGuid || this.ids
|
|
let data = {
|
|
stockinGuidList: stockinGuid
|
|
}
|
|
//console.log(data)
|
|
createStockin(data).then(response => {
|
|
this.getList()
|
|
})
|
|
},
|
|
/** 获取字典数据 */
|
|
getDictList() {
|
|
getDicts("receive_bill_status").then(response => {
|
|
this.statusOptions = response.data;
|
|
});
|
|
},
|
|
/** 获取仓库列表 */
|
|
getWarehouseList() {
|
|
listWarehouse().then(response => {
|
|
this.warehouseOptions = response.rows;
|
|
if (this.warehouseOptions.length > 0) {
|
|
this.queryParams.warehouseId = this.warehouseOptions[0].warehouseId;
|
|
this.handleQuery();
|
|
}
|
|
});
|
|
},
|
|
}
|
|
}
|
|
</script>
|