chenrui  1 жил өмнө
parent
commit
b6ccbf805d

+ 20 - 3
src/views/statisticsCharts/components/statisticsHeadercod.vue

@@ -47,6 +47,7 @@
         </template>
         <template v-if="item.inputType === 'datePicker'">
           <el-date-picker
+          @change="dateup"
             v-model="formData[item.prop]"
             :size="item.size || 'small'"
             type="daterange"
@@ -331,7 +332,7 @@ export default {
     const savedFormData = this.savedFormDataMap[this.$route.name]
     this.formItems.forEach(item => {
       if (item.queryId && item.setKey) {
-        this.getOptions(item.queryId, item.setKey, item.prop)
+        this.getOptions(item.queryId, item.setKey, item.prop,item.coy)
       }
       if (savedFormData?.[item.prop]) {
         this.formData[item.prop] = savedFormData[item.prop]
@@ -342,6 +343,22 @@ export default {
     this.$emit('update:data', this.formData)
   },
   methods: {
+    dateup (value) {
+      let arr = {
+        fd1:value[0],
+        fd2:value[1],
+      }
+      this.formItems.forEach(item => {
+      if (item.queryId && item.setKey) {
+        this.getOptions(item.queryId, item.setKey, item.prop,arr)
+      }
+      if (savedFormData?.[item.prop]) {
+        this.formData[item.prop] = savedFormData[item.prop]
+      } else if (item.defaultOption) {
+        this.formData[item.prop] = item.defaultOption
+      }
+    })
+    },
     getData() {
       try {
         this.formItems.forEach(item => {
@@ -419,11 +436,11 @@ export default {
           break
       }
     },
-    async getOptions(queryId, setKey, prop) {
+    async getOptions(queryId, setKey, prop,cop) {
       try {
         const { code, returnData, message } = await TempQuery({
           serviceId: queryId,
-          dataContent: []
+          dataContent: cop
         })
         if (Number(code) === 0) {
           const arr = returnData.map(element => ({

+ 10 - 8
src/views/statisticsCharts/views/report/workloadTable.vue

@@ -37,6 +37,13 @@ export default {
         td: '',
       },
       formItems: [
+      {
+          prop: 'dateTime',
+          inputType: 'datePicker',
+          clearable: true,
+          width: '240px',
+          options: [],
+        },
         {
           prop: 'agentNumber',
           inputType: 'select',
@@ -47,13 +54,8 @@ export default {
           // disabled: true,
           queryId: SERVICE_ID.workerqueryAll,
           setKey: 'agentNumber',
-          options: [],
-        },
-        {
-          prop: 'dateTime',
-          inputType: 'datePicker',
-          clearable: true,
-          width: '240px',
+          coy: {fd1:Format('yyyy-MM-dd', new Date()),
+            fd2:Format('yyyy-MM-dd', new Date()),},
           options: [],
         },
       ],
@@ -68,7 +70,7 @@ export default {
   },
   mounted() {
     this.dataContent = {
-      agentNumber:'',
+      agentNumber:'全部',
       fd1:Format('yyyy-MM-dd', new Date()),
       fd2:Format('yyyy-MM-dd', new Date()),
     }