You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
cy_web/src/views/libraryManage/inventory/InventoryDifference.vue

233 lines
5.9 KiB

<template>
<!-- 盘点差异处理 -->
<div class="app-container">
<div class="search-box">
<el-form
:inline="true"
:model="enterForm"
>
<el-form-item label="单据编号">
<el-input
v-model="enterForm.invOrderNo"
placeholder="请输入单据编号"
clearable
></el-input>
</el-form-item>
<el-form-item
label="操作员"
prop="userName"
>
<el-select
v-model="enterForm.userName"
filterable
placeholder="请选择工号"
disabled
>
<el-option
v-for="item in options2"
:key="item.userName"
:label="item.nickName"
:value="item.userName"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="queryTable"
>搜索</el-button>
<el-button @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="opt-box">
<div class="opt-box-right">
<el-row :gutter="10">
<!-- <el-col :span="1.5">
<el-button
type="primary"
@click="calce"
:disabled="!handleSelect.length != 0"
>生成复盘</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
@click="generateThePlan"
:disabled="!handleSelect.length != 0"
>取消盘点</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="primary"
@click="quren"
:disabled="!handleSelect.length != 0"
>盘点确认</el-button>
</el-col>
</el-row>
</div>
</div>
<div class="layout-full">
<heavy-table
class="heavy-table tablem"
highlight-current-row
:data="tableData"
:paging="paging"
:config="tableConfig.configInventoryDifference"
:tableProps="tableProps"
@current-change="queryTable"
@handleselection="handleselection"
>
</heavy-table>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { tableConfig } from './config.js'
import { Debounce, getDictLabel } from '@/utils/index'
import { listUser } from '@/api/libraryManage/common'
import { differenceList, generatorCheckInv, confirm, cancel } from '@/api/libraryManage/inventory'
export default {
name: 'Inventory',
dicts: ['goods_unit', 'inv_type_dict'],
computed: {
...mapGetters(['user'])
},
data() {
return {
options2: [], // 当前用户
enterForm: {
invOrderNo: '',
userName: ''
},
tableData: [],
handleSelect: [],
tableConfig: {},
tableProps: {},
paging: {
page: 1, // 当前页
size: 10, // 页面大小
total: 0
}
}
},
mounted() {},
async created() {
this.tableConfig = await this.getTableHeaderCom('busin_inventory_different', tableConfig.call(this), 'configInventoryDifference')
await this.getList()
this.queryTable()
},
methods: {
/** 查询用户列表 */
async getList() {
listUser({}).then((response) => {
this.options2 = response.data
this.enterForm.userName = this.user.userName
})
},
// 表格复选框选中
handleselection(val) {
this.handleSelect = val.map((ele) => ele.id)
},
// 重置
resetQuery() {
this.enterForm = {}
},
// 表格的数据
queryTable() {
this.loading = true
differenceList({
pageSize: this.paging.size,
pageNum: this.paging.page,
...this.enterForm
})
.then((response) => {
if (response.code === 200) {
this.loading = false
this.paging.total = response.total
this.tableData = response.rows
}
})
.catch(() => {
this.loading = false
})
},
// 确认
quren() {
let obj = {
userName: this.enterForm.userName,
ids: this.handleSelect
}
confirm(obj)
.then((response) => {
if (response.code === 200) {
this.loading = false
this.$message({
message: '操作成功!',
type: 'success'
})
this.queryTable()
}
})
.catch(() => {
this.loading = false
})
},
// 生成复盘
calce() {
let obj = {
userName: this.enterForm.userName,
ids: this.handleSelect
}
generatorCheckInv(obj)
.then((response) => {
if (response.code === 200) {
this.loading = false
this.$message({
message: '操作成功!',
type: 'success'
})
this.queryTable()
}
})
.catch(() => {
this.loading = false
})
},
// 取消盘点
generateThePlan() {
this.$confirm('是否确认删除所选明细?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.remove()
})
},
// 取消盘点请求
remove() {
cancel(this.handleSelect)
.then((response) => {
if (response.code === 200) {
this.loading = false
this.$message({
message: '操作成功!',
type: 'success'
})
this.queryTable()
}
})
.catch(() => {
this.loading = false
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped></style>