Browse Source

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

chenrui 2 years ago
parent
commit
299ddc0573

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.6",
+    "version": "2.2.7",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 1 - 1
src/utils/request.js

@@ -59,7 +59,7 @@ const err = (error) => {
       }else{
         notification.error({
           message: '提示',
-          description: resData.message || error.response.statusText
+          description: resData.message || error.response.statusText || '服务器出错,请稍后再试!'
         })
       }
     }

+ 2 - 0
src/views/allocationManagement/transferReturn/edit.vue

@@ -335,6 +335,7 @@ export default {
         { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
+      return arr
     },
     chooseColumns(){
       const _this = this
@@ -350,6 +351,7 @@ export default {
       if(this.$hasPermissions('B_transferReturnEdit_salesPrice')){
         arr.splice(6,0,{ title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
+      return arr
     }
   },
   methods: {

+ 11 - 0
src/views/common/subarea.js

@@ -42,10 +42,17 @@ const AreaList = {
         type: String,
         default: 'default'
     },
+    // 只能选择分区,如果区域下无分区不能选择
+    onlySubarea:{
+      type: Boolean,
+      default: false
+    },
+    // true可选择一级、二级,false只能选择叶子节点
     changeOnSelect:{
         type: Boolean,
         default: true
     },
+    // 只显示那一级数据,空全部显示
     showLeve:{
       type: String,
       default: ''
@@ -87,6 +94,10 @@ const AreaList = {
                         cd.name = cd.subareaAreaName
                         cd.areaSn = cd.subareaAreaSn
                       })
+                    }else{
+                      if(this.onlySubarea){
+                        item.disabled = true
+                      }
                     }
                   })
                   this.list = res.data

+ 10 - 6
src/views/dealerManagement/marketingDivisionSetNew/viewDealers.vue

@@ -128,6 +128,7 @@ export default {
     visible (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.resetData()
       }else{
         this.pageInit()
       }
@@ -235,11 +236,8 @@ export default {
         this.$refs.table.refresh(true)
       }
     },
-    resetSearchForm () {
-      if(this.flag){
-        this.hasData()
-      }else{
-        this.queryParam = {
+    resetData(){
+      this.queryParam = {
           dealer:{
             nameLike: '',
             dealerType: null,
@@ -250,7 +248,13 @@ export default {
             districtSn: undefined
           }
         }
-        this.$refs.areaList.clearData()
+      this.$refs.areaList.clearData()
+    },
+    resetSearchForm () {
+      if(this.flag){
+        this.hasData()
+      }else{
+        this.resetData()
         this.$refs.table.refresh(true)
       }
     },

+ 1 - 1
src/views/expenseManagement/expenseReimbursement/chooseDepartUserModal.vue

@@ -137,7 +137,7 @@ export default {
     getFormatUser(list){
       const ret = []
       list.map(item => {
-        ret.push({label: item.userName, value: item.userId})
+        ret.push({label: item.userName, value: item.userId||item.userid})
       })
       return ret
     },

+ 1 - 0
src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue

@@ -53,6 +53,7 @@
                     id="epenseDetailModal-subarea"
                     ref="subareaBox"
                     defValKey="name"
+                    :onlySubarea="true"
                     :changeOnSelect="false"
                     @change="subareaChange"
                     v-model="subareaList"

+ 69 - 6
src/views/power/role/menuModal.vue

@@ -18,6 +18,12 @@
           :label-col="formItemLayout.labelCol"
           :wrapper-col="formItemLayout.wrapperCol"
         >
+         <div style="display:flex;justify-content: flex-end;align-items: center;" v-if="authType==0">
+           <div style="width:270px;text-align: right;flex:1;">快捷全选:</div>
+           <div style="padding:0 10px;">
+            <a-checkbox-group :value="authAllPrice" :options="priceOptions" @change="onPriceChange" />
+           </div>
+         </div>
          <div style="height: 500px;overflow-y: auto;">
             <a-tree
             checkable
@@ -81,6 +87,9 @@ export default {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      authAllPrice: [],
+      leafNode:[],
+      checkLeafNode:[],
       form: {},
       rules: {},
       authType: '1',
@@ -97,16 +106,58 @@ export default {
       this.halfCheckedKeys = info.halfCheckedKeys
       this.checkedKeys = checkedKeys
     },
+    // 判断某分类是否全选
+    hasAllSelect(){
+      console.log(this.leafNode)
+      console.log(this.checkLeafNode)
+      this.priceOptions.map(item => {
+        const a = this.leafNode.filter(n => n.pr == item.value)
+        const b = this.checkLeafNode.filter(n => n.pr == item.value)
+        if(a&&b&&a.length == b.length && !this.authAllPrice.find(d => d==item.value)){
+          this.authAllPrice.push(item.value)
+        }
+      })
+    },
+    // 全选某分类价格
+    allSelect(data,authPrice,flag){
+      const _this = this
+      for (let i = 0; i < data.length; i++) {
+        const node = data[i]
+        const a = node.code.split('_')
+        if(a[a.length-1] == authPrice){
+          // 全选
+          if(flag){
+            _this.checkedKeys.push(node.id)
+          }else{
+            // 取消
+            _this.checkedKeys = _this.checkedKeys.filter(item => item != node.id)
+          }
+        } 
+        if (node.children && node.children.length) {
+          _this.allSelect(node.children, authPrice, flag)
+        }
+      }
+    },
+    onPriceChange(val){
+      // 全选
+      if(this.authAllPrice.length < val.length){
+        let tempVal = val.filter(item=>!this.authAllPrice.includes(item))
+        console.log(tempVal)
+        this.allSelect(this.nowData.allMenuList, tempVal[0], true)
+      }else{
+        // 取消
+        let tempVal = this.authAllPrice.filter(item=>!val.includes(item))
+        this.allSelect(this.nowData.allMenuList, tempVal[0], false)
+      }
+      this.authAllPrice = val
+    },
     // 保存提交
     handleSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          if (this.checkedKeys.length == 0) {
-            return this.$message.warning('请先选择菜单')
-          }
           const arr = [...this.checkedKeys, ...this.halfCheckedKeys, ...this.checkedData].filter((x, index,self)=>self.indexOf(x)===index) 
-          console.log(arr,this.checkedData)
+          console.log(this.checkedData)
 
           _this.spinning = true
           addMenuPower({ id: this.id, menuIds: arr.join(',') }).then(res => {
@@ -166,6 +217,9 @@ export default {
       const _this = this
       for (let i = 0; i < data.length; i++) {
         const node = data[i]
+        const a = node.code.split('_')
+        // 已选节点勾选
+        const hasNode = arr.find(item => item == node.id)
         if(!_this.isPriceNode(node)){
           // 删除此节点
           node.checkable = false
@@ -176,11 +230,16 @@ export default {
         }else{
           node.class = 'leafNode'
           _this.expandedKeys.push(node.id)
-          // 已选节点勾选
-          const hasNode = arr.find(item => item == node.id)
+          // 默认回显已选节点
           const hasCheck = _this.checkedKeys.find(item => item == node.id)
           if (hasNode && !hasCheck) {
             _this.checkedKeys.push(node.id)
+            _this.checkLeafNode.push({pr:a[a.length-1],id:node.id})
+          }
+          // 统计价格节点
+          const hasLeaf = _this.leafNode.find(item => item.id == node.id)
+          if(!hasLeaf){
+            _this.leafNode.push({pr:a[a.length-1],id:node.id})
           }
         }
 
@@ -206,6 +265,7 @@ export default {
       }
       if(this.authType == 0){
         this.findPrice(treeData, this.checkedData)
+        this.hasAllSelect()
       }
       this.checkedData = this.checkedData.filter(item => !this.checkedKeys.includes(item))
       // console.log(this.checkedData)
@@ -237,6 +297,9 @@ export default {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
         this.id = ''
+        this.authAllPrice = []
+        this.checkLeafNode = []
+        this.leafNode = []
         this.checkedKeys = []
         this.expandedKeys = []
         this.titleText = '新增角色'

+ 3 - 1
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -201,9 +201,11 @@ export default {
       ]
       if (this.$hasPermissions('B_dispatchDetail_salesPrice')) { //  售价权限
         arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(6, 0, { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
+      if (this.$hasPermissions('B_dispatchDetail_cityPrice')) { //  市级权限
+        arr.splice(6, 0, { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      }
       return arr
     }
   },

+ 1 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -182,7 +182,7 @@
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message" class="total-bar">
             <div>
-              <span v-if="$hasPermissions('B_salesEdit_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalPromoCost || detailData.totalPromoCost==0) ? toThousands(detailData.totalPromoCost) : '--' }}</strong>;</span>
+              <span>总成本:<strong>{{ detailData&&(detailData.totalPromoCost || detailData.totalPromoCost==0) ? toThousands(detailData.totalPromoCost) : '--' }}</strong>;</span>
               总款数:<strong>{{ detailData&&(detailData.totalPromoCategory || detailData.totalPromoCategory==0) ? detailData.totalPromoCategory : '--' }}</strong>;
               总数量:<strong>{{ detailData&&(detailData.totalPromoQty || detailData.totalPromoQty==0) ? detailData.totalPromoQty : '--' }}</strong>;
             </div>

+ 18 - 12
src/views/salesManagement/salesQuery/printModal.vue

@@ -132,20 +132,12 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          // 销售分类无权限不打印
-          if(!_this.$hasPermissions('B_salesTypePrint_salesPrice')){
-            _this.form.priceType = 'SALES_BILL_TYPE'
-          }
-          // 销售打印无权限不打印
-          if(!_this.$hasPermissions('B_salesPrint_salesPrice')){
-            _this.form.priceType = 'SALES_BILL'
-          }
-          // 销售导出无权限不导出
-          if(!_this.$hasPermissions('B_salesDetailExport_salesPrice')){
-            _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
-          }
           // 分类打印
           if (_this.nowType == 'SALES_BILL_TYPE') {
+            // 销售分类无权限不打印
+            if(!_this.$hasPermissions('B_salesTypePrint_salesPrice')){
+              _this.form.priceType = 'SALES_BILL_TYPE'
+            }
             const item = _this.typeList.find(item => item.id == _this.form.id)
             if (item) {
               const obj = {
@@ -163,6 +155,10 @@ export default {
               _this.$emit('ok', obj)
             }
           } else if (_this.nowType == 'SALES_BILL') {
+            // 销售打印无权限不打印
+            if(!_this.$hasPermissions('B_salesPrint_salesPrice')){
+              _this.form.priceType = 'SALES_BILL'
+            }
             const obj = {
               salesBillSn: _this.itemData.salesBillSn,
               priceType: _this.form.priceType,
@@ -170,6 +166,10 @@ export default {
             }
             _this.$emit('ok', obj)
           } else if (_this.nowType == 'export') {
+            // 销售导出无权限不导出
+            if(!_this.$hasPermissions('B_salesDetailExport_salesPrice')){
+              _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
+            }
             const obj = {
               salesBillSn: _this.itemData.salesBillSn,
               priceType: _this.form.priceType,
@@ -214,6 +214,12 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.form = {
+          id: 'all',
+          dataScope: 'all',
+          priceType: undefined,
+          orderBy: undefined
+        }
         this.$refs.ruleForm.resetFields()
       } else {
         if (this.nowType == 'SALES_BILL_TYPE') {

+ 2 - 2
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -202,14 +202,14 @@ export default {
         { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_salesReturnDetail_salesPrice') && this.showFlag != 0) { //  售价权限
         arr.splice(10, 0, { title: '参考退货单价', dataIndex: 'initialPrice', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(11, 0, { title: '参考退货金额', dataIndex: 'initialAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(12, 0, { title: '实际退货单价', dataIndex: 'price', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(13, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(14, 0, { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     }

+ 2 - 2
vue.config.js

@@ -107,9 +107,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.2.111:8602/ocs-admin',
+        // target: 'http://192.168.2.111:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  预发布
+        target: 'http://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {