Browse Source

项目计划模块

sangwenwei 1 year ago
parent
commit
d20365a472

+ 39 - 1
src/api/cw/projectRecords/ProjectRecordsService.js

@@ -106,7 +106,45 @@ export default {
 			params:{id:id,projectId:projectId}
 		})
 
-	}
+	},
+	queryPlanById: function (id) {
+		return request({
+			url: prefix + "/cwProjectRecords/queryPlanById",
+			method: "get",
+			params: { id: id },
+		});
+	},
+	exportPlan: function (params) {
+		return request({
+			url: prefix + "/cwProjectRecords/exportPlan",
+			method: "get",
+			params: params,
+			responseType: "blob",
+		});
+	},
+
+	userTree (name,id) {
+		return request({
+			url: prefix + '/cwProjectRecords/userTree',
+			method: 'get',
+			params: {name: name,id:id}
+		})
+	},
+
+	savePlanForm: function (inputForm) {
+		return request({
+			url: prefix + `/cwProjectRecords/savePlanForm`,
+			method: "post",
+			data: inputForm,
+		});
+	},
+
+	getTaskPhase: function () {
+		return request({
+			url: prefix + "/cwProjectRecords/getTaskPhase",
+			method: "get",
+		});
+	},
 
 
 };

+ 461 - 0
src/components/userSelectPlan/UserSelectDialog.vue

@@ -0,0 +1,461 @@
+<template>
+	<el-dialog
+		v-model="dialogVisible"
+		title="人员选择"
+		:width="type == 1 ? 680 : 460"
+		destroy-on-close
+		append-to-body
+		@closed="$emit('closed')"
+		draggable
+	>
+		<template v-if="type == 1">
+			<div class="user-select">
+				<div class="user-select__left">
+					<div class="user-select__search">
+						<el-input
+							v-model="searchForm.name"
+							prefix-icon="search"
+							placeholder="搜索成员"
+						>
+							<template #append>
+								<el-button
+									icon="search"
+									@click="search"
+								></el-button>
+							</template>
+						</el-input>
+					</div>
+					<div class="user-select__select">
+						<div
+							class="user-select__tree"
+							v-loading="showGrouploading"
+						>
+							<el-scrollbar>
+								<el-tree
+									class="menu"
+									ref="groupTree"
+									:data="group"
+									node-key="id"
+									:props="{
+										label: 'name',
+										children: 'children',
+									}"
+									highlight-current
+									:expand-on-click-node="false"
+									:current-node-key="groupId"
+									@node-click="groupClick"
+								>
+									<template #default="{ node, data }">
+										<span
+											class="custom-tree-node el-tree-node__label"
+										>
+											<span class="label">
+												<el-icon
+													:size="16"
+													class="m-r-5"
+												>
+													<qiye
+														v-if="data.type === '1'"
+														:style="{
+															color:
+																$TOOL.data.get(
+																	'IS_PRIMARY_TENANT'
+																) &&
+																data.tenantDTO &&
+																$utils.getTenantColorById(
+																	data
+																		.tenantDTO
+																		.id
+																),
+														}"
+													></qiye>
+													<bumen
+														v-else
+														:style="{
+															color:
+																$TOOL.data.get(
+																	'IS_PRIMARY_TENANT'
+																) &&
+																data.tenantDTO &&
+																$utils.getTenantColorById(
+																	data
+																		.tenantDTO
+																		.id
+																),
+														}"
+													></bumen>
+												</el-icon>
+												{{ node.label }}
+											</span>
+										</span>
+									</template>
+								</el-tree>
+							</el-scrollbar>
+						</div>
+						<div
+							class="user-select__user"
+							v-loading="showUserloading"
+						>
+							<div class="user-select__user__list">
+								<el-scrollbar ref="userScrollbar">
+									<el-tree
+										class="menu"
+										ref="userTree"
+										:data="user"
+										node-key="id"
+										highlight-current
+										:props="{
+											key: 'id',
+											label: 'name',
+											children: 'children',
+										}"
+										:default-checked-keys="selectedIds"
+										:show-checkbox="limit > 1"
+										check-on-click-node
+										@check-change="userClick"
+									></el-tree>
+								</el-scrollbar>
+							</div>
+							<footer>
+								<el-pagination
+									background
+									layout="prev,next"
+									small
+									:total="total"
+									:page-size="pageSize"
+									v-model:currentPage="currentPage"
+									@current-change="paginationChange"
+								></el-pagination>
+							</footer>
+						</div>
+					</div>
+				</div>
+				<div class="user-select__toicon">
+					<el-icon><arrow-right /></el-icon>
+				</div>
+				<div class="user-select__selected">
+					<header>已选 ({{ selected.length }})</header>
+					<ul>
+						<el-scrollbar>
+							<li
+								v-for="(item, index) in selected"
+								:key="item.id"
+							>
+								<span class="name">
+									<el-avatar
+										v-if="
+											$TOOL.data.get('IS_PRIMARY_TENANT')
+										"
+										:size="30"
+										:style="{
+											background:
+												$utils.getTenantColorById(
+													item.tenantId
+												) + '!important',
+										}"
+										>{{
+											item.name.substring(0, 1)
+										}}</el-avatar
+									>
+									<el-avatar v-else>{{
+										item.name.substring(0, 1)
+									}}</el-avatar>
+									<label>{{ item.name }}</label>
+								</span>
+								<span class="delete">
+									<el-button
+										text
+										type="primary"
+										icon="del-filled"
+										circle
+										size="small"
+										@click="deleteSelected(index)"
+									></el-button>
+								</span>
+							</li>
+						</el-scrollbar>
+					</ul>
+				</div>
+			</div>
+		</template>
+
+		<template #footer>
+			<el-button @click="dialogVisible = false">取 消</el-button>
+			<el-button type="primary" @click="save">确 认</el-button>
+		</template>
+	</el-dialog>
+</template>
+
+<script>
+import userService from "@/api/sys/userService";
+import officeService from "@/api/sys/officeService";
+export default {
+	props: {
+		tenantId: { type: String, default: null },
+		limit: {
+			type: Number,
+			default: 999999,
+		},
+	},
+	data() {
+		return {
+			searchForm: {
+				loginName: "",
+				companyDTO: {
+					id: "",
+				},
+				officeDTO: {
+					id: "",
+				},
+				name: "",
+			},
+			dialogVisible: false,
+			showGrouploading: false,
+			showUserloading: false,
+			groupId: "",
+			pageSize: 10,
+			total: 0,
+			currentPage: 1,
+			group: [],
+			user: [],
+			role: [],
+			type: 1,
+			selected: [],
+			value: [],
+		};
+	},
+	computed: {
+		selectedIds() {
+			return this.selected.map((t) => t.id);
+		},
+	},
+	methods: {
+		//打开赋值
+		async open(data) {
+			this.value = data || [];
+			this.selected = JSON.parse(JSON.stringify(data || []));
+			this.dialogVisible = true;
+			await this.getGroup();
+			this.getUser();
+		},
+		//获取组织
+		async getGroup() {
+			this.showGrouploading = true;
+			// officeService.treeData().then((data) => {
+			// 	this.officeTreeData = data
+			// 	this.showGrouploading = false;
+			// })
+			var res = await officeService.treeData({ tenantId: this.tenantId });
+			this.showGrouploading = false;
+			// var allNode = { id: "", type: "1", name: "所有" };
+			// res.unshift(allNode);
+			this.group = res;
+			this.searchForm.companyDTO.id = this.group[0].id;
+		},
+		//获取用户
+		async getUser() {
+			this.showUserloading = true;
+			userService
+				.list({
+					current: this.currentPage,
+					size: this.pageSize,
+					...this.searchForm,
+					"tenantDTO.id": this.tenantId,
+				})
+				.then((data) => {
+					this.user = data.records;
+					this.total = data.total;
+					// this.pageNo = data.current
+					this.showUserloading = false;
+					this.$refs.userScrollbar.setScrollTop(0);
+				});
+		},
+		//组织点击
+		groupClick(data) {
+			if (data.type === "1") {
+				this.searchForm.companyDTO.id = data.id;
+				this.searchForm.officeDTO.id = "";
+			} else {
+				this.searchForm.companyDTO.id = "";
+				this.searchForm.officeDTO.id = data.id;
+			}
+			this.currentPage = 1;
+			this.groupId = data.id;
+			this.getUser();
+		},
+		//用户点击
+		userClick(data, checked) {
+			if (checked) {
+				if (this.limit === 1) {
+					this.selected = [
+						{
+							id: data.id,
+							name: data.name,
+							tenantId: data.tenantDTO?.id,
+						},
+					];
+				} else {
+					this.selected.push({
+						id: data.id,
+						name: data.name,
+						tenantId: data.tenantDTO?.id,
+					});
+				}
+			} else {
+				this.selected = this.selected.filter(
+					(item) => item.id != data.id
+				);
+			}
+		},
+		//用户分页点击
+		paginationChange() {
+			this.getUser();
+		},
+		//用户搜索
+		search() {
+			// this.groupId = ''
+			// this.$refs.groupTree.setCurrentKey(this.groupId)
+			this.currentPage = 1;
+			this.getUser();
+		},
+		//删除已选
+		deleteSelected(index) {
+			this.selected.splice(index, 1);
+			console.log(this.selected);
+			if (this.type == 1) {
+				this.$refs.userTree.setCheckedKeys(this.selectedIds);
+			} else if (this.type == 2) {
+				this.$refs.groupTree.setCheckedKeys(this.selectedIds);
+			}
+		},
+		//提交保存
+		save() {
+			this.value.splice(0, this.value.length);
+			this.selected.map((item) => {
+				this.value.push(item);
+			});
+			if (this.limit < this.value.length) {
+				this.$message.error(`你最多只能选择${this.limit}个用户`);
+				return;
+			}
+			this.$emit("doSubmit", this.value);
+			console.log(this.value)
+			this.dialogVisible = false;
+		},
+	},
+};
+</script>
+
+<style scoped>
+.user-select {
+	display: flex;
+}
+.user-select__left {
+	width: 400px;
+}
+.user-select__right {
+	flex: 1;
+}
+.user-select__selected li .name .el-avatar {
+	margin-right: 2px;
+	height: 10;
+	width: 25px;
+	height: 25px;
+}
+.user-select__search {
+	padding-bottom: 10px;
+}
+
+.user-select__select {
+	display: flex;
+	border: 1px solid var(--el-border-color-light);
+	background: var(--el-color-white);
+}
+.user-select__tree {
+	width: 200px;
+	height: 300px;
+	border-right: 1px solid var(--el-border-color-light);
+}
+.user-select__user {
+	width: 200px;
+	height: 300px;
+	display: flex;
+	flex-direction: column;
+}
+.user-select__user__list {
+	flex: 1;
+	overflow: auto;
+}
+.user-select__user footer {
+	height: 36px;
+	padding-top: 5px;
+	border-top: 1px solid var(--el-border-color-light);
+}
+
+.user-select__toicon {
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	margin: 0 10px;
+}
+.user-select__toicon i {
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	background: #ccc;
+	width: 20px;
+	height: 20px;
+	text-align: center;
+	line-height: 20px;
+	border-radius: 50%;
+	color: #fff;
+}
+
+.user-select__selected {
+	height: 345px;
+	width: 200px;
+	border: 1px solid var(--el-border-color-light);
+	background: var(--el-color-white);
+}
+.user-select__selected header {
+	height: 43px;
+	line-height: 43px;
+	border-bottom: 1px solid var(--el-border-color-light);
+	padding: 0 15px;
+	font-size: 16px;
+}
+.user-select__selected ul {
+	height: 300px;
+	overflow: auto;
+}
+.user-select__selected li {
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	padding: 5px 5px 5px 15px;
+	height: 38px;
+}
+.user-select__selected li .name {
+	display: flex;
+	align-items: center;
+}
+.user-select__selected li .name .el-avatar {
+	margin-right: 10px;
+}
+.user-select__selected li .delete {
+	display: none;
+}
+.user-select__selected li:hover {
+	background: var(--el-color-primary-light-9);
+}
+.user-select__selected li:hover .delete {
+	display: inline-block;
+}
+.user-select-role .user-select__left {
+	width: 200px;
+}
+.user-select-role .user-select__tree {
+	border: none;
+	height: 343px;
+}
+</style>

