zhang_li
10 months ago
32 changed files with 2630 additions and 227 deletions
@ -0,0 +1,42 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 根据设备/模具号查询信息
|
|||
export function getDetailsByNumber(params) { |
|||
return request({ |
|||
url: '/eam/device-accounts/getDetailsByNumber', |
|||
'method': 'GET', |
|||
params |
|||
}) |
|||
} |
|||
// 添加报修
|
|||
export function deviceRepairCreate(data) { |
|||
return request({ |
|||
url: '/eam/device-repair/create', |
|||
'method': 'POST', |
|||
data |
|||
}) |
|||
} |
|||
// 报修列表
|
|||
export function deviceRepairPage(params) { |
|||
return request({ |
|||
url: '/eam/device-repair/getAppPage', |
|||
'method': 'GET', |
|||
params |
|||
}) |
|||
} |
|||
|
|||
// 报修列表
|
|||
export function rejected(id) { |
|||
return request({ |
|||
url: '/eam/device-repair/rejected?id='+id, |
|||
'method': 'DELETE', |
|||
}) |
|||
} |
|||
// 设备列表
|
|||
export function deviceList(params) { |
|||
return request({ |
|||
url: '/eam/device-accounts/selectData', |
|||
'method': 'GET', |
|||
params |
|||
}) |
|||
} |
@ -0,0 +1,23 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 获取字典
|
|||
function getDictList(type) { |
|||
return request({ |
|||
url: '/eam/device-maintenance-main/getDictList?type=' + type, |
|||
'method': 'GET', |
|||
}) |
|||
} |
|||
export async function getDict(type) { |
|||
let data =[] |
|||
await getDictList(type).then((res) => { |
|||
if (res.code == 0) { |
|||
data = res.data.map(item=>{ |
|||
return { |
|||
label:item.label, |
|||
value:item.code, |
|||
} |
|||
}) |
|||
} else {} |
|||
}).catch((err) => {}) |
|||
return data |
|||
} |
@ -0,0 +1,9 @@ |
|||
import request from '@/utils/request' |
|||
// 获取首页数量信息
|
|||
export function getCounts() { |
|||
return request({ |
|||
url: '/eam/device-accounts/getCounts', |
|||
'method': 'GET' |
|||
}) |
|||
} |
|||
|
@ -0,0 +1,36 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
|
|||
// 添加工单
|
|||
export function repairOrderCreate(data) { |
|||
return request({ |
|||
url: '/eam/device-maintenance-main/create', |
|||
'method': 'POST', |
|||
data |
|||
}) |
|||
} |
|||
// 编辑工单
|
|||
export function repairOrderUpdate(data) { |
|||
return request({ |
|||
url: '/eam/device-maintenance-main/update', |
|||
'method': 'PUT', |
|||
data |
|||
}) |
|||
} |
|||
// 报修列表
|
|||
export function repairOrderPage(params) { |
|||
return request({ |
|||
url: '/eam/device-maintenance-main/getAppPage', |
|||
'method': 'GET', |
|||
params |
|||
}) |
|||
} |
|||
// 操作工单
|
|||
export function orderClick(params) { |
|||
return request({ |
|||
url: '/eam/device-maintenance-main/orderClick', |
|||
'method': 'GET', |
|||
params |
|||
}) |
|||
} |
|||
|
@ -0,0 +1,226 @@ |
|||
<template> |
|||
<!-- 添加设备报修 --> |
|||
<view class="add-form-container"> |
|||
<u-form :model="form" ref="form1" label-width="160rpx"> |
|||
<u-form-item label="故障描述" prop="describes" required> |
|||
<u-input v-model="form.describes" placeholder="请输入故障描述" /> |
|||
</u-form-item> |
|||
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required> |
|||
<u-input v-model="form.deviceNumber" @blur="blur()" |
|||
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" /> |
|||
<view class="right-button" @click="chickRightButton"> |
|||
扫描 |
|||
</view> |
|||
</u-form-item> |
|||
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceName" required> |
|||
<u-input v-model="form.deviceName" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}名称`" disabled /> |
|||
</u-form-item> |
|||
<u-form-item label="所属厂区" prop="factoryAreaName" required> |
|||
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> |
|||
</u-form-item> |
|||
</u-form> |
|||
<view class="footer"> |
|||
<view class="btns"> |
|||
<button class="reset" @click="reset">重置</button> |
|||
<button class="sure" @click="submit" :loading='loading' :disabled='loading'>确定</button> |
|||
</view> |
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import * as deviceApi from "@/api/device.js" |
|||
export default { |
|||
data() { |
|||
return { |
|||
loading: false, |
|||
type: "", |
|||
form: { |
|||
describes: "", |
|||
deviceNumber: '', |
|||
deviceName: '', |
|||
factoryAreaName: '', |
|||
factoryAreaNumber: '', |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 扫描设备条码 |
|||
chickRightButton(field) { |
|||
uni.scanCode({ |
|||
success: function(res) { |
|||
this.form.deviceNumber = res.result |
|||
this.getDetailsByNumber() |
|||
} |
|||
}); |
|||
}, |
|||
blur() { |
|||
if (this.form.deviceNumber) { |
|||
this.getDetailsByNumber() |
|||
} |
|||
}, |
|||
// 根据设备/模具号查询信息 |
|||
getDetailsByNumber() { |
|||
const data = { |
|||
number: this.form.deviceNumber, |
|||
type: this.type, |
|||
id: '' |
|||
} |
|||
deviceApi.getDetailsByNumber(data).then((res) => { |
|||
if (res.data) { |
|||
this.form.deviceName = res.data.name |
|||
this.form.factoryAreaName = res.data.factoryAreaName |
|||
this.form.factoryAreaNumber = res.data.factoryAreaNumber |
|||
} else { |
|||
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
|||
} |
|||
}) |
|||
}, |
|||
// 触发提交表单 |
|||
submit() { |
|||
// 校验 |
|||
if (!this.form.describes) { |
|||
this.$modal.showToast('请输入故障描述') |
|||
return; |
|||
} |
|||
if (!this.form.deviceNumber) { |
|||
this.$modal.showToast(`请输入${this.type=='DEVICE'?'设备' : '模具'}编码`) |
|||
return; |
|||
} |
|||
if (!this.form.deviceName) { |
|||
this.$modal.showToast(`请输入${this.type=='DEVICE'?'设备' : '模具'}名称`) |
|||
return; |
|||
} |
|||
if (!this.form.factoryAreaName) { |
|||
this.$modal.showToast('请输入所属厂区') |
|||
return; |
|||
} |
|||
const data = { |
|||
describes: this.form.describes, |
|||
deviceNumber: this.form.deviceNumber, |
|||
factoryAreaNumber: this.form.factoryAreaNumber, |
|||
type: this.type |
|||
} |
|||
this.$modal.confirm('是否添加报修').then(() => { |
|||
this.$modal.loading('加载中') |
|||
this.loading = true |
|||
deviceApi.deviceRepairCreate(data).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.form = {} |
|||
}, |
|||
|
|||
}, |
|||
onLoad(option) { |
|||
if (option.type) this.type = option.type; |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.add-form-container { |
|||
min-height: calc(100vh - 140rpx); |
|||
background: white; |
|||
padding: 0px 30rpx 140rpx; |
|||
} |
|||
|
|||
.list { |
|||
padding-bottom: 20rpx; |
|||
|
|||
.item { |
|||
margin-top: 20rpx; |
|||
background: white; |
|||
padding: 30rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
image { |
|||
width: 160rpx; |
|||
height: 160rpx; |
|||
margin-right: 20rpx; |
|||
} |
|||
|
|||
.title { |
|||
font-size: 32rpx; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.dec1 { |
|||
font-size: 28rpx; |
|||
margin-top: 16rpx; |
|||
color: #acacac; |
|||
} |
|||
|
|||
.dec2 { |
|||
font-size: 28rpx; |
|||
margin-top: 6rpx; |
|||
color: #acacac; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.footer { |
|||
position: fixed; |
|||
bottom: 0px; |
|||
left: 0px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btns { |
|||
display: flex; |
|||
|
|||
|
|||
button { |
|||
flex: 1; |
|||
} |
|||
|
|||
.sure { |
|||
background: #409eff; |
|||
color: white; |
|||
border-radius: 0px; |
|||
|
|||
&::after { |
|||
border: 1px solid #409eff; |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
|
|||
.reset { |
|||
background: #F5F5F5; |
|||
border-radius: 0px; |
|||
|
|||
&::after { |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.right-button { |
|||
background: #409eff; |
|||
color: white; |
|||
padding: 0rpx 30rpx; |
|||
border-radius: 16rpx; |
|||
text-align: center; |
|||
font-size: 28rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,242 @@ |
|||
<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' :isShowScreen='false'/> --> |
|||
<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 --> |
|||
{{`${$time.formatDate(item.createTime)}`}} |
|||
</view> |
|||
</view> |
|||
<view class="dec"> |
|||
报修单号:<span>{{item.number}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
{{`${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' /> |
|||
</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> |
|||
<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 workOrderList from '@/components/workOrderList/index.vue' |
|||
import * as deviceApi from "@/api/device.js" |
|||
export default { |
|||
components: { |
|||
workOrderList |
|||
}, |
|||
data() { |
|||
return { |
|||
params: { |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
type: '' |
|||
}, |
|||
status: 'loadmore', //是否显示没有更多了 |
|||
list: [], |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
// 筛选 |
|||
screen() { |
|||
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`) |
|||
}, |
|||
itemClick(item, index) { |
|||
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`) |
|||
}, |
|||
addForm() { |
|||
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) |
|||
}, |
|||
// 获取设备保修列表 |
|||
getList() { |
|||
if (this.status == 'nomore') return; |
|||
this.status = 'loading'; |
|||
this.$modal.loading('加载中') |
|||
deviceApi.deviceRepairPage(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('加载中') |
|||
deviceApi.rejected(item.id).then((res) => { |
|||
this.$modal.closeLoading() |
|||
this.params.pageNo = 1 |
|||
this.list = [] |
|||
this.status = 'loadmore' |
|||
this.getList() |
|||
}) |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
if (option.type) this.params.type = option.type; |
|||
}, |
|||
onShow() { |
|||
this.params.pageNo = 1 |
|||
this.list = [] |
|||
this.status = 'loadmore' |
|||
this.getList() |
|||
}, |
|||
onReachBottom() { |
|||
this.getList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.list { |
|||
background: #f5f5f5; |
|||
margin-top: 20rpx; |
|||
|
|||
.item { |
|||
padding: 30rpx 30rpx 0px 30rpx; |
|||
margin-top: 20rpx; |
|||
background: white; |
|||
|
|||
.title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding-bottom: 20rpx; |
|||
|
|||
.title-txt { |
|||
color: #409eff; |
|||
font-weight: bold; |
|||
font-size: 36rpx; |
|||
width: 0px; |
|||
flex: 1; |
|||
} |
|||
|
|||
.time { |
|||
color: #919191; |
|||
|
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
padding-bottom: 20rpx; |
|||
|
|||
span { |
|||
color: #999999; |
|||
} |
|||
} |
|||
|
|||
.last { |
|||
padding-bottom: 30rpx; |
|||
} |
|||
|
|||
.bottom { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
border-top: 1px solid #E4E4E4; |
|||
padding: 20rpx 0px; |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
.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> |
@ -0,0 +1,230 @@ |
|||
<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 workOrderList from '@/components/workOrderList/index.vue' |
|||
import * as deviceApi from "@/api/device.js" |
|||
export default { |
|||
components: { |
|||
workOrderList |
|||
}, |
|||
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}`) |
|||
}, |
|||
itemClick(item, index) { |
|||
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`) |
|||
}, |
|||
addForm() { |
|||
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) |
|||
}, |
|||
// 获取设备保修列表 |
|||
getList() { |
|||
if (this.status == 'nomore') return; |
|||
this.status = 'loading'; |
|||
deviceApi.deviceRepairPage(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> |
@ -0,0 +1,349 @@ |
|||
<template> |
|||
<!-- 添加维修工单 --> |
|||
<view class="add-form-container"> |
|||
<u-form :model="form" ref="form1" label-width="160rpx"> |
|||
<u-form-item label="故障描述" prop="describes" required> |
|||
<u-input v-model="form.describes" placeholder="请输入故障描述" :disabled="form&&form.id" /> |
|||
</u-form-item> |
|||
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceNumber" required> |
|||
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)"> |
|||
<view class="input" v-if='form.deviceNumber'> |
|||
{{selectFormat(form.deviceNumber,deviceList)}} |
|||
</view> |
|||
<view class="placeholder" v-else> |
|||
{{`请输入${type=='DEVICE'?'设备' : '模具'}名称`}} |
|||
</view> |
|||
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon> |
|||
</view> |
|||
</u-form-item> |
|||
<u-form-item label="所属厂区" prop="factoryAreaName" required> |
|||
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> |
|||
</u-form-item> |
|||
<u-form-item label="班次" prop="classes" required> |
|||
<view class="select" @click="openSingleColumn('classes',form.classes,maintenanceShift)"> |
|||
<view class="input" v-if='form.classes'> |
|||
{{selectFormat(form.classes,maintenanceShift)}} |
|||
</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="classes" required> |
|||
<view class="select" @click="openSingleColumn('faultType',form.faultType,faultType)"> |
|||
<view class="input" v-if='form.faultType'> |
|||
{{selectFormat(form.faultType,faultType)}} |
|||
</view> |
|||
<view class="placeholder" v-else> |
|||
{{`请选择故障类型`}} |
|||
</view> |
|||
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|||
</view> |
|||
</u-form-item> |
|||
</u-form> |
|||
<view class="footer"> |
|||
<view class="btns"> |
|||
<button class="reset" @click="reset">重置</button> |
|||
<button class="sure" @click="submit" :loading='loading' :disabled='loading'>确定</button> |
|||
</view> |
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' |
|||
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import * as deviceApi from "@/api/device.js" |
|||
import * as dictApi from "@/api/dict.js" |
|||
import * as repairOrderApi from "@/api/repairOrder.js" |
|||
|
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
loading: false, |
|||
type: "", |
|||
form: { |
|||
id: '', |
|||
describes: "", |
|||
deviceNumber: '', |
|||
deviceName: '', |
|||
factoryAreaName: '', |
|||
factoryAreaNumber: '', |
|||
classes: '', |
|||
faultType: '' |
|||
}, |
|||
deviceList: [], //设备列表 |
|||
singleColumnShow: false, |
|||
singleColumnDefaultValue: [], |
|||
singleColumnList: [], |
|||
field: '', |
|||
maintenanceShift: [], //班次字典项 |
|||
faultType: [], //故障类型字典项 |
|||
} |
|||
}, |
|||
methods: { |
|||
// 触发提交表单 |
|||
submit() { |
|||
// 校验 |
|||
if (!this.form.describes) { |
|||
this.$modal.showToast('请输入故障描述') |
|||
return; |
|||
} |
|||
if (!this.form.deviceName) { |
|||
this.$modal.showToast(`请选择${this.type=='DEVICE'?'设备' : '模具'}名称`) |
|||
return; |
|||
} |
|||
if (!this.form.factoryAreaName) { |
|||
this.$modal.showToast('请输入区域') |
|||
return; |
|||
} |
|||
if (!this.form.classes) { |
|||
this.$modal.showToast('请选择班次') |
|||
return; |
|||
} |
|||
if (!this.form.classes) { |
|||
this.$modal.showToast('请选择班次') |
|||
return; |
|||
} |
|||
const data = { |
|||
id: this.form && this.form.id ? this.form.id : '', |
|||
describes: this.form.describes, |
|||
deviceNumber: this.form.deviceNumber, |
|||
factoryAreaNumber: this.form.factoryAreaNumber, |
|||
classes: this.form.classes, |
|||
faultType: this.form.faultType, |
|||
type: this.type |
|||
} |
|||
if (this.form.id) { |
|||
this.$modal.confirm('是否修改维修工单').then(() => { |
|||
this.$modal.loading('加载中') |
|||
this.loading = true |
|||
repairOrderApi.repairOrderUpdate(data).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 |
|||
repairOrderApi.repairOrderCreate(data).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 = {} |
|||
} |
|||
}, |
|||
// |
|||
selectFormat(val, array) { |
|||
let str = array.filter(item => item.value == val)[0].label |
|||
return str |
|||
}, |
|||
// 单列模式 |
|||
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) { |
|||
console.log(e[0]) |
|||
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 getDeviceList() { |
|||
await deviceApi.deviceList({ |
|||
type: this.type, |
|||
id: '' |
|||
}).then(res => { |
|||
res.data.map(item => { |
|||
item.value = item.number |
|||
item.label = item.name |
|||
}) |
|||
this.deviceList = res.data |
|||
}) |
|||
}, |
|||
}, |
|||
async onLoad(option) { |
|||
if (option.type) this.type = option.type; |
|||
if (option.data) { |
|||
let data = JSON.parse(decodeURIComponent(option.data)) |
|||
this.form = { |
|||
id: data.id, |
|||
describes: data.describes, |
|||
deviceNumber: data.deviceNumber, |
|||
deviceName: data.name, |
|||
factoryAreaName: data.factoryAreaName, |
|||
factoryAreaNumber: data.factoryAreaNumber, |
|||
classes: data.classes ? data.classes : '0', |
|||
faultType: data.faultType, |
|||
// faultTypeName:data.faultTypeName, |
|||
} |
|||
}; |
|||
await this.getDeviceList() |
|||
this.maintenanceShift = await dictApi.getDict('maintenance_shift') |
|||
this.faultType = await dictApi.getDict('fault_type') |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.add-form-container { |
|||
min-height: calc(100vh - 140rpx); |
|||
background: white; |
|||
padding: 0px 30rpx 140rpx; |
|||
} |
|||
|
|||
.list { |
|||
padding-bottom: 20rpx; |
|||
|
|||
.item { |
|||
margin-top: 20rpx; |
|||
background: white; |
|||
padding: 30rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
image { |
|||
width: 160rpx; |
|||
height: 160rpx; |
|||
margin-right: 20rpx; |
|||
} |
|||
|
|||
.title { |
|||
font-size: 32rpx; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.dec1 { |
|||
font-size: 28rpx; |
|||
margin-top: 16rpx; |
|||
color: #acacac; |
|||
} |
|||
|
|||
.dec2 { |
|||
font-size: 28rpx; |
|||
margin-top: 6rpx; |
|||
color: #acacac; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.footer { |
|||
position: fixed; |
|||
bottom: 0px; |
|||
left: 0px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btns { |
|||
display: flex; |
|||
|
|||
|
|||
button { |
|||
flex: 1; |
|||
} |
|||
|
|||
.sure { |
|||
background: #409eff; |
|||
color: white; |
|||
border-radius: 0px; |
|||
|
|||
&::after { |
|||
border: 1px solid #409eff; |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
|
|||
.reset { |
|||
background: #F5F5F5; |
|||
border-radius: 0px; |
|||
|
|||
&::after { |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.right-button { |
|||
background: #409eff; |
|||
color: white; |
|||
padding: 0rpx 30rpx; |
|||
border-radius: 16rpx; |
|||
text-align: center; |
|||
font-size: 28rpx; |
|||
} |
|||
|
|||
.select { |
|||
display: flex; |
|||
align-items: center; |
|||
height: 72rpx; |
|||
width: 100%; |
|||
|
|||
.input { |
|||
flex: 1; |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
} |
|||
|
|||
.placeholder { |
|||
flex: 1; |
|||
font-size: 28rpx; |
|||
color: rgb(192, 196, 204); |
|||
|
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,363 @@ |
|||
<template> |
|||
<!-- 详情 --> |
|||
<view class="detail-container"> |
|||
<view class="info"> |
|||
<view class="title"> |
|||
<view>维修工单</view> |
|||
<view>转办</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view class="dec-item"> |
|||
<view>工单单号</view> |
|||
<view>{{data.number}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>报修描述</view> |
|||
<view>{{data.describes}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>班次</view> |
|||
<view>{{data.classesName}}</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> |
|||
<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="dec" v-if="current == 1"> |
|||
<view class="dec-item"> |
|||
<view>工单单号</view> |
|||
<view>{{data.number}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>报修描述</view> |
|||
<view>{{data.describes}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>维修工</view> |
|||
<view>{{data.maintenance}}</view> |
|||
</view> |
|||
</view> |
|||
<view class="dec" v-if="current == 2"> |
|||
<SparePartsCard :subForm='subForm' :data='data' @addSubForm='addSubForm' |
|||
@delSubFormItem='delSubFormItem'> |
|||
</SparePartsCard> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="footer"> |
|||
<view class="btns"> |
|||
<u-button type="primary" v-if="data.status == 'PENDING'" @click="orderClick()" :loading='loading' :disabled='loading'>接单</u-button> |
|||
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick()" :loading='loading' :disabled='loading'>完成</u-button> |
|||
<u-button type="primary" v-if="data.status == 'COMPLETED'" @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> |
|||
<u-popup v-model="isPopupShow" mode="center" border-radius="14"> |
|||
<view class="popup-title">添加记录</view> |
|||
<view class="popup"> |
|||
<Form :form='subForm' :data='data' ref="form2"></Form> |
|||
</view> |
|||
<view class="popup-footer"> |
|||
<view @click="cancle">取消</view> |
|||
<view class="sure" @click="addSpare">确认</view> |
|||
</view> |
|||
</u-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import Form from '@/components/form/index.vue' |
|||
import SparePartsCard from '@/components/sparePartsCard/index.vue' |
|||
import * as deviceApi from "@/api/device.js" |
|||
import * as repairOrderApi from "@/api/repairOrder.js" |
|||
export default { |
|||
components: { |
|||
Form, |
|||
SparePartsCard |
|||
}, |
|||
data() { |
|||
return { |
|||
list: [{ |
|||
name: '设备信息' |
|||
}, { |
|||
name: '报修信息' |
|||
}, { |
|||
name: '维修记录' |
|||
}], |
|||
current: 0, |
|||
changeItem: '', |
|||
data: '', //工单信息 |
|||
loading: false, |
|||
type: "", |
|||
deviceInfo: '', //设备信息 |
|||
isPopupShow: false, |
|||
subForm: { |
|||
formLabel: '', |
|||
formField: 'subList', |
|||
required: true, |
|||
isShowButton: true, |
|||
disabled: false, |
|||
visible: true, |
|||
loading: false, |
|||
labelWidth: '180rpx', |
|||
border: true, |
|||
errorType: ['toast'], |
|||
formData: [{ |
|||
type: 'singleColumn', |
|||
field: 'name', |
|||
label: '模具', |
|||
disabled: false, |
|||
required: true, |
|||
span: 12, |
|||
list: [{ |
|||
label: '类型1', |
|||
value: 1 |
|||
}, { |
|||
label: '类型2', |
|||
value: 2 |
|||
}, { |
|||
label: '类型3', |
|||
value: 3 |
|||
}] |
|||
}, { |
|||
type: 'text', |
|||
field: 'stork', |
|||
label: '库存', |
|||
disabled: false, |
|||
required: true, |
|||
isList: true, |
|||
span: 6 |
|||
}, { |
|||
type: 'text', |
|||
field: 'number', |
|||
label: '数量', |
|||
disabled: false, |
|||
required: true, |
|||
isList: true, |
|||
span: 6 |
|||
}], |
|||
}, |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
change(index) { |
|||
console.log("index", index); |
|||
this.current = index |
|||
this.changeItem = this.list[this.current] |
|||
}, |
|||
// 添加表格表单 |
|||
addSubForm() { |
|||
console.log(5) |
|||
this.isPopupShow = true |
|||
}, |
|||
// 添加备件 |
|||
addSpare() { |
|||
|
|||
}, |
|||
// 取消添加备件 |
|||
cancle() { |
|||
this.isPopupShow = false |
|||
}, |
|||
// 根据设备/模具号查询信息 |
|||
getDetailsByNumber() { |
|||
const data = { |
|||
number: this.data.deviceNumber, |
|||
type: this.type, |
|||
id: '' |
|||
} |
|||
deviceApi.getDetailsByNumber(data).then((res) => { |
|||
if (res.data) { |
|||
this.deviceInfo = res.data |
|||
} else { |
|||
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
|||
} |
|||
}) |
|||
}, |
|||
// APP维修工单接单、点击完成、验证 |
|||
orderClick() { |
|||
const data = { |
|||
number: this.data.number, |
|||
status: this.data.status, |
|||
id: this.data.id, |
|||
requestNumber: '' |
|||
} |
|||
let tips = this.data.status == 'PENDING' ? '是否接单?' : this.data.status == 'PECEIVED'?'是否完成?' : this.data.status == 'COMPLETED'?'是否验证完结?':'' |
|||
this.$modal.confirm(tips).then(() => { |
|||
this.$modal.loading('加载中') |
|||
this.loading = true |
|||
repairOrderApi.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 |
|||
}) |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
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] |
|||
|
|||
this.getDetailsByNumber() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.info { |
|||
background: white; |
|||
margin-bottom: 20rpx; |
|||
} |
|||
|
|||
.tab { |
|||
border-bottom: 1px solid #e4e4e4; |
|||
|
|||
} |
|||
|
|||
.title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 20rpx 30rpx; |
|||
border-bottom: 1px solid #e4e4e4; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
flex: 1; |
|||
border-left: 10rpx solid #409eff; |
|||
padding-left: 20rpx; |
|||
font-weight: bold; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
padding: 30rpx; |
|||
|
|||
.dec-item { |
|||
padding-bottom: 30rpx; |
|||
display: flex; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: #888888; |
|||
flex: 1; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.popup-title { |
|||
text-align: center; |
|||
font-size: 32rpx; |
|||
font-weight: bold; |
|||
color: #409eff; |
|||
padding: 30rpx |
|||
} |
|||
|
|||
.popup { |
|||
width: 600rpx; |
|||
padding: 0rpx 60rpx 0rpx; |
|||
|
|||
} |
|||
|
|||
.popup-footer { |
|||
display: flex; |
|||
border-top: 1px solid #e4e4e4; |
|||
|
|||
view { |
|||
line-height: 100rpx; |
|||
flex: 1; |
|||
text-align: center; |
|||
|
|||
&.sure { |
|||
color: #409eff; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.footer { |
|||
position: fixed; |
|||
bottom: 0px; |
|||
left: 0px; |
|||
width: 100%; |
|||
background: white; |
|||
z-index: 22; |
|||
} |
|||
|
|||
.btns { |
|||
display: flex; |
|||
|
|||
padding: 20rpx; |
|||
box-shadow: 0px -2rpx 20rpx rgba(0, 0, 0, 0.1); |
|||
|
|||
|
|||
button { |
|||
flex: 1; |
|||
margin: 0px 10rpx; |
|||
} |
|||
|
|||
.sure { |
|||
background: #409eff; |
|||
color: white; |
|||
border-radius: 8rpx; |
|||
|
|||
&::after { |
|||
border: 1px solid #409eff; |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,256 @@ |
|||
<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'/> --> |
|||
<view class="list"> |
|||
<view class="item" v-for="(item,index) in list" :key="index" > |
|||
<view class="" @click="itemClick(item,index)"> |
|||
<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="dec"> |
|||
报修单号:<span>{{item.number}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
所属厂区:<span>{{item.factoryAreaName}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
班次:<span>{{item.classesName}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
故障类型:<span>{{item.faultTypeName}}</span> |
|||
</view> |
|||
</view> |
|||
<view class="bottom"> |
|||
<view class="time" style="flex: 1;"> |
|||
{{`${$time.formatDate(item.createTime)}`}} |
|||
</view> |
|||
<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 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 workOrderList from '@/components/workOrderList/index.vue' |
|||
import * as repairOrderApi from "@/api/repairOrder.js" |
|||
export default { |
|||
components: { |
|||
workOrderList |
|||
}, |
|||
data() { |
|||
return { |
|||
params: { |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
type: '' |
|||
}, |
|||
status: 'loadmore', //是否显示没有更多了 |
|||
list: [], |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
// 筛选 |
|||
screen() { |
|||
this.$tab.navigateTo(`/pages/repairOrder/screen?type=${this.params.type}`) |
|||
}, |
|||
itemClick(item, index) { |
|||
this.$tab.navigateTo(`/pages/repairOrder/detail?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`) |
|||
}, |
|||
addForm(item) { |
|||
this.$tab.navigateTo(`/pages/repairOrder/addForm?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`) |
|||
}, |
|||
// 获取设备保修列表 |
|||
getList() { |
|||
if (this.status == 'nomore') return; |
|||
this.status = 'loading'; |
|||
this.$modal.loading('加载中') |
|||
repairOrderApi.repairOrderPage(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('加载中') |
|||
deviceApi.rejected(item.id).then((res) => { |
|||
this.$modal.closeLoading() |
|||
this.params.pageNo = 1 |
|||
this.list = [] |
|||
this.status = 'loadmore' |
|||
this.getList() |
|||
}) |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
if (option.type) this.params.type = option.type; |
|||
}, |
|||
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() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.list { |
|||
background: #f5f5f5; |
|||
margin-top: 20rpx; |
|||
|
|||
.item { |
|||
padding: 30rpx 30rpx 0px 30rpx; |
|||
margin-top: 20rpx; |
|||
background: white; |
|||
|
|||
.title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding-bottom: 20rpx; |
|||
|
|||
.title-txt { |
|||
color: #409eff; |
|||
font-weight: bold; |
|||
font-size: 36rpx; |
|||
width: 0px; |
|||
flex: 1; |
|||
} |
|||
|
|||
.time { |
|||
color: #919191; |
|||
|
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
padding-bottom: 20rpx; |
|||
|
|||
span { |
|||
color: #999999; |
|||
} |
|||
} |
|||
|
|||
.last { |
|||
padding-bottom: 30rpx; |
|||
} |
|||
|
|||
.bottom { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
border-top: 1px solid #E4E4E4; |
|||
padding: 20rpx 0px; |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
.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; |
|||
|
|||
|
|||
.button { |
|||
position: absolute; |
|||
right: 0rpx; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,230 @@ |
|||
<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 workOrderList from '@/components/workOrderList/index.vue' |
|||
import * as deviceApi from "@/api/device.js" |
|||
export default { |
|||
components: { |
|||
workOrderList |
|||
}, |
|||
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}`) |
|||
}, |
|||
itemClick(item, index) { |
|||
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`) |
|||
}, |
|||
addForm() { |
|||
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) |
|||
}, |
|||
// 获取设备保修列表 |
|||
getList() { |
|||
if (this.status == 'nomore') return; |
|||
this.status = 'loading'; |
|||
deviceApi.deviceRepairPage(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> |
@ -0,0 +1,261 @@ |
|||
<template> |
|||
<!-- 添加维修工单 --> |
|||
<view class="add-form-container"> |
|||
<u-form :model="form" ref="form1" label-width="160rpx"> |
|||
<u-form-item label="故障描述" prop="describes"> |
|||
<u-input v-model="form.describes" placeholder="请输入故障描述" /> |
|||
</u-form-item> |
|||
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceName"> |
|||
<view class="select" @click="openSingleColumn('deviceName',form.deviceName,deviceList)"> |
|||
<view class="input" v-if='form.deviceName'> |
|||
{{selectFormat(form.deviceName,deviceList)}} |
|||
</view> |
|||
<view class="placeholder" v-else> |
|||
{{`请输入${type=='DEVICE'?'设备' : '模具'}名称`}} |
|||
</view> |
|||
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|||
</view> |
|||
</u-form-item> |
|||
<u-form-item label="所属厂区" prop="factoryAreaName"> |
|||
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> |
|||
</u-form-item> |
|||
<u-form-item label="班次" prop="classes"> |
|||
<view class="select" @click="openSingleColumn('classes',form.classes,maintenanceShift)"> |
|||
<view class="input" v-if='form.classes'> |
|||
{{selectFormat(form.classes,maintenanceShift)}} |
|||
</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="classes" > |
|||
<view class="select" @click="openSingleColumn('faultType',form.faultType,faultType)"> |
|||
<view class="input" v-if='form.faultType'> |
|||
{{selectFormat(form.faultType,faultType)}} |
|||
</view> |
|||
<view class="placeholder" v-else> |
|||
{{`请选择故障类型`}} |
|||
</view> |
|||
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|||
</view> |
|||
</u-form-item> |
|||
</u-form> |
|||
<view class="footer"> |
|||
<view class="btns"> |
|||
<button class="reset" @click="reset">重置</button> |
|||
<button class="sure" @click="submit" :loading='loading' :disabled='loading'>确定</button> |
|||
</view> |
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' :list="singleColumnList" @confirm="chooseSingleColumn"></u-select> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import * as deviceApi from "@/api/device.js" |
|||
import * as dictApi from "@/api/dict.js" |
|||
import * as repairOrderApi from "@/api/repairOrder.js" |
|||
|
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
loading:false, |
|||
type:"", |
|||
form: { |
|||
describes: "", |
|||
deviceNumber: '', |
|||
deviceName: '', |
|||
factoryAreaName: '', |
|||
factoryAreaNumber: '', |
|||
classes:'', |
|||
faultType:'' |
|||
}, |
|||
deviceList:[],//设备列表 |
|||
singleColumnShow:false, |
|||
singleColumnDefaultValue:[], |
|||
singleColumnList:[], |
|||
field:'', |
|||
maintenanceShift:[],//班次字典项 |
|||
faultType:[],//故障类型字典项 |
|||
} |
|||
}, |
|||
methods: { |
|||
// 触发提交表单 |
|||
submit() { |
|||
const data = { |
|||
describes: this.form.describes, |
|||
deviceNumber: this.form.deviceNumber, |
|||
factoryAreaNumber: this.form.factoryAreaNumber, |
|||
classes:this.form.classes, |
|||
faultType:this.form.faultType, |
|||
type: this.type |
|||
} |
|||
uni.$emit('screen',data) |
|||
this.$tab.navigateBack() |
|||
|
|||
}, |
|||
// 重置 |
|||
reset() { |
|||
console.log('表单数据信息1:', this.data); |
|||
this.form = {} |
|||
}, |
|||
// |
|||
selectFormat(val,array){ |
|||
let str = array.filter(item=>item.value == val)[0].label |
|||
return str |
|||
}, |
|||
// 单列模式 |
|||
openSingleColumn(field,val,list){ |
|||
this.singleColumnList = list |
|||
this.field = field |
|||
if(val){ |
|||
this.singleColumnDefaultValue = [list.findIndex(item=>item.value==val)] |
|||
}else{ |
|||
this.singleColumnDefaultValue = [] |
|||
} |
|||
this.singleColumnShow = true |
|||
}, |
|||
// 单列模式点击确定之后 |
|||
chooseSingleColumn(e){ |
|||
console.log( e[0]) |
|||
this.form[this.field] = e[0].value |
|||
if(this.field == 'deviceName'){ |
|||
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() |
|||
}, |
|||
// 获取设备列表 |
|||
getDeviceList(){ |
|||
deviceApi.deviceList({ |
|||
type:this.type, |
|||
id:'' |
|||
}).then(res=>{ |
|||
res.data.map(item=>{ |
|||
item.value = item.number |
|||
item.label = item.name |
|||
}) |
|||
this.deviceList = res.data |
|||
}) |
|||
}, |
|||
}, |
|||
async onLoad(option) { |
|||
if (option.type) this.type = option.type; |
|||
this.getDeviceList() |
|||
this.maintenanceShift = await dictApi.getDict('maintenance_shift') |
|||
this.faultType = await dictApi.getDict('fault_type') |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.add-form-container { |
|||
min-height: calc(100vh - 140rpx); |
|||
background: white; |
|||
padding: 0px 30rpx 140rpx; |
|||
} |
|||
|
|||
.list { |
|||
padding-bottom: 20rpx; |
|||
|
|||
.item { |
|||
margin-top: 20rpx; |
|||
background: white; |
|||
padding: 30rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
image { |
|||
width: 160rpx; |
|||
height: 160rpx; |
|||
margin-right: 20rpx; |
|||
} |
|||
|
|||
.title { |
|||
font-size: 32rpx; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.dec1 { |
|||
font-size: 28rpx; |
|||
margin-top: 16rpx; |
|||
color: #acacac; |
|||
} |
|||
|
|||
.dec2 { |
|||
font-size: 28rpx; |
|||
margin-top: 6rpx; |
|||
color: #acacac; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.footer { |
|||
position: fixed; |
|||
bottom: 0px; |
|||
left: 0px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.btns { |
|||
display: flex; |
|||
|
|||
|
|||
button { |
|||
flex: 1; |
|||
} |
|||
|
|||
.sure { |
|||
background: #409eff; |
|||
color: white; |
|||
border-radius: 0px; |
|||
|
|||
&::after { |
|||
border: 1px solid #409eff; |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
|
|||
.reset { |
|||
background: #F5F5F5; |
|||
border-radius: 0px; |
|||
|
|||
&::after { |
|||
border-radius: 0px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.right-button { |
|||
background: #409eff; |
|||
color: white; |
|||
padding: 0rpx 30rpx; |
|||
border-radius: 16rpx; |
|||
text-align: center; |
|||
font-size: 28rpx; |
|||
} |
|||
.select{ |
|||
display: flex; |
|||
align-items: center; |
|||
height: 72rpx; |
|||
width: 100%; |
|||
.input{ |
|||
flex: 1; |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
} |
|||
.placeholder{ |
|||
flex: 1; |
|||
font-size: 28rpx; |
|||
color: rgb(192, 196, 204); |
|||
|
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,19 @@ |
|||
export default { |
|||
formatDate(timestamp){ |
|||
// 获取当前时间戳(单位:毫秒)
|
|||
// var timestamp = Date.now(); // 或者传入特定的时间戳值
|
|||
|
|||
// 创建Date对象并设置时间戳
|
|||
var dateObj = new Date(timestamp); |
|||
|
|||
// 提取年份、月份、日期等信息
|
|||
var year = dateObj.getFullYear(); |
|||
var month = (dateObj.getMonth() + 1).toString().padStart(2, '0'); // 注意月份从0开始计数,所以需要加1
|
|||
var day = dateObj.getDate().toString().padStart(2, '0'); |
|||
var hour = dateObj.getHours().toString().padStart(2, '0'); |
|||
var minutes = dateObj.getMinutes().toString().padStart(2, '0'); |
|||
var seconds = dateObj.getSeconds().toString().padStart(2, '0'); |
|||
|
|||
return `${year}-${month}-${day} ${hour}:${minutes}:${seconds}` |
|||
} |
|||
} |
Loading…
Reference in new issue