ymy před 2 roky
rodič
revize
d135cc7006

+ 182 - 0
src/components/skuModal/productModal.vue

@@ -0,0 +1,182 @@
+<template>
+  <vxe-modal v-model="value" id="productDialogModal" :width="width?width+'px':'80%'" @show="show" :height="height?height+'px':'80%'" min-width="500" min-height="400" 
+  show-zoom resize transfer show-footer  @confirm="confirm">
+    <template #title>
+      <span>选择商品</span>
+    </template>
+    <template #default>
+      <module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList" @clickHandle="clickHandle" />
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class ProductModal extends Vue {
+  value=false
+  time:any;
+  timeNum = 0;
+  data:Array<any>=[]
+
+  @Prop()
+  width?:number
+
+  @Prop()
+  height?:number
+
+  @Prop()
+  mulit?:boolean
+
+
+  config:any={
+    search:{
+      attr:{
+        size:'mini'
+      },
+      columns:[
+        [{
+          span:6,
+          label:'物料ID',
+          prop:'materialId',
+          component:'by-input',
+          compConfig:{
+            attr:{
+              clearable:true,
+              placeholder:'请输入名称'
+            }
+          }
+        },{
+          span:6,
+          label:'标题',
+          prop:'skuTitle',
+          component:'by-input',
+          compConfig:{
+            attr:{
+              clearable:true,
+              placeholder:'请输入名称'
+            }
+          }
+        }]
+      ]
+    },
+    tool:{
+      tools:{
+        search:true,
+        refresh:true
+      }
+    },
+    table:{
+      attr:{
+        size:'mini',
+        seq:true,
+        align:'center',
+        // radio:true,
+        pageSize:10
+      },
+      columns:[{
+        title:'物料ID',
+        field:'materialId',
+        width:100
+      },{
+        title:'标题',
+        field:'skuTitle',
+        width:150
+      },{
+        title:'规格',
+        field:'materialSpec'
+      },{
+        title:'单价',
+        field:'price'
+      },{
+        title:'库存',
+        field:'stock'
+      }]
+    },
+    // request:{
+    //   url:'/system/maindataMaterial/page'
+    // }
+  }
+  brandData:Array<any>=[]
+  
+  getBrandData(){
+    return this.brandData;
+  }
+
+  clickHandle(n:string){
+    if(n == 'onRefresh'){
+      this.getList()
+    }
+  }
+
+  setShow(v:boolean){
+    this.value = v;
+  }
+
+  created(){
+    if(this.mulit){
+      this.config.table.attr.checkbox = true
+    }else{
+      this.config.table.attr.radio = true
+    }
+  }
+  mounted(){}
+
+  //确定
+  confirm(){
+    let data:Array<any>=this.getSelectdata();
+    this.$emit('confirm',data);
+    this.value = false;
+  }
+  //获取已选中表格数据
+  getSelectdata(){
+    let data:Array<any>=[];
+    if(this.$refs.view){
+      data = (this.$refs.view as any).getSelectData()
+    }
+    return data;
+  }
+  //显示弹窗
+  show(){
+    if(this.data.length ==0){
+      this.time =setInterval(()=>{
+        this.getList()
+      },500) 
+    }
+    if(this.$refs.view){
+      (this.$refs.view as any).clearCheckboxRow();
+    }
+  }
+  getList(){
+    if(!this.$refs.view){
+      if(this.timeNum > 5){
+        clearInterval(this.time)
+      }
+      this.timeNum ++;
+      return
+    }
+    clearInterval(this.time)
+    let query:any = (this.$refs.view as any).getQuery();
+    query.isLikeSearch = '1';
+    (this as any).$request({
+      url: '/maindata/maindataMaterialSku/page',
+      method: 'get',
+      params:query
+    }).then((res:any) => {
+      if(res.data.records){
+        (this.$refs.view as any).setTableValue(res.data.records);
+        this.data = res.data.records;
+        let page={
+          pageNo: res.data.current, //当前页
+          pageSize: res.data.size, //每页条数
+          total: res.data.total //总条数
+        };
+        (this.$refs.view as any).setPage(page)
+      }
+    })
+  }
+} 
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 1 - 1
src/views/audit/productManagement/components/importProduct.vue

@@ -24,7 +24,7 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { maindataMaterialRelevancy,materialrelevancy } from '@/api/omsOrder'
-import ProductModal from "./productModal.vue";
+import ProductModal from "@/components/skuModal/productModal.vue";
 @Component({components:{ProductModal}})
 export default class ImportProduct extends Vue {
   value = false;

+ 9 - 2
src/views/audit/productManagement/components/productModal.vue

@@ -25,6 +25,9 @@ export default class ProductModal extends Vue {
   @Prop()
   height?:number
 
+  @Prop()
+  mulit?:boolean
+
 
   config:any={
     search:{
@@ -68,7 +71,7 @@ export default class ProductModal extends Vue {
         size:'mini',
         seq:true,
         align:'center',
-        radio:true,
+        // radio:true,
         pageSize:10
       },
       columns:[{
@@ -111,7 +114,11 @@ export default class ProductModal extends Vue {
   }
 
   created(){
-
+    if(this.mulit){
+      this.config.table.attr.checkbox = true
+    }else{
+      this.config.table.attr.radio = true
+    }
   }
   mounted(){}
 

+ 5 - 8
src/views/oms/order/components/loadOrderModal.vue

@@ -28,7 +28,7 @@
         <div class="cont">
           <div class="title">线上订单:</div>
           <div class="right-cont">
-            <el-input v-model="sourceIds" type="textarea" rows="4" size="mini" placeholder="多个单号逗号隔开"></el-input>
+            <el-input v-model="sourceIds" type="textarea" rows="4" size="mini" placeholder="每行一个单号,换行输入"></el-input>
           </div>
         </div>
       </template>
@@ -168,6 +168,8 @@ export default class LoadOrderModal extends Vue {
     if(!this.shopId){
       msg = '店铺名称'
     }
+    value.shopId = this.shopId;
+    value.showName = this.shopName;
     value.type = this.type;
     if(this.type == 1){
       if(!this.sourceIds){
@@ -178,9 +180,8 @@ export default class LoadOrderModal extends Vue {
         }
       }
       
-      value.shopId = this.shopId;
-      value.showName = this.shopName;
-      value.sourceIds = this.sourceIds.split(',');
+      
+      value.sourceIds = this.sourceIds.split('\n');
     }else if(this.type == 2){
       if(this.dateType < 0 || this.dateType > 2){
         if(msg){
@@ -196,8 +197,6 @@ export default class LoadOrderModal extends Vue {
           msg = '时间'
         }
       }
-      value.shopId = this.shopId;
-      value.showName = this.shopName;
       value.dateType = this.dateType;
       value.beginDate = this.beginDate + ' 00:00:00';
       value.endDate = this.endDate + ' 00:00:00';
@@ -209,8 +208,6 @@ export default class LoadOrderModal extends Vue {
           msg = '订单状态'
         }
       }
-      value.shopId = this.shopId;
-      value.showName = this.shopName;
       value.status = this.status;
     }
     if(msg){