Ver Fonte

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

lihongxiao há 3 anos atrás
pai
commit
4d4414b532

+ 3 - 2
config/dev.env.js

@@ -5,8 +5,9 @@ const prodEnv = require('./prod.env')
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG:'"dev"',
-  // BASE_URL: '"http://39.98.239.48/web-api"',//测试服务器
-  BASE_URL: '"http://192.168.0.111:8080/"' //大哥
+  BASE_URL: '"http://39.98.239.48/web-api"',//测试服务器
+  // BASE_URL: '"http://192.168.0.111:8080/"' //大哥
+  // BASE_URL: '"http://192.168.0.115:8080/"'
   // BASE_URL: '"http://192.168.0.14:8080/"' //君
 
 })

+ 21 - 1
src/http/moudules/insCompany.js

@@ -14,6 +14,13 @@ export const gainTopList = (data) => {
       method: 'get',
   })
 }
+//获取其他费用权限
+export const shutdown = () => {
+  return axios({
+      url: '/plt/agreement/shutdown',
+      method: 'get'
+  })
+}
 //通过id得到一个保险公司实体
 export const getInsCompanyById = (id) => {
     return axios({
@@ -21,7 +28,20 @@ export const getInsCompanyById = (id) => {
         method: 'get'
     })
 }
-
+//获取保险公司驾意险产品
+export const getByCompanyId = (companyId) => {
+  return axios({
+      url: '/ptl/nonCar/product/getByCompanyId/'+companyId,
+      method: 'get',
+  })
+}
+//查询地区车牌
+export const getAreaLicense = (parentNumber) => {
+  return axios({
+      url: '/plt/areaLicense/getAreaLicense?parentNumber='+parentNumber,
+      method: 'get',
+  })
+}
 // 分页查询协议
 export const findPage = (data) => {
     return axios({

+ 9 - 9
src/http/moudules/product/product.js

@@ -4,7 +4,7 @@ import axios from '../../axios'
 // 分页查询协议
 export const findPage = (data) => {
     return axios({
-        url: '/esmProduct/findPage',
+        url: '/ptl/nonCar/product/page',
         method: 'post',
         data
     })
@@ -13,16 +13,16 @@ export const findPage = (data) => {
 // 保存产品
 export const addProduct = (data) => {
     return axios({
-        url: '/esmProduct/addProduct',
+        url: '/ptl/nonCar/product',
         method: 'post',
         data
     })
 }
 // 修改产品信息
-export const editProduct = (data) => {
+export const editProduct = (productId,data) => {
     return axios({
-        url: '/esmProduct/editProduct',
-        method: 'post',
+        url: '/ptl/nonCar/product/'+productId,
+        method: 'put',
         data
     })
 }
@@ -35,10 +35,10 @@ export const productTree = (id) => {
 }
 
 // 删除产品
-export const deleteProduct = (data) => {
+export const deleteProduct = (productId) => {
     return axios({
-        url: '/esmProduct/deleteProduct?idList='+data,
-        method: 'post'
+        url: '/ptl/nonCar/product/'+productId,
+        method: 'delete'
     })
 }
 
@@ -76,4 +76,4 @@ export const upStatus = (data) => {
         method: 'post',
         data
     })
-}
+}

Diff do ficheiro suprimidas por serem muito extensas
+ 258 - 644
src/views/AgreementManage/CarInsurance/AgreementEntry.vue


+ 254 - 272
src/views/ProductManage/CarInsurance/ProductEntry.vue

@@ -1,310 +1,292 @@
 <template>
   <div>
     <el-main ref="elMain" style="padding: 0px;">
-        <!-- 工具区域Start -->
-        <el-row style="margin: 0px 20px;">
-          <!-- <kt-button size="small" style="color: #409EFF;" icon="el-icon-circle-plus" label="添加车险产品" type="text" perms="sys:user:add" @click="handleAddProduct" /> -->
-          <kt-button style="background-color: #52C578;border:#52C578;margin-left: 15px;margin-bottom: 20px;"  icon="fa fa-plus" label="添加产品" type="primary" perms="sys:dept:add" @click="handleAddProduct" />
-        </el-row>
-        <kt-common-table  permsEdit="product:product:edit" permsDelete="product:product:delete"  :data="pageResult" :columns="columns" editButtonName="编辑"  deleteButtonName="删除" :showBatchDelete="true" @findPage="findPage" @handleEdit="handleTableEdit" @handleDeleteFlag="handleTableDeleteFlag" @handleDelete="handleTableBatchDelete">
-        </kt-common-table>
+      <!-- 工具区域Start -->
+      <el-row style="margin: 0px 20px;">
+        <!-- <kt-button size="small" style="color: #409EFF;" icon="el-icon-circle-plus" label="添加车险产品" type="text" perms="sys:user:add" @click="handleAddProduct" /> -->
+        <kt-button style="background-color: #52C578;border:#52C578;margin-left: 15px;margin-bottom: 20px;"
+          icon="fa fa-plus" label="添加产品" type="primary" perms="sys:dept:add" @click="handleAddProduct" />
+      </el-row>
+      <kt-common-table permsEdit="product:product:edit" permsDelete="product:product:delete" :data="pageResult"
+        :columns="columns" editButtonName="编辑" deleteButtonName="删除" :showBatchDelete="true" @findPage="findPage"
+        @handleEdit="handleTableEdit" @handleDeleteFlag="handleTableDeleteFlag" @handleDelete="handleTableBatchDelete">
+      </kt-common-table>
     </el-main>
 
     <!-- 新增对话框 -->
-    <el-dialog :title="dialogTitle" v-dialogDrag :visible.sync="productDialogVisible" width="800px" :before-close="productHandleClose" @close="closeDialog">
-        <el-row v-if="operType=='ADD'"  style="color: red;margin:0 0 20px 20px;">注:产品编码前两位数字为产品类型(例如:产品编码ZG01002,'01'为车险)</el-row>
-        <el-form :model="dataForm" :rules="dataFormRules" ref="dataForm" @keyup.enter.native="submitForm" label-width="100px" size="small">
-            <el-row>
-              <el-col :span="8">
-                <el-form-item label="产品编码" prop="id">
-                  <div style="display: flex;" v-if="operType=='ADD'"><div style="width: 65px;text-align: right;margin-right: 10px;">{{dataForm.parentId}}</div><el-input type="text" v-model="idCustom"></el-input></div>
-                  <el-input v-model="dataForm.id" v-if="operType=='EDIT'" disabled></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="8">
-                <el-form-item label="产品名称" prop="name">
-                  <el-input v-model="dataForm.name"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="8">
-                <el-form-item label="排序" prop="orderNum">
-                  <el-input-number
-                    v-model="dataForm.orderNum"
-                    placeholder="排序"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
-              <!-- <el-col :span="8">
-                <el-form-item label="是否启用" prop="isvalid">
-                  <el-select style="width:100%" v-model="dataForm.isvalid" placeholder="请选择">
-                    <el-option label="是" value="0"></el-option>
-                    <el-option label="否" value="1"></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
-              <!-- <el-col :span="8">
-                <el-form-item label="排序" prop="orderNum">
-                  <el-input-number
-                    v-model="dataForm.orderNum"
-                    placeholder="排序"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </el-form-item>
-              </el-col> -->
-            </el-row>
-            <el-row>
-              <el-col :span="24">
-                <el-form-item label="备注" style="width: 100%;">
-                  <el-input
-                    type="textarea"
-                    :rows="3"
-                    :autosize="{ minRows: 3, maxRows: 4}"
-                    placeholder="请输入内容"
-                    v-model="dataForm.remark">
-                  </el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-        </el-form>
-
+    <el-dialog :title="dialogTitle" v-dialogDrag :visible.sync="productDialogVisible" width="800px" @open="closeDialog">
+      <el-form :model="dataForm" :rules="dataFormRules" ref="dataForm" @keyup.enter.native="submitForm"
+        label-width="100px" size="small">
+        <el-row>
+          <el-col :span="10">
+            <el-form-item label="产品名称" prop="productName">
+              <el-input v-model="dataForm.productName" placeholder="格式:产品名称+保司简称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10" :offset="2">
+            <el-form-item label="归属保司" prop="companyId">
+              <el-select v-model="dataForm.companyId" placeholder="请选择归属保司" filterable style="width: 100%;">
+                <el-option v-for="item in prodInsurance" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10">
+            <el-form-item label="归属险类" prop="insuranceCode">
+              <el-select v-model="dataForm.insuranceCode" placeholder="请选择归属险类" style="width: 100%;">
+                <el-option v-for="item in nonCarInsuranceCodeoptions" :key="item.dictValue" :label="item.dictTag"
+                  :value="item.dictValue"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10" :offset="2">
+            <el-form-item label="产品代码">
+              <el-input v-model="dataForm.productCode" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10">
+            <el-form-item label="保司代码" prop="nonCarInsuranceCode">
+              <el-input v-model="dataForm.nonCarInsuranceCode" placeholder="请输入保司代码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10" :offset="2">
+            <el-form-item label="是否有效" prop="isEffective">
+              <el-select v-model="dataForm.isEffective" placeholder="请选择是否" style="width:100%;">
+                <el-option label="有效" value="0"></el-option>
+                <el-option label="无效" value="1"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="22">
+            <el-form-item label="备注" style="width: 100%;">
+              <el-input type="textarea" :rows="3" :autosize="{ minRows: 3, maxRows: 4 }" placeholder="请输入内容"
+                v-model="dataForm.remark">
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="small" @click="productDialogVisible = false">取 消</el-button>
-        <el-button size="small"  type="primary" @click="submitForm">确 定</el-button>
+        <el-button size="small" type="primary" @click="submitForm">确 定</el-button>
       </span>
     </el-dialog>
   </div>
 </template>
 <script>
-  import KtButton from "@/views/Core/KtButton";//按钮权限组件
-  import KtCommonTable from "@/views/Core/KtCommonTable.vue";//表格组件
-  import CommonUtil from "@/utils/comutil.js";
-  export default {
-    components: {
-      KtButton,
-      KtCommonTable
-    },
-    data() {
-      return {
-        // 右侧列表查询数据Start
-        pageResult: {},
-        pageRequest: {  //查询的默认条件
-          pageNum: 1,
-          pageSize: 20,
-          columnFilters: {
-            "parentId": {
-              "name": "parentId",
-              "value": "ZG01"
-            }
-          }
-        },
-        columns: [ // 数据列
-            { prop: "id",label: "产品编码",minWidth: 80,sortable: false},
-            { prop: "name",label: "产品名称",minWidth: 80,sortable: false},
-            { prop: "remark",label: "备注",minWidth: 80,sortable: false},
-            { prop: "isvalid",label: "是否启用",minWidth: 80,sortable: false,formatter: this.usesFormatter},
-          ],
-        usesoptions:[
-            {label:"已启用",value:"0"},
-            {label:"未启用",value:"1"},
-          ],
-        // 右侧列表查询数据End
+import KtButton from "@/views/Core/KtButton";//按钮权限组件
+import KtCommonTable from "@/views/Core/KtCommonTable.vue";//表格组件
+import CommonUtil from "@/utils/comutil.js";
+export default {
+  components: {
+    KtButton,
+    KtCommonTable
+  },
+  data() {
+    return {
+      // 右侧列表查询数据Start
+      pageResult: {},
+      pageRequest: {  //查询的默认条件
+        pageNum: 1,
+        pageSize: 20,
+      },
+      columns: [ // 数据列
+        { prop: "productCode", label: "产品代码", minWidth: 80, sortable: false },
+        { prop: "productName", label: "产品名称", minWidth: 80, sortable: false },
+        { prop: "companyId", label: "归属保司", minWidth: 80, sortable: false },
+        { prop: "insuranceCode", label: "归属险类", minWidth: 80, sortable: false },
+        { prop: "nonCarInsuranceCode", label: "褒保司代码", minWidth: 80, sortable: false },
+        { prop: "remark", label: "备注", minWidth: 80, sortable: false },
+        { prop: "isEffective", label: "是否有效", minWidth: 80, sortable: false, },
+      ],
+      usesoptions: [
+        { label: "已启用", value: "0" },
+        { label: "未启用", value: "1" },
+      ],
+      // 产品字段
+      dataForm: {
+        companyId: "",//归属保司
+        insuranceCode: "",//归属险类
+        isEffective: "",//是否有效
+        nonCarInsuranceCode: "",//保司代码
+        productCode: "",
+        productName: "",//产品名称
+        remark: "",//备注
+      },
+      dataFormRules: {
+        productName: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
+        companyId: [{ required: true, message: "归属保司必选", trigger: "blur" }],
+        insuranceCode: [{ required: true, message: "归属险类必选", trigger: "blur" }],
+        nonCarInsuranceCode: [{ required: true, message: "保司代码不能为空", trigger: "blur" }],
+        isEffective: [{ required: true, message: "是否有效必选", trigger: "blur" }]
+      },
+      productDialogVisible: false, //控制产品对话框
+      operType: "ADD", //'ADD','EDIT'
+      dialogTitle: "新增",
+      idCustom: "",
+      nonCarInsuranceCodeoptions: [],//险类代码字典
+      prodInsurance: [],
+      id: "",
+    };
+  },
+  created() {
+    this.getDicType('nonCarInsuranceCode')
+    this.insCompanyquery();
+  },
+  watch: {
 
-        // 产品字段
-        dataForm:{
-          id:"",
-          isvalid:"0",
-          name:"",
-          orderNum:0,
-          parentId:"",
-          parentName:"",
-          remark:"",
-          delFlag:0
-        },
-        dataFormRules:{
-            name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
-            isvalid: [{ required: true, message: "请选择是否启用", trigger: "blur" }]
-        },
-        productDialogVisible: false, //控制产品对话框
-        operType: "ADD", //'ADD','EDIT'
-        dialogTitle:"新增",
-        idCustom:""
+  },
+  methods: {
+    insCompanyquery() {
+      this.$api.insCompany.gainTopList("1").then(res => {
+        this.prodInsurance = res.data;
+      })
+    },
+    //--tree begin-------
+    handleTableEdit({ row, index }) {
+      this.operType = "EDIT";//'ADD','EDIT'
+      this.dataForm.dialogTitle = "修改";
+      this.dataForm = {
+        companyId: row.companyId,
+        insuranceCode: row.insuranceCode,
+        isEffective: row.isEffective,
+        nonCarInsuranceCode: row.nonCarInsuranceCode,
+        productCode: row.productCode,
+        productName: row.productName,
+        remark: row.remark,
       };
+      this.id = row.id;
+      this.productDialogVisible = true;
     },
-    watch:{
-      idCustom(val){
-        this.dataForm.id = this.dataForm.parentId +this.idCustom;
-      }
+    handleTableDeleteFlag(data) {
+      this.$api.product.deleteProduct(data.row.id).then(res => {
+        if (res.code == "200") {
+          this.$message({
+            message: '删除成功',
+            type: 'success'
+          })
+        } else {
+          this.$message({
+            message: '操作失败',
+            type: 'error'
+          })
+        }
+      })
     },
-    methods: {
-      usesFormatter(row, column) {
-          let isvalid = row.isvalid;
-          return CommonUtil.getDataName({dataList: this.usesoptions, value: 'value', label: 'label', data: isvalid})
-      },
-
-      //--tree begin-------
-      handleTableEdit({row,index}){
-        this.operType= "EDIT";//'ADD','EDIT'
-        this.dialogTitle="修改";
-        row.isvalid = row.isvalid.toString();
-        Object.assign(this.dataForm,row);
-        this.productDialogVisible = true;
-      },
-      handleTableDeleteFlag(data){
-        this.$api.product.productTree(data.params[0].id).then(res => {
-          console.log(res)
-          if(res.data.length>1){
+    handleTableBatchDelete(data) {
+      let params = [];
+      let isFalg = true;
+      for (let i = 0; i < data.params.length; i++) {
+        this.$api.product.productTree(data.params[i].id).then(res => {
+          if (res.data.length > 1) {
+            isFalg = false;
             this.$message({
-              message: '产品类型下存在产品,请先清空产品',
+              message: '产品类型(' + res.data[0].id + '-' + res.data[0].name + ')下存在产品,请先清空产品',
               type: 'info'
             })
-          }else{
-            let params = [];
-            params.push(data.params[0].id);
+          }
+          params.push(res.data[0].id);
+          if ((i == (data.params.length - 1)) && isFalg) {
             this.$api.product.deleteProduct(params).then(data != null ? data.callback : '')
           }
         });
-      },
-      handleTableBatchDelete(data){
-        let params = [];
-        let isFalg = true;
-        for(let i=0;i<data.params.length;i++){
-          this.$api.product.productTree(data.params[i].id).then(res => {
-            if(res.data.length>1){
-              isFalg = false;
-              this.$message({
-                message: '产品类型('+res.data[0].id+'-'+res.data[0].name+')下存在产品,请先清空产品',
-                type: 'info'
-              })
-            }
-            params.push(res.data[0].id);
-            if((i == (data.params.length-1)) && isFalg){
-              this.$api.product.deleteProduct(params).then(data != null ? data.callback : '')
-            }
-          });
-        }
-      },
-      //-- tree end-------
+      }
+    },
+    //-- tree end-------
 
-      // 右侧按钮方法Start
-      handleAddProduct(){
-          this.operType= "ADD";//'ADD','EDIT'
-          this.dialogTitle="新增";
-          this.dataForm.parentId= 'ZG01';
-          this.productDialogVisible = true;
-      },
-      // 右侧按钮方法End
+    // 右侧按钮方法Start
+    handleAddProduct() {
+      this.operType = "ADD";//'ADD','EDIT'
+      this.dialogTitle = "新增";
+      this.productDialogVisible = true;
+    },
+    // 右侧按钮方法End
 
-      // 右侧列表的方法Start
-      findPage(data) {
+    // 右侧列表的方法Start
+    findPage(data) {
       // 获取分页数据
-        if(data && data.pageRequest){
-          this.pageRequest.pageNum = data.pageRequest.pageNum;
-          this.pageRequest.pageSize = data.pageRequest.pageSize;
+      if (data && data.pageRequest) {
+        this.pageRequest.pageNum = data.pageRequest.pageNum;
+        this.pageRequest.pageSize = data.pageRequest.pageSize;
+      }
+      console.log(this.pageRequest)
+      this.$api.product.findPage(this.pageRequest).then((res) => {
+        this.pageResult = res.data;
+      }).then(data != null ? data.callback : '')
+    },
+    closeDialog() {
+      if (this.operType == "ADD") {
+        for (let key in this.dataForm) {
+          this.dataForm[key] = "";
         }
-        console.log(this.pageRequest)
-        this.$api.product.findPage(this.pageRequest).then((res) => {
-          this.pageResult = res.data;
-        }).then(data != null ? data.callback : '')
-      },
-      // 关闭新增对话框
-      productHandleClose(done) {
-        this.$confirm('确认关闭?')
-          .then(_ => {
-            done();
-          })
-          .catch(_ => {});
-      },
-      closeDialog(){
-          this.$refs['dataForm'].resetFields()
-          for (let key in this.dataForm) {
-            this.dataForm[key] = "";
-          }
-          this.idCustom = "";
-          this.dataForm.delFlag = "0";
-          this.dataForm.isvalid = "0";
-      },
-      submitForm(){
-        if(this.operType == 'ADD'){
-          this.dataForm.id = this.dataForm.id.toUpperCase();
-
-          var regular = /^[0-9]+$/;
-          if (!(regular.test(this.idCustom))) {
-            return  this.$message({message: '该产品编码部分须由数字组成',type: 'info'})
+      }
+    },
+    submitForm() {
+      this.$refs.dataForm.validate((valid) => {
+        if (valid) {
+          if (this.operType == 'ADD') {
+            this.$api.product.addProduct(this.dataForm).then((res) => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success'
+                })
+                this.findPage();
+                this.productDialogVisible = false;
+              } else {
+                this.$message({
+                  message: '操作失败',
+                  type: 'error'
+                })
+              }
+            })
+          } else {
+            this.$api.product.editProduct(this.id, this.dataForm).then((res) => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '修改成功',
+                  type: 'success'
+                })
+                this.findPage();
+                this.productDialogVisible = false;
+              } else {
+                this.$message({
+                  message: '操作失败',
+                  type: 'error'
+                })
+              }
+            })
           }
-        }
-        this.$refs.dataForm.validate((valid) => {
-          if (valid) {
-            this.$confirm('确认提交吗?', '提示', {}).then(() => {
-
-               let params = {};
-               Object.assign(params,this.dataForm);
-               console.log(params);
-
-               if(this.operType == 'ADD'){
-                 this.$api.product.addProduct(params).then((res)=>{
-                   console.log(res)
-                   if(res.code == 200){
-                       this.$message({
-                         message: '操作成功',
-                         type: 'success'
-                       })
-                       this.findPage();
-                       this.productDialogVisible = false;
-                   }else{
-                     this.$message({
-                       message: '操作失败',
-                       type: 'error'
-                     })
-                   }
-                 })
-               }else{
-                 this.$api.product.editProduct(params).then((res)=>{
-                   console.log(res)
-                   if(res.code == 200){
-                       this.$message({
-                         message: '操作成功',
-                         type: 'success'
-                       })
-                       this.findPage();
-                       this.productDialogVisible = false;
-                   }else{
-                     this.$message({
-                       message: '操作失败',
-                       type: 'error'
-                     })
-                   }
-                 })
-               }
-               this.findLeftTreeData();
-            }).catch(() => {
 
-            });
 
-          }
-        })
-      }
-    }
+        }
+      })
+    },
+    //--数据字典 begin --
+    getDicType(type) {
+      this.$api.insCompany.dicType(type).then(res => {
+        if (res.code == 200) {
+          this[type + 'options'] = res.data.ddList;
+        }
+      })
+    },
+    //--数据字典 end --
   }
+}
 </script>
 
 <style scoped>
-  /* 顶部查询条件样式Start */
-  .queryFrom .el-row {
-    margin: 10px 0px;
-  }
+/* 顶部查询条件样式Start */
+.queryFrom .el-row {
+  margin: 10px 0px;
+}
 
-  .queryFrom .el-form-item {
-    margin-bottom: 0px;
-  }
+.queryFrom .el-form-item {
+  margin-bottom: 0px;
+}
 
-  .queryFrom .queryButton .el-form-item__content {
-    margin-left: 40px !important;
-  }
+.queryFrom .queryButton .el-form-item__content {
+  margin-left: 40px !important;
+}
 
-  /* 顶部查询条件样式End */
+/* 顶部查询条件样式End */
 </style>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff