Parcourir la source

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

hfxc226 il y a 2 ans
Parent
commit
47b6a3a1bf

+ 28 - 1
src/api/repair/repair.js

@@ -48,7 +48,19 @@ export function updateRepairScheme (parameter) {
     data: parameter
   })
 }
-
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addRepairSchemes (parameter) {
+  return axios({
+    url: `/repair/repairs/${parameter.id}/${parameter.repairId}`,
+    method: 'PUT',
+    data: parameter
+  })
+}
 /**
  * fetch single func
  * parameter: { }
@@ -65,6 +77,21 @@ export function fetchRepairScheme (parameter) {
   })
 }
 
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getRepairType () {
+  return axios({
+    url: '/repair/error-types/tree',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
 /**
  * query list func
  * parameter: { }

+ 2 - 1
src/utils/dict.js

@@ -364,7 +364,8 @@ DictCache.VALUE = {
   CUSTOM_TEMPLATE_SB_REMARK: {
     SB_SCRAP_FORM: 'sb_info_scrap',
     SB_ALLOCATE_FORM: 'sb_info_allocate',
-    SB_STOP_FORM: 'sb_info_stop'
+    SB_STOP_FORM: 'sb_info_stop',
+    OUT_STORE_BACK: 'out_store_back'
   },
   SB_INFO_AUDIT_MODEL_NAME: {
     'sb_info_scrap': '设备报废审批', // 报废

+ 1 - 1
src/utils/tool.js

@@ -1017,7 +1017,7 @@ BaseTool.UPLOAD = {
         fileDTO.fileName = data.fileName
         fileDTO.fileFormat = data.fileFormat
         fileDTO.url = data.url
-        fileDTO.id = data.id || fileList[i].uid
+        // fileDTO.id = data.id || fileList[i].uid
         temp.push(fileDTO)
       }
     }

+ 10 - 2
src/views/activiti/task/MyTask.vue

@@ -50,13 +50,15 @@ import DetailYYAudit from '@/views/store/outstoreform/modules/DetailYYAudit'
 import { getTaskPage } from '@/api/activiti/activiti'
 import { fetchCustomFieldTemplateData, fetchCustomFieldTemplateVOData } from '@/api/customize/fieldTemplateData'
 import { changeOutStoreFormForAudit } from '@/api/activiti/activiti-outstoreform'
+import { fetchOutStoreForm } from '@/api/store/outstoreform'
 
 export default {
   name: 'TaskList',
   components: {
     STable,
     Ellipsis,
-    DetailAuditScrap,DetailYYAudit,
+    DetailAuditScrap,
+    DetailYYAudit,
     AssignForm
   },
   data () {
@@ -154,7 +156,13 @@ export default {
     handleAudit (record) {
       this.visible = false
       if (record.targetCode === 'out_store_back') { // 仓库审批跳转到仓库审批页面
-        this.$refs.detailYYAuditModal.base(record)
+        fetchOutStoreForm({ id: record.targetId }).then(res => {
+          const templateData = res.data
+          const recordTemp = res.data
+          recordTemp.taskId = record.taskId
+          recordTemp.remark = record.targetCode
+          this.$refs.detailAuditScrapModal.base(recordTemp, templateData)
+        })
       } else {
         fetchCustomFieldTemplateVOData({ id: record.targetId }).then(res => {
           const templateData = JSON.parse(res.data.data)

+ 8 - 4
src/views/fill/task/modules/BaseForm.vue

@@ -83,7 +83,7 @@
               <th rowspan="2" width="150px">填报时间</th>
               <th :colspan="ListForm.length>0?ListForm[0].content.length:1">项目内容项</th>
               <th rowspan="2" width="150px">是否填报</th>
-              <th rowspan="2" width="150px" v-if="editor">操作</th>
+              <th rowspan="2" width="150px" >操作</th>
             </tr>
             <tr v-if="ListForm.length>0">
               <th v-for="item in ListForm[0].content" :key="item.name">{{ item.name }}</th>
@@ -109,14 +109,15 @@
               <td>
                 <a-icon v-show="item.status === 1" type="check" style="color:#87d068;font-size: 26px;" />
               </td>
-              <td v-if="editor">
-                <a-button type="link" @click="handleRepair(item)">
+              <td>
+                <a-button v-if="editor" type="link" @click="handleRepair(item)">
                   报修
                 </a-button>
                 <a-button type="link" @click="uploadImg(item,i)">{{ item.images&&item.images.length?'查看图片':'上传图片' }}</a-button>
 
                 <a-modal v-model="uploadVisible" title="上传图片" :footer="null" @cancel="uploadVisible = false">
                   <a-upload
+                    :disabled="!editor"
                     :action="uploadUrl"
                     list-type="picture-card"
                     :file-list="defaultApplicationFileList"
@@ -315,7 +316,10 @@ export default {
       this.uploadVisible = true
       console.log(val)
       this.imgId = i
-      this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(val.images)
+      this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(val.images.map((item, i) => {
+        item.id = i
+        return item
+      }))
       console.log(this.defaultApplicationFileList)
       console.log(this.applicationFileList)
     },

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

@@ -237,6 +237,10 @@
               <a-icon type="plus"/>
               添加方案
             </a-button>
+            <a-button style="margin-left:30px;" v-if="$auth('repair-repairs-add')" type="primary" @click="handleAddRepairResolves">
+              <a-icon type="read" />
+              方案库
+            </a-button>
           </div>
           <a-table
             :data-source="dataRepairResolve"
@@ -301,6 +305,7 @@
     <report-up-form ref="reportUpForm" @ok="handleOk" @okk="handleCancel" />
     <ticket-form ref="ticketForm" @ok="handleOk" />
     <longYanSelectSpareForm ref="longYanSelectSpareForm" @ok="handleOk"/>
+    <scheme-library ref="schemeLibrary" @ok="handleOk"/>
   </div>
 </template>
 
@@ -314,6 +319,7 @@ import FinishForm from './FinishForm'
 import EditForm from './EditForm'
 import DispatchForm from './DispatchForm'
 import AssignForm from './AssignForm'
+import SchemeLibrary from './SchemeLibrary'
 import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
 import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
 import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
@@ -353,6 +359,7 @@ export default {
   name: 'RepairApplicationFormDetail',
   components: {
     CheckForm,
+    SchemeLibrary,
     EditForm,
     DetailList,
     DetailSbCheck,
@@ -450,12 +457,16 @@ export default {
         },
         {
           title: '备件编码',
-          dataIndex: 'no'
+          dataIndex: 'spareId'
         },
         {
           title: '规格型号',
           dataIndex: 'ggxh'
         },
+        {
+          title: '更换数量',
+          dataIndex: 'num'
+        },
         {
           title: '更换日期',
           dataIndex: 'startDate'
@@ -898,7 +909,11 @@ export default {
     },
     handleAddRepairResolve () {
       const modal = this.$refs.resolveBaseForm
-      modal.base({ repairId: this.model.id, repairNo: this.model.no })
+      modal.base({ repairId: this.model.id, repairNo: this.model.no, errorContent: this.model.content, sbId: this.model.sbId })
+    },
+    handleAddRepairResolves () {
+      const modal = this.$refs.schemeLibrary
+      modal.base(this.model)
     },
     handleViewRepairResolve (record) {
       this.visible = false

+ 1 - 1
src/views/repair/application-form/modules/LongYanSelectSpareForm.vue

@@ -85,7 +85,7 @@ export default {
           title: '序号',
           key: 'index',
           align: 'center',
-          width: 50,
+          width: 90,
           scopedSlots: { customRender: 'index' }
         },
         {

+ 172 - 0
src/views/repair/application-form/modules/SchemeLibrary.vue

@@ -0,0 +1,172 @@
+<template>
+  <a-modal
+    title="方案库"
+    :width="1000"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+    :footer="null"
+  >
+    <div v-show="show">
+      <div>
+        <a-form layout="inline">
+          <a-row >
+            <a-col :md="8" :sm="24">
+              <a-form-item label="关键字">
+                <a-input style="width: 100%" v-model="keyword" placeholder="请输入关键字!"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="故障类别">
+                <a-select style="width: 200px" v-model="errorTypeId">
+                  <a-select-option v-for="item in errorType" :key="item.id" :value="item.id">
+                    {{ item.title }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="getInfo">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-table
+        :columns="columns"
+        :data-source="dataSource"
+        bordered
+        :defaultExpandAllRows="true"
+      >
+        <template v-slot:index="text,record,index">
+          {{ index+1 }}
+        </template>
+        <template v-slot:errorTypeId="text,record">
+          {{ errorType.find(item=>item.id===text).title }}
+        </template>
+        <template v-slot:action="text,record">
+          <a-button type="link" @click="addRepairSchemes(record)"> 获取 </a-button>
+          <a-button type="link" @click="handleViewRepairResolve(record)"> 查看</a-button>
+        </template>
+      </a-table>
+    </div>
+    <resolve-detail ref="resolveDetail" @ok="handleOk"/>
+  </a-modal>
+</template>
+
+<script>
+import { getRepairSchemePage, addRepairSchemes, getRepairType, fetchRepairScheme } from '@/api/repair/repair'
+import ResolveDetail from '@/views/repair/repair/modules/Detail'
+
+export default {
+  name: 'LongYanSelectSpareForm',
+  data () {
+    return {
+      model: null,
+      visible: false,
+      show: true,
+      confirmLoading: false,
+      keyword: '',
+      errorTypeId: '',
+      dataSource: [],
+      errorType: [],
+      columns: [
+        {
+          title: '序号',
+          key: 'index',
+          align: 'center',
+          width: 50,
+          scopedSlots: { customRender: 'index' }
+        },
+        {
+          title: '故障描述',
+          width: 150,
+          dataIndex: 'errorContent'
+        },
+        {
+          title: '方案描述',
+          dataIndex: 'opinion',
+          width: 150
+        },
+        {
+          title: '故障类别',
+          dataIndex: 'errorTypeId',
+          width: 100,
+          scopedSlots: { customRender: 'errorTypeId' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          width: 100,
+          scopedSlots: { customRender: 'action' }
+        }
+      ]
+    }
+  },
+  components: {
+    ResolveDetail
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (record) {
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
+      this.visible = true
+      this.model = record
+      console.log(record)
+      this.getInfo()
+    },
+    getInfo () {
+      getRepairSchemePage({
+        keyword: this.keyword,
+        errorTypeId: this.errorTypeId,
+        dataScope: {
+          sortBy: 'desc',
+          sortName: 'created_time'
+        }
+      }).then(res => {
+        this.dataSource = res.data.rows
+      })
+    },
+    resetSearchForm () {
+      this.keyword = ''
+      this.errorTypeId = ''
+      this.getInfo()
+    },
+    handleViewRepairResolve (record) {
+      this.show = false
+      fetchRepairScheme({ id: record.id }).then(res => {
+        const modal = this.$refs.resolveDetail
+        modal.base(res.data)
+      })
+    },
+    addRepairSchemes (val) {
+      addRepairSchemes({
+        id: val.id,
+        repairId: this.model.id
+      }).then(res => {
+        this.$message.success('添加成功!')
+        this.handleCancel()
+      })
+    },
+    handleOk () {
+      this.show = true
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.keyword = ''
+      this.errorTypeId = ''
+      this.$emit('ok')
+    }
+  }
+}
+</script>

+ 47 - 13
src/views/repair/repair/modules/BaseForm.vue

@@ -6,25 +6,50 @@
     :confirmLoading="confirmLoading"
     @cancel="handleCancel"
   >
-    <a-form :form='form'>
+    <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 v-show="false">
+        <a-input v-decorator="['id']" type="hidden" />
+        <a-input v-decorator="['repairId']" type="hidden" />
+        <a-input v-decorator="['sbId']" type="hidden" />
       </a-form-item>
 
-      <row-list :col='1'>
+      <row-list :col="1">
         <row-item>
           <a-form-item
-            label='维修单号'
-            :labelCol='BaseTool.Constant.labelCol'
-            :wrapperCol='BaseTool.Constant.wrapperCol'
+            label="维修单号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input
-              disabled='disabled'
+              disabled="disabled"
               v-decorator="['repairNo']" />
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="故障类别"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select style="width: 100%" v-decorator="['errorTypeId', {rules: [{required: true, message: '故障类别不能为空'}]}]">
+              <a-select-option v-for="item in errorType" :key="item.id" :value="item.id">
+                {{ item.title }}
+              </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-textarea
+              :rows="4"
+              v-decorator="['errorContent', {rules: [{required: true, message: '故障描述不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="方案描述"
@@ -33,7 +58,7 @@
           >
             <a-textarea
               :rows="4"
-              v-decorator="['opinion', {rules: [{required: true, message: '故障描述不能为空'}]}]"/>
+              v-decorator="['opinion', {rules: [{required: true, message: '方案描述不能为空'}]}]"/>
           </a-form-item>
         </row-item>
         <row-item>
@@ -55,7 +80,7 @@
             </a-upload>
           </a-form-item>
         </row-item>
-<!--        <row-item>
+        <!--        <row-item>
           <a-form-item
             label='方案图'
             :labelCol='BaseTool.Constant.labelCol'
@@ -82,7 +107,7 @@
             </a-upload>
           </a-form-item>
 
-<!--          <a-form-item
+          <!--          <a-form-item
             label='维修方案文件'
             :labelCol='BaseTool.Constant.labelCol'
             :wrapperCol='BaseTool.Constant.wrapperCol'
@@ -129,7 +154,7 @@
 
 <script>
 import pick from 'lodash.pick'
-import { addRepairScheme, updateRepairScheme } from '@/api/repair/repair'
+import { addRepairScheme, updateRepairScheme, getRepairType } from '@/api/repair/repair'
 import { uploadUrl } from '@/api/upms/file'
 import Vue from 'vue'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
@@ -143,6 +168,7 @@ export default {
       form: this.$form.createForm(this),
       visible: false,
       uploadUrl: uploadUrl,
+      errorType: [],
       defaultApplicationFileList: [],
       applicationFileList: [],
       defaultFileList: [],
@@ -158,10 +184,15 @@ export default {
   },
   created () {
     // 下拉框map
+
   },
   methods: {
     base (record) {
       this.visible = true
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
+      console.log(record)
       this.defaultFileList = []
       this.applicationFileList = []
       const { form: { setFieldsValue } } = this
@@ -170,8 +201,11 @@ export default {
         setFieldsValue(Object.assign(pick(record, [
           'id',
           'repairId',
+          'sbId',
+          'errorContent',
           'opinion',
           'imageList',
+          'errorTypeId',
           'opinionFile',
           'status',
           'deleteFlag',

+ 21 - 14
src/views/repair/repair/modules/Detail.vue

@@ -1,20 +1,22 @@
 <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 style='margin-left: 8px' type='default' @click='handleCancel()'>返回</a-button>
-              </span>
+  <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 style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+        </span>
       </a-col>
     </a-row>
-    <detail-list title='' :col='2'>
-      <detail-list-item term='方案提供者'>{{ model.createdUserName }}</detail-list-item>
-      <detail-list-item term='方案提供时间'>{{ model.createdTime }}</detail-list-item>
-      <detail-list-item term='方案修改者'>{{ model.updateUserName }}</detail-list-item>
-      <detail-list-item term='方案修改时间'>{{ model.updateTime }}</detail-list-item>
+    <detail-list title="" :col="2">
+      <detail-list-item term="方案提供者">{{ model.createdUserName }}</detail-list-item>
+      <detail-list-item term="方案提供时间">{{ model.createdTime }}</detail-list-item>
+      <detail-list-item term="方案修改者">{{ model.updateUserName }}</detail-list-item>
+      <detail-list-item term="方案修改时间">{{ model.updateTime }}</detail-list-item>
     </detail-list>
-    <detail-list title='' :col='1'>
-      <detail-list-item term='维修意见'>{{ model.opinion }}</detail-list-item>
+    <detail-list title="" :col="2">
+      <detail-list-item term="故障描述">{{ model.errorContent }}</detail-list-item>
+      <detail-list-item term="故障类别">{{ errorType.find(item=>item.id===model.errorTypeId).title }}</detail-list-item>
+      <detail-list-item term="维修意见">{{ model.opinion }}</detail-list-item>
     </detail-list>
     <title-divider title="维修方案" width="90px"></title-divider>
     <detail-list title="" :col="1">
@@ -41,6 +43,7 @@
 
 <script>
 import DetailList from '@/components/tools/DetailList'
+import { getRepairType } from '@/api/repair/repair'
 
 const DetailListItem = DetailList.Item
 
@@ -50,10 +53,11 @@ export default {
     DetailList,
     DetailListItem
   },
-  data() {
+  data () {
     return {
       confirmLoading: false,
       mdl: {},
+      errorType: [],
       modalTitle: null,
       visible: false,
       // 下拉框map
@@ -74,6 +78,9 @@ export default {
   methods: {
     base (record) {
       this.visible = true
+      getRepairType().then(res => {
+        this.errorType = res.data
+      })
       this.modalTitle = '方案详情'
       this.model = record
     },

+ 51 - 16
src/views/sb/modelbom/modules/Detail.vue

@@ -21,18 +21,18 @@
     </detail-list>
     <title-divider title="BOM信息" width="90px" v-show="visibleOther"></title-divider>
     <div class="table-operator" style="margin-bottom: 8px;" v-show="visibleOther">
-      <a-button type="primary" @click="handleAdd">
+<!--      <a-button type="primary" @click="handleAdd">
         <a-icon type="plus"/>
         单条添加
-      </a-button>
-      <a-button style="margin-left:8px;" type="primary" @click="handleSpareSelect">
+      </a-button>-->
+      <a-button style="margin-left:8px;" type="primary" @click="handleSpareStoreSelect">
         <a-icon type="plus"/>
         批量添加
       </a-button>
-      <a-button style="margin-left:8px;" type="primary" @click="handleAddSpareInfo">
+<!--      <a-button style="margin-left:8px;" type="primary" @click="handleAddSpareInfo">
         <a-icon type="plus"/>
         添加备件
-      </a-button>
+      </a-button>-->
       <a-button style="margin-left: 8px" type="primary" icon="download" @click="downTemplate">下载模板</a-button>
       <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>
       <a-button style="margin-left:8px;" type="primary" @click="doImport">
@@ -48,7 +48,7 @@
       rowKey="id">
       <span slot="action" slot-scope="record">
         <template>
-          <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+<!--          <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>-->
           <a-divider type="vertical" />
           <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
             <a>删除</a>
@@ -60,6 +60,7 @@
     <spare-base-form ref="spareBaseModal" @ok="handleOk"/>
     <import-form-add ref="importModal" @ok="handleOk"></import-form-add>
     <spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
+    <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
   </a-card>
 </template>
 
@@ -70,6 +71,7 @@ import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modu
 import BaseForm from './BaseForm'
 import ImportFormAdd from './ImportFormAdd'
 import SpareBaseForm from '@/views/sqarepartmanage/sparepartinfo/modules/BaseForm'
+import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModalYY'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -80,7 +82,8 @@ export default {
     BaseForm,
     SparePartInfoSelectModal,
     ImportFormAdd,
-    SpareBaseForm
+    SpareBaseForm,
+    SpareStoreSelectModal
   },
   data () {
     return {
@@ -105,27 +108,27 @@ export default {
       periodTypeMap: {},
       // 表头
       columns: [
-        {
+        /*{
           title: '备件编号',
           dataIndex: 'spareId'
-        },
+        },*/
         {
-          title: '名称',
-          dataIndex: 'name'
+          title: '备件名称',
+          dataIndex: 'spareName'
         },
         {
-          title: '编码',
+          title: '备件编码',
           dataIndex: 'no'
         },
