Browse Source

完善库存调整

master
myTest383 8 months ago
parent
commit
0daa238015
  1. 1
      src/views/baseInfo/warehouses/warehouse/index.vue
  2. 676
      src/views/storage/inventoryAdjust/inventoryAdjust/inventoryAdjust.vue
  3. 941
      src/views/storage/inventoryAdjust/inventoryDifferential/inventoryDifferential.vue
  4. 1
      src/views/storage/inventoryWarning/regionalWarning/regionalWarning.vue

1
src/views/baseInfo/warehouses/warehouse/index.vue

@ -141,6 +141,7 @@
this.sids = aa
},
//
clicksearchShow() {

676
src/views/storage/inventoryAdjust/inventoryAdjust/inventoryAdjust.vue

@ -1,26 +1,26 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库存调整管理" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="操作日期">
<el-date-picker v-model="listQuery.params.startTime" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
<el-date-picker v-model="listQuery.params.endTime" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="listQuery.params.billNo" placeholder="" clearable />
</el-form-item>
<!-- <el-form-item label="商品">
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库存调整管理" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="操作日期">
<el-date-picker v-model="listQuery.params.startTime" type="date" placeholder="选择日期" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
<el-date-picker v-model="listQuery.params.endTime" type="date" placeholder="选择日期" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="listQuery.params.billNo" placeholder="" clearable />
</el-form-item>
<!-- <el-form-item label="商品">
<el-select v-model="listQuery.params.goodsSkuSid" placeholder="请选择"
style="width: 200px;">
<el-option v-for="(item,i) in goodsList" :key="i" :label="item.title"
@ -28,339 +28,341 @@
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="调整类型">
<el-select v-model="listQuery.params.type" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in typeList" :key="i" :label="item.name"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作员">
<el-input v-model="listQuery.params.operator" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search"
@click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh"
@click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="createTime" label="操作日期" align="center" />
<el-table-column prop="typeValue" label="调整类型" align="center" />
<el-table-column prop="stateValue" label="调整状态" align="center" />
<el-table-column prop="billNo" label="单据编号" align="center" />
<el-table-column prop="warehouseName" label="仓库" align="center" />
<el-table-column prop="operator" label="操作员" align="center" />
<el-table-column prop="remarks" label="备注" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadList" />
</div>
<el-form-item label="调整类型">
<el-select v-model="listQuery.params.type" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in typeList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作员">
<el-input v-model="listQuery.params.operator" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="createTime" label="操作日期" align="center" />
<el-table-column prop="typeValue" label="调整类型" align="center" />
<el-table-column prop="stateValue" label="调整状态" align="center" />
<el-table-column prop="billNo" label="单据编号" align="center" />
<el-table-column prop="warehouseName" label="仓库" align="center" />
<el-table-column prop="operator" label="操作员" align="center" />
<el-table-column prop="remarks" label="备注" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadList" />
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/storage/inventoryAdjust/inventoryAdjust.js'
import req2 from '@/api/goods/goods.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './inventoryAdjustAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
import req from '@/api/storage/inventoryAdjust/inventoryAdjust.js'
import req2 from '@/api/goods/goods.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './inventoryAdjustAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'primary',
size: 'small',
icon: 'edit',
btnKey: 'toEdit',
btnLabel: '编辑'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
}, {
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"type": "",
"billNo": "",
"endTime": "",
"startTime": "",
"goodsSkuSid": "",
"operator": "",
}
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'primary',
size: 'small',
icon: 'edit',
btnKey: 'toEdit',
btnLabel: '编辑'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
}, {
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"type": "",
"billNo": "",
"endTime": "",
"startTime": "",
"goodsSkuSid": "",
"operator": "",
}
},
sids: [],
selectionList: [],
goodsList: [],
typeList: [{
sid: "1",
name: "数量调整"
}],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
// this.init()
},
methods: {
init() {
var query = {
orgPath: window.sessionStorage.getItem('orgSidPath')
}
req2.getGoodsListAllByOrg(query).then((res) => {
this.goodsList = res.data
})
},
sids: [],
selectionList: [],
goodsList: [],
typeList: [{
sid: "1",
name: "数量调整"
}],
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
// this.init()
},
methods: {
init() {
var query = {
orgPath: window.sessionStorage.getItem('orgSidPath')
}
req2.getGoodsListAllByOrg(query).then((res) => {
this.goodsList = res.data
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('orgSidPath')
this.listQuery.params.menuUrl = this.$route.path
req.listPage(this.listQuery).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.listQuery.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.listQuery.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('orgSidPath')
this.listQuery.params.menuUrl = this.$route.path
req.listPage(this.listQuery).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.listQuery.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.listQuery.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.listQuery.current = 1
this.loadList()
},
resetQuery() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"type": "",
"billNo": "",
"endTime": "",
"startTime": "",
"goodsSkuSid": "",
"operator": "",
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
selectionLineChangeHandle(val) {
console.log("val", val);
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.listQuery.current = 1
this.loadList()
},
resetQuery() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"type": "",
"billNo": "",
"endTime": "",
"startTime": "",
"goodsSkuSid": "",
"operator": "",
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
this.selectionList = val
},
toEdit() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
toEdit() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
// if (this.selectionList[0].checkState != 1) {
// this.$message({
// type: 'warning',
// message: ",",
// showClose: true
// })
// return
// }
// if (this.selectionList[0].checkState != 1) {
// this.$message({
// type: 'warning',
// message: ",",
// showClose: true
// })
// return
// }
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
toBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
toBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '出入库明细_' + this.listQuery.params.createDateStart + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
req.exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '出入库明细_' + this.listQuery.params.createDateStart + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBySids(this.sids).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
} else {
this.$message({
showClose: true,
message: '请至少选择一条记录进行删除操作'
})
}
},
resetState() {
this.viewState = 1
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBySids(this.sids).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
} else {
this.$message({
showClose: true,
message: '请至少选择一条记录进行删除操作'
})
}
},
resetState() {
this.viewState = 1
},
}
}
</script>
<style scoped>
</style>

