twt 2 anni fa
parent
commit
5928185fec
3 ha cambiato i file con 71 aggiunte e 22 eliminazioni
  1. 23 10
      src/page/index.vue
  2. 40 9
      src/page/oem.vue
  3. 8 3
      src/utils/request.js

+ 23 - 10
src/page/index.vue

@@ -19,10 +19,10 @@
        <span v-if="carConfigName">  车辆配置:<span class="span1">{{carConfigName}}> </span></span>
         车型: <span class="span1" v-if="!description">{{brand_name?brand_name:'--'}}</span>
              <span class="span1" @click="carCK" v-if="description" style="cursor: pointer;">{{description}}</span>
-       <span class="s1"> {{navfName}}:<span class="span1">{{zzName}}></span></span>
-       <span class="s2" v-if="navchildrenNameTitle">{{navchildrenNameTitle}}:<span class="span1">{{navchildrenName?navchildrenName:'--'}}</span></span>
-       <span class="s3" v-if="restrainTitleTwo">{{restrainTitleTwo}}:<span class="span1">{{zkName2?zkName2:'--'}}></span></span>
-       <span class="cs" v-if="lastName">子组:{{lastName}}</span>
+       <span class="s1"> {{navfName}}:<span class="">{{zzName}}></span></span>
+       <span class="s2" v-if="navchildrenNameTitle">{{navchildrenNameTitle}}:<span class="">{{navchildrenName?navchildrenName:'--'}}</span></span>
+       <span class="s3" v-if="restrainTitleTwo">{{restrainTitleTwo}}:<span class="">{{zkName2?zkName2:'--'}}></span></span>
+       <span class="cs" v-if="lastName">子组:{{lastName | re}}</span>
        <span class="goback" @click="goback" v-if="!firstShow">返回</span>
      </div>
      <div class="main">
@@ -92,9 +92,9 @@
                  <img src="../assets/noImg.png" alt="" v-else class="mainRightLineNOImg">
                </div>
                <div class="mainRightLineMsBox">
-                 <div class="mainRightLineName">{{item.caption}}</div>
+                 <div class="mainRightLineName">{{item.caption | re}}</div>
                  <div class="mainRightLineZm">组号:{{item.group_no}}</div>
-                 <div class="mainRightLineRemarks">备注:{{item.remark}}</div>
+                 <div class="mainRightLineRemarks">备注:{{item.remark | re}}</div>
                </div>
 
              </div>
@@ -119,9 +119,9 @@
                  <img src="../assets/noImg.png" alt="" v-else class="mainRightLineNOImg">
                </div>
                <div class="mainRightLineMsBox">
-                 <div class="mainRightLineName" >{{item.caption}}</div>
+                 <div class="mainRightLineName" >{{item.caption | re}}</div>
                  <div class="mainRightLineZm">组号:{{item.group_no}}</div>
-                 <div class="mainRightLineRemarks">备注:{{item.remark}}</div>
+                 <div class="mainRightLineRemarks">备注:{{item.remark | re}}</div>
                </div>
              </div>
            </div>
@@ -143,9 +143,9 @@
                   <img src="../assets/noImg.png" alt="" v-else class="mainRightLineNOImg">
                </div>
                <div class="mainRightLineMsBox">
-                 <div class="mainRightLineName">{{item.caption}}</div>
+                 <div class="mainRightLineName">{{item.caption | re}}</div>
                  <div class="mainRightLineZm">组号:{{item.group_no}}</div>
-                 <div class="mainRightLineRemarks">备注:{{item.remark}}</div>
+                 <div class="mainRightLineRemarks">备注:{{item.remark | re}}</div>
                </div>
              </div>
            </div>
@@ -204,10 +204,16 @@
                 <el-table-column
                   prop="description"  align="center"
                   label="名称">
+                  <template slot-scope="scope">
+                        <span v-html="scope.row.description"></span>
+                  </template>
                 </el-table-column>
                 <el-table-column
                   prop="remark" align="center"
                   label="备注">
+                  <template slot-scope="scope">
+                        <span v-html="scope.row.remark"></span>
+                  </template>
                 </el-table-column>
                 <el-table-column
                   prop="qty" align="center"  width="60"
