| | |
| | | <style scoped> |
| | | .ins-order-plan-main{ |
| | | padding-top: 60px; |
| | | ins-order-plan-main .title{ |
| | | font-size:20px; |
| | | color:#3A7BFA |
| | | } |
| | | .ins-order-plan-main .search{ |
| | | width: 100%; |
| | |
| | | .center .center-options .center-title { |
| | | width:85%; |
| | | padding-top: 20px; |
| | | text-align: right; |
| | | text-align: left; |
| | | } |
| | | .center .center-options .center-title span:last-child{ |
| | | color: #3A7BFA; |
| | | font-size: 23px; |
| | | font-weight: 400; |
| | | } |
| | | |
| | | .view-self-checkbox{ |
| | | margin-left: 20px; |
| | | } |
| | | </style> |
| | | <template> |
| | | <div class="ins-order-plan-main"> |
| | | <p style="font-size: 16px;padding:19.5px 0px">检验任务</p> |
| | | <div class="search"> |
| | | <el-form :inline="true" :model="searchForm" class="form-inline"> |
| | | <el-form-item label="样品名称:"> |
| | |
| | | <div class="center"> |
| | | <div class="center-options"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <ul class="tab"> |
| | | <li v-for="(m,i) in tabList" :key="i" :class="{active:i==tabIndex}" @click="handleTab(m,i)">{{m.label}}</li> |
| | | </ul> |
| | | <el-col :span="21"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <ul class="tab"> |
| | | <li v-for="(m,i) in tabList" :key="i" :class="{active:i==tabIndex}" @click="handleTab(m,i)">{{m.label}}</li> |
| | | </ul> |
| | | <el-checkbox @change="changeCheckBox" class="view-self-checkbox" v-model="viewSelf"/><span> 我的任务</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-col :span="3"> |
| | | <div class="center-title"> |
| | | <span>总计任务数量:</span> |
| | | <span v-if="$refs.insOrderPlan != undefined">{{$refs.insOrderPlan.total}}</span> |
| | |
| | | </div> |
| | | <ValueTable :tableRowClassName="changeRowClass" class="value-table" ref="insOrderPlan" :url="$api.insOrderPlan.selectInsOrderPlanList" :upUrl="$api.user.updateUser" :componentData="componentData" :key="upIndex" @upUser="upUser"/> |
| | | </div> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="claimVisible" |
| | | width="40%"> |
| | | 是否认领委托编号<span style="color:#33C130">{{sampleUserForm.entrustCode}}</span>的任务 |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="claimVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="confirmClaim">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data(){ |
| | | return { |
| | | viewSelf: false, |
| | | sampleUserForm:{ |
| | | entrustCode: null, |
| | | insSampleId: null, |
| | | userId: null |
| | | }, |
| | | claimVisible: false, |
| | | searchForm:{ |
| | | sampleName: null, |
| | | state: null |
| | | }, |
| | | tabList: [ |
| | | { |
| | | label: '实验室1', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '实验室2', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '实验室3', |
| | | value: 3 |
| | | } |
| | | ], |
| | | tabList: [], |
| | | active: 1, |
| | | tabIndex: 0, |
| | | componentData: { |
| | | entity: { |
| | | viewSelf: false, |
| | | state: 1, |
| | | childrenLaboratory: null, |
| | | insState: null, |
| | | sample: null, |
| | | sampleName: null, |
| | | orderBy: { |
| | | field: 'type', |
| | | order: 'desc' |
| | |
| | | id: '', |
| | | font: '认领', |
| | | type: 'text', |
| | | method: '' |
| | | method: 'claimFun', |
| | | disabFun: (row,index)=>{return row.sampleUserId!=null} |
| | | }], |
| | | tagField: { |
| | | type:{ |
| | |
| | | created(){ |
| | | this.getTypeDicts() |
| | | this.getInsStateDicts() |
| | | this.refreshTable() |
| | | this.getLaboratoryDicts() |
| | | this.$nextTick(()=>{ |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | watch:{ |
| | | tabList(newVal){ |
| | | if(newVal && newVal.length>0){ |
| | | this.componentData.entity.childrenLaboratory = newVal[0].value |
| | | this.$nextTick(()=>{ |
| | | this.refreshTable() |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods:{ |
| | | upUser(){ |
| | | |
| | | }, |
| | | refreshTable() { |
| | | this.$refs.insOrderPlan.selectList() |
| | | changeCheckBox(val){ |
| | | this.componentData.entity.viewSelf = val |
| | | this.$nextTick(()=>{ |
| | | this.planTotal = this.$refs.insOrderPlan.total |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | changeRowClass(obj,rowIndex){ |
| | | claimFun(row){ |
| | | console.log(row) |
| | | if(row){ |
| | | this.sampleUserForm = { |
| | | entrustCode : row.entrustCode, |
| | | insSampleId: row.id |
| | | } |
| | | this.claimVisible = true |
| | | } |
| | | |
| | | }, |
| | | confirmClaim(){ |
| | | this.$axios.post(this.$api.insOrderPlan.claimInsOrderPlan, this.sampleUserForm,{ |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res=>{ |
| | | if(res.code===200 && res.data){ |
| | | this.$message.success("认领成功") |
| | | this.claimVisible = false |
| | | this.refreshTable() |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | refreshTable() { |
| | | this.$refs.insOrderPlan.selectList() |
| | | }, |
| | | changeRowClass({row,rowIndex}){ |
| | | let currentTime = getYearAndMonthAndDays() |
| | | if(obj.row.sendTime && currentTime===obj.row.sendTime){ |
| | | if(row.sendTime && currentTime===row.sendTime){ |
| | | return 'highlight-warning-row-border' |
| | | }else if(obj.row.sendTime && currentTime>obj.row.sendTime){ |
| | | }else if(row.sendTime && currentTime>row.sendTime){ |
| | | return 'highlight-danger-row-border' |
| | | } |
| | | return '' |
| | |
| | | state: null, |
| | | } |
| | | this.componentData.entity.insState = null |
| | | this.componentData.entity.sample = null |
| | | this.componentData.entity.sampleName = null |
| | | this.refreshTable() |
| | | }, |
| | | onSubmit(){ |
| | | this.componentData.entity.insState = this.searchForm.state |
| | | this.componentData.entity.sample = this.searchForm.sampleName |
| | | this.componentData.entity.sampleName = this.searchForm.sampleName |
| | | this.$nextTick(()=>{ |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | handleTab(m, i) { |
| | | this.tabIndex = i; |
| | | //this.componentData.entity.state = m.value |
| | | //this.refreshTable() |
| | | this.componentData.entity.childrenLaboratory = m.value |
| | | this.refreshTable() |
| | | }, |
| | | getTypeDicts() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | |
| | | this.componentData.tagField.insState.select = data |
| | | }) |
| | | }, |
| | | getLaboratoryDicts(){ |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "子实验室" |
| | | }).then(res => { |
| | | this.tabList = res.data.map(ele=>{return {label:ele.label,value:ele.value}}) |
| | | this.$nextTick(()=>{ |
| | | this.componentData.entity.childrenLaboratory = this.tabList[0].value |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |