修改进度跟踪

main
junhong 1 week ago
parent 0e56ce0516
commit 5e98f0f915
  1. 6
      src/views/constructionScheduling/progress-tracking/api.js
  2. 67
      src/views/constructionScheduling/progress-tracking/index.vue
  3. 159
      src/views/constructionScheduling/progress-tracking/indexcopy.vue
  4. 66
      src/views/constructionScheduling/progress-tracking/options.js
  5. 4
      vite.config.js

@ -2,7 +2,8 @@ import axios from '@/utils/request'
// 查询分页数据:
export const iprogressList = (arg) => {
return axios.request({
url: '/iprogress/list',
url: '/iprogressNew/list',
// url: '/iprogress/list',
method: 'get',
params: arg,
dataType: 'json',
@ -23,7 +24,8 @@ export const iprogressGetById = (arg) => {
// 添加数据:
export const iprogressAdd = (arg) => {
return axios.request({
url: '/iprogress/add',
// url: '/iprogress/add',
url:'/iprogressNew/add',
method: 'post',
data: arg,
dataType: 'json',

@ -39,13 +39,19 @@ const state = reactive({
},
hideselection: true,
pageInfo: { total: 0, base: { limit: 8, current: 1 } },
baseQuery: { processDate: formattedTime },
baseQuery: { date: formattedTime },
processDate: "",
beforeSubmit: function (params) {
let child = proxy.getNameById(state.planList, params.planId, 'id')
if (!params.parentId) params.parentId = 0
params.planName = child.planName
// let child = proxy.getNameById(state.planList, params.planId, 'id')
// if (!params.parentId) params.parentId = 0
// params.planName = child.planName
return params
},
tableDataFormatter: function (params, res) {
state.processDate = table.value.filterRef.getFilterParams().date
return res.data.list
},
hideControl:true,
planList: [],
handleAdd: function (params) {
getPlanList().then(() => {
@ -53,7 +59,7 @@ const state = reactive({
})
},
beforeEdit: function (params) {
if (params.parentId == 0) params.parentId = ' '
// if (params.parentId == 0) params.parentId = ' '
return new Promise((resolve) => {
getPlanList().then(() => {
resolve(params)
@ -91,20 +97,20 @@ function getPlanList(params) {
});
}
})
await iprogressList({ pageNo: 1, pageSize: 9999 }).then((res) => {
if (res.code == 200) {
state.baseModelOptions = proxy.$util.setOptions({
attrName: 'data',//
data: state.baseModelOptions, //
key: "parentId", //key
res: res, //
path: res.data.list,
relation: { key: 'value', name: 'label', resKey: 'id', resName: 'planName' },
everClear: true,
hasChildren: true,
});
}
})
// await iprogressList({ pageNo: 1, pageSize: 9999 }).then((res) => {
// if (res.code == 200) {
// state.baseModelOptions = proxy.$util.setOptions({
// attrName: 'data',//
// data: state.baseModelOptions, //
// key: "parentId", //key
// res: res, //
// path: res.data.list,
// relation: { key: 'value', name: 'label', resKey: 'id', resName: 'planName' },
// everClear: true,
// hasChildren: true,
// });
// }
// })
resolve(params)
})
}
@ -122,7 +128,16 @@ function handAdd(item) {
<BaseTablePage :tableOptions="state" ref="table">
<template v-slot:column>
<el-table-column label="计划名称" align="center" prop="planName" />
<el-table-column label="日期" align="center" prop="processDate" />
<el-table-column label="项目阶段" align="center" prop="projectStage" />
<el-table-column label="计划描述" align="center" prop="description" />
<el-table-column label="计划开始时间" align="center" prop="startTime" />
<el-table-column label="计划结束时间" align="center" prop="endTime" />
<el-table-column label="总工期(天)" align="center" prop="duration" />
<el-table-column label="日期" align="center" prop="processDate">
<template #default="scope">
<span>{{ state.processDate }}</span>
</template>
</el-table-column>
<el-table-column label="当日完成进度 " align="center" prop="dayProgress">
<template #default="scope">
<el-progress :stroke-width="6" :percentage="Number(scope.row.dayProgress)" />
@ -136,22 +151,18 @@ function handAdd(item) {
<!-- <el-table-column label="创建人" align="center" prop="creator" /> -->
<!-- <el-table-column label="创建时间" align="center" prop="createTime" /> -->
</template>
<template #control="baseScope">
<!-- <template #control="baseScope">
<el-table-column label="操作" align="center" width="200" fixed="right">
<template #default="scope">
<el-button v-if="scope.row.parentId == 0" v-hasPermi="['progressTracking:page:add']" type="text" icon="Plus"
@click="handAdd(scope.row)">
新增
</el-button>
<el-button v-hasPermi="['progressTracking:page:edit']" type="text" icon="EditPen"
@click="baseScope.handleEdit(scope.$index, scope.row)">
修改
</el-button>
<el-button v-hasPermi="['progressTracking:page:remove']" type="text" icon="Delete"
@click="baseScope.deleteTableData(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</template>
</template> -->
</BaseTablePage>
</div>
</template>

@ -0,0 +1,159 @@
<script setup>
import { reactive } from 'vue'
import { iprogressList, iprogressAdd, iprogressUpdate, iprogressDelete, iprogressGetById, iproductionplanList } from './api'
import { baseModelOptions, baseFilterOptions } from './options'
const currentTime = new Date();
const year = currentTime.getFullYear();
const month = String(currentTime.getMonth() + 1).padStart(2, '0');
const day = String(currentTime.getDate()).padStart(2, '0');
const formattedTime = `${year}-${month}-${day}`;
const { proxy } = getCurrentInstance();
const table = ref()
const state = reactive({
baseModelOptions: baseModelOptions(),
baseFilterOptions: baseFilterOptions(),
title: "进度跟踪管理",
baseModelName: '进度跟踪信息',
addBtnName: '新增进度跟踪',
editBtnName: '',
delBtnName: '',
primaryKey: 'id',
getTableFn: iprogressList,
addFn: iprogressAdd,
editFn: iprogressUpdate,
deleteFn: iprogressDelete,
detailFn: iprogressGetById,
rowKey: 'id',
showEditBtn: false,
showDeleteBtn: false,
columnCount: 1,
// rowControl: {
// showEditBtn: false,
// showDelBtn: false
// },
permission: {//
add: 'progressTracking:page:list',
edit: 'progressTracking:page:list',
delete: 'progressTracking:page:list',
detail: 'progressTracking:page:list',
},
hideselection: true,
pageInfo: { total: 0, base: { limit: 8, current: 1 } },
baseQuery: { processDate: formattedTime },
beforeSubmit: function (params) {
let child = proxy.getNameById(state.planList, params.planId, 'id')
if (!params.parentId) params.parentId = 0
params.planName = child.planName
return params
},
planList: [],
handleAdd: function (params) {
getPlanList().then(() => {
table.value.handleAdd()
})
},
beforeEdit: function (params) {
if (params.parentId == 0) params.parentId = ' '
return new Promise((resolve) => {
getPlanList().then(() => {
resolve(params)
})
})
},
})
onMounted(() => {
getPlanList()
})
function getPlanList(params) {
return new Promise(async (resolve) => {
await iproductionplanList({ pageNo: 1, pageSize: 9999 }).then((res) => {
if (res.code == 200) {
state.planList = res.data.list
state.baseModelOptions = proxy.$util.setOptions({
attrName: 'data',//
data: state.baseModelOptions, //
key: "planId", //key
res: res, //
path: res.data.list,
relation: { key: 'value', name: 'label', resKey: 'id', resName: 'planName' },
everClear: true,
hasChildren: true,
});
state.baseFilterOptions = proxy.$util.setOptions({
attrName: 'data',//
data: state.baseFilterOptions, //
key: "planId", //key
res: res, //
path: res.data.list,
relation: { key: 'value', name: 'label', resKey: 'id', resName: 'planName' },
everClear: true,
hasChildren: true,
});
}
})
await iprogressList({ pageNo: 1, pageSize: 9999 }).then((res) => {
if (res.code == 200) {
state.baseModelOptions = proxy.$util.setOptions({
attrName: 'data',//
data: state.baseModelOptions, //
key: "parentId", //key
res: res, //
path: res.data.list,
relation: { key: 'value', name: 'label', resKey: 'id', resName: 'planName' },
everClear: true,
hasChildren: true,
});
}
})
resolve(params)
})
}
function handAdd(item) {
state.handleAdd()
nextTick(() => {
table.value.modelRef.setValueByKey('parentId', item.id)
})
}
</script>
<template>
<div class="app-container">
<BaseTablePage :tableOptions="state" ref="table">
<template v-slot:column>
<el-table-column label="计划名称" align="center" prop="planName" />
<el-table-column label="日期" align="center" prop="processDate" />
<el-table-column label="当日完成进度 " align="center" prop="dayProgress">
<template #default="scope">
<el-progress :stroke-width="6" :percentage="Number(scope.row.dayProgress)" />
</template>
</el-table-column>
<el-table-column label="累计完成进度" align="center" prop="accumulativeProgress">
<template #default="scope">
<el-progress :stroke-width="6" :percentage="Number(scope.row.accumulativeProgress)" />
</template>
</el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="creator" /> -->
<!-- <el-table-column label="创建时间" align="center" prop="createTime" /> -->
</template>
<template #control="baseScope">
<el-table-column label="操作" align="center" width="200" fixed="right">
<template #default="scope">
<el-button v-if="scope.row.parentId == 0" v-hasPermi="['progressTracking:page:add']" type="text" icon="Plus"
@click="handAdd(scope.row)">
新增
</el-button>
<el-button v-hasPermi="['progressTracking:page:edit']" type="text" icon="EditPen"
@click="baseScope.handleEdit(scope.$index, scope.row)">
修改
</el-button>
<el-button v-hasPermi="['progressTracking:page:remove']" type="text" icon="Delete"
@click="baseScope.deleteTableData(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</template>
</BaseTablePage>
</div>
</template>
<style scoped></style>

@ -1,23 +1,20 @@
export const baseModelOptions = () => {
return [
{
tag: 'el-tree-select',
label: '上级进度:',
key: 'parentId',
value: '',
default: '',
// rules: [
// { required: true, message: '请选择计划名称', trigger: 'blur' },
// ],
attribute: { //属性
clearable: true,
filterable: true,
placeholder: '请选择上级进度',
'render-after-expand': true,
checkStrictly: true,
data: []
},
},
// {
// tag: 'el-tree-select',
// label: '上级进度:',
// key: 'parentId',
// value: '',
// default: '',
// attribute: { //属性
// clearable: true,
// filterable: true,
// placeholder: '请选择上级进度',
// 'render-after-expand': true,
// checkStrictly: true,
// data: []
// },
// },
{
tag: 'el-tree-select',
label: '计划名称:',
@ -71,21 +68,21 @@ export const baseModelOptions = () => {
placeholder: '请输入当日完成进度',
},
},
{
tag: 'el-input-number',
label: '累计完成进度:',
key: 'accumulativeProgress',
value: 0,
default: 0,
rules: [
{ required: true, message: '请输入累计完成进度', trigger: 'blur' },
],
attribute: {//属性
min: 0,
max: 100,
placeholder: '请输入累计完成进度',
},
},
// {
// tag: 'el-input-number',
// label: '累计完成进度:',
// key: 'accumulativeProgress',
// value: 0,
// default: 0,
// rules: [
// { required: true, message: '请输入累计完成进度', trigger: 'blur' },
// ],
// attribute: {//属性
// min: 0,
// max: 100,
// placeholder: '请输入累计完成进度',
// },
// },
]
}
const currentTime = new Date();
@ -99,7 +96,7 @@ export const baseFilterOptions = () => {
{
tag: "el-date-picker",
label: '日期:',
key: 'processDate',
key: 'date',
value: formattedTime,
default: formattedTime,
rules: [
@ -110,6 +107,7 @@ export const baseFilterOptions = () => {
},
],
attribute: {
// clearable:false,
//属性
placeholder: "请选择日期",
valueFormat: "YYYY-MM-DD",

@ -43,9 +43,9 @@ export default defineConfig(({ mode, command }) => {
},
proxy: {
'/dev-api': {
// target: 'http://192.168.2.39:8581',
target: 'http://192.168.2.39:8581',
// target: 'http://192.168.2.223:8080',
target: 'http://39.100.74.100:8581',
// target: 'http://39.100.74.100:8581',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}

Loading…
Cancel
Save