add report
parent
932230be5a
commit
2e81832f31
@ -1,34 +1,61 @@
|
||||
import upload from '@/utils/upload'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询分页
|
||||
export function getPage() {
|
||||
export function getMyList() {
|
||||
return request({
|
||||
url: '/admin-api/mes/plan/page',
|
||||
url: '/admin-api/mes/produce-report/getMyList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询分页
|
||||
export function getOtherList() {
|
||||
return request({
|
||||
url: '/admin-api/mes/produce-report/getOtherList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询详情
|
||||
export function getById(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/plan/get?id='+id,
|
||||
url: '/admin-api/mes/produce-report/get?id='+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 创建
|
||||
export function create(data) {
|
||||
return request({
|
||||
url: '/admin-api/mes/plan/create',
|
||||
url: '/admin-api/mes/produce-report/create',
|
||||
method: 'post',
|
||||
params: data
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function update(data) {
|
||||
return request({
|
||||
url: '/admin-api/mes/plan/update',
|
||||
url: '/admin-api/mes/produce-report/update',
|
||||
method: 'put',
|
||||
params: data
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 提交\审核报工单
|
||||
export function updateStatus(id,status) {
|
||||
return request({
|
||||
url: '/admin-api/mes/produce-report/updateStatus?id='+id+'&status='+status,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export function getDetailByReportId(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/produce-report/produce-report-detail/list-by-report-id?reportId='+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询详情
|
||||
export function deleteByReportId(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/produce-report/delete?id='+id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="item" v-for="(res, index) in siteList" :key="res.id">
|
||||
<view class="top">
|
||||
<view class="name">{{ res.name }}</view>
|
||||
<view class="phone">{{ res.phone }}</view>
|
||||
<view class="tag">
|
||||
<text v-for="(item, index) in res.tag" :key="index" :class="{red:item.tagText=='默认'}">{{ item.tagText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
广东省深圳市宝安区 自由路66号
|
||||
<u-icon name="edit-pen" :size="40" color="#999999"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addSite" @tap="toAddSite">
|
||||
<view class="add">
|
||||
<u-icon name="plus" color="#ffffff" class="icon" :size="30"></u-icon>新建收货地址
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
siteList: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.siteList = [
|
||||
{
|
||||
id: 1,
|
||||
name: '游X',
|
||||
phone: '183****5523',
|
||||
tag: [
|
||||
{
|
||||
tagText: '默认'
|
||||
},
|
||||
{
|
||||
tagText: '家'
|
||||
}
|
||||
],
|
||||
site: '广东省深圳市宝安区 自由路66号'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '李XX',
|
||||
phone: '183****5555',
|
||||
tag: [
|
||||
{
|
||||
tagText: '公司'
|
||||
}
|
||||
],
|
||||
site: '广东省深圳市宝安区 翻身路xx号'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '王YY',
|
||||
phone: '153****5555',
|
||||
tag: [],
|
||||
site: '广东省深圳市宝安区 平安路13号'
|
||||
}
|
||||
];
|
||||
},
|
||||
toAddSite(){
|
||||
uni.navigateTo({
|
||||
url: '/pages_template/pages/address/addSite'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.item {
|
||||
padding: 40rpx 20rpx;
|
||||
.top {
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
font-size: 34rpx;
|
||||
.phone {
|
||||
margin-left: 60rpx;
|
||||
}
|
||||
.tag {
|
||||
display: flex;
|
||||
font-weight: normal;
|
||||
align-items: center;
|
||||
text {
|
||||
display: block;
|
||||
width: 60rpx;
|
||||
height: 34rpx;
|
||||
line-height: 34rpx;
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
border-radius: 6rpx;
|
||||
text-align: center;
|
||||
margin-left: 30rpx;
|
||||
background-color:rgb(49, 145, 253);
|
||||
}
|
||||
.red{
|
||||
background-color:red
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
justify-content: space-between;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.addSite {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 600rpx;
|
||||
line-height: 100rpx;
|
||||
position: absolute;
|
||||
bottom: 30rpx;
|
||||
left: 80rpx;
|
||||
background-color: red;
|
||||
border-radius: 60rpx;
|
||||
font-size: 30rpx;
|
||||
.add{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #ffffff;
|
||||
.icon{
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-list :border="true">
|
||||
<uni-list-item v-for="(item, index) in reportList">
|
||||
<!-- 自定义 header -->
|
||||
<template v-slot:header>
|
||||
<div onclick="">
|
||||
<text class="u-success"> {{timestampToTime(item.reportDate)}}</text>
|
||||
<text class="u-primary">/</text>
|
||||
{{item.userName}}
|
||||
<text class="u-primary">/</text>
|
||||
{{item.orgName}}
|
||||
</div>
|
||||
</template>
|
||||
<!-- 自定义 body -->
|
||||
<template v-slot:body>
|
||||
</template>
|
||||
<!-- 自定义 footer-->
|
||||
<template v-slot:footer>
|
||||
<el-button v-if="item.reportStatus === 0" type="primary" size="small" :icon="Edit" circle @click="editOrAddReport(item.id)"/>
|
||||
<el-button v-if="item.reportStatus === 0" type="success" size="small" :icon="Check" circle @click="updateReport(item.id)"/>
|
||||
<el-button v-if="item.reportStatus < 2" type="danger" size="small" :icon="Delete" circle @click="deleteReport(item.id)"/>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
|
||||
<uni-fab ref="fab" @fabClick="editOrAddReport" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getMyList, getOtherList, getById, updateStatus,deleteByReportId } from "@/api/mes/report";
|
||||
import {Check, Delete, Edit, Message, Search, Star} from '@element-plus/icons-vue'
|
||||
import tab from "@/plugins/tab";
|
||||
import modal from "@/plugins/modal";
|
||||
import auth from "@/plugins/auth";
|
||||
import {showConfirm} from "@/utils/common";
|
||||
import {timestampToTime} from "@/utils/dateUtil";
|
||||
export default {
|
||||
computed: {
|
||||
Delete() {
|
||||
return Delete
|
||||
},
|
||||
Edit() {
|
||||
return Edit
|
||||
},
|
||||
Check() {
|
||||
return Check
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reportList: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
timestampToTime,
|
||||
getList() {
|
||||
getMyList().then(response => {
|
||||
this.reportList = response.data
|
||||
})
|
||||
},
|
||||
deleteReport(id) {
|
||||
showConfirm("确认删除该报工信息吗?").then(res => {
|
||||
if (res.confirm) {
|
||||
deleteByReportId(id).then(response => {
|
||||
modal.msgSuccess("操作成功")
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
updateReport(id) {
|
||||
showConfirm("确认提交该报工信息吗?").then(res => {
|
||||
if (res.confirm) {
|
||||
updateStatus(id,1).then(response => {
|
||||
modal.msgSuccess("操作成功")
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
editOrAddReport(id){
|
||||
if(id===null || id===undefined){
|
||||
uni.navigateTo({
|
||||
url: '/pages_template/pages/address/addSite'
|
||||
});
|
||||
}
|
||||
else{
|
||||
tab.navigateTo("",id)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.addSite {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 600rpx;
|
||||
line-height: 100rpx;
|
||||
position: absolute;
|
||||
bottom: 30rpx;
|
||||
left: 80rpx;
|
||||
background-color: red;
|
||||
border-radius: 60rpx;
|
||||
font-size: 30rpx;
|
||||
.add{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #ffffff;
|
||||
.icon{
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue