Browse Source

开发库存管理——盘库的前端相关页面

master
yunuo970428 3 years ago
parent
commit
928bdead03
  1. 240
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/panku/pankuAdd.vue
  2. 305
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/panku/pankuguanli.vue

240
anrui-scm/anrui-scm-ui/src/views/kucunguanli/panku/pankuAdd.vue

@ -0,0 +1,240 @@
<template>
<div class="app-container">
<div v-show="viewState== 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="wlInfo"><span>盘库操作</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<el-row>
<el-col :span="12">
<div class="span-sty spanOneWidth"><span>存放地点:</span></div>
<el-form-item>
<el-select v-model="formobj.warehouse" placeholder="请选择" filterable clearable class="addinputwOne">
<el-option v-for="item in warehouse_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<div class="span-sty spanOneWidth"><span>盘库人员:</span></div>
<el-form-item>
<el-select v-model="formobj.staff" placeholder="请选择" filterable clearable class="addinputwOne">
<el-option v-for="item in staff_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" style="border-bottom: 0px !important;">
<div class="span-sty spanOneWidth"><span>车架号:</span></div>
<el-form-item>
<el-input v-model="formobj.vinNo" placeholder="" clearable style="width: 30%" class="addinputwOne"/>
</el-form-item>
</el-col>
<el-col :span="12" style="border-bottom: 0px !important;">
<div class="span-sty spanOneWidth"></div>
<el-form-item>
<el-button type="primary" style="margin-left: 270px" size="small">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="listtop">
<div class="tit">库存车辆列表</div>
</div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;">
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toEdit(scope.row)">确认</el-button>
</template>
</el-table-column>
<el-table-column label="车架号" width="140px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleVersion }}</span>
</template>
</el-table-column>
<el-table-column label="合格证" width="140px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleVersion }}</span>
</template>
</el-table-column>
<el-table-column label="所在仓库" align="center" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.engineTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="上次盘库日期" align="center" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
<el-table-column label="上次盘库人员" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="130px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="130px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/weishoumaiduan/unsold'
import { typeValues } from '@/api/cheliang/dictcommons'
export default {
name: 'pankuAdd',
data() {
return {
viewTitle: '盘库操作',
listLoading: false,
viewState: 1,
index: 0,
tableKey: 0,
list: [],
warehouse_list: [],
staff_list: [],
//
formobj: {
sid: '', // sid
applicationName: window.sessionStorage.getItem('name'),
createTime: '',
reason: '',
userSid: window.sessionStorage.getItem('userSid'),
detailsList: []
},
rules: {},
submitdisabled: false
}
},
methods: {
init() {
typeValues({ type: 'warehouse' }).then((res) => {
if (res.success) {
this.warehouse_list = res.data
}
})
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
console.log('编辑回显', row.sid)
req.fetchBySid(row.sid).then((resp) => {
const data = resp.data
this.formobj.applicationName = data.applicationName
this.formobj.sid = data.sid
this.formobj.reason = data.reason
this.formobj.createTime = data.createTime
this.formobj.detailsList = data.voList
}).catch((e) => {
this.formobj = row
})
},
save() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.formobj = {
sid: '', // sid
applicationName: window.sessionStorage.getItem('name'),
createTime: '',
reason: '',
userSid: window.sessionStorage.getItem('userSid'),
detailsList: []
}
this.$refs['form_obj'].resetFields()
this.$refs['divVehicle'].getList()
this.$emit('doback')
},
closePage() {
this.viewState = 1
}
}
}
</script>
<style scoped>
.wlInfo {
text-align: center;
font-size: 28px;
line-height: 90px;
}
/deep/ .el-row {
border-left: 0px;
}
/deep/ .el-col {
border-right: 0px !important;
}
.spanOneWidth {
width: 260px !important;
border-right: 0px !important;
}
.addinputwOne {
margin-left: 270px !important;
padding: 5px 0px;
}
.listtop {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #dfe4ed;
height: 40px;
}
.tit {
margin-bottom: -10px;
}
.pagination {
margin-bottom: -10px;
}
</style>

