Browse Source

人员研发工时表,删除接口参数调整

ljb 10 months ago
parent
commit
59082a0630

+ 1 - 4
src/views/yf-cost-manage/basic-data-setting/dev-work-hours-register.vue

@@ -174,9 +174,6 @@ export default window.$crudCommon({
       });
       });
       return { yearAndMonth: this.params.yearAndMonth, xmAndAssetIdList };
       return { yearAndMonth: this.params.yearAndMonth, xmAndAssetIdList };
     },
     },
-    getDelParams(row) {
-      return { yearAndMonth: this.params.yearAndMonth, xmAndAssetIdList: [{ xmId: row.xmId, assetId: row.assetId }] };
-    },
     handleExport() {
     handleExport() {
       exportBlob(`/api/kd-scientific/asset/hours/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
       exportBlob(`/api/kd-scientific/asset/hours/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
         downloadXls(res.data, `${this.params.yearAndMonth}科研仪器设备工时登记表.xlsx`);
         downloadXls(res.data, `${this.params.yearAndMonth}科研仪器设备工时登记表.xlsx`);
@@ -206,7 +203,7 @@ export default window.$crudCommon({
   res: ({ data }) => {
   res: ({ data }) => {
     let newList = [];
     let newList = [];
     data.records.forEach((item) => {
     data.records.forEach((item) => {
-      let objData = { ...item, id: item.assetId };
+      let objData = { ...item, id: item.assetId+'_'+item.xmId, };
       item.dailyAttendances.forEach(hourItem => {
       item.dailyAttendances.forEach(hourItem => {
         objData[hourItem.workDate] = Number(hourItem.workHours || 0).toFixed(1);
         objData[hourItem.workDate] = Number(hourItem.workHours || 0).toFixed(1);
       });
       });

+ 5 - 5
src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

@@ -187,16 +187,16 @@ export default window.$crudCommon({
       return newFormData;
       return newFormData;
     },
     },
     getDelParams(row) {
     getDelParams(row) {
-      return [{ yearAndMonth: this.params.yearAndMonth, unicode: row.unicode }]
+      return { yearAndMonth: this.params.yearAndMonth, xmAndUnicodeList: [{ xmId: row.xmId, unicode: row.unicode }] };
     },
     },
     getBatchDelParams() {
     getBatchDelParams() {
-      let delArr = [];
+      let xmAndUnicodeList = [];
       this.data.forEach(item => {
       this.data.forEach(item => {
         if (this.ids.indexOf(item.id) > -1) {
         if (this.ids.indexOf(item.id) > -1) {
-          delArr.push({ yearAndMonth: this.params.yearAndMonth, unicode: item.unicode });
+          xmAndUnicodeList.push({ xmId: item.xmId, unicode: item.unicode });
         }
         }
       });
       });
-      return delArr;
+      return { yearAndMonth: this.params.yearAndMonth, xmAndUnicodeList };
     },
     },
     handleExport() {
     handleExport() {
       exportBlob(`/api/kd-scientific/xm/technician/hours/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
       exportBlob(`/api/kd-scientific/xm/technician/hours/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
@@ -229,7 +229,7 @@ export default window.$crudCommon({
     data.records.forEach((item) => {
     data.records.forEach((item) => {
       let objData = {
       let objData = {
         ...item,
         ...item,
-        id: item.unicode,
+        id: item.unicode+'_'+item.xmId,
         monthlyHours: (item.monthlyHours || 0).toFixed(1),
         monthlyHours: (item.monthlyHours || 0).toFixed(1),
         monthlyDays: (item.monthlyDays || 0).toFixed(1)
         monthlyDays: (item.monthlyDays || 0).toFixed(1)
       };
       };