Browse Source

备件列表,备件领用功能,备件维修,我的保养,我的报修,我的维修,我的点检

master
zhang_li 9 months ago
parent
commit
5bc6161cf2
  1. 7
      api/device.js
  2. 7
      api/mold.js
  3. 24
      api/spareParts.js
  4. 32
      api/sparePartsApplication.js
  5. 10
      api/sparePartsServiceWorkOrderList.js
  6. 2
      api/spotCheckOrder.js
  7. 2
      api/upkeepOrder.js
  8. 8
      components/form/index.vue
  9. 5
      components/search/index.vue
  10. 97
      components/sparePartsApplicationList/index.vue
  11. 114
      components/sparePartsCard/index.vue
  12. 40
      pages.json
  13. 5
      pages/deviceReport/addForm.vue
  14. 9
      pages/deviceReport/index.vue
  15. 31
      pages/deviceReport/myDeviceReport.vue
  16. 4
      pages/index.vue
  17. 12
      pages/mine/index.vue
  18. 6
      pages/overhaulOrder/detail.vue
  19. 1
      pages/repairOrder/detail.vue
  20. 54
      pages/repairOrder/myOrder.vue
  21. 223
      pages/repairOrder/myRepairOrder.vue
  22. 74
      pages/spareParts/index.vue
  23. 597
      pages/sparePartsApplication/addForm.vue
  24. 210
      pages/sparePartsApplication/detail.vue
  25. 183
      pages/sparePartsApplication/index.vue
  26. 188
      pages/sparePartsApplication/screen.vue
  27. 313
      pages/sparePartsServiceWorkOrderList/addForm.vue
  28. 88
      pages/sparePartsServiceWorkOrderList/index.vue
  29. 211
      pages/sparePartsServiceWorkOrderList/screen.vue
  30. 629
      pages/spotCheckOrder/addServiceRecord.vue
  31. 487
      pages/spotCheckOrder/detail.vue
  32. 102
      pages/spotCheckOrder/myOrder.vue
  33. 6
      pages/upkeepOrder/detail.vue
  34. 108
      pages/upkeepOrder/myOrder.vue
  35. 223
      pages/upkeepOrder/myRepairOrder.vue

7
api/device.js

@ -57,3 +57,10 @@ export function getSubList(params) {
params
})
}
// 新增申领备件时获取备件列表
export function getApplyDeviceList() {
return request({
url: '/eam/device-accounts/selectAll',
'method': 'GET'
})
}

7
api/mold.js

@ -23,3 +23,10 @@ export function moldList(params) {
params
})
}
// 新增申领备件时获取模具列表
export function getApplyMoldList() {
return request({
url: '/eam/item-accounts/selectAll',
'method': 'GET'
})
}

24
api/spareParts.js

