This commit is contained in:
zds
2022-10-10 19:35:55 +08:00
parent 7e97657f16
commit 900b4a9e1e
6 changed files with 116 additions and 92 deletions

View File

@@ -1,7 +1,7 @@
<template>
<el-dialog
title="设备档案编辑"
width="800px"
width="900px"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
@close="close"
@@ -9,13 +9,13 @@
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="105px" label-suffix=":">
<el-form-item label="设备档案编码" prop="devicerecord_code">
<label slot="label">设备档案编码:</label>
<el-input v-model="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
<el-input v-model="form.devicerecord_code" disabled placeholder="系统生成" style="width: 300px" />
</el-form-item>
<el-form-item label="设备状态" prop="status">
<el-select
v-model="form.status"
placeholder="设备状态"
style="width: 210px"
style="width: 300px"
class="filter-item"
disabled
>
@@ -29,50 +29,50 @@
</el-form-item>
<el-form-item label="设备编码" prop="device_code">
<label slot="label">设备编码:</label>
<el-input v-model="form.device_code" clearable style="width: 210px" />
<el-input v-model="form.device_code" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="设备名称" prop="device_name">
<label slot="label">设备名称:</label>
<el-input v-model="form.device_name" clearable style="width: 210px" />
<el-input v-model="form.device_name" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="设备规格" prop="device_spec">
<label slot="label">设备规格:</label>
<el-input v-model="form.device_spec" clearable style="width: 210px" />
<el-input v-model="form.device_spec" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="设备型号" prop="device_model">
<label slot="label">设备型号:</label>
<el-input v-model="form.device_model" clearable style="width: 210px" />
<el-input v-model="form.device_model" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="制造商" prop="manufacturer">
<label slot="label">制造商:</label>
<el-input v-model="form.manufacturer" clearable style="width: 210px" />
<el-input v-model="form.manufacturer" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="制造国别" prop="country_manufactur">
<label slot="label">制造国别:</label>
<el-input v-model="form.country_manufactur" clearable style="width: 210px" />
<el-input v-model="form.country_manufactur" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="出厂编号" prop="leavefactory_number">
<label slot="label">出厂编号:</label>
<el-input v-model="form.leavefactory_number" clearable style="width: 210px" />
<el-input v-model="form.leavefactory_number" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="出厂日期" prop="leavefactory_date">
<label slot="label">出厂日期:</label>
<el-date-picker v-model="form.leavefactory_date" value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" style="width: 210px" />
<el-date-picker v-model="form.leavefactory_date" value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" style="width: 300px" />
</el-form-item>
<el-form-item label="图号" prop="drawing_number">
<label slot="label">图号:</label>
<el-input v-model="form.drawing_number" clearable style="width: 210px" />
<el-input v-model="form.drawing_number" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="供应商" prop="supplier_name">
<label slot="label">供应商:</label>
<el-input v-model="form.supplier_name" clearable style="width: 210px" />
<el-input v-model="form.supplier_name" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="设备类别" prop="material_type_id">
<treeselect
v-model="form.material_type_id"
:options="classes"
:load-options="loadClass"
style="width: 210px;"
style="width: 300px"
:clearable= "false"
placeholder="设备类别"
@select="typeChange"
@@ -82,7 +82,7 @@
<el-select
v-model="form.is_produceuse"
placeholder="生产用途"
style="width: 210px"
style="width: 300px"
class="filter-item"
>
<el-option
@@ -98,7 +98,7 @@
v-model="form.use_deptid"
:options="depts"
:load-options="loadDepts"
style="width: 210px"
style="width: 300px"
placeholder="使用部门"
/>
</el-form-item>
@@ -107,7 +107,7 @@
v-model="form.use_groupid"
:options="depts"
:load-options="loadDepts"
style="width: 210px"
style="width: 300px"
placeholder="使用班组"
/>
</el-form-item>
@@ -115,7 +115,7 @@
<el-select
v-model="form.device_type"
placeholder="设备属性"
style="width: 210px"
style="width: 300px"
class="filter-item"
>
<el-option
@@ -128,35 +128,35 @@
</el-form-item>
<el-form-item label="内部自编号" prop="extend_code">
<label slot="label">内部自编号:</label>
<el-input v-model="form.extend_code" clearable style="width: 210px" />
<el-input v-model="form.extend_code" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="资产编码" prop="assets_code">
<label slot="label">资产编码:</label>
<el-input v-model="form.assets_code" clearable style="width: 210px" />
<el-input v-model="form.assets_code" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="资产名称" prop="assets_name">
<label slot="label">资产名称:</label>
<el-input v-model="form.assets_name" clearable style="width: 210px" />
<el-input v-model="form.assets_name" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="启用日期" prop="beginuse_date">
<label slot="label">启用日期:</label>
<el-date-picker v-model="form.beginuse_date" value-format="yyyy-MM-dd" type="date" placeholder="启用日期" style="width: 300px" />
</el-form-item>
<el-form-item label="归属部门" prop="belong_deptid">
<treeselect
v-model="form.belong_deptid"
:options="depts"
:load-options="loadDepts"
style="width: 210px"
style="width: 300px"
placeholder="选择部门"
/>
</el-form-item>
<el-form-item label="启用日期" prop="beginuse_date">
<label slot="label">启用日期:</label>
<el-date-picker v-model="form.beginuse_date" value-format="yyyy-MM-dd" type="date" placeholder="启用日期" style="width: 210px" />
</el-form-item>
<el-form-item label="工序" prop="workprocedure_id">
<el-select
v-model="form.workprocedure_id"
clearable
placeholder="工序"
style="width: 210px"
style="width: 300px"
class="filter-item"
>
<el-option
@@ -174,14 +174,14 @@
:controls="false"
:precision="3"
:min="0"
style="width: 210px"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="设备BOM" prop="device_bom_id">
<el-select
v-model="form.device_bom_id"
placeholder="设备BOM"
style="width: 210px"
style="width: 300px"
class="filter-item"
>
<el-option
@@ -194,15 +194,15 @@
</el-form-item>
<el-form-item label="卡片编号" prop="card_code">
<label slot="label">卡片编号:</label>
<el-input v-model="form.card_code" clearable style="width: 210px" />
<el-input v-model="form.card_code" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="安装地点" prop="setting_place">
<label slot="label">安装地点:</label>
<el-input v-model="form.setting_place" clearable style="width: 210px" />
<el-input v-model="form.setting_place" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="使用人" prop="user_name">
<label slot="label">使用人:</label>
<el-input v-model="form.user_name" clearable style="width: 210px" />
<el-input v-model="form.user_name" clearable style="width: 300px" />
</el-form-item>
<el-form-item label="本币原值" prop="oraginal_value">
<label slot="label">本币原值:</label>
@@ -211,7 +211,7 @@
:controls="false"
:precision="3"
:min="0"
style="width: 210px"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="净额" prop="net_amount">
@@ -221,7 +221,7 @@
:controls="false"
:precision="3"
:min="0"
style="width: 210px"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">

View File

@@ -17,7 +17,7 @@
:options="depts"
:load-options="loadDepts"
clearable
style="width: 200px"
style="width: 300px"
placeholder="选择部门"
/>
</el-form-item>
@@ -27,7 +27,7 @@
:options="classes"
clearable
:load-options="loadClass"
style="width: 200px"
style="width: 300px"
placeholder="设备类别"
/>
</el-form-item>

View File

@@ -56,7 +56,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="设备档案" prop="devicerecord_id">
<el-form-item label="设备名称" prop="devicerecord_id">
<el-input v-model="form.devicerecord_id" :disabled="true" style="width: 200px;"/>
</el-form-item>
</el-col>

View File

@@ -68,7 +68,6 @@
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="repair"
>
维修
@@ -79,7 +78,6 @@
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="notRepair"
>
不维修
@@ -155,6 +153,7 @@ export default {
data() {
return {
classes: [],
checkrows: [],
class_idStr: null,
materOpt_code: '23',
statusList: [
@@ -240,23 +239,23 @@ export default {
}
},
repair() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
if (data.status !== '01') {
return this.crud.notify('只能对生成状态的单据进行维修', CRUD.NOTIFICATION_TYPE.INFO)
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
this.crud.notify('请勾选需要操作的记录!')
return false
}
crudDevicerepairrequest.repair(data).then(res => {
crudDevicerepairrequest.repair({ rows: this.checkrows}).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
notRepair() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
if (data.status !== '01') {
return this.crud.notify('只能对生成状态的单据进行操作', CRUD.NOTIFICATION_TYPE.INFO)
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
this.crud.notify('请勾选需要操作的记录!')
return false
}
crudDevicerepairrequest.notRepair(data).then(res => {
crudDevicerepairrequest.notRepair({ rows: this.checkrows}).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})

View File

@@ -128,7 +128,9 @@
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;"
@cell-dblclick = "mydb"
@selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="runrecord_id" label="记录标识" />
<el-table-column prop="run_date" label="填报日期" width="120px" show-overflow-tooltip />
@@ -312,6 +314,10 @@ export default {
})
})
},
mydb(row){
this.openParam = row
this.addPaDialog = true
},
addPa() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]