|
|
@@ -1,108 +1,163 @@
|
|
|
<template>
|
|
|
<div class="container" style="width: 99%; margin-top: 0px">
|
|
|
- <templateTable
|
|
|
- :searchData.sync="queryFrom"
|
|
|
- :tableConfig="tableConfig"
|
|
|
- :data="pageResult"
|
|
|
- @getList="findPage"
|
|
|
- :pagination="pageData"
|
|
|
- >
|
|
|
+ <templateTable :searchData.sync="queryFrom" :tableConfig="tableConfig" :data="pageResult" @getList="findPage"
|
|
|
+ :pagination="pageData">
|
|
|
</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>
|
|
|
+ <el-dialog title="协议调度" :visible.sync="dispatchdialogVisible" width="50%" top="8vh" fullscreen>
|
|
|
+ <el-button size="small" type="success" @click="add" style="margin: 10px;">添加</el-button>
|
|
|
+ <kt-common-table :tableHeights="700" :SerialShow="false" :operationWidth="200" :showOperation="true"
|
|
|
+ :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="dispatchResult"
|
|
|
+ :columns="dispatchColumns" @findPage="dispatchFindPage" button2Name="编辑" @handleButton2="dispatchUpdate"
|
|
|
+ button3Name="删除" @handleButton3="dispatchDelete">
|
|
|
+ </kt-common-table>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="排除部门" :visible.sync="excludedialogVisible" width="70%" top="8vh" class="scrollable-dialog" @close="excludecloseDialog">
|
|
|
+ <el-tree default-expand-all ref="tree" show-checkbox :data="treeData" node-key="id" :props="defaultProps" :default-checked-keys="treekeys"
|
|
|
+ @check="treechange"></el-tree>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="excludedialogVisible = false">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="excludeSubmit">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="ruleDialogTitle" :visible.sync="ruledialogVisible" width="50%" @open="ruleOpenDialog">
|
|
|
+ <el-form :model="localForm" label-width="120px" size="small">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="协议选择">
|
|
|
+ <el-select v-model="localForm.agreementId" placeholder="请选择协议" style="width: 100%;">
|
|
|
+ <el-option v-for="item in agreementList" :key="item.id" :label="item.agreementAbbreviation"
|
|
|
+ :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="优先级">
|
|
|
+ <el-input v-model="localForm.priority" placeholder="输入优先级"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="是否默认">
|
|
|
+ <div class="flex ">
|
|
|
+ <el-radio-group v-model="localForm.defaultFlag">
|
|
|
+ <el-radio-button :label="1">是</el-radio-button>
|
|
|
+ <el-radio-button :label="0">否</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <el-button size="mini" style="margin-left: 20px;" @click="radiouncheck">取消选择</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for=" (formItems, index) in dynamicFormArray" :key="index" :span="24">
|
|
|
+ <el-form-item :label="formItems.attrName">
|
|
|
+ <template v-if="formItems.attrType == 'inputNumber'">
|
|
|
+ <template v-if="formItems.operator == '1' || formItems.operator == null">
|
|
|
+ <el-input-number v-model="formItems.min"></el-input-number>
|
|
|
+ <i class="el-icon-minus"></i>
|
|
|
+ <el-input-number v-model="formItems.max"></el-input-number>
|
|
|
</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 v-if="formItems.operator == '2'">
|
|
|
+ <span><</span>
|
|
|
+ <el-input-number v-model="formItems.min"></el-input-number>
|
|
|
</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 v-if="formItems.operator == '3'">
|
|
|
+ <span>≤</span>
|
|
|
+ <el-input-number v-model="formItems.min"></el-input-number>
|
|
|
</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-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-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>
|
|
|
+ <template v-if="formItems.operator == '4'">
|
|
|
+ <span>></span>
|
|
|
+ <el-input-number v-model="formItems.max"></el-input-number>
|
|
|
+ </template>
|
|
|
+ <template v-if="formItems.operator == '5'">
|
|
|
+ <span>≥</span>
|
|
|
+ <el-input-number v-model="formItems.max"></el-input-number>
|
|
|
+ </template>
|
|
|
+ <el-select v-model="formItems.operator" @change="selectoperatorChange($event, formItems.id)"
|
|
|
+ placeholder="请选择" style="width: 120px;margin-left: 20px;">
|
|
|
+ <el-option v-for="operatoritem in operatorlist" :key="operatoritem.id" :label="operatoritem.label"
|
|
|
+ :value="operatoritem.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <div v-if="formItems.attrType == 'select'" style="display: flex;">
|
|
|
+ <el-select multiple v-model="formItems.minArray" placeholder="请选择" style="width: 100%;"
|
|
|
+ @change="selectChange($event, formItems.id, 'min')">
|
|
|
+ <el-option v-for="dict in formItems.dictLabal" :key="dict.code" :label="dict.name"
|
|
|
+ :value="dict.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-checkbox style="margin-left: 10px;" v-if="formItems.attrCode == 'LicenseNo'" v-model="LicenseNoChecked"
|
|
|
+ @change="LicenseNoCheckedChange($event, 'LicenseNo', 'min')">全选</el-checkbox>
|
|
|
+ </div>
|
|
|
+ <el-checkbox-group v-if="formItems.attrType == 'checkbox'" v-model="formItems.minArray"
|
|
|
+ @change="checkboxChange($event, formItems.id, 'min')">
|
|
|
+ <el-checkbox v-for="dict in formItems.dictLabal" :key="dict.id" :label="dict.name"></el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ <div class="flex " v-if="formItems.attrType == 'radio'">
|
|
|
+ <el-radio-group v-model="formItems.min">
|
|
|
+ <el-radio-button v-for="dict in formItems.dictLabal" :key="dict.id" :label="dict.code">{{ dict.name
|
|
|
+ }}</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <el-button v-if="formItems.attrType == 'radio'" size="mini" style="margin-left: 20px;"
|
|
|
+ @click="radiouncheck1(formItems)">取消选择</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="ruledialogVisible = false">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="dispatchAdd">确 定</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import templateTable from "@/components/TemplateTable/index.vue";
|
|
|
-
|
|
|
+import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
|
|
|
export default {
|
|
|
name: "sourceManagement",
|
|
|
- components: { templateTable },
|
|
|
+ components: { templateTable, KtCommonTable },
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogVisible: false,
|
|
|
- activeName: "1",
|
|
|
+ treekeys:[],
|
|
|
+ localForm: {
|
|
|
+ agreementId: "",//协议id
|
|
|
+ insCompanyId: "",
|
|
|
+ insCompanyName: "",
|
|
|
+ priority: "",
|
|
|
+ defaultFlag: "",
|
|
|
+ attrLinks: [],
|
|
|
+ },
|
|
|
+ //操作符字典
|
|
|
+ operator: { "pageNum": 1, "pageSize": 10, "columnFilters": { "label": { "name": "label", "value": "agreement_operator" } } },
|
|
|
+ operatorlist: [],
|
|
|
+ LicenseNoChecked: false,//全选
|
|
|
+ dispatchdialogVisible: false,//调度弹窗
|
|
|
+ excludedialogVisible: false,//排除部门弹窗
|
|
|
+ ruledialogVisible: false,//添加规则弹窗
|
|
|
+ ruleDialogTitle: "添加规则",
|
|
|
+ ruleDialogType: "add",
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "name",
|
|
|
},
|
|
|
+ agreementList: [],
|
|
|
checkList: [],
|
|
|
- insuranceRepertoireList: [],
|
|
|
treeData: [],
|
|
|
pageResult: [], //表格数据
|
|
|
queryFrom: {}, //查询信息
|
|
|
+ dispatchRequest: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ insCompanyId: "",
|
|
|
+ },
|
|
|
+ areanumberplateList: [],//车牌号列表
|
|
|
+ dispatchResult: [],//调度数据列表
|
|
|
+ dynamicFormArray: [],//规则数据集
|
|
|
+ dispatchColumns: [
|
|
|
+ { prop: "insCompanyId", label: "保险公司ID", minWidth: 180 },
|
|
|
+ { prop: "insCompanyName", label: "保险公司", minWidth: 180 },
|
|
|
+ { prop: "agreementName", label: "协议名称", minWidth: 180 },
|
|
|
+ { prop: "dispatchContent", label: "规则描述", minWidth: 160 },
|
|
|
+ { prop: "defaultFlag", label: "是否默认", minWidth: 120, formatter: this.defaultFlagFormatter },
|
|
|
+ { prop: "priority", label: "优先级", minWidth: 120 },
|
|
|
+ ],
|
|
|
tableConfig: {
|
|
|
columns: [
|
|
|
// 数据列
|
|
|
@@ -120,11 +175,20 @@ export default {
|
|
|
optBtns: [
|
|
|
{
|
|
|
type: "primary",
|
|
|
- label: "税源管理",
|
|
|
+ label: "协议调度",
|
|
|
type: "text",
|
|
|
- perm:"agreement:taxSource:config",
|
|
|
+ perm: "agreement:taxSource:config",
|
|
|
click: (row, index) => {
|
|
|
- return this.addSource(row);
|
|
|
+ return this.protocolDispatch(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "primary",
|
|
|
+ label: "排除部门",
|
|
|
+ type: "text",
|
|
|
+ perm: "agreement:taxSource:config",
|
|
|
+ click: (row, index) => {
|
|
|
+ return this.excludeDepartment(row);
|
|
|
},
|
|
|
},
|
|
|
],
|
|
|
@@ -138,6 +202,10 @@ export default {
|
|
|
options: [],
|
|
|
rowData: {},
|
|
|
insuranceRepertoire: [], //产品代码列表
|
|
|
+ taxSourceVo: {
|
|
|
+ insCompanyId: "",
|
|
|
+ agreementTaxExcludeDeptList: [],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -152,117 +220,283 @@ export default {
|
|
|
this.insuranceRepertoire = rescode.data.ddList;
|
|
|
}
|
|
|
});
|
|
|
+ this.$api.insCompany.getAreaLicense("14").then((res) => {
|
|
|
+ let data = [];
|
|
|
+ res.data.map(val => {
|
|
|
+ data.push({
|
|
|
+ code: val.areaNumber,
|
|
|
+ name: val.license,
|
|
|
+ })
|
|
|
+ return val;
|
|
|
+ })
|
|
|
+ this.areanumberplateList = data;
|
|
|
+ });
|
|
|
+ //获取操作符
|
|
|
+ this.$api.dict.findPage(this.operator).then(res => {
|
|
|
+ this.operatorlist = res.data.content;
|
|
|
+ })
|
|
|
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;
|
|
|
- });
|
|
|
- },
|
|
|
- //税源管理返回没值的话赋值方法
|
|
|
- licenseFun() {
|
|
|
- this.$api.dept.license().then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- res.data.forEach((ele, index) => {
|
|
|
- ele.agreementId = "";
|
|
|
- ele.isTaxSource = "0";
|
|
|
+ //选择部门提交
|
|
|
+ excludeSubmit() {
|
|
|
+ this.$api.insCompany.saveOrUpdateExcludeDepts(this.taxSourceVo).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.excludedialogVisible = false;
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
});
|
|
|
- this.tableData = res.data;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- //提交
|
|
|
- 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();
|
|
|
- }
|
|
|
- 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 = [];
|
|
|
+ //获取选中节点
|
|
|
+ treechange(data, node) {
|
|
|
+ this.taxSourceVo.agreementTaxExcludeDeptList = [];
|
|
|
+ node.checkedKeys.map((ele) => {
|
|
|
+ this.taxSourceVo.agreementTaxExcludeDeptList.push(ele);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ add() {
|
|
|
+ this.ruledialogVisible = true;
|
|
|
+ this.ruleDialogType = 'add';
|
|
|
+ this.ruleDialogTitle = '添加规则';
|
|
|
+ },
|
|
|
+ excludecloseDialog(){
|
|
|
+ if (this.treekeys.length) {
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ruleOpenDialog() {
|
|
|
+ if (this.ruleDialogType == 'add') {
|
|
|
+ this.attrQueryList();
|
|
|
+ for (let key in this.localForm ) {
|
|
|
+ if(key!=='insCompanyId' && key!=='insCompanyName'){
|
|
|
+ this.localForm[key] = "";
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ radiouncheck1(data) {
|
|
|
+ data.min = null;
|
|
|
+ },
|
|
|
+ radiouncheck() {
|
|
|
+ this.localForm.defaultFlag = "";
|
|
|
+ },
|
|
|
+ checkboxChange(value, index, prop) {
|
|
|
+ let data = "";
|
|
|
+ value.map((ele) => {
|
|
|
+ data += ele + ",";
|
|
|
+ return;
|
|
|
});
|
|
|
- this.$api.dept.agreement(row.id).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.options = res.data;
|
|
|
+ this.dynamicFormArray.map(val => {
|
|
|
+ if (val.id === index) {
|
|
|
+ val[prop] = data.slice(0, -1);
|
|
|
}
|
|
|
+ return val;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectChange(value, index, prop) {
|
|
|
+ let data = "";
|
|
|
+ value.map((ele) => {
|
|
|
+ data += ele + ",";
|
|
|
+ return;
|
|
|
});
|
|
|
+ this.dynamicFormArray.map(val => {
|
|
|
+ if (val.id === index) {
|
|
|
+ val[prop] = data.slice(0, -1);
|
|
|
+ }
|
|
|
+ return val;
|
|
|
+ })
|
|
|
},
|
|
|
- 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]);
|
|
|
- }
|
|
|
+ //车牌全选
|
|
|
+ LicenseNoCheckedChange(value, name, prop) {
|
|
|
+ let carPlateCollection = this.dynamicFormArray.find(val => val.attrCode == name);
|
|
|
+ carPlateCollection.minArray = [];
|
|
|
+ if (value) {
|
|
|
+ carPlateCollection.dictLabal.forEach(element => {
|
|
|
+ carPlateCollection.minArray.push(element.name)
|
|
|
+ carPlateCollection[prop] = carPlateCollection.minArray.join(',');
|
|
|
});
|
|
|
+ } else {
|
|
|
+ carPlateCollection.minArray = [];
|
|
|
+ carPlateCollection[prop] = "";
|
|
|
}
|
|
|
},
|
|
|
- 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,
|
|
|
- insuranceRepertoire:val.insuranceRepertoire.join(","),
|
|
|
+ //新增
|
|
|
+ dispatchAdd() {
|
|
|
+ this.localForm.attrLinks = this.dynamicFormArray;
|
|
|
+ if (this.ruleDialogType == 'add') {
|
|
|
+ this.$api.insCompany.dispatchaddOrUpdate(this.localForm).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ this.ruledialogVisible = false;
|
|
|
+ this.dispatchFindPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
- });
|
|
|
- this.$api.dept
|
|
|
- .saveTaxSource({
|
|
|
- ...this.rowData,
|
|
|
- agreementTaxList,
|
|
|
- agreementTaxExcludeDeptList,
|
|
|
- agreementTaxExcludeLicenseList,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.dialogVisible = false;
|
|
|
+ } else {
|
|
|
+ this.$api.insCompany.dispatchaddOrUpdate(this.localForm).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
this.$message({
|
|
|
+ type: 'success',
|
|
|
message: res.msg,
|
|
|
- type: "success",
|
|
|
});
|
|
|
- this.findPage();
|
|
|
+ this.ruledialogVisible = false;
|
|
|
+ this.dispatchFindPage();
|
|
|
} else {
|
|
|
- this.$message.error(res.msg);
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ dispatchUpdate({ row, column }) {
|
|
|
+ this.ruleDialogType = 'edit';
|
|
|
+ this.ruleDialogTitle = '编辑规则';
|
|
|
+ this.$api.insCompany.dispatchgetById(row.id).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.localForm = res.data;
|
|
|
+ this.dynamicFormArray = res.data.attrLinks;
|
|
|
+ this.ruledialogVisible = true;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ dispatchDelete({ row, column }) {
|
|
|
+ this.$api.insCompany.dispatchdelete({
|
|
|
+ ids: [row.id]
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ this.dispatchFindPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取属性列表
|
|
|
+ attrQueryList() {
|
|
|
+ this.$api.insCompany.dispatchAttrList().then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ let data = res.data;
|
|
|
+ data.map(ele => {
|
|
|
+ switch (ele.attrType) {
|
|
|
+ case 'inputNumber':
|
|
|
+ ele.operator = '1';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (ele.attrName == '车牌号') {
|
|
|
+ ele.dictLabal = this.areanumberplateList;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.dynamicFormArray = data;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
+ dispatchFindPage(data) {
|
|
|
+ if (data && data.pageRequest) {
|
|
|
+ this.dispatchRequest.pageNum = data.pageRequest.pageNum;
|
|
|
+ this.dispatchRequest.pageSize = data.pageRequest.pageSize;
|
|
|
+ } else {
|
|
|
+ this.dispatchRequest.pageNum = 1;
|
|
|
+ this.dispatchRequest.pageSize = 20;
|
|
|
+ }
|
|
|
+ this.$api.insCompany
|
|
|
+ .dispatchQueryPage(this.dispatchRequest)
|
|
|
+ .then((res) => {
|
|
|
+ this.dispatchResult = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //排除部门弹窗
|
|
|
+ excludeDepartment(row) {
|
|
|
+ this.excludedialogVisible = true;
|
|
|
+ this.taxSourceVo.insCompanyId = row.id;
|
|
|
+ this.$api.insCompany.getDeptIdsByCompanyId(row.id).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ res.data.map((ele, index) => {
|
|
|
+ this.taxSourceVo.agreementTaxExcludeDeptList.push(ele);
|
|
|
+ return ele;
|
|
|
+ });
|
|
|
+ this.treekeys = this.taxSourceVo.agreementTaxExcludeDeptList;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ defaultFlagFormatter(row, column) {
|
|
|
+ let operatorType = row.defaultFlag;
|
|
|
+ if (operatorType) {
|
|
|
+ return "是"
|
|
|
+ } else {
|
|
|
+ return "否"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取列表
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //协议调度提交
|
|
|
+ protocolDispatch(row) {
|
|
|
+ this.dispatchRequest.insCompanyId = row.id;
|
|
|
+ this.localForm.insCompanyId = row.id;
|
|
|
+ this.localForm.insCompanyName = row.name;
|
|
|
+ this.dispatchFindPage();
|
|
|
+ this.attrQueryList();
|
|
|
+ this.$api.insCompany.findAgreementByCompanyId({ partnerCompaniesId: row.id }).then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ //清空搜索参数
|
|
|
+ this.agreementList = res.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.dispatchdialogVisible = true;
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+/deep/ {
|
|
|
+ .scrollable-dialog .el-dialog__body {
|
|
|
+ max-height: 600px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|