@@ -327,6 +333,13 @@ export default {
   created() {
     this.keyup()
   },
+  filters:{
+    re(val){
+       var reg_exp = new RegExp("<br/>", "g");
+       var res2 = val.replace(reg_exp, "");
+       return res2
+    }
+  },
   methods:{
     seeBigImg(url){
       this.viewerimg=url;

+ 40 - 9
src/page/oem.vue

@@ -79,7 +79,7 @@
          <div class="tableBoxOnediv" style="padding-left: 15px;">
             <el-table
                 class="el-table" :data="carList" size='mini'
-                :max-height="childrenHeight"
+                :max-height="childrenHeight-32"
                 stripe   border style="width: 100%">
                 <el-table-column prop="extened" label="名称">
                   <template slot-scope="scope">
@@ -94,6 +94,17 @@
                 <el-table-column prop="grade"  label="级别"></el-table-column>
                 <el-table-column prop="model_code"  label="模型代码"></el-table-column>
               </el-table>
+              <div style="padding-top: 10px;">
+                <el-pagination
+                  :current-page.sync="currentPage"
+                   :page-size="50"
+                  layout="total,prev, pager, next"
+                  :total="total_page"
+                  background="background"
+                  @current-change="handleCurrentChange"
+                />
+              </div>
+
          </div>
        </div>
      </div>
@@ -126,7 +137,7 @@
          <div class="tableBoxOnediv" style="padding-left: 15px;">
             <el-table
                 class="el-table" :data="carList" size='mini'
-                :max-height="childrenHeight"
+                :max-height="childrenHeight-35"
                 stripe   border style="width: 100%">
                 <el-table-column prop="extened" label="名称">
                   <template slot-scope="scope">
@@ -141,6 +152,15 @@
                 <el-table-column prop="grade"  label="级别"></el-table-column>
                 <el-table-column prop="model_code"  label="模型代码"></el-table-column>
               </el-table>
+              <el-pagination
+                  :current-page.sync="currentPage"
+                   :page-size="50"
+                  layout="total,prev, pager, next"
+                  :total="total_page"
+                  background="background"
+                  @current-change="handleCurrentChange"
+                />
+              </div>
          </div>
        </div>
        <div class="tableBoxRigtThree">
@@ -202,6 +222,9 @@ export default {
          param:'',
          threeTime:'',
          total_page:'',
+         currentPage:1,
+         total:'',
+         background:'#FF4F00'
     }
   },
   watch: {
@@ -221,6 +244,13 @@ export default {
 
   },
   methods: {
+    handleSizeChange(){
+
+    },
+    handleCurrentChange(){
+      console.log(this.currentPage)
+      this.getfindApplicableModelsPage()
+    },
     eliminate(){
       this.tableOneShow=false
       this.tableTwoShow=false
@@ -283,6 +313,7 @@ export default {
            this.access_time=res.data.result.access_time;
            this.carList=res.data.result.list
            this.total_page=res.data.result.total_page;
+           //sthis.total_page=100;
            if(this.total_page>1){
              // this.getfindApplicableModelsPage()
            }
@@ -299,24 +330,24 @@ export default {
        })
     },
     getfindApplicableModelsPage(){
-      for(var i=2;i<this.total_page+1;i++){
-        console.log(i);
+
         fetchGet('/advancedEpc/findApplicableModelsPc', {
           partnum:this.partnum,
            epc_id: this.id,
-           page:i,
+           page:this.currentPage,
          }).then(res => {
            if(res.data.number==200||res.data.number==5212){
              //this.access_time=res.data.result.access_time;
-             var carList=res.data.result.list;
-             this.carList=this.carList.concat(carList)
+           //  var carList=res.data.result.list;
+            // this.carList=this.carList.concat(carList)
+            this.carList=res.data.result.list;
            }else{
            }
 
          }).catch(err => {
 
          })
-      }
+
     },
     keyup(){    //45022-S10
       setTimeout(() => {
@@ -352,7 +383,7 @@ export default {
 
    },
     close() {
-      
+
       this.$emit('update:show', false)
 
     },

+ 8 - 3
src/utils/request.js

@@ -7,10 +7,15 @@ axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded
 //axios.defaults.headers.post['Content-Type'] = 'application/json'
 console.log(store.state.token)
 //var url='http://'+getHashQuery('url')+'/'
-var url='http://'+store.state.url+'/'
+
+if(store.state.url){
+  var url='http://'+store.state.url+'/'
+}else{
+  var url='http://api.dms.66km.com.cn/'
+}
 //axios.defaults.baseURL = process.env.VUE_APP_BASE_API // 配置接口地址
-axios.defaults.baseURL = 'http://api.dms.66km.com.cn/' // 配置接口地址
-//axios.defaults.baseURL = url // 配置接口地址
+//axios.defaults.baseURL = 'http://api.dms.66km.com.cn/' // 配置接口地址
+axios.defaults.baseURL = url // 配置接口地址
 // POST传参序列化(添加请求拦截器)
 //var epcToken=getHashQuery('token');
 //var uid=getHashQuery('uid');