bding 1 年之前
父節點
當前提交
eb7862bd3f

+ 22 - 3
src/api/modules/contractApi.js

@@ -224,10 +224,29 @@ const contractInterface={
 	//获取历史合同
 	getHistoryContract:params=>{
 		return http.get('/custom/company/last_contract/detail/withoutDate',params)
-	}
-
-
+	},
+	// 合同列表接口
+	getAllocationContract:params=>{
+		return http.get('/cygx/allocation/company_contract_list',params)
+	},
+	// 申请服务更新-签约历史(单个详情)
+	getHistoryDetail:params=>{
+		return http.get('/custom/apply/contract/history/detail',params)
+	},
+	// 派点详情
+	getAllocationDetail:params=>{
+		return http.get('/cygx/allocation/detail',params)
+	},
+	// 更新派点接口
+	getAllocationDetailUpdate:params=>{
+		return http.post('/cygx/allocation/update',params)
+	},
+	// 派点统计
+	getAllocationStatistic:params=>{
+		return http.get('/cygx/allocation/statistics',params)
+	},
 
+	
 }
 
 export {

+ 123 - 133
src/views/contract_manage/components/allocationDetail.vue

@@ -1,172 +1,162 @@
 <template>
-  <el-dialog title="派点" :visible.sync="allocationVisible" v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center @close="handleClose">
-    <div class="table-cont">
-      <table>
-        <thead>
-          <tr>
-            <template v-for="item in datalist">
-              <td :key="item" :class="['head-column', 'head-column-item']">
-                {{ item.Name }}
-              </td>
-              <td :key="item" :class="['head-column', 'head-column-item']">
-                {{ item.GruopId }}
-              </td>
-            </template>
-          </tr>
-        </thead>
-      </table>
-
-      <div class="table-body-wrapper">
-        <table>
-          <tbody v-for="(item, index) in datalist" :key="index">
-            <tr class="content-ul">
-              <template v-for="rs in item.Item">
-                <td :key="rs.AdminId">{{ rs.Name }}</td>
-                <td :key="rs.AdminId">{{ rs.DepartmentPercentage }}</td>
-              </template>
-            </tr>
-          </tbody>
-        </table>
+  <el-dialog
+    :title="allocationDetailForm.isDlgType == '关联合同' ? '打分详情' : '派点详情'"
+    :width="`${widthDlg}px`"
+    :visible.sync="allocationDetailVisible"
+    v-dialogDrag
+    :close-on-click-modal="false"
+    :modal-append-to-body="false"
+    center
+    @close="handleClose"
+    :append-to-body="true"
+    custom-class="allocation-detail-content_rai"
+  >
+    <p>总点数:{{ allNum }}w</p>
+    <div class="content-box-table-detail">
+      <div class="table-cont table-cont-top">
+        <div style="display: flex" v-for="item in datalist" :key="item.ChartPermissionName">
+          <div :class="['head-column', 'head-column-item']">
+            {{ item.ChartPermissionName }}
+          </div>
+          <div :class="['head-column', 'head-column-item-Proportion']">
+            {{ item.Proportion }}
+          </div>
+        </div>
+      </div>
+      <div class="table-cont">
+        <div v-for="(item, index) in datalist" :key="index">
+          <div style="display: flex" v-for="rs in item.List" :key="rs.RealName" class="content-ul">
+            <div style="background-color: #fff" :class="['head-column', 'head-column-item']">{{ rs.name }}</div>
+            <div style="background-color: #fff" :class="['head-column', 'head-column-item-Proportion']">{{ rs.val }}</div>
+          </div>
+        </div>
       </div>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="handleClose">取 消</el-button>
-      <el-button type="primary" @click="addAllocationHandler">修 改</el-button>
+      <el-button v-if="allocationDetailForm.isDlgType != '关联合同'" :disabled="IsGray" type="primary" @click="addAllocationHandler">修 改</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
-import TemplateMessage from "../../rai_manage/components/apply/templateMessage.vue";
+import { contractInterface } from "@/api/api.js";
+
 export default {
   name: "",
   components: {},
-  props: {},
+  props: {
+    allocationDetailVisible: {
+      type: Boolean,
+      default: true,
+    },
+    allocationDetailForm: {
+      type: Object,
+      default: {},
+    },
+  },
   data() {
     return {
-      allocationVisible: true,
-      datalist: [
-        {
-          Item: [
-            {
-              Name: "测试1", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-            {
-              Name: "测试2", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-          ],
-          Name: "消费组", // 组别
-          GruopId: 0,
-        },
-        {
-          Item: [
-            {
-              Name: "测试1", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-            {
-              Name: "测试2", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-          ],
-          Name: "科技组", // 组别
-          GruopId: 0,
-        },
-      ],
+      datalist: [],
+      IsGray: false,
+      widthDlg: 600,
+      allNum: "",
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+    allocationDetailVisible: {
+      handler(newVal) {
+        newVal && this.getList();
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
   created() {},
   mounted() {},
   methods: {
     // 关闭弹框
-    handleClose(item) {},
+    handleClose() {
+      this.$emit("update:allocationDetailForm", {});
+      this.$emit("update:allocationDetailVisible", false);
+    },
+    // 点击修改的事件
+    addAllocationHandler() {
+      if (this.IsGray) return;
+      this.handleClose();
+      this.$emit("allocationDetailList", this.allocationDetailForm);
+    },
     processingData() {
       for (let index = 0; index < this.datalist.length; index++) {}
     },
+    // 获取数据
+    async getList() {
+      const res = await contractInterface.getAllocationDetail({
+        CompanyContractId: this.allocationDetailForm.CompanyContractId,
+        ShowDetail: true,
+      });
+      if (res.Ret === 200) {
+        if (res.Data.List.length > 3) {
+          let isWidth = (res.Data.List.length - 3) * 200;
+          this.widthDlg = this.widthDlg + isWidth;
+        }
+        this.IsGray = res.Data.IsGray;
+        let maxLength = 0;
+        res.Data.List &&
+          res.Data.List.forEach((item) => {
+            if (maxLength < item.List.length) {
+              console.log(1212);
+              maxLength = item.List.length;
+            }
+          });
+        res.Data.List &&
+          res.Data.List.forEach((item) => {
+            for (let index = 0; index < maxLength; index++) {
+              item.List[index] = {
+                name: item.List[index] ? item.List[index].RealName : "",
+                val: item.List[index] ? item.List[index].Proportion : "",
+              };
+            }
+          });
+        this.datalist = res.Data.List;
+        this.allNum = res.Data.Money;
+      }
+    },
   },
 };
 </script>
-<style scoped lang="scss">
-.table-cont {
-  .table-body-wrapper {
-    max-height: calc(100vh - 340px);
-    margin-right: -6px;
-    overflow-y: scroll;
-    overflow-x: auto;
-    border-bottom: 1px solid #dcdfe6;
-    border-top: 1px solid #dcdfe6;
-  }
-  .head-column-item {
-    width: 15%;
-  }
-  table {
-    width: 100%;
-    font-size: 14px;
-    color: #666;
-    thead {
+<style lang="scss">
+.allocation-detail-content_rai {
+  .content-box-table-detail {
+    position: relative;
+    margin-top: 20px;
+    .table-cont-top {
       position: sticky;
       top: 0;
       left: 0;
-      border-left: 1px solid #dcdfe6;
-      border-right: 1px solid #dcdfe6;
-      td {
-        border: none;
-        outline-color: #dcdfe6;
-        outline-style: solid;
-        outline-width: 0.5px;
-      }
     }
-    td,
-    th {
-      min-width: 35px;
-      // word-break: break-all;
-      border: 1px solid #dcdfe6;
-      height: 45px;
-      text-align: center;
-      background-color: #fff;
+    .table-cont {
+      display: flex;
     }
-
     .head-column {
-      background-color: #f0f2f5;
-    }
-
-    .data-cell {
-      color: #409eff;
-      cursor: pointer;
-    }
-
-    .thead-sticky {
-      position: sticky;
-      top: 0;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border: 1px solid #dcdfe6;
+      background-color: #ebeef5;
+      color: #333333;
+      font-weight: 500;
+      margin-top: -1px;
+      margin-left: -0.5px;
     }
-  }
-  .content-ul {
-    td {
-      width: 15%;
+    .head-column-item {
+      width: 107px;
+      height: 48px;
     }
-    .association {
-      color: #409eff;
-      cursor: pointer;
+    .head-column-item-Proportion {
+      width: 73px;
+      height: 48px;
     }
   }
 }

+ 63 - 11
src/views/contract_manage/components/allocationLable.vue

@@ -6,28 +6,43 @@
           <span class="editsty" @click="lookContractHandler(row)">{{ row.ContractCode }}</span>
         </template>
       </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="转正类型" width="100"> </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="合同类型" width=""> </el-table-column>
-      <el-table-column align="center" prop="CompanyName" label="公司名称" width="">
+      <el-table-column align="center" prop="FormalType" label="转正类型" width="90"> </el-table-column>
+      <el-table-column align="center" prop="ContractType" label="合同类型" width="100"></el-table-column>
+      <el-table-column align="center" prop="CompanyName" label="公司名称">
         <template slot-scope="{ row }">
           <span class="editsty" @click="lookCompanyNameHandler(row)">{{ row.CompanyName }}</span>
         </template>
       </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="所属销售" width="100"> </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="合同金额" width=""> </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="合同期限" width=""> </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="状态" width=""> </el-table-column>
-      <el-table-column align="center" prop="ContractCode" label="操作">
+      <el-table-column align="center" prop="SellerName" label="所属销售" width="90"> </el-table-column>
+      <el-table-column align="center" prop="Money" label="合同金额" width="130"> </el-table-column>
+      <el-table-column align="center" prop="StartDate" label="合同期限" width="200">
         <template slot-scope="{ row }">
-          <span class="editsty">派点</span>
+          <span>{{ `${row.StartDate} - ${row.EndDate}` }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="IsAllocation" label="状态" width="90">
+        <template slot-scope="{ row }">
+          <span>{{ row.IsAllocation == 0 ? "未派点" : row.IsAllocation == 1 ? "已派点" : "" }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="ContractCode" label="操作" v-if="!typeLable">
+        <template slot-scope="{ row }">
+          <span :class="row.IsGray ? '' : 'editsty'" @click="allocationDetail(row)">派点</span>
+          &nbsp;
           <span class="editsty" @click="detailsHandler(row)">派点详情</span>
         </template>
       </el-table-column>
+      <el-table-column align="center" prop="ContractCode" width="110" label="派点详情" v-if="typeLable">
+        <template slot-scope="{ row }">
+          <span class="editsty" @click="detailsHandler(row)">查看</span>
+        </template>
+      </el-table-column>
     </el-table>
   </div>
 </template>
 
 <script>
+import { dataMainInterface, customInterence, contractInterface } from "@/api/api.js";
 export default {
   name: "",
   components: {},
@@ -36,6 +51,10 @@ export default {
       type: Array,
       default: [],
     },
+    typeLable: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {};
@@ -46,7 +65,32 @@ export default {
   mounted() {},
   methods: {
     // 查看合同
-    lookContractHandler(item) {},
+    async lookContractHandler(item) {
+      console.log(item);
+      if (item.FormalType == "非标") {
+        const loading = this.$loading({
+          lock: true,
+          text: "Loading",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)",
+        });
+        const res = await contractInterface.getHistoryDetail({
+          ContractCode: item.ContractCode,
+        });
+        if (res.Ret === 200) {
+          this.$emit("isPreviewHistoryDetail", res);
+          loading.close();
+        }
+      } else {
+        console.log(item.CompanyContractId);
+        let { href } = this.$router.resolve({
+          path: "/contractdtl",
+          query: { contractid: item.CompanyContractId },
+        });
+        window.open(href, "_blank");
+      }
+    },
+
     // 查看公司详情
     lookCompanyNameHandler(item) {
       const { href } = this.$router.resolve({
@@ -58,7 +102,15 @@ export default {
       window.open(href, "_blank");
     },
     // 派点详情
-    detailsHandler(item) {},
+    detailsHandler(item) {
+      this.$emit("allocationDetail", item);
+    },
+    // 派点
+    allocationDetail(item) {
+      if (item.IsGray) return;
+      this.$emit("allocationDetailList", item);
+      console.log(112233);
+    },
   },
 };
 </script>

+ 107 - 105
src/views/contract_manage/components/allocationNumber.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="container-allocation-number-rai">
-    <el-dialog title="派点" :visible.sync="allocationVisible" v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center @close="handleClose">
+    <el-dialog title="派点" :width="`${widthDlg}px`" :visible.sync="allocationVisible" v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center @close="handleClose">
       <div>
-        <h5>总点数:15W,其中3w默认归属买方研选,请对剩余12W按照100%进行比值分配</h5>
+        <h5>{{ TotalPointsContent }}</h5>
         <p>
           1)单行业套餐只能在对应行业内部分配研究员贡献百分比<br />
           2)多行业套餐先在行业间分配百分比(最低不低于平均值的一半),再分配到个人<br />
@@ -11,23 +11,30 @@
           <br />
         </p>
       </div>
+      <el-button style="margin-top: 20px" type="primary" size="mini" @click="averageaAllocation">平均分配</el-button>
       <div class="content-box">
-        <div v-for="item in listArr" :key="item.IndustryName">
+        <div v-for="item in listArr" :key="item.ChartPermissionName">
           <div class="industry-ul">
-            <span class="industry-name">{{ item.IndustryName }}</span>
-            <el-input :min="-100" :max="100" type="number" v-model="item.PerCent" size="small" @input="restrictInput(item)" style="width: 76px; margin: 0 5px 0 8px">
-              <div class="per_cent_" slot="suffix">%</div>
-            </el-input>
-            <p style="width: 38px">{{ roundedResult(item.PerCent) }}</p>
+            <span :class="['industry-name', item.ChartPermissionName == '买方研选' && 'name-yanxuan']">{{ item.ChartPermissionName }}</span>
+            <template v-if="item.ChartPermissionName !== '买方研选'">
+              <el-input :min="-100" :max="100" type="number" v-model="item.Proportion" size="small" @input="restrictInput(item)" style="width: 76px; margin: 0 5px 0 8px">
+                <div class="per_cent_" slot="suffix">%</div>
+              </el-input>
+              <p style="width: 38px">{{ roundedResult(item) }}</p>
+            </template>
+            <p style="width: 38px; text-align: center" v-else>{{ item.Proportion }}</p>
           </div>
-          <div v-for="study in item.Item" :key="study.StudyName" class="industry-ul">
-            <span class="study-name">{{ study.StudyName }}</span>
-            <el-input :min="-100" :max="100" type="number" v-model="study.PerCent" size="small" style="width: 76px; margin: 0 5px 0 8px">
-              <div class="per_cent_" slot="suffix">%</div>
-            </el-input>
-            <p style="width: 38px">{{ roundedResult(study.PerCent) }}</p>
+          <div v-for="study in item.List" :key="study.RealName" class="industry-ul">
+            <span :class="['study-name', item.ChartPermissionName == '买方研选' && 'name-yanxuan']">{{ study.RealName }}</span>
+            <template v-if="study.RealName !== '买方研选'">
+              <el-input :min="-100" :max="100" type="number" v-model="study.Proportion" size="small" style="width: 76px; margin: 0 5px 0 8px">
+                <div class="per_cent_" slot="suffix">%</div>
+              </el-input>
+              <p style="width: 38px">{{ roundedResult(study) }}</p>
+            </template>
+            <p style="width: 38px; text-align: center" v-else>{{ study.Proportion }}</p>
           </div>
-          <div class="all-item">
+          <div class="all-item" v-if="item.ChartPermissionName != '买方研选'">
             {{ allPerCentHandler(item) == 0 ? "" : `总值:${allPerCentHandler(item)}` }}
           </div>
         </div>
@@ -41,6 +48,8 @@
 </template>
 
 <script>
+import { contractInterface } from "@/api/api.js";
+
 export default {
   name: "",
   components: {},
@@ -49,122 +58,112 @@ export default {
       default: false,
       type: Boolean,
     },
+    allocationForm: {
+      type: Object,
+      default: {},
+    },
   },
   data() {
     return {
-      listArr: [
-        {
-          IndustryName: "消费",
-          PerCent: "",
-          Item: [
-            {
-              StudyName: "赵璐",
-              PerCent: "",
-            },
-            {
-              StudyName: "郭望葳",
-              PerCent: "",
-            },
-            {
-              StudyName: "张天",
-              PerCent: "",
-            },
-            {
-              StudyName: "时昕",
-              PerCent: "",
-            },
-          ],
-        },
-        {
-          IndustryName: "科技",
-          PerCent: "",
-          Item: [
-            {
-              StudyName: "张晶",
-              PerCent: "",
-            },
-            {
-              StudyName: "欧阳志宏",
-              PerCent: "",
-            },
-            {
-              StudyName: "王修远",
-              PerCent: "",
-            },
-            {
-              StudyName: "陈昫锟",
-              PerCent: "",
-            },
-            {
-              StudyName: "许晓葳",
-              PerCent: "",
-            },
-            {
-              StudyName: "李婉月",
-              PerCent: "",
-            },
-          ],
-        },
-        {
-          IndustryName: "智造",
-          PerCent: "",
-          Item: [
-            {
-              StudyName: "杨云鹏",
-              PerCent: "",
-            },
-            {
-              StudyName: "钟正宇",
-              PerCent: "",
-            },
-            {
-              StudyName: "张振",
-              PerCent: "",
-            },
-            {
-              StudyName: "钱程鹏",
-              PerCent: "",
-            },
-            {
-              StudyName: "齐妍",
-              PerCent: "",
-            },
-          ],
-        },
-      ],
-      allNum: 12,
+      listArr: [],
+      allNum: 0,
+      TotalPointsContent: "",
+      widthDlg: 580,
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+    allocationVisible: {
+      handler(newVal) {
+        newVal && this.getList();
+      },
+      immediate: true,
+    },
+  },
   created() {},
   mounted() {},
   methods: {
     // 取消弹框
-    handleClose() {},
+    handleClose() {
+      this.$emit("update:allocationForm", {});
+      this.$emit("update:allocationVisible", false);
+    },
     // 提交弹框
-    addAllocationHandler() {},
+    async addAllocationHandler() {
+      this.listArr.forEach((item) => {
+        item.Money = Number(item.Money) || 0;
+        item.List.forEach((_) => {
+          _.Money = Number(_.Money) || 0;
+        });
+      });
+      let arrList = this.listArr;
+      console.log(arrList);
+      const res = await contractInterface.getAllocationDetailUpdate({
+        CompanyContractId: this.allocationForm.CompanyContractId,
+        List: arrList,
+      });
+      if (res.Ret === 200) {
+        this.$message.success("操作成功");
+        this.$parent.getTableData();
+        this.handleClose();
+      }
+    },
     // 处理百分比
-    roundedResult(PerCent) {
-      let num = PerCent >= 0 ? `0.${PerCent}` : PerCent / 100;
-      return PerCent ? (this.allNum * num).toFixed(2) : "";
+    roundedResult(row) {
+      let num = row.Proportion >= 0 ? (row.Proportion * 100) / 100 / 100 : row.Proportion / 100;
+      row.Money = row.Proportion ? (this.allNum * num).toFixed(2) : "";
+      return row.Money;
     },
     // 输入框的限制
     restrictInput(item) {
-      if (item.PerCent > 100) return (item.PerCent = 100);
-      if (item.PerCent < -100) return (item.PerCent = -100);
+      if (item.Proportion > 100) return (item.Proportion = 100);
+      if (item.Proportion < -100) return (item.Proportion = -100);
     },
     // 数量的总和
     allPerCentHandler(item) {
       let num = 0;
-      item && item.Item.forEach((key) => (num = num + +key.PerCent));
+      item && item.List.forEach((key) => (num = num + +key.Proportion));
       return num;
     },
+    // 获取数据
+    async getList() {
+      const res = await contractInterface.getAllocationDetail({
+        CompanyContractId: this.allocationForm.CompanyContractId,
+      });
+      if (res.Ret === 200) {
+        if (res.Data.List.length > 3) {
+          let isWidth = (res.Data.List.length - 3) * 220;
+          this.widthDlg = this.widthDlg + isWidth;
+        }
+        this.allNum = res.Data.Money;
+        this.listArr = res.Data.List;
+        this.TotalPointsContent = res.Data.TotalPointsContent;
+      }
+    },
+    // 平均分配
+    averageaAllocation() {
+      let isName = this.listArr.some((item) => item.ChartPermissionName == "买方研选");
+      if (isName) {
+        let num = 100 / (this.listArr.length - 1);
+        this.listArr.forEach((item) => {
+          if (item.ChartPermissionName != "买方研选") {
+            item.Proportion = num;
+          }
+          let childrenNum = num / item.List.length;
+          item.List.forEach((key) => {
+            if (key.ChartPermissionName != "买方研选") {
+              key.Proportion = childrenNum;
+            }
+          });
+        });
+      }
+    },
   },
 };
 </script>
 <style lang="scss">
 .container-allocation-number-rai {
+  
   .content-box {
     display: flex;
     .industry-ul {
@@ -204,6 +203,9 @@ export default {
     color: #999;
     font-size: 14px;
   }
+  .name-yanxuan {
+    width: 65px !important;
+  }
   /* 取消[type='number']的input的上下箭头 */
   input::-webkit-inner-spin-button {
     -webkit-appearance: none !important;

+ 19 - 4
src/views/contract_manage/components/raiHistoryContract.vue

@@ -1,7 +1,18 @@
 <template>
   <!-- 历史签约弹窗 -->
-  <div class="history-contract-wrap">
-    <el-dialog :visible.sync="isPreview" :modal-append-to-body="false" @close="$emit('close')" title="历史签约" center top="7vh" v-dialogDrag width="1200px">
+  <div>
+    <el-dialog
+      :visible.sync="isPreview"
+      custom-class="history-contract-wrap-content_rai"
+      append-to-body="true"
+      :modal-append-to-body="false"
+      @close="closePreview"
+      title="历史签约"
+      center
+      top="7vh"
+      v-dialogDrag
+      width="1200px"
+    >
       <div class="dialog-wrap">
         <div class="contract-list">
           <div class="contract-item" v-for="(item, index) in contractList" :key="item.ContractCode">
@@ -179,12 +190,16 @@ export default {
       const { href } = this.$router.resolve({ path: "/contractdetail", query: { contractId: item.ContractId } }) || { href: "" };
       href && window.open(href, "_blank");
     },
+    closePreview() {
+      this.$emit("update:isPreview", false);
+      this.$emit("update:dealList", []);
+    },
   },
 };
 </script>
 
-<style scoped lang="scss">
-.history-contract-wrap {
+<style lang="scss">
+.history-contract-wrap-content_rai {
   .dialog-wrap {
     padding: 5px 60px 30px 60px;
     .contract-tab {

+ 126 - 0
src/views/contract_manage/components/relatedContract.vue

@@ -0,0 +1,126 @@
+<template>
+  <el-dialog title="关联合同" width="90%" :append-to-body="true" :visible.sync="isShowDlg" v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center @close="handleClose">
+    <allocation-lable :tableList="datalist" typeLable="关联合同" @isPreviewHistoryDetail="isPreviewHistoryDetail" @allocationDetail="allocationDetail" />
+    <el-col :span="24" class="toolbar">
+      <m-page :total="total" :page_no="page_no" :pageSize="10" @handleCurrentChange="handleCurrentChange" />
+    </el-col>
+    <rai-history-contract :isPreview.sync="isPreview" :dealList.sync="dealList" />
+    <allocation-detail :allocationDetailVisible.sync="allocationDetailVisible" :allocationDetailForm.sync="allocationDetailForm" />
+  </el-dialog>
+</template>
+
+<script>
+import { contractInterface } from "@/api/api.js";
+import AllocationLable from "./allocationLable.vue";
+import mPage from "@/components/mPage.vue";
+import RaiHistoryContract from "./raiHistoryContract.vue";
+import AllocationDetail from "./allocationDetail.vue";
+export default {
+  name: "",
+  components: { AllocationLable, RaiHistoryContract, mPage, AllocationDetail },
+  props: {
+    isShowDlg: {
+      type: Boolean,
+      default: false,
+    },
+    listDlg: {
+      type: Object,
+      default: {},
+    },
+  },
+  data() {
+    return {
+      datalist: [],
+      page_no: 1,
+      total: 0, //条数
+      PageSize: 10, //每页显示几条
+      dealList: [],
+      isPreview: false,
+      allocationDetailVisible: false,
+      allocationDetailForm: {},
+    };
+  },
+  computed: {},
+  watch: {
+    isShowDlg: {
+      handler(newVal) {
+        newVal && this.getList();
+      },
+    },
+  },
+  created() {},
+  mounted() {},
+  methods: {
+    // 关闭弹框
+    handleClose() {
+      this.$emit("update:isShowDlg", false);
+      this.$emit("update:listDlg", false);
+    },
+
+    // 获取数据
+    async getList() {
+      const res = await contractInterface.getAllocationContract({
+        ResearcherRealName: this.listDlg.ResearcherRealName,
+        PageSize: this.PageSize,
+        CurrentIndex: this.page_no,
+      });
+      if (res.Ret === 200) {
+        this.datalist = res.Data.List;
+        this.total = res.Data.Paging.Totals;
+      }
+    },
+    // 非标准预览
+    isPreviewHistoryDetail(res) {
+      this.isPreview = true;
+      this.dealList = res.Data.List;
+    },
+    //分页
+    handleCurrentChange(page) {
+      this.page_no = page;
+      this.getList();
+    },
+    // 派点详情
+    allocationDetail(item) {
+      this.allocationDetailVisible = true;
+      this.allocationDetailForm = item;
+      this.allocationDetailForm.isDlgType = "关联合同";
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.content-box-table-detail {
+  height: 400px;
+  overflow: hidden;
+  overflow-y: auto;
+  position: relative;
+  margin-top: 20px;
+  .table-cont-top {
+    position: sticky;
+    top: 0;
+    left: 0;
+  }
+  .table-cont {
+    display: flex;
+  }
+  .head-column {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border: 1px solid #dcdfe6;
+    background-color: #ebeef5;
+    color: #333333;
+    font-weight: 500;
+    margin-top: -1px;
+    margin-left: -0.5px;
+  }
+  .head-column-item {
+    width: 107px;
+    height: 48px;
+  }
+  .head-column-item-Proportion {
+    width: 73px;
+    height: 48px;
+  }
+}
+</style>

+ 92 - 20
src/views/contract_manage/raiAllocationPage.vue

@@ -18,7 +18,7 @@
         :disabled-date="disabledBeforeToday"
         @change="dateChange"
       />
-      <el-input placeholder="请输入客户名称" v-model="searchVal" style="width: 400px; margin-left: auto" @input="handleSearch" clearable>
+      <el-input placeholder="请输入客户名称" v-model.trim="searchVal" style="width: 400px; margin-left: auto" @input="handleSearch" clearable>
         <i slot="prefix" class="el-input__icon el-icon-search"></i>
       </el-input>
     </div>
@@ -45,26 +45,33 @@
         >
         </el-cascader>
         <el-select v-model="filterObj.status" placeholder="派点状态" style="width: 230px; margin-right: 20px" clearable @change="changeFilter">
-          <el-option v-for="item in typeArr" :key="item" :label="item.name" :value="item.name"> </el-option>
+          <el-option v-for="item in typeArrStatus" :key="item" :label="item.label" :value="item.value"> </el-option>
         </el-select>
       </div>
-      <allocation-lable :tableList="tableList" />
+      <allocation-lable :tableList="tableList" @isPreviewHistoryDetail="isPreviewHistoryDetail" @allocationDetailList="allocationDetailList" @allocationDetail="allocationDetail" />
+      <el-col :span="24" class="toolbar">
+        <m-page :total="total" :page_no="page_no" :pageSize="10" @handleCurrentChange="handleCurrentChange" />
+      </el-col>
     </el-card>
-    <allocation-number :allocationVisible.sync="allocationVisible" />
-    <allocation-detail />
+    <allocation-number :allocationVisible.sync="allocationVisible" :allocationForm.sync="allocationForm" />
+    <allocation-detail @allocationDetailList="allocationDetailList" :allocationDetailVisible.sync="allocationDetailVisible" :allocationDetailForm.sync="allocationDetailForm" />
+    <rai-history-contract :isPreview.sync="isPreview" :dealList.sync="dealList" />
   </div>
 </template>
 
 <script>
-import { dataMainInterface, customInterence } from "@/api/api.js";
+import { dataMainInterface, customInterence, contractInterface } from "@/api/api.js";
 import AllocationLable from "./components/allocationLable.vue";
 import AllocationNumber from "./components/allocationNumber.vue";
 import AllocationDetail from "./components/allocationDetail.vue";
+import mPage from "@/components/mPage.vue";
+import RaiHistoryContract from "./components/raiHistoryContract.vue";
+
 var moment = require("moment");
 moment().format();
 export default {
   name: "",
-  components: { AllocationLable, AllocationNumber, AllocationDetail },
+  components: { AllocationLable, AllocationNumber, AllocationDetail, mPage, RaiHistoryContract },
   props: {},
   data() {
     return {
@@ -75,6 +82,8 @@ export default {
         type: "",
         sale: "",
         area: "",
+        status: "",
+        contractType: "",
       },
       monthLabel: [
         {
@@ -90,14 +99,24 @@ export default {
       searchVal: "",
       typeArr: [
         {
-          value: "非标合同",
+          value: "非标",
           label: "非标合同",
         },
         {
-          value: "非标合同",
+          value: "标准",
           label: "标准合同",
         },
       ],
+      typeArrStatus: [
+        {
+          value: "0",
+          label: "未派点",
+        },
+        {
+          value: "1",
+          label: "已派点",
+        },
+      ],
       salesArr: [], //销售列表
       contractTypeArr: [
         {
@@ -122,6 +141,14 @@ export default {
       }, //销售级联配置
       tableList: [],
       allocationVisible: false, // 派点
+      allocationForm: {}, // 派点
+      allocationDetailVisible: false, // 派点详情
+      allocationDetailForm: {}, // 派点详情
+      page_no: 1,
+      total: 0, //条数
+      PageSize: 10, //每页显示几条
+      isPreview: false,
+      dealList: [],
     };
   },
   computed: {
@@ -136,15 +163,15 @@ export default {
         });
       }
       let obj = {
-        PageSize: this.pageSize,
+        IsExport: true,
+        FormalType: this.filterObj.type,
+        ContractType: this.filterObj.contractType,
+        PageSize: this.PageSize,
         CurrentIndex: this.page_no,
-        CompanyType: this.filterObj.type,
-        AdminId: salesArr.join(","),
-        RegionType: this.filterObj.area,
-        EndDate: this.end_date,
-        StartDate: this.start_date,
         Keyword: this.searchVal,
-        IsExport: true,
+        AdminId: salesArr.join(","),
+        IsAllocation: this.filterObj.status,
+        EndDate: this.filterObj.date,
       };
       for (let key in obj) {
         paramStr = `${paramStr}&${key}=${obj[key]}`;
@@ -158,9 +185,6 @@ export default {
     this.getSale();
     /* 默认选中近1个月 */
     this.filterDate(this.filterObj.month === "近1个月" ? 1 : this.filterObj.month === "近2个月" ? 2 : this.filterObj.month === "近3个月" ? 3 : 0);
-    this.$nextTick(() => {
-      this.tableList = [{ ContractCode: "HZEQ20230904002", CompanyName: "xxxx", CompanyId: 16 }];
-    });
   },
   methods: {
     /* 切换月份 */
@@ -191,7 +215,55 @@ export default {
         }
       });
     },
-    getTableData() {},
+    async getTableData() {
+      let salesArr = [];
+      if (this.filterObj.sale.length) {
+        salesArr = this.filterObj.sale.map((item) => {
+          return item[item.length - 1];
+        });
+      }
+      const res = await contractInterface.getAllocationContract({
+        FormalType: this.filterObj.type,
+        ContractType: this.filterObj.contractType,
+        PageSize: this.PageSize,
+        CurrentIndex: this.page_no,
+        Keyword: this.searchVal,
+        AdminId: salesArr.join(","),
+        IsAllocation: this.filterObj.status,
+        EndDate: this.filterObj.date,
+      });
+      if (res.Ret === 200) {
+        this.tableList = res.Data.List;
+        this.total = res.Data.Paging.Totals;
+      }
+    },
+    changeFilter() {
+      this.page_no = 1;
+      this.getTableData();
+    },
+    handleSearch() {
+      this.getTableData();
+    },
+    //分页
+    handleCurrentChange(page) {
+      this.page_no = page;
+      this.getTableData();
+    },
+    // 非标准预览
+    isPreviewHistoryDetail(res) {
+      this.isPreview = true;
+      this.dealList = res.Data.List;
+    },
+    // 派点
+    allocationDetailList(item) {
+      this.allocationForm = item;
+      this.allocationVisible = true;
+    },
+    // 派点详情
+    allocationDetail(item) {
+      this.allocationDetailVisible = true;
+      this.allocationDetailForm = item;
+    },
   },
 };
 </script>

+ 35 - 75
src/views/contract_manage/researcherStatistics.vue

@@ -22,7 +22,7 @@
         <i slot="prefix" class="el-input__icon el-icon-search"></i>
       </el-input>
     </div>
-    <el-card style="margin-top:20px">
+    <el-card style="margin-top: 20px">
       <div class="table-cont">
         <table>
           <thead>
@@ -38,36 +38,34 @@
           <table>
             <tbody v-for="(item, index) in datalist" :key="index">
               <tr>
-                <td :rowspan="item.Item.length + 1" class="thead-rs">{{ item.Name }}</td>
+                <td :rowspan="item.List.length + 1" class="thead-rs">{{ item.ChartPermissionName }}</td>
               </tr>
-              <tr v-for="rs in item.Item" :key="rs.AdminId" class="content-ul">
-                <td>{{ rs.Name }}</td>
-                <td class="association">{{ rs.ContractCount }}</td>
-                <td>{{ rs.TotalPoints }}</td>
-                <td>{{ rs.GroupPercentage }}</td>
-                <td>{{ rs.DepartmentPercentage }}</td>
+              <tr v-for="rs in item.List" :key="rs.RealName" class="content-ul">
+                <td>{{ rs.RealName }}</td>
+                <td @click="lookDetailsHadelr(rs)" :class="[rs.RealName == '合计' || rs.RealName == '平均' ? '' : 'association']">{{ rs.TotalRelatedContract }}</td>
+                <td>{{ rs.TotalDispatchPoint }}</td>
+                <td>{{ rs.GroupProportion }}</td>
+                <td>{{ rs.DepartmentProportion }}</td>
               </tr>
             </tbody>
 
-            <tfoot>
-              <!-- <tr>
-              <td colspan="2">总合计</td>
-              <td v-for="(total_data, total_data_key) in totalGroupArr" :key="total_data_key">
-                {{ total_data.value !== 0 ? total_data.value : "" }}
-              </td>
-            </tr> -->
-            </tfoot>
+            <tfoot></tfoot>
           </table>
         </div>
       </div>
     </el-card>
+    <related-contract :isShowDlg.sync="isShowDlg" :listDlg.sync="listDlg" />
   </div>
 </template>
 
 <script>
+import { dataMainInterface, customInterence, contractInterface } from "@/api/api.js";
+import RelatedContract from "./components/relatedContract.vue";
+var moment = require("moment");
+moment().format();
 export default {
   name: "",
-  components: {},
+  components: { RelatedContract },
   props: {},
   data() {
     return {
@@ -91,52 +89,9 @@ export default {
         },
       ],
       tableTheadColumns: ["组别", "研究员", "关联合同", "总派点", "组内占比", "部门占比"],
-      datalist: [
-        {
-          Item: [
-            {
-              Name: "测试1", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-            {
-              Name: "测试2", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-          ],
-          Name: "消费组", // 组别
-          GruopId: 0,
-        },
-        {
-          Item: [
-            {
-              Name: "测试1", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-            {
-              Name: "测试2", // 研究员
-              AdminId: 517,
-              ContractCount: 0, // 关联合同
-              TotalPoints: 0, // 总派点
-              GroupPercentage: 0, // 组内占比
-              DepartmentPercentage: 0, // 部门占比
-            },
-          ],
-          Name: "科技组", // 组别
-          GruopId: 0,
-        },
-      ],
+      datalist: [],
+      isShowDlg: false,
+      listDlg: {},
     };
   },
   computed: {
@@ -144,20 +99,8 @@ export default {
       let baseUrl = process.env.API_ROOT + "/statistic_report/will_expire_list";
       let token = localStorage.getItem("auth") || "";
       let paramStr = "";
-      let salesArr = [];
-      if (this.filterObj.sale.length) {
-        salesArr = this.filterObj.sale.map((item) => {
-          return item[item.length - 1];
-        });
-      }
       let obj = {
-        PageSize: this.pageSize,
-        CurrentIndex: this.page_no,
-        CompanyType: this.filterObj.type,
-        AdminId: salesArr.join(","),
-        RegionType: this.filterObj.area,
         EndDate: this.end_date,
-        StartDate: this.start_date,
         Keyword: this.searchVal,
         IsExport: true,
       };
@@ -194,6 +137,23 @@ export default {
         this.getTableData();
       }
     },
+    async getTableData() {
+      const res = await contractInterface.getAllocationStatistic({
+        Keyword: this.searchVal,
+        EndDate: this.filterObj.date,
+      });
+      if (res.Ret === 200) {
+        this.datalist = res.Data.List;
+      }
+    },
+    // 查看关联合同数
+    lookDetailsHadelr(item) {
+      this.isShowDlg = true;
+      this.listDlg = item;
+    },
+    handleSearch() {
+      this.getTableData();
+    },
   },
 };
 </script>