Browse Source

保养工单

master
zhang_li 10 months ago
parent
commit
231cdb9f2d
  1. 26
      api/upkeepOrder.js
  2. 103
      components/workOrderList/index.vue
  3. 7
      pages/deviceReport/myDeviceReport.vue
  4. 6
      pages/overhaulOrder/addServiceRecord.vue
  5. 11
      pages/overhaulOrder/detail.vue
  6. 3
      pages/overhaulOrder/myRepairOrder.vue
  7. 4
      pages/repairOrder/addServiceRecord.vue
  8. 10
      pages/repairOrder/detail.vue
  9. 4
      pages/repairOrder/index.vue
  10. 3
      pages/repairOrder/myRepairOrder.vue
  11. 37
      pages/upkeepOrder/addServiceRecord.vue
  12. 85
      pages/upkeepOrder/detail.vue
  13. 8
      pages/upkeepOrder/index.vue
  14. 3
      pages/upkeepOrder/myRepairOrder.vue
  15. 400
      pages/upkeepOrder/transfer.vue
  16. 284
      pages/workOrderList/addForm.vue
  17. 349
      pages/workOrderList/detail.vue
  18. 161
      pages/workOrderList/index.vue
  19. 223
      pages/workOrderList/screen.vue
  20. 181
      pages/workOrderList/transfer.vue

26
api/onkeepOrder.js → api/upkeepOrder.js

@ -2,7 +2,7 @@ import request from '@/utils/request'
// 添加工单 // 添加工单
export function onkeepOrderCreate(data) { export function upkeepOrderCreate(data) {
return request({ return request({
url: '/eam/device-maintain-order-main/create', url: '/eam/device-maintain-order-main/create',
'method': 'POST', 'method': 'POST',
@ -10,7 +10,7 @@ export function onkeepOrderCreate(data) {
}) })
} }
// 编辑工单 // 编辑工单
export function onkeepOrderUpdate(data) { export function upkeepOrderUpdate(data) {
return request({ return request({
url: '/eam/device-maintain-order-main/update', url: '/eam/device-maintain-order-main/update',
'method': 'PUT', 'method': 'PUT',
@ -18,23 +18,31 @@ export function onkeepOrderUpdate(data) {
}) })
} }
// 报修列表 // 报修列表
export function onkeepOrderPage(params) { export function upkeepOrderPage(params) {
return request({ return request({
url: '/eam/device-maintain-order-main/getAppPage', url: '/eam/device-maintain-order-main/getAppPage',
'method': 'GET', 'method': 'GET',
params params
}) })
} }
// 操作工 //
export function orderClick(params) { export function orderClick(params) {
return request({ return request({
url: '/eam/device-maintain-order-main/onClick', url: '/eam/device-maintain-order-main/orderClick',
'method': 'GET',
params
})
}
// 完成保养工单
export function orderClickFinish(params) {
return request({
url: '/eam/device-maintain-order-main/orderClickFinish',
'method': 'GET', 'method': 'GET',
params params
}) })
} }
// 添加维修工单子项维修内容 // 添加维修工单子项维修内容
export function onkeepOrderDetailCreate(data) { export function upkeepOrderDetailCreate(data) {
return request({ return request({
url: '/eam/device-maintain-order-detail/create', url: '/eam/device-maintain-order-detail/create',
'method': 'POST', 'method': 'POST',
@ -42,7 +50,7 @@ export function onkeepOrderDetailCreate(data) {
}) })
} }
// 编辑维修工单子项维修内容 // 编辑维修工单子项维修内容
export function onkeepOrderDetailUpdate(data) { export function upkeepOrderDetailUpdate(data) {
return request({ return request({
url: '/eam/device-maintain-order-detail/update', url: '/eam/device-maintain-order-detail/update',
'method': 'PUT', 'method': 'PUT',
@ -50,7 +58,7 @@ export function onkeepOrderDetailUpdate(data) {
}) })
} }
// 获得维修工单子列表 // 获得维修工单子列表
export function onkeepOrderDetailList(params) { export function upkeepOrderDetailList(params) {
return request({ return request({
url: '/eam/device-maintain-order-detail/selectListByNumber', url: '/eam/device-maintain-order-detail/selectListByNumber',
'method': 'GET', 'method': 'GET',
@ -58,7 +66,7 @@ export function onkeepOrderDetailList(params) {
}) })
} }
// 删除维修工单子 // 删除维修工单子
export function onkeepOrderDetailDelete(id) { export function upkeepOrderDetailDelete(id) {
return request({ return request({
url: '/eam/device-maintain-order-detail/delete?id='+id, url: '/eam/device-maintain-order-detail/delete?id='+id,
'method': 'DELETE' 'method': 'DELETE'

103
components/workOrderList/index.vue

@ -1,103 +0,0 @@
<template>
<view class="content">
<view class="list">
<view class="item" v-for="(item,index) in data.list" :key="index" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.title}}
</view>
<view class="time" v-if="data.isShowTime">
2023-12-12 08:00:00
</view>
</view>
<view class="dec" v-for="(cur,key) in labelList" :key="key">
{{cur.label}}:<span>{{item[cur.field]}}</span>
</view>
<view class="bottom" v-if="data.isShowStatus">
<view class="time">
{{item.time}}
</view>
<view class="status">
<u-tag text="待领取" v-if="item.status==1" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="撤单" v-else-if="item.status==2" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
<u-tag text="待执行" v-else-if="item.status==3" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/>
<u-tag text="维修中" v-else-if="item.status==4" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="待验证" v-else-if="item.status==5" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status==6" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
labelList:{
type: Array,
default:()=>{return []},
},
data:{
type: Object,
default:()=>{return {}},
},
},
data() {
return {
}
},
methods: {
itemClick(item,index){
this.$emit('itemClick',item,index)
}
}
}
</script>
<style lang="scss" scoped>
.list{
background: #f5f5f5;
margin-top: 20rpx;
.item{
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title{
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt{
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time{
color: #919191;
}
}
.dec{
padding-bottom: 20rpx;
span{
color: #999999;
}
}
.last{
padding-bottom: 30rpx;
}
.bottom{
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
}
}
}
</style>

7
pages/deviceReport/myDeviceReport.vue

@ -48,12 +48,8 @@
</template> </template>
<script> <script>
import workOrderList from '@/components/workOrderList/index.vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device.js"
export default { export default {
components: {
workOrderList
},
data() { data() {
return { return {
params: { params: {
@ -72,9 +68,6 @@
screen() { screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`) this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
}, },
itemClick(item, index) {
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`)
},
addForm() { addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
}, },

6
pages/overhaulOrder/addServiceRecord.vue

@ -64,7 +64,7 @@
<view class="item-box"> <view class="item-box">
<view class="spare-title"> <view class="spare-title">
<view class="title-txt"> <view class="title-txt">
{{selectFormat(item.number,sparePartsList)}} {{item.name}}
</view> </view>
</view> </view>
<u-row gutter="16"> <u-row gutter="16">
@ -400,6 +400,7 @@
this.$modal.showToast('请输入数量') this.$modal.showToast('请输入数量')
return; return;
} }
this.form1.name=this.selectFormat(this.form1.number,this.sparePartsList)
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) { if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number) let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number)
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
@ -460,8 +461,7 @@
.data)).id) { .data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data)) this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form,'itemNumbers',this.form.items) this.$set(this.form,'itemNumbers',this.form.items)
this.formatDate = this.$time.formatDate(this.form.completionTime) this.formatDate =this.form.completionTime ? this.$time.formatDate(this.form.completionTime):''
}; };
this.jxDetailsStatus = await dictApi.getDict('jx_details_status') this.jxDetailsStatus = await dictApi.getDict('jx_details_status')

11
pages/overhaulOrder/detail.vue

@ -24,6 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
<div class="line"></div>
<view class="info" style="padding-bottom: 130rpx;"> <view class="info" style="padding-bottom: 130rpx;">
<view class="tab"> <view class="tab">
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current" <u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current"
@ -286,11 +287,19 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-container{
min-height: 100vh;
background: white;
}
.line{
background: #f5f5f5;
height: 20rpx;
}
.info { .info {
background: white; background: white;
margin-bottom: 20rpx;
} }
.tab { .tab {
border-bottom: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4;

3
pages/overhaulOrder/myRepairOrder.vue

@ -68,9 +68,6 @@
screen() { screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`) this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
}, },
itemClick(item, index) {
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`)
},
addForm() { addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
}, },

4
pages/repairOrder/addServiceRecord.vue

@ -31,7 +31,7 @@
<view class="item-box"> <view class="item-box">
<view class="spare-title"> <view class="spare-title">
<view class="title-txt"> <view class="title-txt">
{{selectFormat(item.number,sparePartsList)}} {{item.name}}
</view> </view>
</view> </view>
<u-row gutter="16"> <u-row gutter="16">
@ -315,6 +315,7 @@
this.$modal.showToast('请输入数量') this.$modal.showToast('请输入数量')
return; return;
} }
this.form1.name=this.selectFormat(this.form1.number,this.sparePartsList)
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) { if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number) let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number)
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
@ -340,7 +341,6 @@
.data)).id) { .data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data)) this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form,'itemNumbers',this.form.items) this.$set(this.form,'itemNumbers',this.form.items)
console.log('99',this.form)
}; };
await this.getSelecUser() await this.getSelecUser()
await this.getSparePartsList() await this.getSparePartsList()

