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.

384 lines
12 KiB

4 months ago
<template>
<div>
6 months ago
<div class="button-wrap">
6 months ago
<Button type="primary" @click="editorChuku('','add','领用出库')"></Button>
<Button type="primary" @click="editorChuku('','add','处置出库')"></Button>
<Button type="primary" @click="editorChuku('','add','调令出库')"></Button>
4 months ago
</div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
6 months ago
<el-input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" />
<el-select v-model="select.chukuleixing" style="width: 200px;margin-right: 10px;" placeholder="出库类型" clearable>
<el-option v-for="item in chukuTypeList" :key="item.id" :value="item.id" :label="item.value"></el-option>
</el-select>
6 months ago
<el-select v-model="select.zhuangtai" style="width: 200px;margin-right: 10px;" placeholder="状态" clearable>
<el-option v-for="item in statusList" :key="item.id" :value="item.id" :label="item.value"></el-option>
</el-select>
6 months ago
<el-date-picker type="date" placeholder="发起日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.created_at" style="width: 200px;margin-right: 10px;" />
4 months ago
<el-date-picker type="date" placeholder="出库日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.chukushijian" style="width: 200px;margin-right: 10px;" />
<Button type="primary" @click="getindex"></Button>
</div>
</slot>
</lx-header>
</div>
6 months ago
<xy-table
v-loading="loading"
:list="list"
:total="total"
:table-item="table"
4 months ago
@pageSizeChange="e => select.pageSize = e"
6 months ago
@pageIndexChange="pageChange"
6 months ago
>
<template v-slot:zhuangtai>
6 months ago
<el-table-column label="状态" width="120" align="center" header-align="center">
6 months ago
<template slot-scope="scope">
<div v-for="item in statusList">
<el-tag :type="item.type" v-if="scope.row.zhuangtai==item.id">
{{ item.value }}
</el-tag>
</div>
</template>
</el-table-column>
4 months ago
</template>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="300" header-align="center">
2 years ago
<template slot-scope="scope">
2 years ago
<template v-if="scope.row.jilurenyuan==authName||isCkName=='仓库管理员'||roleName=='系统管理员'">
6 months ago
<!-- <Button v-if="scope.row.zhuangtai==='已办结'" type="primary" size="small" style="margin-left: 10px;" @click="printChuku(scope.row.id,scope.row.chukuleixing)"></Button>
6 months ago
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'editor',scope.row.chukuleixing)"></Button>
6 months ago
<Button v-if="scope.row.zhuangtai==='待处理'" type="primary" size="small" style="margin-left: 10px;" @click="toOaFollow(scope.row.id,scope.row.chukuleixing)"></Button>
4 months ago
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)">
<Button type="error" style="margin-left: 10px;" size="small" ghost>删除</Button>
6 months ago
</Poptip> -->
<template v-if="scope.row.zhuangtai==3 || scope.row.zhuangtai==1">
<Button style="margin-right: 10px;" type="primary" size="small"
@click="showChukuDetail(scope.row.id)">查看</Button>
</template>
<template v-else>
<Button v-if="scope.row.zhuangtai==0 || scope.row.zhuangtai==4" style="margin-right: 10px;" type="primary" size="small"
@click="editorChuku(scope.row.id,'editor',scope.row.chukuleixing)">编辑</Button>
<Button v-if="scope.row.zhuangtai==0 || scope.row.zhuangtai==4" style="margin-right: 10px;" type="primary" size="small"
6 months ago
@click="toOaFollow(scope.row,scope.row.chukuleixing)">发起流程</Button>
5 months ago
<!-- v-if="scope.row.zhuangtai==2 &&(isCkName=='仓库管理员'||roleName=='系统管理员')" -->
4 months ago
<Button style="margin-right: 10px;" type="primary" size="small"
6 months ago
@click="printChuku(scope.row.id)">确认出库</Button>
<Poptip v-if="scope.row.zhuangtai==0" transfer confirm title="确认要删除该出库记录?"
@on-ok="deleteChuku(scope.row)">
<Button type="error" size="small" ghost>删除</Button>
</Poptip>
</template>
4 months ago
</template>
</template>
</el-table-column>
</template>
</xy-table>
<addoutbounds ref="addoutbounds" @refresh="getindex" />
<printoutbounds ref="printoutbounds" @refresh="getindex" />
<imports ref="imports" :table-name="customForm.tableName" :form-info="form" @refresh="getindex" />
<showChuku ref="showChuku" @refresh="getindex"></showChuku>
</div>
</template>
<script>
import {
index,
destroy
6 months ago
} from '@/api/system/baseForm.js'
6 months ago
4 months ago
import {
delOutbounds
6 months ago
} from '@/api/outbounds.js'
6 months ago
import {
getInfo
} from '@/api/user.js'
import {
getOutboundsStatus,
getOatoken
4 months ago
} from '@/api/contract.js'
6 months ago
import addoutbounds from './component/addoutbounds.vue'
6 months ago
import showChuku from './component/showChuku.vue'
4 months ago
import printoutbounds from './component/printoutbounds.vue'
import {
Message
} from 'element-ui'
import imports from '@/views/component/imports.vue'
import {
index as fieldIndex
} from '@/api/system/customFormField'
import {
getparameter
} from '@/api/system/dictionary'
export default {
components: {
6 months ago
addoutbounds,
4 months ago
showChuku,
6 months ago
imports,
4 months ago
printoutbounds
},
data() {
6 months ago
return {
loading: false,
userName: '',
authName: '',
roleName: '',
4 months ago
isCkName: '',
select: {
pageSize: 10,
pageIndex: 1,
6 months ago
keyword: '',
6 months ago
chukuleixing: '',
6 months ago
zhuangtai:'',
6 months ago
created_at:'',
4 months ago
chukushijian:''
6 months ago
},
chukuTypeList: [{
6 months ago
id: '领用出库',
6 months ago
value: '领用出库'
}, {
6 months ago
id: '处置出库',
6 months ago
value: '处置出库'
}, {
6 months ago
id: '调令出库',
6 months ago
value: '调令出库'
}],
6 months ago
statusList:[{
id:0,
value:'待处理',
type:'info'
},{
id:1,
value:'待办结',
type:'warning'
},{
id:2,
value:'待出库',
type:''
},{
id:3,
value:'已出库',
type:'success'
},{
id:4,
value:'退回',
type:'danger'
4 months ago
}],
customForm: {
customFormId: '',
tableName: ''
6 months ago
},
4 months ago
wuziguanli_oatoken: '',
form: [],
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
6 months ago
fixed: 'left',
4 months ago
width: 80
}, {
label: '出库日期',
width: 180,
prop: 'chukushijian',
align: 'center',
fixed: 'left'
6 months ago
},
{
6 months ago
label: '出库类型',
6 months ago
width: 180,
6 months ago
prop: 'chukuleixing',
6 months ago
align: 'center'
},
{
6 months ago
label: '状态',
6 months ago
width: 180,
6 months ago
prop: 'zhuangtai',
6 months ago
align: 'center'
4 months ago
},
// {
// label: '借用仓库',
// width: 180,
// prop: 'jieyongcangku',
// align: 'center'
// },
{
label: '借用部门',
width: 180,
prop: 'jieyongbumen',
align: 'center'
},
{
label: '经办人',
width: 180,
6 months ago
prop: 'jilurenyuan',
4 months ago
align: 'center'
},
6 months ago
{
label: '出库详情',
width: 300,
prop: 'id_outbounds_items_outbounds_id_relation',
align: 'left',
customFn: (row) => {
if (row.id_outbounds_items_outbounds_id_relation.length > 0) {
return row.id_outbounds_items_outbounds_id_relation.map(item => {
return (<p> {item.wuzibianma}-{item.zichanmingcheng}
{item.guigexinghao ? '(' + item.guigexinghao + ')' : ''}
{item.jieyongshuliang}{item.jiliangdanwei}
</p>)
})
} else {
return
}
}
4 months ago
},
{
label: '备注',
prop: 'beizhu',
align: 'left'
6 months ago
},
{
label: '发起时间',
prop: 'created_at',
align: 'center',
width:180
4 months ago
}
]
}
},
6 months ago
mounted() {
6 months ago
// if (this.$route.path) {
// const path = this.$route.path.split('_')[1]
// const tableName = path == 'receive' ? 'lingyongchuku' : (path == 'disposition' ? 'baofeichuzhi' : 'yingjichuku')
// getOutboundsStatus({
// table: tableName
// })
// }
5 months ago
if(this.$route.query.oaType==='wuzi'){
this.editorChuku('','add',this.$route.query.chukuType)
}
4 months ago
this.getUserName()
6 months ago
this.getindex()
getOatoken().then(res => {
this.wuziguanli_oatoken = res.oatoken
})
4 months ago
},
6 months ago
methods: {
6 months ago
showChukuDetail(id){
this.$refs['showChuku'].id = id
this.$refs['showChuku'].isShow = true
},
6 months ago
async getUserName() {
getInfo().then(res => {
console.log('res', res)
this.userName = res.username
this.authName = res.name
for (var k of res.role) {
if (k.name == '系统管理员') {
this.roleName = k.name
}
if (k.name == '仓库管理员') {
this.isCkName = '仓库管理员'
}
}
}).catch(error => {})
4 months ago
},
6 months ago
async getindex() {
4 months ago
this.loading = true
const res = await index({
6 months ago
page_size: this.select.pageSize,
4 months ago
page: this.select.pageIndex,
table_name: 'outbounds',
6 months ago
filter: [{ 'key': 'jilurenyuan', 'op': 'like', 'value': this.select.keyword },
6 months ago
{ 'key': 'chukuleixing', 'op': 'like', 'value': this.select.chukuleixing ? this.select.chukuleixing : '' },
{ 'key': 'created_at', 'op': 'like', 'value': this.select.created_at ? this.select.created_at : '' },
6 months ago
{ 'key': 'chukushijian', 'op': 'like', 'value': this.select.chukushijian ? this.select.chukushijian : '' },
{
'key': 'zhuangtai',
'op': 'like',
'value': this.select.zhuangtai ? this.select.zhuangtai : (this.select.zhuangtai===0?0:'')
4 months ago
}]
6 months ago
4 months ago
})
this.list = res.data
6 months ago
this.total = res.total
4 months ago
this.loading = false
},
pageChange(e) {
6 months ago
this.select.pageIndex = e
4 months ago
this.getindex()
},
6 months ago
editorChuku(id, type, leixing) {
if (id) {
this.$refs['addoutbounds'].id = id
4 months ago
}
this.$refs['addoutbounds'].authName = this.authName
this.$refs['addoutbounds'].isShow = true
6 months ago
this.$refs['addoutbounds'].type = type
this.$refs['addoutbounds'].chukuType = leixing
},
// 打印
printChuku(id, leixing) {
this.$refs['printoutbounds'].id = id
this.$refs['printoutbounds'].chukuType = leixing
this.$refs['printoutbounds'].isShow = true
},
6 months ago
async toOaFollow(res, type) {
6 months ago
let typeid = ''
const typeObj = JSON.parse(process.env.VUE_APP_OA_URL_TYPE)
6 months ago
console.log("typeObj",typeObj,type)
6 months ago
for (var k in typeObj) {
6 months ago
if (k == type) {
6 months ago
typeid = parseInt(typeObj[k])
}
}
6 months ago
let default_json = {
outbounds_id:res.id,
chukuriqi:res.chukushijian,
jieyongbumen:res.jieyongbumen,
jingbanren:res.jilurenyuan,
beizhu:res.beizhu,
wuzixinxidan:res.zuozhengwenjian.join(',')
// jieyongcangku:''
}
6 months ago
const url =
6 months ago
`${process.env.VUE_APP_OA_URL}/admin/flow/create/${typeid}?wuziguanli_oatoken=${this.wuziguanli_oatoken}&&outbounds_id=${res.id}&default_json=${JSON.stringify(default_json)}`
6 months ago
const seeBuy = window.open(url, '_blank')
5 months ago
if(this.$route.query.oaType==='wuzi'){
window.history.back()
}
4 months ago
},
deleteChuku(row) {
// return
delOutbounds({
id: row.id,
6 months ago
// table_name: 'outbounds',
4 months ago
// destroy_relation: ['id_outbounds_items_outbounds_id_relation']
}).then(res => {
Message({
type: 'success',
message: '删除成功'
})
this.getindex()
})
}
}
}
</script>
6 months ago
<style scoped lang="scss">
.button-wrap{
button{
margin-right:10px;
}
4 months ago
}
3 years ago
</style>