Browse Source

完善盘点管理--商品盘点明细

master
yunuo970428 2 months ago
parent
commit
7689ff2de5
  1. 468
      yxt-as-ui/src/views/storage/stocktaking/stocktakingInfo.vue

468
yxt-as-ui/src/views/storage/stocktaking/stocktakingInfo.vue

@ -1,43 +1,44 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="商品盘点明细" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<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>
<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="queryParams.params.warehouseName" placeholder="请选择仓库"
@change="selectWarehouseChange">
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName"
:value="item.sid" />
<el-select v-model="queryParams.params.warehouseSid" filterable clearable placeholder="请选择" style="width:100%">
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="区域">
<el-select v-model="queryParams.params.warehouseZoneSid" filterable clearable placeholder="请选择" @focus="getWarehouseZoneList">
<el-option v-for="item in warehouseZoneList" :key="item.sid" :label="item.zoneName" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="库区">
<el-select v-model="queryParams.params.warehouseAreaName" placeholder="请选择库区"
@change="selectWarehouseAreaChange">
<el-option v-for="item in warehouseAreaList" :key="item.sid" :label="item.areaName"
:value="item.sid" />
<el-select v-model="queryParams.params.warehouseAreaSid" filterable clearable placeholder="请选择" @focus="getWareAreaList">
<el-option v-for="item in warehouseAreaList" :key="item.sid" :label="item.areaName" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="库位">
<el-select v-model="queryParams.params.warehouseRackName" placeholder="请选择库位">
<el-option v-for="item in warehouseRackList" :key="item.sid" :label="item.rackName"
:value="item.sid">
<el-select v-model="queryParams.params.warehouseRackSid" filterable clearable placeholder="请选择" style="width:100%" @focus="getWarehouseRackList">
<el-option v-for="item in warehouseRackCodeList" :key="item.sid" :label="item.rackCode" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品ID">
<el-input v-model="queryParams.params.goodsID" placeholder="" clearable />
<el-input v-model="queryParams.params.goodsID" placeholder="" clearable/>
</el-form-item>
<el-form-item label="商品名称">
<el-input v-model="queryParams.params.goodsSkuTitle" placeholder="" clearable />
<el-input v-model="queryParams.params.goodsSkuTitle" placeholder="" clearable/>
</el-form-item>
<el-form-item label="商品图号">
<el-input v-model="queryParams.params.goodsSkuCode" placeholder="" clearable />
<el-input v-model="queryParams.params.goodsSkuCode" placeholder="" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
@ -59,6 +60,7 @@
<el-table-column prop="goodsSkuTitle" label="商品名称" width="120" align="center" />
<el-table-column prop="goodsSkuCode" label="图号" width="120" align="center" />
<el-table-column prop="warehouseName" label="仓库" width="120" align="center" />
<el-table-column prop="warehouseZoneName" label="区域" width="120" align="center" />
<el-table-column prop="warehouseArea" label="库区" width="120" align="center" />
<el-table-column prop="warehouseRackName" label="库位" width="120" align="center" />
<el-table-column prop="unit" label="单位" width="120" align="center" />
@ -75,300 +77,206 @@
<el-table-column prop="remarks" label="备注" align="center" width="200" />
<el-table-column label="附件" align="center">
<template slot-scope="scope">
<div style="color: #1890FF; text-decoration: underline ;" @click="showImage(scope.row.fillPaths)">
查看
</div>
<span class="bluezi" @click="showImage(scope.row.fillPaths)">查看</span>
</template>
</el-table-column>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/>
</div>
</div>
</div>
<el-dialog title="附件" :visible.sync="dialogVisible" :before-close="handleClose">
<el-form ref="dataForm1" class="formadd" style="margin-top: -30px;">
<el-row class="first_row">
<el-col :span="24" class="trightb">
<el-image style="width: 120px;height: 120px; margin: 10px; background: #f0f;"
v-for="(item,index) in fileList" :src="item.url" :preview-src-list="[item]">
</el-image>
</el-col>
</el-row>
</el-form>
<el-image style="width: 120px;height: 120px" v-for="(item, index) in fileList" :key="index" :src="item.url" :preview-src-list="item" />
</el-dialog>
</div>
</template>
<script>
import req from '@/api/storage/stocktaking.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import req2 from '@/api/warehouse/warehouse.js'
import req3 from '@/api/warehouse/warehouseArea.js'
import req4 from '@/api/warehouse/goodsShelves.js'
export default {
components: {
ButtonBar,
Pagination,
pageye,
},
data() {
return {
dialogVisible: false,
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
import req from '@/api/storage/stocktaking.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import { getAllRackByKQSid, getAllWarehouse, getAllWarehouseareaByZoneSid, getAllWarehousezoneBysid } from '@/api/Common/dictcommons'
export default {
components: {
ButtonBar,
Pagination
},
data() {
return {
dialogVisible: false,
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
"billSid": "",
"warehouseSid": "",
"warehouseName": "",
"warehouseAreaSid": "",
"warehouseAreaName": "",
"warehouseRackSid": "",
"goodsID": "",
"goodsSkuTitle": "",
"goodsSkuCode": ""
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
billSid: '',
warehouseSid: '',
warehouseName: '',
warehouseZoneSid: '',
warehouseAreaSid: '',
warehouseRackSid: '',
goodsID: '',
goodsSkuTitle: '',
goodsSkuCode: ''
}
},
billSid: '',
fileList: [],
warehouseList: [],
warehouseZoneList: [],
warehouseAreaList: [],
warehouseRackList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
initData() {
getAllWarehouse({ orgPath: window.sessionStorage.getItem('defaultOrgPath'), warehouseTypeValue: '配件库' }).then(resp => {
this.warehouseList = resp.data
})
},
getWarehouseZoneList() {
if (this.queryParams.params.warehouseSid !== '') {
getAllWarehousezoneBysid({ ckSid: this.queryParams.params.warehouseSid }).then((res) => {
if (res.success) {
this.warehouseZoneList = res.data
}
},
billSid: "",
fileList: [],
warehouseList: [],
warehouseAreaList: [],
warehouseRackList: []
})
} else {
this.warehouseZoneList = []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
getWareAreaList() {
if (this.queryParams.params.warehouseZoneSid !== '') {
getAllWarehouseareaByZoneSid({ qySid: this.queryParams.params.warehouseZoneSid }).then((res) => {
if (res.success) {
this.wareAreaList = res.data
}
})
} else {
this.wareAreaList = []
}
},
methods: {
initData() {
var parpams = {
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
}
req2.getAllWarehouse(parpams).then(resp => {
this.warehouseList = resp.data
getWarehouseRackList() {
if (this.queryParams.params.warehouseAreaSid !== '') {
getAllRackByKQSid({ kqSid: this.queryParams.params.warehouseAreaSid }).then((res) => {
if (res.success) {
this.warehouseRackList = res.data
}
})
},
getWarehouseArea(sid) {
this.queryParams.params.warehouseAreaSid = ''
this.queryParams.params.warehouseAreaName = ''
var params = {
ckSid: sid
}
req3.getAllWarehouseareaBysid(params).then(resp => {
console.log('>>>>>>>>>getAllWarehousearea', resp)
this.warehouseAreaList = resp.data
}).catch(() => {})
},
getAllTypeByAreaSid(sid) {
this.queryParams.params.warehouseRackSid = ''
this.queryParams.params.warehouseRackName = ''
var params = {
areaSid: sid
}
req4.getAllTypeByAreaSid(params).then(resp => {
console.log('>>>>>>>>>getAllTypeByAreaSid', resp)
this.warehouseRackList = resp.data
}).catch(() => {})
},
selectWarehouseChange(val) {
const choose = this.warehouseList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseChange', choose)
this.queryParams.params.warehouseSid = choose[0].sid
this.queryParams.params.warehouseName = choose[0].warehouseName
this.getWarehouseArea(choose[0].sid)
},
selectWarehouseAreaChange(val) {
const choose = this.warehouseAreaList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseAreaChange', choose)
this.queryParams.params.warehouseAreaSid = choose[0].sid
this.queryParams.params.warehouseAreaName = choose[0].areaName
this.getAllTypeByAreaSid(choose[0].sid)
},
selectWarehouseRackChange(val) {
const choose = this.warehouseRackList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseRackChange', choose)
this.queryParams.params.warehouseRackSid = choose[0].sid
this.queryParams.params.warehouseRackName = choose[0].rackName
},
showImage(paths) {
this.fileList = paths
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.warehouseRackList = []
}
},
showImage(paths) {
this.fileList = paths
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'doClose':
this.close()
break
default:
break
}
},
showDetail(sid) {
this.initData()
this.billSid = sid
this.queryParams.params.billSid = sid
this.loadList()
},
loadList() {
this.tableLoading = true
req.billDetail(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
this.searchxianshitit = '显示查询条件'
// resp.code
this.dataList = []
this.queryParams.total = 0
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'doClose':
this.close()
break
default:
break
}
},
showDetail(sid) {
this.initData()
this.billSid = sid
this.queryParams.params.billSid = sid
this.loadList()
},
loadList() {
this.tableLoading = true
req.billDetail(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
"billSid": this.billSid,
"warehouseSid": "",
"warehouseName": "",
"warehouseAreaSid": "",
"warehouseAreaName": "",
"warehouseRackSid": "",
"goodsID": "",
"goodsSkuTitle": "",
"goodsSkuCode": ""
}
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
billSid: this.billSid,
warehouseSid: '',
warehouseName: '',
warehouseZoneSid: '',
warehouseAreaSid: '',
warehouseRackSid: '',
goodsID: '',
goodsSkuTitle: '',
goodsSkuCode: ''
}
this.loadList()
},
close() {
this.$emit('doback')
},
}
this.loadList()
},
close() {
this.$emit('doback')
}
}
}
</script>
<style scoped>
/deep/ .el-form-item__error {
margin-left: 120px !important;
}
.must {
color: #f00;
}
.span-sty {
width: 90px !important;
}
.addinputInfo {
margin-left: 80px !important;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
margin-left: 80px !important;
width: calc(100% - 70px);
}
.first_row {
border-top: 1px solid #E0E3EB;
}
.titleOne {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
/deep/ .el-form-item__error {
margin-left: 180px !important;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group {
display: inline;
line-height: 1px;
vertical-align: middle;
}
.first_row {
border-top: 1px solid #E0E3EB;
}
</style>

Loading…
Cancel
Save