浏览代码

Merge branch 'master' into crm_16.9

bding 6 天之前
父节点
当前提交
38102a3c1e

+ 5 - 1
src/api/modules/crmApi.js

@@ -1099,7 +1099,11 @@ const customInterence = {
    */
   editOutboundMobile:(params)=>{
       return http.post("/custom/user/edit/outbound_mobile",params)
-   }
+   },
+  // 用印合同编号检索接口
+  searchSealcodeSeal:(params)=>{
+    return http.get("/seal/sealcode/search",params)
+  },
 };
 
 /*

+ 4 - 0
src/api/modules/sealApi.js

@@ -54,6 +54,10 @@ const sealInterence={
 	getContractListBySeal:params=>{
 		return http.get('/contract/getListBySeal',params)
 	},
+	//公司检索
+	getCompanyListSearch:params=>{
+		return http.get('/seal/company/search',params)
+	},
 	//上传接口
 	resourceUpload:params=>{
 		return http.post('/resource/image/upload',params)

+ 45 - 4
src/views/custom_manage/customList/applyTurn.vue

@@ -66,6 +66,17 @@
 									<i class="el-icon-info"></i>
 							</el-tooltip>
 						</el-form-item>
+						<el-form-item label-width="140px" label="请输入合同编号" style="width:100%" prop="CreditCode" v-if="isRaiSellerShow"
+						 :rules="{required: true, message: '请输入合同编号', trigger: 'blur'}">
+						   <i style="color:#f00;fontSize:20px;position:absolute;left:-128px;top:10%;">*</i>
+						   <el-autocomplete
+						   	style="width:360px;"
+						   	v-model="formData.CreditCode"
+						   	:fetch-suggestions="querySearchCreditCode"
+						   	placeholder="请复制申请用印时生成的合同编号"
+						   	@select="handleSelectCreditCode"
+						></el-autocomplete>
+						</el-form-item>
 						<el-form-item label="合同期限" prop="term" style="marginRight:60px;" :rules="{ required: true, message: '合同期限不能为空', trigger: 'blur' }" v-if="!isXClassCustom">
 							<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
 							<el-date-picker
@@ -75,6 +86,7 @@
 							start-placeholder="开始日期"
 							end-placeholder="结束日期"
 							@change="dateChange"
+							:disabled="isRaiSellerShow"
 							value-format="yyyy-MM-dd"
 							style="width:400px;">
 							</el-date-picker>
@@ -98,6 +110,7 @@
 							v-model.number="formData.amount"
 							:placeholder="isRaiCompany ? '请输入实际付款金额(优惠后)':'请输入金额'"
 							style="width:400px"
+							:disabled="isRaiCompany"
 							clearable></el-input>
 							<span style="color:#666;">元</span>
 						</el-form-item>
@@ -204,6 +217,9 @@ export default {
 		isRaiCompany(){
 			return this.companyInfo.CompanyType == '权益' || this.isRoleType== '权益'
 		},
+		isRaiSellerShow() {
+			return localStorage.getItem('Role') === 'rai_seller';
+		},
 	},
 	data () {
 		return {
@@ -218,6 +234,7 @@ export default {
 				imglist:[],//合同列表图片
 				setmeal:'',
 				qyBigServeCheck:0,
+				CreditCode:''
 			},
 			hasNoChild:false, // 医药、消费、科技、智造是否没有主客观
 			authList:[],//权限列表
@@ -600,10 +617,34 @@ export default {
 				this.$message.warning('请勾选品种')
 			}
 		},
-	checkboxInputHandler(){
-		this.formData.term = this.selectedQuarters ? [this.selectedDateRange.split(" ~ ")[0],this.selectedDateRange.split(" ~ ")[1]]:[]
-	}
-	
+		checkboxInputHandler(){
+			this.formData.term = this.selectedQuarters ? [this.selectedDateRange.split(" ~ ")[0],this.selectedDateRange.split(" ~ ")[1]]:[]
+		},
+		// 获取合同编号
+		async querySearchCreditCode(queryString, cb) {
+			cb([])
+			if(queryString) {
+			  const res = await customInterence.searchSealcodeSeal({
+				KeyWord:queryString
+			  })
+			  if(res.Ret === 200) {
+				if(res.Data.List.length) {
+				  const data = res.Data.List.map(item => {
+					return {
+					  value: item.Code,
+					  ...item
+					}
+				  })
+				  cb(data)
+				}
+			  }
+			}
+		},
+		// 选择合同编号
+		handleSelectCreditCode(item) {
+			this.formData.term = [item.StartDate,item.EndDate]
+			this.formData.amount = item.Money
+		}
 	},
 	created() {},
 	mounted() {

+ 28 - 24
src/views/dataReport_manage/equityDataSummary.vue

@@ -94,30 +94,7 @@ export default {
           label: "年度",
         },
       ],
-      // 筛选项映射的表头字段(新增后端 key)
-      filterOptions: {
-        新签: [
-          { label: "新增试用", key: "AddTrialCount", tooltip: "新增试用客户的时间,包含在所选时间段内的客户数(包括新建和领取流失)" },
-          { label: "新签合同(金额/数量)", key: "NewContractData", tooltip: "起始时间在所选时间段内的新签合同(第一份合同起始时间一年内的再次签约仍属于新签合同)" },
-        ],
-        续约: [
-          { label: "到期合同(金额/数量)", key: "ExpiredContractData", tooltip: "结束时间在所选时间段内的合用" },
-          { label: "续约合同(金额/数量)", key: "RenewedContractData", tooltip: "起始时间在所选时间段内的续约合同(第一份合同起始时间一年以后的再次签约均属于续约合同)" },
-          { label: "续约率(金额/客户)", key: "RenewalRateData", tooltip: "续约合同/到期合同" },
-          { label: "确认不续约合同(金额/数量)", key: "ConfirmedNoRenewalContractData", tooltip: "已确认不续约的到期合同" },
-          { label: "确认不续约率(金额/客户)", key: "ConfirmNonRenewalRateData", tooltip: "确认不续约合同(剔除非业务不续约)/到期合同" },
-          { label: "签约客户数量", key: "SignedClientCount", tooltip: "新签和续约的客户数" },
-          { label: "客单价", key: "AverageRevenueCount", tooltip: "新签合同和续约合同的总金额/签约客户数量" },
-        ],
-        收入: [
-          { label: "开票金额", key: "InvoiceAmountCount", tooltip: "财务系统中已经登记开票的金额" },
-          { label: "到款金额", key: "PaymentReceivedCount", tooltip: "财务系统中已经登记到账的金额" },
-          { label: "未到款比例", key: "UnpaidRatioCount", tooltip: "开票金额-到款金额 / 开票金额" },
-          { label: "新客开票", key: "NewCustomerInvoicingCount", tooltip: "财务系统中已经登记开票的新签合同金额" },
-          { label: "新客到款", key: "NewCustomerPaymentsReceivedCount", tooltip: "财务系统中已经登记开票的新签合同金额" },
-        ],
-      },
-      selectedFilters: ["新签", "续约", "收入"], // 用户选择的筛选项
+      selectedFilters: localStorage.getItem("userName") == "梁春悦6" ? ["续约"] : ["新签", "续约", "收入"], // 用户选择的筛选项
       // 示例数据(与后端返回的 key 对应)
       tableData: [],
       // 扁平化后的数据
@@ -261,6 +238,33 @@ export default {
     isSwitchDisabled() {
       return this.pathfinderSales.length || this.serviceGroupSalesAct.length;
     },
+    // 筛选项映射的表头字段(新增后端 key)
+    filterOptions() {
+      let useName = localStorage.getItem("userName");
+      let obj = {
+        新签: [
+          { label: "新增试用", key: "AddTrialCount", tooltip: "新增试用客户的时间,包含在所选时间段内的客户数(包括新建和领取流失)" },
+          { label: "新签合同(金额/数量)", key: "NewContractData", tooltip: "起始时间在所选时间段内的新签合同(第一份合同起始时间一年内的再次签约仍属于新签合同)" },
+        ],
+        续约: [
+          { label: "到期合同(金额/数量)", key: "ExpiredContractData", tooltip: "结束时间在所选时间段内的合用" },
+          { label: "续约合同(金额/数量)", key: "RenewedContractData", tooltip: "起始时间在所选时间段内的续约合同(第一份合同起始时间一年以后的再次签约均属于续约合同)" },
+          { label: "续约率(金额/客户)", key: "RenewalRateData", tooltip: "续约合同/到期合同" },
+          { label: "确认不续约合同(金额/数量)", key: "ConfirmedNoRenewalContractData", tooltip: "已确认不续约的到期合同" },
+          { label: "确认不续约率(金额/客户)", key: "ConfirmNonRenewalRateData", tooltip: "确认不续约合同(剔除非业务不续约)/到期合同" },
+          { label: "签约客户数量", key: "SignedClientCount", tooltip: "新签和续约的客户数" },
+          { label: "客单价", key: "AverageRevenueCount", tooltip: "新签合同和续约合同的总金额/签约客户数量" },
+        ],
+        收入: [
+          { label: "开票金额", key: "InvoiceAmountCount", tooltip: "财务系统中已经登记开票的金额" },
+          { label: "到款金额", key: "PaymentReceivedCount", tooltip: "财务系统中已经登记到账的金额" },
+          { label: "未到款比例", key: "UnpaidRatioCount", tooltip: "开票金额-到款金额 / 开票金额" },
+          { label: "新客开票", key: "NewCustomerInvoicingCount", tooltip: "财务系统中已经登记开票的新签合同金额" },
+          { label: "新客到款", key: "NewCustomerPaymentsReceivedCount", tooltip: "财务系统中已经登记开票的新签合同金额" },
+        ],
+      };
+      return useName == "梁春悦6" ? { 续约: obj.续约 } : obj;
+    },
   },
   mounted() {
     this.getDataList();

+ 4 - 0
src/views/seal_manage/approvalList.vue

@@ -173,6 +173,10 @@
                 <tr>
                   <td class="table-item width-50">社会信用码:{{detail.SealDetail.CreditCode}}</td>
                   <td class="table-item width-50">合同类型:{{detail.SealDetail.ServiceType}}</td>  
+                </tr>
+                 <tr v-if="detail.SealDetail.ProductId==2">
+                  <td class="table-item width-50">合同期限:{{detail.SealDetail.StartDate}} ~ {{detail.SealDetail.EndDate}}</td>
+                  <td class="table-item width-50">合同金额:{{detail.SealDetail.Money}}元</td>  
                 </tr>
                 <tr>
                   <td class="table-item width-50">

+ 82 - 20
src/views/seal_manage/updateSeal.vue

@@ -33,6 +33,14 @@
           </el-form-item>
           <el-form-item label="客户名称:" prop="CompanyName">
             <el-autocomplete
+                v-if="isRaiSellerShow"
+                v-model="sealForm.CompanyName"
+                :fetch-suggestions="querySearchCompany"
+                placeholder="请输入用户名称"
+                @select="handleSelectCustome"
+            ></el-autocomplete>
+            <el-autocomplete
+              v-else
               ref="companySelector"
               popper-class="custom-autocomplete"
               placeholder="请输入用户名称"
@@ -50,7 +58,18 @@
               </template>
             </el-autocomplete>
           </el-form-item>
-          <el-form-item label="合同类型:" prop="ServiceType">
+          <el-form-item label="合同期限:" prop="time" v-if="isRaiSellerShow" :rules="{ required: true, message: '请选择合同期限', trigger: 'change' }">
+              <el-date-picker 
+                v-model="sealForm.time" 
+                type="daterange" 
+                value-format="yyyy-MM-dd" 
+                range-separator="至" 
+                start-placeholder="开始日期" 
+                end-placeholder="结束日期"
+                > 
+              </el-date-picker>
+            </el-form-item>
+          <el-form-item label="合同类型:" prop="ServiceType" v-else :rules="{ required: true, message: '请选择合同类型', trigger: 'change'}">
             <el-select
               v-model="sealForm.ServiceType"
               :disabled="sealForm.source === '系统合同'"
@@ -64,6 +83,7 @@
               ></el-option>
             </el-select>
           </el-form-item>
+
           <el-form-item
             :class="{ required: sealForm.Use === '代付合同' }"
             label="实际使用方:"
@@ -98,7 +118,18 @@
               class="form-input"
               placeholder="请填写统一社会信用码"
               v-model.trim="sealForm.CreditCode"
-              :disabled="sealForm.source === '系统合同'"
+              :disabled="sealForm.source === '系统合同' || isRaiSellerShow"
+            ></el-input
+          ></el-form-item>
+           <el-form-item label="合同金额:" prop="Money"
+           v-if="isRaiSellerShow"
+            :rules="{
+                required: true, message: '请输入实际付款金额', trigger: 'blur'
+              }">
+            <el-input
+             class="form-input"
+              placeholder="请输入实际付款金额(优惠后)"
+              v-model="sealForm.Money"
             ></el-input
           ></el-form-item>
           <el-form-item label="文件份数:" prop="FileNum"
@@ -189,7 +220,9 @@ export default {
         Remark: "", //审批备注
         fileList: [], //合同附件
         ContractId: 0, //合同id(默认为0)
-        AffiliatedCompany:''
+        AffiliatedCompany:'',
+        time: [],
+        Money: '',// 实际付款金额
       },
       sealRules: {
         //表单校验规则
@@ -198,9 +231,6 @@ export default {
         CompanyName: [
           { required: true, message: "请选择客户名称", trigger: "blur" },
         ],
-        ServiceType: [
-          { required: true, message: "请选择合同类型", trigger: "change" },
-        ],
         UseCompanyName: [
           { validator: ValidateUseCompanyName, trigger: "change" },
         ],
@@ -240,7 +270,7 @@ export default {
       ],
       isWatch: true, // 控制watch是否触发
 
-      belongCompanyOption:[]
+      belongCompanyOption:[],
     };
   },
   created() {
@@ -262,6 +292,11 @@ export default {
         this.sealForm.source === "系统合同"
       );
     },
+    isRaiSellerShow() {
+      return (
+        this.sealForm.source === "上传附件" && localStorage.getItem('Role') === 'rai_seller'
+      );
+    }
   },
   methods: {
     async getBelongCompanyOptions() {
@@ -298,6 +333,9 @@ export default {
           this.sealForm.ServiceType = SealDetail.ServiceType;
           this.sealForm.UseCompanyName = SealDetail.UseCompanyName;
           this.sealForm.AffiliatedCompany = SealDetail.AffiliatedCompany;
+          if(SealDetail.StartDate && SealDetail.EndDate) {
+            this.sealForm.time = [SealDetail.StartDate, SealDetail.EndDate]
+          }
           this.sealForm.source =
             SealDetail.ContractId > 0 ? "系统合同" : "上传附件";
           // 打开监听
@@ -367,22 +405,41 @@ export default {
     // 关键字联想
     async querySearch(queryString, cb) {
       // 合同来源为上传附件时不进行联想
-      if (this.sealForm.source === "上传附件" || queryString === "")
+      if (this.sealForm.source === "上传附件"  || queryString === "")
         return cb([]);
-      let results = [];
-      try {
-        const res = await sealInterence.getContractListBySeal({
-          Keyword: queryString,
+          let results = [];
+          try {
+            const res = await sealInterence.getContractListBySeal({
+              Keyword: queryString,
+            });
+            if (res.Ret === 200) {
+              results = res.Data;
+            }
+          } catch (err) {
+            console.log(err);
+          }
+          if (!results.length) this.sealForm.ContractId = 0;
+          // 调用 callback 返回建议列表的数据
+          cb(results);
+    },
+    // 关键字公司联想
+    async querySearchCompany(query, cb) {
+        if (query === "") return  cb([]);
+        const res = await sealInterence.getCompanyListSearch({
+          KeyWord: query,
         });
         if (res.Ret === 200) {
-          results = res.Data;
+           if(res.Data.length>0){
+            let arr=res.Data.map(item=>{
+              return {value:item.CompanyName,...item}
+            })
+            cb(arr)
+          }
         }
-      } catch (err) {
-        console.log(err);
-      }
-      if (!results.length) this.sealForm.ContractId = 0;
-      // 调用 callback 返回建议列表的数据
-      cb(results);
+    },
+    // 关键字公司联想后的选择事件
+    handleSelectCustome(val){
+        this.sealForm.CreditCode = val.CreditCode;
     },
     // 选择事件
     selectHandel(item) {
@@ -408,6 +465,7 @@ export default {
           ContractId: this.sealForm.ContractId,
           CreditCode: this.sealForm.CreditCode,
           FileNum: this.sealForm.FileNum,
+          Money: +this.sealForm.Money,
           FileUrls: this.sealForm.fileList.map(item => item.FileUrl),
           Remark: this.sealForm.Remark,
           SealType: this.sealForm.SealType.join(","),
@@ -415,6 +473,8 @@ export default {
           Use: this.sealForm.Use,
           UseCompanyName: this.sealForm.UseCompanyName,
           AffiliatedCompany: this.sealForm.AffiliatedCompany,
+          StartDate: this.isRaiSellerShow ? this.sealForm.time[0] : '',
+          EndDate: this.isRaiSellerShow ? this.sealForm.time[1] : '',
         };
         let res = {};
         if (this.sealId) {
@@ -469,7 +529,8 @@ export default {
         Remark: "", //审批备注
         fileList: [], //合同附件
         ContractId: 0, //合同id(默认为0)
-        AffiliatedCompany:''
+        AffiliatedCompany:'',
+        Money:'',
       };
       // 清除校验提示
       this.$nextTick(() => {
@@ -487,6 +548,7 @@ export default {
     .box {
       flex: 1;
     }
+    .el-range-editor.el-input__inner,
     .el-select,
     .el-autocomplete,
     .form-input {