| | |
| | | > |
| | | <el-row type="flex" justify="left" :gutter="20"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="计划名称" prop="description"> |
| | | <el-form-item label="计划名称" prop="name"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请输入描述关键词" |
| | | v-model="queryParams.name" |
| | | placeholder="请输入计划名称" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | @click="handleUpdate(null)" |
| | | v-hasPermi="['aps:calendar:update']" |
| | | >修改</el-button |
| | | > |
| | |
| | | >删除</el-button |
| | | > |
| | | </el-col> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['core:calendar:export']" |
| | | >导出</el-button |
| | | > |
| | | </el-col> --> |
| | | <right-toolbar |
| | | v-model:showSearch="showSearch" |
| | | @queryTable="getList" |
| | |
| | | @on-checkbox="handleCheckboxChange" |
| | | class="auto-height-grid" |
| | | > |
| | | <template #status="{ row }"> |
| | | <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 }"> |
| | | <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"> |
| | | <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> |
| | | </template> |
| | | <template #buttons="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | |
| | | <el-button |
| | | type="default" |
| | | size="small" |
| | | @click="handleSetHolidays(row)" |
| | | @click="handleSetCycle(row)" |
| | | v-hasPermi="['aps:calendar:remove']" |
| | | >计划周期</el-button |
| | | > |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | @click="handleSetHolidays(row)" |
| | | v-hasPermi="['aps:calendar:remove']" |
| | | >生成计划</el-button |
| | | > |
| | |
| | | <!-- 添加或修改日历管理对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="80%" append-to-body> |
| | | <el-form |
| | | ref="calendarRef" |
| | | ref="planManageRef" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="105px" |
| | | label-width="140px" |
| | | > |
| | | <el-form-item label="日历描述" prop="description"> |
| | | <el-input v-model="form.description" placeholder="请输入描述" /> |
| | | </el-form-item> |
| | | <el-form-item label="日历类型" prop="type"> |
| | | <!-- <el-radio-group v-model="form.type" @change="handleSwitchType"> |
| | | <el-radio :label="'1'">周工作</el-radio> |
| | | <el-radio :label="'2'">节假日</el-radio> |
| | | </el-radio-group> --> |
| | | <el-tag type="primary">周工作</el-tag> |
| | | </el-form-item> |
| | | <el-form-item label="生效时间" prop="effectiveDate"> |
| | | <el-date-picker |
| | | <el-form-item label="计划名称" prop="name" style="width: 100%"> |
| | | <el-input |
| | | v-model="form.name" |
| | | clearable |
| | | v-model="form.effectiveDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="失效时间" prop="expiringDate"> |
| | | <el-date-picker |
| | | clearable |
| | | v-model="form.expiringDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <div> |
| | | <div class="title_bar_line"> |
| | | <div class="line_short"></div> |
| | | <div>周工作设置</div> |
| | | <div class="line_long"></div> |
| | | </div> |
| | | <div |
| | | class="week_flex" |
| | | v-for="(item, index) in weekDaysSettingList" |
| | | :key="index" |
| | | > |
| | | <div class="week_flex_item">{{ item.chineseName }}</div> |
| | | <div class="week_flex_item"> |
| | | <el-radio-group v-model="item.work"> |
| | | <el-radio :label="'y'">工作日</el-radio> |
| | | <el-radio :label="'n'">非工作日</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-if="form.type === '2'"> |
| | | <div class="title_bar_line"> |
| | | <div class="line_short"></div> |
| | | <div>节假日设置</div> |
| | | <div class="line_long"></div> |
| | | </div> |
| | | <div class="week_flex mt20"> |
| | | <div class="week_flex_item">节日开始时间</div> |
| | | <div class="week_flex_item"> |
| | | <el-date-picker |
| | | clearable |
| | | v-model="holidays.startdate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | <div class="week_flex mt20"> |
| | | <div class="week_flex_item">节日结束时间</div> |
| | | <div class="week_flex_item"> |
| | | <el-date-picker |
| | | clearable |
| | | v-model="holidays.enddate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <el-form-item |
| | | label="适用工厂" |
| | | prop="applicableFactory" |
| | | class="factory_use_item" |
| | | > --> |
| | | <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_dis" |
| | | v-for="(item, index) in applicableSettingList" |
| | | :key="index" |
| | | > |
| | | <!-- <el-col :span="7"> --> |
| | | <el-select |
| | | class="select_content" |
| | | clearable |
| | | v-model="item.factory" |
| | | style="width: 160px" |
| | | placeholder="请输入适用工厂" |
| | | @change="changePlant($event)" |
| | | > |
| | | <el-option |
| | | v-for="plant in aps_factory" |
| | | :key="plant.value" |
| | | :label="plant.label" |
| | | :value="`${plant.value};${plant.label}`" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <!-- </el-col> |
| | | <el-col :span="7"> --> |
| | | <el-select |
| | | class="select_content" |
| | | clearable |
| | | v-model="item.workshop" |
| | | style="width: 160px" |
| | | placeholder="请输入适用车间" |
| | | @change="changeWorkshop($event)" |
| | | > |
| | | <el-option |
| | | v-for="shop in shopList" |
| | | :key="shop.id" |
| | | :label="shop.shopName" |
| | | :value="`${shop.id};${shop.shopName}`" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <!-- </el-col> |
| | | <el-col :span="7"> --> |
| | | <el-select |
| | | class="select_content" |
| | | clearable |
| | | v-model="item.process" |
| | | style="width: 160px" |
| | | placeholder="请输入适用工序" |
| | | > |
| | | <el-option |
| | | v-for="process in processList" |
| | | :key="process.processNumber" |
| | | :label="process.processName" |
| | | :value="`${process.processNumber};${process.processName}`" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <!-- </el-col> |
| | | <el-col :span="3"> --> |
| | | <el-button |
| | | class="select_content" |
| | | type="primary" |
| | | icon="Plus" |
| | | @click="handleAddFactory(item)" |
| | | circle |
| | | size="small" |
| | | placeholder="请输入计划名称" |
| | | /> |
| | | <el-button |
| | | v-if="applicableSettingList.length > 1" |
| | | class="select_content" |
| | | type="primary" |
| | | icon="Minus" |
| | | @click="handleMinusFactory(item)" |
| | | circle |
| | | size="small" |
| | | /> |
| | | <!-- </el-col> --> |
| | | </div> |
| | | <!-- </el-row> --> |
| | | <!-- </el-form-item> --> |
| | | <!-- <el-form-item |
| | | label="适用车间" |
| | | prop="applicableWorkshop" |
| | | class="factory_use_item" |
| | | > |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="适用工序" |
| | | prop="applicableProcess" |
| | | class="factory_use_item" |
| | | > |
| | | </el-form-item> --> |
| | | <el-form-item label="计划类型" prop="type" style="width: 100%"> |
| | | <el-radio-group v-model="form.type"> |
| | | <el-radio :label="'0'">装配置分解计划</el-radio> |
| | | <el-radio :label="'1'">主计划</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="计划排产区域" prop="area" style="width: 100%"> |
| | | <el-select |
| | | clearable |
| | | v-model="form.area" |
| | | placeholder="请选择计划排产区域" |
| | | > |
| | | <el-option |
| | | v-for="area in aps_area" |
| | | :key="area.value" |
| | | :label="area.label" |
| | | :value="area.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="计划排产规则" prop="area" style="width: 100%"> |
| | | <el-select |
| | | clearable |
| | | v-model="form.rule" |
| | | placeholder="请选择计划排产规则" |
| | | > |
| | | <el-option |
| | | v-for="rule in aps_plan_rule" |
| | | :key="rule.value" |
| | | :label="rule.label" |
| | | :value="rule.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 计划周期 --> |
| | | <el-dialog |
| | | title="设置节假日" |
| | | v-model="openSetHolidays" |
| | | title="配置计划周期" |
| | | v-model="openSetCycle" |
| | | 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> |
| | | <el-form |
| | | ref="planManageRef" |
| | | :model="formCycle.cycle" |
| | | :rules="rules" |
| | | label-width="140px" |
| | | > |
| | | <el-form-item label="周期类型" prop="type" style="width: 100%"> |
| | | <el-radio-group |
| | | v-model="formCycle.cycle.type" |
| | | @change="handleChangeTypeMonthDay" |
| | | > |
| | | <el-radio :label="'0'">日</el-radio> |
| | | <el-radio :label="'1'">月</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="滚动方式" prop="rollType" style="width: 100%"> |
| | | <el-radio-group |
| | | v-model="formCycle.cycle.rollType" |
| | | @change="handleChangeTypeMonthDay" |
| | | > |
| | | <el-radio :label="'0'">日滚动</el-radio> |
| | | <el-radio :label="'1'">月滚动</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="计划周期" prop="period" style="width: 100%"> |
| | | <el-input-number |
| | | v-model="formCycle.cycle.period" |
| | | size="mini" |
| | | @change="handleChangeTypeMonthDay" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="周期开始时间" |
| | | prop="periodStart" |
| | | style="width: 100%" |
| | | > |
| | | <el-date-picker |
| | | clearable |
| | | v-model="formCycle.cycle.periodStart" |
| | | type="date" |
| | | :disabled-date="handleDisabledDate" |
| | | :default-value="formCycle.cycle.periodStart" |
| | | placeholder="选择日期" |
| | | @change="handleChangeTypeMonthDay" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="周期结束时间" prop="periodEnd" style="width: 100%"> |
| | | <el-date-picker |
| | | clearable |
| | | disabled |
| | | v-model="formCycle.cycle.periodEnd" |
| | | type="date" |
| | | :default-value="formCycle.cycle.periodEnd" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="openSetHolidays = false">取 消</el-button> |
| | | <el-button type="primary" @click="handleSaveHolidaysForm" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="openSetCycle = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitFormCycle">保存</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | import moment from "moment"; |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { |
| | | listCalendar, |
| | | getCalendar, |
| | | delCalendar, |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | import axios from "axios"; |
| | | 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"; |
| | | getApsPlanManagementList, |
| | | apsPlanManagementSave, |
| | | delApsPlanManagementList, |
| | | redundantOrderList, |
| | | apsPlanManagementUpdate, |
| | | } from "@/api/demand/planManage"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const holidaysRef = ref(null); |
| | | const { aps_factory } = proxy.useDict("aps_factory"); |
| | | const router = useRouter(); |
| | | const { aps_area } = proxy.useDict("aps_area"); |
| | | const { aps_plan_rule } = proxy.useDict("aps_plan_rule"); |
| | | const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | const open = ref(false); |
| | | const openSetHolidays = ref(false); |
| | | const openSetCycle = ref(false); |
| | | const expand = ref(true); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | |
| | | const title = ref(""); |
| | | const data = reactive({ |
| | | form: { |
| | | type: "1", |
| | | applicable: [ |
| | | { |
| | | factory: "", |
| | | workshop: "", |
| | | process: "", |
| | | }, |
| | | ], |
| | | applicableTranslate: [{ factory: "" }, { workshop: "" }, { process: "" }], |
| | | name: "", |
| | | rule: "", |
| | | area: "", |
| | | type: "0", |
| | | }, |
| | | formHolidays: { |
| | | holidays: [ |
| | | { |
| | | enddate: "", |
| | | startdate: "", |
| | | describe: "", |
| | | }, |
| | | ], |
| | | formCycle: { |
| | | cycle: { |
| | | type: "0", |
| | | rollType: "0", |
| | | period: "1", |
| | | periodStart: moment(Date.now()).format("YYYY-MM-DD"), |
| | | periodEnd: "", |
| | | }, |
| | | }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | plant: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | name: "", |
| | | }, |
| | | rules: { |
| | | description: [ |
| | | name: [ |
| | | { |
| | | required: true, |
| | | message: "请输入日历描述", |
| | | message: "请输入计划名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | // type: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择日历类型", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | effectiveDate: [ |
| | | type: [ |
| | | { |
| | | required: true, |
| | | message: "请选择日历生效时间", |
| | | message: "请选择计划类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | expiringDate: [ |
| | | area: [ |
| | | { |
| | | required: true, |
| | | message: "请选择日历失效时间", |
| | | message: "请选择计划排产区域", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | rule: [ |
| | | { |
| | | 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 holidayRules = { |
| | | holidays: [{ required: true, message: "节假日是必填项", trigger: "blur" }], |
| | | }; |
| | | const { queryParams, form, rules, formHolidays } = toRefs(data); |
| | | const dateType = ref("周工作"); |
| | | const dateTypeList = ref([ |
| | | { |
| | | name: "周工作", |
| | | label: "1", |
| | | }, |
| | | { |
| | | name: "节假日", |
| | | label: "2", |
| | | }, |
| | | ]); |
| | | const typeRadioNumber = ref(1); |
| | | const applicableSettingList = ref([ |
| | | { factory: "", workshop: "", process: "", id: 0 }, |
| | | ]); |
| | | const weekDaysSettingList = ref([ |
| | | { |
| | | 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", |
| | | }, |
| | | ]); |
| | | const holidays = ref({ |
| | | startdate: "", |
| | | enddate: "", |
| | | }); |
| | | const plantList = ref([]); |
| | | const { queryParams, form, rules, formCycle } = toRefs(data); |
| | | const checkedRow = ref({}); |
| | | const shopList = ref([]); |
| | | const allShopList = ref([]); |
| | | const processList = ref([]); |
| | | const height = ref(document.documentElement.clientHeight - 220 + "px;"); |
| | | // 表格配置-列表 |
| | | const columns = ref([ |
| | | // { type: "checkbox", width: 60, align: "center" }, |
| | | { type: "checkbox", width: 60, align: "center" }, |
| | | { |
| | | title: "滚动方式", |
| | | field: "description", |
| | | title: "计划ID", |
| | | field: "id", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "计划周期", |
| | | title: "计划名称", |
| | | field: "name", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "计划类型", |
| | | field: "type", |
| | | width: 200, |
| | | align: "center", |
| | | slots: { default: "status" }, |
| | | }, |
| | | { |
| | | title: "周期开始时间", |
| | | field: "effectiveDate", |
| | | title: "计划排产区域", |
| | | field: "area", |
| | | width: 200, |
| | | align: "center", |
| | | formatter: ({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | for (let i = 0; i < aps_area.value.length; i++) { |
| | | if (cellValue === aps_area.value[i].value) { |
| | | return aps_area.value[i].label; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | title: "周期结束时间", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "计划ID", |
| | | field: "content", |
| | | title: "计划排产规则", |
| | | field: "rule", |
| | | width: 230, |
| | | align: "center", |
| | | slots: { default: "mark" }, |
| | | formatter: ({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | for (let i = 0; i < aps_plan_rule.value.length; i++) { |
| | | if (cellValue === aps_plan_rule.value[i].value) { |
| | | return aps_plan_rule.value[i].label; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | // { |
| | | // 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", |
| | |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | { |
| | | title: "更新者", |
| | | field: "createBy", |
| | | field: "updateBy", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "更新时间", |
| | | field: "createTime", |
| | | field: "updateTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | |
| | | // 禁用日期 |
| | | function handleDisabledDate(time) { |
| | | return time.getTime() < Date.now() - 86400000 * 1; |
| | | } |
| | | function handleChangeTypeMonthDay() { |
| | | console.log(formCycle.value.cycle.periodStart); |
| | | if (formCycle.value.cycle.type == 0) { |
| | | if (formCycle.value.cycle.rollType == 0) { |
| | | let nowTime = moment(formCycle.value.cycle.periodStart) |
| | | .startOf("day") |
| | | .valueOf(); |
| | | let period = formCycle.value.cycle.period * 86400000 * 1; |
| | | let endDate = nowTime * 1 + period * 1; |
| | | formCycle.value.cycle.periodEnd = moment(endDate).format("YYYY-MM-DD"); |
| | | } else { |
| | | let nowTime = moment(formCycle.value.cycle.periodStart) |
| | | .startOf("day") |
| | | .add(formCycle.value.cycle.period, "months") |
| | | .valueOf(); |
| | | formCycle.value.cycle.periodEnd = moment(nowTime).format("YYYY-MM-DD"); |
| | | } |
| | | } else { |
| | | let nowTime = moment(formCycle.value.cycle.periodStart) |
| | | .startOf("day") |
| | | .add(formCycle.value.cycle.period, "months") |
| | | .valueOf(); |
| | | formCycle.value.cycle.periodEnd = moment(nowTime).format("YYYY-MM-DD"); |
| | | } |
| | | } |
| | | function handleSetPeriod(e) { |
| | | console.log(e); |
| | | formCycle.value.periodEnd; |
| | | } |
| | | /** 查询日历管理列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | 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); |
| | | getApsPlanManagementList(queryParams.value) |
| | | .then((response) => { |
| | | calendarList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }) |
| | | .catch(() => { |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | |
| | |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // 多选框选中数据 |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** 新增按钮操作 */ |
| | | async function handleAdd() { |
| | | open.value = true; |
| | | form.value = { |
| | | type: "1", |
| | | description: "", |
| | | expiringDate: "", |
| | | effectiveDate: "", |
| | | applicable: [ |
| | | { |
| | | factory: "", |
| | | workshop: "", |
| | | process: "", |
| | | }, |
| | | ], |
| | | applicableTranslate: [{ factory: "" }, { workshop: "" }, { process: "" }], |
| | | name: "", |
| | | rule: "", |
| | | area: "", |
| | | }; |
| | | 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 = "添加日历管理"; |
| | | title.value = "新增计划"; |
| | | } |
| | | /** 选择工厂后事件 加载车间 和 工序 **/ |
| | | function changePlant(plant) { |
| | | console.log(plant); |
| | | listAps_shop({ plantCode: plant.split(";")[0] }).then((response) => { |
| | | shopList.value = response.rows; |
| | | }); |
| | | // selectProcessNameList({ orgCode: plant }).then((response) => { |
| | | // processList.value = response.rows; |
| | | // }); |
| | | } |
| | | function changeWorkshop(workShop) { |
| | | console.log(workShop.split(";")[0]); |
| | | listByWorkShop({ workShop: workShop.split(";")[0] }).then((res) => { |
| | | console.log(res, "workShop"); |
| | | processList.value = res.rows; |
| | | }); |
| | | } |
| | | function handleAddFactory(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) { |
| | | const _id = row.id || ids.value; |
| | | console.log(checkedRow.value, row, "修改计划管理000"); |
| | | open.value = true; |
| | | title.value = "修改日历管理"; |
| | | getCalendar(_id).then((response) => { |
| | | form.value = response.data; |
| | | 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; |
| | | |
| | | // else if (form.value.type === "2") { |
| | | // holidays.value = JSON.parse(response.data.content.value).holidays; |
| | | // } |
| | | }); |
| | | } |
| | | // 设置节假日 |
| | | function handleSetHolidays(row) { |
| | | let applicableTranslateArr = 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; |
| | | }); |
| | | } |
| | | ); |
| | | console.log(applicableTranslateArr, "applicableTranslateArr"); |
| | | form.value = { |
| | | ...row, |
| | | applicableTranslate: applicableTranslateArr, |
| | | }; |
| | | if (!row.holidays) { |
| | | formHolidays.value = { |
| | | holidays: [ |
| | | { |
| | | enddate: "", |
| | | startdate: "", |
| | | describe: "", |
| | | }, |
| | | ], |
| | | }; |
| | | } else { |
| | | formHolidays.value.holidays = JSON.parse(row.holidays.value); |
| | | title.value = "修改计划管理"; |
| | | if (!row) { |
| | | form.value = checkedRow.value; |
| | | return; |
| | | } |
| | | // console.log(formHolidays.value.holidays, "formHolidays.value"); |
| | | openSetHolidays.value = true; |
| | | form.value = row; |
| | | } |
| | | // 禁用日期 |
| | | 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 handleSetCycle(row) { |
| | | openSetCycle.value = true; |
| | | if (!row.cycle) { |
| | | formCycle.value = { |
| | | cycle: { |
| | | type: "0", |
| | | rollType: "0", |
| | | period: "1", |
| | | periodStart: moment(Date.now()).format("YYYY-MM-DD"), |
| | | periodEnd: "", |
| | | }, |
| | | }; |
| | | let nowTime = moment(formCycle.value.cycle.periodStart) |
| | | .startOf("day") |
| | | .valueOf(); |
| | | let period = formCycle.value.cycle.period * 86400000 * 1; |
| | | let endDate = nowTime * 1 + period * 1; |
| | | formCycle.value.cycle.periodEnd = moment(endDate).format("YYYY-MM-DD"); |
| | | } else { |
| | | formCycle.value = row; |
| | | } |
| | | console.log(formCycle.value, "formCycle.value"); |
| | | } |
| | | 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) => { |
| | | proxy.$refs["planManageRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (applicableSettingList.value[0].factory === "") { |
| | | ElMessage({ |
| | | type: "error", |
| | | message: "至少选择一个适用工厂", |
| | | }); |
| | | return; |
| | | } |
| | | if (form.value.id != null) { |
| | | updateCalendar({ |
| | | // ...form.value, |
| | | id: form.value.id, |
| | | expiringDate: form.value.expiringDate, |
| | | effectiveDate: form.value.effectiveDate, |
| | | description: form.value.description, |
| | | content: { |
| | | weekdays: weekDaysSettingList.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", |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | // } |
| | | } else { |
| | | addCalendar({ |
| | | apsPlanManagementUpdate({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.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("新增成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | // } |
| | | }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | open.value = false; |
| | | }); |
| | | } else { |
| | | apsPlanManagementSave({ |
| | | ...form.value, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | proxy.$modal.msgSuccess("新增成功"); |
| | | open.value = false; |
| | | getList(); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | open.value = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function submitFormCycle() { |
| | | redundantOrderList({ |
| | | ...formCycle.value.cycle, |
| | | planId: formCycle.value.id, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("更新成功"); |
| | | openSetCycle.value = false; |
| | | } else { |
| | | openSetCycle.value = false; |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | openSetCycle.value = false; |
| | | }); |
| | | getList(); |
| | | } |
| | | function handleGoToCycle() { |
| | | router.push({ |
| | | path: "/demand/planManageCycle", |
| | | }); |
| | | } |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal |
| | | .confirm('是否确认删除日历管理编号为"' + _ids + '"的数据项?') |
| | | .confirm('是否确认删除计划管理编号为"' + _ids + '"的数据项?') |
| | | .then(function () { |
| | | return delCalendar(_ids); |
| | | return delApsPlanManagementList(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** 导出按钮操作 */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "core/calendar/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | | form.value.expiringDate = null; |
| | | form.value.content = null; |
| | | form.value.applicableFactory = null; |
| | | form.value.applicableWorkshop = null; |
| | | form.value.applicableProcess = null; |
| | | } |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | if (data.records.length === 1) { |
| | | checkedRow.value = data.records[0]; |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |