1 год назад
Родитель
Сommit
0c4e444942

+ 169 - 0
src/api/project/project.js

@@ -0,0 +1,169 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getSbTypePage (parameter) {
+  return axios({
+    url: '/project/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addSbType (parameter) {
+  return axios({
+    url: '/project',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSbType (parameter) {
+  return axios({
+    url: '/project/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchSbType (parameter) {
+  return axios({
+    url: '/project/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function querySbType (parameter) {
+  return axios({
+    url: '/project?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * delete batch func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteSbTypes (parameter) {
+  return axios({
+    url: '/project',
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * delete single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteSbType (parameter) {
+  return axios({
+    url: '/project/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function exportSbType (parameter) {
+  return axios({
+    url: '/project/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchSbTypeTree (parameter) {
+  return axios({
+    url: '/project/tree?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+export function fetchStoreTypeTree (parameter) {
+  return axios({
+    url: '/report/stores/tree?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchSbTypeTableTree (parameter) {
+  return axios({
+    url: '/project/tableTree?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

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

@@ -45,6 +45,8 @@ const constantRouterComponents = {
   'SystemRoleList': () => import('@/views/role/RoleList'),
   // 设备类型
   'SbType': () => import('@/views/sb/type/SbType'),
+  // 项目类型
+  'Project': () => import('@/views/project/Project'),
   // 设备位置
   'SbPosition': () => import('@/views/sb/position/SbPosition'),
   // 设备位置台账

+ 673 - 0
src/views/project/BaseForm.vue

@@ -0,0 +1,673 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button type="primary" @click="save()">提交</a-button>
+          <a-button style="margin-left: 8px" @click="handleFresh()">刷新位置</a-button>
+          <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+
+    <title-divider title="基本信息" width="90px"></title-divider>
+    <a-form :form="form">
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['parentId']" type="hidden"/>
+      </a-form-item>
+
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备编号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['no', {rules: [{required: true, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备(旧号)"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['zbh', {rules: [{required: false, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备名称"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['name', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="型号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="是否固定资产"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['isFinancing', { rules: [{required: true, message: '是否显示不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in isFinancingMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-card>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addSbInfo, updateSbInfo, fetchSbInfo, copySbInfo } from '@/api/sb/info'
+import { fetchSbTypeTree } from '@/api/project/project'
+import FirmProducerSelectModal from '@/views/firm/producer/modules/FirmProducerSelectModal'
+import SbGuigeSelectModal from '@/views/sb/guige/modules/SbGuigeSelectModal'
+import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
+import BaseTool from '../../../../utils/tool'
+import { queryUserDeptByUserDeptId } from '@/api/upms/user-dept'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import Vue from 'vue'
+import { uploadUrl } from '@/api/upms/file'
+import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
+import { queryUser } from '@/api/upms/user'
+import DetailList from '@/components/tools/DetailList'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+import ParamForm from './ParamForm'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'BaseSbInfo',
+  components: {
+    FirmProducerSelectModal,
+    SbGuigeSelectModal,
+    SbModelSelectModal,
+    SbInfoSelectModal,
+    ParamForm,
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      areaList: {},
+      companyList: {},
+      paramList: [],
+      projectList: {},
+      deptList: {},
+      groupList: {},
+      visible: false,
+      sbTypeTreeData: [],
+      // sbInfoTreeData: [],
+      // sourceSbInfoTreeData: [],
+      // sbPositionTreeData: [],
+      depreciationTypeMap: {},
+      sourceTypeMap: {},
+      levelMap: {},
+      rlTypeMap: {},
+      colorMap: {},
+      useTypeMap: {},
+      statusMap: {},
+      isChildMap: {},
+      isShowMap: {},
+      isFinancingMap: {},
+      userList: {},
+      unitMap: {},
+      sbInfoSelectType: null,
+      repairFileList: [], // 维修手册
+      defaultRepairFileList: [],
+      defaultUseFileList: [],
+      defaultRecheckFileList: [],
+      defaultSbFileList: [],
+      useFileList: [], // 使用手册
+      recheckFileList: [], // 验收手册
+      sbFileList: [], // 设备图片,
+      uploadUrl: uploadUrl,
+      qrcodesrc: null,
+      id: null,
+      fileList: [],
+      type: null,
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      }
+    }
+  },
+  props: {
+    useType: {
+      type: Number,
+      default: 3
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+    this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
+    this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
+    this.isFinancingMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_FINANCING)
+  },
+  methods: {
+    base (record, type) {
+      this.setTree(record)
+      // 清除文件列表
+      this.visible = true
+      // 选择框查询条件
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.qrcodesrc = null
+        this.modalTitle = '添加'
+        this.clearFileList()
+        return
+      }
+      this.useType = record.useType
+      this.modalTitle = '编辑'
+      this.id = record.id
+      this.qrcodesrc = record.qrCode
+      this.repairFileList = record.repairFileList
+      this.useFileList = record.useFileList
+      this.recheckFileList = record.recheckFileList
+      this.sbFileList = record.sbFileList
+      this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
+      this.defaultUseFileList = this.BaseTool.UPLOAD.transImg(this.useFileList)
+      this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
+      this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
+      this.paramList = JSON.parse(record.paramList)
+      if (type === 1) {
+        this.type = type
+        this.modalTitle = '复制'
+        this.qrcodesrc = null
+        record.no = null
+        this.clearFileList()
+      }
+
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      // record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+      // record.lastRepaireTime = this.BaseTool.Moment(record.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.lastBaoyangTime = this.BaseTool.Moment(record.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.buyDate != null) {
+        record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'buyDate'
+          ])))
+        })
+      }
+      if (record.startDate != null) {
+        record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'startDate'
+          ])))
+        })
+      }
+      if (record.checkDate != null) {
+        record.checkDate = this.BaseTool.Moment(record.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'checkDate'
+          ])))
+        })
+      }
+      if (record.nextCheckDate != null) {
+        record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'nextCheckDate'
+          ])))
+        })
+      }
+      if (record.retirementDate != null) {
+        record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'retirementDate'
+          ])))
+        })
+      }
+      if (record.registerDate != null) {
+        record.registerDate = this.BaseTool.Moment(record.registerDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'registerDate'
+          ])))
+        })
+      }
+      record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
+      record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
+
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'no',
+          'parentId',
+          'parentSbName',
+          'isChild',
+          'isShow',
+          'isFinancing',
+          'financingNo',
+          'financingNoTwo',
+          'financingNoThird',
+          'financingNoFour',
+          'financingNoFive',
+          'name',
+          'model',
+          'cph',
+          'positionId',
+          'producerName',
+          'useArea',
+          'useCompany',
+          'useProject',
+          'useDept',
+          'saveUser',
+          'repairUser',
+          'useGroup',
+          'typeId',
+          'level',
+          'initialValue',
+          // 'cutValue',
+          'producerId',
+          // 'sourceType',
+          'unit',
+          'buyDate',
+          'startDate',
+          'zbh',
+          // 'wbFile',
+          // 'useFile',
+          // 'checkFile',
+          // 'sbImage',
+          'status',
+          'remark',
+          'zzh',
+          'zz',
+          'zjm',
+          'jbdh',
+          'useType',
+          'cardNo',
+          'fdjxh',
+          'checkDate',
+          'checkPeriod',
+          'nextCheckDate',
+          'dph',
+          'zaiz',
+          'rlType',
+          'color',
+          'sbdh',
+          'seatNumber',
+          'registerNo',
+          'characterType',
+          'usedNo',
+          'supplier',
+          'repairUserSecond',
+          'batchNo',
+          'workYear',
+          'retirementDate',
+          'registerDate'
+
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期数据的处理
+        values.buyDate = BaseTool.Date.formatter(values.buyDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.startDate = BaseTool.Date.formatter(values.startDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.checkDate = BaseTool.Date.formatter(values.checkDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+        values.lastRepaireTime = this.BaseTool.Date.formatter(values.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.lastBaoyangTime = this.BaseTool.Date.formatter(values.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.spDate = this.BaseTool.Date.formatter(values.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.jbdDate = this.BaseTool.Date.formatter(values.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.sbdDate = this.BaseTool.Date.formatter(values.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.sbDate = this.BaseTool.Date.formatter(values.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+        // 上传文件
+        values.repairFileList = this.repairFileList
+        values.useFileList = this.useFileList
+        values.recheckFileList = this.recheckFileList
+        values.sbFileList = this.sbFileList
+        values.paramList = JSON.stringify(this.paramList)
+        values.useType = this.useType
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addSbInfo(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          if (this.type == null) {
+            updateSbInfo(values)
+              .then(() => {
+                this.handleCancel(values)
+              }).catch(() => {
+                this.confirmLoading = false
+              })
+          } else {
+            copySbInfo(values)
+              .then(() => {
+                this.handleCancel(values)
+              }).catch(() => {
+                this.confirmLoading = false
+              })
+          }
+        }
+      })
+    },
+    getQrcodeSrc () {
+      console.log(111, 22)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    },
+    handleFresh () {
+      fetchSbInfo({ id: this.id }).then(res => {
+        const { form: { setFieldsValue } } = this
+        const record = res.data
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'zjm',
+            'jbdh'
+          ])))
+        })
+      })
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree().then(res => {
+        this.sbTypeTreeData = res.data
+      })
+      // getSbInfoTree({ id: record.id }).then(res => {
+      //  this.sbInfoTreeData = res.data
+      //  this.sourceSbInfoTreeData = res.data
+      // })
+      // getSbPositionTree().then(res => {
+      //  this.sbPositionTreeData = res.data
+      // })
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+
+      if (record.useArea != null) {
+        getDeptsAllByParentId({ deptId: record.useArea, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+          this.companyList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+          this.projectList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useProject, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+          this.deptList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useDept, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+          this.groupList = res.data
+        })
+        queryUser({ }).then(res => {
+          this.userList = res.data
+        })
+      }
+      queryUser({ }).then(res => {
+        this.userList = res.data
+      })
+    },
+    handleSbModelSelect () {
+      const modal = this.$refs.sbModelSelectModal
+      modal.base()
+    },
+    handleSbModelSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+
+      this.$nextTick(() => {
+        setFieldsValue({
+          'modelId': key,
+          'name': row.name,
+          'model': row.model,
+          'nameModel': row.nameModel,
+          'typeId': row.typeId,
+          'typeName': row.typeName,
+          'level': row.level,
+          'initialValue': row.value,
+          'useType': row.useType,
+          'useTypeName': this.BaseTool.Object.getField(this.useTypeMap, row.useType),
+          'producerId': row.producerId,
+          'producerName': row.producerName,
+          'unit': row.unit,
+          'unitName': this.BaseTool.Object.getField(this.unitMap, row.unit)
+        })
+      })
+    },
+
+    beforeRecheckFileListUpload (file) {
+      const reg = /\.(xls|xlsx)(\?.*)?$/
+      return new Promise((resolve, reject) => {
+        if (reg.test(file.name)) {
+          this.recheckFileList = [file]
+          return true
+        } else {
+          this.$message.error(`请上传正确的xls|xlsx文件`)
+          reject(new Error('请上传正确的xls|xlsx文件'))
+          return false
+        }
+      })
+    },
+    beforeUploadPic (file) {
+      const reg = /\.(jpg|jpeg|png)(\?.*)?$/
+      return new Promise((resolve, reject) => {
+        if (reg.test(file.name)) {
+          this.sbFileList = [file]
+          return true
+        } else {
+          this.$message.error(`请上传正确的jpg|jpeg|png文件`)
+          reject(new Error('请上传正确的jpg|jpeg|png文件'))
+          return false
+        }
+      })
+    },
+    clearFileList () {
+      this.repairFileList = []
+      this.useFileList = []
+      this.recheckFileList = []
+      this.sbFileList = []
+    },
+    handleRepairFileChange (info) {
+      this.defaultRepairFileList = info.fileList
+      this.repairFileList = this.setFileList(info, 1)
+    },
+    handleUseFileChange (info) {
+      this.defaultUseFileList = info.fileList
+      this.useFileList = this.setFileList(info, 2)
+    },
+    handleAreaChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+        this.companyList = res.data
+      })
+    },
+    handleCompanyChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+        this.projectList = res.data
+      })
+    },
+    handleProjectChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+        this.deptList = res.data
+      })
+    },
+    handleDeptChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+        this.groupList = res.data
+      })
+    },
+    handleGroupChange (value) {
+      queryUserDeptByUserDeptId({ deptId: value }).then(res => {
+        this.userList = res.data
+      })
+    },
+    handleRecheckFileChange (info) {
+      this.defaultRecheckFileList = info.fileList
+      this.recheckFileList = this.setFileList(info, 3)
+    },
+    handleSbFileChange (info) {
+      this.defaultSbFileList = info.fileList
+      this.sbFileList = this.setFileList(info, 4)
+    },
+    setFileList1 (info, type) {
+      const fileList = [...info.fileList]
+      const file = [...info.file]
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return []
+      }
+    },
+    clearParent () {
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'parentId': null,
+          'parentSbName': null
+        }))
+      })
+    },
+    // 主子设备切换
+    childChange (value) {
+      if (value === this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT || value === this.DictCache.VALUE.SB_IS_CHILD.IS_NORMAL) {
+        const { form: { setFieldsValue } } = this
+        // 日期处理
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign({
+            'parentId': null,
+            'parentSbName': null
+          }))
+        })
+      }
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT })
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'parentId': key,
+          'parentSbName': row.name,
+          'isChild': this.DictCache.VALUE.SB_IS_CHILD.IS_CHILD
+        }))
+      })
+    },
+    handleChange (value) {
+      this.useType = value
+    },
+    handleProducerSelect () {
+      const modal = this.$refs.producerSelectModal
+      modal.base({}, { type: 1 })
+    },
+    handleProducerSelected (record, selectedRowKeys, selectedRow) {
+      const { form: { setFieldsValue } } = this
+      const [ key ] = selectedRowKeys
+      const [ row ] = selectedRow
+      setFieldsValue({
+        'producerId': key,
+        'producerName': row.name
+      })
+    },
+    setFileList (info, type) {
+      // { file, fileList }
+
+      const file = info.file
+      const fileList = info.fileList
+      // fileList = fileList.slice(-2)
+      // console.log(111, this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type))
+
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return null
+      }
+    },
+    handlePoint () {
+      const { form: { getFieldValue } } = this
+      const zjm = getFieldValue('zjm')
+      const jbdh = getFieldValue('jbdh')
+      const a = document.createElement('a')
+      a.href = '/hitch-screen/point.html?id=' + this.id + '&zjm=' + zjm + '&jbdh=' + jbdh
+      a.target = '_blank'
+      a.click()
+    },
+    handleParam () {
+      const modal = this.$refs.paramForm
+      modal.base(this.model)
+    },
+    handleParamList (values) {
+      console.log(values)
+      if (this.paramList == null) {
+        this.paramList = []
+      }
+      this.paramList.push(values)
+    },
+    handleDelParam (index) {
+      console.log(index)
+      this.paramList.splice(index, 1)
+    }
+  }
+}
+</script>

