SanHQin 1 yıl önce
ebeveyn
işleme
c97d716e41

+ 4 - 2
package.json

@@ -10,7 +10,8 @@
   "dependencies": {
     "axios": "^1.4.0",
     "core-js": "^3.8.3",
-    "docxtemplater": "^3.37.11",
+    "docxtemplater": "^3.46.2",
+    "docxtemplater-image-module-free": "^1.1.1",
     "dom-to-image": "^2.6.0",
     "echarts": "^5.4.2",
     "element-ui": "^2.4.5",
@@ -36,7 +37,8 @@
     "vuex": "^3.6.2",
     "vuex-persistedstate": "^4.1.0",
     "wangeditor": "^4.6.14",
-    "wkhtmltopdf": "^0.4.0"
+    "wkhtmltopdf": "^0.4.0",
+    "xlsx": "^0.18.5"
   },
   "devDependencies": {
     "@babel/core": "^7.12.16",

+ 3 - 0
src/components/tool/getWord2.js

@@ -27,6 +27,8 @@ function getWord2(val){
 			})
 			let ImageList = await getImage(val.elementList);
 
+			// resolve()
+			console.log(ImageList)
 			let zip=new PizZip(content);
 
 			// 图片处理
@@ -149,6 +151,7 @@ function getImage(elList){
 					scale:1.5
 				})
 				imgObj.url = canvas.toDataURL('image/png');
+				imgObj.url = imgObj.url.indexOf('data:image/png;base64,') === -1 ? '' : imgObj.url
 				imgObj.width = canvas.width;
 				imgObj.height = canvas.height;
 				imgList.push(imgObj)

+ 12 - 12
src/components/tool/wangEnduit.vue

@@ -161,18 +161,18 @@ export default {
         }
       };
       //配置 自定义处理粘贴的文本内容
-      this.editor.config.pasteTextHandle = function (content) {
-        if (content == "" && !content) return "";
-        var str = content;
-        str = str.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
-        str = str.replace(/<style>[\s\S]*?<\/style>/gi, "");
-        str = str.replace(/<\/?[^>]*>/g, "");
-        str = str.replace(/[ | ]*\n/g, "\n");
-        str = str.replace(/&nbsp;/gi, "");
-        // console.log('****', content)
-        // console.log('****', str)
-        return str;
-      };
+      // this.editor.config.pasteTextHandle = function (content) {
+      //   if (content == "" && !content) return "";
+      //   var str = content;
+      //   str = str.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
+      //   str = str.replace(/<style>[\s\S]*?<\/style>/gi, "");
+      //   str = str.replace(/<\/?[^>]*>/g, "");
+      //   str = str.replace(/[ | ]*\n/g, "\n");
+      //   str = str.replace(/&nbsp;/gi, "");
+      //   // console.log('****', content)
+      //   // console.log('****', str)
+      //   return str;
+      // };
       this.editor.config.onchange = (html) => {
         this.info_ = html; // 绑定当前逐渐地值
         this.$emit("change", this.info_); // 将内容同步到父组件中

+ 13 - 12
src/views/commission/commission.vue

@@ -80,8 +80,8 @@
             </el-option>
           </el-select>
         </div>
-
-        <!-- <div class="selectsBlock">
+<!-- 
+        <div class="selectsBlock">
           <span class="selectLabel">状态</span>
           <el-select
             v-model="pavalues.value5"
@@ -89,13 +89,8 @@
             placeholder="请选择"
           >
             <el-option label="所有分类" value="" />
-            <el-option
-              v-for="(item,index) in options5"
-              :key="index"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
+						<el-option label="未审核" :value="0" />
+						<el-option label="已审核" :value="1" />
           </el-select>
         </div> -->
 
@@ -196,11 +191,12 @@
         >
 				<template #default="scope">
 					<div>
-              <span v-if="scope.row.isupload == 0">未审核</span>
+						<span>{{ scope.row.isupload>classType[$store.state.userInfo.type]?'已审核':'审核完成' }}</span>
+              <!-- <span v-if="scope.row.isupload == 0">未审核</span>
               <span v-if="scope.row.isupload == 1">审核中</span>
               <span v-if="scope.row.isupload == 2">进行中</span>
               <span v-if="scope.row.isupload == 3">待结项</span>
-              <span v-if="scope.row.isupload == 4">已结项</span>
+              <span v-if="scope.row.isupload == 4">已结项</span> -->
            </div>
 				</template>
         </el-table-column>
@@ -304,6 +300,11 @@ export default {
             value: 4,
             label: "已结项",
           },],
+			classType:{
+				'0':3,
+				'3':4,
+				'4':2
+			},
       loading: false,
       pavalues: {
         value: "",
@@ -353,7 +354,7 @@ export default {
         lim: this.Page.lim, //限制获取几条数据
       };
       this.ajax
-        .post(this.$store.state.api + "/GetProjectIsConclusion", param)
+        .post(this.$store.state.api + "/getProjectByCommission", param)
         .then(
           (res) => {
             let data = res.data;

+ 37 - 11
src/views/commission/components/projectBook.vue

@@ -115,10 +115,7 @@
           colspan="8"
           style="height: 200px; box-sizing: border-box; padding-bottom: 40px"
         >
-          <div class="addMessage" v-if="!isQpButton">
-            <p class="bold">部门意见:</p>
-            <el-button type="primary" @click="openQp">签批</el-button>
-          </div>
+         
           <div class="flexBox">
             <div style="padding-top: 10px">项目简介:</div>
             <el-input
@@ -140,13 +137,38 @@
           </p>
         </td>
       </tr>
-      <tr>
-        <td colspan="8">
-          <p class="bold">审核意见:</p>
-          <div v-for="(item, index) in qpList" :key="index" class="qpItem">
-            <div>{{ item.text }}</div>
-            <div>{{ item.bm }} {{ item.username }} {{ item.time }}</div>
-          </div>
+      <tr v-if="bookData.isupload>=2">
+        <td colspan="8" >
+					<div class="defaultHeight">
+						<p class="bold">所在学院部门审核意见:<el-button  v-if="!isQpButton && $store.state.userInfo.type==4" type="primary" size="small" @click="openQp">签批</el-button></p>
+          	<div v-for="(item, index) in qpList.filter(i=>i.type==4)" :key="index" class="qpItem">
+          	  <div>{{ item.text }}</div>
+          	  <div>{{ item.bm }} {{ item.username }} {{ item.time }}</div>
+          	</div>
+					</div>
+          
+        </td>
+      </tr>
+			<tr v-if="bookData.isupload>=3">
+        <td colspan="8" class="defaultHeight">
+					<div class="defaultWHeight">
+          	<p class="bold">创新创业学院审核意见:<el-button  v-if="!isQpButton && $store.state.userInfo.type==0" type="primary" size="small" @click="openQp">签批</el-button></p>
+          	<div v-for="(item, index) in qpList.filter(i=>i.type==0)" :key="index" class="qpItem">
+          	  <div>{{ item.text }}</div>
+          	  <div>{{ item.bm }} {{ item.username }} {{ item.time }}</div>
+          	</div>
+					</div>
+        </td>
+      </tr>
+			<tr v-if="bookData.isupload>=4">
+        <td colspan="8" class="defaultHeight">
+					<div class="defaultWHeight">
+          	<p class="bold">学校终审意见:<el-button  v-if="!isQpButton && $store.state.userInfo.type==3" type="primary" size="small" @click="openQp">签批</el-button></p>
+          	<div v-for="(item, index) in qpList.filter(i=>i.type==3)" :key="index" class="qpItem">
+          	  <div>{{ item.text }}</div>
+          	  <div>{{ item.bm }} {{ item.username }} {{ item.time }}</div>
+          	</div>
+					</div>
         </td>
       </tr>
       <tr>
@@ -472,6 +494,7 @@ export default {
           this.$message.success("签批成功");
           this.getSign();
           this.sendTask();
+					this.getData()
           this.dialogVisible = false;
         },
         (err) => {
@@ -1013,4 +1036,7 @@ export default {
 .flowReason::-webkit-scrollbar-corner {
   background-color: rgba(255, 255, 255, 0);
 }
+.defaultWHeight{
+	min-height: 200px !important;
+}
 </style>

+ 27 - 1
src/views/projectApply/components/studentProjectWordDetail.vue

@@ -747,6 +747,7 @@ export default {
 				this.$message.info("正在下载,请稍等...")
 				let elementList = this.$refs.myChild.$refs.pdfShow.querySelectorAll('.downImage')
 				let fontSize = [];
+				let pFontSize = [];
 				let fontType = {
 					'1':"13pt",
 					'2':"16.9pt",
@@ -766,7 +767,22 @@ export default {
 						fontSize.push(font[i].getAttribute("size"))
 						font[i].removeAttribute("size")
 						font[i].setAttribute("style",`font-size:${fontType[fontSize[i]]}`)
-						// font[i].setAttribute("size",fontType[fontSize[i]])
+					}
+
+					// 替换p标签的font-size
+					// let p = el.getElementsByTagName('p');
+					let p = el.querySelectorAll("*")
+					for(let i=0;i<p.length;i++){
+						let pStyle = p[i].getAttribute("style")
+						if(!pStyle)continue;
+						let matchArr = pStyle.match(/font-size: (\d+)px/);
+						if(!matchArr)continue;
+						pFontSize.push(pStyle)
+						let originalSize = pStyle.match(/font-size: (\d+)px/)[1];
+						
+						let newSize = parseInt(originalSize)*1.3;
+						let newStyle = pStyle.replace(/font-size: (\d+)px/,`font-size: ${newSize}pt`)
+						p[i].setAttribute("style",newStyle)
 					}
 				})
 				let newData = JSON.parse(JSON.stringify(this.downWordData))
@@ -781,6 +797,16 @@ export default {
 							font[i].removeAttribute("style")
 							font[i].setAttribute("size",fontSize[i])
 						}
+						// 替换p标签的font-size
+						let p = el.querySelectorAll("*")
+						for(let i=0;i<p.length;i++){
+							let pStyle = p[i].getAttribute("style")
+							if(!pStyle)continue;
+							let matchArr = pStyle.match(/font-size: (\d+)px/);
+							if(!matchArr)continue;
+							console.log(pFontSize[i])
+							p[i].setAttribute("style",pFontSize[i])
+						}
 					})
 					this.downloadWordDig = false;
 					this.loading = false;

+ 3 - 3
src/views/projectApply/newStudentProjectApply.vue

@@ -14,7 +14,7 @@
     />
     <div style="position: fixed; bottom: 5%; right: 2%">
 			<el-button @click="saveDraft" type="primary">保存草稿</el-button>
-      <el-button @click="test" type="primary">提交项目</el-button>
+      <el-button @click="test" type="primary">保存项目</el-button>
     </div>
 
     <el-dialog
@@ -24,11 +24,11 @@
       class="pageSubmitData"
     >
       <div class="deleteContent">
-        确定提交“{{ wordData["projectName"] }}”项目吗?
+        确定保存“{{ wordData["projectName"] }}”项目吗?
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitWord" class="AllDialogBtn"
-          >确认提交</el-button
+          >确认保存</el-button
         >
         <el-button @click="submitHint = false" class="AllDialogBtn"
           >取消</el-button

+ 130 - 33
src/views/projectApply/projectApplication.vue

@@ -119,6 +119,9 @@
         <el-button type="primary" class="btn" size="mini" @click="getData"
           >查询</el-button
         >
+      </div>
+			<div class="ProjectManagementQuery" style="margin-top: 60px;" v-if="$store.state.userInfo.type == 0">
+        <el-button type="primary" @click.stop="exportExcel">导出EXCEL</el-button>
       </div>
     </div>
 
@@ -225,18 +228,19 @@
           prop="state"
           label="状态"
           align="center"
-          min-width="6%"
+          min-width="15%"
         >
           <template #default="scope">
             <div>
               <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
               <!-- {{ (scope.row.isupload==0?"未审核": scope.row.data==1?"正在审核":"已审核")  }} -->
+							<span>{{ classType[scope.row.isupload] }}</span>
 
-              <span v-if="scope.row.isupload == 0">未审核</span>
+              <!-- <span v-if="scope.row.isupload == 0">未审核</span>
               <span v-if="scope.row.isupload == 1">审核中</span>
               <span v-if="scope.row.isupload == 2">进行中</span>
               <span v-if="scope.row.isupload == 3">待结项</span>
-              <span v-if="scope.row.isupload == 4">已结项</span>
+              <span v-if="scope.row.isupload == 4">已结项</span> -->
             </div>
           </template>
         </el-table-column>
@@ -278,7 +282,7 @@
                 "
                 class="disa btnClass"
                 size="mini"
-                >审核</el-button
+                >审核</el-button
               >
               <el-button
                 type="primary"
@@ -287,7 +291,7 @@
                 "
                 class="disa btnClass"
                 size="mini"
-                >待结项</el-button
+                >审核中</el-button
               >
               <el-button
                 type="primary"
@@ -296,7 +300,16 @@
                 "
                 class="disa btnClass"
                 size="mini"
-                >已结项</el-button
+                >审核中</el-button
+              >
+							<el-button
+                type="primary"
+                v-if="
+                  scope.row.isupload == 5 && $store.state.userInfo.type != 0 && $store.state.userInfo.type != 3
+                "
+                class="disa btnClass"
+                size="mini"
+                >待结项</el-button
               >
 
               <!--1管理员审核与院长 -->
@@ -328,7 +341,7 @@
                 type="primary"
                 class="disa btnClass"
                 size="mini"
-                >已审核</el-button
+                >已通过</el-button
               >
               <el-button
                 v-if="
@@ -337,7 +350,7 @@
                 type="primary"
                 class="disa btnClass"
                 size="mini"
-                >待结项</el-button
+                >审核中</el-button
               >
               <el-button
                 v-if="
@@ -346,7 +359,16 @@
                 type="primary"
                 class="disa btnClass"
                 size="mini"
-                >已结项</el-button
+                >审核中</el-button
+              >
+							<el-button
+                v-if="
+                  scope.row.isupload == 5 && ($store.state.userInfo.type == 0 || $store.state.userInfo.type == 3)
+                "
+                type="primary"
+                class="disa btnClass"
+                size="mini"
+                >待结项</el-button
               >
 
               <!-- <el-button type="primary"  size="mini" @click="appTable(scope.row.typeid,scope.row.courseId)" >申请表</el-button> -->
@@ -486,10 +508,12 @@
 </template>
 
 <script>
+// import XLSX from "xlsx";
 // import {MakerSpaceWord,MakerStudentWord,getWord} from '@/components/tool/getWord.js'
 // import MakerSpaceWordPreview from '@/components/MakerSpaceWordPreview.vue';
 // import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.vue'
 export default {
+
   // components:{MakerSpaceWordPreview,studentMakerProjectPreview},
   data() {
     return {
@@ -514,6 +538,15 @@ export default {
       },
       tableData: [], //列表数据
 
+			classType:{
+				"0":'未提交',
+				'1':"已提交",
+				'2':"所在学院/部门审核中",
+				'3':"创新创业学院审核中",
+				'4':'学校终审中',
+				'5':'待结项'
+			},
+
       selectInp: {
         // 头部搜索框的内容
         filter: "",
@@ -531,30 +564,30 @@ export default {
         person: [], //负责人
         state: [
           //状态
-          {
-            value: "",
-            label: "全部",
-          },
-          {
-            value: 0,
-            label: "未审核",
-          },
-          {
-            value: 1,
-            label: "审核中",
-          },
-          {
-            value: 2,
-            label: "进行中",
-          },
-          {
-            value: 3,
-            label: "待结项",
-          },
-          {
-            value: 4,
-            label: "已结项",
-          },
+          // {
+          //   value: "",
+          //   label: "全部",
+          // },
+          // {
+          //   value: 0,
+          //   label: "未提交",
+          // },
+          // {
+          //   value: 1,
+          //   label: "已提交",
+          // },
+          // {
+          //   value: 2,
+          //   label: "进行中",
+          // },
+          // {
+          //   value: 3,
+          //   label: "待结项",
+          // },
+          // {
+          //   value: 4,
+          //   label: "已结项",
+          // },
         ],
 				year:[],
       },
@@ -863,6 +896,70 @@ export default {
       this.table.currentPage = val;
       this.getData();
     },
+		// 导出Excel表格
+		exportExcel(){
+			this.$confirm("是否导出Excel?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消"
+      })
+        .then(() => {
+          this.loading = true;
+      		let param = {
+      		  uid: this.$store.state.userInfo.userid,
+      		  pid: this.selectInp.filter, //筛选
+      		  did: this.selectInp.department, //部门
+      		  tid: this.selectInp.sort, //分类
+      		  leader: this.selectInp.person, //负责人
+      		  st: this.selectInp.state, //审核状态
+      		  year: this.selectInp.year,
+      		  textInp: encodeURIComponent(this.input),
+      		  page: 1, //当前页
+      		  lim: 99999999, //限制获取几条数据
+      		};
+					this.ajax.get(this.$store.state.api + "/SelectAllProject", param).then(res=>{
+						let _data = res.data[0];
+						let _array = [];
+
+						_data.forEach((item, index)=>{
+							let _json = {};
+							_json["项目编号"] = item.ProjectNo;
+        			_json["项目名称"] = item.title;
+        			_json["项目负责人"] = item.pro_leader;
+        			_json["所在部门"] = item.name;
+        			_json["分类"] = item.sort;
+        			_json["预算(万)"] = item.fund / 10000;
+        			_json["创建时间"] = item.createTime;
+        			_json["联系电话"] = item.phone;
+							
+        			_json["项目状态"] = this.classType[item.isupload];
+
+							_array.push(_json)
+						})
+
+						let XLSX = require("xlsx");
+						const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
+      			let ws = XLSX.utils.json_to_sheet(_array); //将json对象数组转化成工作表
+      			ws["!cols"] = [
+      			  //设置每一列的宽度
+      			  { wch: 15 },
+      			  { wch: 50 },
+      			  { wch: 15 },
+      			  { wch: 20 },
+      			  { wch: 20 },
+      			  { wch: 10 },
+     + 			  { wch: 30 },
+      			  { wch: 20 },
+							{ wch: 10 },
+      			];
+						XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
+      			XLSX.writeFile(workbook,"项目列表.xlsx");
+						
+						this.loading = false;
+						console.log(_data)
+					});
+        })
+        .catch(() => {});
+		}
     // getUser() {
     //   var request = new XMLHttpRequest();
     //   request.open("get", "http://10.16.30.130/sso/api", true);