| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div style="height: 100%;display: flex;flex-direction: column;align-items: stretch;"> |
| | | <el-row class="homeCard"> |
| | | <el-col :span="5" style="display:flex;align-items: center"> |
| | | <span style="white-space: nowrap">作业类型:</span> |
| | |
| | | <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"> |
| | | <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> |
| | | </el-tabs> |
| | | <div v-if="chosenIndex != null" style="color: #79bbff">注:修改配置数据须重新填写配置</div> |
| | |
| | | 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; |
| | | }; |
| | | |
| | |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | flex: 0 auto; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | position: absolute; |
| | | width: 100%; |
| | | z-index: 99; |
| | | bottom: 0; |
| | | right: 0; |
| | | height: 60px; |
| | | border-radius: 0 0 4px 4px; |
| | | padding-right: 20px; |
| | | background: #fff; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | flex: 1; |
| | | } |
| | | } |
| | | .el-row { |