|
@@ -16,119 +16,194 @@
|
|
|
<script src="../../static/sa.js"></script>
|
|
|
</head>
|
|
|
<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.itemName"></sa-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
|
|
|
- <el-button style="display: inline;" type="info" icon="el-icon-refresh" @click="sa.f5()">重置
|
|
|
- </el-button>
|
|
|
- </el-form>
|
|
|
- <!-- ------------- 快捷按钮 ------------- -->
|
|
|
- <div class="fast-btn">
|
|
|
- <el-button type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button>
|
|
|
- </div>
|
|
|
- <!-- ------------- 数据列表 ------------- -->
|
|
|
- <el-table class="data-table" ref="data-table" :data="dataList">
|
|
|
- <sa-td name="合作伙伴" prop="pickCustomerName"></sa-td>
|
|
|
- <sa-td name="项目类型" prop="itemTypeName"></sa-td>
|
|
|
- <sa-td name="具体项目" prop="itemName"></sa-td>
|
|
|
- <sa-td name="计费标准" prop="unit">
|
|
|
- <template slot-scope="s">
|
|
|
- {{s.row.itemPrice}}{{s.row.unit}}
|
|
|
- </template>
|
|
|
- </sa-td>
|
|
|
+ <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.itemName"></sa-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
|
|
|
+ <el-button style="display: inline;" type="info" icon="el-icon-refresh" @click="sa.f5()">重置
|
|
|
+ </el-button>
|
|
|
+ </el-form>
|
|
|
+ <!-- ------------- 快捷按钮 ------------- -->
|
|
|
+ <div class="fast-btn">
|
|
|
+ <el-button type="warning" icon="el-icon-download" @click="exportFn()">导出</el-button>
|
|
|
+ <slot></slot>
|
|
|
+ </div>
|
|
|
+ <!-- ------------- 数据列表 ------------- -->
|
|
|
+ <el-table class="data-table" ref="data-table" :data="dataList">
|
|
|
+ <sa-td name="单号" prop="no" width="160"></sa-td>
|
|
|
+ <sa-td name="货物" prop="goodsName"></sa-td>
|
|
|
+ <sa-td name="越南车" prop="cardNo"></sa-td>
|
|
|
+ <sa-td name="中国车" prop="chinaCarNo"></sa-td>
|
|
|
+ <sa-td name="作业公司" prop="pickCustomerName"></sa-td>
|
|
|
+ <sa-td name="项目" prop="itemName"></sa-td>
|
|
|
+ <sa-td name="类型" prop="itemTypeName"></sa-td>
|
|
|
+ <sa-td name="计费标准" prop="unit">
|
|
|
+ <template slot-scope="s">
|
|
|
+ {{s.row.itemPrice}}{{s.row.unit}}
|
|
|
+ </template>
|
|
|
+ </sa-td>
|
|
|
<!-- <sa-td name="状态" prop="status" type="enum" :jv="{0: '未完成', 1: '已完成'}"></sa-td>
|
|
|
<sa-td name="作业时间" prop="operateTime"></sa-td> -->
|
|
|
- <sa-td name="创建时间" prop="createTime"></sa-td>
|
|
|
- <sa-td name="接单时间" prop="pickTime"></sa-td>
|
|
|
- <sa-td name="确认时间" prop="confirmTime"></sa-td>
|
|
|
- <el-table-column label="操作" fixed="right" width="100px">
|
|
|
- <template slot-scope="s">
|
|
|
- <el-button class="c-btn" type="primary" @click="pickFn(s.row)" v-if="s.row.pick == 1 && s.row.confirm == 0">确认</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- ------------- 分页 ------------- -->
|
|
|
- <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
|
|
|
- </sa-item>
|
|
|
- </div>
|
|
|
+ <sa-td name="创建时间" prop="createTime" width="160"></sa-td>
|
|
|
+ <sa-td name="接单时间" prop="pickTime" width="160"></sa-td>
|
|
|
+ <sa-td name="确认时间" prop="confirmTime" width="160"></sa-td>
|
|
|
+ <el-table-column label="操作" fixed="right" width="200px" v-if="currentCustomerId=='1'">
|
|
|
+ <template slot-scope="s">
|
|
|
+ <el-button v-if="s.row.pickTime&&!s.row.confirmTime" class="c-btn" type="success"
|
|
|
+ icon="el-icon-edit" @click="confirmFn(s.row)">确认
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- ------------- 分页 ------------- -->
|
|
|
+ <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
|
|
|
+ </sa-item>
|
|
|
</div>
|
|
|
- <script>
|
|
|
- var app = new Vue({
|
|
|
- components: {
|
|
|
- "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
|
|
|
- "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
|
|
|
+ <el-dialog title="提示" :visible.sync="confirm.visible" width="30%">
|
|
|
+ <span>是否进行接单确认?</span>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="confirm.visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="sureConfirm">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="提示" :visible.sync="emodel.visible" width="30%">
|
|
|
+ <span>日期范围:</span>
|
|
|
+ <el-form size="mini">
|
|
|
+ <div class="c-item">
|
|
|
+ <el-date-picker size="mini" v-model="dataTime" type="daterange" unlink-panels="false"
|
|
|
+ range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
|
|
|
+ format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="emodel.visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="sureExport">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ <script>
|
|
|
+ var app = new Vue({
|
|
|
+ components: {
|
|
|
+ "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
|
|
|
+ "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
|
|
|
+ },
|
|
|
+ el: '.vue-box',
|
|
|
+ data: {
|
|
|
+ p: { // 查询参数
|
|
|
+ id: '', // 主键
|
|
|
+ itemName: '', // 项目名称
|
|
|
+ pageNo: 1, // 当前页
|
|
|
+ pageSize: 10, // 页大小
|
|
|
+ sortType: 10 // 排序方式
|
|
|
},
|
|
|
- el: '.vue-box',
|
|
|
- data: {
|
|
|
- businessId: sa.p('businessId', 0),
|
|
|
- p: { // 查询参数
|
|
|
- id: '', // 主键
|
|
|
- itemName: '', // 项目名称
|
|
|
- pageNo: 1, // 当前页
|
|
|
- pageSize: 10, // 页大小
|
|
|
- sortType: 9 // 排序方式
|
|
|
- },
|
|
|
- dataCount: 0,
|
|
|
- dataList: [], // 数据集合
|
|
|
+ dataCount: 0,
|
|
|
+ dataList: [], // 数据集合
|
|
|
+ currentCustomerId: '1',
|
|
|
+ confirm: {
|
|
|
+ visible: false,
|
|
|
+ form: {
|
|
|
+ id: ''
|
|
|
+ }
|
|
|
},
|
|
|
- methods: {
|
|
|
- pickFn (data){
|
|
|
- sa.confirm('是否确认该业务项?', function() {
|
|
|
- sa.ajax('/TbBusinessItem/confirm',{id: data.id}, function(res){
|
|
|
- sa.ok('已确认');
|
|
|
- this.f5();
|
|
|
- }.bind(this));
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
- // 刷新
|
|
|
- f5: function() {
|
|
|
- sa.ajax('/TbBusiness/getById?id=' + this.businessId, sa.removeNull(this.p), function(res) {
|
|
|
- this.dataList = res.data.items; // 数据
|
|
|
- this.dataCount = res.dataCount; // 数据总数
|
|
|
- sa.f5TableHeight(); // 刷新表格高度
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
- // 查看
|
|
|
- get: function(data) {
|
|
|
- sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
|
|
|
- },
|
|
|
- // 查看 - 根据选中的
|
|
|
- getBySelect: function(data) {
|
|
|
- var selection = this.$refs['data-table'].selection;
|
|
|
- if (selection.length == 0) {
|
|
|
- return sa.msg('请选择一条数据')
|
|
|
- }
|
|
|
- this.get(selection[0]);
|
|
|
- },
|
|
|
- // 批量删除
|
|
|
- deleteByIds: function() {
|
|
|
- // 获取选中元素的id列表
|
|
|
- let selection = this.$refs['data-table'].selection;
|
|
|
- let ids = sa.getArrayField(selection, 'id');
|
|
|
- if (selection.length == 0) {
|
|
|
- return sa.msg('请至少选择一条数据')
|
|
|
+ emodel: {
|
|
|
+ visible: false,
|
|
|
+ form: {
|
|
|
+ beginTime: '',
|
|
|
+ endTime: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dataTime: [],
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ exportFn() {
|
|
|
+ Object.assign(this.emodel, {
|
|
|
+ visible: true,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sureExport() {
|
|
|
+ if (this.dataTime.length != 0) {
|
|
|
+ this.emodel.form.beginTime = this.dataTime[0];
|
|
|
+ this.emodel.form.endTime = this.dataTime[1];
|
|
|
+ } else{
|
|
|
+ sa.msg("请选择日期范围");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ sa.ajax('/TbBusinessItem/export/items', this.emodel.form, function(resp) {
|
|
|
+ window.open(resp.data);
|
|
|
+ this.emodel.visible = false;
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ confirmFn(data) {
|
|
|
+ Object.assign(this.confirm, {
|
|
|
+ visible: true,
|
|
|
+ form: {
|
|
|
+ id: data.id
|
|
|
}
|
|
|
- // 提交删除
|
|
|
- sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
|
|
|
- sa.ajax('/TbBusinessItem/deleteByIds', {
|
|
|
- ids: ids.join(',')
|
|
|
- }, function(res) {
|
|
|
- sa.arrayDelete(this.dataList, selection);
|
|
|
- sa.ok('删除成功');
|
|
|
- sa.f5TableHeight(); // 刷新表格高度
|
|
|
- }.bind(this))
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sureConfirm() {
|
|
|
+ sa.ajax('/TbBusinessItem/confirm', {
|
|
|
+ id: this.confirm.form.id
|
|
|
+ }, function(resp) {
|
|
|
+ this.confirm.visible = false;
|
|
|
+ this.f5();
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ getCustomer() {
|
|
|
+ sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
|
|
|
+ this.currentCustomerId = resp.data;
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ // 刷新
|
|
|
+ f5: function() {
|
|
|
+ sa.ajax('/TbBusinessItem/getList', sa.removeNull(this.p), function(res) {
|
|
|
+ this.dataList = res.data; // 数据
|
|
|
+ this.dataCount = res.dataCount; // 数据总数
|
|
|
+ sa.f5TableHeight(); // 刷新表格高度
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ // 查看
|
|
|
+ get: function(data) {
|
|
|
+ sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
|
|
|
+ },
|
|
|
+ // 查看 - 根据选中的
|
|
|
+ getBySelect: function(data) {
|
|
|
+ var selection = this.$refs['data-table'].selection;
|
|
|
+ if (selection.length == 0) {
|
|
|
+ return sa.msg('请选择一条数据')
|
|
|
+ }
|
|
|
+ this.get(selection[0]);
|
|
|
+ },
|
|
|
+ // 批量删除
|
|
|
+ deleteByIds: function() {
|
|
|
+ // 获取选中元素的id列表
|
|
|
+ let selection = this.$refs['data-table'].selection;
|
|
|
+ let ids = sa.getArrayField(selection, 'id');
|
|
|
+ if (selection.length == 0) {
|
|
|
+ return sa.msg('请至少选择一条数据')
|
|
|
+ }
|
|
|
+ // 提交删除
|
|
|
+ sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
|
|
|
+ sa.ajax('/TbBusinessItem/deleteByIds', {
|
|
|
+ ids: ids.join(',')
|
|
|
+ }, function(res) {
|
|
|
+ sa.arrayDelete(this.dataList, selection);
|
|
|
+ sa.ok('删除成功');
|
|
|
+ sa.f5TableHeight(); // 刷新表格高度
|
|
|
+ }.bind(this))
|
|
|
+ }.bind(this));
|
|
|
},
|
|
|
- created: function() {
|
|
|
- this.f5();
|
|
|
- sa.onInputEnter();
|
|
|
- }
|
|
|
- })
|
|
|
- </script>
|
|
|
+ },
|
|
|
+ created: function() {
|
|
|
+ this.getCustomer()
|
|
|
+ this.f5();
|
|
|
+ sa.onInputEnter();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ </script>
|
|
|
</body>
|
|
|
</html>
|