Bläddra i källkod

Merge remote-tracking branch 'origin/demo_' into demo_

hfxc226 2 år sedan
förälder
incheckning
ab96d27b44

+ 13 - 1
src/api/repair/application-form.js

@@ -153,7 +153,19 @@ export function changeApplicationForm (parameter) {
     data: parameter
   })
 }
-
+/**
+ * finish func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function changeEditForm (parameter) {
+  return axios({
+    url: '/repair/application-forms/edit/error/info',
+    method: 'PUT',
+    data: parameter
+  })
+}
 /**
  * finish func
  * parameter: { }

+ 20 - 11
src/views/repair/application-form/modules/BaseForm.vue

@@ -38,7 +38,7 @@
             <a-input v-decorator="['parentSbNo']" />
           </a-form-item>
         </row-item>
-<!--        <row-item>
+        <!--        <row-item>
           <a-form-item
             label="设备部位"
             :labelCol="BaseTool.Constant.labelCol"
@@ -73,7 +73,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select @change="changePlanFlag" v-decorator="['repairProfessor', {rules: [{required: true, message: '检修专业不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['repairProfessor', {rules: [{required: true, message: '检修专业不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in professorMap"
                 :key="value"
@@ -89,14 +89,18 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select @change="changePlanFlag" v-decorator="['repairType', {rules: [{required: true, message: '工作类型不能为空'}]}]" placeholder="请选择">
-              <a-select-option
+            <a-tree-select
+              tree-checkable
+              :show-checked-strategy="SHOW_PARENT"
+              v-decorator="['repairType', {rules: [{required: true, message: '工作类型不能为空'}]}]"
+              placeholder="请选择">
+              <a-tree-select-node
                 v-for="(label,value) in repairTypeMap"
                 :key="value"
-                :label="label"
+                :title="label"
                 :value="parseInt(value)">{{ label }}
-              </a-select-option>
-            </a-select>
+              </a-tree-select-node>
+            </a-tree-select>
           </a-form-item>
         </row-item>
         <row-item>
@@ -105,7 +109,8 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-input placeholder='比如:甲七车间北侧'
+            <a-input
+              placeholder="比如:甲七车间北侧"
               v-decorator="['sbCph']" />
           </a-form-item>
         </row-item>
@@ -115,7 +120,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select @change="changePlanFlag" v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in categoryMap"
                 :key="value"
@@ -308,11 +313,13 @@ import { uploadUrl } from '@/api/upms/file'
 import Vue from 'vue'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
 import { fetchErrorTypeTree } from '@/api/repair/errortype'
-
+import { TreeSelect } from 'ant-design-vue'
+const SHOW_PARENT = TreeSelect.SHOW_PARENT
 export default {
   name: 'BaseRepairApplicationForm',
   data () {
     return {
+      SHOW_PARENT,
       confirmLoading: false,
       modalTitle: null,
       professorMap: {},
@@ -463,6 +470,7 @@ export default {
         values.limitDate = BaseTool.Date.formatter(values.limitDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         // 上传文件
         values.repairFileList = this.repairFileList
+        values.repairType = values.repairType.join(',')
         values.applicationFileList = this.applicationFileList
         values.checkFileList = this.checkFileList
         if (values.partId === undefined) {
@@ -525,7 +533,8 @@ export default {
         setFieldsValue(Object.assign({
           'sbId': key,
           'sbName': row.name,
-          'sbCph': row.cph
+          'sbCph': row.cph,
+          'parentSbNo': row.ppNo
         }))
       })
     },

+ 7 - 3
src/views/repair/application-form/modules/DetailRepair.vue

@@ -87,7 +87,7 @@
               <a-descriptions-item label="要求时间">{{ model.limitHours }}小时</a-descriptions-item>
               <a-descriptions-item label="送修部门">{{ model.name }}</a-descriptions-item>
               <a-descriptions-item label="维修工程师" >{{ model.checkUserName }}</a-descriptions-item>
-              <a-descriptions-item label="故障描述" :span="3"> <span v-html="model.content "></span> </a-descriptions-item>
+              <a-descriptions-item label="故障描述" :span="3"> <span v-html="model.content "></span><a-divider type="vertical" /><a @click="handleEdit(model)">编辑</a> </a-descriptions-item>
               <a-descriptions-item label="报修图片" :span="3">
                 <div v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
                   <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1" >
@@ -298,7 +298,7 @@
     <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
     <base-form ref="baseRepairProjectModal" @ok="handleOk"/>
     <detail ref="detailRepairProjectModal"/>
-    <edit-form ref="editForm" @ok="handleOk" />
+    <edit-form ref="editForm" @okEdit="handleOk" />
     <resolve-base-form ref="resolveBaseForm" @ok="handleResolveOk"/>
     <resolve-detail ref="resolveDetail" @ok="handleResolveOk"/>
     <detail-repair-record ref="detailRepairRecord" @ok="handleRepairRecordOk"/>
@@ -319,7 +319,7 @@ import { fetchRepairApplicationForm, approve, receive, receiveRepair } from '@/a
 import CheckForm from './CheckForm'
 import BaseOutForm from './BaseOutForm'
 import FinishForm from './FinishForm'
-import EditForm from './EditForm'
+import EditForm from './RemarkForm'
 import DispatchForm from './DispatchForm'
 import AssignForm from './AssignForm'
 import SchemeLibrary from './SchemeLibrary'
@@ -1080,6 +1080,10 @@ export default {
       })
       this.init()
     },
+    okEdit (val) {
+      this.loading = true
+      this.model.content = val
+    },
     handleResolveOk () {
       this.loading = true
       this.visible = true

+ 72 - 0
src/views/repair/application-form/modules/RemarkForm.vue

@@ -0,0 +1,72 @@
+<template>
+  <a-modal
+    title="编辑"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-form >
+      <a-form-item
+        label="故障描述"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol">
+        <a-textarea
+          v-model="content"
+          placeholder="请输入内容!"
+        />
+      </a-form-item>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import { changeEditForm } from '@/api/repair/application-form'
+
+export default {
+  name: 'BaseRepairApplicationForm',
+  data () {
+    return {
+      model: null,
+      confirmLoading: false,
+      visible: false,
+      content: ''
+    }
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      this.content = record.content
+    },
+    save () {
+      if (this.content === '' || this.content == null) {
+        this.$message.error('请填写故障描述!')
+        return
+      }
+      changeEditForm({
+        id: this.model.id,
+        content: this.content
+      }).then(() => {
+        this.$message.info('故障描述已修改!')
+        this.handleCancel(this.model.content)
+      }).catch(() => {
+        this.confirmLoading = false
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok', values)
+    }
+
+  }
+}
+</script>

+ 49 - 33
src/views/repair/application-form/modules/TicketForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="main" v-show='visible'>
+  <div class="main" v-show="visible">
     <div>
       <a-button type="primary" v-print="'#print-container2'" :disabled="disabled">打印</a-button>
       <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
@@ -78,7 +78,7 @@
             <td colspan="3">工作优选权</td>
             <td colspan="27">
               {{ model.requireHours }}小时
-<!--              <a-radio-group v-model="value3">
+              <!--              <a-radio-group v-model="value3">
                 <a-radio :value="1">
                   <a-icon class="check" v-show="value3 ==1" type="check" />紧急
                 </a-radio>
@@ -103,35 +103,51 @@
           <tr>
             <td colspan="3">工作类型</td>
             <td colspan="27" >
-              <a-radio-group v-model="value4">
-                <a-radio :value="1">
-                  <a-icon class="check" v-show="value4 ==1" type="check" /><span style='font-size: 13px;'>普通作业</span>
-                </a-radio>
-                <a-radio :value="2">
-                  <a-icon class="check" v-show="value4 ==2" type="check" /><span style='font-size: 13px;'>动火作业</span>
-                </a-radio>
-                <a-radio :value="3">
-                  <a-icon class="check" v-show="value4 ==3" type="check" /><span style='font-size: 13px;'>受限空间作业</span>
-                </a-radio>
-                <a-radio :value="4">
-                  <a-icon class="check" v-show="value4 ==4" type="check" /><span style='font-size: 13px;'>高处作业</span>
-                </a-radio>
-                <a-radio :value="5">
-                  <a-icon class="check" v-show="value4 ==5" type="check" /><span style='font-size: 13px;'>吊装作业</span>
-                </a-radio>
-                <a-radio :value="6">
-                  <a-icon class="check" v-show="value4 ==6" type="check" /><span style='font-size: 13px;'>动土作业</span>
-                </a-radio>
-                <a-radio :value="7">
-                  <a-icon class="check" v-show="value4 ==7" type="check" /><span style='font-size: 13px;'>断路作业</span>
-                </a-radio>
-                <a-radio :value="8">
-                  <a-icon class="check" v-show="value4 ==8" type="check" /><span style='font-size: 13px;'>设备检修作业</span>
-                </a-radio>
-                <a-radio :value="9">
-                  <a-icon class="check" v-show="value4 ==9" type="check" /><span style='font-size: 13px;'>盲板抽堵作业</span>
-                </a-radio>
-              </a-radio-group></td>
+              <a-checkbox-group v-model="value4" @change="onChange">
+                <a-checkbox :value="1">
+                  <span style="position:relative">
+                    <a-icon class="checks" v-show="value4.includes(1)" type="check" /><span style="font-size: 13px;">普通作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="2">
+                  <span style="position:relative">
+                    <a-icon class="checks" v-show="value4.includes(2)" type="check" /><span style="font-size: 13px;">动火作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="3">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(3)" type="check" /><span style="font-size: 13px;">受限空间作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="4">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(4)" type="check" /><span style="font-size: 13px;">高处作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="5">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(5)" type="check" /><span style="font-size: 13px;">吊装作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="6">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(6)" type="check" /><span style="font-size: 13px;">动土作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="7">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(7)" type="check" /><span style="font-size: 13px;">断路作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="8">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(8)" type="check" /><span style="font-size: 13px;">设备检修作业</span>
+                  </span></a-checkbox>
+                <a-checkbox :value="9">
+                  <span style="position:relative">
+
+                    <a-icon class="checks" v-show="value4.includes(9)" type="check" /><span style="font-size: 13px;">盲板抽堵作业</span>
+                  </span></a-checkbox>
+              </a-checkbox-group></td>
           </tr>
           <tr>
             <td colspan="3">设备位号</td>
@@ -146,7 +162,7 @@
             <td colspan="14" >
               <div>
                 1、委托内容描述:<br/>
-                <a-textarea v-model="value5" disabled='disabled' style="resize:none;border:none;" :rows="4"/>
+                <a-textarea v-model="value5" disabled="disabled" style="resize:none;border:none;" :rows="4"/>
               </div>
             </td>
             <td colspan="1" rowspan="11" style="width: 10px;">检<br/>维<br/>修<br/>单<br/>位<br/>填<br/>写</td>
@@ -243,7 +259,7 @@ export default {
       value1: 1,
       value2: null,
       value3: null,
-      value4: null,
+      value4: [],
       value5: null,
       value6: null,
       value7: null,