瀏覽代碼

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

AlanWong 2 年之前
父節點
當前提交
b812d4cabc

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

@@ -105,7 +105,7 @@ export default class ByArea extends VueViews {
   
   @Watch('propValue')
   propValueChange(v:any){
-    this.setValue(v);
+    // this.setValue(v);
   }
   created(){
     if(this.propConfig){

+ 17 - 5
src/components/skuModal/productModal.vue

@@ -1,12 +1,18 @@
 <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">
+  show-zoom resize transfer show-footer>
     <template #title>
       <span>选择商品</span>
     </template>
     <template #default>
       <module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList" @clickHandle="clickHandle" />
     </template>
+    <template #footer>
+      <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+        <el-button type="primary" size="small" @click="confirm">确定</el-button>
+      </div>
+    </template>
   </vxe-modal>
 </template>
 
@@ -31,14 +37,15 @@ export default class ProductModal extends Vue {
   config:any={
     search:{
       attr:{
-        size:'mini'
+        size:'mini',
       },
       columns:[
         [{
-          span:6,
+          span:10,
           label:'物料ID',
           prop:'materialId',
           component:'by-input',
+          labelWidth:'120px',
           compConfig:{
             attr:{
               clearable:true,
@@ -46,10 +53,11 @@ export default class ProductModal extends Vue {
             }
           }
         },{
-          span:6,
+          span:10,
           label:'商品名称',
           prop:'skuTitle',
           component:'by-input',
+          labelWidth:'120px',
           compConfig:{
             attr:{
               clearable:true,
@@ -70,7 +78,7 @@ export default class ProductModal extends Vue {
         size:'mini',
         seq:true,
         align:'center',
-        // radio:true,
+        triggerRowCheck:'row',
         pageSize:10
       },
       columns:[{
@@ -129,6 +137,10 @@ export default class ProductModal extends Vue {
   //确定
   confirm(){
     let data:Array<any>=this.getSelectdata();
+    if(data.length == 0){
+      this.$message('请选择商品!')
+      return
+    }
     this.$emit('confirm',data);
     this.value = false;
   }

+ 16 - 6
src/components/supplierModal/supplierModal.vue

@@ -1,12 +1,18 @@
 <template>
   <vxe-modal v-model="value" id="supplierModal" :width="width?width+'px':'60%'" @show="show" :height="height?height+'px':'80%'" min-width="500" min-height="400" 
-  show-zoom resize transfer show-footer  @confirm="confirm" :zIndex="zIndex">
+  show-zoom resize transfer show-footer  :zIndex="zIndex">
     <template #title>
       <span>{{title?title:'选择供应商'}}</span>
     </template>
     <template #default>
       <module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList" @clickHandle="clickHandle" />
     </template>
+    <template #footer>
+      <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+        <el-button type="primary" size="small" @click="confirm">确定</el-button>
+      </div>
+    </template>
   </vxe-modal>
 </template>
 
@@ -42,8 +48,8 @@ export default class SupplierModal extends Vue {
       },
       columns:[
         [{
-          labelWidth:'50px',
-          span:8,
+          labelWidth:'120px',
+          span:10,
           label:'名称',
           prop:'name',
           component:'by-input',
@@ -54,8 +60,8 @@ export default class SupplierModal extends Vue {
             }
           }
         },{
-          labelWidth:'70px',
-          span:8,
+          labelWidth:'120px',
+          span:10,
           label:'负责人',
           prop:'contacts',
           component:'by-input',
@@ -79,7 +85,7 @@ export default class SupplierModal extends Vue {
         size:'mini',
         seq:true,
         align:'center',
-        // radio:true,
+        triggerRowCheck:'row',
         pageSize:10
       },
       columns:[{
@@ -113,6 +119,10 @@ export default class SupplierModal extends Vue {
   //确定
   confirm(){
     let data:Array<any>=this.getSelectdata();
+    if(data.length == 0){
+      this.$message('请选择供应商!')
+      return
+    }
     this.$emit('confirm',data);
     this.value = false;
   }

+ 1 - 0
src/views/oms/omsLabel/components/addLabel.vue

@@ -3,6 +3,7 @@
     <by-form :propConfig="config" ref="form"></by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 8 - 2
src/views/oms/order/components/addOrder.vue

@@ -22,7 +22,7 @@
               {{ getFromText(value.sourceFrom) }}
             </template>
             <template v-slot:labels="{value}">
-              <el-input placeholder="请选择标签" v-model="value.labels" :disabled="orderValue.id?true:false" size="small" class="myinpuy-with-select" clearable>
+              <el-input :placeholder="!orderValue.id?'请选择标签':''" :value="value.labels" :disabled="orderValue.id?true:false" size="small" class="myinpuy-with-select" clearable>
                 <el-button slot="append" v-if="!orderValue.id" icon="el-icon-more" @click="showLabels"></el-button>
               </el-input>
             </template>
@@ -224,6 +224,7 @@ export default class AddOrder extends Vue {
         component:'by-input',
         compConfig:{
           attr:{
+            type:'integer',
             placeholder:'请输入店铺名称',
             clearable:true
           }
@@ -411,7 +412,11 @@ export default class AddOrder extends Vue {
         label:'买家账号',
         prop:'buyerId',
         component:'by-input',
-        compConfig:{}
+        compConfig:{
+          attr:{
+            type:'integer'
+          }
+        }
       },{
         span:6,
         label:'收货人',
@@ -1013,6 +1018,7 @@ export default class AddOrder extends Vue {
       info.note = data.note;
       info.buyerMessage = data.buyerMessage;
       info.remark = data.remark;
+      info.labels = data.labels;
       info.sourceFrom = data.sourceFrom;
       this.baseConfig.attr.data = info;
       (this.$refs.baseform as any).setValue(info);

+ 1 - 0
src/views/oms/order/components/addProductModal.vue

@@ -16,6 +16,7 @@
     </by-table>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/addQuest.vue

@@ -3,6 +3,7 @@
     <by-form :propConfig="config" ref="form"></by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/cancelOrderModel.vue

@@ -17,6 +17,7 @@
     </div>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/editProductModal.vue

@@ -74,6 +74,7 @@
     <product-sku-modal ref="productGift" :mulit="true" @confirm="confirmProductGift" />
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/freightModal.vue

@@ -3,6 +3,7 @@
     <by-form :propConfig="config" ref="form"></by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 9 - 1
src/views/oms/order/components/labelsModal.vue

@@ -12,6 +12,7 @@
     <add-label ref="addLabel" @handleSuccess="getList" :isSystem="0" />
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>
@@ -28,9 +29,16 @@ export default class LabelsModal extends Vue {
   load = false;
   tool={
     tools:{
-      add:true,
       refresh:true
     },
+    customTools:[{
+      name:'添加标签',
+      event:{
+        click:()=>{
+          (this.$refs.addLabel as any).setShow(true)
+        }
+      }
+    }],
     audit:{}
   }
   tableConfig:any={

+ 1 - 0
src/views/oms/order/components/loadOrderModal.vue

@@ -82,6 +82,7 @@
     </template>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" plain @click="clear">清空</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>

+ 6 - 1
src/views/oms/order/components/mergeMedal.vue

@@ -47,6 +47,7 @@
     </by-table>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>
@@ -105,9 +106,13 @@ export default class MergeModel extends Vue {
       slot:true,
       width:120
     },{
-      title:'重量',
+      title:'运费',
       field:'freight',
       width:80
+    },{
+      title:'重量',
+      field:'weight',
+      width:80
     },{
       title:'买家留言+卖家备注',
       field:'msg',

+ 1 - 0
src/views/oms/order/components/orderTable.vue

@@ -120,6 +120,7 @@
     </vxe-column>
     <vxe-column field="remark" title="订单备注" width="120"></vxe-column>
     <vxe-column field="note" title="线下备注" width="120"></vxe-column>
+    <vxe-column field="labels" title="标签" width="120"></vxe-column>
     <vxe-column title="操作" width="90" fixed="right" align="center">
       <template #default="{ row }">
         <el-button type="text" size="mini" v-if="showMerge(row)" @click="mergeHandle(row)">合并</el-button>

+ 25 - 18
src/views/oms/order/components/purchaseModel.vue

@@ -1,6 +1,6 @@
 <template>
   <vxe-modal v-model="value" id="purchaseModel" @show="show" width="70%" height="80%" min-width="460" min-height="320" 
-    show-zoom resize transfer show-footer @hide="hide" v-loading="load"  @confirm="btn">
+    show-zoom resize transfer show-footer @hide="hide" v-loading="load">
     <template #title>
       <span>生成采购单</span>
     </template>
@@ -20,6 +20,12 @@
       </el-collapse-item>
     </el-collapse>
     <supplier-modal ref="supplierModal" @confirm="confirm" />
+    <template #footer>
+      <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+        <el-button type="primary" size="small" @click="btn">确定</el-button>
+      </div>
+    </template>
   </vxe-modal>
 </template>
 
@@ -270,25 +276,26 @@ export default class PurchaseModel extends Vue {
     (this.$refs.baseform as any).validate().then(()=>{
       let value:any = (this.$refs.baseform as any).getValue();
       let data:Array<any>=(this.$refs.table as any).getValue();
-        if(data.length > 0){
-          value.items = data;
-          this.load = true;
-          toPurchaseOrder(value).then((res:any)=>{
-            this.load = false;
-            this.$message({
-              message:'采购单已生成!',
-              type:'success'
-            })
-            this.$emit('handleSuccess');
-          }).catch((err:any) => {
-            this.load = false;
-          })
-        }else{
+      if(data.length > 0){
+        value.items = data;
+        this.load = true;
+        toPurchaseOrder(value).then((res:any)=>{
+          this.load = false;
+          this.value = false;
           this.$message({
-            message:'采购的商品不能为空!',
-            type:'warning'
+            message:'采购单已生成!',
+            type:'success'
           })
-        }
+          this.$emit('handleSuccess');
+        }).catch((err:any) => {
+          this.load = false;
+        })
+      }else{
+        this.$message({
+          message:'采购的商品不能为空!',
+          type:'warning'
+        })
+      }
       
     })
     

+ 1 - 0
src/views/oms/order/components/questModel.vue

@@ -24,6 +24,7 @@
     </by-table>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="add">新增</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/setQuesModal.vue

@@ -3,6 +3,7 @@
     <by-form :propConfig="config" ref="form"></by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/splitModal.vue

@@ -7,6 +7,7 @@
     </by-table>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 83 - 102
src/views/oms/order/components/tabModal.vue

@@ -1,18 +1,23 @@
 <template>
-  <vxe-modal v-model="value" id="tagModal" width="400" v-loading="load" @hide="hide" height="350" show-footer title="修改标签">
-    <by-form :propConfig="config" ref="form">
-      <template v-slot:actionType="{value}">
-        <el-switch
-          v-model="value.actionType"
-          active-text="移除"
-          inactive-text="新增"
-          :inactive-value="1"
-          :active-value="2">
-        </el-switch>
-      </template>
-    </by-form>
+  <vxe-modal v-model="value" id="tagModal" width="60%" v-loading="load" @hide="hide" height="70%" show-footer title="修改标签">
+    <div class="type">
+      <el-radio-group v-model="actionType">
+        <el-radio :label="1">列表新增</el-radio>
+        <el-radio :label="2">列表移除</el-radio>
+      </el-radio-group>
+    </div>
+    <el-scrollbar class="label-group">
+      <el-checkbox-group v-model="labels" :max="10">
+        <div class="label-box">
+          <div class="label-item" v-for="(item,index) of labelData" :key="index">
+            <el-checkbox :label="item.name"></el-checkbox>
+          </div>
+        </div>
+      </el-checkbox-group>
+    </el-scrollbar>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>
@@ -21,104 +26,50 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { setLabels } from '@/api/omsOrder'
+import {queryAll, updateOrdered, del} from '@/api/omsLabel'
 @Component({components:{}})
 export default class TabModal extends Vue {
   value=false;
   load=false;
   billValue:Array<any>=[];
-  config:any={
-    attr:{
-      rules:{
-        labels: [
-          { required: true, message: '标签不能为空!', trigger: 'input' }
-        ]
-      }
-    },
-    columns:[
-      [{
-        label:'标签',
-        prop:'labels',
-        labelWidth:'80px',
-        component:'by-input',
-        compConfig:{
-          attr:{
-            type:'textarea',
-            rows:3,
-            placeholder:'每行一个标签,换行输入,每个标签字符长度不超过10',
-            autosize:{
-              maxRows:19
-            }
-          }
-        }
-      }],
-      [{
-        label:'',
-        prop:'actionType',
-        labelWidth:'80px',
-        slot:true
-      }]
-    ]
+  actionType:any=1
+  labels:Array<any>=[]
+  labelData:Array<any>=[]
+  mounted(){
+    this.getList()
   }
   hide(){
-    (this.$refs.form as any).clearValidate();
-    (this.$refs.form as any).clearValue();
+    this.actionType = 1;
+    this.labels = [];
   }
-  btn(){
-    (this.$refs.form as any).validate().then(()=>{
-      let data = (this.$refs.form as any).getValue();
-      let newV=data.labels.split('\n');
-      let msg1 = '';
-      let msg2='';
-      for(const item of newV){
-        if(item && item.length >10){
-          if(msg1){
-            msg1 = msg1 + ',' + item
-          }else{  
-            msg1 = item
-          }
-        }
-      }
-      let i1=-1;
-      for(const item1 of newV){
-        let i2=-1;
-        i1++;
-        for(const item2 of newV){
-          i2++;
-          if(i1 != i2 && item1 == item2){
-            if(msg2){
-              msg2 = msg2 + ',' + item2
-            }else{  
-              msg2 = item2
-            } 
-            break
-          }
-        }
-      }
-      let msg = '';
-      if(msg1){
-        msg = '标签“'+msg1 + '”不能超过10个字符;'
+  getList(){
+    this.load = true;
+    queryAll().then((res:any) => {
+      this.load = false;
+      this.labelData = []
+      if(res.data){
+        this.labelData = res.data
       }
-      if(msg2){
-        msg = msg + '标签“'+msg2 + '”重复输入;'
-      }
-      if(msg){
-        this.$message(msg)
-        return
-      }
-      data.labels = newV;
-      data.idList = this.billValue;
-      this.load = true
-      setLabels(data).then(()=>{
-        this.load = false;
-        (this.$message({
-          message:'操作成功!',
-          type:'success'
-        }));
-        this.$emit('handleSuccess');
-        this.value = false;
-      }).catch(()=>{
-        this.load = false;
-      })
+    }).catch(()=>{
+      this.load = false
+    })
+  }
+  btn(){
+    let data:any = {};
+    data.actionType = this.actionType
+    data.labels = this.labels;
+    data.idList = this.billValue;
+    this.load = true
+    setLabels(data).then(()=>{
+      this.load = false;
+      (this.$message({
+        message:'操作成功!',
+        type:'success'
+      }));
+      this.$emit('handleSuccess');
+      this.value = false;
+    }).catch(()=>{
+      this.load = false;
     })
   }
   setShow(v:boolean){
@@ -128,4 +79,34 @@ export default class TabModal extends Vue {
     this.billValue = data;
   }
 }
-</script>
+</script>
+
+<style lang="scss" scoped>
+.type{
+  width: 100%;
+  padding-bottom: 16px;
+}
+.label-group{
+  .label-box{
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+  }
+  .label-item{
+    width: 33.3333%;
+  }
+}
+</style>
+
+<style lang="scss">
+.label-group{
+  width: 100%;
+  height: calc(100% - 37px);
+  div.el-scrollbar__wrap {
+    overflow-x: hidden;
+  }
+  .el-scrollbar__bar {
+    right: 0px;
+  }
+}
+</style>

+ 1 - 0
src/views/oms/order/components/updateRmkModal.vue

@@ -9,6 +9,7 @@
     </by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

+ 1 - 0
src/views/oms/order/components/updateSalerModal.vue

@@ -3,6 +3,7 @@
     <by-form :propConfig="config" ref="form"></by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>

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

@@ -109,7 +109,7 @@
               <el-input style="width: 140px;" v-model="value.noteContent" size="mini" placeholder="备注内容"></el-input>
             </template>
           </order-radio>
-          <el-collapse-item title="标签" name="label">
+          <!-- <el-collapse-item title="标签" name="label">
             <div class="orderSelect">
               <el-select v-model="value.includeLabelsType" placeholder="请选择包含标签类型" clearable size="mini">
                 <el-option label="包含任意一个标签" :value="1"></el-option>
@@ -122,7 +122,7 @@
             <el-input placeholder="排除标签" :value="value.excludeLabels" @clear="labelsClear" class="labels-width-btn" size="mini" clearable>
               <el-button slot="append" icon="el-icon-more" @click="showLabels2"></el-button>
             </el-input>
-          </el-collapse-item>
+          </el-collapse-item> -->
           <order-radio title="订单来源" keyName="sourceFrom" ref="searchCom11" :options="sourceFromOptions" noLimit @radioChange="onChange($event,'sourceFrom')" />
           <order-checkbox title="订单类型" keyName="type" ref="searchCom12" :options="typeOption" noLimit @checkboxChange="onChange($event,'type')" />
           <el-collapse-item title="付款方式 & 是否付款" name="codAndPay">
@@ -227,7 +227,7 @@ import { queryAll } from '@/api/question'
   filterMinMax,loadOrderModal,PurchaseModel,MergeModel,SplitModel,CancelOrderModel,QuestModel,SetQuesModal,UpdateRmkModal,UpdateSalerModal,
   TabModal,AddProductModal,FreightModal,LabelsModal}})
 export default class Order extends Vue {
-  activeNames:Array<any>=['1','status']
+  activeNames:Array<any>=['1','statusList']
   radio=''
   radio2=''
   data:Array<any> = []

+ 1 - 0
src/views/oms/quesType/components/addQuest.vue

@@ -3,6 +3,7 @@
     <by-form :propConfig="config" ref="form"></by-form>
     <template #footer>
       <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
         <el-button type="primary" size="small" @click="btn">确定</el-button>
       </div>
     </template>