Browse Source

Merge remote-tracking branch 'origin/master'

master
李磊 3 years ago
parent
commit
a42f27655a
  1. 85
      src/views/device_management/index.vue

85
src/views/device_management/index.vue

@ -52,7 +52,7 @@
</crud>
</div>
<!--表格内容-->
<CustomTable ref="customTable" :col-configs="colConfigs" :selection="false" :columns="columns" :crud="crud" :row-class-name="getTableRowClassName">
<CustomTable ref="customTable" :col-configs="colConfigs" :columns="columns" :crud="crud" :row-class-name="getTableRowClassName">
<el-table-column slot="operation" align="center" width="100" label="操作">
<template slot-scope="scope">
<Edit :permission="permission" :data="scope.row" :disabled-edit="false" />
@ -131,22 +131,22 @@
</el-form-item>
<el-form-item label="价值类型:" prop="valueType">
<el-select v-model="form.valueType" placeholder="请选择价值类型" clearable>
<el-option v-for="item in valueTypeList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in valueTypeList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="资产来源:" prop="assetSource">
<el-select v-model="form.assetSource" placeholder="请选择资产来源" clearable>
<el-option v-for="item in assetSourceList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in assetSourceList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="经费来源:" prop="fundingSource">
<el-select v-model="form.fundingSource" placeholder="请选择经费来源" clearable>
<el-option v-for="item in fundingSourceList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in fundingSourceList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="采购组织形式:" prop="procurementType">
<el-select v-model="form.procurementType" placeholder="请选择采购组织形式" clearable>
<el-option v-for="item in procurementTypeList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in procurementTypeList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="累计折扣:" prop="discount">
@ -157,7 +157,7 @@
</el-form-item>
<el-form-item label="折旧状态:" prop="depreciationState">
<el-select v-model="form.depreciationState" placeholder="请选择折旧状态" clearable>
<el-option v-for="item in depreciationStateList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in depreciationStateList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="是否入账:" prop="bookedState">
@ -192,17 +192,17 @@
</el-form-item>
<el-form-item label="使用状况:" prop="useState">
<el-select v-model="form.useState" placeholder="请选择使用状况" clearable>
<el-option v-for="item in useStateList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in useStateList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="使用方向:" prop="useDirection">
<el-select v-model="form.useDirection" placeholder="请选择使用方向" clearable>
<el-option v-for="item in useDirectionList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in useDirectionList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="使用用途:" prop="usePurpose">
<el-select v-model="form.usePurpose" placeholder="请选择使用用途" clearable>
<el-option v-for="item in usePurposeList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in usePurposeList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="计量状态:" prop="measureState">
@ -212,14 +212,14 @@
</el-form-item>
<el-form-item v-show="ifMeasure" label="校验周期:" prop="earlyWarningCycle">
<el-select v-model="form.earlyWarningCycle" placeholder="请选择校验周期" clearable>
<el-option v-for="item in cycleList" :key="item.value" :label="item.label" :value="item.id" />
<el-option v-for="item in cycleList" :key="item.value" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item v-show="ifMeasure" label="去年校验日期:" prop="checkLastDate">
<el-form-item v-show="ifMeasure" label="校验日期:" prop="checkLastDate">
<el-date-picker v-model="form.checkLastDate" style="width: 215px;" value-format="yyyy-MM-dd" clearable type="date" placeholder="选择去年校验日期" />
</el-form-item>
<el-form-item v-show="ifMeasure" label="今年校验日期:" prop="checkDate">
<el-date-picker v-model="form.checkDate" style="width: 215px;" value-format="yyyy-MM-dd" clearable type="date" placeholder="选择今年校验日期" />
<el-form-item v-show="ifMeasure" label="下次校验日期:" prop="checkDate">
<el-date-picker v-model="form.checkDate" style="width: 215px;" value-format="yyyy-MM-dd" clearable type="date" placeholder="选择今年校验日期" />
</el-form-item>
</el-tab-pane>
</el-tabs>
@ -326,8 +326,8 @@ export default {
{ prop: 'unitPrice', label: '单价', align: 'center' },
{ prop: 'totalPrice', label: '总价', align: 'center' },
{ prop: 'departmentId', label: '使用部门', align: 'center', formatter: this.formatter.formatterDepartmentName },
{ prop: 'principal', label: '使用人', align: 'center', formatter: this.formatter.formatterNickName },
{ prop: 'useState', label: '使用状况', align: 'center', component: PrefixPlusText, componentFunction: this.formatterDicData },
{ prop: 'principal', label: '使用人', align: 'center', formatter: this.formatter.getChineseName },
{ prop: 'useState', label: '使用状况', align: 'center', formatter: this.formatterDicData },
{ slot: 'operation' }
],
permission: {
@ -400,6 +400,18 @@ export default {
instrumentId: 0,
moveDialogVisible: false,
ifMeasure: false
// pickerOptions1: {
// //disabledDate
// disabledDate: (time) => {
// // setMonth()
// let currentTime = this.value1;
// let threeMonths = currentTime.setMonth(currentTime.getMonth()+3);
// //
// currentTime.setMonth(currentTime.getMonth()-3)
// return time.getTime() < this.value1 || time.getTime() > threeMonths ;
// }
// }
}
},
mounted() {
@ -428,6 +440,7 @@ export default {
[CRUD.HOOK.afterToEdit](crud, form) {
this.departmentId = form.departmentId
this.ifMeasure = form.measureState
this.parentId = form.classCode
},
//
[CRUD.HOOK.afterEditCancel]() {
@ -492,6 +505,7 @@ export default {
getDicDataListByTypeName({ typeCode: 'use_purpose' }).then(data => { this.usePurposeList = data })
//
getDicDataListByTypeName({ typeCode: 'verification_cycle' }).then(data => { this.cycleList = data })
},
//
getDepartmentValue(value) {
@ -512,20 +526,31 @@ export default {
this.query.departmentId = value === 0 ? '' : value
},
//
getTableRowClassName({ row }) {
let color = ''
switch (row.ifOverdue) {
case 2:
color = 'table-row-color-red'
break
case 1:
color = 'table-row-color-orange'
break
default:
color = ''
break
// getTableRowClassName({ row }) {
// let color = ''
// switch (row.ifOverdue) {
// case 2:
// color = 'table-row-color-red'
// break
// case 1:
// color = 'table-row-color-orange'
// break
// default:
// color = ''
// break
// }
// return color
// },
getTableRowClassName({ row, rowIndex }) {
// row.index = rowIndex
const nextTime = new Date(row.checkDate).getTime()
const currentTime = new Date().getTime()
if (nextTime - currentTime < 7776000000) {
return 'table-row-color-red'
} else if (nextTime - currentTime >= 7776000000) {
return 'table-row-color-orange'
}
return color
return ''
},
//
moveAdministration(selections) {
@ -550,8 +575,8 @@ export default {
formatterDicData(cellValue) {
if (cellValue != null) {
let label = ''
this.useStateList.filter(dicData => dicData.id === cellValue).forEach(dicData => {
label = dicData.label
this.useStateList.filter(dicData => dicData.id === cellValue.useState).forEach(dicData => {
label = dicData.name
})
return label
}

Loading…
Cancel
Save