| | |
| | | <el-table-column property="workLevel" label="关联作业等级" align="center" :formatter="toLevel" :show-overflow-tooltip="true"/> |
| | | <el-table-column property="createUname" label="创建人" align="center"/> |
| | | <el-table-column property="gmtCreate" label="创建时间" align="center"/> |
| | | <el-table-column property="gmtModified" label="更新时间" align="center"/> |
| | | <!-- <el-table-column property="gmtModified" label="更新时间" align="center"/>--> |
| | | <el-table-column fixed="right" label="操作" align="center" width="250"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="作业物资汇总"> |
| | | <div class="materials"> |
| | | <div class="maList"> |
| | | <div>必选</div> |
| | | <div class="maList" v-for="item in details.clList"> |
| | | <div>{{item.configurationLevelName}}</div> |
| | | <div> |
| | | <div v-if="mustList.length>0" v-for="(i,index) in mustList" :key="index"> |
| | | {{i.materialName}}:默认值:{{i.defaultVal}},{{i.consumables?'耗材':'非耗材'}} |
| | | </div> |
| | | <div v-else> |
| | | 无 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="maList"> |
| | | <div>可选</div> |
| | | <div> |
| | | <div v-if="chooseList.length>0" v-for="(i,index) in chooseList" :key="index"> |
| | | {{i.materialName}}:默认值:{{i.defaultVal}},{{i.consumables?'耗材':'非耗材'}} |
| | | </div> |
| | | <div v-else> |
| | | 无 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="maList"> |
| | | <div>高配</div> |
| | | <div> |
| | | <div v-if="highList.length>0" v-for="(i,index) in highList" :key="index"> |
| | | {{i.materialName}}:默认值:{{i.defaultVal}},{{i.consumables?'耗材':'非耗材'}} |
| | | <div v-if="item.mdList.length>0" v-for="i in item.mdList"> |
| | | {{i.materialName}}({{i.bigClassifyName }}):标准值:{{i.standVal }} |
| | | </div> |
| | | <div v-else> |
| | | 无 |
| | |
| | | <el-form-item label="创建时间"> |
| | | <el-input v-model="details.gmtCreate" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="更新时间"> |
| | | <el-input v-model="details.gmtModified" readonly /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="更新时间">--> |
| | | <!-- <el-input v-model="details.gmtModified" readonly />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="dialogDetails = false" size="default">确认</el-button> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="物资标准配置"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in allList" :label="item.materialTypeName" :key="index"> |
| | | <div class="tab-i" v-for="(i,x) in item.list" :key="x" v-if="item.list && item.list.length>0"> |
| | | <el-checkbox :label="i.materialName" v-model="checkData[index].list[x].checked"> |
| | | </el-checkbox> |
| | | <el-form v-if="checkData[index].list[x].checked" :model="checkData[index].list[x]" label-width="100px" ref="addListRef" :rules="addListRules"> |
| | | <el-form-item label="配置级别" prop="configurationLevel"> |
| | | <el-select 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> |
| | | </el-form-item> |
| | | <el-form-item v-if="checkData[index].list[x].configurationLevel==0" label="默认值" prop="defaultVal"><el-input v-model="checkData[index].list[x].defaultVal"/></el-form-item> |
| | | <el-form-item label="是否耗材" prop="consumables"> |
| | | <el-radio-group v-model="checkData[index].list[x].consumables"> |
| | | <el-radio :label=true>是</el-radio> |
| | | <el-radio :label=false>否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-tab-pane v-for="(item,index) in allList" :label="item.materialClassifyName" :key="index"> |
| | | <div class="tab-i" v-if="item.childList && item.childList.length>0"> |
| | | <div v-for="(i,x) in item.childList" :key="x"> |
| | | <el-checkbox :label="i.materialClassifyName" v-model="checkData[index].childList[x].checked"> |
| | | </el-checkbox> |
| | | <el-form v-if="checkData[index].childList[x].checked" :model="checkData[index].childList[x]" label-width="100px" ref="addListRef" :rules="addListRules"> |
| | | <el-form-item label="配置级别" prop="configurationLevel"> |
| | | <el-select v-model="checkData[index].childList[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> |
| | | </el-form-item> |
| | | <el-form-item label="标准值" prop="standVal"><el-input type="number" v-model.number="checkData[index].childList[x].standVal"/></el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | <div v-else>暂无物资配置数据</div> |
| | | </el-tab-pane> |
| | |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const addListRules = reactive<FormRules>({ |
| | | defaultVal: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | configurationLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | consumables: [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | standVal: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | configurationLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | // 页面载入时执行方法 |
| | |
| | | if (res.data.code === '200') { |
| | | state.allList = JSON.parse(JSON.stringify(res.data.data)) |
| | | for(let i in state.allList){ |
| | | state.allList[i].list = state.allList[i].list?.map((item:any) => { |
| | | state.allList[i].childList = state.allList[i].childList?.map((item:any) => { |
| | | const obj = { |
| | | checked: false, |
| | | materialName: item.name, |
| | | consumables: null, |
| | | defaultVal: 0, |
| | | materialClassifyName: item.materialClassifyName, |
| | | standVal: 0, |
| | | configurationLevel: null, |
| | | materialType: item.materialType, |
| | | materialTypeName: item.materialTypeName, |
| | | emergencyMaterialId: item.id |
| | | smallClassifyId: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | |
| | | const editRecordBtn = async (index, row) => { |
| | | getList() |
| | | state.addRecord = JSON.parse(JSON.stringify(row)); |
| | | console.log(state.addRecord,'state.addRecord') |
| | | state.dialogAddRecord = true; |
| | | state.chosenIndex = index; |
| | | }; |
| | |
| | | if (valid) { |
| | | state.addRecord.materialDetailList = [] |
| | | for(let i in state.checkData){ |
| | | 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){ |
| | | if(state.checkData[i].childList && state.checkData[i].childList.length>0){ |
| | | for(let j=0;j<state.checkData[i].childList.length;j++){ |
| | | if(state.checkData[i].childList[j].checked){ |
| | | // delete state.checkData[i].list[j].checked |
| | | // state.checkData[i].list[j].checked |
| | | let { checked,...checkObj } = state.checkData[i].list[j] |
| | | let { checked,materialClassifyName,...checkObj } = state.checkData[i].childList[j] |
| | | state.addRecord.materialDetailList.push(checkObj) |
| | | } |
| | | } |
| | |
| | | info: state.addRecord.info, |
| | | materialDetailList: state.addRecord.materialDetailList |
| | | }; |
| | | console.log(data.materialDetailList,'data.materialDetailList') |
| | | if(data.materialDetailList.length==0 || data.materialDetailList.some((e) => e.configurationLevel == null) || data.materialDetailList.some((e) => e.consumables == null)){ |
| | | if(data.materialDetailList.length==0 || data.materialDetailList.some((e) => e.configurationLevel == null)){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请选择物资配置并完善必填数据' |
| | | }); |
| | | return |
| | | } |
| | | if(data.materialDetailList.some((e) => e.configurationLevel == 0 && e.standVal <= 0)){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '必选物资标准值须大于0' |
| | | }); |
| | | return |
| | | } |
| | | if (state.chosenIndex == null) { |
| | | await addRecord(data); |
| | | } else { |
| | |
| | | state.details = JSON.parse(JSON.stringify(row)); |
| | | state.details.workType = toType(state.details) |
| | | state.details.workLevel = toLevel(state.details) |
| | | if(state.details.materialTypeList && state.details.materialTypeList.length>0){ |
| | | const allList = JSON.parse(JSON.stringify(state.details.materialTypeList)) |
| | | for(let i = 0;i < allList.length; i++){ |
| | | if(allList[i].mdList && allList[i].mdList.length>0){ |
| | | allList[i].mdList.map((item)=>{ |
| | | if(item.configurationLevel == 0){ |
| | | state.mustList.push(item) |
| | | return |
| | | }else if(item.configurationLevel == 1){ |
| | | state.chooseList.push(item) |
| | | return |
| | | }else{ |
| | | state.highList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | state.dialogDetails = true; |
| | | }; |
| | | |