| | |
| | | .lims-table .highlight-danger-row-border td:last-child { |
| | | border-right: 4px solid #f56c6c; |
| | | } |
| | | >>>.red-row td { |
| | | background: #FFCCCC !important; |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="table" v-show="!showData"> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 300px)'" |
| | | :page="page" @pagination="pagination"></lims-table> |
| | | :page="page" @pagination="pagination" :row-class-name="tableRowClassName"></lims-table> |
| | | </div> |
| | | <el-dialog :title="isUp ? '设备详情' : '档案修订'" :visible.sync="dialogVisible" width="70%" top="5vh" |
| | | :before-close="handleClose"> |
| | |
| | | { label: "管理编号", prop: "managementNumber" }, |
| | | { label: "技术指标", prop: "technicalIndicators" }, |
| | | { label: "购置日期", prop: "acquisitionDate" }, |
| | | { label: "启用日期", prop: "activationDate" }, |
| | | { label: "校准有效期", prop: "activationDate" }, |
| | | { label: "管理人", prop: "equipmentManagerUser" }, |
| | | { label: "存放点", prop: "storagePoint" }, |
| | | { label: "所属部门", prop: "laboratoryName" }, |
| | |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | tableRowClassName({ row }) { |
| | | const today = new Date(); |
| | | const targetDate = new Date(row.activationDate); |
| | | const fiveDaysBeforeTarget = new Date(targetDate); |
| | | // 计算前五天的日期 |
| | | fiveDaysBeforeTarget.setDate(targetDate.getDate() - 5); |
| | | // 比较时需要确保比较的是完整的日期时间,包含时分秒 |
| | | if (today > fiveDaysBeforeTarget) { |
| | | return 'red-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | |
| | | prop="useDateList"> |
| | | <el-date-picker v-model="form.useDateList" :disabled="operationType === 'view'" end-placeholder="结束日期" |
| | | format="yyyy-MM-dd HH:mm:ss" size="small" start-placeholder="开始日期" style="width:100%" |
| | | type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"> |
| | | type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" |
| | | :picker-options="pickerOptions"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | dialogVisible: false, |
| | | operationType: '', |
| | | formParamList: [], |
| | | tableLoading: false |
| | | tableLoading: false, |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() > Date.now(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | <div slot-scope="{ node, data }" class="custom-tree-node"> |
| | | <el-row style="width: 100%;"> |
| | | <el-col :span="24"> |
| | | <p class="single-line-ellipsis" style="width: 100%"> |
| | | <p class="single-line-ellipsis" style="width: 100%" :style="{ |
| | | color: isLeafNode(data) && shouldHighlight(data) ? 'red' : '' |
| | | }"> |
| | | <i :class="`node_i ${data.children != undefined |
| | | ? data.code === '[1]' |
| | | ? 'el-icon-folder-opened' |
| | |
| | | "></i> |
| | | {{ data.label }} |
| | | </p> |
| | | <p> |
| | | <p :style="{ |
| | | color: isLeafNode(data) && shouldHighlight(data) ? 'red' : '' |
| | | }"> |
| | | {{ data.managementNumber === undefined ? '' : data.managementNumber }} |
| | | </p> |
| | | </el-col> |
| | |
| | | treeDevice().then(res => { |
| | | let data = res.data; |
| | | this.list = data; |
| | | console.log('this.list--', this.list) |
| | | this.loading = false |
| | | }); |
| | | }, |
| | | // 判断是否是叶子节点 |
| | | isLeafNode(data) { |
| | | return !data.children || data.children.length === 0; |
| | | }, |
| | | // 判断是否需要标红 |
| | | shouldHighlight(data) { |
| | | if (!data.activationDate) return false; |
| | | const today = new Date(); |
| | | const targetDate = new Date(data.activationDate); |
| | | const fiveDaysBeforeTarget = new Date(targetDate); |
| | | // 计算前五天的日期 |
| | | fiveDaysBeforeTarget.setDate(targetDate.getDate() - 5); |
| | | |
| | | return today > fiveDaysBeforeTarget; |
| | | }, |
| | | handleNodeClick(val, node, el) { |
| | | // 点击临时缓存 |
| | | this.clickNodeVal = val; |
| | |
| | | }, |
| | | // 点击样品名称 |
| | | selectAllByOne(row) { |
| | | this.$router.push({ |
| | | path: "/productOrder/addView", query: { |
| | | examine: 1, |
| | | active: 2, |
| | | currentId: row.id, |
| | | tabIndex: this.tabIndex, |
| | | } |
| | | }); |
| | | if (this.tabIndex === 4) { |
| | | this.$router.push({ |
| | | path: "/productOrder/addOrder", query: { |
| | | examine: 1, |
| | | active: 2, |
| | | currentId: row.id, |
| | | tabIndex: this.tabIndex, |
| | | } |
| | | }); |
| | | } else { |
| | | this.$router.push({ |
| | | path: "/productOrder/addView", query: { |
| | | examine: 1, |
| | | active: 2, |
| | | currentId: row.id, |
| | | tabIndex: this.tabIndex, |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | // 修改样品型号 |
| | | editSampleModel (row) { |