Procházet zdrojové kódy

调拨报表对接

chenrui před 3 roky
rodič
revize
c53a11f68f

+ 8 - 0
src/api/power-user.js

@@ -64,3 +64,11 @@ export const userSubareaSave = params => {
     method: 'post'
   })
 }
+// 所有用户
+export const userQueryList = params => {
+  return axios({
+    url: '/yyuser/queryAllLike',
+    data: params,
+    method: 'POST'
+  })
+}

+ 80 - 37
src/views/reportData/allocationDetails/list.vue

@@ -19,12 +19,12 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="产品名称">
-                <a-input id="allocationDetailsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                <a-input id="allocationDetailsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="品牌分类">
-                <v-select code="BRAND_TYPE" id="allocationDetailsList-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择品牌分类"></v-select>
+                <v-select code="BRAND_TYPE" id="allocationDetailsList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
@@ -44,7 +44,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品编码">
-                  <a-input id="allocationDetailsList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
+                  <a-input id="allocationDetailsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -56,8 +56,8 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="操作员">
-                  <a-select id="allocationDetailsList-state" v-model="queryParam.state" placeholder="请选择操作员" allowClear >
-                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+                  <a-select id="allocationDetailsList-creatorId" v-model="queryParam.creatorId" placeholder="请选择操作员" allowClear >
+                    <a-select-option v-for="item in operatorList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-model-item>
               </a-col>
@@ -82,7 +82,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="客户名称">
-                  <a-input id="allocationDetailsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
+                  <a-input id="allocationDetailsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -97,8 +97,8 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                  <a-form-model-item prop="provinceSn">
-                    <a-select id="allocationDetailsList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省">
+                  <a-form-model-item prop="dealerProvinceSn">
+                    <a-select id="allocationDetailsList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省">
                       <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
@@ -140,13 +140,13 @@
               总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
             </a-col>
             <a-col :md="4" :sm="24">
-              总成本价:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
+              总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
             </a-col>
             <a-col :md="4" :sm="24">
-              总毛利:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
+              总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}
             </a-col>
             <a-col :md="4" :sm="24">
-              总售价:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
+              总售价:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}
             </a-col>
           </a-row>
         </template>
@@ -163,6 +163,7 @@ import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { getArea } from '@/api/data'
 import { allocateTypeAllList } from '@/api/allocateType'
+import { userQueryList } from '@/api/power-user'
 import { allocateReportDetailList, allocateReportDetailCount } from '@/api/allocateReport'
 export default {
   components: { STable, VSelect, rangeDate, subarea },
@@ -175,17 +176,20 @@ export default {
         time: [],
         beginDate: '',
         endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '', //  调拨单号
+        productName: '',
+        productBrandTypeSn: undefined,
         productBrandSn: undefined, //  产品品牌
+        productCode: '',
+        allocateTypeSn: undefined, //  调拨类型
+        creatorId: undefined,
+        allocateNo: '',
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        dealerName: '',
+        dealerLevel: undefined,
+        subareaSn: undefined,
+        dealerProvinceSn: undefined
       },
       productType: [],
       labelCol: { span: 8 },
@@ -200,7 +204,7 @@ export default {
         { title: '调拨单号', dataIndex: 'allocateNo', width: 220, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '调拨开单日期', dataIndex: 'allocateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealerProvinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'targetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'targetName', align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
@@ -211,11 +215,11 @@ export default {
         { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总成本价', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'data16', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '毛利', dataIndex: 'grossProfit', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库', dataIndex: 'warehouseName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '操作员', dataIndex: 'creatorName', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '调拨类型', dataIndex: 'data20', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '操作员', dataIndex: 'creatorName', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -223,22 +227,39 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
         this.spinning = true
-        return allocateReportDetailList(params).then(res => {
-          // 总计
-          this.getCount(params)
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          this.disabled = false
-          this.spinning = false
-          return data
-        })
+        if (params.beginDate) {
+          return allocateReportDetailList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.spinning = false
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.spinning = false
+            _this.$message.info('请选择调拨开单日期')
+            resolve(data)
+          })
+        }
       },
       allocateTypeList: [], //  调拨类型
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
+      operatorList: [], //  操作员下拉数据
       addrProvinceList: [], //  省下拉
       totalData: null //  合计
     }
@@ -246,7 +267,7 @@ export default {
   methods: {
     // 盘点库存日期
     handleStock () {
-
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
     },
     //  创建时间  change
     dateChange (date) {
@@ -282,10 +303,21 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
+      this.queryParam.productName = ''
+      this.queryParam.productBrandTypeSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productCode = ''
       this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
+      this.queryParam.creatorId = undefined
       this.queryParam.allocateNo = ''
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.productType = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -331,6 +363,16 @@ export default {
         }
       })
     },
+    // 操作员
+    getUserList () {
+      userQueryList({}).then(res => {
+        if (res.status == 200) {
+          this.operatorList = res.data
+        } else {
+          this.operatorList = []
+        }
+      })
+    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -365,6 +407,7 @@ export default {
       vm.getProductBrand()
       vm.getProductType()
       vm.getAllocateTypeAllList()
+      vm.getUserList()
       vm.getArea('province')
     })
   }

+ 26 - 13
src/views/reportData/allocationOrderTotal/list.vue

@@ -24,8 +24,8 @@
             </a-col>
             <a-col :md="5" :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 id="allocationOrderTotalList-creatorId" v-model="queryParam.creatorId" placeholder="请选择操作员" allowClear >
+                  <a-select-option v-for="item in operatorList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
@@ -81,7 +81,7 @@
               总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
             </a-col>
             <a-col :md="4" :sm="24">
-              总毛利:{{ (totalData && (totalData.totalGrossProfig || totalData.totalGrossProfig==0)) ? totalData.totalGrossProfig : '--' }}
+              总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}
             </a-col>
           </a-row>
         </template>
@@ -94,6 +94,7 @@
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { allocateTypeAllList } from '@/api/allocateType'
+import { userQueryList } from '@/api/power-user'
 import { allocateReportList, allocateReportCount } from '@/api/allocateReport'
 export default {
   components: { STable, VSelect, rangeDate },
@@ -105,10 +106,10 @@ export default {
         time: [],
         beginDate: '',
         endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        allocateNo: '',
+        creatorId: undefined,
+        allocateCategory: undefined,
+        allocateTypeSn: undefined
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
@@ -123,8 +124,8 @@ export default {
         { title: '客户名称', dataIndex: 'targetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '调拨数量', dataIndex: 'totalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '成本价', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'grossProfig', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'creatorName', width: 120, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '毛利', dataIndex: 'grossProfit', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'creatorName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -146,13 +147,14 @@ export default {
         })
       },
       allocateTypeList: [], //  调拨类型
+      operatorList: [], //  操作员下拉数据
       totalData: null //  合计
     }
   },
   methods: {
     // 盘点库存日期
     handleStock () {
-
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
     },
     //  创建时间  change
     dateChange (date) {
@@ -188,10 +190,10 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
       this.queryParam.allocateNo = ''
+      this.queryParam.creatorId = undefined
+      this.queryParam.allocateCategory = undefined
+      this.queryParam.allocateTypeSn = undefined
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -205,11 +207,22 @@ export default {
           this.allocateTypeList = []
         }
       })
+    },
+    // 操作员
+    getUserList () {
+      userQueryList({}).then(res => {
+        if (res.status == 200) {
+          this.operatorList = res.data
+        } else {
+          this.operatorList = []
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getAllocateTypeAllList()
+      vm.getUserList()
     })
   }
 }