Browse Source

Merge commit '1391ed40ad13c56706f68c3b1251f73eb6467b3a' into HEAD

gitadmin 3 months ago
parent
commit
3a16e1ce33

+ 1 - 1
public/version.json

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

+ 12 - 0
src/api/stock.js

@@ -77,3 +77,15 @@ export const stockByProductSn = (params) => {
     method: 'post'
   })
 }
+
+//连锁库存  列表   有分页
+export const stockQueryLinkPage = (params) => {
+  const url = `/stock/queryLinkPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 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_chainInventory'
+            },
+            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',

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

@@ -0,0 +1,268 @@
+<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-select
+                  placeholder="请选择门店名称"
+                  id="chainInventoryList-storeName"
+                  allowClear
+                  v-model.trim="queryParam.tenantId"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in linkageGroupData" :id="item.dealerSn" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+                </a-select>
+              </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 { stockQueryLinkPage } from '@/api/stock'
+import { linkageGroupList } from '@/api/reportData'
+export default {
+  name: 'ChainInventoryList',
+  components: { STable, VSelect, ProductType, ProductBrand },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      queryParam: { //  查询条件
+        tenantIdList: [],
+        tenantId: undefined, // 门店名称
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: '', // 原厂编码
+        productBrandSn: undefined, // 产品品牌sn
+        productTypeSn1: undefined, // 产品分类1
+        productTypeSn2: undefined, // 产品分类2
+        productTypeSn3: undefined // 产品分类3
+      },
+      productType: [], // 产品分类默认值
+      linkageGroupData: [], // 门店列表
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '门店名称', dataIndex: 'dealerName', align: 'center', width: '18%', 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: '23%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '15%', align: 'center' },
+        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        if (this.queryParam.tenantId && this.queryParam.tenantId.length > 0) {
+          this.queryParam.tenantIdList[0] = this.queryParam.tenantId
+        } else {
+          this.queryParam.tenantIdList = []
+        }
+        this.disabled = true
+        this.spinning = true
+        const parames = Object.assign(parameter, this.queryParam)
+        delete parames.tenantId
+        return stockQueryLinkPage(parames).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.tenantIdList = []
+      this.queryParam.tenantId = 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()
+    },
+    // 门店店筛选
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 门店列表
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          const data = res.data || []
+          if (data.length > 0) {
+            this.linkageGroupData = data
+          } else {
+            this.linkageGroupData = []
+          }
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    },
+    //  产品分类  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()
+      })
+      _this.getLinkageGroup()
+    },
+    // 表格高度计算
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 190
+    }
+  },
+  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>

+ 6 - 19
src/views/salesManagement/salesQueryNew/carInfoModal.vue

@@ -14,28 +14,15 @@
           <a-divider style="margin: 12px 0;" />
         </div>
         <a-descriptions bordered :column="2" size="small" class="head-info-main">
-          <a-descriptions-item label="车型信息:">{{ infoData&&infoData.text || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="品牌:">{{ infoData&&infoData.brand_name || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="车型:">{{ infoData&&infoData.model_name || '--' }}</a-descriptions-item>
+          <!-- <a-descriptions-item label="车型信息:">{{ infoData&&infoData.text || '--' }}</a-descriptions-item> -->
+          <a-descriptions-item label="品牌:">{{ infoData&&infoData.brandName || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="车型:">{{ infoData&&infoData.modelName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="品牌LOGO:">
             <img :src="infoData&&infoData.icon?infoData.icon:defImg" width="30" height="30" style="border-radius: 50%;" />
           </a-descriptions-item>
-          <a-descriptions-item label="排量:">{{ infoData&&infoData.sub_name || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="年款:">{{ infoData&&infoData.year || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="车型图:">
-            <div v-if="infoData&&infoData.images.length>0">
-              <img :src="infoData.images[0] || defImg" width="30" height="30" class="imageUrl" @click="inited(infoData.images)" />
-            </div>
-            <span v-else>--</span>
-          </a-descriptions-item>
-          <a-descriptions-item label="车系:">{{ infoData&&infoData.series_name || '--' }}</a-descriptions-item>
-        </a-descriptions>
-        <div class="head-info-con" v-if="infoData&&infoData.params">
-          <p class="head-info-title">配置信息</p>
-          <a-divider style="margin: 12px 0;" />
-        </div>
-        <a-descriptions bordered :column="2" size="small" v-if="infoData&&infoData.params" class="head-info-main">
-          <a-descriptions-item v-for="item in infoData.params" :key="item.type_name" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="排量:">{{ infoData&&infoData.displacement || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="年款:">{{ infoData&&infoData.modelYear || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="配置信息:">{{ infoData&&infoData.confLevel || '--' }}</a-descriptions-item>
         </a-descriptions>
         <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
       </div>

+ 75 - 18
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -61,12 +61,11 @@
                 </a-select>
               </a-form-model-item>
             </a-col>
-            <a-col flex="2" v-if="$hasPermissions('B_salerVinFindProduct')">
-              <a-form-model-item label="车架号(VIN)" prop="vinCode">
+            <a-col flex="2" v-if="$hasPermissions('B_salerVinFindProduct')&&sourceType !== 'TRANSFER_ORDER'">
+              <a-form-model-item label="车架号(VIN)" prop="vinCode" class="vininputs">
                 <a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
-                  <a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
+                  <a-icon slot="addonAfter" @click="showUploadImg=true" :type="vinLoading?'loading':'camera'" :style="{ fontSize: '18px', verticalAlign: 'bottom',cursor:'pointer',padding:'0 10px' }" title="点击拖动图片识别VIN" />
                 </a-input>
-                <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
               </a-form-model-item>
             </a-col>
             <a-col flex="200px">
@@ -90,17 +89,17 @@
         <!-- 查看更多 -->
         <div v-if="hasVaild&&showTable" class="vinInfo-box">
           <div>
-            <div class="vinInfo-error" v-if="vinInfoData&&!vinInfoData.vinInfo">
+            <div class="vinInfo-error" v-if="vinInfoData&&!vinInfoData.carInfo">
               <a-icon type="exclamation-circle" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!
             </div>
-            <div v-if="vinInfoData&&vinInfoData.vinInfo" id="productInfoList-carinfo" @click="openCarInfoModal=true">
+            <div v-if="vinInfoData&&vinInfoData.carInfo" id="productInfoList-carinfo" @click="openCarInfoModal=true">
               <div style="display: flex;justify-content: space-between;align-items: center;" id="productInfoList-carinfoMoadl" @click="openCarInfoModal=true">
                 <div>
-                  <img :src="vinInfoData.vinInfo && vinInfoData.vinInfo.icon?(vinInfoData.vinInfo.icon+'?x-oss-process=image/resize,h_30,m_lfit'):defImg" width="30" height="30" class="imageUrl" style="border-radius: 50%;vertical-align: middle;margin-right: 3px;" />
-                  <span style="vertical-align: middle;">{{ vinInfoData.vinInfo.text }}</span>
+                  <img :src="vinInfoData.carInfo && vinInfoData.carInfo.icon?(vinInfoData.carInfo.icon+'?x-oss-process=image/resize,h_30,m_lfit'):defImg" width="30" height="30" class="imageUrl" style="border-radius: 50%;vertical-align: middle;margin-right: 3px;" />
+                  <span style="vertical-align: middle;">{{ vinInfoData.carInfo.brandName }} {{ vinInfoData.carInfo.modelName }} {{ vinInfoData.carInfo.displacement }} {{ vinInfoData.carInfo.modelYear+'年' }}</span>
                 </div>
-                <div style="color: #f90;cursor: pointer;">
-                  <span>查看更多</span> >
+                <div style="color: #f90;cursor: pointer;margin-left: 5px;">
+                  <span>查看详情</span> >
                 </div>
               </div>
             </div>
@@ -210,7 +209,29 @@
       </div>
 
       <!-- 查看车辆信息 -->
-      <car-info-modal ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.vinInfo" @close="openCarInfoModal=false" />
+      <car-info-modal ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.carInfo" @close="openCarInfoModal=false" />
+      <!-- 上传图片弹窗 -->
+      <a-modal
+        v-model="showUploadImg"
+        class="uploadimg-modal"
+        title="上传图片识别VIN"
+        :footer="null"
+        centered
+        @ok="showUploadImg=false">
+        <a-upload-dragger :before-upload="beforeUpload" accept="image/*" :showUploadList="false">
+          <div class="ant-upload-box">
+            <p class="ant-upload-drag-icon">
+              <a-icon type="inbox" />
+            </p>
+            <p class="ant-upload-text">
+              单击或拖动文件到此区域进行上传
+            </p>
+            <p class="ant-upload-hint">
+              最多一张图片,支持JPG、PNG、BMP格式,最大50M。
+            </p>
+          </div>
+        </a-upload-dragger>
+      </a-modal>
     </a-spin>
   </a-drawer>
 </template>
@@ -282,6 +303,7 @@ export default {
       vinLoading: false, // vin识别loading
       productType: [], // 产品类型
       defImg, // 默认图片
+      showUploadImg: false, // 上传图片弹框
       queryParam: { //  查询条件
         customerSn: '', // 客户sn
         salesBillSn: '', // 销售单sn
@@ -549,16 +571,22 @@ export default {
     handleDetail (row) {
       this.$emit('viewRecord', row)
     },
-    uploadFun () {
-      document.getElementById('filed').click()
-    },
-    filePreview (e) {
+    beforeUpload (file) {
       const _this = this
-      var files = e.target.files[0]
+      console.log(file)
+      if (file.size > 10240 * 1024 * 5) {
+        _this.$notification.error({
+          message: '提示',
+          description: '文件大小不能超过50M'
+        })
+        return false
+      }
       const formData = new FormData()
       formData.append('savePathType', 'local')
-      formData.append('file', files)
+      formData.append('file', file)
+      // 解析图片
       this.vinLoading = true
+      this.disabled = true
       vinCodeParse(formData).then(res => {
         if (res.type == 'application/json') {
           var reader = new FileReader()
@@ -568,6 +596,7 @@ export default {
               _this.queryParam.vinCode = obj.data || ''
               // 移除表单项的校验结果
               _this.$refs.ruleForm.clearValidate('vinCode')
+              _this.showUploadImg = false
             } else {
               _this.$notification.error({
                 message: '提示',
@@ -575,13 +604,15 @@ export default {
               })
             }
             _this.vinLoading = false
-            document.getElementById('filed').value = ''
+            _this.disabled = false
           })
           reader.readAsText(res)
         } else {
           _this.vinLoading = false
+          _this.disabled = false
         }
       })
+      return false
     },
     // 仓库
     getWarehouse () {
@@ -618,6 +649,25 @@ export default {
 </script>
 
 <style lang="less">
+.uploadimg-modal{
+  .ant-upload-box{
+    text-align: center;
+    width:100%;
+    .ant-upload-text {
+        margin: 0 0 4px;
+        color: rgba(0, 0, 0, .85);
+        font-size: 16px;
+    }
+    .ant-upload-hint {
+        color: rgba(0, 0, 0, .45);
+        font-size: 14px;
+    }
+    .ant-upload-drag-icon .anticon {
+        color: #40a9ff;
+        font-size: 48px;
+    }
+  }
+}
 .chooseProduct-drawer {
   .ant-drawer-header{
     padding: 13px 20px;
@@ -647,5 +697,12 @@ export default {
       }
     }
   }
+  .vininputs{
+    .ant-input-group-addon{
+      padding: 0;
+      border:0;
+      border-left: 1px solid #e7e7e7;
+    }
+  }
 }
 </style>

+ 2 - 2
vue.config.js

@@ -209,8 +209,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.113:8550/qpls-md',
-        target: 'https://p.iscm.360arrow.com/qpls-md',
+        target: 'http://192.168.2.113:8550/qpls-md',
+        // target: 'https://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
         changeOrigin: true,