浏览代码

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

AlanWong 2 年之前
父节点
当前提交
8bd948309a

+ 40 - 0
src/api/omsLabel.ts

@@ -0,0 +1,40 @@
+import request from '@/benyun/utils/request'
+
+//查询
+export function queryAll(){
+	return request({
+		url: '/omsOrder/omsLabel/queryAll',
+		method: 'GET'
+	})
+}
+//查询系统的
+export function querySys(){
+	return request({
+		url: '/omsOrder/omsLabel/querySys',
+		method: 'GET'
+	})
+}
+//新增
+export function save(data:any){
+	return request({
+		url: '/omsOrder/omsLabel/save',
+		method: 'POST',
+		params: data
+	})
+}
+//修改序号
+export function updateOrdered(data:any){
+	return request({
+		url: '/omsOrder/omsLabel/updateOrdered',
+		method: 'POST',
+		params: data
+	})
+}
+//删除
+export function del(data:any){
+	return request({
+		url: '/omsOrder/omsLabel/delete',
+		method: 'POST',
+		params: data
+	})
+}

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

@@ -90,7 +90,7 @@
           }
         }
       }
-      
+      this.value['isContain'] = this.switchValue;
       
       this.onChange();
     }

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

@@ -0,0 +1,65 @@
+<template>
+  <vxe-modal v-model="value" id="addLabel" width="400" v-loading="load" @show="show" @hide="hide" height="200" show-footer title="新增标签">
+    <by-form :propConfig="config" ref="form"></by-form>
+    <template #footer>
+      <div class="btn">
+        <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 { save} from '@/api/omsLabel'
+@Component({components:{}})
+export default class AddQuestModel extends Vue {
+  value = false;
+  load = false;
+  config:any={
+    attr:{
+      rules:{
+        name: [
+          { required: true, message: '名称不能为空!', trigger: 'blur' }
+        ]
+      }
+    },
+    columns:[
+      [{
+        label:'名称',
+        prop:'name',
+        labelWidth:'80px',
+        component:'by-input'
+      }]
+    ]
+  }
+  show(){
+    
+  }
+  hide(){
+    (this.$refs.form as any).clearValidate();
+    (this.$refs.form as any).clearValue();
+  }
+  setShow(v:boolean){
+    this.value = v;
+  }
+  btn(){
+    (this.$refs.form as any).validate().then(()=>{
+      let data = (this.$refs.form as any).getValue();
+      data.isSystem = 1;
+      this.load = true
+      save(data).then(()=>{
+        this.load = false;
+        this.$emit('handleSuccess');
+        this.value = false;
+      }).catch(()=>{
+        this.load = false;
+      })
+    })
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 139 - 0
src/views/oms/omsLabel/index.vue

@@ -0,0 +1,139 @@
+<template>
+  <div class="oms-label" id="labelPage" v-loading="load">
+    <by-tool :propConfig="tool" class="tool" @clickHandle="clickHandle" id="labelTool" />
+    <by-table :propConfig="tableConfig" ref="table">
+      <template v-slot:ordered="{row}">
+        <vxe-input v-model="row.ordered" size="small" type="number"></vxe-input>
+      </template>
+    </by-table>
+    <add-label ref="addLabel" @handleSuccess="getList" />
+  </div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import {querySys, updateOrdered, del} from '@/api/omsLabel'
+import addLabel from './components/addLabel.vue'
+@Component({components:{addLabel}})
+export default class OmsLabel extends Vue {
+  load=false;
+  tool={
+    tools:{
+      add:true,
+      refresh:true
+    },
+    audit:{
+      add:'oms:omsLabel:add',
+    }
+  }
+  tableConfig:any={
+    attr:{
+      size:'mini',
+      align:'center',
+      seq:true
+    },
+    columns:[{
+      title:'名称',
+      field:'name'
+    },{
+      title:'排序',
+      field:'ordered',
+      width:150,
+      slot:true
+    },{
+      title:'操作',
+      action:true,
+      width:200,
+      plugins:[{
+        name:'排序',
+        event:{
+          click:(row:any) => {
+            this.sortHandle(row);
+          }
+        }
+      },{
+        name:'删除',
+        event:{
+          click:(row:any) => {
+            this.delHandle(row);
+          }
+        }
+      }]
+    }]
+  }
+  mounted(){
+    this.$nextTick(()=>{
+      let height = (document.getElementById('labelPage') as any).offsetHeight;
+      this.tableConfig.attr.height=height - 32 - 48;
+      if(this.$refs.table){
+        (this.$refs.table as any).setConfig(this.tableConfig);
+      }
+      this.getList();
+    })
+  }
+  //获取数据
+  getList(){
+    this.load = true;
+    querySys().then((res:any) => {
+      this.load = false;
+      if(this.$refs.table){
+        (this.$refs.table as any).setValue(res.data);
+      }
+    }).catch(()=>{
+      this.load = false
+    })
+  }
+  //排序
+  sortHandle(row:any){
+    this.load = true;
+    updateOrdered({
+      id:row.id,
+      ordered:Number(row.ordered)
+    }).then(()=>{
+      this.load = false;
+      this.getList();
+    }).catch(()=>{
+      this.load = false
+    })
+  }
+  //删除
+  delHandle(row:any){
+    this.$confirm('此操作将删除“'+row.name+'”, 是否继续?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }).then(() => {
+      this.load = true;
+      del({
+        id:row.id
+      }).then(()=>{
+        this.load = false;
+        this.getList();
+      }).catch(()=>{
+        this.load = false
+      })
+    }).catch(()=>{})
+    
+  }
+  clickHandle(e:any){
+    if(e == 'onAdd'){
+      (this.$refs.addLabel as any).setShow(true)
+    }
+    if(e == 'onRefresh'){
+      this.getList();
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.oms-label{
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  padding: 16px;
+  .tool{
+    padding-bottom: 16px;
+  }
+}
+</style>

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

@@ -152,7 +152,7 @@ export default class QuestType extends Vue {
         }).catch(()=>{
           this.load = false;
         })
-    })
+    }).catch(()=>{})
   }
   //获取异常数据
   getQuestionList(){