305
anrui-scm/anrui-scm-ui/src/views/kucunguanli/panku/pankuguanli.vue

@ -0,0 +1,305 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div v-show="viewState == 1">
<button-bar view-title="盘库记录查询" ref="btnbar" :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 ref="listQueryform" :inline="true" :model="listQuery" class="tab-header">
<el-form-item label="最新盘库日期">
<div class="block" style="float: left;">
<el-date-picker v-model="listQuery.params.warehousingStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</div>
<div style="float: left;margin: 0px 10px"></div>
<div class="block" style="float: left;">
<el-date-picker v-model="listQuery.params.warehousingEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</div>
</el-form-item>
<el-form-item label="车架号">
<el-input v-model="listQuery.params.mNum" placeholder="请输入车型" clearable/>
</el-form-item>
<el-form-item label="仓库">
<el-input v-model="listQuery.params.mNum" placeholder="请输入车型" clearable/>
</el-form-item>
<el-form-item label="状态">
<el-input v-model="listQuery.params.mNum" placeholder="请输入车型" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" @click="handleFilter" size="small">查询</el-button>
<el-button type="primary" @click="handleReset" size="small">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">盘库记录列表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;">
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toEdit(scope.row)">保存</el-button>
</template>
</el-table-column>
<el-table-column label="车架号" width="140px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleVersion }}</span>
</template>
</el-table-column>
<el-table-column label="合格证" width="140px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleVersion }}</span>
</template>
</el-table-column>
<el-table-column label="最新盘库日期" align="center" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.engineTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="最新仓库" align="center" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
<el-table-column label="最新盘库人员" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="130px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="130px">
<template slot-scope="scope">
<span>{{ scope.row.vehicleTypeCode }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<pankuAdd v-show="viewState == 2" ref="divAdd" @doback="resetState"/>
</div>
</template>
<script>
import { pagerList } from '@/api/cheliang/basevehiclemodel'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import req from '@/api/anruiscm/scmmaterial'
import pankuAdd from './pankuAdd'
export default {
name: 'pankuguanli',
components: {
Pagination,
pageye,
ButtonBar,
pankuAdd
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toAdd',
btnLabel: '生成盘库记录'
},
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'doDel',
btnLabel: '盘库'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
viewState: 1,
// -----------
tableKey: 0,
list: [],
FormLoading: false,
listLoading: false,
listQuery: {
params: {
carBrand: '',
vehicleType: '',
productLine: '',
driveForm: '',
power: '',
vehicleVersion: '',
fuelType: '',
vehicleTypeCode: '',
gearboxType: '',
emissionStandard: '',
engineType: '',
marketSegments: '',
specifications: ''
},
current: 1,
size: 10,
total: 0
},
rules: {}
}
},
created() {
//
this.getList()
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doImport':
this.doImport()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
pagerList(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (
response.success &&
response.data &&
response.data.total > 0
) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery = {
params: {
carBrand: '',
vehicleType: '',
productLine: '',
driveForm: '',
power: '',
vehicleVersion: '',
fuelType: '',
vehicleTypeCode: '',
gearboxType: '',
emissionStandard: '',
engineType: '',
marketSegments: '',
specifications: ''
},
current: 1,
size: 10,
total: 0
}
this.getList()
},
toAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd()
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.btn {
padding: 15px 0 15px 0;
border: 1px solid #e0e3eb;
}
.tab-header {
background-color: #edf1f7;
padding: 8px 20px;
margin-bottom: 0 !important;
}
.tab-header /deep/ .el-form-item {
margin-bottom: 10px;
}
.listtop {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #dfe4ed;
height: 40px;
}
.tit {
margin-bottom: -10px;
}
.pagination {
margin-bottom: -10px;
}
</style>
Loading…
Cancel
Save