|
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="button-wrap">
|
|
|
|
|
|
<Button type="primary" @click="editorChuku('','add','领用')">领用出库</Button>
|
|
|
|
|
|
<Button type="primary" @click="editorChuku('','add','处置')">处置出库</Button>
|
|
|
|
|
|
<Button type="primary" @click="editorChuku('','add','调令')">调令出库</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<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="经办人搜索" />
|
|
|
|
|
|
<Select v-model="select.chukuleixing" style="width: 200px;margin-right: 10px;" placeholder="出库类型" clearable>
|
|
|
|
|
|
<Option v-for="item in chukuTypeList" :key="item.id" :value="item.id">{{ item.value }}</Option>
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
<Button type="primary" @click="getindex">查询</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</slot>
|
|
|
|
|
|
</lx-header>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<xy-table
|
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
:list="list"
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
:table-item="table"
|
|
|
|
|
|
@pageSizeChange="e => select.pageSize = e"
|
|
|
|
|
|
@pageIndexChange="pageChange"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="300" header-align="center">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<template v-if="isCkName=='仓库管理员'||roleName=='系统管理员'">
|
|
|
|
|
|
<Button v-if="scope.row.zhuangtai==="已办结"" type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'outbounds')">出库</Button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-if="scope.row.jilurenyuan==authName||isCkName=='仓库管理员'||roleName=='系统管理员'">
|
|
|
|
|
|
<Button type="primary" size="small" style="margin-left: 10px;" @click="printChuku(scope.row.id,scope.row.chukuleixing)">打印</Button>
|
|
|
|
|
|
<!-- <template v-if="scope.row.jilurenyuan==authName||roleName=='系统管理员'"> -->
|
|
|
|
|
|
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'editor',scope.row.chukuleixing)">编辑</Button>
|
|
|
|
|
|
<Button v-if="scope.row.zhuangtai==="待处理"" type="primary" size="small" style="margin-left: 10px;" @click="tofollow(scope.row.id,scope.row)">请示流程</Button>
|
|
|
|
|
|
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)">
|
|
|
|
|
|
<Button type="error" style="margin-left: 10px;" size="small" ghost>删除</Button>
|
|
|
|
|
|
</Poptip>
|
|
|
|
|
|
<!-- </template> -->
|
|
|
|
|
|
</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" />
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
index,
|
|
|
|
|
|
destroy
|
|
|
|
|
|
} from '@/api/system/baseForm.js'
|
|
|
|
|
|
import {
|
|
|
|
|
|
getInfo
|
|
|
|
|
|
} from '@/api/user.js'
|
|
|
|
|
|
import {
|
|
|
|
|
|
getOutboundsStatus,
|
|
|
|
|
|
getOatoken
|
|
|
|
|
|
} from '@/api/contract.js'
|
|
|
|
|
|
import addoutbounds from './component/addoutbounds.vue'
|
|
|
|
|
|
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: {
|
|
|
|
|
|
addoutbounds,
|
|
|
|
|
|
imports,
|
|
|
|
|
|
printoutbounds
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
window: {
|
|
|
|
|
|
width: 0,
|
|
|
|
|
|
height: 0,
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
left: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
userName: '',
|
|
|
|
|
|
authName: '',
|
|
|
|
|
|
roleName: '',
|
|
|
|
|
|
isCkName: '',
|
|
|
|
|
|
select: {
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
pageIndex: 1,
|
|
|
|
|
|
keyword: '',
|
|
|
|
|
|
chukuleixing: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
chukuTypeList: [{
|
|
|
|
|
|
id: '领用',
|
|
|
|
|
|
value: '领用出库'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
id: '处置',
|
|
|
|
|
|
value: '处置出库'
|
|
|
|
|
|
}, {
|
|
|
|
|
|
id: '调令',
|
|
|
|
|
|
value: '调令出库'
|
|
|
|
|
|
}],
|
|
|
|
|
|
chukuType: '领用',
|
|
|
|
|
|
customForm: {
|
|
|
|
|
|
customFormId: '',
|
|
|
|
|
|
tableName: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
wuziguanli_oatoken: '',
|
|
|
|
|
|
form: [],
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
list: [],
|
|
|
|
|
|
table: [{
|
|
|
|
|
|
label: '序号',
|
|
|
|
|
|
type: 'index',
|
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
|
width: 80
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: '出库日期',
|
|
|
|
|
|
width: 180,
|
|
|
|
|
|
prop: 'chukushijian',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
fixed: 'left'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '状态',
|
|
|
|
|
|
width: 180,
|
|
|
|
|
|
prop: 'zhuangtai',
|
|
|
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '出库类型',
|
|
|
|
|
|
width: 180,
|
|
|
|
|
|
prop: 'chukuleixing',
|
|
|
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '借用仓库',
|
|
|
|
|
|
width: 180,
|
|
|
|
|
|
prop: 'jieyongcangku',
|
|
|
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '借用部门',
|
|
|
|
|
|
width: 180,
|
|
|
|
|
|
prop: 'jieyongbumen',
|
|
|
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '经办人',
|
|
|
|
|
|
width: 180,
|
|
|
|
|
|
prop: 'jilurenyuan',
|
|
|
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '备注',
|
|
|
|
|
|
prop: 'beizhu',
|
|
|
|
|
|
align: 'left'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
if (this.$route.path) {
|
|
|
|
|
|
const path = this.$route.path.split('_')[1]
|
|
|
|
|
|
const tableName = path == 'receive' ? 'lingyongchuku' : (path == 'disposition' ? 'baofeichuzhi' : 'yingjichuku')
|
|
|
|
|
|
getOutboundsStatus({
|
|
|
|
|
|
table: tableName
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
this.window.width = screen.availWidth * 0.95
|
|
|
|
|
|
this.window.height = screen.availHeight * 0.95
|
|
|
|
|
|
this.window.top = (window.screen.height - 30 - this.window.height) / 2
|
|
|
|
|
|
this.window.left = (window.screen.width - 10 - this.window.width) / 2
|
|
|
|
|
|
this.getUserName()
|
|
|
|
|
|
this.getindex()
|
|
|
|
|
|
getOatoken().then(res => {
|
|
|
|
|
|
this.wuziguanli_oatoken = res.oatoken
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
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 => {})
|
|
|
|
|
|
},
|
|
|
|
|
|
async getindex() {
|
|
|
|
|
|
this.loading = true
|
|
|
|
|
|
const res = await index({
|
|
|
|
|
|
page_size: this.select.pageSize,
|
|
|
|
|
|
page: this.select.pageIndex,
|
|
|
|
|
|
table_name: 'outbounds',
|
|
|
|
|
|
filter: [{ 'key': 'jilurenyuan', 'op': 'like', 'value': this.select.keyword },
|
|
|
|
|
|
{ 'key': 'chukuleixing', 'op': 'like', 'value': this.select.chukuleixing ? this.select.chukuleixing : '' }]
|
|
|
|
|
|
})
|
|
|
|
|
|
this.list = res.data
|
|
|
|
|
|
this.total = res.total
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
pageChange(e) {
|
|
|
|
|
|
this.select.pageIndex = e
|
|
|
|
|
|
this.getindex()
|
|
|
|
|
|
},
|
|
|
|
|
|
editorChuku(id, type, leixing) {
|
|
|
|
|
|
if (id) {
|
|
|
|
|
|
this.$refs['addoutbounds'].id = id
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$refs['addoutbounds'].authName = this.authName
|
|
|
|
|
|
this.$refs['addoutbounds'].isShow = true
|
|
|
|
|
|
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
|
|
|
|
|
|
},
|
|
|
|
|
|
async tofollow(id, row) {
|
|
|
|
|
|
console.log(row)
|
|
|
|
|
|
if (row.id_outbounds_items_outbounds_id_relation.length < 1) {
|
|
|
|
|
|
Message({
|
|
|
|
|
|
type: 'warning',
|
|
|
|
|
|
message: '请补充出库物资'
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
console.log(row)
|
|
|
|
|
|
// return
|
|
|
|
|
|
let wuzimingcheng = ''
|
|
|
|
|
|
let shuliang = ''
|
|
|
|
|
|
let guigexinghao = ''
|
|
|
|
|
|
row.id_outbounds_items_outbounds_id_relation.map(item => {
|
|
|
|
|
|
wuzimingcheng += item.zichanmingcheng + '、'
|
|
|
|
|
|
shuliang += item.jieyongshuliang + '、'
|
|
|
|
|
|
guigexinghao += item.guigexinghao + '、'
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const default_json = {
|
|
|
|
|
|
// 'yewukeshi':row.jieyongbumen,
|
|
|
|
|
|
// 'bianhao':row.chukushijian+'-'+row.id,
|
|
|
|
|
|
// 'wuzimingcheng':row.id_outbounds_items_outbounds_id_relation[0].zichanmingcheng,
|
|
|
|
|
|
// 'lingyongshijian':row.chukushijian,
|
|
|
|
|
|
// 'shuliang':row.id_outbounds_items_outbounds_id_relation[0].jieyongshuliang,
|
|
|
|
|
|
// 'xinghaoguige':row.id_outbounds_items_outbounds_id_relation[0].guigexinghao,
|
|
|
|
|
|
// 'jingbanren':row.jilurenyuan,
|
|
|
|
|
|
// 'beizhu':row.beizhu,
|
|
|
|
|
|
// 'gudingzichanbianhao':row.gudingzichanbianhao,
|
|
|
|
|
|
// 'baofeiyuanyin':row.baofeiyuanyin,
|
|
|
|
|
|
'wuzimingcheng': wuzimingcheng,
|
|
|
|
|
|
'shuliang': shuliang,
|
|
|
|
|
|
'xinghaoguige': guigexinghao,
|
|
|
|
|
|
'yewukeshi': row.jieyongbumen,
|
|
|
|
|
|
'bianhao': row.chukushijian + '-' + row.id,
|
|
|
|
|
|
'lingyongshijian': row.chukushijian,
|
|
|
|
|
|
'jingbanren': row.jilurenyuan,
|
|
|
|
|
|
'beizhu': row.beizhu,
|
|
|
|
|
|
'baofeiyuanyin': row.baofeiyuanyin,
|
|
|
|
|
|
'link_id': row.id
|
|
|
|
|
|
}
|
|
|
|
|
|
let typeid = ''
|
|
|
|
|
|
const typeObj = JSON.parse(process.env.VUE_APP_OA_URL_TYPE)
|
|
|
|
|
|
for (var k in typeObj) {
|
|
|
|
|
|
if (k == row.chukuleixing) {
|
|
|
|
|
|
typeid = parseInt(typeObj[k])
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// let res = await getOatoken()
|
|
|
|
|
|
// = this.chukuType=='领用'?31:(this.chukuType=='处置'?32:33)
|
|
|
|
|
|
// http://suzhouhedaooa.langye.net/admin/flow/create/31?username=admin&default_json={%22bianhao%22:%22100%22}
|
|
|
|
|
|
const url =
|
|
|
|
|
|
`${process.env.VUE_APP_OA_URL}/admin/flow/create/${typeid}?wuziguanli_oatoken=${this.wuziguanli_oatoken}&username=${this.userName}&default_json=${JSON.stringify(default_json)}`
|
|
|
|
|
|
const seeBuy = window.open(url, 'follow',
|
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
|
)
|
|
|
|
|
|
console.log(url)
|
|
|
|
|
|
},
|
|
|
|
|
|
deleteChuku(row) {
|
|
|
|
|
|
// return
|
|
|
|
|
|
destroy({
|
|
|
|
|
|
id: row.id,
|
|
|
|
|
|
table_name: 'outbounds',
|
|
|
|
|
|
destroy_relation: ['id_outbounds_items_outbounds_id_relation']
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
Message({
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
message: '删除成功'
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getindex()
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
.button-wrap{
|
|
|
|
|
|
button{
|
|
|
|
|
|
margin-right:10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|