浏览代码

跳转方式更换

buzhi 1 年之前
父节点
当前提交
d899dbc5b2

+ 13 - 7
src/views/InformationAudit/enterWarehouseAudit/detail.vue

@@ -84,9 +84,12 @@
84 84
         </el-row>
85 85
       </el-form>
86 86
       <div style="text-align: center; padding: 50px 0 20px">
87
-        <button class="bottom-btn" v-if="!isShow" style="background-color: #676fe8" @click="handleAgree">通 过</button>
87
+        <!-- <button class="bottom-btn" v-if="!isShow" style="background-color: #676fe8" @click="handleAgree">通 过</button>
88 88
         <button class="bottom-btn" v-if="!isShow" style="background-color: #e13434" @click="handleReturn">退 回</button>
89
-        <button class="bottom-btn" style="background-color: #89aac4" @click="handleBack">返 回</button>
89
+        <button class="bottom-btn" style="background-color: #89aac4" @click="handleBack">返 回</button> -->
90
+        <el-button type="success" v-if="!isShow" @click="handleAgree" style="background-color: #676fe8;border:none">通过</el-button>
91
+        <el-button type="primary" v-if="!isShow" @click="handleReturn" style="background-color: #e13434;border:none">退回</el-button>
92
+        <el-button @click="handleBack">返回</el-button>
90 93
       </div>
91 94
     </div>
92 95
   </basic-container>
@@ -103,9 +106,12 @@ import { useDict } from "@/hooks/dict";
103 106
 // import { closeTagAndOpenLastTag } from '@/router/Routermethods';
104 107
 import store from "@/store";
105 108
 import { useGetters } from "@/hooks/storeHooks";
106
-const { access_token } = useGetters(["access_token"])
109
+import { getQuery } from "@/hooks/detailQuery/index";
107 110
 
111
+const { access_token } = useGetters(["access_token"])
108 112
 const { indound_type, is_available } = useDict("indound_type", "is_available");
113
+const queryData = getQuery("enterWarehouseAuditDetail");
114
+
109 115
 const router = useRouter();
110 116
 const route = useRoute();
