记录一个简单的vue页面实现
<template>
<div class="userView">
<!-- 页眉颜色统一 -->
<div class="buttonTop"></div>
<div class="main">
<!--工具栏-->
<div class="center" style="overflow: hidden;">
<el-button @click="updateOrderInvoiceBatch" type="success">批量设置拣货中</el-button>
<div class="input" style="float:right">
<span>发货单状态:</span>
<el-select clearable style="width:100px;" v-model="data.sts" placeholder="发货单状态" size="small">
<el-option label="取消" value="0"></el-option>
<el-option label="未支付" value="1"></el-option>
<el-option label="已支付" value="2"></el-option>
<el-option label="拣货中" value="3"></el-option>
<el-option label="已发货" value="4"></el-option>
</el-select>
<el-input placeholder="请输入名称" v-model="data.name" clearable size="small"></el-input>
<el-button @click="select" type="success">检索</el-button>
<el-button @click="emptyData" type="info">清空</el-button>
</div>
</div> <!--列表table展示-->
<el-table
:data="orderInvoiceList.rows"
@selection-change="changeTable"
border
style="width: 100%; margin-top: 10px">
<el-table-column type="selection" min-width="35"></el-table-column>
<el-table-column prop="price" label="货价" min-width="50"></el-table-column>
<el-table-column prop="postFee" label="运费" min-width="50"></el-table-column>
<el-table-column prop="totalPrice" label="总价" min-width="50"></el-table-column>
<el-table-column prop="isCanceled" label="是否取消" min-width="60" :formatter="booleanMsgFun"></el-table-column>
<el-table-column prop="isSettled" label="费用是否结清" min-width="80" :formatter="booleanMsgFun"></el-table-column>
<el-table-column prop="isSettledFee" label="运费是否结清" min-width="80" :formatter="booleanMsgFun"></el-table-column>
<el-table-column prop="isPost" label="是否发货" min-width="60" :formatter="booleanMsgFun"></el-table-column>
<el-table-column prop="customerAddress" label="地址" min-width="220"></el-table-column>
<el-table-column prop="customerPhone" label="电话" min-width="85"></el-table-column>
<el-table-column prop="customerName" label="名称" min-width="60"></el-table-column>
<el-table-column prop="waybillNo" label="运单号" min-width="110"></el-table-column>
<el-table-column prop="carrier" label="承运人" min-width="60"></el-table-column>
<el-table-column prop="startPickTime" label="开始拣货时间" min-width="100"></el-table-column>
<el-table-column prop="postTime" label="发货时间" min-width="100"></el-table-column>
<el-table-column label="操作" min-width="60">
<template slot-scope="scope">
<el-button size="mini" @click.native="editOrderInvoice(scope.$index, scope.row)">发货</el-button>
<el-button
size="mini"
type="danger"
@click="updateOrderInvoice(scope.$index,scope.row)">拣货中</el-button>
</template>
</el-table-column>
</el-table> <!-- 分页 -->
<div class="page">
<el-pagination
:background="true"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page"
:page-sizes="[10, 20, 30, 40 , 50, 100]"
:page-size="rows"
layout="total, sizes, prev, pager, next, jumper"
:total="orderInvoiceList.total">
</el-pagination>
</div> <!-- 编辑dialog对象 -->
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" size="tiny">
<span slot="title" class="el-dialog__title">
{{'发货'}}
</span>
<el-form ref="dialogData" :model="dialogData" label-width="150px">
<!-- <el-form-item label="地址">
<el-input v-model="dialogData.customerAddress"></el-input>
</el-form-item>
<el-form-item label="电话" >
<el-input v-model="dialogData.customerPhone"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input v-model="dialogData.customerName"></el-input>
</el-form-item>-->
<el-form-item label="运单号">
<el-input v-model="dialogData.waybillNo"></el-input>
</el-form-item>
<el-form-item label="承运人">
<el-input v-model="dialogData.carrier"></el-input>
</el-form-item>
<!--<el-form-item label="开始拣货时间" >
<el-col :span="10">
<el-date-picker type="datetime" placeholder="选择时间" v-model="dialogData.startPickTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="发货时间" >
<el-col :span="10">
<el-date-picker type="datetime" placeholder="选择时间" v-model="dialogData.postTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="是否取消" label-width="150px">
<el-col :span="4">
<el-switch
v-model="canceled"
on-color="#13ce66"
on-text="是"
off-text="否"
off-color="#666666"
@change='changeIsCanceledStatus($event)'>
</el-switch>
</el-col>
</el-form-item>
<el-form-item label="费用是否结清" label-width="150px">
<el-col :span="4">
<el-switch
v-model="settled"
on-color="#13ce66"
on-text="是"
off-text="否"
off-color="#666666"
@change='changeIsSettledStatus($event)'>
</el-switch>
</el-col>
</el-form-item>
<el-form-item label="运费是否结清" label-width="150px">
<el-col :span="4">
<el-switch
v-model="settledFee"
on-color="#13ce66"
on-text="是"
off-text="否"
off-color="#666666"
@change='changeIsSettledFeeStatus($event)'>
</el-switch>
</el-col>
</el-form-item>
<el-form-item label="是否发货" label-width="150px">
<el-col :span="4">
<el-switch
v-model="post"
on-color="#13ce66"
on-text="是"
off-text="否"
off-color="#666666"
@change='changeIsPostStatus($event)'>
</el-switch>
</el-col>
</el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="editOrderInvoiceSubmit">保存并关闭</el-button>
<el-button @click.native="dialogVisible = false">取消</el-button>
</div>
</el-dialog> </div>
</div>
</template> <script>
import util from '../../common/js/util'
import NProgress from 'nprogress'
import http from '../../api/http' export default {
data(){
return{
page:1,
rows:10,
data:{
id:"",
name:"",
sts:null
},
// 弹出框的数据
dialogData:{
id:'',
/*customerAddress:'',
customerPhone:'',
customerName:'',*/
waybillNo:'',
carrier:'',
/* startPickTime:"",
postTime:"",
canceled:false,
settled:false,
settledFee:false,
post:false*/
},
multipleSelection:[],
orderInvoiceList:{},
/*canceled:false,
settled:false,
settledFee:false,
post:false,*/
dialogVisible: false
}
},
methods:{
loadOrderInvoiceList(){
let obj = {
page : this.page,
rows : this.rows,
name : this.data.name,
sts : this.data.sts
}
this.apiPost('/order/invoiceList',obj).then(res=>{
this.handelResponse(res, (data) => {
this.orderInvoiceList = data
})
})
},
handleSizeChange(val) {
this.rows = val
this.loadOrderInvoiceList();
},
handleCurrentChange(val) {
this.page = val;
this.loadOrderInvoiceList();
},
clearable(){
this.data.name = '';
this.data.sts = null;
this.loadOrderInvoiceList();
},
changeTable(val){
this.multipleSelection = val;
},
// 检索
select(){
this.loadOrderInvoiceList()
},
//清空按钮操作
emptyData(){
this.data.name = "";
this.data.sts = null;
this.select()
},
//布尔类型数据格式化显示
booleanMsgFun(row, column,value){
if(value){
return "是";
}else{
return "否";
}
},
//主要功能打开编辑页面,回显当前行信息,包括图片
editOrderInvoice(index,row) {
this.apiPost('/order/orderInvoice/'+row.id+'/get',{}).then((res) => {
this.handelResponse(res, (data) => {
this.dialogData=data
/*if(data.startPickTime){
this.dialogData.startPickTime=new Date(data.startPickTime);
}else{
this.dialogData.startPickTime=null;
}
if(data.postTime){
this.dialogData.postTime=new Date(data.postTime);
}else{
this.dialogData.postTime=null;
}
this.canceled=data.isCanceled;
this.settled=data.isSettled;
this.settledFee=data.isSettledFee;
this.post=data.isPost;*/
this.dialogVisible=true;
})
});
},
//发货单编辑页面的保存方法
editOrderInvoiceSubmit() {
/*this.dialogData.canceled=this.canceled;
this.dialogData.settled=this.settled;
this.dialogData.settledFee=this.settledFee;
this.dialogData.post=this.post;*/
this.apiPost('/order/orderInvoice/'+this.dialogData.id+'/updateIsPost',this.dialogData).then((res) => {
this.handelResponse(res, (data) => {
this.dialogVisible=false;
_g.toastMsg('success','提交成功');
this.loadOrderInvoiceList();
})
});
},
//清空表单的回显值问题
newData(){
this.dialogData.id="",
/*this.dialogData.customerAddress="",
this.dialogData.customerPhone="",
this.dialogData.customerName="",*/
this.dialogData.waybillNo="",
this.dialogData.carrier=""
/*this.dialogData.startPickTime=null,
this.dialogData.postTime=null,
this.dialogData.canceled=false,
this.dialogData.settled=false,
this.dialogData.settledFee=false,
this.dialogData.post=false*/
},
/*changeIsCanceledStatus($event){
this.canceled=$event;
},
changeIsSettledStatus($event){
this.settled=$event;
},
changeIsSettledFeeStatus($event){
this.settledFee=$event;
},
changeIsPostStatus($event){
this.post=$event;
}*/
//修改当前记录状态为拣货中
updateOrderInvoice(index,row) {
this.$confirm('确认修改当前选中记录状态为拣货中吗?', '提示', {
type: 'warning'
}).then(() => {
this.apiPost('/order/orderInvoice/'+row.id+'/updateStartPick',{}).then((res) => {
this.handelResponse(res, (data) => {
_g.toastMsg('success','修改成功');
this.loadOrderInvoiceList();
})
});
}).catch(() => {
});
},
//批量修改当前记录状态为拣货中
updateOrderInvoiceBatch(){
if(this.multipleSelection.length == 0){
this.$message.error('请至少选中一行数据');
return
}
let id = []
for(let i = 0;i < this.multipleSelection.length;i ++){
id[i] = this.multipleSelection[i].id
}
let obj = {
ids : id
}
console.log("aaabbb:"+JSON.stringify(obj));
this.$confirm('确认修改当前选中记录状态为拣货中吗?', '提示', {
type: 'warning'
}).then(() => {
this.apiPost('/order/orderInvoice/updateStartPickBatch',obj).then(res=>{
this.handelResponse(res, (data) => {
_g.toastMsg('success','修改成功');
this.loadOrderInvoiceList();
})
});
}).catch(() => {
});
},
},
mounted(){
this.loadOrderInvoiceList();
},
mixins: [http],
}
</script> <style lang="scss" scoped>
.userView{
.buttonTop{
padding: 6px 10px 0;
background: #545c64;
height: 56px;
overflow: hidden;
border-bottom: 1px solid rgb(255, 208, 75);
color: #fff;
}
.main{
padding: 0 15px;
.center{
margin-top: 10px;
margin-bottom: 20px;
}
}
.input{
float: left;
margin: 8px 0;
margin-right: 32px;
}
}
.page {
/* width: 600px; */
margin: 10px auto 10px;
}
</style>
记录一个简单的vue页面实现的更多相关文章
- 手把手教你从零写一个简单的 VUE
本系列是一个教程,下面贴下目录~1.手把手教你从零写一个简单的 VUE2.手把手教你从零写一个简单的 VUE--模板篇 今天给大家带来的是实现一个简单的类似 VUE 一样的前端框架,VUE 框架现在应 ...
- tkinter做一个简单的登陆页面
做一个简单的登陆页面 import tkinter wuya = tkinter.Tk() wuya.title("wuya") wuya.geometry("900x3 ...
- tkinter做一个简单的登陆页面(十六)
做一个简单的登陆页面 import tkinter wuya = tkinter.Tk() wuya.title("wuya") wuya.geometry("900x3 ...
- 搭建Vue.js环境,建立一个简单的Vue项目
基于vue-cli快速构建 Vue是近年来比较火的一个前端框架,所以搭建Vue.js环境,要装webpack,vue-cli,Vue 安装webpack命令如下 $ cnpm install webp ...
- 一个简单的 vue.js 实践教程
https://segmentfault.com/a/1190000006776243?utm_source=tuicool&utm_medium=referral 感觉需要改善的地方有: ( ...
- 实现一个简单的Vue插件
我们先看官方文档对插件的描述 插件通常会为 Vue 添加全局功能.插件的范围没有限制--一般有下面几种: 1.添加全局方法或者属性,如: vue-custom-element 2.添加全局资源:指令/ ...
- vue-cli3和element做一个简单的登陆页面
1.先用vue-cli3创建一个项目 2.安装element模块 全局安装 npm i element-ui -S 3在main.js引入模块 import ElementUI from 'eleme ...
- ASP.NET Aries 入门开发教程2:配置出一个简单的列表页面
前言: 朋友们都期待我稳定地工作,但创业公司若要躺下,也非意念可控. 若人生注定了风雨飘摇,那就雨中前行了. 最机开始看聊新的工作机会,欢迎推荐,创业公司也可! 同时,趁着自由时间,抓紧把这系列教程给 ...
- bootstrap 一个简单的登陆页面
效果如图:用bootstrap 写的一个简单的登陆 一.修改样式 样式可以自己调整,例如换个背景色之类的,修改 background-color属性就可以 #from { background-col ...
随机推荐
- 后缀自动机(SAM)速成手册!
正好写这个博客和我的某个别的需求重合了...我就来讲一讲SAM啦qwq 后缀自动机,也就是SAM,是一种极其有用的处理字符串的数据结构,可以用于处理几乎任何有关于子串的问题,但以学起来异常困难著称(在 ...
- flume修改配置文件
flume修改配置文件后,flume进程会自动将配置文件更新至服务中,同时会初始化日志,重新对于metrics进行记录的. 所以拿api做监控的同学要注意这点啦
- 探究 encode 和 decode 的使用问题(Python)
很多时候在写Python程序的时候都要在头部添加这样一行代码 #coding: utf-8 或者是这样 # -*- coding:utf-8 -*- 等等 这行代码的意思就是设定同一编码格式为utf- ...
- R语言编程艺术(3)R语言编程基础
本文对应<R语言编程艺术> 第7章:R语言编程结构: 第9章:面向对象的编程: 第13章:调试 ============================================== ...
- IT常用单词
recursion 递归enable 使能够two-dimensional 二维failover 故障恢复.转移.切换broker 经济人 代理人Component Gallery 组件库Config ...
- 解决apache上访问 cgi脚本时总是在网页中显示出脚本的源代码而不是执行结果的问题
apache是支持cgi脚本的,但是需要保证四个条件: 1.放置cgi脚本的文件夹本身需要对apache服务器这个用户(一般默认用户名是www,linux下的用户机制请自行百度)开放x(即可执行)权限 ...
- j.u.c系列(03)---之AQS:AQS简介
写在前面 Java的内置锁一直都是备受争议的,在JDK 1.6之前,synchronized这个重量级锁其性能一直都是较为低下,虽然在1.6后,进行大量的锁优化策略,但是与Lock相比synchron ...
- 并发编程(二):全视角解析volatile
一.目录 1.引入话题-发散思考 2.volatile深度解析 3.解决volatile原子性问题 4.volatile应用场景 二.引入话题-发散思考 public class T1 { /*vol ...
- 使用 IntraWeb (26) - 基本控件之 TIWMenu
TIWMenu 的任务是让原来的 TMainMenu 呈现在网页上, 通过其 AttachedMenu 属性关联一个 TMainMenu 是必需的. TIWMenu 所在单元及继承链: IWCompM ...
- 阿里云VPC默认网关问题
在使用VPC专用网络时,阿里云上面不用设置网关都可以工作,其实不是的,狗日的阿里云居然把默认网关设置成了253,比如设置了172.18.0.0/24时,那么它的默认网关就是172.18.0.253.