Sfoglia il codice sorgente

周报添加年周参数

CzRger 1 anno fa
parent
commit
40547406f4

+ 2 - 1
src/api/modules/weekly.ts

@@ -26,9 +26,10 @@ export const getWeekReport = (id: any) => handle({
   method: 'get',
   method: 'get',
 })
 })
 //  周报管理 > 查询周报提交情况
 //  周报管理 > 查询周报提交情况
-export const getWeekReportSearch = () => handle({
+export const getWeekReportSearch = (params: any) => handle({
   url: `/${suffix}/week/report/search`,
   url: `/${suffix}/week/report/search`,
   method: 'get',
   method: 'get',
+  params
 })
 })
 //  周报管理 > 删除
 //  周报管理 > 删除
 export const delWeekReportDelete = (params: any) => handle({
 export const delWeekReportDelete = (params: any) => handle({

+ 4 - 1
src/store/modules/app.ts

@@ -216,7 +216,10 @@ const actions = {
 	},
 	},
 	LOAD_WEEKLY_INFO({ commit }: any) {
 	LOAD_WEEKLY_INFO({ commit }: any) {
 		return new Promise((resolve, reject) => {
 		return new Promise((resolve, reject) => {
-			getWeekReportSearch().then((res) => {
+			getWeekReportSearch({
+				year: getters.yearWeeks(state).list[getters.yearWeeks(state).list.length - 1].year,
+				weekTime: getters.yearWeeks(state).list[getters.yearWeeks(state).list.length - 1].week,
+			}).then((res) => {
 				if (res.code === 200) {
 				if (res.code === 200) {
 					commit('SET_WEEKLY_INFO', res.data)
 					commit('SET_WEEKLY_INFO', res.data)
 					resolve(res.message)
 					resolve(res.message)

+ 4 - 1
src/views/system/weekly-manage/detail.vue

@@ -110,7 +110,10 @@ export default defineComponent({
           })
           })
         } else {
         } else {
           state.loading = true
           state.loading = true
-          that.$api.getWeekReportSearch().then((res) => {
+          that.$api.getWeekReportSearch({
+            year: store.getters['app/yearWeeks'].list[store.getters['app/yearWeeks'].list.length - 1].year,
+            weekTime: store.getters['app/yearWeeks'].list[store.getters['app/yearWeeks'].list.length - 1].week,
+          }).then((res) => {
             if (res.code === 200) {
             if (res.code === 200) {
               if (res.data?.id) {
               if (res.data?.id) {
                 setFormByInfo(res.data)
                 setFormByInfo(res.data)