408249787 2 年之前
父節點
當前提交
7da50375e6

+ 2 - 1
src/views/repair/application-form/RepairForm.vue

@@ -169,7 +169,8 @@ export default {
       queryParam: {
         filter: this.filter,
         searchType: this.searchType,
-        sbId: this.$route.query.id
+        ...this.$route.query
+
       },
       visible: true,
       // 表头

+ 1 - 1
src/views/repair/fee/RepairFee.vue

@@ -127,7 +127,7 @@ export default {
     return {
       // 查询参数
       queryParam: {
-        sbId: this.$route.query.id
+        ...this.$route.query
       },
       moneyTypeMap: {},
       categoryMap: {},

+ 2 - 1
src/views/store/instoreform/InStoreForm.vue

@@ -116,7 +116,8 @@ export default {
     return {
       // 查询参数
       queryParam: {
-        filter: this.filter
+        filter: this.filter,
+        ...this.$route.query
       },
       visible: true,
       // 表头

+ 4 - 2
src/views/store/outstoreform/OutStoreForm.vue

@@ -70,7 +70,7 @@
             <a-popconfirm v-if="$auth('store-out-store-forms-del')&&record.status==1" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
               <a>删除</a>
             </a-popconfirm>
-             <a-divider v-if="record.status==2" type="vertical" />
+            <a-divider v-if="record.status==2" type="vertical" />
             <a-popconfirm v-if="record.status==2" title="是否要撤销?" @confirm="updateStoreBack(record.id)">
               <a>撤销</a>
             </a-popconfirm>
@@ -113,7 +113,9 @@ export default {
     return {
       // 查询参数
       queryParam: {
-        filter: this.filter
+        filter: this.filter,
+        ...this.$route.query
+
       },
       // 表头
       columns: [

+ 60 - 31
src/views/workplace/backlog/NewWorkplaceBacklog.vue

@@ -6,31 +6,32 @@
           <div class="gutter-box">
             <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
               <a-col>维修数据</a-col>
-              <a-col><a href="/repair/form" target="_block">{{ topData.repairTotalNum }}</a></a-col>
+              <a-col><a href="/repair/form?type=1&searchType=6" target="_block">{{ topData.repairTotalNum }}</a></a-col>
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col >
-                <a-badge color="#E4007F"/>
-                <span style="color:#E4007F;"><a style="color:#E4007F;" href="/repair/form?status=2">待维修 &nbsp; {{ topData.waitForRepairNum }}</a></span>
+                <a-badge color="#F19149"/>
+                <span style="color:#F19149;"><a style="color:#F19149;" target="_block" href="/repair/wait?type=1">待接单 &nbsp; {{ topData.completedRepairNum }}</a></span>
+
               </a-col>
               <a-col >
-                <a-badge color="#5864FF"/>
-                <span style="color:#5864FF;">待审核 &nbsp; {{ topData.verifyRepairNum }}</span>
-
+                <a-badge color="#E4007F"/>
+                <span style="color:#E4007F;"><a style="color:#E4007F;" target="_block" href="/repair/form/mine?type=1">维修中 &nbsp; {{ topData.waitForRepairNum }}</a></span>
               </a-col>
+
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
+              <a-col >
+                <a-badge color="#5864FF"/>
+                <span style="color:#5864FF;"><a style="color:#5864FF;" target="_block" href="/repair/form?type=1&searchType=3">待审核 &nbsp; {{ topData.verifyRepairNum }}</a></span>
 
+              </a-col>
               <a-col>
                 <a-badge color="#009944"/>
-                <span style="color:#009944;">已驳回 &nbsp; {{ topData.refusedRepairNum }}</span>
+                <span style="color:#009944;"><a style="color:#009944;" target="_block" href="/repair/form?type=1&searchType=5">已驳回 &nbsp; {{ topData.refusedRepairNum }}</a></span>
 
               </a-col>
-              <a-col >
-                <a-badge color="#F19149"/>
-                <span style="color:#F19149;">待接单 &nbsp; {{ topData.completedRepairNum }}</span>
 
-              </a-col>
             </a-row>
           </div>
         </a-col>
@@ -38,44 +39,43 @@
           <div class="gutter-box">
             <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
               <a-col>委外数据</a-col>
-              <a-col>{{ topData.outRepairTotalNum }}</a-col>
+              <a-col><a target="_block" href="/repair/form?type=2&searchType=6">{{ topData.outRepairTotalNum }}</a></a-col>
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
+              <a-col >
+                <a-badge color="#F19149"/>
+                <span style="color:#F19149;"><a style="color:#F19149;" target="_block" href="/repair/wait?type=2">待接单 &nbsp; {{ topData.outCompletedRepairNum }}</a></span>
+
+              </a-col>
               <a-col >
                 <a-badge color="#E4007F"/>
-                <span style="color:#E4007F;">待维修 &nbsp; {{ topData.outWaitForRepairNum }}</span>
+                <span style="color:#E4007F;"><a style="color:#E4007F;" target="_block" href="/repair/form/mine?type=2">待维修 &nbsp; {{ topData.outWaitForRepairNum }}</a></span>
               </a-col>
+
+            </a-row>
+            <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col >
                 <a-badge color="#5864FF"/>
-                <span style="color:#5864FF;">待审核 &nbsp; {{ topData.outVerifyRepairNum }}</span>
+                <span style="color:#5864FF;"><a style="color:#5864FF;" target="_block" href="/repair/form?type=2&searchType=3">待审核 &nbsp; {{ topData.outVerifyRepairNum }}</a></span>
 
               </a-col>
-            </a-row>
-            <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col>
                 <a-badge color="#009944"/>
-                <span style="color:#009944;">已驳回 &nbsp; {{ topData.outRefusedRepairNum }}</span>
-
-              </a-col>
-              <a-col >
-                <a-badge color="#F19149"/>
-                <span style="color:#F19149;">待接单 &nbsp; {{ topData.outCompletedRepairNum }}</span>
-
+                <span style="color:#009944;"><a style="color:#009944;" target="_block" href="/repair/form?type=2&searchType=5">已驳回 &nbsp; {{ topData.outRefusedRepairNum }}</a></span>
               </a-col>
-
             </a-row>
           </div>
         </a-col>
         <a-col class="gutter-row" :span="8">
           <div style="display:flex;text-align:center;background:#fff;height: 170px;">
             <div style="width:48%;margin:auto;font-size:30px; line-height: 60px;">
-              <div>维修总计</div>
-              <div style="font-size:24px;">{{ topData.totalNum }}</div>
+              <div>本月维修总计</div>
+              <div style="font-size:24px;"><a target="_block" :href="`/repair/form?repairStartTimeStart=${date.repairStartTimeStart}&repairStartTimeEnd=${date.repairStartTimeEnd}`">{{ topData.totalNum }}</a></div>
             </div>
             <div style="width: 1px;height: 70px;background: #999999;margin:auto;"></div>
             <div style="width:48%;margin:auto; font-size:30px;line-height: 60px;">
-              <div>维修费用总计</div>
-              <div style="font-size:24px;">{{ topData.totalFee }}</div>
+              <div>本月维修费用</div>
+              <div style="font-size:24px;"><a target="_block" :href="`/repair/fee?feeDateStart=${date.searchStartTime}&feeDateEnd=${date.searchEndTime}`">{{ topData.totalFee }}</a></div>
             </div>
           </div>
         </a-col>
@@ -102,15 +102,15 @@
         </a-col>
         <a-col class="gutter-row" :span="4">
           <div style="height: 471px;display:flex;flex-direction:column;justify-content: space-between">
-            <div class="btn" style="background:linear-gradient(to right,#36B5FA,#26ECF5);">
+            <div class="btn" style="background:linear-gradient(to right,#36B5FA,#26ECF5);" >
               <my-icon type="icon-chukuguanli" style="font-size:58px;"/>
               <span>维修</span>
             </div>
-            <div class="btn" style="background:linear-gradient(to right,#FF416D,#FF847F);">
+            <div class="btn" style="background:linear-gradient(to right,#FF416D,#FF847F);" @click="$refs.repairForm.base({},{filter: -1})">
               <my-icon type="icon-rukuguanli" style="font-size:58px;"/>
               <span>报修</span>
             </div>
-            <div class="btn" style="background:linear-gradient(to right,#FB47D1,#F96EFE);">
+            <div class="btn" style="background:linear-gradient(to right,#FB47D1,#F96EFE);" @click="$refs.sparePickForm.base()">
               <my-icon type="icon-zichanguanli-zichantiaobo" style="font-size:58px;"/>
               <span>领用</span>
             </div>
@@ -186,17 +186,23 @@
         </a-col>
       </a-row>
     </div>
+    <repair-form ref="repairForm"></repair-form>
+    <SparePickForm ref="sparePickForm"></SparePickForm>
   </div>
 </template>
 
 <script>
 import { STable } from '@/components'
+import RepairForm from './modules/RepairBaseForm'
+import SparePickForm from '@/views/store/sparepickform/modules/BaseForm'
 import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie } from '@/api/workplace/backlog'
 import { Chart } from '@antv/g2'
 export default {
   name: 'NewWorkplaceBacklog',
   components: {
     STable,
+    SparePickForm,
+    RepairForm,
     Chart
   },
   data () {
@@ -222,6 +228,12 @@ export default {
       chartLine: null,
       topData: null,
       type: this.$route.query.type,
+      date: {
+        repairStartTimeStart: '',
+        repairStartTimeEnd: '',
+        searchStartTime: '',
+        searchEndTime: ''
+      },
       queryParam: {
         status: 1
       },
@@ -338,6 +350,8 @@ export default {
     }
   },
   created () {
+    this.getdate()
+    console.log(this.date)
     this.getDict()
     // this.getInfo()
   },
@@ -347,6 +361,18 @@ export default {
     })
   },
   methods: {
+    getdate () {
+      const date = new Date()
+      const year = date.getFullYear()
+      const month = date.getMonth()
+      this.date = {
+        repairStartTimeStart: `${year}-0${month + 1}-01 00:00:00`,
+        repairStartTimeEnd: this.BaseTool.Date.formatter(date, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN),
+        searchStartTime: `${year}-0${month + 1}-01`,
+        searchEndTime: this.BaseTool.Date.formatter(date, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+      }
+    },
     getDict () {
       this.typeDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_TYPE)
       this.typeDetailDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
@@ -490,6 +516,9 @@ display:flex;
 align-items: center;
 justify-content: space-around;
 }
+.btn:hover{
+  cursor:pointer;
+}
 .information{
   background: #fff;
   padding: 30px 12px;

+ 29 - 13
src/views/workplace/backlog/StoreWorkplaceBacklog.vue

@@ -6,28 +6,35 @@
           <div class="gutter-box">
             <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
               <a-col>待入库总数</a-col>
-              <a-col>{{ topData.inTotalNum }}</a-col>
+              <a-col><a href="/in/store/myform?status=1" target="_block">{{ topData.inTotalNum }}</a></a-col>
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col >
                 <a-badge color="#E4007F"/>
-                <span style="color:#E4007F;">采集入库 &nbsp; {{ topData.purchaseApplyNum }}</span>
+                <a href="/in/store/myform?type=1&status=1" target="_block"><span style="color:#E4007F;">采购入库 &nbsp; {{ topData.purchaseApplyNum }}</span></a>
               </a-col>
               <a-col >
                 <a-badge color="#5864FF"/>
-                <span style="color:#5864FF;">闲置入库 &nbsp; {{ topData.spareBackApplyNum }}</span>
-
+                <a href="/in/store/myform?type=2&status=1" target="_block">
+                  <span style="color:#5864FF;">闲置入库 &nbsp; {{ topData.spareBackApplyNum }}</span>
+                </a>
               </a-col>
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col >
                 <a-badge color="#F19149"/>
-                <span style="color:#F19149;">其他入库 &nbsp; {{ topData.otherNum }}</span>
+                <a href="/in/store/myform?type=3&status=1" target="_block">
+                  <span style="color:#F19149;">调拨入库 &nbsp; {{ topData.applyDBNum }}</span>
 
+                </a>
               </a-col>
               <a-col>
                 <a-badge color="#009944"/>
-                <span style="color:#009944;">调拨入库 &nbsp; {{ topData.applyDBNum }}</span>
+                <a href="/in/store/myform?type=6&status=1" target="_block">
+
+                  <span style="color:#009944;">其他入库 &nbsp; {{ topData.otherNum }}</span>
+
+                </a>
 
               </a-col>
             </a-row>
@@ -37,28 +44,37 @@
           <div class="gutter-box">
             <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
               <a-col>待出库总数</a-col>
-              <a-col>{{ topData.outTotalNum }}</a-col>
+              <a href="/out/store/myform?status=1" target="_block">
+                <a-col>{{ topData.outTotalNum }}</a-col>
+              </a>
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col >
                 <a-badge color="#E4007F"/>
-                <span style="color:#E4007F;">待调拨出库 &nbsp; {{ topData.outDBNum }}</span>
+                <a href="/out/store/myform?type=2&status=1" target="_block">
+                  <span style="color:#E4007F;">调拨出库 &nbsp; {{ topData.outDBNum }}</span>
+                </a>
               </a-col>
               <a-col >
                 <a-badge color="#5864FF"/>
-                <span style="color:#5864FF;">待领用出库 &nbsp; {{ topData.lyNum }}</span>
-
+                <a href="/out/store/myform?type=1&status=1" target="_block">
+                  <span style="color:#5864FF;">领用出库 &nbsp; {{ topData.lyNum }}</span>
+                </a>
               </a-col>
             </a-row>
             <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
               <a-col >
                 <a-badge color="#F19149"/>
-                <span style="color:#F19149;">报废出库 &nbsp; {{ topData.bfNum }}</span>
-
+                <a href="/out/store/myform?type=3&status=1" target="_block">
+                  <span style="color:#F19149;">报废出库 &nbsp; {{ topData.bfNum }}</span>
+                </a>
               </a-col>
               <a-col>
                 <a-badge color="#009944"/>
-                <span style="color:#009944;">其他出库 &nbsp; {{ topData.otherOutNum }}</span>
+                <a href="/out/store/myform?type=6&status=1" target="_block">
+
+                  <span style="color:#009944;">其他出库 &nbsp; {{ topData.otherOutNum }}</span>
+                </a>
 
               </a-col>
             </a-row>

+ 488 - 0
src/views/workplace/backlog/modules/RepairBaseForm.vue

@@ -0,0 +1,488 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="900"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['sbId']" type="hidden"/>
+      </a-form-item>
+
+      <row-list :col="2">
+        <row-item>
+          <a-form-item
+            label="设备名称"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 70%"
+              disabled
+              v-decorator="['sbName', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
+            <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="使用位置"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['sbCph', {rules: [{required: true, message: '设备使用位置不能为空'}]}]" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="工单类别"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="changePlanFlag" v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in categoryMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="是否停机"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['needStop', {rules: [{required: true, message: '是否停机不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in needStopMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item v-show="category === 1">
+          <a-form-item
+            label="要求日期"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-date-picker
+              style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+              v-decorator="['limitDate']" />
+          </a-form-item>
+        </row-item>
+        <row-item v-show="category === 2">
+          <a-form-item
+            label="要求时间"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 100%"
+              suffix="小时"
+              v-decorator="['limitHours']" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="报修单号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              v-decorator="['no', {rules: [{required: false, message: '报修单号不能为空'}]}]" />
+          </a-form-item>
+        </row-item>
+<!--        <row-item>
+          <a-form-item
+            label="报修来源"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['source', {initialValue: DictCache.VALUE.REPAIR_APPLICATION_FORM_SOURCE.SCENE,rules: [{required: true, message: '报修来源不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in sourceMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>-->
+        <row-item>
+          <a-form-item
+            label="报修人"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['actualUser', {initialValue: userInfo.realName, rules: [{required: true, message: '报修人不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+        <!--        <row-item>
+          <a-form-item
+            label="紧急等级"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['level', {initialValue: 1, rules: [{required: true, message: '紧急等级不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in levelMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="异常类别"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-tree-select
+              style="width: 100%"
+              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+              :treeData="treeData"
+              :treeNodeFilterProp="'title'"
+              :showSearch="true"
+              v-decorator="['repairErrorTypeId']"
+              placeholder="请选择"
+            >
+            </a-tree-select>
+          </a-form-item>
+        </row-item>-->
+        <row-item>
+          <a-form-item
+            label="报修图片"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              list-type="picture"
+              :file-list="this.defaultApplicationFileList"
+              @change="handleApplicationFileChange"
+              accept="image/*"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 上传图片 </a-button>
+            </a-upload>
+          </a-form-item>
+        </row-item>
+      </row-list>
+
+      <row-list :col="1">
+        <row-item v-if="false">
+          <a-form-item
+            label="报修状态"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select disabled v-decorator="['status', {initialValue: DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED,rules: [{required: true, message: '报修状态不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in statusMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+
+        <!--        <row-item>
+          <a-form-item
+            label="故障描述"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-select v-decorator="['content']" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in questionMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>-->
+        <row-item>
+          <a-form-item
+            label="故障描述"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-decorator="['content', {rules: [{required: true, message: '故障描述不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+    <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+    <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import BaseTool from '../../../../utils/tool'
+import { addRepairApplicationForm, updateRepairApplicationForm } from '@/api/repair/application-form'
+import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+import { queryUser } from '@/api/upms/user'
+import { uploadUrl } from '@/api/upms/file'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { fetchErrorTypeTree } from '@/api/repair/errortype'
+
+export default {
+  name: 'BaseRepairApplicationForm',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      sourceMap: {},
+      levelMap: {},
+      questionMap: {},
+      treeData: [],
+      needStop: null,
+      needStopMap: {},
+      category: 0,
+      categoryMap: {},
+      statusMap: {},
+      userInfo: this.$store.getters.userInfo,
+      userList: [],
+      uploadUrl: uploadUrl,
+      defaultRepairFileList: [],
+      defaultApplicationFileList: [],
+      defaultCheckFileList: [],
+      applicationFileList: [], // 报修图片
+      checkFileList: [], // 审核图片
+      repairFileList: [], // 维修图片,
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      }
+    }
+  },
+  components: {
+    SbInfoSelectModal,
+    PartInfoSelectModal
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+    this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
+    this.questionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
+    this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
+    this.getUsers()
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      fetchErrorTypeTree().then(res => {
+        this.treeData = res.data
+      })
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        if (!this.BaseTool.Object.isBlank(record) && !this.BaseTool.Object.isBlank(record.sbId)) {
+          const { form: { setFieldsValue } } = this
+          this.$nextTick(() => {
+            setFieldsValue(Object.assign(pick(record, [
+              'sbId',
+              'sbName'
+            ])))
+          })
+        }
+        return
+      }
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        this.modalTitle = '添加'
+        if (!this.BaseTool.Object.isBlank(record.sbId)) {
+          const { form: { setFieldsValue } } = this
+          this.$nextTick(() => {
+            setFieldsValue(Object.assign(pick(record, [
+              'sbId',
+              'sbName',
+              'sbCph'
+            ])))
+          })
+        }
+        return
+      }
+      this.modalTitle = '编辑'
+      this.applicationFileList = record.applicationFileList
+      this.repairFileList = record.repairFileList
+      this.checkFileList = record.checkFileList
+      this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(this.applicationFileList)
+      this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
+      this.defaultCheckFileList = this.BaseTool.UPLOAD.transImg(this.checkFileList)
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      record.applyTime = this.BaseTool.Moment(record.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      if (record.limitDate != null) {
+        record.limitDate = this.BaseTool.Moment(record.limitDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'limitDate'
+          ])))
+        })
+      }
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'sbId',
+          'sbCph',
+          'partId',
+          'repairUserId',
+          'no',
+          'category',
+          'limitDate',
+          'limitHours',
+          'source',
+          'level',
+          'content',
+          'status',
+          'sbName',
+          'needStop',
+          'category',
+          'partName',
+          'remark'
+        ])))
+      })
+    },
+    getUsers () {
+      queryUser({ status: 1 }).then(res => {
+        this.userList = res.data
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        values.applyTime = this.BaseTool.Date.formatter(values.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+        values.limitDate = BaseTool.Date.formatter(values.limitDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        // 上传文件
+        values.repairFileList = this.repairFileList
+        values.applicationFileList = this.applicationFileList
+        values.checkFileList = this.checkFileList
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addRepairApplicationForm(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateRepairApplicationForm(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    changePlanFlag (value) {
+      this.category = value
+      const { form: { setFieldsValue } } = this
+      if (this.category === 1) {
+        this.$nextTick(() => {
+          setFieldsValue({ needStop: 1 })
+        })
+      } else {
+        this.$nextTick(() => {
+          setFieldsValue({ needStop: 0 })
+        })
+      }
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.applicationFileList = []
+      this.defaultApplicationFileList = []
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base({}, {})
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'sbId': key,
+          'sbName': row.name,
+          'sbCph': row.cph
+        }))
+      })
+    },
+    handlePartSelect () {
+      const sbId = this.form.getFieldValue('sbId')
+      this.$refs.partInfoSelectModal.base({ sbId })
+    },
+    handlePartSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'partId': key,
+          'partName': row.name
+        }))
+      })
+    },
+    handleApplicationFileChange (info) {
+      this.defaultApplicationFileList = info.fileList
+      this.applicationFileList = this.setFileList(info, 11)
+    },
+    setFileList (info, type) {
+      const file = info.file
+      const fileList = info.fileList
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return []
+      }
+    }
+  }
+}
+</script>