shaogen1995 3 лет назад
Родитель
Сommit
44ac94539d

+ 2 - 2
src/utils/request.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
 // export const baseURL = '666初始地址'
 const service = axios.create({
-  // baseURL: 'http://192.168.0.135:8006', // 本地调试
-  baseURL: 'http://8.135.106.227:8006', // 线上调试
+  baseURL: 'http://192.168.0.135:8006', // 本地调试
+  // baseURL: 'http://8.135.106.227:8006', // 线上调试
   // baseURL: '', // build
   timeout: 5000
 })

+ 1 - 1
src/views/collect/collect0_DiaEdit.vue

@@ -485,7 +485,7 @@ export default {
       this.tempData.model = (await getFileList(myId, 'model')).data
       this.tempData.doc = (await getFileList(myId, 'doc')).data
       // console.log(6666, res)
-      this.tableData = this.tempData.video
+      this.tableData = this.tempData.img
       this.tableData.forEach((v, i) => {
         v.updateTime = v.updateTime.slice(0, 10)
       })

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

@@ -507,7 +507,7 @@ export default {
       this.tempData.audio = (await getFileList(myId, 'audio')).data
       this.tempData.model = (await getFileList(myId, 'model')).data
       this.tempData.doc = (await getFileList(myId, 'doc')).data
-      this.tableData = this.tempData.video
+      this.tableData = this.tempData.img
       this.tableData.forEach(v => {
         v.updateTime = v.updateTime.slice(0, 10)
       })

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

@@ -508,7 +508,7 @@ export default {
         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)
+        console.log(9999, this.tempData)
       }
     },
     handleRemove (file, fileList) {

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

@@ -104,7 +104,7 @@
       </div>
     </div>
     <!-- 点击添加出现弹窗 -->
-    <Holding0Dialog :dialogFormVisible.sync='isShow' @updateUI='getHoldingList(mydata.id)' :registerId='mydata.id' :fujianId='fujianId' :dirCode='Date.now()'/>
+    <Holding0Dialog :dialogFormVisible.sync='isShow' @updateUI='getHoldingList(mydata.id)' :registerId='mydata.id' :fujianId='fujianId' :dirCode='Date.now()' :key="Date.now()"/>
     <!-- 点击编辑出现弹窗 -->
     <Holding0DiaEdit :dialogFormVisible.sync='isShowED' ref="myDia" @updateUI='getHoldingList(mydata.id)' :registerId='mydata.id' :fujianId='fujianId'/>
   </div>

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

@@ -307,6 +307,12 @@ export default {
         v.integrity = this.spoil(v.integrity)
         v.goodsTypeId = this.category(v.goodsTypeId)
         // 找到第三层的id回显
+
+        v.storageId = ''
+        v.storageId = v.storageLevel1 + ''
+        if (v.storageLevel2) v.storageId += ',' + v.storageLevel2
+        if (v.storageLevel3) v.storageId += ',' + v.storageLevel3
+
         this.location[v.id] = v.storageId
         v.location = v.storageId.split(',')
         v.location = v.location.map(Number)

+ 6 - 0
src/views/holding/holding1_audit.vue

@@ -223,6 +223,12 @@ export default {
     this.tableData.forEach(v => {
       v.integrity = this.spoil(v.integrity)
       v.goodsTypeId = this.category(v.goodsTypeId)
+
+      v.storageId = ''
+      v.storageId = v.storageLevel1 + ''
+      if (v.storageLevel2) v.storageId += ',' + v.storageLevel2
+      if (v.storageLevel3) v.storageId += ',' + v.storageLevel3
+
       v.location = v.storageId.split(',')
       v.location = v.location.map(Number)
     })

+ 6 - 0
src/views/holding/holding1_look.vue

@@ -185,6 +185,12 @@ export default {
       v.integrity = this.spoil(v.integrity)
       v.goodsTypeId = this.category(v.goodsTypeId)
       v.status = this.myStatus(v.status)
+
+      v.storageId = ''
+      v.storageId = v.storageLevel1 + ''
+      if (v.storageLevel2) v.storageId += ',' + v.storageLevel2
+      if (v.storageLevel3) v.storageId += ',' + v.storageLevel3
+
       v.location = v.storageId.split(',')
       v.location = v.location.map(Number)
     })

+ 21 - 3
src/views/holding/holding3.vue

@@ -221,7 +221,7 @@ export default {
       // 藏品来源多选数据
       sourceList: [],
       options: [],
-      optionsArr: [],
+      optionsArr: '',
 
       // 入库位置数据
       // 导出表格的数据
@@ -275,7 +275,9 @@ export default {
         pageNum: 1, // 起始页码,默认1为第一页
         pageSize: 10, // 每页数量
         searchKey: '', // 搜索条件
-        sourceId: ''
+        sourceId: '',
+        storageLevel: null, // 库房级别; 1:第一级, 2:第二级,3:第三级
+        storageId: null// 库房id
       },
       // 控制显示表格还是图片
       change: 0,
@@ -301,6 +303,11 @@ export default {
       })
       this.json_data = res.data.list
       this.json_data.forEach((v) => {
+        v.storageId = ''
+        v.storageId = v.storageLevel1 + ''
+        if (v.storageLevel2) v.storageId += ',' + v.storageLevel2
+        if (v.storageLevel3) v.storageId += ',' + v.storageLevel3
+
         // 位置信息处理
         this.options.forEach((p) => {
           // eslint-disable-next-line
@@ -360,12 +367,23 @@ export default {
     },
     // 封装获取藏品总账列表
     async getHolding3List (data) {
-      const res = await getHolding3List(data)
+      let length
+      let temp
+      if (this.optionsArr.length > 0) {
+        length = this.optionsArr.length
+        temp = this.optionsArr[length - 1]
+      } else length = temp = null
+      const res = await getHolding3List({ ...data, storageLevel: length, storageId: temp })
       this.total = res.data.total
       // console.log(666, res)
       this.imgList = res.data.list
       this.tableData = res.data.list
       this.tableData.forEach((v) => {
+        v.storageId = ''
+        v.storageId = v.storageLevel1 + ''
+        if (v.storageLevel2) v.storageId += ',' + v.storageLevel2
+        if (v.storageLevel3) v.storageId += ',' + v.storageLevel3
+
         // 位置信息处理
         // this.options.forEach(p => {
         // // eslint-disable-next-line

+ 9 - 7
src/views/holding/holding3_DiaEdit.vue

@@ -508,7 +508,7 @@ export default {
       this.tempData.model = (await getFileList(myId, 'model')).data
       this.tempData.doc = (await getFileList(myId, 'doc')).data
       // console.log(6666, res)
-      this.tableData = this.tempData.video
+      this.tableData = this.tempData.img
       this.tableData.forEach((v, i) => {
         v.updateTime = v.updateTime.slice(0, 10)
       })
@@ -602,12 +602,14 @@ export default {
 
           // 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')
+          const res = await getHolding3Edit(this.ruleForm)
+          if (res.code === 0) {
+            // console.log(6666, res)
+            this.$message.success('申请成功')
+            this.cancel()
+            // 通知父组件更新界面
+            this.$emit('updateUI', this.fujianId)
+          }
         }).catch(() => {
           this.$message({
             type: 'info',

+ 48 - 3
src/views/holding/holding4.vue

@@ -107,6 +107,13 @@
                     >馆长审核</el-button
                   >
                   <el-button
+                    @click="begEdit(row)"
+                    type="text"
+                    v-show="userLimits.anewOK"
+                    v-if="row.status === '主任不通过'||row.status === '馆长不通过'"
+                    >重新提交</el-button
+                  >
+                  <el-button
                     type="text"
                     @click="delData(row.id, row.status)"
                     v-if="row.status !== '已完成'"
@@ -132,21 +139,32 @@
         </div>
       </div>
     </div>
+        <!-- 点击重新提交出现弹窗 -->
+    <Holding3DiaEdit
+      @updateUI='updateUI'
+      :dialogFormVisible.sync="isShowED"
+      ref="myDia"
+      :registerId="registerId"
+      :fujianId="fujianId"
+    />
   </div>
 </template>
 
 <script>
+import Holding3DiaEdit from './holding3_DiaEdit.vue'
 import { getList, delData } from '@/apis/holding4'
 import TabList from '@/components/tabLeft.vue'
 export default {
   name: 'Holding4',
-  components: { TabList },
+  components: { TabList, Holding3DiaEdit },
   data () {
     return {
       userLimits: {
         del: false,
         audit: false,
-        auditTow: false
+        auditTow: false,
+        // 重新提交
+        anewOK: false
       }, // 用户权限数据
       total: 0,
       myData: {
@@ -169,8 +187,15 @@ export default {
       ],
       type: '',
       time: '',
+      isShowED: false,
       // 表格数据
-      tableData: []
+      tableData: [],
+      // 重新提交的数据
+      registerId: 1,
+      fujianId: 1,
+      // 点击的藏品id
+      myIdAnew: ''
+
     }
   },
   // 监听属性 类似于data概念
@@ -184,6 +209,24 @@ export default {
   },
   // 方法集合
   methods: {
+    // 点了确定
+    async updateUI () {
+      this.stateArr[1].num++
+      await delData(this.myIdAnew)
+      // 发请求刷新页面
+      this.getList(this.myData)
+      this.stateArr[3].num--
+    },
+    // 点击重新提交
+    begEdit (val) {
+      this.fujianId = val.goodsId
+      this.registerId = val.registerId
+      this.$refs.myDia.detailsById(val.goodsId)
+      this.$refs.myDia.getFileList(val.goodsId, 'img')
+      this.isShowED = true
+      // 把藏品id存起来
+      this.myIdAnew = val.id
+    },
     // 点击查询
     inquire () {
       this.myData.pageNum = 1
@@ -353,6 +396,8 @@ export default {
     // 获取角色权限树
     let temp2 = localStorage.getItem('daliCK_limits')
     temp2 = JSON.parse(temp2)
+    // 重新提交的权限和藏品的编辑权限一样
+    this.userLimits.anewOK = temp2[1].children[0].authority
     this.userLimits.del = temp2[4].children[0].authority
     this.userLimits.audit = temp2[4].children[1].authority
     this.userLimits.auditTow = temp2[4].children[2].authority

+ 124 - 8
src/views/statistics/statistics2.vue

@@ -94,7 +94,9 @@
                   <el-button
                     type="text"
                     @click="myLook(row)"
-                    v-if="row.status !== '主任审核中'&&row.status !== '馆长审核中'"
+                    v-if="
+                      row.status !== '主任审核中' && row.status !== '馆长审核中'
+                    "
                     >查看</el-button
                   >
                   <el-button
@@ -113,6 +115,15 @@
                   >
                   <el-button
                     type="text"
+                    @click="applyMoveFn(row)"
+                    v-if="
+                      row.status === '主任不通过' || row.status === '馆长不通过'
+                    "
+                    v-show="userLimits.anewOK"
+                    >重新提交</el-button
+                  >
+                  <el-button
+                    type="text"
                     @click="delData(row.id, row.status)"
                     v-if="row.status !== '已完成'"
                     v-show="userLimits.del"
@@ -137,10 +148,41 @@
         </div>
       </div>
     </div>
+    <!-- 点击申请移库出现的弹窗 -->
+    <el-dialog title="申请移库" :visible.sync="moveDialog" class="myMove">
+      <div class="block">
+        <div class="block_box">
+          <span>入库位置:</span>
+          <!-- 级联选择 -->
+          <el-cascader
+            style="width: 500px"
+            disabled
+            :props="{ value: 'id', label: 'name' }"
+            v-model="valueOne"
+            :options="options"
+          ></el-cascader>
+        </div>
+        <div>
+          <span class="demonstration">移库位置:</span>
+          <el-cascader
+            style="width: 500px"
+            :props="{ value: 'id', label: 'name' }"
+            v-model="moveValue"
+            :options="options"
+            @change="handleChange"
+          ></el-cascader>
+        </div>
+      </div>
+      <div class="moveBtn">
+        <el-button type="primary" @click="moveOk">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import { getTreeList } from '@/apis/statistics0'
+import { applyMove } from '@/apis/holding3'
 import { getList, delData } from '@/apis/statistics2'
 import TabList from '@/components/tabLeft3.vue'
 export default {
@@ -151,7 +193,9 @@ export default {
       userLimits: {
         del: false,
         audit: false,
-        auditTow: false
+        auditTow: false,
+        // 重新提交
+        anewOK: false
       }, // 用户权限数据
       total: 0,
       myData: {
@@ -175,7 +219,15 @@ export default {
       type: '',
       time: '',
       // 表格数据
-      tableData: []
+      tableData: [],
+      // 重新提交
+      moveDialog: false,
+      tempIds: '',
+      moveValue: null,
+      options: [],
+      valueOne: '',
+      // 点击的藏品id
+      myIdAnew: ''
     }
   },
   // 监听属性 类似于data概念
@@ -189,6 +241,48 @@ export default {
   },
   // 方法集合
   methods: {
+    // 点击重新提交
+    async moveOk () {
+      if (this.tempIds === '') {
+        return this.$message.warning('还未选择移库位置!')
+      }
+      if (this.myObj.storageId === this.tempIds) {
+        console.log(this.myObj.storageId, this.tempIds)
+        return this.$message.warning('不能与之前入库位置相同!')
+      }
+      const res = await applyMove(this.myObj.goodsId, this.tempIds)
+      if (res.code === 0) {
+        this.moveDialog = false
+        this.$message.success('申请成功')
+        // 更新页面
+        this.stateArr[1].num++
+        // 发请求删除
+        await delData(this.myIdAnew)
+        // 发请求刷新页面
+        this.getList(this.myData)
+        this.stateArr[3].num--
+      } else this.$message.error(res.msg)
+      // console.log(999, res)
+    },
+    handleChange (val) {
+      this.tempIds = val.join(',')
+    },
+    applyMoveFn (row) {
+      this.myObj = row
+      const temp = row.storageId.split(',')
+      this.valueOne = []
+      temp.forEach((v) => {
+        if (v !== '') this.valueOne.push(Number(v))
+      })
+      // console.log(998, this.valueOne)
+      // console.log(this.$refs.cascaderAddr)
+      // const thsAreaCode = this.$refs.cascaderAddr.getCheckedNodes()
+      // const txt = thsAreaCode[0].pathLabels.join('/')
+      // this.rukuTxt = txt
+      this.moveDialog = true
+      // 把点击的藏品id存起来
+      this.myIdAnew = row.id
+    },
     // 点击查询
     inquire () {
       this.myData.pageNum = 1
@@ -267,9 +361,13 @@ export default {
           // 发请求刷新页面
           this.getList(this.myData)
           // 更新顶部数据
-          if (status === '馆长审核中' || status === '主任审核中') this.stateArr[1].num--
+          if (status === '馆长审核中' || status === '主任审核中') {
+            this.stateArr[1].num--
+          }
           if (status === '已完成') this.stateArr[2].num--
-          if (status === '主任不通过' || status === '馆长不通过') this.stateArr[3].num--
+          if (status === '主任不通过' || status === '馆长不通过') {
+            this.stateArr[3].num--
+          }
           this.stateArr[0].num--
           this.$message({
             type: 'success',
@@ -311,7 +409,9 @@ export default {
         date.push(this.gettime(e[i]))
       }
       this.myData.startTime = date[0]
-      if (date[1]) { this.myData.endTime = date[1].replace('00:00:00', '23:59:59') }
+      if (date[1]) {
+        this.myData.endTime = date[1].replace('00:00:00', '23:59:59')
+      }
     },
     gettime (data) {
       const value =
@@ -336,7 +436,10 @@ export default {
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {
+  async created () {
+    // 获取位置信息
+    const res1 = await getTreeList()
+    this.options = res1.data
     this.getList(this.myData)
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
@@ -358,6 +461,8 @@ export default {
     // 获取角色权限树
     let temp2 = localStorage.getItem('daliCK_limits')
     temp2 = JSON.parse(temp2)
+    // 重新提交的权限和藏品的编辑权限一样
+    this.userLimits.anewOK = temp2[1].children[1].authority
     this.userLimits.del = temp2[7].children[0].authority
     this.userLimits.audit = temp2[7].children[1].authority
     this.userLimits.auditTow = temp2[7].children[2].authority
@@ -377,7 +482,18 @@ export default {
   /deep/#mytitle > span {
     font-weight: 800;
   }
-
+.block {
+  & > div {
+    margin: 0px 100px 0;
+    &:nth-of-type(1) {
+      margin-bottom: 15px;
+    }
+  }
+  .block_box{
+    display: flex;
+    align-items: center;
+  }
+}
   display: flex;
   .right {
     width: 100%;

+ 6 - 2
src/views/statistics/statistics2_audit.vue

@@ -218,8 +218,12 @@ export default {
     // 获取上个页面传递的数据
     // 通过id获取详情
     const res = await getDetailById(this.myObj.id)
-    this.oldLocation = res.data.storageId.split(',')
-    this.oldLocation = this.oldLocation.map(Number)
+
+    const temp = res.data.storageId.split(',')
+    this.oldLocation = []
+    temp.forEach(v => {
+      if (v !== '') this.oldLocation.push(Number(v))
+    })
     this.newLocation = res.data.updateStorageId.split(',')
     this.newLocation = this.newLocation.map(Number)
 

+ 6 - 2
src/views/statistics/statistics2_look.vue

@@ -165,8 +165,12 @@ export default {
 
     // 获取上个页面传递的数据
     const res = await getDetailById(this.myObj.id)
-    this.oldLocation = res.data.storageId.split(',')
-    this.oldLocation = this.oldLocation.map(Number)
+
+    const temp = res.data.storageId.split(',')
+    this.oldLocation = []
+    temp.forEach(v => {
+      if (v !== '') this.oldLocation.push(Number(v))
+    })
     this.newLocation = res.data.updateStorageId.split(',')
     this.newLocation = this.newLocation.map(Number)
   },