瀏覽代碼

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

hfxc226 2 年之前
父節點
當前提交
dc6f1abf25

+ 21 - 3
src/views/fill/gather/modules/SbInfoSelectModal.vue

@@ -16,6 +16,20 @@
                 <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/编码"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备类型">
+                <a-tree-select
+                  style="width: 100%"
+                  :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                  :treeData="treeData"
+                  :treeNodeFilterProp="'title'"
+                  :showSearch="true"
+                  v-model="queryParam.typeId"
+                  placeholder="请选择"
+                >
+                </a-tree-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="8 || 24" :sm="24">
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
@@ -55,8 +69,9 @@
 
 <script>
 import { STable, Ellipsis } from '@/components'
-import { getSbInfoPage, getSbInfoTree } from '@/api/sb/info'
-
+import { getSbInfoPage } from '@/api/sb/info'
+import { queryDept } from '@/api/upms/dept'
+import { fetchSbTypeTree } from '@/api/sb/type'
 export default {
   name: 'SbInfoSelectModal',
   components: {
@@ -252,7 +267,10 @@ export default {
      * 设置设备类型树
      */
     setTree (record = {}) {
-      getSbInfoTree({ id: record.id }).then(res => {
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+      fetchSbTypeTree().then(res => {
         this.treeData = res.data
       })
     },

+ 103 - 13
src/views/fill/task/modules/BaseForm.vue

@@ -83,6 +83,7 @@
               <th rowspan="2" width="150px">填报时间</th>
               <th :colspan="ListForm.length>0?ListForm[0].content.length:1">项目内容项</th>
               <th rowspan="2" width="150px">是否填报</th>
+              <th rowspan="2" width="150px" v-if="editor">操作</th>
             </tr>
             <tr v-if="ListForm.length>0">
               <th v-for="item in ListForm[0].content" :key="item.name">{{ item.name }}</th>
@@ -108,6 +109,34 @@
               <td>
                 <a-icon v-show="item.status === 1" type="check" style="color:#87d068;font-size: 26px;" />
               </td>
+              <td v-if="editor">
+                <a-button type="link" @click="handleRepair(item)">
+                  报修
+                </a-button>
+                <a-button type="link" @click="uploadVisible = true">上传图片 </a-button>
+
+                <a-modal v-model="uploadVisible" title="上传图片" @cancel="uploadVisible = false">
+                  <a-upload
+                    :action="uploadUrl"
+                    list-type="picture-card"
+                    :file-list="defaultApplicationFileList"
+                    @change="handleApplicationFileChange"
+                    @preview="handlePreview"
+                    accept="image/*"
+                    :headers="headers"
+                  >
+                    <div>
+                      <a-icon type="plus" />
+                      <div class="ant-upload-text">
+                        Upload
+                      </div>
+                    </div>
+                  </a-upload>
+                </a-modal>
+                <a-modal :visible="previewVisible" :footer="null" @cancel="previewVisible = false" @ok="previewVisible = false">
+                  <img alt="example" style="width: 100%" :src="previewImage" />
+                </a-modal>
+              </td>
             </tr>
           </tbody>
         </table>
@@ -138,7 +167,7 @@
     <overtime-form ref="overtimeModal" @ok="handleOk" />
     <pause-form ref="pauseModal" @ok="handleOk" />
     <verify-form ref="verifyModal" @ok="handleOk" />
-
+    <base-form-repair ref="baseFormRepairModal" @ok="handleOk" />
   </a-card>
 </template>
 
@@ -146,8 +175,13 @@
 import { fillGatherTask, getFillGatherTask, getFillUpdates, pauseFillGatherTask } from '@/api/fill/task'
 import DispatchForm from './DispatchForm'
 import OvertimeForm from './OvertimeForm'
+import BaseFormRepair from './BaseFormRepair'
+
 import PauseForm from './PauseForm'
 import VerifyForm from './VerifyForm'
+import { uploadUrl } from '@/api/upms/file'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 export default {
   name: 'BaseFillGatherTask',
@@ -155,12 +189,23 @@ export default {
     PauseForm,
     VerifyForm,
     DispatchForm,
+    BaseFormRepair,
     OvertimeForm
   },
   data () {
     return {
+      uploadUrl: uploadUrl,
+      defaultApplicationFileList: [
+      ],
+      applicationFileList: [],
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      },
       confirmLoading: false,
       visible: false,
+      uploadVisible: false,
+      previewVisible: false,
+      previewImage: '',
       model: {},
       listPage: {
         pageNum: 1,
@@ -264,6 +309,57 @@ export default {
       })
       console.log(this.ListForm)
     },
+    handleRepair (val) {
+      const data = {
+        sbId: val.sbId,
+        sbName: val.sbName,
+        sbCph: val.positionName,
+        applicationFileList: this.applicationFileList,
+        defaultApplicationFileList: this.defaultApplicationFileList,
+        treeData: val.content.map((item) => {
+          return {
+            title: item.name + ':' + item.fillValue,
+            value: item.name + ':' + item.fillValue,
+            key: item.name + ':' + item.fillValue
+          }
+        })
+      }
+      console.log(data)
+
+      const modal = this.$refs.baseFormRepairModal
+      modal.base(data)
+    },
+    getBase64 (file) {
+      return new Promise((resolve, reject) => {
+        const reader = new FileReader()
+        reader.readAsDataURL(file)
+        reader.onload = () => resolve(reader.result)
+        reader.onerror = error => reject(error)
+      })
+    },
+    async handlePreview (file) {
+      if (!file.url && !file.preview) {
+        file.preview = await this.getBase64(file.originFileObj)
+      }
+      this.previewImage = file.url || file.preview
+      this.previewVisible = true
+    },
+    handleApplicationFileChange (info) {
+      this.defaultApplicationFileList = info.fileList
+      this.applicationFileList = this.setFileList(info, 11)
+    },
+    setFileList (info, type) {
+      const file = info.file
+      const fileList = info.fileList
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return []
+      }
+    },
     handleDispatch (record) {
       this.visible = false
       const modal = this.$refs.dispatchModal
@@ -279,16 +375,9 @@ export default {
       modal.base(record)
     },
     handlePause (record) {
-      if (record.status === 5) {
-        this.visible = false
-        const modal = this.$refs.pauseModal
-        modal.base(record)
-        return
-      }
-      pauseFillGatherTask({ pauseType: 1, id: record.id }).then(res => {
-        this.$message.success('暂停成功!')
-        this.getFillUpdates()
-      })
+      this.visible = false
+      const modal = this.$refs.pauseModal
+      modal.base(record)
     },
     getFillUpdates () {
       const params = {
@@ -324,7 +413,9 @@ export default {
       })
       const params = {
         id: this.id,
-        details: detail
+        details: detail,
+        applicationFileList: this.applicationFileList
+
       }
       fillGatherTask(params).then(res => {
         console.log(res)
@@ -336,7 +427,6 @@ export default {
     },
     handleOk () {
       this.visible = true
-      this.getFillUpdates()
     },
     handleCancel () {
       this.visible = false

+ 534 - 0
src/views/fill/task/modules/BaseFormRepair.vue

@@ -0,0 +1,534 @@
+<template>
+  <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" >
+        <a-input v-decorator="['sbId']" type="hidden"/>
+        <a-input v-decorator="['partId']" type="hidden"/>
+      </a-form-item>
+      <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-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
+              style="width: 70%"
+              disabled
+              v-decorator="['partName']" />
+            <a-button style="width: 30%" type="primary" @click="handlePartSelect">选择</a-button>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="送修部门"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['repairDeptId', {rules: [{required: true, message: '维修部门不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in repairDeptMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
+          </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-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="工单类别"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="changePlanFlag" v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in categoryMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </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-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-form-item>
+        </row-item>
+        <row-item v-show="category === 2">
+          <a-form-item
+            label="要求时间"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 100%"
+              suffix="小时"
+              v-decorator="['limitHours']" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="报修人"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled="disabled"
+              v-decorator="['actualUser', {initialValue: userInfo.realName, rules: [{required: true, message: '报修人不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+        <!--        <row-item>
+          <a-form-item
+            label="紧急等级"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['level', {initialValue: 1, 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>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="异常类别"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-tree-select
+              style="width: 100%"
+              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+              :treeData="treeData"
+              :treeNodeFilterProp="'title'"
+              :showSearch="true"
+              v-decorator="['repairErrorTypeId']"
+              placeholder="请选择"
+            >
+            </a-tree-select>
+          </a-form-item>
+        </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-button> <a-icon type="upload" /> 上传图片 </a-button>
+            </a-upload>
+          </a-form-item>
+        </row-item>
+        <row-item v-show="refusedFlag">
+          <a-form-item
+            label="驳回原因"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled="disabled"
+              v-decorator="['remark']"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+
+      <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-option>
+            </a-select>
+          </a-form-item>
+        </row-item> -->
+
+        <!--        <row-item>
+          <a-form-item
+            label="故障描述"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-select v-decorator="['content']" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in questionMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </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-tree-select
+              v-decorator="['content', {rules: [{required: true, message: '故障描述不能为空'}]}]"
+              style="width: 100%"
+              :tree-data="treeData"
+              tree-checkable
+              search-placeholder="Please select"
+            />
+          </a-form-item>
+          <a-form-item
+            label="补充说明"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-model="content"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+    <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+    <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import BaseTool from '../../../../utils/tool'
+import { addRepairApplicationForm, updateRepairApplicationForm } from '@/api/repair/application-form'
+import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+import { queryUser } from '@/api/upms/user'
+import { uploadUrl } from '@/api/upms/file'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { TreeSelect } from 'ant-design-vue'
+const SHOW_PARENT = TreeSelect.SHOW_PARENT
+
+export default {
+  name: 'BaseRepairApplicationForm',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      sbId: null,
+      content: '',
+      // 下拉框map
+      sourceMap: {},
+      SHOW_PARENT: SHOW_PARENT,
+      levelMap: {},
+      questionMap: {},
+      treeData: [],
+      needStop: null,
+      needStopMap: {},
+      category: 0,
+      categoryMap: {},
+      statusMap: {},
+      userInfo: this.$store.getters.userInfo,
+      userList: [],
+      uploadUrl: uploadUrl,
+      defaultRepairFileList: [],
+      defaultApplicationFileList: [],
+      defaultCheckFileList: [],
+      applicationFileList: [], // 报修图片
+      checkFileList: [], // 审核图片
+      repairFileList: [], // 维修图片,
+      repairDeptMap: {},
+      refusedFlag: false,
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      }
+    }
+  },
+  components: {
+    SbInfoSelectModal,
+    PartInfoSelectModal
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+    this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
+    this.questionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
+    this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
+    this.getUsers()
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.refusedFlag = false
+      this.sbId = record.sbId
+      this.treeData = record.treeData
+      this.applicationFileList = record.applicationFileList
+      this.defaultApplicationFileList = record.defaultApplicationFileList
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '报修'
+        if (!this.BaseTool.Object.isBlank(record) && !this.BaseTool.Object.isBlank(record.sbId)) {
+          const { form: { setFieldsValue } } = this
+          this.$nextTick(() => {
+            setFieldsValue(Object.assign(pick(record, [
+              'sbId',
+              'sbName'
+            ])))
+          })
+        }
+        return
+      }
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        this.modalTitle = '报修'
+        if (!this.BaseTool.Object.isBlank(record.sbId)) {
+          const { form: { setFieldsValue } } = this
+          this.$nextTick(() => {
+            setFieldsValue(Object.assign(pick(record, [
+              'sbId',
+              'sbName',
+              'sbCph'
+            ])))
+          })
+        }
+        return
+      }
+      this.modalTitle = '编辑'
+      this.applicationFileList = record.applicationFileList
+      this.repairFileList = record.repairFileList
+      this.checkFileList = record.checkFileList
+      this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(this.applicationFileList)
+      this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
+      this.defaultCheckFileList = this.BaseTool.UPLOAD.transImg(this.checkFileList)
+      if (record.status === this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REFUSED_REPAIR) {
+        this.refusedFlag = true
+      }
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      record.applyTime = this.BaseTool.Moment(record.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      if (record.limitDate != null) {
+        record.limitDate = this.BaseTool.Moment(record.limitDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'limitDate'
+          ])))
+        })
+      }
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'sbId',
+          'sbCph',
+          'partId',
+          'repairUserId',
+          'no',
+          'category',
+          'limitDate',
+          'limitHours',
+          'source',
+          'level',
+          'content',
+          'status',
+          'sbName',
+          'needStop',
+          'category',
+          'partName',
+          'remark',
+          'repairDeptId'
+        ])))
+      })
+    },
+    getUsers () {
+      queryUser({ status: 1 }).then(res => {
+        this.userList = res.data
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      // this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        values.applyTime = this.BaseTool.Date.formatter(values.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+        values.limitDate = BaseTool.Date.formatter(values.limitDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        // 上传文件
+        values.repairFileList = this.repairFileList
+        values.applicationFileList = this.applicationFileList
+        values.checkFileList = this.checkFileList
+        values.content = values.content.join('<br />') + '<br />' + this.content
+        if (values.partId === undefined) {
+          values.partId = ''
+        }
+        console.log(values)
+        addRepairApplicationForm(values)
+          .then(() => {
+            this.$notification.success({
+              message: '报修成功!',
+              duration: 3
+            })
+            this.handleCancel(values)
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+      })
+    },
+    changePlanFlag (value) {
+      this.category = value
+      const { form: { setFieldsValue } } = this
+      if (this.category === 1) {
+        this.$nextTick(() => {
+          setFieldsValue({ needStop: 1 })
+        })
+      } else {
+        this.$nextTick(() => {
+          setFieldsValue({ needStop: 0 })
+        })
+      }
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.applicationFileList = []
+      this.defaultApplicationFileList = []
+      this.form.resetFields()
+      this.content = ''
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base({}, {})
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      this.sbId = key
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'sbId': key,
+          'sbName': row.name,
+          'sbCph': row.cph
+        }))
+      })
+    },
+    handlePartSelect () {
+      if (this.sbId === null) {
+        return this.$message.error('选择设备部位之前,请选择设备')
+      }
+      this.$refs.partInfoSelectModal.base({ sbId: this.sbId })
+    },
+    handlePartSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'partId': key,
+          'partName': row.name
+        }))
+      })
+    },
+    handleApplicationFileChange (info) {
+      this.defaultApplicationFileList = info.fileList
+      this.applicationFileList = this.setFileList(info, 11)
+    },
+    setFileList (info, type) {
+      const file = info.file
+      const fileList = info.fileList
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return []
+      }
+    }
+  }
+}
+</script>

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

@@ -84,7 +84,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">{{ model.content }}</a-descriptions-item>
+              <a-descriptions-item label="故障描述" :span="3"> <span v-html="model.content "></span> </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" >
@@ -153,7 +153,7 @@
               <a-icon type="plus"/>
               更换常用备件
             </a-button>
-<!--            <a-divider type="vertical" />
+            <!--            <a-divider type="vertical" />
             <a-button type="primary" @click="handleAddSpare()">
               <a-icon type="plus"/>
               添加专用备件
@@ -296,11 +296,11 @@
     <resolve-detail ref="resolveDetail" @ok="handleResolveOk"/>
     <detail-repair-record ref="detailRepairRecord" @ok="handleRepairRecordOk"/>
     <transfer-form ref="transferForm" @ok="handleOk"/>
-    <detail-check-new ref='detailCheckNew' @ok='handleVerifyRecordOk'/>
-    <repair-record-form ref='repairRecordForm' @ok='handleRepairRecordOk' />
-    <report-up-form ref='reportUpForm' @ok='handleOk' @okk='handleCancel' />
-    <ticket-form ref='ticketForm' @ok='handleOk' />
-    <longYanSelectSpareForm ref='longYanSelectSpareForm' @ok="handleOk"/>
+    <detail-check-new ref="detailCheckNew" @ok="handleVerifyRecordOk"/>
+    <repair-record-form ref="repairRecordForm" @ok="handleRepairRecordOk" />
+    <report-up-form ref="reportUpForm" @ok="handleOk" @okk="handleCancel" />
+    <ticket-form ref="ticketForm" @ok="handleOk" />
+    <longYanSelectSpareForm ref="longYanSelectSpareForm" @ok="handleOk"/>
   </div>
 </template>
 
@@ -483,7 +483,7 @@ export default {
           width: '200px',
           align: 'center',
           scopedSlots: { customRender: 'actionSpare' }
-        }*/
+        } */
       ],
       columnsFee: [
         {