Ver código fonte

移动端代码调整

wangqiang 1 ano atrás
pai
commit
389cccb8ee

+ 16 - 1
api/auth/loginService.js

@@ -1,5 +1,6 @@
 import request from "../../common/request"
 import { AUTH_PATH as prefix } from "../AppPath";
+import { SYS_PATH as sysPrefix } from "../AppPath";
 
 export default {
   getCode: function () {
@@ -20,5 +21,19 @@ export default {
 	  url: prefix + "/user/logout",
       method: 'get'
     })
-  }
+  },
+  getPhoneCode (loginForm) {
+    return request({
+      url: sysPrefix + '/sys/user/getPhoneCode',
+      method: 'get',
+      params: {mobile: loginForm},
+    })
+  },
+  savePwd: function (loginForm) {
+    return request({
+      url:sysPrefix + "/sys/user/saveNewPassword",
+      method:"get",
+      params:{mobile:loginForm.phoneNumber,code:loginForm.phoneCode,newPassword: loginForm.newPassword},
+    })
+  },
 }

+ 55 - 0
api/materialManagement/MaterialManagementService.js

@@ -0,0 +1,55 @@
+import request from "../../common/request"
+import { PUBLIC_MODULES_PATH as prefix } from "../AppPath";
+
+export default {
+  list: function (param) {
+    return request({
+      url: prefix + '/material/management/list',
+      method: 'get',
+      params: param
+    })
+  },
+  save: function (param) {
+    return request({
+      url: prefix + '/material/management/save',
+      method: 'post',
+      data: param
+    })
+  },
+  findById: function (id) {
+    return request({
+      url: prefix + '/material/management/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  },
+  remove: function (id) {
+    return request({
+      url: prefix + '/material/management/remove',
+      method: 'get',
+      params: {id: id}
+    })
+  },
+  updateStatusById: function (param) {
+    return request({
+      url: prefix + '/material/management/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  },
+  exportFile: function (params) {
+    return request({
+      url: prefix + '/reimbursementApproval/info/exportFile',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  },
+  findTradeByTypeId: function (typeId) {
+    return request({
+      url: prefix + '/material/management/findTradeByTypeId',
+      method: 'get',
+      params: {typeId: typeId}
+    })
+  }
+}

+ 40 - 0
api/materialManagement/SupplierService.js

@@ -0,0 +1,40 @@
+import request from "../../common/request"
+import { PUBLIC_MODULES_PATH as prefix } from "../AppPath";
+
+export default class SupplierService {
+  save (param) {
+    return request({
+      url: prefix + '/material/supplier/save',
+      method: 'post',
+      data: param
+    })
+  }
+  queryById (id) {
+    return request({
+      url: prefix + '/material/supplier/queryById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  list (param) {
+    return request({
+      url: prefix + '/material/supplier/list',
+      method: 'get',
+      params: param
+    })
+  }
+  delete (ids) {
+    return request({
+      url: prefix + '/material/supplier/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+  findByName (name) {
+    return request({
+      url: prefix + '/material/supplier/findByName',
+      method: 'get',
+      params: {name: name}
+    })
+  }
+}

+ 259 - 0
api/sys/OSSService.js

@@ -0,0 +1,259 @@
+import OSS from 'ali-oss'
+// import { ElMessage } from 'element-plus'
+import request from "../../common/request"
+import { PUBLIC_MODULES_PATH as prefix } from "@/api/AppPath";
+
+export default class OSSSerive {
+  disposeXmlFile (data) {
+    return request({
+      url: prefix + '/oss/file/disposeXmlFile',
+      method: 'post',
+      data: data
+    })
+  }
+  downLoadFileDisposeXmlFile (url) {
+    return request({
+      url: prefix + '/oss/file/downLoadFileDisposeXmlFile',
+      method: 'post',
+      params: {file: url}
+    })
+  }
+	queryById (id) {
+		return request({
+			url: prefix + '/oss/file/queryById',
+			method: 'get',
+			params: { id: id },
+		})
+	}
+  saveMsg (param) {
+    return request({
+      url: prefix + '/oss/file/saveMsg',
+      method: 'post',
+      data: param
+    })
+  }
+  findFileList (attachmentId) {
+    return request({
+		  url: prefix + '/oss/file/findFileList',
+      method: 'get',
+      params: {attachmentId: attachmentId}
+    })
+  }
+  getTemporaryUrl (url) {
+    return request({
+      url: prefix + '/oss/file/getTemporaryUrl',
+      method: 'get',
+      params: {url: url}
+    })
+  }
+  getFileSizeByUrl (url) {
+    return request({
+      url: prefix + '/oss/file/getFileSizeByUrl',
+      method: 'get',
+      params: {url: url}
+    })
+  }
+  deleteMsgById (id) {
+    return request({
+      url: prefix + '/oss/file/deleteMsgById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  downLoadAttach (url) {
+    return request({
+      url: prefix + '/oss/file/downLoadAttach',
+      method: 'get',
+      responseType: 'blob',
+      params: {file: url}
+    })
+  }
+}
+
+export const client = new OSS({
+  region: 'oss-cn-hangzhou', // oss地址
+  accessKeyId: 'LTAI5tQDWoM9c1WyJNPs86rX', // 通过阿里云控制台创建的AccessKey ID。
+  accessKeySecret: '84dDIx4edT1n78KUOqqSmDZ35pchJv', // 通过阿里云控制台创建的AccessKey Secret。
+  bucket: 'xgxm-test', // 仓库名字
+	// bucket: 'xg-pg', // 仓库名字
+  useFetch: true, // 支持上传大于100KB的文件
+  secure: false // 返回的url为https
+})
+
+export const headers = {
+  // 指定该Object被下载时网页的缓存行为。
+  'Cache-Control': 'no-cache',
+  // 指定该Object被下载时的名称。
+  'Content-Disposition': 'inline',
+  // 指定该Object被下载时的内容编码格式。
+  'Content-Encoding': 'UTF-8',
+  // 指定过期时间。
+  Expires: 'Wed, 08 Jul 2023 16:57:01 GMT',
+  // 指定Object的存储类型。
+  'x-oss-storage-class': 'Standard',
+  // 指定Object的访问权限。
+  // 'x-oss-object-acl': 'private',
+  // 设置Object的标签,可同时设置多个标签。
+  'x-oss-tagging': 'Tag1=1&Tag2=2',
+  // 指定CopyObject操作时是否覆盖同名目标Object。此处设置为true,表示禁止覆盖同名Object。
+  'x-oss-forbid-overwrite': 'true'
+  // 'secure': 'true'
+}
+
+export function onChange (file, files) {
+  // console.log(file, 'file', files, 'Filest')
+  return files
+}
+
+// eslint-disable-next-line no-unused-vars
+export function handleUploadSuccess (response, file, fileS) {
+  // console.log(response, file, fileS, 'response, file, fileList')
+}
+
+export function handleRemove (e, files) {
+  return files
+}
+
+export function fileName (file) {
+  // console.log('文件名称处理')
+  const tmpcnt = file.file.name.lastIndexOf('.')
+  let fileName = file.file.name.substring(0, tmpcnt)
+  // 将单引号‘’都转换成',将双引号“”都转换成"
+  fileName = fileName.replace(/’|‘/g, '\'').replace(/“|”/g, '')
+  // 将中括号【】转换成[],将大括号{}转换成{}
+  fileName = fileName.replace(/【/g, '(').replace(/】/g, ')').replace(/{/g, '(').replace(/}/g, ')')
+  fileName = fileName.replace(/\[/g, '(').replace(/]/g, ')').replace(/{/g, '(').replace(/}/g, ')')
+  // 将逗号,转换成,,将:转换成:
+  fileName = fileName.replace(/,/g, ',').replace(/:/g, ':')
+  // 将中文——转换为英文-
+  fileName = fileName.replace(/—/g, '-')
+  fileName = fileName.replace(/……/g, '')
+  fileName = fileName.replace(/±/g, '')
+  fileName = fileName.replace(/#/g, '')
+  fileName = fileName.replace(/%/g, '')
+  fileName = fileName.replace(/Π/g, '')
+  fileName = fileName.replace(/π/g, '')
+  fileName = fileName.replace(/·/g, '.')
+  // console.log('文件名处理结果', fileName)
+  return fileName
+}
+
+export function beforeAvatarUpload (file, fileList, maxValue) {
+  // 文件大小校验
+  const isLt2M = file.size / 1024 / 1024 < maxValue
+  if (!isLt2M) {
+    fileList.splice(fileList.length - 1, 1)
+    // console.log('文件大小不能超过 ' + maxValue + ' MB!')
+  }
+  return isLt2M
+}
+
+// export function exnameFix (file, isShow, names) {
+//   // console.log('格式校验')
+//   const tmpcnt = file.name.lastIndexOf('.')
+//   const exname = file.name.substring(tmpcnt + 1) // 获取后缀名
+//   if (names.indexOf(exname) < 0) {
+//     if (isShow === '1') {
+// 		ElMessage({
+// 			message: '不支持的格式!',
+// 			type: 'error',
+// 		})
+//     }
+//     return false
+//   }
+//   return true
+// }
+
+export async function httpRequest (file, name, type, maxValue) { // 阿里云OSS上传
+  if (!beforeAvatarUpload(file.file, [], maxValue)) {
+    return
+  }
+  // console.log('开始上传')
+  // 判断扩展名
+  const tmpcnt = file.file.name.lastIndexOf('.') // 获取.的下标
+  const exname = file.file.name.substring(tmpcnt + 1) // 获取后缀名
+  // console.log(exname, '后缀名')
+  const now = new Date()
+  const year = now.getFullYear()
+  const month = now.getMonth() + 1
+  const day = now.getDate() > 10 ? now.getDate() : '0' + now.getDate()
+  const filePath = '/attachment-file/assess/' + type + '/' + year + '/' + month + '/' + day + '/' + now.getTime()
+  // console.log(filePath, '文件存储路径')
+  const fileName = filePath + name + '.' + exname
+  // console.log(fileName, '文件名')
+
+  await client.multipartUpload(fileName, file.file, {
+	  // eslint-disable-next-line no-unused-vars
+    progress: await function (p, checkpoint) {
+      file.onProgress({percent: Math.floor(p * 100)}) // 触发el-upload组件的onProgress方法
+    }
+    // mime: type,
+  }).then(await function (result) {
+    // console.log(result)
+    if (result.res.status === 200) {
+      // file.onSuccess(result) // 触发el-upload组件的onSuccess方法
+      file.file.url = fileName
+    }
+	  // eslint-disable-next-line handle-callback-err,no-unused-vars
+  }).catch(function (err) {
+    // console.log(err)
+    file.onError('上传失败') // 触发el-upload组件的onError方法,此方法会移除文件列表
+  })
+}
+
+// eslint-disable-next-line no-unused-vars
+function getTemporaryByUrl (url) {
+  return request({
+    url: prefix + '/oss/file/getTemporaryUrl',
+    method: 'get',
+    params: {url: url}
+  })
+}
+
+export async function openWindowOnUrl (row) {
+  if (row.url === undefined || row.url === null || row.url === '') {
+    // Message.error('没有获取到文件的url')
+    return
+  }
+  let rowUrl = ''
+  let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
+  if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
+    await getTemporaryByUrl(row.url).then((data) => {
+      // eslint-disable-next-line no-undef
+      onPreview(data)
+    })
+    return
+  }
+  await getTemporaryByUrl(row.url).then((data) => {
+    rowUrl = data
+  })
+  if (suffix === 'pdf') {
+    window.open('https://view.xdocin.com/xdoc?_xdoc=' + encodeURIComponent(rowUrl), '_blank')
+  } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
+    window.open('https://view.xdocin.com/xdoc?_xdoc=' + encodeURIComponent(rowUrl), '_blank')
+  } else {
+    window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(rowUrl), '_blank')
+  }
+}
+
+export async function toHref (row) {
+  if (row.url === null || row.url === undefined || row.url === '') {
+    // Message.error('没有获取到文件的url')
+    return
+  }
+  const link = document.createElement('a')
+  await getTemporaryByUrl(row.url).then((data) => {
+    const url = data // 完整的url则直接使用
+    // 这里是将url转成blob地址,
+    fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
+      link.href = URL.createObjectURL(blob)
+      link.download = row.name || '' // 下载文件的名字
+      // a.download = url.split('/')[url.split('/').length -1] //  // 下载文件的名字
+      document.body.appendChild(link)
+      link.click()
+      // 在资源下载完成后 清除 占用的缓存资源
+      window.URL.revokeObjectURL(link.href)
+      document.body.removeChild(link)
+    })
+  })
+}

+ 15 - 1
api/sys/userService.js

@@ -71,5 +71,19 @@ export default {
 			method: "get",
 			params: params,
 		});
-	}
+	},
+	treeDataRadio: function (params) {
+		return request({
+			url: prefix + "/sys/user/treeDataRadio",
+			method: "get",
+			params: params,
+		});
+	},
+	updateEmail: function (params){
+		return request({
+			url: prefix + `/sys/user/updateEmailApp`,
+			method: "post",
+			params: params,
+		});
+	},
 }

+ 178 - 0
components/user-select/user-select-radio.vue

@@ -0,0 +1,178 @@
+<template>
+		<view style="width: 100%;"
+			@tap="open"
+		>
+<!--			<u&#45;&#45;input-->
+<!--				v-model="labels"-->
+<!--				suffixIcon="arrow-right"-->
+<!--				suffixIconStyle="color: #909399"-->
+<!--				disabled-->
+<!--				disabledColor="#ffffff"-->
+<!--				:placeholder="placeholder"-->
+<!--				border="none"-->
+<!--			></u&#45;&#45;input>-->
+
+			<u-action-sheet
+				:show="show"
+				@close="show = false"
+			>
+			<view class="cu-bar bg-white">
+				<view class="action text-blue" @tap="show=false">取消</view>
+				<view class="action text-green" @tap="selectUsers">确定</view>
+			</view>
+			<view>
+				  <ly-tree :tree-data="data"
+					:props="props"
+					node-key="id"
+					:checkOnClickNode ="true"
+					:showRadio="showRadio"
+					:show-checkbox ="showCheckBox"
+					:checkOnlyLeaf = "checkOnlyLeaf"
+					ref="userTree" />
+			</view>
+		</u-action-sheet>
+	</view>
+</template>
+
+<script>
+	import userService from "@/api/sys/userService"
+	export default {
+		data() {
+			return {
+				index: '',
+				show: false,
+				labels:'',
+				type:'',
+				data: [],
+				treeList: []
+			};
+		},
+		props: {
+		    limit: Number,
+		    value: String,
+		    size: String,
+			placeholder: {
+			  type: String,
+			  default: () => { return '请选择用户' }
+			},
+		    readonly: {
+		      type: Boolean,
+		      default: () => { return false }
+		    },
+			checkOnlyLeaf: {
+		      type: Boolean,
+		      default: () => { return true }
+		    },
+			showRadio: {
+		      type: Boolean,
+		      default: () => { return true }
+		    },
+			showCheckBox: {
+			  type: Boolean,
+			  default: () => { return false }
+			},
+		    disabled: {
+		      type: Boolean,
+		      default: () => { return false }
+		    },
+			props: {
+				type: Object,
+				default: () => {
+					return {
+						children: 'children',
+						label: 'label'
+					}
+				}
+			}
+		  },
+		mounted() {
+			userService.treeDataRadio({type: 'ydd'}).then((data)=>{
+				// 遍历数据结构中的每个部门,为其子集添加父级的 label
+				data[0].children.forEach(department => {
+					this.addParentLabel(department, department.label, department.id);
+				});
+				this.data = data
+				this.setTreeList(this.data)
+				let labelArra = []
+				if(this.value){
+					let keys = this.value.split(',')
+					keys.forEach((id) => {
+						this.treeList.forEach((node) => {
+						  if (id === node.id) {
+							labelArra.push(node.label)
+						  }
+						})
+					 })
+					this.labels = labelArra.join(',')
+				}
+			})
+		},
+		methods:{
+			open (index,type) {
+				this.index = index
+				this.show = true;
+				this.type = type;
+				if(this.value){
+					this.$nextTick(()=>{
+						let keys = this.value.split(',')
+						this.$refs.userTree.setCheckedKeys(keys);
+					})
+				}
+			},
+			setTreeList (datas) { // 遍历树  获取id数组
+			      for (var i in datas) {
+			        this.treeList.push(datas[i])
+			        if (datas[i].children) {
+			          this.setTreeList(datas[i].children)
+			        }
+			      }
+			    },
+			selectUsers() {
+				let user = this.$refs.userTree.getCheckedNodes().find(item => {
+					return item.type === 'user';
+				});
+
+				// 如果没有选择任何用户,则显示提示信息
+				if (!user) {
+					uni.showToast({
+						title: '请至少选择一条数据',
+						icon: 'none',
+						duration: 2000
+					});
+				} else {
+					// 提取用户的 ID 和父级 label,并形成新的对象数组
+					let usersWithParentLabel = {
+						id: user.id,
+						label: user.label,
+						parentLabel: user.parentLabel, // 获取父级 label,如果不存在则设置为 null
+						parentId: user.parentId
+					};
+
+					// 将用户信息传递给其他地方
+					this.$emit('input', usersWithParentLabel,this.index,this.type);
+
+					// 在本地更新标签显示
+					let names = user.label;
+					this.labels = names;
+					this.show = false;
+				}
+
+
+			},
+			// 给数据结构中的子集添加父级的 label
+			addParentLabel(data, parentLabel,parentId) {
+				if (data.children) {
+					data.children.forEach(child => {
+						// 如果子集是用户节点,则添加父级的 label
+						if (child.type === 'user') {
+							child.parentLabel = parentLabel;
+							child.parentId = parentId;
+						}
+						// 递归调用以处理子集的子集
+						this.addParentLabel(child, parentLabel);
+					});
+				}
+			}
+		}
+	}
+</script>

+ 65 - 63
pages/addressbook/addressbook.vue

@@ -1,44 +1,46 @@
 <template>
-<view>
-	<cu-custom bgColor="bg-blue">
-		<block slot="content">通讯录</block>
-	</cu-custom>
-
-	<u-sticky>
-		<view  style="padding: 20upx; background-color: white;">
-			<u-search placeholder="输入搜索的关键词" :clearabled="true" :showAction="false" v-model="searchUserName"></u-search>
-		</view>
-	</u-sticky>
-	
 	<view>
-		<u-index-list :indexList="indexList">
-			<template v-for="(item, index) in list">
-				<!-- #ifdef APP-NVUE -->
-				<u-index-anchor :text="list[index].letter" :key="index"></u-index-anchor>
-				<!-- #endif -->
-				<u-index-item :key="index">
-					<!-- #ifndef APP-NVUE -->
-					<u-index-anchor :text="list[index].letter"></u-index-anchor>
+		<cu-custom bgColor="bg-blue">
+			<block slot="content">通讯录</block>
+		</cu-custom>
+
+		<u-sticky>
+			<view  style="padding: 20upx; background-color: white;">
+				<u-search placeholder="输入搜索的关键词" :clearabled="true" :showAction="false" v-model="searchUserName"></u-search>
+			</view>
+		</u-sticky>
+
+		<view>
+			<u-index-list :indexList="indexList">
+				<template v-for="(item, index) in list">
+					<!-- #ifdef APP-NVUE -->
+					<u-index-anchor :text="list[index].letter" :key="index"></u-index-anchor>
 					<!-- #endif -->
-					<view class="list" v-for="(user, index1) in list[index].data" :key="index1">
-						<view class="list__item">
-							<u-avatar shape="square" size="35" icon="account-fill" fontSize="26" randomBgColor></u-avatar>
-							<!-- <view class="cu-avatar round " :style="'background-image:url('+(user.photo?user.photo:'/h5/static/user/flat-avatar.png')+');'"></view> -->
-							<text class="list__item__user-name">{{user.name}}</text>
-							<!-- 部门名称 -->
-							<text class="list__item__additional-info">{{ user.officeDTO.name }}</text>
-							<!-- 电话号码信息 -->
-							<text class="list__item__phone-number">{{ user.mobile }}</text>
+					<u-index-item :key="index">
+						<!-- #ifndef APP-NVUE -->
+						<u-index-anchor :text="list[index].letter"></u-index-anchor>
+						<!-- #endif -->
+						<view class="list" v-for="(user, index1) in list[index].data" :key="index1">
+							<!-- 检查user.name是否不等于"管理员" -->
+							<view class="list__item" v-if="user.name !== '管理员' || user.name !== 'admin'">
+								<u-avatar shape="square" size="35" icon="account-fill" fontSize="26" randomBgColor></u-avatar>
+								<!-- <view class="cu-avatar round " :style="'background-image:url('+(user.photo?user.photo:'/h5/static/user/flat-avatar.png')+');'"></view> -->
+								<text class="list__item__user-name">{{user.name}}</text>
+								<!-- 新增的展示其他信息的元素 -->
+								<!-- 使用条件渲染检查 user.officeDTO.name 是否为 null -->
+								<text class="list__item__additional-info" v-if="user.officeDTO">{{ user.officeDTO.name }}</text>
+								<!-- 新的电话号码信息 -->
+								<text class="list__item__phone-number">{{ user.mobile }}</text>
+							</view>
+							<u-line v-if="user.name !== '管理员'"></u-line>
 						</view>
-						<u-line></u-line>
-					</view>
-				</u-index-item>
-			</template>
-			<view style="font-size: 15px; color: gray; text-align: center; margin-top: 15px;">共{{total}}位好友</view>
-		</u-index-list>
-		<u-gap height="100" bgColor="#fff"></u-gap>
+					</u-index-item>
+				</template>
+				<view style="font-size: 15px; color: gray; text-align: center; margin-top: 15px;">共{{total}}位好友</view>
+			</u-index-list>
+			<u-gap height="100" bgColor="#fff"></u-gap>
+		</view>
 	</view>
-</view>	
 </template>
 
 <script>
@@ -73,30 +75,30 @@
 		methods: {
 			// 排序
 			pySegSort(arr) {
-			    if(!String.prototype.localeCompare)
-			        return null;
-			     
-			    var letters = "0abcdefghjklmnopqrstwxyz".split('');
-			    var zh = "阿八嚓哒妸发旮哈讥咔垃痳拏噢妑七呥扨它穵夕丫帀".split('');
-			     
-			    var segs = [];
-			    var curr;
-			    letters.forEach((item,i) => {
-			        curr = {letter: item, data:[]};
-			        arr.forEach((item2) => {
-			            if((!zh[i-1] || zh[i-1].localeCompare(item2.name) <= 0) && item2.name.localeCompare(zh[i]) == -1) {
-			                curr.data.push(item2);
-			            }
-			        });
-			        if(curr.data.length) {
-			            segs.push(curr);
+				if(!String.prototype.localeCompare)
+					return null;
+
+				var letters = "0abcdefghjklmnopqrstwxyz".split('');
+				var zh = "阿八嚓哒妸发旮哈讥咔垃痳拏噢妑七呥扨它穵夕丫帀".split('');
+
+				var segs = [];
+				var curr;
+				letters.forEach((item,i) => {
+					curr = {letter: item, data:[]};
+					arr.forEach((item2) => {
+						if((!zh[i-1] || zh[i-1].localeCompare(item2.name) <= 0) && item2.name.localeCompare(zh[i]) == -1) {
+							curr.data.push(item2);
+						}
+					});
+					if(curr.data.length) {
+						segs.push(curr);
 						this.indexList.push(curr.letter)
-			            curr.data.sort((a,b)=>{
-			                return a.name.localeCompare(b.name);
-			            });
-			        }
-			    });
-			    return segs;
+						curr.data.sort((a,b)=>{
+							return a.name.localeCompare(b.name);
+						});
+					}
+				});
+				return segs;
 			}
 		}
 	}
@@ -104,25 +106,25 @@
 
 <style lang="scss">
 	.list {
-		
+
 		&__item {
 			@include flex;
 			padding: 6px 12px;
 			align-items: center;
-			
+
 			&__avatar {
 				height: 35px;
 				width: 35px;
 				border-radius: 3px;
 			}
-			
+
 			&__user-name {
 				font-size: 16px;
 				margin-left: 10px;
 				color: $u-main-color;
 			}
 		}
-		
+
 		&__footer {
 			color: $u-tips-color;
 			font-size: 14px;

+ 5 - 7
pages/jy/holiday/HolidayForm.vue

@@ -367,7 +367,7 @@
 					this.inputForm.endDay = this.formatDate(this.inputForm.endDay);
 				}
 
-				return new Promise((resolve, reject) => {
+				return new Promise(async ( resolve, reject) => {
 
 					let errors = [];
 
@@ -384,7 +384,7 @@
 					if (this.inputForm.type === '1'){
 						if (this.isNotEmpty(this.inputForm.startDay) && this.isNotEmpty(this.inputForm.beginTime)
 							&& this.isNotEmpty(this.inputForm.endDay) && this.isNotEmpty(this.inputForm.endTime)) {
-							holidayService.checkType(this.inputForm).then((data)=>{
+							await holidayService.checkType(this.inputForm).then((data)=>{
 								let day=data.split(",")
 								if (!day[0].includes(this.inputForm.days)){
 									errors.push(data);
@@ -535,7 +535,6 @@
 						this.$refs.inputForm.validate().then(res => {
 							this.inputForm.status = '2'
 							holidayService.saveForm(this.inputForm).then((data) => {
-								console.log('data', data)
 								this.inputForm.id = data.businessId
 								callback(data.businessTable, data.businessId, this.inputForm)
 								this.$refs.inputForm.resetFields()
@@ -551,16 +550,17 @@
 			},
 			// 通过
 			async agreeForm (callback) {
-				console.log('this.inputForm', this.inputForm)
 				this.$refs.inputForm.validate().then(res => {
 					if (this.inputForm.days >1) {
 						this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
 							if (this.isNotEmpty(data)) {
 								if (data === '总经理审核') {
 									this.inputForm.status = '5'
+								} else {
+									this.inputForm.status = '2'
 								}
 							}
-							this.inputForm.status = '2'
+
 							holidayService.saveForm(this.inputForm).then((data) => {
 								callback(data.businessTable, data.businessId, this.inputForm)
 								this.$refs.inputForm.resetFields()
@@ -586,7 +586,6 @@
 			checkType(){
 				if (this.inputForm.type === '1'){
 					holidayService.checkType(this.inputForm).then((data)=>{
-						console.log('data',data)
 						uni.showToast({
 							title: data,
 							icon: "none",
@@ -611,7 +610,6 @@
 					this.inputForm.endTime = ''
 				}
 				differenceInDays= Math.floor((date2 - date1) / (1000 * 60 * 60 * 24));
-				console.log('differenceInDays',differenceInDays)
 				if (differenceInDays === 0 || differenceInDays > 1){
 					if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '下午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午') ){
 						differenceInDays=differenceInDays+1

+ 235 - 38
pages/login/login.vue

@@ -1,37 +1,74 @@
 <template>
 	<view class="content">
-		<view id="box">
+		<view id="box" v-if="whichPage === '1'">
 
 			<view id="top" class="">
 				<view class="top_le"></view>
 				<view class="top_ri"></view>
 			</view>
 			<view class="title">
-				<view>欢迎登录JeePlus</view>
+				<view>嘉溢业务管理系统</view>
 			</view>
 			<view class="login-form">
 				<u--form :model="inputForm" labelWidth="100px"  labelPosition="left" :rules="rules" ref="uForm">
-						<u-form-item label="用户名" borderBottom prop="username">
-							<u-input border="none" v-model="inputForm.username" />
-						</u-form-item>
-						<u-form-item label="密码" borderBottom prop="password">
-							<u-input border="none" password v-model="inputForm.password" />
-						</u-form-item>
-						<u-form-item label="验证码" borderBottom prop="code">
-							<u-input border="none" v-model="inputForm.code" />
-							<u--image :showLoading="true" :src="captchaImg" width="140px" height="40px" @click="getCaptcha"></u--image>
-						</u-form-item>
+					<u-form-item label="用户名" borderBottom prop="username">
+						<u-input border="none" v-model="inputForm.username" />
+					</u-form-item>
+					<u-form-item label="密码" borderBottom prop="password">
+						<u-input border="none" password v-model="inputForm.password" />
+					</u-form-item>
+					<u-form-item label="验证码" borderBottom prop="code" v-if="passwordErrorCount >= 5">
+						<u-input border="none" v-model="inputForm.code" />
+						<u--image :showLoading="true" :src="captchaImg" width="140px" height="40px" @click="getCaptcha"></u--image>
+					</u-form-item>
 				</u--form>
 			</view>
 			<view class="but">
 				<u-button type="primary" shape="circle" color="linear-gradient(90deg, #1989FA, #19C2FA)" @click="bindLogin" text="欢迎登录"></u-button>
 			</view>
 			<view class="fot">
-				<text @tap="reg_ok">免费注册</text>
-				<text style="display: inline-block;width: 10vw;"></text>
-				<text @tap="forget_ok">忘记密码</text>
+				<text @tap="openForgetPassword" style="color: #1989FA;">忘记密码</text>
 			</view>
-	</view>
+		</view>
+		<view id="box" v-else-if="whichPage === '2'">
+
+			<view id="top" class="">
+				<view class="top_le"></view>
+				<view class="top_ri"></view>
+			</view>
+			<view class="title">
+				<view>修改密码</view>
+				<view>使用账号绑定的手机号找回密码</view>
+			</view>
+			<view class="login-form">
+				<u--form :model="inputForm" labelWidth="100px"  labelPosition="left" :rules="rules" ref="uForm">
+					<u-form-item label="绑定手机号" borderBottom prop="phoneNumber">
+						<u-input border="none" v-model="inputForm.phoneNumber" placeholder='请输入绑定手机号'/>
+					</u-form-item>
+					<u-form-item label="验证码" borderBottom prop="phoneCode">
+						<u-input border="none" v-model="inputForm.phoneCode" placeholder="请输入验证码"></u-input>
+						<u-button type="primary" @click="pushPhoneCode" :loading="!showPhoneCode" style="background-color: #3595f9; width: 100px;">
+							<span v-if="showPhoneCode" style="color: white;">获取验证码</span>
+							<span v-else class="count" style="color: white;">请等待 {{count}} s</span>
+						</u-button>
+					</u-form-item>
+					<u-form-item label="新密码" borderBottom prop="newPassword" >
+						<u-input border="none" v-model="inputForm.newPassword" placeholder='请输入新密码'/>
+					</u-form-item>
+					<u-form-item label="确认密码" borderBottom prop="newPasswordAgain" >
+						<u-input border="none" v-model="inputForm.newPasswordAgain" placeholder='请输入确认密码'/>
+					</u-form-item>
+				</u--form>
+			</view>
+			<view class="but">
+				<u-button type="primary" shape="circle" color="linear-gradient(90deg, #1989FA, #19C2FA)" @click="saveNewPass" text="保存"></u-button>
+			</view>
+			<view class="fot">
+				<!--				<text @tap="reg_ok">免费注册</text>-->
+				<!--				<text style="display: inline-block;width: 10vw;"></text>-->
+				<text @tap="backLogin" style="color: #1989FA;">前往登录页面</text>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -39,17 +76,24 @@
 	import * as $auth from "@/common/auth.js"
 	import loginService from "@/api/auth/loginService"
 	import {mapActions} from 'vuex'
-
+	var  graceChecker = require("@/common/graceChecker.js");
 	export default {
 		data() {
 			return {
+				showPhoneCode: true,
 				captchaImg: '',
 				inputForm: {
 					'username': '',
 					'password': '',
 					'code': '',
-					'uuid': ''
+					'uuid': '',
+					'phoneNumber': '',
+					'phoneCode': '',
+					'newPassword': '',
+					'newPasswordAgain': '',
 				},
+				passwordErrorCount: 0,
+				whichPage: '1', // 1为登录页面,2为忘记密码页面
 				rules: {
 					username: [
 						{
@@ -71,7 +115,35 @@
 							message: '请输入验证码',
 							trigger: ['blur', 'change']
 						}
-					]
+					],
+					phoneNumber: [
+						{
+							required: true,
+							message: '请输入绑定手机号',
+							trigger: ['blur', 'change']
+						}
+					],
+					phoneCode: [
+						{
+							required: true,
+							message: '请输入验证码',
+							trigger: ['blur', 'change']
+						}
+					],
+					newPassword: [
+						{
+							required: true,
+							message: '请输入新密码',
+							trigger: ['blur', 'change']
+						}
+					],
+					newPasswordAgain: [
+						{
+							required: true,
+							message: '请输入确认密码',
+							trigger: ['blur', 'change']
+						}
+					],
 				}
 			}
 		},
@@ -80,32 +152,157 @@
 		},
 		methods: {
 			...mapActions(['refreshUserInfo']),
-		  // 登录
-		  bindLogin() {
+			// 登录
+			bindLogin() {
 				/**
 				 * 客户端对账号信息进行一些必要的校验。
 				 * 实际开发中,根据业务需要进行处理,这里仅做示例。
 				 */
-			this.$refs.uForm.validate().then(res => {
-				loginService.login(this.inputForm).then((data) => {
-				  this.$store.commit('SET_TOKEN',data.token);
-				  this.refreshUserInfo();
-				  uni.reLaunch({
-				  	url: '../index/index',
-				  });
-				}).catch(e => {
-				  this.getCaptcha()
-				  console.error(e)
+				this.$refs.uForm.validate().then(res => {
+					loginService.login(this.inputForm).then((data) => {
+						this.$store.commit('SET_TOKEN',data.token);
+						this.refreshUserInfo();
+						// uni.reLaunch({
+						// 	url: '/pages/index/index',
+						// });
+						this.$router.push('/pages/index/index');
+					}).catch(e => {
+						// 密码错误次数增加
+						this.passwordErrorCount++;
+						// 如果密码错误次数超过5次,显示验证码
+						if (this.passwordErrorCount >= 5) {
+							this.inputForm.code = ''; // 清空验证码输入框
+							this.getCaptcha(); // 获取验证码
+						}
+						this.getCaptcha()
+						console.error(e)
+					})
 				})
-			})
-		  },
-		// 获取验证码
-		  getCaptcha () {
-			  loginService.getCode().then((data) => {
+			},
+			// 获取验证码
+			getCaptcha () {
+				loginService.getCode().then((data) => {
 					this.captchaImg = 'data:image/gif;base64,' + data.codeImg
 					this.inputForm.uuid = data.uuid
-			   })
-		  }
+				})
+			},
+			openForgetPassword () {
+				this.inputForm.username = ''
+				this.inputForm.password = ''
+				this.inputForm.code = ''
+				this.$nextTick(() => {
+					this.whichPage = '2' // 打开忘记密码页面
+				})
+			},
+			backLogin () {
+				this.inputForm.phoneNumber = ''
+				this.inputForm.phoneCode = ''
+				this.inputForm.newPassword = ''
+				this.inputForm.newPasswordAgain = ''
+				this.whichPage = '1' // 打开登录页面
+			},
+			pushPhoneCode () {
+				// 验证手机号码格式是否正确
+				if (this.isNotEmpty(this.inputForm.phoneNumber) && this.checkMobile(this.inputForm.phoneNumber)) {
+					// 向手机号发送验证码
+					loginService.getPhoneCode(this.inputForm.phoneNumber).then((data) => {
+						if (data.success) {
+							uni.showToast({ title: data.message, icon: "success" });
+							// ‘发送验证码’按钮倒计时
+							const TIME_COUNT = 60 // 更改倒计时时间
+							if (!this.timer) {
+								this.count = TIME_COUNT
+								this.showPhoneCode = false
+								this.timer = setInterval(() => {
+									if (this.count > 0 && this.count <= TIME_COUNT) {
+										this.count--
+									} else {
+										this.showPhoneCode = true
+										clearInterval(this.timer) // 清除定时器
+										this.timer = null
+									}
+								}, 1000)
+							}
+						} else {
+							this.$message.error(data.message)
+						}
+					})
+				} else {
+					uni.showToast({
+						title: '请填写正确的手机号',
+						icon: "none",
+						duration:2000
+					})
+				}
+			},
+			checkMobile (str) {
+				const phone = /(^(\d{3,4}-)?\d{6,8}$)|(^(\d{3,4}-)?\d{6,8}(-\d{1,5})?$)|(^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(19[0-9]{1}))+\d{8})$)/
+				if (str && !phone.test(str)) {
+					uni.showToast({
+						title: '绑定手机号填写不正确,请重新填写',
+						icon: "none",
+						duration:2000
+					})
+					this.inputForm.phoneNumber = ''
+					return false;
+				} else {
+					return true;
+				}
+			},
+			isEmpty(value) {
+				let result = false;
+				if (value == null || value == undefined) {
+					result = true;
+				}
+				if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
+					result = true;
+				}
+				if (typeof value == "object" && value instanceof Array && value.length === 0) {
+					result = true;
+				}
+				return result;
+			},
+			isNotEmpty (value) {
+				return !this.isEmpty(value)
+			},
+			saveNewPass () {
+
+				return new Promise((resolve, reject) => {
+
+					let errors = [];
+
+					if (this.inputForm.newPassword !== this.inputForm.newPasswordAgain) {
+						errors.push('两次输入的密码不相同,请重新输入!');
+					}
+
+					if (errors.length > 0) {
+						// 存在错误,显示提示信息
+						errors.forEach(error => {
+							uni.showToast({
+								title: error,
+								icon: 'none',
+								duration: 1500
+							});
+						});
+						reject('Form validation failed');
+					} else {
+						loginService.savePwd(this.inputForm).then((data) => {
+							if (data.success) {
+								this.$message.success(data.message)
+								this.inputForm.username = this.inputForm.phoneNumber
+								this.inputForm.newPassword = this.inputForm.newPassword
+								this.backLogin() // 修改密码成功后返回登录页面
+								this.loading = false
+							} else {
+								this.$message.error(data.message)
+								this.loading = false
+							}
+						}).catch(() => {
+							this.loading = false
+						})
+					}
+				});
+			},
 		}
 	}
 </script>

+ 19 - 8
pages/materialManagement/collect/CollectForm.vue

@@ -31,9 +31,9 @@
 
             <el-row  :gutter="15" :key="index_experience" v-for="(item,index_experience) in this.inputForm.detailInfos">
                 <el-col :span="24">
-                    <el-form-item label="" >
+                    <u-form-item label="" >
                         <el-divider content-position="left"> 领用详情 {{index_experience + 1}}</el-divider>
-                    </el-form-item>
+                    </u-form-item>
                 </el-col>
 
                 <el-col :span="24">
@@ -143,9 +143,9 @@
 
             <el-row  :gutter="15" :key="index_experience" v-for="(item,index_experience) in this.inputForm.detailInfos" >
                 <el-col :span="24">
-                    <el-form-item label="" >
+                    <u-form-item label="" >
                         <el-divider content-position="left"> 领用详情 {{index_experience + 1}}</el-divider>
-                    </el-form-item>
+                    </u-form-item>
                 </el-col>
 
                 <el-col :span="24">
@@ -227,6 +227,7 @@
                 </el-upload>
             </u-form-item>
         </u--form>
+        <user-select ref="userPicker" @input="handleEvent"></user-select>
         <ba-tree-picker ref="treePicker" :multiple='false' @select-change="selectChange" title="类型选择"
                         :localdata="listData" valueKey="value" textKey="label" childrenKey="children" />
         <goods-info-picker ref="goodsPicker" :multiple='false' @select-goods-change="selectGoodsChange" title="物品名称"
@@ -235,6 +236,7 @@
 </template>
 
 <script>
+    import userSelect from '@/components/user-select/user-select-radio.vue'
     import goodsInfoPicker from './GoodsInfoPicker'
     import MaterialTypeService from '@/api/materialManagement/MaterialTypeService'
     import WareHouseService from '@/api/materialManagement/WareHouseService'
@@ -244,6 +246,7 @@
     import {mapState, mapMutations, mapActions} from 'vuex'
     export default {
         components: {
+            userSelect,
             baTreePicker,
             goodsInfoPicker
         },
@@ -342,6 +345,14 @@
             }
         },
         methods: {
+            handleEvent(data,index,type) {
+                // 在这里处理子组件传递过来的数据
+                this.inputForm.detailInfos[index].recipientAgentId = data.id
+                this.inputForm.detailInfos[index].recipientAgent = data.label
+                this.inputForm.detailInfos[index].recipientOffice = data.parentLabel
+                this.inputForm.detailInfos[index].deptId = data.parentId
+                // 进行进一步处理...
+            },
             // 显示选择器
             showPicker(index) {
                 this.$refs.treePicker._show(index);
@@ -505,9 +516,10 @@
             // 领用人下拉弹窗
             openUserPullForm(index) {
                 // 点击 "领用人" 输入框时打开userPullForm页面,传入index用于区分不同的行
-                uni.navigateTo({
-                    url: '/pages/materialManagement/collect/UserPullForm?index=' + index // userPullForm页面的路径
-                });
+                // uni.navigateTo({
+                //     url: '/pages/materialManagement/collect/UserPullForm?index=' + index // userPullForm页面的路径
+                // });
+                this.$refs.userPicker.open(index,"");
             },
             handleUploadSuccess (res, file, fileList, index, type) {
 
@@ -693,7 +705,6 @@
                 if (this.isNotEmpty(this.inputForm.collectDate)) {
                     this.inputForm.collectDate = this.formatDate(this.inputForm.collectDate);
                 }
-                console.log('this.inputForm', this.inputForm)
                 this.$refs.inputForm.validate().then(res => {
                     this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
                         if (this.isNotEmpty(data)) {

+ 106 - 0
pages/materialManagement/purchase/MyDropdown.vue

@@ -0,0 +1,106 @@
+<template>
+    <u-form-item label="商品名称" :prop="'detailInfos[' + index_experience + '].tradeName'" :required="true">
+        <el-autocomplete
+                style="width: 100%;"
+                v-model="inputForm.detailInfos[index_experience].tradeName"
+                placeholder="请选择物品名称"
+                clearable
+                @focus="showDropdown"
+                :fetch-suggestions="fetchSuggestions"
+                @select="handleSelect"
+                :disabled="disabled"
+        >
+            <template slot-scope="{ item }">
+                <span style="width: 100%;">{{ item.tradeName }}</span>
+            </template>
+        </el-autocomplete>
+    </u-form-item>
+</template>
+
+<script>
+    import materialManagementService from '@/api/materialManagement/MaterialManagementService'
+    export default {
+        props: {
+            index_experience: Number,
+            inputForm: Object,
+            disabled: Boolean // 接收传入的 disabled 属性
+        },
+        data() {
+            return {
+                showDropdownList: false,
+                dropdownList: [],
+                selectedTradeName: ''
+            };
+        },
+        created() {
+        },
+        methods: {
+            showDropdown() {
+                let row = this.inputForm.detailInfos[this.index_experience]
+                row.tradeNameList = []
+                row.tradeNameData = []
+
+                let procurementTypeId = this.inputForm.detailInfos[this.index_experience].procurementTypeId
+
+                if (this.isNotEmpty(procurementTypeId)) {
+                    // Simulated data
+                    materialManagementService.findTradeByTypeId(procurementTypeId)
+                        .then((data) => {
+                            row.tradeNameList = JSON.parse(JSON.stringify(data))
+                            this.dropdownList = JSON.parse(JSON.stringify(data))
+                            this.showDropdownList = true; // Move this line here
+                        })
+                        .catch(() => {
+                            // Handle error
+                        });
+                }
+            },
+            isEmpty(value) {
+                let result = false;
+                if (value == null || value == undefined) {
+                    result = true;
+                }
+                if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
+                    result = true;
+                }
+                if (typeof value == "object" && value instanceof Array && value.length === 0) {
+                    result = true;
+                }
+                return result;
+            },
+            isNotEmpty (value) {
+                return !this.isEmpty(value)
+            },
+            fetchSuggestions(queryString, callback) {
+                if (this.dropdownList && queryString) {
+                    const filteredList = this.dropdownList.filter(item =>
+                        item.tradeName.toLowerCase().includes(queryString.toLowerCase())
+                    );
+                    callback(filteredList);
+                } else {
+                    callback(this.dropdownList);
+                    // Handle the case when dropdownList or queryString is not properly initialized
+                }
+            },
+            handleSelect(item) {
+                this.inputForm.detailInfos[this.index_experience].tradeName = item.tradeName;
+                this.showDropdownList = false;
+            }
+        }
+    };
+</script>
+
+<style scoped>
+    .my-dropdown {
+        position: absolute;
+        top: calc(100% + 4px); /* 将下拉框定位在输入框的下方,此处增加了 4px 的间距 */
+        left: 0;
+        width: 100%;
+        background-color: #fff;
+        border: 1px solid #ccc;
+    }
+    .list-item {
+        padding: 8px;
+        cursor: pointer;
+    }
+</style>

Diferenças do arquivo suprimidas por serem muito extensas
+ 1011 - 0
pages/materialManagement/purchase/PurchaseForm.vue


+ 102 - 0
pages/materialManagement/purchase/SupplierSelector.vue

@@ -0,0 +1,102 @@
+<template>
+    <u-form-item label="供应商" :prop="'detailInfos[' + index_experience + '].supplierName'" :required="true">
+        <el-autocomplete
+                style="width: 100%;"
+                v-model="inputForm.detailInfos[index_experience].supplierName"
+                placeholder="请选择供应商"
+                clearable
+                @focus="showDropdown"
+                :fetch-suggestions="fetchSuggestions"
+                @select="handleSelect"
+                :disabled="disabled"
+        >
+            <template slot-scope="{ item }">
+                <span style="width: 100%;">{{ item.name }}</span>
+            </template>
+        </el-autocomplete>
+    </u-form-item>
+</template>
+
+<script>
+    import SupplierService from '@/api/materialManagement/SupplierService'
+    export default {
+        props: {
+            index_experience: Number,
+            inputForm: Object,
+            disabled: Boolean // 接收传入的 disabled 属性
+        },
+        data() {
+            return {
+                showDropdownList: false,
+                selectedSupplier: null,
+                suppliers: [] // 供应商对象数组 [{id: 1, name: 'Supplier 1'}, ...]
+            };
+        },
+        supplierService: null,
+        created () {
+            this.supplierService = new SupplierService()
+            this.showDropdown()
+        },
+        methods: {
+
+            showDropdown() {
+                // 将获取的供应商赋值给 this.suppliers
+                this.supplierService.list({
+                    'current': 1,
+                    'size': -1,
+                }).then((data) => {
+                    this.suppliers = data.records
+                    this.showDropdownList = true;
+                })
+            },
+            isEmpty(value) {
+                let result = false;
+                if (value == null || value == undefined) {
+                    result = true;
+                }
+                if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
+                    result = true;
+                }
+                if (typeof value == "object" && value instanceof Array && value.length === 0) {
+                    result = true;
+                }
+                return result;
+            },
+            isNotEmpty (value) {
+                return !this.isEmpty(value)
+            },
+            fetchSuggestions(queryString, callback) {
+
+                if (this.suppliers && queryString) {
+                    const filteredList = this.suppliers.filter(item =>
+                        item.name.toLowerCase().includes(queryString.toLowerCase())
+                    );
+                    callback(filteredList);
+                } else {
+                    callback(this.suppliers);
+                    // Handle the case when suppliers or queryString is not properly initialized
+                }
+            },
+            handleSelect(item) {
+                this.inputForm.detailInfos[this.index_experience].supplierName = item.name;
+                this.inputForm.detailInfos[this.index_experience].supplierId = item.id;
+                this.showDropdownList = false;
+            }
+        }
+    };
+</script>
+
+<style scoped>
+    .my-dropdown {
+        position: absolute;
+        top: calc(100% + 4px); /* 将下拉框定位在输入框的下方,此处增加了 4px 的间距 */
+        left: 0;
+        width: 100%;
+        background-color: #fff;
+        border: 1px solid #ccc;
+    }
+    .list-item {
+        padding: 8px;
+        cursor: pointer;
+    }
+</style>

+ 1 - 0
pages/workbench/task/ApplyList.vue

@@ -125,6 +125,7 @@
 					current: this.tablePage.currentPage,
 					size: this.tablePage.pageSize,
 					orders: this.tablePage.orders,
+					type: 'ydd',
 					...this.searchForm
 				}).then((data)=>{
 					//追加新数据

+ 6 - 0
pages/workbench/task/FlowCopyList.vue

@@ -38,6 +38,7 @@
 </template>
 
 <script>
+	import {mapState, mapMutations, mapActions} from 'vuex'
 	import flowCopyService from "@/api/flowable/flowCopyService"
 	import taskService from "@/api/flowable/taskService"
 	import pick from 'lodash.pick'
@@ -58,6 +59,9 @@
 				loading: false,
 			}
 		},
+		computed: mapState({
+			userInfo: (state) => state.user.userInfo,
+		}),
 		onLoad() {
 			this.loadmore()
 		},
@@ -92,6 +96,8 @@
 					current: this.tablePage.currentPage,
 					size: this.tablePage.pageSize,
 					orders: this.tablePage.orders,
+					type: 'ydd',
+					userName: this.userInfo.name,
 					...this.searchForm
 				}).then((data)=>{
 					//追加新数据

+ 1 - 0
pages/workbench/task/HistoryList.vue

@@ -166,6 +166,7 @@
 					current: this.tablePage.currentPage,
 					size: this.tablePage.pageSize,
 					orders: this.tablePage.orders,
+					type: 'ydd',
 					...this.searchForm
 				}).then((data)=>{
 					//追加新数据

+ 46 - 16
pages/workbench/task/TaskForm.vue

@@ -13,6 +13,7 @@
 				
 				<TestActivitiLeaveForm  v-if="formUrl.endsWith('TestActivitiLeaveForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></TestActivitiLeaveForm>
 				<CollectForm  v-else-if="formUrl.endsWith('CollectForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></CollectForm>
+				<PurchaseForm  v-else-if="formUrl.endsWith('PurchaseForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></PurchaseForm>
 				<HolidayForm  v-else-if="formUrl.endsWith('HolidayForm')" :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId"></HolidayForm>
 				<!-- <component :formReadOnly="formReadOnly" :class="formReadOnly?'readonly':''"  ref="form" :businessId="businessId" :is="form"></component> -->
 				  <PreviewForm :formData="formData"  v-if="formType !== '2'"  :processDefinitionId="procDefId" :edit="true" ref="form"></PreviewForm>
@@ -91,6 +92,7 @@
 </template>
 
 <script>
+	import PurchaseForm from '@/pages/materialManagement/purchase/PurchaseForm.vue'
 	import CollectForm from '@/pages/materialManagement/collect/CollectForm.vue'
 	import HolidayForm from '@/pages/jy/holiday/HolidayForm.vue'
 	import userSelect from '@/components/user-select/user-select.vue'
@@ -139,6 +141,8 @@
 					  this.form = TestActivitiLeaveForm
 				  }else if(this.formUrl.endsWith('CollectForm')){
 					  this.form = CollectForm
+				  }else if(this.formUrl.endsWith('PurchaseForm')){
+					  this.form = PurchaseForm
 				  }else if(this.formUrl.endsWith('HolidayForm')){
 					  this.form = HolidayForm
 				  }else{
@@ -188,11 +192,14 @@
 				})
 			  }
 			// 读取历史任务列表
-			  taskService.historicTaskList(this.procInsId).then((data) => {
-				this.historicTaskList = data.reverse()
-			  })
+			if (this.procInsId) {
+				taskService.historicTaskList(this.procInsId).then((data) => {
+					this.historicTaskList = data.reverse()
+				})
+			}
 		},
 		components:{
+			PurchaseForm,
 			CollectForm,
 			HolidayForm,
 		  userSelect,
@@ -349,17 +356,26 @@
 			start (vars) {
 			  if (this.formType === '2') { // 外置表单启动
 				this.$refs.form.saveForm((businessTable, businessId,inputForm) => {
-					if (inputForm.days){
-						this.days=inputForm.days
+					let assignee = this.auditForm.assignee
+					if (inputForm) {
+						if (inputForm.days){
+							this.days=inputForm.days
+						}
+
+						if (inputForm.assignee) {
+							assignee = inputForm.assignee
+						}
 					}
-					console.log('this.days', this.days)
+
+
+
 				  taskService.start({
 					procDefKey: this.procDefKey,
 					businessTable: businessTable,
 					businessId: businessId,
 					...vars,
 					title: this.title,
-					assignee: this.auditForm.assignee,
+					assignee: assignee,
 					days: this.days
 				  }).then((data) => {
 					  uni.showToast({ title: "启动成功", icon: "success" });
@@ -429,14 +445,22 @@
 					}
 					this.$refs.form.reapplyForm((businessTable, businessId, inputForm,recordType) => {
 						vars = {...vars, ...inputForm,recordType}
-						console.log('inputForm', inputForm)
-						if (inputForm.procDefId) {
-							param.procDefId = inputForm.procDefId
-						}
+
 						let assignee = this.auditForm.assignee
-						if (!this.isEmpty(inputForm.assignee)) {
-							assignee = inputForm.assignee
+						if (inputForm) {
+							if (inputForm.procDefId) {
+								param.procDefId = inputForm.procDefId
+							}
+							if (inputForm.days) {
+								this.days=inputForm.days
+							}
+
+							if (!this.isEmpty(inputForm.assignee)) {
+								assignee = inputForm.assignee
+							}
 						}
+
+
 						this.recordType=recordType
 
 
@@ -448,7 +472,8 @@
 							vars: vars,
 							comment: this.auditForm,
 							assignee: assignee,
-							recordType: this.recordType
+							recordType: this.recordType,
+							days: this.days,
 						}).then((data) => {
 							uni.showToast({ title: "审批成功", icon: "success" });
 							uni.navigateTo({
@@ -613,9 +638,14 @@
 				}
 				if (this.formType === '2') { //外置表单审批
 					this.$refs.form.agreeForm((businessTable, businessId,inputForm) => {
-						if (inputForm.days) {
-							this.days = inputForm.days
+
+						if (inputForm) {
+							if (inputForm.days) {
+								this.days = inputForm.days
+							}
 						}
+
+
 						taskService.audit({
 							taskId: this.taskId,
 							taskDefKey: this.taskDefKey,

+ 9 - 3
pages/workbench/task/TaskFormDetail.vue

@@ -53,6 +53,7 @@
 </template>
 
 <script>
+	import PurchaseForm from '@/pages/materialManagement/purchase/PurchaseForm.vue'
 	import CollectForm from '@/pages/materialManagement/collect/CollectForm.vue'
 	import HolidayForm from '@/pages/jy/holiday/HolidayForm.vue'
 	import userSelect from '@/components/user-select/user-select.vue'
@@ -89,6 +90,8 @@
 						this.form = TestActivitiLeaveForm
 					}else if(this.formUrl.endsWith('CollectForm')){
 						this.form = CollectForm
+					}else if(this.formUrl.endsWith('PurchaseForm')){
+						this.form = PurchaseForm
 					}else if(this.formUrl.endsWith('HolidayForm')){
 						this.form = HolidayForm
 					}else{
@@ -121,11 +124,14 @@
 				}
 			  }
 			// 读取历史任务列表
-			  taskService.historicTaskList(this.procInsId).then((data) => {
-				this.historicTaskList = data.reverse()
-			  })
+			if (this.procInsId) {
+				taskService.historicTaskList(this.procInsId).then((data) => {
+					this.historicTaskList = data.reverse()
+				})
+			}
 		},
 		components:{
+			PurchaseForm,
 			CollectForm,
 			HolidayForm,
 		  userSelect,

+ 5 - 3
pages/workbench/task/TaskFormEdit.vue

@@ -180,9 +180,11 @@
 				})
 			  }
 			// 读取历史任务列表
-			  taskService.historicTaskList(this.procInsId).then((data) => {
-				this.historicTaskList = data.reverse()
-			  })
+			if (this.procInsId) {
+				taskService.historicTaskList(this.procInsId).then((data) => {
+					this.historicTaskList = data.reverse()
+				})
+			}
 		},
 		components:{
 		  userSelect,

+ 4 - 0
pages/workbench/task/TodoList.vue

@@ -1,5 +1,8 @@
 <template>
 	<view>
+		<cu-custom style="height: 10px;" :backUrl="'/pages/index/index'" :isBack="true" bgColor="bg-gradual-blue" >
+			<block slot="content">待办事项</block>
+		</cu-custom>
 		<u-search  :show-action="false" v-model="searchForm.title" @change="inputWord" margin="20rpx 50rpx"></u-search>
 		<view>
 			<u-swipe-action>
@@ -120,6 +123,7 @@
 					current: this.tablePage.currentPage,
 					size: this.tablePage.pageSize,
 					orders: this.tablePage.orders,
+					type: 'ydd',
 					...this.searchForm
 				}).then((data)=>{
 					//追加新数据

+ 57 - 32
pages/workbench/workbench.vue

@@ -119,43 +119,68 @@
 	    async mounted() {
 			
 			let res = await actCategoryService.treeData()
-			let data = await processService.list({current: 1, size: -1})
+			let data = await processService.list({current: 1, size: -1, type: 'ydd'})
 			this.processMap = new Map()
 
-			if (this.isAdmin) {
-				//如果是管理员 查看所有的流程图信息
-				res.forEach((item)=>{
-					this.processMap.set(item.name, [])
-				})
-				let list = data.records
-				list.forEach((item)=>{
-					if(this.processMap.has(item.category)){
-						let list = this.processMap.get(item.category)
-						list.push(item)
-					}else{
-						this.processMap.set(item.category, [item])
+			let list = data.records
+			let test = []
+			let leaveTest = []
+			list.forEach((item)=>{
+				if (item.category === '未设置') {
+					if (item.name === '物资管理-领用申请') {
+						test.push(item)
+						// this.processMap.set('物资管理', [item])
 					}
-				})
-
-				for(let [key,value] of this.processMap){
-					console.log(key,value);
-				}
-			} else {
-				//非管理员用户  只能查看物资领用 与 请假流程信息
-				let list = data.records
-				list.forEach((item)=>{
-					if (item.category === '未设置') {
-						if (item.name === '物资管理-领用申请') {
-							this.processMap.set('物资管理', [item])
-						}
-						if (item.name === '嘉溢-请假申请') {
-							this.processMap.set('请假申请', [item])
-						}
+					if (item.name === '物资管理-采购申请') {
+						// console.log('item', item)
+						// this.processMap.set('物资管理', [item])
+						test.push(item)
+					}
+					if (item.name === '嘉溢-请假申请') {
+						// console.log('item', item)
+						// this.processMap.set('物资管理', [item])
+						leaveTest.push(item)
 					}
+				}
 
-				})
-				console.log('this.processMap', this.processMap)
-			}
+			})
+			this.processMap.set('物资管理', test)
+			this.processMap.set('日常办公', leaveTest)
+
+			// if (this.isAdmin) {
+			// 	//如果是管理员 查看所有的流程图信息
+			// 	res.forEach((item)=>{
+			// 		this.processMap.set(item.name, [])
+			// 	})
+			// 	let list = data.records
+			// 	list.forEach((item)=>{
+			// 		if(this.processMap.has(item.category)){
+			// 			let list = this.processMap.get(item.category)
+			// 			list.push(item)
+			// 		}else{
+			// 			this.processMap.set(item.category, [item])
+			// 		}
+			// 	})
+			//
+			// 	for(let [key,value] of this.processMap){
+			// 		console.log(key,value);
+			// 	}
+			// } else {
+			// 	//非管理员用户  只能查看物资领用 与 请假流程信息
+			// 	let list = data.records
+			// 	list.forEach((item)=>{
+			// 		if (item.category === '未设置') {
+			// 			if (item.name === '物资管理-领用申请') {
+			// 				this.processMap.set('物资管理', [item])
+			// 			}
+			// 			if (item.name === '嘉溢-请假申请') {
+			// 				this.processMap.set('请假申请', [item])
+			// 			}
+			// 		}
+			//
+			// 	})
+			// 	console.log('this.processMap', this.processMap)
+			// }
 			
 			
 		},