+ 121 - 0
src/components/userSelectPlan/index.vue

@@ -0,0 +1,121 @@
+<template>
+	<template v-if="printRead">
+		<label>{{ name }}</label>
+	</template>
+	<template v-else>
+		<el-input
+			placeholder="请选择"
+			readonly
+			:clearable="clearable"
+			:disabled="disabled"
+			style="line-hight: 40px"
+			v-model="name"
+		>
+			<template #append>
+				<el-button
+					:disabled="disabled"
+					:readonly="readonly"
+					@click="showUserSelect"
+					icon="search"
+				></el-button>
+			</template>
+		</el-input>
+		<user-select
+			ref="userSelect"
+			@doSubmit="selectUsersToInput"
+			:tenantId="tenantId"
+			:limit="limit"
+		></user-select>
+	</template>
+</template>
+<script>
+	import userSelect from "./UserSelectDialog";
+	import userService from "@/api/sys/userService";
+	export default {
+		data() {
+			return {
+				name: "",
+				selectData: [],
+			};
+		},
+		props: {
+			limit: Number,
+			modelValue: { type: String, default: "" },
+			tenantId: { type: String, default: null },
+			printRead: {
+				type: Boolean,
+				default: () => {
+					return false;
+				},
+			},
+			clearable: {
+				type: Boolean,
+				default: () => {
+					return true;
+				},
+			},
+			readonly: {
+				type: Boolean,
+				default: () => {
+					return false;
+				},
+			},
+			disabled: {
+				type: Boolean,
+				default: () => {
+					return false;
+				},
+			},
+		},
+		components: {
+			userSelect,
+		},
+		watch: {
+			modelValue: {
+				handler(newVal) {
+					this.selectData = [];
+					if (newVal) {
+						newVal.split(",").forEach((id) => {
+							userService.queryById(id).then((data) => {
+								if (data && data.id !== "") {
+									this.selectData.push(data);
+									this.name = this.selectData
+										.map((user) => {
+											return user.name;
+										})
+										.join(",");
+								}
+							});
+						});
+					} else {
+						this.name = "";
+					}
+				},
+				immediate: true,
+				deep: false,
+			},
+		},
+		methods: {
+			selectUsersToInput(users) {
+				let selectIds = users
+					.map((user) => {
+						return user.id;
+					})
+					.join(",");
+				this.$emit("update:modelValue", selectIds);
+			},
+			showUserSelect() {
+				this.$refs.userSelect.open(this.selectData);
+			},
+		},
+	};
+</script>
+<style>
+	.el-form-item__content .el-input-group {
+		vertical-align: middle;
+	}
+	.el-tag + .el-tag {
+		margin-left: 5px;
+		margin-bottom: 5px;
+	}
+</style>

+ 504 - 0
src/views/cw/projectRecords/CwProjectPlanList.vue

@@ -0,0 +1,504 @@
+<template>
+  <div class="page">
+    <el-form :inline="true" v-if="searchVisible" class="query-form m-b-10" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-form-item label="项目名称" prop="projectName">
+        <el-input v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="项目编号" prop="projectNumber">
+        <el-input v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+      </el-form-item>
+      <el-form-item v-if="showHideItem" label="项目经理1" prop="projectMasterName">
+<!--        <el-input v-model="searchForm.projectMasterName" placeholder="请输入项目经理" clearable></el-input>-->
+        <UserSelect2 :limit='1' :modelValue="searchForm.projectMasterName" @update:modelValue='(value, label) => {searchForm.projectMasterName = value}'></UserSelect2>
+      </el-form-item>
+      <el-form-item v-if="showHideItem" label="项目经理2" prop="realHeaderName">
+        <!--        <el-input v-model="searchForm.projectMasterName" placeholder="请输入项目经理" clearable></el-input>-->
+        <UserSelect2 :limit='1' :modelValue="searchForm.realHeaderName" @update:modelValue='(value, label) => {searchForm.realHeaderName = value}'></UserSelect2>
+      </el-form-item>
+		<el-form-item v-if="showHideItem" label="创建人" prop="createBy.name">
+			<!--        <el-input  v-model="searchForm.createBy.name" placeholder="请输入创建人" clearable></el-input>-->
+			<UserSelect2 :limit='1' :modelValue="searchForm.createBy.name" @update:modelValue='(value, label) => {searchForm.createBy.name = value}'></UserSelect2>
+		</el-form-item>
+      <el-form-item v-if="showHideItem" label="创建时间" prop="createDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="YYYY-MM-DD HH:mm:ss"
+          value-format="YYYY-MM-DD HH:mm:ss"
+          v-model="searchForm.createDates"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+		<!--<el-form-item v-if="showHideItem" label="业务类型" prop="businessType">
+			<SelectTree
+				ref="typeTree"
+				:props="{
+                    value: 'id',             // ID字段名
+                    label: 'name',         // 显示名称
+                    children: 'children'    // 子级字段名
+                  }"
+				:url="'/finance-server/projectRecords/cw_project_business_type/list'"
+				:value="searchForm.businessType"
+				:clearable="true"
+				:accordion="true"
+				size="default"
+				@getValue="(value) => {searchForm.businessType=value}"/>
+		</el-form-item>-->
+		<el-form-item v-if="showHideItem" label="报备类型" prop="filingType">
+			<el-select v-model="searchForm.reportType" placeholder="请选择" style="width:100%;">
+				<el-option
+					v-for="item in $dictUtils.getDictList('cw_work_client_report_type')"
+					:key="item.value"
+					:label="item.label"
+					:value="item.value">
+				</el-option>
+			</el-select>
+		</el-form-item>
+      <el-form-item>
+        <el-button type="default" @click="showHide" :icon="showHideIcon">{{showHideName}}</el-button>
+        <el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
+        <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="jp-table top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" export custom>
+        <template #buttons>
+<!--          <el-button v-if="hasPermission('cwProjectRecords:add')" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>-->
+          <!--          <el-button v-if="hasPermission('klg:question:del')" type="danger" icon="el-icon-delete" @click="del()" :disabled="$refs.questionsTable && $refs.questionsTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
+        </template>
+		  <template #tools>
+			  <vxe-button
+				  text
+				  type="primary"
+				  :title="searchVisible ? '收起检索' : '展开检索'"
+				  icon="vxe-icon-search"
+				  class="tool-btn"
+				  @click="searchVisible = !searchVisible"
+			  ></vxe-button>
+		  </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 90px)">
+        <vxe-table
+          :key="tableKey"
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :export-config="{
+                    remote: true,
+                    filename: `项目数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    sheetName: `项目数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    exportMethod: exportMethod,
+                    types: ['xls'],
+                    modes: ['current', 'selected', 'all']
+                  }"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <!--<vxe-column type="checkbox" width="40" ></vxe-column>-->
+          <vxe-column min-width="230" align="center" title="项目名称" field="projectName">
+            <template #default="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('cwProjectRecords:view')" @click="view(scope.row.id)">{{scope.row.projectName}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('cwProjectRecords:view')"  @click="view(scope.row.id,)">{{scope.row.projectName}}</el-link>
+              <span v-else>{{scope.row.projectName}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="140" align="center" title="项目编号" field="projectNumber"></vxe-column>
+			<vxe-column min-width="110" align="center" title="项目规模(元)" field="projectMoney"></vxe-column>
+			<!--<vxe-column min-width="160" align="center" title="业务类型" field="businessTypeName"></vxe-column>-->
+          <vxe-column min-width="230" align="center" title="合同名称" field="contractName">
+            <template #default="scope">
+              <el-link  type="primary" :underline="false" v-if="commonJS.isNotEmpty(scope.row.contractId)&&commonJS.isNotEmpty(scope.row.contractName)" @click="viewContract(scope.row.contractId)">{{scope.row.contractName}}</el-link>
+              <span v-else style="color: red">暂无合同</span>
+            </template>
+          </vxe-column>
+			<vxe-column min-width="80" align="center" title="创建人" field="createBy.name"></vxe-column>
+          <vxe-column min-width="100" align="center" title="项目经理1" field="projectMasterName"></vxe-column>
+          <vxe-column min-width="100" align="center" title="项目经理2" field="realHeaderName"></vxe-column>
+			<vxe-column min-width="200" align="center" title="客户名称" field="clientContactsName"></vxe-column>
+          <vxe-column min-width="120" align="center" title="创建时间" field="createTime"></vxe-column>
+			<vxe-column min-width="120" align="center" title="计划开始时间" field="planStartDate"></vxe-column>
+			<vxe-column min-width="120" align="center" title="计划结束时间" field="planEndDate"></vxe-column>
+          <vxe-column title="操作" width="200px" fixed="right" align="center">
+            <template  #default="scope">
+              <el-button v-if="hasPermission('projectPlan:edit')&& (scope.row.isHavePlan === '0')&&(scope.row.createBy.id === $store.state.user.id || isAdmin || haveProjectIds.includes(scope.row.id))" text type="primary"  size="small" @click="edit(scope.row)">添加</el-button>
+              <el-button v-if="hasPermission('projectPlan:edit')&& (scope.row.isHavePlan === '1')&&(scope.row.createBy.id === $store.state.user.id || isAdmin || haveProjectIds.includes(scope.row.id))" text type="primary"  size="small" @click="edit(scope.row)">编辑</el-button>
+<!--              <el-button v-else-if="hasPermission('cwProjectRecords:edit')&&isAdmin" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>-->
+<!--              <el-button v-if="hasPermission('cwProjectRecords:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>-->
+<!--              <el-button v-if="hasPermission('cwProjectRecords:del')&&(scope.row.reportReview !== '1' || isAdmin)&&(scope.row.createBy.id === $store.state.user.id || isAdmin || haveProjectIds.includes(scope.row.id))" text type="primary"   size="small" @click="del(scope.row.id)">删除</el-button>-->
+<!--              <el-button v-else-if="hasPermission('cwProjectRecords:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3' ||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>-->
+<!--				<el-button v-if="hasPermission('cwProjectRecords:add:reportNum')&&(scope.row.reportNo === '' || scope.row.reportNo === undefined)&&(scope.row.reportReview !== '1' )&&(scope.row.createBy.id === $store.state.user.id || haveProjectIds.includes(scope.row.id))" text type="primary"   size="small" @click="addReportNum(scope.row.id,scope.row.projectNumber)">生成报告号</el-button>-->
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+    <ProjectRecordsForm ref="projectRecordsForm" @refreshList="refreshList"></ProjectRecordsForm>
+    <ContractNameForm ref="contractNameForm"></ContractNameForm>
+    <ProjectRecordsAddForm ref="projectRecordsAddForm" @refreshList="refreshList"></ProjectRecordsAddForm>
+	  <ProjectPlanForm ref="projectPlanForm" @refreshList="refreshList"></ProjectPlanForm>
+  </div>
+</template>
+
+<script>
+	import ReportReviewService from '@/api/cw/reportManagement/ReportReviewService'
+	import UserSelect2 from '@/components/userSelect'
+  import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  import taskService from '@/api/flowable/TaskService'
+  import processService from '@/api/flowable/ProcessService'
+  import ProjectRecordsForm from './ProjectRecordsForm'
+  import pick from 'lodash.pick'
+  import userService from '@/api/sys/UserService'
+  import UserSelect from '@/views/cw/workClientInfo/clientUserSelect'
+  import ContractNameForm from '../workContract/ContractNameForm'
+  import ProjectRecordsAddForm from './ProjectRecordsAddForm'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+	import ProjectPlanForm from './ProjectPlanForm'
+
+	export default {
+    data () {
+      return {
+		searchVisible: true,
+        showHideItem: false,
+        showHideIcon: 'el-icon-arrow-down',
+        showHideName: '展示',
+        searchForm: {
+          projectMasterName: '',
+          projectNumber: '',
+		  businessType:'',
+          projectName: '',
+          createDates: [],
+          status: '',
+          realHeaderName: '',
+			createBy: {
+				name: ''
+			}
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        tableKey: '',
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false,
+        haveProjectIds: ''
+      }
+    },
+		ReportReviewService: null,
+    created () {
+		this.reportReviewService = new ReportReviewService()
+    },
+    components: {
+      ProjectRecordsForm,
+      UserSelect,
+      ContractNameForm,
+      ProjectRecordsAddForm,
+	  UserSelect2,
+	  SelectTree,
+		ProjectPlanForm
+    },
+    computed: {
+      userName () {
+        return this.$store.state.user.name
+      },
+      user () {
+        this.createName = this.$store.state.user.name
+        return this.$store.state.user
+      }
+    },
+    mounted () {
+		this.$nextTick(() => {
+			//将表格和工具栏进行关联
+			const $table = this.$refs.projectTable;
+			const $toolbar = this.$refs.toolbarRef;
+			$table.connect($toolbar);
+		})
+      this.refreshList()
+    },
+    activated () {
+      this.refreshList()
+    },
+    methods: {
+      showHide () {
+        if (this.showHideItem === false) {
+          this.showHideItem = true
+          this.showHideIcon = 'el-icon-arrow-up'
+          this.showHideName = '隐藏'
+        } else {
+          this.showHideItem = false
+          this.showHideIcon = 'el-icon-arrow-down'
+          this.showHideName = '展示'
+        }
+      },
+      // 新增
+      add () {
+        this.$refs.projectRecordsAddForm.init('add', 'false')
+      },
+      // 修改
+      edit (row) {
+      	console.log("row",row.isHavePlan)
+      	if (row.isHavePlan === '0'){
+			this.$refs.projectPlanForm.init('add', row.id)
+		}else {
+			this.$refs.projectPlanForm.init('edit', row.id)
+		}
+
+      },
+      // 查看
+      view (id) {
+        this.$refs.projectRecordsForm.init('view', id)
+      },
+      viewContract (id) {
+        this.$refs.contractNameForm.init('view', id)
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        userService.is().then((data) => {
+        	console.log(data)
+          this.isAdmin = data
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+		  this.searchForm.projectType = '1'
+        projectRecordsService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then((data) => {
+        	console.log('data',data.records)
+          projectRecordsService.getHaveProjectIds().then((data) => {
+            if (this.commonJS.isNotEmpty(data)) {
+              this.haveProjectIds = data.map(i => {
+                if (this.commonJS.isNotEmpty(i)) {
+                  return i
+                }
+              }).join(',')
+            }
+          })
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          // this.tableKey = Math.random()
+          this.loading = false
+        })
+        this.checkIsAdmin()
+        processService.getByName('财务-项目登记').then((data) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionAuditId = data.id
+            this.procDefAuditKey = data.key
+          }
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.projectTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          projectRecordsService.delete(ids).then((data) => {
+            if (data === '删除成功') {
+              this.$message.success(data)
+            } else {
+              this.$message.error(data)
+            }
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+		//生成报告号
+		addReportNum (id,projectNumber) {
+      		//根据项目id创建一条报告信息,同时生成报告号  默认是咨字报告号
+			let param = {
+				'projectId' : id,
+				'projectNumber' : projectNumber,
+			}
+			this.reportReviewService.saveNew(param).then((data) => {
+				this.refreshList()
+			}).catch(() => {
+
+			})
+
+		},
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      start () {
+        // 读取流程表单
+        let tabTitle = `发起流程【项目登记】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [项目登记]`
+        taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.formType,
+                formUrl: data.formUrl,
+                formTitle: processTitle,
+                businessId: 'false',
+                isShow: false,
+                routePath: '/cw/projectRecords/ProjectRecordsList'
+              }
+            })
+          })
+      },
+      // 发起项目登记
+      push (row) {
+        // 读取流程表单
+        let title = `发起流程【项目登记】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[项目登记]`
+        let status = 'startAndHold'
+        if (row.status === '3') {
+          status = 'startAndClose'
+        } else if (row.status === '4') {
+          status = 'reapplyFlag'
+        }
+        taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          businessId: row.id,
+          businessTable: 'cw_project_records'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                title: title,
+                formType: data.formType,
+                formUrl: data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'cw_project_records',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/cw/projectRecords/ProjectRecordsList'
+              }
+            })
+          })
+      },
+      // 查看项目登记流程结果
+      detail (row) {
+        if (row.status !== '0' && row.status !== '1') {
+          // eslint-disable-next-line eqeqeq
+          taskService.getTaskDef({
+            procInsId: row.procInsId,
+            procDefId: this.processDefinitionAuditId
+          }).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskFormDetail',
+              query: {
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                isShow: 'false',
+                readOnly: true,
+                title: '项目登记' + '流程详情',
+                formTitle: '项目登记' + '流程详情',
+                businessId: row.id,
+                status: 'reback'
+              }
+            })
+          })
+        }
+      },
+      // 撤回项目登记
+      reback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await projectRecordsService.queryById(row.id).then((data) => {
+            if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.refreshList()
+            } else {
+              processService.revokeProcIns(row.procInsId).then((data) => {
+                let form = {status: '3', id: row.id}
+                projectRecordsService.updateStatusById(form)
+                this.$message.success(data)
+                this.refreshList()
+              })
+            }
+          })
+        })
+      },
+      // 自定义服务端导出
+      exportMethod ({ options }) {
+        // 传给服务端的参数
+        const params = {
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm,
+          filename: options.filename,
+          sheetName: options.sheetName,
+          isHeader: options.isHeader,
+          original: options.original,
+          mode: options.mode,
+          selectIds: options.mode === 'selected' ? options.map(item => item.id) : [],
+          exportFields: options.columns.map(column => column.property)
+        }
+        return projectRecordsService.exportFile(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res, options.filename + '.xls')
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
+    }
+  }
+</script>

