Browse Source

2、浩德项目申请单修改,删除,提交,通过,退回功能的实现
3、浩德项目以管理员身份查看供应商提交的申请列表及明细页面实现

shengxuefei 3 years ago
parent
commit
47414f5ee0

+ 2 - 0
.gitignore

@@ -14,3 +14,5 @@
 /WebAPIBase.NetCore/WebAPIBase.NetCore.Enties/bin
 /WebAPIBase.NetCore/WebAPIBase.NetCore.Enties/obj
 /uni-app-front/unpackage
+/WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/obj
+/WebAPIBase.NetCore/WebAPIBase.NetCore.BusinessCoreTests/bin

+ 391 - 0
WebAPIBase.NetCore/WebAPIBase.NetCore/Controllers/SupplierApplyController.cs

@@ -0,0 +1,391 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Caching.Memory;
+using Microsoft.Extensions.Configuration;
+using Newtonsoft.Json;
+using NLog;
+using Sugar.Enties;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net.Http;
+using WebAPIBase.Utils;
+
+namespace WebAPIBase.API.Controllers
+{
+    /// <summary>
+    /// 供应商申请相关
+    /// </summary>
+    [Produces("application/json;charset=UTF-8")]
+    [Route("api/SupplierApply")]
+    [ServiceFilter(typeof(Filter.TokenAuthorize))]
+    public class SupplierApplyController : Controller
+    {
+        private static Logger logger = NLog.LogManager.GetCurrentClassLogger();
+        #region 供应商扩展信息
+        /// <summary>
+        /// 根据供应商编码获取供应商扩展信息
+        /// </summary>
+        /// <param name="supplierCode">供应商编号</param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("GetzzSupplierExList")]
+        public JsonResult GetzzSupplierExList(string supplierCode)
+        {
+
+            if (supplierCode.IsNullOrEmpty())
+            {
+
+                return Json("-1");
+            }
+            try
+            {
+                var service = new zzSupplierExManager();
+                var list = service.GetzzSupplierExDTOList(supplierCode);
+
+                return Json(list);
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json("-2");
+            }
+        }
+
+        /// <summary>
+        /// 根据项目获取供应商申请的信息
+        /// </summary>
+        /// <param name="projectCode"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("GetzzSupplierExListByProject")]
+        public JsonResult GetzzSupplierExListByProject(string projectCode)
+        {
+
+            if (projectCode.IsNullOrEmpty())
+            {
+                return Json("参数错误");
+            }
+            try
+            {
+                var service = new zzSupplierExManager();
+                var list = service.GetzzSupplierExListByProject(projectCode);
+
+                return Json(list);
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+        }
+
+        /// <summary>
+        /// 获取供应商扩展实例信息
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("GetzzSupplierEx")]
+        public JsonResult GetzzSupplierEx(int id)
+        {
+
+            if (id.IsNullOrEmpty())
+            {
+                return Json("参数错误");
+            }
+            try
+            {
+                var bll = new RequisitionManager();
+                var service = new zzSupplierExManager();
+                var entity = service.GetzzSupplierExDTO(id);
+                var attachments = bll.GetAttachMents(id.ToString(), "zzSupplierExAttach");
+                var data = new
+                {
+                    entity = entity,
+                    attachments = attachments
+                };
+
+                return Json(data);
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+        }
+
+        /// <summary>
+        /// 供应商扩展信息添加
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("InsertzzSupplierEx")]
+        public JsonResult InsertzzSupplierEx([FromBody] zzSupplierEx dto)
+        {
+            logger.Info($"【InsertzzSupplierEx】dto:{JsonConvert.SerializeObject(dto)}");
+
+            if (dto.Title.IsNullOrEmpty())
+            {
+
+                return Json("标题不能为空");
+            }
+            if (dto.Title.Length > 200)
+            {
+                return Json("标题不能超过200字");
+            }
+            if (dto.Reason.IsNullOrEmpty())
+            {
+
+                return Json("原因不能为空");
+            }
+            if (dto.Reason.Length > 500)
+            {
+
+                return Json("原因不能超过500字");
+            }
+            try
+            {
+                dto.CheckDate = null;
+                dto.CheckPerson = "";
+                var service = new zzSupplierExManager();
+                var id = service.Db.Insertable(dto).ExecuteReturnIdentity();
+                if (id > 0)
+                {
+
+                    return Json(id);
+                }
+                else
+                {
+
+                    return Json("插入失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+
+                return Json(ex.Message);
+            }
+
+        }
+        /// <summary>
+        /// 更新供应商申请
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("UpdatezzSupplierEx")]
+        public JsonResult UpdatezzSupplierEx([FromBody] zzSupplierEx dto)
+        {
+            logger.Info($"【UpdatezzSupplierEx】dto:{JsonConvert.SerializeObject(dto)}");
+            if (dto.ID.IsNullOrEmpty())
+            {
+                return Json("参数错误,不能审核");
+            }
+            if (dto.Title.IsNullOrEmpty())
+            {
+
+                return Json("标题不能为空");
+            }
+            if (dto.Title.Length > 200)
+            {
+                return Json("标题不能超过200字");
+            }
+            if (dto.Reason.IsNullOrEmpty())
+            {
+
+                return Json("原因不能为空");
+            }
+            if (dto.Reason.Length > 500)
+            {
+
+                return Json("原因不能超过500字");
+            }
+            try
+            {
+                var service = new zzSupplierExManager();
+                dto.CheckDate = DateTime.Now;
+                var row = service.Db.Updateable(dto).ExecuteCommand();
+                if (row > 0)
+                {
+                    return Json("success");
+                }
+                else
+                {
+
+                    return Json("更新失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+
+        }
+        /// <summary>
+        /// 管理员审核供应商提交的信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("AuditzzSupplierEx")]
+        public JsonResult AuditzzSupplierEx([FromBody] zzSupplierEx dto)
+        {
+            logger.Info($"【AuditzzSupplierEx】dto:{JsonConvert.SerializeObject(dto)}");
+            if (dto.ID.IsNullOrEmpty()||dto.ProjectCode.IsNullOrEmpty())
+            {
+                return Json("参数错误或无权限,不能审核");
+            }
+
+            try
+            {
+                var service = new zzSupplierExManager();
+                var model = service.GetById(dto.ID);
+                if(model.ProjectCode!=dto.ProjectCode)
+                {
+                    return Json("无权限操作");
+                }
+                if(model.State!=1)
+                {
+                    return Json("非审核中状态,不能操作");
+                }
+                var success = service.AuditzzSupplierEx(dto);
+                if (success)
+                {
+                    return Json("success");
+                }
+                else
+                {
+
+                    return Json("审核失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+
+        }
+
+        /// <summary>
+        /// 提交供应商申请信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("SubmitzzSupplierEx")]
+        public JsonResult SubmitzzSupplierEx([FromBody] zzSupplierEx dto)
+        {
+            logger.Info($"【SubmitzzSupplierEx】dto:{JsonConvert.SerializeObject(dto)}");
+            if (dto.ID.IsNullOrEmpty() || dto.SupplierCode.IsNullOrEmpty())
+            {
+                return Json("参数错误或无权限,不能审核");
+            }
+
+            try
+            {
+                var service = new zzSupplierExManager();
+                var model = service.GetById(dto.ID);
+                if (model.SupplierCode != dto.SupplierCode)
+                {
+                    return Json("无权限操作");
+                }
+                if (model.State != 0)
+                {
+                    return Json("非待审核状态,不能操作");
+                }
+                var success = service.SubmitzzSupplierEx(dto);
+                if (success)
+                {
+                    return Json("success");
+                }
+                else
+                {
+
+                    return Json("提交失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+
+        }
+
+        /// <summary>
+        /// 删除供应商扩展信息
+        /// </summary>
+        /// <param name="suppliercode"></param>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("DeletezzSupplierEx")]
+        public JsonResult DeletezzSupplierEx(string suppliercode, int id)
+        {
+
+            if (suppliercode.IsNullOrEmpty())
+            {
+                return Json("参数错误,不能删除");
+            }
+            if (id <= 0)
+            {
+                return Json("参数错误,不能删除");
+            }
+
+            try
+            {
+                var service = new zzSupplierExManager();
+                var success = service.Delete(m => m.SupplierCode == suppliercode && m.ID == id);
+                if (success)
+                {
+
+                    return Json("success");
+
+                }
+                else
+                {
+
+                    return Json("删除失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.Error(ex);
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+
+        }
+        /// <summary>
+        /// 根据供应商编号获取其对应所有项目
+        /// </summary>
+        /// <param name="supplierCode"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("GetProjectBySupplierCode")]
+        public JsonResult GetProjectBySupplierCode(string supplierCode)
+        {
+
+            if (supplierCode.IsNullOrEmpty())
+            {
+                return Json("请输入供应商编号");
+            }
+            try
+            {
+                var service = new zzSupplierExManager();
+                var list = service.GetProjectBySupplierCode(supplierCode);
+                logger.Info($"【GetProjectBySupplierCode】list:" + JsonConvert.SerializeObject(list));
+                return Json(list);
+            }
+            catch (Exception ex)
+            {
+                return Json(ex.Message + "\r\n" + ex.StackTrace);
+            }
+        }
+        #endregion
+    }
+}

+ 461 - 0
uni-app-front/pages/template/UpdatezzSupplierEx/UpdatezzSupplierEx.vue

@@ -0,0 +1,461 @@
+<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="title" />
+					
+				</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="selector" :value="index" :range="array" range-key="projectName" @change="bindPickerChange" v-model="projectCode" 	  style="width: 100%;">
+						<view class="uni-input">{{array.length>0?array[index].projectName:''}}</view>
+					</picker>
+				</view>
+			</view>
+
+
+			<view class="uni-form-item uni-column">
+				<view class="title"><text class="uni-form-item__title">原因</text></view>
+				<view class="uni-textarea">
+					<textarea focus placeholder="请输入原因" v-model="reason" auto-height="true"  />
+					</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="20000"></g-upfile>
+				</view>
+			</view>
+			
+		
+			<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 permision from "@/common/permission.js";
+	import {UpdatezzSupplierEx,GetProjectBySupplierCode,GetzzSupplierEx} from "@/common/api/requisitionApi.js";
+	
+	import {Decimal} from 'decimal.js';     //decimal计算
+		 
+	
+	export default {
+		data() {
+			return {
+				needFormCach:false,    //是否需要表单缓存
+				title:'',
+				projectCode:'',
+				requisitionType:0,
+				reason:'',				
+				supplierCode:this.$store.state.user.supplierCode,	        //用户编号
+			    entity:{},
+				attachments:[],
+				
+				
+				
+				imageList: [],
+				
+				countIndex: 5,
+				count: [1, 2, 3, 4, 5],
+				
+				array: [],
+				index: 0,
+				date: this.$util.getDate({
+					format: true
+				}),
+				startDate:this.$util.getDate('start'),
+				endDate:this.$util.getDate('end'),
+				
+				control: true,
+				columnNum: 3,
+				imgList: [],
+				urlList:[],
+				maxCount:5
+			
+			}
+		},
+		onLoad(){
+			console.info('onLoad');
+			console.info(uni.getStorageSync('storage_state'));
+			//console.info(this);
+			this.$util.persistLogin(this);
+			//console.info(this.$store.state.user);
+			//const page = getCurrentPages();
+			//console.info(page);
+			
+		},
+		onUnload() {
+			this.imageList = [],
+			
+			this.countIndex = 5;
+		},
+		created: function() {
+			console.info('created');
+			this.GetDropDown();
+			this.GetzzSupplierEx();
+			
+		},
+		updated:function(){
+			
+		},
+		
+		methods: {
+			input(form, name, value) {
+				this.$refs[form].setValue(name, value)
+			},		
+            GetzzSupplierEx:function(){
+				let that=this;
+				let id = this.$util.getQuery("id")-0;
+				GetzzSupplierEx(id).then((res)=>{
+					console.info("获取供应商扩展信息",res);
+					that.entity=res.entity;
+					that.attachments=res.attachments;
+					//console.info('entity',this.entity);
+					that.title=res.entity.title;
+					that.reason=res.entity.reason;
+					that.projectCode=res.entity.projectCode;
+				})
+				
+			},
+			/**
+			 * 手动提交
+			 * @param {Object} form
+			 */
+			submitForm(e) {				
+				console.info('submitForm');
+				let _this=this;
+				if(this.title==='')
+				{
+					uni.showToast({
+						icon:"none",
+						title:"请填写申请标题",
+						duration:3000
+					});
+					return;
+				}
+				if(this.title.length>200)
+				{
+					uni.showToast({
+						icon:"none",
+						title:"申请标题不能多于200字",
+						duration:3000
+					});
+					return;
+				}
+				if(this.projectCode=="")
+				{
+					uni.showToast({
+						icon:"none",
+						title:"请选择项目",
+						duration:3000
+					});
+					return;
+				}
+				if(this.reason===""){
+					uni.showToast({
+						icon:"none",
+						title:"原因不能为空",
+						duration:3000
+					});
+					return;
+				}
+				if(this.reason.length>500){
+					uni.showToast({
+						icon:"none",
+						title:"原因不能超过500字",
+						duration:3000
+					});
+					return;
+				}
+				
+				if(this.$util.isEmpty(this.supplierCode)){
+					uni.showToast({
+						icon:"none",
+						title:"登录人信息丢失,请重新登录再操作",
+						duration:4000
+					});
+					return;
+				}
+				let id=this.$util.getQuery("id")-0;
+				var dto={id:id,title:this.title,projectCode:this.projectCode,supplierCode:this.supplierCode,reason:this.reason,checkPerson:''};
+			 
+				console.info('dto',dto);
+				//return;
+				//var data={dto:dto};
+				//var strList=JSON.stringify(list);
+				//var strData=JSON.stringify(data);
+				UpdatezzSupplierEx(dto).then((res)=>{
+					console.info("更新结果",res);
+					
+					if(res=="success"){
+						//上传图片
+						_this.uploadFileToServe(id) ;
+						
+						uni.navigateTo({
+							url:'/pages/template/SupplierList/SupplierList'
+						})
+					}
+					else{
+						uni.showToast({
+							title:res,
+							icon:'none',
+							duration:3000
+						})
+					}
+					
+				});
+			},
+			bindPickerChange: function(e) {
+				//console.log('picker发送选择改变,携带值为:' + e.detail.value);
+				//console.info(e.detail);
+				this.index = e.detail.value;
+				this.projectCode=this.array[this.index].projectCode;
+				console.info('bindPickerChange',this.projectCode);
+			},
+			bindDateChange: function(e) {
+				this.date = e.detail.value;
+				this.requisitionDate=this.date;
+				console.info(this.date);
+			},
+			
+			countChange: function(e) {
+				this.countIndex = e.detail.value;
+			},
+			
+			GetDropDown:function(){
+				let that=this;
+				
+				GetProjectBySupplierCode(this.supplierCode).then((res)=>{
+					console.info('GetProjectBySupplierCode',res);
+					res.forEach(function(item,index,array){
+						that.$set(that.array,index,item);
+					});
+					that.projectCode=that.array[0].projectCode;	
+					//console.info('array',that.array);
+					//that.GetzzSupplierEx();
+				});
+			},
+			
+			openWindow:function(){
+				 
+			},
+			
+			
+			/*
+			上传后返回的值:
+			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(masterCode) {
+				let _this=this;
+				var urlList=_this.urlList;
+				if (!urlList || urlList.length <= 0) {
+					return;
+				};
+				//console.info(urlList);
+			
+			
+				//return;
+				for (let i = 0; i < urlList.length; i++) {
+			        console.info('x-token',_this.$store.state.token.tokenStr);
+					uni.uploadFile({
+						url: '/api/Common/UploadImage', 
+						filePath: urlList[i],
+						name: 'file',
+						formData: {
+							createPerson:_this.$store.state.user.supplierCode,
+							masterCode:masterCode,
+							attachMentType:'zzSupplierExAttach'
+						},
+						headers: {
+							'Content-Type': 'multipart/form-data; boundary = ' + new Date().getTime(),
+							'X-Token':_this.$store.state.token.tokenStr
+							//这里要把content-type设置为multipard/form-data,同时还要设置boundary
+						},
+						success: (uploadFileRes) => {
+							console.log("图片上传:",uploadFileRes.data);
+						}
+					});
+				}
+			}
+		}
+	}
+</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;
+	    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;
+	}
+</style>

+ 395 - 0
uni-app-front/pages/template/zzSupplierExDetail/zzSupplierExDetail.vue

@@ -0,0 +1,395 @@
+<template>
+	<view> 
+		<view style="margin:8px;position: fixed;z-index: 50;opacity:0.7;" >
+			<button type="default" style="border-radius: 5px;" class="mini-btn" size="mini" @click="modify" v-show="entity.state==0">修改</button>
+			<button type="default" style="border-radius: 5px;margin-left:15px;" class="mini-btn" size="mini" @click="delSupplier" v-show="entity.state==0">删除</button>
+			<button type="default" style="border-radius: 5px;margin-left:15px;" class="mini-btn" size="mini" @click="submit" v-show="entity.state==0">提交</button>
+			<button type="default" style="border-radius: 5px;margin-left:15px;" class="mini-btn" size="mini" @click="pass" v-show="entity.state==1">通过</button>
+			<button type="default" style="border-radius: 5px;margin-left:15px;" class="mini-btn" size="mini" @click="back" v-show="entity.state==1">退回</button>
+		</view>		
+		<uni-list style="padding-top:30px;">
+			<uni-list-item  >
+				<view slot="body" class="slot-box">
+					<view class="row">
+						<view class="column-left">编号:</view>
+						<view class="column-right section-title">{{entity.id}}</view>
+					</view>
+					<view class="row">
+						<view class="column-left">标题:</view>
+						<view class="column-right">{{entity.title}}</view>
+					</view>
+					<view class="row">
+						<view class="column-left">状态:</view>
+						<view class="column-right">{{entity.stateName}}</view>
+					</view>
+					<view class="row">
+						<view class="column-left">申请日期:</view>
+						<view class="column-right">{{entity.createDateStr}}</view>
+					</view>
+					<view class="row">
+						<view class="column-left">项目:</view>
+						<view class="column-right">{{entity.projectName}}</view>
+					</view>
+				
+					<view class="row">
+						<view class="column-left">原因:</view>
+						<view class="column-right">{{entity.reason}}</view>
+					</view>					
+					<view class="row">
+						<view class="column-left">附件:</view>
+						<view class="column-right">
+							<view v-for="(item,index) in attachments" :key="index">								
+								<a :href="'/api/common/ShowImg?code='+item.attachMentCode">{{item.fileName}}</a>
+							</view>
+						</view>
+					</view>
+				</view>
+			</uni-list-item>
+		</uni-list>	
+
+		
+		 <view class="uni-form-item uni-column" v-show="isUpload">
+		     <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="20000"></g-upfile>
+		 	</view>
+		 </view>
+		 <view class="uni-btn-v uni-column"  v-show="isUpload">
+		 	<button type="primary" form-type="submit" style="border-radius: 15px;"  @click="upload">上传附件</button>
+		 </view>
+	</view>
+</template>
+
+<script>
+	import {
+		GetzzSupplierEx,DeletezzSupplierEx,SubmitzzSupplierEx,AuditzzSupplierEx
+	} from "@/common/api/requisitionApi.js";
+	import {		
+		showImage
+	} from "@/common/api/commonApi.js";
+
+	export default {
+		data() {
+			return {
+				entity: {}, //申请单				
+				attachments: [], //附件
+				unitCodeName: '',
+				procedureName:"",				
+				isShow:false,        //修改按钮是否显示
+				isWorkFlow:false,   //流程审核按钮是否显示
+				
+				isUpload:false,    //是否显示上传组件及上传按钮
+				control: true,
+				columnNum: 3,
+				imgList: [],
+				urlList:[],
+				maxCount:5,
+				imageList: [],				
+				countIndex: 5,
+				count: [1, 2, 3, 4, 5],
+			}
+		},
+		onLoad(event) {
+			if (this.$store == null || this.$store.state == null) {
+				uni.navigateTo({
+					url: '../../LoginSupplier/LoginSupplier'
+				});
+				//console
+				return;
+			}
+			console.info("当前登录状态:" + this.$store.state.isLogin);
+			//console.info(this);
+			this.$util.persistLogin(this);
+		},
+		created: function() {
+			if(this.$store.state.user.userCode!=undefined)
+			{
+				uni.setNavigationBarTitle({
+					title:"供应商申请明细"
+				});
+			}
+			else{
+				uni.setNavigationBarTitle({
+					title:"我的申请明细"
+				});
+			}
+			let id = this.$util.getQuery('id');
+			if (!id) {
+				uni.navigateTo({
+					url: '../SupplierList/SupplierList'
+				})
+				return;
+			}
+			this.getDetail(id);
+		},
+		computed:function(){
+			
+		},
+		methods: {
+			getDetail(id) {
+				let that = this;
+				GetzzSupplierEx(id).then((res) => {
+					console.info('GetzzSupplierEx res', res);
+					if(typeof res!='string')
+					{
+						that.entity = res.entity;
+						res.attachments.forEach(function(item, index, arr) {
+							that.$set(that.attachments, index, item);
+						});
+						if(that.entity.state>=1&&that.$store.state.user.userCode==undefined)
+						{
+							that.isUpload=true;
+						}
+						else{
+							that.isUpload=false;
+						}
+					}
+					else{
+						uni.showModal({
+							content:res,
+							
+						});
+						return;
+					}
+					
+					
+					
+
+				});
+			},
+			/* 显示部门 */
+			GetDepartment: function(unitcode) {
+				let that = this;
+				GetUserDepartment(unitcode).then((res) => {
+					console.info(res);
+					that.unitCodeName = res;
+				});
+			},
+			/* 流程审核按钮点击事件处理 */
+			workFlow:function(){
+				let url="../GetWorkFlowProcedureList/GetWorkFlowProcedureList?procedureName="+this.procedureName+"&applicationCode="+this.$util.getQuery("id");
+				uni.navigateTo({    //跳转到流程控制列表页面
+					url:url
+				});
+			},
+			showImage: function(code) {
+				console.info('showimage', code);
+				uni.navigateTo({
+					url: '/api/common/ShowImg?code=' + code
+				})
+
+			},
+			modify: function() { //跳转到修改页面
+				let id = this.$util.getQuery("id");
+				uni.navigateTo({
+					url: '/pages/template/UpdatezzSupplierEx/UpdatezzSupplierEx?id=' + id
+				});
+			},
+			delSupplier: function() { //删除
+				let id = this.$util.getQuery("id");
+				let supplierCode=this.$store.state.user.supplierCode;
+				DeletezzSupplierEx(supplierCode,id).then((res)=>{
+					console.info("删除结果",res);
+					
+					if(res=="success"){
+						
+						uni.navigateTo({
+							url:'/pages/template/SupplierList/SupplierList'
+						})
+					}
+					else{
+						uni.showToast({
+							title:res,
+							icon:'none',
+							duration:3000
+						})
+					}
+					
+				});
+			},
+			submit: function() { //提交审核
+				let id = this.$util.getQuery("id")-0;
+				var dto={id:id,projectCode:this.entity.projectCode,supplierCode:this.entity.supplierCode,state:1};
+				console.info('提交dto',dto);
+				SubmitzzSupplierEx(dto).then((res)=>{
+					console.info("提交结果",res);
+					
+					if(res=="success"){
+						
+						uni.navigateTo({
+							url:'/pages/template/SupplierList/SupplierList'
+						})
+					}
+					else{
+						uni.showToast({
+							title:res,
+							icon:'none',
+							duration:3000
+						})
+					}
+					
+				});
+				
+			},
+			pass: function() { //审核通过
+				let id = this.$util.getQuery("id")-0;
+				var dto={id:id,projectCode:this.entity.projectCode,supplierCode:this.entity.supplierCode,state:2};
+				console.info('通过dto',dto);
+				AuditzzSupplierEx(dto).then((res)=>{
+					console.info("审核结果",res);
+					
+					if(res=="success"){
+						if(this.$store.state.user.userCode!=undefined){
+							uni.navigateTo({
+								url:'/pages/template/SupplierList/SupplierList?projectCode='+this.$store.state.projectCode
+							})
+						}
+						else{
+							uni.navigateTo({
+								url:'/pages/template/SupplierList/SupplierList'
+							})
+						}
+						
+					}
+					else{
+						uni.showToast({
+							title:res,
+							icon:'none',
+							duration:3000
+						})
+					}
+					
+				});
+			},
+			back: function() { //审核退回
+				let id = this.$util.getQuery("id")-0;
+				var dto={id:id,projectCode:this.entity.projectCode,supplierCode:this.entity.supplierCode,state:0};
+				console.info('退回dto',dto);
+				AuditzzSupplierEx(dto).then((res)=>{
+					console.info("审核结果",res);
+					
+					if(res=="success"){
+						
+						if(this.$store.state.user.userCode!=undefined){
+							uni.navigateTo({
+								url:'/pages/template/SupplierList/SupplierList?projectCode='+this.$store.state.projectCode
+							})
+							console.info("aa");
+						}
+						else{
+							uni.navigateTo({
+								url:'/pages/template/SupplierList/SupplierList'
+							})
+						}
+					}
+					else{
+						uni.showToast({
+							title:res,
+							icon:'none',
+							duration:3000
+						})
+					}
+					
+				});
+			},
+			/*
+			上传后返回的值:
+			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
+						});
+					}
+				}
+			},
+			upload:function(){
+				this.uploadFileToServe(this.$util.getQuery("id")) ;
+			},
+			/*
+			执行上传服务:
+			urlList:要上传的图片:数组类型
+			*/
+			uploadFileToServe(masterCode) {
+				let _this=this;
+				var urlList=_this.urlList;
+				if (!urlList || urlList.length <= 0) {
+					return;
+				};
+				//console.info(urlList);
+			
+			
+				//return;
+				for (let i = 0; i < urlList.length; i++) {
+			        console.info('x-token',_this.$store.state.token.tokenStr);
+					uni.uploadFile({
+						url: '/api/Common/UploadImage', 
+						filePath: urlList[i],
+						name: 'file',
+						formData: {
+							createPerson:_this.$store.state.user.supplierCode,
+							masterCode:masterCode,
+							attachMentType:'zzSupplierExAttach'
+						},
+						headers: {
+							'Content-Type': 'multipart/form-data; boundary = ' + new Date().getTime(),
+							'X-Token':_this.$store.state.token.tokenStr
+							//这里要把content-type设置为multipard/form-data,同时还要设置boundary
+						},
+						success: (uploadFileRes) => {
+							console.log("图片上传:",uploadFileRes.data);
+							this.getDetail(masterCode);
+							//this.urlList=[];
+						}
+					});
+				}
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	 
+</style>