This commit is contained in:
parent
5b4a67805f
commit
5ae5058bf6
|
|
@ -223,7 +223,7 @@
|
|||
padding: 3px 0;
|
||||
box-shadow: 0 0 20rpx 5rpx rgb(0 0 0 / 30%);
|
||||
border-radius: 5px;
|
||||
max-height: 181px;
|
||||
max-height: 281px;
|
||||
}
|
||||
|
||||
/* 下拉项通用样式 */
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ function jumpUrl(path) {
|
|||
if (path == 'toolsOut') {
|
||||
const params = {
|
||||
isOut: true,
|
||||
isNew: 0,
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/toolsLease/toolsLease?params=' + JSON.stringify(params),
|
||||
|
|
@ -247,8 +248,8 @@ onNavigationBarButtonTap((e) => {
|
|||
padding-top: 8vh;
|
||||
display: flex;
|
||||
.user-lef {
|
||||
width: 15%;
|
||||
height: 6vh;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
image {
|
||||
|
|
@ -268,10 +269,10 @@ onNavigationBarButtonTap((e) => {
|
|||
color: #fff;
|
||||
}
|
||||
view:first-child {
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
}
|
||||
view:last-child {
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
letter-spacing: 6rpx;
|
||||
}
|
||||
}
|
||||
|
|
@ -321,8 +322,8 @@ onNavigationBarButtonTap((e) => {
|
|||
align-items: center;
|
||||
margin-bottom: 2vh;
|
||||
image {
|
||||
width: 58%;
|
||||
height: 6vh;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
span {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,16 @@
|
|||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
><template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<div class="content">
|
||||
<uni-section title="任务信息" type="line"></uni-section>
|
||||
<uni-forms ref="form" :rules="rules" :model="formData" label-width="80px">
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
<template>
|
||||
<uni-nav-bar
|
||||
dark
|
||||
:fixed="true"
|
||||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
title="退料任务"
|
||||
right-text="新增"
|
||||
@clickLeft="back"
|
||||
@clickRight="add"
|
||||
/>
|
||||
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="退料任务">
|
||||
<template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-slot:right>
|
||||
<view style="font-size: 18px">
|
||||
<text @click="add">新增</text>
|
||||
</view>
|
||||
</template></uni-nav-bar
|
||||
>
|
||||
<div class="content">
|
||||
<div class="query">
|
||||
<uni-datetime-picker
|
||||
|
|
@ -51,23 +53,38 @@
|
|||
:key="index"
|
||||
@click="(e) => onClickSwipe(e, item)"
|
||||
>
|
||||
<div class="list" @click="handleItem(item)">
|
||||
<div class="list" @click="handleItem(item)">
|
||||
<div style="margin-right: 8px">{{ index + 1 }}.</div>
|
||||
<div class="item">
|
||||
<div>申请时间: {{ item.createTime }}</div>
|
||||
<div>退料单号: {{ item.code }}</div>
|
||||
<div>退料物资: {{ item.typeName }}</div>
|
||||
<div>退料班组: {{ item.teamName }}</div>
|
||||
<div>工程名称: {{ item.proName }}</div>
|
||||
<div>退料人: {{ item.backPerson }}</div>
|
||||
<div>联系电话: {{ item.phone }}</div>
|
||||
<div>已退数量: {{item.backNum}}</div>
|
||||
<div>备注: {{ item.remark }}</div>
|
||||
<div>工程名称: {{ item.proName }}</div>
|
||||
<div>退料人: {{ item.backPerson }}</div>
|
||||
<div>联系电话: {{ item.phone }}</div>
|
||||
<div>已退数量: {{ item.backNum }}</div>
|
||||
<div>备注: {{ item.remark }}</div>
|
||||
<div>
|
||||
状态:
|
||||
<uni-tag v-if="item.taskStatus == 0" text="未完成" type="warning" custom-style="warningStyle"/>
|
||||
<uni-tag v-if="item.taskStatus == 1" text="已驳回" type="warning" custom-style="warningStyle"/>
|
||||
<uni-tag v-if="item.taskStatus == 2" text="已完成" type="success" custom-style="successStyle"/>
|
||||
<uni-tag
|
||||
v-if="item.taskStatus == 0"
|
||||
text="未完成"
|
||||
type="warning"
|
||||
custom-style="warningStyle"
|
||||
/>
|
||||
<uni-tag
|
||||
v-if="item.taskStatus == 1"
|
||||
text="已驳回"
|
||||
type="warning"
|
||||
custom-style="warningStyle"
|
||||
/>
|
||||
<uni-tag
|
||||
v-if="item.taskStatus == 2"
|
||||
text="已完成"
|
||||
type="success"
|
||||
custom-style="successStyle"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -91,7 +108,7 @@ const queryParams = reactive({
|
|||
pageSize: 10,
|
||||
range: [],
|
||||
keyWord: '',
|
||||
appTaskStatus: 0,
|
||||
appTaskStatus: 0,
|
||||
})
|
||||
const items = ref(['未完成', '已完成'])
|
||||
const current = ref(0)
|
||||
|
|
@ -120,7 +137,7 @@ const back = () => {
|
|||
})
|
||||
}
|
||||
const add = () => {
|
||||
uni.navigateTo({ url: `/pages/toolsBack/toolsAddBack` })
|
||||
uni.navigateTo({ url: `/pages/toolsBack/toolsAddBack` })
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
|
|
@ -135,7 +152,7 @@ const getList = async () => {
|
|||
startTime: queryParams.range && queryParams.range[0],
|
||||
endTime: queryParams.range && queryParams.range[1],
|
||||
keyWord: queryParams.keyWord,
|
||||
appTaskStatus: queryParams.appTaskStatus,
|
||||
appTaskStatus: queryParams.appTaskStatus,
|
||||
}
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
try {
|
||||
|
|
@ -162,8 +179,10 @@ const onClickItem = (item) => {
|
|||
|
||||
//点击详情
|
||||
const handleItem = (item) => {
|
||||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
uni.navigateTo({ url: `/pages/toolsBack/toolsDetail?id=${item.id}&taskId=${item.taskId}&status=${item.status}` })
|
||||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
uni.navigateTo({
|
||||
url: `/pages/toolsBack/toolsDetail?id=${item.id}&taskId=${item.taskId}&status=${item.status}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 滚动事件
|
||||
|
|
@ -177,41 +196,41 @@ const onScrollTolower = () => {
|
|||
|
||||
// 滑动
|
||||
const onClickSwipe = async (e, item) => {
|
||||
console.log('🚀 ~ onClickSwipe ~ e:', e, item)
|
||||
try {
|
||||
console.log('🚀 ~ onClickSwipe ~ e:', e, item)
|
||||
try {
|
||||
if (e.index == 0) {
|
||||
// 提交
|
||||
const params = JSON.stringify({
|
||||
id: item.id,
|
||||
taskId: item.taskId
|
||||
})
|
||||
const res = await backSubmit(params)
|
||||
console.log('🚀 ~ 提交结果 ~ res:', res)
|
||||
// 提交
|
||||
const params = JSON.stringify({
|
||||
id: item.id,
|
||||
taskId: item.taskId,
|
||||
})
|
||||
const res = await backSubmit(params)
|
||||
console.log('🚀 ~ 提交结果 ~ res:', res)
|
||||
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: res.msg || '操作成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 确保刷新列表
|
||||
await getList()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '操作失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: res.msg || '操作成功',
|
||||
icon: 'success',
|
||||
})
|
||||
// 确保刷新列表
|
||||
await getList()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || '操作失败',
|
||||
icon: 'error',
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 删除
|
||||
await deleteItem(item)
|
||||
// 删除
|
||||
await deleteItem(item)
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
console.error('操作失败:', error)
|
||||
uni.showToast({
|
||||
title: error.message || '操作失败',
|
||||
icon: 'error'
|
||||
title: error.message || '操作失败',
|
||||
icon: 'error',
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
|
@ -222,10 +241,10 @@ const deleteItem = (item) => {
|
|||
content: '确定删除吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
const params = JSON.stringify({
|
||||
id: item.id
|
||||
})
|
||||
deleteBackApi(params)
|
||||
const params = JSON.stringify({
|
||||
id: item.id,
|
||||
})
|
||||
deleteBackApi(params)
|
||||
.then((res) => {
|
||||
console.log('🚀 ~ .then ~ res:', res)
|
||||
if (res.code == 200) {
|
||||
|
|
@ -245,8 +264,8 @@ onLoad((options) => {
|
|||
getList()
|
||||
})
|
||||
|
||||
onShow(()=>{
|
||||
getList()
|
||||
onShow(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,17 @@
|
|||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
>
|
||||
<template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="accept page-common">
|
||||
<div class="card">
|
||||
<div>任务信息</div>
|
||||
|
|
|
|||
|
|
@ -5,11 +5,15 @@
|
|||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
><template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template></uni-nav-bar>
|
||||
<view class="accept page-common">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="12">
|
||||
|
|
|
|||
|
|
@ -5,11 +5,17 @@
|
|||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
>
|
||||
<template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="accept page-common">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
|
|
|||
|
|
@ -5,11 +5,17 @@
|
|||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
>
|
||||
<template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="accept page-common">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
|
|
|||
|
|
@ -5,11 +5,17 @@
|
|||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
>
|
||||
<template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<!-- 新购验收详情 -->
|
||||
<view class="accept page-common">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
<template>
|
||||
<!-- 编码出库-->
|
||||
<uni-nav-bar
|
||||
dark
|
||||
:fixed="true"
|
||||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
title="编码出库"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="编码出库"
|
||||
><template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="page-container">
|
||||
<!-- 表单信息区域 -->
|
||||
<scroll-view scroll-y style="height: 100vh">
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
<template>
|
||||
<uni-nav-bar
|
||||
dark
|
||||
:fixed="true"
|
||||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
title="数量出库"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="数量出库"
|
||||
><template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<div class="content">
|
||||
<div class="card">
|
||||
<div class="item">
|
||||
|
|
@ -29,12 +28,12 @@
|
|||
<span>{{ opts.typeName }}</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
单位:
|
||||
单 位:
|
||||
<span>{{ opts.unitName }}</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
库存数量:
|
||||
<span>{{ opts.projectName }}</span>
|
||||
<span>{{ opts.storageNum }}</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
已领数量:
|
||||
|
|
@ -89,6 +88,15 @@ const handleOutNum = () => {
|
|||
// 重置为1
|
||||
outNum.value = 1
|
||||
}
|
||||
// 不能大于库存数量
|
||||
if (outNum.value > opts.value.storageNum) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '出库数量不能大于库存数量',
|
||||
})
|
||||
// 重置为库存数量
|
||||
outNum.value = opts.value.storageNum
|
||||
}
|
||||
}
|
||||
|
||||
const submit = () => {
|
||||
|
|
@ -124,6 +132,7 @@ onLoad((opt) => {
|
|||
console.log('🚀 ~ onLoad ~ 出库:', opt)
|
||||
opts.value = opt.params ? JSON.parse(opt.params) : {}
|
||||
outNum.value = opts.value.outNum
|
||||
console.log('🚀 ~ onLoad ~ opts.value:', opts.value)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
<template>
|
||||
<uni-nav-bar
|
||||
dark
|
||||
:fixed="true"
|
||||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
right-text="新增"
|
||||
@clickLeft="back"
|
||||
@clickRight="add"
|
||||
/>
|
||||
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar :title="title">
|
||||
<template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-slot:right>
|
||||
<view style="font-size: 18px">
|
||||
<text @click="add">新增</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<div class="content">
|
||||
<div class="query">
|
||||
<uni-datetime-picker
|
||||
|
|
@ -45,8 +47,8 @@
|
|||
<scroll-view scroll-y @scrolltolower="onScrollTolower">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item
|
||||
:right-options="current == 0 ? options : optionsFinish"
|
||||
v-for="(item, index) in tableList"
|
||||
:right-options="item.options"
|
||||
:key="index"
|
||||
@click="(e) => onClickSwipe(e, item)"
|
||||
>
|
||||
|
|
@ -67,10 +69,11 @@
|
|||
<uni-tag
|
||||
:text="item.taskStatusName"
|
||||
:inverted="true"
|
||||
:type="item.taskStatus == 1 ? 'error' : 'success'"
|
||||
:type="item.taskStatus == 4 ? 'success' : 'error'"
|
||||
/>
|
||||
</div>
|
||||
<div>是否签名:
|
||||
<div>
|
||||
是否签名:
|
||||
<uni-tag
|
||||
:text="item.isElectronicSign == 1 ? '未签名' : '已签名'"
|
||||
:inverted="true"
|
||||
|
|
@ -92,7 +95,11 @@
|
|||
<script setup>
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { getPickingOutboundListAPI, deleteLeaseApplyApi,submitLeaseOut } from '@/services/picking/outbound.js'
|
||||
import {
|
||||
getPickingOutboundListAPI,
|
||||
deleteLeaseApplyApi,
|
||||
submitLeaseOut,
|
||||
} from '@/services/picking/outbound.js'
|
||||
|
||||
const title = ref('工器具领料')
|
||||
const opts = ref()
|
||||
|
|
@ -107,40 +114,6 @@ const items = ref(['未完成', '已完成'])
|
|||
const current = ref(0)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
const options = ref([
|
||||
{
|
||||
text: '电子签名',
|
||||
style: {
|
||||
backgroundColor: '#c6bf3b',
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '提交',
|
||||
style: {
|
||||
backgroundColor: '#2c954f',
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '编辑',
|
||||
style: {
|
||||
backgroundColor: '#2f8cf0',
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff4949',
|
||||
},
|
||||
},
|
||||
])
|
||||
const optionsFinish = ref([
|
||||
{
|
||||
text: '电子签名',
|
||||
style: {
|
||||
backgroundColor: '#c6bf3b',
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
const finish = computed(() => {
|
||||
if (total.value === tableList.value.length) return true
|
||||
|
|
@ -151,8 +124,12 @@ const back = () => {
|
|||
})
|
||||
}
|
||||
const add = () => {
|
||||
const params = JSON.stringify({
|
||||
isOut: opts.value.isOut,
|
||||
isNew: opts.value.isNew,
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/toolsLease/toolsLeaseAdd',
|
||||
url: '/pages/toolsLease/toolsLeaseAdd?params=' + params,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -168,14 +145,37 @@ const getList = async () => {
|
|||
startTime: queryParams.range && queryParams.range[0],
|
||||
endTime: queryParams.range && queryParams.range[1],
|
||||
keyWord: queryParams.keyWord,
|
||||
taskStatus: queryParams.taskStatus,
|
||||
// taskStatus: queryParams.taskStatus,
|
||||
statusList: queryParams.taskStatus == 1 ? [1, 5] : [4],
|
||||
}
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
try {
|
||||
const res = await getPickingOutboundListAPI(params)
|
||||
console.log('🚀 ~ getList ~ res:', res)
|
||||
if (res.code == 200) {
|
||||
tableList.value = res.data.rows
|
||||
tableList.value = res.data.rows.map((item) => {
|
||||
let options = [
|
||||
{ text: '电子签名', style: { backgroundColor: '#c6bf3b' } },
|
||||
{ text: '提交', style: { backgroundColor: '#2c954f' } },
|
||||
{ text: '编辑', style: { backgroundColor: '#2f8cf0' } },
|
||||
{ text: '删除', style: { backgroundColor: '#ff4949' } },
|
||||
]
|
||||
if (!opts.value.isOut) {
|
||||
options = options.filter((option) => option.text !== '提交')
|
||||
}
|
||||
if (item.taskStatus != 1) {
|
||||
options = options.filter((option) => option.text !== '编辑' && option.text !== '删除')
|
||||
|
||||
} else if (item.taskStatus == 4) {
|
||||
// 已完成状态
|
||||
options = [{ text: '电子签名', style: { backgroundColor: '#c6bf3b' } }]
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
options,
|
||||
}
|
||||
})
|
||||
|
||||
console.log('🚀 ~ getList ~ tableList.value:', tableList.value)
|
||||
total.value = res.data.total
|
||||
}
|
||||
|
|
@ -210,105 +210,105 @@ const onClickSwipe = async (e, item) => {
|
|||
console.log('电子签名-e', e)
|
||||
console.log('电子签名-item', item)
|
||||
const params = {
|
||||
id: item.id,
|
||||
leaseSignUrl: item.leaseSignUrl,
|
||||
// leaseSignType: item.leaseSignType,
|
||||
isLease: true,
|
||||
id: item.id,
|
||||
leaseSignUrl: item.leaseSignUrl,
|
||||
// leaseSignType: item.leaseSignType,
|
||||
isLease: true,
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
|
||||
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
|
||||
})
|
||||
}else if(e.index == 1) {
|
||||
} else if (e.index == 1) {
|
||||
// 提交
|
||||
try {
|
||||
let paramsOne = {
|
||||
id: item.id,
|
||||
isSubmit: 0,
|
||||
}
|
||||
const submitRes = await submitLeaseOut(paramsOne)
|
||||
console.log('🚀 ~ 提交成功 ~ submitRes:', submitRes)
|
||||
if (submitRes.code === 200 && submitRes.msg === "该领料单无未出库领料数据,请确认是否提交") {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "是否确认提交?",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
id: item.id,
|
||||
}
|
||||
try {
|
||||
const submitRes = await submitLeaseOut(params)
|
||||
if (submitRes.code === 200) {
|
||||
uni.showToast({
|
||||
title: '提交成功', // 设置提示信息
|
||||
icon: 'success'
|
||||
})
|
||||
getList() // 取消注释,提交成功后刷新列表
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 提交失败 ~ error:', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户取消提交')
|
||||
}
|
||||
try {
|
||||
let paramsOne = {
|
||||
id: item.id,
|
||||
isSubmit: 0,
|
||||
}
|
||||
const submitRes = await submitLeaseOut(paramsOne)
|
||||
console.log('🚀 ~ 提交成功 ~ submitRes:', submitRes)
|
||||
if (submitRes.code === 200 && submitRes.msg === '该领料单无未出库领料数据,请确认是否提交') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认提交?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
id: item.id,
|
||||
}
|
||||
})
|
||||
} else if (submitRes.code === 200 && submitRes.msg === "该领料单有未出库领料数据,请确认是否提交") {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "该领料单有未出库领料数据,是否确认提交?",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
id: item.id,
|
||||
}
|
||||
try {
|
||||
const submitRes = await submitLeaseOut(params)
|
||||
if (submitRes.code === 200) {
|
||||
uni.showToast({
|
||||
title: '提交成功', // 设置提示信息
|
||||
icon: 'success'
|
||||
})
|
||||
getList() // 取消注释,提交成功后刷新列表
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 提交失败 ~ error:', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户取消提交')
|
||||
try {
|
||||
const submitRes = await submitLeaseOut(params)
|
||||
if (submitRes.code === 200) {
|
||||
uni.showToast({
|
||||
title: '提交成功', // 设置提示信息
|
||||
icon: 'success',
|
||||
})
|
||||
getList() // 取消注释,提交成功后刷新列表
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 提交失败 ~ error:', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户取消提交')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 提交失败 ~ error:', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else if(e.index == 2){
|
||||
},
|
||||
})
|
||||
} else if (
|
||||
submitRes.code === 200 &&
|
||||
submitRes.msg === '该领料单有未出库领料数据,请确认是否提交'
|
||||
) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该领料单有未出库领料数据,是否确认提交?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
id: item.id,
|
||||
}
|
||||
try {
|
||||
const submitRes = await submitLeaseOut(params)
|
||||
if (submitRes.code === 200) {
|
||||
uni.showToast({
|
||||
title: '提交成功', // 设置提示信息
|
||||
icon: 'success',
|
||||
})
|
||||
getList() // 取消注释,提交成功后刷新列表
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 提交失败 ~ error:', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户取消提交')
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 提交失败 ~ error:', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
} else if (e.index == 2) {
|
||||
// 编辑
|
||||
const params = JSON.stringify({
|
||||
id: item.id,
|
||||
|
|
@ -338,11 +338,6 @@ const leaseOut = (item) => {
|
|||
uni.navigateTo({
|
||||
url: `/pages/toolsLease/toolsLeaseOut?params=${params}`,
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已完成出库',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -369,10 +364,15 @@ const deleteItem = (item) => {
|
|||
})
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
console.log('🚀 ~ onLoad ~ options:', options)
|
||||
opts.value = options.params ? JSON.parse(options.params) : {}
|
||||
onLoad((opt) => {
|
||||
console.log('🚀 ~ onLoad ~ opt:', opt)
|
||||
opts.value = opt.params ? JSON.parse(opt.params) : {}
|
||||
title.value = opts.value.isOut ? '工器具出库' : '工器具领料'
|
||||
// isOut 为 false 时,删除提交功能
|
||||
if (!opts.value.isOut) {
|
||||
options.value = options.value.filter((item) => item.text !== '提交')
|
||||
}
|
||||
console.log('🚀 ~ onLoad ~ options.value:', options.value)
|
||||
})
|
||||
onShow(() => {
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
<template>
|
||||
<uni-nav-bar
|
||||
dark
|
||||
:fixed="true"
|
||||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
:title="title"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar :title="title"
|
||||
><template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<div class="content">
|
||||
<uni-section title="任务信息" type="line"></uni-section>
|
||||
<uni-forms ref="form" :rules="rules" :model="formData" label-width="80px">
|
||||
|
|
@ -24,7 +23,7 @@
|
|||
<uni-forms-item label="领用工程" required name="projectId">
|
||||
<eselect
|
||||
v-if="!opts.isEdit"
|
||||
style="width: 100%; height: 90rpx"
|
||||
style="width: 100%; height: 45rpx"
|
||||
v-model="formData.projectId"
|
||||
ref="treeSelect"
|
||||
:options="prodRange"
|
||||
|
|
@ -38,10 +37,15 @@
|
|||
></eselect>
|
||||
<uni-easyinput v-else v-model="formData.projectName" disabled></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="班组长" required name="leasePerson" v-if="opts.isNew != 0">
|
||||
<uni-forms-item
|
||||
v-if="opts.isNew != 0 || opts.isOut"
|
||||
label="班组长"
|
||||
required
|
||||
name="leasePerson"
|
||||
>
|
||||
<uni-easyinput v-model="formData.leasePerson" placeholder="请输入内容"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="联系电话" required name="phone" v-if="opts.isNew != 0">
|
||||
<uni-forms-item label="联系电话" name="phone" v-if="opts.isNew != 0 || opts.isOut">
|
||||
<uni-easyinput
|
||||
v-model="formData.phone"
|
||||
placeholder="请输入内容"
|
||||
|
|
@ -49,7 +53,7 @@
|
|||
@blur="checkPhone"
|
||||
></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-section title="领用工具器" type="line"></uni-section>
|
||||
<uni-section title="领用工具器" type="line" />
|
||||
<eselect
|
||||
v-model="equipmentId"
|
||||
style="width: 100%; height: 90rpx; margin: 10px 0"
|
||||
|
|
@ -61,14 +65,14 @@
|
|||
|
||||
<uni-table ref="table" border stripe emptyText="暂无更多数据">
|
||||
<uni-tr>
|
||||
<uni-th width="60" align="center">序号</uni-th>
|
||||
<uni-th width="180" align="center">类型名称</uni-th>
|
||||
<uni-th width="50" align="center">序号</uni-th>
|
||||
<uni-th width="160" align="center">类型名称</uni-th>
|
||||
<uni-th width="180" align="center">规格型号</uni-th>
|
||||
<uni-th align="center">在库数</uni-th>
|
||||
<uni-th width="204" align="center">{{
|
||||
opts.isNew == 0 ? '出库数' : '领用数'
|
||||
<uni-th width="80" align="center">在库数</uni-th>
|
||||
<uni-th width="100" align="center">{{
|
||||
opts.isNew == 0 || opts.isOut ? '出库数' : '领用数'
|
||||
}}</uni-th>
|
||||
<uni-th width="120" align="center">操作</uni-th>
|
||||
<uni-th width="100" align="center">操作</uni-th>
|
||||
</uni-tr>
|
||||
<uni-tr v-for="(item, index) in tableData" :key="index">
|
||||
<uni-td align="center">{{ index + 1 }}</uni-td>
|
||||
|
|
@ -104,8 +108,8 @@
|
|||
</uni-tr>
|
||||
</uni-table>
|
||||
|
||||
<button style="width: 100%; margin: 50px 0" size="mini" type="primary" @click="submit">
|
||||
{{ opts.isNew == 0 ? '出 库' : '确 定' }}
|
||||
<button style="width: 100%; margin: 50px 0" type="primary" @click="submit">
|
||||
{{ opts.isNew == 0 || opts.isOut ? '出 库' : '确 定' }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -124,6 +128,7 @@ import {
|
|||
leaseOutApi,
|
||||
} from '@/services/back.js'
|
||||
|
||||
const loading = ref(false)
|
||||
const title = ref('工器具领料申请')
|
||||
const opts = ref({})
|
||||
const form = ref()
|
||||
|
|
@ -147,9 +152,9 @@ const rules = ref({
|
|||
leasePerson: {
|
||||
rules: [{ required: true, errorMessage: '请填写领用人' }],
|
||||
},
|
||||
phone: {
|
||||
rules: [{ required: true, errorMessage: '请填写联系电话' }],
|
||||
},
|
||||
// phone: {
|
||||
// rules: [{ required: true, errorMessage: '请填写联系电话' }],
|
||||
// },
|
||||
})
|
||||
const tableData = ref([])
|
||||
|
||||
|
|
@ -300,6 +305,8 @@ const submit = () => {
|
|||
form.value
|
||||
.validate()
|
||||
.then(async (valid) => {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
console.log('🚀 ~ form.value.validate.then ~ valid:', valid)
|
||||
if (tableData.value.length === 0) {
|
||||
await uni.showToast({
|
||||
|
|
@ -310,15 +317,17 @@ const submit = () => {
|
|||
return
|
||||
}
|
||||
// tableData.value 循环 preNum 不能小于 0, 小于0的提示到具体行
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
console.log('🚀 ~ .then ~ tableData.value[i].preNum:', tableData.value[i].preNum)
|
||||
if (tableData.value[i].preNum < 1) {
|
||||
await uni.showToast({
|
||||
title: `第${i + 1}行领用数量不能为0`,
|
||||
icon: 'none',
|
||||
duration: 1000,
|
||||
})
|
||||
return
|
||||
if (opts.value.isOut) {
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
console.log('🚀 ~ .then ~ tableData.value[i].preNum:', tableData.value[i].preNum)
|
||||
if (tableData.value[i].preNum < 1) {
|
||||
await uni.showToast({
|
||||
title: `第${i + 1}行出库数量不能为0`,
|
||||
icon: 'none',
|
||||
duration: 1000,
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -336,15 +345,22 @@ const submit = () => {
|
|||
const res = await editLeaseTask(params)
|
||||
back()
|
||||
} else {
|
||||
let res = {}
|
||||
if (opts.value.isOut) {
|
||||
// 出库
|
||||
res = await addLeaseTask(params)
|
||||
console.log('🚀 ~ .then ~ res:', res)
|
||||
}
|
||||
tableData.value.forEach((item) => {
|
||||
item.isApp = '0'
|
||||
item.isNew = '0'
|
||||
item.parentId = opts.value.parentId
|
||||
item.isNew = opts.value.isOut ? '1' : '0'
|
||||
item.parentId = opts.value.parentId || res.data
|
||||
item.outNum = item.preNum
|
||||
})
|
||||
await leaseOutApi({ leaseOutDetailsList: tableData.value })
|
||||
back()
|
||||
}
|
||||
loading.value = false
|
||||
// 提示
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
|
@ -352,6 +368,7 @@ const submit = () => {
|
|||
})
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ .then ~ error:', error)
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
<template>
|
||||
<uni-nav-bar
|
||||
dark
|
||||
:fixed="true"
|
||||
shadow
|
||||
background-color="#4AA4EA"
|
||||
status-bar
|
||||
left-icon="left"
|
||||
left-text="返回"
|
||||
title="工器具出库"
|
||||
@clickLeft="back"
|
||||
/>
|
||||
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="工器具出库"
|
||||
><template v-slot:left>
|
||||
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
|
||||
<!-- 图标 -->
|
||||
<uni-icons type="left" size="20" color="#fff"></uni-icons>
|
||||
<!-- 文本 -->
|
||||
<text>返回</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<div class="content">
|
||||
<div class="df">
|
||||
<uni-easyinput
|
||||
|
|
@ -126,7 +125,7 @@ const addLeaseCode = () => {
|
|||
projectId: opts.value.projectId,
|
||||
projectName: opts.value.projectName,
|
||||
parentId: tableList.value[0].parentId,
|
||||
isAddCode: true
|
||||
isAddCode: true,
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/toolsLease/codeOut?params=' + JSON.stringify(params),
|
||||
|
|
|
|||
Loading…
Reference in New Issue