| | |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogAddRecord" title="作业物资标准编辑" @close="closeAdd" @open="openAdd"> |
| | | <el-dialog v-model="dialogAddRecord" title="作业物资标准编辑" @close="closeAdd" @open="openAdd" center> |
| | | <el-form :model="addRecord" label-width="150px" ref="addRef" :rules="addRules"> |
| | | <el-form-item label="作业物资标准名称" prop="name"> |
| | | <el-input v-model="addRecord.name"> </el-input> |
| | |
| | | <el-radio :label=false>否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <!-- <div>--> |
| | | <!-- <span>配置级别:</span>--> |
| | | <!-- <el-select size="small" v-model="checkData[index].list[x].configurationLevel">--> |
| | | <!-- <el-option key="0" label="必选" value="0"/>--> |
| | | <!-- <el-option key="1" label="可选" value="1"/>--> |
| | | <!-- <el-option key="2" label="高配" value="2"/>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- <div>--> |
| | | <!-- <span>是否耗材:</span>--> |
| | | <!-- <el-radio-group v-model="checkData[index].list[x].consumables">--> |
| | | <!-- <el-radio label="1">是</el-radio>--> |
| | | <!-- <el-radio label="2">否</el-radio>--> |
| | | <!-- </el-radio-group>--> |
| | | <!-- </div>--> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | |
| | | <el-form-item label="描述" prop="info"> |
| | | <el-input v-model="addRecord.info" type="textarea" autosize :rows="2"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="warning" @click="dialogAddRecord = false" size="default" plain>取消</el-button> |
| | | <el-button type="primary" @click="confirmAddRecord(addRef)" size="default">确认</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="deleteDialog" title="提示" width="30%" center @close="indexClear"> |
| | | <span>您确定要删除该条记录吗?</span> |
| | |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { teamManageApi } from '/@/api/systemManage/basicDateManage/personShiftManage/teamManage'; |
| | | import { materialApi } from '/@/api/specialWorkSystem/material'; |
| | | import {a} from "pinia-plugin-persistedstate/dist/types-374a3a36"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface stateType { |
| | |
| | | configurationLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | consumables: [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const addNoRules = reactive<FormRules>({}); |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | |
| | | }; |
| | | |
| | | const toLevel = (row, column, cellValue, index) => { |
| | | if(row.workLevel <= 3){ |
| | | return state.fireLevel.find((item) => item.value === row.workLevel)?.label; |
| | | }else if(row.workLevel>3 && row.workLevel<=7){ |
| | | return state.heightLevel.find((item) => item.value === row.workLevel)?.label; |
| | | }else if(row.workLevel>8 && row.workLevel<=10){ |
| | | return state.hoistLevel.find((item) => item.value === row.workLevel)?.label; |
| | | if(row.workLevel == null){ |
| | | return '无' |
| | | }else{ |
| | | return state.plateLevel.find((item) => item.value === row.workLevel)?.label; |
| | | if(row.workLevel <= 3){ |
| | | return state.fireLevel.find((item) => item.value === row.workLevel)?.label; |
| | | }else if(row.workLevel>3 && row.workLevel<=7){ |
| | | return state.heightLevel.find((item) => item.value === row.workLevel)?.label; |
| | | }else if(row.workLevel>8 && row.workLevel<=10){ |
| | | return state.hoistLevel.find((item) => item.value === row.workLevel)?.label; |
| | | }else{ |
| | | return state.plateLevel.find((item) => item.value === row.workLevel)?.label; |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | if(state.checkData[i].list && state.checkData[i].list.length>0){ |
| | | for(let j=0;j<state.checkData[i].list.length;j++){ |
| | | if(state.checkData[i].list[j].checked){ |
| | | delete state.checkData[i].list[j].checked |
| | | state.checkData[i].list[j].checked |
| | | state.addRecord.materialDetailList.push(state.checkData[i].list[j]) |
| | | // delete state.checkData[i].list[j].checked |
| | | // state.checkData[i].list[j].checked |
| | | let { checked,...checkObj } = state.checkData[i].list[j] |
| | | state.addRecord.materialDetailList.push(checkObj) |
| | | } |
| | | } |
| | | } |
| | |
| | | info: state.addRecord.info, |
| | | materialDetailList: state.addRecord.materialDetailList |
| | | }; |
| | | if(data.materialDetailList.length==0){ |
| | | console.log(data.materialDetailList,'data.materialDetailList') |
| | | if(data.materialDetailList.length==0 || data.materialDetailList.some((e) => e.defaultVal == null) || data.materialDetailList.some((e) => e.configurationLevel == null) || data.materialDetailList.some((e) => e.consumables == null)){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '物资配置数据为空' |
| | | message: '请完善物资配置必填数据' |
| | | }); |
| | | return |
| | | }else{ |
| | | if (state.chosenIndex == null) { |
| | | await addRecord(data); |
| | | } else { |
| | | data.id = state.addRecord.id; |
| | | await editRecord(data); |
| | | } |
| | | state.dialogAddRecord = false; |
| | | } |
| | | if (state.chosenIndex == null) { |
| | | await addRecord(data); |
| | | } else { |
| | | data.id = state.addRecord.id; |
| | | await editRecord(data); |
| | | } |
| | | state.dialogAddRecord = false; |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | |
| | | addListRef, |
| | | addRules, |
| | | addListRules, |
| | | addNoRules, |
| | | View, |
| | | Edit, |
| | | Delete, |