From f4bcf01171297bc16db79e543eda36a36957279b Mon Sep 17 00:00:00 2001 From: CD配唱片 <CD配唱片> Date: 星期日, 27 四月 2025 15:39:08 +0800 Subject: [PATCH] 提交标准工序的表格工厂展示字段修正 --- src/views/basicData/calendar/index.vue | 138 ++++++++++++++++++++++++---------------------- 1 files changed, 72 insertions(+), 66 deletions(-) diff --git a/src/views/basicData/calendar/index.vue b/src/views/basicData/calendar/index.vue index 073b58d..da87e7b 100644 --- a/src/views/basicData/calendar/index.vue +++ b/src/views/basicData/calendar/index.vue @@ -98,22 +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> - <!-- <div v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index"> + <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> @@ -167,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> @@ -293,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); @@ -457,37 +478,30 @@ 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', + title: "閫傜敤杞﹂棿", + field: "applicableWorkshop", width: 200, - align: 'center', - formatter: (({ cellValue, row, column }) => { - + 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: "閫傜敤宸ュ簭", @@ -507,7 +521,13 @@ 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({ @@ -524,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); + }); } // 鍙栨秷鎸夐挳 @@ -591,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) => { @@ -612,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( @@ -636,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, @@ -719,7 +730,6 @@ ); } function handleSwitchType(e) { - console.log(e, "鏃ユ湡绫诲瀷鍒囨崲"); typeRadioNumber.value = e; form.value.type = e; form.value.effectiveDate = null; @@ -728,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; @@ -800,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