|
@@ -18,7 +18,6 @@
|
|
|
<body>
|
|
|
<div class="vue-box" style="display: none;" :style="'display: block;'">
|
|
|
<div class="c-panel">
|
|
|
- <div class="c-title">检索参数</div>
|
|
|
<el-form ref="form" :model='p' @submit.native.prevent>
|
|
|
<sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>
|
|
|
<div class="c-item">
|
|
@@ -40,9 +39,10 @@
|
|
|
<div class="c-item" style="width: 120px;">
|
|
|
<label class="c-label">车辆颜色:</label>
|
|
|
<el-select v-model="p.color" placeholder="请选择">
|
|
|
- <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=""> </el-option>
|
|
|
+ <el-option v-for="(item,index) in colorList" :key="index" :label="item.carNoColor"
|
|
|
+ :value="item.carNoColor"> </el-option>
|
|
|
+
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</el-form>
|
|
@@ -60,10 +60,18 @@
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
|
|
|
- <el-button size="mini" type="primary" @click="exportFn">导出</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="exportFn" v-if="sa.isAuth('tb-business-car-export')">导出</el-button>
|
|
|
<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
|
|
|
- <el-button size="mini" type="primary" @click="add()">
|
|
|
+ <el-button size="mini" type="primary" @click="add()" v-if="sa.isAuth('tb-business-car-add')">
|
|
|
新增</el-button>
|
|
|
+ <br/>
|
|
|
+ <sa-item name="综合排序">
|
|
|
+ <el-radio-group v-model="p.sortType" class="s-radio-text">
|
|
|
+ <el-radio :label="10">默认</el-radio>
|
|
|
+ <el-radio :label="6">入场时间</el-radio>
|
|
|
+ <el-radio :label="7">离场时间</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </sa-item>
|
|
|
</el-form>
|
|
|
<!-- ------------- 数据列表 ------------- -->
|
|
|
<el-table class="data-table" ref="data-table" :data="dataList">
|
|
@@ -96,9 +104,10 @@
|
|
|
<template slot-scope="s">
|
|
|
<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
|
|
|
</el-button>
|
|
|
- <el-button v-if="sa.isAuth('tb-business-edit')" class="c-btn" type="primary"
|
|
|
+ <el-button v-if="sa.isAuth('tb-business-car-edit')" class="c-btn" type="primary"
|
|
|
icon="el-icon-edit" @click="update(s.row)">修改
|
|
|
</el-button>
|
|
|
+ <el-button v-if="sa.isAuth('tb-business-car-del')&&s.row.money==0" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -120,6 +129,7 @@
|
|
|
p: { // 查询参数
|
|
|
id: '', //
|
|
|
businessId: sa.p('id', ''), //
|
|
|
+ color: '',
|
|
|
carNo: '', //
|
|
|
leave: '1',
|
|
|
pay: '',
|
|
@@ -131,8 +141,18 @@
|
|
|
},
|
|
|
dataCount: 0,
|
|
|
dataList: [], // 数据集合
|
|
|
+ colorList: []
|
|
|
},
|
|
|
methods: {
|
|
|
+ getCarColor() {
|
|
|
+ sa.ajax('/TbCarNoColor/getList', {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ status: 1
|
|
|
+ }, function(resp) {
|
|
|
+ this.colorList = resp.data;
|
|
|
+ }.bind(this))
|
|
|
+ },
|
|
|
exportFn() {
|
|
|
this.$confirm('确定导出符合条件的数据?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
@@ -187,36 +207,18 @@
|
|
|
// 删除
|
|
|
del: function(data) {
|
|
|
sa.confirm('是否删除,此操作不可撤销', function() {
|
|
|
- sa.ajax('/TbBusinessCar/delete?id=' + data.id, function(res) {
|
|
|
+ sa.ajax('/TbBusinessCar/deleteRecord?id=' + data.id, function(res) {
|
|
|
sa.arrayDelete(this.dataList, data);
|
|
|
sa.ok('删除成功');
|
|
|
sa.f5TableHeight(); // 刷新表格高度
|
|
|
}.bind(this))
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- // 改 - 状态(0=否,1=是)
|
|
|
- updateStatus: function(data) {
|
|
|
- // 声明变量记录是否成功
|
|
|
- var isOk = false;
|
|
|
- var oldValue = data.isLock;
|
|
|
- var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
|
|
|
- id: data.id,
|
|
|
- value: data.isLock
|
|
|
- }, function(res) {
|
|
|
- isOk = true;
|
|
|
- sa.msg('修改成功');
|
|
|
- }.bind(this));
|
|
|
- // 如果未能修改成功, 则回滚
|
|
|
- $.when(ajax).done(function() {
|
|
|
- if (isOk == false) {
|
|
|
- data.isLock = oldValue;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
},
|
|
|
created: function() {
|
|
|
this.f5();
|
|
|
sa.onInputEnter();
|
|
|
+ this.getCarColor();
|
|
|
}
|
|
|
})
|
|
|
</script>
|