Jelajahi Sumber

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

lilei 2 tahun lalu
induk
melakukan
acbe752d55

+ 29 - 0
src/views/dealerManagement/businessOwnerSettings/chooseAreaModal.vue

@@ -9,6 +9,9 @@
     @close="visible = false">
     <div class="areaSetModal">
       <div :style="{ height: tableHeight+84.5+'px' }">
+        <div>
+          <a-checkbox :checked="checkAll" @change="onCheckAllChange">全选</a-checkbox>
+        </div>
         <div :style="{ height: tableHeight+30+'px' }" style="overflow-y:scroll;">
           <a-tree
             v-model="checkedKeys"
@@ -53,6 +56,7 @@ export default {
     visible (newValue, oldValue) {
       if (!newValue) {
         this.checkedKeys = { checked: [], halfChecked: [] }
+        this.checkAll = false
         this.$emit('close')
       }
     }
@@ -60,6 +64,7 @@ export default {
   data () {
     return {
       autoExpandParent: false,
+      checkAll: false, //  全选
       checkedKeys: {
         checked: [], halfChecked: []
       },
@@ -122,6 +127,30 @@ export default {
     save () {
       this.$emit('ok', this.checkedKeys)
     },
+    // 全选
+    onCheckAllChange (e) {
+      this.checkAll = e.target.checked
+      if (e.target.checked) {
+        this.checkedKeys.checked = []
+        this.checkedKeys.halfChecked = []
+        this.getAllFun(this.subregionData)
+      } else {
+        this.checkedKeys.checked = []
+        this.checkedKeys.halfChecked = []
+      }
+    },
+    getAllFun (data) {
+      if (data) {
+        data.map((item, index) => {
+          if (!item.disabled || !item.disableCheckbox) {
+            this.checkedKeys.checked.push(item.areaSn)
+          }
+          if (item.subareaAreaList && item.subareaAreaList.length > 0) {
+            this.getAllFun(item.subareaAreaList)
+          }
+        })
+      }
+    },
     onCheck (checkedKeys) {
       this.checkedKeys = checkedKeys
     },

+ 2 - 2
src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue

@@ -241,7 +241,7 @@ export default {
     async openAreaModal () {
       const _this = this
       const checkedArr = []
-      const dataList = await queryAreaScope({ userSn: this.$route.query.sn })
+      const dataList = await queryAreaScope({ userSn: this.$route.query.sn, hasDetail: 0 })
       if (dataList.data && dataList.data.length > 0) {
         dataList.data.forEach(item => {
           if (item.bizType == 'subarea_area') {
@@ -264,7 +264,7 @@ export default {
     async openDealerModal (params = {}) {
       const _this = this
       const arr = []
-      const dataList = await queryDealerScope({ userSn: this.$route.query.sn })
+      const dataList = await queryDealerScope({ userSn: this.$route.query.sn, hasDetail: 0 })
       if (dataList.data && dataList.data.length > 0) {
         dataList.data.forEach(con => {
           arr.push(con.bizSn)

+ 13 - 19
src/views/reportData/receivedSendStorageReport/index.vue

@@ -259,22 +259,19 @@ export default {
       _this.exportLoading = true
       _this.spinning = true
       _this.showExport = true
-      if (this.tabVal == 1) {
-        hdExportExcel(exportDetailReport, params, '收发存报表', function () {
-          _this.exportLoading = false
-          _this.spinning = false
-        })
-      } else {
-        hdExportExcel(exportGroupByProductTypeReport, params, '收发存报表', function () {
-          _this.exportLoading = false
-          _this.spinning = false
-        })
-      }
+      hdExportExcel(exportDetailReport, params, '收发存报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+      hdExportExcel(exportGroupByProductTypeReport, params, '收发存报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
     },
     // 验证表单 type值  search查询 export导出
     testForm (type) {
       const _this = this
-      if (_this.form.time.length != 2) {
+      if (!_this.form.time[0] || !_this.form.time[1]) {
         _this.$message.error('请选择月份')
         return
       }
@@ -294,11 +291,8 @@ export default {
     // 查询
     handleSearch () {
       const _this = this
-      if (_this.tabVal == 1) {
-        _this.$refs.table.refresh(true)
-      } else {
-        _this.$refs.gatherBox.resetCurForm()
-      }
+      _this.$refs.table.refresh(true)
+      _this.$refs.gatherBox.resetCurForm()
     },
     // 重置
     resetSearchForm () {
@@ -316,8 +310,8 @@ export default {
       this.queryParam.productTypeSn3 = undefined
       this.$refs.table.clearTable()
       this.productType = []
-      this.$refs.table.refresh(true)
-      this.$refs.gatherBox.resetCurForm()
+      this.totalData = null
+      this.$refs.gatherBox.resetTable()
     },
     pageInit () {
       const _this = this

+ 4 - 0
src/views/reportData/receivedSendStorageReport/list.vue

@@ -115,6 +115,10 @@ export default {
     // 刷新当前页面
     resetCurForm () {
       this.$refs.table.refresh()
+    },
+    resetTable () {
+      this.$refs.table.clearTable()
+      this.totalData = null
     }
   }
 }