Преглед изворни кода

Merge branch 'dev' of http://www.baoxianzhanggui.com:8090/sxzgd/vue-insagent-pc into dev

lihongxiao пре 2 година
родитељ
комит
ca6a6117d2

+ 60 - 0
src/http/moudules/insCompany.js

@@ -588,3 +588,63 @@ export const deleteBatch = (data) => {
     data
   })
 }
+
+/**
+ * 税源管理
+ */
+
+//调度列表分页查询
+export const dispatchQueryPage = (data) => {
+  return axios({
+    url: '/tax/source/new/queryPage',
+    method: "post",
+    data
+  })
+}
+//属性配置列表获取
+export const dispatchAttrList = () => {
+  return axios({
+    url: '/tax/source/new/attr/list',
+    method: "get",
+  })
+}
+//协议调度添加和修改
+export const dispatchaddOrUpdate = (data) => {
+  return axios({
+    url: '/tax/source/new/addOrUpdate',
+    method: "post",
+    data
+  })
+}
+//编辑回显接口
+export const dispatchgetById = (data) => {
+  return axios({
+    url: '/tax/source/new/getById?id='+data,
+    method: "get",
+
+  })
+}
+//删除接口
+export const dispatchdelete = (data) => {
+  return axios({
+    url: '/tax/source/new/delete',
+    method: "post",
+    data
+  })
+}
+//排除部门新增/删除
+export const saveOrUpdateExcludeDepts = (data) => {
+  return axios({
+    url: '/tax/source/new/saveOrUpdateExcludeDepts',
+    method: "post",
+    data
+  })
+}
+
+//排除部门查询
+export const getDeptIdsByCompanyId = (insCompanyId) => {
+  return axios({
+    url: '/tax/source/new/getDeptIdsByCompanyId?insCompanyId='+insCompanyId,
+    method: "get",
+  })
+}

+ 1 - 1
src/views/AgreementManage/CarInsurance/AgreementEntry.vue

@@ -1922,7 +1922,7 @@ export default {
         costStartDate: "",
         costsEndDate: "",
         costsDescription: "",
-        isEffective: "",
+        isEffective: "2",
         pageNum: 1,
         pageSize: 20,
       },

+ 406 - 172
src/views/AgreementManage/CarInsurance/SourceManagement.vue

@@ -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>

+ 74 - 17
src/views/Task/daikeComponents/KtLetter.vue

@@ -1245,7 +1245,7 @@
                     </el-select>
                   </el-form-item>
                   <el-form-item label=" ">
-                    <el-select clearable v-model="guoRenaccidentForm.prodCode" 
+                    <el-select clearable v-model="guoRenaccidentForm.prodCode"
                       @change="grcxchangeChild">
                       <el-option v-for="(item, index) in guoRenaccidentDataListChild" :key="item.projectCode"
                         :label="item.projectName" :value="item.projectCode"></el-option>
@@ -4104,7 +4104,7 @@ export default {
     zijinInsuranceChange(index) {
       this.zijintemplateSelection=index
       console.log(index,222222);
-      this.zijinInsuranceDataTable = []; 
+      this.zijinInsuranceDataTable = [];
       this.$refs.expandTable[0].clearSelection();
       index.forEach(item => {
         this.zijinInsuranceDataTable.push(
@@ -4183,6 +4183,23 @@ export default {
         this.guoRenaccidentDataListChild =this.guoRenaccidentDataList.find(e=>e.projectCode==index).children;
         this.guoRenaccidentalDrivingVo.parentName = this.guoRenaccidentDataList.find(e=>e.projectCode==index).projectName;
         this.guoRenaccidentalDrivingVo.parentCode = this.guoRenaccidentDataList.find(e=>e.projectCode==index).projectCode;
+        // let data = await this.$api.letter.syncNonAutoInsGuoren({
+        //   goodsCode: index,
+        //   agreementId: this.guoRenaccidentForm.agreementId
+        // });
+        // if (data.code == 200) {
+        //   let num = 0;
+        //   data.data.forEach(item => {
+        //     num += Number(item.premium);
+        //   });
+
+        //   this.accidentLoading = false;
+
+        // } else {
+          // this.accidentLoading = false;
+        //   this.$message.error(data.msg);
+        //   this.guoRenaccidentDataListChild = [];
+        // }
       }
     },
     // 国任选择意外险子级类型
@@ -4199,8 +4216,8 @@ export default {
         sumPremium: Number(list.sumPremium)
         // appnum:Number(list.appnum)
       };
-      this.guoRenInsuranceDataTable = list.son;
-      this.guoRenaccidentalDrivingVo=Object.assign({...list,...this.guoRenaccidentalDrivingVo}) 
+      this.guoRenaccidenttableData = list.son;
+      this.guoRenaccidentalDrivingVo=Object.assign({...list,...this.guoRenaccidentalDrivingVo})
 
     },
     // 选择意外险类型
@@ -4216,9 +4233,25 @@ export default {
       this.accidentDataList.find(val => val.projectCode == index).son.forEach(item => {
         item.sumAmount= Number(item.amount) * Number(this.accidentForm.seatNum);
         });
-      this.yongchengInsuranceDataTable =  this.accidentDataList.find(val => val.projectCode == index).son
-      this.accidentPremium =  this.accidentForm.sumPremium;
-      
+      this.accidenttableData =  this.accidentDataList.find(val => val.projectCode == index).son
+
+        this.accidentPremium =  this.accidentForm.sumPremium;
+      // this.accidentForm.fen = "1";
+      // let data = await this.$api.letter.ycgainAccidentSchemeList({
+      //   companyCode: this.accidentForm.companyId,
+      //   code: index,
+      //   agreementId: this.accidentForm.agreementId,
+      //   seatNum: Number(this.carInfo.seatCount)
+      // });
+      // if (data.code == 200) {
+      //   let num = 0;
+      //   data.data.forEach(item => {
+      //     num += Number(item.premium);
+      //   });
+      //   this.accidentPremium = num;
+      //   this.accidentForm.premium = num;
+      //   this.accidenttableData = data.data;
+      // }
     },
     numberCopieschange(index) {
       this.accidentForm.sumPremium = Number(this.accidentPremium) * index;
@@ -4599,7 +4632,7 @@ export default {
       });
     },
 
-   
+
 
     //人寿驾意险选择
     RSDrivingChange(row) {
@@ -4615,7 +4648,7 @@ export default {
     //安盛驾意险选择
     ASDrivingRadio(row) {
       this.anshengInsurancetype = row.projectCode;
-      this.anshengaccidentalDrivingVo=Object.assign({...row,...this.anshengaccidentalDrivingVo}) 
+      this.anshengaccidentalDrivingVo=Object.assign({...row,...this.anshengaccidentalDrivingVo})
       // this.anshengaccidentalDrivingVo.projectCode = row.projectCode;
       // this.anshengaccidentalDrivingVo.projectName = row.projectName;
     },
@@ -4875,7 +4908,7 @@ export default {
       } else {
       }
     },
-   
+
     clearAccidentForm() {
       this.accidentForm = {};
       this.accidentForm.fen = 1;
@@ -5359,6 +5392,7 @@ export default {
     },
     //永安报价
     yongan(num, id) {
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       let params = {
         orderNo: this.orderno,
         companyId: id,
@@ -5385,7 +5419,9 @@ export default {
               policyHolderInfo: this.policyHolderInfo,
               kindList: this.kindList,
               riskList: this.riskList,
-              vehicleAndVesselTax: this.vehicleAndVesselTaxForm
+              vehicleAndVesselTax: this.vehicleAndVesselTaxForm,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
+
             };
             return this.$api.letter[this.apiInterfaceName](param).then(res => {
               this.yongan(num, id);
@@ -5480,7 +5516,7 @@ export default {
     //中煤报价
     zhongmei(num, id) {
       let accidentalDrivingVo = {};
-   
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       // if (this.accidentFormZM.projectCode) {
       //   accidentalDrivingVo = {
       //     projectCode: this.accidentFormZM.projectCode,
@@ -5502,7 +5538,9 @@ export default {
         accidentalDrivingVo,
         orderNo: this.orderno,
         companyId: id,
-        agreementId: this.totalCompanyList[num].agreementId
+        agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
+
       };
       this.$api.letter.zhongmeiquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -5574,12 +5612,15 @@ export default {
       //   accidentalDrivingVo.rideRiskName=this.dajiaaccidentalDrivingVo.cvrgName;
       //   accidentalDrivingVo.quantity=this.dajiaaccidentalDrivingVo.quantity;
       // }
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
 
       let params = {
         accidentalDrivingVo: this.dajiaaccidentalDrivingVo,
         orderNo: this.orderno,
         companyId: id,
-        agreementId: this.totalCompanyList[num].agreementId
+        agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
+
       };
       this.$api.letter.dajiaquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -5645,10 +5686,13 @@ export default {
     },
     //华泰报价
     huatai(num, id) {
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       let params = {
         orderNo: this.orderno,
         companyId: id,
-        agreementId: this.totalCompanyList[num].agreementId
+        agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
+
       };
       this.$api.letter.huataiquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -5707,11 +5751,13 @@ export default {
     },
     //紫金报价
     zijin(num, id) {
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       let params = {
         accidentalDrivingVo: this.accidentalDrivingVo,
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
         coefficient: this.totalCompanyList[num].coefficient
       };
       this.$api.letter.zijinquote(params).then(res => {
@@ -5781,6 +5827,7 @@ export default {
       this.isInsuredShow = false;
       this.isApplicantShow = false;
       let accidentalDrivingVo = {};
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       if (this.accidentForm.projectCode) {
         let data= this.accidentDataList.find(
           val => val.projectCode == this.yongchengtemplateSelection
@@ -5798,7 +5845,8 @@ export default {
         cqryCdeSy: this.cqryCdeSy,
         renewalCodeJq: this.renewalCodeJq,
         renewalCodeSy: this.renewalCodeSy,
-        agreementId: this.totalCompanyList[num].agreementId
+        agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
       };
       this.$api.letter.yongchengquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -5879,6 +5927,7 @@ export default {
     },
     //国任报价
     guoRen(num, id) {
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       let guoRenSpecialAgreementVo = [];
       this.zijinengageList.forEach(val => {
         guoRenSpecialAgreementVo.push({
@@ -5902,6 +5951,7 @@ export default {
         renewalCodeJq: this.renewalCodeJq,
         renewalCodeSy: this.renewalCodeSy,
         agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
         guoRenSpecialAgreementVo
       };
       this.$api.letter.guorenquote(params).then(res => {
@@ -5981,6 +6031,7 @@ export default {
     },
     //渤海报价
     bohai(num, id) {
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
       let accidentalDrivingVo = [];
       if (this.boHaiaccidentForm.packageCode) {
         accidentalDrivingVo = [
@@ -6002,6 +6053,8 @@ export default {
         renewalCodeJq: this.renewalCodeJq,
         renewalCodeSy: this.renewalCodeSy,
         agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
+
         userId: this.userId
       };
       this.$api.letter.bohaiquote(params).then(res => {
@@ -6084,12 +6137,16 @@ export default {
     quoteInsurance(num, id, namesimple, apiType) {
       let api = apiType == 2 ? "pythonquote" : "anshengquote";
       let ccidenttype = this.totalCompanyList[num].cnName;
+      let isTaxSource = this.totalCompanyList[num].isTaxSource;
+
       let params = {
         accidentalDrivingVo: this[ccidenttype + "accidentalDrivingVo"],
         orderNo: this.orderno,
         companyId: id,
         userId: this.userId,
-        agreementId: this.totalCompanyList[num].agreementId
+        agreementId: this.totalCompanyList[num].agreementId,
+        isTaxSource: isTaxSource == 1 ? isTaxSource : null,
+
       };
       if (namesimple == "中国人寿" && this.lastCompanyId) {
         params.discount = this.totalCompanyList[num].discount;