lilei 1 week ago
parent
commit
3911871456

BIN
public/templ/库存导入模板.xlsx


BIN
public/templ/散件入库产品导入模板.xlsx


+ 1 - 1
public/version.json

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

+ 4 - 0
src/views/common/warehouse.js

@@ -8,6 +8,7 @@ const Warehouse = {
           :value="defaultVal"
           expand-trigger="hover"
           :allowClear="allowClear"
+          :show-search="{filter}"
           :options="warehouseCascadeData"
           :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
           :id="id"
@@ -58,6 +59,9 @@ const Warehouse = {
     this.getWarehouseCascade()
   },
   methods: {
+    filter(inputValue, path) {
+      return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
+    },
     handleChange (value, selectedOptions) {
       this.defaultVal = value
       this.$emit('change', this.defaultVal, selectedOptions)

+ 31 - 11
src/views/productManagement/productInfo/list.vue

@@ -14,12 +14,12 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="原厂编码"><a-input id="productInfoList-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码" /></a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品品牌">
-                  <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品分类">
                   <ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
@@ -42,8 +42,13 @@
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="仓库仓位">
+                  <Warehouse id="productInfoList-warehouseCascade" :showDefault="false" :changeOnSelect="true" ref="warehouse" v-model="queryParam.warehouseCascade"></Warehouse>
+                </a-form-model-item>
+              </a-col>
             </template>
-            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
               <a-button type="primary" @click="searchForm()" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="productInfoList-reset">重置</a-button>
               <a-button
@@ -158,10 +163,11 @@ import { STable, VSelect } from '@/components'
 import productInfoDetailModal from './detailModal.vue'
 import importGuideModal from './importGuideModal.vue'
 import importPriceModal from './importPriceModal.vue'
+import Warehouse from '@/views/common/warehouse.js'
 import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductList',
-  components: { STable, VSelect, productInfoDetailModal, ProductType, ProductBrand, importGuideModal, importPriceModal },
+  components: { STable, VSelect, productInfoDetailModal, ProductType, ProductBrand, importGuideModal, importPriceModal, Warehouse },
   mixins: [commonMixin],
   data () {
     const _this = this
@@ -181,7 +187,10 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         enabledFlag: undefined, //  状态
-        stockEmptyFlag: undefined
+        stockEmptyFlag: undefined,
+        warehouseCascade: [], // 仓库仓位列表
+        warehouseSn: undefined, //  仓库
+        warehouseLocationSn: undefined // 仓位
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
@@ -263,6 +272,8 @@ export default {
             return text || '--'
           }
         },
+        { title: '默认仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '默认仓位', dataIndex: 'warehouseLocationName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         {
           title: '可用库存',
           dataIndex: 'currentStockQty',
@@ -279,7 +290,15 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        if (params.warehouseCascade && params.warehouseCascade.length > 0) {
+          // 仓库仓位
+          params.warehouseSn = params.warehouseCascade[0] || undefined
+          params.warehouseLocationSn = params.warehouseCascade[1] || undefined
+        }
+        const newParams = JSON.parse(JSON.stringify(params))
+        delete newParams.warehouseCascade
+        return dealerProductList(newParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -334,8 +353,9 @@ export default {
       this.queryParam.enabledFlag = undefined
       this.queryParam.stockEmptyFlag = undefined
       this.productType = []
-      // this.$refs.table.clearSelected()
-      // this.rowSelectionInfo = null
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.warehouseLocationSn = undefined
+      this.queryParam.warehouseCascade = []
       this.$refs.table.refresh(true)
     },
     //  新增/编辑

+ 50 - 16
src/views/productManagement/productInfoJg/list.vue

@@ -19,12 +19,12 @@
               <a-input id="productInfoList-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
             </a-form-item>
           </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品品牌">
+              <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+            </a-form-item>
+          </a-col>
           <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
-              </a-form-item>
-            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品状态">
                 <v-select code="ONLINE_FLAG" id="productInfoList-onlineFalg" v-model="queryParam.onlineFalg " allowClear placeholder="请选择产品状态"></v-select>
@@ -47,8 +47,13 @@
                 </a-select>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="仓库仓位">
+                <Warehouse id="productInfoList-warehouseCascade" :showDefault="false" :changeOnSelect="true" ref="warehouse" v-model="queryParam.warehouseCascade"></Warehouse>
+              </a-form-model-item>
+            </a-col>
           </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+          <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
             <a-button type="primary" @click="searchForm(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px" id="productInfoList-advanced">
@@ -67,6 +72,7 @@
             <a-menu slot="overlay" @click="handleMenuClick" id="productInfoList-menus">
               <a-menu-item key="1" id="productInfoList-menus0"> 批量启用</a-menu-item>
               <a-menu-item key="2" id="productInfoList-menus1"> 批量禁用</a-menu-item>
+              <a-menu-item key="3" id="productInfoList-menus1"> 批量修改仓库仓位</a-menu-item>
             </a-menu>
             <a-button id="productInfoList-menus-action" ghost type="danger"> 批量操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
@@ -189,6 +195,8 @@
     <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="resetSearchForm" />
     <!-- 自定义报价弹窗 -->
     <editPriceModal :openModal="openEditPriceModal" :itemId="itemId" @ok="searchForm(false)" @close="openEditPriceModal=false"></editPriceModal>
+    <!-- 修改仓库仓位 -->
+    <setWarehouseVue :openModal="openEditWarhouseModal" :itemId="productSnList" @ok="searchForm(false)" @close="openEditWarhouseModal=false"></setwarehousevue>
   </a-card>
 </template>
 
@@ -200,10 +208,12 @@ import ProductBrand from '../../common/productBrand.js'
 import { STable, VSelect } from '@/components'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import editPriceModal from './editPriceModal.vue'
+import setWarehouseVue from './setWarehouse.vue'
+import Warehouse from '@/views/common/warehouse.js'
 import importGuideModal from './importGuideModal.vue'
 export default {
   name: 'ProductJgList',
-  components: { STable, VSelect, ProductType, ProductBrand, editPriceModal, importGuideModal },
+  components: { STable, VSelect, ProductType, ProductBrand, editPriceModal, importGuideModal, Warehouse, setWarehouseVue },
   mixins: [commonMixin],
   data () {
     return {
@@ -222,7 +232,10 @@ export default {
         productTypeSn3: '', //  产品三级分类
         onlineFalg: '', // 是否上线
         enabledFlag: '1', // 启用禁用
-        stockEmptyFlag: undefined // 是否缺货
+        stockEmptyFlag: undefined, // 是否缺货
+        warehouseCascade: [], // 仓库仓位列表
+        warehouseSn: undefined, //  仓库
+        warehouseLocationSn: undefined // 仓位
       },
       openGuideModal: false, // 导入弹框
       // 显示列选项
@@ -234,6 +247,7 @@ export default {
       isZdPrice: true, // 终端指导价
       isCzPrice: true, // 车主指导价
       openEditPriceModal: false, // 自定义报价弹窗
+      openEditWarhouseModal: false, // 修改仓库弹窗
       iconShowFlag: false, // 列表配置图标显示
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
@@ -242,7 +256,15 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return productList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        if (params.warehouseCascade && params.warehouseCascade.length > 0) {
+          // 仓库仓位
+          params.warehouseSn = params.warehouseCascade[0] || undefined
+          params.warehouseLocationSn = params.warehouseCascade[1] || undefined
+        }
+        const newParams = JSON.parse(JSON.stringify(params))
+        delete newParams.warehouseCascade
+        return productList(newParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -258,6 +280,7 @@ export default {
       },
       openModal: false, //  查看客户详情  弹框
       itemId: '', //  当前产品id
+      productSnList: [],
       productTypeList: [], //  分类下拉数据
       rowSelectionInfo: null, // 已选产品
       currentDealerInfo: {} // 经销商信息
@@ -277,6 +300,8 @@ export default {
         // { title: '车主价', dataIndex: 'carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '自定义终端价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '自定义车主价', dataIndex: 'price2', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '默认仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '默认仓位', dataIndex: 'warehouseLocationName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '可用库存', dataIndex: 'currentStockQty', width: '7%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
         { title: '产品状态', dataIndex: 'onlineFalgDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '启用状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
@@ -340,6 +365,7 @@ export default {
     },
     // 查询
     searchForm (flag) {
+      this.rowSelectionInfo = null
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.refresh(flag)
     },
@@ -356,6 +382,9 @@ export default {
       this.queryParam.enabledFlag = '1'
       this.queryParam.stockEmptyFlag = undefined
       this.productType = []
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.warehouseLocationSn = undefined
+      this.queryParam.warehouseCascade = []
       this.$refs.table.refresh(true)
       this.rowSelectionInfo = null
       this.$refs.table.clearSelected()
@@ -409,13 +438,8 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    // 批量操作
+    // 批量启用禁用
     handleOutbounds (type) {
-      console.log(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length)
-      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length <= 0)) {
-        this.$message.warning('请在列表勾选后再进行批量操作!')
-        return
-      }
       this.$confirm({
         title: '提示',
         content: type == '2' ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '确定批量启用吗?',
@@ -427,7 +451,17 @@ export default {
     },
     // 更多操作
     handleMenuClick (e) {
-      this.handleOutbounds(e.key)
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length <= 0)) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      // 批量修改仓库仓位
+      if (e.key == 3) {
+        this.productSnList = this.rowSelectionInfo.selectedRowKeys
+        this.openEditWarhouseModal = true
+      } else {
+        this.handleOutbounds(e.key)
+      }
     },
     // 初始化页面
     pageInit () {

+ 134 - 0
src/views/productManagement/productInfoJg/setWarehouse.vue

@@ -0,0 +1,134 @@
+<template>
+  <a-modal
+    centered
+    class="editPrice-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="批量修改默认仓库仓位"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="800">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="text-align: center;padding:10px;">
+        共选择 {{ itemId.length }} 款产品,修改默认入库仓库和仓位
+      </div>
+      <a-form-model
+        id="editWarehouse-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="默认仓库仓位" prop="warehouseLocationSn">
+          <Warehouse id="editWarehouse-warehouseCascade" :showDefault="false" ref="warehouse" @change="warehouseChange" v-model="warehouseCascade"></Warehouse>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" size="large" id="editPrice-btn-submit" @click="handleSubmit">保存</a-button>
+        <a-button id="editPrice-btn-back" size="large" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { settingPrice } from '@/api/product.js'
+import Warehouse from '@/views/common/warehouse.js'
+export default {
+  name: 'EditWarehouseModal',
+  mixins: [commonMixin],
+  components: { Warehouse },
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      rules: {
+        warehouseLocationSn: [
+          { required: true, message: '请选择仓库仓位', trigger: ['change', 'blur'] }
+        ]
+      },
+      warehouseCascade: [], // 仓库仓位列表
+      form: {
+        warehouseSn: undefined, //  仓库
+        warehouseLocationSn: undefined // 仓位
+      }
+    }
+  },
+  methods: {
+    pageInit () {
+      this.warehouseCascade = []
+      this.form.warehouseSn = undefined
+      this.form.warehouseLocationSn = undefined
+      this.$refs.ruleForm.resetFields()
+    },
+    warehouseChange (v) {
+      this.form.warehouseSn = v[0]
+      this.form.warehouseLocationSn = v[1]
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          settingPrice({ productSn: _this.itemId, ..._this.form }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.pageInit()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.editPrice-modal {
+  .ant-modal-body {
+    padding: 40px 40px 24px;
+  }
+  .btn-cont {
+    text-align: center;
+    margin: 35px 0 10px;
+  }
+}
+</style>

+ 0 - 17
src/views/reportData/frozenProductReport/list.vue

@@ -57,20 +57,6 @@
                   <a-input id="frozenProductReportList-demanderName" v-model.trim="queryParam.demanderName" allowClear placeholder="请输入单位名称"/>
                 </a-form-model-item>
               </a-col>
-              <!-- <a-col :md="6" :sm="24">
-                <a-form-model-item label="仓库仓位">
-                  <a-cascader
-                    v-model="queryParam.warehouseCascade"
-                    expand-trigger="hover"
-                    :options="warehouseCascadeData"
-                    :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-                    id="frozenProductReportList-warehouseCascade"
-                    placeholder="请选择仓库仓位"
-                    @change="warehouseCascadeChange"
-                    allowClear
-                    style="width: 100%;" />
-                </a-form-model-item>
-              </a-col> -->
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="仓库仓位">
                   <Warehouse id="frozenProductReportList-warehouseCascade" :showDefault="false" :changeOnSelect="true" ref="warehouse" v-model="queryParam.warehouseCascade"></Warehouse>
@@ -130,7 +116,6 @@ import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import Warehouse from '@/views/common/warehouse.js'
 // 接口
-import { warehouseCascadeList } from '@/api/warehouse'
 import { freezeReportPageList, freezeReportExport, freezeReportCount } from '@/api/reportStock'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand, Warehouse },
@@ -189,8 +174,6 @@ export default {
         })
       },
       totalData: {}, // 合计
-      warehouseCascadeData: [] //  仓库仓位
-
     }
   },
   computed: {