Parcourir la source

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

hfxc226 il y a 2 ans
Parent
commit
3a5a3d60c6

BIN
src/assets/icons/beijian.png


BIN
src/assets/icons/jilu.png


BIN
src/assets/icons/shenhe.png


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
src/components/IconSelector/iconfont.js


+ 2 - 2
src/utils/install.js

@@ -17,8 +17,8 @@ import { Icon } from 'ant-design-vue'
 import iconfont from '@/components/IconSelector/iconfont.js'
 import ImportForm from '@/components/custom/ImportForm'
 const MyIcon = Icon.createFromIconfontCN({
-  // scriptUrl: iconfont // //at.alicdn.com/t/font_1314041_9qgpnn1vvko.js在 iconfont.cn 上生成
-  scriptUrl: '//at.alicdn.com/t/font_3266072_86x8xjo2osl.js'
+  scriptUrl: iconfont // //at.alicdn.com/t/font_1314041_9qgpnn1vvko.js在 iconfont.cn 上生成
+  // scriptUrl: '//at.alicdn.com/t/font_3266072_mx3m5426u3.js'
 })
 
 export default {

+ 4 - 4
src/views/repair/application-form/RepairForm.vue

@@ -1,6 +1,6 @@
 <template>
-  <a-card :bordered="false">
-    <div v-show="visible">
+  <div>
+    <a-card v-show="visible">
       <div class="table-page-search-wrapper">
         <a-form layout="inline">
           <a-row :gutter="48">
@@ -128,14 +128,14 @@
           <badge :text="BaseTool.Object.getField(levelMap,text)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[text]"/>
         </span>
       </s-table>
-    </div>
+    </a-card>
     <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>
+  </div>
 </template>
 
 <script>

+ 865 - 0
src/views/repair/application-form/modules/DetailRepair copy.vue

@@ -0,0 +1,865 @@
+<template>
+  <div>
+    <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+      <a-row :gutter="48" slot="extra">
+        <a-col :md="48" :sm="48">
+          <span class="table-page-search-submitButtons" style="float: right">
+            <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
+            <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
+            <a-button v-if="$auth('repair-application-forms-assign') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派工</a-button>
+            <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status)" title="是否要接收?" @confirm="receive">
+              <!-- <a-button style="margin-left: 8px">接收</a-button> -->
+            </a-popconfirm>
+            <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="default" @click="handleOut">委外</a-button>
+            <a-button v-if="$auth('repair-application-forms-dispatch') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status" style="margin-left: 8px" type="default" @click="handleDispatch">转派</a-button>
+            <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成</a-button>
+            <a-button v-if="$auth('repair-application-forms-edit')" style="margin-left: 8px" type="default" @click="handleEdit()">修改</a-button>
+            <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
+              <a-button style="margin-left: 8px" type="default">提交审核</a-button>
+            </a-popconfirm>
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
+          </span>
+        </a-col>
+      </a-row>
+      <a-layout>
+        <a-layout-content style="background-color: rgb(255, 255, 255)">
+          <a-divider orientation="left">报修详情</a-divider>
+          <detail-list title="" :col="3">
+            <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.sbCph }}</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="紧急等级"><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]"/></detail-list-item>
+            <detail-list-item term="要求时间">{{ model.limitHours }}小时</detail-list-item>
+            <detail-list-item term="要求日期">{{ model.limitDate }}</detail-list-item>
+          </detail-list>
+          <detail-list title="" :col="1">
+            <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
+            <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
+          </detail-list>
+          <title-divider title="报修图片" width="90px"></title-divider>
+          <detail-list title="" :col="1">
+            <detail-list-item term="" v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
+              <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1" >
+                <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>
+          </detail-list>
+          <a-divider orientation="left">维修详情</a-divider>
+          <detail-list title="" :col="3">
+            <!--            <detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>-->
+            <detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
+            <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
+            <detail-list-item term="维修耗时">{{ model.repairMinutes }}小时</detail-list-item>
+            <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
+          <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
+          </detail-list>
+          <detail-list title="" :col="1">
+            <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
+          </detail-list>
+          <title-divider title="维修图片" width="90px"></title-divider>
+          <detail-list title="" :col="1">
+            <detail-list-item term="" v-if="model.repairFileList != null && model.repairFileList.length > 0">
+              <viewer :images="model.repairFileList" @inited="inited" ref="viewer" :index="1" >
+                <img v-for="item in model.repairFileList" :src="item.url" :key="item.id" class="image">
+              </viewer>
+            </detail-list-item>
+            <detail-list-item term="" v-if="model.repairFileList == null || model.repairFileList.length === 0">
+              暂无
+            </detail-list-item>
+          </detail-list>
+          <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
+          <detail-list v-for="item in dispatchList" title="" :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>
+          </detail-list>
+          <a-divider orientation="left">审核详情</a-divider>
+          <detail-list title="" :col="3">
+            <detail-list-item term="审核开始时间">{{ model.checkStartTime }}</detail-list-item>
+            <detail-list-item term="审核结束时间">{{ model.checkEndTime }}</detail-list-item>
+            <detail-list-item term="审核人员">{{ model.checkUserName }}</detail-list-item>
+            <detail-list-item term="审核描述">{{ model.checkContent }}</detail-list-item>
+          </detail-list>
+          <detail-list title="审核图片:" :col="6">
+            <upload-image-detail :images-list="model.checkFileList"/>
+          </detail-list>
+        </a-layout-content>
+        <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-steps>
+          </div>
+        </a-layout-sider>
+      </a-layout>
+      <q-tabs :activeKey="activeKey" @change="changeTab">
+        <q-tab-pane key="1" tab="备件清单">
+          <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
+            <a-button type="primary" @click="handleSpareStoreSelect(1)">
+              <a-icon type="plus"/>
+              更换专用备件
+            </a-button>
+            <a-divider type="vertical" />
+            <a-button type="primary" @click="handleSpareStoreSelect(0)">
+              <a-icon type="plus"/>
+              更换常用备件
+            </a-button>
+            <a-divider type="vertical" />
+            <a-button type="primary" @click="handleAddSpare()">
+              <a-icon type="plus"/>
+              添加专用备件
+            </a-button>
+          </div>
+          <a-table
+            :data-source="dataSpare"
+            :columns="columnsSpare"
+            :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            tableLayout="auto"
+            rowKey="id">
+            <span slot="actionSpare" slot-scope="record">
+              <template>
+                <a v-if="$auth('repair-application-forms-finish') && record.isSpecial === 0" @click="handleEditSpare(record)">修改</a>
+                <!--                <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否替换该备件?" @confirm="updateSpare(record)">
+                  <a>更换备件</a>
+                </a-popconfirm>-->
+                <a-divider type="vertical" />
+                <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否要删除该条数据?" @confirm="batchDeleteSpare(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </template>
+            </span>
+          </a-table>
+        </q-tab-pane>
+        <q-tab-pane key="2" tab="费用清单">
+          <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
+            <a-button type="primary" @click="handleAddFee">
+              <a-icon type="plus"/>
+              添加
+            </a-button>
+          </div>
+          <a-table
+            :data-source="dataFee"
+            :columns="columnsFee"
+            tableLayout="auto"
+            rowKey="id">
+            <span slot="action" slot-scope="record">
+              <template>
+                <a @click="handleViewFee(record)">查看</a>
+                <operation-button
+                  @click="handleEditFee(record)" >修改</operation-button>
+                <operation-button
+                  title="确认删除该笔费用?"
+                  @confirm="batchDeleteFee(record.id)" >删除</operation-button>
+              </template>
+            </span>
+          </a-table>
+        </q-tab-pane>
+        <q-tab-pane key="3" tab="维修报告">
+          <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))">
+            <a-button type="primary" @click="handleAddReason">
+              <a-icon type="plus"/>
+              添加
+            </a-button>
+          </div>
+          <a-table
+            :data-source="dataReason"
+            :columns="columnsReason"
+            :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
+            rowKey="id">
+            <span slot="action" slot-scope="record">
+              <template>
+                <a @click="handleViewReason(record)">查看</a>
+                <operation-button
+                  @click="handleEditReason(record)" >修改</operation-button>
+                <!--                <operation-button
+                  v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"
+                  @click="handleCopyReason(record)" >复制</operation-button>-->
+                <operation-button
+                  :type="2"
+                  title="确认删除该记录?"
+                  @confirm="batchDeleteReason(record.id)" >删除</operation-button>
+              </template>
+            </span>
+          </a-table>
+        </q-tab-pane>
+      </q-tabs>
+      <!--      <title-divider title="备件清单" width="90px"></title-divider>
+
+      <title-divider title="费用清单" width="90px"></title-divider>
+
+      <title-divider title="维修报告" width="90px"></title-divider>-->
+
+    <!--    <q-tabs :activeKey="activeKey" @change="changeTab">
+      <q-tab-pane key="a" tab="配件更换">
+       <spare-part-used-select-table :type="2" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
+     </q-tab-pane>
+      <q-tab-pane key="b" tab="备件领用">
+        <spare-pick-form-select-table :type="2" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
+      </q-tab-pane>
+    </q-tabs>-->
+
+    </a-card>
+    <check-form ref="checkForm" @ok="handleOk" />
+    <base-out-form ref="outForm" @ok="handleCancel" />
+    <finish-form ref="finishForm" @ok="handleOk" />
+    <dispatch-form ref="dispatchForm" @ok="handleCancel" />
+    <assign-form ref="assignForm" @ok="handleCancel" />
+    <spare-pick-base-form ref="baseModal" @ok="handleOk"/>
+    <base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
+    <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
+    <fee-base-form ref="feeForm" @ok="handleOk" />
+    <fee-detail ref="feeDetail" @ok="handleOk" />
+    <reason-base-form ref="reasonForm" @ok="handleOk" />
+    <reason-detail ref="reasonDetail" @ok="handleOk" />
+    <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
+    <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
+    <base-form ref="baseRepairProjectModal" @ok="handleOk"/>
+    <detail ref="detailRepairProjectModal"/>
+    <edit-form ref="editForm" @ok="handleOk" />
+  </div>
+</template>
+
+<script>
+import { stringify } from 'qs'
+import DetailList from '@/components/tools/DetailList'
+import { fetchRepairApplicationForm, examine, approve, receive } from '@/api/repair/application-form'
+import CheckForm from './CheckForm'
+import BaseOutForm from './BaseOutForm'
+import FinishForm from './FinishForm'
+import EditForm from './EditForm'
+import DispatchForm from './DispatchForm'
+import AssignForm from './AssignForm'
+import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
+import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
+import RepairProjectSelectModal from '@/views/repair/repairproject/modules/RepairProjectSelectModal'
+import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
+import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
+import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
+import { selectSparePartUsedListBySbId, addSparePartUsedBatch, deleteSparePartUseds, updateSpare, selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
+import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
+import BaseTool from '@/utils/tool'
+import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
+import FeeDetail from '@/views/repair/fee/modules/Detail'
+import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
+import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
+import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
+import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
+import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
+import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
+import { fetchSbInfo } from '@/api/sb/info'
+import BaseForm from '@/views/repair/repairproject/modules/BaseForm'
+import Detail from '@/views/repair/repairproject/modules/Detail'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'RepairApplicationFormDetail',
+  components: {
+    CheckForm,
+    EditForm,
+    DetailList,
+    DetailSbCheck,
+    DetailSbBom,
+    ReasonBaseForm,
+    ReasonDetail,
+    DetailListItem,
+    FinishForm,
+    BaseOutForm,
+    DispatchForm,
+    FeeDetail,
+    AssignForm,
+    FeeBaseForm,
+    SparePickBaseForm,
+    SparePartUsedSelectTable,
+    SparePickFormSelectTable,
+    RepairProjectSelectModal,
+    SparePartInfoSelectModal,
+    BaseFormForRepair,
+    SpareStoreSelectModal,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      needStopMap: {},
+      planFlagMap: {},
+      dispatchList: [],
+      visible: false,
+      showSbFlag: false,
+      sbInfo: {},
+      // 下拉框map
+      sourceMap: {},
+      typeMap: {},
+      levelMap: {},
+      descripitionMap: {},
+      selectedRowKeys: [],
+      statusMap: {},
+      repairProjectMap: {},
+      repairTechnologyMap: {},
+      activeKey: 'a',
+      data: [],
+      dataSpare: [],
+      dataFee: [],
+      dataReason: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '维修内容',
+          dataIndex: 'name'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      columnsSpare: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '备件名称',
+          dataIndex: 'spareId',
+          customRender: (text, record, index) => {
+            return record.spareName
+          }
+        },
+        {
+          title: '数量',
+          dataIndex: 'num'
+        },
+        {
+          title: '价格',
+          dataIndex: 'price'
+        },
+        {
+          title: '总价',
+          dataIndex: 'totalPrice'
+        },
+        {
+          title: '更换日期',
+          dataIndex: 'startDate'
+        },
+        {
+          title: '是否专用',
+          dataIndex: 'isSpecial',
+          checked: true,
+          customRender: (text, record, index) => {
+            if (text === 1) {
+              return '是'
+            } else {
+              return '否'
+            }
+          }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'actionSpare' }
+        }
+      ],
+      columnsFee: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '费用金额',
+          dataIndex: 'fee',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '费用类别',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '费用原因',
+          dataIndex: 'reason'
+        },
+        {
+          title: '费用描述',
+          dataIndex: 'descripition'
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      columnsReason: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: '70px',
+          customRender: (text, record, index) => {
+            return `${index + 1}`
+          }
+        },
+        {
+          title: '分析时间',
+          dataIndex: 'analyzeTime',
+          width: '150px'
+        },
+        {
+          title: '故障现象',
+          dataIndex: 'problemDesc',
+          ellipsis: true,
+          width: '150px'
+        },
+        {
+          title: '检查处理过程',
+          dataIndex: 'checkProcess',
+          ellipsis: true,
+          width: '150px'
+        },
+        {
+          title: '改进措施类别',
+          dataIndex: 'type',
+          ellipsis: true,
+          width: '150px',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeReasonMap, text)
+          }
+        },
+        {
+          title: '改进内容',
+          dataIndex: 'changeRepairPlanContent',
+          ellipsis: true,
+          width: '250px'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      typeReasonMap: {},
+      model: {
+        'id': null,
+        'sbId': null,
+        'partId': null,
+        'repairUserId': null,
+        'needStop': null,
+        'category': null,
+        'no': null,
+        'source': null,
+        'applyTime': null,
+        'level': null,
+        'content': null,
+        'status': null,
+        'remark': null,
+        'updateTime': null,
+        'createdUserId': null,
+        'updateUserId': null,
+        'createdUserName': null,
+        'sbName': null,
+        'partName': null,
+        'limitHours': null,
+        'limitDate': null,
+        'updateUserName': null,
+        'repairFormVO': null,
+        'repairCheckVO': null
+      }
+    }
+  },
+  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.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
+    this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
+    this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
+    this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
+    this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
+    this.typeReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.showSbFlag = false
+      this.modalTitle = '详情'
+      this.model = record
+      console.log(record)
+      this.activeKey = 'a'
+      this.dispatchList = JSON.parse(record.repairDispatchList)
+      const sbId = record.sbId
+      if (sbId) {
+        fetchSbInfo({ id: sbId }).then(res => {
+          this.sbInfo = res.data
+          this.showSbFlag = true
+        })
+      }
+
+      this.init()
+    },
+    init () {
+      queryRepairProject({ repairId: this.model.id }).then(res => {
+        this.data = res.data
+      })
+      selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
+        this.dataSpare = res.data
+      })
+      /* selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
+        this.dataSpare = res.data
+      }) */
+      queryRepairFee({ repairId: this.model.id }).then(res => {
+        this.dataFee = res.data
+      })
+      queryRepairReason({ repairId: this.model.id }).then(res => {
+        this.dataReason = res.data
+      })
+    },
+    handleViewBom (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbBomModal
+      modal.base(this.sbInfo)
+    },
+    handleViewCheck (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbCheckModal
+      modal.base(this.sbInfo)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok')
+    },
+    handleAddSpare () {
+      const id = this.model.sbId
+      const routeUrl = this.$router.resolve({ path: '/spare/used/record', query: { id: id } })
+      window.open(routeUrl.href, '_blank')
+    },
+    receive () {
+      this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING
+      receive(this.model).then(() => {
+        // const modal = this.$refs.finishForm
+        // modal.base(that.model)
+      })
+    },
+    batchDeleteFee (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteRepairFees(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+      })
+    },
+    handleOut () {
+      const modal = this.$refs.outForm
+      modal.base(null, this.model)
+    },
+    handleAddFee () {
+      const modal = this.$refs.feeForm
+      modal.base(null, this.model)
+    },
+    handleEditFee (record) {
+      fetchRepairFee({ id: record.id }).then(res => {
+        const modal = this.$refs.feeForm
+        const data = res.data
+        data.repairNo = this.model.no
+        modal.base(data, this.model)
+      })
+    },
+    handleViewFee (record) {
+      fetchRepairFee({ id: record.id }).then(res => {
+        const modal = this.$refs.feeDetail
+        modal.base(res.data)
+      })
+    },
+    batchDeleteReason (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteRepairReasons(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleAddReason () {
+      const modal = this.$refs.reasonForm
+      this.visible = false
+      modal.base(null, this.model)
+    },
+    handleEditReason (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.reasonForm
+        this.visible = false
+        modal.base(res.data, this.model)
+      })
+    },
+    handleCopyReason (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.reasonForm
+        this.visible = false
+        res.data.id = null
+        modal.base(res.data, this.model)
+      })
+    },
+    handleViewReason (record) {
+      fetchRepairReason({ id: record.id }).then(res => {
+        const modal = this.$refs.reasonDetail
+        modal.base(res.data)
+      })
+    },
+    handleApprove () {
+      approve(this.model).then(() => {
+        this.$message.info('操作成功')
+        this.handleOk()
+      })
+    },
+    handleReturn () {
+      const modal = this.$refs.checkForm
+      modal.base(this.model)
+    },
+    handleOk () {
+      this.loading = true
+      fetchRepairApplicationForm({ id: this.model.id }).then(res => {
+        this.loading = false
+        this.model = res.data
+        this.visible = true
+        this.dispatchList = JSON.parse(this.model.repairDispatchList)
+      })
+      this.init()
+    },
+    handleFinish () {
+      const modal = this.$refs.finishForm
+      modal.base(this.model)
+    },
+    handleExamine () {
+      examine({ id: this.model.id }).then(res => {
+        this.loading = false
+        this.visible = true
+        this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING
+        this.$message.info('已提交,请等待审核')
+      })
+      this.init()
+    },
+    handleDispatch () {
+      const modal = this.$refs.dispatchForm
+      modal.base(this.model)
+    },
+    handleAssign () {
+      const modal = this.$refs.assignForm
+      modal.base(this.model)
+    },
+    handleSparePick () {
+      const modal = this.$refs.baseModal
+      modal.base(null, { repairId: this.model.id, repairNo: this.model.no, reason: '维修领用' })
+    },
+    changeTab (activeKey) {
+      this.activeKey = activeKey
+      if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
+        const modal = this.$refs.sparePartUsedSelectTable
+        modal.handleOk()
+        return
+      }
+      if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
+        const modal = this.$refs.sparePickFormSelectTable
+        modal.handleOk()
+      }
+    },
+    handleView (record) {
+      fetchRepairProject({ id: record.id }).then(res => {
+        const modal = this.$refs.detailRepairProjectModal
+        modal.base(res.data)
+      })
+    },
+    handleEdit (record) {
+      const modal = this.$refs.editForm
+      modal.base(this.model)
+    },
+    handleRepairProjectAdd () {
+      this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteRepairProjects(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+      })
+    },
+    handleSpareSelect () {
+      this.$refs.spareSelectModal.base({}, { yt: 1 })
+    },
+    handleSpareSelected (record, keys, rows) {
+      const data = []
+      for (let i = 0; i < rows.length; i++) {
+        data.push({ sbId: this.model.sbId, spareId: rows[i].id, repairId: this.model.id, num: 1, price: rows[i].initialValue, totalPrice: rows[i].initialValue })
+      }
+      addSparePartUsedBatch(data)
+        .then((response) => {
+          this.$message.info('添加成功')
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    },
+    batchDeleteSpare (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteSparePartUseds(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+      })
+    },
+    handleEditSpare (record) {
+      const modal = this.$refs.baseFormForRepair
+      modal.base(record)
+    },
+    updateSpare (record) {
+      updateSpare(record).then(res => {
+        this.$message.info('更换成功')
+        selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
+          this.dataSpare = res.data
+        })
+      })
+    },
+    handleSpareStoreSelect (isSpecial) {
+      // this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
+      this.$refs.spareStoreSelectModal.base({}, { repairFlag: 1, storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
+    },
+    handleSpareStoreSelected (record, keys, rows) {
+      const data = []
+      for (let i = 0; i < rows.length; i++) {
+        data.push({ isSpecial: record.isSpecial, sbId: this.model.sbId, spareId: rows[i].spareId, repairId: this.model.id, num: 1, price: rows[i].price, totalPrice: rows[i].price, startDate: BaseTool.Date.formatter(new Date(), BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
+      }
+      if (record.isSpecial === 1) {
+        updateSpare(data)
+          .then((response) => {
+            this.$message.info('更换成功')
+            this.handleOk()
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+      } else {
+        addSparePartUsedBatch(data)
+          .then((response) => {
+            this.$message.info('更换成功')
+            this.handleOk()
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+      }
+    },
+    onSelectChange (selectedRowKeys) {
+      console.log('selectedRowKeys changed: ', selectedRowKeys)
+      this.selectedRowKeys = selectedRowKeys
+    },
+    inited (viewer) {
+      this.$viewer = viewer
+    }
+  }
+}
+</script>
+<style scoped>
+/* For demo */
+.ant-carousel {
+  width: 300px;
+  height: 300px;
+}
+.ant-carousel >>> .slick-slide {
+  text-align: center;
+  height: 300px;
+  line-height: 300px;
+  overflow: hidden;
+}
+
+.ant-carousel >>> .slick-slide h3 {
+  color: #fff;
+}
+
+.image {
+  width: calc(20% - 10px);
+  cursor: pointer;
+  margin: 5px;
+  display: inline-block;
+}
+</style>

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

@@ -1,115 +1,161 @@
 <template>
   <div>
-    <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
-      <a-row :gutter="48" slot="extra">
-        <a-col :md="48" :sm="48">
-          <span class="table-page-search-submitButtons" style="float: right">
-            <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
-            <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
-            <a-button v-if="$auth('repair-application-forms-assign') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派工</a-button>
-            <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status)" title="是否要接收?" @confirm="receive">
-              <a-button style="margin-left: 8px">接收</a-button>
-            </a-popconfirm>
-            <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="default" @click="handleOut">委外</a-button>
-            <a-button v-if="$auth('repair-application-forms-dispatch') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status" style="margin-left: 8px" type="default" @click="handleDispatch">转派</a-button>
-            <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成</a-button>
-            <a-button v-if="$auth('repair-application-forms-edit')" style="margin-left: 8px" type="default" @click="handleEdit()">修改</a-button>
-            <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
-              <a-button style="margin-left: 8px" type="default">提交审核</a-button>
-            </a-popconfirm>
-            <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
-          </span>
+    <div v-show="visible">
+      <a-row :gutter="40">
+        <a-col :span="6">
+          <div class="gutter-box gutter-color center">
+            <div style=" overflow: auto;height: 300px;">
+              <a-steps :current="0" 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-steps>
+            </div>
+          </div>
+        </a-col>
+        <a-col :span="18" class="gutter-box">
+          <a-row :gutter="[20,20]">
+            <a-col :span="6">
+              <div class="gutter-btn gutter-color" @click="current=0">
+                <my-icon type="icon-weixiu1" />
+                <div style="font-size:25px; color: #333;">报修详情</div>
+              </div>
+            </a-col>
+            <a-col :span="6" >
+              <div class="gutter-btn gutter-color" @click="current=1">
+                <my-icon type="icon-weixiubaoxiu" />
+                <div style="font-size:25px; color: #333;">维修详情</div>
+              </div>
+            </a-col>
+            <a-col :span="6">
+              <div class="gutter-btn gutter-color" @click="current=2">
+                <img src="@/assets/icons/shenhe.png" width="40px"/>
+                <div style="font-size:25px; color: #333;">审核详情</div>
+              </div>
+            </a-col>
+            <a-col :span="6">
+              <div class="gutter-btn gutter-color" @click="current=3">
+                <img src="@/assets/icons/jilu.png" width="40px"/>
+                <div style="font-size:25px; color: #333;">维修记录</div>
+              </div>
+            </a-col>
+            <a-col :span="6">
+              <div class="gutter-btn gutter-color" @click="current=4">
+                <img src="@/assets/icons/beijian.png" width="40px"/>
+                <div style="font-size:25px; color: #333;">备件清单</div>
+              </div>
+            </a-col>
+            <a-col :span="6" >
+              <div class="gutter-btn gutter-color" @click="current=5">
+                <my-icon type="icon-qitafeiyong" />
+                <div style="font-size:25px; color: #333;">费用清单</div>
+              </div>
+            </a-col>
+            <a-col :span="6">
+              <div class="gutter-btn gutter-color" @click="current=6">
+                <my-icon type="icon-zhengzaiweixiudegongdan" />
+                <div style="font-size:25px; color: #333;">维修报告</div>
+              </div>
+            </a-col>
+            <a-col :span="6">
+              <div class="gutter-btn gutter-color" @click="current=7">
+                <my-icon type="icon-weixiu" />
+                <div style="font-size:25px; color: #333;">维修方案</div>
+              </div>
+            </a-col>
+          </a-row>
         </a-col>
       </a-row>
-      <a-layout>
-        <a-layout-content style="background-color: rgb(255, 255, 255)">
-          <a-divider orientation="left">报修详情</a-divider>
-          <detail-list title="" :col="3">
-            <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.sbCph }}</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="紧急等级"><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]"/></detail-list-item>
-            <detail-list-item term="要求时间">{{ model.limitHours }}小时</detail-list-item>
-            <detail-list-item term="要求日期">{{ model.limitDate }}</detail-list-item>
-          </detail-list>
-          <detail-list title="" :col="1">
-            <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
-            <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
-          </detail-list>
-          <title-divider title="报修图片" width="90px"></title-divider>
-          <detail-list title="" :col="1">
-            <detail-list-item term="" v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
-              <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1" >
-                <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>
-          </detail-list>
-          <a-divider orientation="left">维修详情</a-divider>
-          <detail-list title="" :col="3">
-            <!--            <detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>-->
-            <detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
-            <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
-            <detail-list-item term="维修耗时">{{ model.repairMinutes }}小时</detail-list-item>
-            <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
-          <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
-          </detail-list>
-          <detail-list title="" :col="1">
-            <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
-          </detail-list>
-          <title-divider title="维修图片" width="90px"></title-divider>
-          <detail-list title="" :col="1">
-            <detail-list-item term="" v-if="model.repairFileList != null && model.repairFileList.length > 0">
-              <viewer :images="model.repairFileList" @inited="inited" ref="viewer" :index="1" >
-                <img v-for="item in model.repairFileList" :src="item.url" :key="item.id" class="image">
-              </viewer>
-            </detail-list-item>
-            <detail-list-item term="" v-if="model.repairFileList == null || model.repairFileList.length === 0">
-              暂无
-            </detail-list-item>
-          </detail-list>
-          <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
-          <detail-list v-for="item in dispatchList" title="" :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>
-          </detail-list>
-          <a-divider orientation="left">审核详情</a-divider>
-          <detail-list title="" :col="3">
-            <detail-list-item term="审核开始时间">{{ model.checkStartTime }}</detail-list-item>
-            <detail-list-item term="审核结束时间">{{ model.checkEndTime }}</detail-list-item>
-            <detail-list-item term="审核人员">{{ model.checkUserName }}</detail-list-item>
-            <detail-list-item term="审核描述">{{ model.checkContent }}</detail-list-item>
-          </detail-list>
-          <detail-list title="审核图片:" :col="6">
-            <upload-image-detail :images-list="model.checkFileList"/>
-          </detail-list>
-        </a-layout-content>
-        <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-steps>
+      <div>
+        <div class="main gutter-color" v-show="current == 0">
+          <div class="title">报修详情</div>
+          <div>
+            <a-descriptions :column="3" bordered>
+              <a-descriptions-item label="报修单号">{{ model.no }}</a-descriptions-item>
+              <a-descriptions-item label="设备编号">{{ model.sbNo }}</a-descriptions-item>
+              <a-descriptions-item label="设备名称">{{ model.sbName }}</a-descriptions-item>
+              <a-descriptions-item label="预留维修时间">{{ model.limitHours }}</a-descriptions-item>
+              <a-descriptions-item label="使用位置">{{ model.sbCph }}</a-descriptions-item>
+              <a-descriptions-item label="工单类别">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</a-descriptions-item>
+              <!--            <a-descriptions-item label="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</a-descriptions-item>-->
+              <a-descriptions-item label="报修人">{{ model.actualUser }}</a-descriptions-item>
+              <!--            <a-descriptions-item label="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</a-descriptions-item>
+            <a-descriptions-item label="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></a-descriptions-item>-->
+              <a-descriptions-item label="报修时间">{{ model.applyTime }}</a-descriptions-item>
+              <a-descriptions-item label="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></a-descriptions-item>
+              <a-descriptions-item label="要求时间">{{ model.limitHours }}小时</a-descriptions-item>
+              <a-descriptions-item label="要求日期" :span="2">{{ model.limitDate }}</a-descriptions-item>
+              <a-descriptions-item label="故障描述" :span="3">{{ model.content }}</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" >
+                    <img
+                      v-for="item in model.applicationFileList"
+                      :src="item.url"
+                      :key="item.id"
+                      class="image"
+                      width="200px"
+                      style="margin:10px;">
+                  </viewer></div>
+                <div v-if="model.applicationFileList == null || model.applicationFileList.length === 0"> 暂无</div>
+              </a-descriptions-item>
+            </a-descriptions>
           </div>
-        </a-layout-sider>
-      </a-layout>
-      <q-tabs :activeKey="activeKey" @change="changeTab">
-        <q-tab-pane key="1" tab="备件清单">
-          <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
+        </div>
+        <div class="main gutter-color" v-show="current == 1">
+          <div class="title">维修详情</div>
+          <div>
+            <a-descriptions :column="3" bordered>
+              <!--            <a-descriptions-item label="故障类别">{{ model.repairErrorTypeName }}</a-descriptions-item>-->
+              <a-descriptions-item label="维修开始时间">{{ model.repairStartTime }}</a-descriptions-item>
+              <a-descriptions-item label="维修结束时间">{{ model.repairEndTime }}</a-descriptions-item>
+              <a-descriptions-item label="维修耗时">{{ model.repairMinutes }}小时</a-descriptions-item>
+              <a-descriptions-item label="维修人员">{{ model.repairUserName }}</a-descriptions-item>
+              <!--<a-descriptions-item label="维修次数">{{ model.repairTimes }}</a-descriptions-item>-->
+              <a-descriptions-item label="维修描述" :span="2">{{ model.repairContent }}</a-descriptions-item>
+              <a-descriptions-item label="报修图片" :span="3">
+                <div v-if="model.repairFileList != null && model.repairFileList.length > 0">
+                  <viewer :images="model.repairFileList" @inited="inited" ref="viewer" :index="1" >
+                    <img
+                      v-for="item in model.repairFileList"
+                      :src="item.url"
+                      :key="item.id"
+                      class="image"
+                      width="200px"
+                      style="margin:10px;">
+                  </viewer></div>
+                <div v-if="model.repairFileList == null || model.repairFileList.length === 0"> 暂无</div>
+              </a-descriptions-item>
+            </a-descriptions>
+          </div>
+        </div>
+        <div class="main gutter-color" v-show="current == 2">
+          <div class="title">审核详情</div>
+          <a-descriptions bordered>
+            <a-descriptions-item label="审核开始时间">{{ model.checkStartTime }}</a-descriptions-item>
+            <a-descriptions-item label="审核结束时间">{{ model.checkEndTime }}</a-descriptions-item>
+            <a-descriptions-item label="审核人员">{{ model.checkUserName }}</a-descriptions-item>
+            <a-descriptions-item label="审核描述" :span="3">{{ model.checkContent }}</a-descriptions-item>
+            <a-descriptions-item label="审核图片" :span="3">
+              <div v-if="model.checkFileList != null && model.checkFileList.length > 0">
+                <viewer :images="model.checkFileList" @inited="inited" ref="viewer" :index="1" >
+                  <img
+                    v-for="item in model.checkFileList"
+                    :src="item.url"
+                    :key="item.id"
+                    class="image"
+                    width="200px"
+                    style="margin:10px;">
+                </viewer></div>
+              <div v-if="model.checkFileList == null || model.checkFileList.length === 0"> 暂无</div>
+            </a-descriptions-item>
+          </a-descriptions >
+        </div>
+        <div class="main gutter-color" v-show="current == 4">
+          <div class="title">备件清单</div>
+          <div style="margin:20px;" class="table-operator" v-if="$auth('repair-application-forms-finish')">
             <a-button type="primary" @click="handleSpareStoreSelect(1)">
               <a-icon type="plus"/>
               更换专用备件
@@ -134,7 +180,7 @@
             <span slot="actionSpare" slot-scope="record">
               <template>
                 <a v-if="$auth('repair-application-forms-finish') && record.isSpecial === 0" @click="handleEditSpare(record)">修改</a>
-<!--                <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否替换该备件?" @confirm="updateSpare(record)">
+                <!--                <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否替换该备件?" @confirm="updateSpare(record)">
                   <a>更换备件</a>
                 </a-popconfirm>-->
                 <a-divider type="vertical" />
@@ -144,9 +190,10 @@
               </template>
             </span>
           </a-table>
-        </q-tab-pane>
-        <q-tab-pane key="2" tab="费用清单">
-          <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
+        </div>
+        <div class="main gutter-color" v-show="current == 5">
+          <div class="title">费用清单</div>
+          <div style="margin:20px;" class="table-operator" v-if="$auth('repair-application-forms-finish')">
             <a-button type="primary" @click="handleAddFee">
               <a-icon type="plus"/>
               添加
@@ -168,9 +215,10 @@
               </template>
             </span>
           </a-table>
-        </q-tab-pane>
-        <q-tab-pane key="3" tab="维修报告">
-          <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))">
+        </div>
+        <div class="main gutter-color" v-show="current == 6">
+          <div class="title">维修报告</div>
+          <div style="margin:20px;" class="table-operator" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))">
             <a-button type="primary" @click="handleAddReason">
               <a-icon type="plus"/>
               添加
@@ -196,24 +244,25 @@
               </template>
             </span>
           </a-table>
-        </q-tab-pane>
-      </q-tabs>
-      <!--      <title-divider title="备件清单" width="90px"></title-divider>
-
-      <title-divider title="费用清单" width="90px"></title-divider>
-
-      <title-divider title="维修报告" width="90px"></title-divider>-->
-
-    <!--    <q-tabs :activeKey="activeKey" @change="changeTab">
-      <q-tab-pane key="a" tab="配件更换">
-       <spare-part-used-select-table :type="2" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
-     </q-tab-pane>
-      <q-tab-pane key="b" tab="备件领用">
-        <spare-pick-form-select-table :type="2" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
-      </q-tab-pane>
-    </q-tabs>-->
-
-    </a-card>
+        </div>
+      </div>
+      <div class="btn">
+        <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
+        <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
+        <a-button v-if="$auth('repair-application-forms-assign') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派工</a-button>
+        <!-- <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status)" title="是否要接收?" @confirm="receive">
+        <a-button style="margin-left: 8px">接收</a-button>
+      </a-popconfirm> -->
+        <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="default" @click="handleOut">委外</a-button>
+        <a-button v-if="$auth('repair-application-forms-dispatch') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status" style="margin-left: 8px" type="default" @click="handleDispatch">转派</a-button>
+        <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成</a-button>
+        <a-button v-if="$auth('repair-application-forms-edit')" style="margin-left: 8px" type="default" @click="handleEdit()">修改</a-button>
+        <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
+          <a-button style="margin-left: 8px" type="default">提交审核</a-button>
+        </a-popconfirm>
+        <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
+      </div>
+    </div>
     <check-form ref="checkForm" @ok="handleOk" />
     <base-out-form ref="outForm" @ok="handleCancel" />
     <finish-form ref="finishForm" @ok="handleOk" />
