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

+ 6 - 0
src/router/index.js

@@ -142,6 +142,12 @@ const router = new VueRouter({
           component: () => import('@/views/holding/holding5_add.vue')
         },
         {
+          name: 'holding5_audit',
+          path: 'holding5_audit',
+          meta: { myInd: 1 },
+          component: () => import('@/views/holding/holding5_audit.vue')
+        },
+        {
           name: 'holding0_DiaEdit',
           path: 'holding0_DiaEdit',
           meta: { myInd: 1 },

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

@@ -257,10 +257,10 @@ export default {
     async submit () {
       if (this.fromData.textarea.trim() === '') return this.$message.warning('入库说明不能为空')
       const obj = { description: this.fromData.textarea, goodsIds: this.goodsIds.join(','), id: this.mydata.id, status: 1, location: this.location }
-      console.log(999, obj)
-      // await holding1submit(obj)
-      // this.$message.success('提交成功')
-      // this.$router.push('/layout/holding1')
+      // console.log(999, obj)
+      await holding1submit(obj)
+      this.$message.success('提交成功')
+      this.$router.push('/layout/holding1')
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)

+ 4 - 5
src/views/holding/holding2_audit.vue

@@ -15,20 +15,19 @@
         <div class="info">
           <div>
             <h4>出库编号:</h4>
-            <b>DJ</b>
-            <span>2021081701</span>
+            <span>{{myData.num}}</span>
           </div>
           <div>
             <h4>登记人员:</h4>
-            <span>Admin</span>
+            <span>{{myData.realName}}</span>
           </div>
           <div>
             <h4>出库类型:</h4>
-            <span>其他</span>
+            <span>{{myData.type}}</span>
           </div>
           <div>
             <h4>出库说明:</h4>
-            <span>考古发掘</span>
+            <span>{{myData.description}}</span>
           </div>
         </div>
         <!-- 表格 -->

+ 16 - 2
src/views/holding/holding5.vue

@@ -57,8 +57,8 @@
               <el-table-column label="操作" width="200">
                 <template #default='{row}'>
                   <el-button type="text" v-if="row.status==='已完成'||row.status==='审核不通过'">查看</el-button>
-                  <el-button type="text" v-if="row.status==='待审核'">审核</el-button>
-                  <el-button type="text" v-if="row.status==='待办理'">编辑</el-button>
+                  <el-button type="text" v-if="row.status==='待审核'" @click="audit(row)">审核</el-button>
+                  <el-button type="text" v-if="row.status==='待办理'" @click="compile(row)">编辑</el-button>
                   <el-button type="text" v-if="row.status!=='已完成'" @click="delOne(row.id)">删除</el-button>
                 </template>
               </el-table-column>
@@ -125,6 +125,20 @@ export default {
   },
   // 方法集合
   methods: {
+    // 点击审核
+    audit (val) {
+      this.$router.push({
+        path: '/layout/holding5_audit',
+        query: val
+      })
+    },
+    // 点击编辑
+    compile (val) {
+      this.$router.push({
+        path: '/layout/holding5_add',
+        query: val
+      })
+    },
     // 点击删除
     delOne (id) {
       this.$confirm('确定删除吗?', '提示', {

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

@@ -54,7 +54,7 @@
 import axios from '@/utils/request'
 import { getListTow } from '@/apis/holding5'
 export default {
-  name: 'Holding0_Dialog',
+  name: 'Holding5_Dialog',
   components: {},
   props: {
     dialogFormVisible: {

+ 2 - 3
src/views/holding/holding5_add.vue

@@ -8,7 +8,7 @@
           <!-- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> -->
           <el-breadcrumb-item to="">首页</el-breadcrumb-item>
           <el-breadcrumb-item to="">馆藏管理</el-breadcrumb-item>
-          <el-breadcrumb-item>出库管理</el-breadcrumb-item>
+          <el-breadcrumb-item>藏品注销</el-breadcrumb-item>
           <el-breadcrumb-item id="mytitle">{{mydata.description?'编辑':'新增'}}</el-breadcrumb-item>
         </el-breadcrumb>
       </div>
@@ -70,10 +70,9 @@
               </el-table-column>
               <el-table-column prop="age" label="藏品年代" width="180">
               </el-table-column>
-              <el-table-column label="操作" width="230">
+              <el-table-column label="操作" width="120">
                 <template #default>
                   <el-button type="text">查看</el-button>
-                  <el-button type="text">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>

+ 259 - 0
src/views/holding/holding5_audit.vue

@@ -0,0 +1,259 @@
+<!--  -->
+<template>
+  <div class="holding2_audit">
+    <TabList :ind='5'/>
+    <div class="right">
+      <div class="top">
+        <el-breadcrumb separator="/">
+          <el-breadcrumb-item to="">首页</el-breadcrumb-item>
+          <el-breadcrumb-item to="">馆藏管理</el-breadcrumb-item>
+          <el-breadcrumb-item>藏品注销</el-breadcrumb-item>
+          <el-breadcrumb-item id="mytitle">审核</el-breadcrumb-item>
+        </el-breadcrumb>
+      </div>
+      <div class="conten">
+        <div class="info">
+          <div>
+            <h4>注销编号:</h4>
+            <span>{{myData.num}}</span>
+          </div>
+          <div>
+            <h4>登记人员:</h4>
+            <span>{{myData.realName}}</span>
+          </div>
+          <div style="width:100%">
+            <h4>注销说明:</h4>
+            <span>{{myData.description}}</span>
+          </div>
+        </div>
+        <!-- 表格 -->
+        <div class="table">
+          <div class="title">
+            <h3>藏品信息</h3>
+          </div>
+          <el-table
+            :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
+            :data="tableData"
+            border
+            style="width: 100%"
+          >
+            <el-table-column label="缩略图" width="160">
+              <template #default='{row}'>
+                <div class="smimg">
+                  <img :src="baseURL+row.thumb" alt="" />
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="registerNum" label="总登记号" width="235">
+            </el-table-column>
+            <el-table-column prop="name" label="藏品名称"> </el-table-column>
+            <el-table-column prop="goodsTypeId" label="类别" width="180">
+            </el-table-column>
+            <el-table-column prop="integrity" label="完残程度" width="180">
+            </el-table-column>
+            <el-table-column prop="age" label="藏品年代" width="180">
+            </el-table-column>
+            <el-table-column prop="age" label="操作" width="120">
+                <template #default='{row}'>
+                  <el-button type="text" @click="look(row)">查 看</el-button>
+                </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="txt">
+          <el-form
+            :model="fromData"
+            :rules="rules"
+            ref="fromData"
+            label-width="100px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="审核结果:" prop="result">
+              <el-select v-model="fromData.result" placeholder="请选择">
+                <el-option label="通过" :value="3"></el-option>
+                <el-option label="不通过" :value="2"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              label="审核说明:"
+              prop="textarea"
+            >
+              <el-input
+                type="textarea"
+                :rows="3"
+                v-model="fromData.textarea"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <!-- 最下面的按钮 -->
+        <div class="button">
+          <el-button type="primary" @click="submit">提交</el-button>
+          <el-button @click="$router.go(-1)">返回</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getDetailById, holding1Audit } from '@/apis/holding5'
+import axios from '@/utils/request'
+import TabList from '@/components/tabLeft.vue'
+export default {
+  name: 'holding5_audit',
+  // import引入的组件需要注入到对象中才能使用
+  components: { TabList },
+  data () {
+    // 这里存放数据
+    return {
+      // 服务器前缀地址
+      baseURL: '',
+      myData: {},
+      fromData: {
+        textarea: '',
+        result: 3
+      },
+      rules: {
+        textarea: [
+          { required: true, message: '不能为空', trigger: 'blur' },
+          { max: 255, message: '不能超过255个字符', trigger: 'blur' }
+        ],
+        result: [
+          { required: true, message: '请选择活动区域', trigger: 'change' }
+        ]
+      },
+      auditResult: '',
+      // 表格数据
+      tableData: []
+    }
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+  // 方法集合
+  methods: {
+    // 点击查看
+    look (val) {
+
+    },
+    // 点击提交
+    async submit () {
+      try {
+        await this.$refs.fromData.validate()
+        const obj = { id: this.myData.id, reason: this.fromData.textarea, status: this.fromData.result }
+        const res = await holding1Audit(obj)
+        if (res.code === 0) {
+          this.$message.success('审核成功')
+          this.$router.push('/layout/holding5')
+        } else this.$message.warning(res.msg)
+      } catch (error) {
+        console.log(error)
+      }
+    }
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  async created () {
+    // 获取服务器前缀地址
+    this.baseURL = axios.defaults.baseURL
+    // 拿到路由传递过来的参数
+    this.myData = this.$route.query
+    this.myData.id = Number(this.myData.id)
+    // 通过id获取列表详情
+    const res = await getDetailById(this.myData.id)
+    this.tableData = res.data.goods
+    this.tableData.forEach(v => {
+      v.integrity = this.spoil(v.integrity)
+      v.goodsTypeId = this.category(v.goodsTypeId)
+    })
+  },
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted () {},
+  beforeCreate () {}, // 生命周期 - 创建之前
+  beforeMount () {}, // 生命周期 - 挂载之前
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
+</script>
+<style lang='less' scoped>
+//@import url(); 引入公共css类
+.holding2_audit {
+  /deep/#mytitle > span {
+    font-weight: 800;
+  }
+
+  display: flex;
+  .right {
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    .top {
+      padding-left: 35px;
+      display: flex;
+      align-items: center;
+      box-shadow: 1px 1px 10px 1px;
+      margin-left: 2px;
+      height: 40px;
+      background-color: #fff;
+    }
+  }
+  .conten {
+    position: relative;
+    flex: 1;
+    background-color: #fff;
+    margin: 20px 20px 40px;
+    padding: 35px;
+    .info {
+      display: flex;
+      flex-wrap: wrap;
+      & > div {
+        padding-left: 20px;
+        color: black;
+        height: 50px;
+        display: flex;
+        align-items: center;
+        border: 1px solid #ccc;
+        width: 50%;
+      }
+    }
+    .table {
+      max-height: 288px;
+      overflow: auto;
+      .smimg {
+        border: 3px solid #ccc;
+        height: 68px;
+        img {
+          width: 100%;
+          height: 100%;
+        }
+      }
+      margin-top: 38px;
+      border: 1px solid #ccc;
+      .title {
+        padding-left: 30px;
+        color: black;
+        height: 50px;
+        line-height: 50px;
+      }
+    }
+    .txt {
+      margin-top: 38px;
+    }
+    .button {
+      position: absolute;
+      left: 50%;
+      bottom: 20px;
+      transform: translateX(-50%);
+      width: 240px;
+      display: flex;
+      justify-content: space-between;
+    }
+  }
+}
+</style>