From 65f86f41dedbbbb7030e2f37ce3e001bbca4923a Mon Sep 17 00:00:00 2001 From: chengxiangling <291105840@qq.com> Date: 星期四, 15 五月 2025 13:03:25 +0800 Subject: [PATCH] 查询日历带适用工厂 --- src/views/basicData/calendar/index.vue | 863 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 718 insertions(+), 145 deletions(-) diff --git a/src/views/basicData/calendar/index.vue b/src/views/basicData/calendar/index.vue index 8868a93..9a6fd7e 100644 --- a/src/views/basicData/calendar/index.vue +++ b/src/views/basicData/calendar/index.vue @@ -7,9 +7,10 @@ :inline="true" v-show="showSearch" label-width="68px" + label-position="left" > - <el-row type="flex" justify="left"> - <el-col :span="6"> + <el-row type="flex" justify="left" :gutter="20"> + <el-col :span="5"> <el-form-item label="鏃ュ巻鎻忚堪" prop="description"> <el-input style="width: 140px" @@ -25,7 +26,7 @@ <el-select style="width: 140px" clearable - v-model="queryParams.plant" + v-model="queryParams.applicableFactory" placeholder="閫傜敤宸ュ巶" > <el-option @@ -37,7 +38,7 @@ </el-select> </el-form-item> </el-col> - <el-col :span="12" style="text-align: right"> + <el-col :span="13" style="text-align: right"> <el-form-item class="column-with-margin"> <el-button type="primary" icon="Search" @click="handleQuery" >鏌ヨ</el-button @@ -110,7 +111,7 @@ class="auto-height-grid" > <template #status="{ row }"> - <vxe-tag v-if="row.type === '1'" status="primary">鍛ㄥ伐浣滄棩</vxe-tag> + <vxe-tag v-if="row.type === '1'" status="primary">鍛ㄥ伐浣�</vxe-tag> <vxe-tag v-if="row.type === '2'" status="success">鑺傚亣鏃�</vxe-tag> </template> <template #mark="{ row }"> @@ -140,17 +141,26 @@ </div> </template> <template #buttons="{ row }"> - <vxe-button - mode="text" + <el-button + type="primary" + size="small" @click="handleUpdate(row)" v-hasPermi="['aps:calendar:update']" - >淇敼</vxe-button + >淇敼</el-button > - <vxe-button - mode="text" + <el-button + type="warning" + size="small" + @click="handleSetHolidays(row)" + v-hasPermi="['aps:calendar:remove']" + >璁剧疆鑺傚亣鏃�</el-button + > + <el-button + type="danger" + size="small" @click="handleDelete(row)" v-hasPermi="['aps:calendar:remove']" - >鍒犻櫎</vxe-button + >鍒犻櫎</el-button > </template> </HxlhTable> @@ -193,7 +203,7 @@ > </el-date-picker> </el-form-item> - <div v-if="form.type === '1'"> + <div> <div class="title_bar_line"> <div class="line_short"></div> <div>鍛ㄥ伐浣滆缃�</div> @@ -251,10 +261,13 @@ prop="applicableFactory" class="factory_use_item" > --> - <div class="select_factory">閫傜敤宸ュ巶/杞﹂棿/宸ュ簭</div> + <div class="select_factory select_factory_dis"> + <span class="error_require">*</span> + <span>閫傜敤宸ュ巶/杞﹂棿/宸ュ簭</span> + </div> <!-- <el-row :gutter="20" class="select_factory"> --> <div - class="select_factory" + class="select_factory_dis" v-for="(item, index) in applicableSettingList" :key="index" > @@ -271,7 +284,7 @@ v-for="plant in aps_factory" :key="plant.value" :label="plant.label" - :value="plant.value" + :value="`${plant.value};${plant.label}`" > </el-option> </el-select> @@ -289,7 +302,7 @@ v-for="shop in shopList" :key="shop.id" :label="shop.shopName" - :value="shop.id" + :value="`${shop.id};${shop.shopName}`" > </el-option> </el-select> @@ -304,9 +317,9 @@ > <el-option v-for="process in processList" - :key="process.id" + :key="process.processNumber" :label="process.processName" - :value="process.processName" + :value="`${process.processNumber};${process.processName}`" > </el-option> </el-select> @@ -315,8 +328,17 @@ <el-button class="select_content" type="primary" - :icon="Plus" + icon="Plus" @click="handleAddFactory(item)" + circle + size="small" + /> + <el-button + v-if="applicableSettingList.length > 1" + class="select_content" + type="primary" + icon="Minus" + @click="handleMinusFactory(item)" circle size="small" /> @@ -344,11 +366,229 @@ </div> </template> </el-dialog> + <el-dialog + title="璁剧疆鑺傚亣鏃�" + v-model="openSetHolidays" + width="80%" + style="height: 570px" + append-to-body + > + <div class="height_dialog"> + <div class="height_dialog_scroll"> + <div class="grey_bg"> + <div v-if="expand"> + <div class="flex_item"> + <div>宸ヤ綔鏃ュ巻锛� </div> + <div>{{ form.description }}</div> + </div> + <div class="flex_item"> + <div>鐢熸晥鏃堕棿锛� </div> + <div>{{ form.effectiveDate }}</div> + </div> + <div class="flex_item"> + <div>澶辨晥鏃堕棿锛� </div> + <div>{{ form.expiringDate }}</div> + </div> + <div class="flex_item"> + <div>閫傜敤宸ュ巶锛� </div> + <div class="flex_item_dis"> + <div + class="flex_item" + v-for="(item, index) in form.applicableTranslate" + :key="index" + > + {{ item }} + <div v-if="item[0].factory">{{ item[0].factory }}</div> + <div v-if="item[2].workshop">-</div> + <div v-if="item[2].workshop">{{ item[2].workshop }}</div> + <div v-if="item[1].process">-</div> + <div v-if="item[1].process">{{ item[1].process }}</div> + </div> + </div> + </div> + </div> + <div class="flex_item_expand_end" @click="handleToggleExpand"> + <el-icon :size="18" v-if="expand"><ArrowUpBold /></el-icon> + <el-icon v-else><ArrowDownBold /></el-icon> + </div> + </div> + <div class="title_flex"> + <div class="holiday_title">鑺傚亣鏃ュ垪琛�</div> + <el-button type="primary" size="small" @click="hanldeAddHolidays" + >娣诲姞鑺傚亣鏃�</el-button + > + </div> + <div class="grey_bg"> + <div + class="flex_holidays_set" + v-for="(item, index) in formHolidays.holidays" + :key="index" + > + <div class="dis_error_wrap"> + <div class="flex_item"> + <div class="flex_item_title"> + <span class="error_require">*</span><span>鑺傚亣鏃ユ弿杩�</span> + </div> + <div> + <el-input + style="width: 130px" + v-model="item.describe" + placeholder="璇疯緭鍏ユ弿杩�" + /> + </div> + </div> + <div class="error_text" v-if="item.describe == ''"> + 璇疯緭鍏ヨ妭鍋囨棩鎻忚堪 + </div> + </div> + <div class="dis_error_wrap"> + <div class="flex_item"> + <div class="flex_item_title"> + <span class="error_require">*</span><span>寮�濮嬫椂闂�</span> + </div> + <div> + <el-date-picker + style="width: 130px" + clearable + v-model="item.startdate" + type="date" + :disabled-date="handleDisabledDate" + :default-value="form.effectiveDate" + placeholder="閫夋嫨鏃ユ湡" + > + </el-date-picker> + </div> + </div> + <div class="error_text" v-if="item.startdate == ''"> + 璇疯緭鍏ュ紑濮嬫椂闂� + </div> + </div> + <div class="dis_error_wrap"> + <div class="flex_item"> + <div class="flex_item_title"> + <span class="error_require">*</span><span>缁撴潫鏃堕棿</span> + </div> + <div> + <el-date-picker + style="width: 130px" + clearable + v-model="item.enddate" + type="date" + :disabled-date="handleDisabledDate" + :default-value="form.expiringDate" + placeholder="閫夋嫨鏃ユ湡" + > + </el-date-picker> + </div> + </div> + <div class="error_text" v-if="item.enddate == ''"> + 璇疯緭鍏ョ粨鏉熸椂闂� + </div> + </div> + <div class="dis_error_wrap"> + <div class="flex_item"> + <el-button + v-if="formHolidays.length > 1" + type="danger" + size="small" + @click="handleDelSettingHolidays(item)" + >鍒犻櫎</el-button + > + </div> + </div> + </div> + <!-- <el-form + class="mart10" + ref="holidaysRef" + :model="item" + :rules="holidayRules" + :inline="true" + label-width="105px" + > + <div v-for="(item, index) in formHolidays.holidays" :key="index"> + <el-form-item + label="鑺傚亣鏃ユ弿杩�" + :prop="'holidays.' + index + '.describe'" + :rules="{ + required: true, + message: '璇疯緭鍏ヨ妭鍋囨棩鎻忚堪', + trigger: 'blur', + }" + > + <el-input + style="width: 130px" + v-model="item.describe" + placeholder="璇疯緭鍏ユ弿杩�" + /> + </el-form-item> + <el-form-item + label="寮�濮嬫椂闂�" + :prop="'holidays.' + index + '.startdate'" + :rules="{ + required: true, + message: '璇疯緭鍏ュ紑濮嬫椂闂�', + trigger: 'blur', + }" + > + <el-date-picker + style="width: 130px" + clearable + v-model="item.startdate" + type="date" + :disabled-date="handleDisabledDate" + :default-value="form.effectiveDate" + placeholder="閫夋嫨鏃ユ湡" + > + </el-date-picker> + </el-form-item> + <el-form-item + label="缁撴潫鏃堕棿" + :prop="'holidays.' + index + '.enddate'" + :rules="{ + required: true, + message: '璇疯緭鍏ョ粨鏉熸椂闂�', + trigger: 'blur', + }" + > + <el-date-picker + style="width: 130px" + clearable + v-model="item.enddate" + type="date" + placeholder="閫夋嫨鏃ユ湡" + :disabled-date="handleDisabledDate" + :default-value="form.expiringDate" + > + </el-date-picker> + </el-form-item> + <el-form-item label="" prop=""> + <el-button + v-if="formHolidays.length > 1" + type="danger" + size="small" + @click="handleDelSettingHolidays(item)" + >鍒犻櫎</el-button + > + </el-form-item> + </div> + </el-form> --> + </div> + </div> + </div> + <template #footer> + <div class="dialog-footer"> + <el-button @click="openSetHolidays = false">鍙� 娑�</el-button> + <el-button type="primary" @click="handleSaveHolidaysForm" + >淇濆瓨</el-button + > + </div> + </template> + </el-dialog> </div> </template> <script setup name="Calendar"> -import { Plus } from "@element-plus/icons-vue"; +import moment from "moment"; import HxlhTable from "@/components/HxlhTable"; import { listCalendar, @@ -361,11 +601,15 @@ import { listAll_plant, listByWorkShop } from "@/api/basicData/plant"; import { listAll_shop, listAps_shop } from "@/api/basicData/shop"; import { selectProcessNameList } from "@/api/basicData/processRoute.js"; +import { ElMessage } from "element-plus"; const { proxy } = getCurrentInstance(); +const holidaysRef = ref(null); const { aps_factory } = proxy.useDict("aps_factory"); const tableRef = ref(); const calendarList = ref([]); const open = ref(false); +const openSetHolidays = ref(false); +const expand = ref(true); const loading = ref(true); const showSearch = ref(true); const ids = ref([]); @@ -383,12 +627,22 @@ process: "", }, ], + applicableTranslate: [{ factory: "" }, { workshop: "" }, { process: "" }], + }, + formHolidays: { + holidays: [ + { + enddate: "", + startdate: "", + describe: "", + }, + ], }, queryParams: { pageNum: 1, pageSize: 10, description: null, - plant: null, + applicableFactory: null, type: null, effectiveDate: null, expiringDate: null, @@ -426,16 +680,35 @@ trigger: "blur", }, ], - applicableFactory: [ - { - required: true, - message: "璇烽�夋嫨閫傜敤宸ュ巶", - trigger: "blur", - }, - ], }, + // holidayRules: { + // describe: [ + // { + // required: true, + // message: "璇疯緭鍏ヨ妭鍋囨棩鎻忚堪", + // trigger: "blur", + // }, + // ], + // startdate: [ + // { + // required: true, + // message: "璇疯緭鍏ュ紑濮嬫椂闂�", + // trigger: "blur", + // }, + // ], + // enddate: [ + // { + // required: true, + // message: "璇疯緭鍏ョ粨鏉熸椂闂�", + // trigger: "blur", + // }, + // ], + // }, }); -const { queryParams, form, rules } = toRefs(data); +const holidayRules = { + holidays: [{ required: true, message: "鑺傚亣鏃ユ槸蹇呭~椤�", trigger: "blur" }], +}; +const { queryParams, form, rules, formHolidays } = toRefs(data); const dateType = ref("鍛ㄥ伐浣�"); const dateTypeList = ref([ { @@ -449,7 +722,7 @@ ]); const typeRadioNumber = ref(1); const applicableSettingList = ref([ - { factory: "", workshop: "", process: "" }, + { factory: "", workshop: "", process: "", id: 0 }, ]); const weekDaysSettingList = ref([ { @@ -532,43 +805,43 @@ align: "center", slots: { default: "mark" }, }, - { - title: "閫傜敤宸ュ巶", - field: "applicableFactory", - width: 200, - align: "center", - formatter: ({ cellValue, row, column }) => { - 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: 200, - align: "center", - formatter: ({ cellValue, row, column }) => { - if (cellValue) { - for (let i = 0; i < shopList.value.length; i++) { - if (cellValue === shopList.value[i].id) { - return shopList.value[i].shopName; - } - } - } - return ""; - }, - }, - { - title: "閫傜敤宸ュ簭", - field: "applicableProcess", - width: 200, - align: "center", - }, + // { + // title: "閫傜敤宸ュ巶", + // field: "applicableFactory", + // width: 200, + // align: "center", + // formatter: ({ cellValue, row, column }) => { + // 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: 200, + // align: "center", + // formatter: ({ cellValue, row, column }) => { + // if (cellValue) { + // for (let i = 0; i < shopList.value.length; i++) { + // if (cellValue === shopList.value[i].id) { + // return shopList.value[i].shopName; + // } + // } + // } + // return ""; + // }, + // }, + // { + // title: "閫傜敤宸ュ簭", + // field: "applicableProcess", + // width: 200, + // align: "center", + // }, { title: "鍒涘缓鑰�", field: "createBy", @@ -583,7 +856,7 @@ }, { title: "鎿嶄綔", - width: 100, + width: 270, fixed: "right", slots: { default: "buttons" }, align: "center", @@ -626,34 +899,6 @@ // 鍙栨秷鎸夐挳 function cancel() { open.value = false; - reset(); -} - -// 琛ㄥ崟閲嶇疆 -function reset() { - form.value = { - id: null, - description: null, - type: "1", - effectiveDate: null, - expiringDate: null, - content: null, - applicableFactory: null, - applicableWorkshop: null, - applicableProcess: null, - createBy: null, - createTime: null, - updateBy: null, - updateTime: null, - applicable: [ - { - factory: "", - workshop: "", - process: "", - }, - ], - }; - proxy.resetForm("calendarRef"); } /** 鎼滅储鎸夐挳鎿嶄綔 */ @@ -677,9 +922,12 @@ /** 鏂板鎸夐挳鎿嶄綔 */ async function handleAdd() { - reset(); open.value = true; form.value = { + type: "1", + description: "", + expiringDate: "", + effectiveDate: "", applicable: [ { factory: "", @@ -687,13 +935,51 @@ process: "", }, ], + applicableTranslate: [{ factory: "" }, { workshop: "" }, { process: "" }], }; + weekDaysSettingList.value = [ + { + day: "Monday", + chineseName: "鏄熸湡涓�", + work: "y", + }, + { + day: "Tuesday", + chineseName: "鏄熸湡浜�", + work: "y", + }, + { + day: "Wednesday", + chineseName: "鏄熸湡涓�", + work: "y", + }, + { + day: "Thursday", + chineseName: "鏄熸湡鍥�", + work: "y", + }, + { + day: "Friday", + chineseName: "鏄熸湡浜�", + work: "y", + }, + { + day: "Saturday", + chineseName: "鏄熸湡鍏�", + work: "y", + }, + { + day: "Sunday", + chineseName: "鏄熸湡鏃�", + work: "y", + }, + ]; title.value = "娣诲姞鏃ュ巻绠$悊"; } /** 閫夋嫨宸ュ巶鍚庝簨浠� 鍔犺浇杞﹂棿 鍜� 宸ュ簭 **/ function changePlant(plant) { console.log(plant); - listAps_shop({ plantCode: plant }).then((response) => { + listAps_shop({ plantCode: plant.split(";")[0] }).then((response) => { shopList.value = response.rows; }); // selectProcessNameList({ orgCode: plant }).then((response) => { @@ -701,60 +987,252 @@ // }); } function changeWorkshop(workShop) { - listByWorkShop({ workShop: "姘旀煖" }).then((res) => { + console.log(workShop.split(";")[0]); + listByWorkShop({ workShop: workShop.split(";")[0] }).then((res) => { console.log(res, "workShop"); processList.value = res.rows; }); } function handleAddFactory(row) { - applicableSettingList.value.push(row); + console.log(row); + applicableSettingList.value.push({ ...row, id: ++row.id }); +} +function handleMinusFactory(row) { + applicableSettingList.value = applicableSettingList.value.filter( + (item, index) => item !== row + ); } /** 淇敼鎸夐挳鎿嶄綔 */ function handleUpdate(row) { - reset(); const _id = row.id || ids.value; + open.value = true; + title.value = "淇敼鏃ュ巻绠$悊"; getCalendar(_id).then((response) => { form.value = response.data; - // form.value.content = JSON.parse(response.data.content.value); - if (form.value.type === "1") { - weekDaysSettingList.value = JSON.parse( - response.data.content.value - ).weekdays; - } else if (form.value.type === "2") { - holidays.value = JSON.parse(response.data.content.value).holidays; + applicableSettingList.value = JSON.parse(response.data.applicableTranslate); + console.log(response.data, "response.data"); + form.value.content = JSON.parse(response.data.content.value); + weekDaysSettingList.value = response.data.content.weekdays; + form.value.applicableTranslate= applicableTranslateArr(response.data); + console.log(form.value.applicableTranslate,"form.value.applicableTranslate") + }); + +} +let applicableTranslateArr = (row)=>{ + return JSON.parse(row.applicableTranslate).map( + (item) => { + return Object.keys(item).map((n) => { + console.log(item); + let arrObj = {}; + if (item[n] && item[n].indexOf(";") > 0) { + arrObj[n] = item[n].split(";")[1]; + } else { + arrObj[n] = item[n]; + } + return arrObj; + }); } - - open.value = true; - title.value = "淇敼鏃ュ巻绠$悊"; + ); +} +// 璁剧疆鑺傚亣鏃� +function handleSetHolidays(row) { + console.log(applicableTranslateArr, "applicableTranslateArr"); + form.value = { + ...row, + applicableTranslate: applicableTranslateArr(row), + }; + if (!row.holidays) { + formHolidays.value = { + holidays: [ + { + enddate: "", + startdate: "", + describe: "", + }, + ], + }; + } else { + formHolidays.value.holidays = JSON.parse(row.holidays.value); + } + // console.log(formHolidays.value.holidays, "formHolidays.value"); + openSetHolidays.value = true; +} +// 绂佺敤鏃ユ湡 +function handleDisabledDate(date) { + const targetDate = moment(date).valueOf(); + const startDate = moment(form.value.effectiveDate).valueOf(); + const endDate = moment(form.value.expiringDate).valueOf(); + return targetDate < startDate || targetDate > endDate; +} +// 鍒犻櫎鑺傚亣鏃ヨ缃� +function handleDelSettingHolidays(row) { + formHolidays.value.holidays = formHolidays.value.holidays.filter((item) => { + return item != row; }); } - +// 娣诲姞鑺傚亣鏃� +function hanldeAddHolidays() { + formHolidays.value.holidays.push({ + enddate: "", + startdate: "", + describe: "", + }); +} +function handleToggleExpand() { + expand.value = !expand.value; +} +// const confirmClick = () => { +// let formList = [predictionFormRef] +// let resultArr = []; +// let validate = (form) => { +// let result = new Promise((resolve, reject) => { +// form.value.validate(valid => { +// if (valid) { +// resolve() +// } else { +// reject() +// } +// }) +// }) +// resultArr.push(result) +// } +// formList.forEach(item => { +// validate(item) +// }) +// Promise.all(resultArr).then(() => { +// saveRule() // 鏍¢獙鎴愬姛涔嬪悗 淇濆瓨鏁版嵁鐨勬柟娉� +// }) +// } +// const submitForm = () => { +// formRef.value.validate((valid) => { +// if (valid) { +// alert('submit!'); +// } else { +// alert('Form is not valid.'); +// return false; +// } +// }); +// }; +function checkFieldsEmpty(arr) { + let filteredArr = arr.filter((item) => { + return Object.values(item).some( + (value) => value == null || value == "" || value == undefined + ); + }); + return filteredArr; +} +// 鎻愪氦鑺傚亣鏃� +function handleSaveHolidaysForm() { + const hasValidDates = checkFieldsEmpty(formHolidays.value.holidays); + console.log(hasValidDates, "hasValidDates"); + if (hasValidDates.length == 0) { + updateCalendar({ + id: form.value.id, + holidays: formHolidays.value.holidays.map((item) => { + return { + startdate: moment(item.startdate).format("YYYY-MM-DD"), + enddate: moment(item.enddate).format("YYYY-MM-DD"), + describe: item.describe, + }; + }), + }).then((response) => { + proxy.$modal.msgSuccess("鏂板鎴愬姛"); + openSetHolidays.value = false; + getList(); + }); + } + // holidaysRef.value.validate((valid) => { + // if (!valid) { + // proxy.$modal.msgSuccess("蹇呭~椤逛笉鑳戒负绌�"); + // } + // if (valid) { + // if (!hasValidDates) { + // updateCalendar({ + // id: form.value.id, + // holidays: formHolidays.value.holidays.map((item) => { + // return { + // startdate: moment(item.startdate).format("YYYY-MM-DD"), + // enddate: moment(item.enddate).format("YYYY-MM-DD"), + // describe: item.describe, + // }; + // }), + // }).then((response) => { + // proxy.$modal.msgSuccess("鏂板鎴愬姛"); + // open.value = false; + // getList(); + // }); + // } + // }); + //if (valid) { + // if (!hasValidDates) { + // updateCalendar({ + // id: form.value.id, + // holidays: formHolidays.value.holidays.map((item) => { + // return { + // startdate: moment(item.startdate).format("YYYY-MM-DD"), + // enddate: moment(item.enddate).format("YYYY-MM-DD"), + // describe: item.describe, + // }; + // }), + // }).then((response) => { + // proxy.$modal.msgSuccess("鏂板鎴愬姛"); + // open.value = false; + // getList(); + // }); + // } + // }); +} /** 鎻愪氦鎸夐挳 */ function submitForm() { proxy.$refs["calendarRef"].validate((valid) => { if (valid) { + if (applicableSettingList.value[0].factory === "") { + ElMessage({ + type: "error", + message: "鑷冲皯閫夋嫨涓�涓�傜敤宸ュ巶", + }); + return; + } if (form.value.id != null) { - // if (form.value.type === "1") { - // updateCalendar({ - // ...form.value, - // content: { - // weekdays: weekDaysSettingList.value, - // }, - // applicableWorkshop: form.value.applicableWorkshop, - // applicableProcess: form.value.applicableProcess, - // }).then((response) => { - // proxy.$modal.msgSuccess("淇敼鎴愬姛"); - // open.value = false; - // getList(); - // }); - // } else if (form.value.type === "2") { updateCalendar({ - ...form.value, + // ...form.value, + id: form.value.id, + expiringDate: form.value.expiringDate, + effectiveDate: form.value.effectiveDate, + description: form.value.description, content: { - holidays: holidays.value, + weekdays: weekDaysSettingList.value, }, - applicableWorkshop: form.value.applicableWorkshop, - applicableProcess: form.value.applicableProcess, + // holidays: holidays.value, + applicable: applicableSettingList.value.map((item) => { + return { + factory: item.factory + ? item.factory.indexOf(";") > 0 + ? item.factory.split(";")[0] + : item.factory + : "", + process: item.process + ? item.process.indexOf(";") > 0 + ? item.process.split(";")[0] + : item.process + : "", + workshop: item.workshop + ? item.workshop.indexOf(";") > 0 + ? item.workshop.split(";")[0] + : item.workshop + : "", + }; + }), + applicableTranslate: JSON.stringify( + applicableSettingList.value.map((item) => { + return { + factory: item.factory ? item.factory : "", + process: item.process ? item.process : "", + workshop: item.workshop ? item.workshop : "", + }; + }) + ), + type: "1", }).then((response) => { proxy.$modal.msgSuccess("淇敼鎴愬姛"); open.value = false; @@ -762,25 +1240,42 @@ }); // } } else { - // if (form.value.type === "1") { - // addCalendar({ - // ...form.value, - // content: { - // weekdays: weekDaysSettingList.value, - // }, - // }).then((response) => { - // proxy.$modal.msgSuccess("鏂板鎴愬姛"); - // open.value = false; - // getList(); - // }); - // } else if (form.value.type === "2") { addCalendar({ ...form.value, content: { weekdays: weekDaysSettingList.value, }, - holidays: holidays.value, - applicable: applicableSettingList.value, + // holidays: holidays.value, + applicable: applicableSettingList.value.map((item) => { + return { + factory: item.factory + ? item.factory.indexOf(";") > 0 + ? item.factory.split(";")[0] + : item.factory + : "", + process: item.process + ? item.process.indexOf(";") > 0 + ? item.process.split(";")[0] + : item.process + : "", + workshop: item.workshop + ? item.workshop.indexOf(";") > 0 + ? item.workshop.split(";")[0] + : item.workshop + : "", + }; + }), + applicableTranslate: JSON.stringify( + applicableSettingList.value.map((item) => { + return { + factory: item.factory ? item.factory : "", + process: item.process ? item.process : "", + workshop: item.workshop ? item.workshop : "", + }; + }) + ), + type: "1", + // applicableCn: //}, }).then((response) => { proxy.$modal.msgSuccess("鏂板鎴愬姛"); @@ -896,10 +1391,12 @@ margin-top: 10px; } .select_factory { - margin-left: 34px; font-weight: 800; font-size: 14px; color: #606266; +} +.select_factory_dis { + margin-left: 34px; } .select_content { margin-right: 10px; @@ -917,4 +1414,80 @@ .auto-height-grid .xe-body .xe-body--row { height: auto; /* 鎴栬�呬娇鐢� min-height */ } +.mart10 { + margin-top: 20px; +} +.h300 { +} +.height_dialog { + height: 400px; + overflow: hidden; + .height_dialog_scroll { + height: 100%; + overflow: auto; + } +} +.dis_error_wrap { + .error_text { + margin-left: 20px; + font-size: 12px; + color: #f56c6c; + margin-left: 120px; + } +} +.error_require { + color: #f56c6c; + margin-right: 5px; +} +.grey_bg { + background: #f1f1f1; + width: 100%; + padding: 10px; + box-sizing: border-box; + .flex_holidays_set { + display: flex; + justify-content: flex-start; + align-items: center; + } + .flex_item { + display: flex; + justify-content: flex-start; + align-items: center; + margin-top: 10px; + .flex_item_title { + width: 85px; + color: #606266; + font-size: 14px; + font-weight: 600; + margin-left: 20px; + margin-right: 10px; + } + .flex_item_dis { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + & div { + margin-bottom: 5px; + } + } + } + .flex_item_expand_end { + display: flex; + justify-content: flex-end; + align-items: center; + cursor: pointer; + } +} +.title_flex { + margin-top: 20px; + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + .holiday_title { + font-size: 15px; + font-weight: 500; + } +} </style> -- Gitblit v1.9.3