You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
3.3 KiB
Vue
147 lines
3.3 KiB
Vue
<template>
|
|
<div>
|
|
<!-- <el-form :inline="true" :model="unitquery" class="query-form" size="mini">-->
|
|
<!-- <el-form-item class="query-form-item" label="关键字搜索:">-->
|
|
<!-- <el-input v-model="unitquery.key" placeholder="搜索"></el-input>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item>-->
|
|
<!-- <el-button-->
|
|
<!-- type="primary"-->
|
|
<!-- icon="el-icon-search"-->
|
|
<!-- @click.native.stop="getUnitList()"-->
|
|
<!-- >查询-->
|
|
<!-- </el-button-->
|
|
<!-- >-->
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-form>-->
|
|
|
|
<el-table
|
|
v-loading="loading"
|
|
:data="unitlist"
|
|
style="width: 100%"
|
|
highlight-current-row
|
|
height="500"
|
|
border
|
|
@current-change="handleDetail"
|
|
>
|
|
<el-table-column
|
|
label="往来单位ID"
|
|
prop="erpId"
|
|
show-overflow-tooltip
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="往来单位名称"
|
|
prop="name"
|
|
show-overflow-tooltip
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="往来单位简写"
|
|
prop="spell"
|
|
show-overflow-tooltip
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="地址"
|
|
prop="addr"
|
|
show-overflow-tooltip
|
|
></el-table-column>
|
|
<el-table-column width="200" label="操作">
|
|
<template slot-scope="scope">
|
|
|
|
<el-button
|
|
type="text"
|
|
size="small"
|
|
@click.native.stop="selectUnit(scope.row)"
|
|
>选入绑定
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {getBasicUnitMaintains, getCorpFilter} from "@/api/basic/basicUnitMaintain";
|
|
|
|
export default {
|
|
name: "DialogSelectUnit",
|
|
props: {
|
|
codeId: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
fromCorp: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
|
|
|
|
},
|
|
data() {
|
|
return {
|
|
loading: false,
|
|
unitquery: {key: "", page: 1, limit: 20},
|
|
unitlist: [],
|
|
unitUpdateQuery: {
|
|
id: "",
|
|
fromCorpId: "",
|
|
fromCorp: "",
|
|
},
|
|
}
|
|
},
|
|
methods: {
|
|
getUnitList() {
|
|
this.loading = true;
|
|
getBasicUnitMaintains(this.unitquery)
|
|
.then((response) => {
|
|
this.loading = false;
|
|
this.unitlist = response.data.page.list || [];
|
|
})
|
|
.catch(() => {
|
|
this.loading = false;
|
|
});
|
|
},
|
|
getUnitListByCode(row) {
|
|
let query = {
|
|
udiRlIdFk: row.relId,
|
|
unitFk: this.fromCorp,
|
|
}
|
|
getCorpFilter(query)
|
|
.then((response) => {
|
|
this.loading = false;
|
|
if (response.code == 20000) {
|
|
this.unitlist = response.data || [];
|
|
} else {
|
|
this.$message.warning(response.message);
|
|
}
|
|
|
|
})
|
|
.catch(() => {
|
|
this.loading = false;
|
|
});
|
|
},
|
|
|
|
handleDetail(row) {
|
|
this.curUnitRow = row;
|
|
},
|
|
selectUnit(row) {
|
|
this.$emit("selectSupUnit", row);
|
|
this.$emit("closeBindDialog", true);
|
|
},
|
|
},
|
|
created() {
|
|
|
|
},
|
|
mounted() {
|
|
console.log("this.codeId = " + this.codeId)
|
|
if (this.codeId != null) {
|
|
this.getUnitListByCode(this.codeId)
|
|
}
|
|
}
|
|
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|