瀏覽代碼

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

lilei 4 年之前
父節點
當前提交
24e8ee83f5

+ 5 - 5
src/api/product.js

@@ -74,7 +74,7 @@ export const productBatchOnline = (params) => {
 
 //  产品  定价  列表  分页
 export const productPricingList = (params) => {
-  const url = `/product/queryPricingPage/${params.pageNo}/${params.pageSize}`
+  const url = `/product/pricing/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -86,14 +86,14 @@ export const productPricingList = (params) => {
 //  产品  定价 详情  根据sn查询
 export const productPricingSnDetail = (params) => {
   return axios({
-    url: `/product/getPricingInfo/${params.sn}`,
+    url: `/product/pricing/getPricingInfo/${params.sn}`,
     method: 'get'
   })
 }
 //  产品  定价 编辑
 export const productPricingSave = (params) => {
   return axios({
-    url: '/product/savePricing',
+    url: '/product/pricing/save',
     data: params,
     method: 'post'
   })
@@ -101,7 +101,7 @@ export const productPricingSave = (params) => {
 //  产品  定价 审核
 export const productPricingAudit = (params) => {
   return axios({
-    url: '/product/auditPricing',
+    url: '/product/pricing/audit',
     data: params,
     method: 'post'
   })
@@ -163,7 +163,7 @@ export const productBatchOfflineAudit = (params) => {
 
 //  产品  价格变更记录  列表  分页
 export const productPriceChangeList = (params) => {
-  const url = `/product/queryPriceChangePage/${params.pageNo}/${params.pageSize}`
+  const url = `/product/priceChange/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 27 - 9
src/api/stock.js

@@ -14,14 +14,14 @@ export const stockList = (params) => {
 //  库存 列表 合计
 export const stockCount = (params) => {
   return axios({
-    url: '/stock/queryCount',
+    url: '/stock/queryPageCount',
     data: params,
     method: 'post'
   })
 }
 //  库存 详情列表  分页
 export const stockDetailList = (params) => {
-  const url = `/stock/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  const url = `/stock/queryDetailPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -33,15 +33,14 @@ export const stockDetailList = (params) => {
 //  库存 详情列表 合计
 export const stockDetailCount = (params) => {
   return axios({
-    url: '/stock/detail/queryCount',
+    url: '/stock/queryDetailPageCount',
     data: params,
     method: 'post'
   })
 }
-
-//  库存 详情列表  分页
-export const querySumByProductLocation = (params) => {
-  const url = `/stock/detail/querySumByProductLocation/${params.pageNo}/${params.pageSize}`
+//  出入库明细 列表  有分页
+export const stockFlowList = (params) => {
+  const url = `/stock/queryFlowPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -51,11 +50,30 @@ export const querySumByProductLocation = (params) => {
   })
 }
 //  出入库明细  列表  合计
-export const stockByProductSn = (params) => {
-  const url = `/stock/findByProductSn/${params.productSn}`
+export const stockFlowCount = (params) => {
+  return axios({
+    url: '/stock/queryFlowPageCount',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  库存预警 列表  分页
+export const stockWarnList = (params) => {
+  const url = `/stock/queryWarnPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
     url: url,
     data: params,
     method: 'post'
   })
 }
+//  库存预警 保存
+export const stockWarnSaveBatch = (params) => {
+  return axios({
+    url: '/stock/updateStateBatch',
+    data: params,
+    method: 'post'
+  })
+}

+ 0 - 13
src/api/stockFlow.js

@@ -1,13 +0,0 @@
-import { axios } from '@/utils/request'
-
-//  库存流水(出入库明细) 列表  有分页
-export const stockFlowList = (params) => {
-  const url = `/stockFlow/queryPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}

+ 0 - 21
src/api/stockWarn.js

@@ -1,21 +0,0 @@
-import { axios } from '@/utils/request'
-
-//  库存预警 列表  分页
-export const stockWarnList = (params) => {
-  const url = `/stockWarn/queryPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-//  库存预警 保存
-export const stockWarnSaveBatch = (params) => {
-  return axios({
-    url: '/stockWarn/saveBatch',
-    data: params,
-    method: 'post'
-  })
-}

+ 14 - 8
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -4,13 +4,13 @@
     class="inventoryQueryDetail-modal"
     :footer="null"
     :maskClosable="false"
-    :title="modalTit"
+    title="库存详情"
     v-model="isShow"
     @cancle="isShow=false"
     width="80%">
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ currentStock.currentQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.putCost || 0 }}</strong>。</div>
+      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
     </a-alert>
     <!-- 库存详情 -->
     <s-table
@@ -51,11 +51,6 @@ export default {
       default: ''
     }
   },
-  computed: {
-    modalTit () {
-      return '库存详情'
-    }
-  },
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
@@ -84,7 +79,6 @@ export default {
           this.disabled = false
           // 总计
           this.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
-          console.log(data)
           return data
         })
       },
