Просмотр исходного кода

Merge branch 'blueBranch' into allTestUrgent

qymljy 8 месяцев назад
Родитель
Сommit
9d01be6f00

+ 42 - 7
src/HDrpManagement/prodectFileData/components/add.vue

@@ -5,12 +5,12 @@
         :title="$t(`新增关联商品`)"
         :visible.sync="drawer"
         :wrapperClosable="false"
-        size="70%"
+        size="85%"
         @close="onClose"
         append-to-body
     >
-      <div class="drawer__panel" style="margin-bottom: 0">
-      <search class="inline-16" @searchActive="searchActive" :placeholder="placeholder"></search>
+      <div class="drawer__panel" style="margin-top: 0;margin-bottom: 0;padding-top: 0">
+      <search class="inline-16" @searchActive="searchActive" :placeholder="placeholder" style="padding-left: 0"></search>
       <uploadAllData
         class="inline-16"
         :total="total"
@@ -18,13 +18,14 @@
         @handleUploadApi="handleUploadApi"
         @onSuccess="onSuccess"
       ></uploadAllData>
+      <selectClass ref="class" @clickAreaBase="clickAreaBase" @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickField="clickField" :default="true"></selectClass>
       <div>
-        <tablelayout :layout="tablecols" :data="productsList" :custom="true" :checkbox="true" height="calc(100vh - 292px)" @checkboxCallBack="checkboxCallBack">
+        <tablelayout :layout="tablecols" :data="productsList" :custom="true" :checkbox="true" height="calc(100vh - 392px)" @checkboxCallBack="checkboxCallBack">
           <template v-slot:customcol="scope">
             <div v-if="scope.column.columnname === 'province'">
               <span>{{scope.column.data.province}} - {{scope.column.data.city}} - {{scope.column.data.county}}</span>
             </div>
-            <div v-else-if="scope.column.columnname === 'isonsale'" :style="{color:scope.column.data[scope.column.columnname] === 1?tool.getStatusColor('上架',true):tool.getStatusColor('下架',true)}">
+            <div v-else-if="scope.column.columnname === 'isonsale'" :style="{color:scope.column.data[scope.column.columnname] === 1?tool.getStatusColor('上架',true):tool.getStatusColor('下架',true)}">>
               <span>{{scope.column.data.isonsale ? $t('上架') : $t('下架')}}</span>
             </div>
             <p v-else-if="scope.column.columnname === 'status'">
@@ -76,6 +77,7 @@
 import tablelayout from '@/components/table/index2'
 import search from './search'
 import uploadAllData from '@/components/uploadAllData/index'
+import selectClass from '@/components/selectClass/index'
 export default {
   name: "add",
   props:["plm_technicalinfoid"],
@@ -105,7 +107,11 @@ export default {
           "pageNumber":1,
           "pageSize":20,
           "where": {
-            "condition": ""
+            "condition": "",
+            "standards": "",
+            "tradefield": "",
+            "sa_brandid": "",
+            "itemclassid": ""
           }
         }
       }
@@ -114,7 +120,8 @@ export default {
   components:{
     tablelayout,
     search,
-    uploadAllData
+    uploadAllData,
+    selectClass
   },
   mounted() {
 
@@ -202,6 +209,34 @@ export default {
       this.params.content.pageNumber = val
       this.productsData()
     },
+    clickAreaBase (item) {
+      this.params.content.where.standards = item
+      this.productsData()
+    },
+    brandChange(id) {
+      console.log(id);
+      this.brandId = id
+      this.$refs.class.clickClass(false)
+      // this.productsData()
+    },
+    onClassChange (n) {
+      this.params.content.where.itemclassid = n.itemclassid
+      this.productsData()
+    },
+    Search(data) {
+      this.params.content.where.condition = data
+      this.params.content.pageNumber = 1
+      this.productsData()
+    },
+    clearSearch() {
+      this.params.content.where.condition = ''
+      this.params.content.pageNumber = 1
+      this.productsData()
+    },
+    clickField (item) {
+      this.params.content.where.tradefield = item.tradefield
+      this.productsData()
+    },
   }
 }
 </script>

+ 7 - 7
src/HManagement/serviceDataScreen/modules/dataProfile.vue

