|
|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
- <a-modal :title="modalTitle" :width="900" :visible="visible" :confirmLoading="confirmLoading" class="ant-modal2" @cancel="handleCancel">
|
|
|
+ <a-modal :title="modalTitle" :width="900" :visible="visible" :confirmLoading="confirmLoading" class="ant-modal2"
|
|
|
+ @cancel="handleCancel">
|
|
|
<a-form :form="form">
|
|
|
|
|
|
<a-form-item v-show="false">
|
|
|
@@ -10,13 +11,20 @@
|
|
|
<row-list :col="2">
|
|
|
<row-item>
|
|
|
<a-form-item label="设备名称" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-input style="width: 70%" disabled v-decorator="['sbName', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
|
|
|
+ <a-input style="width: 70%" disabled
|
|
|
+ v-decorator="['sbName', { rules: [{ required: true, message: '设备名称不能为空' }] }]" />
|
|
|
<a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
|
<a-form-item label="使用位置" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-input v-decorator="['sbCph', {rules: [{required: true, message: '设备使用位置不能为空'}]}]" />
|
|
|
+ <!-- <a-input v-decorator="['sbCph', { rules: [{ required: true, message: '设备使用位置不能为空' }] }]" /> -->
|
|
|
+ <a-tree-select style="width: 100%" :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
+ :treeData="sbPositionData" :replaceFields="{
|
|
|
+ value: 'title', title: 'title', key: 'id'
|
|
|
+ }" :treeNodeFilterProp="'title'" :showSearch="true"
|
|
|
+ v-decorator="['sbCph', { rules: [{ required: true, message: '设备使用位置不能为空' }] }]" placeholder="请选择">
|
|
|
+ </a-tree-select>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<!-- <row-item>
|
|
|
@@ -29,15 +37,18 @@
|
|
|
</row-item> -->
|
|
|
<row-item>
|
|
|
<a-form-item label="是否停机" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-select v-decorator="['needStop', {rules: [{required: true, message: '是否停机不能为空'}]}]" placeholder="请选择">
|
|
|
- <a-select-option v-for="(label,value) in needStopMap" :key="value" :label="label" :value="parseInt(value)">{{ label }}
|
|
|
+ <a-select v-decorator="['needStop', { rules: [{ required: true, message: '是否停机不能为空' }] }]"
|
|
|
+ placeholder="请选择">
|
|
|
+ <a-select-option v-for="(label, value) in needStopMap" :key="value" :label="label"
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item v-show="category === 1">
|
|
|
<a-form-item label="要求日期" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-date-picker style="width: 100%" :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN" v-decorator="['limitDate']" />
|
|
|
+ <a-date-picker style="width: 100%" :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
|
+ v-decorator="['limitDate']" />
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item v-show="category === 2">
|
|
|
@@ -47,7 +58,7 @@
|
|
|
</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-input disabled v-decorator="['no', { rules: [{ required: false, message: '报修单号不能为空' }] }]" />
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<!-- <row-item>
|
|
|
@@ -68,7 +79,8 @@
|
|
|
</row-item>-->
|
|
|
<row-item>
|
|
|
<a-form-item label="报修人" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-input v-decorator="['actualUser', {initialValue: userInfo.realName, rules: [{required: true, message: '报修人不能为空'}]}]" />
|
|
|
+ <a-input
|
|
|
+ v-decorator="['actualUser', { initialValue: userInfo.realName, rules: [{ required: true, message: '报修人不能为空' }] }]" />
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<!-- <row-item>
|
|
|
@@ -107,7 +119,9 @@
|
|
|
</row-item>-->
|
|
|
<row-item>
|
|
|
<a-form-item label="报修图片" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-upload :action="uploadUrl" :multiple="true" list-type="picture" :file-list="this.defaultApplicationFileList" @change="handleApplicationFileChange" accept="image/*" :headers="headers">
|
|
|
+ <a-upload :action="uploadUrl" :multiple="true" list-type="picture"
|
|
|
+ :file-list="this.defaultApplicationFileList" @change="handleApplicationFileChange" accept="image/*"
|
|
|
+ :headers="headers">
|
|
|
<a-button> <a-icon type="upload" /> 上传图片 </a-button>
|
|
|
</a-upload>
|
|
|
</a-form-item>
|
|
|
@@ -117,8 +131,11 @@
|
|
|
<row-list :col="1">
|
|
|
<row-item v-if="false">
|
|
|
<a-form-item label="报修状态" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-select disabled v-decorator="['status', {initialValue: DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED,rules: [{required: true, message: '报修状态不能为空'}]}]" placeholder="请选择">
|
|
|
- <a-select-option v-for="(label,value) in statusMap" :key="value" :label="label" :value="parseInt(value)">{{ label }}
|
|
|
+ <a-select disabled
|
|
|
+ v-decorator="['status', { initialValue: DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED, rules: [{ required: true, message: '报修状态不能为空' }] }]"
|
|
|
+ placeholder="请选择">
|
|
|
+ <a-select-option v-for="(label, value) in statusMap" :key="value" :label="label"
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
@@ -142,7 +159,7 @@
|
|
|
</row-item>-->
|
|
|
<row-item>
|
|
|
<a-form-item label="故障描述" :labelCol="BaseTool.Constant.labelCol2" :wrapperCol="BaseTool.Constant.wrapperCol2">
|
|
|
- <a-textarea :rows="4" v-decorator="['content', {rules: [{required: true, message: '故障描述不能为空'}]}]" />
|
|
|
+ <a-textarea :rows="4" v-decorator="['content', { rules: [{ required: true, message: '故障描述不能为空' }] }]" />
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
</row-list>
|
|
|
@@ -166,6 +183,7 @@ import { uploadUrl } from '@/api/upms/file'
|
|
|
import Vue from 'vue'
|
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
|
import { fetchErrorTypeTree } from '@/api/repair/errortype'
|
|
|
+import { getSbPositionTree } from '@/api/sb/position'
|
|
|
|
|
|
export default {
|
|
|
name: 'BaseRepairApplicationForm',
|
|
|
@@ -181,6 +199,7 @@ export default {
|
|
|
questionMap: {},
|
|
|
treeData: [],
|
|
|
needStop: null,
|
|
|
+ sbPositionData: [],
|
|
|
needStopMap: {},
|
|
|
category: 0,
|
|
|
categoryMap: {},
|
|
|
@@ -220,6 +239,9 @@ export default {
|
|
|
fetchErrorTypeTree().then((res) => {
|
|
|
this.treeData = res.data
|
|
|
})
|
|
|
+ getSbPositionTree().then(res => {
|
|
|
+ this.sbPositionData = res.data
|
|
|
+ })
|
|
|
// 如果是空标识添加
|
|
|
if (this.BaseTool.Object.isBlank(record)) {
|
|
|
this.modalTitle = '添加'
|