+ 504 - 0
src/views/cw/projectRecords/CwProjectPlanList2.vue

@@ -0,0 +1,504 @@
+<template>
+	<div class="page">
+		<el-form :inline="true" v-if="searchVisible" class="query-form m-b-10" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+			<!-- 搜索框-->
+			<el-form-item label="项目名称" prop="projectName">
+				<el-input v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+			</el-form-item>
+			<el-form-item label="项目编号" prop="projectNumber">
+				<el-input v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="项目经理1" prop="projectMasterName">
+				<!--        <el-input v-model="searchForm.projectMasterName" placeholder="请输入项目经理" clearable></el-input>-->
+				<UserSelect2 :limit='1' :modelValue="searchForm.projectMasterName" @update:modelValue='(value, label) => {searchForm.projectMasterName = value}'></UserSelect2>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="项目经理2" prop="realHeaderName">
+				<!--        <el-input v-model="searchForm.projectMasterName" placeholder="请输入项目经理" clearable></el-input>-->
+				<UserSelect2 :limit='1' :modelValue="searchForm.realHeaderName" @update:modelValue='(value, label) => {searchForm.realHeaderName = value}'></UserSelect2>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="创建人" prop="createBy.name">
+				<!--        <el-input  v-model="searchForm.createBy.name" placeholder="请输入创建人" clearable></el-input>-->
+				<UserSelect2 :limit='1' :modelValue="searchForm.createBy.name" @update:modelValue='(value, label) => {searchForm.createBy.name = value}'></UserSelect2>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="创建时间" prop="createDates">
+				<el-date-picker
+					placement="bottom-start"
+					format="YYYY-MM-DD HH:mm:ss"
+					value-format="YYYY-MM-DD HH:mm:ss"
+					v-model="searchForm.createDates"
+					type="datetimerange"
+					range-separator="至"
+					start-placeholder="开始日期"
+					end-placeholder="结束日期">
+				</el-date-picker>
+			</el-form-item>
+			<!--<el-form-item v-if="showHideItem" label="业务类型" prop="businessType">
+				<SelectTree
+					ref="typeTree"
+					:props="{
+						value: 'id',             // ID字段名
+						label: 'name',         // 显示名称
+						children: 'children'    // 子级字段名
+					  }"
+					:url="'/finance-server/projectRecords/cw_project_business_type/list'"
+					:value="searchForm.businessType"
+					:clearable="true"
+					:accordion="true"
+					size="default"
+					@getValue="(value) => {searchForm.businessType=value}"/>
+			</el-form-item>-->
+			<el-form-item v-if="showHideItem" label="报备类型" prop="filingType">
+				<el-select v-model="searchForm.reportType" placeholder="请选择" style="width:100%;">
+					<el-option
+						v-for="item in $dictUtils.getDictList('cw_work_client_report_type')"
+						:key="item.value"
+						:label="item.label"
+						:value="item.value">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item>
+				<el-button type="default" @click="showHide" :icon="showHideIcon">{{showHideName}}</el-button>
+				<el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
+				<el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+			</el-form-item>
+		</el-form>
+		<div class="jp-table top" style="">
+			<vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" export custom>
+				<template #buttons>
+					<!--          <el-button v-if="hasPermission('cwProjectRecords:add')" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>-->
+					<!--          <el-button v-if="hasPermission('klg:question:del')" type="danger" icon="el-icon-delete" @click="del()" :disabled="$refs.questionsTable && $refs.questionsTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
+				</template>
+				<template #tools>
+					<vxe-button
+						text
+						type="primary"
+						:title="searchVisible ? '收起检索' : '展开检索'"
+						icon="vxe-icon-search"
+						class="tool-btn"
+						@click="searchVisible = !searchVisible"
+					></vxe-button>
+				</template>
+			</vxe-toolbar>
+			<div style="height: calc(100% - 90px)">
+				<vxe-table
+					:key="tableKey"
+					border="inner"
+					auto-resize
+					resizable
+					height="auto"
+					:loading="loading"
+					size="small"
+					ref="projectTable"
+					show-header-overflow
+					show-overflow
+					highlight-hover-row
+					:menu-config="{}"
+					@sort-change="sortChangeHandle"
+					:sort-config="{remote:true}"
+					:export-config="{
+                    remote: true,
+                    filename: `项目数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    sheetName: `项目数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    exportMethod: exportMethod,
+                    types: ['xls'],
+                    modes: ['current', 'selected', 'all']
+                  }"
+					:data="dataList"
+					:checkbox-config="{}">
+					<vxe-column type="seq" width="60" title="序号"></vxe-column>
+					<!--<vxe-column type="checkbox" width="40" ></vxe-column>-->
+					<vxe-column min-width="230" align="center" title="项目名称" field="projectName">
+						<template #default="scope">
+							<el-link  type="primary" :underline="false" v-if="hasPermission('cwProjectRecords:view')" @click="view(scope.row.id)">{{scope.row.projectName}}</el-link>
+							<el-link  type="primary" :underline="false" v-else-if="hasPermission('cwProjectRecords:view')"  @click="view(scope.row.id,)">{{scope.row.projectName}}</el-link>
+							<span v-else>{{scope.row.projectName}}</span>
+						</template>
+					</vxe-column>
+					<vxe-column min-width="140" align="center" title="项目编号" field="projectNumber"></vxe-column>
+					<vxe-column min-width="110" align="center" title="项目规模(元)" field="projectMoney"></vxe-column>
+					<!--<vxe-column min-width="160" align="center" title="业务类型" field="businessTypeName"></vxe-column>-->
+					<vxe-column min-width="230" align="center" title="合同名称" field="contractName">
+						<template #default="scope">
+							<el-link  type="primary" :underline="false" v-if="commonJS.isNotEmpty(scope.row.contractId)&&commonJS.isNotEmpty(scope.row.contractName)" @click="viewContract(scope.row.contractId)">{{scope.row.contractName}}</el-link>
+							<span v-else style="color: red">暂无合同</span>
+						</template>
+					</vxe-column>
+					<vxe-column min-width="80" align="center" title="创建人" field="createBy.name"></vxe-column>
+					<vxe-column min-width="100" align="center" title="项目经理1" field="projectMasterName"></vxe-column>
+					<vxe-column min-width="100" align="center" title="项目经理2" field="realHeaderName"></vxe-column>
+					<vxe-column min-width="200" align="center" title="客户名称" field="clientContactsName"></vxe-column>
+					<vxe-column min-width="120" align="center" title="创建时间" field="createTime"></vxe-column>
+					<vxe-column min-width="120" align="center" title="计划开始时间" field="planStartDate"></vxe-column>
+					<vxe-column min-width="120" align="center" title="计划结束时间" field="planEndDate"></vxe-column>
+					<vxe-column title="操作" width="200px" fixed="right" align="center">
+						<template  #default="scope">
+							<el-button v-if="hasPermission('projectPlan:edit')&& (scope.row.isHavePlan === '0')&&(scope.row.createBy.id === $store.state.user.id || isAdmin || haveProjectIds.includes(scope.row.id))" text type="primary"  size="small" @click="edit(scope.row)">添加</el-button>
+							<el-button v-if="hasPermission('projectPlan:edit')&& (scope.row.isHavePlan === '1')&&(scope.row.createBy.id === $store.state.user.id || isAdmin || haveProjectIds.includes(scope.row.id))" text type="primary"  size="small" @click="edit(scope.row)">编辑</el-button>
+							<!--              <el-button v-else-if="hasPermission('cwProjectRecords:edit')&&isAdmin" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>-->
+							<!--              <el-button v-if="hasPermission('cwProjectRecords:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>-->
+							<!--              <el-button v-if="hasPermission('cwProjectRecords:del')&&(scope.row.reportReview !== '1' || isAdmin)&&(scope.row.createBy.id === $store.state.user.id || isAdmin || haveProjectIds.includes(scope.row.id))" text type="primary"   size="small" @click="del(scope.row.id)">删除</el-button>-->
+							<!--              <el-button v-else-if="hasPermission('cwProjectRecords:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3' ||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>-->
+							<!--				<el-button v-if="hasPermission('cwProjectRecords:add:reportNum')&&(scope.row.reportNo === '' || scope.row.reportNo === undefined)&&(scope.row.reportReview !== '1' )&&(scope.row.createBy.id === $store.state.user.id || haveProjectIds.includes(scope.row.id))" text type="primary"   size="small" @click="addReportNum(scope.row.id,scope.row.projectNumber)">生成报告号</el-button>-->
+						</template>
+					</vxe-column>
+				</vxe-table>
+				<vxe-pager
+					background
+					size="small"
+					:current-page="tablePage.currentPage"
+					:page-size="tablePage.pageSize"
+					:total="tablePage.total"
+					:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+					:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+					@page-change="currentChangeHandle">
+				</vxe-pager>
+			</div>
+		</div>
+		<ProjectRecordsForm ref="projectRecordsForm" @refreshList="refreshList"></ProjectRecordsForm>
+		<ContractNameForm ref="contractNameForm"></ContractNameForm>
+		<ProjectRecordsAddForm ref="projectRecordsAddForm" @refreshList="refreshList"></ProjectRecordsAddForm>
+		<ProjectPlanForm ref="projectPlanForm" @refreshList="refreshList"></ProjectPlanForm>
+	</div>
+</template>
+
+<script>
+	import ReportReviewService from '@/api/cw/reportManagement/ReportReviewService'
+	import UserSelect2 from '@/components/userSelect'
+	import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+	import taskService from '@/api/flowable/TaskService'
+	import processService from '@/api/flowable/ProcessService'
+	import ProjectRecordsForm from './ProjectRecordsForm'
+	import pick from 'lodash.pick'
+	import userService from '@/api/sys/UserService'
+	import UserSelect from '@/views/cw/workClientInfo/clientUserSelect'
+	import ContractNameForm from '../workContract/ContractNameForm'
+	import ProjectRecordsAddForm from './ProjectRecordsAddForm'
+	import SelectTree from '@/components/treeSelect/treeSelect.vue'
+	import ProjectPlanForm from './ProjectPlanForm'
+
+	export default {
+		data () {
+			return {
+				searchVisible: true,
+				showHideItem: false,
+				showHideIcon: 'el-icon-arrow-down',
+				showHideName: '展示',
+				searchForm: {
+					projectMasterName: '',
+					projectNumber: '',
+					businessType:'',
+					projectName: '',
+					createDates: [],
+					status: '',
+					realHeaderName: '',
+					createBy: {
+						name: ''
+					}
+				},
+				dataList: [],
+				tablePage: {
+					total: 0,
+					currentPage: 1,
+					pageSize: 10,
+					orders: []
+				},
+				tableKey: '',
+				loading: false,
+				processDefinitionAuditId: '',
+				procDefAuditKey: '',
+				isAdmin: false,
+				haveProjectIds: ''
+			}
+		},
+		ReportReviewService: null,
+		created () {
+			this.reportReviewService = new ReportReviewService()
+		},
+		components: {
+			ProjectRecordsForm,
+			UserSelect,
+			ContractNameForm,
+			ProjectRecordsAddForm,
+			UserSelect2,
+			SelectTree,
+			ProjectPlanForm
+		},
+		computed: {
+			userName () {
+				return this.$store.state.user.name
+			},
+			user () {
+				this.createName = this.$store.state.user.name
+				return this.$store.state.user
+			}
+		},
+		mounted () {
+			this.$nextTick(() => {
+				//将表格和工具栏进行关联
+				const $table = this.$refs.projectTable;
+				const $toolbar = this.$refs.toolbarRef;
+				$table.connect($toolbar);
+			})
+			this.refreshList()
+		},
+		activated () {
+			this.refreshList()
+		},
+		methods: {
+			showHide () {
+				if (this.showHideItem === false) {
+					this.showHideItem = true
+					this.showHideIcon = 'el-icon-arrow-up'
+					this.showHideName = '隐藏'
+				} else {
+					this.showHideItem = false
+					this.showHideIcon = 'el-icon-arrow-down'
+					this.showHideName = '展示'
+				}
+			},
+			// 新增
+			add () {
+				this.$refs.projectRecordsAddForm.init('add', 'false')
+			},
+			// 修改
+			edit (row) {
+				console.log("row",row.isHavePlan)
+				if (row.isHavePlan === '0'){
+					this.$refs.projectPlanForm.init('add', row.id)
+				}else {
+					this.$refs.projectPlanForm.init('edit', row.id)
+				}
+
+			},
+			// 查看
+			view (id) {
+				this.$refs.projectRecordsForm.init('view', id)
+			},
+			viewContract (id) {
+				this.$refs.contractNameForm.init('view', id)
+			},
+			// 查询当前用户是否是管理员用户
+			checkIsAdmin () {
+				userService.is().then((data) => {
+					console.log(data)
+					this.isAdmin = data
+				})
+			},
+			// 获取数据列表
+			refreshList () {
+				this.loading = true
+				this.searchForm.projectType = '2'
+				projectRecordsService.list({
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm
+				}).then((data) => {
+					console.log('data',data.records)
+					projectRecordsService.getHaveProjectIds().then((data) => {
+						if (this.commonJS.isNotEmpty(data)) {
+							this.haveProjectIds = data.map(i => {
+								if (this.commonJS.isNotEmpty(i)) {
+									return i
+								}
+							}).join(',')
+						}
+					})
+					this.dataList = data.records
+					this.tablePage.total = data.total
+					// this.tableKey = Math.random()
+					this.loading = false
+				})
+				this.checkIsAdmin()
+				processService.getByName('财务-项目登记').then((data) => {
+					if (!this.commonJS.isEmpty(data.id)) {
+						this.processDefinitionAuditId = data.id
+						this.procDefAuditKey = data.key
+					}
+				})
+			},
+			// 当前页
+			currentChangeHandle ({ currentPage, pageSize }) {
+				this.tablePage.currentPage = currentPage
+				this.tablePage.pageSize = pageSize
+				this.refreshList()
+			},
+			// 排序
+			sortChangeHandle (column) {
+				this.tablePage.orders = []
+				if (column.order != null) {
+					this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+				}
+				this.refreshList()
+			},
+			// 删除
+			del (id) {
+				let ids = id || this.$refs.projectTable.getCheckboxRecords().map(item => {
+					return item.id
+				}).join(',')
+				this.$confirm(`确定删除所选项吗?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.loading = true
+					projectRecordsService.delete(ids).then((data) => {
+						if (data === '删除成功') {
+							this.$message.success(data)
+						} else {
+							this.$message.error(data)
+						}
+						this.refreshList()
+						this.loading = false
+					})
+				})
+			},
+			//生成报告号
+			addReportNum (id,projectNumber) {
+				//根据项目id创建一条报告信息,同时生成报告号  默认是咨字报告号
+				let param = {
+					'projectId' : id,
+					'projectNumber' : projectNumber,
+				}
+				this.reportReviewService.saveNew(param).then((data) => {
+					this.refreshList()
+				}).catch(() => {
+
+				})
+
+			},
+			resetSearch () {
+				this.$refs.searchForm.resetFields()
+				this.refreshList()
+			},
+			start () {
+				// 读取流程表单
+				let tabTitle = `发起流程【项目登记】`
+				let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [项目登记]`
+				taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+					status: 'startAndHold'}).then((data) => {
+					this.$router.push({
+						path: '/flowable/task/TaskForm',
+						query: {
+							...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+							procDefId: this.processDefinitionAuditId,
+							procDefKey: this.procDefAuditKey,
+							status: 'startAndHold',
+							title: tabTitle,
+							formType: data.formType,
+							formUrl: data.formUrl,
+							formTitle: processTitle,
+							businessId: 'false',
+							isShow: false,
+							routePath: '/cw/projectRecords/ProjectRecordsList'
+						}
+					})
+				})
+			},
+			// 发起项目登记
+			push (row) {
+				// 读取流程表单
+				let title = `发起流程【项目登记】`
+				let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[项目登记]`
+				let status = 'startAndHold'
+				if (row.status === '3') {
+					status = 'startAndClose'
+				} else if (row.status === '4') {
+					status = 'reapplyFlag'
+				}
+				taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+					businessId: row.id,
+					businessTable: 'cw_project_records'}).then((data) => {
+					this.$router.push({
+						path: '/flowable/task/TaskForm',
+						query: {
+							...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+							procDefId: this.processDefinitionAuditId,
+							procDefKey: this.procDefAuditKey,
+							title: title,
+							formType: data.formType,
+							formUrl: data.formUrl,
+							formTitle: processTitle,
+							businessTable: 'cw_project_records',
+							businessId: row.id,
+							isShow: 'false',
+							status: status,
+							routePath: '/cw/projectRecords/ProjectRecordsList'
+						}
+					})
+				})
+			},
+			// 查看项目登记流程结果
+			detail (row) {
+				if (row.status !== '0' && row.status !== '1') {
+					// eslint-disable-next-line eqeqeq
+					taskService.getTaskDef({
+						procInsId: row.procInsId,
+						procDefId: this.processDefinitionAuditId
+					}).then((data) => {
+						this.$router.push({
+							path: '/flowable/task/TaskFormDetail',
+							query: {
+								...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+								isShow: 'false',
+								readOnly: true,
+								title: '项目登记' + '流程详情',
+								formTitle: '项目登记' + '流程详情',
+								businessId: row.id,
+								status: 'reback'
+							}
+						})
+					})
+				}
+			},
+			// 撤回项目登记
+			reback (row) {
+				this.$confirm(`确定要撤回该申请吗?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(async () => {
+					await projectRecordsService.queryById(row.id).then((data) => {
+						if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+							this.$message.error('数据已发生改变或不存在,请刷新数据')
+							this.refreshList()
+						} else {
+							processService.revokeProcIns(row.procInsId).then((data) => {
+								let form = {status: '3', id: row.id}
+								projectRecordsService.updateStatusById(form)
+								this.$message.success(data)
+								this.refreshList()
+							})
+						}
+					})
+				})
+			},
+			// 自定义服务端导出
+			exportMethod ({ options }) {
+				// 传给服务端的参数
+				const params = {
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm,
+					filename: options.filename,
+					sheetName: options.sheetName,
+					isHeader: options.isHeader,
+					original: options.original,
+					mode: options.mode,
+					selectIds: options.mode === 'selected' ? options.map(item => item.id) : [],
+					exportFields: options.columns.map(column => column.property)
+				}
+				return projectRecordsService.exportFile(params).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, options.filename + '.xls')
+				}).catch(function (err) {
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+		}
+	}
+</script>

+ 480 - 0
src/views/cw/projectRecords/ProjectPlanForm.vue

@@ -0,0 +1,480 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+	  draggable
+      width="1400px"
+      height="500px"
+      @close="close"
+      append-to-body
+      v-model="visible">
+    <el-row>
+      <el-col :span="24">
+        <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'|| method ==='view'"
+                     label-width="135px" @submit.native.prevent>
+              <el-divider content-position="left"><i class="el-icon-document"></i> 项目计划信息</el-divider>
+              <el-row  :gutter="15">
+                <el-col :span="12">
+                  <el-form-item label="项目名称" prop="projectName"
+                                :rules="[
+                                {required: true, message:'项目名称不能为空', trigger:'blur'}
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.projectName" placeholder="请填写项目名称" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="项目编号" prop="projectNumber"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.projectNumber" placeholder="请填写项目编号" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="创建人" prop="createName"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.createName" placeholder="请填写创建人" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="创建时间" prop="createTime"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.createTime" placeholder="请填写创建时间" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+			<el-divider content-position="left"><i class="el-icon-document"></i> 项目计划列表
+				<el-button size="default" style="margin-left: 20px" type="primary" :disabled = "method === 'view'" @click="insertEvent()" plain>
+					新增
+				</el-button>
+				<el-button size="default" style="margin-left: 20px" type="primary" :disabled = "method === 'view'" @click="exportPlan()" plain>
+					导出
+				</el-button>
+				<a v-if="inputForm.planStartDate !=='' && inputForm.planEndDate !== ''" style="margin-left: 1em;font-size: 14px">项目起始时间:{{inputForm.planStartDate}} - {{inputForm.planEndDate}}</a>
+			</el-divider>
+			<el-row  :gutter="15">
+				<el-col :span="24">
+					<vxe-table
+						border
+						show-overflow
+						show-footer
+						:column-config="{resizable: true}"
+						ref="detailTable"
+						:key="detailkey"
+						class="vxe-table-element"
+						:data="inputForm.planDetailsList"
+						style=""
+						highlight-current-row
+						:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
+					>
+						<vxe-table-column type="seq" width="60" title="序号"></vxe-table-column>
+						<vxe-table-column field="taskPhase" title="任务阶段" :edit-render="{}" show-overflow="title" :rules="[{required: true, message:'请输入任务阶段', trigger:'blur'}]">
+							<template v-slot:edit="scope">
+								<el-autocomplete
+									class="inline-input"
+									v-model="scope.row.taskPhase"
+									:fetch-suggestions="querySearch"
+									placeholder="请输入内容"
+									@select="handleSelect"
+								></el-autocomplete>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="planStartDate" title="计划开始时间" :edit-render="{}" show-overflow="title">
+							<template v-slot:edit="scope">
+								<el-date-picker
+									v-model="scope.row.planStartDate"
+									type="date"
+									value-format="YYYY-MM-DD"
+									placeholder="选择计划开始时间"
+									style="width:100%"
+									placement="bottom-start"
+									clearable>
+								</el-date-picker>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="planEndDate" title="计划结束时间" :edit-render="{}" show-overflow="title">
+							<template v-slot:edit="scope">
+								<el-date-picker
+									v-model="scope.row.planEndDate"
+									type="date"
+									value-format="YYYY-MM-DD"
+									placeholder="选择计划结束时间"
+									style="width:100%"
+									placement="bottom-start"
+									clearable>
+								</el-date-picker>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="warnName" title="提醒人" :edit-render="{}" show-overflow="title">
+							<template v-slot:edit="scope">
+								<el-input v-model="scope.row.warnName" @focus="userPullListForm1(scope.$rowIndex)"></el-input>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="achieverName" title="完成人" :edit-render="{}" show-overflow="title">
+							<template v-slot:edit="scope">
+								<el-input v-model="scope.row.achieverName" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column title="操作" width="100">
+							<template v-slot="scope">
+								<el-button size="default" type="danger" :disabled = "method === 'view'" @click="removeEvent(scope.row,scope.$rowIndex)"  >删除</el-button>
+							</template>
+						</vxe-table-column>
+					</vxe-table>
+				</el-col>
+			</el-row>
+        </el-form>
+		  <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+      </el-col>
+    </el-row>
+		<template #footer>
+			<span class="dialog-footer">
+			  <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+			  <el-button v-if="method === 'edit' || method === 'add'" type="primary" icon="el-icon-circle-check" @click="save()">确定</el-button>
+			</span>
+		</template>
+    </el-dialog>
+	  <UserPullForm ref="userPullForm" @getProgramForUser="getProgramForUser"></UserPullForm>
+	  <UserPullFormPlan ref="userPullFormPlan" @getProgramForUser="getProgramForUser1"></UserPullFormPlan>
+  </div>
+
+
+
+
+</template>
+
+<script>
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  import UserPullForm from '@/views/finance/invoice/UserPullForm'
+  import UserPullFormPlan from '@/views/finance/invoice/UserPullFormPlan'
+  export default {
+	  props: {
+		  businessId: {
+			  type: String,
+			  default: ''
+		  },
+		  formReadOnly: {
+			  type: Boolean,
+			  default: false
+		  },
+		  status: {
+			  type: String,
+			  default: ''
+		  }
+	  },
+	  data() {
+		  return {
+			  showChildDialog: false,
+			  typeVisible: false,
+			  title: '',
+			  method: '',
+			  loading: false,
+			  inputForm: {
+				  id: '',
+				  createDate: '',
+				  createName: '',
+				  createTime: '',
+				  remarks: '',
+				  projectNumber: '',
+				  projectName: '',
+				  planFileList: [],
+				  planStartDate: '',
+				  planEndDate: '',
+				  planDetailsList: [],
+			  },
+			  keyWatch: '',
+			  detailkey: '',
+			  visible: false,
+			  restaurants: [],
+		  }
+	  },
+
+	  created() {
+
+	  },
+	  computed: {
+		  bus: {
+			  get() {
+				  this.$refs.uploadComponent.setDividerName('项目计划附件信息', false)
+				  return this.businessId
+			  },
+			  set(val) {
+				  this.businessId = val
+			  }
+		  }
+	  },
+	  watch: {
+		  'keyWatch': {
+			  handler(newVal) {
+				  if (this.commonJS.isNotEmpty(this.bus)) {
+					  this.init('', this.bus)
+				  } else {
+					  this.$nextTick(() => {
+						  this.$refs.inputForm.resetFields()
+					  })
+				  }
+			  }
+		  }
+	  },
+	  mounted() {
+		  this.restaurants = this.loadAll();
+	  },
+	  components: {
+		  UpLoadComponent,
+		  UserPullForm,
+		  UserPullFormPlan
+	  },
+	  methods: {
+		  getKeyWatch(keyWatch) {
+			  this.keyWatch = keyWatch
+		  },
+		  forUpdate() {
+			  this.$forceUpdate()
+		  },
+		  init(method, id) {
+			  if (method === 'add') {
+				  this.title = '添加项目计划信息'
+			  } else if (method === 'edit'){
+				  this.title = '修改项目计划信息'
+			  }else if (method === 'view'){
+				  this.title = '查看项目计划信息'
+			  }
+			  this.visible = true
+			  this.method = method
+			  this.inputForm = {
+				  id: '',
+				  createName: '',
+				  createTime: '',
+				  remarks: '',
+				  projectNumber: '',
+				  projectName: '',
+				  planFileList: [],
+				  planStartDate: '',
+				  planEndDate: '',
+				  planDetailsList: []
+			  }
+			  this.inputForm.id = id
+			  this.loading = false
+			  this.$nextTick(() => {
+				  this.$refs.inputForm.resetFields()
+				  this.loading = true
+				  projectRecordsService.queryPlanById(this.inputForm.id).then((data) => {
+				  	console.log('data',data)
+					  this.$refs.uploadComponent.clearUpload()
+					  this.inputForm = this.recover(this.inputForm, data)
+					  this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+					  this.inputForm.planStartDate = this.moment(data.planStartDate).format('YYYY-MM-DD')
+					  this.inputForm.planEndDate = this.moment(data.planEndDate).format('YYYY-MM-DD')
+
+					  if (this.commonJS.isEmpty(this.inputForm.planDetailsList)) {
+						  this.inputForm.planDetailsList = []
+						  let phase = this.$dictUtils.getDictList('cw_project_plan_phase')
+						  console.log('phase',phase)
+						  phase.forEach((item) => {
+							  console.log('item', item)
+							  let a = {
+								  taskPhase: item.label,
+								  planStartDate: '',
+								  planEndDate: '',
+								  warnName: this.$store.state.user.name,
+								  warnUser:this.$store.state.user.id,
+								  achiever:this.$store.state.user.id,
+								  achieverName: this.$store.state.user.name,
+							  }
+							  this.$refs.detailTable.insertAt(a)
+							  this.inputForm.planDetailsList.push(a)
+							  this.detailkey = Math.random()
+						  })
+						  var li = this.inputForm.planDetailsList.length - 1
+						  console.log('this.inputForm.planStartDate',this.inputForm.planDetailsList)
+						  if (this.commonJS.isNotEmpty(this.inputForm.planStartDate)) {
+							  this.inputForm.planDetailsList[0].planStartDate = this.inputForm.planStartDate
+						  }
+						  if (this.commonJS.isNotEmpty(this.inputForm.planEndDate)) {
+							  this.inputForm.planDetailsList[li].planEndDate = this.inputForm.planEndDate
+						  }
+					  }
+
+					  this.$refs.uploadComponent.newUpload(this.method, this.inputForm.planFileList, 'cw_project_plan', null, '项目计划附件信息', null, null, false)
+
+					  this.loading = false
+				  })
+			  })
+		  },
+		  // 表单提交
+		  save() {
+			  this.$refs['inputForm'].validate((valid) => {
+				  if (valid) {
+					  this.loading = true
+					  if (this.commonJS.isEmpty(this.inputForm.planDetailsList)) {
+						  this.loading = false
+						  this.$message.error('至少输入一条项目计划')
+						  throw new Error('至少输入一条项目计划')
+					  }else {
+					  	let begindate = this.inputForm.planDetailsList[0].planStartDate
+					  	let planLength = this.inputForm.planDetailsList.length -1
+						  let endDate = this.inputForm.planDetailsList[planLength].planEndDate
+						  this.inputForm.planStartDate = this.moment(begindate).format('YYYY-MM-DD HH:mm:ss')
+						  this.inputForm.planEndDate = this.moment(endDate).format('YYYY-MM-DD HH:mm:ss')
+						  for (let i = 0; i < this.inputForm.planDetailsList.length; i++) {
+						  	if (this.commonJS.isEmpty(this.inputForm.planDetailsList[i].planEndDate)){
+								this.loading = false
+								this.$message.error('第'+(i+1)+'行计划结束时间未选择')
+								throw new Error('第'+(i+1)+'行计划结束时间未选择')
+							}
+							  if (this.commonJS.isEmpty(this.inputForm.planDetailsList[i].planStartDate)){
+								  this.loading = false
+								  this.$message.error('第'+(i+1)+'行计划开始时间未选择')
+								  throw new Error('第'+(i+1)+'行计划开始时间未选择')
+							  }
+							  //横向比较开始时间和结束时间
+							  if (this.inputForm.planDetailsList[i].planEndDate < this.inputForm.planDetailsList[i].planStartDate){
+								  this.loading = false
+								  this.$message.error('第'+(i+1)+'行计划结束时间不能小于计划开始时间')
+								  throw new Error('第'+(i+1)+'行计划结束时间不能小于计划开始时间')
+							  }
+							  //纵向比较开始时间和结束时间
+							  if (this.inputForm.planDetailsList[i].planStartDate<begindate){
+								  this.loading = false
+								  this.$message.error('第'+(i+1)+'行计划开始时间不能小于第一行的计划开始时间')
+								  throw new Error('第'+(i+1)+'行计划开始时间不能小于第一行的计划开始时间')
+							  }
+							  if (this.inputForm.planDetailsList[i].planEndDate>endDate){
+								  this.loading = false
+								  this.$message.error('第'+(i+1)+'行计划结束时间不能大于最后一行的计划结束时间')
+								  throw new Error('第'+(i+1)+'行计划结束时间不能大于最后一行的计划结束时间')
+							  }
+						  }
+					  }
+					  console.log('this.inputForm',this.inputForm)
+					  this.inputForm.planFileList = this.$refs.uploadComponent.getDataList()
+					  projectRecordsService.savePlanForm(this.inputForm).then((data) => {
+						  this.$emit('refreshList')
+						  this.loading = false
+						  this.close()
+					  }).catch(() => {
+						  this.loading = false
+					  })
+				  }
+			  })
+		  },
+		  close() {
+			  this.inputForm = {
+				  id: '',
+				  createName: '',
+				  createTime: '',
+				  remarks: '',
+				  projectNumber: '',
+				  projectName: '',
+				  planFileList: [],
+				  planStartDate: '',
+				  planEndDate: '',
+				  planDetailsList: []
+			  }
+			  this.$refs.uploadComponent.clearUpload()
+			  this.$refs.inputForm.resetFields()
+			  this.visible = false
+		  },
+		  // 新增
+		  // eslint-disable-next-line no-dupe-keys
+		  async insertEvent() {
+			  let d = {
+				  taskPhase: '',
+				  planStartDate: '',
+				  planEndDate: '',
+				  warnUser: '',
+				  achiever: '',
+			  }
+			  if (this.commonJS.isEmpty(this.inputForm.planDetailsList)) {
+				  this.inputForm.planDetailsList = []
+			  }
+
+			  console.log('this.inputForm.planDetailsList', this.inputForm.planDetailsList)
+			  this.$refs.detailTable.insertAt(d)
+			  this.inputForm.planDetailsList.push(d)
+			  this.detailkey = Math.random()
+
+		  },
+		  // 删除
+		  removeEvent(row, rowIndex) {
+			  this.$refs.detailTable.remove(row)
+			  this.inputForm.planDetailsList.splice(rowIndex, 1)
+		  },
+		  querySearch(queryString, cb) {
+			  var restaurants = this.restaurants;
+			  var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
+			  // 调用 callback 返回建议列表的数据
+			  console.log('results', results)
+			  cb(results);
+		  },
+		  createFilter(queryString) {
+			  return (restaurant) => {
+				  return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
+			  };
+		  },
+		  loadAll() {
+			let task = []
+		  	projectRecordsService.getTaskPhase().then((data)=>{
+			  	task=data
+			  })
+			  console.log('task',task)
+			  return projectRecordsService.getTaskPhase()
+		  },
+		  handleSelect(item) {
+			  console.log(item);
+			  console.log('index', index);
+		  },
+		  // 自定义服务端导出
+		  exportPlan() {
+		  	let optionName = this.inputForm.projectName+"项目计划.xls"
+			  // 传给服务端的参数
+			  const params = {
+				  id: this.inputForm.id,
+				  mode:'all'
+			  }
+			  return projectRecordsService.exportPlan(params).then((res) => {
+				  // 将二进制流文件写入excel表,以下为重要步骤
+				  this.$utils.downloadExcel(res,  optionName)
+			  }).catch(function (err) {
+				  if (err.response) {
+					  console.log(err.response)
+				  }
+			  })
+		  },
+		  userPullListForm (rowIndex) {
+			  this.indexRow = rowIndex
+			  this.$refs.userPullForm.init()
+		  },
+		  getProgramForUser (rows) {
+			  this.inputForm.planDetailsList[this.indexRow].achiever = rows[0].id
+			  this.inputForm.planDetailsList[this.indexRow].achieverName = rows[0].name
+			  this.indexRow = ''
+			  this.$forceUpdate()
+		  },
+		  userPullListForm1 (rowIndex) {
+			  this.indexRow = rowIndex
+			  this.$refs.userPullFormPlan.init(this.inputForm.id)
+		  },
+		  getProgramForUser1 (rows) {
+			  this.inputForm.planDetailsList[this.indexRow].warnUser = rows[0].id
+			  this.inputForm.planDetailsList[this.indexRow].warnName = rows[0].name
+			  this.indexRow = ''
+			  this.$forceUpdate()
+		  },
+	  }
+
+  }
+</script>
+<style scoped>
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+</style>
+<style>
+  .vxe-select--panel {
+    z-index: 9997 !important
+  }
+</style>

