lilei 1 day ago
parent
commit
9bbff5d782

+ 31 - 41
src/views/salesManagement/priceInquiry/carInfoModal.vue

@@ -1,48 +1,37 @@
 <template>
-  <a-modal
-    centered
-    class="carInfoDetail-modal"
-    :footer="null"
-    :maskClosable="false"
-    v-model="isShow"
-    @cancel="isShow=false"
-    :width="800">
-    <div>
-      <div class="head-info-con">
-        <p class="head-info-title">车型信息</p>
-        <a-divider style="margin: 12px 0;" />
+  <div v-if="isShow">
+    <a-modal
+      centered
+      class="carInfoDetail-modal"
+      :footer="null"
+      :maskClosable="false"
+      v-model="isShow"
+      @cancel="isShow=false"
+      :width="800">
+      <div>
+        <div class="head-info-con">
+          <p class="head-info-title">车型信息</p>
+          <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.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.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>
-      <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="品牌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" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
-      </a-descriptions>
-      <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
-    </div>
-  </a-modal>
+    </a-modal>
+  </div>
 </template>
 
 <script>
-import defImg from '@/assets/def_img@2x.png'
+import defImg from '@/assets/def_img@2x.png' // 默认图片
 export default {
   name: 'CarInfoDetailModal',
   props: {
@@ -50,7 +39,7 @@ export default {
       type: Boolean,
       default: false
     },
-    infoData: {
+    infoData: { // 基本信息
       type: Object,
       default: () => {
         return {}
@@ -64,6 +53,7 @@ export default {
     }
   },
   methods: {
+    // 预览图片
     inited (viewer) {
       if (viewer) {
         const imageUrl = []

+ 109 - 110
src/views/salesManagement/priceInquiry/list.vue

@@ -1,116 +1,116 @@
 <template>
   <div>
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form-model
-        ref="ruleForm"
-        class="form-model-con"
-        layout="inline"
-        :rules="rules"
-        :model="queryParam"
-        @keyup.enter.native="$refs.table.refresh(true)" >
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="车架号(VIN)" prop="vinCode">
-              <a-input id="priceInquiryList-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-input>
-              <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品编码">
-              <a-input id="priceInquiryList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品名称">
-              <a-input id="priceInquiryList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="$refs.table.refresh(true)" >
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <ProductType v-model="productType" id="priceInquiryList-productType" @change="changeProductType" placeholder="请选择产品分类"></ProductType>
-              </a-form-item>
+              <a-form-model-item label="车架号(VIN)" prop="vinCode">
+                <a-input id="priceInquiryList-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-input>
+                <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品品牌">
-                <ProductBrand id="priceInquiryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+              <a-form-model-item label="产品编码">
+                <a-input id="priceInquiryList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品状态">
-                <v-select code="PRODUCT_ONOFFLINE_STATUS" id="priceInquiryList-state" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
+              <a-form-model-item label="产品名称">
+                <a-input id="priceInquiryList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-model-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="priceInquiryList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceInquiryList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 5px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-  </a-card>
-  
-  <a-card size="small" :bordered="false" class="priceInquiryList-wrap">
-    <div ref="vinInfo" v-if="vinInfoData">
-      <a-alert type="error" style="margin-bottom: 10px;" v-if="vinInfoData&&!vinInfoData.vinInfo">
-        <template slot="message"><a-icon type="exclamation-circle" theme="filled" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!</template>
-      </a-alert>
-      <a-alert type="warning" style="margin-bottom: 10px;cursor: pointer;" v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
-        <template slot="message">
-          <div style="display: flex;justify-content: space-between;align-items: center;" @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>
-            </div>
-            <div style="color: #f90;">
-              <span>查看更多</span> >
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <ProductType v-model="productType" id="priceInquiryList-productType" @change="changeProductType" placeholder="请选择产品分类"></ProductType>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="priceInquiryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品状态">
+                  <v-select code="PRODUCT_ONOFFLINE_STATUS" id="priceInquiryList-state" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="priceInquiryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceInquiryList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-card>
+
+    <a-card size="small" :bordered="false" class="priceInquiryList-wrap">
+      <div ref="vinInfo" v-if="vinInfoData">
+        <a-alert type="error" style="margin-bottom: 10px;" v-if="vinInfoData&&!vinInfoData.carInfo">
+          <template slot="message"><a-icon type="exclamation-circle" theme="filled" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!</template>
+        </a-alert>
+        <a-alert type="warning" style="margin-bottom: 10px;cursor: pointer;" v-if="vinInfoData&&vinInfoData.carInfo" @click="openCarInfoModal=true">
+          <template slot="message">
+            <div style="display: flex;justify-content: space-between;align-items: center;" @click="openCarInfoModal=true">
+              <div>
+                <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;">
+                <span>查看更多</span> >
+              </div>
             </div>
+          </template>
+        </a-alert>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+70+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :pageSize="30"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 产品图片 -->
+        <template slot="imageUrl" slot-scope="text, record">
+          <div v-if="record.productPicList && record.productPicList.length>0">
+            <img :src="record.productPicList[0].imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''" width="30" height="30" class="imageUrl" @click="inited(record.productPicList)" />
           </div>
+          <span v-else>--</span>
+        </template>
+        <!-- 产品分类 -->
+        <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>
-      </a-alert>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable fixPagination"
-      ref="table"
-      :style="{ height: tableHeight+70+'px' }"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :pageSize="30"
-      :scroll="{ y: tableHeight }"
-      :defaultLoadData="false"
-      bordered>
-      <!-- 产品图片 -->
-      <template slot="imageUrl" slot-scope="text, record">
-        <div v-if="record.productPicList && record.productPicList.length>0">
-          <img :src="record.productPicList[0].imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''" width="30" height="30" class="imageUrl" @click="inited(record.productPicList)" />
-        </div>
-        <span v-else>--</span>
-      </template>
-      <!-- 产品分类 -->
-      <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>
-      <!-- 产品编码 可点击查看详情 -->
-      <template slot="detail" slot-scope="text, record">
-        <span class="link-bule" @click="handleDetail(record)">{{ record.code }}</span>
-      </template>
-    </s-table>
-    <!-- 查看车辆信息 -->
-    <car-info-modal v-drag ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.vinInfo" @close="openCarInfoModal=false" />
-  </a-card>
+        <!-- 产品编码 可点击查看详情 -->
+        <template slot="detail" slot-scope="text, record">
+          <span class="link-bule" @click="handleDetail(record)">{{ record.code }}</span>
+        </template>
+      </s-table>
+      <!-- 查看车辆信息 -->
+      <car-info-modal v-drag ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.carInfo" @close="openCarInfoModal=false" />
+    </a-card>
   </div>
 </template>
 
@@ -125,7 +125,7 @@ import { supperCodeByVin, vinCodeParse } from '@/api/sales'
 export default {
   name: 'PriceInquiryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, ProductBrand, carInfoModal, ProductType},
+  components: { STable, VSelect, ProductBrand, carInfoModal, ProductType },
   data () {
     return {
       advanced: true, // 高级搜索 展开/关闭
@@ -188,9 +188,9 @@ export default {
     columns () {
       const arr = [
         { title: '产品编码', dataIndex: 'code', scopedSlots: { customRender: 'detail' }, width: '8%', align: 'center' },
-        { title: '产品名称', dataIndex: 'name', width: '36%', align: 'left', customRender: function (text) { return text || '--' }},
+        { title: '产品名称', dataIndex: 'name', width: '36%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'origCode', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '产品状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_priceInquiryList_provincePrice')) { //  售价权限
         arr.push({ title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
@@ -201,10 +201,10 @@ export default {
       if (this.$hasPermissions('M_priceInquiryList_specialPrice')) { //  售价权限
         arr.push({ title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
-       
-        arr.push({ title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.push({ title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.push({ title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' })
+
+      arr.push({ title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      arr.push({ title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      arr.push({ title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' })
       return arr
     }
   },
@@ -315,7 +315,7 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200
-      if(this.vinInfoData){
+      if (this.vinInfoData) {
         const vinInfoH = this.$refs.vinInfo.offsetHeight
         this.tableHeight = this.tableHeight - vinInfoH
       }
@@ -325,7 +325,7 @@ export default {
     advanced (newValue, oldValue) {
       this.pageInit()
     },
-    vinInfoData(){
+    vinInfoData () {
       this.pageInit()
     },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
@@ -355,4 +355,3 @@ export default {
   }
 }
 </script>
-