-        {
+        /*{
           title: '自编号',
           dataIndex: 'zbh'
-        },
+        },*/
         {
           title: '规格型号',
           dataIndex: 'ggxh'
         },
-        {
+        /*{
           title: '更换周期',
           dataIndex: 'period',
           customRender: (text, record, index) => {
@@ -147,7 +150,7 @@ export default {
         {
           title: '助记码',
           dataIndex: 'zjm'
-        },
+        },*/
         {
           title: '操作',
           key: 'action',
@@ -206,6 +209,38 @@ export default {
           this.confirmLoading = false
         })
     },
+    handleSpareStoreSelect () {
+      this.$refs.spareStoreSelectModal.base()
+    },
+    handleSpareStoreSelected (record, keys, rows) {
+      const addData = []
+      for (let i = 0; i < rows.length; i++) {
+        addData.push({ spareId: 111111, sbId: this.model.id, modelId: this.model.id, no: rows[i].no, spareName: rows[i].spareName, num: 1, ggxh: rows[i].ggxh })
+      }
+      addSbModelBomBatch(addData)
+        .then((response) => {
+          this.$message.info('批量添加成功')
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+
+      /*const { data } = this
+      for (let i = 0; i < rows.length; i++) {
+        let find = false
+        for (let j = 0; j < data.length; j++) {
+          if (rows[i].cbatch === data[j].cbatch) {
+            find = true
+            break
+          }
+        }
+        if (!find) {
+          const selectData = rows[i]
+          selectData.num = 1
+          data.push(selectData)
+        }
+      }*/
+    },
     handleAdd () {
       const modal = this.$refs.baseModal
       modal.base({ modelId: null, sbId: this.model.id })

+ 60 - 5
src/views/sb/scraps/modules/DetailAudit.vue

@@ -13,7 +13,7 @@
       <detail-list-item term="申请人">{{ model.createdUserName }}</detail-list-item>
       <detail-list-item term="申请日期">{{ model.createdTime }}</detail-list-item>
     </detail-list>
-    <detail-list v-show='sbInfoAllocate' title="设备调拨" :col="2">
+    <detail-list v-show="sbInfoAllocate" title="设备调拨" :col="2">
       <detail-list-item term="单号">{{ model.no }}</detail-list-item>
       <detail-list-item term="标题">{{ model.title }}</detail-list-item>
       <detail-list-item term="申请部门">{{ model.currentDeptName }}</detail-list-item>
@@ -22,13 +22,13 @@
       <detail-list-item term="结束时间">{{ model.endTime }}</detail-list-item>
       <detail-list-item term="备注">{{ model.dataRemark }}</detail-list-item>
     </detail-list>
-    <detail-list v-show='sbInfoAllocate' title="设备调拨详情" :col="2" v-for="(item, index) in sbInfos" :key="index">
+    <detail-list v-show="sbInfoAllocate" title="设备调拨详情" :col="2" v-for="(item, index) in sbInfos" :key="index">
       <detail-list-item term="设备名称">{{ item.name }}</detail-list-item>
       <detail-list-item term="设备编号">{{ item.no }}</detail-list-item>
       <detail-list-item term="设备类型">{{ item.typeName }}</detail-list-item>
       <detail-list-item term="生成厂商">{{ item.producerName }}</detail-list-item>
     </detail-list>
-    <detail-list v-show='sbInfoStop' title="设备停用" :col="2">
+    <detail-list v-show="sbInfoStop" title="设备停用" :col="2">
       <detail-list-item term="单号">{{ model.no }}</detail-list-item>
       <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
       <detail-list-item term="维修单">{{ model.repairId }}</detail-list-item>
@@ -36,13 +36,26 @@
       <detail-list-item term="停用原因">{{ model.reason }}</detail-list-item>
       <detail-list-item term="备注">{{ model.dataRemark }}</detail-list-item>
     </detail-list>
-    <detail-list v-show='sbInfoScrap' title="设备报废" :col="2">
+    <detail-list v-show="sbInfoScrap" title="设备报废" :col="2">
       <detail-list-item term="单号">{{ model.no }}</detail-list-item>
       <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
       <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
       <detail-list-item term="报废原因">{{ model.reason }}</detail-list-item>
       <detail-list-item term="备注">{{ model.dataRemark }}</detail-list-item>
     </detail-list>
+    <detail-list v-show="storeInfo" title="" :col="2">
+      <detail-list-item term="单号">{{ model.outNo }}</detail-list-item>
+      <detail-list-item term="仓库名称">{{ model.storeName }}</detail-list-item>
+    </detail-list>
+    <title-divider v-show="storeInfo" title="备件明细" width="90px"></title-divider>
+    <a-table
+      v-if="storeInfo"
+      bordered
+      :data-source="model.detailList"
+      :columns="columns"
+      tableLayout="auto"
+      rowKey="cbatch">
+    </a-table>
     <history ref="history" :audit="audit" @ok="handleCancel"></history>
   </a-card>
 </template>
@@ -74,6 +87,7 @@ export default {
       sbInfoStop: false,
       sbInfoScrap: false,
       visible: false,
+      storeInfo: false,
       // 下拉框map
       statusMap: {},
       task: {},
@@ -96,7 +110,46 @@ export default {
         'no': null,
         'sbNo': null
       },
-      sbInfos: []
+      sbInfos: [],
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '备件名称',
+          dataIndex: 'spareName'
+        },
+        {
+          title: '编号',
+          dataIndex: 'no'
+        },
+        {
+          title: '规格',
+          dataIndex: 'ggxh'
+        },
+        {
+          title: '仓库',
+          dataIndex: 'storeName'
+        },
+        {
+          title: '批次',
+          dataIndex: 'cbatch'
+        },
+        {
+          title: '申请数量',
+          dataIndex: 'num',
+          width: 150
+        },
+        {
+          title: '实际数量',
+          dataIndex: 'realNum',
+          width: 150
+        }
+      ]
     }
   },
   created () {
@@ -118,6 +171,8 @@ export default {
         this.sbInfoScrap = true
       } else if (record.remark === this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_STOP_FORM) {
         this.sbInfoStop = true
+      } else if (record.remark === this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.OUT_STORE_BACK) {
+        this.storeInfo = true
       }
       if (record.targetId === undefined) {
         model.id = record.id // 将targetId赋给model,带入history,用作提交

+ 11 - 1
src/views/store/outstoreform/OutStoreFormYY.vue

@@ -99,6 +99,7 @@ import TicketForm from './modules/TicketForm'
 
 import { updateStoreBack, getOutStoreFormPage, deleteOutStoreForms, fetchOutStoreForm, exportOutStoreForm } from '@/api/store/outstoreform'
 import { startOutStoreForm } from '@/api/activiti/activiti-outstoreform'
+import { startSbInfoScrap } from '@/api/activiti/activiti-sb-scrap'
 
 export default {
   name: 'OutStoreFormList',
@@ -275,10 +276,19 @@ export default {
       })
     },
     updateStore (id) {
-      startOutStoreForm({ id: id }).then(res => {
+      const params = {}
+      params.id = id
+      params.processInstanceId = ''
+      params.auditModelName = '仓库审批'
+      params.auditModelKey = 'out_store_back'
+      startSbInfoScrap(params).then(res => {
         this.$message.info('已提交,请等待主管审核')
         this.$refs.table.refresh()
       })
+      /* startOutStoreForm({ id: id }).then(res => {
+        this.$message.info('已提交,请等待主管审核')
+        this.$refs.table.refresh()
+      }) */
     },
     updateStoreBack (id) {
       updateStoreBack({ id: id }).then(res => {