+ 12 - 1
src/views/dashboard/widgets/components/MyNoticePageList.vue

@@ -68,6 +68,7 @@
 	<KeyCardPopup ref="keyCardPopup"></KeyCardPopup>
 	<DepartPopup ref="departPopup"></DepartPopup>
 	<DepartProvePopup ref="departProvePopup"></DepartProvePopup>
+	<ProjectPlanForm ref="projectPlanForm"></ProjectPlanForm>
 </template>
 
 <script>
@@ -76,6 +77,7 @@
 	import KeyCardPopup from '@/views/human/enrollment/registration/KeyCardPopup'
 	import DepartPopup from '@/views/human/depart/handover/DepartPopup'
 	import DepartProvePopup from '@/views/human/depart/handover/DepartProvePopup'
+	import ProjectPlanForm from '@/views/cw/projectRecords/ProjectPlanForm'
 // import notifyService from "@/api/notify/notifyService";
 import noticeService from '@/api/flowable/NoticeService'
 import taskService from "@/api/flowable/taskService";
@@ -94,6 +96,7 @@ export default {
 		KeyCardPopup,
 		DepartPopup,
 		DepartProvePopup,
+		ProjectPlanForm
 	},
 	data() {
 		return {
@@ -125,7 +128,15 @@ export default {
 	methods: {
 		todo (row) {
 			// console.log('row', row)
-			if (row.taskName === '库存提醒') {
+			if (row.taskName === '项目计划通知'){
+				// console.log('测试进来了')
+				this.$refs.projectPlanForm.init('view',row.defId)
+				this.inputForm = {
+					id: row.id
+				}
+				noticeService.stockUpdate(this.inputForm)
+				this.resetSearch()
+			}else if (row.taskName === '库存提醒') {
 				// console.log('测试进来了')
 				this.$refs.wareHouseHistoryPopup.init(row.defId)
 				this.inputForm = {

+ 143 - 0
src/views/finance/invoice/UserPullFormPlan.vue

@@ -0,0 +1,143 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+	  draggable
+      width="500px"
+      height="500px"
+      @close="close"
+      append-to-body
+	  v-model="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="" prop="name">
+            <el-input v-model="searchForm.name" placeholder="请输入用户名称" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="300px"
+          :loading="loading"
+          size="small"
+          ref="userTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}"
+          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId',expandAll: true}"
+          :checkbox-config="{}">
+<!--          <vxe-column type="seq" width="60" title="序号"></vxe-column>-->
+          <vxe-column type="radio" width="50" ></vxe-column>
+
+          <vxe-column title="姓名" min-width="180" field="name" align="left" tree-node></vxe-column>
+        </vxe-table>
+      </div>
+		<template #footer>
+			<span class="dialog-footer">
+			  <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+			  <el-button type="primary" v-if="method != 'view'" @click="getProgramForUser()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+			</span>
+		</template>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import ReimbursementService from '@/api/sys/ReimbursementService'
+  import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        dataList: [],
+        searchForm: {
+          name: ''
+        }
+      }
+    },
+    reimbursementService: null,
+    created () {
+      this.reimbursementService = new ReimbursementService()
+    },
+    components: {
+    },
+    methods: {
+      init (id) {
+        this.title = '人员选择'
+        this.visible = true
+        this.list(id)
+      },
+      // 表单提交
+      getProgramForUser () {
+        let rows = []
+        if (this.commonJS.isEmpty(this.$refs.userTable.getRadioRecord())) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        // if (this.$refs.userTable.getCheckboxRecords().length > 1) {
+        //   this.$message.error('最多选择一条数据')
+        //   return
+        // }
+        let row = this.$refs.userTable.getRadioRecord()
+        if (!row.isUser) {
+          this.$message.error('请选择子集数据')
+          return
+        }
+        this.close()
+        rows.push(row)
+        this.$emit('getProgramForUser', rows)
+      },
+      list (id) {
+        this.loading = true
+        projectRecordsService.userTree(this.searchForm.name,id).then((data) => {
+          this.dataList = data
+          this.loading = false
+          this.$nextTick(() => {
+            this.$refs.userTable.setAllTreeExpand(true)
+          })
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.detail = ''
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style>
+  .messageZindex {
+    z-index:9999 !important;
+  }
+</style>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0px;
+  }
+</style>

+ 12 - 1
src/views/flowable/task/NoticePageList.vue

@@ -69,6 +69,7 @@
 	  <KeyCardPopup ref="keyCardPopup"></KeyCardPopup>
 	  <DepartPopup ref="departPopup"></DepartPopup>
 	  <DepartProvePopup ref="departProvePopup"></DepartProvePopup>
+	  <ProjectPlanForm ref="projectPlanForm"></ProjectPlanForm>
   </div>
 </template>
 
@@ -81,6 +82,7 @@
   import DepartPopup from '@/views/human/depart/handover/DepartPopup'
   import DepartProvePopup from '@/views/human/depart/handover/DepartProvePopup'
   import pick from 'lodash.pick'
+  import ProjectPlanForm from '@/views/cw/projectRecords/ProjectPlanForm'
   export default {
     data () {
       return {
@@ -117,6 +119,7 @@
 		KeyCardPopup,
 		DepartPopup,
 		DepartProvePopup,
+		ProjectPlanForm
     },
     methods: {
       // 获取数据列表
@@ -144,7 +147,15 @@
       },
       todo (row) {
         // console.log('row', row)
-        if (row.taskName === '库存提醒') {
+		  if (row.taskName === '项目计划通知'){
+			  // console.log('测试进来了')
+			  this.$refs.projectPlanForm.init('view',row.defId)
+			  this.inputForm = {
+				  id: row.id
+			  }
+			  noticeService.stockUpdate(this.inputForm)
+			  this.resetSearch()
+		  }else if (row.taskName === '库存提醒') {
           // console.log('测试进来了')
           this.$refs.wareHouseHistoryPopup.init(row.defId)
           this.inputForm = {