This commit is contained in:
2023-09-08 16:25:46 +08:00
6 changed files with 363 additions and 25 deletions

View File

@@ -367,4 +367,53 @@ uni-button:after {
.layout-t tr.checked td .sin_input {
color: #8a8a8a;
border: 1px solid #ffffff;
}
/** grid分成2个table */
.grid_new {
width: 100%;
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.grid_l {
-webkit-box-flex: 0;
-ms-flex: 0 0 100rpx;
flex: 0 0 100rpx;
}
.grid_r {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
overflow-x: scroll;
}
.grid_l table, .grid_r table {
border-collapse: separate;
border-spacing: 0;
border: 0;
}
.grid_l table th, .grid_r table th {
background: #d7d7d7;
font-size: 26rpx;
line-height: 98rpx;
color: #696969;
font-weight: bold;
white-space: nowrap;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 20rpx;
border-bottom: 10rpx solid #f5f5f5;
text-align: center;
}
.grid_l table td, .grid_r table td {
font-size: 28rpx;
line-height: 76rpx;
color: #323232;
background: #fff;
white-space: nowrap;
text-overflow: ellipsis;
white-space: nowrap;
padding: 11rpx 20rpx;
border-bottom: 10rpx solid #f5f5f5;
text-align: center;
}

View File

@@ -86,6 +86,20 @@
"navigationStyle": "custom"
}
},
{
"path" : "pages/device/WorkManage",
"style": {
"navigationStyle": "custom"
}
}
,{
"path" : "pages/device/workDetail",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {

View File

@@ -10,6 +10,8 @@
<view class="filter_input_wraper">
<search-box
v-model="val1"
:focused="true"
@handleChange="handleChange"
/>
</view>
</view>
@@ -27,11 +29,11 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.repair_code}}</td>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.maint_code === pkId}">
<td>{{e.maint_code}}</td>
<td>{{e.device_code}}</td>
<td>{{e.device_name}}</td>
<td>{{e.status_name}}</td>
<td>{{e.invstatus_name}}</td>
<td>{{e.plan_start_date}}</td>
</tr>
</tbody>
@@ -40,9 +42,8 @@
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !val1 || !pkId || !index}" :disabled="disabled" @tap="_confirmInstor">开始保养</button>
<button class="submit-button" @tap="searchList">填报</button>
<button class="submit-button" @tap="searchList">结束保养</button>
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure1">开始保养</button>
<button class="submit-button" :class="{'btn-disabled': !pkId}" @tap="toJump">结束保养</button>
</view>
</view>
</template>
@@ -50,7 +51,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
import {upkeepgetAllQuery, upkeepbegin} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -65,27 +66,44 @@
disabled: false
};
},
created () {
},
methods: {
/** 下拉框查询 */
async _statusList () {
let res = await statusList()
this.options = [...res.data]
handleChange (e) {
this._upkeepgetAllQuery(e)
},
/** 确认 */
async _confirmInstor () {
/** grid查询 */
async _upkeepgetAllQuery (e) {
let res = await upkeepgetAllQuery(e)
res.data.map(el => {
if(el.invstatus === '01') {
this.$set(el, 'invstatus_name', '生成')
}
if(el.invstatus === '02') {
this.$set(el, 'invstatus_name', '提交')
}
if(el.invstatus === '03') {
this.$set(el, 'invstatus_name', '保养开始')
}
if(el.invstatus === '06') {
this.$set(el, 'invstatus_name', '保养结束')
}
if(el.invstatus === '99') {
this.$set(el, 'invstatus_name', '审核完毕')
}
})
this.dataList = [...res.data]
},
async toSure1 () {
this.disabled = true
if (!this.val1 || !this.pkId || !this.index) {
if (!this.pkId) {
this.disabled = false
return
}
try {
let res = await confirmInstor(this.pkObj, this.val1, this.index)
let res = await upkeepbegin(this.pkObj)
this.disabled = false
this.pkId = ''
this.pkObj = {}
this.searchList()
this._upkeepgetAllQuery(this.val1)
uni.showToast({
title: res.message,
icon: 'none'
@@ -93,6 +111,18 @@
} catch (e) {
this.disabled = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.maint_code ? '' : e.maint_code
this.pkObj = this.pkId === e.maint_code ? e : {}
},
toJump () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateTo({
url: '/pages/device/MaintainFill'
})
}
}
}
}

View File

@@ -0,0 +1,126 @@
<template>
<view class="zd_container">
<nav-bar :inner2="true" @goIn="goIn" title="保养填报"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">设备</span>
</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input filter_input_disabled" disabled v-model="val1">
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">保养单</span>
</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input filter_input_disabled" disabled v-model="val2">
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>是否完成</th>
<th>保养项目名称</th>
<th>保养等级</th>
<th>保养内容</th>
<th>要求</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.maint_item_code === pkId}">
<td>{{e.indexId}}</td>
<td>
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</td>
<td>{{e.maint_item_code}}</td>
<td>{{e.item_level}}</td>
<td>{{e.contents}}</td>
<td>{{e.requirement}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="dataList.length === 0">确认</button>
<button class="submit-button" @tap="toCancle">取消</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
val2: '',
val3: '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false
};
},
created () {
},
methods: {
/** 下拉框查询 */
async _statusList () {
let res = await statusList()
this.options = [...res.data]
},
/** 确认 */
async _confirmInstor () {
this.disabled = true
if (!this.val1 || !this.pkId || !this.index) {
this.disabled = false
return
}
try {
let res = await confirmInstor(this.pkObj, this.val1, this.index)
this.disabled = false
this.pkId = ''
this.pkObj = {}
this.searchList()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.maint_item_code ? '' : e.maint_item_code
this.pkObj = this.pkId === e.maint_item_code ? e : {}
},
toCancle () {
this.$store.dispatch('setPublicObj', '')
this.goIn()
},
goIn () {
uni.redirectTo({
url: '/pages/device/EquipMaintainWork'
})
}
}
}
</script>
<style lang="stylus">
</style>

View File

@@ -31,3 +31,116 @@ export const empOutconfirm = (rows) => request({
url:'api/pda/hrBcp/empOut/confirm',
rows: rows
})
/**
* 设备保养作业
*/
// 1.1设备保养作业页面 (初始查询)-- 单选
export const upkeepgetAllQuery = (dcode) => request({
url:'api/pda/device/upkeep/getAllQuery',
data: {
device_code: dcode
}
})
// 1.2开始保养(按钮)
export const upkeepbegin = (row) => request({
url:'api/pda/device/upkeep/begin',
row: row
})
// 1.3结束保养(按钮)-- 跳转至二级页面【保养填报页面】
// 1.4保养填报页面(二级页面)
export const upkeepgetDtl = (dcode, mcode, id) => request({
url:'api/pda/device/upkeep/getDtl',
data: {
device_code: dcode,
maint_code: mcode,
maint_id: id
}
})
// 1.4.1确认(按钮)-- 是否完成全部为是【确认】按钮可点击,否则为灰色不可点击
export const upkeepconfirm = (dcode, mcode, rows) => request({
url:'api/pda/device/upkeep/confirm',
data: {
device_code: dcode,
maint_code: mcode,
rows: rows
}
})
// 1.4.2取消(按钮)-- 关闭当前页面
/**
* 设备点检作业
*/
// 1.1设备点检作业页面 (初始查询)-- 单选
export const sportcheckgetAllQuery = (dcode) => request({
url:'api/pda/device/sportcheck/getAllQuery',
data: {
device_code: dcode
}
})
// 1.2开始点检(按钮)
export const sportcheckbegin = (row) => request({
url:'api/pda/device/sportcheck/begin',
row: row
})
// 1.3结束点检(按钮)-- 跳转至二级页面【点检填报页面】
// 1.4点检填报页面(二级页面)
export const sportcheckgetDtl = (dcode, mcode, id) => request({
url:'api/pda/device/sportcheck/getDtl',
data: {
device_code: dcode,
maint_code: mcode,
maint_id: id
}
})
// 1.4.1确认(按钮)-- 是否完成全部为是【确认】按钮可点击,否则为灰色不可点击
export const sportcheckconfirm = (dcode, mcode, rows) => request({
url:'api/pda/device/sportcheck/confirm',
data: {
device_code: dcode,
maint_code: mcode,
rows: rows
}
})
// 1.4.2取消(按钮)-- 关闭当前页面
/**
* 设备润滑作业
*/
// 1.1设备润滑作业页面 (初始查询)-- 单选
export const lubricategetAllQuery = (dcode) => request({
url:'api/pda/device/lubricate/getAllQuery',
data: {
device_code: dcode
}
})
// 1.2开始润滑(按钮)
export const lubricatebegin = (row) => request({
url:'api/pda/device/lubricate/begin',
row: row
})
// 1.3结束润滑(按钮)-- 跳转至二级页面【润滑填报页面】
// 1.4润滑填报页面(二级页面)
export const lubricategetDtl = (dcode, mcode, id) => request({
url:'api/pda/device/lubricate/getDtl',
data: {
device_code: dcode,
maint_code: mcode,
maint_id: id
}
})
// 1.4.1确认(按钮)-- 是否完成全部为是【确认】按钮可点击,否则为灰色不可点击
export const lubricateconfirm = (dcode, mcode, rows) => request({
url:'api/pda/device/lubricate/confirm',
data: {
device_code: dcode,
maint_code: mcode,
rows: rows
}
})
// 1.4.2取消(按钮)-- 关闭当前页面

View File

@@ -75,14 +75,20 @@ export const deviceRepairBegin = (row) => request({
}
})
// 1.4维修填报页面(二级页面)
export const deviceRepairGetDtl = (code, rcode, id) => request({
url:'api/pda/device/repair/getDtl',
data: {
device_code: code,
repair_code: rcode,
repair_id: id
// export const deviceRepairGetDtl = (code, rcode, id) => request({
// url:'api/pda/device/repair/getDtl',
// data: {
// device_code: code,
// repair_code: rcode,
// repair_id: id
// }
// })
export const deviceRepairGetDtl = (code) => {
let res = {
data: [{isfinish: '1', repair_item_code: '99', repair_item_name: '11', requirement: '检查减速机皮带轮、配重块配合情况,更换减速机齿轮油'}, {isfinish: '0', repair_item_code: '99', repair_item_name: '11', requirement: '111'}]
}
})
return res
}
// 1.4.1确认(按钮)-- 是否完成全部为是【确认】按钮可点击,否则为灰色不可点击
export const deviceRepairConfirm = (code, rcode, rows) => request({
url:'api/pda/device/repair/confirm',