lilei 2 éve
szülő
commit
6d3d6cc4bf

+ 17 - 6
src/views/reportData/allocationDetails/list.vue

@@ -41,10 +41,8 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="调拨类型名称">
-                  <a-select id="allocationDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型名称" allowClear >
-                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                  </a-select>
+                <a-form-model-item label="费用/调拨类型">
+                  <AllocateType id="allocationDetailsList-allocateTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -165,11 +163,12 @@ import { allocateTypeAllList } from '@/api/allocateType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { userQueryList } from '@/api/power-user'
+import AllocateType from '@/views/common/allocateType.js'
 import { allocateReportDetailList, allocateReportDetailCount, allocateReportDetailExport } from '@/api/allocateReport'
 export default {
   name: 'AllocationDetailsList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal, AllocateType },
   data () {
     return {
       spinning: false,
@@ -177,6 +176,7 @@ export default {
       exportLoading: false,
       tableHeight: 0,
       showExport: false,
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         time: [
           getDate.getCurrMonthDays().starttime,
@@ -188,7 +188,9 @@ export default {
         productBrandTypeSn: undefined,
         productBrandSn: undefined, //  产品品牌
         productCode: '',
-        allocateTypeSn: undefined, //  调拨类型
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类型1
+        allocateTypeSn: undefined, //  调拨类型2
         creatorId: undefined,
         allocateNo: '',
         productTypeSn1: '', //  产品一级分类
@@ -309,6 +311,12 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
     // 合计
     getCount (params) {
       allocateReportDetailCount(params).then(res => {
@@ -344,6 +352,8 @@ export default {
       this.queryParam.productBrandTypeSn = undefined
       this.queryParam.productBrandSn = undefined
       this.queryParam.productCode = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.creatorId = undefined
       this.queryParam.allocateNo = ''
@@ -355,6 +365,7 @@ export default {
       this.queryParam.subareaSn = undefined
       this.queryParam.dealerProvinceSn = undefined
       this.productType = []
+      this.allocateTypeVal = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()

+ 16 - 12
src/views/reportData/allocationOrderTotal/list.vue

@@ -40,15 +40,8 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="调拨类别">
-                  <v-select code="ALLOCATE_CATEGORY" id="allocationOrderTotalList-allocateCategory" v-model="queryParam.allocateCategory" allowClear placeholder="请选择调拨类别"></v-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="调拨类型名称">
-                  <a-select id="allocationOrderTotalList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型名称" allowClear >
-                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                  </a-select>
+                <a-form-model-item label="费用/调拨类型">
+                  <AllocateType id="allocationDetailsList-allocateTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -98,15 +91,17 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { allocateTypeAllList } from '@/api/allocateType'
 import { userQueryList } from '@/api/power-user'
+import AllocateType from '@/views/common/allocateType.js'
 import { allocateReportList, allocateReportCount } from '@/api/allocateReport'
 export default {
   name: 'AllocationOrderTotalList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, AllocateType },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         time: [
           getDate.getCurrMonthDays().starttime,
@@ -116,8 +111,9 @@ export default {
         endDate: getDate.getCurrMonthDays().endtime,
         allocateNo: '',
         creatorId: undefined,
-        allocateCategory: undefined,
-        allocateTypeSn: undefined
+        costTypeSn: undefined, // 费用类型
+        allocateCategory: undefined, //  调拨类型1
+        allocateTypeSn: undefined //  调拨类型2
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
@@ -171,6 +167,12 @@ export default {
     }
   },
   methods: {
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateCategory = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
     // 盘点库存日期
     handleStock () {
       this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
@@ -218,8 +220,10 @@ export default {
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.allocateNo = ''
       this.queryParam.creatorId = undefined
+      this.queryParam.costTypeSn = undefined
       this.queryParam.allocateCategory = undefined
       this.queryParam.allocateTypeSn = undefined
+      this.allocateTypeVal = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()