Browse Source

物料完成

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

+ 24 - 0
src/api/omsOrder.ts

@@ -63,4 +63,28 @@ export function pullOrder(data:any){
 		method: 'POST',
 		data: data
 	})
+}
+
+export function pullItem(data:any){
+	return request({
+		url: '/omsOrder/shopItem/pullItem',
+		method: 'POST',
+		data: data
+	})
+}
+
+export function maindataMaterialRelevancy(params:any){
+	return request({
+		url:'/maindata/maindataMaterialRelevancy/page',
+		method:'Get',
+		params:params
+	})
+}
+
+export function materialrelevancy(data:any){
+	return request({
+		url:'/maindata/maindataMaterialRelevancy/materialrelevancy',
+		method:'POST',
+		data:data
+	})
 }

+ 1 - 1
src/benyun/components/byForm/byForm.vue

@@ -227,7 +227,7 @@ export default class ByForm extends VueViews {
         });
     })
   }
-  //清过滤提示
+  //清过滤提示
   clearValidate(){
     (this.$refs.byForm as any).clearValidate();
   }

+ 7 - 0
src/benyun/components/moduleView/moduleView.vue

@@ -95,6 +95,13 @@ export default class ModuleView extends ModuleViewHandle {
       (this.$refs[this.tableID] as any).setValue(data)
     }
   }
