|
|
@@ -1,227 +1,267 @@
|
|
|
<template>
|
|
|
- <div class="container" style="width: 99%; margin-top: 0px">
|
|
|
- <templateTable :searchData.sync="queryFrom" :tableConfig="tableConfig" :data="pageResult" @getList="findPage" :pagination="pageData">
|
|
|
- </templateTable>
|
|
|
- <el-dialog
|
|
|
- title="税源管理"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="50%"
|
|
|
+ <div class="container" style="width: 99%; margin-top: 0px">
|
|
|
+ <templateTable
|
|
|
+ :searchData.sync="queryFrom"
|
|
|
+ :tableConfig="tableConfig"
|
|
|
+ :data="pageResult"
|
|
|
+ @getList="findPage"
|
|
|
+ :pagination="pageData"
|
|
|
>
|
|
|
- <el-tabs v-model="activeName" >
|
|
|
+ </templateTable>
|
|
|
+ <el-dialog title="税源管理" :visible.sync="dialogVisible" width="50%">
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
<el-tab-pane label="协议选择" name="1">
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- style="width: 100%">
|
|
|
- <el-table-column
|
|
|
- prop="license"
|
|
|
- label="车牌"
|
|
|
- width="100"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="协议选择"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.agreementId" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.id"
|
|
|
- :label="item.agreementName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="是否启动"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-switch
|
|
|
- v-model="scope.row.isTaxSource"
|
|
|
- active-value="1"
|
|
|
- inactive-value="0"
|
|
|
- @change="isTaxSourceFun(scope.row.isTaxSource,scope.$index)"
|
|
|
- >
|
|
|
- </el-switch>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
+ <el-table-column prop="license" label="车牌" width="100">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="协议选择" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.agreementId" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.agreementName"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="是否启动">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.isTaxSource"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="isTaxSourceFun(scope.row.isTaxSource, scope.$index)"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-checkbox-group
|
|
|
+ v-if="scope.row.isTaxSource * 1"
|
|
|
+ v-model="scope.row.insuranceRepertoire"
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ v-for="item in insuranceRepertoire"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :checked="item.status == 1"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item"
|
|
|
+ >{{ item.dictTag }}</el-checkbox
|
|
|
+ >
|
|
|
+ </el-checkbox-group>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="排除部门" name="2">
|
|
|
- <el-tree default-expand-all ref="tree" show-checkbox :data="treeData" node-key="id" :props="defaultProps" ></el-tree>
|
|
|
+ <el-tree
|
|
|
+ default-expand-all
|
|
|
+ ref="tree"
|
|
|
+ show-checkbox
|
|
|
+ :data="treeData"
|
|
|
+ node-key="id"
|
|
|
+ :props="defaultProps"
|
|
|
+ ></el-tree>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="排除车牌" name="3">
|
|
|
<el-checkbox-group v-model="checkList">
|
|
|
- <el-checkbox v-for="val in tableData" :key="val.id" :label="val.license"></el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-for="val in tableData"
|
|
|
+ :key="val.id"
|
|
|
+ :label="val.license"
|
|
|
+ ></el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitDialog()">确 定</el-button>
|
|
|
- </span>
|
|
|
+ </el-tabs>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitDialog()">确 定</el-button>
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import templateTable from '@/components/TemplateTable/index.vue'
|
|
|
+import templateTable from "@/components/TemplateTable/index.vue";
|
|
|
|
|
|
export default {
|
|
|
- name: "sourceManagement",
|
|
|
+ name: "sourceManagement",
|
|
|
components: { templateTable },
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogVisible:false,
|
|
|
- activeName:'1',
|
|
|
- defaultProps: {
|
|
|
- children: 'children',
|
|
|
- label: 'name'
|
|
|
- },
|
|
|
- checkList:[],
|
|
|
- treeData:[],
|
|
|
- pageResult: [], //表格数据
|
|
|
- queryFrom: {}, //查询信息
|
|
|
- tableConfig: {
|
|
|
+ dialogVisible: false,
|
|
|
+ activeName: "1",
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ label: "name",
|
|
|
+ },
|
|
|
+ checkList: [],
|
|
|
+ insuranceRepertoireList: [],
|
|
|
+ treeData: [],
|
|
|
+ pageResult: [], //表格数据
|
|
|
+ queryFrom: {}, //查询信息
|
|
|
+ tableConfig: {
|
|
|
columns: [
|
|
|
// 数据列
|
|
|
- { prop: "name", label: "保险公司名称", type: 'text' },
|
|
|
+ { prop: "name", label: "保险公司名称", type: "text" },
|
|
|
{
|
|
|
prop: "id",
|
|
|
- label: "id", type: 'text',
|
|
|
+ label: "id",
|
|
|
+ type: "text",
|
|
|
},
|
|
|
],
|
|
|
loading: true,
|
|
|
isPaginationShow: true,
|
|
|
isShowIndex: true,
|
|
|
- operationWidth: '30',
|
|
|
+ operationWidth: "30",
|
|
|
optBtns: [
|
|
|
{
|
|
|
- type: 'primary',
|
|
|
- label: '税源管理',
|
|
|
- type: 'text',
|
|
|
- click: (row, index) => { return this.addSource(row) },
|
|
|
+ type: "primary",
|
|
|
+ label: "税源管理",
|
|
|
+ type: "text",
|
|
|
+ click: (row, index) => {
|
|
|
+ return this.addSource(row);
|
|
|
+ },
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
},
|
|
|
pageData: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- totalSize: 0
|
|
|
+ totalSize: 0,
|
|
|
},
|
|
|
- tableData:[],
|
|
|
- options:[],
|
|
|
- rowData:{}
|
|
|
- }
|
|
|
-},
|
|
|
-created() {
|
|
|
- this.$api.dept.findTree().then((res) => {
|
|
|
- if(res.code==200){
|
|
|
- this.treeData=res.data
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- this.findPage()
|
|
|
+ tableData: [],
|
|
|
+ options: [],
|
|
|
+ rowData: {},
|
|
|
+ insuranceRepertoire: [], //产品代码列表
|
|
|
+ };
|
|
|
},
|
|
|
-methods:{
|
|
|
+ created() {
|
|
|
+ this.$api.dept.findTree().then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.treeData = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //获取产品代码列表
|
|
|
+ this.$api.insCompany.dicType("productsType").then((rescode) => {
|
|
|
+ if (rescode.code == 200) {
|
|
|
+ this.insuranceRepertoire = rescode.data.ddList;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //获取列表
|
|
|
findPage() {
|
|
|
this.tableConfig.loading = true;
|
|
|
- this.$api.dept.insureCompany({ ...this.pageData })
|
|
|
- .then((res) => {
|
|
|
- this.tableConfig.loading = false;
|
|
|
- this.pageResult = res.data.content;
|
|
|
- this.pageData.pageNum = res.data.pageNum;
|
|
|
- this.pageData.pageSize = res.data.pageSize;
|
|
|
- this.pageData.totalSize = res.data.totalSize;
|
|
|
-
|
|
|
- })
|
|
|
+ this.$api.dept.insureCompany({ ...this.pageData }).then((res) => {
|
|
|
+ this.tableConfig.loading = false;
|
|
|
+ this.pageResult = res.data.content;
|
|
|
+ this.pageData.pageNum = res.data.pageNum;
|
|
|
+ this.pageData.pageSize = res.data.pageSize;
|
|
|
+ this.pageData.totalSize = res.data.totalSize;
|
|
|
+ });
|
|
|
},
|
|
|
- licenseFun(){
|
|
|
+ //税源管理返回没值的话赋值方法
|
|
|
+ licenseFun() {
|
|
|
this.$api.dept.license().then((res) => {
|
|
|
- if(res.code==200){
|
|
|
- res.data.forEach((ele,index) => {
|
|
|
- ele.agreementId=''
|
|
|
- ele.isTaxSource='0'
|
|
|
- });
|
|
|
- this.tableData=res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- addSource(row){
|
|
|
- this.dialogVisible=true
|
|
|
- this.rowData={
|
|
|
- insCompanyId:row.id,
|
|
|
- insCompanyName:row.name
|
|
|
+ if (res.code == 200) {
|
|
|
+ res.data.forEach((ele, index) => {
|
|
|
+ ele.agreementId = "";
|
|
|
+ ele.isTaxSource = "0";
|
|
|
+ });
|
|
|
+ this.tableData = res.data;
|
|
|
}
|
|
|
- this.$api.dept.getTaxSource(row.id)
|
|
|
- .then((res) => {
|
|
|
- if(res.code==200){
|
|
|
- if(res.data.agreementTaxList.length>0){
|
|
|
- this.tableData=res.data.agreementTaxList
|
|
|
- }
|
|
|
- else{
|
|
|
- this.licenseFun()
|
|
|
- }
|
|
|
- if(res.data.agreementTaxExcludeDeptList.length>0){
|
|
|
- this.$refs.tree.setCheckedKeys(res.data.agreementTaxExcludeDeptList)
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$refs.tree.setCheckedKeys([])
|
|
|
- }
|
|
|
- if(res.data.agreementTaxExcludeLicenseList.length>0){
|
|
|
- this.checkList=res.data.agreementTaxExcludeLicenseList
|
|
|
- }
|
|
|
- else{
|
|
|
- this.checkList=[]
|
|
|
- }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ addSource(row) {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.rowData = {
|
|
|
+ insCompanyId: row.id,
|
|
|
+ insCompanyName: row.name,
|
|
|
+ };
|
|
|
+ this.$api.dept.getTaxSource(row.id).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data.agreementTaxList.length > 0) {
|
|
|
+ res.data.agreementTaxList.forEach((ele, index) => {
|
|
|
+ if (ele.insuranceRepertoire == null) {
|
|
|
+ ele.insuranceRepertoire = [];
|
|
|
+ } else {
|
|
|
+ ele.insuranceRepertoire = ele.insuranceRepertoire.split(",");
|
|
|
+ }
|
|
|
+ console.log(ele.insuranceRepertoire);
|
|
|
+ });
|
|
|
+ this.tableData = res.data.agreementTaxList;
|
|
|
+ } else {
|
|
|
+ this.licenseFun();
|
|
|
}
|
|
|
- })
|
|
|
- this.$api.dept.agreement(row.id)
|
|
|
- .then((res) => {
|
|
|
- if(res.code==200){
|
|
|
- this.options=res.data
|
|
|
+ if (res.data.agreementTaxExcludeDeptList.length > 0) {
|
|
|
+ this.$refs.tree.setCheckedKeys(
|
|
|
+ res.data.agreementTaxExcludeDeptList
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- isTaxSourceFun(data,index){
|
|
|
- if(data==1){
|
|
|
- this.tableData.forEach((val,ind)=>{
|
|
|
- val.isTaxSource='0'
|
|
|
- if(index==ind){
|
|
|
- this.tableData[index].isTaxSource='1'
|
|
|
- this.$set( this.tableData,index,this.tableData[index])
|
|
|
+ if (res.data.agreementTaxExcludeLicenseList.length > 0) {
|
|
|
+ this.checkList = res.data.agreementTaxExcludeLicenseList;
|
|
|
+ } else {
|
|
|
+ this.checkList = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$api.dept.agreement(row.id).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.options = res.data;
|
|
|
}
|
|
|
-
|
|
|
- })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ isTaxSourceFun(data, index) {
|
|
|
+ if (data == 1) {
|
|
|
+ this.tableData.forEach((val, ind) => {
|
|
|
+ val.isTaxSource = "0";
|
|
|
+ if (index == ind) {
|
|
|
+ this.tableData[index].isTaxSource = "1";
|
|
|
+ this.$set(this.tableData, index, this.tableData[index]);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
- submitDialog(){
|
|
|
- let agreementTaxList=[]
|
|
|
- let agreementTaxExcludeDeptList=this.$refs.tree.getCheckedKeys()
|
|
|
- let agreementTaxExcludeLicenseList=this.checkList
|
|
|
- this.tableData.forEach(val=>{
|
|
|
+ submitDialog() {
|
|
|
+ let agreementTaxList = [];
|
|
|
+ let agreementTaxExcludeDeptList = this.$refs.tree.getCheckedKeys();
|
|
|
+ let agreementTaxExcludeLicenseList = this.checkList;
|
|
|
+ this.tableData.forEach((val) => {
|
|
|
agreementTaxList.push({
|
|
|
- agreementId:val.agreementId,
|
|
|
- license:val.license,
|
|
|
- isTaxSource:val.isTaxSource,
|
|
|
+ agreementId: val.agreementId,
|
|
|
+ license: val.license,
|
|
|
+ isTaxSource: val.isTaxSource,
|
|
|
+ insuranceRepertoire:val.insuranceRepertoire.join(","),
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.$api.dept
|
|
|
+ .saveTaxSource({
|
|
|
+ ...this.rowData,
|
|
|
+ agreementTaxList,
|
|
|
+ agreementTaxExcludeDeptList,
|
|
|
+ agreementTaxExcludeLicenseList,
|
|
|
})
|
|
|
- })
|
|
|
- this.$api.dept.saveTaxSource({...this.rowData,agreementTaxList,agreementTaxExcludeDeptList,agreementTaxExcludeLicenseList})
|
|
|
.then((res) => {
|
|
|
- if(res.code==200){
|
|
|
- this.dialogVisible=false
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.dialogVisible = false;
|
|
|
this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- this.findPage()
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$message.error(res.msg)
|
|
|
+ message: res.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
-}
|
|
|
-
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|