|
@@ -0,0 +1,305 @@
|
|
|
+<template>
|
|
|
+ <div class="cargoOwner">
|
|
|
+ <module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @modalHandle="modalHandle" @onRefresh="getList"
|
|
|
+ @resert="queryList" @search="queryList" @clickHandle="clickHandle" @detail="detail" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script lang="ts">
|
|
|
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
+import {registerMember, updateMember, queryAll, queryById} from '@/api/cargoOwner'
|
|
|
+@Component({components:{}})
|
|
|
+export default class CargoOwner extends Vue {
|
|
|
+ load=false;
|
|
|
+ time:any;
|
|
|
+ timeNum = 0;
|
|
|
+ isSearch=false;
|
|
|
+ config:any={
|
|
|
+ attr:{
|
|
|
+ calculateH:true
|
|
|
+ },
|
|
|
+ search:{
|
|
|
+ attr:{
|
|
|
+ size:'small'
|
|
|
+ },
|
|
|
+ columns:[
|
|
|
+ [{
|
|
|
+ label:'货主名称',
|
|
|
+ prop:'wmsMemberName',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{}
|
|
|
+ },{
|
|
|
+ label:'联系人',
|
|
|
+ prop:'wmsContact',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{}
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label:'WMS系统',
|
|
|
+ // prop:'wmsSys',
|
|
|
+ // component:'by-select',
|
|
|
+ // compConfig:{
|
|
|
+ // attr:{
|
|
|
+ // clearable:true,
|
|
|
+ // data:[{
|
|
|
+ // value:'Authorized',
|
|
|
+ // label:'已授权'
|
|
|
+ // },{
|
|
|
+ // value:'Unauthorized',
|
|
|
+ // label:'未授权'
|
|
|
+ // },{
|
|
|
+ // value:'Expired',
|
|
|
+ // label:'已过期'
|
|
|
+ // }]
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ tool:{
|
|
|
+ tools:{
|
|
|
+ add:true,
|
|
|
+ // delete:true,
|
|
|
+ search:true,
|
|
|
+ refresh:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ table:{
|
|
|
+ attr:{
|
|
|
+ size:'mini',
|
|
|
+ seq:true,
|
|
|
+ align:'center',
|
|
|
+ // checkbox:true
|
|
|
+ },
|
|
|
+ columns:[{
|
|
|
+ title:'货主名称',
|
|
|
+ field:'wmsMemberName',
|
|
|
+ isDetail:true,
|
|
|
+ // width:150
|
|
|
+ },{
|
|
|
+ title:'WMS系统',
|
|
|
+ field:'wmsSys',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'货主等级',
|
|
|
+ field:'wmsLevel',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'日单量',
|
|
|
+ field:'wmsDayAmount',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'联系人',
|
|
|
+ field:'wmsContact',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'联系电话',
|
|
|
+ field:'wmsPhone',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'联系人性别',
|
|
|
+ field:'wmsSex',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'邮箱',
|
|
|
+ field:'wmsEmail',
|
|
|
+ width:150
|
|
|
+ },{
|
|
|
+ title:'地址',
|
|
|
+ field:'wmsAddress',
|
|
|
+ width:150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'操作',
|
|
|
+ action:true,
|
|
|
+ width:100,
|
|
|
+ // plugins:[{
|
|
|
+ // name:'删除',
|
|
|
+ // event:{
|
|
|
+ // click:(item:any) => {
|
|
|
+ // this.del(item);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }]
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ modal:{
|
|
|
+ tool:{
|
|
|
+ tools:{
|
|
|
+ return:true,
|
|
|
+ add:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ form:{
|
|
|
+ attr:{
|
|
|
+ size:'small',
|
|
|
+ labelWidth:'130px',
|
|
|
+ rules:{
|
|
|
+ shopId:[
|
|
|
+ { required: true, message: '请输入店铺编号', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns:[
|
|
|
+ [{
|
|
|
+ label:'货主名称',
|
|
|
+ prop:'wmsMemberName',
|
|
|
+ component:'by-input'
|
|
|
+ },{
|
|
|
+ label:'WMS系统',
|
|
|
+ prop:'wmsSys',
|
|
|
+ component:'by-select',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ defaultIndex: 0,
|
|
|
+ data:[{
|
|
|
+ value:'GEEKPLUS',
|
|
|
+ label:'极智嘉'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ label:'货主等级',
|
|
|
+ prop:'wmsLevel',
|
|
|
+ component:'by-input'
|
|
|
+ }],
|
|
|
+ [{
|
|
|
+ label:'联系人',
|
|
|
+ prop:'wmsContact',
|
|
|
+ component:'by-input'
|
|
|
+ },{
|
|
|
+ label:'联系电话',
|
|
|
+ prop:'wmsPhone',
|
|
|
+ component:'by-input'
|
|
|
+ },{
|
|
|
+ label:'联系人性别',
|
|
|
+ prop:'wmsSex',
|
|
|
+ component:'by-input'
|
|
|
+ }],
|
|
|
+ [{
|
|
|
+ label:'日单量',
|
|
|
+ prop:'wmsDayAmount',
|
|
|
+ component:'by-input'
|
|
|
+ },{
|
|
|
+ label:'邮箱',
|
|
|
+ prop:'wmsEmail',
|
|
|
+ component:'by-input'
|
|
|
+ },{
|
|
|
+ label:'地址',
|
|
|
+ prop:'wmsAddress',
|
|
|
+ component:'by-input'
|
|
|
+ }]
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mounted(){
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //分页
|
|
|
+ pagination(){
|
|
|
+ if(this.isSearch){
|
|
|
+ this.queryList();
|
|
|
+ }else{
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //列表请求(只有分页,不包含搜素条件)
|
|
|
+ getList(){
|
|
|
+ if(!this.$refs.view){
|
|
|
+ if(this.timeNum > 5){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.getList()
|
|
|
+ },500)
|
|
|
+ this.timeNum ++;
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isSearch = false;
|
|
|
+ this.requestList();
|
|
|
+ }
|
|
|
+ //列表请求(包含分页和搜素条件)
|
|
|
+ queryList(){
|
|
|
+ this.isSearch = true;
|
|
|
+ let data = (this.$refs.view as any).getQuery();
|
|
|
+ this.requestList();
|
|
|
+ }
|
|
|
+ requestList(){
|
|
|
+ this.load = true;
|
|
|
+ queryAll().then((res:any) => {
|
|
|
+ this.load = false;
|
|
|
+ (this.$refs.view as any).setTableValue(res.data.records);
|
|
|
+
|
|
|
+ }).catch(()=>{
|
|
|
+ this.load = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //修改店铺数据
|
|
|
+ onSave(){
|
|
|
+ let data = (this.$refs.view as any).getFormValue();
|
|
|
+ this.load = true;
|
|
|
+ updateMember(data).then((res:any) => {
|
|
|
+ this.$message({
|
|
|
+ message:res.msg,
|
|
|
+ type:'success'
|
|
|
+ });
|
|
|
+ this.load = false;
|
|
|
+ (this.$refs.view as any).closeModal();
|
|
|
+ this.pagination();
|
|
|
+ }).catch(()=>{
|
|
|
+ this.load = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //表单工具栏按钮事件
|
|
|
+ modalHandle(n:string){
|
|
|
+ if(n == 'onAdd'){
|
|
|
+ (this.$refs.view as any).getFormValidate(this.addShop)
|
|
|
+ }
|
|
|
+
|
|
|
+ if(n == 'onSave'){
|
|
|
+ (this.$refs.view as any).getFormValidate(this.onSave)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //表格工具栏按钮事件
|
|
|
+ clickHandle(n:string){
|
|
|
+ if(n == 'onAdd'){
|
|
|
+ this.config.modal.tool.tools.add = true;
|
|
|
+ delete this.config.modal.tool.tools.save;
|
|
|
+ (this.$refs.view as any).initFormTool();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //添加店铺
|
|
|
+ addShop(){
|
|
|
+ let value = (this.$refs.view as any).getFormValue();
|
|
|
+ if(value){
|
|
|
+ this.load = true;
|
|
|
+ registerMember(value).then((res:any)=>{
|
|
|
+ this.load = false;
|
|
|
+ this.$message({
|
|
|
+ message:res.msg,
|
|
|
+ type:'success'
|
|
|
+ });
|
|
|
+ (this.$refs.view as any).closeModal();
|
|
|
+ this.getList();
|
|
|
+ }).catch(()=>{
|
|
|
+ this.load = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //点击详情
|
|
|
+ detail(){
|
|
|
+ this.config.modal.tool.tools.save = true;
|
|
|
+ delete this.config.modal.tool.tools.add;
|
|
|
+ (this.$refs.view as any).initFormTool();
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.cargoOwner{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+</style>
|