Explorar o código

1、质量安全修改接口的实现
2、质量安全修改页面前端的实现
3、检查项目选择页面实现在修改页面由于不同的质量或者安全类型,在选择页面也呈现不同内容功能
4、接口写入数据库的调试

shengxuefei %!s(int64=4) %!d(string=hai) anos
pai
achega
045175d705

+ 25 - 0
WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCore/BaseCore/SafeQualityCheckManager.cs

@@ -146,9 +146,34 @@ public class SafeQualityCheckManager : DbContext<SafeQualityCheck>
     public string UpdateSafeQualityCheck(SafeQualityCheck sc, List<SafeQualityCheckItem> si)
     {
         var checkCode = "";
+        var dictionaryNameCode = "";
         try
         {
             var manager = new UnitManager();
+            var entity = SafeQualityCheckDb.GetById(sc.CheckCode);
+            if (entity == null)
+            {
+                return "-1";   //不存在
+            }
+            if (entity.Status != 0)
+            {
+                return "-2";   //无权修改
+            }
+            if (entity.CheckType == "QualityCheck")
+            {
+                dictionaryNameCode = "10034";
+            }
+            else
+            {
+                dictionaryNameCode = "10035";
+            }
+            foreach (var item in si)
+            {
+                if (item.DictionaryNameCode != dictionaryNameCode)
+                {
+                    return "-3";   //所选检查选项与该选项类型不一致
+                }
+            }
             Db.BeginTran();
             checkCode = sc.CheckCode;
 

+ 22 - 6
WebAPIBase.NetCore/WebAPIBase.NetCore/Controllers/CommonController.cs

@@ -21,6 +21,7 @@ using System.Drawing;
 using Microsoft.AspNetCore.Http;
 using System.Linq.Expressions;
 
+
 namespace WebAPIBase.API.Controllers
 {
     [Produces("application/json;charset=UTF-8")]
@@ -262,25 +263,40 @@ namespace WebAPIBase.API.Controllers
         }
 
         /// <summary>
-        /// 获取质量安全检查项
+        ///  获取质量安全检查项
         /// </summary>
-        /// <param name="searchvalue">搜索条件</param>
+        /// <param name="type">0:质量检查 1:安全检查</param>
+        /// <param name="searchvalue"></param>
         /// <returns></returns>
         [HttpGet]
         [Route("GetQualityAndSafeItems")]
-        public ActionResult GetQualityAndSafeItems(string searchvalue = "")
+        public ActionResult GetQualityAndSafeItems(int type = -1, string searchvalue = "")
         {
+            Logger.Info($"【GetQualityAndSafeItems】type:{type},searchvalue:{searchvalue}");
             //10034:质量检查项目 10035:安全检查项目
             var manager = new DictionaryNameManager();
             List<DictionaryItem> list;
-            if (searchvalue.IsNullOrEmpty())
+            Expression<Func<DictionaryItem, bool>> lambda = m => true;
+            if (type == 0)
+            {
+                lambda = lambda.And(m => m.dnCode == "10034");
+            }
+            else if (type == 1)
             {
-                list = manager.GetDictionaryItems(m => m.dnCode == "10034" || m.dnCode == "10035");
+                lambda = lambda.And(m => m.dnCode == "10035");
             }
             else
             {
-                list = manager.GetDictionaryItems(m => (m.dnCode == "10034" || m.dnCode == "10035") && m.diName.Contains(searchvalue));
+                lambda = lambda.And(m => m.dnCode == "10034" || m.dnCode == "10035");
+            }
+            if (!searchvalue.IsNullOrEmpty())
+            {
+                lambda = lambda.And(m => m.diName.Contains(searchvalue));
             }
+
+
+            list = manager.GetDictionaryItems(lambda);
+
             return Json(list);
         }
     }

+ 17 - 1
WebAPIBase.NetCore/WebAPIBase.NetCore/Controllers/SafeQualityCheckController.cs

@@ -70,7 +70,7 @@ namespace WebAPIBase.API.Controllers
             return Json(data);
         }
         /// <summary>
-        /// 插入安全检查
+        /// 插入质量安全检查
         /// </summary>
         /// <param name="sc"></param>
         /// <param name="si"></param>
@@ -85,6 +85,22 @@ namespace WebAPIBase.API.Controllers
             var list = manager.InsertSafeQualityCheck(data.SafeQualityCheck, data.ItemList);
             return Json(list);
         }
+        /// <summary>
+        /// 更新质量安全检查
+        /// </summary>
+        /// <param name="sc"></param>
+        /// <param name="si"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("UpdateSafeQualityCheck")]
+        public ActionResult UpdateSafeQualityCheck([FromBody] PostData data)
+        {
+            logger.Info(JsonConvert.SerializeObject(data));
+            //return Json("");
+            var manager = new SafeQualityCheckManager();
+            var checkcode = manager.UpdateSafeQualityCheck(data.SafeQualityCheck, data.ItemList);
+            return Json(checkcode);
+        }
     }
 
     public class PostData

+ 18 - 1
uni-app-front/App.vue

@@ -24,7 +24,7 @@
 	};
 </script>
 
-<style>
+<style lang="scss">
 	/*全局样式*/
 	/* #ifndef APP-PLUS-NVUE */
 	@import './common/uni.css';
@@ -118,4 +118,21 @@
 		font-size: 20px;
 		font-weight: 600;
 	}
+	/* 底部导航 */
+	.tabBar{ width:100%;height: 98rpx;background: #fff;border-top:1px solid #E5E5E5;position: fixed;bottom:0px;left:0px;right:0px;display: flex;align-items: center;justify-content: center;
+			.tabBar_list{ width:98%;display: flex;justify-content: space-between;
+				image{ width:48rpx;height: 48rpx;margin-bottom:2rpx}
+				.tabBar_item{ width:25%;display: flex;justify-content: center;align-items: center;flex-direction: column;font-size: 20rpx;color: #969BA3;}
+				.tabBar_item2{
+					width:25%;height:100%;display: flex;justify-content: center;align-items: center;flex-direction: column;font-size: 20rpx;color: #969BA3;margin-top:-20rpx;position: relative;z-index: 101;
+					image{ width:68rpx;height: 68rpx;}
+				}
+			 } 
+		}
+		.border_box{
+			// pointer-events: none; 事件穿透解决z-index层级问题
+			width:100%;height: 100rpx;display: flex;justify-content: center;align-items: center;position: fixed;left:0px;bottom:50rpx;z-index: 100;pointer-events: none;
+			.tabBar_miden_border{   width:100rpx;height:50rpx;border-top:2rpx solid #E5E5E5;border-radius:50rpx 50rpx 0 0; /* 左上、右上、右下、左下 */background: #fff;}
+		}
+		.nav_active{color: #007AFF;}
 </style>

+ 10 - 2
uni-app-front/common/api/SafeQualityCheckApi.js

@@ -26,12 +26,20 @@ import request from '@/common/axiosHelper.js'
  	data:data
    })
  }
+ /*更新安全检查*/
+ export function UpdateSafeQualityCheck(data) {
+   return request({
+ 	url: '/SafeQualityCheck/UpdateSafeQualityCheck',
+ 	method: 'POST',
+ 	data:data
+   })
+ }
  
  /*获取质量安全检查项*/
- export function GetQualityAndSafeItems(searchvalue) {
+ export function GetQualityAndSafeItems(type,searchvalue) {
    return request({
  	url: '/Common/GetQualityAndSafeItems',
  	method: 'get',
- 	params:{searchvalue:searchvalue}
+ 	params:{type:type,searchvalue:searchvalue}
    })
  }

+ 9 - 0
uni-app-front/pages.json

@@ -284,6 +284,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/template/SafeQualityCheckEdit/SafeQualityCheckEdit",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "质量检查修改",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",

+ 57 - 1
uni-app-front/pages/index/index.vue

@@ -147,6 +147,23 @@
 
 
 		</view>
+		
+		<!-- 底部导航开始 /////////////////////////////////////////////////////////////-->
+		<!-- is_lhp判断是否为刘海屏在main.js里,好像uniapp有一个css变量获取刘海屏的安全区域 -->
+		<view class="tabBar" :style="{height:is_lhp?'140rpx':'98rpx'}">
+			<!-- 导航的中间圆圈 --> 
+			<view class="border_box" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view class="tabBar_miden_border"></view>
+			</view>
+			<view class="tabBar_list" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view v-for="(item) in tab_nav_list" :key="item.id" :class="{'tabBar_item':item.id!=2,'tabBar_item2':item.id==2}" @tap="cut_index(item.id)">
+					<image v-if="show_index == item.id"  :src="`/static/tabBar/${item.id+1}${item.id+1}.png`"></image>
+					<image v-else :src="`/static/tabBar/${item.id+1}.png`"></image>
+					<view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
+				</view>
+			</view>
+			</view>
+			<!-- 底部导航结束 /////////////////////////////////////////////////////////////-->
 	</view>
 </template>
 
@@ -174,7 +191,12 @@
 				pixelRatio: 1,
 				serverData: '',
 				itemCount: 30, //x轴单屏数据密度
-				sliderMax: 50
+				sliderMax: 50,
+				
+				/* 底部导航 */
+				show_index:0,//控制显示那个组件
+				tab_nav_list :[{'id':0,'name':'首页'},{'id':1,'name':'签证申请'},{'id':2,'name':'入库单'},{'id':3,'name':'领料单'},{'id':4,'name':'质量检查'}],//菜单列表
+				is_lhp:false,
 			}
 		},
 		onLoad() {
@@ -1123,6 +1145,40 @@
 				});
 			},
 			/* 图表end */
+			// 切换组件
+			cut_index(type){
+				console.log('----------------------------------',type)
+				let _this = this
+				_this.show_index = type
+				if(_this.show_index == 0){
+					 uni.navigateTo({
+					 	url:'/pages/index/index'
+					 })
+				}
+				else if(_this.show_index == 1){
+					 uni.navigateTo({
+					 	url:'/pages/template/requisitionlist/requisitionlist'
+					 })
+				}
+				else if(_this.show_index == 2){
+					 
+					 uni.navigateTo({
+					 	url:'/pages/template/GetMaterialIns/GetMaterialIns'
+					 })
+				}
+				else if (_this.show_index == 3) {
+					uni.navigateTo({
+						url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
+					})
+				            
+				}else if (_this.show_index == 4) {
+					uni.navigateTo({
+						url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
+					})
+				            
+				}
+				 
+			}
 		}
 
 	}

+ 68 - 2
uni-app-front/pages/template/GetMaterialIns/GetMaterialIns.vue

