Kaynağa Gözat

添加连锁库存

chenrui 3 ay önce
ebeveyn
işleme
e1485fd0f1

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1739782256753
+  "version": 1742269032448
 }

+ 25 - 0
src/config/router.config.js

@@ -1948,6 +1948,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/inventoryManagement/chainInventory',
+            name: 'chainInventory',
+            redirect: '/inventoryManagement/chainInventory/list',
+            component: BlankLayout,
+            meta: {
+              title: '连锁库存',
+              icon: 'alert'
+              // permission: 'M_chainInventoryList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainInventoryList',
+                component: () => import(/* webpackChunkName: "inventoryManagement" */ '@/views/inventoryManagement/chainInventory/list.vue'),
+                meta: {
+                  title: '连锁库存列表',
+                  hidden: true,
+                  icon: 'alert'
+                  // permission: 'M_chainInventoryList'
+                }
+              }
+            ]
+          },
           {
             path: '/inventoryManagement/inventoryWarning',
             name: 'inventoryWarning',

+ 226 - 0
src/views/inventoryManagement/chainInventory/list.vue

@@ -0,0 +1,226 @@
+<template>
+  <a-card size="small" :bordered="false" class="jg-page-wrap chainInventoryList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model layout="inline" ref="ruleForm" :model="queryParam" :rules="rules" @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="门店名称">
+                <a-input id="chainInventoryList-storeName" v-model.trim="queryParam.storeName" allowClear placeholder="请输入门店名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码" prop="productCode">
+                <a-input id="chainInventoryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="原厂编码">
+                <a-input id="chainInventoryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="chainInventoryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="chainInventoryList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <ProductType id="chainInventoryList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainInventoryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainInventoryList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="chainInventoryList-advanced">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+68.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :pageSize="30"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import ProductType from '@/views/common/productType.js'// 产品分类
+import ProductBrand from '@/views/common/productBrand.js'// 产品品牌
+// 接口
+import { stockWarnList } from '@/api/stockWarn'
+export default {
+  name: 'ChainInventoryList',
+  components: { STable, VSelect, ProductType, ProductBrand },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      queryParam: { //  查询条件
+        storeName: undefined, // 门店名称
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: '', // 原厂编码
+        productBrandSn: undefined, // 产品品牌sn
+        productTypeSn1: undefined, // 产品分类1
+        productTypeSn2: undefined, // 产品分类2
+        productTypeSn3: undefined // 产品分类3
+      },
+      productType: [], // 产品分类默认值
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '门店名称', dataIndex: 'storeName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProduct.origCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '15%', align: 'center' },
+        { title: '可用库存数量(个)', dataIndex: 'stockNum', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return stockWarnList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+        })
+      },
+      rules: {
+        productCode: [{ required: true, message: '请输入产品编码', trigger: 'blur' }]
+      }
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          this.$message.error('请输入产品编码')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.storeName = undefined
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  产品分类  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] : ''
+    },
+    // 页面初始化
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    // 表格高度计算
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 180
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .chainInventoryList-wrap{
+    .green{
+      color: #19be6b;
+    }
+    .red{
+      color: #ed1c24;
+    }
+    .yellow{
+      color: #ff9900;
+    }
+    .blue{
+      color: #2db7f5;
+    }
+  }
+</style>