|
@@ -1,29 +1,16 @@
|
|
<template>
|
|
<template>
|
|
- <a-modal
|
|
|
|
- :title="modalTitle"
|
|
|
|
- :width="1200"
|
|
|
|
- :visible="visible"
|
|
|
|
- :confirmLoading="confirmLoading"
|
|
|
|
- @cancel="handleCancel"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-modal :title="modalTitle" :width="1200" :visible="visible" :confirmLoading="confirmLoading" @cancel="handleCancel">
|
|
<a-form :form="form">
|
|
<a-form :form="form">
|
|
-
|
|
|
|
<a-form-item v-show="false">
|
|
<a-form-item v-show="false">
|
|
- <a-input v-decorator="['id']" type="hidden"/>
|
|
|
|
- <a-input v-decorator="['sbId']" type="hidden"/>
|
|
|
|
- <a-input v-decorator="['part']" type="hidden"/>
|
|
|
|
|
|
+ <a-input v-decorator="['id']" type="hidden" />
|
|
|
|
+ <a-input v-decorator="['sbId']" type="hidden" />
|
|
|
|
+ <a-input v-decorator="['part']" type="hidden" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
|
<row-list :col="2">
|
|
<row-list :col="2">
|
|
<row-item>
|
|
<row-item>
|
|
- <a-form-item
|
|
|
|
- label="编码"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <a-input
|
|
|
|
- disabled
|
|
|
|
- v-decorator="['no', {rules: [{required: false, message: '编码不能为空'}]}]"/>
|
|
|
|
|
|
+ <a-form-item label="编码" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
|
+ <a-input disabled v-decorator="['no', { rules: [{ required: false, message: '编码不能为空' }] }]" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
<row-item>
|
|
<row-item>
|
|
@@ -35,7 +22,8 @@
|
|
<a-input
|
|
<a-input
|
|
disabled
|
|
disabled
|
|
style="width: 80%"
|
|
style="width: 80%"
|
|
- v-decorator="['sbNo', {rules: [{required: false, message: '请选择设备'}]}]"/>
|
|
|
|
|
|
+ v-decorator="['sbNo', { rules: [{ required: false, message: '请选择设备' }] }]"
|
|
|
|
+ />
|
|
<a-button type="primary" style="width: 20%" @click="handleSbSelect">选择</a-button>
|
|
<a-button type="primary" style="width: 20%" @click="handleSbSelect">选择</a-button>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
@@ -55,10 +43,7 @@
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-input
|
|
|
|
- disabled
|
|
|
|
- style="width: 80%"
|
|
|
|
- v-decorator="['partName']"/>
|
|
|
|
|
|
+ <a-input disabled style="width: 80%" v-decorator="['partName']" />
|
|
<a-button type="primary" style="width: 20%" @click="handlePartSelect">选择</a-button>
|
|
<a-button type="primary" style="width: 20%" @click="handlePartSelect">选择</a-button>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
@@ -70,13 +55,11 @@
|
|
>
|
|
>
|
|
<a-select
|
|
<a-select
|
|
@change="changeLevel"
|
|
@change="changeLevel"
|
|
- v-decorator="['level', {rules: [{required: true, message: '维护等级不能为空'}]}]"
|
|
|
|
- placeholder="请选择">
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(label,value) in levelMap"
|
|
|
|
- :key="value"
|
|
|
|
- :label="label"
|
|
|
|
- :value="parseInt(value)">{{ label }}
|
|
|
|
|
|
+ v-decorator="['level', { rules: [{ required: true, message: '维护等级不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option v-for="(label, value) in levelMap" :key="value" :label="label" :value="parseInt(value)"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -88,14 +71,15 @@
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
<a-select
|
|
<a-select
|
|
- disabled
|
|
|
|
- v-decorator="['checkUserType', {rules: [{required: true, message: '执行人方式不能为空'}]}]"
|
|
|
|
- placeholder="请选择">
|
|
|
|
|
|
+ v-decorator="['checkUserType', { rules: [{ required: true, message: '执行人方式不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<a-select-option
|
|
<a-select-option
|
|
- v-for="(label,value) in checkUserTypeMap"
|
|
|
|
|
|
+ v-for="(label, value) in checkUserTypeMap"
|
|
:key="value"
|
|
:key="value"
|
|
:label="label"
|
|
:label="label"
|
|
- :value="parseInt(value)">{{ label }}
|
|
|
|
|
|
+ :value="parseInt(value)"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -111,19 +95,20 @@
|
|
<a-input-number
|
|
<a-input-number
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:min="1"
|
|
:min="1"
|
|
- v-decorator="['period', {rules: [{required: true, message: '计划周期不能为空'}]}]"/>
|
|
|
|
|
|
+ v-decorator="['period', { rules: [{ required: true, message: '计划周期不能为空' }] }]"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item
|
|
|
|
- :style="{ display: 'inline-block', width: '30%' }"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item :style="{ display: 'inline-block', width: '30%' }">
|
|
<a-select
|
|
<a-select
|
|
- v-decorator="['periodType', {rules: [{required: true, message: '周期类型不能为空'}]}]"
|
|
|
|
- placeholder="请选择">
|
|
|
|
|
|
+ v-decorator="['periodType', { rules: [{ required: true, message: '周期类型不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<a-select-option
|
|
<a-select-option
|
|
- v-for="(label,value) in periodTypeMap"
|
|
|
|
|
|
+ v-for="(label, value) in periodTypeMap"
|
|
:key="value"
|
|
:key="value"
|
|
:label="label"
|
|
:label="label"
|
|
- :value="parseInt(value)">{{ label }}
|
|
|
|
|
|
+ :value="parseInt(value)"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -135,9 +120,7 @@
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-input
|
|
|
|
- v-decorator="['standardHours']"
|
|
|
|
- suffix="小时"/>
|
|
|
|
|
|
+ <a-input v-decorator="['standardHours']" suffix="小时" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
<!-- <row-item>
|
|
<!-- <row-item>
|
|
@@ -161,14 +144,11 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>-->
|
|
</row-item>-->
|
|
<row-item>
|
|
<row-item>
|
|
- <a-form-item
|
|
|
|
- label="排序"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item label="排序" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
<a-input-number
|
|
<a-input-number
|
|
:step="1"
|
|
:step="1"
|
|
- v-decorator="['sort', {initialValue: 1,rules: [{required: true, message: '排序不能为空'}]}]"/>
|
|
|
|
|
|
+ v-decorator="['sort', { initialValue: 1, rules: [{ required: true, message: '排序不能为空' }] }]"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
<row-item>
|
|
<row-item>
|
|
@@ -178,13 +158,18 @@
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
<a-select
|
|
<a-select
|
|
- v-decorator="['actionType', {initialValue: 1,rules: [{required: true, message: '是否启用不能为空'}]}]"
|
|
|
|
- placeholder="请选择">
|
|
|
|
|
|
+ v-decorator="[
|
|
|
|
+ 'actionType',
|
|
|
|
+ { initialValue: 1, rules: [{ required: true, message: '是否启用不能为空' }] }
|
|
|
|
+ ]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<a-select-option
|
|
<a-select-option
|
|
- v-for="(label,value) in actionTypeMap"
|
|
|
|
|
|
+ v-for="(label, value) in actionTypeMap"
|
|
:key="value"
|
|
:key="value"
|
|
:label="label"
|
|
:label="label"
|
|
- :value="parseInt(value)">{{ label }}
|
|
|
|
|
|
+ :value="parseInt(value)"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -219,7 +204,8 @@
|
|
<a-date-picker
|
|
<a-date-picker
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
- v-decorator="['lastDate']" />
|
|
|
|
|
|
+ v-decorator="['lastDate']"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
<row-item>
|
|
<row-item>
|
|
@@ -232,7 +218,8 @@
|
|
disabled
|
|
disabled
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
- v-decorator="['nextDate']" />
|
|
|
|
|
|
+ v-decorator="['nextDate']"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
</row-list>
|
|
</row-list>
|
|
@@ -245,7 +232,8 @@
|
|
>
|
|
>
|
|
<a-textarea
|
|
<a-textarea
|
|
:rows="4"
|
|
:rows="4"
|
|
- v-decorator="['requirement', {rules: [{required: true, message: '检查项目不能为空'}]}]"/>
|
|
|
|
|
|
+ v-decorator="['requirement', { rules: [{ required: true, message: '检查项目不能为空' }] }]"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
<row-item>
|
|
<row-item>
|
|
@@ -256,17 +244,14 @@
|
|
>
|
|
>
|
|
<a-textarea
|
|
<a-textarea
|
|
:rows="4"
|
|
:rows="4"
|
|
- v-decorator="['remark', {rules: [{required: false, message: '操作说明及标准不能为空'}]}]"/>
|
|
|
|
|
|
+ v-decorator="['remark', { rules: [{ required: false, message: '操作说明及标准不能为空' }] }]"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
</row-list>
|
|
</row-list>
|
|
<row-list :col="2">
|
|
<row-list :col="2">
|
|
<row-item>
|
|
<row-item>
|
|
- <a-form-item
|
|
|
|
- label="图片"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item label="图片" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
<a-upload
|
|
<a-upload
|
|
:action="uploadUrl"
|
|
:action="uploadUrl"
|
|
:multiple="true"
|
|
:multiple="true"
|
|
@@ -281,11 +266,7 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
<row-item>
|
|
<row-item>
|
|
- <a-form-item
|
|
|
|
- label="文件"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-form-item label="文件" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
<a-upload
|
|
<a-upload
|
|
:action="uploadUrl"
|
|
:action="uploadUrl"
|
|
:multiple="true"
|
|
:multiple="true"
|
|
@@ -302,11 +283,11 @@
|
|
<title-divider title="关联备件" width="100px"></title-divider>
|
|
<title-divider title="关联备件" width="100px"></title-divider>
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
<a-button style="margin-left:8px;" type="primary" @click="handleSpareSelect">
|
|
<a-button style="margin-left:8px;" type="primary" @click="handleSpareSelect">
|
|
- <a-icon type="plus"/>
|
|
|
|
|
|
+ <a-icon type="plus" />
|
|
添加
|
|
添加
|
|
</a-button>
|
|
</a-button>
|
|
<a-button class="margin-left8" size="small" type="danger" @click="handleDel">
|
|
<a-button class="margin-left8" size="small" type="danger" @click="handleDel">
|
|
- <a-icon type="delete"/>
|
|
|
|
|
|
+ <a-icon type="delete" />
|
|
删除
|
|
删除
|
|
</a-button>
|
|
</a-button>
|
|
</div>
|
|
</div>
|
|
@@ -317,10 +298,15 @@
|
|
ref="table"
|
|
ref="table"
|
|
tableLayout="auto"
|
|
tableLayout="auto"
|
|
:row-selection="rowSelection"
|
|
:row-selection="rowSelection"
|
|
- rowKey="bomId">
|
|
|
|
|
|
+ rowKey="bomId"
|
|
|
|
+ >
|
|
<template slot="num" slot-scope="text, record">
|
|
<template slot="num" slot-scope="text, record">
|
|
<div class="editable-cell-input-wrapper">
|
|
<div class="editable-cell-input-wrapper">
|
|
- <a-input :value="text" :id="record.spareId + ',num'" @change="$event => onQuantityChange($event, record.id, 'num')" />
|
|
|
|
|
|
+ <a-input
|
|
|
|
+ :value="text"
|
|
|
|
+ :id="record.spareId + ',num'"
|
|
|
|
+ @change="$event => onQuantityChange($event, record.id, 'num')"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<span slot="action" slot-scope="record">
|
|
<span slot="action" slot-scope="record">
|
|
@@ -336,9 +322,9 @@
|
|
<template slot="footer">
|
|
<template slot="footer">
|
|
<a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
<a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
</template>
|
|
</template>
|
|
- <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
|
|
|
|
- <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
|
|
|
|
- <spare-part-info-select-modal-sb-info :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
|
|
|
|
|
|
+ <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected" />
|
|
|
|
+ <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd" />
|
|
|
|
+ <spare-part-info-select-modal-sb-info :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected" />
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -363,7 +349,7 @@ export default {
|
|
PartInfoSelectModal,
|
|
PartInfoSelectModal,
|
|
SparePartInfoSelectModalSbInfo
|
|
SparePartInfoSelectModalSbInfo
|
|
},
|
|
},
|
|
- data () {
|
|
|
|
|
|
+ data() {
|
|
return {
|
|
return {
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
modalTitle: null,
|
|
modalTitle: null,
|
|
@@ -440,7 +426,7 @@ export default {
|
|
default: 2
|
|
default: 2
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created () {
|
|
|
|
|
|
+ created() {
|
|
// 下拉框map
|
|
// 下拉框map
|
|
this.paramTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_PARAM_TYPE)
|
|
this.paramTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_PARAM_TYPE)
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
|
|
@@ -451,7 +437,7 @@ export default {
|
|
this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
|
|
this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- base (record, sbId, sbNo) {
|
|
|
|
|
|
+ base(record, sbId, sbNo) {
|
|
this.visible = true
|
|
this.visible = true
|
|
this.selectedRowKeys = []
|
|
this.selectedRowKeys = []
|
|
this.selectedRows = []
|
|
this.selectedRows = []
|
|
@@ -466,7 +452,9 @@ export default {
|
|
this.cacheData = []
|
|
this.cacheData = []
|
|
if (sbId != null) {
|
|
if (sbId != null) {
|
|
this.sbId = sbId
|
|
this.sbId = sbId
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
// 日期处理
|
|
// 日期处理
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
setFieldsValue({ sbId: sbId, sbNo: sbNo })
|
|
setFieldsValue({ sbId: sbId, sbNo: sbNo })
|
|
@@ -489,17 +477,13 @@ export default {
|
|
if (record.lastDate != null) {
|
|
if (record.lastDate != null) {
|
|
record.lastDate = this.BaseTool.Moment(record.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
record.lastDate = this.BaseTool.Moment(record.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign(pick(record, [
|
|
|
|
- 'lastDate'
|
|
|
|
- ])))
|
|
|
|
|
|
+ setFieldsValue(Object.assign(pick(record, ['lastDate'])))
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if (record.nextDate != null) {
|
|
if (record.nextDate != null) {
|
|
record.nextDate = this.BaseTool.Moment(record.nextDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
record.nextDate = this.BaseTool.Moment(record.nextDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign(pick(record, [
|
|
|
|
- 'nextDate'
|
|
|
|
- ])))
|
|
|
|
|
|
+ setFieldsValue(Object.assign(pick(record, ['nextDate'])))
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if (this.checkImgList == null) {
|
|
if (this.checkImgList == null) {
|
|
@@ -508,35 +492,43 @@ export default {
|
|
if (this.checkImgList == null) {
|
|
if (this.checkImgList == null) {
|
|
this.defaultCheckFileList = this.BaseTool.UPLOAD.transImg(this.checkFileList)
|
|
this.defaultCheckFileList = this.BaseTool.UPLOAD.transImg(this.checkFileList)
|
|
}
|
|
}
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
// 日期处理
|
|
// 日期处理
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign(pick(record, [
|
|
|
|
- 'id',
|
|
|
|
- 'sbId',
|
|
|
|
- 'sbNo',
|
|
|
|
- 'name',
|
|
|
|
- // 'no',
|
|
|
|
- // 'type',
|
|
|
|
- 'period',
|
|
|
|
- 'level',
|
|
|
|
- 'part',
|
|
|
|
- 'partName',
|
|
|
|
- 'checkUserType',
|
|
|
|
- 'checkUserId',
|
|
|
|
- 'periodType',
|
|
|
|
- 'standardHours',
|
|
|
|
- // 'actionType',
|
|
|
|
- // 'enable',
|
|
|
|
- 'requirement',
|
|
|
|
- 'nextDate',
|
|
|
|
- 'lastDate',
|
|
|
|
- 'remark'
|
|
|
|
- ])))
|
|
|
|
|
|
+ setFieldsValue(
|
|
|
|
+ Object.assign(
|
|
|
|
+ pick(record, [
|
|
|
|
+ 'id',
|
|
|
|
+ 'sbId',
|
|
|
|
+ 'sbNo',
|
|
|
|
+ 'name',
|
|
|
|
+ // 'no',
|
|
|
|
+ // 'type',
|
|
|
|
+ 'period',
|
|
|
|
+ 'level',
|
|
|
|
+ 'part',
|
|
|
|
+ 'partName',
|
|
|
|
+ 'checkUserType',
|
|
|
|
+ 'checkUserId',
|
|
|
|
+ 'periodType',
|
|
|
|
+ 'standardHours',
|
|
|
|
+ // 'actionType',
|
|
|
|
+ // 'enable',
|
|
|
|
+ 'requirement',
|
|
|
|
+ 'nextDate',
|
|
|
|
+ 'lastDate',
|
|
|
|
+ 'remark'
|
|
|
|
+ ])
|
|
|
|
+ )
|
|
|
|
+ )
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- save () {
|
|
|
|
- const { form: { validateFieldsAndScroll } } = this
|
|
|
|
|
|
+ save() {
|
|
|
|
+ const {
|
|
|
|
+ form: { validateFieldsAndScroll }
|
|
|
|
+ } = this
|
|
this.confirmLoading = true
|
|
this.confirmLoading = true
|
|
validateFieldsAndScroll((errors, values) => {
|
|
validateFieldsAndScroll((errors, values) => {
|
|
if (errors) {
|
|
if (errors) {
|
|
@@ -546,8 +538,12 @@ export default {
|
|
// 上传文件
|
|
// 上传文件
|
|
values.checkImgList = this.checkImgList
|
|
values.checkImgList = this.checkImgList
|
|
values.checkFileList = this.checkFileList
|
|
values.checkFileList = this.checkFileList
|
|
- values.nextDate = values.nextDate ? this.BaseTool.Date.formatter(values.nextDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
|
|
|
|
- values.lastDate = values.lastDate ? this.BaseTool.Date.formatter(values.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
|
|
|
|
|
|
+ values.nextDate = values.nextDate
|
|
|
|
+ ? this.BaseTool.Date.formatter(values.nextDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
|
+ : null
|
|
|
|
+ values.lastDate = values.lastDate
|
|
|
|
+ ? this.BaseTool.Date.formatter(values.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
|
+ : null
|
|
|
|
|
|
// 备件列表
|
|
// 备件列表
|
|
values.detailList = this.data
|
|
values.detailList = this.data
|
|
@@ -555,20 +551,22 @@ export default {
|
|
addCheckStandard(values)
|
|
addCheckStandard(values)
|
|
.then(() => {
|
|
.then(() => {
|
|
this.handleCancel(values)
|
|
this.handleCancel(values)
|
|
- }).catch(() => {
|
|
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
updateCheckStandard(values)
|
|
updateCheckStandard(values)
|
|
.then(() => {
|
|
.then(() => {
|
|
this.handleCancel(values)
|
|
this.handleCancel(values)
|
|
- }).catch(() => {
|
|
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleCancel (values) {
|
|
|
|
|
|
+ handleCancel(values) {
|
|
this.visible = false
|
|
this.visible = false
|
|
this.data = []
|
|
this.data = []
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
@@ -579,51 +577,59 @@ export default {
|
|
this.$emit('ok', values)
|
|
this.$emit('ok', values)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handleSbSelect () {
|
|
|
|
|
|
+ handleSbSelect() {
|
|
this.$refs.sbInfoSelectModal.base()
|
|
this.$refs.sbInfoSelectModal.base()
|
|
},
|
|
},
|
|
- handleSbSelectd (keys, rows) {
|
|
|
|
- const [ key ] = keys
|
|
|
|
- const [ row ] = rows
|
|
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ handleSbSelectd(keys, rows) {
|
|
|
|
+ const [key] = keys
|
|
|
|
+ const [row] = rows
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
this.sbId = key
|
|
this.sbId = key
|
|
// 日期处理
|
|
// 日期处理
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign({
|
|
|
|
- 'sbId': key,
|
|
|
|
- 'sbNo': row.no,
|
|
|
|
- 'part': null,
|
|
|
|
- 'partName': null
|
|
|
|
- }))
|
|
|
|
|
|
+ setFieldsValue(
|
|
|
|
+ Object.assign({
|
|
|
|
+ sbId: key,
|
|
|
|
+ sbNo: row.no,
|
|
|
|
+ part: null,
|
|
|
|
+ partName: null
|
|
|
|
+ })
|
|
|
|
+ )
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handlePartSelect () {
|
|
|
|
|
|
+ handlePartSelect() {
|
|
const sbId = this.form.getFieldValue('sbId')
|
|
const sbId = this.form.getFieldValue('sbId')
|
|
if (this.BaseTool.Object.isBlank(sbId)) {
|
|
if (this.BaseTool.Object.isBlank(sbId)) {
|
|
this.$message.error('请先选择设备')
|
|
this.$message.error('请先选择设备')
|
|
}
|
|
}
|
|
this.$refs.partInfoSelectModal.base({ sbId })
|
|
this.$refs.partInfoSelectModal.base({ sbId })
|
|
},
|
|
},
|
|
- handlePartSelected (keys, rows) {
|
|
|
|
- const [ key ] = keys
|
|
|
|
- const [ row ] = rows
|
|
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ handlePartSelected(keys, rows) {
|
|
|
|
+ const [key] = keys
|
|
|
|
+ const [row] = rows
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign({
|
|
|
|
- 'part': key,
|
|
|
|
- 'partName': row.name
|
|
|
|
- }))
|
|
|
|
|
|
+ setFieldsValue(
|
|
|
|
+ Object.assign({
|
|
|
|
+ part: key,
|
|
|
|
+ partName: row.name
|
|
|
|
+ })
|
|
|
|
+ )
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleCheckImgChange (info) {
|
|
|
|
|
|
+ handleCheckImgChange(info) {
|
|
this.defaultCheckImgList = info.fileList
|
|
this.defaultCheckImgList = info.fileList
|
|
this.checkImgList = this.setFileList(info, 1)
|
|
this.checkImgList = this.setFileList(info, 1)
|
|
},
|
|
},
|
|
- handleCheckFileChange (info) {
|
|
|
|
|
|
+ handleCheckFileChange(info) {
|
|
this.defaultCheckFileList = info.fileList
|
|
this.defaultCheckFileList = info.fileList
|
|
this.checkFileList = this.setFileList(info, 2)
|
|
this.checkFileList = this.setFileList(info, 2)
|
|
},
|
|
},
|
|
- setFileList (info, type) {
|
|
|
|
|
|
+ setFileList(info, type) {
|
|
const file = info.file
|
|
const file = info.file
|
|
const fileList = info.fileList
|
|
const fileList = info.fileList
|
|
if (file.status === 'done') {
|
|
if (file.status === 'done') {
|
|
@@ -635,10 +641,10 @@ export default {
|
|
return null
|
|
return null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handleSpareSelect () {
|
|
|
|
|
|
+ handleSpareSelect() {
|
|
this.$refs.spareSelectModal.base(null, { sbId: this.sbId })
|
|
this.$refs.spareSelectModal.base(null, { sbId: this.sbId })
|
|
},
|
|
},
|
|
- handleSpareSelected (record, keys, rows) {
|
|
|
|
|
|
+ handleSpareSelected(record, keys, rows) {
|
|
const addData = []
|
|
const addData = []
|
|
for (let i = 0; i < rows.length; i++) {
|
|
for (let i = 0; i < rows.length; i++) {
|
|
addData.push({ sbId: this.sbId, spareId: rows[i].id, spareName: rows[i].name, num: 1 })
|
|
addData.push({ sbId: this.sbId, spareId: rows[i].id, spareName: rows[i].name, num: 1 })
|
|
@@ -664,7 +670,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handleDel () {
|
|
|
|
|
|
+ handleDel() {
|
|
const data = [...this.data]
|
|
const data = [...this.data]
|
|
if (this.selectedRowKeys.length === 0) {
|
|
if (this.selectedRowKeys.length === 0) {
|
|
this.$message.error('请至少选择一条数据')
|
|
this.$message.error('请至少选择一条数据')
|
|
@@ -672,19 +678,21 @@ export default {
|
|
}
|
|
}
|
|
this.data = data.filter(item => !this.selectedRowKeys.includes(item.bomId))
|
|
this.data = data.filter(item => !this.selectedRowKeys.includes(item.bomId))
|
|
},
|
|
},
|
|
- handleDelOne (record) {
|
|
|
|
|
|
+ handleDelOne(record) {
|
|
const data = [...this.data]
|
|
const data = [...this.data]
|
|
this.data = data.filter(item => record.bomId !== item.bomId)
|
|
this.data = data.filter(item => record.bomId !== item.bomId)
|
|
},
|
|
},
|
|
- changeLevel (value) {
|
|
|
|
|
|
+ changeLevel(value) {
|
|
this.level = value
|
|
this.level = value
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
// 日期处理
|
|
// 日期处理
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
setFieldsValue({ checkUserType: value })
|
|
setFieldsValue({ checkUserType: value })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onQuantityChange (e, id, attr) {
|
|
|
|
|
|
+ onQuantityChange(e, id, attr) {
|
|
const value = e.target.value
|
|
const value = e.target.value
|
|
console.log(value)
|
|
console.log(value)
|
|
if (value !== 0 && !value) {
|
|
if (value !== 0 && !value) {
|