| | |
| | | </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> |
| | | |
| | |
| | | > |
| | | <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> |
| | |
| | | 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); |
| | |
| | | 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: "适用工序", |
| | |
| | | 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({ |
| | |
| | | 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); |
| | | }); |
| | | } |
| | | |
| | | // 取消按钮 |
| | |
| | | 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) => { |
| | |
| | | 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( |
| | |
| | | proxy.$refs["calendarRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | console.log(form.value, "修改日历==="); |
| | | if (form.value.type === "1") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | console.log(e, "日期类型切换"); |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | |
| | | 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; |
| | |
| | | .factory_use_item { |
| | | margin-top: 10px; |
| | | } |
| | | .mart5{ |
| | | margin-top:5px; |
| | | .mart5 { |
| | | margin-top: 5px; |
| | | } |
| | | .custom-height { |
| | | height: 200px; /* 或者使用 min-height */ |