Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev_v2' into dev_v2

钱惠东 před 5 dny
rodič
revize
e3cb4ceb9e

+ 71 - 12
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcFollowMapper.xml

@@ -178,18 +178,75 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <sql id="test">
-      select * from (
-        SELECT DISTINCT
-        follow_id,
-        business_id,
-        follow_type
-        FROM
-        tc_follow
-        where
-        del_flag = '0'
-        ORDER BY id DESC
-        ) temp
-        Group by business_id,follow_type
+        SELECT main.follow_id
+        FROM (
+        SELECT t1.follow_id,
+        CASE t1.follow_type
+        WHEN '0' THEN
+        t4.lead_no
+        WHEN '1' THEN
+        t5.account_no
+        ELSE t6.project_no
+        END AS business_no,
+        su.nick_name AS follower,
+        CASE t1.follow_type
+        WHEN '0' THEN
+        t4.country_id
+        WHEN '1' THEN
+        t5.country_id
+        ELSE t6.country_id
+        END AS country_id
+        from
+        tc_follow AS t1
+        LEFT JOIN tc_lead AS t4 ON t4.lead_id = t1.business_id AND t1.follow_type = '0'
+        LEFT JOIN tc_account AS t5 ON t5.account_id = t1.business_id AND t1.follow_type = '1'
+        LEFT JOIN tc_project AS t6 ON t6.project_id = t1.business_id AND t1.follow_type = '2'
+        LEFT JOIN sys_user su ON su.user_id = t1.create_by
+        inner join (SELECT p.premession_char FROM (SELECT @premessionStr:= #{permissionChar} p) param ,
+        getpremessionview_chars p
+        ) permission on permission.premession_char = t1.permission_char
+        <where>
+            <if test="loginUserId != null  and loginUserId != ''">
+                and (t1.permission_char &lt;&gt; #{permissionChar} or t1.create_by = #{loginUserId})
+            </if>
+            <if test="followTypeArray != null  and followTypeArray.length != 0">
+                and t1.follow_type in
+                <foreach item="type" collection="followTypeArray" open="(" separator="," close=")">
+                    #{type}
+                </foreach>
+            </if>
+            <if test="followNo != null  and followNo != ''"> and t1.follow_no like CONCAT('%', #{followNo},'%')  escape '/' </if>
+            <if test="beginTime != null and beginTime != ''">
+                and date_format(t1.follow_time,'%Y%m%d') &gt;= date_format(#{beginTime},'%Y%m%d')
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and date_format(t1.follow_time,'%Y%m%d') &lt;= date_format(#{endTime},'%Y%m%d')
+            </if>
+            <if test="followPerson != null  and followPerson != ''"> and t1.follow_person like CONCAT('%', #{followPerson},'%')  escape '/'</if>
+            <if test="followWayArray != null  and followWayArray.length > 0">
+                and t1.follow_way in
+                <foreach item="way" collection="followWayArray" open="(" separator="," close=")">
+                    #{way}
+                </foreach>
+            </if>
+            <if test="contactPerson != null  and contactPerson != ''"> and t1.contact_person like CONCAT('%', #{contactPerson},'%')  escape '/'</if>
+            <if test="contact != null  and contact != ''"> and t1.contact = #{contact}</if>
+            <if test="followDesc != null  and followDesc != ''"> and t1.follow_desc like CONCAT('%', #{followDesc},'%')  escape '/' </if>
+
+        </where>
+        ) main
+        <where>
+        <if test="businessNo != null "> and main.business_no like CONCAT('%', #{businessNo},'%')  escape '/' </if>
+        <if test="follower != null  and follower != ''"> and t1.follower like CONCAT('%', #{follower},'%')  escape '/' </if>
+
+        <if test="countries != null and countries.size() > 0">
+            and t1.country_id in
+            <foreach item="countryId" collection="countries" open="(" separator="," close=")">
+                #{countryId}
+            </foreach>
+        </if>
+        </where>
+        GROUP BY main.business_no
     </sql>
 
     <sql id="test2">
@@ -200,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         getpremessionview_chars p
         ) permission on permission.premession_char = t1.permission_char
         <where>
+            t1.del_flag = 0
             <if test="loginUserId != null  and loginUserId != ''">
                 and (t1.permission_char &lt;&gt; #{permissionChar} or t1.create_by = #{loginUserId})
             </if>
@@ -230,6 +288,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         GROUP BY business_id,follow_type
     </sql>
+
     <select id="selectTcFollowList" parameterType="com.ruoyi.project.business.domain.TcFollow" resultMap="TcFollowResultForList">
         <include refid="selectTcFollowVo2"/>
 

+ 4 - 21
ruoyi-ui-vue2/src/views/contract/edit.vue

@@ -776,12 +776,12 @@ export default {
   },
 
   async created() {
+    this.loading = true;
     this.permissionChar = this.$store.state.user.permissionChar
     this.language = this.$i18n.locale;
+    this.contractId = this.$route.params.contractId ;
     //初始化点击button的类型
     this.initType();
-    this.contractId = this.$route.params.contractId ;
-    this.loading = true;
     //从数据库取出货币单位
     this.getDictsFun()
 
@@ -791,11 +791,10 @@ export default {
       //获取代理商List
       await this.getAgentListByOwner();
       //不是新增
-      if (this.type != 'add') {
+      if (this.type !== 'add') {
         //判断是否存在履历id historyId
         //非新增并且只是查询
-        console.log("this.type===============>",this.type)
-        if (this.type == 'history') {
+        if (this.type === 'history') {
           await this.getHistoryForm();
         } else {
           //编辑或者变更
@@ -1190,24 +1189,9 @@ export default {
     },
     /** 查询客户所有人列表 */
     getAllOwnerList() {
-      // getAllOwnerList({onlySalesRole: false}).then(res => {
-      //   this.ownerList = res.data;
-      // })
-      // //获取业务员
-      // getAuthRole(this.form.salesman?this.form.salesman:this.$store.state.user.userInfo.userId).then(response => {
-      //   const newUser = response.user;
-      //
-      //   // 检查 ownerList 中是否已经存在相同的 user
-      //   const exists = this.ownerList.some(owner => owner.userId === newUser.userId); // 假设 userId 是唯一标识
-      //
-      //   if (!exists) {
-      //     this.ownerList.push(newUser); // 只有在不存在时才添加
-      //   }
-      // })
       getNickNameList().then(res => {
         this.ownerList = res.data;
       })
-
     },
     //设备一览提交
     equipmentSubmitForm(){
@@ -1468,7 +1452,6 @@ export default {
       this.$nextTick(() => {
         this.$set(rowAmount,column,value)
         this.$set(rowAmount,'additionalCost',this.sumPrice1(rowAmount))
-        // this.$set(rowAmount,'liftAmount',this.sumPrice(rowAmount))
       })
     },
     additionalCostSubmitForm(){

+ 12 - 15
ruoyi-ui-vue2/src/views/contract/index.vue

@@ -56,7 +56,7 @@
         <Column :label="$t('contract.endCustomers')" prop="endCustomersName" show-search :searchParams="queryParams"/>
 
         <!--币种10-->
-        <Column  :label="$t('contract.currencyId')"  prop="currencyId" searchType="select" :searchDict="dict.type.currency_type" />
+        <Column  :label="$t('contract.currencyId')"  prop="currencyId" searchType="select" :searchDict="dict.type.currency_type" :searchParams="queryParams" />
 
         <!--金额31-->
         <Column :label="$t('lift.amountOfMoney')" :searchParams="queryParams"  prop="amount"  align="right" >
@@ -135,7 +135,7 @@ import {
 } from "@/api/contract/contract";
 import {getAllAreaList} from "@/api/user/area";
 import {curAgent} from "@/api/business/crm/lead";
-import {getAllOwnerList, getAuthRole} from "@/api/system/user";
+import {getAllOwnerList, getAuthRole, getNickNameList} from "@/api/system/user";
 import {audit} from "@/api/system/flow";
 import {rollback} from "@/api/audit/flow";
 import {parseTime} from "@/utils/ruoyi";
@@ -296,7 +296,7 @@ export default {
     };
   },
   created() {
-    console.log("this.$route.query=========>",this.$route.query)
+    this.$set(this.queryParams,'contractNo',this.$route.query.businessNo)
     this.getArea();
     this.curCountry()
     this.getAreaList()
@@ -323,13 +323,9 @@ export default {
     },
     /** 查询客户所有人列表 */
     getAllOwnerList() {
-      getAllOwnerList({onlySalesRole: false}).then(res => {
+      getNickNameList().then(res => {
         this.ownerList = res.data;
       })
-      //将超级管理员的账号添加
-      getAuthRole(1).then(response => {
-        this.ownerList.push(response.user)
-      })
     },
     //获取代理商
     async curAgent() {
@@ -366,8 +362,10 @@ export default {
 
       try {
         const response = await listContractBo(params);
-        this.contractList = response.rows;
-        this.queryParams.total = response.total;
+        if(response && response.code === 200){
+          this.contractList = response.rows;
+          this.queryParams.total = response.total;
+        }
       } finally {
         this.loading = false;
       }
@@ -380,7 +378,7 @@ export default {
       this.queryParams.pageNum = 1;
       this.getList();
     },
-    /** 重置按钮操作 todo:待补充*/
+    /** 重置按钮操作 */
     resetQuery() {
       this.$set(this.queryParams, 'paymentRatio', null)
       this.$set(this.queryParams, 'contractNo', null)
@@ -489,10 +487,9 @@ export default {
       response.data.forEach(item=>{
         this.curCountryOps.push({
           label: item.countryName,
-          value: parseInt(item.countryId)
+          value: item.countryId
         })
       })
-      console.log("this.curCountryOps==============>",this.curCountryOps)
     },
     //查看合同
     handleView(row){
@@ -568,10 +565,10 @@ export default {
         businessObj: bargainObj
       }
       const response = await rollback(auditForm)
-      if(response && response.code == 200){
+      if(response && response.code === 200){
         //合同状态变为已取消
         updateContract({id:row.id,approveStatus:'3'}).then(res=>{
-          if(res && res.code == 200){
+          if(res && res.code === 200){
             this.$message.success("合同取消成功")
             this.getList()
           }

+ 44 - 19
ruoyi-ui-vue2/src/views/contract/lift/index.vue

@@ -342,7 +342,7 @@
           <!--单价18-->
           <Column  :label="$t('lift.unitPrice')"  prop="unitPrice"   align="right" v-if="checkPermi(['user:contract:lift:unitPriceEdit'])">
             <template v-slot="scope">
-              <MoneyInput :inputValue="scope.row.unitPrice" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'unitPrice')" ></MoneyInput>
+              <MoneyInput :inputValue="scope.row.unitPrice" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'unitPrice',true)" ></MoneyInput>
             </template>
           </Column >
           <!--报价折扣19-->
@@ -415,13 +415,13 @@
           <!--评审运费40 可修改-->
           <Column  :label="$t('lift.reviewShippingCosts')"  prop="reviewShippingCosts" align="right" v-if="checkPermi(['user:contract:lift:reviewShippingCostsEdit'])">
             <template v-slot="scope">
-              <MoneyInput :inputValue="scope.row.reviewShippingCosts" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'reviewShippingCosts')" ></MoneyInput>
+              <MoneyInput :inputValue="scope.row.reviewShippingCosts" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'reviewShippingCosts',true)" ></MoneyInput>
             </template>
           </Column >
           <!--评审佣金41 可修改-->
           <Column :label="$t('lift.reviewCommission')"  prop="reviewCommission" align="right" v-if="checkPermi(['user:contract:lift:reviewCommissionEdit'])">
             <template v-slot="scope">
-              <MoneyInput :inputValue="scope.row.reviewCommission" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'reviewCommission')" ></MoneyInput>
+              <MoneyInput :inputValue="scope.row.reviewCommission" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'reviewCommission',true)" ></MoneyInput>
             </template>
           </Column >
 
@@ -450,14 +450,14 @@
           <!--预计内陆运费48 可修改-->
           <Column :label="$t('lift.planInlandFreightCost')" align="right" v-if="checkPermi(['user:contract:lift:planInlandFreightCost'])" prop="planInlandFreightCost" >
             <template v-slot="scope">
-              <MoneyInput :inputValue="scope.row.planInlandFreightCost" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'planInlandFreightCost')" ></MoneyInput>
+              <MoneyInput :inputValue="scope.row.planInlandFreightCost" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'planInlandFreightCost',true)" ></MoneyInput>
             </template>
           </Column>
 
           <!--预计海运费49 可修改-->
           <Column :label="$t('lift.planOceanFreight')"  align="right" v-if="checkPermi(['user:contract:lift:planOceanFreight'])" prop="planOceanFreight" >
             <template v-slot="scope">
-              <MoneyInput :inputValue="scope.row.planOceanFreight" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'planOceanFreight')" ></MoneyInput>
+              <MoneyInput :inputValue="scope.row.planOceanFreight" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'planOceanFreight',true)" ></MoneyInput>
             </template>
           </Column>
 
@@ -476,8 +476,8 @@
 
           <!--其他费用52 不可修改-->
           <Column :label="$t('lift.otherFees')"  prop="otherCost"  v-if="checkPermi(['user:contract:lift:otherCost'])">
-            <template #default="{ row }">
-              <span>{{ toDecimal2(numFormat(row.otherCost)) }}</span>
+            <template v-slot="scope">
+              <MoneyInput :inputValue="scope.row.otherCost" :zeroLength="2" @change="item=>valueChanged(item,scope.row,'otherCost',true)" ></MoneyInput>
             </template>
           </Column>
           <!--附加费用53 不可修改-->
@@ -576,7 +576,7 @@ import MoreBtn from "@/components/MoreBtn/index.vue";
 import {addLiftBatch, listAllById, listLift, selectProductionOrderNo, updateOrderNoBo} from "@/api/contract/lift";
 import {getAreaList} from "@/api/business/crm/account";
 import {curAgent} from "@/api/business/crm/lead";
-import {getAllOwnerList, getAuthRole} from "@/api/system/user";
+import {getAllOwnerList, getAuthRole, getNickNameList} from "@/api/system/user";
 import MoneyInput from "@/components/element/form/items/moneyInput.vue";
 import DatePicker from "@/components/element/form/items/DatePicker.vue";
 import DictColumn from "@/components/element/table/DictColumn.vue";
@@ -590,6 +590,7 @@ import {addSn, listSn} from "@/api/contract/liftSn";
 import InputNumberColumn from "@/components/element/table/InputNumberColumn.vue";
 import InputNumber from "@/components/element/form/items/InputNumber.vue";
 import {getAllNationNeedLanguageList} from "@/api/user/country";
+import {delcommafy} from "@/utils/money";
 
 export default {
   name: "Lift",
@@ -758,13 +759,9 @@ export default {
     checkPermi,
     /** 查询客户所有人列表 */
     getAllOwnerList() {
-      getAllOwnerList({onlySalesRole: false}).then(res => {
+      getNickNameList().then(res => {
         this.ownerList = res.data;
       })
-      // //将超级管理员的账号添加
-      // getAuthRole(1).then(response => {
-      //   this.ownerList.push(response.user)
-      // })
     },
     //获取代理商
     async curAgent() {
@@ -955,18 +952,46 @@ export default {
       this.$set(this.queryParams, 'rate4SigningContracts', null)
       this.$set(this.queryParams, 'rate4Shipment', null)
       this.$set(this.queryParams, 'elevatorCode', null)
-
-
-
-
       this.handleQuery();
     },
-    valueChanged(value, rowAmount,column) {
+    valueChanged(value, rowAmount,column,sumFlag) {
       this.$nextTick(() => {
         this.$set(rowAmount,column,value)
-        // this.$set(rowAmount,'additionalCost',this.sumPrice(rowAmount))
+        if(sumFlag != null){
+          console.log("有效果")
+          this.$set(rowAmount,'additionalCost',this.sumPrice1(rowAmount))
+        }
       })
     },
+    sumPrice1(row){
+      if(isNaN(row.unitPrice)){
+        row.unitPrice = 0.00
+      }
+      if(isNaN(row.planInlandFreightCost)){
+        row.planInlandFreightCost = 0.00
+      }
+      if(isNaN(row.planOceanFreight)){
+        row.planOceanFreight = 0.00
+      }
+      if(isNaN(row.reviewShippingCosts)){
+        row.reviewShippingCosts = 0.00
+      }
+      if(isNaN(row.reviewCommission)){
+        row.reviewCommission = 0.00
+      }
+      if(isNaN(row.otherCost)){
+        row.otherCost = 0.00
+      }
+      let amount = (Number(delcommafy(row.planInlandFreightCost)) +
+        Number(delcommafy(row.planOceanFreight)) +
+        Number(delcommafy(row.reviewShippingCosts)) +
+        Number(delcommafy(row.reviewCommission))+
+        Number(delcommafy(row.otherCost))).toFixed(2) || 0.00
+      row.additionalCost = amount
+      console.log("amount============================》",amount)
+      row.liftAmount = (Number(delcommafy(amount))+Number(delcommafy(row.unitPrice))).toFixed(2)
+      return amount
+    },
 
 
     // 多选框选中数据