941
src/views/storage/inventoryAdjust/inventoryDifferential/inventoryDifferential.vue

@ -1,31 +1,27 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库存差异量管理" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="仓库">
<el-select v-model="listQuery.params.warehouseSid" placeholder="请选择"
style="width: 200px;">
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品">
<el-select v-model="listQuery.params.goodsSkuSid" placeholder="请选择"
style="width: 200px;">
<el-option v-for="(item,i) in goodsList" :key="i" :label="item.title"
:value="item.sid">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="品牌">
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库存差异量管理" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="仓库">
<el-select v-model="listQuery.params.warehouseSid" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品">
<el-select v-model="listQuery.params.goodsSkuSid" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in goodsList" :key="i" :label="item.title" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="品牌">
<el-select v-model="listQuery.params.brandSid" placeholder="请选择" style="width: 200px;">
<el-option v-for="(item,i) in bankList" :key="i" :label="item.brandName"
:value="item.sid">
@ -39,461 +35,462 @@
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="差异量">
<el-input v-model="listQuery.params.start" placeholder="" clearable
style="width: 100px;" />
<el-input v-model="listQuery.params.end" placeholder="" clearable
style="width: 100px;" />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search"
@click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh"
@click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="goodsSkuTitle" label="商品名称" align="center" />
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
<el-table-column prop="goodsSkuCode" label="编码" align="center" />
<el-table-column prop="barCode" label="条码" align="center" />
<el-table-column prop="useCount" label="实际库存" align="center" />
<el-table-column prop="count" label="库存差异量" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadList" />
</div>
<el-form-item label="差异量">
<el-input v-model="listQuery.params.start" placeholder="" clearable style="width: 100px;" />
<el-input v-model="listQuery.params.end" placeholder="" clearable style="width: 100px;" />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<el-dialog title="库存调整" :visible.sync="dialogVisible" :before-close="handleClose">
<div class="listtop" style="margin-top: -30px;">
<div class="tit">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="rackNumList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="goodsSkuTitle" label="商品名称" align="center" />
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
<el-table-column prop="goodsSkuCode" label="编码" align="center" />
<el-table-column prop="barCode" label="条码" align="center" />
<el-table-column prop="useCount" label="实际库存" align="center" />
<el-table-column label="调整差异数量" align="center">
<template slot-scope="scope">
<el-input ref="focusAssumptionInput"
@keyup.native="scope.row.count = getNumber(scope.row.count, 0)"
v-model="scope.row.count" clearable placeholder="" />
</template>
</el-table-column>
</el-table>
</div>
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
<el-button type="primary" style="margin-top: 20px;" @click="handleClose"> </el-button>
<el-button type="primary" style="margin-top: 20px;" @click="saveData"> </el-button>
</div>
</el-dialog>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="goodsSkuTitle" label="商品名称" align="center" />
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
<el-table-column prop="goodsSkuCode" label="编码" align="center" />
<el-table-column prop="barCode" label="条码" align="center" />
<el-table-column prop="useCount" label="实际库存" align="center" />
<el-table-column prop="count" label="库存差异量" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<el-dialog title="库存调整" :visible.sync="dialogVisible" :before-close="handleClose">
<div class="listtop" style="margin-top: -30px;">
<div class="tit">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="rackNumList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="goodsSkuTitle" label="商品名称" align="center" />
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
<el-table-column prop="goodsSkuCode" label="编码" align="center" />
<el-table-column prop="barCode" label="条码" align="center" />
<el-table-column prop="rackCode" label="库位" align="center" />
<el-table-column prop="useCount" label="实际库存" align="center" />
<el-table-column label="调整差异数量" align="center">
<template slot-scope="scope">
<el-input ref="focusAssumptionInput" @keyup.native="scope.row.count = getNumber(scope.row.count, 0)"
v-model="scope.row.count" clearable placeholder="" />
</template>
</el-table-column>
</el-table>
</div>
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
<el-button type="primary" style="margin-top: 20px;" @click="handleClose"> </el-button>
<el-button type="primary" style="margin-top: 20px;" @click="saveData"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/storage/inventoryDifferential/inventoryDifferential.js'
import req2 from '@/api/goods/goods.js'
import req3 from '@/api/baseinfo/warehouse/warehouse.js'
import req4 from '@/api/goods/brand.js'
import req5 from '@/api/goods/category.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
components: {
ButtonBar,
Pagination,
pageye,
},
data() {
return {
btndisabled: false,
dialogVisible: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '库存调整'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"typeSid": "",
"brandSid": "",
"end": "",
"start": "",
"goodsSkuSid": "",
"warehouseSid": "",
}
},
sids: [],
selectionList: [],
warehouseList: [],
goodsList: [],
bankList: [],
typeList: [],
rackNumList: [],
itemInfo: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
import req from '@/api/storage/inventoryDifferential/inventoryDifferential.js'
import req2 from '@/api/goods/goods.js'
import req3 from '@/api/baseinfo/warehouse/warehouse.js'
import req4 from '@/api/goods/brand.js'
import req5 from '@/api/goods/category.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
export default {
components: {
ButtonBar,
Pagination,
pageye,
},
data() {
return {
btndisabled: false,
dialogVisible: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '库存调整'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"typeSid": "",
"brandSid": "",
"end": "",
"start": "",
"goodsSkuSid": "",
"warehouseSid": "",
}
},
created() {
sids: [],
selectionList: [],
warehouseList: [],
goodsList: [],
bankList: [],
typeList: [],
rackNumList: [],
itemInfo: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
this.init()
},
methods: {
init() {
var query = {
orgPath: window.sessionStorage.getItem('orgSidPath')
}
req2.getGoodsListAllByOrg(query).then((res) => {
if (res.success) {
this.goodsList = res.data
}
})
// req4.getAllBrand(query).then((res) => {
// if (res.success) {
// this.bankList = res.data
// }
// })
// req5.getAllType(query).then((res) => {
// if (res.success) {
// this.typeList = res.data
// }
// })
var parpams = {
orgPath: window.sessionStorage.getItem('orgSid'),
}
req3.getAllWarehouse(parpams).then(resp => {
this.warehouseList = resp.data
})
},
getNumber(val, limit) {
let value = val.replace(/[^\-\d.]/g, '') // .-
value = value.replace(/^\./g, '') //.
value = value.replace(/\.{2,}/g, '.') // .
value = value.replace(/(\.\d+)\./g, '$1') // ..
value = value.replace(/(-)\./g, '$1') // -.
value = value.replace(/\-{2,}/g, '-') // -
value = value.replace(/(\d+|\.)-/g, '$1') // .-,11-, 12.-
value = value.replace(/-(0){2,}/g, "$1") // -00,-001,-0001
value = value.replace(/(-)0+(\d+)/g, '$1$2') // -01,-02
value = value.replace(/^0+(\d)/, '$1') // 00
value = value.replace(/(\d{15})\d*/, '$1') // 15
value = value.replace(/(\.\d{2})\d*/, '$1') // 2
return value
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('orgSidPath')
this.listQuery.params.menuUrl = this.$route.path
req.listPage(this.listQuery).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.listQuery.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.listQuery.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.listQuery.current = 1
this.loadList()
},
resetQuery() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"typeSid": "",
"brandSid": "",
"end": "",
"start": "",
"goodsSkuSid": "",
"warehouseSid": "",
}
}
this.loadList()
},
toAdd() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
this.itemInfo = this.selectionList[0]
var data = {
goodsSkuSid: this.selectionList[0].goodsSkuSid,
rackSid: this.selectionList[0].rackSid,
orgSid: window.sessionStorage.getItem('orgSid'),
}
req.selAvailBySkuSid(data).then(resp => {
this.rackNumList = resp.data
this.dialogVisible = true
})
},
saveData() {
var total = 0
for (var i = 0; i < this.rackNumList.length; i++) {
var item = this.rackNumList[i]
if ((Number(item.useCount) + Number(item.count)) < 0) {
this.$message({
type: 'warning',
message: "调整后的实际库存不能为小于0。",
showClose: true
})
return
}
total += Number(item.count)
}
if (total != Number(this.itemInfo.count)) {
this.$message({
type: 'warning',
message: "调整总数量与差异总数量不一致。",
showClose: true
})
return
}
console.log("saveData", this.rackNumList);
var data = {
detailSid: this.itemInfo.sid,
list: this.rackNumList
}
req.saveOrUpdate(data).then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: '保存成功'
})
this.dialogVisible = false
this.loadList()
this.init()
},
methods: {
init() {
var query = {
orgPath: window.sessionStorage.getItem('orgSidPath')
}
req2.getGoodsListAllByOrg(query).then((res) => {
if (res.success) {
this.goodsList = res.data
}
})
// req4.getAllBrand(query).then((res) => {
// if (res.success) {
// this.bankList = res.data
// }
// })
// req5.getAllType(query).then((res) => {
// if (res.success) {
// this.typeList = res.data
// }
// })
var parpams = {
orgPath: window.sessionStorage.getItem('orgSid'),
}
req3.getAllWarehouse(parpams).then(resp => {
this.warehouseList = resp.data
})
},
getNumber(val, limit) {
let value = val.replace(/[^\-\d.]/g, '') // .-
value = value.replace(/^\./g, '') //.
value = value.replace(/\.{2,}/g, '.') // .
value = value.replace(/(\.\d+)\./g, '$1') // ..
value = value.replace(/(-)\./g, '$1') // -.
value = value.replace(/\-{2,}/g, '-') // -
value = value.replace(/(\d+|\.)-/g, '$1') // .-,11-, 12.-
value = value.replace(/-(0){2,}/g, "$1") // -00,-001,-0001
value = value.replace(/(-)0+(\d+)/g, '$1$2') // -01,-02
value = value.replace(/^0+(\d)/, '$1') // 00
value = value.replace(/(\d{15})\d*/, '$1') // 15
value = value.replace(/(\.\d{2})\d*/, '$1') // 2
return value
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('orgSidPath')
this.listQuery.params.menuUrl = this.$route.path
req.listPage(this.listQuery).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.listQuery.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.listQuery.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.listQuery.current = 1
this.loadList()
},
resetQuery() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
"menuUrl": "",
"orgPath": "",
"userSid": "",
"typeSid": "",
"brandSid": "",
"end": "",
"start": "",
"goodsSkuSid": "",
"warehouseSid": "",
}
}
this.loadList()
},
toAdd() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
this.itemInfo = this.selectionList[0]
var data = {
goodsSkuSid: this.selectionList[0].goodsSkuSid,
rackSid: this.selectionList[0].rackSid,
orgSid: window.sessionStorage.getItem('orgSid'),
}
req.selAvailBySkuSid(data).then(resp => {
this.rackNumList = resp.data
this.dialogVisible = true
})
},
saveData() {
var total = 0
for (var i = 0; i < this.rackNumList.length; i++) {
var item = this.rackNumList[i]
if ((Number(item.useCount) + Number(item.count)) < 0) {
this.$message({
type: 'warning',
message: "调整后的实际库存不能为小于0。",
showClose: true
})
return
}
total += Number(item.count)
}
if (total != Number(this.itemInfo.count)) {
this.$message({
type: 'warning',
message: "调整总数量与差异总数量不一致。",
showClose: true
})
return
}
console.log("saveData", this.rackNumList);
var data = {
detailSid: this.itemInfo.sid,
list: this.rackNumList
}
req.saveOrUpdate(data).then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: '保存成功'
})
this.dialogVisible = false
this.loadList()
}
})
},
handleClose() {
this.dialogVisible = false
},
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
},
toEdit() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
if (this.selectionList[0].checkState != 1) {
this.$message({
type: 'warning',
message: "此记录已完成,不可重复编辑。",
showClose: true
})
return
}
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
toBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '出入库明细_' + this.listQuery.params.createDateStart + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
}
})
},
handleClose() {
this.dialogVisible = false
},
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
toEdit() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
if (this.selectionList[0].checkState != 1) {
this.$message({
type: 'warning',
message: "此记录已完成,不可重复编辑。",
showClose: true
})
return
}
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
toBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '出入库明细_' + this.listQuery.params.createDateStart + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
}
}
</script>
<style scoped>
</style>

1
src/views/storage/inventoryWarning/regionalWarning/regionalWarning.vue

@ -209,6 +209,7 @@
typeList: [],
stateList: [{
name: "有",
sid: '1'
},
{

Loading…
Cancel
Save