init project
This commit is contained in:
293
mes/qd/src/views/wms/sb/re/instrumentaccount/index.vue
Normal file
293
mes/qd/src/views/wms/sb/re/instrumentaccount/index.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入设备编码、名称"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="校验日期">
|
||||
<el-date-picker v-model="query.beginuse_date" type="date" placeholder="选择日期" style="width: 230px" value-format="yyyy-MM-dd" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="检定结果">
|
||||
<el-select
|
||||
v-model="query.docimasy_result"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in resultList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view" :title="crud.status.title" width="1100px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="量具编码:" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计量器具名称:" prop="device_name">
|
||||
<el-input v-model="form.device_name" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号:" prop="device_model">
|
||||
<el-input v-model="form.device_model" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="范围精度:" prop="range_scope">
|
||||
<el-input v-model="form.range_scope" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="量具厂家:" prop="manufacturer">
|
||||
<el-input v-model="form.manufacturer" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出厂编号:" prop="leavefactory_number">
|
||||
<el-input v-model="form.leavefactory_number" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检定周期:" prop="docimasy_period">
|
||||
<el-input v-model="form.docimasy_period" style="width: 200px;" placeholder="天" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="下次检定日期:" prop="beginuse_date">
|
||||
<el-date-picker v-model="form.beginuse_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="管理状态:" prop="manage_status">
|
||||
<el-input v-model="form.manage_status" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="校准机构:" prop="check_org">
|
||||
<el-input v-model="form.check_org" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检定结果:" prop="docimasy_result">
|
||||
<el-select
|
||||
v-model="form.docimasy_result"
|
||||
:disabled="crud.status.view > 0"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in resultList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用人:" prop="use_person">
|
||||
<el-input v-model="form.use_person" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" style="width: 555px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :disabled="crud.status.view > 0" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" :row-style="tableRowClassName" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="devicebill_id" label="设备标识" />
|
||||
<el-table-column show-overflow-tooltip prop="device_code" label="设备编码" width="130px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
<el-table-column prop="device_model" label="规格型号" />
|
||||
<el-table-column prop="range_scope" label="范围精度" /><el-table-column prop="manufacturer" label="量具厂家" />
|
||||
<el-table-column prop="leavefactory_number" label="出厂编号" />
|
||||
<el-table-column prop="docimasy_period" label="检定周期" />
|
||||
<el-table-column prop="beginuse_date" label="下次检定日期" width="150px"/>
|
||||
<el-table-column prop="manage_status" label="管理状态" />
|
||||
<el-table-column prop="check_org" label="校准机构" />
|
||||
<el-table-column prop="docimasy_result" label="检定结果" :formatter="formatResultName"/>
|
||||
<el-table-column prop="use_person" label="使用人" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInstrumentaccount from '@/api/wms/re/instrumentaccount'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { devicebill_id: null, device_code: null, device_name: null, device_model: null, range_scope: null, manufacturer: null, leavefactory_number: null, docimasy_period: null, beginuse_date: null, manage_status: null, check_org: null, docimasy_result: null, use_person: null, remark: null, update_optid: null, update_optname: null, update_time: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Instrumentaccount',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '量具台账',
|
||||
url: 'api/instrumentaccount',
|
||||
idField: 'devicebill_id',
|
||||
sort: 'devicebill_id,desc',
|
||||
crudMethod: { ...crudInstrumentaccount },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: true,
|
||||
reset: true
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
resultList: [
|
||||
{ 'value': '01', 'label': '合格' },
|
||||
{ 'value': '02', 'label': '不合格' }
|
||||
],
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '设备代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_name: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatResultName(row, column) {
|
||||
if (row.docimasy_result === '01') {
|
||||
return '合格'
|
||||
}
|
||||
if (row.docimasy_result === '02') {
|
||||
return '不合格'
|
||||
}
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// 将每行的检验有效期时间格式化
|
||||
const vDate = row.beginuse_date
|
||||
const vDateStr = vDate.replace(/-/g, '')
|
||||
// 获取当前时间并格式化
|
||||
var myDate = new Date()
|
||||
// 以下操作是为了补时间缺的0
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const stryear = myDate.getFullYear().toString()
|
||||
const strmonth = (myDate.getMonth() + 1).toString()
|
||||
const strdate = myDate.getDate().toString()
|
||||
var c
|
||||
var x
|
||||
var b
|
||||
b = stryear
|
||||
if (month < 10) {
|
||||
c = ('0' + strmonth)
|
||||
} else {
|
||||
c = strmonth
|
||||
}
|
||||
if (date < 10) {
|
||||
x = ('0' + strdate)
|
||||
} else {
|
||||
x = strdate
|
||||
}
|
||||
const vnowDate = b + c + x
|
||||
// 将字符串转换成int类型进行相减
|
||||
const a = parseInt(vDateStr) - parseInt(vnowDate)
|
||||
// 进行比较符合条件表格就变化颜色
|
||||
const stylejson = {}
|
||||
if (a < 15) {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
262
mes/qd/src/views/wms/sb/re/safeaccount/index.vue
Normal file
262
mes/qd/src/views/wms/sb/re/safeaccount/index.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入设备编码、名称"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="校验日期">
|
||||
<el-date-picker v-model="query.docimasy_date" type="date" placeholder="选择日期" style="width: 230px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
 
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view" :title="crud.status.title" width="1100px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码:" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 200px;" :disabled="crud.status.view > 0 || crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称:" prop="device_name">
|
||||
<el-input v-model="form.device_name" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号:" prop="device_model">
|
||||
<el-input v-model="form.device_model" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用班组:">
|
||||
<el-input v-model="form.use_group" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用设备:" prop="use_device">
|
||||
<el-input v-model="form.use_device" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数量:" prop="qty">
|
||||
<el-input v-model="form.qty" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检定日期:" prop="docimasy_date">
|
||||
<el-date-picker v-model="form.docimasy_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="下次检定日期:" prop="next_docimasy_date">
|
||||
<el-date-picker v-model="form.next_docimasy_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="编号:">
|
||||
<el-input v-model="form.code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备责任人:" prop="use_person">
|
||||
<el-input v-model="form.use_person" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="证书编号:">
|
||||
<el-input v-model="form.certificate_code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 908px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :disabled="crud.status.view > 0" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :row-style="tableRowClassName" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="devicebill_id" label="设备标识" />
|
||||
<el-table-column show-overflow-tooltip prop="device_code" label="设备代码" width="130px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_name" label="设备名称" width="120px" />
|
||||
<el-table-column prop="device_model" label="规格型号" width="120px" />
|
||||
<el-table-column prop="use_group" label="使用班组" />
|
||||
<el-table-column prop="use_device" label="使用设备" width="120px" />
|
||||
<el-table-column prop="qty" label="数量" />
|
||||
<el-table-column prop="docimasy_date" label="检定日期" width="120px" />
|
||||
<el-table-column prop="next_docimasy_date" label="下次检定日期" width="120px" />
|
||||
<el-table-column prop="code" label="编号" width="120px" />
|
||||
<el-table-column prop="use_person" label="设备责任人" />
|
||||
<el-table-column prop="certificate_code" label="证书编号" width="120px" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSafeaccount from '@/api/wms/re/safeaccount'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { devicebill_id: null, device_code: null, device_name: null, device_model: null, use_group: null, use_device: null, qty: null, docimasy_date: null, next_docimasy_date: null, code: null, use_person: null, certificate_code: null, remark: null, update_optid: null, update_optname: null, update_time: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Safeaccount',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '安全附件账台维护',
|
||||
url: 'api/safeaccount',
|
||||
idField: 'devicebill_id',
|
||||
sort: 'devicebill_id,desc',
|
||||
crudMethod: { ...crudSafeaccount },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: true,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '设备代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_name: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_model: [
|
||||
{ required: true, message: '型号不能为空', trigger: 'blur' }
|
||||
],
|
||||
use_device: [
|
||||
{ required: true, message: '使用设备不能为空', trigger: 'blur' }
|
||||
],
|
||||
qty: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
docimasy_date: [
|
||||
{ required: true, message: '检定日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
next_docimasy_date: [
|
||||
{ required: true, message: '下次检定日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
use_person: [
|
||||
{ required: true, message: '责任人不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// 将每行的检验有效期时间格式化
|
||||
const vDate = row.next_docimasy_date
|
||||
const vDateStr = vDate.replace(/-/g, '')
|
||||
// 获取当前时间并格式化
|
||||
var myDate = new Date()
|
||||
// 以下操作是为了补时间缺的0
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const stryear = myDate.getFullYear().toString()
|
||||
const strmonth = (myDate.getMonth() + 1).toString()
|
||||
const strdate = myDate.getDate().toString()
|
||||
var c
|
||||
var x
|
||||
var b
|
||||
b = stryear
|
||||
if (month < 10) {
|
||||
c = ('0' + strmonth)
|
||||
} else {
|
||||
c = strmonth
|
||||
}
|
||||
if (date < 10) {
|
||||
x = ('0' + strdate)
|
||||
} else {
|
||||
x = strdate
|
||||
}
|
||||
const vnowDate = b + c + x
|
||||
// 将字符串转换成int类型进行相减
|
||||
const a = parseInt(vDateStr) - parseInt(vnowDate)
|
||||
// 进行比较符合条件表格就变化颜色
|
||||
const stylejson = {}
|
||||
if (a < 15) {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
261
mes/qd/src/views/wms/sb/re/specialaccount/index.vue
Normal file
261
mes/qd/src/views/wms/sb/re/specialaccount/index.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入设备编码、名称"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="校验日期">
|
||||
<el-date-picker v-model="query.valid_term" type="date" placeholder="选择日期" style="width: 230px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
 
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view" :title="crud.status.title" width="1100px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码:" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 200px;" :disabled="crud.status.view > 0 || crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称:" prop="device_name">
|
||||
<el-input v-model="form.device_name" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备注册代码:">
|
||||
<el-input v-model="form.register_code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用证书编号:">
|
||||
<el-input v-model="form.certificate_code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制造日期:" prop="product_date">
|
||||
<el-date-picker v-model="form.product_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="投用日期:">
|
||||
<el-date-picker v-model="form.use_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备所在位置:">
|
||||
<el-input v-model="form.curr_address" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用状况:">
|
||||
<el-input v-model="form.use_status" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备责任人:" prop="use_person">
|
||||
<el-input v-model="form.use_person" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检验有效期:" prop="valid_term">
|
||||
<el-date-picker v-model="form.valid_term" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设计使用年限:" prop="use_years">
|
||||
<el-input-number size="mini" :controls="false" style="width: 200px" v-model="form.use_years" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报告编号:">
|
||||
<el-input v-model="form.report_code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 908px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" :disabled="crud.status.view > 0" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :row-style="tableRowClassName" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="devicebill_id" label="设备标识" />
|
||||
<el-table-column show-overflow-tooltip prop="device_code" label="设备代码" width="130px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
<el-table-column prop="register_code" label="设备注册代码" width="120px" />
|
||||
<el-table-column prop="certificate_code" label="使用证书编号" width="120px" />
|
||||
<el-table-column prop="product_date" label="制造日期" width="110px" />
|
||||
<el-table-column prop="use_date" label="投用日期" width="110px" />
|
||||
<el-table-column prop="curr_address" label="设备所在位置" width="120px" />
|
||||
<el-table-column prop="use_status" label="使用状况" />
|
||||
<el-table-column prop="use_person" label="设备责任人" />
|
||||
<el-table-column prop="valid_term" label="检验有效期" width="110px" />
|
||||
<el-table-column prop="use_years" label="设计使用年限" width="110px" />
|
||||
<el-table-column prop="report_code" label="报告编号" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSpecialaccount from '@/api/wms/re/specialaccount'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { devicebill_id: null, device_code: null, device_name: null, device_model: null, register_code: null, certificate_code: null, product_date: null, use_date: null, curr_address: null, use_status: null, use_person: null, valid_term: null, use_years: null, report_code: null, remark: null, update_optid: null, update_optname: null, update_time: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Specialaccount',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '特种设备台账维护',
|
||||
url: 'api/specialaccount',
|
||||
idField: 'devicebill_id',
|
||||
sort: 'devicebill_id,desc',
|
||||
crudMethod: { ...crudSpecialaccount },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: true,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '设备代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_name: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_date: [
|
||||
{ required: true, message: '制造日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
use_person: [
|
||||
{ required: true, message: '设备责任人不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid_term: [
|
||||
{ required: true, message: '校验有效期不能为空', trigger: 'blur' }
|
||||
],
|
||||
use_years: [
|
||||
{ required: true, message: '设计使用年限不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// 将每行的检验有效期时间格式化
|
||||
const vDate = row.valid_term
|
||||
const vDateStr = vDate.replace(/-/g, '')
|
||||
// 获取当前时间并格式化
|
||||
var myDate = new Date()
|
||||
// 以下操作是为了补时间缺的0
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const stryear = myDate.getFullYear().toString()
|
||||
const strmonth = (myDate.getMonth() + 1).toString()
|
||||
const strdate = myDate.getDate().toString()
|
||||
var c
|
||||
var x
|
||||
var b
|
||||
b = stryear
|
||||
if (month < 10) {
|
||||
c = ('0' + strmonth)
|
||||
} else {
|
||||
c = strmonth
|
||||
}
|
||||
if (date < 10) {
|
||||
x = ('0' + strdate)
|
||||
} else {
|
||||
x = strdate
|
||||
}
|
||||
const vnowDate = b + c + x
|
||||
// 将字符串转换成int类型进行相减
|
||||
const a = parseInt(vDateStr) - parseInt(vnowDate)
|
||||
// 进行比较符合条件表格就变化颜色
|
||||
const stylejson = {}
|
||||
if (a < 15) {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user