10
pages/repairOrder/detail.vue

@ -29,6 +29,7 @@
</view> </view>
</view> </view>
</view> </view>
<div class="line"></div>
<view class="info" style="padding-bottom: 130rpx;"> <view class="info" style="padding-bottom: 130rpx;">
<view class="tab"> <view class="tab">
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current" <u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current"
@ -323,9 +324,16 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-container{
min-height: 100vh;
background: white;
}
.line{
background: #f5f5f5;
height: 20rpx;
}
.info { .info {
background: white; background: white;
margin-bottom: 20rpx;
} }
.tab { .tab {

4
pages/repairOrder/index.vue

@ -60,12 +60,8 @@
</template> </template>
<script> <script>
import workOrderList from '@/components/workOrderList/index.vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
export default { export default {
components: {
workOrderList
},
data() { data() {
return { return {
params: { params: {

3
pages/repairOrder/myRepairOrder.vue

@ -68,9 +68,6 @@
screen() { screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`) this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
}, },
itemClick(item, index) {
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`)
},
addForm() { addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
}, },

37
pages/upkeepOrder/addServiceRecord.vue

@ -2,9 +2,12 @@
<!-- 添加维修工单 --> <!-- 添加维修工单 -->
<view class="add-form-container"> <view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx"> <u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="检修描述" prop="name" required> <u-form-item label="保养内容" prop="contents" required class="disabled">
<u-input v-model="form.name" placeholder="请输入检修描述" maxlength="50"/> <u-input v-model="form.contents" placeholder="请输入保养内容" maxlength="50" disabled/>
</u-form-item> </u-form-item>
<!-- <u-form-item label="保养部位" prop="equipmentParts" required>
<u-input v-model="form.equipmentParts" placeholder="请输入保养部位" maxlength="50" disabled/>
</u-form-item> -->
<u-form-item label="预估人数" prop="peoples" required> <u-form-item label="预估人数" prop="peoples" required>
<u-input v-model="form.peoples" type="number" placeholder="请输入预估人数" maxlength="50"/> <u-input v-model="form.peoples" type="number" placeholder="请输入预估人数" maxlength="50"/>
</u-form-item> </u-form-item>
@ -64,7 +67,7 @@
<view class="item-box"> <view class="item-box">
<view class="spare-title"> <view class="spare-title">
<view class="title-txt"> <view class="title-txt">
{{selectFormat(item.number,sparePartsList)}} {{item.name}}
</view> </view>
</view> </view>
<u-row gutter="16"> <u-row gutter="16">
@ -139,7 +142,7 @@
</template> </template>
<script> <script>
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder.js"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts.js"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
@ -201,10 +204,6 @@
// //
submit() { submit() {
// //
if (!this.form.name) {
this.$modal.showToast('请输入检修描述')
return;
}
if (!this.form.peoples) { if (!this.form.peoples) {
this.$modal.showToast('请输入预估人数') this.$modal.showToast('请输入预估人数')
return; return;
@ -252,10 +251,10 @@
return; return;
} }
if (this.form.id) { if (this.form.id) {
this.$modal.confirm('是否修改检修内容').then(() => { this.$modal.confirm('是否修改保养内容').then(() => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
this.loading = true this.loading = true
overhaulOrderApi.overhaulOrderDetailUpdate(this.form).then((res) => { upkeepOrderApi.upkeepOrderDetailUpdate(this.form).then((res) => {
this.$modal.closeLoading() this.$modal.closeLoading()
if (res.data) { if (res.data) {
this.$modal.showToast('修改成功') this.$modal.showToast('修改成功')
@ -276,7 +275,7 @@
this.$modal.confirm('是否添加检修内容').then(() => { this.$modal.confirm('是否添加检修内容').then(() => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
this.loading = true this.loading = true
overhaulOrderApi.overhaulOrderDetailCreate(this.form).then((res) => { upkeepOrderApi.upkeepOrderDetailCreate(this.form).then((res) => {
this.$modal.closeLoading() this.$modal.closeLoading()
if (res.data) { if (res.data) {
this.$modal.showToast('添加成功') this.$modal.showToast('添加成功')
@ -386,6 +385,7 @@
open() { open() {
this.form1 = { this.form1 = {
number: "", number: "",
name:'',
qty: '' qty: ''
} }
this.isPopupShow = true this.isPopupShow = true
@ -400,6 +400,7 @@
this.$modal.showToast('请输入数量') this.$modal.showToast('请输入数量')
return; return;
} }
this.form1.name=this.selectFormat(this.form1.number,this.sparePartsList)
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) { if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number) let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number)
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
@ -460,9 +461,9 @@
.data)).id) { .data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data)) this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form,'itemNumbers',this.form.items) this.$set(this.form,'itemNumbers',this.form.items)
this.formatDate = this.$time.formatDate(this.form.completionTime) this.formatDate =this.form.completionTime ? this.$time.formatDate(this.form.completionTime):''
}; };
console.log(this.form)
this.jxDetailsStatus = await dictApi.getDict('jx_details_status') this.jxDetailsStatus = await dictApi.getDict('jx_details_status')
await this.getSelecUser() await this.getSelecUser()
@ -475,9 +476,14 @@
.add-form-container { .add-form-container {
min-height: calc(100vh - 140rpx); min-height: calc(100vh - 140rpx);
background: white; background: white;
padding: 0px 30rpx 140rpx; padding: 0px 0rpx 140rpx;
}
.u-form-item{
padding: 20rpx 30rpx;
}
.disabled{
background: #f5f5f5;
} }
.footer { .footer {
position: fixed; position: fixed;
@ -558,6 +564,7 @@
} }
.list { .list {
padding: 0px 30rpx;
.item { .item {
display: flex; display: flex;
margin-bottom: 20rpx; margin-bottom: 20rpx;

85
pages/upkeepOrder/detail.vue

@ -3,7 +3,7 @@
<view class="detail-container"> <view class="detail-container">
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view>检修工单</view> <view>保养工单</view>
</view> </view>
<view class="dec"> <view class="dec">
<view class="dec-item"> <view class="dec-item">
@ -24,6 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
<div class="line"></div>
<view class="info" style="padding-bottom: 130rpx;"> <view class="info" style="padding-bottom: 130rpx;">
<view class="tab"> <view class="tab">
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current" <u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current"
@ -58,11 +59,13 @@
<view class="item-box"> <view class="item-box">
<view class="spare-title"> <view class="spare-title">
<view class="title-txt"> <view class="title-txt">
{{item.name}} {{item.contents}}
</view> </view>
<u-icon name="trash" color="#aaaaaa" size="40"
@click.native.stop="delService(item)"></u-icon>
</view> </view>
<!-- <view class="dec2">
<view>保养部位</view>
<view>{{item.equipmentParts}}</view>
</view> -->
<view class="dec2"> <view class="dec2">
<view>预估人数</view> <view>预估人数</view>
<view>{{item.peoples}}</view> <view>{{item.peoples}}</view>
@ -112,16 +115,14 @@
</view> </view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
<view class="add-btn" v-if="data.status == 'PROCCED'" >
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加检修内容</u-button>
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" v-if="data.status == 'PROCCED'" @click="orderClick()" :loading='loading' <u-button type="primary" v-if="data.status == 'PENDING'" @click="orderClick(1)" :loading='loading'
:disabled='loading'>接单</u-button>
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(2)" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
@ -134,7 +135,7 @@
import SparePartsCard from '@/components/sparePartsCard/index.vue' import SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold.js"
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder.js"
export default { export default {
components: { components: {
Form, Form,
@ -145,7 +146,7 @@
list: [{ list: [{
name: '设备信息' name: '设备信息'
}, { }, {
name: '检修内容' name: '保养内容'
}], }],
current: 0, current: 0,
changeItem: '', changeItem: '',
@ -169,11 +170,11 @@
} }
if (clickType == 'updata') { if (clickType == 'updata') {
this.$tab.navigateTo( this.$tab.navigateTo(
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}&data=${encodeURIComponent(JSON.stringify(item))}` `/pages/upkeepOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}&data=${encodeURIComponent(JSON.stringify(item))}`
) )
} else { } else {
this.$tab.navigateTo( this.$tab.navigateTo(
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}` `/pages/upkeepOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}`
) )
} }
}, },
@ -210,22 +211,39 @@
} }
}, },
// APP // APP
orderClick() { orderClick(type) {
if(type == 2){
if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){ if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){
this.$modal.showToast('请添加检修内容') this.$modal.showToast('请添加保养内容')
return; return;
} }
}
const data = { const data = {
// number: this.data.number, id: this.data.id
// status: this.data.status,
id: this.data.id,
// requestNumber: ''
} }
let tips = '是否完成' let tips = this.data.status == 'PENDING' ? '是否接单?' : this.data.status == 'PECEIVED' ? '是否完成?' : ''
this.$modal.confirm(tips).then(() => { this.$modal.confirm(tips).then(() => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
this.loading = true this.loading = true
overhaulOrderApi.orderClick(data).then((res) => { if(type == 1){
upkeepOrderApi.orderClick(data).then((res) => {
if (res.data) {
this.$modal.showToast('操作成功')
setTimeout(() => {
this.$tab.navigateBack()
this.loading = false
}, 1500)
} else {
this.$modal.showToast('操作失败')
this.loading = false
}
}).catch(() => {
this.$modal.closeLoading()
this.loading = false
})
}else if(type == 2){
upkeepOrderApi.orderClickFinish(data).then((res) => {
if (res.data) { if (res.data) {
this.$modal.showToast('操作成功') this.$modal.showToast('操作成功')
setTimeout(() => { setTimeout(() => {
@ -240,11 +258,13 @@
this.$modal.closeLoading() this.$modal.closeLoading()
this.loading = false this.loading = false
}) })
}
}) })
}, },
// //
getOverhaulOrderDetailList() { getUpkeepOrderDetailList() {
overhaulOrderApi.overhaulOrderDetailList({ upkeepOrderApi.upkeepOrderDetailList({
number: this.data.number number: this.data.number
}).then((res) => { }).then((res) => {
if (res.data) { if (res.data) {
@ -256,17 +276,13 @@
delService(item) { delService(item) {
this.$modal.confirm('确定删除检修内容吗?').then(() => { this.$modal.confirm('确定删除检修内容吗?').then(() => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => { upkeepOrderApi.upkeepOrderDetailDelete(item.id).then((res) => {
this.$modal.closeLoading() this.$modal.closeLoading()
this.getOverhaulOrderDetailList() this.getUpkeepOrderDetailList()
}) })
}) })
}, },
//
transfer() {
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`)
}
}, },
onLoad(option) { onLoad(option) {
if (option.type) this.type = option.type; if (option.type) this.type = option.type;
@ -280,15 +296,22 @@
}, },
onShow() { onShow() {
this.getDetailsByNumber() this.getDetailsByNumber()
this.getOverhaulOrderDetailList() this.getUpkeepOrderDetailList()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-container{
min-height: 100vh;
background: white;
}
.line{
background: #f5f5f5;
height: 20rpx;
}
.info { .info {
background: white; background: white;
margin-bottom: 20rpx;
} }
.tab { .tab {

8
pages/upkeepOrder/index.vue

@ -52,7 +52,7 @@
</template> </template>
<script> <script>
import * as onkeepOrderApi from "@/api/onkeepOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder.js"
export default { export default {
data() { data() {
return { return {
@ -69,20 +69,20 @@
methods: { methods: {
// //
screen() { screen() {
this.$tab.navigateTo(`/pages/onkeepOrder/screen?type=${this.params.type}`) this.$tab.navigateTo(`/pages/upkeepOrder/screen?type=${this.params.type}`)
}, },
itemClick(item, index) { itemClick(item, index) {
this.$tab.navigateTo(`/pages/upkeepOrder/detail?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`) this.$tab.navigateTo(`/pages/upkeepOrder/detail?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
}, },
addForm(item) { addForm(item) {
this.$tab.navigateTo(`/pages/onkeepOrder/addForm?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`) this.$tab.navigateTo(`/pages/upkeepOrder/addForm?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
}, },
// //
getList() { getList() {
if (this.status == 'nomore') return; if (this.status == 'nomore') return;
this.status = 'loading'; this.status = 'loading';
this.$modal.loading('加载中') this.$modal.loading('加载中')
onkeepOrderApi.onkeepOrderPage(this.params).then((res) => { upkeepOrderApi.upkeepOrderPage(this.params).then((res) => {
this.$modal.closeLoading() this.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list); this.list = this.list.concat(res.data.list);

3
pages/upkeepOrder/myRepairOrder.vue

@ -68,9 +68,6 @@
screen() { screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`) this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
}, },
itemClick(item, index) {
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`)
},
addForm() { addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
}, },

400
pages/upkeepOrder/transfer.vue

@ -1,400 +0,0 @@
<template>
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="类型" prop="receiverType" required>
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)">
<view class="input" v-if='form.receiverType'>
{{selectFormat(form.receiverType,appDeviceMoldType)}}
</view>
<view class="placeholder" v-else>
{{`请选择类型`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceNumber" required>
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceNumber'>
{{selectFormat(form.deviceNumber,deviceList)}}
</view>
<view class="placeholder" v-else>
{{`请选择${type=='DEVICE'?'设备' : '模具'}名称`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item label="维修人员" prop="describes" required>
<view class="select" @click="openSelecUser('receiverUserId')">
<view class="input" v-if='form.receiverUserId'>
{{selectFormatRadin(form.receiverUserId,selecUserList)}}
</view>
<view class="placeholder" v-else>
请选择维修人员
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
</u-form>
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
<button class="sure" @click="submit" :loading='loading' :disabled='loading'>确定</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<!-- 选择维修人员 -->
<u-popup v-model="isShowSelecUser" mode="center" border-radius="14">
<view class="popup-title">选择维修人员</view>
<view class="popup">
<u-radio-group v-model="form.receiverUserId"
@change="radioGroupChange('receiverUserId',form.receiverUserId,selecUserList)">
<u-radio v-for="(item, index) in selecUserList" :key="index" :name="item.id">
{{item.name}}
</u-radio>
</u-radio-group>
</view>
<view class="popup-footer">
<view @click="isShowSelecUser = false">取消</view>
<view class="sure" @click="chooseUser">确认</view>
</view>
</u-popup>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
</view>
</template>
<script>
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js"
import * as deptApi from "@/api/dept.js"
export default {
data() {
return {
loading: false,
type: "",
appDeviceMoldType: [], //
form: {
id: '',
receiverType: "",
deviceNumber: '',
deviceName: '',
receiverUserId: '',
},
deviceList: [], //
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
field: '',
//
selecUserList: [], //
isShowSelecUser: false,
}
},
methods: {
//
submit() {
//
if (!this.form.receiverType) {
this.$modal.showToast('请选择类型')
return;
}
if (!this.form.deviceNumber) {
this.$modal.showToast(`请选择${this.type=='DEVICE'?'设备' : '模具'}名称`)
return;
}
if (!this.form.receiverUserId) {
this.$modal.showToast('请选择维修人员')
return;
}
const data = {
id: this.form && this.form.id ? this.form.id : '',
receiverType: this.form.receiverType,
deviceNumber: this.form.deviceNumber,
receiverUserId: this.form.receiverUserId,
}
this.$modal.confirm('是否转办维修工单').then(() => {
this.$modal.loading('加载中')
this.loading = true
repairOrderApi.transfer(data).then((res) => {
this.$modal.closeLoading()
if (res.data) {
this.$modal.showToast('转办成功')
setTimeout(() => {
this.$tab.navigateBack(2)
this.loading = false
}, 1500)
} else {
this.$modal.showToast('转办失败')
this.loading = false
}
}).catch(() => {
this.$modal.closeLoading()
this.loading = false
})
})
},
//
reset() {
if (this.form.id) {
this.form.receiverType = "";
this.form.deviceNumber = '';
this.form.deviceName = '';
this.form.receiverUserId = '';
} else {
this.form = {}
}
},
//
selectFormat(val, array) {
let str = array.filter(item => item.value == val)[0].label
return str
},
//
openSingleColumn(field, val, list) {
this.singleColumnList = list
this.field = field
if (val) {
this.singleColumnDefaultValue = [list.findIndex(item => item.value == val)]
} else {
this.singleColumnDefaultValue = []
}
this.singleColumnShow = true
},
//
chooseSingleColumn(e) {
console.log(e[0])
this.form[this.field] = e[0].value
if (this.field == 'receiverType') {
this.type = this.form[this.field]
this.form.deviceName = ''
this.form.deviceNumber = ''
this.getDeviceList()
} else if (this.field == 'deviceNumber') {
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value)
this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName
this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber
this.getSelecUser()
}
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
},
// /
async getDeviceList() {
if (this.type == 'DEVICE') {
await deviceApi.deviceList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.deviceList = res.data
})
} else if (this.type == 'MOLD') {
await moldApi.moldList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.deviceList = res.data
})
}
},
//
async getSelecUser() {
let data = {
classType: this.type,
factoryAreaNumber: this.form.factoryAreaNumber,
flag: 1
}
let arr = []
if (this.form.maintenances) {
arr = this.form.maintenances.split(',')
}
await deptApi.getSelecUser(data).then(res => {
res.data.forEach(item => {
item.checked = false
arr.forEach(cur => {
if (item.id == cur) {
item.checked = true
}
})
})
this.selecUserList = res.data
})
},
//
openSelecUser(field) {
this.field = field
this.isShowSelecUser = true
},
radioGroupChange(field, e, list) {
this.chooseUserInfo = e
},
//
selectFormatRadin(val, array) {
let str = array.filter(item => item.id == val)[0].name
return str
},
//
chooseUser() {
this.form[this.field] = this.chooseUserInfo
this.isShowSelecUser = false
},
},
async onLoad(option) {
if (option.type) this.type = option.type;
if (option.id) this.form.id = option.id;
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
this.appDeviceMoldType = this.appDeviceMoldType.filter(item => item.value != this.type)
}
}
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.list {
padding-bottom: 20rpx;
.item {
margin-top: 20rpx;
background: white;
padding: 30rpx;
display: flex;
align-items: center;
image {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
}
.dec1 {
font-size: 28rpx;
margin-top: 16rpx;
color: #acacac;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
.right-button {
background: #409eff;
color: white;
padding: 0rpx 30rpx;
border-radius: 16rpx;
text-align: center;
font-size: 28rpx;
}
.select {
display: flex;
align-items: center;
height: 72rpx;
width: 100%;
.input {
flex: 1;
font-size: 28rpx;
color: #000000;
}
.placeholder {
flex: 1;
font-size: 28rpx;
color: rgb(192, 196, 204);
}
}
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx 30rpx 0px
}
.popup {
width: 600rpx;
padding: 30rpx 60rpx 30rpx;
}
.popup-footer {
display: flex;
border-top: 1px solid #e4e4e4;
view {
line-height: 100rpx;
flex: 1;
text-align: center;
&.sure {
color: #409eff;
}
}
}
::v-deep .u-radio-group {
display: grid !important;
}
</style>

284
pages/workOrderList/addForm.vue

@ -1,284 +0,0 @@
<template>
<!-- 设备 -->
<view class="add-form-container">
<Form :form='form' :data='data' ref="form1" @chickRightButton='chickRightButton' @blur='blur'></Form>
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
<button class="sure" @click="submit">确定</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</view>
</template>
<script>
import Form from '@/components/form/index.vue'
import * as deviceApi from "@/api/device.js"
export default {
components: {
Form
},
data() {
return {
type:'',
form: {
disabled: false,
visible: true,
loading: false,
labelWidth: '180rpx',
border: true,
errorType: ['toast'],
formData: [{
type: 'text',
field: 'code',
label: '报修主题',
disabled: false,
required: true,
value: ''
}, {
type: 'text',
field: 'name',
label: '设备名称',
disabled: false,
required: true,
value: '',
isRightButton: '扫描'
}, {
type: 'text',
field: 'location',
label: '存放位置',
}, {
type: 'singleColumn',
field: 'type',
label: '紧急程度',
required: true,
list: [{
label: '程度1',
value: 1
}, {
label: '程度2',
value: 2
}, {
label: '程度3',
value: 3
}]
}, {
type: 'text',
field: 'location',
label: '故障描述',
}],
},
data: {
name: '',
sex: 2,
deviceNumber:'',
deviceName: '',
factoryName: '',
time: '2023-12-12 08:00:00'
}
}
},
methods: {
//
chickRightButton(field) {
//
if(field == 'deviceNumber'){
uni.scanCode({
success: function (res) {
this.data.deviceNumber = res.result
this.getDetailsByNumber()
}
});
}
},
blur(val,field){
console.log(field)
this.data.deviceNumber = val
if(field == 'deviceNumber'){
this.getDetailsByNumber()
}
},
// /
getDetailsByNumber(){
const data = {
number :this.data.deviceNumber,
type:this.type,
id:''
}
console.log(data)
deviceApi.getDetailsByNumber(data).then((res)=>{
this.data.deviceName = res.data.name
this.data.factoryName = res.data.factoryName
this.$forceUpdate()
})
},
//
submit() {
//
if(this.type == 1){
}
// for (let i = 0; i < this.form.formData.length; i++) {
// if (this.form.formData[i].required === true) {
// if (!this.data[this.form.formData[i].field]) {
// let placeholder = ''
// if (this.form.formData[i].type == 'text' || this.form.formData[i].type == 'textarea') {
// placeholder = ''
// } else {
// placeholder = ''
// }
// this.$modal.showToast(placeholder + this.form.formData[i].label)
// return;
// }
// }
// }
console.log('表单数据信息1:', this.data);
},
//
reset() {
console.log('表单数据信息1:', this.data);
this.data = {}
},
},
onLoad(option) {
this.type = option.type
if(option.type == 1){
uni.setNavigationBarTitle({
title:'添加报修'
})
this.type = 'DEVICE'
this.form= {
disabled: false,
visible: true,
loading: false,
labelWidth: '180rpx',
border: true,
errorType: ['toast'],
formData: [{
type: 'text',
field: 'describes',
label: '故障描述',
disabled: false,
required: true,
value: ''
}, {
type: 'text',
field: 'deviceNumber',
label: '设备编码',
disabled: false,
required: true,
value: '',
isRightButton: '扫描'
}, {
type: 'text',
field: 'deviceName',
label: '设备名称',
required: true,
}, {
type: 'text',
field: 'factoryName',
label: '所属厂区',
required: true,
}],
}
}else if(option.type == 2){
uni.setNavigationBarTitle({
title:'添加维修工单'
})
}else if(option.type == 3){
uni.setNavigationBarTitle({
title:'添加检修工单'
})
}else if(option.type == 4){
uni.setNavigationBarTitle({
title:'添加点检工单'
})
}else if(option.type == 5){
uni.setNavigationBarTitle({
title:'添加保养工单'
})
}
}
}
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.list {
padding-bottom: 20rpx;
.item {
margin-top: 20rpx;
background: white;
padding: 30rpx;
display: flex;
align-items: center;
image {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
}
.dec1 {
font-size: 28rpx;
margin-top: 16rpx;
color: #acacac;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
</style>

349
pages/workOrderList/detail.vue

@ -1,349 +0,0 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>维修工单</view>
<view>转班</view>
</view>
<view class="dec">
<view class="dec-item">
<view>工单单号</view>
<view>WXDH2051351</view>
</view>
<view class="dec-item">
<view>工单主题</view>
<view>设备一维修2554</view>
</view>
<view class="dec-item">
<view>工单类型</view>
<view>报修工单</view>
</view>
<view class="dec-item">
<view>维修班组</view>
<view>维修班组一</view>
</view>
<view class="dec-item">
<view>工程师</view>
<view>橙子</view>
</view>
<view class="dec-item">
<view>维修工</view>
<view>香蕉</view>
</view>
</view>
</view>
<view class="info" style="padding-bottom: 130rpx;">
<view class="tab">
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current"
@change="change"></u-tabs>
</view>
<view>
<view class="title">
<view>{{changeItem.name}}</view>
</view>
<view class="dec" v-if="current == 0">
<view class="dec-item">
<view>设备编号</view>
<view>WXDH2051351</view>
</view>
<view class="dec-item">
<view>设备名称</view>
<view>设备一维修2554</view>
</view>
<view class="dec-item">
<view>规格型号</view>
<view>报修工单</view>
</view>
<view class="dec-item">
<view>设备类型</view>
<view>维修班组一</view>
</view>
<view class="dec-item">
<view>存放位置</view>
<view>橙子</view>
</view>
<view class="dec-item">
<view>使用部门</view>
<view>香蕉</view>
</view>
</view>
<view class="dec" v-if="current == 1">
<view class="dec-item">
<view>设备编号</view>
<view>WXDH2051351</view>
</view>
<view class="dec-item">
<view>设备名称</view>
<view>设备一维修2554</view>
</view>
<view class="dec-item">
<view>规格型号</view>
<view>报修工单</view>
</view>
<view class="dec-item">
<view>设备类型</view>
<view>维修班组一</view>
</view>
<view class="dec-item">
<view>存放位置</view>
<view>橙子</view>
</view>
<view class="dec-item">
<view>使用部门</view>
<view>香蕉</view>
</view>
</view>
<view class="dec" v-if="current == 2">
<SparePartsCard :subForm='subForm' :data='data' @addSubForm='addSubForm' @delSubFormItem='delSubFormItem'>
</SparePartsCard>
</view>
</view>
</view>
<view class="footer">
<view class="btns">
<u-button type="primary">保存/接单</u-button>
<u-button type="primary">完成</u-button>
<u-button type="primary">验证完结</u-button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<u-popup v-model="isPopupShow" mode="center" border-radius="14">
<view class="popup-title">添加记录</view>
<view class="popup">
<Form :form='subForm' :data='data' ref="form2"></Form>
</view>
<view class="popup-footer">
<view @click="cancle">取消</view>
<view class="sure" @click="addSpare">确认</view>
</view>
</u-popup>
</view>
</template>
<script>
import Form from '@/components/form/index.vue'
import SparePartsCard from '@/components/sparePartsCard/index.vue'
export default {
components: {
Form,
SparePartsCard
},
data() {
return {
list: [{
name: '设备信息'
}, {
name: '报修信息'
}, {
name: '维修记录'
}],
current: 0,
changeItem: '',
data: {
name: '',
subList: [{
name: '备件111111',
stork: '1',
number: '30',
}, {
name: '备件111111',
stork: '1',
number: '30',
}]
},
isPopupShow:false,
subForm: {
formLabel: '',
formField: 'subList',
required: true,
isShowButton: true,
disabled: false,
visible: true,
loading: false,
labelWidth: '180rpx',
border: true,
errorType: ['toast'],
formData: [{
type: 'singleColumn',
field: 'name',
label: '模具',
disabled: false,
required: true,
span: 12,
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}, {
type: 'text',
field: 'stork',
label: '库存',
disabled: false,
required: true,
isList: true,
span: 6
}, {
type: 'text',
field: 'number',
label: '数量',
disabled: false,
required: true,
isList: true,
span: 6
}],
},
}
},
methods: {
change(index) {
console.log("index", index);
this.current = index
this.changeItem = this.list[this.current]
},
//
addSubForm() {
console.log(5)
this.isPopupShow = true
},
//
addSpare(){
//
for (let i = 0; i < this.subForm.formData.length; i++) {
if (this.subForm.formData[i].required === true) {
if (!this.data[this.subForm.formData[i].field]) {
let placeholder = '请输入'
if (this.subForm.formData[i].type == 'text' || this.subForm.formData[i].type == 'textarea') {
placeholder = '请输入'
} else {
placeholder = '请选择'
}
this.$modal.showToast(placeholder + this.subForm.formData[i].label)
return;
}
}
}
},
//
cancle(){
this.isPopupShow = false
},
},
onLoad() {
this.changeItem = this.list[this.current]
}
}
</script>
<style lang="scss" scoped>
.info {
background: white;
margin-bottom: 20rpx;
}
.tab {
border-bottom: 1px solid #e4e4e4;
}
.title {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
view {
&:nth-child(1) {
flex: 1;
border-left: 10rpx solid #409eff;
padding-left: 20rpx;
font-weight: bold;
}
}
}
.dec {
padding: 30rpx;
.dec-item {
padding-bottom: 30rpx;
display: flex;
view {
&:nth-child(1) {
width: 160rpx;
}
&:nth-child(2) {
color: #888888;
flex: 1;
}
}
}
}
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx
}
.popup {
width: 600rpx;
padding: 0rpx 60rpx 0rpx;
}
.popup-footer{
display: flex;
border-top: 1px solid #e4e4e4;
view{
line-height: 100rpx;
flex: 1;
text-align: center;
&.sure{
color: #409eff;
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
background: white;
z-index: 22;
}
.btns {
display: flex;
padding: 20rpx;
box-shadow: 0px -2rpx 20rpx rgba(0, 0, 0, 0.1);
button {
flex: 1;
margin: 0px 10rpx;
}
.sure {
background: #409eff;
color: white;
border-radius: 8rpx;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
}
</style>

161
pages/workOrderList/index.vue

@ -1,161 +0,0 @@
<template>
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
:title="title">
<template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon>
</template>
</u-navbar>
<Search @search='search' @screen='screen' />
<workOrderList :data="data" :labelList='labelList' @itemClick="itemClick"></workOrderList>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import workOrderList from '@/components/workOrderList/index.vue'
export default {
components: {
workOrderList
},
data() {
return {
title:'',
type:'',
labelList:[{
label: '报修单号',
field: 'dec1',
},{
label: '设备名称',
field: 'dec2',
},{
label: '设备编号',
field: 'dec3',
},{
label: '存放位置',
field: 'dec4',
},{
label: '紧急程度',
field: 'dec5',
}],
data: {
isShowTime: true,
list: [{
title: '设备报修205245',
dec1: 'BX-20224648',
dec2: 'BX-20224648',
dec3: 'BX-20224648',
dec4: 'BX-20224648',
dec5: 'BX-20224648',
time: '2023-12-12 06:00:00',
status: 6
}, {
title: '设备报修205245',
dec1: 'BX-20224648',
dec2: 'BX-20224648',
dec3: 'BX-20224648',
dec4: 'BX-20224648',
dec5: 'BX-20224648',
time: '2023-12-12 06:00:00',
status: 2
}, {
title: '设备报修205245',
dec1: 'BX-20224648',
dec2: 'BX-20224648',
dec3: 'BX-20224648',
dec4: 'BX-20224648',
dec5: 'BX-20224648',
time: '2023-12-12 06:00:00',
status: 3
}, {
title: '设备报修205245',
dec1: 'BX-20224648',
dec2: 'BX-20224648',
dec3: 'BX-20224648',
dec4: 'BX-20224648',
dec5: 'BX-20224648',
time: '2023-12-12 06:00:00',
status: 4
}]
}
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/workOrderList/screen?type=${this.type}`)
},
itemClick(item,index){
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`)
},
addForm(){
this.$tab.navigateTo(`/pages/workOrderList/addForm?type=${this.type}`)
},
//
},
onLoad(option) {
this.type = option.type
if(option.type == 1){
this.title = '设备报修'
}else if(option.type == 2){
this.title = '维修工单'
}else if(option.type == 3){
this.title = '检修工单'
}else if(option.type == 4){
this.title = '点检工单'
}else if(option.type == 5){
this.title = '保养工单'
}
}
}
</script>
<style lang="scss" scoped>
.list{
background: #f5f5f5;
margin-top: 20rpx;
.item{
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title{
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt{
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time{
color: #919191;
}
}
.dec{
padding-bottom: 20rpx;
span{
color: #999999;
}
}
.last{
padding-bottom: 30rpx;
}
.bottom{
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
}
}
}
</style>

223
pages/workOrderList/screen.vue

@ -1,223 +0,0 @@
<template>
<!-- 设备 -->
<view class="add-form-container">
<Form :form='form' :data='data' ref="form1"></Form>
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
<button class="sure" @click="submit">确定</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</view>
</template>
<script>
import Form from '@/components/form/index.vue'
export default {
components: {
Form
},
data() {
return {
type:'',
form: {
disabled: false,
visible: true,
loading: false,
labelWidth: '180rpx',
border: true,
errorType: ['toast'],
formData: [{
type: 'text',
field: 'code',
label: '报修主题',
disabled: false,
required: true,
value: ''
}, {
type: 'text',
field: 'name',
label: '设备名称',
disabled: false,
required: true,
value: '',
}, {
type: 'text',
field: 'location',
label: '存放位置',
}, {
type: 'singleColumn',
field: 'type',
label: '紧急程度',
list: [{
label: '程度1',
value: 1
}, {
label: '程度2',
value: 2
}, {
label: '程度3',
value: 3
}]
}, {
type: 'singleColumn',
field: 'type',
label: '工单状态',
list: [{
label: '状态1',
value: 1
}, {
label: '状态2',
value: 2
}, {
label: '状态3',
value: 3
}]
}],
},
data: {
name: '',
sex: 2,
hobby: [1, 2],
open: true,
duoxuan: 3,
time: '2023-12-12 08:00:00'
}
}
},
methods: {
//
submit() {
},
//
reset() {
console.log('表单数据信息1:', this.data);
this.data={}
},
},
onLoad(option) {
this.type = option.type
if(option.type == 1){
}else if(option.type == 2){
this.form.formData[0] = {
type: 'text',
field: 'code',
label: '维修主题',
disabled: false,
required: true,
value: ''
}
}else if(option.type == 3){
this.form.formData[0] = {
type: 'text',
field: 'code',
label: '检修主题',
disabled: false,
required: true,
value: ''
}
this.form.formData.pop()
}else if(option.type == 4){
this.form.formData[0] = {
type: 'text',
field: 'code',
label: '点检主题',
disabled: false,
required: true,
value: ''
}
this.form.formData.pop()
}else if(option.type == 5){
this.form.formData[0] = {
type: 'text',
field: 'code',
label: '保养主题',
disabled: false,
required: true,
value: ''
}
this.form.formData.pop()
}
}
}
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.list {
padding-bottom: 20rpx;
.item {
margin-top: 20rpx;
background: white;
padding: 30rpx;
display: flex;
align-items: center;
image {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
}
.dec1 {
font-size: 28rpx;
margin-top: 16rpx;
color: #acacac;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
</style>

181
pages/workOrderList/transfer.vue

@ -1,181 +0,0 @@
<template>
<!-- 设备 -->
<view class="add-form-container">
<Form :form='form' :data='data' ref="form1"></Form>
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
<button class="sure" @click="submit">确定</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</view>
</template>
<script>
import Form from '@/components/form/index.vue'
export default {
components: {
Form
},
data() {
return {
form: {
disabled: false,
visible: true,
loading: false,
labelWidth: '180rpx',
border: true,
errorType: ['toast'],
formData: [{
type: 'singleColumn',
field: 'type',
label: '模具',
list: [{
label: '程度1',
value: 1
}, {
label: '程度2',
value: 2
}, {
label: '程度3',
value: 3
}]
}, {
type: 'singleColumn',
field: 'type',
label: '维修工',
list: [{
label: '状态1',
value: 1
}, {
label: '状态2',
value: 2
}, {
label: '状态3',
value: 3
}]
}],
rules: {
// name
name: [
{
min: 5,
message: '简介不能少于5个字',
trigger: 'change'
},
// name
{
required: true,
message: '请填写姓名',
trigger: ['change', 'blur']
},
]
}
},
data: {
name: '',
sex: 2,
hobby: [1, 2],
open: true,
duoxuan: 3,
time: '2023-12-12 08:00:00'
}
}
},
methods: {
//
submit() {
console.log('表单数据信息1:', this.data);
this.$refs.form1.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
})
},
//
reset() {
console.log('表单数据信息1:', this.data);
this.data={}
},
}
}
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.list {
padding-bottom: 20rpx;
.item {
margin-top: 20rpx;
background: white;
padding: 30rpx;
display: flex;
align-items: center;
image {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
}
.dec1 {
font-size: 28rpx;
margin-top: 16rpx;
color: #acacac;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
</style>
Loading…
Cancel
Save