This commit is contained in:
parent
2628a1dbb7
commit
db7a85fe52
|
|
@ -206,7 +206,8 @@
|
||||||
{
|
{
|
||||||
"path": "pages/back/detail",
|
"path": "pages/back/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "退料任务详情"
|
// "navigationBarTitleText": "退料任务详情"
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -225,7 +226,8 @@
|
||||||
{
|
{
|
||||||
"path": "pages/back/backCode",
|
"path": "pages/back/backCode",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "退料编码"
|
// "navigationBarTitleText": "退料编码"
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -243,7 +245,8 @@
|
||||||
{
|
{
|
||||||
"path": "pages/back/backNum",
|
"path": "pages/back/backNum",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "退料数量"
|
// "navigationBarTitleText": "退料数量"
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
|
<uni-nav-bar leftIcon="left" right-text="确定" title="退料编码" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="leftClick" @clickRight="submitCode"/>
|
||||||
<view class="accept page-common">
|
<view class="accept page-common">
|
||||||
<div class="card">
|
<div class="card top-content" :class="{'is-expanded': isExpanded}">
|
||||||
<div>任务信息</div>
|
<div class="card-header" @click="isExpanded = !isExpanded">
|
||||||
|
<div class="title">任务信息</div>
|
||||||
|
<uni-icons class="icon" type="down" size="19" :class="{'is-expanded': isExpanded}"></uni-icons>
|
||||||
|
</div>
|
||||||
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
|
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
|
||||||
<uni-forms-item label="退料单位:" name="unitName">
|
<uni-forms-item label="退料单位:" name="unitName">
|
||||||
<span style="height: 100%; display: flex; align-items: center">{{
|
<span style="height: 100%; display: flex; align-items: center">{{
|
||||||
|
|
@ -109,10 +113,9 @@
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn">
|
<!-- <div class="btn">
|
||||||
<!-- <button class="btn-cont" @click="reject">取消</button> -->
|
|
||||||
<button class="btn-cont" @click="submitCode">确认</button>
|
<button class="btn-cont" @click="submitCode">确认</button>
|
||||||
</div>
|
</div> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -136,7 +139,14 @@ const imgList = ref([]) // 图片列表,用于回显
|
||||||
const bmFileInfos = ref([]) // 上传后的图片信息
|
const bmFileInfos = ref([]) // 上传后的图片信息
|
||||||
const scanQrCodeRef = ref(null)
|
const scanQrCodeRef = ref(null)
|
||||||
const codeList = ref([])
|
const codeList = ref([])
|
||||||
|
const isExpanded = ref(false)
|
||||||
|
|
||||||
|
const leftClick = () => {
|
||||||
|
// 返回
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1, // 返回到已存在的页面
|
||||||
|
})
|
||||||
|
}
|
||||||
const changeRadio = (e) => {
|
const changeRadio = (e) => {
|
||||||
console.log(e.detail.value)
|
console.log(e.detail.value)
|
||||||
apDetection.value = e.detail.value
|
apDetection.value = e.detail.value
|
||||||
|
|
@ -565,7 +575,7 @@ onLoad((options) => {
|
||||||
}
|
}
|
||||||
.accept {
|
.accept {
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
height: 95vh;
|
/* height: 95vh; */
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
background-color: #f7f8fa;
|
background-color: #f7f8fa;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -580,7 +590,7 @@ onLoad((options) => {
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
// 卡片标题
|
// 卡片标题
|
||||||
> div:first-child {
|
/* > div:first-child {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #262626;
|
color: #262626;
|
||||||
|
|
@ -599,6 +609,41 @@ onLoad((options) => {
|
||||||
background: #3784fb;
|
background: #3784fb;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
|
} */
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #262626;
|
||||||
|
position: relative;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
width: 6rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
background: #3784fb;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
transition: transform 0.5s ease; /* 添加动画过渡 */
|
||||||
|
transform: rotate(0deg);
|
||||||
|
|
||||||
|
&.is-expanded {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单样式
|
// 表单样式
|
||||||
|
|
@ -751,4 +796,13 @@ onLoad((options) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.top-content {
|
||||||
|
max-height: 30px;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: max-height 0.5s ease-out;
|
||||||
|
|
||||||
|
&.is-expanded {
|
||||||
|
max-height: 2000px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
|
<uni-nav-bar leftIcon="left" right-text="确定" title="退料数量" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="leftClick" @clickRight="submitNum"/>
|
||||||
<view class="accept page-common">
|
<view class="accept page-common">
|
||||||
<div class="card">
|
<div class="card top-content" :class="{'is-expanded': isExpanded}">
|
||||||
<div class="card-header">
|
<div class="card-header" @click="isExpanded = !isExpanded">
|
||||||
<span class="title">任务信息</span>
|
<span class="title">任务信息</span>
|
||||||
|
<uni-icons class="icon" type="down" size="19" :class="{'is-expanded': isExpanded}"></uni-icons>
|
||||||
</div>
|
</div>
|
||||||
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
|
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
|
||||||
<uni-forms-item label="单位:" name="unitName">
|
<uni-forms-item label="单位:" name="unitName">
|
||||||
|
|
@ -31,20 +33,35 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="select-area">
|
<div class="select-area">
|
||||||
<uni-row :gutter="24" style="display: flex; align-items: center">
|
<uni-row :gutter="24" style="display: flex; align-items: center">
|
||||||
<uni-col :span="10">
|
<uni-col :span="12">
|
||||||
<view>
|
<view>
|
||||||
<uni-data-select v-model="typeId"
|
<!-- <uni-data-select v-model="typeId"
|
||||||
placeholder="请选择物资类型"
|
placeholder="请选择物资类型"
|
||||||
:localdata="maTypeSelectList" @change="getMaCode" filterable >
|
:localdata="maTypeSelectList" @change="getMaCode" filterable >
|
||||||
</uni-data-select>
|
</uni-data-select> -->
|
||||||
|
<eselect
|
||||||
|
style="width: 100%; height: 90rpx"
|
||||||
|
v-model="typeId"
|
||||||
|
:options="maTypeSelectList"
|
||||||
|
@change="getMaCode"
|
||||||
|
@clear="clearTypeId"
|
||||||
|
></eselect>
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="10">
|
<uni-col :span="12">
|
||||||
<view>
|
<view>
|
||||||
<uni-data-select v-model="typeCode"
|
<!-- <uni-data-select v-model="typeCode"
|
||||||
placeholder="请选择规格型号"
|
placeholder="请选择规格型号"
|
||||||
:localdata="maCodeSelectList" @change="selectMaCode">
|
:localdata="maCodeSelectList" @change="selectMaCode">
|
||||||
</uni-data-select>
|
</uni-data-select> -->
|
||||||
|
<eselect
|
||||||
|
style="width: 100%; height: 90rpx"
|
||||||
|
v-model="typeCode"
|
||||||
|
ref="treeSelect"
|
||||||
|
:options="maCodeSelectList"
|
||||||
|
@change="selectMaCode"
|
||||||
|
@clear=""
|
||||||
|
></eselect>
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
|
|
@ -121,9 +138,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer-btn">
|
<!-- <div class="footer-btn">
|
||||||
<button class="btn-cont" @click="submitNum">确认</button>
|
<button class="btn-cont" @click="submitNum">确认</button>
|
||||||
</div>
|
</div> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -131,13 +148,23 @@
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { getUseType,insertApp } from '../../services/back.js';
|
import { getUseType,insertApp } from '../../services/back.js';
|
||||||
|
import eselect from '@/components/tree-select/eselect.vue'
|
||||||
const taskInfo = ref({})
|
const taskInfo = ref({})
|
||||||
|
|
||||||
const maTypeSelectList = ref([])
|
const maTypeSelectList = ref([])
|
||||||
const typeId = ref("")//类型
|
const typeId = ref()//类型
|
||||||
const maCodeSelectList = ref([])
|
const maCodeSelectList = ref([])
|
||||||
const typeCode = ref("")//规格型号
|
const typeCode = ref("")//规格型号
|
||||||
const typeList = ref([])
|
const typeList = ref([])
|
||||||
|
const isExpanded = ref(false)
|
||||||
|
const treeSelect = ref()
|
||||||
|
|
||||||
|
const leftClick = () => {
|
||||||
|
// 返回
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1, // 返回到已存在的页面
|
||||||
|
})
|
||||||
|
}
|
||||||
//类下拉选
|
//类下拉选
|
||||||
const getMaType = () => {
|
const getMaType = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
|
|
@ -147,8 +174,11 @@ const getMaType = () => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
maTypeSelectList.value = res.data.map(option => {
|
maTypeSelectList.value = res.data.map(option => {
|
||||||
return {
|
return {
|
||||||
value:option.typeId,
|
// value:option.typeId,
|
||||||
text:option.typeName,
|
// text:option.typeName,
|
||||||
|
id:option.typeId,
|
||||||
|
name:option.typeName,
|
||||||
|
parentId: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|
@ -156,19 +186,26 @@ const getMaType = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//规格
|
//规格
|
||||||
const getMaCode = () => {
|
const getMaCode = (e) => {
|
||||||
|
console.log('🚀 ~ getMaCode ~ e:', e.id)
|
||||||
|
typeId.value = e.id
|
||||||
|
console.log('🚀 ~ getMaCode ~ typeId.value:', typeId.value)
|
||||||
let obj = {
|
let obj = {
|
||||||
"agreementId":taskInfo.value.agreementId,
|
"agreementId":taskInfo.value.agreementId,
|
||||||
"typeId":typeId.value
|
"typeId":typeId.value
|
||||||
}
|
}
|
||||||
|
console.log('🚀 ~ getMaCode ~ obj:', obj)
|
||||||
getUseType(obj).then(res => {
|
getUseType(obj).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
maCodeSelectList.value = res.data.map(option => {
|
maCodeSelectList.value = res.data.map(option => {
|
||||||
let obj = {
|
let obj = {
|
||||||
...option,
|
...option,
|
||||||
bmFileInfos:[],
|
bmFileInfos:[],
|
||||||
value:option.typeId,
|
// value:option.typeId,
|
||||||
text:option.typeName,
|
// text:option.typeName,
|
||||||
|
id:option.typeId,
|
||||||
|
name:option.typeName,
|
||||||
|
parentId: 0
|
||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
});
|
});
|
||||||
|
|
@ -176,13 +213,29 @@ const getMaCode = () => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const clearTypeId = () => {
|
||||||
|
typeId.value = ''
|
||||||
|
typeCode.value = ''
|
||||||
|
maCodeSelectList.value = []
|
||||||
|
treeSelect.value.showLabel = ''
|
||||||
|
console.log('🚀 ~ clearTypeId ~ treeSelect.value:', treeSelect.value)
|
||||||
|
}
|
||||||
//选择规格型号
|
//选择规格型号
|
||||||
const selectMaCode = (e) => {
|
const selectMaCode = (e) => {
|
||||||
console.log(e)
|
console.log('🚀 ~ selectMaCode ~ e:', e)
|
||||||
|
// 不可重复添加
|
||||||
|
if(typeList.value.some(item => item.typeId == e.id)){
|
||||||
|
// 提示
|
||||||
|
uni.showToast({
|
||||||
|
title: '请勿重复添加',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
maCodeSelectList.value.forEach(item=>{
|
maCodeSelectList.value.forEach(item=>{
|
||||||
console.log(item)
|
console.log(item)
|
||||||
if(item.typeId==e){
|
if(item.typeId==e.id){
|
||||||
typeList.value.push(item)
|
typeList.value.unshift(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(typeList.value)
|
console.log(typeList.value)
|
||||||
|
|
@ -332,7 +385,10 @@ onLoad((options)=>{
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .tree-item .head {
|
||||||
|
justify-content: center !important;
|
||||||
|
}
|
||||||
.accept {
|
.accept {
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
height: 95vh;
|
height: 95vh;
|
||||||
|
|
@ -382,6 +438,15 @@ onLoad((options)=>{
|
||||||
color: #8c8c8c;
|
color: #8c8c8c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
transition: transform 0.5s ease; /* 添加动画过渡 */
|
||||||
|
transform: rotate(0deg);
|
||||||
|
|
||||||
|
&.is-expanded {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作按钮样式
|
// 操作按钮样式
|
||||||
.uni-group {
|
.uni-group {
|
||||||
|
|
@ -474,4 +539,13 @@ onLoad((options)=>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.top-content {
|
||||||
|
max-height: 30px;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: max-height 0.5s ease-out;
|
||||||
|
|
||||||
|
&.is-expanded {
|
||||||
|
max-height: 800px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 新购验收详情 -->
|
<uni-nav-bar leftIcon="left" right-text="提交" title="退料任务详情" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="leftClick" @clickRight="submit"/>
|
||||||
<view class="accept page-common">
|
<view class="accept page-common">
|
||||||
<uni-row :gutter="24" class="search-form">
|
<uni-row :gutter="24" class="search-form">
|
||||||
<uni-col :span="10">
|
<uni-col :span="10">
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { getBackInfo,deleteNumType } from '../../services/back.js';
|
import { getBackInfo,deleteNumType, submitBackApply } from '@/services/back.js';
|
||||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||||
const keyWord = ref('')
|
const keyWord = ref('')
|
||||||
const id = ref('')
|
const id = ref('')
|
||||||
|
|
@ -99,6 +99,12 @@ const options2 = ref([
|
||||||
},
|
},
|
||||||
|
|
||||||
])
|
])
|
||||||
|
const leftClick = () => {
|
||||||
|
// 返回
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1, // 返回到已存在的页面
|
||||||
|
})
|
||||||
|
}
|
||||||
//详情数据
|
//详情数据
|
||||||
const getTableList = () => {
|
const getTableList = () => {
|
||||||
// let obj = {
|
// let obj = {
|
||||||
|
|
@ -158,6 +164,35 @@ const onClick = (e, item, itemIndex) => {
|
||||||
}
|
}
|
||||||
swipeRef.value[itemIndex].closeAll()
|
swipeRef.value[itemIndex].closeAll()
|
||||||
}
|
}
|
||||||
|
const submit = async () => {
|
||||||
|
let param = {
|
||||||
|
id: id.value,
|
||||||
|
taskId: taskId.value
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await submitBackApply(param)
|
||||||
|
if (res.code==200){
|
||||||
|
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||||
|
leftClick()
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ submit ~ error:', error)
|
||||||
|
uni.showToast({ title: '删除失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
// console.log(param)
|
||||||
|
// submitBackApply(param).then(res => {
|
||||||
|
// console.log(res)
|
||||||
|
// if(res.code==200){
|
||||||
|
// uni.showToast({ title: '提交成功', icon: 'none' })
|
||||||
|
|
||||||
|
// }else{
|
||||||
|
// uni.showToast({ title: '提交失败', icon: 'none' })
|
||||||
|
// }
|
||||||
|
// }).catch(error => {
|
||||||
|
// console.log(error)
|
||||||
|
// })
|
||||||
|
}
|
||||||
onLoad((options)=>{
|
onLoad((options)=>{
|
||||||
console.log(options)
|
console.log(options)
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
|
|
|
||||||
|
|
@ -179,14 +179,14 @@ const options = ref([
|
||||||
fontSize: '30rpx',
|
fontSize: '30rpx',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
text: '提交',
|
// text: '提交',
|
||||||
style: {
|
// style: {
|
||||||
backgroundColor: '#13ce66',
|
// backgroundColor: '#13ce66',
|
||||||
color: '#fff',
|
// color: '#fff',
|
||||||
fontSize: '30rpx',
|
// fontSize: '30rpx',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
text: '删除',
|
text: '删除',
|
||||||
style: {
|
style: {
|
||||||
|
|
@ -239,31 +239,31 @@ const onClick=(e,item,itemIndex)=> {
|
||||||
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
|
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (index === 1) {
|
// if (index === 1) {
|
||||||
if (item.taskStatus == 0) {//未完成-提交
|
// if (item.taskStatus == 0) {//未完成-提交
|
||||||
console.log(item)
|
// console.log(item)
|
||||||
let param = {
|
// let param = {
|
||||||
id:item.id,
|
// id:item.id,
|
||||||
taskId:item.taskId
|
// taskId:item.taskId
|
||||||
}
|
// }
|
||||||
console.log(param)
|
// console.log(param)
|
||||||
submitBackApply(param).then(res => {
|
// submitBackApply(param).then(res => {
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
if(res.code==200){
|
// if(res.code==200){
|
||||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
// uni.showToast({ title: '提交成功', icon: 'none' })
|
||||||
getTableList(true)
|
// getTableList(true)
|
||||||
}else{
|
// }else{
|
||||||
uni.showToast({ title: '提交失败', icon: 'none' })
|
// uni.showToast({ title: '提交失败', icon: 'none' })
|
||||||
}
|
// }
|
||||||
}).catch(error => {
|
// }).catch(error => {
|
||||||
console.log(error)
|
// console.log(error)
|
||||||
})
|
// })
|
||||||
} else if(item.taskStatus == 2) {//已完成-查看
|
// } else if(item.taskStatus == 2) {//已完成-查看
|
||||||
handleItem(item)
|
// handleItem(item)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 2. 删除
|
// 2. 删除
|
||||||
if (index === 2) {
|
if (index === 1) {
|
||||||
console.log(item)
|
console.log(item)
|
||||||
let param = {
|
let param = {
|
||||||
id:item.id
|
id:item.id
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ const complete = (e) => {
|
||||||
// console.log(e) // 返回本地生成的base图片路径
|
// console.log(e) // 返回本地生成的base图片路径
|
||||||
const img = new Image()
|
const img = new Image()
|
||||||
img.src = e
|
img.src = e
|
||||||
console.log('🚀 ~ complete ~ img.src:', img.src)
|
// console.log('🚀 ~ complete ~ img.src:', img.src)
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
const canvas = document.createElement('canvas')
|
const canvas = document.createElement('canvas')
|
||||||
canvas.width = img.width
|
canvas.width = img.width
|
||||||
|
|
@ -106,9 +106,11 @@ const complete = (e) => {
|
||||||
ctx.drawImage(img, 0, 0)
|
ctx.drawImage(img, 0, 0)
|
||||||
|
|
||||||
// 转换为 WebP 格式,质量 0.8
|
// 转换为 WebP 格式,质量 0.8
|
||||||
const webpBase64 = canvas.toDataURL('image/webp', 0.8).replace(/^data:image\/(jpeg|png|webp);base64,/, '')
|
const webpBase64 = canvas
|
||||||
|
.toDataURL('image/webp', 0.8)
|
||||||
|
.replace(/^data:image\/(jpeg|png|webp);base64,/, '')
|
||||||
|
|
||||||
console.log('🚀 ~ WebP base64:', webpBase64)
|
// console.log('🚀 ~ WebP base64:', webpBase64)
|
||||||
uploadImg2(webpBase64)
|
uploadImg2(webpBase64)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129,32 +131,32 @@ const preview = () => {
|
||||||
// 拍照/上传
|
// 拍照/上传
|
||||||
const handlePhoto = () => {
|
const handlePhoto = () => {
|
||||||
console.log('拍照/上传')
|
console.log('拍照/上传')
|
||||||
uni.chooseImage({
|
// uni.chooseImage({
|
||||||
count: 1,
|
// count: 1,
|
||||||
sizeType: ['compressed'],
|
// sizeType: ['compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
// sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
|
||||||
console.log('🚀 ~ handlePhoto ~ res.tempFilePaths[0]:', res)
|
|
||||||
// imgPath.value = res.tempFilePaths[0]
|
|
||||||
// isRotate.value = false
|
|
||||||
signType.value = 1
|
|
||||||
uploadImg(res.tempFilePaths[0])
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// uni.showActionSheet({
|
|
||||||
// itemList: ['拍照', '从相册选择'],
|
|
||||||
// success: (res) => {
|
// success: (res) => {
|
||||||
// if (res.tapIndex === 0) {
|
// console.log('🚀 ~ handlePhoto ~ res.tempFilePaths[0]:', res)
|
||||||
// getCamera()
|
// // imgPath.value = res.tempFilePaths[0]
|
||||||
// } else if (res.tapIndex === 1) {
|
// // isRotate.value = false
|
||||||
// // 从相册选择
|
// signType.value = 1
|
||||||
// getPhoto()
|
// uploadImg(res.tempFilePaths[0])
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// fail: (err) => {
|
|
||||||
// console.error('操作菜单选择失败:', err)
|
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['拍照', '从相册选择'],
|
||||||
|
success: (res) => {
|
||||||
|
if (res.tapIndex === 0) {
|
||||||
|
getCamera()
|
||||||
|
} else if (res.tapIndex === 1) {
|
||||||
|
// 从相册选择
|
||||||
|
getPhoto()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('操作菜单选择失败:', err)
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 拍照
|
// 拍照
|
||||||
const getCamera = () => {
|
const getCamera = () => {
|
||||||
|
|
@ -177,23 +179,26 @@ const onCameraError = (message) => {
|
||||||
console.log('🚀 ~ onCameraError ~ message:', message)
|
console.log('🚀 ~ onCameraError ~ message:', message)
|
||||||
}
|
}
|
||||||
const onCameraSuccess = (file) => {
|
const onCameraSuccess = (file) => {
|
||||||
// const file1 = "data:image/jpeg;base64," + file;
|
img.src = file
|
||||||
// const file1 = file
|
let signUrl = ''
|
||||||
// uni.showToast({ title: file, icon: 'none', duration: 20000 })
|
// console.log('🚀 ~ complete ~ img.src:', img.src)
|
||||||
// uni.showModal({
|
img.onload = () => {
|
||||||
// title: '是否上传图片',
|
const canvas = document.createElement('canvas')
|
||||||
// content: file,
|
canvas.width = img.width
|
||||||
// })
|
canvas.height = img.height
|
||||||
// let params = {
|
const ctx = canvas.getContext('2d')
|
||||||
// image: file1,
|
ctx.drawImage(img, 0, 0)
|
||||||
// jiju_type: '',
|
|
||||||
// auth_lic:
|
// 转换为 WebP 格式,质量 0.8
|
||||||
// 'xIWDlaDVdijcBB4mjhGCPYk5Kvk8tHZJbUn+vW+ih15+MYx98e/PXyBmKL5gFcWMPznLgDA15QuSAnZQSLddwdy9HkZgtuQDEEZZ351Eyb1eiDUccUnyoSGIrNimbx5TooBNNPYqU4qJeFrPJXAqjBHzRrxoBxuR2CEGKQPgHC4=',
|
signUrl = canvas
|
||||||
// }
|
.toDataURL('image/webp', 0.8)
|
||||||
// console.log('🚀 ~ onCameraSuccess ~ params:', params)
|
.replace(/^data:image\/(jpeg|png|webp);base64,/, '')
|
||||||
|
|
||||||
|
// console.log('🚀 ~ WebP base64:', signUrl)
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const signUrl = file
|
// const signUrl = webpBase64
|
||||||
if (opts.isLease) {
|
if (opts.isLease) {
|
||||||
const params = {
|
const params = {
|
||||||
id: opts.id,
|
id: opts.id,
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ const onClick = (e, item) => {
|
||||||
console.log("tttttttttt",e,item)
|
console.log("tttttttttt",e,item)
|
||||||
if(taskStatus.value==3){//出库进行中
|
if(taskStatus.value==3){//出库进行中
|
||||||
console.log("333333333333333333333333333")
|
console.log("333333333333333333333333333")
|
||||||
if (e.index === 0) {
|
if (e.content.text == '出库') {
|
||||||
if (item.status == 2) {//已完成
|
if (item.status == 2) {//已完成
|
||||||
leaseOutBack(item)
|
leaseOutBack(item)
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -333,7 +333,7 @@ const onClick = (e, item) => {
|
||||||
onCodingItem(item)//出库
|
onCodingItem(item)//出库
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e.index === 1) {
|
if (e.content.text == '查看') {
|
||||||
if (item.status == 2) {//已完成
|
if (item.status == 2) {//已完成
|
||||||
console.log(312)
|
console.log(312)
|
||||||
checkViewDetail(item)//查看
|
checkViewDetail(item)//查看
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ export const submitBackApply = (data) => {
|
||||||
export const backApplyRemove = (data) => {
|
export const backApplyRemove = (data) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/material/back_apply_info/deleteById',
|
url: '/material/back_apply_info/deleteByApp',
|
||||||
data:data,
|
data:data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue