|
@@ -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 {
|