Browse Source

修改bug

chenrui 2 năm trước cách đây
mục cha
commit
e5996ade46

+ 9 - 42
src/views/productManagement/newProduct/detail.vue

@@ -14,6 +14,10 @@
       <h4>{{ (detailsData && detailsData.name) || '--' }}</h4>
       <div class="productHead">
         <div class="productInfo">
+          <!--
+          ***省级经销商:市场价、特约价1显示 0不显示
+          ***市级经销商:特约价1显示 0不显示
+          -->
           <a-descriptions bordered :column="2" size="small">
             <a-descriptions-item label="产品品牌:">{{ (detailsData && detailsData.productBrandName) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="产品编码:">{{ (detailsData && detailsData.code) || '--' }}</a-descriptions-item>
@@ -21,47 +25,10 @@
             <a-descriptions-item label="商品尺寸:">{{ (detailsData && detailsData.size) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="重量:">{{ (detailsData && detailsData.weight) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="计量单位:">{{ (detailsData && detailsData.unit) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-          <a-descriptions bordered :column="2" layout="vertical" size="small" style="margin-top:10px;">
-            <a-descriptions-item label="省级经销商:" :span="2">
-              <a-row :gutter="16">
-                <a-col class="gutter-row" :span="6">
-                  市场价:{{ detailsData&&(detailsData.cityPrice || detailsData.cityPrice==0)?toThousands(detailsData.cityPrice):'--' }}
-                </a-col>
-                <a-col class="gutter-row" :span="6" v-if="specialPriceObj&&specialPriceObj.isShowSpecialPrice&&specialPriceObj.isShowSpecialPrice==1">
-                  特约价:{{ specialPriceObj.specialPrice==0?toThousands(specialPriceObj.specialPrice):'--' }}
-                </a-col>
-                <a-col class="gutter-row" :span="6">
-                  终端价:{{ detailsData&&(detailsData.terminalPrice || detailsData.terminalPrice==0)?toThousands(detailsData.terminalPrice):'--' }}
-                </a-col>
-                <a-col class="gutter-row" :span="6">
-                  车主价:{{ detailsData&&(detailsData.carOwnersPrice || detailsData.carOwnersPrice==0)?toThousands(detailsData.carOwnersPrice):'--' }}
-                </a-col>
-              </a-row>
-            </a-descriptions-item>
-            <a-descriptions-item label="市级经销商:" :span="2">
-              <a-row :gutter="16">
-                <a-col class="gutter-row" :span="6" v-if="specialPriceObj&&specialPriceObj.isShowSpecialPrice&&specialPriceObj.isShowSpecialPrice==1">
-                  特约价:{{ specialPriceObj.specialPrice==0?toThousands(specialPriceObj.specialPrice):'--' }}
-                </a-col>
-                <a-col class="gutter-row" :span="6">
-                  终端价:{{ detailsData&&(detailsData.terminalPrice || detailsData.terminalPrice==0)?toThousands(detailsData.terminalPrice):'--' }}
-                </a-col>
-                <a-col class="gutter-row" :span="6">
-                  车主价:{{ detailsData&&(detailsData.carOwnersPrice || detailsData.carOwnersPrice==0)?toThousands(detailsData.carOwnersPrice):'--' }}
-                </a-col>
-              </a-row>
-            </a-descriptions-item>
-            <a-descriptions-item label="特约经销商:" :span="2" v-if="specialPriceObj && specialPriceObj.dealerLevel == 'SPECIAL'">
-              <a-row :gutter="16">
-                <a-col class="gutter-row" :span="6">
-                  终端价:{{ detailsData&&(detailsData.terminalPrice || detailsData.terminalPrice==0)?toThousands(detailsData.terminalPrice):'--' }}
-                </a-col>
-                <a-col class="gutter-row" :span="6">
-                  车主价:{{ detailsData&&(detailsData.carOwnersPrice || detailsData.carOwnersPrice==0)?toThousands(detailsData.carOwnersPrice):'--' }}
-                </a-col>
-              </a-row>
-            </a-descriptions-item>
+            <a-descriptions-item label="市场价:" v-if="this.specialPriceObj.dealerLevel&&this.specialPriceObj.dealerLevel == 'PROVINCE'">{{ detailsData&&(detailsData.cityPrice||detailsData.cityPrice==0) ? toThousands(detailsData.cityPrice):'--' }}</a-descriptions-item>
+            <a-descriptions-item label="特约价:" v-if="(this.specialPriceObj.dealerLevel&&this.specialPriceObj.dealerLevel != 'SPECIAL')&&(specialPriceObj&&specialPriceObj.specialPrice==1) ">{{ detailsData && (detailsData.specialPrice||detailsData.specialPrice==0)?toThousands(detailsData.specialPrice) : '--' }}</a-descriptions-item>
+            <a-descriptions-item label="终端价:">{{ detailsData && (detailsData.terminalPrice || detailsData.terminalPrice==0)?toThousands(detailsData.terminalPrice):'--' }}</a-descriptions-item>
+            <a-descriptions-item label="车主价:">{{ detailsData && (detailsData.carOwnersPrice || detailsData.carOwnersPrice==0)?toThousands(detailsData.carOwnersPrice):'--' }}</a-descriptions-item>
           </a-descriptions>
           <div class="productDetail">
             <h4>产品介绍</h4>
@@ -117,7 +84,7 @@ export default {
         maskColor: 'red',
         maskOpacity: 0.2
       },
-      specialPriceObj: null
+      specialPriceObj: {}
     }
   },
   methods: {

+ 16 - 2
src/views/productManagement/productInfoJg/editPriceModal.vue

@@ -25,13 +25,27 @@
           <div>{{ form.terminalPrice?form.terminalPrice : '--' }}</div>
         </a-form-model-item>
         <a-form-model-item label="自定义终端价" prop="dealerProductPrice.terminalPrice">
-          <a-input id="editPrice-terminalPriceZdy" :maxLength="18" v-model.trim="form.dealerProductPrice.terminalPrice" placeholder="请输入自定义终端价" allowClear />
+          <a-input-number
+            :min="0"
+            :max="999999"
+            :precision="2"
+            v-model.trim="form.dealerProductPrice.terminalPrice"
+            style="width: 90%;margin-right: 5px;"
+            placeholder="请输入自定义终端价"
+            allowClear /><span>元</span>
         </a-form-model-item>
         <a-form-model-item label="车主价" prop="carOwnersPrice">
           <div>{{ form.carOwnersPrice?form.carOwnersPrice:'--' }}</div>
         </a-form-model-item>
         <a-form-model-item label="自定义车主价" prop="dealerProductPrice.carOwnersPrice">
-          <a-input id="editPrice-carOwnersPriceZdy" v-model.trim="form.dealerProductPrice.carOwnersPrice" placeholder="请输入自定义车主价" allowClear />
+          <a-input-number
+            :min="0"
+            :max="999999"
+            :precision="2"
+            v-model.trim="form.dealerProductPrice.carOwnersPrice"
+            placeholder="请输入自定义车主价"
+            style="width: 90%;margin-right: 5px;"
+            allowClear /><span>元</span>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">

+ 14 - 9
src/views/productManagement/productInfoJg/list.vue

@@ -307,13 +307,6 @@ export default {
           if (res.data.isShowSpecialPrice && res.data.isShowSpecialPrice == '1') { //  是否展示特约价
             this.columns.push({ title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
           }
-          if (_this.isTerminalPrice) {
-            cArr.splice(1, 0, { title: '自定义终端价', dataIndex: 'dealerProductPrice.terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-          }
-          if (_this.isCarOwnersPrice) {
-            const pos = _this.terminalPrice ? 3 : 2
-            cArr.splice(pos, 0, { title: '自定义车主价', dataIndex: 'dealerProductPrice.carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-          }
           this.columns = [...this.columns, ...cArr]
         }
       })
@@ -321,11 +314,23 @@ export default {
     // 显示自定义终端价
     changeTerminalPrice (e) {
       this.terminalPrice = e.target.checked
-      this.getColumns()
+      const _this=this;
+      const pos= _this.columns.findIndex(item=>{return item.title == '终端价'})
+      if(e.target.checked){
+        _this.columns.splice(pos+1, 0, { title: '自定义终端价', dataIndex: 'dealerProductPrice.terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }else{
+        _this.columns.splice(pos+1,1)
+      }
     },
     changeCarOwnersPrice (e) {
       this.isCarOwnersPrice = e.target.checked
-      this.getColumns()
+      const _this=this;
+      const pos = _this.columns.findIndex(item=>{return item.title == '车主价'})
+     if(e.target.checked){
+       _this.columns.splice(pos+1, 0, { title: '自定义车主价', dataIndex: 'dealerProductPrice.carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+     }else{
+        _this.columns.splice(pos+1,1)
+     }
     },
     filterOption (input, option) {
       return (