408249787 2 سال پیش
والد
کامیت
62f406ad57

+ 31 - 0
src/api/fill/task.js

@@ -118,6 +118,37 @@ export function fetchFillGatherTask (parameter) {
     }
   })
 }
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getFillGatherTask (parameter) {
+  return axios({
+    url: '/fill/task-details/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getFillUpdates (parameter) {
+  return axios({
+    url: '/fill/updates/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
 
 /**
  * query list func

+ 1 - 0
src/utils/dict.js

@@ -160,6 +160,7 @@ DictCache.TYPE = {
   REMOTE_MEASURE: 'REMOTE_MEASURE', // 设备遥测
   REMOTE_DEGREE: 'REMOTE_DEGREE', // 设备电度
   FILL_GATHER_TASK_STATUS: 'FILL_GATHER_TASK_STATUS', // 巡检任务状态
+  FILL_UPDATE_TYPE: 'FILL_UPDATE_TYPE', // 巡检操作类型
   /* 审批单 */
   ACTIVITI_FORM_STATUS: 'ACTIVITI_FORM_STATUS', // 申请单状态
 

+ 7 - 11
src/views/fill/task/FillGatherTask.vue

@@ -97,11 +97,11 @@
               title="是否暂停要该任务"
               @confirm="handlePause(record)"
             >暂停</operation-button>
-            <operation-button
+            <!-- <operation-button
               v-if="$auth('fill-fills-del')"
               :type="2"
               title="是否要删除该条数据?"
-              @confirm="batchDelete(record.id)">删除</operation-button>
+              @confirm="batchDelete(record.id)">删除</operation-button> -->
           </template>
         </span>
       </s-table>
@@ -110,7 +110,7 @@
     <dispatch-form ref="dispatchModal" @ok="handleOk" />
     <overtime-form ref="overtimeModal" @ok="handleOk" />
     <pause-form ref="pauseModal" @ok="handleOk" />
-    <detail ref="detailModal" @ok="handleOk" />
+    <base-form :editor="false" ref="detailModal" @ok="handleOk" />
   </a-card>
 </template>
 
@@ -344,17 +344,13 @@ export default {
     },
     handleEdit (record) {
       this.visible = false
-      fetchFillGatherTask({ id: record.id }).then(res => {
-        const modal = this.$refs.baseModal
-        modal.base(res.data)
-      })
+      const modal = this.$refs.baseModal
+      modal.base(record)
     },
     handleView (record) {
       this.visible = false
-      fetchFillGatherTask({ id: record.id }).then(res => {
-        const modal = this.$refs.detailModal
-        modal.base(res.data)
-      })
+      const modal = this.$refs.detailModal
+      modal.base(record)
     },
     handleOk () {
       this.visible = true

+ 257 - 57
src/views/fill/task/modules/BaseForm.vue

@@ -1,89 +1,285 @@
 <template>
-  <a-card :bordered="false" v-show="visible" class="card" title="填报">
-    <a-row :gutter="48" slot="extra">
+  <a-card :bordered="false" v-show="visible" class="card">
+    <a-row :gutter="48" style="position:fixed;bottom:150px;z-index:999;display:flex; justify-content: center;width: 90%;">
       <a-col :md="48" :sm="48">
-        <span style="float: right">
-          <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
-          <a-button style="margin-left: 8px" :loading="confirmLoading" type="primary" @click="save()">确认</a-button>
+        <span>
+          <a-button v-show="editor" :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
           <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+          <a-button
+            style="margin-left: 8px"
+            type="primary"
+            @click="handleDispatch(model)"
+          >转派</a-button>
+          <a-button
+            style="margin-left: 8px"
+            type="primary"
+            @click="handleOvertime(model)"
+          >延时</a-button>
+
+          <a-button
+            v-if="model.status===5"
+            style="margin-left: 8px"
+            type="primary"
+            @click="handlePause(model)"
+          >取消暂停</a-button>
+          <a-button
+            v-else
+            style="margin-left: 8px"
+            type="primary"
+            @click="handlePause(model)"
+          >暂停</a-button>
         </span>
       </a-col>
     </a-row>
-    <div class="tables">
-      <div style="text-align:center;padding-bottom:10px;font-size:32px;">时代思康仪表巡检记录表</div>
-      <table>
-        <thead border="1px">
-          <tr>
-            <td rowspan="2" width="100px">序号</td>
-            <td rowspan="2" width="150px">车间</td>
-            <td rowspan="2" width="150px">设备名称</td>
-            <td rowspan="2" width="150px">设备编号</td>
-            <td rowspan="2" width="150px">填报时间</td>
-            <td :colspan="ListForm[0].content.length">项目内容项</td>
-            <td rowspan="2" width="150px">是否填报</td>
-          </tr>
-          <tr>
-            <td v-for="item in ListForm[0].content" :key="item.name">{{ item.name }}</td>
-          </tr>
-        </thead>
-        <tbody>
-          <tr v-for="(item,i) in ListForm" :key="item.id">
-            <td>{{ i+1 }}</td>
-            <td>{{ item.positionName }}</td>
-            <td>{{ item.sbName }}</td>
-            <td>{{ item.sbNo }}</td>
-            <td>{{ item.updateTime }}</td>
-            <td v-for="li in item.content" :key="li.name">
-              <!-- <span v-if="item.status === 1" @dblclick="item.status =2"> {{ li.fillValue }}</span> -->
-              <a-input v-if="li.type === 1 " v-model="li.fillValue" />
-              <a-select v-else-if="li.type === 2" v-model="li.fillValue" style="min-width:100px;">
-                <a-select-option v-for="val in JSON.parse(li.selectValue)" :key="val.value" :value="val.value">
-                  {{ val.value }}
-                </a-select-option>
-              </a-select>
-            </td>
-            <td>
-              <a-icon v-show="item.status === 1" type="check" style="color:#87d068;font-size: 26px;" />
-            </td>
-          </tr>
-        </tbody>
-      </table>
-      <a-pagination style="float:right;margin:10px;" :default-current="1" :total="10" />
+    <a-button-group size="large" v-show="!editor" >
+      <a-button @click="type=1">
+        <a-icon type="left" />巡检记录
+      </a-button>
+      <a-button @click="type=2">
+        任务追踪<a-icon type="right" />
+      </a-button>
+    </a-button-group>
+    <div v-show="type===1">
+      <div class="tables">
+        <a-radio-group :value="status" @change="handleStatusChange">
+          <a-radio-button :value="null">
+            全部
+          </a-radio-button>
+          <a-radio-button :value="0">
+            未填报
+          </a-radio-button>
+          <a-radio-button :value="1">
+            已填报
+          </a-radio-button>
+        </a-radio-group>
+        <div style="text-align:center;padding-bottom:10px;font-size:32px;">时代思康仪表巡检记录表</div>
+        <table>
+          <thead border="1px">
+            <tr>
+              <th rowspan="2" width="100px">序号</th>
+              <th rowspan="2" width="150px">车间</th>
+              <th rowspan="2" width="150px">设备名称</th>
+              <th rowspan="2" width="150px">设备编号</th>
+              <th rowspan="2" width="150px">填报时间</th>
+              <th :colspan="ListForm.length>0?ListForm[0].content.length:1">项目内容项</th>
+              <th rowspan="2" width="150px">是否填报</th>
+            </tr>
+            <tr v-if="ListForm.length>0">
+              <th v-for="item in ListForm[0].content" :key="item.name">{{ item.name }}</th>
+            </tr>
+          </thead>
+          <tbody v-if="ListForm.length>0">
+            <tr v-for="(item,i) in ListForm" :key="item.id">
+              <td>{{ i+1 }}</td>
+              <td>{{ item.positionName }}</td>
+              <td>{{ item.sbName }}</td>
+              <td>{{ item.sbNo }}</td>
+              <td>{{ item.updateTime }}</td>
+              <td v-for="li in item.content" :key="li.name">
+                <span v-if="!editor" > {{ li.fillValue }}</span>
+                <a-input v-else-if="li.type === 1 && editor " v-model="li.fillValue" />
+                <a-select v-else-if="li.type === 2 && editor" v-model="li.fillValue" style="min-width:100px;">
+                  <a-select-option v-for="val in JSON.parse(li.selectValue)" :key="val.value" :value="val.value">
+                    {{ val.value }}
+                  </a-select-option>
+                </a-select>
+              </td>
+              <td>
+                <a-icon v-show="item.status === 1" type="check" style="color:#87d068;font-size: 26px;" />
+              </td>
+            </tr>
+          </tbody>
+        </table>
+        <div v-if="ListForm.length===0">
+          <a-empty />
+        </div>
+        <a-pagination style="float:right;margin:10px;" v-model="listPage.pageNum" :total="listPage.total" @change="onChange" />
+      </div>
+    </div>
+    <div v-show="type===2">
+      <div style="text-align:center;padding-bottom:10px;font-size:32px;">时代思康仪表任务记录表</div>
+      <a-table
+        :columns="columns"
+        :data-source="updatesInfo"
+        bordered
+        :pagination="pagination"
+        @change="handleTableChange"
+        :loading="loading">
+        <template v-slot:index="text,record,index">
+          {{ index+1 }}
+        </template>
+        <template v-slot:type="text">
+          {{ typeMap[text] }}
+        </template>
+      </a-table>
     </div>
+    <dispatch-form ref="dispatchModal" @ok="handleOk" />
+    <overtime-form ref="overtimeModal" @ok="handleOk" />
+    <pause-form ref="pauseModal" @ok="handleOk" />
   </a-card>
 </template>
 
 <script>
-import { fillGatherTask } from '@/api/fill/task'
+import { fillGatherTask, getFillGatherTask, getFillUpdates, pauseFillGatherTask } from '@/api/fill/task'
+import DispatchForm from './DispatchForm'
+import OvertimeForm from './OvertimeForm'
+import PauseForm from './PauseForm'
 export default {
   name: 'BaseFillGatherTask',
+  components: {
+    PauseForm,
+    DispatchForm,
+    OvertimeForm
+  },
   data () {
     return {
       confirmLoading: false,
       visible: false,
+      model: {},
+      listPage: {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0
+      },
+      pagination: {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0
+      },
+      loading: false,
       ListForm: [],
-      id: ''
+      id: '',
+      type: 1,
+      typeMap: {},
+      status: null,
+      updatesInfo: [],
+      columns: [
+        {
+          title: '序号',
+          width: 70,
+          key: 'index',
+          align: 'center',
+          scopedSlots: { customRender: 'index' }
+        },
+        {
+
+          title: '类型',
+          width: 100,
+          dataIndex: 'type',
+          scopedSlots: { customRender: 'type' }
+        },
+        {
+          title: '巡检人',
+          width: 150,
+          dataIndex: 'checkerName'
+        },
+        {
+          title: '巡检主管',
+          width: 150,
+          dataIndex: 'leaderName '
+        },
+        {
+          title: '记录时间',
+          width: 150,
+          dataIndex: 'createdTime'
+        },
+        {
+          title: ' 延时时长',
+          width: 150,
+          dataIndex: 'lateHour'
+        }
+      ]
       // 下拉框map
     }
   },
-  props: {},
+  props: {
+    editor: {
+      type: Boolean,
+      default: true
+    }
+  },
   created () {
     // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FILL_UPDATE_TYPE)
   },
   methods: {
     base (record) {
       this.visible = true
+      this.model = record
       this.id = record.id
-      this.ListForm = record.details.map(item => {
-        item.content = JSON.parse(item.content)
-        item.content = item.content.map(val => {
-          val.fillValue = val.fillValue ? val.fillValue : ''
-          return val
+      this.getInfo()
+      this.getFillUpdates()
+    },
+    getInfo () {
+      const params = {
+        ...this.listPage,
+        taskId: this.id,
+        status: this.status
+      }
+      getFillGatherTask(params).then(res => {
+        if (res.data.rows.length === 0) {
+          this.ListForm = []
+          return
+        }
+        this.listPage.total = res.data.total
+        this.ListForm = res.data.rows.map(item => {
+          item.content = JSON.parse(item.content)
+          item.content = item.content.map(val => {
+            val.fillValue = val.fillValue ? val.fillValue : ''
+            return val
+          })
+          return item
         })
-        return item
       })
       console.log(this.ListForm)
     },
+    handleDispatch (record) {
+      this.visible = false
+      const modal = this.$refs.dispatchModal
+      modal.base(record)
+    },
+    handleOvertime (record) {
+      this.visible = false
+      const modal = this.$refs.overtimeModal
+      modal.base(record)
+    },
+    handlePause (record) {
+      if (record.status === 5) {
+        this.visible = false
+        const modal = this.$refs.pauseModal
+        modal.base(record)
+        return
+      }
+      pauseFillGatherTask({ pauseType: 1, id: record.id }).then(res => {
+        this.$message.success('暂停成功!')
+        this.getFillUpdates()
+      })
+    },
+    getFillUpdates () {
+      const params = {
+        ...this.pagination,
+        taskId: this.id
+      }
+      getFillUpdates(params).then(res => {
+        this.updatesInfo = res.data.rows
+        this.pagination.total = res.data.total
+      })
+    },
+    handleStatusChange (e) {
+      this.status = e.target.value
+      this.getInfo()
+    },
+    handleTableChange (pagination) {
+      console.log(pagination)
+      const pager = { ...this.pagination }
+      pager.pageNum = pagination.current
+      this.pagination = pager
+      this.getFillUpdates()
+    },
+    onChange (page) {
+      console.log(page)
+      this.getInfo()
+    },
     save () {
       const detail = this.ListForm.map(item => {
         return {
@@ -103,6 +299,10 @@ export default {
     handleConfirm (id) {
       console.log(id)
     },
+    handleOk () {
+      this.visible = true
+      this.getFillUpdates()
+    },
     handleCancel () {
       this.visible = false
       // this.ListForm = []
@@ -131,9 +331,9 @@ export default {
         table-layout:fixed;
     }
     th{
-      color: #FFFFFF;
-      background: #3762FC;
-      min-width:150px;
+      background: #fafafa;
+      font-weight: 500;
+
     }
     th,
     td {

+ 74 - 74
src/views/fill/task/modules/Detail.vue

@@ -1,81 +1,81 @@
 <template>
-    <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
-        <a-row :gutter="48" slot="extra">
-            <a-col :md="48" :sm="48">
-              <span class="table-page-search-submitButtons" style="float: right">
-                <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
-              </span>
-            </a-col>
-        </a-row>
-        <detail-list title="" :col="2">
-                                                                                                    <detail-list-item term="巡检人">{{ model.checker }}</detail-list-item>
-                                                                                                            <detail-list-item term="巡检主管">{{ model.checkLeader }}</detail-list-item>
-                                                                                                                                        <detail-list-item term="巡检结束时间">{{ model.updateTime }}</detail-list-item>
-                                                                                                            <detail-list-item term="任务创建人ID">{{ model.createdUserId }}</detail-list-item>
-                                                                                                                                        <detail-list-item term="巡检结束人ID">{{ model.updateUserId }}</detail-list-item>
-                                                                                                            <detail-list-item term="巡检结束人">{{ model.updateUserName }}</detail-list-item>
-                                                                                                            <detail-list-item term="待完成数量">{{ model.waitNum }}</detail-list-item>
-                                                                                                            <detail-list-item term="巡检总数量">{{ model.totalNum }}</detail-list-item>
-                                                                                                            <detail-list-item term="0 待接单 1 巡检中 2 完成  3 延迟  4 暂停">{{ model.status }}</detail-list-item>
-                                                                                                            <detail-list-item term="要求时间">{{ model.requireHour }}</detail-list-item>
-                                                                                                            <detail-list-item term="超时预警时间">{{ model.warningHour }}</detail-list-item>
-                                                                                                            <detail-list-item term="累计延时时间">{{ model.lateHistoryHours }}</detail-list-item>
-                                                                                                            <detail-list-item term="变更记录">{{ model.recordJson }}</detail-list-item>
-                                                                                                            <detail-list-item term="任务名称">{{ model.name }}</detail-list-item>
-                                                        </detail-list>
-    </a-card>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+    <detail-list title="" :col="2">
+      <detail-list-item term="巡检人">{{ model.checker }}</detail-list-item>
+      <detail-list-item term="巡检主管">{{ model.checkLeader }}</detail-list-item>
+      <detail-list-item term="巡检结束时间">{{ model.updateTime }}</detail-list-item>
+      <detail-list-item term="任务创建人ID">{{ model.createdUserId }}</detail-list-item>
+      <detail-list-item term="巡检结束人ID">{{ model.updateUserId }}</detail-list-item>
+      <detail-list-item term="巡检结束人">{{ model.updateUserName }}</detail-list-item>
+      <detail-list-item term="待完成数量">{{ model.waitNum }}</detail-list-item>
+      <detail-list-item term="巡检总数量">{{ model.totalNum }}</detail-list-item>
+      <detail-list-item term="0 待接单 1 巡检中 2 完成  3 延迟  4 暂停">{{ model.status }}</detail-list-item>
+      <detail-list-item term="要求时间">{{ model.requireHour }}</detail-list-item>
+      <detail-list-item term="超时预警时间">{{ model.warningHour }}</detail-list-item>
+      <detail-list-item term="累计延时时间">{{ model.lateHistoryHours }}</detail-list-item>
+      <detail-list-item term="变更记录">{{ model.recordJson }}</detail-list-item>
+      <detail-list-item term="任务名称">{{ model.name }}</detail-list-item>
+    </detail-list>
+  </a-card>
 </template>
 
 <script>
-    import DetailList from '@/components/tools/DetailList'
-    const DetailListItem = DetailList.Item
+import DetailList from '@/components/tools/DetailList'
+const DetailListItem = DetailList.Item
 
-    export default {
-        name: 'FillGatherTaskDetail',
-        components: {
-            DetailList,
-            DetailListItem
-        },
-        data () {
-            return {
-                confirmLoading: false,
-                mdl: {},
-                modalTitle: null,
-                visible: false,
-                // 下拉框map
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            model: {
-                                                                                                                    'checker': null,
-                                                                                                'checkLeader': null,
-                                                                                                                                            'updateTime': null,
-                                                                                                'createdUserId': null,
-                                                                                                                                            'updateUserId': null,
-                                                                                                'updateUserName': null,
-                                                                                                'waitNum': null,
-                                                                                                'totalNum': null,
-                                                                                                'status': null,
-                                                                                                'requireHour': null,
-                                                                                                'warningHour': null,
-                                                                                                'lateHistoryHours': null,
-                                                                                                'recordJson': null,
-                                                                                                'name': null,
-                                                            }
-            }
-        },
-        created () {
-            // 下拉框map
-            
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        },
-        methods: {
-            base (record) {
-                this.visible = true
-                this.modalTitle = '详情'
-                this.model = record
-            },
-            handleCancel () {
-                this.visible = false
-                this.confirmLoading = false
-                this.$emit('ok')
-            }
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
+export default {
+  name: 'FillGatherTaskDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      // 下拉框map
+      model: {
+        'checker': null,
+        'checkLeader': null,
+        'updateTime': null,
+        'createdUserId': null,
+        'updateUserId': null,
+        'updateUserName': null,
+        'waitNum': null,
+        'totalNum': null,
+        'status': null,
+        'requireHour': null,
+        'warningHour': null,
+        'lateHistoryHours': null,
+        'recordJson': null,
+        'name': null
+      }
     }
+  },
+  created () {
+    // 下拉框map
+
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.$emit('ok')
+    }
+  }
+}
 </script>

+ 1 - 0
src/views/fill/task/modules/DispatchForm.vue

@@ -93,6 +93,7 @@ export default {
         }
         console.log(values)
         dispatchFillGatherTask(values).then(res => {
+          this.$message.success('转派成功!')
           this.handleCancel()
         })
         // 日期处理

+ 1 - 0
src/views/fill/task/modules/OvertimeForm.vue

@@ -68,6 +68,7 @@ export default {
         }
         console.log(values)
         overtimeFillGatherTask(values).then(res => {
+          this.$message.success('延时成功!')
           this.handleCancel()
         })
         // 日期处理