|
|
@@ -3,17 +3,27 @@
|
|
|
<div class="main-container">
|
|
|
<div class="page page-product-manage">
|
|
|
<div class="com-pro-search">
|
|
|
- <el-form label-position="left" ref="searchForm" size="medium" :model="searchForm" label-width="90px">
|
|
|
+ <el-form label-position="left" ref="searchForm" size="small" :model="searchForm" label-width="100px">
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="部门名称:" prop="classname">
|
|
|
- <el-input clearable v-model="searchForm.classname" placeholder="请输入部门名称" style="width: 85%"></el-input>
|
|
|
+ <el-form-item label="供应商名称:" prop="classname">
|
|
|
+ <el-input clearable v-model="searchForm.classname" placeholder="请输入供应商名称"
|
|
|
+ style="width: 250px;"></el-input>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
</el-col>
|
|
|
- <el-col :span="6" style="margin-top: 2px">
|
|
|
- <el-button size="medium" type="primary" style="background-color: #00bc70; border: 1px solid #00bc70"
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="供应商类型:" prop="classname">
|
|
|
+ <el-select v-model="searchForm.type" placeholder="请选择供应商" style="width: 250px;">
|
|
|
+ <el-option label="保司" value="1"></el-option>
|
|
|
+ <el-option label="渠道" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" style="margin-top: 2px">
|
|
|
+ <el-button size="small" type="primary" style="background-color: #00bc70; border: 1px solid #00bc70"
|
|
|
@click="searchInfor()">搜索</el-button>
|
|
|
- <el-button size="medium" style="background-color: #ffffff; border: 1px solid c6e2ff"
|
|
|
+ <el-button size="small" style="background-color: #ffffff; border: 1px solid c6e2ff"
|
|
|
@click="resetfrom()">重置</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -28,14 +38,15 @@
|
|
|
background: '#F2F7FC',
|
|
|
fontWeight: '900',
|
|
|
color: '#606266',
|
|
|
- }" size="small" @row-click="handleRowClick">
|
|
|
+ }" size="small" @row-click="handleRowClick">
|
|
|
<el-table-column prop="name" label="供应商名称"> </el-table-column>
|
|
|
- <el-table-column prop="id" label="编号" >
|
|
|
+ <el-table-column prop="id" label="编号">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="保司类型">
|
|
|
+ <el-table-column prop="type" label="保司类型">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.openQuote == '1'" type="primary">开启</el-tag>
|
|
|
- <el-tag v-if="scope.row.openQuote == '0' || scope.row.openQuote == null" type="success">关闭</el-tag>
|
|
|
+ <el-tag v-if="scope.row.type == '0'" size="small">渠道</el-tag>
|
|
|
+ <el-tag v-if="scope.row.type == '1'" type="danger" size="small">财险</el-tag>
|
|
|
+ <el-tag v-if="scope.row.type == '2'" type="warning" size="small">寿险</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column prop="address" label="状态" width="180">
|
|
|
@@ -50,8 +61,8 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" size="mini" icon="el-icon-edit" @click="handleTableEdit(scope.row)">修改</el-button>
|
|
|
<el-button type="text" size="mini" icon="el-icon-plus" @click="handleAddCompany(scope.row)">新增</el-button>
|
|
|
- <el-button type="text" size="mini" icon="el-icon-delete"
|
|
|
- @click="handleTableBatchDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button v-if="['0', '2'].includes(scope.row.type) || scope.row.childnode" type="text" size="mini"
|
|
|
+ icon="el-icon-delete" @click="handleTableBatchDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -62,12 +73,12 @@
|
|
|
<el-dialog v-dialogDrag :title="dialogTitle" :visible.sync="dialogVisible" width="900px" @close="closeVisible"
|
|
|
:close-on-click-modal="false">
|
|
|
<el-form :model="dataForm" :rules="rules" ref="dataForm" label-width="120px" size="small">
|
|
|
- <el-row >
|
|
|
+ <el-row>
|
|
|
<el-col :span="8" v-if="operType == 'ADD2'">
|
|
|
<el-form-item label="选择公司地区" prop="area">
|
|
|
- <el-cascader size="small" v-model="dataForm.area" :options="areaList" :props="optionProps"
|
|
|
- @change="areaHandleChange"></el-cascader>
|
|
|
- <!-- <el-cascader
|
|
|
+ <el-cascader size="small" v-model="dataForm.area" :options="areaList" :props="optionProps"
|
|
|
+ @change="areaHandleChange"></el-cascader>
|
|
|
+ <!-- <el-cascader
|
|
|
size="small"
|
|
|
v-model="area"
|
|
|
:options="areaList"
|
|
|
@@ -76,20 +87,24 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
></el-cascader> -->
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="保司类型" prop="type">
|
|
|
- <el-select v-model="dataForm.type" placeholder="请选择供应商类型">
|
|
|
- <el-option
|
|
|
- v-for="item in typeOptions"
|
|
|
- :key="item.dictValue"
|
|
|
- :label="item.dictTag"
|
|
|
+ <el-select v-model="dataForm.type" placeholder="请选择供应商类型" @change="typeOptionsChange"
|
|
|
+ :disabled="operType == 'ADD2' || operType == 'EDIT'">
|
|
|
+ <el-option v-for="item in typeOptions" :key="item.dictValue" :label="item.dictTag"
|
|
|
:value="item.dictValue">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8" v-if="operType == 'ADD3'">
|
|
|
+ <el-form-item label="code编码" prop="code">
|
|
|
+ <el-input v-model="dataForm.code" placeholder="请输入code编码" maxlength="4" type="text"
|
|
|
+ show-word-limit></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
@@ -190,6 +205,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ type: "",
|
|
|
value: false,
|
|
|
/**Split 开始 */
|
|
|
leftSplitWidth: 20,
|
|
|
@@ -235,7 +251,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- typeOptions:[],
|
|
|
+ typeOptions: [],
|
|
|
columns: [
|
|
|
{ prop: "id", label: "供应商编码", minWidth: 80, sortable: false },
|
|
|
{ prop: "name", label: "供应商名称", minWidth: 80, sortable: false },
|
|
|
@@ -258,10 +274,12 @@ export default {
|
|
|
parentId: "0", //上级编码
|
|
|
namesimple: "", //保险公司简称
|
|
|
remark: "", //备注
|
|
|
- orderNum: 0,
|
|
|
+ orderNum: 0,//排序
|
|
|
logo: "",
|
|
|
- openQuote: 0, //状态0为关闭,1为开启
|
|
|
cnName: "", //拼音
|
|
|
+ code: "",//编码
|
|
|
+ type: "",//保司类型
|
|
|
+
|
|
|
},
|
|
|
imgList1: [],
|
|
|
rules: {
|
|
|
@@ -280,6 +298,9 @@ export default {
|
|
|
area: [
|
|
|
{ required: true, message: "请选择供应商名称", trigger: "change" },
|
|
|
],
|
|
|
+ code: [
|
|
|
+ { required: true, message: "请输入code编码", trigger: "blur" },
|
|
|
+ ],
|
|
|
name: [
|
|
|
{ required: true, message: "请输入供应商名称", trigger: "blur" },
|
|
|
],
|
|
|
@@ -300,17 +321,32 @@ export default {
|
|
|
},
|
|
|
searchForm: {
|
|
|
classname: "",
|
|
|
- status: "",
|
|
|
+ type: "",
|
|
|
},
|
|
|
isshow: false,
|
|
|
// 是否禁用上传
|
|
|
uploadDisabled: false,
|
|
|
//点击表格展开折叠
|
|
|
expanded: false,
|
|
|
+ childnode: false,//子节点标识
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ "dataForm.code": {
|
|
|
+ handler(val, oldVal) {
|
|
|
+ if (val) {
|
|
|
+ this.dataForm.code = val.toUpperCase();
|
|
|
+ this.dataForm.id = val + this.type + '000000'
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.findLeftTreeData();
|
|
|
+ // 字典
|
|
|
+ this.getDicType("supplierTypeEnum", 'typeOptions')
|
|
|
//用像素初始化左边的split的宽度
|
|
|
// this.changeTreeWidth(240); // 初始化树的宽度
|
|
|
this.ztreeNodes.forEach((val) => {
|
|
|
@@ -318,6 +354,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ typeOptionsChange(e) {
|
|
|
+ this.type = e;
|
|
|
+ this.dataForm.id = e + '000000'
|
|
|
+ },
|
|
|
// 搜索
|
|
|
searchInfor() {
|
|
|
this.findLeftTreeData();
|
|
|
@@ -329,7 +369,6 @@ export default {
|
|
|
console.log(this.$refs.expandTable);
|
|
|
this.$refs.expandTable.toggleRowExpansion(i, isExpand);
|
|
|
if (i.children) {
|
|
|
- console.log("kkk");
|
|
|
this.forTableData(i.children, isExpand);
|
|
|
}
|
|
|
});
|
|
|
@@ -371,15 +410,28 @@ export default {
|
|
|
},
|
|
|
/**Split 结束 */
|
|
|
//--tree begin-------
|
|
|
+
|
|
|
+ // 递归函数 ,操作子节点
|
|
|
+ addTypeToChildren(node) {
|
|
|
+ if (node.children.length === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 给当前节点的每个子节点添加type数据
|
|
|
+ for (const child of node.children) {
|
|
|
+ child.childnode = true;
|
|
|
+ this.addTypeToChildren(child);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取树数据
|
|
|
- findLeftTreeData: function () {
|
|
|
- var that = this;
|
|
|
- const params = new URLSearchParams();
|
|
|
- params.append("name", that.searchForm.classname);
|
|
|
- that.$api.insCompany.findLeftInsTree(params).then((res) => {
|
|
|
- that.ztreeNodes = res.data;
|
|
|
+ findLeftTreeData() {
|
|
|
+ this.$api.insCompany.findLeftInsTree(this.searchForm).then((res) => {
|
|
|
+ for (const node of res.data) {
|
|
|
+ this.addTypeToChildren(node)
|
|
|
+ }
|
|
|
+ this.ztreeNodes = res.data;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
// 点击事件
|
|
|
this.currentTreeNode = treeNode;
|
|
|
@@ -418,14 +470,14 @@ export default {
|
|
|
.then(data != null ? data.callback : "");
|
|
|
},
|
|
|
areaHandleChange(value) {
|
|
|
+ console.log(value)
|
|
|
if (value != "") {
|
|
|
this.dataForm.id =
|
|
|
- this.dataForm.parentId.substring(0, 6) + value[value.length - 1];
|
|
|
+ this.dataForm.parentId.substring(0, 4) + this.dataForm.type + value[value.length - 1];
|
|
|
} else {
|
|
|
this.dataForm.id = "";
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
handleAddType() {
|
|
|
// 添加保险总公司
|
|
|
this.operType = "ADD3";
|
|
|
@@ -434,24 +486,31 @@ export default {
|
|
|
this.dialogVisible = true;
|
|
|
this.imgList1 = [];
|
|
|
this.uploadDisabled = false;
|
|
|
- this.$api.insCompany.dicType("supplierTypeEnum").then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.typeOptions=res.data.ddList
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
handleAddCompany(row) {
|
|
|
this.operType = "ADD2";
|
|
|
this.dialogTitle = "新增保险分公司";
|
|
|
this.dataForm.parentId = row.id;
|
|
|
+ this.dataForm.type = row.type;
|
|
|
this.dataForm.logo = "";
|
|
|
this.dataForm.openQuote = row.openQuote;
|
|
|
this.dialogVisible = true;
|
|
|
this.imgList1 = [];
|
|
|
this.uploadDisabled = false;
|
|
|
},
|
|
|
+ //系统字典统一调用
|
|
|
+ getDicType(type, options) {
|
|
|
+ this.$api.insCompany.dicType(type).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this[options] = res.data.ddList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
handleTableEdit(row) {
|
|
|
+ this.childnode = row.childnode;
|
|
|
this.operType = "EDIT";
|
|
|
+ this.dialogTitle = "信息编辑";
|
|
|
//查询详情
|
|
|
this.$api.insCompany.getInsCompanyById(row.id).then((res) => {
|
|
|
this.dataForm.id = res.data.id;
|
|
|
@@ -463,6 +522,7 @@ export default {
|
|
|
this.dataForm.cnName = res.data.cnName;
|
|
|
this.dataForm.openQuote = res.data.openQuote;
|
|
|
this.dataForm.logo = res.data.logo;
|
|
|
+ this.dataForm.type = res.data.type;
|
|
|
if (res.data.openQuote == "1") {
|
|
|
this.value = true;
|
|
|
} else {
|
|
|
@@ -475,7 +535,7 @@ export default {
|
|
|
this.imgList1.push({ url: res.data.logo });
|
|
|
this.uploadDisabled = true;
|
|
|
}
|
|
|
- this.dialogVisible = true;
|
|
|
+ this.dialogVisible = true;
|
|
|
|
|
|
});
|
|
|
},
|
|
|
@@ -518,7 +578,7 @@ export default {
|
|
|
},
|
|
|
//提交确认
|
|
|
submitForm(formName) {
|
|
|
- console.log(this.dataForm,1111111 )
|
|
|
+ console.log(this.dataForm, 1111111)
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.operType == "ADD1" || this.operType == "ADD2" || this.operType == "ADD3") {
|