Jelajahi Sumber

feat(repair): 优化维修工单相关功能及界面交互

- 在CheckJob.vue中添加实际工时和实际结束时间列的排序功能
- 在BaseForm.vue中完善保养项字典加载后的列表刷新逻辑,增强数据一致性
- 修复保养项为空时的保存校验,提示至少选择一个保养项
- 在RepairForm.vue中增加部门筛选项,实现按部门过滤工单
- 优化RepairForm.vue中表格和按钮的布局及格式,增强界面美观性和可用性
- 新增部门列表数据接口调用及用户部门默认筛选功能
- 调整RepairForm.vue中部分方法命名和代码风格,提升代码规范性
- 修正BaseForm.vue和FinishForm.vue中选择框和输入框标签格式,使代码风格统一
- 在Detail.vue中优化报修单详情展示,调整部分字段显示和格式
- 重构FinishForm.vue中表单结构及验证规则,提升用户体验
- 修正多处组件的props和方法定义格式,统一代码书写规范
- 清理无效注释和多余代码,提升代码清晰度和可维护性
408249787@qq.com 1 hari lalu
induk
melakukan
8597d1447e

+ 8 - 2
src/views/check/checkjob/CheckJob.vue

@@ -355,13 +355,19 @@ export default {
           title: '实际工时',
           dataIndex: 'realHours',
           checked: true,
-          width: '200px'
+          width: '200px',
+          sorter: (a, b) => (Number(a.realHours) || 0) - (Number(b.realHours) || 0)
         },
         {
           title: '实际结束时间',
           dataIndex: 'actualEndTime',
           checked: true,
-          width: '200px'
+          width: '200px',
+          sorter: (a, b) => {
+            if (!a.actualEndTime) return -1
+            if (!b.actualEndTime) return 1
+            return new Date(a.actualEndTime) - new Date(b.actualEndTime)
+          }
         },
         {
           title: '计划执行日期',

+ 28 - 8
src/views/check/checkstandard/modules/BaseForm.vue

@@ -464,6 +464,17 @@ export default {
       })
       queryCheckDetail().then((res) => {
         this.checkDetailList = res.data
+        // 字典加载完成后,若已选定标准类型则刷新保养项列表,避免竞态导致保养项为空无法保存
+        if (this.sbType != null) {
+          const list = this.checkDetailList[this.sbType]
+          if (list) {
+            this.requirementList = list
+            if (!this.state.selectedRows || this.state.selectedRows.length === 0) {
+              this.state.selectedRowKeys = list.map((item) => item.id)
+              this.state.selectedRows = list
+            }
+          }
+        }
       })
       // 如果是空标识添加
       if (this.BaseTool.Object.isBlank(record)) {
@@ -491,16 +502,20 @@ export default {
       // 查询列表
       fetchCheckStandard({ id: record.id }).then((res) => {
         this.data = res.data.detailList
-        this.sbType = res.data.requirementList[0].sbType
-        this.$nextTick(() => {
-          setFieldsValue({
-            sbType: this.sbType,
+        const requirementList = res.data.requirementList || []
+        this.sbType = requirementList.length > 0 ? requirementList[0].sbType : null
+        if (this.sbType != null) {
+          this.$nextTick(() => {
+            setFieldsValue({
+              sbType: this.sbType,
+            })
           })
-        })
-        this.state.selectedRowKeys = res.data.requirementList.map((item) => item.id)
-        this.state.selectedRows = res.data.requirementList
+        }
+        this.state.selectedRowKeys = requirementList.map((item) => item.id)
+        this.state.selectedRows = requirementList
 
-        this.requirementList = this.checkDetailList[this.sbType]
+        // 保养项字典未加载完成时,先回显已选保养项,避免列表空白
+        this.requirementList = (this.checkDetailList || {})[this.sbType] || requirementList
       })
 
       this.checkImgList = record.checkImgList
@@ -571,6 +586,11 @@ export default {
         values.checkImgList = this.checkImgList
         values.type = this.checkType
         values.requirementList = this.state.selectedRows
+        if (!values.requirementList || values.requirementList.length === 0) {
+          this.$message.error('请至少选择一个保养项')
+          this.confirmLoading = false
+          return
+        }
         values.checkFileList = this.checkFileList
         values.nextDate = values.nextDate
           ? this.BaseTool.Date.formatter(values.nextDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)

+ 69 - 52
src/views/repair/application-form/RepairForm.vue

@@ -6,36 +6,43 @@
           <a-row :gutter="48">
             <a-col :md="6" :sm="24">
               <a-form-item label="关键字">
-                <a-input v-model="queryParam.keyword" placeholder="请输入设备名称/设备新号"/>
+                <a-input v-model="queryParam.keyword" placeholder="请输入设备名称/设备新号" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="设备旧号">
-                <a-input v-model="queryParam.zbh" placeholder="请输入设备旧号"/>
+                <a-input v-model="queryParam.zbh" placeholder="请输入设备旧号" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="报修人">
-                <a-input v-model="queryParam.actualUser" placeholder="请输入报修人"/>
+                <a-input v-model="queryParam.actualUser" placeholder="请输入报修人" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="维修人">
-                <a-input v-model="queryParam.repairUserName" placeholder="请输入维修人"/>
+                <a-input v-model="queryParam.repairUserName" placeholder="请输入维修人" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="部门">
+                <a-select v-model="queryParam.deptId" placeholder="请选择部门" allowClear showSearch
+                  optionFilterProp="label">
+                  <a-select-option v-for="item in deptList" :key="item.deptId" :label="item.name"
+                    :value="item.deptId">{{ item.name }}
+                  </a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="问题描述">
-                <a-input v-model="queryParam.content" placeholder="问题描述模糊查询"/>
+                <a-input v-model="queryParam.content" placeholder="问题描述模糊查询" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="状态">
                 <a-select v-model="queryParam.status" placeholder="请选择">
-                  <a-select-option
-                    v-for="(label,value) in statusMap"
-                    :key="value"
-                    :label="label"
+                  <a-select-option v-for="(label, value) in statusMap" :key="value" :label="label"
                     :value="parseInt(value)">{{ label }}
                   </a-select-option>
                 </a-select>
@@ -43,20 +50,14 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="报修起始日期">
-                <a-date-picker
-                  v-model="queryParam.searchStartTime"
-                  style="width: 100%"
-                  :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-                />
+                <a-date-picker v-model="queryParam.searchStartTime" style="width: 100%"
+                  :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="报修结束日期">
-                <a-date-picker
-                  v-model="queryParam.searchEndTime"
-                  style="width: 100%"
-                  :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-                />
+                <a-date-picker v-model="queryParam.searchEndTime" style="width: 100%"
+                  :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN" />
               </a-form-item>
             </a-col>
             <a-col :md="8 || 24" :sm="24">
@@ -70,8 +71,10 @@
       </div>
 
       <div class="table-operator">
-        <a-button v-if="$auth('repair-application-forms-add')" type="primary" icon="plus" @click="$refs.baseModal.base({},{filter: -1})">新增</a-button>
-        <a-button style="margin-left: 8px" v-if="$auth('repair-application-forms-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+        <a-button v-if="$auth('repair-application-forms-add')" type="primary" icon="plus"
+          @click="$refs.baseModal.base({}, { filter: -1 })">新增</a-button>
+        <a-button style="margin-left: 8px" v-if="$auth('repair-application-forms-export')" type="primary"
+          icon="download" @click="doExport">导出</a-button>
         <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('repair-application-forms-del')">
           <a-menu slot="overlay">
             <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
@@ -84,23 +87,14 @@
         </a-dropdown>
       </div>
 
-      <s-table
-        ref="table"
-        size="default"
-        rowKey="id"
-        :columns="columns"
-        :data="loadData"
-        :alert="options.alert"
-        :rowSelection="options.rowSelection"
-        :scroll="{x: 1000, y: BaseTool.Constant.scrollY }"
-        showPagination="auto"
-      >
+      <s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :alert="options.alert"
+        :rowSelection="options.rowSelection" :scroll="{ x: 1000, y: BaseTool.Constant.scrollY }" showPagination="auto">
         <span slot="action" slot-scope="record">
           <template>
             <a @click="handleView(record)">查看</a>
             <operation-button
               v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-edit')"
-              @click="handleEdit(record)" >修改</operation-button>
+              @click="handleEdit(record)">修改</operation-button>
             <!--            <operation-button-->
             <!--              v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-del')"-->
             <!--              :type="2"-->
@@ -111,21 +105,23 @@
               @click="handleDispatching(record)" >派工</operation-button>-->
             <operation-button
               v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status && $auth('repair-application-forms-dispatch')"
-              @click="handleAssign(record)" >派工</operation-button>
+              @click="handleAssign(record)">派工</operation-button>
           </template>
         </span>
         <span slot="status" slot-scope="text">
-          <badge :text="BaseTool.Object.getField(statusMap,text)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[text]"/>
+          <badge :text="BaseTool.Object.getField(statusMap, text)"
+            :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[text]" />
         </span>
         <span slot="level" slot-scope="text">
-          <badge :text="BaseTool.Object.getField(levelMap,text)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[text]"/>
+          <badge :text="BaseTool.Object.getField(levelMap, text)"
+            :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[text]" />
         </span>
       </s-table>
     </div>
-    <base-form ref="baseModal" @ok="handleOk"/>
-    <base-out-form ref="baseOutModal" @ok="handleOk"/>
-    <detail ref="detailModal" @ok="handleOk"/>
-    <detail-out ref="detailOutModal" @ok="handleOk"/>
+    <base-form ref="baseModal" @ok="handleOk" />
+    <base-out-form ref="baseOutModal" @ok="handleOk" />
+    <detail ref="detailModal" @ok="handleOk" />
+    <detail-out ref="detailOutModal" @ok="handleOk" />
     <assign-form ref="assignForm" @ok="handleOk" />
     <dispatch-base-form ref="dispatchBaseForm" @ok="handleOk" />
   </a-card>
@@ -140,6 +136,8 @@ import Detail from './modules/DetailRepair'
 import DetailOut from './modules/DetailRepairOut'
 import { getRepairApplicationFormPage, deleteRepairApplicationForms, fetchRepairApplicationForm, exportRepairApplicationForm } from '@/api/repair/application-form'
 import DispatchBaseForm from '@/views/repair/application-form/modules/DispatchBaseForm'
+import { queryDept } from '@/api/upms/dept'
+import { selectUserDept } from '@/api/upms/user-dept'
 
 export default {
   name: 'RepairForm',
@@ -163,7 +161,7 @@ export default {
       default: null
     }
   },
-  data () {
+  data() {
     return {
       // 查询参数
       queryParam: {
@@ -296,6 +294,8 @@ export default {
       statusMap: {},
       needStopMap: {},
       planFlagMap: {},
+      // 部门下拉数据
+      deptList: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
@@ -325,7 +325,7 @@ export default {
       optionAlertShow: false
     }
   },
-  created () {
+  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)
@@ -337,10 +337,25 @@ export default {
     if (no != null) {
       this.queryParam.no = no
     }
+    // 部门下拉数据
+    queryDept({}).then(res => {
+      this.deptList = res.data || []
+    })
+    // 我的工单:默认查询当前登录人部门的所有相关工单
+    if (this.searchType === 2) {
+      selectUserDept().then(res => {
+        if (res.data && res.data.deptId) {
+          this.queryParam.deptId = res.data.deptId
+          if (this.$refs.table) {
+            this.$refs.table.refresh()
+          }
+        }
+      })
+    }
     this.tableOption()
   },
   methods: {
-    tableOption () {
+    tableOption() {
       if (!this.optionAlertShow) {
         this.options = {
           alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
@@ -364,7 +379,7 @@ export default {
         this.optionAlertShow = false
       }
     },
-    batchDelete (id) {
+    batchDelete(id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {
         const length = this.selectedRows.length
@@ -382,14 +397,14 @@ export default {
         this.$refs.table.clearSelected()
       })
     },
-    handleEdit (record) {
+    handleEdit(record) {
       fetchRepairApplicationForm({ id: record.id }).then(res => {
         const type = res.data.type
         const modal = type === 2 ? this.$refs.baseOutModal : this.$refs.baseModal
         modal.base(res.data)
       })
     },
-    handleView (record) {
+    handleView(record) {
       fetchRepairApplicationForm({ id: record.id }).then(res => {
         this.visible = false
         // 收起可能残留的详情卡片,避免新旧详情(委外详情)同时显示
@@ -404,26 +419,28 @@ export default {
         modal.base(res.data)
       })
     },
-    handleAssign (record) {
+    handleAssign(record) {
       const modal = this.$refs.assignForm
       modal.base(record)
     },
-    handleOk () {
+    handleOk() {
       this.visible = true
       this.queryParam.searchStartTime = this.queryParam.searchStartTime ? this.BaseTool.Date.formatter(this.queryParam.searchStartTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 00:00:01' : null
       this.queryParam.searchEndTime = this.queryParam.searchEndTime ? this.BaseTool.Date.formatter(this.queryParam.searchEndTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) + ' 23:59:59' : null
       this.$refs.table.refresh()
     },
-    onSelectChange (selectedRowKeys, selectedRows) {
+    onSelectChange(selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
     },
-    resetSearchForm () {
+    resetSearchForm() {
       this.queryParam = {
+        filter: this.filter,
+        searchType: this.searchType
       }
       this.$refs.table.refresh(true)
     },
-    doExport () {
+    doExport() {
       const parameter = {
         ...this.queryParam,
         searchStartTime: this.queryParam.searchStartTime,
@@ -433,7 +450,7 @@ export default {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
     },
-    handleDispatching (record) {
+    handleDispatching(record) {
       const modal = this.$refs.dispatchBaseForm
       modal.base(record)
     }

+ 19 - 33
src/views/repair/application-form/modules/BaseForm.vue

@@ -27,14 +27,16 @@
             </a-tree-select>
           </a-form-item>
         </row-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 @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>
         <row-item>
           <a-form-item label="是否停机" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
             <a-select v-decorator="['needStop', { rules: [{ required: true, message: '是否停机不能为空' }] }]"
@@ -45,13 +47,13 @@
             </a-select>
           </a-form-item>
         </row-item>
-        <row-item v-show="category === 1">
+        <row-item>
           <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">
+        <row-item>
           <a-form-item label="要求时间" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
             <a-input style="width: 100%" suffix="小时" v-decorator="['limitHours']" />
           </a-form-item>
@@ -84,38 +86,22 @@
           </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-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-select
-              style="width: 100%"
-              v-decorator="['repairErrorTypeId']"
-              placeholder="请选择"
-              allowClear
-            >
-              <a-select-option
-                v-for="(label,value) in faultTypeMap"
-                :key="value"
-                :label="label"
-                :value="value">{{ label }}
+          <a-form-item label="故障类型" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
+            <a-select style="width: 100%" v-decorator="['repairErrorTypeId']" placeholder="请选择" allowClear>
+              <a-select-option v-for="(label, value) in faultTypeMap" :key="value" :label="label" :value="value">{{
+                label
+                }}
               </a-select-option>
             </a-select>
           </a-form-item>

+ 17 - 13
src/views/repair/application-form/modules/Detail.vue

@@ -15,18 +15,20 @@
             <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
             <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
             <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
-            <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
+            <!-- <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item> -->
             <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
             <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
-            <detail-list-item term="工单类别">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</detail-list-item>
+            <detail-list-item term="工单类别">{{ BaseTool.Object.getField(planFlagMap, model.category) }}</detail-list-item>
             <!--            <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>-->
 
             <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
-            <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
+            <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source)
+              }}</detail-list-item>
             <!--            <detail-list-item term="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></detail-list-item>-->
             <detail-list-item term="报修时间">{{ model.applyTime }}</detail-list-item>
             <detail-list-item term="报修状态">
-              <badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]" />
+              <badge :text="BaseTool.Object.getField(statusMap, model.status)"
+                :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]" />
             </detail-list-item>
             <detail-list-item term="要求时间">{{ model.limitHours }}小时</detail-list-item>
             <detail-list-item term="要求日期">{{ model.limitDate }}</detail-list-item>
@@ -42,7 +44,8 @@
                 <img v-for="item in model.applicationFileList" :src="item.url" :key="item.id" class="image">
               </viewer>
             </detail-list-item>
-            <detail-list-item term="" v-if="model.applicationFileList == null || model.applicationFileList.length === 0">
+            <detail-list-item term=""
+              v-if="model.applicationFileList == null || model.applicationFileList.length === 0">
               暂无
             </detail-list-item>
           </detail-list>
@@ -70,7 +73,7 @@
             </detail-list-item>
           </detail-list>
           <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
-          <detail-list v-for="(item,index) in dispatchList" title="" :key="index" :col="3">
+          <detail-list v-for="(item, index) in dispatchList" title="" :key="index" :col="3">
             <detail-list-item term="转派人">{{ item.username }}</detail-list-item>
             <detail-list-item term="转派时间">{{ item.time }}</detail-list-item>
             <detail-list-item term="转派备注">{{ item.remark }}</detail-list-item>
@@ -89,11 +92,11 @@
         <a-layout-sider style="background-color: rgb(255, 255, 255)">
           <div style="margin-top: 30px;margin-left: 30px;">
             <a-steps progress-dot :current="6" direction="vertical">
-              <a-step title="报修时间:" :description="''+model.applyTime?model.applyTime:''" />
-              <a-step title="维修开始时间:" :description="''+model.repairStartTime?model.repairStartTime:''" />
-              <a-step title="维修结束时间:" :description="''+model.repairEndTime?model.repairEndTime:''" />
-              <a-step title="审核开始时间:" :description="''+model.checkStartTime?model.checkStartTime:''" />
-              <a-step title="审核结束时间:" :description="''+model.checkEndTime?model.checkEndTime:''" />
+              <a-step title="报修时间:" :description="'' + model.applyTime ? model.applyTime : ''" />
+              <a-step title="维修开始时间:" :description="'' + model.repairStartTime ? model.repairStartTime : ''" />
+              <a-step title="维修结束时间:" :description="'' + model.repairEndTime ? model.repairEndTime : ''" />
+              <a-step title="审核开始时间:" :description="'' + model.checkStartTime ? model.checkStartTime : ''" />
+              <a-step title="审核结束时间:" :description="'' + model.checkEndTime ? model.checkEndTime : ''" />
             </a-steps>
           </div>
         </a-layout-sider>
@@ -539,14 +542,15 @@ export default {
   width: 300px;
   height: 300px;
 }
-.ant-carousel >>> .slick-slide {
+
+.ant-carousel>>>.slick-slide {
   text-align: center;
   height: 300px;
   line-height: 300px;
   overflow: hidden;
 }
 
-.ant-carousel >>> .slick-slide h3 {
+.ant-carousel>>>.slick-slide h3 {
   color: #fff;
 }
 

+ 35 - 70
src/views/repair/application-form/modules/FinishForm.vue

@@ -1,46 +1,26 @@
 <template>
-  <a-modal
-    :title="modalTitle"
-    :width="800"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    class="ant-modal2"
-    @cancel="handleCancel"
-  >
+  <a-modal :title="modalTitle" :width="800" :visible="visible" :confirmLoading="confirmLoading" class="ant-modal2"
+    @cancel="handleCancel">
     <a-form :form="form">
-      <a-form-item v-show="false" >
-        <a-input v-decorator="['id']" type="hidden"/>
+      <a-form-item v-show="false">
+        <a-input v-decorator="['id']" type="hidden" />
       </a-form-item>
 
       <row-list :col="2">
         <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 planFlagMap"
-                :key="value"
-                :label="label"
+          <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 planFlagMap" :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-date-picker
-              showTime
-              v-decorator="['repairEndTime']"
-              style="width: 100%"
-              :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
-            />
+          <a-form-item label="完成时间" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
+            <a-date-picker showTime v-decorator="['repairEndTime']" style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN" />
           </a-form-item>
         </row-item>
         <!--        <row-item>
@@ -105,29 +85,14 @@
       </row-list>
       <row-list :col="1">
         <row-item>
-          <a-form-item
-            label="维修描述"
-            :labelCol="BaseTool.Constant.labelCol2"
-            :wrapperCol="BaseTool.Constant.wrapperCol2"
-          >
-            <a-textarea v-decorator="['repairContent']"/>
+          <a-form-item label="维修描述" :labelCol="BaseTool.Constant.labelCol2" :wrapperCol="BaseTool.Constant.wrapperCol2">
+            <a-textarea v-decorator="['repairContent', { rules: [{ required: true, message: '维修描述不能为空' }] }]" />
           </a-form-item>
         </row-item>
         <row-item>
-          <a-form-item
-            label="维修图片"
-            :labelCol="BaseTool.Constant.labelCol2"
-            :wrapperCol="BaseTool.Constant.wrapperCol2"
-          >
-            <a-upload
-              :action="uploadUrl"
-              :multiple="true"
-              list-type="picture"
-              :file-list="defaultRepairFileList"
-              @change="handleRepairFileChange"
-              accept="image/*"
-              :headers="headers"
-            >
+          <a-form-item label="维修图片" :labelCol="BaseTool.Constant.labelCol2" :wrapperCol="BaseTool.Constant.wrapperCol2">
+            <a-upload :action="uploadUrl" :multiple="true" list-type="picture" :file-list="defaultRepairFileList"
+              @change="handleRepairFileChange" accept="image/*" :headers="headers">
               <a-button> <a-icon type="upload" /> 上传图片 </a-button>
             </a-upload>
           </a-form-item>
@@ -153,7 +118,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 export default {
   name: 'BaseRepairApplicationForm',
-  data () {
+  data() {
     return {
       model: null,
       confirmLoading: false,
@@ -183,7 +148,7 @@ export default {
   },
   props: {
   },
-  created () {
+  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)
@@ -193,7 +158,7 @@ export default {
     this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
   },
   methods: {
-    base (record) {
+    base(record) {
       this.setTree()
       this.visible = true
       this.model = record
@@ -219,12 +184,12 @@ export default {
         ])))
       })
     },
-    getUsers () {
+    getUsers() {
       queryUser({ status: 1 }).then(res => {
         this.userList = res.data
       })
     },
-    changePlanFlag (value) {
+    changePlanFlag(value) {
       this.category = value
       const { form: { setFieldsValue } } = this
       if (this.category === 1) {
@@ -237,11 +202,11 @@ export default {
         })
       }
     },
-    handleRepairFileChange (info) {
+    handleRepairFileChange(info) {
       this.defaultRepairFileList = info.fileList
       this.repairFileList = this.setFileList(info, 12)
     },
-    setFileList (info, type) {
+    setFileList(info, type) {
       const file = info.file
       const fileList = info.fileList
       if (file.status === 'done') {
@@ -253,7 +218,7 @@ export default {
         return []
       }
     },
-    save () {
+    save() {
       const { form: { validateFieldsAndScroll } } = this
       this.confirmLoading = true
       validateFieldsAndScroll((errors, values) => {
@@ -272,7 +237,7 @@ export default {
         })
       })
     },
-    handleCancel (values) {
+    handleCancel(values) {
       this.visible = false
       this.confirmLoading = false
       this.form.resetFields()
@@ -280,12 +245,12 @@ export default {
         this.$emit('ok')
       }
     },
-    handleSbSelect () {
+    handleSbSelect() {
       this.$refs.sbInfoSelectModal.base({}, { filter: 0, status: 2 })
     },
-    handleSbSelectd (keys, rows) {
-      const [ key ] = keys
-      const [ row ] = rows
+    handleSbSelectd(keys, rows) {
+      const [key] = keys
+      const [row] = rows
       const { form: { setFieldsValue } } = this
       // 日期处理
       this.$nextTick(() => {
@@ -295,13 +260,13 @@ export default {
         }))
       })
     },
-    handlePartSelect () {
+    handlePartSelect() {
       const sbId = this.form.getFieldValue('sbId')
       this.$refs.partInfoSelectModal.base({ sbId })
     },
-    handlePartSelected (keys, rows) {
-      const [ key ] = keys
-      const [ row ] = rows
+    handlePartSelected(keys, rows) {
+      const [key] = keys
+      const [row] = rows
       const { form: { setFieldsValue } } = this
       this.$nextTick(() => {
         setFieldsValue(Object.assign({
@@ -313,12 +278,12 @@ export default {
     /**
      * 设置类别树
      */
-    setTree (record = {}) {
+    setTree(record = {}) {
       fetchErrorTypeTree({ id: record.id }).then(res => {
         this.treeData = res.data
       })
     },
-    handleAddPartUsed () {
+    handleAddPartUsed() {
       /* const modal = this.$refs.repairFeeModal
       modal.base(null, record) */
       this.$refs.sparePartUsedSelectModal.base(this.model, { sbId: this.model.sbId, modelId: this.model.modelId })