@@ -94,6 +88,18 @@ export default {
       }
     }
   },
+  computed: {
+    stockQty () { //  库存总数量 合计
+      const currentStockQty = Number(this.currentStock.currentStockQty) || 0
+      const freezeStockQty = Number(this.currentStock.freezeStockQty) || 0
+      return currentStockQty + freezeStockQty
+    },
+    stockCost () { //  库存总成本 合计
+      const currentStockCost = Number(this.currentStock.currentStockCost) || 0
+      const freezeStockCost = Number(this.currentStock.freezeStockCost) || 0
+      return currentStockCost + freezeStockCost
+    }
+  },
   methods: {
     // 合计
     getTotal (param) {

+ 86 - 29
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -22,12 +22,30 @@
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <ProductBrand id="inventoryQueryList-brandSn" v-model="queryParam.brandSn"></ProductBrand>
+                <a-select
+                  placeholder="请选择产品品牌"
+                  id="inventoryQueryList-productBrandSn"
+                  allowClear
+                  v-model="queryParam.productBrandSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品分类">
-                <ProductType v-model="productTypeSn" @change="changeType"></ProductType>
+                <a-cascader
+                  @change="changeProductType"
+                  expand-trigger="hover"
+                  change-on-select
+                  :options="productTypeList"
+                  :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
+                  id="inventoryQueryList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear
+                  v-model="productType" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -58,7 +76,7 @@
     </div>
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ currentStock.currentStockQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.currentStockCost || 0 }}</strong>。</div>
+      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -70,11 +88,6 @@
       :data="loadData"
       :scroll="{ x: 1630, y: tableHeight }"
       bordered>
-      <!-- 产品分类 -->
-      <template slot="productTypeName" slot-scope="text, record">
-        <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
-        <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
-      </template>
       <!-- 现有库存数量 -->
       <template slot="currentStockQty" slot-scope="text, record">
         {{ (record.currentStockQty + record.freezeQty) || 0 }}
@@ -93,13 +106,13 @@
 
 <script>
 import moment from 'moment'
-import { stockList, stockCount } from '@/api/stock'
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
-import ProductBrand from '@/views/common/productBrand.js'
-import ProductType from '@/views/common/productType.js'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { stockList, stockCount } from '@/api/stock'
 export default {
-  components: { STable, VSelect, inventoryQueryDetailModal, ProductBrand, ProductType },
+  components: { STable, VSelect, inventoryQueryDetailModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -108,15 +121,17 @@ export default {
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productOrigCode: '', //  原厂编码
-        brandSn: undefined, //  产品品牌
+        productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品分类1
         productTypeSn2: '', //  产品分类2
         productTypeSn3: '', //  产品分类3
         zeroQtyFlag: undefined //  库存数量是否为0
       },
-      productTypeSn: [],
+      productType: [],
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [], //  分类下拉数据
       zeroQtyData: [ //  库存情况
         { name: '库存数量为0', id: '1' },
         { name: '库存数量不为0', id: '0' }
@@ -125,11 +140,11 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 240, align: 'center' },
-        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
-        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
+        { 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 对象
@@ -156,6 +171,14 @@ export default {
           this.disabled = false
           // 总计
           this.getTotal(Object.assign(parameter, this.queryParam))
+          // 产品分类
+          if (this.productTypeList.length == 0) {
+            this.getProductType()
+          }
+          // 产品品牌
+          if (this.productBrandList.length == 0) {
+            this.getProductBrand()
+          }
           return data
         })
       },
@@ -167,20 +190,30 @@ export default {
       }
     }
   },
