feat:医共体
parent
f2436df23b
commit
c5e553e5a3
@ -0,0 +1,319 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :inline="true" :model="customerQuery" class="query-form" size="mini">
|
||||||
|
<el-form-item class="query-form-item" label="供应商名称:">
|
||||||
|
<el-input
|
||||||
|
v-model="customerQuery.key"
|
||||||
|
placeholder="请输入供应商名称"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
@click="onCustomerReset"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="loadCustomerList"
|
||||||
|
icon="el-icon-search"
|
||||||
|
>查询
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="addCustomer()"
|
||||||
|
icon="el-icon-document-add"
|
||||||
|
>选入供应商
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</el-button-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
:data="customerData"
|
||||||
|
key="row.id"
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="companyName"
|
||||||
|
label="供应商名称"
|
||||||
|
min-width="30%">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="creditNum"
|
||||||
|
label="统一社会信用号"
|
||||||
|
min-width="20%">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="detailAddr"
|
||||||
|
label="地址"
|
||||||
|
min-width="20%">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
min-width="30%"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click.native="rmInvCustomer(scope.row)">
|
||||||
|
移除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="customerTotal>0"
|
||||||
|
:total="customerTotal"
|
||||||
|
:page.sync="customerQuery.page"
|
||||||
|
:limit.sync="customerQuery.limit"
|
||||||
|
@pagination="loadCustomerList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!--添加用户弹窗-->
|
||||||
|
<el-dialog
|
||||||
|
v-if="customerFormVisible"
|
||||||
|
title="仓库信息-选入供应商"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
width="65%"
|
||||||
|
append-to-body
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
:visible.sync="customerFormVisible"
|
||||||
|
>
|
||||||
|
<el-table v-loading="customerloading" :data="selectCustomerList"
|
||||||
|
ref="selectCustomerList"
|
||||||
|
@selection-change="handleCustomerSelectionChange"
|
||||||
|
border
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
:reserve-selection="false"
|
||||||
|
width="55">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="companyName"
|
||||||
|
label="供应商名称"
|
||||||
|
min-width="30%">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="creditNum"
|
||||||
|
label="统一社会信用号"
|
||||||
|
min-width="20%">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="detailAddr"
|
||||||
|
label="地址"
|
||||||
|
min-width="20%">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click.native="customerFormVisible = !customerFormVisible"
|
||||||
|
>取消
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click.native="addCustomerData()"
|
||||||
|
>选入
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<pagination
|
||||||
|
v-show="selectCustomerToatl>0"
|
||||||
|
:total="selectCustomerToatl"
|
||||||
|
:page.sync="selectCustomerQuery.page"
|
||||||
|
:limit.sync="selectCustomerQuery.limit"
|
||||||
|
@pagination="getSelectCustomer"
|
||||||
|
/>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {warehouseListByCode,selectNotSelectCustomer,addWarehouseCustomer,
|
||||||
|
deleteWarehouseCustomer} from "@/api/system/invWarehouse";
|
||||||
|
import {isBlank} from "@/utils/strUtil";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "invRelCustomers",
|
||||||
|
props: {
|
||||||
|
configParms: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
inputQuery: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
closeDialog: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//---------------仓库-用户相关---------------------
|
||||||
|
customerQuery: {
|
||||||
|
code: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10
|
||||||
|
},
|
||||||
|
customerData: [],
|
||||||
|
customerTotal: 0,
|
||||||
|
customerDataList:[],
|
||||||
|
|
||||||
|
//---------------仓库添加用户-----
|
||||||
|
selectCustomerQuery: {
|
||||||
|
code: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
parentId:""
|
||||||
|
},
|
||||||
|
customerFormVisible: false,
|
||||||
|
customerloading: false,
|
||||||
|
selectCustomerList: [],
|
||||||
|
selectCustomerToatl: 0,
|
||||||
|
selectAddCustomer: [],
|
||||||
|
|
||||||
|
|
||||||
|
//------用户-单据类型相关-----------------------
|
||||||
|
curSeleCustomer: null,
|
||||||
|
relBusCustomerVisile: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
//用户相关
|
||||||
|
onCustomerReset() {
|
||||||
|
this.customerQuery = {
|
||||||
|
code: this.inputQuery.code,
|
||||||
|
key: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10
|
||||||
|
};
|
||||||
|
this.loadCustomerList();
|
||||||
|
},
|
||||||
|
loadCustomerList() { //获取仓库用户列表
|
||||||
|
// if (val != null) {
|
||||||
|
// this.userQuery.page = val;
|
||||||
|
// }
|
||||||
|
//加载用户数据
|
||||||
|
warehouseListByCode(this.customerQuery).then((res) => {
|
||||||
|
this.customerData = res.data.list;
|
||||||
|
this.customerTotal = res.data.total;
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
this.$message.error("用户数据加载失败")
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
addCustomer() { //添加仓库关联用户弹窗
|
||||||
|
if (isBlank(this.inputQuery.parentId)) {
|
||||||
|
this.$message.warning("请先选择仓库");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.currentCode = this.inputQuery.code;
|
||||||
|
this.customerFormVisible = true;
|
||||||
|
this.selectCustomerQuery.parentId=this.inputQuery.parentId;
|
||||||
|
this.selectCustomerQuery.code = this.inputQuery.code;
|
||||||
|
this.selectCustomerQuery.page = 1;
|
||||||
|
for(var i=0;i<this.customerData.length;i++){
|
||||||
|
this.customerDataList[i]=this.customerData[i].id;
|
||||||
|
}
|
||||||
|
this.selectCustomerQuery.listUser=this.customerDataList;
|
||||||
|
this.getSelectCustomer();
|
||||||
|
},
|
||||||
|
|
||||||
|
rmInvCustomer(row) { //移除仓库关联用户
|
||||||
|
this.$confirm("确定移除该仓库关联供应商?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
let params = {id: row.unifyId};
|
||||||
|
deleteWarehouseCustomer(params).then((res) => {
|
||||||
|
if (res.code == 20000) {
|
||||||
|
this.loadCustomerList();
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCustomerSelectionChange(val) {
|
||||||
|
this.selectAddCustomer = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
getSelectCustomer() {
|
||||||
|
selectNotSelectCustomer(this.selectCustomerQuery).then((res) => {
|
||||||
|
this.selectCustomerList = res.data.list;
|
||||||
|
this.selectCustomerToatl = res.data.total;
|
||||||
|
}).catch((error) => {
|
||||||
|
this.$message.error("用户数据加载失败")
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
addCustomerData() { //提交选入用户
|
||||||
|
if(this.selectAddCustomer.length==0){
|
||||||
|
this.$message.error("请选择要选入的供应商!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let query = {
|
||||||
|
code: this.currentCode,
|
||||||
|
customerList: this.selectAddCustomer
|
||||||
|
};
|
||||||
|
console.log(query)
|
||||||
|
addWarehouseCustomer(query).then((res) => {
|
||||||
|
if (res.code === 20000) {
|
||||||
|
this.customerFormVisible = false;
|
||||||
|
this.$message.success("添加成功");
|
||||||
|
this.loadCustomerList();
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.$message.error("添加失败");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//用户-单据类型 相关
|
||||||
|
relBusttype(row) {
|
||||||
|
this.curSeleUser = row;
|
||||||
|
this.relBusUserVisile = true;
|
||||||
|
},
|
||||||
|
cancelRelBusDiaolog() {
|
||||||
|
this.relBusUserVisile = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
inputQuery: function () {
|
||||||
|
this.customerQuery.code = this.inputQuery.code;
|
||||||
|
this.loadCustomerList();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.customerQuery.code = this.inputQuery.code;
|
||||||
|
this.loadCustomerList();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue