zenglf
2023-10-23 9676e09a8fa76483b27dd2f17dd7d9dbef8eac56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="任务编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskNum">
              <a-input v-model="model.taskNum"placeholder="请输入任务编码" disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentNum">
              <a-input v-model="model.equipmentNum"placeholder="请输入设备编码" disabled></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
            <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="资产编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetNumber">
              <a-input v-model="model.assetNumber"placeholder="请输入资产编码" disabled></a-input>
            </a-form-model-item>
          </a-col>
          <!-- <a-col :span="12">
            <a-form-model-item label="特种设备(是、否)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specificEquipment">
              <j-dict-select-tag type="list" v-model="model.specificEquipment" dictCode="" placeholder="请选择特种设备(是、否)" disabled/>
            </a-form-model-item>
          </a-col> -->
            </a-row>
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentName">
              <a-input v-model="model.equipmentName"placeholder="请输入设备名称" disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
              <a-input v-model="model.model"placeholder="请输入设备型号" disabled></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
 
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="设备规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specification">
              <a-input v-model="model.specification"placeholder="请输入设备规格" disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentStatus">
              <j-dict-select-tag type="list" v-model="model.equipmentStatus" dictCode="equipment_status" placeholder="请选择设备状态" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="技术状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologyStatus">
              <j-dict-select-tag type="list" v-model="model.technologyStatus" dictCode="technology_status" placeholder="请选择技术状态" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="外委单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplierId">
              <a-input v-model="model.supplierId"placeholder="请输入外委单位" disabled></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
<!--          <a-col :span="24">
            <a-form-model-item label="维保方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentImportanceId">
              <j-dict-select-tag type="list" v-model="model.maintenanceMode" dictCode="mom_eam_equipment_importance,name,id" placeholder="请选择重要度" disabled/>
            </a-form-model-item>
          </a-col>-->
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="项目内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sealReason">
              <a-input v-model="model.itemName"placeholder="请输入项目内容" disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="紧急程序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="urgencyDegree">
              <j-dict-select-tag type="list" v-model="model.urgencyDegree" dictCode="urgency_degree" placeholder="请选择紧急程序" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="责任班组" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamId">
              <j-dict-select-tag type="list" v-model="model.teamId" dictCode="mom_base_team,name,id" placeholder="请选择责任班组" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
 
              <j-dict-select-tag type="list" v-model="model.userId" dictCode="sys_user,realname,id" placeholder="请选择责任人" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="计划开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planStartTime">
              <j-date placeholder="请选择计划开始时间" v-model="model.planStartTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="计划结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planEndTime">
              <j-date placeholder="请选择计划结束时间" v-model="model.planEndTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :span='24'>
          <a-col :span="12">
            <a-form-model-item label="实际开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualStartTime">
              <j-date placeholder="请选择实际开始时间" v-model="model.actualStartTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="实际完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualEndTime">
              <j-date placeholder="请选择实际完成时间" v-model="model.actualEndTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
 
<script>
 
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
 
  export default {
    name: "ProjectMaintenanceOrderDetailModal",
    components: {
    },
    props:{
      mainId:{
        type:String,
        required:false,
        default:''
      }
    },
    data () {
      return {
        title:"操作",
        width:800,
        visible: false,
        model:{
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
 
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/eam/projectMaintenanceOrder/addProjectMaintenanceOrderDetail",
          edit: "/eam/projectMaintenanceOrder/editProjectMaintenanceOrderDetail",
        }
 
      }
    },
    created () {
    //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            this.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            this.model['projectMaintenanceOrderId'] = this.mainId
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                this.$message.success(res.message);
                this.$emit('ok');
 
              }else{
                this.$message.warning(res.message);
              }
            }).finally(() => {
              this.confirmLoading = false;
              this.close();
            })
          }else{
             return false
          }
        })
      },
      handleCancel () {
        this.close()
      },
 
 
    }
  }
</script>