qzyReal 3 سال پیش
والد
کامیت
81d63997a8

+ 30 - 5
sp-admin/sa-frame/menu-list.js

@@ -339,7 +339,7 @@ var menuList = [{
 						isShow: false
 					},
 					{
-					
+
 						id: 'tb-business-car-bind',
 						name: '车辆绑定',
 						isShow: false
@@ -361,9 +361,35 @@ var menuList = [{
 		icon: 'el-icon-notebook-2',
 		parent: true,
 		childList: [{
+				id: 'tb-goods-list',
+				name: '业务项管理',
+				url: 'sa-view/tb-goods/tb-goods-list.html',
+				childList: [{
+						id: 'tb-goods-add',
+						name: '添加业务项',
+						isShow: false
+					},
+					{
+						id: 'tb-goods-edit',
+						name: '编辑业务项',
+						isShow: false
+					},
+					{
+						id: 'tb-goods-item-type',
+						name: '编辑收费项',
+						isShow: false
+					},
+					{
+						id: 'tb-goods-del',
+						name: '删除业务项',
+						isShow: false
+					},
+
+				]
+			}, {
 				id: 'tb-item-type-list',
 				name: '收费项管理',
-				url: 'sa-view/tb-goods/tb-goods-list.html',
+				url: 'sa-view/tb-item-type/tb-item-type-list.html',
 				childList: [{
 						id: 'tb-item-type-add',
 						name: '添加收费项',
@@ -413,8 +439,7 @@ var menuList = [{
 				id: 'tb-sort-group',
 				name: '其他业务设置',
 				url: 'sa-view/tb-sort-group/tb-sort-group-list.html',
-				childList: [
-					{
+				childList: [{
 						id: 'tb-sort-group-add',
 						name: '添加',
 						isShow: false
@@ -462,7 +487,7 @@ var menuList = [{
 					name: '修改记录',
 					isShow: false
 				},
-				
+
 				{
 
 					id: 'tb-business-car-del',

+ 2 - 2
sp-admin/sa-view/relation-goods-type/relation-goods-type-list.html

@@ -29,8 +29,8 @@
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<el-table-column type="index" width="50">
 					</el-table-column>
-					<sa-td name="业务名称" prop="goodsName"></sa-td>
-					<sa-td name="业务类型" prop="typeName"></sa-td>
+					<sa-td name="业务名称" prop="goodsName"></sa-td>
+					<sa-td name="收费项名称" prop="typeName"></sa-td>
 					<sa-td name="下拉必选" prop="needSelect" type="switch" :jv="{0: '可选[#e5e5e5]', 1: '必选[#005500]'}"
 						@change="s => updateNeedSelect(s.row)"></sa-td>
 					<el-table-column label="操作" fixed="right">

+ 11 - 3
sp-admin/sa-view/relation-goods-type/tb-item-type-select.html

@@ -31,7 +31,7 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td name="项名称" prop="name" ></sa-td>
+					<sa-td name="收费项名称" prop="name" ></sa-td>
 					<sa-td name="付款步骤" prop="payStep" type="enum" :jv="{1: '下单后', 2: '确认后'}"></sa-td>
 					<sa-td name="排序" prop="sort"></sa-td>
 					<el-table-column label="操作" fixed="right">
@@ -78,7 +78,7 @@
 							goodsId:this.goodsId,
 							typeIds: selection.map(obj => obj.id).join(',')
 						}
-						sa.ajax('/RelationGoodsType/add', obj, function(res) {
+						sa.ajax('/RelationGoodsType/saveBatch', obj, function(res) {
 							sa.alert('添加成功');
 							setTimeout(() => {
 								sa.closeCurrIframe(); // 关闭本页 
@@ -88,7 +88,15 @@
 					},
 					// 删除
 					selectOne: function(data) {
-						
+						let obj={
+							goodsId:this.goodsId,
+							typeId: data.id
+						}
+						sa.ajax('/RelationGoodsType/saveSingle', obj, function(res) {
+							sa.alert('添加成功');
+							this.ids=this.ids+','+data.id;
+							this.f5();
+						}.bind(this));
 					},
 					// 刷新
 					f5: function() {

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

@@ -24,7 +24,7 @@
 					<sa-item type="text" name="名称" v-model="p.name"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<el-button type="info" icon="el-icon-search" @click="p.name = ''; f5()">重置</el-button>
-					<el-button  size="mini" type="primary" @click="add()">增加</el-button>
+					<el-button v-if="sa.isAuth('tb-goods-add')" size="mini" type="primary" @click="add()">增加</el-button>
 					<br />
 				</el-form>
 			
@@ -44,11 +44,11 @@
 						<sa-td name="创建时间" prop="createTime"></sa-td>
 						<el-table-column label="操作" fixed="right" width="230">
 							<template slot-scope="s">
-								<el-button class="c-btn" type="primary" @click="businessFn(s.row)">收费类型
+								<el-button v-if="sa.isAuth('tb-goods-item-type')" class="c-btn" type="primary" @click="businessFn(s.row)">收费
 								</el-button>
-								<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+								<el-button v-if="sa.isAuth('tb-goods-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
 								</el-button>
-								<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
+								<el-button v-if="sa.isAuth('tb-goods-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
 								</el-button>
 							</template>
 						</el-table-column>

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_goods/TbGoods.java

@@ -33,6 +33,9 @@ public class TbGoods extends Model<TbGoods> implements Serializable {
 	 * 此模块对应的权限码 
 	 */
 	public static final String PERMISSION_CODE = "tb-goods";	
+	public static final String PERMISSION_CODE_ADD = "tb-goods-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-goods-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-goods-del";
 
 
 	// ---------- 表中字段 ----------

+ 7 - 4
sp-server/src/main/java/com/pj/project/tb_goods/TbGoodsController.java

@@ -31,8 +31,7 @@ public class TbGoodsController {
 
 	/** 增 */  
 	@RequestMapping("add")
-	@SaCheckPermission(TbItemType.PERMISSION_CODE)
-	@Transactional(rollbackFor = Exception.class)
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_ADD)
 	public AjaxJson add(TbGoods t){
 		t.setCreateTime(new Date());
 		tbGoodsService.save(t);
@@ -41,7 +40,7 @@ public class TbGoodsController {
 
 	/** 删 */  
 	@RequestMapping("delete")
-	@SaCheckPermission(TbItemType.PERMISSION_CODE)
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_DEL)
 	public AjaxJson delete(Long id){
 		tbGoodsService.removeById(id);
 		return AjaxJson.getSuccess();
@@ -51,7 +50,7 @@ public class TbGoodsController {
 	
 	/** 改 */  
 	@RequestMapping("update")
-	@SaCheckPermission(TbItemType.PERMISSION_CODE)
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
 	public AjaxJson update(TbGoods t){
 		tbGoodsService.update(t);
 		return AjaxJson.getSuccess();
@@ -87,6 +86,7 @@ public class TbGoodsController {
 
 	/** 改 - 载重是否必填(1=是,0=否) */
 	@RequestMapping("updateNeedWeight")
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
 	public AjaxJson updateNeedWeight(Long id, String value){
 		int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_weight", value, id);
 		return AjaxJson.getByLine(line);
@@ -94,6 +94,7 @@ public class TbGoodsController {
 
 	/** 改 - 规格是否必填(1=是,0=否) */
 	@RequestMapping("updateNeedCarSize")
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
 	public AjaxJson updateNeedCarSize(Long id, String value){
 		int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_car_size", value, id);
 		return AjaxJson.getByLine(line);
@@ -101,6 +102,7 @@ public class TbGoodsController {
 
 	/** 改 - 申报单是否必填(1=是,0=否) */
 	@RequestMapping("updateNeedDeclare")
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
 	public AjaxJson updateNeedDeclare(Long id, String value){
 		int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_declare", value, id);
 		return AjaxJson.getByLine(line);
@@ -108,6 +110,7 @@ public class TbGoodsController {
 
 	/** 改 - 申报时间是否必填(1=是,0=否) */
 	@RequestMapping("updateNeedOperateTime")
+	@SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
 	public AjaxJson updateNeedOperateTime(Long id, String value){
 		int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_operate_time", value, id);
 		return AjaxJson.getByLine(line);