@@ -173,7 +173,7 @@ export default {
           },
           {
             title:'过期比例',
-            value:Math.round(((this.list.gqbl * 100)*100)/100) + '%',
+            value:Math.round((this.list.gqbl * 100) * 100)/100 + '%',
             tips:'过期比例=已过期线索数÷待分配线索数×100%'
           },
           {
@@ -188,7 +188,7 @@ export default {
           },
           {
             title:'线索转化率',
-            value:Math.round(((this.list.zhl * 100)*100)/100) + '%',
+            value:Math.round((this.list.zhl * 100) * 100)/100 + '%',
             tips:'线索转化率=已转化线索数÷线索总数×100%'
           },
           {
@@ -198,7 +198,7 @@ export default {
           },
           {
             title:'线索成交率',
-            value:Math.round(((this.list.cjl * 100)*100)/100) + '%',
+            value:Math.round((this.list.cjl * 100) * 100)/100 + '%',
             tips:'线索成交率=转化后有下订单的线索数÷线索总数×100%'
           },
           {
@@ -213,7 +213,7 @@ export default {
           },
           {
             title:'参与线索转化率',
-            value:Math.round(((this.list.joinordercluezhl * 100)*100)/100) + '%',
+            value:Math.round((this.list.joinordercluezhl * 100) * 100)/100 + '%',
             tips:'参与线索转化率=参与线索转化数 ÷ 参与线索数 ×100%'
           },
           {
@@ -223,7 +223,7 @@ export default {
           },
           {
             title:'参与线索成交率',
-            value:Math.round(((this.list.joinordercluecjl * 100)*100)/100) + '%',
+            value:Math.round((this.list.joinordercluecjl * 100) * 100)/100 + '%',
             tips:'参与线索成交率=参与线索成交率 ÷ 参与线索数 ×100%'
           },
         ]
@@ -284,7 +284,7 @@ export default {
           },
           {
             title:'项目失败率',
-            value:Math.round(((this.list.sbl)*100)/100) + '%',
+            value:Math.round(this.list.sbl * 100)/100 + '%',
             tips:'项目失败率=已失败项目数÷项目总数×100%'
           },
           {
@@ -299,7 +299,7 @@ export default {
           },
           {
             title:'参与项目成交率',
-            value:Math.round(((this.list.joinDealProjectcjl)*100)/100) + '%',
+            value:Math.round(this.list.joinDealProjectcjl *100)/100 + '%',
             tips:'参与项目成交率=参与项目成交数 ÷ 参与项目数 ×100%'
           },
         ]

+ 72 - 0
src/components/selectClass/classTree.vue

@@ -0,0 +1,72 @@
+<template>
+  <div>
+    <div class="flex-start">
+      <div v-for="item in data" :key="item.index" @click.stop="classClick(item)">
+        <p class="classItem" v-if="item.index === 1"  :class="class_act === item.itemclassnum?'act':''">{{$t(item.itemclassname)}}</p>
+        <p class="classItem"  v-else   :class="class_act === item.itemclassnum?'act':''">{{$t(item.itemclassname)}}</p>
+        <Tree v-if="item.subdep && class_act === item.itemclassnum" :data="item.subdep"></Tree>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "Tree",
+  props:['data'],
+  inject:['selectThis'],
+  data () {
+    return {
+      activeClass:{},
+      class_act:0,
+    }
+  },
+  methods:{
+    classClick (item) {
+      console.log(item)
+      this.activeClass = item
+      this.class_act = item.itemclassnum
+      this.selectThis().change(item)
+    },
+  }
+}
+</script>
+<style scoped>
+.class-item{
+  margin:0 15px;
+  color: #333;
+  cursor: pointer;
+  transition: .2s all linear;
+  font-size: 14px;
+
+}
+.right-line {
+  border-right: 1px solid #e3e5ea;
+  padding-right: 10px;
+}
+.act{
+  color:#3874f6;
+  font-weight: bold;
+}
+.classIndex{
+  margin-bottom: 0px
+  !important;
+}
+.classItem{
+  flex: 0 1 auto;
+  width:90px ;
+  margin:10px 0px 10px 0;
+  font-size:14px !important;
+  cursor: pointer;
+  padding-right: 10px;
+  text-align: right;
+  border-right: 1px solid #e3e5ea;
+}
+.flex-start{
+  display: flex;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+  position: relative;
+  width: 80px;
+}
+</style>

+ 300 - 0
src/components/selectClass/index.vue

@@ -0,0 +1,300 @@
+<template>
+  <div class="border-bottom">
+    <div>
+      <ul class="normal-margin-new" ref="myUl">
+        <li
+            :class="areaBase === '' ? 'act' : ''"
+            class="brand-item border-all"
+            style="float: left"
+
+            @click="clickAreaBase('')"
+        >
+          {{ $t("全部标准") }}
+        </li>
+        <li
+            :class="areaBase === item ? 'act' : ''"
+
+            class="brand-item margin-notAll"
+            v-for="(item,index) in areaBases"
+            :key="item"
+            @click="clickAreaBase(item)"
+        >
+          <div v-if="index == 0"  class="brand-item margin-notAll" style="float: left" :class="areaBase === item ? 'act' : ''">{{ $t(item) }}</div>
+          <div v-else class="brand-item margin-notAll" style="float: left;margin-left: 15px" :class="areaBase === item ? 'act' : ''">{{ $t(item) }}</div>
+        </li>
+      </ul>
+      <ul class="normal-margin-new" style="clear: both">
+        <li
+            :class="field_act === '' ? 'act' : ''"
+            v-if="(siteid == 'HY' && fields.length > 1) || siteid != 'HY'"
+            class="brand-item border-all"
+            style="float: left"
+            @click="clickField('')"
+        >
+          {{ $t("全部领域") }}
+        </li>
+        <li
+            :class="tradefield === item.tradefield ? 'act' : ''"
+            v-if="(siteid == 'HY' && fields.length > 1) || siteid != 'HY'"
+            class="brand-item margin-notAll"
+            v-for="(item,index) in fields"
+            :key="item.sys_enterprise_tradefieldid"
+            @click="clickField(item)"
+        >
+          <!--          {{ $t(item.tradefield) }}-->
+          <div v-if="item.rowindex == 1"  class="brand-item margin-notAll" style="float: left"  :class="tradefield === item.tradefield ? 'act' : ''">{{ $t(item.tradefield) }}</div>
+          <div v-else class="brand-item margin-notAll" style="float: left;margin-left: 15px"  :class="tradefield === item.tradefield ? 'act' : ''">{{ $t(item.tradefield) }}</div>
+        </li>
+      </ul>
+      <ul class="normal-margin-new" style="clear: both">
+        <li
+            :class="!brand_act ? 'act' : ''"
+            class="brand-item border-all"
+            style="float: left"
+            v-if="(siteid == 'HY' && brands.length > 1) || siteid != 'HY'"
+            @click="clickBrand('')"
+        >
+          {{ $t("全部品牌") }}
+        </li>
+        <li
+            :class="brand_act == item.sa_brandid ? 'act' : ''"
+            v-if="(siteid == 'HY' && brands.length > 1) || siteid != 'HY'"
+            class="brand-item margin-notAll"
+            v-for="(item,index) in brands"
+            :key="item.sa_brandid"
+            @click="clickBrand(item.sa_brandid)"
+        >
+          <!--          {{ item.brandname }}-->
+          <div v-if="index == 0"  class="brand-item margin-notAll" style="float: left"  :class="brand_act == item.sa_brandid ? 'act' : ''">{{ $t(item.brandname) }}</div>
+          <div v-else class="brand-item margin-notAll" style="float: left;margin-left: 15px"  :class="brand_act == item.sa_brandid ? 'act' : ''">{{ $t(item.brandname) }}</div>
+        </li>
+      </ul>
+      <ul class="flex-align-center normal-margin-new" style="clear: both">
+        <li
+            :class="class_act === '' ? 'act' : ''"
+            class="brand-item border-all"
+            @click="clickClass('')"
+        >
+          {{ $t("营销类别") }}
+        </li>
+        <li
+            :class="class_act === item.itemclassnum ? 'act' : ''"
+            class="brand-item margin-notAll right-line"
+            v-for="item in itemclass"
+            :key="item.itemclassnum"
+            @click="clickClass(item)"
+        >
+          {{ $t(item.itemclassname) }}
+        </li>
+      </ul>
+      <classTree
+          ref="tree"
+          style="padding-left: 80px"
+          :data="activeClass.subdep"
+          @onClassChange="change"
+      ></classTree>
+    </div>
+  </div>
+</template>
+
+<script>
+import classTree from "./classTree.vue";
+export default {
+  data() {
+    return {
+      value: "",
+      brands: [],
+      fields: [],
+      itemclass: [],
+      activeClass: {},
+      field_act: "",
+      tradefield: "",
+      brand_act: 0,
+      class_act: "",
+      areaBases: [],
+      areaBase: "",
+      siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid,
+    };
+  },
+  provide() {
+    return {
+      selectThis: () => this,
+    };
+  },
+  inject: ["sys_enterpriseid"],
+  props: {
+    default: {
+      type: Boolean,
+      default: () => false,
+    },
+  },
+  components: {
+    classTree,
+  },
+  methods: {
+    /* 授权标准 */
+    async queryAreaBase(id) {
+      const res1 = await this.$api.requested({
+        id: "20230519141202",
+        content: {
+          sys_enterpriseid: id ? id : "", //不传查询当前账号授权的标准
+        },
+      });
+      if (res1.data.length) {
+        // this.areaBase = res1.data[0]
+        this.areaBases = res1.data;
+        // this.$emit('clickAreaBase',res1.data[0])
+      } else {
+        this.areaBases = res1.data;
+        // this.areaBase = ''
+      }
+      console.log("标准", this.areaBases);
+    },
+    async queryAgentiInfo(callback) {
+      let param = {
+        id: 20230418142202,
+        content: {
+          sys_enterpriseid: '',
+          where: {
+            condition: "",
+          },
+        },
+      };
+      // if (!this.sys_enterpriseid()) delete param.content.sys_enterpriseid;
+      const res1 = await this.$api.requested(param);
+      this.fields = res1.data;
+      if (this.fields.length) {
+        // this.field_act = res1.data[0].sys_enterprise_tradefieldid
+        // this.tradefield = res1.data[0].tradefield
+        // this.$emit('clickField',res1.data[0])
+        // this.clickField({sys_enterprise_tradefieldid:this.field_act,tradefield:res1.data[0].tradefield})
+      } else {
+        // this.field_act = 0
+        // this.tradefield = ''
+        // this.clickField(false)
+      }
+      callback && callback();
+    },
+    async queryBrands(callback) {
+      let param = {
+        id: "20220924163702",
+        content: {
+          pageSize: 1000,
+          sys_enterpriseid: '',
+          where: {
+            condition: "",
+          },
+        },
+      };
+      // if (!this.sys_enterpriseid()) delete param.content.sys_enterpriseid;
+      const res = await this.$api.requested(param);
+      this.brands = res.data;
+      if (this.brands.length) {
+        // this.brand_act = res.data[0].sa_brandid
+        // this.clickBrand(res.data[0].sa_brandid)
+      } else {
+        // this.brand_act = 0
+        // this.clickBrand(this.brand_act)
+      }
+      callback && callback();
+    },
+
+    async queryClass() {
+      let param = {
+        id: "20220922110403",
+        content: {
+          sa_brandid: this.brand_act,
+          sys_enterpriseid: '',
+          where: { istool: 0 },
+        },
+      };
+      // if (!this.sys_enterpriseid()) delete param.content.sys_enterpriseid;
+      const res = await this.$api.requested(param);
+      console.log(res.data);
+
+      this.itemclass = res.data.length ? res.data[0].ttemclass : [];
+    },
+    clickAreaBase(item) {
+      this.areaBase = item ? item : "";
+      this.$emit("clickAreaBase", item);
+    },
+    clickBrand(id) {
+      this.brand_act = id ? id : 0;
+      this.queryClass();
+      this.$emit("brandChange", this.brand_act ? [this.brand_act] : []);
+    },
+    clickField(item) {
+      console.log(this.fields);
+      this.field_act = item ? item.sys_enterprise_tradefieldid : "";
+      this.tradefield = item ? item.tradefield : "";
+      this.$emit("clickField", item);
+    },
+    clickClass(item) {
+      if (item) {
+        this.activeClass = item;
+        this.class_act = item.itemclassnum;
+        this.$emit("onClassChange", item);
+      } else {
+        this.class_act = "";
+        this.$refs.tree.class_act = 0;
+        this.$emit("onClassChange", item);
+      }
+    },
+    change(n) {
+      this.$emit("onClassChange", n);
+    },
+    clearSearch() {
+      this.$emit("clearSearch");
+    },
+  },
+  // watch:{
+  //   "height":function (){
+  //     console.log(this.height,'444444高度222')
+  //     const newHeight = this.$refs.myUl.offsetHeight; // 获取当前高度。
+  //     if (newHeight !== this.height) { // 检查是否真的发生了变化(可选)以避免不必要的操作。
+  //       this.height = newHeight; // 更新高度值。可以在这里执行其他基于高度变化的逻辑。例如:console.log(newHeight); 或者 this.doSomethingWithNewHeight(newHeight);。
+  //     }
+  //     console.log(this.height,'高度')
+  //   }
+  // },
+  mounted() {
+    this.queryClass();
+    this.queryAgentiInfo();
+    this.queryBrands();
+    this.queryAreaBase();
+  },
+};
+</script>
+<style>
+</style>
+<style scoped>
+.brand-item {
+  margin: 2px 40px;
+  color: #333;
+  cursor: pointer;
+  transition: 0.2s all linear;
+  font-size: 14px;
+  /* border-right: 1px solid #ccc; */
+}
+.right-line {
+  border-right: 1px solid #e3e5ea;
+  padding-right: 10px;
+}
+.act {
+  color: #3874f6;
+  font-weight: bold;
+}
+.normal-margin-new {
+  margin-bottom: 2px !important;
+}
+.border-bottom {
+  padding-bottom: 16px;
+  border-bottom: 1px solid #e3e5ea;
+}
+.border-all {
+  margin-left: 0px;
+}
+.margin-notAll {
+  margin-left: -18px;
+}
+</style>