From 40156cbae622671684543e0899c381f0b22a4bb4 Mon Sep 17 00:00:00 2001
From: CD配唱片 <CD配唱片>
Date: 星期五, 25 四月 2025 20:05:41 +0800
Subject: [PATCH] 提交新内容和修正
---
.env.development | 1
src/views/mainPlan/gasPlanning/index.vue | 300 +++++++++++++++++++++++++++++++++++++------------
src/views/mainPlan/platePlanList/index.vue | 5
src/views/basicData/calendar/index.vue | 20 ++-
src/views/mainPlan/gasProduceStatics/index.vue | 2
5 files changed, 244 insertions(+), 84 deletions(-)
diff --git a/.env.development b/.env.development
index 27efa92..605a602 100644
--- a/.env.development
+++ b/.env.development
@@ -10,3 +10,4 @@
# 閰嶅悎鍚庣鏈嶅姟
# VITE_APP_LOCAL = 'int'
# VITE_APP_LOCAL = 'zhl'
+VITE_APP_LOCAL = 'hjy'
\ No newline at end of file
diff --git a/src/views/basicData/calendar/index.vue b/src/views/basicData/calendar/index.vue
index 3cb4745..073b58d 100644
--- a/src/views/basicData/calendar/index.vue
+++ b/src/views/basicData/calendar/index.vue
@@ -102,6 +102,10 @@
<span v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 宸ヤ綔鏃�; </span>
<span v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 闈炲伐浣滄棩; </span>
</span>
+ <!-- <div v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
+ <vxe-tag v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 宸ヤ綔鏃�; </vxe-tag>
+ <vxe-tag v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 闈炲伐浣滄棩; </vxe-tag>
+ </div> -->
</div>
<div v-if="row.type === '2'">
<div>{{JSON.parse(row.content.value).holidays.startdate}}鑷硔{JSON.parse(row.content.value).holidays.enddate}}</div>
@@ -424,26 +428,26 @@
{
title: "鏃ュ巻绫诲瀷",
field: "type",
- width: 150,
+ width: 200,
align: "center",
slots: { default: "status" },
},
{
title: "鏃ュ巻鐢熸晥鏃堕棿",
field: "effectiveDate",
- width: 100,
+ width: 200,
align: "center",
},
{
title: "鏃ュ巻澶辨晥鏃堕棿",
field: "expiringDate",
- width: 150,
+ width: 200,
align: "center",
},
{
title: "鏃ュ巻鍐呭",
field: "content",
- width: 200,
+ width: 230,
align: "center",
slots: { default: "mark" },
},
@@ -470,7 +474,7 @@
{
title: '閫傜敤杞﹂棿',
field: 'applicableWorkshop',
- width: 150,
+ width: 200,
align: 'center',
formatter: (({ cellValue, row, column }) => {
@@ -488,19 +492,19 @@
{
title: "閫傜敤宸ュ簭",
field: "applicableProcess",
- width: 90,
+ width: 200,
align: "center",
},
{
title: "鍒涘缓鑰�",
field: "createBy",
- width: 90,
+ width: 200,
align: "center",
},
{
title: "鍒涘缓鏃堕棿",
field: "createTime",
- width: 90,
+ width: 200,
align: "center",
},
{ title: '鎿嶄綔', width: 100, fixed:"right", slots: { default: 'buttons' }, align: 'center' }
diff --git a/src/views/mainPlan/gasPlanning/index.vue b/src/views/mainPlan/gasPlanning/index.vue
index a84817d..2bb0a90 100644
--- a/src/views/mainPlan/gasPlanning/index.vue
+++ b/src/views/mainPlan/gasPlanning/index.vue
@@ -51,11 +51,11 @@
</HxlhTable> -->
<vxe-table
border
- ref="xTable"
+ ref="tableRef"
show-overflow
:loading="loading"
:height="height"
- :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
+ :edit-config="{ trigger: 'manual', mode: 'row', showStatus: true }"
:data="routePlanList"
@cell-click="cellClickEvent"
>
@@ -66,10 +66,13 @@
field="dayProduceType"
title="鏃ヤ骇鍑虹被鍨�"
min-width="160"
- :edit-render="{ }"
+ :edit-render="{}"
>
<template #edit="{ row }">
- <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select>
+ <vxe-select
+ v-model="row.dayProduceType"
+ :options="dayProduceTypeOptions"
+ ></vxe-select>
</template>
<template #default="{ row }">
<span>{{ formatTypeLabel([row.dayProduceType]) }}</span>
@@ -82,10 +85,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number
- v-model="row.dayProduceNum"
- size="mini"
- />
+ <el-input-number v-model="row.dayProduceNum" size="mini" />
</template>
</vxe-column>
<vxe-column
@@ -105,9 +105,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number
- v-model="row.personnelNumber"
- />
+ <el-input-number v-model="row.personnelNumber" />
</template>
</vxe-column>
<vxe-column
@@ -117,10 +115,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number
- v-model="row.dayProduceAllNum"
- disabled
- />
+ <el-input-number v-model="row.dayProduceAllNum" disabled />
</template>
</vxe-column>
<vxe-column
@@ -140,7 +135,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number v-model="row.monthProduceAllNum" disabled/>
+ <el-input-number v-model="row.monthProduceAllNum" disabled />
</template>
</vxe-column>
<vxe-column
@@ -152,6 +147,22 @@
<template #edit="{ row }">
<el-input type="textarea" v-model="row.remark" />
</template>
+ </vxe-column>
+ <vxe-column title="鎿嶄綔" width="200" fixed="right">
+ <!-- <template #default="{ row }">
+ <vxe-button @click="handleSave(row)" :loading="row.loading"
+ >淇濆瓨</vxe-button
+ > -->
+ <template #default="{ row }">
+ <template v-if="hasEditStatus(row)">
+ <el-button @click="saveRowEvent(row)" size="small">淇濆瓨</el-button>
+ <el-button @click="cancelRowEvent()" size="small">鍙栨秷</el-button>
+ </template>
+ <template v-else>
+ <el-button @click="editRowEvent(row)" size="small">缂栬緫</el-button>
+ </template>
+ </template>
+ <!-- </template> -->
</vxe-column>
</vxe-table>
</div>
@@ -167,11 +178,11 @@
:height="height"
>
</HxlhTable> -->
- <vxe-table
+ <vxe-table
border
- ref="xTable"
+ ref="tableRef1"
show-overflow
- :loading="loading"
+ :loading="loading2"
:height="height"
:edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
:data="gasPlanList"
@@ -184,10 +195,13 @@
field="dayProduceType"
title="鏃ヤ骇鍑虹被鍨�"
min-width="160"
- :edit-render="{ }"
+ :edit-render="{}"
>
<template #edit="{ row }">
- <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select>
+ <vxe-select
+ v-model="row.dayProduceType"
+ :options="dayProduceTypeOptions"
+ ></vxe-select>
</template>
<template #default="{ row }">
<span>{{ formatTypeLabel([row.dayProduceType]) }}</span>
@@ -200,10 +214,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number
- v-model="row.dayProduceNum"
- size="mini"
- />
+ <el-input-number v-model="row.dayProduceNum" size="mini" />
</template>
</vxe-column>
<vxe-column
@@ -223,9 +234,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number
- v-model="row.personnelNumber"
- />
+ <el-input-number v-model="row.personnelNumber" />
</template>
</vxe-column>
<vxe-column
@@ -235,9 +244,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number
- v-model="row.dayProduceAllNum"
- />
+ <el-input-number v-model="row.dayProduceAllNum" />
</template>
</vxe-column>
<vxe-column
@@ -247,7 +254,7 @@
:edit-render="{ autoFocus: 'input' }"
>
<template #edit="{ row }">
- <el-input-number v-model="row.days" />
+ <el-input-number v-model="row.days" />
</template>
</vxe-column>
<vxe-column
@@ -270,10 +277,26 @@
<el-input type="textarea" v-model="row.remark" />
</template>
</vxe-column>
+ <vxe-column title="鎿嶄綔" width="200" fixed="right">
+ <!-- <template #default="{ row }">
+ <el-button @click="handleSave(row)" :loading="row.loading"
+ >淇濆瓨</el-button
+ > -->
+ <template #default="{ row }">
+ <template v-if="hasEditStatus1(row)">
+ <el-button @click="saveRowEvent1(row)" size="small">淇濆瓨</el-button>
+ <el-button @click="cancelRowEvent1()" size="small">鍙栨秷</el-button>
+ </template>
+ <template v-else>
+ <el-button @click="editRowEvent1(row)" size="small">缂栬緫</el-button>
+ </template>
+ </template>
+ <!-- </template> -->
+ </vxe-column>
</vxe-table>
- <div class="btn_center">
- <el-button type="primary" @click="handleSave">淇濆瓨</el-button>
- </div>
+ <!-- <div class="btn_center">
+ <el-button type="primary" @click="handleSave2">淇濆瓨</el-button>
+ </div> -->
</div>
</div>
</div>
@@ -286,11 +309,14 @@
import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning";
const height = ref(document.documentElement.clientHeight - 400 + "px;");
const loading = ref(false);
+const loading2 = ref(false);
const data = reactive({
queryParams: {
date: "",
},
});
+const tableRef = ref()
+const tableRef1 = ref()
const { queryParams } = toRefs(data);
const gasPlanList = ref([]);
const routePlanList = ref([]);
@@ -300,13 +326,17 @@
]);
const formatTypeLabel = (list) => {
if (list) {
- return list.map(type => {
- const item = dayProduceTypeOptions.value.find(item => item.value === type)
- return item ? item.label : type
- }).join(',')
+ return list
+ .map((type) => {
+ const item = dayProduceTypeOptions.value.find(
+ (item) => item.value === type
+ );
+ return item ? item.label : type;
+ })
+ .join(",");
}
- return ''
-}
+ return "";
+};
// 琛ㄦ牸閰嶇疆
// const columns = ref([
// // {
@@ -378,6 +408,68 @@
// type: "html",
// },
// ]);
+const hasEditStatus = (row) => {
+ const $table = tableRef.value
+ if ($table) {
+ return $table.isEditByRow(row)
+ }
+}
+const editRowEvent = (row) => {
+ const $table = tableRef.value
+ if ($table) {
+ $table.setEditRow(row)
+ }
+}
+const saveRowEvent = (row) => {
+ const $table = tableRef.value
+ if ($table) {
+ $table.clearEdit().then(() => {
+ // loading.value = true
+ // setTimeout(() => {
+ // loading.value = false
+ // VxeUI.modal.message({ content: `淇濆瓨鎴愬姛锛乶ame=${row.name}`, status: 'success' })
+ // }, 300)
+ handleSave(row)
+ })
+ }
+}
+const cancelRowEvent = () => {
+ const $table = tableRef.value
+ if ($table) {
+ $table.clearEdit()
+ }
+}
+const hasEditStatus1 = (row) => {
+ const $table = tableRef1.value
+ if ($table) {
+ return $table.isEditByRow(row)
+ }
+}
+const editRowEvent1 = (row) => {
+ const $table = tableRef1.value
+ if ($table) {
+ $table.setEditRow(row)
+ }
+}
+const saveRowEvent1 = (row) => {
+ const $table = tableRef1.value
+ if ($table) {
+ $table.clearEdit().then(() => {
+ // loading.value = true
+ // setTimeout(() => {
+ // loading.value = false
+ // VxeUI.modal.message({ content: `淇濆瓨鎴愬姛锛乶ame=${row.name}`, status: 'success' })
+ // }, 300)
+ handleSave2(row)
+ })
+ }
+}
+const cancelRowEvent1 = () => {
+ const $table = tableRef1.value
+ if ($table) {
+ $table.clearEdit()
+ }
+}
async function getRouteList(year, month) {
const res = await listGasPlan({
major: "绠¤矾",
@@ -395,10 +487,14 @@
personnelNumber:
item.personnelNumber == null ? "1" : item.personnelNumber,
dayProduceAllNum:
- item.dayProduceAllNum == null ? "0" : item.dayProduceNum*item.personnelNumber,
+ item.dayProduceAllNum == null
+ ? "0"
+ : item.dayProduceNum * item.personnelNumber,
days: item.days == null ? "22" : item.days,
monthProduceAllNum:
- item.monthProduceAllNum == null ? "0" : item.dayProduceAllNum*item.days,
+ item.monthProduceAllNum == null
+ ? "0"
+ : item.dayProduceAllNum * item.days,
};
});
loading.value = false;
@@ -420,55 +516,109 @@
personnelNumber:
item.personnelNumber == null ? "1" : item.personnelNumber,
dayProduceAllNum:
- item.dayProduceAllNum == null ? "0" : item.dayProduceNum*item.personnelNumber,
+ item.dayProduceAllNum == null
+ ? "0"
+ : item.dayProduceNum * item.personnelNumber,
days: item.days == null ? "22" : item.days,
monthProduceAllNum:
- item.monthProduceAllNum == null ? "0" : item.dayProduceAllNum*item.days,
+ item.monthProduceAllNum == null
+ ? "0"
+ : item.dayProduceAllNum * item.days,
};
});
- loading.value = false;
+ loading2.value = false;
}
-function cellClickEvent ({ row, column }){
- console.log(column,row)
- row.dayProduceAllNum = row.dayProduceNum*row.personnelNumber
- row.monthProduceAllNum = row.dayProduceAllNum*row.days
+function cellClickEvent({ row, column }) {
+ console.log(column, row);
+ row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber;
+ row.monthProduceAllNum = row.dayProduceAllNum * row.days;
}
function handleQuery() {
+ if(!queryParams.value.date){
+ ElMessage({
+ message: "璇烽�夋嫨骞存湀",
+ type: "error",
+ });
+ return;
+ }
console.log(queryParams.value.date, "scsciciisc");
const year = queryParams.value.date.split("-")[0];
const month = parseInt(queryParams.value.date.split("-")[1]);
getRouteList(year, month);
getGasList(year, month);
}
-async function handleSave() {
+function resetQuery() {
+ queryParams.value.date = ""
+}
+async function handleSave(row) {
const year = queryParams.value.date.split("-")[0];
const month = parseInt(queryParams.value.date.split("-")[1]);
- gasPlanList.value = gasPlanList.value.map((item)=>{
- return {
- ...item,
- major: "姘斾綋",
- year,
- month
- }
- })
- routePlanList.value = routePlanList.value.map((item)=>{
- return {
- ...item,
+ console.log(row, "baocun");
+ // gasPlanList.value = gasPlanList.value.map((item) => {
+ // return {
+ // ...item,
+ // major: "姘斾綋",
+ // year,
+ // month,
+ // };
+ // });
+ // routePlanList.value = routePlanList.value.map((item) => {
+ // return {
+ // ...item,
+ // major: "绠¤矾",
+ // year,
+ // month,
+ // };
+ // });
+ const res = await getGasPlanSave([
+ {
+ ...row,
major: "绠¤矾",
year,
- month
- }
- })
- const res = await getGasPlanSave([
- ...gasPlanList.value,
- ...routePlanList.value
- ])
- ElMessage({
+ month,
+ },
+ ]);
+ ElMessage({
message: "鏁版嵁淇濆瓨鎴愬姛",
type: "success",
});
- handleQuery()
- console.log(res,"akiwjciwj")
+ handleQuery();
+ console.log(res, "akiwjciwj");
+}
+async function handleSave2(row) {
+ const year = queryParams.value.date.split("-")[0];
+ const month = parseInt(queryParams.value.date.split("-")[1]);
+ console.log(row, "baocun");
+ // gasPlanList.value = gasPlanList.value.map((item) => {
+ // return {
+ // ...item,
+ // major: "姘斾綋",
+ // year,
+ // month,
+ // };
+ // });
+ // routePlanList.value = routePlanList.value.map((item) => {
+ // return {
+ // ...item,
+ // major: "绠¤矾",
+ // year,
+ // month,
+ // };
+ // });
+ const res = await getGasPlanSave([
+ {
+ ...row,
+ major: "姘斾綋",
+ year,
+ month,
+ },
+ ]);
+ ElMessage({
+ message: "鏁版嵁淇濆瓨鎴愬姛",
+ type: "success",
+ });
+ handleQuery();
+ console.log(res, "akiwjciwj");
}
onMounted(() => {
// getRouteList();
@@ -491,11 +641,11 @@
margin: 20px auto;
}
}
-.btn_center{
+.btn_center {
display: flex;
justify-content: center;
align-items: center;
- margin-top:20px;
- padding-bottom:20px;
+ margin-top: 20px;
+ padding-bottom: 20px;
}
</style>
diff --git a/src/views/mainPlan/gasProduceStatics/index.vue b/src/views/mainPlan/gasProduceStatics/index.vue
index 13a251b..ae47d56 100644
--- a/src/views/mainPlan/gasProduceStatics/index.vue
+++ b/src/views/mainPlan/gasProduceStatics/index.vue
@@ -29,7 +29,7 @@
<el-date-picker
v-model="queryParams.monthRange"
type="monthrange"
- range-separator="To"
+ range-separator="鑷�"
start-placeholder="閫夋嫨寮�濮嬫湀浠�"
end-placeholder="閫夋嫨缁撴潫鏈堜唤"
/>
diff --git a/src/views/mainPlan/platePlanList/index.vue b/src/views/mainPlan/platePlanList/index.vue
index 5e9548d..18cb1f1 100644
--- a/src/views/mainPlan/platePlanList/index.vue
+++ b/src/views/mainPlan/platePlanList/index.vue
@@ -306,6 +306,11 @@
},
},
]);
+ newArray.splice(2,0,{
+ title: "鐒婃帴浠堕綈濂楀紑濮嬫椂闂�",
+ field:"hanjie_startDate",
+ width: 140,
+ })
await nextTick();
columns.value = [...columns.value, ...newArray]; // 寮哄埗缁勪欢閲嶆柊娓叉煋
--
Gitblit v1.9.3