diff --git a/public/favicon.ico b/public/favicon.ico index e2637602..a5a46102 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/assets/images/fh.png b/src/assets/images/fh.png new file mode 100644 index 00000000..87450062 Binary files /dev/null and b/src/assets/images/fh.png differ diff --git a/src/components/prompt/api.js b/src/components/prompt/api.js new file mode 100644 index 00000000..dbf6d200 --- /dev/null +++ b/src/components/prompt/api.js @@ -0,0 +1,11 @@ +import axios from '@/utils/request' +// 查询分页数据: +export const iengineerlogList = (arg) => { + return axios.request({ + url: '/iproductionplan/querywarn', + method: 'get', + params: arg, + dataType: 'json', + + }) +} diff --git a/src/components/prompt/index.vue b/src/components/prompt/index.vue new file mode 100644 index 00000000..df0ba301 --- /dev/null +++ b/src/components/prompt/index.vue @@ -0,0 +1,121 @@ + + + \ No newline at end of file diff --git a/src/layout/index.vue b/src/layout/index.vue index 0923ca64..54c43f24 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -6,10 +6,12 @@ + + + + + diff --git a/src/views/constructionScheduling/progress-alert/options.js b/src/views/constructionScheduling/progress-alert/options.js new file mode 100644 index 00000000..51f437e9 --- /dev/null +++ b/src/views/constructionScheduling/progress-alert/options.js @@ -0,0 +1,27 @@ +export const baseModelOptions = () => { + function validatePhoneNumber(phoneNumber) { + const regex = /^1[3-9]\d{9}$/; + return regex.test(phoneNumber); + } + const validatePass2 = (rule, value, callback) => { + if (value === '') { + callback(new Error('请输入现场负责人联系方式')) + } else { + if (!validatePhoneNumber(value)) { + callback(new Error('手机号格式不正确')) + return + } + callback() + } + } + return [ + + ] +} + +export const baseFilterOptions = () => { + return [ + + + ] +} \ No newline at end of file diff --git a/src/views/constructionScheduling/progress-monitoring/api.js b/src/views/constructionScheduling/progress-monitoring/api.js new file mode 100644 index 00000000..ad461f82 --- /dev/null +++ b/src/views/constructionScheduling/progress-monitoring/api.js @@ -0,0 +1,66 @@ +import axios from '@/utils/request' +// 查询分页数据: +export const iresourcescheduleList = (arg) => { + return axios.request({ + url: '/iproductionplan/statistics', + method: 'get', + params: arg, + dataType: 'json', + + }) +} +// 查询详情数据: +export const iresourcescheduleGetById = (arg) => { + return axios.request({ + url: `/iresourceschedule/getById`, + method: 'get', + params: arg, + dataType: 'json', + + }) +} + +// 添加数据: +export const iresourcescheduleAdd = (arg) => { + return axios.request({ + url: '/iresourceschedule/add', + method: 'post', + data: arg, + dataType: 'json', + + }) +} + +// 修改数据: +export const iresourcescheduleUpdate = (arg) => { + return axios.request({ + url: '/iresourceschedule/update', + method: 'put', + data: arg, + dataType: 'json', + + }) +} + +// 删除数据: +export const iresourcescheduleDelete = (arg) => { + return axios.request({ + url: '/iresourceschedule/delete', + method: 'delete', + params: { + id:arg.id[0] + }, + dataType: 'json', + + }) +} +// 查询分页数据: +export const iproductionplanList = (arg) => { + return axios.request({ + url: '/iproductionplan/list', + method: 'get', + params: arg, + dataType: 'json', + + }) +} \ No newline at end of file diff --git a/src/views/constructionScheduling/progress-monitoring/echartsOptions.js b/src/views/constructionScheduling/progress-monitoring/echartsOptions.js new file mode 100644 index 00000000..96398040 --- /dev/null +++ b/src/views/constructionScheduling/progress-monitoring/echartsOptions.js @@ -0,0 +1,123 @@ +import * as echarts from "echarts"; +// import 'echarts-liquidfill/src/liquidFill.js'; //在这里引入 +export function echartsZhe({ ydata2, ydata1, xdata }) { + + let color = ['#027CFB', '#02FBD1', '#F1C342', '#10F3A4'] + let server = [{ + type: "line", + name: "计划进度", + symbolSize: 1, + animation: false, + itemStyle: { + normal: { + label: { + show: true, + textStyle: { + color: "#8a989f", + fontSize: 10, + }, + position: "top", + }, + color: color[0], + lineStyle: { + color: color[0], + width: 1, + }, + }, + }, + data: ydata1 ? ydata1 : [], + }, { + type: "line", + symbolSize: 1, + name: "实际进度", + animation: false, + itemStyle: { + normal: { + label: { + show: true, + textStyle: { + color: "#8a989f", + fontSize: 10, + }, + position: "top", + }, + color: color[1], + lineStyle: { + color: color[1], + width: 1, + }, + }, + }, + data: ydata2 ? ydata2 : [], + }] + return { + grid: { + left: "5%", + right: "12%", + top: "15%", + bottom: "10%", + }, + legend: { + top: "0%", + y: "35", + textStyle: { + fontSize: 14, + }, + data: xdata, + }, + tooltip: { + trigger: "axis", + }, + xAxis: [ + { + type: "category", + boundaryGap: false, + axisLabel: { + color: "#8a989f", + formatter: function (value) { + // 使用正则表达式每10个字符换行 + return value.replace(/^(.{10})/g, "$1\n"); + }, + }, + axisLine: { + show: false, + lineStyle: { + color: "#E9EAED", + }, + }, + axisTick: { + show: true, + }, + data: [1, 2, 3, 4], + }, + ], + yAxis: [ + { + type: "value", + offset: 0, + axisLabel: { + formatter: "{value}", + marginBottom: 20, + textStyle: { + color: "#8a989f", + }, + }, + axisLine: { + lineStyle: { + color: "#E9EAED", + }, + }, + axisTick: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: "#E9EAED", + }, + }, + }, + ], + series: server, + }; +} diff --git a/src/views/constructionScheduling/progress-monitoring/index.vue b/src/views/constructionScheduling/progress-monitoring/index.vue new file mode 100644 index 00000000..163f9b97 --- /dev/null +++ b/src/views/constructionScheduling/progress-monitoring/index.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/src/views/constructionScheduling/progress-monitoring/options.js b/src/views/constructionScheduling/progress-monitoring/options.js new file mode 100644 index 00000000..82a982ae --- /dev/null +++ b/src/views/constructionScheduling/progress-monitoring/options.js @@ -0,0 +1,94 @@ +export const baseModelOptions = () => { + return [ + { + tag: 'BaseSelect', + label: '计划名称:', + key: 'planId', + value: '', + default: '', + rules: [ + { required: true, message: '请选择计划名称', trigger: 'blur' }, + ], + attribute: { //属性 + placeholder: '请选择计划名称', + options: [] + }, + }, + { + tag: 'el-input-number', + label: '当前进度:', + key: 'currentProgress', + value: 0, + default: 0, + rules: [ + { required: true, message: '请输入当前进度', trigger: 'blur' }, + ], + attribute: {//属性 + min: 0, + max: 100, + placeholder: '请输入当前进度', + }, + }, + { + tag: "el-date-picker", + label: '计划开始时间:', + key: 'startTime', + value: '', + default: '', + rules: [ + { required: true, message: '请选择计划开始时间', trigger: 'blur' }, + ], + attribute: {//属性 + valueFormat: "YYYY-MM-DD", + type: "date", + placeholder: '请选择计划开始时间', + }, + }, + { + tag: "el-date-picker", + label: '计划结束时间:', + key: 'endTime', + value: '', + default: '', + rules: [ + { required: true, message: '请选择计划结束时间', trigger: 'blur' }, + ], + attribute: {//属性 + valueFormat: "YYYY-MM-DD", + type: "date", + placeholder: '请选择计划结束时间', + }, + }, + { + tag: 'el-input', + label: '调度建议:', + key: 'advises', + value: '', + default: '', + attribute: {//属性 + type: 'textarea', + placeholder: '请输入调度建议', + }, + }, + ] +} + +export const baseFilterOptions = () => { + return [ + { + tag: 'BaseSelect', + label: '计划名称:', + key: 'planId', + value: '', + default: '', + rules: [ + { required: true, message: '请选择计划名称', trigger: 'blur' }, + ], + attribute: { //属性 + placeholder: '请选择计划名称', + options: [] + }, + }, + + ] +} \ No newline at end of file diff --git a/src/views/constructionScheduling/progress-tracking/index.vue b/src/views/constructionScheduling/progress-tracking/index.vue index fad783aa..782bc039 100644 --- a/src/views/constructionScheduling/progress-tracking/index.vue +++ b/src/views/constructionScheduling/progress-tracking/index.vue @@ -2,9 +2,13 @@ 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(), @@ -19,6 +23,7 @@ const state = reactive({ editFn: iprogressUpdate, deleteFn: iprogressDelete, detailFn: iprogressGetById, + rowKey: 'id', showEditBtn: false, showDeleteBtn: false, columnCount: 1, @@ -34,68 +39,110 @@ const state = reactive({ }, hideselection: true, pageInfo: { total: 0, base: { limit: 8, current: 1 } }, + baseQuery: { processDate: formattedTime }, beforeSubmit: function (params) { - let item = state.planList.find((item) => item.id == params.planId) - if (item) { - params.planName = item.planName - } + let child = proxy.getNameById(state.planList, params.planId, 'id') + if (!params.parentId) params.parentId = 0 + params.planName = child.planName return params }, - planList: [] + 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) { - iproductionplanList({ pageNo: 1, pageSize: 9999 }).then((res) => { - if (res.code == 200) { - state.planList = res.data.list - state.baseModelOptions = proxy.$util.setOptions({ - attrName: 'options',//树形 - 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: 'options',//树形 - 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, - }); - } + 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) + }) +} +