xiongchao 3 năm trước cách đây
mục cha
commit
1d7fdb46b5

+ 2 - 2
src/api/check/checkstandard.js

@@ -73,8 +73,8 @@ export function fetchCheckStandard (parameter) {
  */
 export function generateJobByCheckStandard (parameter) {
   return axios({
-    url: '/check/standards/generate' + parameter.id,
-    method: 'get',
+    url: '/check/standards/generate/' + parameter.id,
+    method: 'PUT',
     headers: {
       'Content-Type': 'application/json;charset=UTF-8'
     }

+ 2 - 1
src/views/check/checkjob/CheckJob.vue

@@ -68,7 +68,6 @@
           <template v-if="record.status === DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
             <a-divider  type="vertical" />
             <a  @click="handleFinish(record)">完成</a>
-
           </template>
           <template v-if="record.status != DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
              <a-divider  type="vertical" />
@@ -229,6 +228,8 @@ export default {
           ...parameter,
           ...this.queryParam,
           dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
           }
         }
         return getCheckJobPage(Object.assign(parameter, this.queryParam))

+ 6 - 0
src/views/check/checkjob/modules/CheckJobTable.vue

@@ -121,6 +121,10 @@ export default {
       type: Number,
       default: 1
     },
+    status: {
+      type: Number,
+      default: null
+    },
     tableParams: {
       type: Object,
       default: () => ({})
@@ -244,6 +248,8 @@ export default {
           ...this.queryParam,
           ...this.tableParams,
           dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
           }
         }
         return getCheckJobPage(Object.assign(parameter, this.queryParam))

+ 3 - 3
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -37,7 +37,7 @@
           <a-divider type="vertical" />
           <a @click="handleCopy(record)">复制</a>
           <a-divider type="vertical" />
-          <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要插入任务?" @confirm="handleGenerate(record.id)">
+          <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要插入任务?" @confirm="handleGenerate(record)">
             <a>插入任务</a>
           </a-popconfirm>
         </template>
@@ -174,8 +174,8 @@ export default {
       data.id = null
       modal.base(data)
     },
-    handleGenerate (id) {
-      generateJobByCheckStandard({ id: this.model.id }).then(res => {
+    handleGenerate (record) {
+      generateJobByCheckStandard({ id: record.id }).then(res => {
         this.$message.info('任务已经创建,请及时处理')
       })
     },

+ 21 - 10
src/views/sb/info/modules/Detail.vue

@@ -5,17 +5,17 @@
         <a-col :md="48" :sm="48">
           <span class="table-page-search-submitButtons" style="float: right">
             <a-badge :count="numPartInfo" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
-              <a-button style="margin-left: 16px" type="default" @click="partInfoListView()">设备部位</a-button>
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="partInfoListView()">设备部位</a-button>
             </a-badge>
             <a-badge :count="numModelbom" title="备件总数" :number-style="{ backgroundColor: '#52c41a' }">
-              <a-button style="margin-left: 16px" type="default" @click="handleViewBom()">备件BOM</a-button>
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
             </a-badge>
             <a-badge :count="numCheckStandard" title="保养项目总数" :number-style="{ backgroundColor: '#52c41a' }">
-              <a-button style="margin-left: 16px" type="default" @click="handleViewCheck()">保养项目</a-button>
-            </a-badge>
-            <a-badge :count="numNumCheckjob" title="待保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
-              <a-button style="margin-left: 16px" type="default" @click="partInfoListView()">待保养任务</a-button>
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
             </a-badge>
+<!--            <a-badge :count="numNumCheckjob" title="待保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="checkJobTableWaitDoListView()">待保养任务</a-button>
+            </a-badge>-->
             <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
           </span>
         </a-col>
@@ -101,7 +101,7 @@
         <q-tab-pane key="2" tab="配件记录">
           <spare-part-used-select-table :type="2" :table-params="{sbId: model.id, modelId: model.modelId}" ref="sparePartUsedSelectTable"/>
         </q-tab-pane>
-        <q-tab-pane key="3" tab="保养记录">
+        <q-tab-pane key="3" tab="保养任务">
           <check-job-table :type="2" :check-type="2" :table-params="{sbId: model.id}" ref="spotJobTable" />
         </q-tab-pane>
       </q-tabs>
@@ -109,6 +109,7 @@
     <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
     <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
     <part-info-list ref="partInfoList" />
+    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>
   </a-card>
 </template>
 
@@ -116,6 +117,7 @@
 import DetailList from '@/components/tools/DetailList'
 import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
 import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
+import CheckJobTableWaitDo from '@/views/check/checkjob/modules/CheckJobTableWaitDo'
 import { fetchFirmProducer } from '@/api/firm/producer'
 import { queryNumCheckStandard } from '@/api/check/checkstandard'
 import { queryNumCheckjob } from '@/api/check/checkjob'
@@ -138,6 +140,7 @@ export default {
     DetailListItem,
     RepairApplicationFormTable,
     CheckJobTable,
+    CheckJobTableWaitDo,
     SparePartUsedSelectTable,
     SbOilPageTable,
     SbRunFillPageTable,
@@ -275,6 +278,12 @@ export default {
       this.model = record
       this.activeKey = '1'
       this.collapseActiveKey = '0'
+      this.fetchNum()
+      fetchFirmProducer({ id: this.model.producerId }).then(res => {
+        this.firmProducer = res.data
+      })
+    },
+    fetchNum(){
       Promise.all([queryNumPartInfo({ sbId: this.model.id }), queryNumModelbom({ sbId: this.model.id }), queryNumCheckStandard({ sbId: this.model.id }), queryNumCheckjob({ sbId: this.model.id })])
         .then((values) => {
           this.numPartInfo = values[0].data
@@ -282,9 +291,6 @@ export default {
           this.numCheckStandard = values[2].data
           this.numNumCheckjob = values[3].data
         })
-      fetchFirmProducer({ id: this.model.producerId }).then(res => {
-        this.firmProducer = res.data
-      })
     },
     changeTab (activeKey) {
       this.activeKey = activeKey
@@ -331,10 +337,15 @@ export default {
     },
     handleOk () {
       this.visible = true
+      this.fetchNum()
     },
     partInfoListView () {
       const modal = this.$refs.partInfoList
       modal.base({ sbId: this.model.id }, { sbId: this.model.id })
+    },
+    checkJobTableWaitDoListView () {
+      const modal = this.$refs.checkJobTableWaitDo
+      modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })
     }
   }
 }