@ -1,5 +1,12 @@
import request from '@/utils/request'
// 获取tabs备件列表
export function getSparePartsPage(params) {
return request({
url: '/eam/item/getAppPage',
'method': 'GET',
params
})
}
// 获取备件列表
export function getSparePartsList(params) {
return request({
@ -8,3 +15,18 @@ export function getSparePartsList(params) {
params
})
}
// 新增申领备件时获取备件列表
export function getApplySparePartsList() {
return request({
url: '/eam/item/getApplyList',
'method': 'GET'
})
}
// 新增备件维修获取备件列表
export function getServiceSparePartsList() {
return request({
url: '/eam/item/getItemMaintainList',
'method': 'GET'
})
}

32
api/sparePartsApplication.js

@ -0,0 +1,32 @@
import request from '@/utils/request'
// 备件领用列表
export function sparePartsApplicationPage(params) {
return request({
url: '/eam/item-apply-main/getAppPage',
'method': 'GET',
params
})
}
// 领用备件
export function sparePartsApplicationCreate(data) {
return request({
url: '/eam/item-apply-main/create',
'method': 'POST',
data
})
}
// 撤回领用备件
export function sparePartsApplicationCancle(id) {
return request({
url: '/eam/item-apply-main/backout?id=' + id,
'method': 'GET',
})
}
// 领用备件详情
export function sparePartsApplicationDetail(number) {
return request({
url: '/eam/item-apply-main/appGetByNumber?number=' + number,
'method': 'GET',
})
}

10
api/sparePartsServiceWorkOrderList.js

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 领用备件
export function sparePartsServiceWorkOrderListCreate(data) {
return request({
url: '/eam/item-maintenance/create',
'method': 'POST',
data
})
}

2
api/spotCheckOrder.js

@ -17,7 +17,7 @@ export function spotCheckOrderUpdate(data) {
data
})
}
// 报修列表
// 工单列表
export function spotCheckOrderPage(params) {
return request({
url: '/eam/device-spot-inspection-record-main/getAppPage',

2
api/upkeepOrder.js

@ -17,7 +17,7 @@ export function upkeepOrderUpdate(data) {
data
})
}
// 报修列表
// 工单列表
export function upkeepOrderPage(params) {
return request({
url: '/eam/device-maintain-order-main/getAppPage',

8
components/form/index.vue

@ -273,11 +273,11 @@
</template>
<script>
import sparePartsCard from '@/components/sparePartsCard/index.vue'
// import sparePartsCard from '@/components/sparePartsCard/index.vue'
export default {
components:{
sparePartsCard
},
// components:{
// sparePartsCard
// },
props: { form: { type: Object, default: {}, require: true }, data: { type: Object, default: {}, require: true }, },
data() {
return {

5
components/search/index.vue

@ -11,6 +11,7 @@
:placeholder="searchData.placeholder ||'请输入设备名称'"
:clearabled="true"
@search='search'
@clear='clear'
>
</u-search>
</view>
@ -45,6 +46,10 @@
search() {
this.$emit('search', this.keyWord)
},
//
clear() {
this.$emit('search', '')
},
//
screen() {
this.$emit('screen')

97
components/sparePartsApplicationList/index.vue

@ -1,97 +0,0 @@
<template>
<view class="content">
<view class="list">
<view class="item" v-for="(item,index) in data.list" :key="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="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: {
}
}
</script>
<style lang="scss" scoped>
.list{
background: #f5f5f5;
margin-top: 20rpx;
.item{
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
position: relative;
.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{
position: absolute;
right: 30rpx;
bottom:40rpx;
}
}
}
</style>

114
components/sparePartsCard/index.vue

@ -1,114 +0,0 @@
<template>
<view class="">
<view class="title" v-if="subForm.formLabel">
<span v-if="subForm.required">*</span>{{subForm.formLabel}}
</view>
<view class="list">
<view class="item" v-for="(item,index) in data[subForm.formField]" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
{{item.name}}
</view>
</view>
<u-row gutter="16">
<u-col :span="cur.span || 12" v-for="(cur,key) in subForm.formData" :key="key">
<view class="dec">
<view class="" v-if="cur.isList">
{{cur.label}}:{{item[cur.field]}}
</view>
</view>
</u-col>
</u-row>
</view>
<u-icon name="minus-circle" color="#aaaaaa" size="60" v-if="subForm.isShowButton"></u-icon>
</view>
</view>
<view class="add-btn">
<u-button type="primary" @click="addSubForm"><u-icon name="plus-circle" color="#ffffff" size="36"
v-if="subForm.isShowButton"></u-icon>添加</u-button>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
subForm: {
type: Object,
default: () => {
return {}
},
},
data: {
type: Object,
default: () => {
return {}
},
},
},
data() {
return {
}
},
methods: {
addSubForm() {
console.log(444)
this.$emit('addSubForm', this.subForm.formLabel)
}
}
}
</script>
<style lang="scss" scoped>
.title {
padding: 32rpx 0px;
position: relative;
span {
position: absolute;
left: -16rpx;
color: #fa3534;
padding-top: 6rpx;
}
}
.list {
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
background: #F5F5F5;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
}
}
.dec {
color: #9c9c9c;
padding: 0rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
</style>

40
pages.json

@ -76,9 +76,9 @@
"navigationBarTextStyle": "white"
}
},{
"path": "pages/repairOrder/myRepairOrder",
"path": "pages/repairOrder/myOrder",
"style": {
"navigationBarTitleText": "维修工单",
"navigationBarTitleText": "我的维修工单",
"navigationStyle": "custom"
}
},{
@ -143,9 +143,9 @@
"navigationBarTextStyle": "white"
}
},{
"path": "pages/spotCheckOrder/index",
"path": "pages/upkeepOrder/myOrder",
"style": {
"navigationBarTitleText": "点检工单",
"navigationBarTitleText": "我的保养工单",
"navigationStyle": "custom"
}
},{
@ -156,23 +156,43 @@
"navigationBarTextStyle": "white"
}
},{
"path": "pages/spotCheckOrder/detail",
"path": "pages/spotCheckOrder/myOrder",
"style": {
"navigationBarTitleText": "我的点检工单",
"navigationStyle": "custom"
}
},{
"path": "pages/mine/changePassword",
"style": {
"navigationBarTitleText": "修改密码",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}
},{
"path": "pages/sparePartsApplication/index",
"style": {
"navigationBarTitleText": "点检工单详情",
"navigationBarTitleText": "领用申请",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},{
"path": "pages/sparePartsApplication/addForm",
"style": {
"navigationBarTitleText": "领用备件",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}
},{
"path": "pages/spotCheckOrder/addServiceRecord",
"path": "pages/sparePartsApplication/detail",
"style": {
"navigationBarTitleText": "添加点检内容",
"navigationBarTitleText": "详情",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}
},{
"path": "pages/mine/changePassword",
"path": "pages/sparePartsServiceWorkOrderList/addForm",
"style": {
"navigationBarTitleText": "修改密码",
"navigationBarTitleText": "添加备件维修工单",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}

5
pages/deviceReport/addForm.vue

@ -157,7 +157,6 @@
},
//
reset() {
console.log('表单数据信息1:', this.data);
this.form = {}
},
selectFormat(val, array) {
@ -177,11 +176,7 @@
},
//
chooseSingleColumn(e) {
console.log(e[0])
this.form[this.field] = e[0].value
// if (this.field == 'receiverType') {
// this.type = this.form[this.field]
// }
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()

9
pages/deviceReport/index.vue

@ -75,11 +75,11 @@
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
//
getList() {
async getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.$modal.loading('加载中')
deviceApi.deviceRepairPage(this.params).then((res) => {
await deviceApi.deviceRepairPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
@ -94,12 +94,13 @@
cancle(item) {
this.$modal.confirm('确定撤销报修吗?').then(() => {
this.$modal.loading('加载中')
deviceApi.rejected(item.id).then((res) => {
deviceApi.rejected(item.id).then(async (res) => {
this.$modal.closeLoading()
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
await this.getList()
this.$modal.showLoading('撤销成功')
})
})

31
pages/deviceReport/myDeviceReport.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="我的报修">
</u-navbar>
<Search @search='search' @screen='screen'/>
<!-- <Search @search='search' @screen='screen'/> -->
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)">
<view class="title">
@ -12,25 +12,26 @@
{{item.describes}}
</view>
<view class="time">
2023-12-12 08:00:00
<!-- 2023-12-12 08:00:00 -->
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
设备编号:<span>{{item.deviceNumber}}</span>
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
设备名称:<span>{{item.name}}</span>
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="bottom">
<view class="status">
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
<u-tag :text="item.result" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
</view>
<view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
@ -55,7 +56,6 @@
params: {
pageNo: 1,
pageSize: 10,
type: 'DEVICE',
flag:1
},
status: 'loadmore', //
@ -64,13 +64,13 @@
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
},
addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
// //
// screen() {
// this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
// },
// addForm() {
// this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
// },
//
getList() {
if (this.status == 'nomore') return;
@ -156,7 +156,8 @@
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
height: 90rpx;
}
}
}

4
pages/index.vue

@ -63,7 +63,7 @@
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/spotCheckOrder/index?type=DEVICE')">
<view class="icon-item" @click="open('/pages/spotCheckOrder/addForm?type=DEVICE')">
<image src="../static/images/icon2.svg" mode=""></image>
<view>点检工单</view>
</view>
@ -111,7 +111,7 @@
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/sparePartsServiceWorkOrderList/index')">
<view class="icon-item" @click="open('/pages/sparePartsServiceWorkOrderList/addForm?type=DEVICE')">
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>

12
pages/mine/index.vue

@ -36,12 +36,12 @@
<image src="../../static/images/banner/icon2.png" mode="widthFix"></image>
<text class="text">我的维修</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="action-item" @click="handleUpkeepOrder">
<image src="../../static/images/banner/icon3.png" mode="widthFix"></image>
<text class="text">我的保养</text>
</view>
<view class="action-item action-item1" @click="handleBuilding">
<view class="action-item action-item1" @click="handleSpotCheckOrder">
<image src="../../static/images/banner/icon4.png" mode="widthFix"></image>
<text class="text">巡检点检</text>
</view>
@ -117,7 +117,13 @@
this.$tab.navigateTo('/pages/deviceReport/myDeviceReport')
},
handleRepairOrder() {
this.$tab.navigateTo('/pages/repairOrder/myRepairOrder')
this.$tab.navigateTo('/pages/repairOrder/myOrder')
},
handleUpkeepOrder() {
this.$tab.navigateTo('/pages/upkeepOrder/myOrder')
},
handleSpotCheckOrder() {
this.$tab.navigateTo('/pages/spotCheckOrder/myOrder')
},
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {

6
pages/overhaulOrder/detail.vue

@ -131,16 +131,10 @@
</template>
<script>
import Form from '@/components/form/index.vue'
import SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
export default {
components: {
Form,
SparePartsCard
},
data() {
return {
list: [{

1
pages/repairOrder/detail.vue

@ -151,7 +151,6 @@
</template>
<script>
import SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js"

54
pages/spotCheckOrder/index.vue → pages/repairOrder/myOrder.vue

@ -1,8 +1,8 @@
<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>
@ -23,19 +23,19 @@
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view>
<view class="dec">
修单号:<span>{{item.number}}</span>
修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
维修工单:<span>{{item.maintenanceNumber}}</span>
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
班次:<span>{{item.classesName}}</span>
</view>
<view class="dec">
故障类型:<span>{{item.faultTypeName}}</span>
@ -45,9 +45,10 @@
<view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}}
</view>
<view class="status">
<!-- <view class="status">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="addForm(item)">编辑</u-button>
</view>
</view> -->
</view>
</view>
</view>
@ -59,14 +60,14 @@
</template>
<script>
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import * as repairOrderApi from "@/api/repairOrder.js"
export default {
data() {
return {
params: {
pageNo: 1,
pageSize: 10,
type: ''
flag: 1
},
status: 'loadmore', //
list: [],
@ -74,22 +75,12 @@
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/spotCheckOrder/screen?type=${this.params.type}`)
},
itemClick(item, index) {
this.$tab.navigateTo(`/pages/spotCheckOrder/detail?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
},
addForm(item) {
this.$tab.navigateTo(`/pages/spotCheckOrder/addForm?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
},
//
//
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.$modal.loading('加载中')
spotCheckOrderApi.spotCheckOrderPage(this.params).then((res) => {
repairOrderApi.repairOrderPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
@ -100,9 +91,20 @@
}
})
},
},
onLoad(option) {
if (option.type) this.params.type = option.type;
//
cancle(item) {
this.$modal.confirm('确定撤销报修吗?').then(() => {
this.$modal.loading('加载中')
deviceApi.rejected(item.id).then((res) => {
this.$modal.closeLoading()
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
})
})
}
},
onShow() {

223
pages/repairOrder/myRepairOrder.vue

@ -1,223 +0,0 @@
<template>
<!-- 我的维修工单 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="我的维修">
</u-navbar>
<Search @search='search' @screen='screen'/>
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.describes}}
</view>
<view class="time">
2023-12-12 08:00:00
</view>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
设备编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
设备名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="bottom">
<view class="status">
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
</view>
<view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.isCancel == 0" @click="cancle(item)">撤销</u-button>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as repairOrderApi from "@/api/repairOrder.js"
export default {
data() {
return {
params: {
pageNo: 1,
pageSize: 10,
type: 'DEVICE',
flag:1
},
status: 'loadmore', //
list: [],
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
},
addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
//
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
repairOrderApi.repairOrderPage(this.params).then((res) => {
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
this.status = 'loadmore'
} else {
this.status = 'nomore'
}
})
},
//
cancle(item){
this.$modal.confirm('确定撤销报修吗?').then(()=>{
deviceApi.rejected(item.id).then((res) => {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
})
})
}
},
onShow() {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
onReachBottom() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.list {
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;
}
}
}
.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;
position: relative;
.status {
flex: 1;
}
.button{
position: absolute;
right: 0rpx;
}
}
}
}
</style>

74
pages/spareParts/index.vue

@ -1,10 +1,11 @@
<template>
<!-- 设备 -->
<view class="work-container">
<Search @search='search' @screen='screen'/>
<Search :searchData='searchData' @search='search' @screen='screen' :isShowScreen='false' />
<view class="list">
<view class="item" v-for="index in 6" :key='index'>
<u-image src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" width='160' height="160">
<view class="item" v-for="(item,index) in list" :key='index'>
<u-image :src="item.images" width='160'
height="160">
<template v-slot:error>
<view class="image-error">
<u-icon name="photo" color="#c7c7c7" size="38"></u-icon>
@ -14,24 +15,26 @@
</u-image>
<view class="text">
<view class="title">
备件025
{{item.name}}
</view>
<view class="dec1">
备件编码SB52225456
备件编码{{item.number}}
</view>
<view class="dec2">
规格型号SB52225456
</view>
<view class="dec2">
总库存25
总库存{{item.qty}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as sparePartsApi from "@/api/spareParts.js"
import Search from '../../components/search/index.vue'
export default {
components: {
@ -40,18 +43,59 @@
data() {
return {
searchData: {
placeholder: '请输入备件名称'
},
params: {
pageNo: 1,
pageSize: 10,
type: '',
name: ''
},
status: 'loadmore', //
list: [],
}
},
methods: {
//
//
search(keyWord) {
console.log(keyWord)
this.params.name = keyWord
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
//
screen() {
console.log(222)
this.$tab.navigateTo(`/pages/spareParts/screen`)
}
},
//
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.$modal.loading('加载中')
sparePartsApi.getSparePartsPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
this.status = 'loadmore'
} else {
this.status = 'nomore'
}
})
},
},
onShow() {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
onReachBottom() {
this.getList()
}
}
</script>
@ -67,8 +111,9 @@
display: flex;
align-items: center;
.text{
.text {
margin-left: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
@ -84,11 +129,12 @@
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
}
}
.image-error{
.image-error {
text-align: center;
}
</style>

597
pages/sparePartsApplication/addForm.vue

@ -1,183 +1,355 @@
<template>
<!-- 设备 -->
<!-- 添加维修工单 -->
<view class="add-form-container">
<Form :form='form' :data='data' ref="form1"></Form>
<SparePartsCard :subForm='subForm' :data='data' @addSubForm='addSubForm' @delSubFormItem='delSubFormItem'>
</SparePartsCard>
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="申请主题" prop="name" required>
<u-input v-model="form.name" placeholder="请输入申请主题" />
</u-form-item>
</u-form>
<view class="list">
<view class="title">
<span>*</span>申请备件
</view>
<view class="item " v-for="(item,index) in form.subList" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
{{item.name}}
</view>
</view>
<u-row gutter="16">
<u-col :span="24">
<view class="dec">
类型:{{`${item.type=='DEVICE'?'设备' : '模具'}`}}
</view>
</u-col>
<u-col :span="24">
<view class="dec">
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}:{{item.deviceName}}
</view>
</u-col>
<u-col :span="24">
<view class="dec">
是否以旧换新:{{item.isRadeIn=='TRUE'?'是' :'否'}}
</view>
</u-col>
<u-col :span="24">
<view class="dec">
库存:{{item.currentQty}}
</view>
</u-col>
<u-col :span="24">
<view class="dec">
数量:{{item.qty}}
</view>
</u-col>
</u-row>
</view>
<u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(index)"></u-icon>
</view>
<view class="add-btn">
<u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加备件</u-button>
</view>
</view>
<view class="footer">
<view class="btns">
<button class="sure" @click="submit">提交</button>
<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="isPopupShow" mode="center" border-radius="14">
<view class="popup-title">添加备件</view>
<view class="popup">
<Form :form='subForm' :data='data' ref="form2"></Form>
<u-form :model="form1" ref="form1" label-width="200rpx">
<u-form-item :label="`备件`" prop="number" required>
<view class="select" @click="openSingleColumn('itemNumber',form1.itemNumber,sparePartsList)">
<view class="input" v-if='form1.itemNumber'>
{{selectFormat(form1.itemNumber,sparePartsList)}}
</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="类型" prop="type" required>
<view class="select" @click="openSingleColumn('type',form1.type,deviceMoldType)">
<view class="input" v-if='form1.type'>
{{selectFormat(form1.type,deviceMoldType)}}
</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="`${form1.type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber" required>
<view class="select" @click="openSingleColumn('deviceNumber',form1.deviceNumber,deviceList)">
<view class="input" v-if='form1.deviceNumber'>
{{selectFormat(form1.deviceNumber,deviceList)}}
</view>
<view class="placeholder" v-else>
{{`请选择${form1.type=='DEVICE'?'设备' : '模具'}`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item label="是否以旧换新" prop="isRadeIn" required class="disabled">
<u-radio-group v-model="form1.isRadeIn" disabled>
<u-radio name="TRUE"></u-radio>
<u-radio name="FALSE"></u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="库存" prop="currentQty" required class="disabled">
<u-input v-model="form1.currentQty" type="number" disabled placeholder="请输入库存" />
</u-form-item>
<u-form-item label="数量" prop="qty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入数量" />
</u-form-item>
</u-form>
</view>
<view class="popup-footer">
<view @click="cancle">取消</view>
<view @click="isPopupShow = false">取消</view>
<view class="sure" @click="addSpare">确认</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 Form from '@/components/form/index.vue'
import SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import * as sparePartsApi from "@/api/spareParts.js"
import * as deviceApi from "@/api/device.js"
import * as deptApi from "@/api/dept.js"
import * as dictApi from "@/api/dict.js"
import * as moldApi from "@/api/mold.js"
export default {
components: {
Form,
SparePartsCard
},
data() {
return {
loading: false,
type: "",
//
isPopupShow: false,
sparePartsList: [],
deviceList: [], //
//
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
field: '',
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: 'singleColumn',
field: 'type',
label: '申请类型',
disabled: false,
required: true,
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}],
},
data: {
name: '',
subList: [{
name: '备件111111',
stork: '1',
number: '30',
}, {
name: '备件111111',
stork: '1',
number: '30',
}]
subList:[]
},
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
}],
form1: {
itemNumber: "",
type:'',
deviceNumber: '',
isRadeIn: '',
currentQty: '',
qty: ''
},
isPopupShow: false,
deviceMoldType:[],
}
},
methods: {
//
submit() {
console.log('表单数据信息1:', this.data);
this.$refs.form1.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
})
console.log(this.data.subList)
let isTrue = this.data.subList.some(item => {
return !item.name || item.number === ''
})
if (isTrue) {
this.$modal.showToast('申请备件信息请填写完全')
//
if (!this.form.name) {
this.$modal.showToast('请输入主题')
return;
}
if (this.form.subList.length === 0) {
this.$modal.showToast('请选择备件')
return;
}
this.$modal.confirm('是否添加备件申请').then(() => {
this.$modal.loading('加载中')
this.loading = true
sparePartsApplicationApi.sparePartsApplicationCreate(this.form).then((res) => {
this.$modal.closeLoading()
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
})
})
},
//
reset() {
console.log('表单数据信息1:', this.data);
this.data = {}
if (this.form.id) {
this.form.classes = '';
this.form.faultType = ''
} else {
this.form = {}
}
},
//
addSubForm() {
console.log(5)
this.isPopupShow = true
// this.data.subList.push({
// name:1,
// stork:2,
// number:'300'
// })
//
async getSelecUser() {
let data = {
classType: this.type,
factoryAreaNumber: this.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
})
},
//
addSpare(){
// this.data.subList
this.$refs.form2.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
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) {
this.form1[this.field] = e[0].value
if (this.field == 'itemNumber') {
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value)
this.form1.isRadeIn = this.choosesingleColumnItem[0].isRadeIn
this.form1.currentQty = this.choosesingleColumnItem[0].qty
}
if (this.field == 'type') {
this.form1.deviceNumber =''
this.form1.deviceName =''
}
this.getApplyDeviceList()
this.singleColumnShow = false
this.$forceUpdate()
},
//
async getApplySparePartsList() {
await sparePartsApi.getApplySparePartsList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.sparePartsList = res.data
})
},
//
cancle(){
//
async getApplyDeviceList() {
console.log(this.form1.type)
if (this.form1.type == 'DEVICE') {
await deviceApi.getApplyDeviceList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.deviceList = res.data
})
} else if (this.form1.type == 'MOLD') {
moldApi.getApplyMoldList().then((res) => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.deviceList = res.data
})
}
},
//
open() {
this.form1 = {
itemNumber: "",
type:'',
deviceNumber: '',
isRadeIn: '',
currentQty: "",
qty: '',
}
this.isPopupShow = true
},
//
addSpare() {
if (!this.form1.itemNumber) {
this.$modal.showToast('请选择备件')
return;
}
if (!this.form1.deviceNumber) {
this.$modal.showToast('请选择设备')
return;
}
if (!this.form1.qty) {
this.$modal.showToast('请输入数量')
return;
}
if (this.form1.qty > this.form1.currentQty) {
this.$modal.showToast('数量不可以大于库存')
return;
}
this.form1.name = this.selectFormat(this.form1.itemNumber, this.sparePartsList)
this.form1.deviceName = this.selectFormat(this.form1.deviceNumber, this.deviceList)
if (this.form.subList && this.form.subList.length > 0) {
let arr = this.form.subList.filter(item => item.itemNumber == this.form1.itemNumber)
if (arr && arr.length > 0) {
this.$modal.showToast('该备件已添加')
return;
}
}
this.form.subList.push(this.form1)
this.isPopupShow = false
},
delTableFormItem(index) {
this.data.subList.splice(index, 1)
//
delSpareParts(index) {
this.form.subList.splice(index, 1)
}
},
async onLoad(option) {
if (option.type) this.type = option.type;
if (option.factoryAreaNumber) this.factoryAreaNumber = option.factoryAreaNumber;
if (option.number) this.form.maintenanceNumber = option.number;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form, 'subList', this.form.subList)
};
this.deviceMoldType = await dictApi.getDict('device_mold_type')
console.log(this.deviceMoldType)
await this.getApplySparePartsList()
}
}
</script>
@ -186,42 +358,15 @@
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
padding: 0px 0rpx 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;
}
.u-form-item {
padding: 20rpx 30rpx;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
.disabled {
background: #f5f5f5;
}
.footer {
@ -229,15 +374,12 @@
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;
@ -246,13 +388,101 @@
.sure {
background: #409eff;
color: white;
border-radius: 8rpx;
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);
}
}
.title {
padding: 32rpx 0rpx;
position: relative;
span {
position: absolute;
left: -16rpx;
color: #fa3534;
top: 19px;
}
}
.list {
padding: 0rpx 30rpx;
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
background: #F5F5F5;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
}
}
.dec {
color: #9c9c9c;
padding: 20rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
.popup-title {
@ -260,24 +490,31 @@
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx
padding: 30rpx 30rpx 0px
}
.popup {
width: 600rpx;
padding: 0rpx 60rpx 0rpx;
padding: 30rpx 0rpx 30rpx;
}
.popup-footer{
.popup-footer {
display: flex;
border-top: 1px solid #e4e4e4;
view{
view {
line-height: 100rpx;
flex: 1;
text-align: center;
&.sure{
&.sure {
color: #409eff;
}
}
}
::v-deep .u-checkbox-group {
display: grid !important;
}
</style>

210
pages/sparePartsApplication/detail.vue

@ -0,0 +1,210 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>备件申领工单</view>
</view>
<view class="dec">
<view class="dec-item">
<view>申请主题</view>
<view>{{data.name}}</view>
</view>
<view class="dec-item">
<view>申请单号</view>
<view>{{data.number}}</view>
</view>
<view class="dec-item">
<view>申请备件</view>
</view>
<view class="items" v-for="(cur,key) in data.subList" :key="key">
<view class="items-name">
备件名称{{cur.itemName}}
</view>
<view class="items-dec">
类型{{cur.type == 'type'?'设备' :'模具'}}
</view>
<view class="items-dec">
{{cur.type == 'type'?'设备' :'模具'}}名称{{cur.name}}
</view>
<view class="items-dec">
是否以旧换新{{cur.isRadeIn == 'TRUE'?'是' :'否'}}
</view>
<view class="items-dec">
数量{{cur.qty}}
</view>
</view>
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import * as moldApi from "@/api/mold.js"
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
export default {
data() {
return {
number: '',
data: '',
}
},
methods: {
getSparePartsApplicationDetail(){
sparePartsApplicationApi.sparePartsApplicationDetail(this.number).then((res)=>{
this.data = res.data
})
}
},
onLoad(option) {
if (option.type) this.type = option.type;
if (option.number) {
this.number = option.number
}
console.log(this.data)
},
onShow() {
this.getSparePartsApplicationDetail()
}
}
</script>
<style lang="scss" scoped>
.detail-container{
min-height: 100vh;
background: white;
}
.line{
background: #f5f5f5;
height: 20rpx;
}
.info {
background: white;
}
.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;
width: 0px;
word-wrap: break-word;
}
}
}
}
.dec2 {
padding: 10rpx 30rpx;
display: flex;
view {
&:nth-child(1) {
width: 180rpx;
}
&:nth-child(2) {
color: #888888;
flex: 1;
width: 0px;
word-wrap: break-word;
}
}
}
.items {
border-radius: 12rpx;
background: #F5F5F5;
padding-bottom: 20rpx;
.items-name {
padding: 20rpx;
border-bottom: 1px solid #dedede;
}
.items-dec {
padding: 0px 20rpx;
margin-top: 20rpx;
}
}
.list {
padding: 20rpx;
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
border-radius: 12rpx;
border: 1px solid #dedede;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
display: flex;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
flex: 1;
}
}
.dec {
color: #9c9c9c;
padding: 0rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
</style>

183
pages/sparePartsApplication/index.vue

@ -7,29 +7,43 @@
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon>
</template>
</u-navbar>
<Search @search='search' @screen='screen' />
<!-- <Search @search='search' @screen='screen' /> -->
<view class="list">
<view class="item" v-for="(item,index) in data.list" :key="index">
<view class="item" v-for="(item,index) in list" :key="index" @click="openDetail(item)">
<view class="title">
<view class="title-txt">
{{item.title}}
{{item.name}}
</view>
<view class="time" v-if="data.isShowTime">
2023-12-12 08:00:00
<view class="time">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
<view class="dec" v-for="(cur,key) in labelList" :key="key">
{{cur.label}}:<span>{{item[cur.field]}}</span>
<view class="dec">
申请单号:<span>{{item.number}}</span>
</view>
<view class="bottom" v-if="data.isShowStatus">
<view class="dec">
:<span>{{item.applyName}}</span>
</view>
<view class="bottom">
<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'/>
<u-tag text="待审批" v-if="item.status==0" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="审批通过" v-else-if="item.status==1" bg-color='rgba(255,255,255,0)' color='#2EC7C9'
border-color='#2EC7C9' type="info" shape='circle' />
<u-tag text="审批驳回" v-else-if="item.status==2" bg-color='rgba(255,255,255,0)' color='#e01f54'
border-color='#e01f54' type="success" shape='circle' />
<u-tag text="出库中" v-else-if="item.status==3" bg-color='rgba(255,255,255,0)' color='#005eaa'
border-color='#005eaa ' type="error" shape='circle' />
<u-tag text="完成" v-else-if="item.status==4" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="info" shape='circle' />
<u-tag text="撤单" v-else-if="item.status==5" bg-color='rgba(255,255,255,0)' color='#d7d7d7'
border-color='#d7d7d7 ' type="warning" shape='circle' />
</view>
<view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.status==0" @click="cancle(item)">撤回</u-button>
</view>
</view>
</view>
</view>
@ -38,56 +52,16 @@
</template>
<script>
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
export default {
data() {
return {
labelList: [{
label: '申请单号',
field: 'dec1',
}, {
label: '申请类型',
field: 'dec2',
}, {
label: ' 申 请 人',
field: 'dec3',
}],
data: {
isShowTime: true,
isShowStatus: true,
list: [{
title: '备件002领用',
dec1: '维修领用',
dec2: '刘冰雨',
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
}]
}
params: {
pageNo: 1,
pageSize: 10,
},
status: 'loadmore', //
list: [],
}
},
@ -98,51 +72,106 @@
},
addForm() {
this.$tab.navigateTo(`/pages/sparePartsApplication/addForm`)
},
openDetail(item){
this.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}`)
},
//
async getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.$modal.loading('加载中')
await sparePartsApplicationApi.sparePartsApplicationPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
this.status = 'loadmore'
} else {
this.status = 'nomore'
}
})
},
//
cancle(item) {
this.$modal.confirm('确定撤回申请吗?').then(() => {
this.$modal.loading('加载中')
sparePartsApplicationApi.sparePartsApplicationCancle(item.id).then(async (res) => {
this.$modal.closeLoading()
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
await this.getList()
this.$modal.showToast('撤回成功')
})
})
}
}
},
onLoad(option) {
if (option.type) this.params.type = option.type;
},
onShow() {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
}
</script>
<style lang="scss" scoped>
.list{
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item{
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
position: relative;
.title{
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt{
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time{
.time {
color: #919191;
}
}
.dec{
.dec {
padding-bottom: 20rpx;
span{
span {
color: #999999;
}
}
.last{
.last {
padding-bottom: 30rpx;
}
.bottom{
position: absolute;
right: 30rpx;
bottom:40rpx;
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
height: 90rpx;
}
}
}

188
pages/sparePartsApplication/screen.vue

@ -1,188 +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: 'text',
field: 'code',
label: '申请主题',
disabled: false,
required: true,
value: ''
}, {
type: 'singleColumn',
field: 'type',
label: '申请类型',
disabled: false,
required: true,
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}, {
type: 'singleColumn',
field: 'type1',
label: '备件类型',
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}, {
type: 'datetime',
field: 'datetime',
label: '申请时间',
}, {
type: 'singleColumn',
field: 'type',
label: '申请人',
disabled: false,
required: true,
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={}
},
}
}
</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>

313
pages/sparePartsServiceWorkOrderList/addForm.vue

@ -1,182 +1,168 @@
<template>
<!-- 设备 -->
<view class="work-container">
<Form :form='form' :data='data' ref="form1" @tableFormSingleColumn='tableFormSingleColumn'
@addTableFormItem='addTableFormItem' @delTableFormItem='delTableFormItem'></Form>
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item :label="`备件`" prop="itemNumber" required>
<view class="select" @click="openSingleColumn('itemNumber',form.itemNumber,sparePartsList)">
<view class="input" v-if='form.itemNumber'>
{{selectFormat(form.itemNumber,sparePartsList)}}
</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="数量" prop="qty" required>
<u-input v-model="form.qty" type="number" placeholder="请输入数量" />
</u-form-item>
<u-form-item label="维修结果" prop="reasons" required>
<u-radio-group v-model="form.result">
<u-radio :name="item.value" v-for="(item,index) in result" :key="index">{{item.label}}</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="维修原因" prop="reasons" required>
<u-input v-model="form.reasons" placeholder="请输入维修原因" />
</u-form-item>
</u-form>
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
<button class="sure" @click="submit">确定</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-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
</view>
</template>
<script>
import Form from '@/components/form/index.vue'
import * as sparePartsApi from "@/api/spareParts.js"
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList.js"
import * as dictApi from "@/api/dict.js"
export default {
components: {
Form
},
data() {
return {
loading: false,
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: 'singleColumn',
field: 'type',
label: '申请类型',
disabled: false,
required: true,
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}, {
type: 'tableForm',
field: 'subList',
labelPosition: 'top',
label: '申请备件',
disabled: false,
required: true,
tableThlist: [{
label: '备用名称',
field: 'name',
type: 'singleColumn',
disabled: false,
required: true,
list: 'list'
}, {
label: '库存',
field: 'stork',
type: 'singleColumn',
disabled: false,
required: true,
list: 'list1'
}, {
label: '申请数量',
field: 'number',
type: 'number',
disabled: false,
required: true,
}]
}],
rules: {
// name
name: [{
min: 5,
message: '简介不能少于5个字',
trigger: 'change'
},
// name
{
required: true,
message: '请填写姓名',
trigger: ['change', 'blur']
},
]
}
itemNumber: "",
qty: '',
result: 'YES',
reasons: '',
},
data: {
name: '',
subList: [{
name: 1,
stork: '1',
number: '',
inputType: 'singleColumn',
list: [{
value: 1,
label: '哈哈'
}, {
value: 2,
label: '呵呵'
}],
list1: [{
value: 1,
label: '哈哈1111'
}, {
value: 2,
label: '呵呵111'
}],
}]
}
sparePartsList: [],
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
field: '',
result: []
}
},
methods: {
//
submit() {
console.log('表单数据信息1:', this.data);
this.$refs.form1.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
})
console.log(this.data.subList)
let isTrue = this.data.subList.some(item => {
return !item.name || item.number === ''
})
if (isTrue) {
this.$modal.showToast('申请备件信息请填写完全')
//
if (!this.form.itemNumber) {
this.$modal.showToast('请选择备件')
return;
}
if (!this.form.qty) {
this.$modal.showToast(`请输入数量`)
return;
}
if (!this.form.result) {
this.$modal.showToast('请选择维修结果')
return;
}
if (!this.form.reasons) {
this.$modal.showToast('请输入维修原因')
return;
}
this.$modal.confirm('是否添加备件维修工单').then(() => {
this.$modal.loading('加载中')
this.loading = true
sparePartsServiceWorkOrderListApi.sparePartsServiceWorkOrderListCreate(this.form).then((res) => {
this.$modal.closeLoading()
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
})
})
},
//
reset() {
console.log('表单数据信息1:', this.data);
this.data = {}
if (this.form.id) {
this.form.classes = '';
this.form.faultType = ''
} else {
this.form = {}
}
},
//
tableFormSingleColumn(field, tableFormField, tableFormVal) {
console.log(field)
console.log(tableFormField)
console.log(tableFormVal)
//
selectFormat(val, array) {
if (array.length > 0) {
let str = array.filter(item => item.value == val)[0].label
return str
} else {
return ''
}
},
//
addTableFormItem() {
this.data.subList.push({
name: 1,
stork: 2,
number: '300',
inputType: 'singleColumn',
list: [{
value: 1,
label: '哈哈额'
}, {
value: 2,
label: '呵呵额'
}],
list1: [{
value: 1,
label: '哈哈222'
}, {
value: 2,
label: '呵呵333'
}],
//
openSingleColumn(field, val, list) {
if (field == 'deviceNumber' && this.form.id) return;
this.singleColumnList = list
this.field = field
if (val) {
this.singleColumnDefaultValue = [list.findIndex(item => item.value == val)]
} else {
this.singleColumnDefaultValue = []
}
this.singleColumnShow = true
},
//
chooseSingleColumn(e) {
this.form[this.field] = e[0].value
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.form.deviceNumber = e[0].value
}
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
},
//
async getServiceSparePartsList() {
await sparePartsApi.getServiceSparePartsList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.sparePartsList = res.data
})
},
delTableFormItem(index) {
this.data.subList.splice(index, 1)
}
},
async onLoad(option) {
if (option.type) this.type = option.type;
this.result = await dictApi.getDict('result')
await this.getServiceSparePartsList()
}
}
</script>
@ -258,4 +244,33 @@
}
}
}
.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);
}
}
</style>

88
pages/sparePartsServiceWorkOrderList/index.vue

@ -1,88 +0,0 @@
<template>
<!-- 备件维修工单 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
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' />
<sparePartsApplicationList :data="data" :labelList='labelList'></sparePartsApplicationList>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import sparePartsApplicationList from '@/components/sparePartsApplicationList/index.vue'
export default {
components: {
sparePartsApplicationList
},
data() {
return {
labelList: [{
label: '申请单号',
field: 'dec1',
}, {
label: '申请类型',
field: 'dec2',
}, {
label: ' 申 请 人',
field: 'dec3',
}],
data: {
isShowTime: true,
isShowStatus: true,
list: [{
title: '备件002领用',
dec1: '维修领用',
dec2: '刘冰雨',
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/sparePartsApplication/screen`)
},
addForm() {
this.$tab.navigateTo(`/pages/sparePartsApplication/addForm`)
}
}
}
</script>
<style lang="scss" scoped>
</style>

211
pages/sparePartsServiceWorkOrderList/screen.vue

@ -1,211 +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: 'text',
field: 'code',
label: '申请主题',
disabled: false,
required: true,
value: ''
}, {
type: 'singleColumn',
field: 'type',
label: '申请类型',
disabled: false,
required: true,
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}, {
type: 'singleColumn',
field: 'type1',
label: '备件类型',
list: [{
label: '类型1',
value: 1
}, {
label: '类型2',
value: 2
}, {
label: '类型3',
value: 3
}]
}, {
type: 'datetime',
field: 'datetime',
label: '申请时间',
}, {
type: 'singleColumn',
field: 'type',
label: '申请人',
disabled: false,
required: true,
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>

629
pages/spotCheckOrder/addServiceRecord.vue

@ -1,629 +0,0 @@
<template>
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="检修描述" prop="name" required>
<u-input v-model="form.name" placeholder="请输入检修描述" maxlength="50"/>
</u-form-item>
<u-form-item label="预估人数" prop="peoples" required>
<u-input v-model="form.peoples" type="number" placeholder="请输入预估人数" maxlength="50"/>
</u-form-item>
<u-form-item label="预估分钟" prop="estimatedMinutes" required>
<u-input v-model="form.estimatedMinutes" type="number" placeholder="请输入预估分钟" maxlength="50"/>
</u-form-item>
<u-form-item label="实际分钟" prop="actualMinutes" required>
<u-input v-model="form.actualMinutes" type="number" placeholder="请输入实际分钟" maxlength="50"/>
</u-form-item>
<u-form-item label="责任人" prop="chargePeoples" required>
<view class="select" @click="openSelecUser">
<view class="input" v-if='form.chargePeoples'>
{{selectFormatCheck(form.chargePeoples,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-item label="完成情况" prop="status" required>
<view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')">
<view class="input" v-if='form.status'>
{{selectFormat(form.status,jxDetailsStatus)}}
</view>
<view class="placeholder" v-else>
{{`请选择完成情况`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon>
</view>
</u-form-item>
<u-form-item label="完成时间" prop="completionTime" required v-if='form.status == 0'>
<view class="select" @click="openDatetime('completionTime',formatDate,params,formatValue)">
<view class="input" v-if='formatDate'>
{{formatDate}}
</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="工程师确认" prop="engineer">
<u-input v-model="form.engineer" placeholder="请输入工程师确认" maxlength="50"/>
</u-form-item>
<u-form-item label="未完成原因" prop="uncompleted" required v-if='form.status == 1'>
<u-input type='textarea' v-model="form.uncompleted" placeholder="请输入未完成原因" maxlength="200"/>
</u-form-item>
</u-form>
<view class="list">
<view class="title">
<span>*</span>备件
</view>
<view class="item " v-for="(item,index) in form.itemNumbers" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
{{item.name}}
</view>
</view>
<u-row gutter="16">
<u-col :span="12">
<view class="dec">
<view class="">
数量:{{item.qty}}
</view>
</view>
</u-col>
</u-row>
</view>
<u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(index)"></u-icon>
</view>
<view class="add-btn">
<u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加备件</u-button>
</view>
</view>
<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="isPopupShow" mode="center" border-radius="14">
<view class="popup-title">添加备件</view>
<view class="popup">
<u-form :model="form1" ref="form1" label-width="160rpx">
<u-form-item :label="`备件`" prop="number" required>
<view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')">
<view class="input" v-if='form1.number'>
{{selectFormat(form1.number,sparePartsList)}}
</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="数量" prop="qty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入故障描述" />
</u-form-item>
</u-form>
</view>
<view class="popup-footer">
<view @click="isPopupShow = false">取消</view>
<view class="sure" @click="addSpare">确认</view>
</view>
</u-popup>
<!-- 选择维修人员 -->
<u-popup v-model="isShowSelecUser" mode="center" border-radius="14">
<view class="popup-title">选择维修人员</view>
<view class="popup">
<u-checkbox-group @change="checkboxGroupChange">
<u-checkbox v-model="item.checked" v-for="(item, index) in selecUserList" :key="index"
:name="item.id">{{item.name}}</u-checkbox>
</u-checkbox-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>
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" @confirm='chooseDatetime'></u-picker>
</view>
</template>
<script>
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
import * as sparePartsApi from "@/api/spareParts.js"
import * as deptApi from "@/api/dept.js"
import * as dictApi from "@/api/dict.js"
export default {
data() {
return {
loading: false,
type: "",
//
isPopupShow: false,
sparePartsList: [],
//
from:'',//
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
field: '',
//
selecUserList: [], //
isShowSelecUser: false,
jxDetailsStatus:[],//
form: {
number: '',
name:'',
peoples: '',
estimatedMinutes: '',
actualMinutes: '',
chargePeoples: '',
status: '',
completionTime: '',
engineer: '',
uncompleted: '',
itemNumbers:[]
},
formatDate:'',//
form1: {
number: "",
qty: ''
},
//
datetimeShow:false,
params:{
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
timestamp: true,
},
datetimeDefaultValue:'',
formatValue:'YYYY-MM-DD hh:mm:ss'
}
},
methods: {
//
submit() {
//
if (!this.form.name) {
this.$modal.showToast('请输入检修描述')
return;
}
if (!this.form.peoples) {
this.$modal.showToast('请输入预估人数')
return;
}
if (this.form.peoples>100) {
this.$modal.showToast('预估人数不得超出100')
return;
}
if (!this.form.estimatedMinutes) {
this.$modal.showToast(`请输入预估分钟`)
return;
}
if (!this.form.actualMinutes) {
this.$modal.showToast('请输入实际分钟')
return;
}
if (!this.form.chargePeoples) {
this.$modal.showToast('请选择负责人')
return;
}
if (!this.form.status) {
this.$modal.showToast('请选择完成情况')
return;
}
if(this.form.status == 0){
if (!this.form.completionTime) {
this.$modal.showToast('请选择完成时间')
return;
}
}
// if (!this.form.engineer) {
// this.$modal.showToast('')
// return;
// }
if(this.form.status == 1){
if (!this.form.uncompleted) {
this.$modal.showToast('请输入未完成原因')
return;
}
}
if (this.form.itemNumbers.length === 0) {
this.$modal.showToast('请选择备件')
return;
}
if (this.form.id) {
this.$modal.confirm('是否修改检修内容').then(() => {
this.$modal.loading('加载中')
this.loading = true
overhaulOrderApi.overhaulOrderDetailUpdate(this.form).then((res) => {
this.$modal.closeLoading()
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 {
this.$modal.confirm('是否添加检修内容').then(() => {
this.$modal.loading('加载中')
this.loading = true
overhaulOrderApi.overhaulOrderDetailCreate(this.form).then((res) => {
this.$modal.closeLoading()
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
})
})
}
},
//
reset() {
if (this.form.id) {
this.form.classes = '';
this.form.faultType = ''
} else {
this.form = {}
}
},
//
async getSelecUser() {
let data = {
classType: this.type,
factoryAreaNumber: this.factoryAreaNumber,
flag: 0
}
let arr = []
if (this.form.chargePeoples) {
arr = this.form.chargePeoples.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() {
this.isShowSelecUser = true
},
checkboxGroupChange(e) {
this.chooseUserList = e
},
//
selectFormatCheck(val, array) {
const arr = val.split(',').map(parseFloat)
let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',')
return str
},
//
chooseUser() {
this.form.chargePeoples = this.chooseUserList.join(',')
this.isShowSelecUser = false
},
selectFormat(val, array) {
let str = array.filter(item => item.value == val)[0].label
return str
},
//
openSingleColumn(field, val, list,from) {
if (field == 'deviceNumber' && this.form.id) return;
this.from = from
this.singleColumnList = list
this.field = field
if (val) {
this.singleColumnDefaultValue = [list.findIndex(item => item.value == val)]
} else {
this.singleColumnDefaultValue = []
}
this.singleColumnShow = true
},
//
chooseSingleColumn(e) {
this[this.from][this.field] = e[0].value
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
},
//
async getSparePartsList() {
await sparePartsApi.getSparePartsList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.sparePartsList = res.data
})
},
//
open() {
this.form1 = {
number: "",
qty: ''
}
this.isPopupShow = true
},
//
addSpare() {
if (!this.form1.number) {
this.$modal.showToast('请选择备件')
return;
}
if (!this.form1.qty) {
this.$modal.showToast('请输入数量')
return;
}
this.form1.name=this.selectFormat(this.form1.number,this.sparePartsList)
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number)
if (arr && arr.length > 0) {
this.$modal.showToast('该备件已添加')
return;
}
}
this.form.itemNumbers.push(this.form1)
this.isPopupShow = false
},
//
delSpareParts(index) {
this.form.itemNumbers.splice(index, 1)
},
openDatetime(field,val,params,formatValue){
this.params = params
this.formatValue =formatValue
this.field = field
this.form[this.field] = val ? val :''
this.datetimeDefaultValue = val ? val :this.$time.formatDate()
this.datetimeShow = true
},
//
chooseDatetime(e){
let array1 = []
let array2 = []
if(this.formatValue.indexOf('YYYY')>-1){
array1.push(e.year)
}
if(this.formatValue.indexOf('MM')>-1){
array1.push(e.month)
}
if(this.formatValue.indexOf('DD')>-1){
array1.push(e.day)
}
if(this.formatValue.indexOf('hh')>-1){
array2.push(e.hour)
}
if(this.formatValue.indexOf('mm')>-1){
array2.push(e.minute)
}
if(this.formatValue.indexOf('ss')>-1){
array2.push(e.second)
}
let str = array1.join('-') + ' ' + array2.join(':')
this.formatDate = str
this.form[this.field] = e.timestamp
},
},
async onLoad(option) {
if (option.type) this.type = option.type;
if (option.factoryAreaNumber) this.factoryAreaNumber = option.factoryAreaNumber;
if (option.number) this.form.number = option.number;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form,'itemNumbers',this.form.items)
this.formatDate =this.form.completionTime ? this.$time.formatDate(this.form.completionTime):''
};
this.jxDetailsStatus = await dictApi.getDict('jx_details_status')
await this.getSelecUser()
await this.getSparePartsList()
}
}
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
z-index: 22;
}
.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);
}
}
.title {
padding: 32rpx 0px;
position: relative;
span {
position: absolute;
left: -16rpx;
color: #fa3534;
padding-top: 6rpx;
}
}
.list {
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
background: #F5F5F5;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
}
}
.dec {
color: #9c9c9c;
padding: 20rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
.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-checkbox-group {
display: grid !important;
}
</style>

487
pages/spotCheckOrder/detail.vue

@ -1,487 +0,0 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>检修工单</view>
</view>
<view class="dec">
<view class="dec-item">
<view>工单单号</view>
<view>{{data.number}}</view>
</view>
<view class="dec-item">
<view>维修工单</view>
<view>{{data.maintenanceNumber}}</view>
</view>
<view class="dec-item">
<view>故障类型</view>
<view>{{data.faultTypeName}}</view>
</view>
<view class="dec-item">
<view>维修工</view>
<view>{{data.maintenance}}</view>
</view>
</view>
</view>
<div class="line"></div>
<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>{{deviceInfo.number}}</view>
</view>
<view class="dec-item">
<view>设备名称</view>
<view>{{deviceInfo.name}}</view>
</view>
<view class="dec-item">
<view>所属厂区</view>
<view>{{deviceInfo.factoryAreaName}}</view>
</view>
<view class="dec-item">
<view>设备类型</view>
<view>{{deviceInfo.typeName}}</view>
</view>
</view>
<view class="list" v-if="current == 1">
<view class="item " v-for="(item,index) in serviceList" :key="index"
@click="addSubForm('updata',item)">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
{{item.name}}
</view>
<u-icon name="trash" color="#aaaaaa" size="40"
@click.native.stop="delService(item)"></u-icon>
</view>
<view class="dec2">
<view>预估人数</view>
<view>{{item.peoples}}</view>
</view>
<view class="dec2">
<view>预估分钟</view>
<view>{{item.estimatedMinutes}}分钟</view>
</view>
<view class="dec2">
<view>实际分钟</view>
<view>{{item.actualMinutes}}分钟</view>
</view>
<view class="dec2">
<view>责任人</view>
<view>{{item.chargePeoplesName}}</view>
</view>
<view class="dec2" >
<view>完成情况</view>
<view>{{item.status==0?'完成':'未完成'}}</view>
</view>
<view class="dec2" v-if='item.status == 0'>
<view>完成时间</view>
<view>{{$time.formatDate(item.completionTime)}}</view>
</view>
<view class="dec2">
<view>工程师确认</view>
<view>{{item.engineer}}</view>
</view>
<view class="dec2" v-if="item.status == 1">
<view>未完成原因</view>
<view>{{item.uncompleted}}</view>
</view>
<view class="dec2">
备件
</view>
<view class="items" v-for="(cur,key) in item.items" :key="key">
<view class="items-name">
{{cur.name}}
</view>
<view class="items-dec">
备件编号{{cur.number}}
</view>
<view class="items-dec">
数量{{cur.qty}}
</view>
</view>
</view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</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 class="footer">
<view class="btns">
<u-button type="primary" v-if="data.status == 'PROCCED'" @click="orderClick()" :loading='loading'
:disabled='loading'>完成</u-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 SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
export default {
components: {
Form,
SparePartsCard
},
data() {
return {
list: [{
name: '设备信息'
}, {
name: '检修内容'
}],
current: 0,
changeItem: '',
data: '', //
loading: false,
type: "",
deviceInfo: '', //
serviceList: [], //
}
},
methods: {
change(index) {
this.current = index
this.changeItem = this.list[this.current]
},
//
addSubForm(clickType, item) {
if(this.data.status == 'PENDING'){
this.$modal.showToast('请先接单')
return
}
if (clickType == 'updata') {
this.$tab.navigateTo(
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}&data=${encodeURIComponent(JSON.stringify(item))}`
)
} else {
this.$tab.navigateTo(
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}`
)
}
},
//
addSpare() {
},
//
cancle() {
this.isPopupShow = false
},
// /
getDetailsByNumber() {
const data = {
number: this.data.deviceNumber,
id: ''
}
if (this.type == 'DEVICE') {
deviceApi.getDeviceDetailsByNumber(data).then((res) => {
if (res.data) {
this.deviceInfo = res.data
} else {
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`)
}
})
} else if (this.type == 'MOLD') {
moldApi.getMoldDetailsByNumber(data).then((res) => {
if (res.data) {
this.deviceInfo = res.data
} else {
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`)
}
})
}
},
// APP
orderClick() {
if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){
this.$modal.showToast('请添加检修内容')
return;
}
const data = {
// number: this.data.number,
// status: this.data.status,
id: this.data.id,
// requestNumber: ''
}
let tips = '是否完成'
this.$modal.confirm(tips).then(() => {
this.$modal.loading('加载中')
this.loading = true
overhaulOrderApi.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
})
})
},
//
getOverhaulOrderDetailList() {
overhaulOrderApi.overhaulOrderDetailList({
number: this.data.number
}).then((res) => {
if (res.data) {
this.serviceList = res.data
}
})
},
//
delService(item) {
this.$modal.confirm('确定删除检修内容吗?').then(() => {
this.$modal.loading('加载中')
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => {
this.$modal.closeLoading()
this.getOverhaulOrderDetailList()
})
})
},
//
transfer() {
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`)
}
},
onLoad(option) {
if (option.type) this.type = option.type;
if (option.data) {
this.data = JSON.parse(decodeURIComponent(option.data))
}
this.changeItem = this.list[this.current]
},
onShow() {
this.getDetailsByNumber()
this.getOverhaulOrderDetailList()
}
}
</script>
<style lang="scss" scoped>
.detail-container{
min-height: 100vh;
background: white;
}
.line{
background: #f5f5f5;
height: 20rpx;
}
.info {
background: white;
}
.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;
width: 0px;
word-wrap: break-word;
}
}
}
}
.dec2 {
padding: 10rpx 30rpx;
display: flex;
view {
&:nth-child(1) {
width: 180rpx;
}
&:nth-child(2) {
color: #888888;
flex: 1;
width: 0px;
word-wrap: break-word;
}
}
}
.items {
margin: 20rpx 30rpx;
border-radius: 12rpx;
background: #F5F5F5;
padding-bottom: 20rpx;
.items-name {
padding: 20rpx;
border-bottom: 1px solid #dedede;
}
.items-dec {
padding: 0px 20rpx;
margin-top: 20rpx;
}
}
.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;
}
}
}
.list {
padding: 20rpx;
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
border-radius: 12rpx;
border: 1px solid #dedede;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
display: flex;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
flex: 1;
}
}
.dec {
color: #9c9c9c;
padding: 0rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
</style>

102
pages/spotCheckOrder/myRepairOrder.vue → pages/spotCheckOrder/myOrder.vue

@ -1,61 +1,58 @@
<template>
<!-- 我的维修工单 -->
<!-- 点检工单 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="我的维修">
title="点检工单">
</u-navbar>
<Search @search='search' @screen='screen'/>
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.describes}}
<view class="item" v-for="(item,index) in list" :key="index" >
<view class="">
<view class="title">
<view class="title-txt">
{{item.describes}}
</view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
<u-tag text="已转办" v-else-if="item.status=='TRANSFERRED'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/>
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view>
<view class="time">
2023-12-12 08:00:00
<view class="dec">
点检单号:<span>{{item.number}}</span>
</view>
<view class="dec">
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
班次:<span>{{item.classesName}}</span>
</view>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
设备编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
设备名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="bottom">
<view class="status">
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
</view>
<view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.isCancel == 0" @click="cancle(item)">撤销</u-button>
<view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as repairOrderApi from "@/api/repairOrder.js"
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
export default {
data() {
return {
params: {
pageNo: 1,
pageSize: 10,
type: 'DEVICE',
flag:1
},
status: 'loadmore', //
@ -64,18 +61,13 @@
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
},
addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
//
//
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
repairOrderApi.repairOrderPage(this.params).then((res) => {
this.$modal.loading('加载中')
spotCheckOrderApi.spotCheckOrderPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
@ -85,24 +77,21 @@
}
})
},
//
cancle(item){
this.$modal.confirm('确定撤销报修吗?').then(()=>{
deviceApi.rejected(item.id).then((res) => {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
})
})
}
},
onShow() {
uni.$on('screen',(data)=>{
console.log(data)
this.params = {...this.params,...data}
})
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
onUnload() {
uni.$off('screen')
},
onReachBottom() {
this.getList()
@ -112,6 +101,7 @@
<style lang="scss" scoped>
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
@ -209,10 +199,8 @@
padding: 20rpx 0px;
position: relative;
.status {
flex: 1;
}
.button{
.button {
position: absolute;
right: 0rpx;
}

6
pages/upkeepOrder/detail.vue

@ -131,16 +131,10 @@
</template>
<script>
import Form from '@/components/form/index.vue'
import SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as upkeepOrderApi from "@/api/upkeepOrder.js"
export default {
components: {
Form,
SparePartsCard
},
data() {
return {
list: [{

108
pages/overhaulOrder/myRepairOrder.vue → pages/upkeepOrder/myOrder.vue

@ -1,61 +1,64 @@
<template>
<!-- 我的维修工单 -->
<!-- 保养工单 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="我的维修">
title="保养工单">
</u-navbar>
<Search @search='search' @screen='screen'/>
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.describes}}
<view class="item" v-for="(item,index) in list" :key="index" >
<view class="">
<view class="title">
<view class="title-txt">
{{item.describes}}
</view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
<u-tag text="已转办" v-else-if="item.status=='TRANSFERRED'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/>
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view>
<view class="time">
2023-12-12 08:00:00
<view class="dec">
保养单号:<span>{{item.number}}</span>
</view>
<view class="dec">
保养计划单号:<span>{{item.planNumber}}</span>
</view>
<view class="dec">
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="dec">
故障类型:<span>{{item.faultTypeName}}</span>
</view>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
设备编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
设备名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="bottom">
<view class="status">
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
</view>
<view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.isCancel == 0" @click="cancle(item)">撤销</u-button>
<view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as repairOrderApi from "@/api/repairOrder.js"
import * as upkeepOrderApi from "@/api/upkeepOrder.js"
export default {
data() {
return {
params: {
pageNo: 1,
pageSize: 10,
type: 'DEVICE',
flag:1
},
status: 'loadmore', //
@ -64,18 +67,13 @@
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
},
addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
//
//
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
repairOrderApi.repairOrderPage(this.params).then((res) => {
this.$modal.loading('加载中')
upkeepOrderApi.upkeepOrderPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
@ -85,24 +83,21 @@
}
})
},
//
cancle(item){
this.$modal.confirm('确定撤销报修吗?').then(()=>{
deviceApi.rejected(item.id).then((res) => {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
})
})
}
},
onShow() {
uni.$on('screen',(data)=>{
console.log(data)
this.params = {...this.params,...data}
})
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
onUnload() {
uni.$off('screen')
},
onReachBottom() {
this.getList()
@ -112,6 +107,7 @@
<style lang="scss" scoped>
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
@ -209,10 +205,8 @@
padding: 20rpx 0px;
position: relative;
.status {
flex: 1;
}
.button{
.button {
position: absolute;
right: 0rpx;
}

223
pages/upkeepOrder/myRepairOrder.vue

@ -1,223 +0,0 @@
<template>
<!-- 我的维修工单 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="我的维修">
</u-navbar>
<Search @search='search' @screen='screen'/>
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.describes}}
</view>
<view class="time">
2023-12-12 08:00:00
</view>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
设备编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
设备名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="bottom">
<view class="status">
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
</view>
<view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.isCancel == 0" @click="cancle(item)">撤销</u-button>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as repairOrderApi from "@/api/repairOrder.js"
export default {
data() {
return {
params: {
pageNo: 1,
pageSize: 10,
type: 'DEVICE',
flag:1
},
status: 'loadmore', //
list: [],
}
},
methods: {
//
screen() {
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
},
addForm() {
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
//
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
repairOrderApi.repairOrderPage(this.params).then((res) => {
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
this.status = 'loadmore'
} else {
this.status = 'nomore'
}
})
},
//
cancle(item){
this.$modal.confirm('确定撤销报修吗?').then(()=>{
deviceApi.rejected(item.id).then((res) => {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
})
})
}
},
onShow() {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
onReachBottom() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.list {
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;
}
}
}
.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;
position: relative;
.status {
flex: 1;
}
.button{
position: absolute;
right: 0rpx;
}
}
}
}
</style>
Loading…
Cancel
Save