111 117
 const data = reactive({
@@ -134,12 +140,12 @@ let { tableData, auditData, isShow, fileUrl, myHeader } = toRefs(data);
134 140
 
135 141
 // 获取列表
136 142
 const getList = () => {
137
-  if (route.query.type == "show") {
143
+  if (queryData.type == "show") {
138 144
     isShow.value = true;
139 145
   } else {
140 146
     isShow.value = false;
141 147
   }
142
-  getInAuditDetail(route.query.id).then((res: any) => {
148
+  getInAuditDetail(queryData.id).then((res: any) => {
143 149
     if (res.code === 0) {
144 150
       tableData.value = res.data.inboundMaterial;
145 151
       auditData.value = res.data.inboundStatus;
@@ -159,7 +165,7 @@ const handleAgree = () => {
159 165
     type: "warning"
160 166
   })
161 167
     .then(() => {
162
-      let data = { ...formData, audi: "0", inboundId: route.query.id };
168
+      let data = { ...formData, audi: "0", inboundId: queryData.id };
163 169
       audit(data).then((res: any) => {
164 170
         if (res.code === 0) {
165 171
           ElMessage({
@@ -185,7 +191,7 @@ const handleReturn = () => {
185 191
     type: "warning"
186 192
   })
187 193
     .then(() => {
188
-      let data = { ...formData, audi: "1", inboundId: route.query.id };
194
+      let data = { ...formData, audi: "1", inboundId: queryData.id };
189 195
       audit(data).then((res: any) => {
190 196
         if (res.code === 0) {
191 197
           ElMessage({

+ 17 - 14
src/views/InformationAudit/enterWarehouseAudit/index.vue

@@ -101,6 +101,7 @@ import { Search, RefreshRight } from "@element-plus/icons-vue";
101 101
 import { useRouter } from "vue-router";
102 102
 import { useDict } from "@/hooks/dict";
103 103
 import { useGetters } from "@/hooks/storeHooks";
104
+import { setQuery } from "@/hooks/detailQuery/index";
104 105
 
105 106
 const { indound_type, auditing_status } = useDict("indound_type", "auditing_status");
106 107
 const { userInfo } = useGetters(["userInfo"]);
@@ -162,23 +163,25 @@ const handleReSearch = () => {
162 163
 };
163 164
 // 审核
164 165
 const handleProcess = (row: any) => {
165
-  router.push({
166
-    path: "enterWarehouseAuditDetail",
167
-    query: {
168
-      id: row.inboundId,
169
-      type: "audit"
170
-    }
171
-  });
166
+  // router.push({
167
+  //   path: "enterWarehouseAuditDetail",
168
+  //   query: {
169
+  //     id: row.inboundId,
170
+  //     type: "audit"
171
+  //   }
172
+  // });
173
+  setQuery("enterWarehouseAuditDetail", { id: row.inboundId, type: "audit" });
172 174
 };
173 175
 // 查看
174 176
 const handleShow = (row: any) => {
175
-  router.push({
176
-    path: "enterWarehouseAuditDetail",
177
-    query: {
178
-      id: row.inboundId,
179
-      type: "show"
180
-    }
181
-  });
177
+  // router.push({
178
+  //   path: "enterWarehouseAuditDetail",
179
+  //   query: {
180
+  //     id: row.inboundId,
181
+  //     type: "show"
182
+  //   }
183
+  // });
184
+  setQuery("enterWarehouseAuditDetail", { id: row.inboundId, type: "show" });
182 185
 };
183 186
 
184 187
 onMounted(() => {

+ 17 - 11
src/views/InformationAudit/outWarehouseAudit/detail.vue

@@ -89,9 +89,12 @@
89 89
         </el-row>
90 90
       </el-form>
91 91
       <div style="text-align: center; padding: 50px 0 20px">
92
-        <button class="bottom-btn" v-if="!isShow" style="background-color: #676fe8" @click="handleAgree">通 过</button>
92
+        <!-- <button class="bottom-btn" v-if="!isShow" style="background-color: #676fe8" @click="handleAgree">通 过</button>
93 93
         <button class="bottom-btn" v-if="!isShow" style="background-color: #e13434" @click="handleReturn">退 回</button>
94
-        <button class="bottom-btn" style="background-color: #89aac4" @click="handleBack">返 回</button>
94
+        <button class="bottom-btn" style="background-color: #89aac4" @click="handleBack">返 回</button> -->
95
+        <el-button type="success" v-if="!isShow" @click="handleAgree" style="background-color: #676fe8;border:none">通过</el-button>
96
+        <el-button type="primary" v-if="!isShow" @click="handleReturn" style="background-color: #e13434;border:none">退回</el-button>
97
+        <el-button @click="handleBack">返回</el-button>
95 98
       </div>
96 99
     </div>
97 100
   </basic-container>
@@ -105,12 +108,14 @@ import { Search } from "@element-plus/icons-vue";
105 108
 import { ElMessage, ElMessageBox } from "element-plus";
106 109
 import { useRouter, useRoute } from "vue-router";
107 110
 import { useDict } from "@/hooks/dict";
108
-import { closeTagAndOpenLastTag } from "@/router/Routermethods";
111
+// import { closeTagAndOpenLastTag } from "@/router/Routermethods";
109 112
 import store from "@/store";
110 113
 import { useGetters } from "@/hooks/storeHooks";
111
-const { access_token } = useGetters(["access_token"])
114
+import { getQuery } from "@/hooks/detailQuery/index";
112 115
 
116
+const { access_token } = useGetters(["access_token"]);
113 117
 const { outdound_type, is_available, province_ch } = useDict("outdound_type", "is_available", "province_ch");
118
+const queryData = getQuery("outWarehouseAuditDetail");
114 119
 
115 120
 const router = useRouter();
116 121
 const route = useRoute();
@@ -140,12 +145,12 @@ let { tableData, auditData, isShow, fileUrl, myHeader } = toRefs(data);
140 145
 
141 146
 // 获取列表
142 147
 const getList = () => {
143
-  if (route.query.type == "show") {
148
+  if (queryData.type == "show") {
144 149
     isShow.value = true;
145 150
   } else {
146 151
     isShow.value = false;
147 152
   }
148
-  getInAuditDetail(route.query.id).then((res: any) => {
153
+  getInAuditDetail(queryData.id).then((res: any) => {
149 154
     if (res.code === 0) {
150 155
       tableData.value = res.data.outboundMaterial;
151 156
       auditData.value = res.data.outboundStatus;
@@ -165,7 +170,7 @@ const handleAgree = () => {
165 170
     type: "warning"
166 171
   })
167 172
     .then(() => {
168
-      let data = { ...formData, audi: "0", outboundId: route.query.id };
173
+      let data = { ...formData, audi: "0", outboundId: queryData.id };
169 174
       audit(data).then((res: any) => {
170 175
         if (res.code === 0) {
171 176
           ElMessage({
@@ -191,7 +196,7 @@ const handleReturn = () => {
191 196
     type: "warning"
192 197
   })
193 198
     .then(() => {
194
-      let data = { ...formData, audi: "1", outboundId: route.query.id };
199
+      let data = { ...formData, audi: "1", outboundId: queryData.id };
195 200
       audit(data).then((res: any) => {
196 201
         if (res.code === 0) {
197 202
           ElMessage({
@@ -211,9 +216,9 @@ const handleReturn = () => {
211 216
 };
212 217
 // 返回
213 218
 const handleBack = () => {
214
-  // store.commit("DEL_TAG", store.getters.tag);
215
-  // router.push("/InformationAudit/outWarehouseAudit");
216
-  closeTagAndOpenLastTag();
219
+  store.commit("DEL_TAG", store.getters.tag);
220
+  router.push("/InformationAudit/outWarehouseAudit");
221
+  // closeTagAndOpenLastTag();
217 222
 };
218 223
 
219 224
 // 附件相关
@@ -281,6 +286,7 @@ onMounted(() => {
281 286
   border: none;
282 287
   border-radius: 15px;
283 288
 }
289
+
284 290
 .bottom-btn + .bottom-btn {
285 291
   margin-left: 20px;
286 292
 }

+ 17 - 14
src/views/InformationAudit/outWarehouseAudit/index.vue

@@ -99,6 +99,7 @@ import { Search, RefreshRight } from "@element-plus/icons-vue";
99 99
 import { useRouter } from "vue-router";
100 100
 import { useDict } from "@/hooks/dict";
101 101
 import { useGetters } from "@/hooks/storeHooks";
102
+import { setQuery } from "@/hooks/detailQuery/index";
102 103
 
103 104
 const { outdound_type, is_available, province_ch, auditing_status } = useDict(
104 105
   "outdound_type",
@@ -164,23 +165,25 @@ const handleReSearch = () => {
164 165
 };
165 166
 // 审核
166 167
 const handleProcess = (row: any) => {
167
-  router.push({
168
-    path: "outWarehouseAuditDetail",
169
-    query: {
170
-      id: row.outboundId,
171
-      type: "audit"
172
-    }
173
-  });
168
+  // router.push({
169
+  //   path: "outWarehouseAuditDetail",
170
+  //   query: {
171
+  //     id: row.outboundId,
172
+  //     type: "audit"
173
+  //   }
174
+  // });
175
+  setQuery("outWarehouseAuditDetail", { id: row.outboundId, type: "audit" });
174 176
 };
175 177
 // 查看
176 178
 const handleShow = (row: any) => {
177
-  router.push({
178
-    path: "outWarehouseAuditDetail",
179
-    query: {
180
-      id: row.outboundId,
181
-      type: "show"
182
-    }
183
-  });
179
+  // router.push({
180
+  //   path: "outWarehouseAuditDetail",
181
+  //   query: {
182
+  //     id: row.outboundId,
183
+  //     type: "show"
184
+  //   }
185
+  // });
186
+  setQuery("outWarehouseAuditDetail", { id: row.outboundId, type: "show" });
184 187
 };
185 188
 
186 189
 onMounted(() => {