|
@@ -1,7 +1,7 @@
|
|
|
<!--草稿箱-->
|
|
|
<template>
|
|
|
<div class="draftPage">
|
|
|
- <div class="draftPage-min">
|
|
|
+ <div class="draftPage-min" v-if="pageType == 1">
|
|
|
<el-form :model="queryParamsData" class="form-box" ref="queryForm" :inline="true">
|
|
|
<el-form-item label="关键字" prop="searchValue">
|
|
|
<el-input
|
|
@@ -48,11 +48,11 @@
|
|
|
<div class="button-box">
|
|
|
<p class="table-min-button"
|
|
|
style="margin:0!important;"
|
|
|
- @click="goPageInfo(2,scope.row)"
|
|
|
+ @click="pageToggle(2,scope.row.id)"
|
|
|
>编辑</p>
|
|
|
<p class="table-min-button"
|
|
|
style="margin:0!important;"
|
|
|
- @click="goPageInfo(2,scope.row)"
|
|
|
+ @click="delHxpapply(scope.row.id)"
|
|
|
>删除</p>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -67,13 +67,18 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <edit-page :editPagePropsData="editPagePropsData" v-if="pageType == 2"></edit-page>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getHxpapplyMyDraftsList } from "@/api/studentApi/chemicalManagement/index";
|
|
|
+ import editPage from "./editPage.vue"
|
|
|
+ import { getHxpapplyDraftsList,delHxpapply,getHxpapply } from "@/api/studentApi/chemicalManagement/index";
|
|
|
export default {
|
|
|
name: "draftPage",
|
|
|
+ components: {
|
|
|
+ editPage
|
|
|
+ },
|
|
|
data(){
|
|
|
return{
|
|
|
// 遮罩层
|
|
@@ -96,6 +101,8 @@
|
|
|
total:0,
|
|
|
//数据数组
|
|
|
tableList:[],
|
|
|
+ //详情数据
|
|
|
+ editPagePropsData:{}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -105,6 +112,73 @@
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //编辑页面
|
|
|
+ pageToggle(type,id){
|
|
|
+ if(type == 1){
|
|
|
+ this.pageType = 1;
|
|
|
+ this.resetQuery();
|
|
|
+ }else if(type == 2){
|
|
|
+ this.getHxpapply(id);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询详情
|
|
|
+ getHxpapply(id){
|
|
|
+ getHxpapply(id).then(response => {
|
|
|
+ let maxObj = {
|
|
|
+ id:id,
|
|
|
+ subId:parseInt(response.data.subId),
|
|
|
+ applyReason:response.data.applyReason,
|
|
|
+ maxList:[],
|
|
|
+ }
|
|
|
+ for(let i=0;i<response.data.actHxpapplyDetailList.length;i++){
|
|
|
+ let num = 0;
|
|
|
+ for(let o=0;o<maxObj.maxList.length;o++){
|
|
|
+ if(maxObj.maxList[o].chemicalId == response.data.actHxpapplyDetailList[i].chemicalId){
|
|
|
+ num++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(num == 0){
|
|
|
+ let obj = {
|
|
|
+ chemicalId:parseInt(response.data.actHxpapplyDetailList[i].chemicalId),
|
|
|
+ chemicalName:response.data.actHxpapplyDetailList[i].chemicalName,
|
|
|
+ list:[],
|
|
|
+ }
|
|
|
+ maxObj.maxList.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let i=0;i<response.data.actHxpapplyDetailList.length;i++){
|
|
|
+ for(let o=0;o<maxObj.maxList.length;o++){
|
|
|
+ console.log('maxObj.maxList[o].chemicalId',maxObj.maxList[o].chemicalId)
|
|
|
+ console.log('response.data.actHxpapplyDetailList[i].chemicalId',response.data.actHxpapplyDetailList[i].chemicalId)
|
|
|
+ if(maxObj.maxList[o].chemicalId == response.data.actHxpapplyDetailList[i].chemicalId){
|
|
|
+ let minObj = {
|
|
|
+ cabinetId:parseInt(response.data.actHxpapplyDetailList[i].cabinetId),
|
|
|
+ applyNum:parseInt(response.data.actHxpapplyDetailList[i].applyNum),
|
|
|
+ applyText:response.data.actHxpapplyDetailList[i].remainingStorage,
|
|
|
+ };
|
|
|
+ maxObj.maxList[o].list.push(minObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this,'editPagePropsData',maxObj);
|
|
|
+ this.pageType = 2;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ delHxpapply(id){
|
|
|
+ let self = this;
|
|
|
+ this.$confirm('是否确认删除?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ delHxpapply(id).then(response => {
|
|
|
+ self.msgSuccess(response.msg);
|
|
|
+ self.resetQuery();
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
//获取数据列表
|
|
|
getList(){
|
|
|
this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
|
|
@@ -115,7 +189,7 @@
|
|
|
this.queryParamsData.beginCreateTime = null
|
|
|
this.queryParamsData.endCreateTime = null
|
|
|
}
|
|
|
- getHxpapplyMyDraftsList(this.queryParamsData).then(response => {
|
|
|
+ getHxpapplyDraftsList(this.queryParamsData).then(response => {
|
|
|
this.total = response.total;
|
|
|
this.tableList = response.rows;
|
|
|
});
|