This commit is contained in:
parent
d2f9a8c965
commit
a1935dbdc6
|
|
@ -29,7 +29,7 @@
|
|||
</view>
|
||||
<view class="sections">
|
||||
<view v-for="(part, index) in isUsingList" :key="index" @click="jumpUrl(part.iconMark)">
|
||||
<image :src="`/src/static/${part.iconMark}.png`" mode="" />
|
||||
<image :src="`../../static/${part.iconMark}.png`" mode="" />
|
||||
<span>{{ part.iconName }}</span>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -103,22 +103,28 @@ onMounted(async () => {
|
|||
|
||||
// 登录按钮
|
||||
const onHandleLogin = async () => {
|
||||
const res = await appLoginAPI(loginForm)
|
||||
if (res.code === 200) {
|
||||
// 1. 获取 token 并存储
|
||||
memberStore.setToken(res.data.access_token)
|
||||
// 2 . 获取用户信息并存储
|
||||
const result = await getUserInfoAPI()
|
||||
memberStore.setUserInfo(result.user)
|
||||
uni.showToast({ title: '登录成功!', icon: 'none' })
|
||||
uni.setStorageSync('username', loginForm.username)
|
||||
uni.setStorageSync('password', loginForm.password)
|
||||
uni.setStorageSync('id', result.user.userId)
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}, 500)
|
||||
console.log('🚀 ~ onHandleLogin ~ loginForm:', loginForm)
|
||||
try {
|
||||
const res = await appLoginAPI(loginForm)
|
||||
console.log('🚀 ~ onHandleLogin ~ res:', res)
|
||||
if (res.code === 200) {
|
||||
// 1. 获取 token 并存储
|
||||
memberStore.setToken(res.data.access_token)
|
||||
// 2 . 获取用户信息并存储
|
||||
const result = await getUserInfoAPI()
|
||||
memberStore.setUserInfo(result.user)
|
||||
uni.showToast({ title: '登录成功!', icon: 'none' })
|
||||
uni.setStorageSync('username', loginForm.username)
|
||||
uni.setStorageSync('password', loginForm.password)
|
||||
uni.setStorageSync('id', result.user.userId)
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ onHandleLogin ~ error:', error)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@
|
|||
<uni-forms-item label="领料工程:" name="projectName" class="flex">
|
||||
<span class="form-view">{{ queryParams.projectName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName" class="flex">
|
||||
<uni-forms-item label="物资类型:" name="maTypeName" class="flex" v-if="!queryParams.isAddCode">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName" class="flex">
|
||||
<uni-forms-item label="规格型号:" name="typeName" class="flex" v-if="!queryParams.isAddCode">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="待出库数量:" name="outNum" class="flex">
|
||||
<uni-forms-item label="待出库数量:" name="outNum" class="flex" v-if="!queryParams.isAddCode">
|
||||
<span class="form-view">{{ queryParams.outNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
|
@ -131,6 +131,7 @@ import {
|
|||
getCodeScanAPI,
|
||||
} from '@/services/picking/outbound.js'
|
||||
import { getBoxBindByCode } from '@/services/standard.js'
|
||||
import { getInfoByQrcode } from '@/services/back.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
|
@ -258,15 +259,24 @@ const onHandleOutbound = async () => {
|
|||
// 组装出库参数
|
||||
const paramsList = []
|
||||
codeDeviceList.value.map((e) => {
|
||||
console.log('🚀 ~ codeDeviceList.value.map ~ e:', e.typeId)
|
||||
const maCodeList = []
|
||||
maCodeList.push({
|
||||
maId: e.maId,
|
||||
maCode: e.maCode,
|
||||
})
|
||||
paramsList.push({
|
||||
typeId: e.typeId,
|
||||
leaseType: 0,
|
||||
maId: e.maId,
|
||||
maCode: e.maCode,
|
||||
manageType: 0,
|
||||
outNum: 1,
|
||||
parentId,
|
||||
typeId,
|
||||
publishTask,
|
||||
maCodeList,
|
||||
isApp: 0,
|
||||
isNew: queryParams.value.isNew,
|
||||
})
|
||||
})
|
||||
console.log('mmmmmmmmmmmmmmmm', paramsList)
|
||||
|
|
@ -408,9 +418,53 @@ const onCodeIdentify = () => {
|
|||
|
||||
// 扫码识别按钮
|
||||
const scanStart = () => {
|
||||
if (scanQrCodeRef.value) {
|
||||
scanQrCodeRef.value.scanQrCode()
|
||||
}
|
||||
// if (scanQrCodeRef.value) {
|
||||
// scanQrCodeRef.value.scanQrCode()
|
||||
// }
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
console.log('🚀 ~ scanStart ~ res:', res.result)
|
||||
const qrCode = res.result
|
||||
if (!qrCode) {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
} else {
|
||||
try {
|
||||
const res = await getInfoByQrcode({ qrCode })
|
||||
console.log('🚀 ~ success: ~ res:', res)
|
||||
if (res.code === 200) {
|
||||
if (res.data && res.data.recordList.length > 0) {
|
||||
codeDeviceList.value.push(...res.data.recordList)
|
||||
// 去重
|
||||
if (codeDeviceList.value.length > 0) {
|
||||
const seen = new Set()
|
||||
codeDeviceList.value = codeDeviceList.value.filter((item) => {
|
||||
if (!item.typeId || seen.has(item.typeId)) {
|
||||
return false
|
||||
}
|
||||
seen.add(item.typeId)
|
||||
return true
|
||||
})
|
||||
//materialModel
|
||||
codeDeviceList.value.forEach(item => {
|
||||
item.materialName = item.typeName
|
||||
item.materialModel = item.typeModelName
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '暂无数据', icon: 'none' })
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ success: ~ error:', error)
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.error('扫描出错:', error.message)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 处理扫描成功事件
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ const back = () => {
|
|||
onLoad((opt) => {
|
||||
console.log('🚀 ~ onLoad ~ 出库:', opt)
|
||||
opts.value = opt.params ? JSON.parse(opt.params) : {}
|
||||
outNum.value = opts.value.outNum
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
<uni-th width="180" align="center">规格型号</uni-th>
|
||||
<uni-th align="center">在库数</uni-th>
|
||||
<uni-th width="204" align="center">{{
|
||||
opts.value.isNew != 0 ? '领用数' : '出库数'
|
||||
opts.isNew == 0 ? '出库数' : '领用数'
|
||||
}}</uni-th>
|
||||
<uni-th width="120" align="center">操作</uni-th>
|
||||
</uni-tr>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
<div class="df-btn">
|
||||
<button class="btn" size="mini" type="primary" @click="addLeaseNum">新增数量出库</button>
|
||||
<button class="btn" size="mini" type="primary" @click="">新增编码出库</button>
|
||||
<button class="btn" size="mini" type="primary" @click="addLeaseCode">新增编码出库</button>
|
||||
</div>
|
||||
<div
|
||||
class="table-box"
|
||||
|
|
@ -113,8 +113,24 @@ const addLeaseNum = () => {
|
|||
isEdit: true,
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/toolsLease/toolsLeaseAdd?params=' + JSON.stringify(params),
|
||||
})
|
||||
url: '/pages/toolsLease/toolsLeaseAdd?params=' + JSON.stringify(params),
|
||||
})
|
||||
}
|
||||
|
||||
// 编码新增
|
||||
const addLeaseCode = () => {
|
||||
const params = {
|
||||
isNew: 0,
|
||||
teamId: opts.value.teamId,
|
||||
teamName: opts.value.teamName,
|
||||
projectId: opts.value.projectId,
|
||||
projectName: opts.value.projectName,
|
||||
parentId: tableList.value[0].parentId,
|
||||
isAddCode: true
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/toolsLease/codeOut?params=' + JSON.stringify(params),
|
||||
})
|
||||
}
|
||||
const back = () => {
|
||||
uni.navigateBack({
|
||||
|
|
|
|||
|
|
@ -366,3 +366,12 @@ export const leaseOutApi = (data) => {
|
|||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 二维码出库
|
||||
export const getInfoByQrcode = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/lease_apply_info/getInfoByQrcode',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ const ENV = process.env.NODE_ENV
|
|||
// export const baseURL = ENV === 'development' ? 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' : 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/'//生产
|
||||
// export const baseURL = ENV === 'development' ? '/api' : '/iws/jiju-api'; // 宏源服务
|
||||
// export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***'
|
||||
export const baseURL = ENV === 'development' ? 'http://192.168.0.96:18080' : 'http://192.168.0.96:18080'//马
|
||||
export const baseURL = ENV === 'development' ? 'http://192.168.0.96:18080' : 'http://sgwpdm.ah.sgcc.com.cn/iws/clz-api'//马
|
||||
console.log('🚀 ~ baseURL:', baseURL)
|
||||
// export const baseURL = ENV === 'development' ? '/api' : '***'
|
||||
|
||||
|
|
@ -77,11 +77,6 @@ export const http = (options) => {
|
|||
url: '/pages/login/index',
|
||||
})
|
||||
reject(res)
|
||||
} else if (res.data.code === 400) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: `${res.data.msg}`,
|
||||
})
|
||||
} else if (res.data.code === 500) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export default defineConfig({
|
|||
// target: 'http://192.168.2.76:18080',
|
||||
// target: 'http://192.168.0.244:18580',
|
||||
// target: 'http://36.33.26.201:19988/prod-api/',
|
||||
target: 'http://192.168.1.117:18080',
|
||||
target: 'http://sgwpdm.ah.sgcc.com.cn/iws/clz-api/',
|
||||
// target: 'http://localhost:18080',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue