xiongchao 3 년 전
부모
커밋
71668c33dd

+ 1 - 1
src/api/activiti/model.js

@@ -43,7 +43,7 @@ export function addModel (parameter) {
  */
 export function updateModel (parameter) {
   return axios({
-    url: '/act/model/' + parameter.id,
+    url: '/act/model',
     method: 'PUT',
     data: parameter
   })

+ 59 - 0
src/api/sb/info.js

@@ -214,6 +214,23 @@ export function fetchSbInfo (parameter) {
   })
 }
 
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchSbInfos (parameter) {
+  return axios({
+    url: '/sb/infos/code/batch',
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
 /**
  * query list func
  * parameter: { }
@@ -324,3 +341,45 @@ export function importSbInfo (parameter) {
     data: parameter
   })
 }
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSbInfoScrap (parameter) {
+  return axios({
+    url: '/sb/infos/scrap/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * update func 直接提交审批
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSbInfoScrapForAudit (parameter) {
+  return axios({
+    url: '/sb/infos/audit/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * update func 审批
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function auditProcess (parameter) {
+  return axios({
+    url: '/sb/infos/auditProcess/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}

+ 5 - 0
src/router/generator-platform-routers.js

@@ -292,6 +292,11 @@ const constantRouterComponents = {
   'SbStatusLog': () => import('@/views/sb/status-log/SbStatusLog'),
   // 设备停机记录表
   'SbStopLog': () => import('@/views/sb/stop-logs/SbStopLog'),
+
+  // 设备报废
+  'SbInfoScrap': () => import('@/views/sb/scrap/SbInfoScrap'),
+  // 导入
+  'Imp': () => import('@/views/upms/impExcel/Imp')
 }
 
 // 前端未找到页面路由(固定不用改)

+ 15 - 0
src/utils/dict.js

@@ -79,6 +79,7 @@ DictCache.TYPE = {
   SBTYPE_SOURCETYPE: 'SBTYPE_SOURCETYPE', // 设备来源方式
   SBINFO_UNIT: 'SBINFO_UNIT', // 计量单位
   SB_USE_TYPE: 'SB_USE_TYPE', // 自定义类型
+  SB_INFO_AUDIT_NODE: 'SB_INFO_AUDIT_NODE', // 设备报废节点
   SB_IS_CHILD: 'SB_IS_CHILD', // 自定义类型
   SB_IS_SHOW: 'SB_IS_SHOW', // 自定义类型
   PRODUCER_AREA: 'PRODUCER_AREA', // 产地
@@ -294,6 +295,7 @@ DictCache.VALUE = {
     JOB: 3,
     SB_ALLOCATE: 4,
     SB_OIL: 5,
+    SB_SCRAP: 16,
     /**
      * 采购总需求计划审批提醒
      */
@@ -318,6 +320,8 @@ DictCache.VALUE = {
     SB_OIL_OIL: 12,
     SB_OIL_AUDIT_RESULT: 13,
     SB_OIL_OIL_CONFIRM: 14,
+    SB_SCRAP: 16,
+    SB_SCRAP_RESULT: 161,
     REPAIR_RECEIVE: 23,
     /**
      * 采购总需求计划审批提醒
@@ -1323,6 +1327,17 @@ DictCache.COLOR = {
     4: 'error'// 已过期
   },
 
+  /**
+   * 供应商审批节点
+   */
+  SB_INFO_AUDIT_NODE: {
+    0: 'default', // 开始
+    20: 'warning', // 分公司设备主管
+    30: 'warning', // 分公司财务主管
+    40: 'processing', // 分公司分管领导
+    100: 'success'// 完成
+  },
+
   /* 保养润滑模块 */
   /**
    * 保养润滑设备状态

+ 2 - 1
src/views/activiti/model/modules/BaseForm.vue

@@ -1,7 +1,8 @@
 <template>
   <a-modal
     :title="modalTitle"
-    :width="640"
+    width="100%"
+    height="100%"
     :visible="visible"
     :confirmLoading="confirmLoading"
     @cancel="handleCancel"

+ 13 - 22
src/views/activiti/task/MyTask.vue

@@ -35,22 +35,16 @@
       </s-table>
     </div>
     <audit ref="auditModal" @ok="handleOk"/>
-    <purchase-plan-audit-form ref="purchasePlanAuditModal" @ok="handleOk"/>
-    <purchase-apply-audit-form ref="purchaseApplyAuditModal" @ok="handleOk"/>
-    <purchase-demand-plan-audit-form ref="purchaseDemandPlanAuditModal" @ok="handleOk"/>
-    <purchase-demand-plan-audit-add-form ref="purchaseDemandPlanAuditAddModal" @ok="handleOk"/>
     <suplier-audit-form ref="supplierAuditModal" @ok="handleOk"/>
+    <detail-audit-scrap ref="detailAuditScrapModal" @ok="handleOk"/>
   </a-card>
 </template>
 
 <script>
 import { STable, Ellipsis } from '@/components'
 import Audit from '../audit/Audit'
-import PurchasePlanAuditForm from '@/views/purchase/purchase-plan/modules/AuditForm'
-import PurchaseApplyAuditForm from '@/views/purchase/purchase-apply/modules/AuditForm'
-import PurchaseDemandPlanAuditForm from '@/views/purchase/purchase-demand-plan/modules/AuditForm'
-import PurchaseDemandPlanAuditAddForm from '@/views/purchase/purchase-demand-plan/modules/AuditAddForm'
 import SuplierAuditForm from '@/views/purchase/supplier/modules/AuditForm'
+import DetailAuditScrap from '@/views/sb/scrap/modules/DetailAuditScrap'
 import { getTaskPage } from '@/api/activiti/activiti'
 
 export default {
@@ -58,12 +52,9 @@ export default {
   components: {
     STable,
     Ellipsis,
-    PurchasePlanAuditForm,
-    PurchaseApplyAuditForm,
-    PurchaseDemandPlanAuditForm,
     SuplierAuditForm,
-    PurchaseDemandPlanAuditAddForm,
-    Audit
+    Audit,
+    DetailAuditScrap
   },
   data () {
     return {
@@ -85,16 +76,10 @@ export default {
           title: '类型',
           dataIndex: 'targetCode',
           customRender: (text, record, index) => {
-            if (text === 'purchase_plan') {
-              return '采购计划'
-            } else if (text === 'purchase_apply') {
-              return '采购申请'
-            } else if (text === 'purchase_demand_plan') {
-              return '采购总需求计划'
-            } else if (text === 'purchase_demand_plan_add') {
-              return '采购总需求计划增补'
-            } else if (text === 'supplier') {
+            if (text === 'supplier') {
               return '供应商'
+            } else if (text === 'sb_info_scrap') {
+              return '设备报废'
             }
           }
         },
@@ -178,8 +163,14 @@ export default {
         this.$refs.purchaseDemandPlanAuditModal.base(record)
       } else if (record.targetCode === 'purchase_demand_plan_add') {
         this.$refs.purchaseDemandPlanAuditAddModal.base(record)
+      } else if (record.targetCode === 'purchase_bid') {
+        this.$refs.purchaseBidAuditAddModal.base(record)
       } else if (record.targetCode === 'supplier') {
         this.$refs.supplierAuditModal.base(record)
+      } else if (record.targetCode === 'sb_info_scrap') {
+        this.$refs.detailAuditScrapModal.base(record)
+      } else if (record.targetCode === 'sb_info_scrap_second') {
+        this.$refs.detailAuditScrapSecondModal.base(record)
       }
       // this.$refs.auditModal.base(record)
     },

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

@@ -86,7 +86,7 @@
       </a-layout>
       <title-divider title="维修项目" width="90px"></title-divider>
       <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
-        <a-button type="primary" @click="handleRepairProjectSelect">
+        <a-button type="primary" @click="handleRepairProjectAdd">
           <a-icon type="plus"/>
           添加
         </a-button>
@@ -98,7 +98,11 @@
         rowKey="id">
         <span slot="action" slot-scope="record">
           <template>
-            <a-popconfirm 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)" title="是否要删除该条数据?" @confirm="batchDelete(record.relationId)">
+            <a @click="handleView(record)">查看</a>
+            <a-divider type="vertical" />
+            <a @click="handleEdit(record)">修改</a>
+            <a-divider type="vertical" />
+            <a-popconfirm 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)" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
               <a>删除</a>
             </a-popconfirm>
           </template>
@@ -127,34 +131,34 @@
           </template>
         </span>
       </a-table>
-<!--      <title-divider title="费用清单" width="90px" v-if="model.type == 2"></title-divider>-->
-<!--      <div class="table-operator" 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) && model.type === 2">-->
-<!--        <a-button type="primary" @click="handleAddFee">-->
-<!--          <a-icon type="plus"/>-->
-<!--          添加-->
-<!--        </a-button>-->
-<!--      </div>-->
-<!--      <a-table-->
-<!--        v-if="model.type == 2"-->
-<!--        :data-source="dataFee"-->
-<!--        :columns="columnsFee"-->
-<!--        tableLayout="auto"-->
-<!--        rowKey="id">-->
-<!--        <span slot="action" slot-scope="record">-->
-<!--          <template>-->
-<!--            <a @click="handleViewFee(record)">查看</a>-->
-<!--            <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="handleEditFee(record)" >修改</operation-button>-->
+      <!--      <title-divider title="费用清单" width="90px" v-if="model.type == 2"></title-divider>-->
+      <!--      <div class="table-operator" 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) && model.type === 2">-->
+      <!--        <a-button type="primary" @click="handleAddFee">-->
+      <!--          <a-icon type="plus"/>-->
+      <!--          添加-->
+      <!--        </a-button>-->
+      <!--      </div>-->
+      <!--      <a-table-->
+      <!--        v-if="model.type == 2"-->
+      <!--        :data-source="dataFee"-->
+      <!--        :columns="columnsFee"-->
+      <!--        tableLayout="auto"-->
+      <!--        rowKey="id">-->
+      <!--        <span slot="action" slot-scope="record">-->
+      <!--          <template>-->
+      <!--            <a @click="handleViewFee(record)">查看</a>-->
+      <!--            <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="handleEditFee(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)"-->
-<!--              :type="2"-->
-<!--              title="确认删除该笔费用?"-->
-<!--              @confirm="batchDeleteFee(record.id)" >删除</operation-button>-->
-<!--          </template>-->
-<!--        </span>-->
-<!--      </a-table>-->
+      <!--            <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)"-->
+      <!--              :type="2"-->
+      <!--              title="确认删除该笔费用?"-->
+      <!--              @confirm="batchDeleteFee(record.id)" >删除</operation-button>-->
+      <!--          </template>-->
+      <!--        </span>-->
+      <!--      </a-table>-->
       <title-divider title="原因分析" width="90px"></title-divider>
       <div class="table-operator" 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)">
         <a-button type="primary" @click="handleAddReason">
@@ -198,8 +202,6 @@
     <dispatch-form ref="dispatchForm" @ok="handleCancel" />
     <assign-form ref="assignForm" @ok="handleCancel" />
     <spare-pick-base-form ref="baseModal" @ok="handleOk"/>
-    <repair-project-select-Modal :type="'checkbox'" ref="repairProjectSelectModal" @selected="handleRepairProjectSelected"/>
-    <!--    <spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>-->
     <base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
     <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
     <fee-base-form ref="feeForm" @ok="handleOk" />
@@ -208,6 +210,8 @@
     <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"/>
   </div>
 </template>
 
@@ -223,7 +227,7 @@ 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 { selectRepairProjectListByRepairId, addRepairProjectRelationBatch, deleteRepairProjectRelations } from '@/api/repair/repairprojectrelation'
+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 { selectSparePartUsedListByRepairId, addSparePartUsedBatch, deleteSparePartUseds } from '@/api/sqarepartmanage/sparepartused'
@@ -238,6 +242,8 @@ import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api
 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 {
@@ -262,7 +268,9 @@ export default {
     RepairProjectSelectModal,
     SparePartInfoSelectModal,
     BaseFormForRepair,
-    SpareStoreSelectModal
+    SpareStoreSelectModal,
+    BaseForm,
+    Detail
   },
   data () {
     return {
@@ -298,39 +306,9 @@ export default {
           }
         },
         {
-          title: '编码',
-          dataIndex: 'no'
-        },
-        {
-          title: '名称',
+          title: '维修内容',
           dataIndex: 'name'
         },
-        {
-          title: '维修类别',
-          dataIndex: 'type',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Object.getField(this.repairProjectMap, text)
-          }
-        },
-        {
-          title: '维修工艺',
-          dataIndex: 'technology',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Object.getField(this.repairTechnologyMap, text)
-          }
-        },
-        {
-          title: '标准工时',
-          dataIndex: 'standardHours'
-        },
-        {
-          title: '标准费用',
-          dataIndex: 'standardMoney'
-        },
-        {
-          title: '考核工时',
-          dataIndex: 'checkHours'
-        },
         {
           title: '操作',
           key: 'action',
@@ -523,7 +501,7 @@ export default {
       this.init()
     },
     init () {
-      selectRepairProjectListByRepairId({ id: this.model.id }).then(res => {
+      queryRepairProject({ repairId: this.model.id }).then(res => {
         this.data = res.data
       })
       selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
@@ -681,21 +659,20 @@ export default {
         modal.handleOk()
       }
     },
-    handleRepairProjectSelect () {
-      this.$refs.repairProjectSelectModal.base()
+    handleView (record) {
+      fetchRepairProject({ id: record.id }).then(res => {
+        const modal = this.$refs.detailRepairProjectModal
+        modal.base(res.data)
+      })
     },
-    handleRepairProjectSelected (record, keys, rows) {
-      const data = []
-      for (let i = 0; i < rows.length; i++) {
-        data.push({ repairId: this.model.id, projectId: rows[i].id })
-      }
-      addRepairProjectRelationBatch(data)
-        .then((response) => {
-          this.$message.info('添加成功')
-          this.handleOk()
-        }).catch(() => {
-          this.confirmLoading = false
-        })
+    handleEdit (record) {
+      fetchRepairProject({ id: record.id }).then(res => {
+        const modal = this.$refs.baseRepairProjectModal
+        modal.base(res.data)
+      })
+    },
+    handleRepairProjectAdd () {
+      this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })
     },
     batchDelete (id) {
       let ids = []
@@ -708,7 +685,7 @@ export default {
       } else {
         ids = [id]
       }
-      deleteRepairProjectRelations(ids).then(res => {
+      deleteRepairProjects(ids).then(res => {
         this.$message.info('删除成功')
         this.handleOk()
       })

+ 14 - 9
src/views/repair/repairproject/modules/BaseForm.vue

@@ -9,16 +9,18 @@
     <a-form :form="form">
       <a-form-item v-show="false" >
         <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['repairId']" type="hidden"/>
       </a-form-item>
       <a-form-item
-        label="名称"
+        label="维修内容"
         :labelCol="BaseTool.Constant.labelCol"
         :wrapperCol="BaseTool.Constant.wrapperCol"
       >
-        <a-input
-          v-decorator="['name', {rules: [{required: true, message: '名称不能为空'}]}]" />
+        <a-textarea
+          rows="8"
+          v-decorator="['name', {rules: [{required: true, message: '维修内容不能为空'}]}]" />
       </a-form-item>
-      <a-form-item
+<!--      <a-form-item
         label="编码"
         :labelCol="BaseTool.Constant.labelCol"
         :wrapperCol="BaseTool.Constant.wrapperCol"
@@ -83,7 +85,7 @@
       >
         <a-input
           v-decorator="['remark', {rules: [{required: false, message: '助记码不能为空'}]}]" />
-      </a-form-item>
+      </a-form-item>-->
     </a-form>
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
@@ -126,19 +128,22 @@ export default {
       this.visible = true
       // 如果是空标识添加
       const { form: { setFieldsValue } } = this
-      if (this.BaseTool.Object.isBlank(record)) {
+      if (this.BaseTool.Object.isBlank(record.id)) {
         this.modalTitle = '添加'
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'repairId'
+          ])))
+        })
         return
       }
       this.modalTitle = '编辑'
-      if (this.BaseTool.Object.isBlank(record.id)) {
-        this.modalTitle = '复制'
-      }
       // 日期处理
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
           'id',
           'no',
+          'repairId',
           'name',
           'type',
           'technology',

+ 4 - 4
src/views/repair/repairproject/modules/Detail.vue

@@ -7,15 +7,15 @@
     @cancel="handleCancel"
   >
     <detail-list title="" :col="2">
-      <detail-list-item term="编码">{{ model.no }}</detail-list-item>
-      <detail-list-item term="名称">{{ model.name }}</detail-list-item>
-      <detail-list-item term="维修类别">{{ model.type }}</detail-list-item>
+<!--      <detail-list-item term="编码">{{ model.no }}</detail-list-item>-->
+      <detail-list-item term="维修内容">{{ model.name }}</detail-list-item>
+<!--      <detail-list-item term="维修类别">{{ model.type }}</detail-list-item>
       <detail-list-item term="维修工艺">{{ model.technology }}</detail-list-item>
       <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
       <detail-list-item term="标准费用">{{ model.standardMoney }}</detail-list-item>
       <detail-list-item term="考核工时">{{ model.checkHours }}</detail-list-item>
       <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
-      <detail-list-item term="助记码">{{ model.remark }}</detail-list-item>
+      <detail-list-item term="助记码">{{ model.remark }}</detail-list-item>-->
     </detail-list>
 
     <template slot="footer">

+ 2 - 1
src/views/sb/info/SbInfo.vue

@@ -271,6 +271,7 @@ export default {
           title: '设备原值',
           dataIndex: 'initialValue',
           width: 100,
+          checked: true,
           customRender: (text, record, index) => {
             return this.BaseTool.Amount.formatter(text)
           }
@@ -341,7 +342,7 @@ export default {
           checked: true,
           fixed: 'right',
           align: 'center',
-          width: '100',
+          width: '200',
           scopedSlots: { customRender: 'action' }
         }
       ],

+ 3 - 3
src/views/sb/modelbom/modules/DetailSbBom.vue

@@ -19,10 +19,10 @@
         <a-icon type="plus"/>
         关联BOM
       </a-button>
-      <!--      <a-button style="margin-left:8px;" type="primary" @click="handleSpareSelect">
+      <a-button style="margin-left:8px;" type="primary" @click="handleSpareSelect">
         <a-icon type="plus"/>
-        关联BOM
-      </a-button>-->
+        批量关联BOM
+      </a-button>
       <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
         <a-icon type="plus"/>
         复制BOM

+ 520 - 0
src/views/sb/scrap/SbInfoScrap.vue

@@ -0,0 +1,520 @@
+<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="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-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"
+                        :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">
+          </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>
+                <a @click="handleView(record)">查看</a>
+                <a-divider v-if="record.status != 3 && record.status != 4" type="vertical" />
+                <a v-if="record.status != 3 && record.status != 4" @click="handleEdit(record)">报废</a>
+              </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>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+  </a-card>
+
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import DownloadModal from '@/views/download/DownloadModal'
+import PreviewModal from '@/views/preview/PreviewModal'
+import { updateSbInfo, getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
+import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
+import BaseTool from '../../../utils/tool'
+import { fetchSbTypeTree } from '@/api/sb/type'
+
+export default {
+  name: 'SbInfoList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail,
+    DownloadModal,
+    PreviewModal
+  },
+  props: {
+    filter: {
+      type: Number,
+      default: -1
+    }
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        filter: this.filter
+      },
+      depreciationTypeMap: {},
+      visible: true,
+      levelMap: {},
+      unitMap: {},
+      areaList: {},
+      companyList: {},
+      projectList: {},
+      deptList: {},
+      useTypeMap: {},
+      statusMap: {},
+      expandedKeys: [],
+      selectedKeys: [],
+      sourceTypeMap: {},
+      treeData: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          width: 200,
+          dataIndex: 'name'
+        },
+        {
+          title: '设备编号',
+          dataIndex: 'no',
+          width: 120,
+          checked: true
+        },
+        {
+          title: '设备类型',
+          checked: true,
+          dataIndex: 'type',
+          width: 150,
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '设备等级',
+          checked: true,
+          dataIndex: 'level',
+          width: 120,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '设备原值',
+          dataIndex: 'initialValue',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '购置日期',
+          dataIndex: 'buyDate',
+          width: 120,
+          checked: true
+        },
+        {
+          title: '投用日期',
+          dataIndex: 'startDate',
+          width: 120,
+          checked: true
+        },
+        {
+          title: '检定日期',
+          dataIndex: 'checkDate',
+          width: 150,
+          checked: true
+        },
+        {
+          title: '检定周期',
+          dataIndex: 'checkPeriod',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return text + '月'
+            }
+          }
+        },
+        {
+          title: '检定有效期',
+          dataIndex: 'nextCheckDate',
+          width: 150,
+          fixed: 'right',
+          checked: true
+        },
+        {
+          title: '检定截止',
+          dataIndex: 'restDay',
+          width: 100,
+          fixed: 'right',
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
+            }
+          }
+        },
+        {
+          title: '状态',
+          checked: true,
+          dataIndex: 'status',
+          width: 100,
+          fixed: 'right',
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          fixed: 'right',
+          align: 'center',
+          width: '100',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSbInfoPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    this.tableOption()
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    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)
+  },
+  methods: {
+    tableOption () {
+      this.setTree()
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (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]
+      }
+      deleteSbInfos(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    printQcode (record) {
+      let recordList = []
+      if (this.BaseTool.String.isBlank(record)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要打印的记录')
+          return
+        }
+        recordList = this.selectedRows
+      } else {
+        recordList = [record]
+      }
+      this.$refs.printSbCode.base(recordList)
+    },
+    handleStart (record) {
+      record.status = 2
+      updateSbInfo(record).then(res => {
+        this.$message.info('已启用')
+      })
+    },
+    handleStop (record) {
+      record.status = 7
+      updateSbInfo(record).then(res => {
+        this.$message.info('已停用')
+      })
+    },
+    handleAdd () {
+      this.visible = false
+      this.$refs.baseModal.base()
+    },
+    handleView (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    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
+      })
+    },
+    handleCopy (record) {
+      this.visible = false
+      fetchSbInfo({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        res.data.id = null
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.visible = true
+      this.setTree()
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+        filter: this.filter
+      }
+      this.visible = true
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbInfo(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    setTree (record = {}) {
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+      fetchSbTypeTree().then(res => {
+        this.treeData = res.data
+      })
+    },
+    onSelect: function (selectedKeys, info) {
+      this.selectedKeys = selectedKeys
+      this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
+      this.$refs.table.refresh(true)
+    },
+    onExpand (expandedKeys) {
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    handleRepairFilePreview (record) {
+      console.log(record, 87878)
+      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE)
+    },
+    handleRepairFileDownload (record) {
+      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE, getDownloadUrl(record.id))
+    },
+    handleUseFilePreview (record) {
+      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE)
+    },
+    handleUseFileDownload (record) {
+      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE, getDownloadUrl(record.id))
+    },
+    handleCheckFilePreview (record) {
+      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE)
+    },
+    handleCheckFileDownload (record) {
+      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE, getDownloadUrl(record.id))
+    },
+    doImport () {
+      if (this.queryParam.useCompany == null) {
+        this.$message.error('请先选择公司')
+        return
+      }
+      if (this.queryParam.useProject == null) {
+        this.$message.error('请先选择项目部')
+        return
+      }
+      this.$refs.importModal.base(this.queryParam.useCompany, this.queryParam.useProject)
+    },
+    doImportDe () {
+      this.queryParam.useCompany = null
+      this.queryParam.useProject = null
+      this.$refs.importModal.base()
+    },
+    handlePrint (record) {
+      this.visible = false
+      fetchSbInfo({ id: record.id }).then(res => {
+        const modal = this.$refs.printInSbInfoBatch
+        modal.base([res.data])
+      })
+    },
+    handlePrintBatch () {
+      this.visible = false
+      let ids = []
+      const length = this.selectedRows.length
+      if (length === 0) {
+        this.$message.info('请选择要打印的记录')
+        return
+      }
+      ids = this.selectedRows.map(item => item.id)
+      fetchSbInfos(ids).then(res => {
+        const modal = this.$refs.printInSbInfoBatch
+        modal.base(res.data)
+      })
+    }
+  }
+}
+</script>

+ 833 - 0
src/views/sb/scrap/modules/BaseForm.vue

@@ -0,0 +1,833 @@
+<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="error" @click="updateSbInfoScrapForAudit()">提交审批</a-button>
+          <a-button style="margin-left: 8px" type="primary" @click="save()">保存</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="['modelId']" type="hidden"/>
+        <a-input v-decorator="['typeId']" type="hidden"/>
+        <a-input v-decorator="['producerId']" type="hidden"/>
+        <a-input v-decorator="['level']" type="hidden"/>
+        <a-input v-decorator="['useType']" 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
+              disabled
+              v-decorator="['typeName']" />
+          </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
+              v-decorator="['model']" />
+          </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
+              disabled
+              v-decorator="['producerName']" />
+          </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
+              v-decorator="['name']" />
+          </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
+              disabled
+              v-decorator="['useTypeName']" />
+          </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
+              v-decorator="['unit']" />
+          </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
+              disabled
+              v-decorator="['levelName']" />
+          </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="设备新号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              v-decorator="['no', {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-input
+              disabled
+              v-decorator="['zbh']" />
+          </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
+              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-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="['currentValue', {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
+              :min="0"
+              :step="0.01"
+              :formatter="BaseTool.Amount.formatter"
+              :parser="BaseTool.Amount.parser"
+              v-decorator="['rate']" />
+          </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
+              :min="0"
+              :step="1"
+              :formatter="BaseTool.Amount.formatter"
+              :parser="BaseTool.Amount.parser"
+              v-decorator="['month']" />
+          </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
+              :min="0"
+              :step="1"
+              :formatter="BaseTool.Amount.formatter"
+              :parser="BaseTool.Amount.parser"
+              v-decorator="['usedMonth']" />
+          </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-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="助记码"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['zjm']" />
+          </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-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="购置日期"
+            :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>
+      <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"
+              list-type="picture"
+              :multiple="true"
+              :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"/>
+  </a-card>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { updateSbInfoScrap, updateSbInfoScrapForAudit } from '@/api/sb/info'
+import { fetchSbTypeTree } from '@/api/sb/type'
+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 SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+
+export default {
+  name: 'BaseSbInfo',
+  components: {
+    FirmProducerSelectModal,
+    SbGuigeSelectModal,
+    SbModelSelectModal,
+    SbInfoSelectModal
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+
+      areaList: {},
+      companyList: {},
+      projectList: {},
+      deptList: {},
+      groupList: {},
+      visible: false,
+
+      sbTypeTreeData: [],
+      // sbInfoTreeData: [],
+      // sourceSbInfoTreeData: [],
+      // sbPositionTreeData: [],
+      depreciationTypeMap: {},
+      sourceTypeMap: {},
+      levelMap: {},
+      rlTypeMap: {},
+      colorMap: {},
+      useTypeMap: {},
+      statusMap: {},
+      userList: {},
+      unitMap: {},
+      sbInfoSelectType: null,
+      repairFileList: [], // 维修手册
+      defaultRepairFileList: [],
+      defaultUseFileList: [],
+      defaultRecheckFileList: [],
+      defaultSbFileList: [],
+      useFileList: [], // 使用手册
+      recheckFileList: [], // 验收手册
+      sbFileList: [], // 设备图片,
+      uploadUrl: uploadUrl,
+      qrcodesrc: null,
+      fileList: [],
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      }
+    }
+  },
+  props: {
+  },
+  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)
+  },
+  methods: {
+    base (record) {
+      this.setTree(record)
+      // 清除文件列表
+      this.visible = true
+      // 选择框查询条件
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.qrcodesrc = null
+        this.modalTitle = '添加'
+        this.clearFileList()
+        return
+      }
+      this.modalTitle = '设备报废'
+      this.qrcodesrc = record.qrCode
+      this.repairFileList = record.repairFileList
+      this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
+      this.useFileList = record.useFileList
+      this.recheckFileList = record.recheckFileList
+      this.sbFileList = record.sbFileList
+      this.defaultUseFileList = this.BaseTool.UPLOAD.transImg(this.useFileList)
+      this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
+      this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
+
+      // if (this.BaseTool.Object.isBlank(record.id)) {
+      // 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)
+
+      if (record.isChild === 1) {
+        record.isChild = this.DictCache.VALUE.SB_IS_CHILD.IS_CHILD
+      }
+      if (record.isChild === 2) {
+        record.isChild = this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT
+      }
+      if (record.isChild === 3) {
+        record.isChild = this.DictCache.VALUE.SB_IS_CHILD.IS_NORMAL
+      }
+      // 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.jbdDate != null) {
+        record.jbdDate = this.BaseTool.Moment(record.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'jbdDate'
+          ])))
+        })
+      }
+      if (record.sbdDate != null) {
+        record.sbdDate = this.BaseTool.Moment(record.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'sbdDate'
+          ])))
+        })
+      }
+      if (record.sbDate != null) {
+        record.sbDate = this.BaseTool.Moment(record.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'sbDate'
+          ])))
+        })
+      }
+      if (record.spDate != null) {
+        record.spDate = this.BaseTool.Moment(record.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'spDate'
+          ])))
+        })
+      }
+      record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
+      record.levelName = this.BaseTool.Object.getField(this.levelMap, record.level)
+      record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
+
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'no',
+          'parentId',
+          'parentSbName',
+          'isChild',
+          'isShow',
+          'cardNo',
+          'financingNo',
+          'name',
+          'model',
+          'positionId',
+          'nameModel',
+          'rate',
+          'month',
+          'usedMonth',
+          'producerName',
+          'useArea',
+          'useCompany',
+          'useProject',
+          'useDept',
+          'saveUser',
+          'useGroup',
+          'modelId',
+          'typeId',
+          'typeName',
+          'level',
+          'levelName',
+          'unitName',
+          'useTypeName',
+          'initialValue',
+          'currentValue',
+          // 'cutValue',
+          'producerId',
+          // 'sourceType',
+          'unit',
+          'totalMiles',
+          'totalHours',
+
+          'buyDate',
+          'startDate',
+
+          // 'wbFile',
+          // 'useFile',
+          // 'checkFile',
+          // 'sbImage',
+          'status',
+          'remark',
+          'zzh',
+          'fdjxh',
+          'fdjh',
+          'cph',
+          'dph',
+          'zz',
+          'rlType',
+          'color',
+          'seatNumber',
+          'zjm',
+          'jbdh',
+          'sbdh',
+          'bxgs',
+          'useType'
+
+        ])))
+      })
+    },
+    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.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)
+
+        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.level = this.level
+        values.useType = this.useType
+        values.unit = this.unit
+        updateSbInfoScrap(values)
+          .then(() => {
+            this.handleCancel(values)
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+      })
+    },
+    updateSbInfoScrapForAudit () {
+      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.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)
+
+        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.level = this.level
+        values.useType = this.useType
+        values.unit = this.unit
+        updateSbInfoScrapForAudit(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')
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree().then(res => {
+        this.sbTypeTreeData = 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
+        })
+        queryUserDeptByUserDeptId({ deptId: record.useGroup }).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,
+          'levelName': this.BaseTool.Object.getField(this.levelMap, 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)
+    },
+    setFileList1 (info, type) {
+      const fileList = [...info.fileList]
+      const file = [...info.file]
+      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 []
+      }
+    },
+    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
+        }))
+      })
+    },
+    setFileList (info, type) {
+      // { file, fileList }
+
+      const file = info.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
+      }
+
+      // return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+
+      // 1. Limit the number of uploaded files
+      //    Only to show two recent uploaded files, and old ones will be replaced by the new
+      // fileList = fileList.slice(-2)
+
+      // 2. read from response and show file link
+      // fileList = fileList.map(file => {
+      //   if (file.response) {
+      //     // Component will show file.url as link
+      //     const { response: { data } } = file
+      //     file.url = data.url
+      //     file.fileName = data.fileName
+      //     file.fileFormat = data.fileFormat
+      //     file.name = data.name
+      //     file.type = type
+      //   }
+      //   return file
+      // })
+      // console.log(6666, fileList)
+      // return fileList
+    }
+  }
+}
+</script>

+ 370 - 0
src/views/sb/scrap/modules/Detail.vue

@@ -0,0 +1,370 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <div v-show="visible2" >
+      <a-row :gutter="48" slot="extra">
+        <a-col :md="48" :sm="48">
+          <span class="table-page-search-submitButtons" style="float: right">
+            <a-button type="error" :loading="confirmLoading" v-if="model.status != 3 && model.status != 4" @click="updateSbInfoScrapForAudit()">提交审批</a-button>
+            <!--            <a-button style="margin-left: 8px" type="primary" @click="handlePrint()">打印</a-button>-->
+            <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+          </span>
+        </a-col>
+      </a-row>
+      <title-divider title="型号信息" width="90px"></title-divider>
+      <detail-list title="" :col="3">
+        <detail-list-item term="型号">{{ model.model }}</detail-list-item>
+        <detail-list-item term="名称型号">{{ model.nameModel }}</detail-list-item>
+        <detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
+        <detail-list-item term="设备类型">{{ model.typeName }}</detail-list-item>
+        <detail-list-item term="自定义类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</detail-list-item>
+        <detail-list-item term="设备等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
+        <detail-list-item term="生产商">{{ model.producerName }}</detail-list-item>
+        <detail-list-item term="计量单位">{{ model.unit }}</detail-list-item>
+        <detail-list-item term="设备原值">{{ BaseTool.Amount.formatter(model.initialValue) }}</detail-list-item>
+        <detail-list-item term="当前价值">{{ BaseTool.Amount.formatter(model.currentValue) }}</detail-list-item>
+        <detail-list-item term="已折旧价值">{{ BaseTool.Amount.formatter(model.cutValue) }}</detail-list-item>
+        <detail-list-item term="净残值率">{{ BaseTool.Amount.formatter(model.rate) }}</detail-list-item>
+        <detail-list-item term="折旧总计月份">{{ BaseTool.Amount.formatter(model.month) }}</detail-list-item>
+        <detail-list-item term="已计提月份">{{ BaseTool.Amount.formatter(model.usedMonth) }}</detail-list-item>
+      </detail-list>
+
+      <title-divider title="基本信息" width="90px"></title-divider>
+      <detail-list title="" :col="3">
+        <detail-list-item term="设备编号">{{ model.no }}</detail-list-item>
+        <detail-list-item term="财务编码">{{ model.financingNo }}</detail-list-item>
+        <detail-list-item term="卡片编号">{{ model.cardNo }}</detail-list-item>
+        <detail-list-item term="车牌号">{{ model.cph }}</detail-list-item>
+        <detail-list-item term="资产现状说明">{{ model.remark }}</detail-list-item>
+        <detail-list-item term="使用公司">{{ model.useCompanyName }}</detail-list-item>
+        <detail-list-item term="使用项目部">{{ model.useProjectName }}</detail-list-item>
+        <detail-list-item term="购置日期">{{ model.buyDate }}</detail-list-item>
+        <detail-list-item term="投用日期">{{ model.startDate }}</detail-list-item>
+        <detail-list-item term="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></detail-list-item>
+      </detail-list>
+      <title-divider title="资产图片" width="90px"></title-divider>
+      <detail-list title="" :col="6">
+        <detail-list-item v-show="model.sbFileList!=null && model.sbFileList.length>0">
+          <a-upload
+            list-type="picture-card"
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.sbFileList)"
+          >
+          </a-upload>
+        </detail-list-item>
+      </detail-list>
+      <title-divider title="审批信息" width="90px" v-if="auditFlag"></title-divider>
+      <a-card :bordered="false" title="" v-if="auditFlag" class="audit-info">
+        <a-steps
+          :direction="'horizontal'"
+          :current="current"
+          :status="status"
+          progressDot>
+
+          <a-step
+            v-for="item in currentNodes"
+            :key="item.nodeValue"
+            :title="item.nodeName"
+          >
+            <template v-slot:description v-if="item.userName">
+              <div class="antd-pro-pages-profile-advanced-style-stepDescription">
+                {{ item.userName }}
+                <div>{{ item.createTime }}</div>
+              </div>
+            </template>
+          </a-step>
+        </a-steps>
+      </a-card>
+      <a-table
+        v-if="auditFlag"
+        :columns="auditColumns"
+        :dataSource="auditData"
+        :pagination="false"
+      >
+      </a-table>
+    </div>
+    <print-in-form ref="basePrintModal" @ok="handleOk"/>
+  </a-card>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { fetchSbInfo, updateSbInfoScrapForAudit } from '@/api/sb/info'
+import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
+import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
+import SbOilPageTable from '@/views/sb/oil/modules/SbOilPageTable'
+import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
+import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
+import PrintInForm from '@/views/sb/scrap/modules/PrintInForm'
+import BaseTool from '@/utils/tool'
+import { getAuditRecord } from '@/api/activiti/activiti'
+import { formatDate } from '@/utils/util'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'SbInfoDetail',
+  components: {
+    DetailList,
+    DetailListItem,
+    RepairApplicationFormTable,
+    CheckJobTable,
+    SparePartUsedSelectTable,
+    SbOilPageTable,
+    SbRunFillPageTable,
+    SbInspectionFillPageTable,
+    PrintInForm
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      visible2: true,
+      auditColumns: [
+        {
+          title: '审批人',
+          dataIndex: 'userName',
+          key: 'userName',
+          width: '20%'
+        },
+        {
+          title: '审批时间',
+          dataIndex: 'createTime',
+          key: 'auditTime',
+          width: '30%',
+          scopedSlots: { customRender: 'keyword' }
+        },
+        {
+          title: '审批结果',
+          dataIndex: 'flag',
+          key: 'flag',
+          width: '30%',
+          customRender: (text, row, index) => {
+            return text ? '通过' : '不通过'
+          }
+        },
+        {
+          title: '审批意见',
+          dataIndex: 'opinion',
+          key: 'opinion'
+        }
+      ],
+      auditData: [],
+      nodeMap: {},
+      nodes: [],
+      auditFlag: false,
+      current: 0,
+      status: 'process',
+      currentNodes: [],
+      model: {
+        'no': null,
+        'financingNo': null,
+        'name': null,
+        'currentAuditUserName': null,
+        'modelId': null,
+        'typeId': null,
+        'isShow': null,
+        'isChild': null,
+        'parentId': null,
+        'level': null,
+        'useType': null,
+        'rate': null,
+        'month': null,
+        'usedMonth': null,
+        'initialValue': null,
+        'currentValue': null,
+        'cutValue': null,
+        'producerId': null,
+        // 'sourceType': null,
+        // 'sourceSbId': null,
+        // 'parentId': null,
+        'unit': null,
+        // 'position': null,
+        // 'guigeId': null,
+        'useCompanyName': null,
+        'useProjectName': null,
+        'useDeptName': null,
+        'useGroupName': null,
+        'useUserName': null,
+        'saveDeptName': null,
+        'saveUserName': null,
+        'repairUserName': null,
+        'totalMiles': null,
+        'totalHours': null,
+        // 'lastBaoyangTime': null,
+        // 'lastBaoyangMiles': null,
+        // 'lastBaoyangHours': null,
+        // 'baoyangTimes': null,
+        'buyDate': null,
+        'startDate': null,
+        // 'nextCheckDate': null,
+        // 'guaranteeDate': null,
+        // 'workYear': null,
+        // 'retirementDate': null,
+        // 'depreciationType': null,
+        'wbFile': null,
+        'useFile': null,
+        'checkFile': null,
+        'sbImage': null,
+        'qrCode': null,
+        'status': null,
+        'remark': null,
+        'createdUserId': null,
+        'updateTime': null,
+        'parentName': null,
+        'createdUserName': null,
+        'typeName': null,
+        'producerName': null,
+        'zzh': null,
+        'fdjxh': null,
+        'fdjh': null,
+        'cph': null,
+        'dph': null,
+        'zz': null,
+        'rlType': null,
+        'color': null,
+        'seatNumber': null,
+        'zjm': null,
+        'jbdh': null,
+        'sbdh': null,
+        'bxgs': null
+      },
+      depreciationTypeMap: {},
+      firmSupplier: {},
+      statusMap: {},
+      useTypeMap: {},
+      levelMap: {},
+      unitMap: {},
+      colorMap: {},
+      rlTypeMap: {},
+      sourceTypeMap: {}
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+    this.nodeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_AUDIT_NODE)
+  },
+  computed: {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      if (record.targetId != null) {
+        fetchSbInfo({ id: record.targetId }).then(res => {
+          const data = res.data
+          this.model = data
+          this.getAuditRecords(data)
+        })
+      } else {
+        this.model = record
+        this.getAuditRecords(this.model)
+      }
+    },
+    handlePrint (record) {
+      const modal = this.$refs.basePrintModal
+      this.visible2 = false
+      modal.base(this.model)
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok', values)
+    },
+    handleOk () {
+      this.visible = true
+      this.visible2 = true
+      this.confirmLoading = false
+    },
+    filterCompany (flag, node) {
+      if (!flag) {
+        return parseInt(node) !== 5
+      } else {
+        return true
+      }
+    },
+    getFormatOpinion (opinion) {
+      if (opinion === '提交申请') {
+        return '同意'
+      } else {
+        return opinion
+      }
+    },
+    getAuditRecords (record) {
+      const processInstanceId = record.processInstanceId
+      if (processInstanceId) {
+        this.auditFlag = true
+        const currentNodes = []
+        for (const value in this.nodeMap) {
+          currentNodes.push({
+            nodeValue: value,
+            nodeName: this.nodeMap[value]
+          })
+        }
+        getAuditRecord(processInstanceId).then(res => {
+          const auditData = res.data
+          for (let i = 0; i < auditData.length; i++) {
+            const item = auditData[i]
+            item.opinion = this.getFormatOpinion(item.opinion)
+            for (let j = 0; j < currentNodes.length; j++) {
+              const elem = currentNodes[j]
+              if (item.node === parseInt(elem.nodeValue)) {
+                elem.createTime = item.createTime
+                elem.userName = item.userName
+                elem.flag = item.flag
+                elem.opinion = item.opinion
+                currentNodes[j] = elem
+              }
+            }
+            if (item.node === 0) {
+              break
+            }
+          }
+          this.auditData = auditData
+          this.currentNodes = currentNodes
+          const first = this.auditData[0]
+          const flag = first.flag
+          const node = first.node
+          let index = 1
+          for (let j = 0; j < currentNodes.length; j++) {
+            const elem = currentNodes[j]
+            if (node === parseInt(elem.nodeValue)) {
+              index = j
+            }
+          }
+          if (!flag) {
+            this.status = 'error'
+            this.current = index
+          } else {
+            this.current = index + 1
+            if (index === currentNodes.length - 1) {
+              this.status = 'finish'
+            } else {
+              currentNodes[this.current].userName = this.model.currentAuditUserName
+              this.status = 'process'
+            }
+          }
+        })
+      }
+    },
+    updateSbInfoScrapForAudit () {
+      this.confirmLoading = true
+      updateSbInfoScrapForAudit(this.model)
+        .then(() => {
+          this.confirmLoading = false
+          this.handleCancel(this.model)
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    }
+  }
+}
+</script>

+ 319 - 0
src/views/sb/scrap/modules/DetailAuditScrap.vue

@@ -0,0 +1,319 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <div v-show="visible2" >
+      <a-row :gutter="48" slot="extra">
+        <a-col :md="48" :sm="48">
+          <span class="table-page-search-submitButtons" style="float: right">
+            <a-button type="error" :loading="confirmLoading" v-if="model.status == 3" @click="save()">提交审批</a-button>
+            <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+          </span>
+        </a-col>
+      </a-row>
+      <title-divider title="型号信息" width="90px"></title-divider>
+      <detail-list title="" :col="3">
+        <detail-list-item term="型号">{{ model.model }}</detail-list-item>
+        <detail-list-item term="名称型号">{{ model.nameModel }}</detail-list-item>
+        <detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
+        <detail-list-item term="设备类型">{{ model.typeName }}</detail-list-item>
+        <detail-list-item term="自定义类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</detail-list-item>
+        <detail-list-item term="设备等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
+        <detail-list-item term="生产商">{{ model.producerName }}</detail-list-item>
+        <detail-list-item term="计量单位">{{ model.unit }}</detail-list-item>
+        <detail-list-item term="设备原值">{{ BaseTool.Amount.formatter(model.initialValue) }}</detail-list-item>
+        <detail-list-item term="当前价值">{{ BaseTool.Amount.formatter(model.currentValue) }}</detail-list-item>
+        <detail-list-item term="已折旧价值">{{ BaseTool.Amount.formatter(model.cutValue) }}</detail-list-item>
+        <detail-list-item term="净残值率">{{ BaseTool.Amount.formatter(model.rate) }}</detail-list-item>
+        <detail-list-item term="折旧总计月份">{{ BaseTool.Amount.formatter(model.month) }}</detail-list-item>
+        <detail-list-item term="已计提月份">{{ BaseTool.Amount.formatter(model.usedMonth) }}</detail-list-item>
+      </detail-list>
+
+      <title-divider title="基本信息" width="90px"></title-divider>
+      <detail-list title="" :col="3">
+        <detail-list-item term="设备编号">{{ model.no }}</detail-list-item>
+        <detail-list-item term="财务编码">{{ model.financingNo }}</detail-list-item>
+        <detail-list-item term="卡片编号">{{ model.cardNo }}</detail-list-item>
+        <detail-list-item term="车牌号">{{ model.cph }}</detail-list-item>
+        <detail-list-item term="资产现状说明">{{ model.remark }}</detail-list-item>
+        <detail-list-item term="使用公司">{{ model.useCompanyName }}</detail-list-item>
+        <detail-list-item term="使用项目部">{{ model.useProjectName }}</detail-list-item>
+        <detail-list-item term="购置日期">{{ model.buyDate }}</detail-list-item>
+        <detail-list-item term="投用日期">{{ model.startDate }}</detail-list-item>
+        <detail-list-item term="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></detail-list-item>
+      </detail-list>
+      <title-divider title="资产图片" width="90px"></title-divider>
+      <detail-list title="" :col="6">
+        <detail-list-item v-show="model.sbFileList!=null && model.sbFileList.length>0">
+          <a-upload
+            list-type="picture-card"
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.sbFileList)"
+          >
+          </a-upload>
+        </detail-list-item>
+      </detail-list>
+      <title-divider title="审批信息" width="90px"></title-divider>
+      <a-table
+        :columns="auditColumns"
+        :dataSource="auditData"
+        :pagination="false"
+      >
+      </a-table>
+      <title-divider title="审核信息" width="90px"></title-divider>
+      <a-row class="form-row" :gutter="16">
+        <a-col :lg="12" :md="12" :sm="24">
+
+          <a-radio-group v-model="auditFlag" @change="changeOpinion">
+            <a-radio :value="1">通过</a-radio>
+            <a-radio :value="0">拒绝</a-radio>
+          </a-radio-group>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="16">
+        <a-col :lg="12" :md="12" :sm="24">
+          <a-form-item
+            label="审核描述"
+          >
+            <a-textarea
+              v-model="refuseReason"/>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { fetchSbInfo, auditProcess, updateSbInfoScrapForAudit } from '@/api/sb/info'
+import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
+import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
+import SbOilPageTable from '@/views/sb/oil/modules/SbOilPageTable'
+import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
+import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
+import PrintInForm from '@/views/sb/scrap/modules/PrintInForm'
+import { getAuditRecord } from '@/api/activiti/activiti'
+import { formatDate } from '@/utils/util'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'DetailAuditScrap',
+  components: {
+    DetailList,
+    DetailListItem,
+    RepairApplicationFormTable,
+    CheckJobTable,
+    SparePartUsedSelectTable,
+    SbOilPageTable,
+    SbRunFillPageTable,
+    SbInspectionFillPageTable,
+    PrintInForm
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      visible2: true,
+      refuseReason: '同意',
+      auditFlag: 1,
+      auditColumns: [
+        {
+          title: '审批人',
+          dataIndex: 'userName',
+          key: 'userName',
+          width: '20%'
+        },
+        {
+          title: '审批时间',
+          dataIndex: 'createTime',
+          key: 'auditTime',
+          width: '30%',
+          scopedSlots: { customRender: 'keyword' }
+        },
+        {
+          title: '审批结果',
+          dataIndex: 'flag',
+          key: 'flag',
+          width: '30%',
+          customRender: (text, row, index) => {
+            return text ? '通过' : '不通过'
+          }
+        },
+        {
+          title: '审批意见',
+          dataIndex: 'opinion',
+          key: 'opinion'
+        }
+      ],
+      auditData: [],
+      model: {
+        'no': null,
+        'financingNo': null,
+        'name': null,
+        'modelId': null,
+        'typeId': null,
+        'isShow': null,
+        'isChild': null,
+        'parentId': null,
+        'level': null,
+        'useType': null,
+        'rate': null,
+        'month': null,
+        'usedMonth': null,
+        'initialValue': null,
+        'currentValue': null,
+        'cutValue': null,
+        'producerId': null,
+        // 'sourceType': null,
+        // 'sourceSbId': null,
+        // 'parentId': null,
+        'unit': null,
+        // 'position': null,
+        // 'guigeId': null,
+        'useCompanyName': null,
+        'useProjectName': null,
+        'useDeptName': null,
+        'useGroupName': null,
+        'useUserName': null,
+        'saveDeptName': null,
+        'saveUserName': null,
+        'repairUserName': null,
+        'totalMiles': null,
+        'totalHours': null,
+        // 'lastBaoyangTime': null,
+        // 'lastBaoyangMiles': null,
+        // 'lastBaoyangHours': null,
+        // 'baoyangTimes': null,
+        'buyDate': null,
+        'startDate': null,
+        // 'nextCheckDate': null,
+        // 'guaranteeDate': null,
+        // 'workYear': null,
+        // 'retirementDate': null,
+        // 'depreciationType': null,
+        'wbFile': null,
+        'useFile': null,
+        'checkFile': null,
+        'sbImage': null,
+        'qrCode': null,
+        'status': null,
+        'remark': null,
+        'createdUserId': null,
+        'updateTime': null,
+        'parentName': null,
+        'createdUserName': null,
+        'typeName': null,
+        'producerName': null,
+        'zzh': null,
+        'fdjxh': null,
+        'fdjh': null,
+        'cph': null,
+        'dph': null,
+        'zz': null,
+        'rlType': null,
+        'color': null,
+        'seatNumber': null,
+        'zjm': null,
+        'jbdh': null,
+        'sbdh': null,
+        'bxgs': null
+      },
+      depreciationTypeMap: {},
+      firmProducerLevelMap: {},
+      firmSupplier: {},
+      firmProducer: {},
+      statusMap: {},
+      useTypeMap: {},
+      levelMap: {},
+      unitMap: {},
+      colorMap: {},
+      rlTypeMap: {},
+      sourceTypeMap: {}
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.firmProducerLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FIRM_PRODUCER_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+  },
+  computed: {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = {}
+      this.taskId = record.taskId
+      fetchSbInfo({ id: record.targetId }).then(res => {
+        const data = res.data
+        this.model = data
+        this.getAuditRecords(data)
+      })
+    },
+    getFormatOpinion (opinion) {
+      if (opinion === '提交申请') {
+        return '同意'
+      } else {
+        return opinion
+      }
+    },
+    getAuditRecords (record) {
+      const processInstanceId = record.processInstanceId
+      if (processInstanceId) {
+        getAuditRecord(processInstanceId).then(res => {
+          const auditData = res.data
+          for (let i = 0; i < auditData.length; i++) {
+            const item = auditData[i]
+            item.opinion = this.getFormatOpinion(item.opinion)
+          }
+          this.auditData = auditData
+        })
+      }
+    },
+    save () {
+      this.confirmLoading = true
+      auditProcess({ id: this.model.id, refuseReason: this.refuseReason, auditFlag: this.auditFlag, taskId: this.taskId })
+        .then(() => {
+          this.$message.info('操作成功')
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok', values)
+    },
+    handleOk () {
+      this.visible = true
+      this.visible2 = true
+      this.confirmLoading = false
+      fetchSbInfo({ id: this.model.id }).then(res => {
+        const data = res.data
+        this.model = data
+        this.getAuditRecords(data)
+      })
+    },
+    updateSbInfoScrapForAudit () {
+      updateSbInfoScrapForAudit(this.model)
+        .then(() => {
+          this.handleCancel(this.model)
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    },
+    changeOpinion (e) {
+      this.refuseReason = e.target.value ? '同意' : '不同意'
+    }
+  }
+}
+</script>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 13 - 0
src/views/sb/scrap/modules/PrintInForm.vue


+ 14 - 5
src/views/sqarepartmanage/sparepartinfo/modules/BaseForm.vue

@@ -192,7 +192,7 @@
             </a-select>
           </a-form-item>
         </row-item>
-        <row-item>
+<!--        <row-item>
           <a-form-item
             label="包装单位"
             :labelCol="BaseTool.Constant.labelCol"
@@ -227,7 +227,7 @@
               placeholder="单位折算为包装单位,如24个单位包装为一箱"
               v-decorator="['unitRate']" />
           </a-form-item>
-        </row-item>
+        </row-item>-->
         <row-item>
           <a-form-item
             label="采购周期"
@@ -246,6 +246,15 @@
             <a-input suffix="月" v-decorator="['usePeriod']" />
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="寿命周期"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input suffix="月" v-decorator="['agePeriod']" />
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="最高库存"
@@ -673,13 +682,13 @@ export default {
       }
     },
     /**
-     * 设置备件类别树
+     * 设置仓库、备件类别树
      */
     setTree (record = {}) {
-      fetchStoreTree({ id: record.id }).then(res => {
+      fetchStoreTree().then(res => {
         this.storeTreeDate = res.data
       })
-      fetchSpareTypeTree({ }).then(res => {
+      fetchSpareTypeTree().then(res => {
         this.spareTypeData = res.data
       })
       /* querySpareType({ filter: 2, parentId: record.parentTypeId }).then(res => {

+ 3 - 2
src/views/sqarepartmanage/sparepartinfo/modules/Detail.vue

@@ -27,8 +27,9 @@
       <detail-list-item term="包装单位">{{ model.unitBz }}</detail-list-item>
       <detail-list-item term="折算系数">{{ model.unitRate }}</detail-list-item>
       <detail-list-item term="当前库存">{{ model.currentStock }}</detail-list-item>
-      <detail-list-item term="采购周期">{{ model.purchasePeriod }}</detail-list-item>
-      <detail-list-item term="使用周期">{{ model.usePeriod }}</detail-list-item>
+      <detail-list-item term="采购周期">{{ model.purchasePeriod }}天</detail-list-item>
+      <detail-list-item term="使用周期">{{ model.usePeriod }}月</detail-list-item>
+      <detail-list-item term="寿命周期">{{ model.usePeriod }}月</detail-list-item>
       <detail-list-item term="最高库存">{{ model.maxStock }}</detail-list-item>
       <detail-list-item term="最低库存">{{ model.minStock }}</detail-list-item>
       <detail-list-item term="初始库存">{{ model.initStock }}</detail-list-item>

+ 255 - 0
src/views/upms/impExcel/Imp.vue

@@ -0,0 +1,255 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+    </div>
+
+    <div class="table-operator">
+      <a-button v-if="$auth('sb-types-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+      <a-button style="margin-left: 8px" v-if="$auth('sb-types-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-types-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>
+
+    <a-table
+      ref="table"
+      size="default"
+      rowKey="name"
+      :columns="columns"
+      :data-source="dataSource"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">模板下载</a>
+          <a-divider type="vertical" />
+          <a @click="handleView(record)">导入</a>
+          <a-divider type="vertical" />
+          <a-popconfirm v-if="$auth('sb-types-del')" title="是否要清空该类型数据?" @confirm="batchDelete(record.id)">
+            <a>清空</a>
+          </a-popconfirm>
+        </template>
+      </span>
+      <span slot="delFlag" slot-scope="text">
+        <badge
+          :status="DictCache.COLOR.DELFLAG[text]"
+          :text="delFlagMap[text]" />
+      </span>
+    </a-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import { getSbTypePage, deleteSbTypes, fetchSbType, exportSbType, fetchSbTypeTableTree, fetchSbTypeTree } from '@/api/sb/type'
+
+export default {
+  name: 'SbTypeList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      dataSource: [
+        {
+          name: '部门导入',
+          key: '1',
+          type: 0
+        },
+        {
+          name: '角色导入',
+          key: '2',
+          type: 0
+        },
+        {
+          name: '用户导入',
+          key: '3',
+          type: 1
+        },
+        {
+          name: '设备类型导入',
+          key: '4',
+          type: 1
+        },
+        {
+          name: '设备导入',
+          key: '5',
+          type: 1
+        },
+        {
+          name: '备件类型导入',
+          key: '6',
+          type: 1
+        }
+      ],
+      treeData: [],
+      typeMap: {},
+      delFlagMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '方式',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return text === '1' ? '导入' : '手工录入'
+          }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return fetchSbTypeTableTree(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    this.tableOption()
+    this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_TYPE)
+  },
+  methods: {
+    tableOption () {
+      this.setTree()
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (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]
+      }
+      deleteSbTypes(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbType({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchSbType({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      fetchSbType({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        res.data.id = null
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.setTree()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.handleOk()
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbType(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree({ id: record.id }).then((res) => {
+        this.treeData = res.data
+      })
+    }
+  }
+}
+</script>

+ 213 - 0
src/views/upms/impExcel/modules/BaseForm.vue

@@ -0,0 +1,213 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+
+      <a-form-item
+        label="类代号"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-input
+          v-decorator="['no', {rules: [{required: false, message: '代号不能为空'}]}]" />
+      </a-form-item>
+      <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-form-item
+        label="设备类别"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-select @change="handleTypeChange" v-decorator="['type', {rules: [{required: true, message: '设备类别不能为空'}]}]" placeholder="请选择">
+          <a-select-option
+            v-for="(label,value) in typeMap"
+            :key="value"
+            :label="label"
+            :value="parseInt(value)">{{ label }}
+          </a-select-option>
+        </a-select>
+      </a-form-item>
+      <a-form-item
+        label="首字母"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-input
+          v-decorator="['szm']" />
+      </a-form-item>
+      <a-form-item
+        label="排序"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-input-number
+          style="width: 100%"
+          :min="1"
+          v-decorator="['sort', {initialValue:1,rules: [{required: true, message: '排序不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="是否删除"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-select v-decorator="['delFlag', {initialValue:DictCache.VALUE.DELFLAG.NORMAL, rules: [{required: true, message: '是否删除不能为空'}]}]" placeholder="请选择">
+          <a-select-option
+            v-for="(label,value) in delFlagMap"
+            :key="value"
+            :label="label"
+            :value="parseInt(value)">{{ label }}
+          </a-select-option>
+        </a-select>
+      </a-form-item>
+      <a-form-item
+        label="上层设备类型"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+        v-show="isShowParent"
+      >
+        <a-tree-select
+          style="width: 100%"
+          :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+          :treeData="treeData"
+          :treeNodeFilterProp="'title'"
+          :showSearch="true"
+          v-decorator="['parentId', {rules: [{required: isShowParent, message: '上层设备类型不能为空'}]}]"
+          placeholder="请选择"
+        >
+        </a-tree-select>
+      </a-form-item>
+      <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-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addSbType, updateSbType, fetchSbTypeTree } from '@/api/sb/type'
+
+export default {
+  name: 'BaseSbType',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      typeMap: {},
+      delFlagMap: {},
+      typeName: '',
+      treeData: [],
+      isShowParent: true
+    }
+  },
+  props: {
+  },
+  created () {
+    this.setTree()
+    this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_TYPE)
+  },
+  methods: {
+    base (record) {
+      this.setTree(record)
+      this.visible = true
+      // 如果是空标识添加
+      const { form: { setFieldsValue } } = this
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        return
+      }
+      this.modalTitle = '编辑'
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        this.modalTitle = '复制'
+      }
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'no',
+          'name',
+          'type',
+          'sort',
+          'delFlag',
+          'parentId',
+          'remark'
+        ])))
+      })
+      this.isShowParent = record.type === this.DictCache.VALUE.SBTYPE_TYPE.SON
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addSbType(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateSbType(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree({ type: 1 }).then((res) => {
+        this.treeData = res.data
+      })
+    },
+    handleTypeChange (val) {
+      const { form: { setFieldsValue } } = this
+      this.isShowParent = val === this.DictCache.VALUE.SBTYPE_TYPE.SON
+      this.$nextTick(() => {
+        setFieldsValue({
+          'parentId': ''
+        })
+      })
+    }
+
+  }
+}
+</script>

+ 78 - 0
src/views/upms/impExcel/modules/Detail.vue

@@ -0,0 +1,78 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="850"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <detail-list title="" :col="2">
+      <detail-list-item term="设备编码">{{ model.no }}</detail-list-item>
+      <detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
+      <detail-list-item term="首字母">{{ model.szm }}</detail-list-item>
+      <detail-list-item term="设备类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
+      <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
+      <detail-list-item term="上层设备类型">{{ model.parentName }}</detail-list-item>
+      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+      <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
+      <detail-list-item term="是否删除"><badge :status="DictCache.COLOR.DELFLAG[model.delFlag]" :text="delFlagMap[model.delFlag]"></badge></detail-list-item>
+      <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
+    </detail-list>
+
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'SbTypeDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      model: {
+        'no': null,
+        'name': null,
+        'type': null,
+        'sort': null,
+        'delFlag': null,
+        'parentId': null,
+        'parentName': null,
+        'remark': null,
+        'createdUserId': null,
+        'createdUserName': null,
+        'updateTime': null
+      },
+      typeMap: {},
+      delFlagMap: {}
+    }
+  },
+  created () {
+    this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_TYPE)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    }
+
+  }
+}
+</script>

+ 58 - 123
src/views/workplace/backlog/WorkplaceBacklog.vue

@@ -19,7 +19,7 @@
               </a-col>
               <a-col :md="4" :sm="24">
                 <a-form-item label="状态">
-                  <a-select :default-value="1" v-model="queryParam.status" placeholder="请选择">
+                  <a-select :default-value="defaultValue" v-model="queryParam.status" placeholder="请选择">
                     <a-select-option
                       :key="1"
                       label="待办"
@@ -73,12 +73,9 @@
     <sb-oil-task ref="sbOilTask" v-if="sbOilTaskShow" :target-id="targetId" @back="back" />
     <sb-oil-audit ref="sbOilAudit" v-if="sbOilAuditShow" :target-id="targetId" @back="back" />
     <sb-allocate-task-audit res="sbAllocateTaskAudit" v-if="sbAllocateTaskAuditShow" :target-id="targetId" @back="back" />
-
-    <purchase-plan-audit-form ref="purchasePlanAuditModal" @ok="handleOk"/>
-    <purchase-apply-audit-form ref="purchaseApplyAuditModal" @ok="handleOk"/>
-    <purchase-demand-plan-audit-form ref="purchaseDemandPlanAuditModal" @ok="handleOk"/>
-    <purchase-demand-plan-audit-add-form ref="purchaseDemandPlanAuditAddModal" @ok="handleOk"/>
     <suplier-audit-form ref="supplierAuditModal" @ok="handleOk"/>
+    <detail-audit-scrap ref="detailAuditScrapModal" @ok="handleOk"/>
+    <detail-scrap ref="detailScrapModal" @ok="handleOk"/>
   </page-view>
 </template>
 
@@ -98,6 +95,8 @@ import SbAllocateTaskAudit from '@/views/sb/allocate-task/SbAllocateTaskAudit'
 import { getWorkplaceBacklogUserPage, updateWorkplaceBacklog, fetchWorkplaceBacklogUserById } from '@/api/workplace/backlog'
 import { fetchRepairApplicationForm } from '@/api/repair/application-form'
 import { fetchOutStoreForm } from '@/api/store/outstoreform'
+import { fetchPurchaseOrder } from '@/api/purchase/purchase-order'
+import { fetchPurchaseDispatchOrder } from '@/api/purchase/purchase-dispatch-order'
 import { fetchSparePickForm } from '@/api/store/sparepickform'
 import DetailRepairApplicationForm from '../../repair/application-form/modules/Detail'
 import DetailRepairApplicationFormRepair from '../../repair/application-form/modules/DetailRepair'
@@ -106,12 +105,9 @@ import DetailOutStore from '../../store/outstoreform/modules/Detail'
 import DetailSparePick from '../../store/sparepickform/modules/Detail'
 import { fetchSbOil } from '@/api/sb/oil'
 import { fetchSbAllocateApply } from '@/api/sb/allocate-apply'
-
-import PurchasePlanAuditForm from '@/views/purchase/purchase-plan/modules/AuditForm'
-import PurchaseApplyAuditForm from '@/views/purchase/purchase-apply/modules/AuditForm'
-import PurchaseDemandPlanAuditForm from '@/views/purchase/purchase-demand-plan/modules/AuditForm'
-import PurchaseDemandPlanAuditAddForm from '@/views/purchase/purchase-demand-plan/modules/AuditAddForm'
 import SuplierAuditForm from '@/views/purchase/supplier/modules/AuditForm'
+import DetailAuditScrap from '@/views/sb/scrap/modules/DetailAuditScrap'
+import DetailScrap from '@/views/sb/scrap/modules/Detail'
 
 export default {
   name: 'Workplace',
@@ -132,11 +128,9 @@ export default {
     SbAllocateTaskAudit,
     SbAllocateApplyDetail,
     SbOilConfirmBaseForm,
-    PurchasePlanAuditForm,
-    PurchaseApplyAuditForm,
-    PurchaseDemandPlanAuditForm,
     SuplierAuditForm,
-    PurchaseDemandPlanAuditAddForm
+    DetailAuditScrap,
+    DetailScrap
   },
   data () {
     return {
@@ -144,6 +138,7 @@ export default {
       queryParam: {
         status: 1
       },
+      defaultValue: 1,
       typeDict: {},
       typeDetailDict: {},
       leaderFlag: false,
@@ -367,106 +362,46 @@ export default {
         } else {
           this.$message.info('没有该类型消息通知,请联系管理员...')
         }
-      } else if (record.type === this.DictCache.VALUE.WORKPLACE_BACKLOG_TYPE.BACK_PURCHASE_AUDIT) {
-        if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_DEMAND_PLAN_AUDIT) {
-          this.visible = false
-          const param = {
-            targetId: record.otherId,
-            taskId: record.targetId
-          }
-          this.$refs.purchaseDemandPlanAuditModal.base(param)
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_DEMAND_PLAN_ADD_AUDIT) {
-          this.visible = false
-          const param = {
-            targetId: record.otherId,
-            taskId: record.targetId
-          }
-          this.$refs.purchaseDemandPlanAuditAddModal.base(param)
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_PLAN_AUDIT) {
-          this.visible = false
-          const param = {
-            targetId: record.otherId,
-            taskId: record.targetId
-          }
-          this.$refs.purchasePlanAuditModal.base(param)
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_APPLY_AUDIT) {
+      } else if (record.type === this.DictCache.VALUE.WORKPLACE_BACKLOG_TYPE.SB_SCRAP) {
+        // 已办
+        if (record.status === 1) {
+          updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
+            console.log('已置为已办')
+          })
+        }
+        if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.SB_SCRAP) {
           this.visible = false
           const param = {
             targetId: record.otherId,
             taskId: record.targetId
           }
-          this.$refs.purchaseApplyAuditModal.base(param)
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_SUPPLIER_AUDIT) {
+          this.$refs.detailAuditScrapModal.base(param)
+        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.SB_SCRAP_RESULT) {
           this.visible = false
           const param = {
             targetId: record.otherId,
             taskId: record.targetId
           }
-          this.$refs.supplierAuditModal.base(param)
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_DEMAND_PLAN_AUDIT_RESULT) {
-          // 已办
-          if (record.status === 1) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              this.$router.push('/purchase/demand/plan')
-            })
-          }
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_DEMAND_PLAN_ADD_AUDIT_RESULT) {
-          // 已办
-          if (record.status === 1) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              this.$router.push('/purchase/demand/plan/add')
-            })
-          }
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_PLAN_AUDIT_RESULT) {
-          // 已办
-          if (record.status === 1) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              this.$router.push('/purchase/plan')
-            })
-          }
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_APPLY_AUDIT_RESULT) {
-          // 已办
-          if (record.status === 1) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              this.$router.push('/purchase/apply')
-            })
-          }
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_SUPPLIER_AUDIT_RESULT) {
-          // 已办
-          if (record.status === 1) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              this.$router.push('/supplier/apply')
-            })
-          }
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_DISPATCH_ASSIGN ||
-        record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_ORDER_ASSIGN ||
-        record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_ENQUIRY_AUDIT_RESULT ||
-          record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_ENQUIRY_AUDIT) {
-          // 已办
-          if (record.status === 1 && record.detailType !== this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_ENQUIRY_AUDIT) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              this.$router.push('/purchase/order')
-            })
-          } else {
-            this.$router.push('/purchase/order')
-          }
-        } else if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_STORE_CHECK ||
-          record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.BACK_PURCHASE_STORE_CHECK_QUANTITY_EXCEPTION) {
-          // 已办
-          if (record.status === 1) {
-            updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-              if (!record.otherId) {
-                this.$router.push('/purchase/order')
-              } else {
-                this.$router.push('/purchase/dispatch/order')
-              }
-            })
-          }
+          this.$refs.detailScrapModal.base(param)
         }
       } else {
         this.$message.info('该类型的通知正在开发中,请稍后...')
       }
     },
+    toPurchaseOrder (record) {
+      const id = record.otherId ? record.otherId : record.targetId
+      fetchPurchaseOrder({ id: id }).then(res => {
+        this.$store.dispatch('setPurchaseNo', res.data.billNo)
+        this.$router.push('/purchase/order')
+      })
+    },
+    toDispatchOrder (record) {
+      const id = record.otherId ? record.otherId : record.targetId
+      fetchPurchaseDispatchOrder({ id: id }).then(res => {
+        this.$store.dispatch('setPurchaseNo', res.data.billNo)
+        this.$router.push('/purchase/dispatch/order')
+      })
+    },
     updateStatus (targetId) {
       updateWorkplaceBacklog({ id: targetId })
     },
@@ -497,36 +432,36 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .item-group {
-    padding: 20px 0 8px 24px;
-    font-size: 0;
-    a {
-      color: rgba(0, 0, 0, 0.65);
-      display: inline-block;
-      font-size: 14px;
-      margin-bottom: 13px;
-      width: 25%;
-    }
+.item-group {
+  padding: 20px 0 8px 24px;
+  font-size: 0;
+  a {
+    color: rgba(0, 0, 0, 0.65);
+    display: inline-block;
+    font-size: 14px;
+    margin-bottom: 13px;
+    width: 25%;
   }
+}
 
-  .mobile {
+.mobile {
 
-    .project-list {
+  .project-list {
 
-      .project-card-grid {
-        width: 100%;
-      }
+    .project-card-grid {
+      width: 100%;
     }
+  }
 
-    .more-info {
-      border: 0;
-      padding-top: 16px;
-      margin: 16px 0 16px;
-    }
+  .more-info {
+    border: 0;
+    padding-top: 16px;
+    margin: 16px 0 16px;
+  }
 
-    .headerContent .title .welcome-text {
-      display: none;
-    }
+  .headerContent .title .welcome-text {
+    display: none;
   }
+}
 
 </style>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.