提交 8f478f98 authored 作者: 刘旭's avatar 刘旭

更新代码

上级 5eae5d40
{
"recommendations": [
"cschlosser.doxdocgen"
]
}
\ No newline at end of file
{
}
\ No newline at end of file
...@@ -14,6 +14,10 @@ export const getMetadataList = () => request('/lowcodeplatform-system/center/met ...@@ -14,6 +14,10 @@ export const getMetadataList = () => request('/lowcodeplatform-system/center/met
export const getMetadata = (formId: string) => export const getMetadata = (formId: string) =>
request('/lowcodeplatform-system/center/metadata/detail', 'GET', { formId }); request('/lowcodeplatform-system/center/metadata/detail', 'GET', { formId });
// 创建表单数据
export const createBusiness = (data: any) =>
request('/lowcodeplatform-system/center/business/create', 'POST', data);
export const getUserParameter = (formId: string) => export const getUserParameter = (formId: string) =>
request('/lowcodeplatform-system/center/business/getUserParameter', 'GET', { formId }); request('/lowcodeplatform-system/center/business/getUserParameter', 'GET', { formId });
...@@ -29,12 +33,12 @@ export const getPrintData = (data: any) => ...@@ -29,12 +33,12 @@ export const getPrintData = (data: any) =>
request('/wms-system/labelRule/print/serial', 'POST', data); request('/wms-system/labelRule/print/serial', 'POST', data);
// 获取打印信息 // 获取打印信息
export const createBusiness = (data: any) => export const createBatchBusiness = (data: any) =>
request('/lowcodeplatform-system/center/business/createBatch', 'POST', data); request('/lowcodeplatform-system/center/business/createBatch', 'POST', data);
// 获取序列化 // 获取序列化
export const getByBillNo = (data: any) => export const getBillSerialNumber = (data: any) =>
request('/wms-system/serialNumber/getByBillNo', 'GET', data); request('/wms-system/serialNumber/getBillSerialNumber', 'GET', data);
// 获取条码规则 // 获取条码规则
export const getAnalysis = (data: any) => export const getAnalysis = (data: any) =>
...@@ -47,3 +51,24 @@ export const getRuleSelection = (lowFormId: string) => ...@@ -47,3 +51,24 @@ export const getRuleSelection = (lowFormId: string) =>
// 获取规则选单 // 获取规则选单
export const changeDataById = (data: any) => export const changeDataById = (data: any) =>
request('/lowcodeplatform-system/center/bill/transform/change/databyid', 'POST', data); request('/lowcodeplatform-system/center/bill/transform/change/databyid', 'POST', data);
// 获取明细范围
export const getDetailList = (data: any) =>
request('/lowcodeplatform-system/center/business/detailList', 'POST', data);
// 获取合并数量操作
export const getEmptyList = (data: any) =>
request('/lowcodeplatform-system/center/business/empty', 'POST', data);
/**
* @brief 提交下推操作保存为已审核
* @param idsBill 保存状态的id
* @param operationKey audit 自动审核-》已审核 submit 提交-》变成审核中
* @return
*/
export const submitBusiness = (data: any) =>
request('/lowcodeplatform-system/center/business/submit', 'POST', data);
// 判断是否已创建
export const getBillBySerialNumber = (data: any) =>
request('/wms-system/serialNumber/getBillBySerialNumber', 'GET', data);
<template> <template>
<!-- <button @tap="PrintText">测试</button> --> <!-- <button @tap="PrintText">测试</button> -->
<view class="card" v-for="(res, r) in businessList" :key="r"> <view class="card" v-for="(res, r) in businessList" :key="r">
<block v-for="(item, index) of res" :key="index"> <block v-for="(item, index) of res" :key="index">
<view style="padding: 10rpx 0; display: flex; flex-direction: row;"> <view style="padding: 10rpx 0; display: flex; flex-direction: row;">
<view style="margin-right: 5rpx; width: 200rpx;">{{ item.label }}</view> <view style="margin-right: 5rpx; width: 200rpx;">{{ item.label }}</view>
<view style="flex: 1; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"> <view style="flex: 1; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
{{ item.value }} {{ item.value }}
</view> </view>
</view> </view>
</block> </block>
<u-divider v-show="is_WMS_Receive" color="#fa3534"> <u-divider v-show="is_WMS_Receive" color="#fa3534">
<u-button type="primary" size="mini" @tap="handlePrint(res)">打印</u-button> <u-button type="primary" size="mini" @tap="handlePrint(res)">打印</u-button>
</u-divider> </u-divider>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, reactive } from 'vue' import { computed, reactive } from 'vue';
import { useBlueTooth } from '@/store/modules/bluetooth'; import { useBlueTooth } from '@/store/modules/bluetooth';
import { getPrintData, getByBillNo, getAnalysis, getMetadata, getBusinessList } from '@/api/apply' import {
getPrintData,
getBillSerialNumber,
getAnalysis,
getMetadata,
getBusinessList,
} from '@/api/apply';
import template from './template'; import template from './template';
import { generateInstruct } from '@/tspl'; import { generateInstruct } from '@/tspl';
const blueTooth = useBlueTooth() const blueTooth = useBlueTooth();
const props = defineProps({ const props = defineProps({
businessList: { businessList: {
type: Array type: Array,
} as any } as any,
}) printTemplateId: Number,
});
const state: any = reactive({ const state: any = reactive({
looptime: 0, looptime: 0,
currentTime: 1, currentTime: 1,
lastData: 0, lastData: 0,
oneTimeData: 0, oneTimeData: 0,
canvasWidth: 1050, canvasWidth: 1050,
canvasHeight: 750, canvasHeight: 750,
buffSize: [], buffSize: [],
printNum: [], printNum: [],
printerNum: 1, printerNum: 1,
currentPrint: 1, currentPrint: 1,
isReceiptSend: false, isReceiptSend: false,
isLabelSend: false isLabelSend: false,
}) });
const is_WMS_Receive = computed(() => { const is_WMS_Receive = computed(() => {
return ['WMS_Receive', 'BD_Reserve'].indexOf(JSON.parse(uni.getStorageSync('pageData')).permTag) !== -1 ? true : false return ['WMS_Receive', 'BD_Reserve'].indexOf(
}) // 是否收料通知单 JSON.parse(uni.getStorageSync('pageData')).permTag
) !== -1
? true
: false;
}); // 是否收料通知单
const handlePrint = async (row: any) => { // 整合打印模板与后台返回的打印数据
const billNo = row.filter((item: any) => item.label == "单据编码" || item.label == "编码")[0].value const integrateData = (printTemplate: any, printData: any) => {
const formId = JSON.parse(uni.getStorageSync('pageData')).permTag console.log(printTemplate, printData);
let metaParams = formId == 'WMS_Receive' ? 'WMS_LableRule' : 'BD_ReserveRule' printTemplate.printElements.map((element: any) => {
const { data: metaList } = await getMetadata(metaParams) printData.map((print: any) => {
console.log(metaList, 'metaList'); if (element.options.field === print.field) {
let printData = [] as any[] element.options.testData = print.printVal;
if (formId == 'WMS_Receive') { element.options.title = print.name;
const { data: serialList } = await getByBillNo({ billNo, formId }) }
console.log(serialList); if (element.options.textType === 'qrcode') element.options.testData = print.FBarCode;
if (serialList.data.length === 0) return uni.showToast({ });
title: '该编码下无序列号', });
icon: 'none' return printTemplate;
}) };
const { data: printList } = await getPrintData(serialList.data)
const { data: analysisList }: any = await getAnalysis({ billNo: printList.data[0].FBarCode.split(',')[0] })
console.log(printList, analysisList, 'printList');
printList.data.map((item: any) => { const handlePrint = async (row: any) => {
let obj = {} as any const billNo = row.filter((item: any) => item.label == '单据编码' || item.label == '编码')[0]
analysisList.data.map((res: any, r: number) => { .value;
let arr = item.FBarCode.split(',') const formId = JSON.parse(uni.getStorageSync('pageData')).permTag;
if (arr) { let printTemplate;
let newArr = arr.slice(1, arr.length - 1) // let metaParams = formId == 'WMS_Receive' ? 'WMS_LableRule' : 'BD_ReserveRule'
obj['FBarCode'] = item.FBarCode // const { data: metaList } = await getMetadata(metaParams)
obj[res.name] = newArr[r] // console.log(metaList, 'metaList');
} const { data: printList } = await getBusinessList({ formId: 'PrintTemplate' });
})
printData.push(obj)
})
} else {
const { data: businessList } = await getBusinessList({ formId })
console.log(businessList, row);
row.map((item: any) => { if (props.printTemplateId) {
businessList.data.fieldList.map((filed: any) => { const templateJson = printList.data.dataList.find(
if (item.label == filed.fieldName) { (item: any) => item.id == props.printTemplateId
console.log(item.label, filed.fieldName); ).templateJson;
if (item.label == '编码') item.type = 'qrcode' printTemplate = JSON.parse(templateJson).panels[0];
else item.type = 'text' } else
} return uni.showToast({
}) title: '请先在后台设置打印模板',
}) mask: true,
printData = row });
} let printData;
console.log(JSON.parse(metaList.data.formJson), printData); if (formId == 'WMS_Receive') {
// const deviceId = blueTooth.BLEInformation.deviceId const { data: serialList } = await getBillSerialNumber({ billNo, formId });
// if (!deviceId) { console.log(serialList);
// uni.navigateTo({ url: '/pages/blueTooth/index' }) if (serialList.data.length === 0)
// } return uni.showToast({
// generateInstruct(template.panels[0], blueTooth) title: '该编码下无序列号',
} icon: 'none',
});
const { data: printList } = await getPrintData(serialList.data);
const { data: analysisList }: any = await getAnalysis({
billNo: printList.data[0].FBarCode.split(',')[0],
});
console.log(printList, analysisList, 'printList');
printList.data.map((item: any) => {
analysisList.data.map((res: any, r: number) => {
let arr = item.FBarCode.split(',');
if (arr) {
let newArr = arr.slice(1, arr.length - 1);
res.FBarCode = item.FBarCode;
res.printVal = newArr[r];
}
});
});
printData = analysisList.data;
console.log(printData, 'analysisList.data');
} else {
const { data: businessList } = await getBusinessList({ formId });
console.log(businessList, row);
row.map((item: any) => {
businessList.data.fieldList.map((filed: any) => {
if (item.label == filed.fieldName) {
console.log(item.label, filed.fieldName);
if (item.label == '编码') item.type = 'qrcode';
else item.type = 'text';
}
});
});
// printData = row
}
const deviceId = blueTooth.BLEInformation.deviceId;
if (!deviceId) {
uni.navigateTo({ url: '/pages/blueTooth/index' });
}
generateInstruct(integrateData(printTemplate, printData), blueTooth);
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card.box-list { .card.box-list {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
:deep(.u-checkbox__label) { :deep(.u-checkbox__label) {
display: none; display: none;
} }
</style> </style>
export const data = {
"config": {
"size": "default",
"hideRequiredAsterisk": false,
"labelWidth": 100,
"labelPosition": "right",
"dbTableComment": "收料标签",
"dbTableName": "T_WMS_LableRule",
"formId": "WMS_LableRule",
"formTypes": "labelPrint",
"subSystem": "wms-system",
"microFrontEnd": false,
"supportSync": false,
"saveVisibility": "",
"savePlugin": "",
"pushVisibility": "",
"pushPlugin": "",
"printVisibility": "",
"printPlugin": "",
"dependencyForm": "WMS_Receive",
"x": 60,
"y": 42
},
"list": [
{
"label": "条码",
"type": "barcode",
"options": {
"defaultValue": "123456789",
"visibility": [
"list_visible",
"form_visible"
],
"x": "150",
"y": "25"
},
"key": "7a14224c207a47698fa0a8bd24a2a895",
"model": "FSerialId",
"rules": [],
"dbFieldName": "FSerialId",
"dbFieldComment": "条码",
"dbTableName": "T_WMS_LableRule"
},
{
"label": "栅格布局",
"type": "grid",
"columns": [
{
"span": 12,
"list": [
{
"label": "物料编码",
"type": "text",
"options": {
"defaultValue": "ZXCVBNM",
"visibility": [
"list_visible",
"form_visible"
],
"x": "20",
"y": "160"
},
"key": "ec2d553e50884d0ca10d0efb9b6c4593",
"model": "FMaterialId",
"rules": [],
"dbFieldName": "FMaterialId",
"dbFieldComment": "物料编码",
"dbTableName": "T_WMS_LableRule"
},
{
"label": "物料名称",
"type": "text",
"options": {
"defaultValue": "锂电池",
"visibility": [
"list_visible",
"form_visible"
],
"x": "20",
"y": "200"
},
"key": "1cd2df65b64d46dcbac6ae8f4316a730",
"model": "FMaterialName",
"rules": [],
"dbFieldName": "FMaterialName",
"dbFieldComment": "物料名称",
"dbTableName": "T_WMS_LableRule"
},
{
"label": "批号",
"type": "text",
"options": {
"defaultValue": "1008611",
"visibility": [
"list_visible",
"form_visible"
],
"x": "20",
"y": "240"
},
"key": "a0247174622b4935b36232232ef129c5",
"model": "FLot",
"rules": [],
"dbFieldName": "FLot",
"dbFieldComment": "批号",
"dbTableName": "T_WMS_LableRule"
},
{
"label": "数量",
"type": "text",
"options": {
"defaultValue": "10000",
"visibility": [
"list_visible",
"form_visible"
],
"x": "20",
"y": "280"
},
"key": "9dd73ddb99f3449f8be4cdadddc24fad",
"model": "FQty",
"rules": [],
"dbFieldName": "FQty",
"dbFieldComment": "数量",
"dbTableName": "T_WMS_LableRule"
}
]
},
{
"span": 12,
"list": [
{
"label": "二维码",
"type": "qrcode",
"options": {
"defaultValue": "ZXCVBNM,,,,123456",
"visibility": [
"list_visible",
"form_visible"
],
"x": "340",
"y": "160"
},
"key": "3d2c4d94491c4f269b93064f7362125b",
"model": "FDimensionalCode",
"rules": [],
"dbFieldName": "FDimensionalCode",
"dbFieldComment": "二维码",
"dbTableName": "T_WMS_LableRule"
}
]
}
],
"options": {
"gutter": 0,
"justify": "start",
"align": "top"
},
"key": "dae5e3e88230400d8d253b04239cb4ca",
"model": "grid_dae5e3e88230400d8d253b04239cb4ca",
"rules": [],
"dbTableName": "T_WMS_LableRule"
}
]
}
\ No newline at end of file
<template> <template>
<headers :title="title" back-icon-name="nav-back" background="#3cbafd"/> <headers :title="title" back-icon-name="nav-back" background="#3cbafd" />
<form-list-item ref="formListRef" :business-list="businessList" /> <form-list-item ref="formListRef" :business-list="businessList" :printTemplateId="printTemplateId" />
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref } from 'vue' import { ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'; import { onLoad, onShow } from '@dcloudio/uni-app';
import { getBusinessList } from '@/api/apply' import { getBusinessList } from '@/api/apply'
import { useFormData } from '@/store/modules/formData';
import { sLoading, hLoading } from '@/utils/util' import { sLoading, hLoading } from '@/utils/util'
import headers from '@/components/header/index.vue' import headers from '@/components/header/index.vue'
import FormListItem from './components/FormListItem.vue'; import FormListItem from './components/FormListItem.vue';
const title = ref('') const title = ref('')
const store = useFormData()
const pageData = ref() const pageData = ref()
const formListRef = ref() const formListRef = ref()
const businessList = ref([] as any[]) const businessList = ref([] as any[])
const printTemplateId = ref()
onLoad(async () => { onLoad(async (options: any) => {
printTemplateId.value = options.printTemplateId
const { subSystem, permTag: formId } = JSON.parse(uni.getStorageSync('pageData')) const { subSystem, permTag: formId } = JSON.parse(uni.getStorageSync('pageData'))
const { data: res } = await getBusinessList({ formId, subSystem, mobile: true }) const { data: res } = await getBusinessList({ formId, subSystem, mobile: true })
sLoading() sLoading()
......
<template> <template>
<headers title='WMS工作台' background="#3cbafd"/> <headers title='WMS工作台' background="#3cbafd" />
<block v-for="res in menuList" :key="res.path"> <block v-for="res in menuList" :key="res.path">
<view class="card" v-show="res.children?.length"> <view class="card" v-show="res.children?.length">
<h4 class="card-text">{{ res.title }}</h4> <h4 class="card-text">{{ res.title }}</h4>
......
...@@ -23,6 +23,7 @@ import { ref, reactive } from 'vue' ...@@ -23,6 +23,7 @@ import { ref, reactive } from 'vue'
import { getBusinessList, changeDataById } from '@/api/apply'; import { getBusinessList, changeDataById } from '@/api/apply';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import { sLoading, hLoading } from '@/utils/util' import { sLoading, hLoading } from '@/utils/util'
import { useMenuSelection } from '@/store/modules/menuSelection';
import headers from '@/components/header/index.vue' import headers from '@/components/header/index.vue'
const listQuery = reactive({ const listQuery = reactive({
...@@ -35,6 +36,7 @@ const listQuery = reactive({ ...@@ -35,6 +36,7 @@ const listQuery = reactive({
total: 0, total: 0,
}) })
const menuSelection = useMenuSelection()
const fieldList = ref() const fieldList = ref()
const dataList = ref() const dataList = ref()
const optionsMenuId = ref() const optionsMenuId = ref()
...@@ -50,9 +52,10 @@ const optionsMenu = async (row: any) => { ...@@ -50,9 +52,10 @@ const optionsMenu = async (row: any) => {
const { data: res } = await changeDataById(data) const { data: res } = await changeDataById(data)
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
menuSelection.setMenuSelection(true)
menuSelection.setMenuSelectionData(res.data.data[0])
uni.navigateBack() uni.navigateBack()
} }
} }
} }
...@@ -94,7 +97,7 @@ const handleLoadData = (data: any) => { ...@@ -94,7 +97,7 @@ const handleLoadData = (data: any) => {
onLoad((option: any) => { onLoad((option: any) => {
const list = JSON.parse(decodeURIComponent(option.list)) const list = JSON.parse(decodeURIComponent(option.list))
console.log(list); // console.log(list);
optionsMenuId.value = list.id optionsMenuId.value = list.id
upFormId.value = list.upFormId upFormId.value = list.upFormId
init(list.upFormId) init(list.upFormId)
......
/**
* @brief 解析 单据头与单据体数据(扁平化处理)
* @param list[]
* @return { headerList , bodyList }
*/
export const documentFilter = (list: any) => {
const headerList: any[] = []; // 单据头数据
const bodyList: any[] = []; // 单据体数据
const bodyModel: any[] = []
const recursiveFilter = (item: any) => {
if (item.columns) {
item.columns[0].list.forEach((res: any) => {
bodyList.push(res);
});
}
if (item.detailColumns) {
item.detailColumns[0].list.forEach((res: any) => {
if (res.type === 'table') {
recursiveFilter(res);
} else if (res.type === 'grid') {
res.columns.forEach((col: any) => {
col.list.forEach((cols: any) => {
bodyList.push(cols);
});
});
} else if (res.type !== 'menu_bar') {
bodyList.push(res);
}
});
}
bodyList.push(item);
};
list.forEach((item: any) => {
if (item.type === 'table') {
bodyModel.push(item.model)
recursiveFilter(item);
}
else if (item.type === 'grid')
item.columns.forEach((col: any) => {
col.list.forEach((res: any) => {
headerList.push(res);
});
});
else if (item.type !== 'menu_bar') headerList.push(item);
});
return { headerList, bodyList, bodyModel }
};
/**
* @brief 获取移动端表单可见的值
* @param list[]
* @return { [mobileList] }
*/
export const filterList = (list: any[]) => {
let mobileList = [] as any[];
const recursiveFilter = (item: any) => {
if (item.columns)
item.columns[0].list.map((res: any) => {
if (
res.options.visibility &&
res.options.visibility.indexOf('mobile_form_visible') !== -1
)
mobileList = [...mobileList, res];
});
if (item.detailColumns)
item.detailColumns[0].list.forEach((res: any) => {
recursiveFilter(res);
});
if (
item.options.visibility &&
item.options.visibility.indexOf('mobile_form_visible') !== -1
)
mobileList = [...mobileList, item];
};
list.forEach(item => recursiveFilter(item));
return mobileList;
};
/**
* @brief 获取过滤表单的是否存在的值
* @param list[]
* @param FilterConditions 过滤条件 字符串类型
* @return { list }
*/
export const filterSpecified = (list: any[], FilterConditions: string) => {
return list.filter((item: any) => eval(FilterConditions))
}
export const baseDataFilter = (list: any[], baseList: any[]) => {
// console.log(list, baseList);
let mobileList = [] as any[];
let dataList = [] as any[];
const recursiveFilter = (item: any) => {
if (item.columns)
item.columns[0].list.map((res: any) => {
if (
res.type == 'basic_data' ||
res.type == 'basic_data_edit' &&
res.options.remoteFunc
)
mobileList = [...mobileList, res];
});
if (item.detailColumns)
item.detailColumns[0].list.forEach((res: any) => {
recursiveFilter(res);
});
if (
item.type == 'basic_data' ||
item.type == 'basic_data_edit' &&
item.options.remoteFunc
)
mobileList = [...mobileList, item];
};
list.forEach(item => recursiveFilter(item));
// console.log(mobileList, 'mobileList');
console.log(list, baseList);
for (const k in baseList) {
mobileList.map((item: any) => {
if (item.options.remoteFunc === k) {
let obj = {} as any
const label = item.options.props.label
const value = item.options.props.value
if (baseList[k].length && baseList[k][0][label]) obj['label'] = baseList[k][0][label]
if (baseList[k].length && baseList[k][0][value]) obj['value'] = baseList[k][0][value]
if (obj) dataList.push(obj)
}
})
}
return dataList
}
/**
* @brief 单据体model数据扁平化
* @param data[] 单据体model数据
* @param flattenedData {}
* @return { flattenedData }
*/
export const flattenData = (data: any[]) => {
let flattenedData: any = {};
const flattenObject = (obj: any) => {
const flattenedObj: any = {};
for (let key in obj) {
if (typeof obj[key] === 'object') {
const nestedObj = flattenObject(obj[key]);
for (let nestedKey in nestedObj) {
// flattenedObj[key + '.' + nestedKey] = nestedObj[nestedKey];
flattenedObj[nestedKey] = nestedObj[nestedKey];
}
} else {
flattenedObj[key] = obj[key];
}
}
return flattenedObj;
};
for (let item of data) {
flattenedData = { ...flattenedData, ...flattenObject(item) }
// flattenedData.push(flattenObject(item));
}
return flattenedData;
};
export const dataListFilter = (list: any[], obj: any) => {
let dataList = [] as any[]
list.map((item: any) => {
let dataObj = {} as any
for (const key in obj) {
if (item.model === key) {
dataObj['label'] = item.label + ':'
dataObj['value'] = obj[key]
}
}
if (JSON.stringify(dataObj) === '{}') {
dataObj['label'] = item.label + ':'
dataObj['value'] = ''
}
dataList.push(dataObj)
})
return dataList
}
export const mergeList = (list: any[]) => {
const { subSystem, permTag: formId } = JSON.parse(uni.getStorageSync('pageData'));
const data = {
formId,
subSystem,
list: [] as any
}
for (const item of list) {
let isAdded = false;
// 如果列表为空,则添加数据
if (data.list.length === 0) {
data.list.push(item);
continue;
}
for (const res of data.list) {
// 查找相同供应商ID的元素
if (res.FSupplyId === item.FSupplyId) {
for (const wms of res.WMS_InStockEntry) {
// 查找相同物料ID和批次号的元素
if (item.WMS_InStockEntry[0].FLot === wms.FLot &&
item.WMS_InStockEntry[0].FMaterialId === wms.FMaterialId) {
wms.WMS_InStockSERIAL.push(item.WMS_InStockEntry[0].WMS_InStockSERIAL[0]);
isAdded = true;
break;
}
}
// 如果没有找到相同物料ID和批次号的元素,则在其中新增一条数据
if (!isAdded) {
res.WMS_InStockEntry.push(item.WMS_InStockEntry[0]);
isAdded = true;
}
break;
}
}
// 如果列表中没有相同供应商ID的元素,则在其中新增一条数据
if (!isAdded) {
data.list.push(item);
}
}
return data;
}
\ No newline at end of file
...@@ -26,24 +26,11 @@ ...@@ -26,24 +26,11 @@
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref, computed } from 'vue'
import { useBlueTooths } from '@/tspl/blueTooth'; import { useBlueTooths } from '@/tspl/blueTooth';
import headers from '@/components/header/index.vue' import headers from '@/components/header/index.vue'
const { blueToothList, startSearch, chooseBluetooth, stopBluetoothDeviceDiscovery } = useBlueTooths() const { blueToothList, startSearch, chooseBluetooth, stopBluetoothDeviceDiscovery } = useBlueTooths()
// rssi范围
// const rssiRange = computed(() => {
// let rssiArr = [] as number[]
// demo.map((item: any) => {
// rssiArr.push(item.RSSI)
// })
// let maxNumber = Math.max.apply(null, rssiArr);
// let minNumber = Math.min.apply(null, rssiArr);
// console.log(rssiArr, maxNumber, minNumber);
// })
const clickCell = (deviceId: string) => { const clickCell = (deviceId: string) => {
chooseBluetooth(deviceId) chooseBluetooth(deviceId)
} }
......
...@@ -19,15 +19,15 @@ import headers from '@/components/header/index.vue' ...@@ -19,15 +19,15 @@ import headers from '@/components/header/index.vue'
const list = [{ const list = [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', image: 'https://img2.baidu.com/it/u=3313021461,2750855646&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
title: '昨夜星辰昨夜风,画楼西畔桂堂东' title: '昨夜星辰昨夜风,画楼西畔桂堂东'
}, },
{ {
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg', image: 'https://img0.baidu.com/it/u=613475666,1531838114&fm=253&fmt=auto&app=120&f=JPEG?w=642&h=500',
title: '身无彩凤双飞翼,心有灵犀一点通' title: '出入库管理系统与wms仓库管理系统的联系,区别|物流'
}, },
{ {
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg', image: 'https://img0.baidu.com/it/u=1239061214,527236417&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=286',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳' title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}] }]
const menuList = ref() const menuList = ref()
......
import { defineStore } from "pinia";
export const useMenuSelection = defineStore({
id: 'menuSelection',
state: () => ({
isMenuSelection: false, // 是否选单
menuSelectionData: {} // 选单选中的数据
}),
getters: {
menuSelectionDataGet: (state) => state.menuSelectionData
},
actions: {
// 设置选单的数据
setMenuSelectionData(menuSelectionData: any) {
this.menuSelectionData = menuSelectionData
},
setMenuSelection(isMenuSelection: boolean) {
this.isMenuSelection = isMenuSelection
}
}
})
\ No newline at end of file
...@@ -7,7 +7,7 @@ export const useGlobalStore = defineStore({ ...@@ -7,7 +7,7 @@ export const useGlobalStore = defineStore({
state() { state() {
return { return {
token: '', token: '',
statusBarHeight: 0 statusBarHeight: 0,
} }
}, },
getters: { getters: {
......
// 解析 单据头与单据体数据
export const documentFilter = (list: any) => {
const headerList: any[] = []; // 单据头数据
const bodyList: any[] = []; // 单据体数据
const recursiveFilter = (item: any) => {
if (item.columns) {
item.columns[0].list.forEach((res: any) => {
bodyList.push(res);
});
}
if (item.detailColumns) {
item.detailColumns[0].list.forEach((res: any) => {
if (res.type === 'table') {
recursiveFilter(res);
} else if (res.type === 'grid') {
res.columns.forEach((col: any) => {
col.list.forEach((cols: any) => {
bodyList.push(cols);
});
});
} else if (res.type !== 'menu_bar') {
bodyList.push(res);
}
});
}
bodyList.push(item);
};
list.forEach((item: any) => {
if (item.type === 'table') recursiveFilter(item);
else if (item.type === 'grid')
item.columns.forEach((col: any) => {
col.list.forEach((res: any) => {
headerList.push(res);
});
});
else if (item.type !== 'menu_bar') headerList.push(item);
});
console.log(headerList, bodyList);
return { headerList, bodyList }
};
\ No newline at end of file
...@@ -85,7 +85,7 @@ export const generateInstruct = (panels: any, blueTooth: any) => { ...@@ -85,7 +85,7 @@ export const generateInstruct = (panels: any, blueTooth: any) => {
command.setText(left, top, 'TSS24.BF2', 1, 1, `${hideTitle ? '' : title || ''}${!hideTitle && field ? ':' : ''}${testData || ''}`) command.setText(left, top, 'TSS24.BF2', 1, 1, `${hideTitle ? '' : title || ''}${!hideTitle && field ? ':' : ''}${testData || ''}`)
break; break;
case 'qrcode': case 'qrcode':
command.setQR(left, top, setLevel(qrCodeLevel), 7, 'A', testData) command.setQR(left, top, setLevel(qrCodeLevel), 4, 'A', testData)
break; break;
case 'barcode': case 'barcode':
command.setBarCode(left, top, '128', height, `${hideTitle ? 0 : 1}`, 2, 2, testData); command.setBarCode(left, top, '128', height, `${hideTitle ? 0 : 1}`, 2, 2, testData);
......
const CONFIG: any = { const CONFIG: any = {
// 开发环境配置 // 开发环境配置
development: { development: {
assetsPath: 'http://192.168.1.83', // 静态资源路径 assetsPath: 'http://192.168.1.156', // 静态资源路径
baseUrl: 'http://192.168.1.83', // 后台接口请求地址 baseUrl: 'http://192.168.1.156', // 后台接口请求地址
// baseUrl: 'http://192.168.0.8', // 后台接口请求地址 // baseUrl: 'http://192.168.0.8', // 后台接口请求地址
hostUrl: 'http://192.168.1.83', // H5地址(前端运行地址) hostUrl: 'http://192.168.1.156', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
}, },
// 生产环境配置 // 生产环境配置
......
/**
* @brief 提示框
* @param zconfirm('是否清除数据', (result: boolean) => {if (result) { 确认 } else { 取消 } })
* @return
*/
export const zconfirm = (msg: string, callBackFun?: any) => { export const zconfirm = (msg: string, callBackFun?: any) => {
uni.showModal({ uni.showModal({
content: msg, content: msg,
...@@ -10,6 +15,7 @@ export const zconfirm = (msg: string, callBackFun?: any) => { ...@@ -10,6 +15,7 @@ export const zconfirm = (msg: string, callBackFun?: any) => {
}, },
}) })
} }
export const zalert = (msg: string, callBackFun?: any) => { export const zalert = (msg: string, callBackFun?: any) => {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -22,6 +28,7 @@ export const zalert = (msg: string, callBackFun?: any) => { ...@@ -22,6 +28,7 @@ export const zalert = (msg: string, callBackFun?: any) => {
}, },
}) })
} }
export const toast = (msg: string) => { export const toast = (msg: string) => {
uni.showToast({ uni.showToast({
title: msg, title: msg,
......
...@@ -45,12 +45,12 @@ export default defineConfig({ ...@@ -45,12 +45,12 @@ export default defineConfig({
https: false, // 默认用http方式 https: false, // 默认用http方式
proxy: { proxy: {
'/lowcodeplatform-system': { '/lowcodeplatform-system': {
target: 'http://192.168.1.83', target: 'http://192.168.1.156',
// target: 'http://192.168.0.8', // target: 'http://192.168.1.27',
}, },
'/wms-system': { '/wms-system': {
target: 'http://192.168.1.83', target: 'http://192.168.1.156',
// target: 'http://192.168.0.8', // target: 'http://192.168.1.27',
}, },
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论