@@ -36,6 +36,24 @@
 			</router-link>
 		</view>
 		<uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
+		
+		<!-- 底部导航开始 /////////////////////////////////////////////////////////////-->
+		<!-- is_lhp判断是否为刘海屏在main.js里,好像uniapp有一个css变量获取刘海屏的安全区域 -->
+		<view class="tabBar" :style="{height:is_lhp?'140rpx':'98rpx'}">
+			<!-- 导航的中间圆圈 -->
+			<view class="border_box" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view class="tabBar_miden_border"></view>
+			</view>
+			<view class="tabBar_list" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view v-for="(item) in tab_nav_list" :key="item.id" :class="{'tabBar_item':item.id!=2,'tabBar_item2':item.id==2}"
+				 @tap="cut_index(item.id)">
+					<image v-if="show_index == item.id" :src="`/static/tabBar/${item.id+1}${item.id+1}.png`"></image>
+					<image v-else :src="`/static/tabBar/${item.id+1}.png`"></image>
+					<view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
+				</view>
+			</view>
+		</view>
+		<!-- 底部导航结束 /////////////////////////////////////////////////////////////-->
 	</view>
 </template>
 
@@ -59,7 +77,25 @@
 				last_id: '',
 				reload: false,
 				status: 'more',
-
+                /* 底部导航 */
+                show_index: 2, //控制显示那个组件
+                tab_nav_list: [{
+                	'id': 0,
+                	'name': '首页'
+                }, {
+                	'id': 1,
+                	'name': '签证申请'
+                }, {
+                	'id': 2,
+                	'name': '入库单'
+                }, {
+                	'id': 3,
+                	'name': '领料单'
+                }, {
+                	'id': 4,
+                	'name': '质量检查'
+                }], //菜单列表
+                is_lhp: false,
 				contentText: {
 					contentdown: '上拉加载更多',
 					contentrefresh: '加载中',
@@ -107,7 +143,37 @@
 					url: '/pages/template/GetMaterialIn/GetMaterialIn?id=' + id
 				});
 			},
-
+            // 切换组件
+            cut_index(type) {
+            	console.log('----------------------------------', type)
+            	let _this = this
+            	_this.show_index = type
+            	if (_this.show_index == 0) {
+            		uni.navigateTo({
+            			url: '/pages/index/index'
+            		})
+            	} else if (_this.show_index == 1) {
+            		uni.navigateTo({
+            			url: '/pages/template/requisitionlist/requisitionlist'
+            		})
+            	} else if (_this.show_index == 2) {
+            
+            		uni.navigateTo({
+            			url: '/pages/template/GetMaterialIns/GetMaterialIns'
+            		})  
+            	} else if (_this.show_index == 3) {
+            		uni.navigateTo({
+            			url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
+            		})
+            
+            	}else if (_this.show_index == 4) {
+            		uni.navigateTo({
+            			url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
+            		})
+            
+            	}
+            
+            }
 		}
 	};
 </script>

+ 68 - 2
uni-app-front/pages/template/GetMaterialOuts/GetMaterialOuts.vue

@@ -32,6 +32,24 @@
 		</uni-list>
 		
 		<uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
+		
+		<!-- 底部导航开始 /////////////////////////////////////////////////////////////-->
+		<!-- is_lhp判断是否为刘海屏在main.js里,好像uniapp有一个css变量获取刘海屏的安全区域 -->
+		<view class="tabBar" :style="{height:is_lhp?'140rpx':'98rpx'}">
+			<!-- 导航的中间圆圈 -->
+			<view class="border_box" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view class="tabBar_miden_border"></view>
+			</view>
+			<view class="tabBar_list" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view v-for="(item) in tab_nav_list" :key="item.id" :class="{'tabBar_item':item.id!=2,'tabBar_item2':item.id==2}"
+				 @tap="cut_index(item.id)">
+					<image v-if="show_index == item.id" :src="`/static/tabBar/${item.id+1}${item.id+1}.png`"></image>
+					<image v-else :src="`/static/tabBar/${item.id+1}.png`"></image>
+					<view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
+				</view>
+			</view>
+		</view>
+		<!-- 底部导航结束 /////////////////////////////////////////////////////////////-->
 	</view>
 </template>
 
@@ -55,7 +73,25 @@
 				last_id: '',
 				reload: false,
 				status: 'more',
-
+                /* 底部导航 */
+                show_index: 3, //控制显示那个组件
+                tab_nav_list: [{
+                	'id': 0,
+                	'name': '首页'
+                }, {
+                	'id': 1,
+                	'name': '签证申请'
+                }, {
+                	'id': 2,
+                	'name': '入库单'
+                }, {
+                	'id': 3,
+                	'name': '领料单'
+                }, {
+                	'id': 4,
+                	'name': '质量检查'
+                }], //菜单列表
+                is_lhp: false,
 				contentText: {
 					contentdown: '上拉加载更多',
 					contentrefresh: '加载中',
@@ -103,7 +139,37 @@
 					url: '/pages/template/GetMaterialOutDetail/GetMaterialOutDetail?id=' + id
 				});
 			},