+  getPage(){
+    let p = {};
+    if(this.$refs[this.tableID]){
+      p=(this.$refs[this.tableID] as any).getPage()
+    }
+    return p;
+  }
   setPage(page:Page){
     if(this.$refs[this.tableID]){
       (this.$refs[this.tableID] as any).setPage(page)

+ 12 - 2
src/components/productDialog/productDialog.vue

@@ -25,6 +25,11 @@ export default class ProductDialog extends Vue {
   @Prop()
   height?:number
 
+  @Prop({
+    default:true
+  })
+  mulit?:boolean
+
   config:any={
     search:{
       attr:{
@@ -145,7 +150,7 @@ export default class ProductDialog extends Vue {
         size:'mini',
         seq:true,
         align:'center',
-        checkbox:true
+        // checkbox:true
       },
       columns:[{
         title:'编码',
@@ -190,7 +195,7 @@ export default class ProductDialog extends Vue {
     // }
   }
   brandData:Array<any>=[]
-
+  
   getBrandData(){
     return this.brandData;
   }
@@ -206,6 +211,11 @@ export default class ProductDialog extends Vue {
   }
 
   created(){
+    if(this.mulit){
+      this.config.table.attr.checkbox = true
+    }else{
+      this.config.table.attr.radio = true
+    }
     // this.getBrand()
   }
   mounted(){}

+ 98 - 18
src/views/audit/productManagement/components/importProduct.vue

@@ -1,20 +1,21 @@
 <template>
-  <vxe-modal v-model="value" id="importProduct" width="70%" height="80%" show-zoom resize transfer v-loading="load">
+  <vxe-modal v-model="value" id="importProduct" width="70%" height="80%" @show="show" show-zoom resize transfer v-loading="load">
     <template #title>
       <span>商品关联</span>
     </template>
     <template #default>
       <div class="i-box">
-        <div class="table">
+        <div class="table" id="t1">
           <by-table :propConfig="config" ref="table"></by-table>
         </div>
-        <div class="icon">
+        <!-- <div class="icon">
           <i class="el-icon-right" style="font-size: 30px;"></i>
         </div>
-        <div class="table">
-          <by-table :propConfig="config2" ref="table"></by-table>
-        </div>
+        <div class="table t2">
+          <by-table :propConfig="config2" ref="table2"></by-table>
+        </div> -->
       </div>
+      <product-modal ref="product" @confirm="confirmProduct" />
     </template>
   </vxe-modal>
 
@@ -22,44 +23,57 @@
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-@Component
+import { maindataMaterialRelevancy,materialrelevancy } from '@/api/omsOrder'
+import ProductModal from "./productModal.vue";
+@Component({components:{ProductModal}})
 export default class ImportProduct extends Vue {
   value = false;
   load = false;
-  config={
+  syncProduct:Array<any>=[];
+  currentRow:any=null;
+  config:any={
     attr:{
       size:'mini',
       align:'center'
     },
     columns:[{
-      title:'名称',
-      field:'name'
+      title:'商品编码',
+      field:'goodsSkuId'
+    },{
+      title:'商品名称',
+      field:'goodsName'
     },{
       title:'操作',
       action:true,
       width:170,
       plugins:[{
-        icon:'el-icon-setting',
-        name:'同步商品',
+        name:'商品关联',
         audit:'',
         event:{
+          show:(row:any) => {
+            return row.isSync != 1
+          },
           click:(item:any) => {
-            console.log('该行数据:',item)
+            (this.$refs.product as any).setShow(true);
+            this.setCurrentRow(item);
           }
         }
       },{
-        icon:'el-icon-setting',
         name:'直接注册',
         audit:'',
         event:{
+          show:(row:any) => {
+            return row.isSync != 1
+          },
           click:(item:any) => {
+            this.$message('尚未开发!');
             console.log('该行数据:',item)
           }
         }
       }]
     }]
   }
-  config2={
+  config2:any={
     attr:{
       size:'mini',
       align:'center'
@@ -69,11 +83,69 @@ export default class ImportProduct extends Vue {
       field:'name'
     }]
   }
-  show(){}
+
+  mounted(){
+
+  }
+  setCurrentRow(row:any){
+    this.currentRow = row;
+  }
+
+  show(){
+    const h = document.getElementById('t1')?.offsetHeight;
+    if(h){
+      this.config.attr.height = h - 48;
+      this.config2.attr.height = h - 48;
+    }
+    this.getSyncData()
+  }
 
   setShow(v:boolean){
     this.value = v;
   }
+
+  getSyncData(){
+    let page = (this.$refs.table as any).getPage();
+    let data:any={
+      pageNo:page.pageNo,
+      pageSize:page.pageSize
+    }
+    this.load = true;
+    maindataMaterialRelevancy(data).then((res:any) => {
+      this.load = false;
+      if(this.$refs.table){
+        (this.$refs.table as any).setValue(res.data.records);
+        page.pageNo = res.data.current;
+        page.total = res.data.total;
+        (this.$refs.table as any).setPage(page);
+      }
+    }).catch((err:any) => {
+      this.load = false;
+    })
+  }
+
+  confirmProduct(data:Array<any>){
+    if(data.length == 0){
+      this.$message('请选择商品!');
+      return;
+    }
+    let value:any={
+      lid:this.currentRow.id,
+      mskuid:data[0].id
+    }
+    this.load = true;
+    materialrelevancy(value).then((res:any) => {
+      this.load = false;
+      this.$message({
+        message:'商品关联成功!',
+        type:'success'
+      })
+      this.getSyncData();
+    }).catch((err:any) => {
+      this.load = false;
+      this.$message.error('商品关联失败!')
+    })
+  }
 }
 </script>
 
@@ -84,12 +156,20 @@ export default class ImportProduct extends Vue {
   justify-content: space-between;
   height: 100%;
   .table{
-    width: 46%;
+    width: 100%;
     height: 100%;
     overflow: auto;
-    box-shadow: 0 0 10px rgba(0,0,0,.1);
+    box-shadow: 0 0 10px rgba(86,86,86,.1);
     // background-color: aliceblue;
   }
+  .t1{
+    width: 52%;
+    // box-shadow: 5px -5px 5px rgba(127,127,127,.1);
+  }
+  .t2{
+    width: 40%;
+    // box-shadow: -5px -5px 5px rgba(127,127,127,.1);
+  }
   .icon{
     width: 8%;
     height: 100%;

+ 175 - 0
src/views/audit/productManagement/components/productModal.vue

@@ -0,0 +1,175 @@
+<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
+
+
+  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(){
+
+  }
+  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>

+ 223 - 0
src/views/audit/productManagement/components/synchronousOrderModal.vue

@@ -0,0 +1,223 @@
+<template>
+  <vxe-modal v-model="value" id="synchronousOrderModal"  width="500" height="400"  transfer show-footer v-loading="load">
+    <template #title>
+      <span>商品同步</span>
+    </template>
+    <template #default>
+      <div class="type">
+        <el-radio-group v-model="type">
+          <el-radio :label="1">按sku拉取</el-radio>
+          <el-radio :label="2">按款拉取</el-radio>
+          <el-radio :label="3">按时间段拉取</el-radio>
+        </el-radio-group>
+      </div>
+      <div class="cont">
+        <div class="title">店铺名称:</div>
+        <div class="right-cont">
+          <el-select v-model="shopId" size="mini" style="width:100%" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in shopOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </div>
+      </div>
+      <template v-if="type == 1">
+        <div class="cont">
+          <div class="title">sku:</div>
+          <div class="right-cont">
+            <el-input v-model="skus" type="textarea" rows="4" size="mini" placeholder="每行一个单号,换行输入"></el-input>
+          </div>
+        </div>
+      </template>
+      <template v-if="type == 2">
+        <div class="cont">
+          <div class="title">款式编码:</div>
+          <div class="right-cont">
+            <el-input v-model="styles" type="textarea" rows="4" size="mini" placeholder="每行一个单号,换行输入"></el-input>
+          </div>
+        </div>
+      </template>
+      <template v-if="type == 3">
+        <div class="cont">
+          <div class="title">时间类型:</div>
+          <div class="right-cont">
+            <el-select v-model="dateType" size="mini" style="width:100%" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in dateTypeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="cont">
+          <div class="title">时间:</div>
+          <div class="right-cont">
+            <el-date-picker
+              v-model="time"
+              style="width: 100%;"
+              size="mini"
+              type="daterange"
+              clearable
+              value-format="yyyy-MM-dd"
+              range-separator="-"
+              start-placeholder="开始日期"
+              @change="change"
+              end-placeholder="结束日期">
+            </el-date-picker>
+          </div>
+        </div>
+      </template>
+      
+    </template>
+    <template #footer>
+      <div class="btn">
+        <el-button type="primary" size="small" plain @click="clear">清空</el-button>
+        <el-button type="primary" size="small" @click="btn">确定</el-button>
+      </div>
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { pullItem } from '@/api/omsOrder'
+@Component
+export default class SynchronousOrderModal extends Vue {
+  load = false;
+  value = false;
+  type=1;
+  shopName = '犇云聚水潭店铺';
+  shopId:any = 2;
+  shopOptions=[{
+    label:'犇云聚水潭店铺',
+    value:2
+  }]
+  skus=''; //skus
+  styles=''; //款式编码
+  dateType:any=null;
+  dateTypeOptions=[{
+    label:'修改时间',
+    value:1
+  },{
+    label:'创建时间',
+    value:2
+  }]
+  beginDate='';
+  endDate='';
+  time:any=null;
+
+  setShow(v:boolean){
+    this.value = v;
+  }
+  change(v:any){
+    if(v){
+      this.beginDate = v[0];
+      this.endDate = v[1];
+    }else{
+      this.beginDate = '';
+      this.endDate = '';
+    }
+  }
+  btn(){
+    let value:any={};
+    let msg = '';
+    if(!this.shopId){
+      msg = '店铺名称'
+    }else{
+      value.shopId = this.shopId;
+      value.showName = this.shopName;
+    }
+    
+    value.type = this.type;
+    if(this.type == 1){
+      msg = this.msgInfo(this.skus,msg,'sku')
+      value.skus = this.skus.split('\n');
+    }else if(this.type == 2){
+      msg = this.msgInfo(this.styles,msg,'款式编码')
+      value.styles = this.styles.split('\n');
+    }else if(this.type == 3){
+      if(this.dateType < 1 || this.dateType > 2){
+        if(msg){
+          msg = msg + ',时间类型'
+        }else{
+          msg = '时间类型'
+        }
+      }
+      msg = this.msgInfo(this.time,msg,'时间')
+      value.dateType = this.dateType;
+      value.beginDate = this.beginDate + ' 00:00:00';
+      value.endDate = this.endDate + ' 00:00:00';
+    }
+    if(msg){
+      this.$message({
+        message:msg + '不能为空!',
+        type: 'warning'
+      })
+      return
+    }
+    this.load = true;
+    pullItem(value).then((res:any) => {
+      this.load = false;
+      (this as any).$message({
+        message: '操作成功!',
+        type: 'success',
+      });
+      this.value = false;
+      this.$emit('handleSuccess');
+    }).catch((err:any) => {
+      this.load = false;
+    })
+  }
+  msgInfo(data:any,msg:string,title:string){
+    if(!data){
+      if(msg){
+        msg = msg + ',' + title;
+      }else{
+        msg = title
+      }
+    }
+    return msg
+  }
+  clear(){
+    this.type = 1;
+    this.shopName = '';
+    this.shopId = '';
+    this.skus = '';
+    this.dateType = '';
+    this.beginDate = '';
+    this.endDate = '';
+    this.time = null;
+    this.styles = '';
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn{
+  width: 100%;
+  display: flex;
+  justify-content: flex-end;
+}
+.type{
+  width: 100%;
+  padding: 8px 0;
+}
+.cont{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  padding: 8px 0;
+  .title{
+    width: 100px;
+    text-align: right;
+  }
+  .right-cont{
+    width: calc(100% - 100px);
+  }
+}
+</style>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 324 - 286
src/views/audit/productManagement/index.vue


+ 11 - 1
src/views/oms/order/components/filterMinMax.vue

@@ -27,6 +27,16 @@ export default class OrderProduct extends Vue {
     this.value={}
   }
   mininput(){
+    const max = Number(this.value[this.maxField]);
+    const min = Number(this.value[this.minField]);
+    if(max < min){
+      this.$message({
+        message: '最小值不能超过最大值!',
+        type: 'warning'
+      })
+      this.value[this.minField] = null;
+      return
+    }
     this.$emit('change',this.value)
   }
   maxinput(){
@@ -34,7 +44,7 @@ export default class OrderProduct extends Vue {
     const min = Number(this.value[this.minField]);
     if(max < min){
       this.$message({
-        message: '最大值不能超过最小值',
+        message: '最小值不能超过最大值!',
         type: 'warning'
       })
       this.value[this.maxField] = null;

+ 1 - 1
src/views/oms/order/index.vue

@@ -34,7 +34,7 @@
             <filter-date @change="onChangeTime" ref="searchCom07" />
             <div>付款后几小时未发货:</div>
             <div class="order-time">
-              <el-input v-model="value.deliveryHours" class="deliveryHours-input" size="mini" type="number" style=""></el-input>
+              <el-input v-model="value.deliveryHours" class="deliveryHours-input" size="mini" type="number" :input="value.deliveryHours=value?.deliveryHours?.replace(/^(0+)|[^\d]+/g,'')" style=""></el-input>
               <i class="el-icon-info" title="单位小时,不支持小数位。如果数值大于0,强制为未发货订单。同时勾选店铺可以实现不同平台的未发货时效查询"></i>
             </div>
             <filterMinMax title="剩余发货时间(小时)" ref="searchCom08" minField="deliveryRemainingMin" maxField="deliveryRemainingMax" @change="parameChange" />

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác