This commit is contained in:
hongchao 2025-10-10 12:21:28 +08:00
commit a2a9c68ecd
7 changed files with 92 additions and 14 deletions

View File

@ -22,7 +22,7 @@
<view class="fun-box-btn clear flex" @click="clear"> <view class="fun-box-btn clear flex" @click="clear">
<text>清空</text> <text>清空</text>
</view> </view>
<view class="fun-box-btn confirm flex" @click="confirm"> <view v-if="isLandscape" class="fun-box-btn confirm flex" @click="confirm">
<text>确认</text> <text>确认</text>
</view> </view>
<view class="fun-box-btn cancel flex" @click="cancel"> <view class="fun-box-btn cancel flex" @click="cancel">
@ -38,7 +38,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, watch, getCurrentInstance } from 'vue' import { ref, reactive, watch, getCurrentInstance, onMounted, onUnmounted } from 'vue'
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
const emits = defineEmits(['update:modelValue', 'complete']) const emits = defineEmits(['update:modelValue', 'complete'])
@ -71,6 +71,36 @@ if (memberStore.userInfo.nickName && memberStore.userInfo.nickName.length < 5) {
const paths = ref([]) // const paths = ref([]) //
const PEN = { width: 6, color: '#000000' } // const PEN = { width: 6, color: '#000000' } //
const isLandscape = ref(true) //
//
const handleResize = () => {
const { windowWidth, windowHeight } = uni.getSystemInfoSync()
console.log('🚀 ~ handleResize ~ windowWidth, windowHeight:', windowWidth, windowHeight)
isLandscape.value = windowWidth < windowHeight
// canvas
setTimeout(() => {
uni.createSelectorQuery()
.in(_this)
.select('#mycanvas')
.fields({ size: true, rect: true }, (data) => {
if (data) {
drawBackground(canvaCtx, data.width, data.height)
}
})
.exec()
}, 50)
}
onMounted(() => {
uni.onWindowResize(handleResize)
handleResize() //
})
onUnmounted(() => {
uni.offWindowResize(handleResize)
})
watch( watch(
() => props.modelValue, () => props.modelValue,

View File

@ -55,11 +55,29 @@
></uni-data-select> ></uni-data-select>
</uni-forms-item> </uni-forms-item>
</uni-col> </uni-col>
<!-- <uni-col :span="6">
<view class="addBtn" @click="getList">查询</view>
</uni-col> -->
</uni-row>
<uni-row
:gutter="30"
style="display: flex; margin-top: -15px;"
>
<uni-col :span="24">
<uni-forms-item name="typeName" >
<uni-data-select
v-model="queryParams.typeName"
:localdata="typeList"
placeholder="选择物资类型"
:searchable="false"
filterable
></uni-data-select>
</uni-forms-item>
</uni-col>
<uni-col :span="6"> <uni-col :span="6">
<view class="addBtn" @click="getList">查询</view> <view class="addBtn" @click="getList">查询</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
</div> </div>
<scroll-view scroll-y class="scroll-container"> <scroll-view scroll-y class="scroll-container">
@ -135,7 +153,8 @@
<script setup> <script setup>
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { onMounted, ref, reactive, computed } from 'vue' import { onMounted, ref, reactive, computed } from 'vue'
import { getBranchListApi,getImpUnitListApi, getDepartListByImpUnitApi, getProListByDepartApi, } from '@/services/materialsStation' import { getBranchListApi,getImpUnitListApi, getDepartListByImpUnitApi, getProListByDepartApi } from '@/services/materialsStation'
import { getTypeListApi } from '@/services/inStorage/index.js'
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
const memberStore = useMemberStore() const memberStore = useMemberStore()
const userInfo = ref(memberStore.userInfo || {}) const userInfo = ref(memberStore.userInfo || {})
@ -147,10 +166,12 @@ const queryParams = ref({
departName: '', departName: '',
proName: '', proName: '',
keyWord: '', keyWord: '',
typeName: ''
}) })
const impUnitOptions = ref([]) const impUnitOptions = ref([])
const departOptions = ref([]) const departOptions = ref([])
const proOptions = ref([]) const proOptions = ref([])
const typeList = ref([])
const back = () => { const back = () => {
uni.navigateBack({ uni.navigateBack({
@ -204,6 +225,7 @@ onLoad((opt) => {
handleImpUnitChange() handleImpUnitChange()
handleDepartChange() handleDepartChange()
getList() getList()
getTypeList()
}) })
onMounted(() => { onMounted(() => {
@ -265,6 +287,23 @@ const handleDepartChange= async () => {
} }
}; };
const getTypeList = async () => {
try {
const res = await getTypeListApi({ level: 3, skipPermission: 1 })
console.log('🚀 ~ getTypeList ~ res:', res)
typeList.value = []
if (res.data) {
typeList.value = res.data.map(item => ({
text: item.typeName, //
value: item.typeName
}))
}
} catch (error) {
console.log('🚀 ~ getTypeList ~ error:', error)
}
}
const filteredEquipmentCategories = computed(() => { const filteredEquipmentCategories = computed(() => {
@ -290,7 +329,7 @@ const showDetail= (engineering) => {
console.log('查看详情:', engineering); console.log('查看详情:', engineering);
// //
uni.navigateTo({ uni.navigateTo({
url: '/pages/materialsStation/equipmentRecord/equipmentRecordDetails?proName='+ engineering.proName, url: '/pages/materialsStation/equipmentRecord/equipmentRecordDetails?proName='+ engineering.proName + '&typeName='+ queryParams.value.typeName,
}) })
} }

View File

@ -105,6 +105,7 @@ const back = () => {
onLoad((options) => { onLoad((options) => {
console.log(options) console.log(options)
proName.value = options.proName proName.value = options.proName
queryParams.value.typeName = options.typeName
getDetailsList() getDetailsList()
}) })

View File

@ -62,7 +62,7 @@ const userInfo = ref(memberStore.userInfo || {})
const queryParams = reactive({ const queryParams = reactive({
teamId: '', teamId: '',
status: '', status: 2,
}) })
const teamList = ref([]) const teamList = ref([])
const statusList = ref([ const statusList = ref([

View File

@ -46,7 +46,6 @@
<uni-easyinput <uni-easyinput
v-model="formData.backPerson" v-model="formData.backPerson"
placeholder="请输入内容" placeholder="请输入内容"
disabled
></uni-easyinput> ></uni-easyinput>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="联系电话" name="phone"> <uni-forms-item label="联系电话" name="phone">

View File

@ -53,9 +53,9 @@
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
<div style="width: 100%"> <!-- <div style="width: 100%">-->
<ElectronicSeal :maCode="codeData?.maCode" :maId="codeData?.maId" :devType="queryParams?.jiJuType" /> <!-- <ElectronicSeal :maCode="codeData?.maCode" :maId="codeData?.maId" :devType="queryParams?.jiJuType" />-->
</div> <!-- </div>-->
<button type="primary" style="margin-top: 20px" @click="addCode">添加编码</button> <button type="primary" style="margin-top: 20px" @click="addCode">添加编码</button>
</view> </view>
@ -106,10 +106,10 @@
<script> <script>
import { decryptWithSM4 } from '@/utils/sm' import { decryptWithSM4 } from '@/utils/sm'
import { getInfoByCodeApi } from '@/services/picking/outbound' import { getInfoByCodeApi } from '@/services/picking/outbound'
import ElectronicSeal from '@/components/ElectronicSeal/index.vue' // import ElectronicSeal from '@/components/ElectronicSeal/index.vue'
export default { export default {
components: { ElectronicSeal }, // components: { ElectronicSeal },
data() { data() {
return { return {
showCamera: false, showCamera: false,
@ -136,6 +136,8 @@ export default {
focusTimeout: null, focusTimeout: null,
// //
systemInfo: null, systemInfo: null,
screenHeight: null,
screenWidth: null,
} }
}, },
onBackPress(options) { onBackPress(options) {
@ -205,6 +207,11 @@ export default {
const systemInfo = uni.getSystemInfoSync() const systemInfo = uni.getSystemInfoSync()
console.log('设备信息:', systemInfo) console.log('设备信息:', systemInfo)
this.systemInfo = systemInfo this.systemInfo = systemInfo
//
const screenHeight = systemInfo.screenHeight; // 1000
const screenWidth = systemInfo.screenWidth; // 600
this.screenHeight = screenHeight;
this.screenWidth = screenWidth;
} catch (error) { } catch (error) {
console.error('获取设备信息失败:', error) console.error('获取设备信息失败:', error)
} }
@ -482,7 +489,7 @@ export default {
console.log('拍照前聚焦...') console.log('拍照前聚焦...')
console.log('开始拍照...') console.log('开始拍照...')
CameraPreview.takePicture( CameraPreview.takePicture(
{ width: 640, height: 540, quality: 50 }, {width:this.screenWidth, height:this.screenHeight, quality: 50 },
async (base64PictureData) => { async (base64PictureData) => {
console.log('拍照返回数据', base64PictureData) console.log('拍照返回数据', base64PictureData)
await this.processImage(base64PictureData) await this.processImage(base64PictureData)

View File

@ -565,6 +565,8 @@ const changeProd = async (e) => {
console.log('🚀 ~ changeProd ~ e:', e) console.log('🚀 ~ changeProd ~ e:', e)
formData.proId = e formData.proId = e
formData.projectId = prodRange.value.find((item) => item.proId == e)?.projectId formData.projectId = prodRange.value.find((item) => item.proId == e)?.projectId
formData.teamId = null
formData.leasePerson = ''
console.log('xxxxxxxxxxxxxxxxxxxxxx', formData.projectId) console.log('xxxxxxxxxxxxxxxxxxxxxx', formData.projectId)
tableData.value = [] tableData.value = []
if (formData.pickType == 0) { if (formData.pickType == 0) {
@ -633,7 +635,7 @@ const getCode = (item) => {
uni.navigateTo({ uni.navigateTo({
url: url:
'/pages/materialsStation/toolsLease/codeOut?params=' + '/pages/materialsStation/toolsLease/codeOut?params=' +
JSON.stringify({ ...item, proId: formData.proId, teamId: formData.teamId }), JSON.stringify({ ...item, proId: formData.proId, teamId: formData.teamId}),
}) })
} }