+  computed: {
+    stockQty () { //  库存总数量 合计
+      const currentStockQty = Number(this.currentStock.currentStockQty) || 0
+      const freezeStockQty = Number(this.currentStock.freezeStockQty) || 0
+      return currentStockQty + freezeStockQty
+    },
+    stockCost () { //  库存总成本 合计
+      const currentStockCost = Number(this.currentStock.currentStockCost) || 0
+      const freezeStockCost = Number(this.currentStock.freezeStockCost) || 0
+      return currentStockCost + freezeStockCost
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.brandSn = undefined
+      this.queryParam.productBrandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productCode = ''
       this.queryParam.productOrigCode = ''
       this.queryParam.productName = ''
-      this.queryParam.brandName = undefined
-      this.queryParam.productTypeName = undefined
       this.queryParam.zeroQtyFlag = undefined
-      this.productTypeSn = []
+      this.productType = []
       this.$refs.table.refresh(true)
     },
     // 合计
@@ -243,12 +276,36 @@ export default {
         })
       }
     },
-    // 分类  changeType
-    changeType (val) {
-      console.log(val)
-      for (let i = 0; i < val.length; i++) {
-        this.queryParam['productTypeSn' + (i + 1)] = val[i]
-      }
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
   }
 }

+ 26 - 33
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -16,7 +16,7 @@
                 <v-select
                   v-model="queryParam.flowType"
                   ref="flowType"
-                  id="warehousingAuditList-flowType"
+                  id="inventoryQueryWarehouseDetail-flowType"
                   code="STOCK_FLOW_TYPE"
                   placeholder="请选择变动类型"
                   allowClear></v-select>
@@ -72,7 +72,7 @@
       </div>
       <!-- 合计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div class="ftext" slot="message">当前库存总数量(个):<strong>{{ productTotal.stockQty }}</strong>;当前库存总成本(¥):<strong>{{ productTotal.stockCost }}</strong>。</div>
+        <div class="ftext" slot="message">当前库存总数量(个):<strong>{{ (productTotal&&productTotal.totalQty) ? productTotal.totalQty : 0 }}</strong>;当前库存总成本(¥):<strong>{{ (productTotal&&productTotal.totalCost) ? productTotal.totalCost : 0 }}</strong>。</div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -82,11 +82,14 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1760 }"
+        :scroll="{ x: 1980 }"
         bordered>
         <!-- 数量 -->
         <template slot="qty" slot-scope="text, record">
-          <span :class="record.flowType=='PUT' ? 'green':'red'">{{ record.flowType=='PUT' ? '+':'-' }}{{ record.qty }}</span>
+          <p :class="record.flowType=='PUT' ? 'green':'red'" style="margin: 0;">
+            <span v-if="record.qty!=0">{{ record.flowType=='PUT' ? '+':'-' }}</span>
+            {{ record.qty }}
+          </p>
         </template>
       </s-table>
     </a-card>
