From 72fe8bdc16157cbd2da9592f4c7e0c9b1ab39452 Mon Sep 17 00:00:00 2001
From: lijun
Date: Tue, 24 Dec 2024 23:41:35 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=88=90?=
=?UTF-8?q?=E6=9C=AC=E4=BA=A7=E5=80=BC=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yanzhu-bigscreen/src/api/detail.js | 79 +++++
yanzhu-bigscreen/src/utils/request.js | 1 -
yanzhu-bigscreen/src/views/projectDetail.vue | 42 ++-
.../controller/ProCostOutputController.java | 55 +++
.../impl/ProCostOutputServiceImpl.java | 14 +-
yanzhu-ui-vue3/src/App.vue | 5 +-
yanzhu-ui-vue3/src/api/manage/costOutput.js | 33 ++
.../src/views/manage/costOutput/costMonth.vue | 83 +++++
.../manage/costOutput/costOutputDrawer.vue | 185 ++++++++++
.../src/views/manage/costOutput/costYear.vue | 86 +++++
.../src/views/manage/costOutput/index.vue | 128 ++-----
.../views/manage/greenCarbonData/index.vue | 4 +-
.../src/views/manage/proProjectInfo/index.vue | 325 ++++++++++--------
13 files changed, 773 insertions(+), 267 deletions(-)
create mode 100644 yanzhu-ui-vue3/src/views/manage/costOutput/costMonth.vue
create mode 100644 yanzhu-ui-vue3/src/views/manage/costOutput/costOutputDrawer.vue
create mode 100644 yanzhu-ui-vue3/src/views/manage/costOutput/costYear.vue
diff --git a/yanzhu-bigscreen/src/api/detail.js b/yanzhu-bigscreen/src/api/detail.js
index fa5d7d9a..9d1ef10a 100644
--- a/yanzhu-bigscreen/src/api/detail.js
+++ b/yanzhu-bigscreen/src/api/detail.js
@@ -99,10 +99,89 @@ const milestoneList = (data) => {
});
});
};
+
+const costOutputSelectYearAndMonth=(data)=> {
+ return new Promise(reslove=>{
+ let data2={...data};
+ let y=data2.year;
+ let m=data2.month-1;
+ if(m==0){
+ m=12;
+ y--;
+ }
+ data2.year=y;
+ data2.month=m;
+ var ajaxs=[request({
+ url: `/manage/costOutput/selectYearAndMonth`,
+ method: 'post',
+ data:data
+ }),
+ request({
+ url: `/manage/costOutput/selectYearAndMonth`,
+ method: 'post',
+ data:data2
+ })];
+
+ axios.all(ajaxs).then(res=>{
+ let d=res[0]
+ const getValue=(tmps,type)=>{
+ let objs=tmps.filter(d=>d.costType==type);
+ return objs.length>0?objs[0]:{};
+ }
+ let tmps=(d.data||[]).map(it=>{
+ it.money=it.money?it.money/10000.0:0;
+ return it;
+ });
+ let y=data.year;
+ let m=data.month-1;
+ if(m==0){
+ m=12;
+ y--;
+ }
+ let tmps2=(res[1].data||[]).map(it=>{
+ it.money=it.money?it.money/10000.0:0;
+ return it;
+ });
+ let curM=tmps2.filter(it=>it.costType==9 && it.year==y && it.month==m);
+ curM=curM.length>0?curM[0]:{};
+
+ let totalObjs=tmps.filter(it=>it.costType==9);
+ let total=0;
+ totalObjs.forEach(it=>{
+ if(it.money){
+ total+=it.money;
+ }
+ });
+ let yearObjs=tmps.filter(it=>it.costType==9 && it.year==y);
+ let totalY=0;
+ yearObjs.forEach(it=>{
+ if(it.money){
+ totalY+=it.money;
+ }
+ });
+ let obj={
+ totalInv:getValue(tmps,1).money||0,//总投资
+ curYear:getValue(tmps,2).money||0,//年总投资
+ contract1:getValue(tmps,3).money||0,//合同金额
+ contract2:getValue(tmps,4).money||0,//合同支付金额
+ contract3:getValue(tmps,5).money||0,//合同挂账金额
+ safety1:getValue(tmps,6).money||0,//安措金额
+ safety2:getValue(tmps,7).money||0,//安措支付金额
+ safety3:getValue(tmps,8).money||0,//安措挂账金额
+ curMonth:curM.money||0,//当月投资
+ totalMonth:total,//开累投资
+ totalYear:totalY,//本年完成
+ }
+ reslove(obj);
+ })
+ })
+}
+
export default {
groupByCraftType,
groupByCraftTypeByAttendance,
subdeptsUsersList,
attendanceUbiDataList,
milestoneList,
+ costOutputSelectYearAndMonth
};
diff --git a/yanzhu-bigscreen/src/utils/request.js b/yanzhu-bigscreen/src/utils/request.js
index bfff3fc0..812e5c20 100644
--- a/yanzhu-bigscreen/src/utils/request.js
+++ b/yanzhu-bigscreen/src/utils/request.js
@@ -76,7 +76,6 @@ service.interceptors.response.use(res => {
return res.data
}
if (code === 401) {
- debugger
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
diff --git a/yanzhu-bigscreen/src/views/projectDetail.vue b/yanzhu-bigscreen/src/views/projectDetail.vue
index b66aceb1..11b4a595 100644
--- a/yanzhu-bigscreen/src/views/projectDetail.vue
+++ b/yanzhu-bigscreen/src/views/projectDetail.vue
@@ -224,7 +224,7 @@
总投资
- {{ 1000 }} 万元
+ {{ costOutData.totalInv||0 }} 万元
@@ -237,7 +237,7 @@
本月完成
- {{ 1000 }} 万元
+ {{ costOutData.curMonth||0 }} 万元
@@ -251,7 +251,7 @@
本年完成
- {{ 1000 }} 万元
+ {{ costOutData.totalYear||0 }} 万元
@@ -265,7 +265,7 @@
开累完成
- {{ 1000 }} 万元
+ {{ costOutData.totalMonth||0 }} 万元
@@ -280,7 +280,7 @@
计划开工日期
- {{ new Date() | toDate }}
+ {{ selProject.scheduledStartTime | toDate }}
@@ -295,7 +295,7 @@
计划竣工日期
- {{ new Date() | toDate }}
+ {{ selProject.plannedCompletionTime | toDate }}
@@ -309,7 +309,7 @@
实际开工日期
- {{ new Date() | toDate }}
+ {{ selProject.actualOperatingTime | toDate }}
@@ -323,7 +323,7 @@
合同工期
- {{ 2100 }} 天
+ {{ selProject.projectTimeLimit||'' }} 天
@@ -338,7 +338,7 @@
建筑面积
- {{ 10000 }} 平方米
+ {{ selProject.floorArea||'' }} 平方米
@@ -503,7 +503,6 @@ import projectInfoDialog from './detail/projectInfoDialog.vue';
import staffSurveyChart from '@/components/staffSurveyChart.vue';
import MonitAndWarning from './components/MonitAndWarning.vue';
import attendanceInfoDlg from './detail/attendanceInfoDlg.vue';
-import testData from './test/detail'
import debounce from 'lodash.debounce'
export default {
components: {
@@ -549,6 +548,7 @@ export default {
projectBuildNode: [],
maxWidth: 0,
minWidth: 100,
+ costOutData:{},
}
},
mounted() {
@@ -615,13 +615,25 @@ export default {
});
this.loadAttendanceData();
this.loadMilestoneData();
+ this.loadCostOutput();
},
- loadMilestoneData() {
+ loadCostOutput(){
+ let dt = this.$dt(new Date());
+ this.$api.detail.costOutputSelectYearAndMonth({
+ comId: this.selProject.comId,
+ projectId: this.selProject.id,
+ year: dt.$y,
+ month: dt.$M + 1,
+ }).then(d=>{
+ this.costOutData=d;
+ });
+ },
+ loadMilestoneData() {
this.$api.detail.milestoneList({
pageNum: 1,
pageSize: 100,
- comId: this.prjInfo.comId,
- projectId: this.prjInfo.id
+ comId: this.selProject.comId,
+ projectId: this.selProject.id
}).then(d => {
this.projectBuildNode = d;
let itemWidth = this.$dpi() == "1K" ? 200 : this.$dpi() == "2K" ? 300 : 500;
@@ -638,8 +650,8 @@ export default {
loadAttendanceData() {
let ajax = this.$api.detail.groupByCraftType;
let posData = {
- comId: this.prjInfo.comId,
- projectId: this.prjInfo.id
+ comId: this.selProject.comId,
+ projectId: this.selProject.id
}
if (this.attendanceNav == 1) {
ajax = this.$api.detail.groupByCraftTypeByAttendance;
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProCostOutputController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProCostOutputController.java
index 45f44af7..67c1b8c2 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProCostOutputController.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProCostOutputController.java
@@ -142,4 +142,59 @@ public class ProCostOutputController extends BaseController
Map>> list=proCostOutputService.selectForBigEnginList(where);
return AjaxResult.success(list);
}
+
+ /**
+ * 按项目ID查询,如果没有数据进行初始化
+ * @param projectId
+ * @return
+ */
+ @GetMapping("/listByProjectId")
+ public AjaxResult listByProjectId(long projectId,long comId){
+ ProCostOutput where =new ProCostOutput();
+ where.setProjectId(projectId);
+ where.setComId(comId);
+ List list=proCostOutputService.selectProCostOutputList(where);
+ if(list.size()==0){
+ proCostOutputService.initProject(projectId,comId);
+ }
+ list=proCostOutputService.selectProCostOutputList(where);
+ return AjaxResult.success(list);
+ }
+ /**
+ * 增加年度投资
+ * @param projectId
+ * @param year
+ * @return
+ */
+ @PostMapping("/addYearInvestment")
+ public AjaxResult addYearInvestment(@RequestBody ProCostOutput where){
+ List list=proCostOutputService.selectProCostOutputList(where);
+ if(list.size()==0){
+ proCostOutputService.addYearInvestment(where);
+ return AjaxResult.success("增加年度投资成功!");
+ }else{
+ return AjaxResult.error("此年度投资已存在!");
+ }
+ }
+ @PostMapping("/addMonthInvestment")
+ public AjaxResult addMonthInvestment(@RequestBody ProCostOutput where) {
+ List list=proCostOutputService.selectProCostOutputList(where);
+ if(list.size()==0){
+ proCostOutputService.addMonthInvestment(where);
+ return AjaxResult.success("增加月度投资成功!");
+ }else{
+ return AjaxResult.error("此月度投资已存在!");
+ }
+ }
+
+
+ @PostMapping("/batchUpdate")
+ public AjaxResult batchUpdate(@RequestBody List list){
+ try {
+ proCostOutputService.batchUpdate(list);
+ return AjaxResult.success("保存成功!");
+ }catch (Exception ex){
+ return AjaxResult.error(ex.getMessage());
+ }
+ }
}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProCostOutputServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProCostOutputServiceImpl.java
index 02ee3180..02294c80 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProCostOutputServiceImpl.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProCostOutputServiceImpl.java
@@ -118,19 +118,19 @@ public class ProCostOutputServiceImpl implements IProCostOutputService
insertProCostOutput(it);
it.setYear(null);
it.setCostType(3l);//合同金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(4l);//合同支付金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(5l);//合同挂账金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(6l);//安措金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(7l);//安措支付金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(8l);//安措挂账金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(10l);//建安费金额
- insertProCostOutput(it);
+ //insertProCostOutput(it);
it.setCostType(9l);//月度投资
it.setYear(year*1l);
for(int i=1;i<=12;i++){
diff --git a/yanzhu-ui-vue3/src/App.vue b/yanzhu-ui-vue3/src/App.vue
index 045bc42e..1ead6db3 100644
--- a/yanzhu-ui-vue3/src/App.vue
+++ b/yanzhu-ui-vue3/src/App.vue
@@ -65,5 +65,8 @@ onMounted(() => {
top: 16px;
display: none;
}
-}
+}
+:focus-visible {
+ outline: none !important;
+}
\ No newline at end of file
diff --git a/yanzhu-ui-vue3/src/api/manage/costOutput.js b/yanzhu-ui-vue3/src/api/manage/costOutput.js
index 44a0e23f..97603ba2 100644
--- a/yanzhu-ui-vue3/src/api/manage/costOutput.js
+++ b/yanzhu-ui-vue3/src/api/manage/costOutput.js
@@ -42,3 +42,36 @@ export function delCostOutput(id) {
method: 'delete'
})
}
+
+export function listByProjectId(query){
+ return request({
+ url: '/manage/costOutput/listByProjectId',
+ method: 'get',
+ params: query
+ })
+}
+
+
+export function addYearInvestment(data){
+ return request({
+ url: '/manage/costOutput/addYearInvestment',
+ method: 'post',
+ data:data
+ })
+}
+
+export function addMonthInvestment(data){
+ return request({
+ url: '/manage/costOutput/addMonthInvestment',
+ method: 'post',
+ data:data
+ })
+}
+
+export function batchUpdate(datas){
+ return request({
+ url: '/manage/costOutput/batchUpdate',
+ method: 'post',
+ data:datas
+ })
+}
diff --git a/yanzhu-ui-vue3/src/views/manage/costOutput/costMonth.vue b/yanzhu-ui-vue3/src/views/manage/costOutput/costMonth.vue
new file mode 100644
index 00000000..58e69c94
--- /dev/null
+++ b/yanzhu-ui-vue3/src/views/manage/costOutput/costMonth.vue
@@ -0,0 +1,83 @@
+
+
+
+ 选择年份
+
+
+
+
+
+ 取消
+ 确定
+
+
+ 增加年份
+
+
+
+
+
+
+
+
+
+ 万元
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yanzhu-ui-vue3/src/views/manage/costOutput/costOutputDrawer.vue b/yanzhu-ui-vue3/src/views/manage/costOutput/costOutputDrawer.vue
new file mode 100644
index 00000000..dd022979
--- /dev/null
+++ b/yanzhu-ui-vue3/src/views/manage/costOutput/costOutputDrawer.vue
@@ -0,0 +1,185 @@
+
+
+
+ {{ (data.title) + " 【项目成本产值管理】" }}
+
+
+
+
+
+
+
+
+
+
+ 万元
+
+ 年度投资
+
+
+
+
+
+
+ 月度产值
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yanzhu-ui-vue3/src/views/manage/costOutput/costYear.vue b/yanzhu-ui-vue3/src/views/manage/costOutput/costYear.vue
new file mode 100644
index 00000000..25322ca5
--- /dev/null
+++ b/yanzhu-ui-vue3/src/views/manage/costOutput/costYear.vue
@@ -0,0 +1,86 @@
+
+
+
+
+ 选择年份
+
+
+
+
+
+ 取消
+ 确定
+
+
+ 增加年份
+
+
+
+
+
+
+
+
+
+
+ 万元
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yanzhu-ui-vue3/src/views/manage/costOutput/index.vue b/yanzhu-ui-vue3/src/views/manage/costOutput/index.vue
index 63b40894..b3f8c941 100644
--- a/yanzhu-ui-vue3/src/views/manage/costOutput/index.vue
+++ b/yanzhu-ui-vue3/src/views/manage/costOutput/index.vue
@@ -2,76 +2,35 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
搜索
@@ -81,42 +40,20 @@
- 新增
+ 新增
- 修改
+ 修改
- 删除
+ 删除
- 导出
+ 导出
@@ -145,19 +82,16 @@
- 修改
- 删除
+ 修改
+ 删除
-
-
+
+
@@ -181,18 +115,12 @@
-
-
@@ -350,12 +278,12 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
- proxy.$modal.confirm('是否确认删除项目成本产值编号为"' + _ids + '"的数据项?').then(function() {
+ proxy.$modal.confirm('是否确认删除项目成本产值编号为"' + _ids + '"的数据项?').then(function () {
return delCostOutput(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
- }).catch(() => {});
+ }).catch(() => { });
}
/** 导出按钮操作 */
diff --git a/yanzhu-ui-vue3/src/views/manage/greenCarbonData/index.vue b/yanzhu-ui-vue3/src/views/manage/greenCarbonData/index.vue
index 840c4d0d..1389ff1c 100644
--- a/yanzhu-ui-vue3/src/views/manage/greenCarbonData/index.vue
+++ b/yanzhu-ui-vue3/src/views/manage/greenCarbonData/index.vue
@@ -287,7 +287,7 @@ function handleAdd() {
pageNum: 1,
pageSize: 100,
projectId: userStore.currentProId,
- comIdL: userStore.currentComId,
+ comId: userStore.currentComId,
carbonFactorType: data.selTab
}).then(d => {
data.itemList = d.rows || [];
@@ -306,7 +306,7 @@ function handleUpdate(row) {
pageNum: 1,
pageSize: 100,
projectId: userStore.currentProId,
- comIdL: userStore.currentComId,
+ comId: userStore.currentComId,
carbonFactorType: data.selTab
}).then(d => {
data.itemList = d.rows || [];
diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue
index e6eb61de..3612317a 100644
--- a/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue
+++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue
@@ -53,7 +53,7 @@
-
@@ -101,25 +101,42 @@
-
+
+ menuCommand(e,scope.row)">
+
+
+
+ 操作
+
+
+
+
+
+
+
+
+ 修改
+
+
+
+
+
+ 项目产值管理
+
+
+
+
+ 删除
+
+
+
@@ -128,13 +145,10 @@
v-model:limit="queryParams.pageSize" @pagination="getList" />
-
+
-
+
@@ -181,11 +195,11 @@
-
+
-
+
@@ -232,13 +246,13 @@
-
+
-
+
@@ -253,15 +267,15 @@
:value="dict.value">
-
+
-
+
-
+
@@ -279,44 +293,47 @@
-
+
-
+
-
+
@@ -371,6 +390,7 @@ import { deptTreeSelect } from "@/api/system/user";
import { listProProjectInfo, getProProjectInfo, delProProjectInfo, addProProjectInfo, updateProProjectInfo } from "@/api/manage/proProjectInfo";
import BaiduMap from "@/components/BaiduMap/Map.vue";
import useUserStore from '@/store/modules/user'
+import costOutputDrawer from "../costOutput/costOutputDrawer.vue";
const { proxy } = getCurrentInstance();
const { pro_project_type, pro_project_schedule, pro_dept_type, sys_is_del } = proxy.useDict('pro_project_type', 'pro_project_schedule', 'pro_dept_type', 'sys_is_del');
@@ -387,10 +407,10 @@ const total = ref(0);
const title = ref("");
const activeTags = ref('base')
const addressInfos = ref("");
-const fitemPrjAddr=ref()
+const fitemPrjAddr = ref()
const projectDeptsList = ref([]);
const checkedProjectDepts = ref([]);
-
+const coDrawer=ref();
const deptOptions = ref([]);
const userStore = useUserStore()
const data = reactive({
@@ -413,7 +433,7 @@ const data = reactive({
projectStatus: null,
isDel: null,
},
- rules: {
+ rules: {
disDeptId: [{ required: true, message: "归属单位不能为空", trigger: "change" }],
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
simpleName: [{ required: false, message: "项目简称不能为空", trigger: "blur" }],
@@ -432,25 +452,39 @@ const data = reactive({
actualOperatingTime: [{ required: true, message: "实际开工时间不能为空", trigger: "blur" }],
projectSummarize: [{ required: true, message: "项目概述不能为空", trigger: "blur" }],
},
- opt:'',
- projectDeptsList:[]
+ opt: '',
+ projectDeptsList: []
});
const { queryParams, form, rules } = toRefs(data);
/** 地图选择 */
function mapDocom(pt, city) {
- form.value.province=city.province
- form.value.city=city.city
- form.value.district=city.district
- form.value.address=city.address;
+ form.value.province = city.province
+ form.value.city = city.city
+ form.value.district = city.district
+ form.value.address = city.address;
form.value.projectAddress = city.address || "";
form.value.longitude = pt.lng.toFixed(5);
form.value.latitude = pt.lat.toFixed(5);
addressInfos.value = form.value.projectAddress + "," + form.value.longitude + "," + form.value.latitude;
- fitemPrjAddr.value.clearValidate();
+ fitemPrjAddr.value.clearValidate();
}
+function menuCommand(e,row){
+ if(e=="edit"){
+ handleUpdate(row);
+ return;
+ }
+ if(e=="delete"){
+ handleDelete(row);
+ return;
+ }
+ if(e=="outCost"){
+ coDrawer.value.showDrawer(row);
+ return;
+ }
+}
/** 查询项目信息列表 */
function getList() {
loading.value = true;
@@ -469,7 +503,7 @@ function cancel() {
// 表单重置
function reset() {
- addressInfos.value="";
+ addressInfos.value = "";
form.value = {
id: null,
deptId: null,
@@ -513,7 +547,7 @@ function reset() {
setting: {}
};
proxy.resetForm("proProjectInfoRef");
- activeTags.value="base";
+ activeTags.value = "base";
}
/** 搜索按钮操作 */
@@ -537,65 +571,64 @@ function handleSelectionChange(selection) {
/** 新增按钮操作 */
function handleAdd() {
- data.opt="add"
+ data.opt = "add"
reset();
open.value = true;
title.value = "添加项目";
}
-function doAddPrjDept(it){
+function doAddPrjDept(it) {
it.datas.push({
- deptType:it.header,deptName:'',leader:'',phone:''
+ deptType: it.header, deptName: '', leader: '', phone: ''
});
}
-function doDeletPrjDept(it,item,index){
- if(item.deptName || item.leader || item.phone){
+function doDeletPrjDept(it, item, index) {
+ if (item.deptName || item.leader || item.phone) {
proxy.$modal.confirm('是否确认删除这个数据?').then(function () {
- it.datas.splice(index,1)
+ it.datas.splice(index, 1)
proxy.$modal.msgSuccess("删除成功");
}).catch(() => { });
- }else{
- it.datas.splice(index,1)
+ } else {
+ it.datas.splice(index, 1)
}
}
/** 修改按钮操作 */
function handleUpdate(row) {
- data.opt="edit"
+ data.opt = "edit"
reset();
const _id = row.id || ids.value
- getProProjectInfo(_id).then(response => {
- debugger
+ getProProjectInfo(_id).then(response => {
form.value = response.data;
- form.value.setting=response.data.setting||{
- orgName:'',
- orgLogo:'',
- orgPlane:'',
- orgImage:[],
- orgVideo:''
+ form.value.setting = response.data.setting || {
+ orgName: '',
+ orgLogo: '',
+ orgPlane: '',
+ orgImage: [],
+ orgVideo: ''
};
open.value = true;
title.value = "修改项目信息";
- projectDeptsList.value=(response.data.projectDeptsList||[]).filter(d=>d.id);
- if(projectDeptsList.value.length==0){
- projectDeptsList.value=[
- {deptType:'建设单位',deptName:'',leader:'',phone:''},
- {deptType:'监理单位',deptName:'',leader:'',phone:''},
- {deptType:'设计单位',deptName:'',leader:'',phone:''},
- {deptType:'检测单位',deptName:'',leader:'',phone:''},
- {deptType:'勘察单位',deptName:'',leader:'',phone:''},
+ projectDeptsList.value = (response.data.projectDeptsList || []).filter(d => d.id);
+ if (projectDeptsList.value.length == 0) {
+ projectDeptsList.value = [
+ { deptType: '建设单位', deptName: '', leader: '', phone: '' },
+ { deptType: '监理单位', deptName: '', leader: '', phone: '' },
+ { deptType: '设计单位', deptName: '', leader: '', phone: '' },
+ { deptType: '检测单位', deptName: '', leader: '', phone: '' },
+ { deptType: '勘察单位', deptName: '', leader: '', phone: '' },
];
}
- let headers="建设单位,监理单位,设计单位,检测单位,勘察单位".split(",");
- data.projectDeptsList=[];
- headers.forEach(h=>{
+ let headers = "建设单位,监理单位,设计单位,检测单位,勘察单位".split(",");
+ data.projectDeptsList = [];
+ headers.forEach(h => {
data.projectDeptsList.push({
- header:h,
- datas:projectDeptsList.value.filter(it=>it.deptType==h)
+ header: h,
+ datas: projectDeptsList.value.filter(it => it.deptType == h)
})
- });
+ });
addressInfos.value = form.value.projectAddress + "," + form.value.longitude + "," + form.value.latitude;
-
+
});
}
@@ -632,12 +665,12 @@ function handleDeptsSelectionChange(selection) {
checkedProjectDepts.value = selection.map(item => item.index)
}
-function getProjectDeptsList(){
- let datas=[];
- data.projectDeptsList.forEach(d=>{
- if(d.datas){
- d.datas.forEach(it=>{
- if(it.deptName || it.leader || it.phone){
+function getProjectDeptsList() {
+ let datas = [];
+ data.projectDeptsList.forEach(d => {
+ if (d.datas) {
+ d.datas.forEach(it => {
+ if (it.deptName || it.leader || it.phone) {
datas.push(it);
}
})
@@ -651,9 +684,9 @@ function submitForm() {
proxy.$refs["proProjectInfoRef"].validate(valid => {
if (valid) {
form.value.projectDeptsList = getProjectDeptsList();
- let postData={
+ let postData = {
...form.value
- }
+ }
if (form.value.id != null) {
updateProProjectInfo(postData).then(response => {
proxy.$modal.msgSuccess("修改成功");
@@ -716,9 +749,9 @@ function getMapInfo() {
/** 初始化页面 */
function initPage() {
let roles = userStore.roles;
- if(roles.includes("admin") || roles.includes("gsAdmin")){
+ if (roles.includes("admin") || roles.includes("gsAdmin")) {
isAdmin.value = true;
- }else{
+ } else {
isAdmin.value = false;
}
}
@@ -728,52 +761,62 @@ getList();
getDeptTree();