+ 273 - 0
src/views/project/Project.vue

@@ -0,0 +1,273 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="关键字">
+              <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/编码"/>
+            </a-form-item>
+          </a-col>
+          <!--<a-col :md="8" :sm="24">
+            <a-form-item label="上层类型">
+              <a-tree-select
+                style="width: 100%"
+                :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                :treeData="treeData"
+                :treeNodeFilterProp="'title'"
+                :showSearch="true"
+                v-model="queryParam.parentId"
+                placeholder="请选择"
+              >
+              </a-tree-select>
+            </a-form-item>
+          </a-col>-->
+          <a-col :md="8 || 24" :sm="24">
+            <span class="table-page-search-submitButtons">
+              <a-button type="primary" @click="handleOk">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-operator" style="margin-bottom: 8px;">
+      <a-button v-if="$auth('sb-types-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+      <a-button style="margin-left: 8px" v-if="$auth('sb-types-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-types-del')">
+        <a-menu slot="overlay">
+          <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
+            <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
+          </a-popconfirm>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
+    <a-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data-source="dataSource"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">查看</a>
+          <a-divider type="vertical" />
+          <a v-if="$auth('sb-types-edit')" @click="handleEdit(record)">修改</a>
+          <a-divider type="vertical" />
+          <a-popconfirm v-if="$auth('sb-types-del')" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+          <a-divider type="vertical" />
+          <a @click="handleCopy(record)">复制</a>
+        </template>
+      </span>
+      <span slot="delFlag" slot-scope="text">
+        <badge
+          :status="DictCache.COLOR.DELFLAG[text]"
+          :text="delFlagMap[text]" />
+      </span>
+    </a-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import { deleteSbTypes, fetchSbType, exportSbType, fetchSbTypeTableTree, fetchSbTypeTree } from '@/api/project/project'
+
+export default {
+  name: 'SbTypeList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      dataSource: [],
+      treeData: [],
+      typeMap: {},
+      delFlagMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '编码',
+          dataIndex: 'no'
+        },
+        {
+          title: '首字母',
+          dataIndex: 'szm'
+        },
+        {
+          title: '类型',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.typeMap, text)
+          }
+        },
+        {
+          title: '排序',
+          dataIndex: 'sort'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return fetchSbTypeTableTree(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    this.tableOption()
+    this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_TYPE)
+  },
+  methods: {
+    tableOption () {
+      this.setTree()
+      fetchSbTypeTableTree().then(res => {
+        this.dataSource = res.data
+      })
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteSbTypes(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbType({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchSbType({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      fetchSbType({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        res.data.id = null
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.setTree()
+      fetchSbTypeTableTree(this.queryParam).then(res => {
+        this.dataSource = res.data
+      })
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.handleOk()
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbType(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree({ id: record.id }).then((res) => {
+        this.treeData = res.data
+      })
+    }
+  }
+}
+</script>

+ 211 - 0
src/views/project/modules/BaseForm.vue

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

+ 78 - 0
src/views/project/modules/Detail.vue

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

+ 8 - 8
src/views/sb/info/SbInfoC.vue

@@ -592,14 +592,14 @@ export default {
           width: 100,
           scopedSlots: { customRender: 'status' }
         },
-        {
-          title: '检定状态',
-          checked: true,
-          dataIndex: 'measureStatus',
-          fixed: 'right',
-          width: 100,
-          scopedSlots: { customRender: 'measureStatus' }
-        },
+        // {
+        //   title: '检定状态',
+        //   checked: true,
+        //   dataIndex: 'measureStatus',
+        //   fixed: 'right',
+        //   width: 100,
+        //   scopedSlots: { customRender: 'measureStatus' }
+        // },
         {
           title: '操作',
           key: 'action',

+ 59 - 1
src/views/store/outstoreform/modules/BaseFormYY.vue

@@ -127,6 +127,31 @@
             </a-select>
           </a-form-item>
         </a-col>
+<!--        <a-tree-select-->
+<!--          style="width: 100%"-->
+<!--          :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"-->
+<!--          :treeData="treeData"-->
+<!--          :treeNodeFilterProp="'title'"-->
+<!--          :showSearch="true"-->
+<!--          v-decorator="['parentId', {rules: [{required: isShowParent, message: '上层设备类型不能为空'}]}]"-->
+<!--          placeholder="请选择"-->
+<!--        >-->
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="项目:"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+          <a-tree-select
+            style="width: 100%"
+            :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+            :treeData="treeData"
+            v-decorator="['projectId', {rules: [{required: true, message: '上层设备类型不能为空'}]}]"
+            placeholder="请选择"
+          >
+        </a-tree-select>
+          </a-form-item>
+        </a-col>
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
             label="用途备注"
@@ -138,6 +163,27 @@
               v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]"/>
           </a-form-item>
         </a-col>
+
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="厂区"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-model="tokenType" placeholder="请选择">
+              <a-select-option
+                :key="1"
+                label="新厂"
+                :value="1">新厂
+              </a-select-option>
+              <a-select-option
+                :key="2"
+                label="老厂"
+                :value="2">老厂
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
       </a-row>
     </a-form>
     <title-divider title="备件明细" width="90px"></title-divider>
@@ -208,6 +254,7 @@ import BaseTool from '@/utils/tool'
 import { queryUsersByParentDeptNatureAll } from '@/api/upms/user'
 import { fetchStoreTree } from '@/api/store/store'
 import { getSbPositions } from '@/api/repair/application-form'
+import { fetchSbTypeTree } from '@/api/project/project'
 export default {
   name: 'BaseOutStoreFormYY',
   components: {
@@ -226,10 +273,12 @@ export default {
       visible: false,
       maskClosable: false,
       outFlag: 1,
+      tokenType:1,
       model: {},
       sbPositionList: [],
       feeFromMap: {},
       storeId: null,
+      treeData: [],
       // 下拉框map
       typeMap: {},
       deptYYMap: {},
@@ -316,6 +365,7 @@ export default {
   props: {
   },
   created () {
+    this.setTree()
     // 下拉框map
     this.getSbPositions()
     this.feeFromMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FEE_FORM_TYPE)
@@ -380,6 +430,14 @@ export default {
       })
       this.data = record.detailList
     },
+    setTree (record = {}) {
+      fetchSbTypeTree({ type: 1 }).then((res) => {
+        this.treeData = res.data.map( item =>{
+          item.selectable = item.children == null
+          return item
+        })
+      })
+    },
     save () {
       const { form: { validateFieldsAndScroll } } = this
       this.confirmLoading = true
@@ -529,7 +587,7 @@ export default {
       this.data = data.filter(item => record.autoId !== item.autoId)
     },
     handleSpareStoreSelect () {
-      this.$refs.spareStoreSelectModal.base()
+      this.$refs.spareStoreSelectModal.base({tokenType:this.tokenType})
     },
     handleSpareStoreSelected (record, keys, rows) {
       console.log(rows)

+ 6 - 1
src/views/store/outstoreform/modules/TicketForm.vue

@@ -30,12 +30,17 @@
               {{ type? '领库':'退库' }}单位或个人:{{ model.createdUserName }}
             </td>
             <td colspan="3" style="text-align:left;">
-              用途:{{ model.remark }}
+              项目:{{ model.projectName }}
             </td>
             <td colspan="3" style="text-align:left;">
               成本归属:{{ model.feeFrom }}
             </td>
           </tr>
+          <tr>
+            <td colspan="7" style="text-align:left;">
+              用途:{{ model.remark }}
+            </td>
+          </tr>
           <tr>
             <td colspan="1" style="min-width:210px;">物料编码</td>
             <td colspan="1" style="min-width:120px;">物料名称</td>

+ 3 - 0
src/views/store/sparestore/modules/SpareStoreSelectModalYY.vue

@@ -175,12 +175,14 @@ export default {
         }
       ],
       // 下拉框map
+      tokenType:1,
       delFlagMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
           ...parameter,
           ...this.queryParam,
+          tokenType: this.tokenType,
           dataScope: {
             sortBy: 'desc',
             sortName: 'update_time'
@@ -275,6 +277,7 @@ export default {
     base (record, queryParam = { storeNo: '09' }) {
       this.visible = true
       this.modalTitle = '选择信息'
+      this.tokenType = record.tokenType
       this.queryParam = queryParam
       if (queryParam.isSpecial !== undefined) {
         this.isSpecial = queryParam.isSpecial