-
+            // 切换组件
+            cut_index(type) {
+            	console.log('----------------------------------', type)
+            	let _this = this
+            	_this.show_index = type
+            	if (_this.show_index == 0) {
+            		uni.navigateTo({
+            			url: '/pages/index/index'
+            		})
+            	} else if (_this.show_index == 1) {
+            		uni.navigateTo({
+            			url: '/pages/template/requisitionlist/requisitionlist'
+            		})
+            	} else if (_this.show_index == 2) {
+            
+            		uni.navigateTo({
+            			url: '/pages/template/GetMaterialIns/GetMaterialIns'
+            		})
+            	} else if (_this.show_index == 3) {
+            		uni.navigateTo({
+            			url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
+            		})
+            
+            	}else if (_this.show_index == 4) {
+            		uni.navigateTo({
+            			url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
+            		})
+            
+            	}
+            
+            }
 		}
 	};
 </script>

+ 7 - 2
uni-app-front/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO.vue

@@ -96,7 +96,12 @@
 				GetSafeQualityCheckDTO(id).then((res) => {
 					console.info('GetSafeQualityCheckDTO',res);
 					
-					
+					if(res.entity.status==0){
+						that.isShow=true;
+					}
+					else{
+						that.isShow=true;
+					}
 					that.listData=res;
 					 
 					//console.info(that.listData);
@@ -106,7 +111,7 @@
 			 modify: function() { //跳转到修改页面
 			 	let id = this.$util.getQuery("id");
 			 	uni.navigateTo({
-			 		url: '/pages/template/SafeQualityCheckAdd/SafeQualityCheckAdd?id=' + id
+			 		url: '/pages/template/SafeQualityCheckEdit/SafeQualityCheckEdit?id=' + id
 			 	});
 			 }
 		}

+ 100 - 29
uni-app-front/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs.vue

@@ -4,7 +4,7 @@
 			<uni-search-bar :radius="100" @confirm="search" @input="input" @cancel="cancel"></uni-search-bar>
 		</view>
 		<uni-list>
-			<uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.checkCode)" clickable >
+			<uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.checkCode)" clickable>
 				<view slot="body" class="slot-box">
 					<view class="row">
 						<view class="column-left">编号:</view>
@@ -17,7 +17,7 @@
 					<view class="row">
 						<view class="column-left">日期:</view>
 						<view class="column-right">{{item.checkDateStr}}</view>
-					</view>					
+					</view>
 					<view class="row">
 						<view class="column-left">状态:</view>
 						<view class="column-right">{{item.statusName}}</view>
@@ -31,6 +31,26 @@
 			</router-link>
 		</view>
 		<uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
+
+
+		<!-- 底部导航开始 /////////////////////////////////////////////////////////////-->
+		<!-- is_lhp判断是否为刘海屏在main.js里,好像uniapp有一个css变量获取刘海屏的安全区域 -->
+		<view class="tabBar" :style="{height:is_lhp?'140rpx':'98rpx'}">
+			<!-- 导航的中间圆圈 -->
+			<view class="border_box" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view class="tabBar_miden_border"></view>
+			</view>
+			<view class="tabBar_list" :style="{paddingBottom:is_lhp?'40rpx':''}">
+				<view v-for="(item) in tab_nav_list" :key="item.id" :class="{'tabBar_item':item.id!=2,'tabBar_item2':item.id==2}"
+				 @tap="cut_index(item.id)">
+					<image v-if="show_index == item.id" :src="`/static/tabBar/${item.id+1}${item.id+1}.png`"></image>
+					<image v-else :src="`/static/tabBar/${item.id+1}.png`"></image>
+					<view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
+				</view>
+			</view>
+		</view>
+		<!-- 底部导航结束 /////////////////////////////////////////////////////////////-->
+
 	</view>
 </template>
 
