master
lion 3 years ago
parent d338558464
commit 3e1cdec1a0

@ -40,6 +40,11 @@ export const constantRoutes = [{
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
{
path: '/stocks',
component: () => import('@/views/stocks/index'),
hidden: true
},
{
path: '/info',

@ -0,0 +1,282 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增入库' : '编辑入库'" :form="form" :rules="rules" @submit="submit">
<template v-slot:bianhao>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>编号
</div>
<div class="xy-table-item-content">
<el-input v-model="form.bianhao" placeholder="请输入编号" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:zhuangtai>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>状态
</div>
<div class="xy-table-item-content">
<el-input v-model="form.zhuangtai" placeholder="请输入状态" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:rukushijian>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库时间
</div>
<div class="xy-table-item-content">
<el-input v-model="form.rukushijian" placeholder="请输入入库时间" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:jingbanren>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>经办人
</div>
<div class="xy-table-item-content">
<el-input v-model="form.jingbanren" placeholder="请输入经办人" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:jilurenyuan>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>记录人员
</div>
<div class="xy-table-item-content">
<el-input v-model="form.jilurenyuan" placeholder="请输入记录人员" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:baoguanrenyuan>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>保管人员
</div>
<div class="xy-table-item-content">
<el-input v-model="form.baoguanrenyuan" placeholder="请输入保管人员" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:beizhu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="form.beizhu" placeholder="请输入备注" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:rukumingxi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库明细
</div>
<div class="xy-table-item-content">
<Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="mingxiList.push({ wuzibianma:'',shuliang:'',pici:'',rukubiaodan:''})">新增入库明细</Button>
<xy-table style="width: 620px" :height="260" :is-page="false" :list="mingxiList"
:table-item="mingxiTable">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost
@click="mingxiList.splice(scope.$index, 1)">删除</Button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {save} from "@/api/system/baseForm.js"
import { Message } from 'element-ui'
export default {
data() {
return {
isShow:false,
type:'add',
id:'',
form:{
bianhao:"",
zhuangtai:'',
rukushijian:'',
jingbanren:"",
jilurenyuan:'',
baoguanrenyuan:'',
beizhu:'',
rukumingxi:''
},
rules:{
},
mingxiList:[],
mingxiTable: [{
label: "物资编码",
prop: "wuzibianma",
width: 200,
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写物资编码"
v-model={row.wuzibianma}>
</el-input>
)
}
},{
label: "数量",
prop: "wuzibianma",
width: 200,
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写数量"
v-model={row.shuliang}>
</el-input>
)
}
},{
label: "批次",
prop: "wuzibianma",
width: 200,
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写批次"
v-model={row.pici}>
</el-input>
)
}
},{
label: "入库表单",
prop: "rukubiaodan",
width: 200,
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写入库表单"
v-model={row.wuzibianma}>
</el-input>
)
}
}]
}
},
created(){
},
methods: {
async getDetail(){
const res = await show({id:this.id})
this.form = {
}
},
submit(){
if(this.type === 'add'){
save(this.form).then(res => {
Message({
type:'success',
message:'新增成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if(this.type === 'editor'){
save({
id:this.id,
...this.form
}).then(res => {
Message({
type:'success',
message:'编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
}
}
},
watch:{
isShow(newVal){
if(newVal){
if(this.type === 'editor'){
this.getDetail()
}
}else{
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label{
width: 160px;
}
.img__delete{
transform: scale(0.8,0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon{
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .xy-table-item-label{
width: 160px !important;
}
::v-deep .el-date-editor .el-range-separator{
width: auto !important;
}
::v-deep .el-input-number .el-input__inner{
text-align: left !important;
}
</style>

@ -0,0 +1,191 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="入库管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getActivities"></Button> -->
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add'">添加</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:list="list"
:total="total"
@pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<!-- <Button type="primary" size="small" @click="editorActivity(scope.row.id,'editor')"></Button>
<Button style="margin-left: 10px;" type="primary" size="small" @click="checkActivity(scope.row.id)"></Button>
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorActivity(scope.row.id,'copy')"></Button> -->
<Poptip
transfer
confirm
title="确认要删除吗?"
@on-ok="deleteRuku(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
<addRuku ref="addRuku"></addRuku>
</div>
</template>
<script>
import {index,destory} from "@/api/system/baseForm.js"
import addRuku from "./component/addRuku.vue"
import { Message } from 'element-ui'
export default {
components:{
addRuku
},
data() {
return {
select:{
pageSize:10,
pageIndex:1,
keyword:""
},
total:0,
list:[],
table:[
{
label:"编号",
width: 220,
prop:'bianhao',
align:'left',
fixed:'left',
},
{
label:"状态",
width: 220,
prop:'zhuangtai',
align:'center',
// formatter:(cell,data,value)=>{
// if(cell.merchant){
// return cell.merchant.username
// }else{
// return ""
// }
// }
},
{
label:"入库时间",
width: 180,
prop:'rukushijian',
align:'center',
// formatter:(cell,data,value)=>{
// return value==0 ? '':(value==1 ?'':'')
// }
},
{
label:"经办人",
width: 120,
prop:'jingbanren',
align:'center',
// customFn: (row) => {
// return ( <input class = 'sortinput el-input__inner'
// type='number'
// on = {
// {
// ["keyup"]: (e) => (this.updateSort(e, row.id, row))
// }
// }
// value = {
// row.sort
// }> </input>
// )
// }
},
{
label:"记录人员",
width: 220,
prop:'jilurenyuan',
align:'left',
// customFn:(row)=>{
// if(row.company_ids){
// let companys = JSON.parse(row.company_ids)
// return(
// <div>
// {
// companys.map((item,index)=>{
// return(
// <div>{item['type_name']}:{item['name']}</div>
// )
// })
// }
// </div>
// )
// }
// }
},
// {
// label:"",
// width: 140,
// prop:'sponsor'
// },
{
label:"保管人员",
width: 140,
prop:'baoguanrenyuan',
// customFn:(row)=>{
// if(row.sponsor_logo){
// return (<el-image style={{'height':'90px'}} src={row.sponsor_logo}></el-image>)
// }
// }
},
{
label:"备注",
width: 200,
prop:'beizhu',
align:'left'
}
]
}
},
methods: {
async getindex(){
const res = await index({
rows:this.select.pageSize,
page:this.select.pageIndex,
table_name:'stocks',
keyword:this.select.keyword
})
this.list = res.data
this.total = res.total
},
pageChange(e){
this.select.pageIndex = e
},
deleteRuku(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除成功'
})
this.getindex()
})
}
},
mounted() {
this.getindex()
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save