snow 2 years ago
parent
commit
1d8e453dac

+ 18 - 0
src/mixins/privateField.js

@@ -0,0 +1,18 @@
+import { mapGetters } from 'vuex'
+
+const privateField = {
+  computed: {
+    ...mapGetters(['private_field', 'isSupertube', 'sourceLevel'])
+  },
+  methods: {
+    // 1 成本价 2 销售价 3 毛利率
+    isDisplayPrivateField(type) {
+      if (this.isSupertube) return true
+      if (this.originLevel === '3' && type === '1') return true
+      if (this.originLevel === '2' && privateField && privateField.includes(type)) return true
+      return false
+    }
+  }
+}
+
+export default privateField

+ 0 - 1
src/mixins/resToken.js

@@ -7,7 +7,6 @@ export default {
       }
     },
     async routeGoto(path, query) {
-      console.log(111);
       await window.vm.$router.push({
         path: path,
         query: query

+ 6 - 3
src/views/sellOut/sellOutOrder/detail.vue

@@ -79,13 +79,14 @@
                   ></el-tag>
                 </template>
                 <template slot="sale_price">
-                  <span>{{
+                  <!-- <span>{{
                     private_field &&
                     private_field.length > 0 &&
                     private_field.some((item) => item == "2")
                       ? sitem.sale_price
                       : "***"
-                  }}</span>
+                  }}</span> -->
+                  <span>{{isDisplayPrivateField('2') ? sitem.sale_price : ''}}</span>
                 </template>
                 <template slot="total_price">
                   <span>{{
@@ -371,9 +372,11 @@ import returnExpress from "./components/returnExpress";
 import wantDeliver from "./components/want-deliver";
 import addEditForm from "./components/addEditForm"; //发货申请单详情
 import addEditA from "./components/addEditA";
+import privateField from "@/mixins/privateField";
+
 export default {
   name: "sellOutOrderDetail",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, privateField],
   components: {
     addEditForm,
     addEditA,

+ 0 - 1
src/views/stock/stockCount/components/dataWeido/index.vue

@@ -192,7 +192,6 @@ import { mapGetters } from "vuex";
 export default {
   name: "dataWeido",
   mixins: [mixinPage, resToken, companyHelper],
-
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {

+ 0 - 3
src/views/stock/stockCount/components/spaceCount/index.vue

@@ -173,9 +173,6 @@ export default {
     }
   },
   methods: {
-    // onCompanyChange(){
-    //   this.parmValue.companyNo = this.currentCompany
-    // },
     //业务公司选择
     async supplierChange(e) {
       const { code } = e;