@@ -96,8 +99,7 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
-import { stockFlowList } from '@/api/stockFlow'
-import { stockByProductSn } from '@/api/stock'
+import { stockFlowCount, stockFlowList } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
 export default {
   components: { STable, VSelect },
@@ -116,15 +118,15 @@ export default {
       dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'product.code', width: 140, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'product.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库批次时间', dataIndex: 'stockBatchNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'unitName', width: 200, align: 'center', ellipsis: true, 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: 'unitName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
         { title: '总成本', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总售价', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
@@ -158,10 +160,7 @@ export default {
         })
       },
       warehouseList: [], //  仓库  下拉数据
-      productTotal: {
-        stockQty: 0,
-        stockCost: 0
-      } //  合计
+      productTotal: null //  合计
     }
   },
   methods: {
@@ -171,17 +170,11 @@ export default {
     },
     // 合计
     getTotal (param) {
-      stockByProductSn(param).then(res => {
+      stockFlowCount(param).then(res => {
         if (res.status == 200 && res.data) {
-          this.productTotal = {
-            stockQty: (Number(res.data.currentStockQty) + Number(res.data.freezeQty)) || 0,
-            stockCost: (Number(res.data.currentStockCost) + Number(res.data.freezeCost)) || 0
-          }
+          this.productTotal = res.data
         } else {
-          this.productTotal = {
-            stockQty: 0,
-            stockCost: 0
-          }
+          this.productTotal = null
         }
       })
     },
@@ -200,13 +193,13 @@ export default {
     },
     // 仓库下拉数据
     getWarehouseList (type) {
-      warehouseAllList({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
+      // warehouseAllList({}).then(res => {
+      //   if (res.status == 200) {
+      //     this.warehouseList = res.data
+      //   } else {
+      //     this.warehouseList = []
+      //   }
+      // })
     }
   },
   beforeRouteEnter (to, from, next) {

+ 68 - 17
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -22,20 +22,38 @@
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <ProductBrand id="inventoryWarningList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                <a-select
+                  placeholder="请选择产品品牌"
+                  id="inventoryWarningList-productBrandSn"
+                  allowClear
+                  v-model="queryParam.productBrandSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品分类">
-                <ProductType id="inventoryWarningList-productType" v-model="productType" @change="changeProductType"></ProductType>
+                <a-cascader
+                  @change="changeProductType"
+                  change-on-select
+                  v-model="productType"
+                  expand-trigger="hover"
+                  :options="productTypeList"
+                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                  id="inventoryWarningList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="预警提示">
                 <v-select
-                  v-model="queryParam.warnTip"
-                  ref="warnTip"
-                  id="inventoryWarningList-warnTip"
+                  v-model="queryParam.stockState"
+                  ref="stockState"
+                  id="inventoryWarningList-stockState"
                   code="STOCK_WARN_TIP"
                   placeholder="请选择预警提示"
                   allowClear
@@ -77,8 +95,9 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :dataSource="loadData"
-      :scroll="{ x: 2120, y: tableHeight }"
+      :scroll="{ x: 2220, y: tableHeight }"
       :pagination="paginationProps"
+      :loading="tableLoading"
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
@@ -91,8 +110,8 @@
         <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
       </template>
       <!-- 预警提示 -->
-      <template slot="warnTip" slot-scope="text, record">
-        <span v-if="record.warnTipDictValue" :class="[record.warnTip=='OVERFLOW'?'yellow':record.warnTip=='NOT_ENOUGH'?'red':record.warnTip=='LACK'?'blue':record.warnTip=='NORMAL'?'green':'']">{{ record.warnTipDictValue }}</span>
+      <template slot="stockState" slot-scope="text, record">
+        <span v-if="record.stockStateDictValue" :class="[record.stockState=='OVERFLOW'?'yellow':record.stockState=='NOT_ENOUGH'?'red':record.stockState=='LACK'?'blue':record.stockState=='NORMAL'?'green':'']">{{ record.stockStateDictValue }}</span>
         <span v-else>--</span>
       </template>
       <!-- 在途数 -->
@@ -142,11 +161,11 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
-import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
-import ProductBrand from '@/views/common/productBrand.js'
-import ProductType from '@/views/common/productType.js'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { stockWarnList, stockWarnSaveBatch } from '@/api/stock'
 export default {
-  components: { STable, VSelect, ProductBrand, ProductType },
+  components: { STable, VSelect },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -159,25 +178,28 @@ export default {
         productTypeSn1: undefined,
         productTypeSn2: undefined,
         productTypeSn3: undefined,
-        warnTip: undefined
+        stockState: undefined
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
+      tableLoading: false, //  表格加载中
+      productBrandList: [], //  产品品牌下拉数据
+      productTypeList: [], //  产品类别下拉数据
       productType: [],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'brandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
         { title: '实时库存数(个)', scopedSlots: { customRender: 'stockQty' }, width: 180, align: 'center' },
         { title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 130, align: 'center' },
-        { title: '总库存数(个)', dataIndex: 'totalStockQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总库存数(个)', dataIndex: 'totalQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
         { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
         { title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '预警提示', scopedSlots: { customRender: 'warnTip' }, width: 100, align: 'center' },
+        { title: '预警提示', scopedSlots: { customRender: 'stockState' }, width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       loadData: [],
@@ -220,6 +242,7 @@ export default {
       this.disabled = true
       this.pageNo = pageNo || this.pageNo
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      this.tableLoading = true
       stockWarnList(params).then(res => {
         if (res.status == 200) {
           const data = res.data
@@ -230,6 +253,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.loadData = data.list
+          this.tableLoading = false
           this.disabled = false
         } else {
           this.paginationProps.total = 0
@@ -306,7 +330,7 @@ export default {
       this.queryParam.productTypeSn1 = undefined
       this.queryParam.productTypeSn2 = undefined
       this.queryParam.productTypeSn3 = undefined
-      this.queryParam.warnTip = undefined
+      this.queryParam.stockState = undefined
       this.productType = []
       this.pageInit(1)
     },
@@ -332,6 +356,31 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
     //  导出
     handleExport () {
       const params = this.queryParam
@@ -358,6 +407,8 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.pageInit(1)
+      vm.getProductType()
+      vm.getProductBrand()
     })
   }
 }

+ 6 - 2
src/views/productManagement/productPricing/editModal.vue

@@ -18,8 +18,11 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="成本价" prop="supplierName">
-          50.00
+        <a-form-model-item label="成本价">
+          <div v-if="detailData && detailData.supplierProductList">
+            <p v-for="(item, index) in detailData.supplierProductList" :key="index" style="margin: 0;">{{ item.cost.toFixed(2) + ' 元 -- ' + item.supplierName + ';' }}</p>
+          </div>
+          <span v-else>--</span>
         </a-form-model-item>
         <a-form-model-item label="省级价" prop="afterProvincePrice">
           <a-input-number
@@ -185,6 +188,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.costPrice = ''
         this.$refs.ruleForm.resetFields()
       }
     },

+ 10 - 3
src/views/productManagement/productPricing/list.vue

@@ -72,7 +72,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 2010 }"
+      :scroll="{ x: 2110 }"
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
@@ -83,6 +83,13 @@
       <template slot="pricingState" slot-scope="text, record">
         <a-badge :color="record.pricingState=='WAIT_PRICING'?'gold':record.pricingState=='WAIT_PRICING_AUDIT'?'volcano':'#87d068'" :text="record.pricingStateDictValue" />
       </template>
+      <!-- 成本价 -->
+      <template slot="sterminaldsdPrice" slot-scope="text, record">
+        <div v-if="record.supplierProductList">
+          <p v-for="(item, index) in record.supplierProductList" :key="index" style="margin: 0;">{{ item.cost.toFixed(2) + '元 - ' + item.supplierName + ';' }}</p>
+        </div>
+        <span v-else>--</span>
+      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
@@ -129,14 +136,14 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
         { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
         { title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '定价状态', scopedSlots: { customRender: 'pricingState' }, width: 140, align: 'center' },
-        { title: '成本价', dataIndex: 'sterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: 200, align: 'center' },
         { title: '省级价', dataIndex: 'provincePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },