Commit 608b7358 by shj

国际交流合作费从数据库添加

parent 5661f8ab
......@@ -3,10 +3,7 @@ package handlers;
import beans.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import dao.IConsultationDao;
import dao.IEquipmentDao;
import dao.ILabourDao;
import dao.ITravelDao;
import dao.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -135,4 +132,37 @@ public class DatabaseQueryHandler {
e.printStackTrace();
}
}
@Autowired
private IInternationalCommunicationDao internationalCommunicationDao;
@RequestMapping("/International")
public void queryInternational(HttpServletRequest request, HttpServletResponse response){
try {
response.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter writer = response.getWriter();
JSONObject object=new JSONObject();
List<InternationalCommunication> internationalCommunications = internationalCommunicationDao.selectAll();
List<JSONObject> list=new LinkedList<>();
for (InternationalCommunication item : internationalCommunications) {
JSONObject obj=new JSONObject();
obj.put("id",item.getId());
obj.put("name",item.getName());
obj.put("price",item.getPrice());
obj.put("food",item.getFood());
obj.put("traffic",item.getTraffic());
obj.put("accommodation",item.getAccommodation());
obj.put("people",item.getPeople());
obj.put("days",item.getDays());
obj.put("nums",0);
list.add(obj);
}
object.put("data",list);
writer.write(JSON.toJSONString(object));
} catch (IOException e) {
e.printStackTrace();
}
}
}
......@@ -92,7 +92,7 @@ public class BudgetExportUtil {
run.setText(line.toString());
line = new StringBuilder();
line.append("用途:,购置")
line.append("用途:【自行填写】,购置")
.append(num).append("台,")
.append("单价").append(price).append("元,共需").append(num * price).append("元。");
paragraph = document.createParagraph();
......@@ -216,9 +216,9 @@ public class BudgetExportUtil {
paragraph = document.createParagraph();
run = paragraph.createRun();
run.addTab();
run.setText("【会议任务举例】 牵头单位将组织和协调各课题组召开项目启动会,共同商讨各课题的具体目标、流程、关键节点及研究路线" +
"牵头单位每年组织和协调各课题组召开一次项目及课题中期检查会,检查各课题进度,讨论遇到的问题,内部研讨,寻找解决问题的方法" +
"为了做好项目的结题验收工作,牵头单位将组织各课题承担单位自查自纠,总结课题财务执行情况和撰写课题自评价报告,邀请专家进行项目预验收" +
run.setText("【会议任务举例】 牵头单位将组织和协调各课题组召开项目启动会,共同商讨各课题的具体目标、流程、关键节点及研究路线" +
"牵头单位每年组织和协调各课题组召开一次项目及课题中期检查会,检查各课题进度,讨论遇到的问题,内部研讨,寻找解决问题的方法" +
"为了做好项目的结题验收工作,牵头单位将组织各课题承担单位自查自纠,总结课题财务执行情况和撰写课题自评价报告,邀请专家进行项目预验收" +
"项目牵头单位将根据项目进度要求,按时完成项目结题验收工作,并组织召开项目结题验收;" +
"在课题实施期间,要与相关领域其他学者进行研讨,预计受邀参加国内学术会议;");
......
......@@ -411,6 +411,27 @@
<button class="btn btn-success" @click="add(sample)">添加</button>
</td>
</tr>
<tr class="info" v-if="database.length>0">
<td>
<select v-model="selectedIndex" class="form-control">
<option v-for="(record,i) in database" :value="i">
{{record.name}}
</option>
</select>
</td>
<td>
<input type="number" v-model="database[selectedIndex].price" class="form-control">
</td>
<td><input type="number" v-model="database[selectedIndex].food" class="form-control"></td>
<td><input type="number" v-model="database[selectedIndex].traffic" class="form-control"></td>
<td><input type="number" v-model="database[selectedIndex].accommodation" class="form-control"></td>
<td><input type="number" v-model="database[selectedIndex].people" class="form-control"></td>
<td><input type="number" v-model="database[selectedIndex].days" class="form-control"></td>
<td>
<button class="btn btn-success" @click="add(database[selectedIndex])">添加</button>
</td>
</tr>
</tbody>
</table>
......@@ -761,7 +782,9 @@
el: "#international",
data: {
items: [],
sample: {name: "sample", price: 0, food: 0, accommodation: 0, traffic: 0, days: 0, people: 0, nums: 0}
sample: {name: "sample", price: 0, food: 0, accommodation: 0, traffic: 0, days: 0, people: 0, nums: 0},
database:[{name: "sample", price: 0, food: 0, accommodation: 0, traffic: 0, days: 0, people: 0, nums: 0}],
selectedIndex:0
},
methods: {
update: function (item) {
......@@ -778,7 +801,27 @@
function (data) {
this.items = data.body.data;
console.log("showlist");
updateBudgetPage("international")
updateBudgetPage("international");
this.showDatabase();
}, function (error) {
console.log(error)
}
)
},
showDatabase:function(){
this.$http.get("${pageContext.request.contextPath}/Database/Query/International").then(
function (data) {
var tmp= data.body.data;
for(var i=0;i<tmp.length;i++)
{
if(inItems(tmp[i],this.items)){
console.log("inItems:true, "+tmp[i].name);
tmp.splice(i,1);
i--;
}
}
this.database=tmp;
console.log("show database");
}, function (error) {
console.log(error)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment