|
|
|
|
<template>
|
|
|
|
|
<div style="padding: 0 20px">
|
|
|
|
|
|
|
|
|
|
<div ref="lxHeader">
|
|
|
|
|
<lx-header icon="md-apps" :text="`${chukuType}出库管理`" 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="getindex">查询</Button>
|
|
|
|
|
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
|
|
|
|
|
@click="$refs['addoutbounds'].isShow = true,$refs['addoutbounds'].type = 'add',$refs['addoutbounds'].chukuType = chukuType">添加</Button>
|
|
|
|
|
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
|
|
|
|
|
@click="$refs['imports'].show()">导入</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="editorRuku(scope.row.id,'editor')">编辑</Button>
|
|
|
|
|
<!-- <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>
|
|
|
|
|
<addoutbounds ref="addoutbounds" @refresh="getindex"></addoutbounds>
|
|
|
|
|
|
|
|
|
|
<imports :table-name="customForm.tableName" :form-info="form" ref="imports" @refresh="getindex"></imports>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
index,
|
|
|
|
|
destroy
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
import addoutbounds from "./component/addoutbounds.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
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
select: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageIndex: 1,
|
|
|
|
|
keyword: ""
|
|
|
|
|
},
|
|
|
|
|
chukuType:'领用',
|
|
|
|
|
customForm: {
|
|
|
|
|
customFormId: "",
|
|
|
|
|
tableName: ""
|
|
|
|
|
},
|
|
|
|
|
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: 'chukuleixing',
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "借用仓库",
|
|
|
|
|
width: 180,
|
|
|
|
|
prop: 'jieyongcangku',
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "借用部门",
|
|
|
|
|
width: 180,
|
|
|
|
|
prop: 'jieyongbumen',
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "借用人",
|
|
|
|
|
width: 180,
|
|
|
|
|
prop: 'jieyongren',
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "记录人员",
|
|
|
|
|
width: 180,
|
|
|
|
|
prop: 'jilurenyuan',
|
|
|
|
|
align:'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "备注",
|
|
|
|
|
prop: 'beizhu',
|
|
|
|
|
align: 'left'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getindex() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page_size: this.select.pageSize,
|
|
|
|
|
page: this.select.pageIndex,
|
|
|
|
|
table_name: 'outbounds',
|
|
|
|
|
filter:[{"key":"jieyongren","op":"like","value":this.select.keyword},
|
|
|
|
|
{"key":"chukuleixing","op":"like","value":this.chukuType}],
|
|
|
|
|
})
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
pageChange(e) {
|
|
|
|
|
this.select.pageIndex = e
|
|
|
|
|
},
|
|
|
|
|
editorRuku(id, type) {
|
|
|
|
|
this.$refs['addoutbounds'].id = id
|
|
|
|
|
this.$refs['addoutbounds'].isShow = true
|
|
|
|
|
this.$refs['addoutbounds'].type = type
|
|
|
|
|
$refs['addoutbounds'].chukuType = chukuType
|
|
|
|
|
},
|
|
|
|
|
deleteRuku(row) {
|
|
|
|
|
// return
|
|
|
|
|
destroy({
|
|
|
|
|
id: row.id,
|
|
|
|
|
table_name: 'outbounds'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '删除成功'
|
|
|
|
|
})
|
|
|
|
|
this.getindex()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getField() {
|
|
|
|
|
if (this.$route.meta.params?.custom_form) {
|
|
|
|
|
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
|
|
|
|
|
try {
|
|
|
|
|
let custom_form = JSON.parse(decode)
|
|
|
|
|
this.customForm.customFormId = custom_form.custom_form_id
|
|
|
|
|
this.customForm.tableName = custom_form.table_name
|
|
|
|
|
console.log("123", this.customForm)
|
|
|
|
|
// this.select.table_name = custom_form.table_name
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.warn(err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const res = await fieldIndex({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
custom_form_id: this.customForm.customFormId,
|
|
|
|
|
sort_name: 'sort',
|
|
|
|
|
sort_type: 'asc',
|
|
|
|
|
})
|
|
|
|
|
if (res.data && res.data instanceof Array) {
|
|
|
|
|
res.data.forEach(i => {
|
|
|
|
|
if (i.field) {
|
|
|
|
|
if (
|
|
|
|
|
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
|
|
|
|
|
i.parameter_id
|
|
|
|
|
) {
|
|
|
|
|
getparameter({
|
|
|
|
|
id: i.parameter_id
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
i._paramters = res.detail ?? [];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
|
|
|
|
|
i.link_table_name
|
|
|
|
|
) {
|
|
|
|
|
index({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
table_name: i.link_table_name,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
i._paramters = res.data ?? [];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.form = res.data
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
if(this.$route.path){
|
|
|
|
|
let path = this.$route.path.split("_")[1]
|
|
|
|
|
this.chukuType = path=='receive'?'领用':(path=='desposition'?'处置':'应急')
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// this.getField()
|
|
|
|
|
this.getindex()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
</style>
|