Forráskód Böngészése

pc端确认业务单

lzm 3 éve
szülő
commit
15e4feee9b

+ 134 - 0
sp-admin/sa-view/tb-business/tb-business-item-list.html

@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>业务作业项-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<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>
+				<!-- 	<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>
+		</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: {
+					businessId: sa.p('businessId', 0),
+					p: { // 查询参数  
+						id: '', // 主键 
+						itemName: '', // 项目名称
+						pageNo: 1, // 当前页 
+						pageSize: 10, // 页大小 
+						sortType: 9 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+				},
+				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('请至少选择一条数据')
+						}
+						// 提交删除 
+						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>
+	</body>
+</html>

+ 4 - 0
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -77,6 +77,7 @@
 							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
 								&&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" @click="payFn(s.row)">
 								马上支付</el-button>
+							<el-button class="c-btn" type="primary" @click="itemFn(s.row)">业务项</el-button>
 							<el-button class="c-btn" type="primary" @click="carFn(s.row)">车辆管理
 							</el-button>
 							<el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
@@ -259,6 +260,9 @@
 					}
 				},
 				methods: {
+					itemFn(data) {
+						sa.showIframe('业务项', 'tb-business-item-list.html?businessId=' + data.id, '1050px', '95%');
+					},
 					carFn(data) {
 						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id+'&payStatus='+data.payStatus, '1050px', '95%');
 					},

+ 2 - 1
sp-admin/sa-view/tb-partner/tb-business-item-list.html

@@ -27,7 +27,7 @@
 					</el-button>
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
-
+				<sa-item type="fast-btn" show="export"></sa-item>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td name="项目类型" prop="itemTypeName"></sa-td>
@@ -41,6 +41,7 @@
 					<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="200px">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看

+ 0 - 1
sp-server/app.pid

@@ -1 +0,0 @@
-18200

+ 7 - 0
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemController.java

@@ -64,5 +64,12 @@ public class TbBusinessItemController {
         return AjaxJson.getPageData(so.getDataCount(), list);
     }
 
+    @RequestMapping("confirm")
+    public AjaxJson confirm() {
+        SoMap so = SoMap.getRequestSoMap();
+        tbBusinessItemService.confirm(so.getLong("id"));
+        return AjaxJson.getSuccess();
+    }
+
 
 }

+ 37 - 0
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemService.java

@@ -1,10 +1,21 @@
 package com.pj.project.tb_business_item;
 
+import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.api.wx.bo.MsgDataBO;
+import com.pj.api.wx.service.WxService;
+import com.pj.current.config.MyConfig;
+import com.pj.current.config.WxConfig;
+import com.pj.project.tb_business.TbBusiness;
+import com.pj.project.tb_business.TbBusinessService;
+import com.pj.project4sp.admin.SpAdmin;
+import com.pj.project4sp.admin.SpAdminService;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -12,6 +23,8 @@ import org.springframework.stereotype.Service;
 import com.pj.utils.sg.*;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
+
 /**
  * Service: tb_business_item -- 业务作业项
  * @author qzy 
@@ -23,6 +36,16 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper,TbBu
 	/** 底层 Mapper 对象 */
 	@Autowired
 	TbBusinessItemMapper tbBusinessItemMapper;
+	@Resource
+    TbBusinessService tbBusinessService;
+    @Resource
+    private SpAdminService spAdminService;
+    @Resource
+    private WxService wxService;
+    @Resource
+    private WxConfig wxConfig;
+    @Resource
+    private MyConfig myConfig;
 
 	/** 增 */
 	int add(TbBusinessItem t){
@@ -67,4 +90,18 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper,TbBu
 		ew.eq("item_type_name",itemTypeName);
 		return getOne(ew);
 	}
+
+    public void confirm(long id) {
+        TbBusinessItem tbBusinessItem = this.getById(id);
+        tbBusinessItem.setConfirm(1).setConfirmTime(new Date());
+        this.updateById(tbBusinessItem);
+        TbBusiness tbBusiness=tbBusinessService.getById(tbBusinessItem.getBusinessId());
+        //todo 通知作业方
+        List<SpAdmin> spAdminList = spAdminService.findByCustomerId(tbBusinessItem.getPickCustomerId());
+        MsgDataBO msgDataBO=new MsgDataBO("您有一条新的业务确认提醒",tbBusiness.getCustomerName(), DateUtil.now(),tbBusinessItem.getItemTypeName()+"("+tbBusinessItem.getItemName()+")");
+        spAdminList.stream().filter(admin -> StrUtil.isNotEmpty(admin.getOpenid())).forEach(admin -> {
+            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + id;
+            wxService.sendTemplateMsg(wxConfig.getBusinessPickTemplate(),admin.getOpenid(),msgDataBO,detailUrl);
+        });
+    }
 }