From 96872a90ce8eb5c3395c31bbebcb93bd7a36027a Mon Sep 17 00:00:00 2001
From: chengxiangling <291105840@qq.com>
Date: 星期一, 12 五月 2025 19:25:21 +0800
Subject: [PATCH] 提交更改
---
src/views/basicData/calendar/index.vue | 160 ++++++++++++++++++++++++++++-------------------------
1 files changed, 85 insertions(+), 75 deletions(-)
diff --git a/src/views/basicData/calendar/index.vue b/src/views/basicData/calendar/index.vue
index 3cb4745..6b2d26d 100644
--- a/src/views/basicData/calendar/index.vue
+++ b/src/views/basicData/calendar/index.vue
@@ -38,7 +38,7 @@
plain
icon="Plus"
@click="handleAdd"
- v-hasPermi="['aps:calendar:update']"
+ v-hasPermi="['aps:calendar:add']"
>鏂板</el-button
>
</el-col>
@@ -98,18 +98,43 @@
</template>
<template #mark="{ row }">
<div v-if="row.type === '1'">
- <span v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
- <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>
+ <span
+ v-for="(item, index) in JSON.parse(row.content.value).weekdays"
+ :key="index"
+ >
+ <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>
+ <div>
+ {{ JSON.parse(row.content.value).holidays.startdate }}鑷硔{
+ JSON.parse(row.content.value).holidays.enddate
+ }}
+ </div>
</div>
</template>
- <template #buttons="{row}">
- <vxe-button mode="text" @click="handleUpdate(row)" v-hasPermi="['aps:calendar:update']" >淇敼</vxe-button>
- <vxe-button mode="text" @click="handleDelete(row)" v-hasPermi="['aps:calendar:remove']" >鍒犻櫎</vxe-button>
+ <template #buttons="{ row }">
+ <vxe-button
+ mode="text"
+ @click="handleUpdate(row)"
+ v-hasPermi="['aps:calendar:update']"
+ >淇敼</vxe-button
+ >
+ <vxe-button
+ mode="text"
+ @click="handleDelete(row)"
+ v-hasPermi="['aps:calendar:remove']"
+ >鍒犻櫎</vxe-button
+ >
</template>
</HxlhTable>
@@ -163,7 +188,7 @@
>
<div class="week_flex_item">{{ item.chineseName }}</div>
<div class="week_flex_item">
- <el-radio-group v-model="item.work" @change="handleSetWorkDays">
+ <el-radio-group v-model="item.work">
<el-radio :label="'y'">宸ヤ綔鏃�</el-radio>
<el-radio :label="'n'">闈炲伐浣滄棩</el-radio>
</el-radio-group>
@@ -289,7 +314,7 @@
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { selectProcessNameList } from "@/api/basicData/processRoute.js";
const { proxy } = getCurrentInstance();
-const tableRef = ref()
+const tableRef = ref();
const calendarList = ref([]);
const open = ref(false);
const loading = ref(true);
@@ -373,7 +398,7 @@
work: "y",
},
{
- day: "TuesDay",
+ day: "Tuesday",
chineseName: "鏄熸湡浜�",
work: "y",
},
@@ -424,26 +449,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" },
},
@@ -453,57 +478,56 @@
width: 200,
align: "center",
formatter: ({ cellValue, row, column }) => {
- console.log(cellValue, "000hsudhwhuwhuhwu");
- for (let i = 0; i < plantList.value.length; i++) {
- console.log(
- cellValue,
- plantList.value[i].plantCode,
- plantList.value[i].plantName,
- "111hsudhwhuwhuhwu"
- );
- if (cellValue === plantList.value[i].plantCode) {
- return plantList.value[i].plantName;
+ if (cellValue) {
+ for (let i = 0; i < plantList.value.length; i++) {
+ if (cellValue === plantList.value[i].plantCode) {
+ return plantList.value[i].plantName;
+ }
}
}
},
},
{
- title: '閫傜敤杞﹂棿',
- field: 'applicableWorkshop',
- width: 150,
- align: 'center',
- formatter: (({ cellValue, row, column }) => {
-
+ title: "閫傜敤杞﹂棿",
+ field: "applicableWorkshop",
+ width: 200,
+ align: "center",
+ formatter: ({ cellValue, row, column }) => {
if (cellValue) {
- for(let i=0;i<shopList.value.length;i++){
- if(cellValue===shopList.value[i].id){
- console.log(cellValue,'cellValue')
- return shopList.value[i].shopName
+ for (let i = 0; i < shopList.value.length; i++) {
+ if (cellValue === shopList.value[i].id) {
+ return shopList.value[i].shopName;
}
}
}
- return '';
- })
+ return "";
+ },
},
{
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' }
+ {
+ title: "鎿嶄綔",
+ width: 100,
+ fixed: "right",
+ slots: { default: "buttons" },
+ align: "center",
+ },
]);
// 鍒嗛〉灞炴��
const page = ref({
@@ -520,21 +544,23 @@
page.value.total = response.total;
loading.value = false;
});
- axios.all([
- /** 鏌ヨ宸ュ巶鍒楄〃 */
- listAll_plant({}),
- /** 鏌ヨ杞﹂棿鍒楄〃 */
- listAll_shop({}),
- ])
- .then(axios.spread((response1, response2) => {
- plantList.value = response1.data;
- shopList.value = response2.data;
- loading.value = false;
- }))
- .catch(error => {
- console.error('璇锋眰鍑洪敊:', error);
- });
-
+ axios
+ .all([
+ /** 鏌ヨ宸ュ巶鍒楄〃 */
+ listAll_plant({}),
+ /** 鏌ヨ杞﹂棿鍒楄〃 */
+ listAll_shop({}),
+ ])
+ .then(
+ axios.spread((response1, response2) => {
+ plantList.value = response1.data;
+ shopList.value = response2.data;
+ loading.value = false;
+ })
+ )
+ .catch((error) => {
+ console.error("璇锋眰鍑洪敊:", error);
+ });
}
// 鍙栨秷鎸夐挳
@@ -587,15 +613,10 @@
reset();
open.value = true;
title.value = "娣诲姞鏃ュ巻绠$悊";
- // const res = await listAll_plant({});
- // plantList.value = res.data;
-
- console.log(res, "sjchhscwhciwhcwi");
}
/** 閫夋嫨宸ュ巶鍚庝簨浠� 鍔犺浇杞﹂棿 鍜� 宸ュ簭 **/
function changePlant(plant) {
listAps_shop({ plantCode: plant }).then((response) => {
- console.log(response, "sbcsuhcuhscschsc");
shopList.value = response.rows;
});
selectProcessNameList({ orgCode: plant }).then((response) => {
@@ -608,11 +629,6 @@
const _id = row.id || ids.value;
getCalendar(_id).then((response) => {
form.value = response.data;
- console.log(
- form.value,
- JSON.parse(response.data.content.value),
- "hushchsuch"
- );
// form.value.content = JSON.parse(response.data.content.value);
if (form.value.type === "1") {
weekDaysSettingList.value = JSON.parse(
@@ -632,7 +648,6 @@
proxy.$refs["calendarRef"].validate((valid) => {
if (valid) {
if (form.value.id != null) {
- console.log(form.value, "淇敼鏃ュ巻===");
if (form.value.type === "1") {
updateCalendar({
...form.value,
@@ -715,7 +730,6 @@
);
}
function handleSwitchType(e) {
- console.log(e, "鏃ユ湡绫诲瀷鍒囨崲");
typeRadioNumber.value = e;
form.value.type = e;
form.value.effectiveDate = null;
@@ -724,10 +738,6 @@
form.value.applicableFactory = null;
form.value.applicableWorkshop = null;
form.value.applicableProcess = null;
-}
-// 璁剧疆鍛ㄥ伐浣滄棩
-function handleSetWorkDays(e) {
- console.log(weekDaysSettingList.value, "璁剧疆鍛ㄥ伐浣滄棩");
}
function changePageNo(currentPage) {
queryParams.value.pageNum = currentPage;
@@ -796,8 +806,8 @@
.factory_use_item {
margin-top: 10px;
}
-.mart5{
- margin-top:5px;
+.mart5 {
+ margin-top: 5px;
}
.custom-height {
height: 200px; /* 鎴栬�呬娇鐢� min-height */
--
Gitblit v1.9.3