465 lines
18 KiB
Vue
465 lines
18 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="$t('checkDifference.checkStockDetailId')" prop="checkStockDetailId"> <!-- 盘点单据id -->
|
|
<el-input
|
|
v-model="queryParams.checkStockDetailId"
|
|
:placeholder="$t('checkDifference.inputCheckStockDetailId')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.stockId')" prop="stockId"> <!-- 库存id -->
|
|
<el-input
|
|
v-model="queryParams.stockId"
|
|
:placeholder="$t('checkDifference.inputStockId')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.trayCode')" prop="trayCode"> <!-- 托盘 -->
|
|
<el-input
|
|
v-model="queryParams.trayCode"
|
|
:placeholder="$t('checkDifference.inputTrayCode')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.cargoSpaceId')" prop="cargoSpaceId"> <!-- 货位id -->
|
|
<el-input
|
|
v-model="queryParams.cargoSpaceId"
|
|
:placeholder="$t('checkDifference.inputCargoSpaceId')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.productId')" prop="productId"> <!-- 物料id -->
|
|
<el-input
|
|
v-model="queryParams.productId"
|
|
:placeholder="$t('checkDifference.inputProductId')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<!-- <el-form-item :label="$t('checkDifference.lotNo')" prop="lotNo"> <!– 批次号 –>
|
|
<el-input
|
|
v-model="queryParams.lotNo"
|
|
:placeholder="$t('checkDifference.inputLotNo')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>-->
|
|
<!-- <el-form-item label="供应商" prop="supplier">
|
|
<el-input
|
|
v-model="queryParams.supplier"
|
|
placeholder="请输入供应商"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="客户" prop="customer">
|
|
<el-input
|
|
v-model="queryParams.customer"
|
|
placeholder="请输入客户"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>-->
|
|
<!-- <el-form-item label="原值" prop="oldQuantity">
|
|
<el-input
|
|
v-model="queryParams.oldQuantity"
|
|
placeholder="请输入原值"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="新值" prop="newQuantity">
|
|
<el-input
|
|
v-model="queryParams.newQuantity"
|
|
placeholder="请输入新值"
|
|
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('checkDifference.status')" prop="status"> <!-- 审核状态 -->
|
|
<el-select v-model="queryParams.status" :placeholder="$t('checkDifference.inputStatus')" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.audit_diff_status"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.recordType')" prop="recordType"> <!-- 审核状态 -->
|
|
<el-select v-model="queryParams.recordType" :placeholder="$t('checkDifference.inputRecordType')" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.record_type"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<!-- <el-form-item :label="$t('checkDifference.productGuid')" prop="productGuid"> 物料guid
|
|
<el-input
|
|
v-model="queryParams.productGuid"
|
|
placeholder="请输入物料guid"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item> -->
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('checkDifference.search')}}</el-button> <!-- 搜索 -->
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('checkDifference.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-check"
|
|
size="mini"
|
|
:disabled="multiple || queryParams.status === '1'"
|
|
@click="handleAudit"
|
|
v-hasPermi="['check:difference:audit']"
|
|
>{{$t('checkDifference.audit')}}</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="danger"
|
|
plain
|
|
icon="el-icon-delete"
|
|
size="mini"
|
|
:disabled="multiple || queryParams.status === '1'"
|
|
@click="handleDelete"
|
|
v-hasPermi="['check:difference:delete']"
|
|
>{{$t('checkDifference.delete')}}</el-button>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table v-loading="loading" :data="differenceList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<!-- <el-table-column :label="$t('checkDifference.checkGuid')" align="center" prop="checkGuid" /> <!– 盘点id –>-->
|
|
<el-table-column :label="$t('checkDifference.warehouseId')" align="center" prop="warehouseName" /> <!-- 仓库 -->
|
|
<el-table-column :label="$t('checkDifference.checkStockDetailId')" align="center" prop="checkStockDetailId" /> <!-- 盘点单据id -->
|
|
<el-table-column :label="$t('checkDifference.stockId')" align="center" prop="stockId" /> <!-- 库存id -->
|
|
<el-table-column :label="$t('checkDifference.trayCode')" align="center" prop="trayCode" /> <!-- 托盘 -->
|
|
<el-table-column :label="$t('checkDifference.cargoSpaceId')" align="center" prop="cargoSpaceName" /> <!-- 货位id -->
|
|
<el-table-column :label="$t('checkDifference.productId')" align="center" prop="productId" /> <!-- 物料id -->
|
|
<el-table-column :label="$t('checkStockCheck.materialDesc')" align="center" prop="extraField.materialDesc"/> <!-- 物料描述 -->
|
|
<el-table-column :label="$t('checkStockCheck.englishDesc')" align="center" prop="extraField.englishDesc"/> <!-- 英文描述 -->
|
|
<el-table-column :label="$t('checkDifference.oldQuantity')" align="center" prop="oldQuantity" /> <!-- 原值 -->
|
|
<el-table-column :label="$t('checkDifference.newQuantity')" align="center" prop="newQuantity" /> <!-- 新值 -->
|
|
<el-table-column :label="$t('checkDifference.recordType')" align="center" prop="recordType" >
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.record_type" :value="scope.row.recordType"/>
|
|
</template>
|
|
</el-table-column><!-- 操作方式 -->
|
|
<el-table-column :label="$t('checkDifference.createTime')" align="center" prop="createTime" /> <!-- 创建时间 -->
|
|
<el-table-column :label="$t('checkDifference.status')" align="center" prop="status"> <!-- 审核状态 -->
|
|
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.audit_diff_status" :value="scope.row.status"/>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
|
|
<!-- <el-table-column :label="$t('checkDifference.productGuid')" align="center" prop="productGuid" /> <!– 物料guid –>-->
|
|
<!-- <el-table-column :label="$t('checkDifference.operation')" 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:difference:edit']"
|
|
>{{$t('checkDifference.edit')}}</el-button> <!– 修改 –>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['check:difference:remove']"
|
|
>{{$t('checkDifference.delete')}}</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="$t('checkDifference.checkStockDetailId')" prop="checkStockDetailId"> <!-- 盘点单据id -->
|
|
<el-input v-model="form.checkStockDetailId" :placeholder="$t('checkDifference.inputCheckStockDetailId')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.stockId')" prop="stockId"> <!-- 库存id -->
|
|
<el-input v-model="form.stockId" :placeholder="$t('checkDifference.inputStockId')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.trayCode')" prop="trayCode"> <!-- 托盘 -->
|
|
<el-input v-model="form.trayCode" :placeholder="$t('checkDifference.inputTrayCode')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.cargoSpaceId')" prop="cargoSpaceId"> <!-- 货位id -->
|
|
<el-input v-model="form.cargoSpaceId" :placeholder="$t('checkDifference.inputCargoSpaceId')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.productId')" prop="productId"> <!-- 物料id -->
|
|
<el-input v-model="form.productId" :placeholder="$t('checkDifference.inputProductId')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.lotNo')" prop="lotNo"> <!-- 批次号 -->
|
|
<el-input v-model="form.lotNo" :placeholder="$t('checkDifference.inputLotNo')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.supplier')" prop="supplier"> <!-- 供应商 -->
|
|
<el-input v-model="form.supplier" :placeholder="$t('checkDifference.inputSupplier')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.customer')" prop="customer"> <!-- 客户 -->
|
|
<el-input v-model="form.customer" :placeholder="$t('checkDifference.inputCustomer')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.oldQuantity')" prop="oldQuantity"> <!-- 原值 -->
|
|
<el-input v-model="form.oldQuantity" :placeholder="$t('checkDifference.inputOldQuantity')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.newQuantity')" prop="newQuantity"> <!-- 新值 -->
|
|
<el-input v-model="form.newQuantity" :placeholder="$t('checkDifference.inputNewQuantity')" />
|
|
</el-form-item>
|
|
<el-form-item :label="$t('checkDifference.productGuid')" prop="productGuid"> <!-- 物料guid -->
|
|
<el-input v-model="form.productGuid" :placeholder="$t('checkDifference.inputProductGuid')" />
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">{{$t('checkDifference.confirm')}}</el-button> <!-- 确定 -->
|
|
<el-button @click="cancel">{{$t('checkDifference.cancel')}}</el-button> <!-- 取消 -->
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listDifference, getDifference, delDifference, addDifference, updateDifference, auditDifference } from "@/api/check/difference"
|
|
import { listDifferenceRecordFinish } from "@/api/check/DifferenceRecordFinish"
|
|
import DictTag from "@/components/DictTag"
|
|
import {listWarehouse} from "@/api/bas/warehouse";
|
|
|
|
export default {
|
|
name: "Difference",
|
|
dicts:['record_type','audit_diff_status'],
|
|
components: {
|
|
DictTag
|
|
},
|
|
data() {
|
|
return {
|
|
warehouseOptions:[],
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 总条数
|
|
total: 0,
|
|
// 盘点差异表格数据
|
|
differenceList: [],
|
|
// 弹出层标题
|
|
title: "",
|
|
// 是否显示弹出层
|
|
open: false,
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
checkStockDetailId: null,
|
|
stockId: null,
|
|
trayCode: null,
|
|
cargoSpaceId: null,
|
|
productId: null,
|
|
lotNo: null,
|
|
supplier: null,
|
|
customer: null,
|
|
oldQuantity: null,
|
|
newQuantity: null,
|
|
recordType: null,
|
|
productGuid: null,
|
|
status: null
|
|
},
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
this.getList()
|
|
this.getWarehouseList()
|
|
},
|
|
methods: {
|
|
/** 获取仓库列表 */
|
|
getWarehouseList() {
|
|
listWarehouse().then(response => {
|
|
this.warehouseOptions = response.rows;
|
|
if (this.warehouseOptions.length > 0) {
|
|
this.handleQuery();
|
|
}
|
|
});
|
|
},
|
|
/** 查询盘点差异列表 */
|
|
getList() {
|
|
this.loading = true
|
|
if (this.queryParams.status === '1') {
|
|
// 已审核,查询历史表
|
|
listDifferenceRecordFinish(this.queryParams).then(response => {
|
|
this.differenceList = response.rows
|
|
this.total = response.total
|
|
this.loading = false
|
|
})
|
|
} else {
|
|
// 未审核或未选择状态,查询差异表
|
|
listDifference(this.queryParams).then(response => {
|
|
this.differenceList = response.rows
|
|
this.total = response.total
|
|
this.loading = false
|
|
})
|
|
}
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.open = false
|
|
this.reset()
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
checkGuid: null,
|
|
checkStockDetailId: null,
|
|
stockId: null,
|
|
trayCode: null,
|
|
cargoSpaceId: null,
|
|
productId: null,
|
|
lotNo: null,
|
|
supplier: null,
|
|
customer: null,
|
|
oldQuantity: null,
|
|
newQuantity: null,
|
|
recordType: null,
|
|
createTime: null,
|
|
productGuid: null,
|
|
status: 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.checkGuid)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
},
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
this.reset()
|
|
this.open = true
|
|
this.title = "添加盘点差异"
|
|
},
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
this.reset()
|
|
const checkGuid = row.checkGuid || this.ids
|
|
getDifference(checkGuid).then(response => {
|
|
this.form = response.data
|
|
this.open = true
|
|
this.title = "修改盘点差异"
|
|
})
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (this.form.checkGuid != null) {
|
|
updateDifference(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功")
|
|
this.open = false
|
|
this.getList()
|
|
})
|
|
} else {
|
|
addDifference(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功")
|
|
this.open = false
|
|
this.getList()
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
const checkGuids = row.checkGuid || this.ids
|
|
this.$modal.confirm('是否确认删除盘点差异编号为"' + checkGuids + '"的数据项?').then(function() {
|
|
return delDifference(checkGuids)
|
|
}).then(() => {
|
|
this.getList()
|
|
this.$modal.msgSuccess("删除成功")
|
|
}).catch(() => {})
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
this.download('check/difference/export', {
|
|
...this.queryParams
|
|
}, `difference_${new Date().getTime()}.xlsx`)
|
|
},
|
|
/** 审核按钮操作 */
|
|
handleAudit() {
|
|
const checkGuids = this.ids
|
|
this.$modal.confirm('是否确认审核选中的' + checkGuids.length + '条数据?').then(function() {
|
|
return auditDifference(checkGuids)
|
|
}).then(() => {
|
|
this.getList()
|
|
this.$modal.msgSuccess("审核成功")
|
|
}).catch(() => {})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
.el-form-item >>> .el-form-item__label {
|
|
white-space: nowrap;
|
|
width: auto;
|
|
min-width: fit-content;
|
|
}
|
|
</style>
|