Parcourir la source

1、货架名称,由搜索查前20条更改为 查全部前端过滤
2、货架监控,去掉生成定时任务按钮
3、货架监控,货位产品状态数据字典无值问题

chenrui il y a 3 ans
Parent
commit
e12b648570

+ 68 - 0
src/views/common/shelfList.js

@@ -0,0 +1,68 @@
+import { shelfList } from '@/api/shelf'
+const shelfSList = {
+  template: `
+      <a-select
+        placeholder="请选择货架"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        @change="handleChange"
+        option-filter-prop="children"
+        :dropdownMatchSelectWidth="false"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in shelfList" :key="item.shelfSn" :value="item.shelfSn">{{ item.shelfName }}</a-select-option>
+      </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      defaultVal: this.value,
+      shelfList: []
+    }
+  },
+  mounted () {
+    this.getShelf()
+  },
+  watch: {
+    value (newValue, oldValue) {
+      this.defaultVal = newValue
+    }
+  },
+  methods: {
+    filterOption (input, option) {
+      console.log(input, option)
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange (value) {
+      console.log(value)
+      const row = this.shelfList.find(item => item.shelfSn == value)
+      this.defaultVal = value
+      this.$emit('change', value, row)
+      this.$emit('input', value, row)
+    },
+    //  货架列表
+    getShelf () {
+      shelfList({ pageNo: 1, pageSize: 1000 }).then(res => {
+        if (res.status == 200) {
+          this.shelfList = res.data && res.data.list ? res.data.list : []
+        } else {
+          this.shelfList = []
+        }
+      })
+    }
+  }
+}
+
+export default shelfSList

+ 0 - 88
src/views/common/shelfList.vue

@@ -1,88 +0,0 @@
-<template>
-  <!-- 货架 -->
-  <a-select
-    show-search
-    label-in-value
-    :value="shelfName"
-    placeholder="请输入名称搜索"
-    style="width: 100%"
-    :filter-option="false"
-    :dropdownMatchSelectWidth="false"
-    :not-found-content="fetching ? undefined : null"
-    @blur="blurSelect"
-    @search="fetchUser"
-    @change="handleChange"
-    allowClear>
-    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
-    <a-select-option v-for="item in data" :key="item.shelfSn" :value="item.shelfSn">{{ item.shelfName }}</a-select-option>
-  </a-select>
-</template>
-<script>
-import debounce from 'lodash/debounce'
-import { shelfList } from '@/api/shelf'
-export default {
-  props: {
-    itemSn: {
-      type: String || Number,
-      default: undefined
-    }
-  },
-  data () {
-    this.lastFetchId = 0
-    this.fetchUser = debounce(this.fetchUser, 800)
-    return {
-      data: [],
-      shelfName: undefined,
-      fetching: false
-    }
-  },
-  methods: {
-    fetchUser (shelfName) {
-      console.log('fetching user', shelfName)
-      if (shelfName == '') return
-      this.lastFetchId += 1
-      const fetchId = this.lastFetchId
-      this.data = []
-      this.fetching = true
-      shelfList({ shelfName: shelfName, pageNo: 1, pageSize: 20 }).then(res => {
-        if (fetchId !== this.lastFetchId) {
-          return
-        }
-        this.data = res.data && res.data.list ? res.data.list : []
-        this.fetching = false
-      })
-    },
-    handleChange (value) {
-      if (value && value.key) {
-        const ind = this.data.findIndex(item => item.shelfSn == value.key)
-        value.row = ind != -1 ? this.data[ind] : undefined
-      }
-      Object.assign(this, {
-        shelfName: value,
-        data: [],
-        fetching: false
-      })
-      this.$emit('change', value || { key: undefined, label: '' })
-    },
-    resetForm () {
-      this.shelfName = undefined
-    },
-    setData (value) {
-      Object.assign(this, {
-        shelfName: value,
-        data: [],
-        fetching: false
-      })
-    },
-    blurSelect () {
-      this.data = []
-    }
-  },
-  mounted () {
-    if (this.itemSn) {
-      this.fetchUser(this.itemSn)
-      this.setData({ key: this.itemSn })
-    }
-  }
-}
-</script>

+ 2 - 7
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -17,7 +17,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfList ref="shelfList" @change="shelfChange"></shelfList>
+                <shelfList v-model="queryParam.shelfSn"></shelfList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -106,7 +106,7 @@ import { STable } from '@/components'
 import recallModal from './recallModal.vue'
 import getDate from '@/libs/getDate.js'
 import { toThousands } from '@/libs/tools.js'
-import shelfList from '@/views/common/shelfList.vue'
+import shelfList from '@/views/common/shelfList'
 import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount } from '@/api/shelfRecall.js'
 export default {
   components: { STable, recallModal, rangeDate, shelfList },
@@ -182,10 +182,6 @@ export default {
     }
   },
   methods: {
-    // 选择货架
-    shelfChange (obj) {
-      this.queryParam.shelfSn = obj.key || undefined
-    },
     // 时间改变
     dateChange (date) {
       this.queryParam.beginDate = date[0]
@@ -269,7 +265,6 @@ export default {
         recallBillNo: '', // 调回单号
         shelfSn: undefined // 数字货架sn
       }
-      this.$refs.shelfList.resetForm()
     },
     // 退库
     handleRecall (row) {

+ 2 - 7
src/views/numsGoodsShelves/recallStockManagement/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfSList ref="shelfList" @change="shelfChange" :itemSn="queryParam.providerSn"></shelfSList>
+                <shelfSList v-model="queryParam.providerSn"></shelfSList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -81,7 +81,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import shelfSList from '@/views/common/shelfList.vue'
+import shelfSList from '@/views/common/shelfList'
 import { recallStockList, stockPutCount } from '@/api/shelfRecall.js'
 export default {
   components: { STable, VSelect, shelfSList },
@@ -147,15 +147,10 @@ export default {
     handleSet (row) {
       this.$router.push({ path: `/numsGoodsShelves/recallStockManagement/editStock/${row.stockPutSn}` })
     },
-    // 货架  change
-    shelfChange (obj) {
-      this.queryParam.providerSn = obj.key || undefined
-    },
     // 重置
     resetSearchForm () {
       this.queryParam.providerSn = undefined
       this.queryParam.putBizNo = ''
-      this.$refs.shelfList.resetForm()
       this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },

+ 3 - 8
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -15,7 +15,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfSList ref="shelfList" @change="shelfChange" :itemSn="queryParam.shelfSn"></shelfSList>
+                <shelfSList v-model="queryParam.shelfSn"></shelfSList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -30,7 +30,7 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="info" style="margin-left: 5px" @click="taskIn" :disabled="disabled" >定时任务</a-button>
+                <!-- <a-button type="info" style="margin-left: 5px" @click="taskIn" :disabled="disabled" >定时任务</a-button> -->
                 <a-button type="primary" style="margin-left: 5px" @click="queryByTypeSum" :disabled="disabled" id="replenishmentManagementList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="replenishmentManagementList-reset">重置</a-button>
                 <a @click="advanced = !advanced" style="margin-left: 5px">
@@ -108,7 +108,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
-import shelfSList from '@/views/common/shelfList.vue'
+import shelfSList from '@/views/common/shelfList'
 import confirmModal from './confirmModal.vue'
 import stockModal from './stockModal.vue'
 import printStickerModal from './printStickerModal.vue'
@@ -315,10 +315,6 @@ export default {
         }
       })
     },
-    // 货架  change
-    shelfChange (obj) {
-      this.queryParam.shelfSn = obj.key || undefined
-    },
     expandFun (expanded, record) {
       if (expanded) {
         this.expandedRowKeys.push(record.id)
@@ -359,7 +355,6 @@ export default {
       this.queryParam.bizType = this.curBizType
       this.queryParam.replenishBillNo = ''
       this.queryParam.shelfSn = undefined
-      this.$refs.shelfList.resetForm()
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
     },

+ 2 - 6
src/views/numsGoodsShelves/settlementManagement/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfList ref="shelfList" @change="shelfChange" :itemSn="queryParam.shelfSn"></shelfList>
+                <shelfList v-model="queryParam.shelfSn"></shelfList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -101,7 +101,7 @@ import { commonMixin } from '@/utils/mixin'
 import { toThousands } from '@/libs/tools.js'
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
-import shelfList from '@/views/common/shelfList.vue'
+import shelfList from '@/views/common/shelfList'
 import custList from '@/views/common/custList.vue'
 import { queryShelfSettleRulePage, queryShelfSettleRuleCount } from '@/api/merchant'
 export default {
@@ -173,10 +173,6 @@ export default {
     custChange (obj) {
       this.queryParam.customerSn = obj.key || undefined
     },
-    // 货架  change
-    shelfChange (obj) {
-      this.queryParam.shelfSn = obj.key || undefined
-    },
     // 禁止选择今天之后的日期
     disabledDate (current) {
       return current && current > moment().endOf('day')

+ 5 - 7
src/views/numsGoodsShelves/shelfMonitoring/list.vue

@@ -16,7 +16,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="货架名称" prop="shelfSn">
-                <shelfSList ref="shelfList" @change="shelfChange" :itemSn="queryParam.shelfSn"></shelfSList>
+                <shelfSList v-model="queryParam.shelfSn" @change="shelfChange"></shelfSList>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -154,7 +154,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
-import shelfSList from '@/views/common/shelfList.vue'
+import shelfSList from '@/views/common/shelfList'
 import { shelfControlList } from '@/api/shelf'
 export default {
   components: { STable, VSelect, addModal, shelfSList },
@@ -263,9 +263,8 @@ export default {
       this.rowSelectionInfo = obj || null
     },
     // 货架  change
-    shelfChange (obj) {
-      this.queryParam.shelfSn = obj.key || undefined
-      this.shelfName = obj && obj.row && obj.row.shelfName || ''
+    shelfChange (val, obj) {
+      this.shelfName = obj && obj.shelfName || ''
     },
     //  查询
     handleSearch () {
@@ -282,8 +281,7 @@ export default {
     //  重置
     resetSearchForm () {
       this.isSearch = false
-      // this.queryParam.shelfSn = undefined
-      // this.$refs.shelfList.resetForm()
+      this.queryParam.shelfSn = undefined
       this.queryParam.shelfPlaceCode = ''
       this.queryParam.productCode = ''
       this.queryParam.productName = ''

+ 2 - 7
src/views/numsGoodsShelves/shelfSet/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfSList ref="shelfList" @change="shelfChange" :itemSn="queryParam.shelfSn"></shelfSList>
+                <shelfSList v-model="queryParam.shelfSn"></shelfSList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -79,7 +79,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
-import shelfSList from '@/views/common/shelfList.vue'
+import shelfSList from '@/views/common/shelfList'
 import basicInfoModal from './basicInfoModal.vue'
 import { shelfList } from '@/api/shelf'
 export default {
@@ -145,14 +145,9 @@ export default {
     custChange (obj) {
       this.queryParam.customerSn = obj.key || undefined
     },
-    // 货架  change
-    shelfChange (obj) {
-      this.queryParam.shelfSn = obj.key || undefined
-    },
     // 重置
     resetSearchForm () {
       this.queryParam.shelfSn = undefined
-      this.$refs.shelfList.resetForm()
       this.queryParam.customerSn = undefined
       this.$refs.custList.resetForm()
       this.queryParam.finishFlag = undefined