|
|
|
@ -1,94 +1,146 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<el-form :inline="true" :model="busQuery" class="query-form" size="mini">
|
|
|
|
|
<el-form-item class="query-form-item" label="单据类型名称:">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="busQuery.key"
|
|
|
|
|
placeholder="请输入单据类型名称"
|
|
|
|
|
clearable
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button-group>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-refresh"
|
|
|
|
|
@click="selsectBussinessType"
|
|
|
|
|
>重置
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" @click="selsectBussinessType"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
>查询
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" @click="addBussinessType()"
|
|
|
|
|
icon="el-icon-document-add"
|
|
|
|
|
>选入单据类型
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table :data="userBussinessTypeList" ref="typeList"
|
|
|
|
|
border
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column label="序号" type="index"></el-table-column>
|
|
|
|
|
<el-table-column label="单据类型名称" prop="name"></el-table-column>
|
|
|
|
|
<el-table-column label="单据类型编码" prop="action"></el-table-column>
|
|
|
|
|
<el-table-column label="操作">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
:disabled="!configParms.basicInv"
|
|
|
|
|
@click.native.stop="delWarehouseBussinessType(scope.row.id)"
|
|
|
|
|
>移除
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="仓库信息-选入单据类型"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
:visible.sync="bussinessTypeFormVisible"
|
|
|
|
|
|
|
|
|
|
<el-transfer v-model="value" :data="data"
|
|
|
|
|
class="edit_dev"
|
|
|
|
|
@change="transferChange"
|
|
|
|
|
filterable
|
|
|
|
|
:titles="['未选入单据类型', '已选入单据类型']"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
<el-table v-loading="loading" :data="bussinessTypeList" ref="typeList"
|
|
|
|
|
border
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="selection"
|
|
|
|
|
:reserve-selection="true"
|
|
|
|
|
width="55">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="序号" type="index"></el-table-column>
|
|
|
|
|
<el-table-column label="单据类型编码" prop="action"></el-table-column>
|
|
|
|
|
<el-table-column label="单据类型名称" prop="name"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="bussinessTypeTotal>0"
|
|
|
|
|
:total="bussinessTypeTotal"
|
|
|
|
|
:page.sync="bussinessTypeQuery.page"
|
|
|
|
|
:limit.sync="bussinessTypeQuery.limit"
|
|
|
|
|
@pagination="getSelectUser"
|
|
|
|
|
/>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible"
|
|
|
|
|
>取消
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click.native="addBussinessTypeData()"
|
|
|
|
|
>提交
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>
|
|
|
|
|
<span>{{ scope.option.label }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</el-transfer>
|
|
|
|
|
<div style="text-align: center;margin-top: 20px">
|
|
|
|
|
<el-button type="primary" size="small" icon="search" @click="onAddSubmit"
|
|
|
|
|
>提交
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
|
|
|
|
|
>取消
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script></script>
|
|
|
|
|
<script>
|
|
|
|
|
import {invRelBusTypeList, updateInvRelBusType} from "@/api/system/invWarehouse";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "invRelBusType",
|
|
|
|
|
props: {
|
|
|
|
|
configParms: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
inputQuery: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
closeDialog: {
|
|
|
|
|
type: Function,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
bussinessTypeTotal: 0,
|
|
|
|
|
bussinessTypeQuery: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
ids: ""
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
busQuery: {
|
|
|
|
|
code: null,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10
|
|
|
|
|
},
|
|
|
|
|
selectBussinessTypeList: [],
|
|
|
|
|
busTypes: [],
|
|
|
|
|
bussinessTypeFormVisible: false,
|
|
|
|
|
data: [],
|
|
|
|
|
value: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
selsectBussinessType() { //获取单据类型
|
|
|
|
|
this.busQuery = {
|
|
|
|
|
code: this.inputQuery.code
|
|
|
|
|
}
|
|
|
|
|
invRelBusTypeList(this.busQuery).then((res) => {
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.busTypes = res.data;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
for (let i = 0; i < this.busTypes.length; i++) {
|
|
|
|
|
this.data.push({
|
|
|
|
|
key: this.busTypes[i].action,
|
|
|
|
|
label: this.busTypes[i].name,
|
|
|
|
|
});
|
|
|
|
|
if (this.busTypes[i].select) {
|
|
|
|
|
this.value.push(
|
|
|
|
|
this.busTypes[i].action
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error("单据类型数据加载失败")
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
checkSelectable(row) {
|
|
|
|
|
return !row.select;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onAddSubmit() {
|
|
|
|
|
let postRequesty = {
|
|
|
|
|
invCode: this.inputQuery.code,
|
|
|
|
|
selectActions: [],
|
|
|
|
|
};
|
|
|
|
|
postRequesty.selectActions = this.value;
|
|
|
|
|
updateInvRelBusType(postRequesty).then((res) => {
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
transferChange(value, direction, keyArr) {
|
|
|
|
|
console.log(value);
|
|
|
|
|
console.log(direction);
|
|
|
|
|
console.log(keyArr);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cancelDialog() {
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.selsectBussinessType();
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|