@@ -39,7 +59,7 @@
 		GetSafeQualityCheckDTOs
 	} from "@/common/api/SafeQualityCheckApi.js";
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	 
+
 	export default {
 		components: {
 			uniLoadMore
@@ -47,11 +67,31 @@
 		data() {
 			return {
 				listData: [],
-				searchvalue:'',
+				searchvalue: '',
 				last_id: '',
 				reload: false,
 				status: 'more',
 
+				/* 底部导航 */
+				show_index: 4, //控制显示那个组件
+				tab_nav_list: [{
+					'id': 0,
+					'name': '首页'
+				}, {
+					'id': 1,
+					'name': '签证申请'
+				}, {
+					'id': 2,
+					'name': '入库单'
+				}, {
+					'id': 3,
+					'name': '领料单'
+				}, {
+					'id': 4,
+					'name': '质量检查'
+				}], //菜单列表
+				is_lhp: false,
+
 				contentText: {
 					contentdown: '上拉加载更多',
 					contentrefresh: '加载中',
@@ -63,15 +103,14 @@
 			console.info("当前登录状态:" + this.$store.state.isLogin);
 			//console.info(this);
 			this.$util.persistLogin(this);
-			let type=this.$util.getQuery("type")-0;
-			if(type==1){
+			let type = this.$util.getQuery("type") - 0;
+			if (type == 1) {
 				uni.setNavigationBarTitle({
-					title:'安全检查'
+					title: '安全检查'
 				});
-			}
-			else{
+			} else {
 				uni.setNavigationBarTitle({
-					title:'质量检查'
+					title: '质量检查'
 				});
 			}
 		},
@@ -91,12 +130,12 @@
 		methods: {
 			getList() {
 				let that = this;
-				let type = this.$util.getQuery("type")-0;				
+				let type = this.$util.getQuery("type") - 0;
 				let search = this.searchvalue;
-				
+
 				GetSafeQualityCheckDTOs(type, search).then((res) => {
 					console.info(res);
-					that.listData=[];
+					that.listData = [];
 					res.forEach(function(item, index, array) {
 						that.$set(that.listData, index, item);
 					});
@@ -104,27 +143,59 @@
 				});
 			},
 			goDetail: function(id) {
-				console.info('检查godetail',id);
-				uni.navigateTo({					
-					url: '/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO?type='+this.$util.getQuery("type")+'&id=' + id
+				console.info('检查godetail', id);
+				uni.navigateTo({
+					url: '/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO?type=' + this.$util.getQuery("type") +
+						'&id=' + id
 				});
 			},
-            search(res) { //回车搜索
-            	this.searchvalue = res.value; //赋值
-            	
-            	this.getList(); //调用搜索方法
-            },
-            input(res) {
-            	this.searchVal = res.value
-            },
-            cancel(res) {
-            	console.info('点击取消,输入值为:' + res.value);
-            	
-            }
+			search(res) { //回车搜索
+				this.searchvalue = res.value; //赋值
+
+				this.getList(); //调用搜索方法
+			},
+			input(res) {
+				this.searchVal = res.value
+			},
+			cancel(res) {
+				console.info('点击取消,输入值为:' + res.value);
+
+			},
+			// 切换组件
+			cut_index(type) {
+				console.log('----------------------------------', type)
+				let _this = this
+				_this.show_index = type
+				if (_this.show_index == 0) {
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				} else if (_this.show_index == 1) {
+					uni.navigateTo({
+						url: '/pages/template/requisitionlist/requisitionlist'
+					})
+				} else if (_this.show_index == 2) {
+
+					uni.navigateTo({
+						url: '/pages/template/GetMaterialIns/GetMaterialIns'
+					})
+				} else if (_this.show_index == 3) {
+            		uni.navigateTo({
+            			url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
+            		})
+            
+            	}else if (_this.show_index == 4) {
+            		uni.navigateTo({
+            			url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
+            		})
+            
+            	}
+
+			}
 		}
 	};
 </script>
 
 <style scoped>
-	
+
 </style>

+ 618 - 0
uni-app-front/pages/template/SafeQualityCheckEdit/SafeQualityCheckEdit.vue

@@ -0,0 +1,618 @@
+<template>
+	<view>
+		<uni-forms ref="form" labelPosition="left" labelAlign="left" @submit="submitForm">
+			<view class="uni-form-item uni-column">
+				<view class="title"><text class="uni-form-item__title">工程名称</text></view>
+				<view class="uni-input-wrapper">
+					<input class="uni-input" focus placeholder="请填写工程名称" v-model="projectName" />
+				</view>
+			</view>
+			
+			<view class="uni-form-item uni-column">
+				<view class="title"><text class="uni-form-item__title">检查日期</text></view>
+				<view class="uni-input-wrapper" style="justify-content: left;">
+					<picker mode="date"     @change="bindDateChange" v-model="checkDate"     style="width: 100%;">
+					 	<view class="uni-input">{{checkDate}}</view>
+					</picker>
+				</view>
+			</view>
+			
+			
+			<view class="uni-form-item uni-column">
+				<view class="title"  style="background-color: #efefef;"><text class="uni-form-item__title">上传文件</text></view>
+				<view class="content">
+				  <g-upfile ref='gUpfile' :mode="imgList" @chooseFile='chooseFile' @imgDelete='imgDelete' :control='control'
+				   :columnNum="columnNum" :maxCount="maxCount" @limitFileSizeList='limitFileSizeList' @limitFileTypeList='limitFileTypeList'  :maxFileSize="2000"></g-upfile>
+				</view>
+			</view>
+			
+			<uni-section :title="detailTitle"  type="line">
+				<button type="default" @click="getRelationItem" size="mini">选择检查项</button> 
+			</uni-section>
+			<uni-list>
+				<uni-list-item v-if="itemList"  v-for="(item, index) in itemList"  :key="index">
+					<view slot="body" class="slot-box">
+						<view class="row">
+							<view class="column-left">检查项目:</view>
+							<view class="column-right">{{item.checkContent}}</view>
+						</view>
+						
+						<view class="row">
+							<view class="column-left">检查结果:</view>
+							<view class="column-right"> 
+							    <textarea  focus  v-model="item.checkResult"  placeholder="请填写"  auto-height="true" style="width: 240px;text-align: left;" />
+							</view>
+						</view>
+						<view class="row">
+							<view class="column-left">操作:</view>
+							<view class="column-right"> 
+							   <i class="fa fa-window-close" aria-hidden="true"   @click="delRow(index)" style="font-size:20px;cursor: pointer;color: #999;margin-left:15px;" title="删除"></i>
+							</view>
+						</view>
+					</view>
+				</uni-list-item>
+			</uni-list>
+			 <view style="margin-bottom: 120px;">
+			 
+			 </view>
+			<view class="uni-btn-v uni-column">
+				<button type="primary" form-type="submit" style="border-radius: 15px;" >提交</button>
+			</view>
+			
+		</uni-forms>
+	</view>
+</template>
+
+<script>
+	import {GetSafeQualityCheckDTO,UpdateSafeQualityCheck} from "@/common/api/SafeQualityCheckApi.js";
+	import {Decimal} from 'decimal.js';     //decimal计算
+	 
+	export default {
+		
+		data() {
+			 
+			return {
+				projectName:'',
+				  
+				checkDate:this.$util.getDate({
+					format: true
+				}),
+				entity:{},      //主表对象 
+				itemList:[],    //检查明细
+				imageList: [],
+				checkType:0,    //核对质量安全检查项与主表的类型是否一致
+				detailTitle:'',
+				type:0,       //检查项目类型
+				 
+				countIndex: 5,
+				count: [1, 2, 3, 4, 5],
+				title1: 'picker',
+				array: [],
+				index: 0,
+				 
+				control: true,
+				columnNum: 3,
+				imgList: [],
+				urlList:[],
+				maxCount:5
+			
+			}
+		},
+		onLoad(){
+			//console.info(page.path);
+			  
+			//console.info(this);
+			this.$util.persistLogin(this);
+			//console.info(this.$store.state.user);
+			
+		},
+		onUnload() {
+			 
+		},
+		created: function() {
+			 
+			this.getList();
+			
+		},
+		updated:function(){
+			console.info('updated');
+			
+			 
+			
+			//this.auditType();
+		},
+		methods: {
+			
+			/**
+			 * 手动提交
+			 * @param {Object} form
+			 */
+			submitForm(e) {				
+				console.info('submitForm');
+				let _this=this;
+				if(this.projectName==='')
+				{
+					uni.showToast({
+						icon:"none",
+						title:"请填写工程名称",
+						duration:3000
+					});
+					return;
+				}
+				if(this.checkDate==='')
+				{
+					uni.showToast({
+						icon:"none",
+						title:"请选择检查日期",
+						duration:3000
+					});
+					return;
+				}
+				 
+				if(this.itemList.length<=0){
+					uni.showToast({
+						icon:"none",
+						title:"请选择质量安全检查项",
+						duration:3000
+					});
+					return;
+				}
+				 
+				let list=[];
+				let itemNames=[];
+				this.itemList.forEach(function(item,index,arr){ 
+					if(item.checkResult==null||item.checkResult==''){
+						itemNames.push(item.checkContent);
+						return;
+					}
+					list.push({checkContent:item.checkContent,checkResult:item.checkResult,dictionaryItemCode:item.dictionaryItemCode,dictionaryNameCode:item.dictionaryNameCode });
+					});
+					if(itemNames.length>0){
+						uni.showToast({
+							title:itemNames[0]+' 检查结果不能为空',
+							duration:3000,
+							icon:"none"
+						});
+						return;
+					}
+				//vise  viseCosts
+				var data1={checkCode:this.entity.checkCode,projectName:this.projectName,checkDate:this.checkDate };
+				  
+				var data={SafeQualityCheck:data1,ItemList:list};
+				console.info('data:',data); 
+				//return;
+				UpdateSafeQualityCheck(data).then((res)=>{
+					console.info("提交后的response",res);
+				 
+					if(res){
+						    if(res=="-1"){
+								uni.showToast({
+									title:'修改失败,记录不存在',
+									icon:'none',
+									duration:3000
+								});
+								return;
+							}
+							if(res=="-2"){
+								uni.showToast({
+									title:'非申请状态,不能修改',
+									icon:'none',
+									duration:3000
+								});
+								return;
+							}
+							if(res=="-3"){
+								uni.showToast({
+									title:'所选检查项目类型与工程所属项目类型不一致',
+									icon:'none',
+									duration:3000
+								});
+								return;
+							}
+							//上传图片
+							_this.uploadFileToServe(res) ; 
+						
+						uni.navigateTo({
+							url:'/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs'
+						})
+					}
+					else{
+						uni.showToast({
+							title:'添加失败,重新操作',
+							icon:'none',
+							duration:3000
+						})
+					}
+					
+				});
+			},
+			 /* 获取质量安全检查主表和明细表的信息*/
+			 getList(){
+				 let _this=this;
+				 let checkcode=_this.$util.getQuery("id");
+				 //console.info('getList',_this.$util.getQuery("id"));
+				 if(!checkcode){
+					 uni.showToast({
+					 	title:'参数错误',
+						icon:'none',
+						duration:3000
+					 });
+					 return;
+				 }
+				 GetSafeQualityCheckDTO(checkcode).then(res=>{
+					 console.info('GetSafeQualityCheckDTO',res);
+					 _this.projectName=res.entity.projectName;
+					 _this.checkDate=res.entity.checkDate.substring(0,10);
+					 _this.entity=res.entity;
+					 _this.itemList=res.list;
+					 let title='';
+					 if(_this.entity.checkType=='SafeCheck'){
+						 title='安全检查修改';
+						 _this.detailTitle='安全检查项目';
+						 _this.type=1;
+					 }
+					 else if(_this.entity.checkType=='QualityCheck'){
+						 title='质量检查修改';
+						 _this.detailTitle='质量检查项目';
+						 _this.type=0;
+					 }
+					 
+					 uni.setNavigationBarTitle({
+					 	title:title
+					 });
+					 
+				 });
+			 },
+			 auditType(){
+				 
+				 if(this.checkType==1){
+				 		console.info('jinru1');					  
+						 uni.showToast({
+							title:'此修改项是安全检查,不能选择质量检查项',
+							icon:'none',
+							duration:3000
+						 }); 
+						 console.info('jinru1结束');		
+						 //this.checkType=0;
+				 							  
+				 }
+				 else if(this.checkType==2){
+					 console.info('jinru2');						 
+					 uni.showToast({
+						title:'此修改项是质量检查,不能选择安全检查项',
+						icon:'none',
+						duration:3000
+					 });
+					 //this.checkType=0;
+				 }
+			 },
+			/*
+			获取关联项
+			*/
+			getRelationItem() {
+				let _this = this;				
+				_this.saveTemp(_this);
+				//console.info("getRelationItem", _this.$util.getQuery("id"));
+				let checkCode=_this.$util.getQuery("id");
+				//创建名字为fire的监听器,监听子页面传值事件
+				uni.$on('items', function(data) {
+					console.info("监听getRelationItem子页面的传值", data);
+					//console.info('监听',_this);
+					//return;
+					
+			         _this.getTemp(_this);					
+					 let itemList=_this.itemList;
+					 let result=[];
+				     if(data) {
+						 //console.info("转换id",_this.$util.getQuery("id"));
+						 //转换
+						 data.forEach(function(item,index,arr){
+							 result.push({checkCode:checkCode,checkContent:item.diName,checkResult:'',dictionaryItemCode:item.diCode,dictionaryNameCode:item.dnCode});
+						 });
+						 console.info("转换",result);
+						 //return;
+						 //let checkType=0;
+						 result.forEach(function(item,index,arr){
+							 item.remark='';
+							 let has=false;
+							 for(var i=0;i<itemList.length;i++){
+								 console.info('itemList[i].dictionaryItemCode',itemList[i].dictionaryItemCode);
+								 console.info('item.dictionaryItemCode',item.dictionaryItemCode);
+								 if(itemList[i].dictionaryItemCode==item.dictionaryItemCode){
+									 has=true;
+									 break;
+								 }
+							 }
+							 if(!has){
+								 if(_this.entity.checkType=='SafeCheck'){
+									 if(item.dictionaryNameCode!='10035'){
+									
+									 _this.checkType=1;
+									 _this.$nextTick(function(){
+									 	console.info(_this.checkType);
+									 });
+									 console.info('checkType',_this.checkType);
+									 return;
+									}
+								 }
+								 else{
+									 if(item.dictionaryNameCode!='10034'){
+										 
+										 _this.checkType=2;
+										 _this.$nextTick(function(){
+										 	console.info(_this.checkType);
+										 });
+										console.info('checkType',_this.checkType);
+										 return;
+									 }
+								 }
+								  _this.itemList.push(item);
+							 } 
+							
+						 });
+						 
+						 console.info("监听后的明细增加",_this.itemList);
+					 }
+					//接收一次监听,一旦监听到回传值,则清除监听事件,若不清除,会占用资源
+					uni.$off("items");
+				});
+				 
+				uni.navigateTo({
+					url: '/pages/template/SelectCheckProject/SelectCheckProject?type='+_this.type
+				});
+			},
+			
+			
+			delRow: function(index) {
+				console.info("删除");
+				console.info(this.itemList[index]);
+				this.itemList.splice(index, 1);
+			},
+			 
+			bindPickerChange: function(e) {
+				//console.log('picker发送选择改变,携带值为:' + e.detail.value);
+				//console.info(e.detail);
+				this.index = e.detail.value;
+				this.viseType=this.array[this.index];
+				console.info(this.viseType);
+			},
+			bindDateChange: function(e) {
+				let date = e.detail.value;
+				this.checkDate=date;
+				console.info('bindDateChange',this.checkDate);
+			},
+			 
+			 
+			/*
+			上传后返回的值:
+			list:上传后图片数组
+			v:返回当前上传图片的临时路径
+			*/
+			chooseFile(list, v) {
+				console.log("上传图片_list:", list)
+				console.log("上传图片_v:", v);
+				this.urlList=list;
+				console.info("urlList",this.urlList);
+				
+			},
+			
+			
+			/*
+			删除图片:
+			list:删除返回删除后剩余的图片数组
+			eq:返回删除的数组
+			*/
+			imgDelete(list, eq) {
+				console.log("删除图片_list:", list);
+				console.log("删除图片_eq:", eq);
+				this.urlList=list;
+				console.info("urlList",this.urlList);
+			},
+			/*限制文件大小列表*/
+			limitFileSizeList(list){
+				console.info('limitFileSizeList:',list);
+				if(list){
+					if(list.length>0){
+						uni.showModal({
+							title:'警告',
+							content: list.join()+' 文件大小超过2000KB',
+							showCancel:false
+						});
+					}
+				}
+			},
+			/*限制文件类型列表*/
+			limitFileTypeList(list,allowFileType){
+				console.info('limitFileTypeList:',list);
+				console.info('limitFileTypeList:',allowFileType);
+				if(list){
+					if(list.length>0){
+						uni.showModal({
+							title:'警告',
+							content: list.join()+' 文件类型必须是'+allowFileType.join(),
+							showCancel:false
+						});
+					}
+				}
+			},
+			/*
+			执行上传服务:
+			urlList:要上传的图片:数组类型
+			*/
+			uploadFileToServe(code) {
+				console.info('uploadFileToServe',code)
+				let _this=this;
+				var urlList=_this.urlList;
+				if (!urlList || urlList.length <= 0) {
+					return;
+				};
+				//console.info(urlList);
+			    
+			      
+					 for (let i = 0; i < urlList.length; i++) {
+					 			
+					 	uni.uploadFile({
+					 		url: '/api/Common/UploadImage', 
+					 		filePath: urlList[i],
+					 		name: 'file',
+					 		formData: {
+					 			createPerson:_this.$store.state.user.userCode,
+					 			masterCode:code,
+					 			attachMentType:_this.entity.checkType
+					 		},
+					 		headers: {
+					 			'Content-Type': 'multipart/form-data; boundary = ' + new Date().getTime()
+					 			//这里要把content-type设置为multipard/form-data,同时还要设置boundary
+					 		},
+					 		success: (uploadFileRes) => {
+					 			console.log("图片上传:",uploadFileRes.data);
+					 		}
+					 	});
+					 }
+				 
+				//return;
+				
+			},
+		
+		   saveTemp(_this){  //临时存
+				uni.setStorage({
+					key:'projectName',
+					data:_this.projectName
+				});
+				uni.setStorage({
+					key:'checkDate',
+					data:_this.checkDate
+				});
+			   uni.setStorage({
+				key:'itemList',
+				data:_this.itemList
+			   });
+		   
+		   },
+		   getTemp(_this){   //获取缓存,重新给表单赋值
+		   	_this.projectName=uni.getStorageSync('projectName');
+		   	_this.checkDate=uni.getStorageSync('checkDate');
+		    _this.itemList=uni.getStorageSync('itemList');
+		   
+		   } 
+		}
+	}
+</script>
+
+<style scoped>
+	/* 头条小程序组件内不能引入字体 */
+	/* #ifdef MP-TOUTIAO */
+	@font-face {
+		font-family: uniicons;
+		font-weight: normal;
+		font-style: normal;
+		src: url("~@/static/uni.ttf") format("truetype");
+	}
+
+	/* #endif */
+	 
+	page {
+		display: flex;
+		flex-direction: column;
+		box-sizing: border-box;
+		background-color: #efeff4;
+		min-height: 100%;
+		height: auto;
+	}
+
+	view {
+		font-size: 14px;
+		line-height: inherit;
+	}
+
+	.uni-form-item__title {
+	    font-size: 16px;
+	    line-height: 24px;
+	}
+	
+	.uni-input-wrapper {
+	    /* #ifndef APP-NVUE */
+	    display: flex;
+	    /* #endif */
+	    padding: 8px 13px;
+	    flex-direction: row;
+	    flex-wrap: nowrap;
+	    background-color: #FFFFFF;
+	}
+	.title{
+		background-color: #efefef;
+	}
+	.uni-input {
+	    height: 28px;
+	    line-height: 28px;
+	    font-size: 15px;
+	    padding: 0px;
+	    flex: 1;
+	    background-color: #FFFFFF;
+	}
+	
+	.uni-icon {
+	    font-family: uniicons;
+	    font-size: 24px;
+	    font-weight: normal;
+	    font-style: normal;
+	    width: 24px;
+	    height: 24px;
+	    line-height: 24px;
+		margin-left:15px;
+	    color: #999999;
+	}
+	
+	.uni-eye-active {
+	    color: #007AFF;
+	}
+	.uni-btn-v{
+		position: fixed;
+		bottom: 0;
+		width:100%;
+		
+	}
+	.header-slot-box {
+		font-size:15px;
+		margin: 5px 5px;
+		width:20%;
+		justify-content: center;
+	}
+	.body-slot-box {
+		font-size:15px;
+		margin: 5px 5px;
+		width:40%;
+		justify-content: center;
+	}
+	.footer-slot-box {
+		font-size:15px;
+		margin: 5px 5px;
+		width:40%;
+		justify-content: center;
+	}
+	.uni-textarea textarea{
+		font-size:15px;
+	}
+	.content {
+		padding: 40rpx;
+		background-color: #fff;
+	}
+	
+	/* 上传控件 */
+	.uploadControl {
+		border: 1rpx solid #eee;
+		border-radius: 10rpx;
+		width: 130rpx;
+		display: block;
+		height: 130rpx;
+		text-align: center;
+		line-height: 130rpx;
+		font-size: 30rpx;
+		color: #888;
+		background-color: #eeeeee;
+	}
+	 
+	 .topicon >>> .icon{
+	        border: #4CD964 2upx solid;
+	    }
+</style>

+ 7 - 2
uni-app-front/pages/template/SelectCheckProject/SelectCheckProject.vue

@@ -59,13 +59,18 @@
 		methods: {
 			getItems: function() {
 				var that = this;
-				 
+				 let type=-1;
 				let searchVal=that.searchVal;
+				if(that.$util.getQuery("type")!=undefined&&that.$util.getQuery("type")!=""){
+					type=that.$util.getQuery("type");
+				}
 				uni.showLoading({
 					title: "页面努力加载中,请稍候...",
 					mask: true
 				});
-				GetQualityAndSafeItems(searchVal).then((res) => {
+				console.info('getitems type:',type);
+				console.info('getitems searchVal:',searchVal);
+				GetQualityAndSafeItems(type,searchVal).then((res) => {
 					uni.hideLoading();
 					console.info('GetQualityAndSafeItems',res);
 					//console.info(projectCode);