@@ -235,7 +284,7 @@
 </template>
 
 <script>
-import { stringify } from 'qs'
+// import { stringify } from 'qs'
 import DetailList from '@/components/tools/DetailList'
 import { fetchRepairApplicationForm, examine, approve, receive } from '@/api/repair/application-form'
 import CheckForm from './CheckForm'
@@ -298,6 +347,7 @@ export default {
     return {
       confirmLoading: false,
       mdl: {},
+      current: 0,
       modalTitle: null,
       needStopMap: {},
       planFlagMap: {},
@@ -552,9 +602,9 @@ export default {
       selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
         this.dataSpare = res.data
       })
-      /*selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
+      /* selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
         this.dataSpare = res.data
-      })*/
+      }) */
       queryRepairFee({ repairId: this.model.id }).then(res => {
         this.dataFee = res.data
       })
@@ -574,6 +624,7 @@ export default {
     },
     handleCancel () {
       this.visible = false
+      this.current = 0
       this.confirmLoading = false
       this.$emit('ok')
     },
@@ -803,7 +854,7 @@ export default {
       })
     },
     handleSpareStoreSelect (isSpecial) {
-      //this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
+      // this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
       this.$refs.spareStoreSelectModal.base({}, { repairFlag: 1, storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
     },
     handleSpareStoreSelected (record, keys, rows) {
@@ -839,27 +890,49 @@ export default {
   }
 }
 </script>
-<style scoped>
-/* For demo */
-.ant-carousel {
-  width: 300px;
-  height: 300px;
+
+<style lang="less" scoped>
+.gutter-box{
+  height: 350px;
 }
-.ant-carousel >>> .slick-slide {
-  text-align: center;
-  height: 300px;
-  line-height: 300px;
-  overflow: hidden;
+.gutter-color{
+  background: #fff;
+  border: 1px solid #DDDDDD;
 }
-
-.ant-carousel >>> .slick-slide h3 {
-  color: #fff;
+.gutter-btn{
+  height: 165px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  font-size: 50px;
+  color:#3462FD;
+  &:hover{
+    cursor: pointer;
+  }
 }
-
-.image {
-  width: calc(20% - 10px);
-  cursor: pointer;
-  margin: 5px;
-  display: inline-block;
+.main{
+ margin-top:30px;
+}
+.title{
+ font-size: 28px;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #3462FD;
+ padding:10px 42px;
+ border-bottom: 1px solid #DDDDDD;
+}
+.btn{
+   position: fixed;
+   bottom: 50px;
+   width: 100%;
+    display: flex;
+    justify-content: center;
+}
+.center{
+ display: flex;
+ justify-content: center;
+ align-items: center;
 }
+::-webkit-scrollbar { width: 0; height: 0; color: transparent; }
 </style>

+ 212 - 201
src/views/sb/info/SbInfo.vue

@@ -1,208 +1,220 @@
 <template>
-  <a-card :bordered="false">
-    <a-row :gutter="8" v-show="visible">
-      <a-col :span="24">
-        <div>
-          <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-              <a-row :gutter="48">
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="关键字">
-                    <a-input v-model.trim="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-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="第一维修人">
-                    <a-input v-model="queryParam.repairUserName" placeholder="第一维修人"/>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="第二维修人">
-                    <a-input v-model="queryParam.repairUserSecondName" placeholder="第二维修人"/>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="设备等级">
-                    <a-select v-model="queryParam.level" 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>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="自定义类型">
-                    <a-select v-model="queryParam.useType" placeholder="请选择">
-                      <a-select-option
-                        v-for="(label,value) in useTypeMap"
-                        :key="value"
-                        :label="label"
-                        :value="parseInt(value)">{{ label }}
-                      </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.model" placeholder="规格型号"/>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="设备位置">
-                    <a-select v-model="queryParam.positionId" placeholder="请选择">
-                      <a-select-option
-                        v-for="({id,name}) in sbPositionData"
-                        :key="id"
-                        :label="name"
-                        :value="id">{{ 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.producerName" 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="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"
-                        :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
-                        :label="label"
-                        :value="parseInt(value)">{{ label }}
-                      </a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="主子设备">
-                    <a-select v-model="queryParam.isChild" placeholder="请选择">
-                      <a-select-option value="1">子设备</a-select-option>
-                      <a-select-option value="2">父设备</a-select-option>
-                      <a-select-option value="3">普通设备</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6 || 24" :sm="24">
-                  <span class="table-page-search-submitButtons">
-                    <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
-                  </span>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
+  <div>
+    <a-card :bordered="false" v-show="visible">
+      <a-row :gutter="8" >
+        <!--      <a-col :span="4">
+        <a-tree
+          @expand="onExpand"
+          :expandedKeys="expandedKeys"
+          :autoExpandParent="true"
+          @select="onSelect"
+          :selectedKeys="selectedKeys"
+          :treeData="treeData"
+        />
+      </a-col>-->
+        <a-col :span="24">
+          <div>
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline">
+                <a-row :gutter="48">
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="关键字">
+                      <a-input v-model.trim="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-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="第一维修人">
+                      <a-input v-model="queryParam.repairUserName" placeholder="第一维修人"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="第二维修人">
+                      <a-input v-model="queryParam.repairUserSecondName" placeholder="第二维修人"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="设备等级">
+                      <a-select v-model="queryParam.level" 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>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="自定义类型">
+                      <a-select v-model="queryParam.useType" placeholder="请选择">
+                        <a-select-option
+                          v-for="(label,value) in useTypeMap"
+                          :key="value"
+                          :label="label"
+                          :value="parseInt(value)">{{ label }}
+                        </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.model" placeholder="规格型号"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="设备位置">
+                      <a-select v-model="queryParam.positionId" placeholder="请选择">
+                        <a-select-option
+                          v-for="({id,name}) in sbPositionData"
+                          :key="id"
+                          :label="name"
+                          :value="id">{{ 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.producerName" 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="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"
+                          :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
+                          :label="label"
+                          :value="parseInt(value)">{{ label }}
+                        </a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="主子设备">
+                      <a-select v-model="queryParam.isChild" placeholder="请选择">
+                        <a-select-option value="1">子设备</a-select-option>
+                        <a-select-option value="2">父设备</a-select-option>
+                        <a-select-option value="3">普通设备</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6 || 24" :sm="24">
+                    <span class="table-page-search-submitButtons">
+                      <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                      <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+                    </span>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
 
-          <div class="table-operator" style="margin-bottom: 8px;">
-            <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
-            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
-            <a-button style="margin-left:8px;" type="primary" @click="doImport">
-              <a-icon type="upload"/>
-              新增导入
-            </a-button>
-            <a-button style="margin-left:8px;" type="primary" @click="doImportForUpdate">
-              <a-icon type="upload"/>
-              修改导入
-            </a-button>
-            <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
-            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
-            <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
-              <a-menu slot="overlay">
-                <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
-                  <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
-                </a-popconfirm>
-              </a-menu>
-              <a-button style="margin-left: 8px">
-                批量操作 <a-icon type="down" />
+            <div class="table-operator" style="margin-bottom: 8px;">
+              <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
+              <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+              <a-button style="margin-left:8px;" type="primary" @click="doImport">
+                <a-icon type="upload"/>
+                新增导入
               </a-button>
-            </a-dropdown>
-          </div>
+              <a-button style="margin-left:8px;" type="primary" @click="doImportForUpdate">
+                <a-icon type="upload"/>
+                修改导入
+              </a-button>
+              <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
+              <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
+              <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
+                <a-menu slot="overlay">
+                  <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
+                    <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
+                  </a-popconfirm>
+                </a-menu>
+                <a-button style="margin-left: 8px">
+                  批量操作 <a-icon type="down" />
+                </a-button>
+              </a-dropdown>
+            </div>
 
-          <s-table
-            ref="table"
-            size="default"
-            rowKey="id"
-            :widthSpace="true"
-            :columns="columns"
-            :data="loadData"
-            :alert="options.alert"
-            :rowSelection="options.rowSelection"
-            :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
-            showPagination="auto"
-          >
-            <span slot="action" slot-scope="record">
-              <template>
-                <div>
-                  <!--<a-divider type="vertical" />
+            <s-table
+              ref="table"
+              size="default"
+              rowKey="id"
+              :widthSpace="true"
+              :columns="columns"
+              :data="loadData"
+              :alert="options.alert"
+              :rowSelection="options.rowSelection"
+              :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
+              showPagination="auto"
+            >
+              <span slot="action" slot-scope="record">
+                <template>
+                  <div>
+                    <!--<a-divider type="vertical" />
                     <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要删除该设备?" @confirm="batchDelete(record.id)">
                       <a>删除</a>
                     </a-popconfirm>
                     <a-divider type="vertical" />
                     <a @click="handleCopy(record)">复制</a>-->
-                  <a-dropdown>
-                    <a-menu slot="overlay">
-                      <a-menu-item key="0">
-                        <a @click="handleView(record)">查看</a>
-                      </a-menu-item>
-                      <a-menu-item key="1">
-                        <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
-                      </a-menu-item>
-                      <a-menu-item v-if="record.status != 2" key="2">
-                        <a-popconfirm title="是否要启用该设备?" @confirm="handleStart(record)">
-                          <a>启用</a>
-                        </a-popconfirm>
-                      </a-menu-item>
-                      <a-menu-item v-if="record.status != 7" key="3">
-                        <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
-                          <a>停用</a>
-                        </a-popconfirm>
-                      </a-menu-item>
-                      <a-menu-item key="10">
-                        <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
-                      </a-menu-item>
-                      <a-menu-item key="4">
-                        <a @click="handlePrint(record)">打印</a>
-                      </a-menu-item>
-                    </a-menu>
-                    <a-button> 操作 <a-icon type="down" /> </a-button>
-                  </a-dropdown>
-                </div>
-              </template>
-            </span>
-            <span slot="status" slot-scope="text">
-              <badge
-                :status="DictCache.COLOR.SB_INFO_STATUS[text]"
-                :text="statusMap[text]" />
-            </span>
-          </s-table>
-        </div>
-      </a-col>
-    </a-row>
+                    <a-dropdown>
+                      <a-menu slot="overlay">
+                        <a-menu-item key="0">
+                          <a @click="handleView(record)">查看</a>
+                        </a-menu-item>
+                        <a-menu-item key="1">
+                          <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+                        </a-menu-item>
+                        <a-menu-item v-if="record.status != 2" key="2">
+                          <a-popconfirm title="是否要启用该设备?" @confirm="handleStart(record)">
+                            <a>启用</a>
+                          </a-popconfirm>
+                        </a-menu-item>
+                        <a-menu-item v-if="record.status != 7" key="3">
+                          <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
+                            <a>停用</a>
+                          </a-popconfirm>
+                        </a-menu-item>
+                        <a-menu-item key="10">
+                          <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
+                        </a-menu-item>
+                        <a-menu-item key="4">
+                          <a @click="handlePrint(record)">打印</a>
+                        </a-menu-item>
+                      </a-menu>
+                      <a-button> 操作 <a-icon type="down" /> </a-button>
+                    </a-dropdown>
+                  </div>
+                </template>
+              </span>
+              <span slot="status" slot-scope="text">
+                <badge
+                  :status="DictCache.COLOR.SB_INFO_STATUS[text]"
+                  :text="statusMap[text]" />
+              </span>
+            </s-table>
+          </div>
+        </a-col>
+      </a-row>
+    </a-card>
     <base-form ref="baseModal" :parent-id="queryParam.parentId" :parent-name="queryParam.parentName" @ok="handleOk"/>
     <base-form-status-log ref="baseModalStatusLog" @ok="handleOk"/>
     <detail ref="detailModal" @ok="handleOk"/>
@@ -212,8 +224,7 @@
     <import-form-update ref="importModalUpdate" @ok="handleOk"/>
     <print-sb-code ref="printSbCode"/>
     <print-in-sb-info-batch ref="printInSbInfoBatch" @ok="handleOk"/>
-  </a-card>
-
+  </div>
 </template>
 
 <script>
@@ -535,6 +546,9 @@ export default {
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
     this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
     this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
+    querySbPosition().then(res => {
+      this.sbPositionData = res.data
+    })
   },
   methods: {
     tableOption () {
@@ -695,9 +709,6 @@ export default {
       fetchSbTypeTree().then(res => {
         this.treeData = res.data
       })
-      querySbPosition().then(res => {
-        this.sbPositionData = res.data
-      })
     },
     onSelect: function (selectedKeys, info) {
       this.selectedKeys = selectedKeys

+ 1544 - 0
src/views/sb/info/modules/BaseForm copy.vue

@@ -0,0 +1,1544 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button type="primary" @click="save()">提交</a-button>
+          <a-button style="margin-left: 8px" @click="handleFresh()">刷新位置</a-button>
+          <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+
+    <title-divider title="基本信息" width="90px"></title-divider>
+    <a-form :form="form">
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['parentId']" type="hidden"/>
+      </a-form-item>
+
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备编号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['no', {rules: [{required: true, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备(旧号)"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['zbh', {rules: [{required: false, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备名称"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['name', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="型号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="是否固定资产"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['isFinancing', { rules: [{required: true, message: '是否显示不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in isFinancingMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <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>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备价格"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+
+          >
+            <a-input-number
+              style="width: 100%"
+              :min="0"
+              :step="0.01"
+              :formatter="BaseTool.Amount.formatter"
+              :parser="BaseTool.Amount.parser"
+              v-decorator="['initialValue', {rules: [{required: true, message: '设备原值不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备类型"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-tree-select
+              style="width: 100%"
+              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+              :treeData="sbTypeTreeData"
+              :treeNodeFilterProp="'title'"
+              :showSearch="true"
+              v-decorator="['typeId', {rules: [{required: true, message: '设备类型不能为空'}]}]"
+              placeholder="请选择"
+            >
+            </a-tree-select>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="自定义类型"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="handleChange" v-decorator="['useType', {rules: [{required: true, message: '自定义类型不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in useTypeMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="状态"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['status', {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>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="大小/尺寸"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['zz']" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="系列号(出厂编号)"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['zzh']" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <!--        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="使用位置"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['cph']" />
+          </a-form-item>
+        </a-col>-->
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="生产商"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select
+              show-search
+              option-filter-prop="children"
+              :filter-option="filterOptionProducer"
+              v-decorator="['producerId']"
+              placeholder="请选择">
+              <a-select-option
+                v-for="({id, name}) in producerList"
+                :key="id"
+                :label="name"
+                :value="id">{{ name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item
+            label="生产商"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+            v-show="false"
+          >
+            <a-input
+              v-decorator="['producerId', {rules: [{required: true, message: '生产商不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="父设备"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              style="width: 60%"
+              v-decorator="['parentSbName']"/>
+            <a-button type="primary" style="width: 20%" @click="handleSbSelect">选择</a-button>
+            <a-button type="default" style="width: 20%" @click="clearParent">清空</a-button>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="是否子设备"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="childChange" v-decorator="['isChild', { rules: [{required: true, message: '是否子设备不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in isChildMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <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="['positionId', {rules: [{required: false, message: '上层位置不能为空'}]}]"
+              placeholder="请选择"
+            >
+            </a-tree-select>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="是否显示"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['isShow', { rules: [{required: true, message: '是否显示不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in isShowMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="水平位置"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input-number
+              :step="1"
+              :min="85"
+              style="width:70%"
+              v-decorator="['zjm']"
+              placeholder="请输入离屏幕左上角的右方距离,最低85"/>
+            <a-button style="width: 30%" type="primary" @click="handlePoint">设置预览</a-button>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="垂直位置"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input-number
+              :step="1"
+              :min="340"
+              style="width:70%"
+              v-decorator="['jbdh']"
+              placeholder="请输入离屏幕左上角的下方位置,最低340"/>
+            <a-button style="width: 30%" type="primary" @click="handlePoint">设置预览</a-button>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="备注"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="使用机台"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['saveUser', {rules: [{required: true, message: '项目部不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({userId, realName}) in userList"
+                :key="userId"
+                :label="realName"
+                :value="userId">{{ realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <!--      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="所属区域"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="handleAreaChange" v-decorator="['useArea', {rules: [{required: true, message: '所属区域不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({deptId, name}) in areaList"
+                :key="deptId"
+                :label="name"
+                :value="deptId">{{ name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="所属公司"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="handleCompanyChange" v-decorator="['useCompany', {rules: [{required: true, message: '所属公司不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({deptId, name}) in companyList"
+                :key="deptId"
+                :label="name"
+                :value="deptId">{{ name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="所属项目部"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="handleProjectChange" v-decorator="['useProject', {rules: [{required: true, message: '项目部不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({deptId, name}) in projectList"
+                :key="deptId"
+                :label="name"
+                :value="deptId">{{ name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="所属部门"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="handleDeptChange" v-decorator="['useDept', {rules: [{required: true, message: '所属公司不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({deptId, name}) in deptList"
+                :key="deptId"
+                :label="name"
+                :value="deptId">{{ name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>-->
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <!--        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="所属班组"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="handleGroupChange" v-decorator="['useGroup', {rules: [{required: true, message: '项目部不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({deptId, name}) in groupList"
+                :key="deptId"
+                :label="name"
+                :value="deptId">{{ name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>-->
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="维修人"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['repairUser']" placeholder="请选择">
+              <a-select-option
+                v-for="({userId, realName}) in userList"
+                :key="userId"
+                :label="realName"
+                :value="userId">{{ realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="第二维修人员"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['repairUserSecond']" placeholder="请选择">
+              <a-select-option
+                v-for="({userId, realName}) in userList"
+                :key="userId"
+                :label="realName"
+                :value="userId">{{ realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <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="['buyDate', {rules: [{required: true, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <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="['startDate', {rules: [{required: true, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="使用寿命"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 100%"
+              suffix="年"
+              :formatter="BaseTool.Amount.formatter"
+              :parser="BaseTool.Amount.parser"
+              v-decorator="['workYear', {rules: [{required: true, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <title-divider title="自定义参数" width="120px"></title-divider>
+      <div class="table-operator" style="margin-bottom: 8px;">
+        <a-button type="primary" @click="handleParam">
+          <a-icon type="plus"/>
+          添加
+        </a-button>
+      </div>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :key="index" v-for="(item, index) in paramList" :lg="12" :md="24" :sm="24">
+          <a-form-item
+            :label="item.name"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 70%"
+              :defaultValue="item.content"
+              disabled
+            />
+            <a-button style="width: 30%" type="primary" @click="handleDelParam(index)">删除</a-button>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <title-divider title="资产编号" width="90px"></title-divider>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="资产编号1"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['financingNo']" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="资产编号1"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['financingNoTwo']" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="资产编号3"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['financingNoThird']" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="资产编号4"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['financingNoFour']" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="资产编号5"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['financingNoFive']" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <title-divider v-show="useType == 5" title="特种信息" width="90px"></title-divider>
+      <div v-show="useType == 5" >
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="注册代码"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['registerNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="介质属性"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['characterType']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="设备批号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['batchNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="使用登记证编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['usedNo']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="维护供应商"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['supplier']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <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="['registerDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <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="['retirementDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </div>
+      <title-divider v-show="useType == 4" title="计量信息" width="90px"></title-divider>
+      <div v-show="useType == 4" >
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="测量设备编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['cardNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="准确度等级"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['fdjxh']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定单位"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['dph']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定人"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['zaiz']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定结论"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['rlType']" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in rlTypeMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="是否周检查"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['color']" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in colorMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定证书编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['sbdh']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="预警天数"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input-number
+                style="width: 100%"
+                :min="0"
+                :step="0.01"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['seatNumber']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <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="['checkDate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定周期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                style="width: 100%"
+                suffix="月"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['checkPeriod']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <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="['nextCheckDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </div>
+      <title-divider title="文件信息" width="90px"></title-divider>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="维保手册"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="this.defaultRepairFileList"
+              @change="handleRepairFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="使用手册"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="this.defaultUseFileList"
+              @change="handleUseFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="验收文件"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="this.defaultRecheckFileList"
+              @change="handleRecheckFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备图片"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="false"
+              list-type="picture"
+              :file-list="this.defaultSbFileList"
+              @change="handleSbFileChange"
+              accept="image/*"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+    <sb-model-select-modal ref="sbModelSelectModal" @selected="handleSbModelSelected"/>
+    <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+    <firm-producer-select-modal ref="producerSelectModal" @selected="handleProducerSelected"/>
+    <param-form ref="paramForm" @ok="handleParamList" />
+  </a-card>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addSbInfo, updateSbInfo, fetchSbInfo, copySbInfo } from '@/api/sb/info'
+import { fetchSbTypeTree } from '@/api/sb/type'
+import { getSbPositionTree, querySbPosition } from '@/api/sb/position'
+import FirmProducerSelectModal from '@/views/firm/producer/modules/FirmProducerSelectModal'
+import SbGuigeSelectModal from '@/views/sb/guige/modules/SbGuigeSelectModal'
+import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
+import BaseTool from '../../../../utils/tool'
+import { queryUserDeptByUserDeptId } from '@/api/upms/user-dept'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import Vue from 'vue'
+import { uploadUrl } from '@/api/upms/file'
+import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
+import { queryUser } from '@/api/upms/user'
+import DetailList from '@/components/tools/DetailList'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+import ParamForm from './ParamForm'
+import { queryFirmProducer } from '@/api/firm/producer'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'BaseSbInfo',
+  components: {
+    FirmProducerSelectModal,
+    SbGuigeSelectModal,
+    SbModelSelectModal,
+    SbInfoSelectModal,
+    ParamForm,
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      areaList: {},
+      companyList: {},
+      paramList: [],
+      projectList: {},
+      deptList: {},
+      groupList: {},
+      visible: false,
+      sbTypeTreeData: [],
+      sbPositionData: [],
+      // sbInfoTreeData: [],
+      // sourceSbInfoTreeData: [],
+      // sbPositionTreeData: [],
+      depreciationTypeMap: {},
+      sourceTypeMap: {},
+      levelMap: {},
+      rlTypeMap: {},
+      colorMap: {},
+      useTypeMap: {},
+      statusMap: {},
+      isChildMap: {},
+      isShowMap: {},
+      treeData: [],
+      isFinancingMap: {},
+      producerList: {},
+      userList: {},
+      unitMap: {},
+      sbInfoSelectType: null,
+      repairFileList: [], // 维修手册
+      defaultRepairFileList: [],
+      defaultUseFileList: [],
+      defaultRecheckFileList: [],
+      defaultSbFileList: [],
+      useFileList: [], // 使用手册
+      recheckFileList: [], // 验收手册
+      sbFileList: [], // 设备图片,
+      uploadUrl: uploadUrl,
+      qrcodesrc: null,
+      id: null,
+      fileList: [],
+      type: null,
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      }
+    }
+  },
+  props: {
+    useType: {
+      type: Number,
+      default: 3
+    },
+    parentId: {
+      type: String,
+      default: null
+    },
+    parentName: {
+      type: String,
+      default: null
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+    this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
+    this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
+    this.isFinancingMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_FINANCING)
+    queryFirmProducer({}).then(res => {
+      this.producerList = res.data
+    })
+    getSbPositionTree().then(res => {
+      this.treeData = res.data
+    })
+  },
+  methods: {
+    base (record, type) {
+      if (this.parentId) {
+        const { form: { setFieldsValue } } = this
+        // 日期处理
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign({
+            'parentId': this.parentId,
+            'parentSbName': this.parentName,
+            'isChild': this.BaseTool.Object.getField(this.isChildMap, this.DictCache.VALUE.SB_IS_CHILD.IS_CHILD)
+          }))
+        })
+      }
+      this.setTree(record)
+      // 清除文件列表
+      this.visible = true
+      // 选择框查询条件
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.qrcodesrc = null
+        this.modalTitle = '添加'
+        this.clearFileList()
+        return
+      }
+      this.useType = record.useType
+      this.modalTitle = '编辑'
+      this.id = record.id
+      this.qrcodesrc = record.qrCode
+      this.repairFileList = record.repairFileList
+      this.useFileList = record.useFileList
+      this.recheckFileList = record.recheckFileList
+      this.sbFileList = record.sbFileList
+      this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
+      this.defaultUseFileList = this.BaseTool.UPLOAD.transImg(this.useFileList)
+      this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
+      this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
+      this.paramList = JSON.parse(record.paramList)
+      if (type === 1) {
+        this.type = type
+        this.modalTitle = '复制'
+        this.qrcodesrc = null
+        record.no = null
+        this.clearFileList()
+      }
+
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      // record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+      // record.lastRepaireTime = this.BaseTool.Moment(record.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.lastBaoyangTime = this.BaseTool.Moment(record.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.buyDate != null) {
+        record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'buyDate'
+          ])))
+        })
+      }
+      if (record.startDate != null) {
+        record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'startDate'
+          ])))
+        })
+      }
+      if (record.checkDate != null) {
+        record.checkDate = this.BaseTool.Moment(record.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'checkDate'
+          ])))
+        })
+      }
+      if (record.nextCheckDate != null) {
+        record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'nextCheckDate'
+          ])))
+        })
+      }
+      if (record.retirementDate != null) {
+        record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'retirementDate'
+          ])))
+        })
+      }
+      if (record.registerDate != null) {
+        record.registerDate = this.BaseTool.Moment(record.registerDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'registerDate'
+          ])))
+        })
+      }
+      record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
+      record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
+
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'no',
+          'parentId',
+          'parentSbName',
+          'isChild',
+          'isShow',
+          'isFinancing',
+          'financingNo',
+          'financingNoTwo',
+          'financingNoThird',
+          'financingNoFour',
+          'financingNoFive',
+          'name',
+          'model',
+          'cph',
+          'positionId',
+          'producerName',
+          'useArea',
+          'useCompany',
+          'useProject',
+          'useDept',
+          'saveUser',
+          'repairUser',
+          'useGroup',
+          'typeId',
+          'level',
+          'initialValue',
+          // 'cutValue',
+          'producerId',
+          // 'sourceType',
+          'unit',
+          'buyDate',
+          'startDate',
+          'zbh',
+          // 'wbFile',
+          // 'useFile',
+          // 'checkFile',
+          // 'sbImage',
+          'status',
+          'remark',
+          'zzh',
+          'zz',
+          'zjm',
+          'jbdh',
+          'useType',
+          'cardNo',
+          'fdjxh',
+          'checkDate',
+          'checkPeriod',
+          'nextCheckDate',
+          'dph',
+          'zaiz',
+          'rlType',
+          'color',
+          'sbdh',
+          'seatNumber',
+          'registerNo',
+          'characterType',
+          'usedNo',
+          'supplier',
+          'repairUserSecond',
+          'batchNo',
+          'workYear',
+          'retirementDate',
+          'registerDate'
+
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期数据的处理
+        values.buyDate = BaseTool.Date.formatter(values.buyDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.startDate = BaseTool.Date.formatter(values.startDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.checkDate = BaseTool.Date.formatter(values.checkDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        if (values.registerDate != null) {
+          values.registerDate = BaseTool.Date.formatter(values.registerDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        }
+        values.lastRepaireTime = this.BaseTool.Date.formatter(values.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.lastBaoyangTime = this.BaseTool.Date.formatter(values.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.spDate = this.BaseTool.Date.formatter(values.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.jbdDate = this.BaseTool.Date.formatter(values.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.sbdDate = this.BaseTool.Date.formatter(values.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.sbDate = this.BaseTool.Date.formatter(values.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+        // 上传文件
+        values.repairFileList = this.repairFileList
+        values.useFileList = this.useFileList
+        values.recheckFileList = this.recheckFileList
+        values.sbFileList = this.sbFileList
+        values.paramList = JSON.stringify(this.paramList)
+        values.useType = this.useType
+        if (values.isChild === '父设备') {
+          values.isChild = 0
+        } else if (values.isChild === '子设备') {
+          values.isChild = 1
+        }
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addSbInfo(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          if (this.type == null) {
+            updateSbInfo(values)
+              .then(() => {
+                this.handleCancel(values)
+              }).catch(() => {
+                this.confirmLoading = false
+              })
+          } else {
+            copySbInfo(values)
+              .then(() => {
+                this.handleCancel(values)
+              }).catch(() => {
+                this.confirmLoading = false
+              })
+          }
+        }
+      })
+    },
+    getQrcodeSrc () {
+      // console.log(111, 22)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    },
+    handleFresh () {
+      fetchSbInfo({ id: this.id }).then(res => {
+        const { form: { setFieldsValue } } = this
+        const record = res.data
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'zjm',
+            'jbdh'
+          ])))
+        })
+      })
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree().then(res => {
+        this.sbTypeTreeData = res.data
+      })
+      querySbPosition().then(res => {
+        this.sbPositionData = res.data
+      })
+      // getSbInfoTree({ id: record.id }).then(res => {
+      //  this.sbInfoTreeData = res.data
+      //  this.sourceSbInfoTreeData = res.data
+      // })
+      // getSbPositionTree().then(res => {
+      //  this.sbPositionTreeData = res.data
+      // })
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+
+      if (record.useArea != null) {
+        getDeptsAllByParentId({ deptId: record.useArea, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+          this.companyList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+          this.projectList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useProject, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+          this.deptList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useDept, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+          this.groupList = res.data
+        })
+        queryUser({ }).then(res => {
+          this.userList = res.data
+        })
+      }
+      queryUser({ }).then(res => {
+        this.userList = res.data
+      })
+    },
+    handleSbModelSelect () {
+      const modal = this.$refs.sbModelSelectModal
+      modal.base()
+    },
+    handleSbModelSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+
+      this.$nextTick(() => {
+        setFieldsValue({
+          'modelId': key,
+          'name': row.name,
+          'model': row.model,
+          'nameModel': row.nameModel,
+          'typeId': row.typeId,
+          'typeName': row.typeName,
+          'level': row.level,
+          'initialValue': row.value,
+          'useType': row.useType,
+          'useTypeName': this.BaseTool.Object.getField(this.useTypeMap, row.useType),
+          'producerId': row.producerId,
+          'producerName': row.producerName,
+          'unit': row.unit,
+          'unitName': this.BaseTool.Object.getField(this.unitMap, row.unit)
+        })
+      })
+    },
+
+    beforeRecheckFileListUpload (file) {
+      const reg = /\.(xls|xlsx)(\?.*)?$/
+      return new Promise((resolve, reject) => {
+        if (reg.test(file.name)) {
+          this.recheckFileList = [file]
+          return true
+        } else {
+          this.$message.error(`请上传正确的xls|xlsx文件`)
+          reject(new Error('请上传正确的xls|xlsx文件'))
+          return false
+        }
+      })
+    },
+    beforeUploadPic (file) {
+      const reg = /\.(jpg|jpeg|png)(\?.*)?$/
+      return new Promise((resolve, reject) => {
+        if (reg.test(file.name)) {
+          this.sbFileList = [file]
+          return true
+        } else {
+          this.$message.error(`请上传正确的jpg|jpeg|png文件`)
+          reject(new Error('请上传正确的jpg|jpeg|png文件'))
+          return false
+        }
+      })
+    },
+    clearFileList () {
+      this.repairFileList = []
+      this.useFileList = []
+      this.recheckFileList = []
+      this.sbFileList = []
+    },
+    handleRepairFileChange (info) {
+      this.defaultRepairFileList = info.fileList
+      this.repairFileList = this.setFileList(info, 1)
+    },
+    handleUseFileChange (info) {
+      this.defaultUseFileList = info.fileList
+      this.useFileList = this.setFileList(info, 2)
+    },
+    handleAreaChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+        this.companyList = res.data
+      })
+    },
+    handleCompanyChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+        this.projectList = res.data
+      })
+    },
+    handleProjectChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+        this.deptList = res.data
+      })
+    },
+    handleDeptChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+        this.groupList = res.data
+      })
+    },
+    handleGroupChange (value) {
+      queryUserDeptByUserDeptId({ deptId: value }).then(res => {
+        this.userList = res.data
+      })
+    },
+    handleRecheckFileChange (info) {
+      this.defaultRecheckFileList = info.fileList
+      this.recheckFileList = this.setFileList(info, 3)
+    },
+    handleSbFileChange (info) {
+      this.defaultSbFileList = info.fileList
+      this.sbFileList = this.setFileList(info, 4)
+    },
+    clearParent () {
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'parentId': null,
+          'parentSbName': null
+        }))
+      })
+    },
+    // 主子设备切换
+    childChange (value) {
+      if (value === this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT || value === this.DictCache.VALUE.SB_IS_CHILD.IS_NORMAL) {
+        const { form: { setFieldsValue } } = this
+        // 日期处理
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign({
+            'parentId': null,
+            'parentSbName': null
+          }))
+        })
+      }
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT })
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'parentId': key,
+          'parentSbName': row.name,
+          'isChild': this.DictCache.VALUE.SB_IS_CHILD.IS_CHILD
+        }))
+      })
+    },
+    handleChange (value) {
+      this.useType = value
+    },
+    handleProducerSelect () {
+      const modal = this.$refs.producerSelectModal
+      modal.base({}, { type: 1 })
+    },
+    handleProducerSelected (record, selectedRowKeys, selectedRow) {
+      const { form: { setFieldsValue } } = this
+      const [ key ] = selectedRowKeys
+      const [ row ] = selectedRow
+      setFieldsValue({
+        'producerId': key,
+        'producerName': row.name
+      })
+    },
+    filterOptionProducer (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    setFileList (info, type) {
+      // { file, fileList }
+
+      const file = info.file
+      // console.log('file: ' + JSON.stringify(file))
+      const fileList = info.fileList
+      // fileList = fileList.slice(-2)
+      // console.log(111, this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type))
+
+      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 null
+      }
+    },
+    handlePoint () {
+      const { form: { getFieldValue } } = this
+      const zjm = getFieldValue('zjm')
+      const jbdh = getFieldValue('jbdh')
+      const a = document.createElement('a')
+      a.href = '/hitch-screen/point.html?id=' + this.id + '&zjm=' + zjm + '&jbdh=' + jbdh
+      a.target = '_blank'
+      a.click()
+    },
+    handleParam () {
+      const modal = this.$refs.paramForm
+      modal.base(this.model)
+    },
+    handleParamList (values) {
+      // console.log(values)
+      if (this.paramList == null) {
+        this.paramList = []
+      }
+      this.paramList.push(values)
+    },
+    handleDelParam (index) {
+      // console.log(index)
+      this.paramList.splice(index, 1)
+    }
+  }
+}
+</script>

Fichier diff supprimé car celui-ci est trop grand
+ 617 - 912
src/views/sb/info/modules/BaseForm.vue


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff