Browse Source

Merge branch 'develop_cuxiao' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_cuxiao

chenrui 1 year ago
parent
commit
5d72f9b9d6

+ 1 - 1
src/components/Table/index.js

@@ -364,7 +364,7 @@ export default {
         // 自定义属性,也就是官方文档中的props,可通过条件来控制样式
         style: {
           //  设置行背景色
-          'background-color': record[this.rowKeyName] === this.leftAlignId ? '#fff1c5' : ''
+          'background-color': record[this.rowKeyName] === this.leftAlignId ? '#ffedeb' : ''
         },
         on: {
           // 鼠标单击行

+ 3 - 3
src/components/custom.less

@@ -151,18 +151,18 @@ body{
     }
     &:hover{
       td{
-        background: #ffb60a!important;
+        background: #fff2f0!important;
       }
     }
   }
   .ant-pagination.ant-table-pagination{
     margin: 10px 0 0;
   }
-  .ant-table-small > .ant-table-content .ant-table-body,.ant-table-fixed-right{
+  .ant-table-small > .ant-table-content .ant-table-body,.ant-table-fixed-right,.ant-table-fixed-left{
     margin: 0;
     tr:hover{
       td{
-        background: #ffb60a;
+        background: #fff2f0!important;
       }
     }
   }

+ 2 - 2
src/components/newThem.less

@@ -1,5 +1,5 @@
 @font-size-base: 12px;
-@table-row-hover-bg: color(~`colorPalette('@{warning-color}', 3) `);
+@table-row-hover-bg: color(~`colorPalette('@{primary-color}', 0.5) `);
 @text-color: fade(@black, 100%);
 @disabled-bg: #fafafa;
 @modal-body-padding: 15px;
@@ -24,7 +24,7 @@
 @ve-table-body-row-highlight-background-color: color(~`colorPalette('@{primary-color}', 1) `);
  
 .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content{
-    // border-bottom: 1px solid #ddd;
+    border-bottom: 1px solid #ddd;
 }
 .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content thead.ve-table-header tr.ve-table-header-tr th.ve-table-header-th{
     font-weight: 900;

+ 4 - 0
src/store/modules/app.js

@@ -42,6 +42,10 @@ const app = {
     curActionPermission: '', // 当前激活状态的权限码
     showPdfPrintView: false, // pdf 打印预览
     pdfUrl: '',
+    productBrandAllList: null, // 产品品牌列表
+    productTypeAllList: null, // 产品分类列表
+    warehouseAuthList: null, // 有权限的仓库列表
+    warehouseAllList: null, // 无权限所有仓库列表
     defWarehouse: null, // 默认仓库
     isWarehouse: false// 仓库管理权限
   },

+ 48 - 16
src/views/common/chooseWarehouse.js

@@ -57,11 +57,28 @@ const warehouse = {
     }
   },
   mounted () {
+    // 如果已经存在仓库数据
+    const a = this.$store.state.app.warehouseAuthList 
+    const b = this.$store.state.app.warehouseAllList
+
     if (this.isPermission) {
       this.$store.state.app.defWarehouse = null
       this.$store.state.app.isWarehouse = true
+      if(a){
+        this.setWarehouseData(a)
+      }else{
+        // 不存在,远程获取
+        this.getWarehouse()
+      }
+    }else{
+      if(b){
+        this.setWarehouseData(b)
+      }else{
+        // 不存在,远程获取
+        this.getWarehouse()
+      }
     }
-    this.getWarehouse()
+    
   },
   watch: {
     value (newValue, oldValue) {
@@ -79,26 +96,36 @@ const warehouse = {
       this.$emit('input', value)
       this.$emit('change', value)
     },
+    // 设置仓库数据
+    setWarehouseData(data){
+      // 有权限控制的
+      if (this.isPermission) {
+        this.$store.state.app.isWarehouse = true
+        this.$store.state.app.defWarehouse = data && data[0]
+      }
+      this.warehouseData = data || []
+      let defaultWarehouseVal = {}
+      if (this.isDefault) {
+        defaultWarehouseVal = data.find(con => {
+          return con.defaultFlag == 1 ? con.warehouseSn : ''
+        })
+        this.defaultVal = defaultWarehouseVal.warehouseSn
+        this.$emit('load', defaultWarehouseVal.warehouseSn, this.warehouseData)
+      } else {
+        this.$emit('load', null, this.warehouseData)
+      }
+    },
     //  获取仓库列表
     getWarehouse () {
       const ajaxName = this.isPermission ? queryAuthWarehouse : warehouseAllList
       ajaxName({}).then(res => {
         if (res.status == 200) {
-          // 有权限控制的
-          if (this.isPermission) {
-            this.$store.state.app.isWarehouse = true
-            this.$store.state.app.defWarehouse = res.data && res.data[0]
-          }
-          this.warehouseData = res.data || []
-          let defaultWarehouseVal = {}
-          if (this.isDefault) {
-            defaultWarehouseVal = res.data.find(con => {
-              return con.defaultFlag == 1 ? con.warehouseSn : ''
-            })
-            this.defaultVal = defaultWarehouseVal.warehouseSn
-            this.$emit('load', defaultWarehouseVal.warehouseSn, this.warehouseData)
-          } else {
-            this.$emit('load', null, this.warehouseData)
+          this.setWarehouseData(res.data)
+          // 存储仓库数据本地
+          if(this.isPermission){
+            this.$store.state.app.warehouseAuthList = this.warehouseData
+          }else{
+            this.$store.state.app.warehouseAllList = this.warehouseData
           }
         } else {
           if (this.isPermission) {
@@ -114,6 +141,11 @@ const warehouse = {
     },
     clearData () {
       this.handleChange([])
+    },
+    // 清空缓存的数据
+    clearCacheData(){
+      this.$store.state.app.warehouseAuthList = null
+      this.$store.state.app.warehouseAllList = null
     }
   }
 }

+ 30 - 10
src/views/common/productBrand.js

@@ -27,10 +27,6 @@ const ProductBrand = {
       type: String,
       default: '请选择产品品牌'
     },
-    sysFlag: {
-      type: String,
-      default: ''
-    },
     brandType: {
       type: String,
       default: ''
@@ -47,7 +43,13 @@ const ProductBrand = {
     };
   },
   mounted() {
-    this.getProductBrand()
+    const a = this.$store.state.app.productBrandAllList
+    // 有缓存
+    if(a){
+      this.setBrandData(a||[])
+    }else{
+      this.getProductBrand()
+    }
   },
   watch: {
     value(newValue, oldValue) {
@@ -55,7 +57,13 @@ const ProductBrand = {
     },
     brandType(newValue,oldValue){
       this.handleChange(undefined)
-      this.getProductBrand()
+      const a = this.$store.state.app.productBrandAllList
+      // 有缓存
+      if(a){
+        this.setBrandData(a||[])
+      }else{
+        this.getProductBrand()
+      }
     }
   },
   methods: {
@@ -70,14 +78,26 @@ const ProductBrand = {
       this.$emit('input', value);
       this.$emit('change', value, this.id, row);
     },
-    //  产品品牌列表, sysFlag: 1 箭冠 0 自建
+    setBrandData(data){
+      // brandType: 1 自主品牌 2 代理品牌
+      if(this.brandType!=''){
+        this.productBrandList = data.filter(item => item.brandType == this.brandType)
+      }else{
+        this.productBrandList = data
+      }
+    },
+    //  产品品牌列表,
     getProductBrand () {
-      productBrandQuery({ 'sysFlag': this.sysFlag, 'brandType': this.brandType }).then(res => {
+      productBrandQuery({}).then(res => {
+        let ret = []
         if (res.status == 200) {
-          this.productBrandList = res.data
+          ret = res.data
         } else {
-          this.productBrandList = []
+          ret = []
         }
+        // 缓存数据
+        this.$store.state.app.productBrandAllList = ret
+        this.setBrandData(ret)
       })
     },
   },

+ 9 - 1
src/views/common/productTypeAll.js

@@ -50,7 +50,13 @@ const ProductType = {
     }
   },
   mounted () {
-    this.getProductType()
+    const a = this.$store.state.app.productTypeAllList
+    // 如果有缓存
+    if(this.isAll && a){
+      this.productTypeList = a || []
+    }else{
+      this.getProductType()
+    }
   },
   methods: {
     filter(inputValue, path) {
@@ -80,6 +86,8 @@ const ProductType = {
           } else {
             this.productTypeList = []
           }
+          // 缓存数据
+          this.$store.state.app.productTypeAllList = this.productTypeList
         })
       }else{
         productTypeQuery({}).then(res => {

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -578,10 +578,10 @@
         updateWarehouse(data).then(res => {
           console.log(res)
           if (res.status == 200) {
-            _this.openWarehouseModal = false
             _this.resetSearchForm(true)
             _this.$message.success(res.message)
           }
+          _this.openWarehouseModal = false
           _this.$refs.table.refresh(true)
           _this.spinning = false
         })

+ 3 - 1
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -241,6 +241,7 @@
               for (var i = 0; i < data.list.length; i++) {
                 data.list[i].no = no + i + 1
                 data.list[i].qtyBackups = data.list[i].qty
+                data.list[i].warehouseBackups = data.list[i].warehouseSn
               }
               this.disabled = false
               this.dataSource = data.list
@@ -403,10 +404,11 @@
         _this.spinning = true
         updateWarehouse(data).then(res => {
           if (res.status == 200) {
-            _this.openWarehouseModal = false
             _this.resetSearchForm(true)
             _this.$message.success(res.message)
           }
+          _this.openWarehouseModal = false
+          _this.$refs.table.refresh(true)
           _this.spinning = false
         })
       },

+ 2 - 1
src/views/salesManagement/salesQueryNew/edit.vue

@@ -55,7 +55,7 @@
           <span style="margin-left:20px;color:#00aaff;cursor: pointer;"  @click="(event) => {showDesc(event, item)}">
             <a-icon :type="item.showDesc ? 'eye-invisible' : 'eye'"/> 活动详情
           </span>
-          <span style="margin:0 20px;color:#ff0800;cursor: pointer;" @click="(event) => {disabledActive(event, item)}">
+          <span :style="{margin:'0 20px',color:item.disabled?'#14b900':'#ff0800',cursor: 'pointer'}" @click="(event) => {disabledActive(event, item)}">
             <a-icon title="禁用规则" type="disconnect"/> {{item.disabled ? '启用规则' : '禁用规则'}}
           </span>
         </div>
@@ -254,6 +254,7 @@ export default {
       })
     },
     showNewActiveOk(){
+      this.showNewActiveModal = false
       this.pageInit()
     },
     // 添加产品,包括正常和活动的产品

+ 5 - 0
src/views/user/Login.vue

@@ -191,6 +191,11 @@ export default {
         customActiveKey,
         Login
       } = this
+      // 清空仓库缓存数据
+      this.$store.state.app.warehouseAuthList = null
+      this.$store.state.app.warehouseAllList = null
+      this.$store.state.app.productTypeAllList = null
+      this.$store.state.app.productBrandAllList = null
 
       state.loginBtn = true
       const validateFieldsKey = customActiveKey === 'tab1' ? ['username', 'password', 'rememberMe'] : ['mobile', 'captcha']