shaogen1995 4 лет назад
Родитель
Сommit
554ca895b4

+ 8 - 0
src/apis/holding3.js

@@ -7,3 +7,11 @@ export const getHolding3List = (data) => {
     data
     data
   })
   })
 }
 }
+// 点击申请编辑
+export const getHolding3Edit = (data) => {
+  return axios({
+    method: 'post',
+    url: '/cms/ledger/edit',
+    data
+  })
+}

+ 21 - 0
src/apis/holding4.js

@@ -0,0 +1,21 @@
+import axios from '../utils/request'
+// 列表
+export const getList = (data) => {
+  return axios({
+    method: 'post',
+    url: '/cms/ledgerEdit/list',
+    data
+  })
+}
+// 点击删除
+export const delData = (id) => {
+  return axios({
+    url: `/cms/ledgerEdit/remove/${id}`
+  })
+}
+// 通过id获取详情
+export const getDetailById = (id) => {
+  return axios({
+    url: `/cms/ledgerEdit/detail/${id}`
+  })
+}

+ 21 - 6
src/views/holding/holding0_DiaEdit.vue

@@ -50,7 +50,7 @@
         </el-form-item>
         </el-form-item>
       </div>
       </div>
       <div class="row">
       <div class="row">
-        <el-form-item label="文物类别:">
+        <el-form-item label="文物类别:" prop="goodsTypeId">
           <el-select
           <el-select
             v-model="ruleForm.goodsTypeId"
             v-model="ruleForm.goodsTypeId"
             placeholder="请选择"
             placeholder="请选择"
@@ -64,7 +64,7 @@
             ></el-option>
             ></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="文物级别:">
+        <el-form-item label="文物级别:" prop="level">
           <el-select
           <el-select
             v-model="ruleForm.level"
             v-model="ruleForm.level"
             placeholder="请选择"
             placeholder="请选择"
@@ -80,7 +80,7 @@
         </el-form-item>
         </el-form-item>
       </div>
       </div>
       <div class="row">
       <div class="row">
-        <el-form-item label="文物质地:">
+        <el-form-item label="文物质地:" prop="textureType">
           <el-select
           <el-select
             v-model="ruleForm.textureType"
             v-model="ruleForm.textureType"
             placeholder="质地类型"
             placeholder="质地类型"
@@ -118,7 +118,7 @@
         </el-form-item>
         </el-form-item>
       </div>
       </div>
       <div class="row">
       <div class="row">
-        <el-form-item label="完残程度:">
+        <el-form-item label="完残程度:" prop="integrity">
           <el-select
           <el-select
             v-model="ruleForm.integrity"
             v-model="ruleForm.integrity"
             placeholder="请选择"
             placeholder="请选择"
@@ -322,6 +322,7 @@ export default {
   },
   },
   data () {
   data () {
     return {
     return {
+      temp: [],
       // 服务器前缀地址
       // 服务器前缀地址
       baseURL: '',
       baseURL: '',
       token: '',
       token: '',
@@ -379,7 +380,11 @@ export default {
         registerNum: [{ required: true, message: '不能为空', trigger: 'blur' }],
         registerNum: [{ required: true, message: '不能为空', trigger: 'blur' }],
         age: [{ required: true, message: '不能为空', trigger: 'blur' }],
         age: [{ required: true, message: '不能为空', trigger: 'blur' }],
         length: [{ required: true, message: '不能为空', trigger: 'blur' }],
         length: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        repairRemark: [{ max: 50, message: '不能超过50个字符', trigger: 'blur' }]
+        repairRemark: [{ max: 50, message: '不能超过50个字符', trigger: 'blur' }],
+        level: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        goodsTypeId: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        textureType: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        integrity: [{ required: true, message: '不能为空', trigger: 'blur' }]
       },
       },
       // 上传图片和文件
       // 上传图片和文件
       fileList: [],
       fileList: [],
@@ -417,6 +422,14 @@ export default {
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
         this.tableData = this.tableData.filter(v => v.name !== val.name)
         this.tableData = this.tableData.filter(v => v.name !== val.name)
+        if (this.temp.length !== 0) {
+          this.temp.forEach((v, i) => {
+            // eslint-disable-next-line
+            if (v == val.id) this.temp.splice(i, 1)
+          })
+          // console.log(999, this.temp.join(','))
+          this.ruleForm.fileIds = this.temp.join(',')
+        }
         deleteAffix(val.id)
         deleteAffix(val.id)
         this.$message({
         this.$message({
           type: 'success',
           type: 'success',
@@ -433,7 +446,8 @@ export default {
     async detailsById (myId) {
     async detailsById (myId) {
       const res = await detailsById(myId)
       const res = await detailsById(myId)
       this.ruleForm = res.data
       this.ruleForm = res.data
-      this.ruleForm.fileIds = ''
+      if (this.ruleForm.fileIds) this.temp = this.ruleForm.fileIds.split(',')
+      // this.ruleForm.fileIds = ''
       // console.log(99999, res)
       // console.log(99999, res)
     },
     },
     // 通过id获取附件列表
     // 通过id获取附件列表
@@ -455,6 +469,7 @@ export default {
       if (file.code === 0) {
       if (file.code === 0) {
         if (this.ruleForm.fileIds === '') this.ruleForm.fileIds = `${file.data.fileId}`
         if (this.ruleForm.fileIds === '') this.ruleForm.fileIds = `${file.data.fileId}`
         else this.ruleForm.fileIds += `,${file.data.fileId}`
         else this.ruleForm.fileIds += `,${file.data.fileId}`
+        this.temp = this.ruleForm.fileIds.split(',')
         this.$message.success('上传成功')
         this.$message.success('上传成功')
         this.tableData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath })
         this.tableData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath })
       }
       }

+ 25 - 11
src/views/holding/holding0_Dialog.vue

@@ -50,7 +50,7 @@
         </el-form-item>
         </el-form-item>
       </div>
       </div>
       <div class="row">
       <div class="row">
-        <el-form-item label="文物类别:">
+        <el-form-item label="文物类别:" prop="goodsTypeId">
           <el-select
           <el-select
             v-model="ruleForm.goodsTypeId"
             v-model="ruleForm.goodsTypeId"
             placeholder="请选择"
             placeholder="请选择"
@@ -64,7 +64,7 @@
             ></el-option>
             ></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="文物级别:">
+        <el-form-item label="文物级别:" prop="level">
           <el-select
           <el-select
             v-model="ruleForm.level"
             v-model="ruleForm.level"
             placeholder="请选择"
             placeholder="请选择"
@@ -80,7 +80,7 @@
         </el-form-item>
         </el-form-item>
       </div>
       </div>
       <div class="row">
       <div class="row">
-        <el-form-item label="文物质地:">
+        <el-form-item label="文物质地:" prop="textureType">
           <el-select
           <el-select
             v-model="ruleForm.textureType"
             v-model="ruleForm.textureType"
             placeholder="质地类型"
             placeholder="质地类型"
@@ -118,7 +118,7 @@
         </el-form-item>
         </el-form-item>
       </div>
       </div>
       <div class="row">
       <div class="row">
-        <el-form-item label="完残程度:">
+        <el-form-item label="完残程度:" prop="integrity">
           <el-select
           <el-select
             v-model="ruleForm.integrity"
             v-model="ruleForm.integrity"
             placeholder="请选择"
             placeholder="请选择"
@@ -326,6 +326,7 @@ export default {
   },
   },
   data () {
   data () {
     return {
     return {
+      temp: [],
       // 服务器前缀地址
       // 服务器前缀地址
       baseURL: '',
       baseURL: '',
       token: '',
       token: '',
@@ -383,7 +384,11 @@ export default {
         registerNum: [{ required: true, message: '不能为空', trigger: 'blur' }],
         registerNum: [{ required: true, message: '不能为空', trigger: 'blur' }],
         age: [{ required: true, message: '不能为空', trigger: 'blur' }],
         age: [{ required: true, message: '不能为空', trigger: 'blur' }],
         length: [{ required: true, message: '不能为空', trigger: 'blur' }],
         length: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        repairRemark: [{ max: 50, message: '不能超过50个字符', trigger: 'blur' }]
+        repairRemark: [{ max: 50, message: '不能超过50个字符', trigger: 'blur' }],
+        level: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        goodsTypeId: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        textureType: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        integrity: [{ required: true, message: '不能为空', trigger: 'blur' }]
       },
       },
       // 上传图片和文件
       // 上传图片和文件
       fileList: [],
       fileList: [],
@@ -415,7 +420,6 @@ export default {
   methods: {
   methods: {
     // 点击删除附件
     // 点击删除附件
     delAffix (val) {
     delAffix (val) {
-      console.log(666, val)
       this.$confirm('确定删除吗?', '提示', {
       this.$confirm('确定删除吗?', '提示', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',
@@ -423,6 +427,14 @@ export default {
       }).then(() => {
       }).then(() => {
         this.tableData = this.tableData.filter(v => v.name !== val.name)
         this.tableData = this.tableData.filter(v => v.name !== val.name)
         this.tempData = this.tempData.filter(v => v.name !== val.name)
         this.tempData = this.tempData.filter(v => v.name !== val.name)
+        if (this.temp.length !== 0) {
+          this.temp.forEach((v, i) => {
+            // eslint-disable-next-line
+            if (v == val.id) this.temp.splice(i, 1)
+          })
+          this.ruleForm.fileIds = this.temp.join(',')
+          // console.log(11111, this.ruleForm.fileIds)
+        }
         this.$message({
         this.$message({
           type: 'success',
           type: 'success',
           message: '删除成功!'
           message: '删除成功!'
@@ -454,8 +466,10 @@ export default {
         if (this.ruleForm.fileIds === '') this.ruleForm.fileIds = `${file.data.fileId}`
         if (this.ruleForm.fileIds === '') this.ruleForm.fileIds = `${file.data.fileId}`
         else this.ruleForm.fileIds += `,${file.data.fileId}`
         else this.ruleForm.fileIds += `,${file.data.fileId}`
         this.$message.success('上传成功')
         this.$message.success('上传成功')
-        this.tempData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath })
-        this.tableData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath })
+        this.tempData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath, id: file.data.fileId })
+        this.tableData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath, id: file.data.fileId })
+        this.temp = this.ruleForm.fileIds.split(',')
+        // console.log(9999, this.temp)
       }
       }
     },
     },
     handleRemove (file, fileList) {
     handleRemove (file, fileList) {
@@ -501,11 +515,11 @@ export default {
     },
     },
     // 点击确定
     // 点击确定
     async btnOK () {
     async btnOK () {
-      // 清空表格数据
-      this.tableData = this.tempData = []
-      this.ruleForm.registerId = this.registerId
       try {
       try {
         await this.$refs.ruleForm.validate()
         await this.$refs.ruleForm.validate()
+        // 清空表格数据
+        this.tableData = this.tempData = []
+        this.ruleForm.registerId = this.registerId
         if (this.ruleForm.goodsTypeId === '') return this.$message.warning('文物类别没有选择!')
         if (this.ruleForm.goodsTypeId === '') return this.$message.warning('文物类别没有选择!')
         if (this.ruleForm.level === '') return this.$message.warning('文物级别没有选择!')
         if (this.ruleForm.level === '') return this.$message.warning('文物级别没有选择!')
         if (this.ruleForm.textureType === '') return this.$message.warning('文物质地没有选择!')
         if (this.ruleForm.textureType === '') return this.$message.warning('文物质地没有选择!')

+ 0 - 237
src/views/holding/holding1_Dialog copy.vue

@@ -1,237 +0,0 @@
-<template>
-  <el-dialog title="添加藏品" :visible="dialogFormVisible" @close="cancel()">
-    <div class="query">
-      <span>藏品名称:</span>
-      <el-input
-        v-model="myData.searchKey"
-        placeholder="请输入"
-        style="width: 280px; margin-right: 40px"
-      ></el-input>
-      <el-button @click="search">查 询</el-button>
-    </div>
-    <!-- 表格 -->
-    <el-table
-      ref="multipleTable"
-      @selection-change="handleSelectionChange"
-      :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
-      :data="tableData"
-      border
-      style="width: 100%"
-    >
-      <el-table-column type="selection" width="55"> </el-table-column>
-      <el-table-column label="缩略图" width="140">
-        <template #default="{ row }">
-          <div class="smimg">
-            <img :src="baseURL + row.thumb" alt="" :onerror='defaultImg'/>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column prop="registerNum" label="总登记号" width="180">
-      </el-table-column>
-      <el-table-column prop="name" label="藏品名称"> </el-table-column>
-      <el-table-column prop="goodsTypeName" label="类别" width="180">
-      </el-table-column>
-    </el-table>
-    <!-- 分页器 -->
-    <div class="paging">
-      <el-pagination
-        :current-page='myData.pageNum'
-        @current-change="currentChange"
-        background
-        layout="prev, pager, next,jumper"
-        :total="total"
-      >
-      </el-pagination>
-    </div>
-    <div slot="footer" class="dialog-footer">
-      <el-button type="primary" @click="btnOK">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-import axios from '@/utils/request'
-import { getListTow } from '@/apis/holding1'
-export default {
-  name: 'Holding0_Dialog',
-  components: {},
-  props: {
-    dialogFormVisible: {
-      type: Boolean,
-      default: false
-    },
-    myTemp: {
-      type: Array,
-      default: function () {
-        return []
-      }
-    }
-  },
-  data () {
-    return {
-      // 存储全部表格信息的数据
-      tableGather: {},
-      // 表格数据的筛选
-      myData: {
-        pageNum: 1,
-        pageSize: 10,
-        searchKey: ''
-      },
-      // 分页器总数
-      total: 0,
-      // 服务器前缀地址
-      baseURL: '',
-      // 表格数据
-      tableData: [],
-      // 传递给父元素的表格数据
-      fatabList: [],
-      tableObj: {}
-
-    }
-  },
-  // 监听属性 类似于data概念
-  computed: {},
-  // 监控data中的数据变化
-  watch: {},
-  // 方法集合
-  methods: {
-    // 分页器页码改变
-    currentChange (val) {
-      // console.log(val)
-      this.tableData = this.tableGather[val]
-      // this.myData.pageNum = val
-      // this.getListTow(this.myData)
-      // this.$nextTick(() => {
-      //   // 所有dom加载完毕之后---要执行的代码
-      //   setTimeout(() => {
-      //     if (this.tableData.length === 0) {
-      //       this.myData.pageNum = 1
-      //       this.getListTow(this.myData)
-      //     }
-      //   }, 100)
-      // })
-    },
-    // 每一页显示条数改变
-    // sizeChange (val) {
-    //   this.myData.pageSize = val
-    //   this.getListAll()
-    // },
-    // 点击查询
-    search () {
-      this.myData.pageNum = 1
-      this.getListTow(this.myData)
-    },
-    // 表格的多选
-    handleSelectionChange (rows) {
-      // console.log(this.myData.pageNum)
-    //   const temp = []
-    //   this.tableObj[this.myData.pageNum] = rows
-    //   // console.log(666, this.tableObj)
-    //   for (const k in this.tableObj) {
-    //     this.tableObj[k].forEach(v => {
-    //       temp.push(v)
-    //     })
-    //   }
-    //   this.fatabList = temp
-    //   console.log(99999999, this.fatabList)
-    },
-    // 点击确定
-    btnOK () {
-      // 把选中的数据传给父组件
-
-      this.$emit('getSonList', this.fatabList)
-
-      this.cancel()
-    },
-    // 点击取消
-    cancel () {
-      this.$emit('update:dialogFormVisible', false)
-      this.myData.searchKey = ''
-      this.myData.pageNum = 1
-    },
-    // 获取藏品列表---让父组件调用
-    async getListTow (data) {
-      const res = await getListTow(data)
-      this.tableData = res.data.list
-      // console.log(66666666, res.data.list.length / 10)
-      // console.log(66666, this.tableData)
-      // this.tableGather[1]=
-
-      // 表格的默认选中
-      this.myTemp.forEach(v => {
-        this.tableData.forEach((i, ind) => {
-          if (v.id === i.id) {
-            this.$nextTick(() => {
-              this.$refs.multipleTable.toggleRowSelection(this.tableData[ind], true)
-            })
-          }
-        })
-      })
-      // 表格的默认选中
-      // this.myTemp.forEach(v => {
-      //   console.log(666, v)
-      // })
-
-      this.total = res.data.total
-    },
-    // 获取所有藏品列表信息的函数
-    async getListAll () {
-      const res = await getListTow({ pageNum: 1, pageSize: 999999 })
-      this.total = res.data.total
-      // console.log(res.data.list)
-      const totle = res.data.list.length / this.myData.pageSize
-      // console.log(999999999, Math.ceil(totle))
-      for (let i = 1; i <= Math.ceil(totle); i++) {
-        this.tableGather[i] = res.data.list.slice(i * this.myData.pageSize - this.myData.pageSize, i * this.myData.pageSize)
-      }
-      this.tableData = this.tableGather[1]
-    }
-  },
-  created () {
-    // 获取服务器前缀地址
-    this.baseURL = axios.defaults.baseURL
-  },
-  mounted () {
-    this.getListAll()
-  },
-  beforeCreate () {}, // 生命周期 - 创建之前
-  beforeMount () {}, // 生命周期 - 挂载之前
-  beforeUpdate () {}, // 生命周期 - 更新之前
-  updated () {}, // 生命周期 - 更新之后
-  beforeDestroy () {}, // 生命周期 - 销毁之前
-  destroyed () {}, // 生命周期 - 销毁完成
-  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
-}
-</script>
-<style lang='less' scoped>
-.paging {
-  position: absolute;
-  bottom: 20px;
-  left: 50%;
-  transform: translateX(-50%);
-}
-.query {
-  height: 85px;
-  align-items: center;
-  display: flex;
-}
-/deep/.el-dialog__body {
-  padding: 0px 20px 20px;
-  overflow: auto;
-  max-height: 556px;
-}
-.row {
-  display: flex;
-  /deep/& > div {
-    flex: 1;
-  }
-}
-.smimg {
-  height: 60px;
-  img {
-    width: 100%;
-    height: 100%;
-    // border: 3px solid #ccc;
-  }
-}
-</style>

+ 8 - 1
src/views/holding/holding1_Dialog.vue

@@ -136,7 +136,14 @@ export default {
     // 点击确定
     // 点击确定
     btnOK () {
     btnOK () {
       // 把选中的数据传给父组件
       // 把选中的数据传给父组件
-
+      if (this.myTemp.length > 0) {
+        this.myTemp.forEach((v, i) => {
+          if (this.fatabList[i]) this.fatabList[i].storageId = v.location.join(',')
+          // console.log(22222, this.fatabList[i].location)
+        })
+      }
+      // console.log(111111111, this.fatabList)
+      // 把选中的数据传给父组件
       this.$emit('getSonList', this.fatabList)
       this.$emit('getSonList', this.fatabList)
 
 
       this.cancel()
       this.cancel()

+ 2 - 0
src/views/holding/holding1_add.vue

@@ -164,6 +164,7 @@ export default {
       this.goodsIds = [...temp2]
       this.goodsIds = [...temp2]
       // console.log(999, this.goodsIds)
       // console.log(999, this.goodsIds)
       this.tableData = data
       this.tableData = data
+      // console.log(999999999, this.tableData.storageId)
       this.tableData.forEach(v => {
       this.tableData.forEach(v => {
         v.integrity = this.spoil(v.integrity)
         v.integrity = this.spoil(v.integrity)
         v.goodsTypeId = this.category(v.goodsTypeId)
         v.goodsTypeId = this.category(v.goodsTypeId)
@@ -225,6 +226,7 @@ export default {
     addObject () {
     addObject () {
       // 把当前表格的数据传递过去,防止重复选择
       // 把当前表格的数据传递过去,防止重复选择
       this.myTemp = this.tableData
       this.myTemp = this.tableData
+      // console.log(99999, this.myTemp)
       // 调用子组件方法
       // 调用子组件方法
       this.$refs.myDialog.getListTow({ pageNum: 1, pageSize: 99999 })
       this.$refs.myDialog.getListTow({ pageNum: 1, pageSize: 99999 })
       this.isShow = true
       this.isShow = true

+ 5 - 1
src/views/holding/holding2_Dialog.vue

@@ -136,7 +136,11 @@ export default {
     // 点击确定
     // 点击确定
     btnOK () {
     btnOK () {
       // 把选中的数据传给父组件
       // 把选中的数据传给父组件
-
+      if (this.myTemp.length > 0) {
+        this.myTemp.forEach((v, i) => {
+          if (this.fatabList[i]) this.fatabList[i].outPath = v.outPath
+        })
+      }
       this.$emit('getSonList', this.fatabList)
       this.$emit('getSonList', this.fatabList)
 
 
       this.cancel()
       this.cancel()

+ 1 - 1
src/views/holding/holding2_look.vue

@@ -126,7 +126,7 @@ export default {
     myStatus (id) {
     myStatus (id) {
       const list = [
       const list = [
         { id: 0, name: '已归还' },
         { id: 0, name: '已归还' },
-        { id: 1, name: '已入库' },
+        { id: 1, name: '已归还' },
         { id: 2, name: '未归还' }
         { id: 2, name: '未归还' }
       ]
       ]
       return list.filter((v) => id === v.id)[0].name
       return list.filter((v) => id === v.id)[0].name

+ 49 - 39
src/views/holding/holding3.vue

@@ -233,22 +233,25 @@ export default {
         this.options.forEach(p => {
         this.options.forEach(p => {
         // eslint-disable-next-line
         // eslint-disable-next-line
           if(p.id== v.storageId.split(',')[0]) {
           if(p.id== v.storageId.split(',')[0]) {
-            v.myweizhi = p.name
-            p.children.forEach(p2 => {
-            // eslint-disable-next-line
-              if(p2.id==v.storageId.split(',')[1]) {
-                v.myweizhi += '/' + p2.name + '/'
-                p2.children.forEach(p3 => {
-                // eslint-disable-next-line
-                  if (p3.id == v.storageId.split(',')[2]) {
-                    v.myweizhi += p3.name
+            if (p.children) {
+              v.myweizhi = p.name
+              p.children.forEach(p2 => {
+              // eslint-disable-next-line
+                  if(p2.id==v.storageId.split(',')[1]) {
+                  if (p2.children) {
+                    v.myweizhi += '/' + p2.name
+                    p2.children.forEach(p3 => {
+                    // eslint-disable-next-line
+                            if (p3.id == v.storageId.split(',')[2]) {
+                        v.myweizhi += '/' + p3.name
+                      }
+                    })
                   }
                   }
-                })
-              }
-            })
+                }
+              })
+            }
           }
           }
         })
         })
-
         v.numTypeId = this.mycategory(v.numTypeId)
         v.numTypeId = this.mycategory(v.numTypeId)
         if (v.amountType === 0) v.amountType = '单件'
         if (v.amountType === 0) v.amountType = '单件'
         else if (v.amountType === 1) v.amountType = '一套多件'
         else if (v.amountType === 1) v.amountType = '一套多件'
@@ -285,26 +288,29 @@ export default {
       this.imgList = res.data.list
       this.imgList = res.data.list
       this.tableData = res.data.list
       this.tableData = res.data.list
       this.tableData.forEach(v => {
       this.tableData.forEach(v => {
-        // 位置信息处理
+      // 位置信息处理
         this.options.forEach(p => {
         this.options.forEach(p => {
-          // eslint-disable-next-line
+        // eslint-disable-next-line
           if(p.id== v.storageId.split(',')[0]) {
           if(p.id== v.storageId.split(',')[0]) {
-            v.myweizhi = p.name
-            p.children.forEach(p2 => {
+            if (p.children) {
+              v.myweizhi = p.name
+              p.children.forEach(p2 => {
               // eslint-disable-next-line
               // eslint-disable-next-line
-              if(p2.id==v.storageId.split(',')[1]) {
-                v.myweizhi += '/' + p2.name + '/'
-                p2.children.forEach(p3 => {
-                  // eslint-disable-next-line
-                  if (p3.id == v.storageId.split(',')[2]) {
-                    v.myweizhi += p3.name
+                  if(p2.id==v.storageId.split(',')[1]) {
+                  if (p2.children) {
+                    v.myweizhi += '/' + p2.name
+                    p2.children.forEach(p3 => {
+                    // eslint-disable-next-line
+                            if (p3.id == v.storageId.split(',')[2]) {
+                        v.myweizhi += '/' + p3.name
+                      }
+                    })
                   }
                   }
-                })
-              }
-            })
+                }
+              })
+            }
           }
           }
         })
         })
-
         // if (v.textureType === 0) v.textureType = '单一质地'
         // if (v.textureType === 0) v.textureType = '单一质地'
         // else if (v.textureType === 1) v.textureType = '复合质地'
         // else if (v.textureType === 1) v.textureType = '复合质地'
         if (v.status === 0) v.status = '待入库'
         if (v.status === 0) v.status = '待入库'
@@ -351,19 +357,23 @@ export default {
       this.options.forEach(p => {
       this.options.forEach(p => {
         // eslint-disable-next-line
         // eslint-disable-next-line
           if(p.id== v.storageId.split(',')[0]) {
           if(p.id== v.storageId.split(',')[0]) {
-          v.myweizhi = p.name
-          p.children.forEach(p2 => {
-            // eslint-disable-next-line
-              if(p2.id==v.storageId.split(',')[1]) {
-              v.myweizhi += '/' + p2.name + '/'
-              p2.children.forEach(p3 => {
-                // eslint-disable-next-line
-                  if (p3.id == v.storageId.split(',')[2]) {
-                  v.myweizhi += p3.name
+          if (p.children) {
+            v.myweizhi = p.name
+            p.children.forEach(p2 => {
+              // eslint-disable-next-line
+                  if(p2.id==v.storageId.split(',')[1]) {
+                if (p2.children) {
+                  v.myweizhi += '/' + p2.name
+                  p2.children.forEach(p3 => {
+                    // eslint-disable-next-line
+                            if (p3.id == v.storageId.split(',')[2]) {
+                      v.myweizhi += '/' + p3.name
+                    }
+                  })
                 }
                 }
-              })
-            }
-          })
+              }
+            })
+          }
         }
         }
       })
       })
 
 

+ 626 - 0
src/views/holding/holding3_DiaEdit.vue

@@ -0,0 +1,626 @@
+<template>
+  <el-dialog title="编辑藏品" :visible="dialogFormVisible" @close="cancel()">
+    <!-- 表单内容 -->
+    <el-form
+      :model="ruleForm"
+      :rules="rules"
+      ref="ruleForm"
+      label-width="120px"
+      class="demo-ruleForm"
+    >
+      <div class="row">
+        <el-form-item label="藏品名称:" prop="name">
+          <el-input v-model="ruleForm.name" placeholder="请输入"></el-input>
+        </el-form-item>
+        <el-form-item label="总登记号:" prop="registerNum">
+          <el-input
+            v-model="ruleForm.registerNum"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </div>
+      <div class="row">
+        <el-form-item label="编号类型:">
+          <el-select
+            v-model="ruleForm.numTypeId"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in numType"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="藏品编号:">
+          <el-input v-model="ruleForm.num" placeholder="请输入"></el-input>
+        </el-form-item>
+      </div>
+      <div class="row">
+        <el-form-item label="原名:">
+          <el-input
+            v-model="ruleForm.primitiveName"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="年代:" prop="age">
+          <el-input v-model="ruleForm.age" placeholder="请输入"></el-input>
+        </el-form-item>
+      </div>
+      <div class="row">
+        <el-form-item label="文物类别:" prop="goodsTypeId">
+          <el-select
+            v-model="ruleForm.goodsTypeId"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in objectType"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="文物级别:" prop="level">
+          <el-select
+            v-model="ruleForm.level"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option label="" value=""></el-option>
+            <el-option label="三级" :value="3"></el-option>
+            <el-option label="二级" :value="2"></el-option>
+            <el-option label="一级" :value="1"></el-option>
+            <el-option label="一般" :value="0"></el-option>
+            <el-option label="未定级" :value="-1"></el-option>
+          </el-select>
+        </el-form-item>
+      </div>
+      <div class="row">
+        <el-form-item label="文物质地:" prop="textureType">
+          <el-select
+            v-model="ruleForm.textureType"
+            placeholder="质地类型"
+            style="width: 100%"
+          >
+            <el-option label="" value=""></el-option>
+            <el-option label="单一质地" :value="0"></el-option>
+            <el-option label="复合质地" :value="1"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-input
+          style="margin: 0 20px"
+          v-model="ruleForm.textureCategory"
+          placeholder="质地类别"
+        ></el-input>
+        <el-input v-model="ruleForm.texture" placeholder="质地"></el-input>
+      </div>
+      <div class="row">
+        <el-form-item label="外形尺寸:" prop="length">
+          <el-input
+            v-model="ruleForm.length"
+            placeholder="长(cm)"
+            style="width: 30%"
+          ></el-input>
+          <el-input
+            v-model="ruleForm.width"
+            placeholder="宽(cm)"
+            style="width: 30%; margin: 0 20px"
+          ></el-input>
+          <el-input
+            v-model="ruleForm.height"
+            placeholder="高(cm)"
+            style="width: 30%"
+          ></el-input>
+        </el-form-item>
+      </div>
+      <div class="row">
+        <el-form-item label="完残程度:" prop="integrity">
+          <el-select
+            v-model="ruleForm.integrity"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option label="" value=""></el-option>
+            <el-option label="完整" :value="1"></el-option>
+            <el-option label="基本完整" :value="0"></el-option>
+            <el-option label="残缺" :value="-1"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="保存状态:">
+          <el-select
+            v-model="ruleForm.repair"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option label="" value=""></el-option>
+            <el-option label="已修复" :value="3"></el-option>
+            <el-option label="继续修复" :value="2"></el-option>
+            <el-option label="需要修复" :value="1"></el-option>
+            <el-option label="不需修复" :value="0"></el-option>
+          </el-select>
+        </el-form-item>
+      </div>
+      <div class="row">
+         <el-form-item label="完残状况:" prop="repairRemark">
+          <el-input v-model="ruleForm.repairRemark" placeholder="请输入"></el-input>
+        </el-form-item>
+      </div>
+      <div class="row">
+        <el-form-item label="数量类型:">
+          <el-select
+            v-model="ruleForm.amountType"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option label="" value=""></el-option>
+            <el-option label="一套多件" :value="1"></el-option>
+            <el-option label="单件" :value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="具体数量:">
+          <el-input v-model="ruleForm.amount" placeholder="请输入"></el-input>
+        </el-form-item>
+      </div>
+
+      <div class="row">
+        <el-form-item label="质量范围:">
+          <el-select
+            v-model="ruleForm.qualityScope"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in qualityRange"
+              :key="item"
+              :label="item"
+              :value="item"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="具体质量:">
+          <el-input v-model="ruleForm.quality" placeholder="请输入"></el-input>
+        </el-form-item>
+      </div>
+
+      <div class="row">
+        <el-form-item label="入藏时间范围:">
+          <el-select
+            v-model="ruleForm.checkInScope"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in checkInScope"
+              :key="item"
+              :label="item"
+              :value="item"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="入藏年度:">
+          <el-input
+            v-model="ruleForm.checkInYear"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </div>
+      <!-- 图片和附件 -->
+      <el-form-item label="藏品图片:">
+        <el-upload
+          class="avatar-uploader"
+          :action="baseURL + '/cms/goods/uploadImg'"
+          :headers="{
+            token,
+          }"
+          :show-file-list="false"
+          :before-upload="beforethumbUpload"
+          :on-success="upload_thumb_success"
+        >
+          <div v-if="ruleForm.thumb" class="imgdiv">
+            <img
+              style="width: 100%; height: 100%"
+              :src="baseURL + ruleForm.thumb"
+            />
+            <i
+              class="el-icon-circle-close"
+              @click.stop="ruleForm.thumb = ''"
+            ></i>
+          </div>
+          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+        </el-upload>
+        <span>支持上传jpg,png格式,最大10M</span>
+      </el-form-item>
+      <el-form-item label="上传附件:">
+        <el-select v-model="affixVal" placeholder="请选择">
+          <el-option
+            v-for="item in affix"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+        <!-- 上传附件 -->
+        <el-upload
+          class="upload-demo"
+          :action="baseURL + `/cms/goods/upload/${affixVal}/${ruleForm.dirCode}`"
+                    :headers="{
+            token,
+          }"
+          :on-success="successFujian"
+          :on-preview="handlePreview"
+          :on-remove="handleRemove"
+          :before-remove="beforeRemove"
+          :show-file-list='false'
+          multiple
+          :on-exceed="handleExceed"
+          :file-list="fileList"
+        >
+          <el-button size="small" type="primary">点击上传</el-button>
+        </el-upload>
+      </el-form-item>
+    </el-form>
+    <!-- 表格 -->
+    <el-table
+      :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
+      :data="tableData"
+      border
+      style="width: 100%"
+    >
+      <el-table-column label="缩略图" width="140" v-if="affixVal==='img'">
+        <template #default='{row}'>
+          <div class="smimg">
+            <img :src="baseURL+row.filePath" alt="" :onerror='defaultImg'/>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column prop="name" label="附件名称"> </el-table-column>
+      <el-table-column prop="updateTime" label="上传时间" width="150">
+      </el-table-column>
+      <el-table-column label="操作" width="150">
+        <template #default='{row}'>
+          <!-- <el-button type="text">重 传</el-button> -->
+          <el-button type="text" @click="delAffix(row)">删 除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="cancel">取 消</el-button>
+      <el-button type="primary" @click="btnOK">提 交</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import axios from '@/utils/request'
+import { getHolding3Edit } from '../../apis/holding3'
+import {
+  getGoodsNumType,
+  getGoodsType,
+  detailsById,
+  getFileList,
+  deleteAffix
+} from '@/apis/holding'
+export default {
+  name: 'holding3_DiaEdit',
+  components: {},
+  props: {
+    dialogFormVisible: {
+      type: Boolean,
+      default: false
+    },
+    registerId: {
+      type: Number
+    },
+    fujianId: {
+      type: Number
+    }
+  },
+  data () {
+    return {
+      temp: [],
+      // 服务器前缀地址
+      baseURL: '',
+      token: '',
+      ruleForm: {
+        repairRemark: '',
+        age: '', // 年代
+        amount: '', // 数量
+        amountType: '', // 数量类型, 0:单件, 1:一套多件
+        checkInScope: '', // 入藏时间范围
+        checkInYear: '', // 入藏年底
+        dirCode: '', // 目录码
+        fileIds: '', // 附件id, 多个以逗号分隔
+        goodsTypeId: '', // 文物类型Id
+        height: '', // 高
+        // id:'',//id, 修改时必须传,新增忽略
+        integrity: '', // 完整度, -1:残缺,0:基本完整, 1:完整
+        // isStorage: '', // 是否入库,0:不入库, 1:入库
+        length: '', // 长
+        level: '', // 文物级别,前端输入。 -1:未定级, 0:一般, 1:一级, 2:二级, 3:三级
+        name: '', // 标题
+        num: '', // 臧品编号
+        numTypeId: '', // 编号类型Id
+        primitiveName: '', // 原名
+        quality: '', // 具体质量
+        qualityScope: '', // 质量范围
+        registerNum: '', // 总登记号
+        repair: '', // 保存状态(修复状态), 0:不需修复, 1:需要修复,2:继续修复, 3:已修复
+        texture: '', // 质地
+        textureCategory: '', // 质地类别
+        textureType: '', // 质地类型,前端输入, 0:单一质地, 1:复活质地
+        thumb: '', // 缩略图url
+        width: '' // 宽
+      },
+      checkInScope: [
+        '',
+        '1949.10.1前',
+        '1949.10.1-1965',
+        '1966-1976',
+        '1977-2000',
+        '2001至今'
+      ], // 入藏时间范围
+      qualityRange: [
+        '',
+        '<0.01kg',
+        '0.01-1kg',
+        '1-50kg',
+        '50-100kg',
+        '100-1000kg',
+        '>1000kg'
+      ], // 质量范围
+      objectType: [], // 文物类型
+      numType: [], // 文物编号类型
+      rules: {
+        name: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        registerNum: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        age: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        length: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        repairRemark: [{ max: 50, message: '不能超过50个字符', trigger: 'blur' }],
+        level: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        goodsTypeId: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        textureType: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        integrity: [{ required: true, message: '不能为空', trigger: 'blur' }]
+      },
+      // 上传图片和文件
+      fileList: [],
+      affixVal: 'video',
+      affix: [
+        { label: '高清图片', value: 'img' },
+        { label: '视频文件', value: 'video' },
+        { label: '音频文件', value: 'audio' },
+        { label: '三维模型', value: 'model' },
+        { label: '文档资料', value: 'doc' }
+      ],
+      dialogImageUrl: '',
+      dialogVisible: false,
+      disabled: false,
+      // 表格数据
+      tableData: [],
+      tempData: []
+    }
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {
+    affixVal (val) {
+      this.getFileList(this.fujianId, val)
+    }
+  },
+  // 方法集合
+  methods: {
+    // 点击删除附件
+    delAffix (val) {
+      this.$confirm('确定删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.tableData = this.tableData.filter(v => v.name !== val.name)
+        if (this.temp.length !== 0) {
+          this.temp.forEach((v, i) => {
+            // eslint-disable-next-line
+            if (v == val.id) this.temp.splice(i, 1)
+          })
+          // console.log(999, this.temp.join(','))
+          this.ruleForm.fileIds = this.temp.join(',')
+        }
+        deleteAffix(val.id)
+        this.$message({
+          type: 'success',
+          message: '删除成功!'
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    },
+    // 通过id获取藏品详情--让父组件调用
+    async detailsById (myId) {
+      const res = await detailsById(myId)
+      this.ruleForm = res.data
+      if (this.ruleForm.fileIds) this.temp = this.ruleForm.fileIds.split(',')
+      // console.log(99999, res)
+    },
+    // 通过id获取附件列表
+    async getFileList (myId, myType) {
+      const res = await getFileList(myId, myType)
+      // console.log(6666, res)
+      this.tableData = res.data
+      this.tableData.forEach(v => {
+        v.updateTime = v.updateTime.slice(0, 10)
+      })
+      // this.fileList = [{ name: this.tableData[0].name, url: this.tableData[0].filePath }]
+      // { name: '666.png', url: '666' }
+    },
+    // 上传附件
+    successFujian (file) {
+      // 上传成功
+      // console.log(333333, file)
+      // console.log(666666, this.ruleForm.fileIds)
+      if (file.code === 0) {
+        if (this.ruleForm.fileIds === '') this.ruleForm.fileIds = `${file.data.fileId}`
+        else this.ruleForm.fileIds += `,${file.data.fileId}`
+        this.$message.success('上传成功')
+        // 获取当前时间
+        // const myDate = new Date()
+        // const a = myDate.getFullYear()
+        // const b = myDate.getMonth()
+        // const c = myDate.getDate()
+        // console.log(999, a, b + 1, c)
+        this.tableData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath })
+      }
+    },
+    handleRemove (file) {
+      // 删除成功
+      // console.log(111111111, file)
+      let temp
+      if (this.ruleForm.fileIds.includes(',')) temp = ',' + file.response.data.fileId
+      else temp = file.response.data.fileId + ''
+      this.ruleForm.fileIds = this.ruleForm.fileIds.replace(temp, '')
+      console.log(7777, this.ruleForm.fileIds)
+    },
+    handlePreview (file) {
+      console.log(222222222, file)
+    },
+    handleExceed (files, fileList) {
+      this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
+    },
+    beforeRemove (file, fileList) {
+      return this.$confirm(`确定移除 ${file.name}?`)
+    },
+    // 上传图片
+    beforethumbUpload (file) {
+      // 限制图片大小和格式
+      const sizeOk = file.size / 1024 / 1024 < 10
+      const typeOk = file.type === 'image/png' || file.type === 'image/jpeg'
+
+      return new Promise((resolve, reject) => {
+        if (!typeOk) {
+          this.$message.error('照片格式有误!')
+          reject(file)
+        } else if (!sizeOk) {
+          this.$message.error('照片大小超过10M!')
+          reject(file)
+        } else {
+          this.$message.success('上传成功')
+          resolve(file)
+        }
+      })
+    },
+    upload_thumb_success (data) {
+      this.loading = false
+      this.ruleForm.thumb = data.data.filePath
+    },
+    // 点击确定
+    async btnOK () {
+      this.ruleForm.registerId = this.registerId
+      try {
+        await this.$refs.ruleForm.validate()
+        if (this.ruleForm.goodsTypeId === '') return this.$message.warning('文物类别没有选择!')
+        if (this.ruleForm.level === '') return this.$message.warning('文物级别没有选择!')
+        if (this.ruleForm.textureType === '') return this.$message.warning('文物质地没有选择!')
+        if (this.ruleForm.integrity === '') return this.$message.warning('完残程度没有选择!')
+        // console.log(this.ruleForm)
+        this.ruleForm.amount = Number(this.ruleForm.amount)
+        await getHolding3Edit(this.ruleForm)
+        // console.log(6666, res)
+        this.$message.success('申请成功')
+        this.cancel()
+        // 通知父组件更新界面
+        this.$emit('updateUI')
+      } catch (error) {
+        console.log(error)
+        this.$message.warning('有输入不符合表单要求!')
+      }
+    },
+    // 点击取消
+    cancel () {
+      // 把附件变成video
+      this.affixVal = 'video'
+      this.$emit('update:dialogFormVisible', false)
+    }
+  },
+  created () {
+    // 获取服务器前缀地址
+    this.baseURL = axios.defaults.baseURL
+    // 获取用户token
+    this.token = localStorage.getItem('daliCK_token')
+  },
+  async mounted () {
+    // 获取文物编号类型
+    const res = await getGoodsNumType()
+    this.numType = res.data
+    this.numType.unshift({ id: '', name: '' })
+    // 获取文物类型
+    const res2 = await getGoodsType()
+    this.objectType = res2.data
+    this.objectType.unshift({ id: '', name: '' })
+  },
+  beforeCreate () {}, // 生命周期 - 创建之前
+  beforeMount () {}, // 生命周期 - 挂载之前
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
+</script>
+<style lang='less' scoped>
+
+/deep/.upload-demo{
+  float: left;
+  margin-right: 30px;
+}
+/deep/.el-dialog__body {
+  overflow: auto;
+  max-height: 556px;
+}
+.row {
+  display: flex;
+  /deep/& > div {
+    flex: 1;
+  }
+}
+.smimg {
+  height: 80px;
+  img {
+    width: 100%;
+    height: 100%;
+    // border: 3px solid #ccc;
+  }
+}
+/deep/.el-icon-plus {
+  border: 1px dashed #000;
+}
+.avatar-uploader .el-upload {
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+/deep/.el-icon-circle-close {
+  font-size: 20px;
+}
+.imgdiv {
+  max-width: 400px;
+}
+</style>

+ 15 - 2
src/views/holding/holding3_look.vue

@@ -155,7 +155,7 @@
                 <span>入库位置:</span>
                 <span>入库位置:</span>
                 <el-cascader
                 <el-cascader
                   ref="cascaderAddr"
                   ref="cascaderAddr"
-                  v-if="myObj.location && myObj.location.length === 3"
+                  v-if="myObj.location && myObj.location.length >= 1"
                   placeholder=""
                   placeholder=""
                   disabled
                   disabled
                   style="width: 80%"
                   style="width: 80%"
@@ -223,15 +223,19 @@
           </div>
           </div>
           <!-- 底部的返回按钮 -->
           <!-- 底部的返回按钮 -->
           <div class="btn">
           <div class="btn">
+            <el-button type="primary" @click="begEdit">申请编辑</el-button>
             <el-button @click="$router.go(-1)">返 回</el-button>
             <el-button @click="$router.go(-1)">返 回</el-button>
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
+    <!-- 点击编辑出现弹窗 -->
+    <Holding3DiaEdit :dialogFormVisible.sync='isShowED' ref="myDia"  :registerId='myObj.registerId' :fujianId='myObj.id'/>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import Holding3DiaEdit from './holding3_DiaEdit.vue'
 import htmlToPdf from '@/utils/htmlToPdf'
 import htmlToPdf from '@/utils/htmlToPdf'
 import { getTreeList } from '@/apis/statistics0'
 import { getTreeList } from '@/apis/statistics0'
 import { getFileList } from '@/apis/holding'
 import { getFileList } from '@/apis/holding'
@@ -240,10 +244,11 @@ import TabList from '@/components/tabLeft.vue'
 export default {
 export default {
   name: 'Holding3_look',
   name: 'Holding3_look',
   // import引入的组件需要注入到对象中才能使用
   // import引入的组件需要注入到对象中才能使用
-  components: { TabList },
+  components: { TabList, Holding3DiaEdit },
   data () {
   data () {
     // 这里存放数据
     // 这里存放数据
     return {
     return {
+      isShowED: false,
       rukuTxt: '',
       rukuTxt: '',
       isShow: false,
       isShow: false,
       options: [],
       options: [],
@@ -272,6 +277,12 @@ export default {
   },
   },
   // 方法集合
   // 方法集合
   methods: {
   methods: {
+    // 点击申请编辑
+    begEdit () {
+      this.$refs.myDia.detailsById(this.myObj.id)
+      this.$refs.myDia.getFileList(this.myObj.id, 'video')
+      this.isShowED = true
+    },
     // 点击导出
     // 点击导出
     exPdf () {
     exPdf () {
       this.isShow = true
       this.isShow = true
@@ -308,6 +319,8 @@ export default {
     this.options = res1.data
     this.options = res1.data
     // 拿到路由跳转传过来的数据
     // 拿到路由跳转传过来的数据
     this.myObj = this.$route.query
     this.myObj = this.$route.query
+    this.myObj.id = Number(this.myObj.id)
+    this.myObj.registerId = Number(this.myObj.registerId)
     if (this.myObj.storageId) {
     if (this.myObj.storageId) {
       this.myObj.location = this.myObj.storageId.split(',')
       this.myObj.location = this.myObj.storageId.split(',')
       this.myObj.location = this.myObj.location.map(Number)
       this.myObj.location = this.myObj.location.map(Number)

+ 4 - 4
src/views/holding/holding4.vue

@@ -49,13 +49,13 @@
               border
               border
               style="width: 100%"
               style="width: 100%"
             >
             >
-              <el-table-column prop="" label="藏品名称" >
+              <el-table-column prop="name" label="藏品名称" >
               </el-table-column>
               </el-table-column>
-              <el-table-column prop="" label="总登记号" width="280">
+              <el-table-column prop="num" label="总登记号" width="280">
               </el-table-column>
               </el-table-column>
               <el-table-column prop="realName" label="编辑登记人" width="200">
               <el-table-column prop="realName" label="编辑登记人" width="200">
               </el-table-column>
               </el-table-column>
-              <el-table-column prop="createTime" label="编辑日期" width="200">
+              <el-table-column prop="updateTime" label="编辑日期" width="200">
               </el-table-column>
               </el-table-column>
               <el-table-column prop="status" label="状态" width="230">
               <el-table-column prop="status" label="状态" width="230">
               </el-table-column>
               </el-table-column>
@@ -86,7 +86,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getList, delData } from '@/apis/holding1'
+import { getList, delData } from '@/apis/holding4'
 import TabList from '@/components/tabLeft.vue'
 import TabList from '@/components/tabLeft.vue'
 export default {
 export default {
   name: 'Holding4',
   name: 'Holding4',

+ 110 - 17
src/views/holding/holding4_audit.vue

@@ -13,10 +13,10 @@
       </div>
       </div>
       <div class="conten">
       <div class="conten">
         <div class="con_top">
         <div class="con_top">
-          <div><span>藏品名称:</span>666</div>
-          <div><span>总登记号:</span>666</div>
-          <div><span>编辑登记人:</span>666</div>
-          <div><span>编辑时间:</span>666</div>
+          <div><span>藏品名称:</span>{{myObj.name}}</div>
+          <div><span>总登记号:</span>{{myObj.num}}</div>
+          <div><span>编辑登记人:</span>{{myObj.realName}}</div>
+          <div><span>编辑时间:</span>{{myObj.updateTime}}</div>
         </div>
         </div>
         <div class="con_edit">
         <div class="con_edit">
           <div class="title">修改记录
           <div class="title">修改记录
@@ -74,6 +74,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import { getDetailById } from '@/apis/holding4'
 import TabList from '@/components/tabLeft.vue'
 import TabList from '@/components/tabLeft.vue'
 export default {
 export default {
   name: 'holding4_audit',
   name: 'holding4_audit',
@@ -82,19 +83,36 @@ export default {
   data () {
   data () {
     // 这里存放数据
     // 这里存放数据
     return {
     return {
+      myObj: {},
+      // 字典
+      dictionaries: {
+        age: '年代',
+        amount: '具体数量',
+        amountType: '数量类型',
+        checkInScope: '入藏时间范围',
+        checkInYear: '入藏年度',
+        goodsTypeId: '文物类别',
+        height: '通高',
+        integrity: '完残程度',
+        length: '通长',
+        level: '文物级别',
+        name: '藏品名称',
+        num: '藏品编号',
+        numTypeId: '编号类型',
+        primitiveName: '原名',
+        quality: '具体质量',
+        qualityScope: '质量范围',
+        registerNum: '总登记号',
+        repair: '保存状态',
+        repairRemark: '完残状况',
+        texture: '质地',
+        textureCategory: '质地类别',
+        textureType: '文物质地',
+        thumb: '藏品图片',
+        width: '通宽'
+      },
       editData: [
       editData: [
-        { name: '完残程度', qian: '基本完整', hou: '部分残缺' },
-        { name: '完残程度2', qian: '基本完整2', hou: '部分残缺2' },
-        { name: '完残程度', qian: '基本完整', hou: '部分残缺' },
-        { name: '完残程度2', qian: '基本完整2', hou: '部分残缺2' },
-        { name: '完残程度', qian: '基本完整', hou: '部分残缺' },
-        { name: '完残程度2', qian: '基本完整2', hou: '部分残缺2' },
-        { name: '完残程度', qian: '基本完整', hou: '部分残缺' },
-        { name: '完残程度2', qian: '基本完整2', hou: '部分残缺2' },
-        { name: '完残程度', qian: '基本完整', hou: '部分残缺' },
-        { name: '完残程度2', qian: '基本完整2', hou: '部分残缺2' },
-        { name: '完残程度', qian: '基本完整', hou: '部分残缺' },
-        { name: '完残程度2', qian: '基本完整2', hou: '部分残缺2' }
+        // { name: '完残程度', qian: '基本完整', hou: '部分残缺' }
       ],
       ],
       fromData: {
       fromData: {
         textarea: '',
         textarea: '',
@@ -127,7 +145,82 @@ export default {
     }
     }
   },
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {},
+  async created () {
+    this.myObj = this.$route.query
+    // 获取上个页面传递的数据
+    const res = await getDetailById(this.myObj.id)
+    const oldObj = res.data.goods
+    if (oldObj.amountType === 0) oldObj.amountType = '单件'
+    else if (oldObj.amountType === 1) oldObj.amountType = '一套多件'
+    if (oldObj.textureType === 0) oldObj.textureType = '单一质地'
+    else if (oldObj.textureType === 1) oldObj.textureType = '复合质地'
+    oldObj.goodsTypeId = this.category(oldObj.goodsTypeId)
+    oldObj.integrity = this.spoil(oldObj.integrity)
+    oldObj.level = this.myWwjb(oldObj.level)
+    oldObj.numTypeId = this.mycategory(oldObj.numTypeId)
+    oldObj.repair = this.mySave(oldObj.repair)
+    if (oldObj.thumb) {
+      const temp = oldObj.thumb.split('/')
+      oldObj.thumb = temp[temp.length - 1]
+    }
+    const newObj = res.data.backupGoods
+    if (newObj.amountType === 0) newObj.amountType = '单件'
+    else if (newObj.amountType === 1) newObj.amountType = '一套多件'
+    if (newObj.textureType === 0) newObj.textureType = '单一质地'
+    else if (newObj.textureType === 1) newObj.textureType = '复合质地'
+    newObj.goodsTypeId = this.category(newObj.goodsTypeId)
+    newObj.integrity = this.spoil(newObj.integrity)
+    newObj.level = this.myWwjb(newObj.level)
+    newObj.numTypeId = this.mycategory(newObj.numTypeId)
+    newObj.repair = this.mySave(newObj.repair)
+    if (newObj.thumb) {
+      const temp = newObj.thumb.split('/')
+      newObj.thumb = temp[temp.length - 1]
+    }
+    for (const k in oldObj) {
+      if (oldObj[k] !== newObj[k] && this.dictionaries[k]) {
+        this.editData.push({ name: this.dictionaries[k], qian: oldObj[k], hou: newObj[k] })
+      }
+    }
+    // 对比附件
+    const oldFujian = res.data.goodsFile
+    const newFujian = res.data.backupGoodsFile
+    if (oldFujian.length >= newFujian.length) {
+      let temp = ''
+      let temp2 = ''
+      oldFujian.forEach((v, i) => {
+        temp += v.name + ' / '
+        if (i <= newFujian.length - 1) temp2 += newFujian[i].name + ' / '
+      })
+      this.editData.push({ name: '附件', qian: temp, hou: temp2 })
+    } else {
+      let temp3 = ''
+      let temp4 = ''
+      newFujian.forEach((v2, i2) => {
+        temp3 += v2.name + ' / '
+        if (i2 <= oldFujian.length - 1) temp4 += oldFujian[i2].name + ' / '
+      })
+      this.editData.push({ name: '附件', qian: temp3, hou: temp4 })
+    }
+    // newFujian.forEach((v, i) => {
+    //   if (v.type === 'video') v.type2 = '视频文件'
+    //   if (v.type === 'img') v.type2 = '高清图片'
+    //   if (v.type === 'audio') v.type2 = '音频文件'
+    //   if (v.type === 'model') v.type2 = '三维模型'
+    //   if (v.type === 'doc') v.type2 = '文档资料'
+    //   if (oldFujian.length === 0) {
+    //     this.editData.push({ name: v.type2, qian: '', hou: v.name })
+    //   } else {
+    //     oldFujian.forEach(v2 => {
+    //       if (v.id !== v2.id && v.type === v2.type) {
+    //         this.editData.push({ name: v.type2, qian: v2.name, hou: v2.name + ' , ' + v.name })
+    //       }
+    //     })
+    //   }
+    // })
+    console.log(999, oldFujian, newFujian)
+    // this.editData
+  },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {},
   mounted () {},
   beforeCreate () {}, // 生命周期 - 创建之前
   beforeCreate () {}, // 生命周期 - 创建之前