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.
spms-vue/src/views/warehouse/DialogSelectUnit.vue

147 lines
4.3 KiB
Vue

3 years ago
<template>
<div>
<el-form :inline="true" :model="unitquery" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input v-model="unitquery.key" placeholder="搜索"></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="search"
@click.native.stop="getUnitList()"
>查询
</el-button
>
<!-- <el-button-->
<!-- type="primary"-->
<!-- icon="search"-->
<!-- @click.native.stop="selectUnit()"-->
<!-- >确定-->
<!-- </el-button-->
<!-- >-->
</el-form-item>
</el-form>
3 years ago
<el-table
v-loading="loading"
:data="unitlist"
style="width: 100%"
highlight-current-row
@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 label="状态" prop="status"></el-table-column>
<el-table-column label="类型" prop="type"></el-table-column>
<el-table-column width="200" label="操作" fixed="right">
<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>
3 years ago
</template>
<script>
import {updateUnit} from "@/api/warehouse/order";
import {getBasicUnitMaintains, getCorpFilter} from "@/api/basic/basicUnitMaintain";
3 years ago
export default {
name: "DialogSelectUnit",
props: {
codeId: {
type: Object,
required: true,
},
},
3 years ago
data() {
return {
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,
}
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;
3 years ago
},
selectUnit(row) {
this.$emit("selectSupUnit", row);
this.$emit("closeBindDialog", true);
},
},
created() {
3 years ago
},
mounted() {
console.log("this.codeId = " + this.codeId)
if (this.codeId != null) {
this.getUnitListByCode(this.codeId)
}
}
3 years ago
}
</script>
<style scoped>
</style>