فهرست منبع

保养标准插入日期

xiongchao 4 سال پیش
والد
کامیت
31e7d5af46

+ 16 - 1
src/api/check/checkstandard.js

@@ -49,6 +49,20 @@ export function updateCheckStandard (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function copy (parameter) {
+  return axios({
+    url: '/check/standards/copy',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }
@@ -73,8 +87,9 @@ export function fetchCheckStandard (parameter) {
  */
 export function generateJobByCheckStandard (parameter) {
   return axios({
-    url: '/check/standards/generate/' + parameter.id,
+    url: '/check/standards/generate',
     method: 'PUT',
+    data: parameter,
     headers: {
       'Content-Type': 'application/json;charset=UTF-8'
     }

+ 14 - 0
src/api/part/info.js

@@ -65,6 +65,20 @@ export function updatePartInfo (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function copy (parameter) {
+  return axios({
+    url: '/part/infos/copy',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }

+ 14 - 0
src/api/sb/modelbom.js

@@ -147,6 +147,20 @@ export function updateSbModelBom (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function copy (parameter) {
+  return axios({
+    url: '/sb/model-spare-boms/copy',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }

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

@@ -172,15 +172,23 @@ export default {
          // checked: true
         //},
         {
-          title: '任务开始时间',
+          title: '执行日期',
           dataIndex: 'startTime',
           checked: true
         },
         {
-          title: '任务结束时间',
+          title: '截至日期',
           dataIndex: 'endTime',
           checked: true
         },
+        {
+          title: '标准工时',
+          dataIndex: 'standardHours'
+        },
+        {
+          title: '实际工时',
+          dataIndex: 'realHours'
+        },
         {
           title: '实际开始时间',
           dataIndex: 'actualStartTime'

+ 4 - 4
src/views/check/checkjob/modules/BaseForm.vue

@@ -90,7 +90,7 @@
         </row-item>
         <row-item>
           <a-form-item
-            label="任务开始时间"
+            label="执行日期"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
@@ -99,12 +99,12 @@
               disabled
               style="width: 100%"
               :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-              v-decorator="['startTime', {rules: [{required: true, message: '任务开始时间不能为空'}]}]"/>
+              v-decorator="['startTime', {rules: [{required: true, message: '执行日期不能为空'}]}]"/>
           </a-form-item>
         </row-item>
         <row-item>
           <a-form-item
-            label="任务结束时间"
+            label="截至日期"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
@@ -113,7 +113,7 @@
               disabled
               style="width: 100%"
               :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-              v-decorator="['endTime', {rules: [{required: true, message: '任务结束时间不能为空'}]}]"/>
+              v-decorator="['endTime', {rules: [{required: true, message: '截至日期不能为空'}]}]"/>
           </a-form-item>
         </row-item>
         <row-item>

+ 2 - 2
src/views/check/checkjob/modules/CheckJobSelectModal.vue

@@ -111,11 +111,11 @@ export default {
           dataIndex: 'planId'
         },
         {
-          title: '任务开始时间',
+          title: '执行日期',
           dataIndex: 'startTime'
         },
         {
-          title: '任务结束时间',
+          title: '截至日期',
           dataIndex: 'endTime'
         },
         {

+ 6 - 6
src/views/check/checkjob/modules/CheckJobTable.vue

@@ -160,21 +160,21 @@ export default {
           },
           checked: true
         },
-        {
+/*        {
           title: '计划单号',
           dataIndex: 'planNo',
           checked: true
-        },
+        },*/
         {
           title: '任务名称',
           dataIndex: 'name',
           checked: true
         },
-        {
+/*        {
           title: '计划名称',
           dataIndex: 'planName',
           checked: true
-        },
+        },*/
         {
           title: '负责人',
           dataIndex: 'checkUserName',
@@ -191,12 +191,12 @@ export default {
         // checked: true
         // },
         {
-          title: '任务开始时间',
+          title: '执行日期',
           dataIndex: 'startTime',
           checked: true
         },
         {
-          title: '任务结束时间',
+          title: '截至日期',
           dataIndex: 'endTime',
           checked: true
         },

+ 6 - 6
src/views/check/checkjob/modules/CheckJobTableWaitDo.vue

@@ -172,21 +172,21 @@ export default {
           },
           checked: true
         },
-        {
+ /*       {
           title: '计划单号',
           dataIndex: 'planNo',
           checked: true
-        },
+        },*/
         {
           title: '任务名称',
           dataIndex: 'name',
           checked: true
         },
-        {
+    /*    {
           title: '计划名称',
           dataIndex: 'planName',
           checked: true
-        },
+        },*/
         {
           title: '负责人',
           dataIndex: 'checkUserName',
@@ -203,12 +203,12 @@ export default {
         // checked: true
         // },
         {
-          title: '任务开始时间',
+          title: '执行日期',
           dataIndex: 'startTime',
           checked: true
         },
         {
-          title: '任务结束时间',
+          title: '截止日期',
           dataIndex: 'endTime',
           checked: true
         },

+ 4 - 2
src/views/check/checkjob/modules/Detail.vue

@@ -13,8 +13,10 @@
       <detail-list-item :term="names[checkType-1]+'设备'">{{ model.sbName }}</detail-list-item>
       <!--<detail-list-item :term="names[checkType-1]+'部件'">{{ model.partName }}</detail-list-item>
       <detail-list-item term="部件编号">{{ model.partNo}}</detail-list-item>-->
-      <detail-list-item term="任务开始时间">{{ model.startTime }}</detail-list-item>
-      <detail-list-item term="任务结束时间">{{ model.endTime }}</detail-list-item>
+      <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
+      <detail-list-item term="实际工时">{{ model.realHours }}</detail-list-item>
+      <detail-list-item term="执行日期">{{ model.startTime }}</detail-list-item>
+      <detail-list-item term="截至日期">{{ model.endTime }}</detail-list-item>
       <detail-list-item term="实际开始时间">{{ model.actualStartTime }}</detail-list-item>
       <detail-list-item term="实际结束时间">{{ model.actualEndTime }}</detail-list-item>
       <!--<detail-list-item term="是否停机"><badge :status="DictCache.COLOR.YES_NO[model.sbStatus]" :text="sbStatusMap[model.sbStatus]" /></detail-list-item>-->

+ 2 - 2
src/views/check/checkproject/modules/AddForm.vue

@@ -223,13 +223,13 @@
 
 <script>
 import pick from 'lodash.pick'
-import { addCheckProject, updateCheckProject } from '@/api/check/checkproject'
+import { addCheckProject } from '@/api/check/checkproject'
 import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
 import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
 import CheckStandardSelectModal from '@/views/check/checkstandard/modules/CheckStandardSelectModal'
 import Detail from '../../checkstandard/modules/Detail'
-import { getCheckStandardPage, fetchCheckStandard } from '@/api/check/checkstandard'
+import { fetchCheckStandard } from '@/api/check/checkstandard'
 
 export default {
   name: 'BaseCheckProject',

+ 10 - 0
src/views/check/checkstandard/modules/BaseForm.vue

@@ -94,6 +94,16 @@
             </a-form-item>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="标准工时"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['standardHours']" suffix="小时"/>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="动作类型"

+ 336 - 0
src/views/check/checkstandard/modules/BaseFormInsert.vue

@@ -0,0 +1,336 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="600"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false">
+        <a-input v-decorator="['standardId']" type="hidden"/>
+      </a-form-item>
+
+      <row-list :col="2">
+        <row-item>
+          <a-form-item
+            label="任务时间"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-date-picker
+              style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+              v-decorator="['startTime']" />
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+    <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { STable, Ellipsis } from '@/components'
+import BaseTool from '../../../../utils/tool'
+import { uploadUrl } from '@/api/upms/file'
+import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { generateJobByCheckStandard } from '@/api/check/checkstandard'
+
+export default {
+  name: 'BaseCheckStandard',
+  components: {
+    STable,
+    Ellipsis,
+    PartInfoSelectModal
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      typeMap: {},
+      actionTypeMap: {},
+      paramTypeMap: {},
+      enableMap: {},
+      periodTypeMap: {},
+      checkImgList: [], // 图片
+      checkFileList: [], // 文档
+      defaultCheckImgList: [],
+      defaultCheckFileList: [],
+      uploadUrl: uploadUrl,
+      userList: {},
+      editingKey: '',
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      },
+      rowSelection: {
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys
+          this.selectedRows = selectedRows
+        }
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name',
+          scopedSlots: { customRender: 'name' }
+        },
+        {
+          title: '类型',
+          dataIndex: 'type',
+          scopedSlots: { customRender: 'type' }
+        },
+        {
+          title: '上限',
+          dataIndex: 'upperLimit',
+          scopedSlots: { customRender: 'upperLimit' }
+        },
+        {
+          title: '下限',
+          dataIndex: 'lowerrLimit',
+          scopedSlots: { customRender: 'lowerrLimit' }
+        },
+        {
+          title: '参考值',
+          dataIndex: 'referenceValue',
+          scopedSlots: { customRender: 'referenceValue' }
+        },
+        {
+          title: '正常选型',
+          dataIndex: 'normalSelection',
+          scopedSlots: { customRender: 'normalSelection' }
+        },
+        {
+          title: '说明',
+          dataIndex: 'instruction',
+          scopedSlots: { customRender: 'instruction' }
+        },
+        {
+          title: '操作',
+          dataIndex: 'operation',
+          width: 150,
+          scopedSlots: { customRender: 'operation' }
+        }
+      ],
+      data: [],
+      cacheData: [],
+      selectedRowKeys: [],
+      selectedRows: [],
+      options: {
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys
+        }
+      }
+    }
+  },
+  props: {
+    /**
+     * 检查类型: 1-点检 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 1
+    }
+  },
+  created () {
+    // 下拉框map
+    this.paramTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_PARAM_TYPE)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
+    this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+  },
+  methods: {
+    base (record, standardId) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.data = []
+        this.cacheData = []
+        if (standardId != null) {
+          const { form: { setFieldsValue } } = this
+          // 日期处理
+          this.$nextTick(() => {
+            setFieldsValue({ standardId: standardId })
+          })
+        }
+        return
+      }
+      this.modalTitle = '编辑'
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        this.modalTitle = '复制'
+      }
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id'
+        ])))
+      })
+      this.data = BaseTool.Object.copy(record.paramList)
+      this.cacheData = BaseTool.Object.copy(record.paramList)
+      this.editingKey = ''
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values.startTime = BaseTool.Date.formatter(values.startTime, BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+        if (this.BaseTool.String.isBlank(values.id)) {
+          generateJobByCheckStandard(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          generateJobByCheckStandard(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)
+      }
+    },
+    handleChange (value, key, column) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      if (target) {
+        target[column] = value
+        this.data = newData
+      }
+    },
+    edit (key) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      this.editingKey = key
+      if (target) {
+        target.editable = true
+        this.data = newData
+      }
+    },
+    cancel (key) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      this.editingKey = ''
+      if (!this.checkParams(target)) {
+        const data = [...this.data]
+        const cacheData = [...this.cacheData]
+        this.data = data.filter(item => item.id !== key)
+        this.cacheData = cacheData.filter(item => item.id !== key)
+        return
+      }
+      if (target) {
+        Object.assign(target, this.cacheData.filter(item => key === item.id)[0])
+        console.log(target, 'target')
+        delete target.editable
+        this.data = newData
+      }
+    },
+    handleAdd () {
+      if (this.editingKey !== '') {
+        this.$message.error('请保存后再添加')
+        return false
+      }
+      const { data, cacheData } = this
+      console.log(this.data, this.cacheData)
+      const newParam = this.getNewParam()
+      const newCache = { ...newParam }
+      data.push(newParam)
+      cacheData.push(newCache)
+    },
+    handleDel () {
+      const data = [...this.data]
+      const cacheData = [...this.cacheData]
+      this.data = data.filter(item => !this.selectedRowKeys.includes(item.id))
+      this.cacheData = cacheData.filter(item => !this.selectedRowKeys.includes(item.id))
+      if (this.selectedRowKeys.includes(this.editingKey)) {
+        this.editingKey = ''
+      }
+    },
+    getNewParam () {
+      const newParam = {
+        name: '',
+        type: '1',
+        upperLimit: '',
+        lowerrLimit: '',
+        referenceValue: '',
+        normalSelection: '',
+        instruction: ''
+      }
+      newParam.id = new Date().getTime()
+      newParam.editable = true
+      this.editingKey = newParam.id
+      console.log(newParam, 'newparam')
+      return newParam
+    },
+    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({
+          'part': key,
+          'partName': row.name
+        }))
+      })
+    },
+    handleCheckImgChange (info) {
+      this.defaultCheckImgList = info.fileList
+      this.checkImgList = this.setFileList(info, 1)
+    },
+    handleCheckFileChange (info) {
+      this.defaultCheckFileList = info.fileList
+      this.checkFileList = this.setFileList(info, 2)
+    },
+    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 null
+      }
+    }
+  }
+}
+</script>

+ 2 - 0
src/views/check/checkstandard/modules/Detail.vue

@@ -11,6 +11,7 @@
       <detail-list-item term="编码">{{ model.no }}</detail-list-item>
       <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
       <detail-list-item term="计划周期">{{ model.period }}{{ BaseTool.Object.getField(periodTypeMap,model.periodType) }}</detail-list-item>
+      <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
       <detail-list-item term="动作类型">{{ BaseTool.Object.getField(actionTypeMap,model.actionType) }}</detail-list-item>
       <detail-list-item term="部位">{{ model.partName }}</detail-list-item>
       <detail-list-item term="是否启用"><badge :status="DictCache.COLOR.YES_NO[model.enable]" :text="enableMap[model.enable]"></badge></detail-list-item>
@@ -84,6 +85,7 @@ export default {
         'part': null,
         'enable': null,
         'requirement': null,
+        'standardHours': null,
         'remark': null,
         'createdUserId': null,
         'updateUserId': null,

+ 36 - 8
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -20,7 +20,11 @@
         <a-icon type="plus"/>
         添加
       </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="handleSbSelect">
+        <a-icon type="plus"/>
+        复制
+      </a-button>
+      <!--      <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>-->
     </div>
     <a-table
       :data-source="data"
@@ -39,14 +43,15 @@
           <a-divider type="vertical" />
           <a @click="handleCopy(record)">复制</a>
           <a-divider type="vertical" />
-          <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要插入任务?" @confirm="handleGenerate(record)">
-            <a>插入任务</a>
-          </a-popconfirm>
+          <a @click="handleGenerate(record)">插入任务</a>
         </template>
       </span>
     </a-table>
     <base-form ref="baseModal" :check-type="checkType" @ok="handleOk"/>
+    <base-form-insert ref="baseModalInsert" @ok="handleOk"/>
     <detail ref="detailModal"/>
+    <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+
   </div>
 </template>
 
@@ -57,10 +62,13 @@ import {
   deleteCheckStandards,
   exportCheckStandard,
   fetchCheckStandard,
+  copy,
   generateJobByCheckStandard
 } from '@/api/check/checkstandard'
 import BaseForm from './BaseForm'
+import BaseFormInsert from './BaseFormInsert'
 import Detail from './Detail'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -69,7 +77,9 @@ export default {
     DetailList,
     DetailListItem,
     BaseForm,
-    Detail
+    Detail,
+    SbInfoSelectModal,
+    BaseFormInsert
   },
   props: {
     /**
@@ -130,6 +140,10 @@ export default {
             return this.BaseTool.Table.getMapText(this.actionTypeMap, text)
           }
         },
+        {
+          title: '标准工时',
+          dataIndex: 'standardHours'
+        },
         {
           title: '操作',
           key: 'action',
@@ -186,9 +200,8 @@ export default {
       modal.base(data)
     },
     handleGenerate (record) {
-      generateJobByCheckStandard({ id: record.id }).then(res => {
-        this.$message.info('任务已经创建,请及时处理')
-      })
+      const modal = this.$refs.baseModalInsert
+      modal.base(null, record.id)
     },
     handleCancel () {
       this.visible = false
@@ -219,6 +232,21 @@ export default {
       exportCheckStandard(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      // 日期处理
+      copy({ sbId: this.model.id, copySbId: row.id })
+        .then((response) => {
+          this.$message.info(response.data)
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
     }
   }
 }

+ 24 - 3
src/views/part/info/modules/PartInfoList.vue

@@ -29,7 +29,11 @@
 
       <div class="table-operator">
         <a-button v-if="$auth('sb-part-infos-add')" type="primary" icon="plus" @click="$refs.baseModal.base(dataParam,1)">新增</a-button>
-        <a-button style="margin-left: 8px" v-if="$auth('sb-part-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+        <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
+          <a-icon type="plus"/>
+          复制
+        </a-button>
+        <!--        <a-button style="margin-left: 8px" v-if="$auth('sb-part-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>-->
         <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-part-infos-del')">
           <a-menu slot="overlay">
             <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
@@ -77,6 +81,7 @@
       </s-table>
       <base-form ref="baseModal" @ok="handleOk"/>
       <detail ref="detailModal"/>
+      <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
     </a-card>
   </a-modal>
 </template>
@@ -85,7 +90,8 @@
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './BaseForm'
 import Detail from './Detail'
-import { getPartInfoPage, deletePartInfos, fetchPartInfo, exportPartInfo } from '@/api/part/info'
+import { getPartInfoPage, copy, deletePartInfos, fetchPartInfo, exportPartInfo } from '@/api/part/info'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 
 export default {
   name: 'PartInfoList',
@@ -93,7 +99,8 @@ export default {
     STable,
     Ellipsis,
     BaseForm,
-    Detail
+    Detail,
+    SbInfoSelectModal
   },
   data () {
     return {
@@ -293,6 +300,20 @@ export default {
       exportPartInfo(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    handleSbSelectd (keys, rows) {
+      const [ row ] = rows
+      // 日期处理
+      copy({ sbId: this.sbId, copySbId: row.id })
+        .then((response) => {
+          this.$message.info(response.data)
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
     }
   }
 }

+ 37 - 4
src/views/sb/modelbom/modules/BaseFormSb.vue

@@ -14,6 +14,9 @@
       <a-form-item v-show="false" >
         <a-input v-decorator="['sbId']" type="hidden"/>
       </a-form-item>
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['sbPartId']" type="hidden"/>
+      </a-form-item>
 
       <a-form-item v-show="false" >
         <a-input v-decorator="['spareId']" type="hidden"/>
@@ -33,6 +36,19 @@
             <a-button style="width: 30%" type="primary" @click="handleSpareSelect">选择</a-button>
           </a-form-item>
         </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="检查部位"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              style="width: 80%"
+              v-decorator="['sbPartName', {rules: [{required: false, message: '检查部位不能为空'}]}]"/>
+            <a-button type="primary" style="width: 20%" @click="handlePartSelect">选择</a-button>
+          </a-form-item>
+        </a-col>
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
             label="更换周期"
@@ -82,6 +98,7 @@
     </a-form>
 
     <spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
+    <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
     </template>
@@ -92,8 +109,7 @@
 import pick from 'lodash.pick'
 import { addSbModelBom, updateSbModelBom, deleteSbModelBoms } from '@/api/sb/modelbom'
 import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
-import Vue from 'vue'
-
+import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
 export default {
   name: 'BaseSbModel',
   data () {
@@ -114,7 +130,8 @@ export default {
     }
   },
   components: {
-    SparePartInfoSelectModal
+    SparePartInfoSelectModal,
+    PartInfoSelectModal
   },
   created () {
     // 下拉框map
@@ -150,7 +167,9 @@ export default {
         setFieldsValue(Object.assign(pick(record, [
           'id',
           'sbId',
+          'sbPartId',
           'spareId',
+          'sbPartName',
           'spareName',
           'period',
           'periodType',
@@ -225,8 +244,22 @@ export default {
         }).catch(() => {
           this.confirmLoading = false
         })
+    },
+    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({
+          'sbPartId': key,
+          'sbPartName': row.name
+        }))
+      })
     }
-
   }
 }
 </script>

+ 34 - 7
src/views/sb/modelbom/modules/DetailSbBom.vue

@@ -17,22 +17,27 @@
     <div class="table-operator">
       <a-button type="primary" @click="handleAdd">
         <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>-->
+      <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
+        <a-icon type="plus"/>
+        复制BOM
       </a-button>
       <a-button style="margin-left:8px;" type="primary" @click="handleSpareAdd">
         <a-icon type="plus"/>
         添加备件
       </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="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">
         <a-icon type="upload"/>
         导入
-      </a-button>
+      </a-button>-->
     </div>
     <a-table
       :data-source="data"
@@ -55,17 +60,19 @@
     <base-form ref="baseModal" @ok="handleOk"/>
     <import-form-add ref="importModal" @ok="handleOk"></import-form-add>
     <spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
+    <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
   </div>
 </template>
 
 <script>
 import DetailList from '@/components/tools/DetailList'
-import { addSbModelBomBatch, selectSpareInfoListBySbId, deleteSbModelBoms, exportSbModelBom } from '@/api/sb/modelbom'
+import { addSbModelBomBatch, copy, selectSpareInfoListBySbId, deleteSbModelBoms, exportSbModelBom } from '@/api/sb/modelbom'
 import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
 import BaseFormSb from './BaseFormSb'
 import ImportFormAdd from './ImportFormAdd'
 import BaseForm from '@/views/sqarepartmanage/sparepartinfo/modules/BaseForm'
 import { fetchSparePartInfo } from '@/api/sqarepartmanage/sparepartinfo'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -76,7 +83,8 @@ export default {
     BaseFormSb,
     SparePartInfoSelectModal,
     ImportFormAdd,
-    BaseForm
+    BaseForm,
+    SbInfoSelectModal
   },
   data () {
     return {
@@ -107,6 +115,10 @@ export default {
             return `${index + 1}`
           }
         },
+        {
+          title: '部位',
+          dataIndex: 'sbPartName'
+        },
         {
           title: '名称',
           dataIndex: 'name'
@@ -247,6 +259,21 @@ export default {
       exportSbModelBom(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      // 日期处理
+      copy({ sbId: this.model.id, copySbId: row.id })
+        .then((response) => {
+          this.$message.info(response.data)
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
     }
   }
 }

+ 2 - 2
src/views/sb/storecheckjob/modules/Detail.vue

@@ -16,8 +16,8 @@
       <detail-list-item term="差异数量">{{ model.profitNum}}</detail-list-item>
       <detail-list-item term="备件金额">{{ model.price}}</detail-list-item>
       <detail-list-item term="差异金额">{{ model.profitPrice}}</detail-list-item>
-      <detail-list-item term="任务开始时间">{{ model.startTime }}</detail-list-item>
-      <detail-list-item term="任务结束时间">{{ model.endTime }}</detail-list-item>
+      <detail-list-item term="执行日期">{{ model.startTime }}</detail-list-item>
+      <detail-list-item term="截至日期">{{ model.endTime }}</detail-list-item>
       <detail-list-item term="任务状态"><badge :status="DictCache.COLOR.STORE_CHECK_JOB_STATUS[model.status]" :text="statusMap[model.status]" /></detail-list-item>
     </detail-list>
     <detail-list title="" :col="1">

+ 2 - 2
src/views/store/storecheckjob/modules/Detail.vue

@@ -16,8 +16,8 @@
       <detail-list-item term="差异数量">{{ model.profitNum}}</detail-list-item>
       <detail-list-item term="备件金额">{{ model.price}}</detail-list-item>
       <detail-list-item term="差异金额">{{ model.profitPrice}}</detail-list-item>
-      <detail-list-item term="任务开始时间">{{ model.startTime }}</detail-list-item>
-      <detail-list-item term="任务结束时间">{{ model.endTime }}</detail-list-item>
+      <detail-list-item term="执行日期">{{ model.startTime }}</detail-list-item>
+      <detail-list-item term="截至日期">{{ model.endTime }}</detail-list-item>
       <detail-list-item term="任务状态"><badge :status="DictCache.COLOR.STORE_CHECK_JOB_STATUS[model.status]" :text="statusMap[model.status]" /></detail-list-item>
     </detail-list>
     <detail-list title="" :col="1">