Jelajahi Sumber

bug修复+对接库存详情

chenrui 4 tahun lalu
induk
melakukan
c292ef16ab

+ 13 - 5
src/api/stock.js

@@ -11,9 +11,17 @@ export const stockList = (params) => {
     method: 'post'
   })
 }
-//  库存详情列表  分页
+//  库存 列表 合计
+export const stockCount = (params) => {
+  return axios({
+    url: '/stock/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存 详情列表  分页
 export const stockDetailList = (params) => {
-  const url = `/stock/queryDetailPage/${params.pageNo}/${params.pageSize}`
+  const url = `/stock/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -22,10 +30,10 @@ export const stockDetailList = (params) => {
     method: 'post'
   })
 }
-//  库存 列表 合计
-export const stockCount = (params) => {
+//  库存 详情列表 合计
+export const stockDetailCount = (params) => {
   return axios({
-    url: '/stock/queryCount',
+    url: '/stock/detail/queryCount',
     data: params,
     method: 'post'
   })

+ 2 - 2
src/components/tools/UserMenu.vue

@@ -7,11 +7,11 @@
         </span>
       </a> -->
       <!-- <notice-icon class="action"/> -->
+      <span style="margin: 0 5px;">{{ nickname }}</span>
       <a-dropdown>
         <span class="action ant-dropdown-link user-dropdown-menu">
           <!-- <a-avatar class="avatar" size="small" :src="avatar==''?defaultAvatar:avatar"/> -->
-          <a-icon type="user" />
-          <span style="margin: 0 5px;">{{ nickname }}</span>
+          <!-- <a-icon type="user" /> -->
           <a-icon type="down" />
         </span>
         <a-menu slot="overlay" class="user-dropdown-menu-wrapper">

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

@@ -666,8 +666,8 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '库存管理',
-          icon: 'shop',
-          permission: 'M_inventory'
+          icon: 'shop'
+          // permission: 'M_inventory'
         },
         children: [
           {
@@ -677,8 +677,8 @@ export const asyncRouterMap = [
             component: RouteView,
             meta: {
               title: '库存查询',
-              icon: 'monitor',
-              permission: 'M_inventory_inventoryQuery_list'
+              icon: 'monitor'
+              // permission: 'M_inventory_inventoryQuery_list'
             },
             hideChildrenInMenu: true,
             children: [
@@ -689,8 +689,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '库存列表',
                   icon: 'monitor',
-                  hidden: true,
-                  permission: 'M_inventory_inventoryQuery_list'
+                  hidden: true
+                  // permission: 'M_inventory_inventoryQuery_list'
                 }
               },
               {

+ 36 - 41
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -10,7 +10,7 @@
     width="80%">
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>998</strong>;现有库存总成本(¥):<strong>2009.00</strong>。</div>
+      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ currentStock.currentQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.putCost || 0 }}</strong>。</div>
     </a-alert>
     <!-- 库存详情 -->
     <s-table
@@ -20,7 +20,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1220 }"
+      :scroll="{ x: 1340 }"
       bordered>
     </s-table>
     <div class="btn-cont">
@@ -31,6 +31,7 @@
 
 <script>
 import { STable } from '@/components'
+import { stockDetailList, stockDetailCount } from '@/api/stock'
 export default {
   name: 'InventoryQueryDetailModal',
   components: { STable },
@@ -55,49 +56,51 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库时间', dataIndex: 'productBrand', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'productType', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'productTypes', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'productTypess', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'inventoryNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本单价', dataIndex: 'inventoryMoney', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 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' }
-            ]
-          }
+        return stockDetailList(Object.assign(parameter, { stockSn: this.itemId })).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
+          // 总计
+          this.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
+          return data
         })
+      },
+      currentStock: { // 合计信息
+        currentQty: '',
+        putCost: ''
       }
     }
   },
   methods: {
-
+    // 合计
+    getTotal (param) {
+      stockDetailCount(param).then(res => {
+        if (res.status == 200 && res.data) {
+          this.currentStock = res.data
+        } else {
+          this.currentStock = { // 合计信息
+            currentQty: '',
+            putCost: ''
+          }
+        }
+      })
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -109,14 +112,6 @@ export default {
       if (!newValue) {
         this.$emit('close')
       }
-    },
-    itemId (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        const _this = this
-        setTimeout(() => {
-          _this.$refs.table.refresh(true)
-        }, 100)
-      }
     }
   }
 }
@@ -125,8 +120,8 @@ export default {
 <style lang="less">
   .inventoryQueryDetail-modal{
     .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
+      text-align: center;
+      margin: 35px 0 10px;
     }
   }
 </style>

+ 9 - 9
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -81,17 +81,17 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
+      :scroll="{ x: 1470 }"
       bordered>
       <!-- 产品分类 -->
       <template slot="productTypeName" slot-scope="text, record">
-        <span v-if="record.productTypeName1">{{ record.productTypeName1 || '' }} ></span>
         <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
         <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
-        <a-button size="small" type="link" style="margin-left: 8px" @click="goWarehouseDetail(record)" id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
+        <a-button size="small" type="primary" class="button-success" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
+        <a-button size="small" type="primary" class="button-warning" @click="goWarehouseDetail(record)" id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
       </template>
     </s-table>
     <!-- 库存详情 -->
@@ -115,7 +115,7 @@ export default {
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productOrigCode: '', //  原厂编码
-        productBrandSn: '', //  产品品牌
+        productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品分类1
         productTypeSn2: '', //  产品分类2
         productTypeSn3: '', //  产品分类3
@@ -132,10 +132,10 @@ export default {
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 300, align: 'center' },
+        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 240, align: 'center' },
         { title: '现有库存数量(个)', dataIndex: 'currentStockQty', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -171,7 +171,7 @@ export default {
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.productBrandSn = ''
+      this.queryParam.productBrandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
@@ -199,7 +199,7 @@ export default {
     },
     //  库存详情
     goDetail (row) {
-      this.itemId = row.id
+      this.itemId = row.stockSn
       this.openModal = true
     },
     //  关闭弹框