浏览代码

对接登录和散件入库查询列表接口

chenrui 4 年之前
父节点
当前提交
27fb1c2316

+ 13 - 0
src/api/sparePartsRet.js

@@ -0,0 +1,13 @@
+import { axios } from '@/utils/request'
+
+//  散件退货列表  分页
+export const sparePartsRetList = (params) => {
+  const url = `/sparePartsRet/findPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 13 - 0
src/api/stock.js

@@ -0,0 +1,13 @@
+import { axios } from '@/utils/request'
+
+//  库存列表  分页
+export const stockList = (params) => {
+  const url = `/stock/findPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 12 - 12
src/config/router.config.js

@@ -1732,8 +1732,8 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '权限管理',
-          icon: 'lock',
-          permission: 'M_auth_0'
+          icon: 'lock'
+          // permission: 'M_auth_0'
         },
         children: [
           {
@@ -1742,8 +1742,8 @@ export const asyncRouterMap = [
             component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
             meta: {
               title: '用户管理',
-              icon: 'user',
-              permission: 'M_auth_userList'
+              icon: 'user'
+              // permission: 'M_auth_userList'
             }
           },
           {
@@ -1752,8 +1752,8 @@ export const asyncRouterMap = [
             component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
             meta: {
               title: '角色管理',
-              icon: 'solution',
-              permission: 'M_auth_roleList'
+              icon: 'solution'
+              // permission: 'M_auth_roleList'
             }
           }
         ]
@@ -1765,8 +1765,8 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '系统设置',
-          icon: 'setting',
-          permission: 'M_setting_0'
+          icon: 'setting'
+          // permission: 'M_setting_0'
         },
         children: [
           {
@@ -1776,8 +1776,8 @@ export const asyncRouterMap = [
               '@/views/power/dataDictionary/dataDictionary.vue'),
             meta: {
               title: '数据字典管理',
-              icon: 'database',
-              permission: 'M_sys_dataDictionary'
+              icon: 'database'
+              // permission: 'M_sys_dataDictionary'
             }
           },
           // {
@@ -1797,8 +1797,8 @@ export const asyncRouterMap = [
               '@/views/power/OperateJournal/OperateJournal.vue'),
             meta: {
               title: '操作日志',
-              icon: 'read',
-              permission: 'M_operateJournal'
+              icon: 'read'
+              // permission: 'M_operateJournal'
             }
           }
         ]

+ 1 - 2
src/layouts/BasicLayout.vue

@@ -113,8 +113,7 @@ export default {
     } else {
       // 没有权限时只显示首页
       const noqx = asyncRouterMap.find((item) => item.path === '/').children
-      // this.menus = [noqx.find(item => item.path === '/home')]
-      this.menus = noqx
+      this.menus = [noqx.find(item => item.path === '/home')]
     }
     this.collapsed = !this.sidebarOpened
   },

+ 8 - 10
src/permission.js

@@ -78,16 +78,14 @@ router.beforeEach((to, from, next) => {
       }
     }
   } else {
-    console.log(111111)
-    next()
-    // // 未登录
-    // if (whiteList.includes(to.name)) {
-    //   // 在免登录白名单,直接进入
-    //   next()
-    // } else {
-    //   next({ path: '/user/login', query: { redirect: to.fullPath } })
-    //   NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
-    // }
+    // 未登录
+    if (whiteList.includes(to.name)) {
+      // 在免登录白名单,直接进入
+      next()
+    } else {
+      next({ path: '/user/login', query: { redirect: to.fullPath } })
+      NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
+    }
   }
 })
 

+ 0 - 1
src/utils/request.js

@@ -38,7 +38,6 @@ const err = (error) => {
 // request interceptor
 service.interceptors.request.use(config => {
   const token = store.getters.token
-  config.headers['App-Type'] = 9 // 平台类型
   if (token) {
     config.headers['authorization'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
   }

+ 33 - 64
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -6,35 +6,35 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
-              <a-input id="inventoryQueryList-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入产品编码"/>
+              <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="原厂编码">
-              <a-input id="inventoryQueryList-custMobile" v-model.trim="queryParam.orderBundle.custMobile" allowClear placeholder="请输入原厂编码"/>
+              <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="inventoryQueryList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <a-select id="inventoryQueryList-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
+                <a-select id="inventoryQueryList-brandName" placeholder="请选择产品品牌" allowClear v-model="queryParam.brandName">
                   <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品类别">
-                <a-cascader :options="typeData" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+                <a-cascader :options="typeData" placeholder="请选择产品类别" allowClear v-model="queryParam.productTypeName" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="库存数量是否为0">
-                <a-switch checkedChildren="是" unCheckedChildren="否" id="inventoryQueryList-bundleNamess" v-model="queryParam.inventoryNum" />
+                <a-switch checkedChildren="是" unCheckedChildren="否" id="inventoryQueryList-currentStockQty" v-model="queryParam.currentStockQty" />
               </a-form-item>
             </a-col>
           </template>
@@ -76,7 +76,7 @@
 
 <script>
 import moment from 'moment'
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
+import { stockList } from '@/api/stock'
 import { STable } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
 export default {
@@ -85,14 +85,12 @@ export default {
     return {
       advanced: false,  // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        orderBundleNo: '', //  订单编号
-        orderBundle: {
-          custMobile: '' //  客户手机
-        },
-        bundleName: '', //  套餐名称
-        itemName: '', //  服务名称
-        brand: undefined,  //  产品品牌
-        inventoryNum: false  //  库存数量是否为0
+        productCode: '', //  产品编码
+        productOrigCode: '', //  原厂编码
+        productName: '', //  产品名称
+        brandName: undefined,  //  产品品牌
+        productTypeName: undefined, //  产品类别
+        currentStockQty: false  //  库存数量是否为0
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
@@ -100,42 +98,27 @@ export default {
       typeData: [],  //  产品类别下拉数据
       columns: [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productNum', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOldNum', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrand', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', dataIndex: 'productType', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '现有库存数量(个)', dataIndex: 'inventoryNum', width: 180, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '现有库存成本(¥)', dataIndex: 'inventoryMoney', width: 180, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', width: 180, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 180, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function(resolve, reject){
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        this.queryParam = {}
+        return stockList( Object.assign(parameter, this.queryParam) ).then(res => {
+          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
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
       openModal: false,  //  查看库存详情  弹框
@@ -145,12 +128,12 @@ export default {
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.productCode = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.brandName = undefined
+      this.queryParam.productTypeName = undefined
+      this.queryParam.currentStockQty = false
       this.$refs.table.refresh(true)
     },
     //  库存详情
@@ -170,25 +153,11 @@ export default {
     //  导出
     handleExport () {
       const params = this.queryParam
-      if (this.oldTime && this.oldTime.length > 0) {
-        params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
-        params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginOldExpiryDate = ''
-        params.endOldExpirydDate = ''
-      }
-      if (this.newTime && this.newTime.length > 0) {
-        params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
       this.exportLoading = true
-      customerBundleExportDelay(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
+      // customerBundleExportDelay(params).then(res => {
+      //   this.exportLoading = false
+      //   this.download(res)
+      // })
     },
     download (data) {
       if (!data) { return }

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.72:8503/qpls-md',
+        target: 'http://192.168.0.12:8503/qpls-md',
         // target: 'http://it.test.zyucgj.com/zyit',
         // target: 'https://it.test.qiubcar.com/zyit',
         ws: false,