提交 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>
<vk-header :title="title" back-icon-name="nav-back" background="#3cbafd" /> <vk-header :title="title" back-icon-name="nav-back" background="#3cbafd" />
<!-- <button @tap="initSerialNumberData({ serialNumber: 'A087', curFormId: 'WMS_InStock' })">A087</button> --> <button @tap="handleInput">测试</button>
<view class="header"> <view class="header">
<view class="scan-input"> <view class="scan-input">
<scanInput :inputValue="inputValue" /> <scanInput :inputValue="inputValue" />
...@@ -23,38 +23,40 @@ ...@@ -23,38 +23,40 @@
<!-- rgb(218,222,224) --> <!-- rgb(218,222,224) -->
<view class="line" /> <view class="line" />
<view class="detail-content" v-for="(item, i) in list" :key="i"> <view class="detail">
<view v-show="item.show"> <view class="detail-content" v-for="(item, i) in list" :key="i">
<block v-for="res in item.dataList" :key="res.label"> <view v-show="item.show">
<view class="list"> <block v-for="res in item.dataList" :key="res.label">
<view class="label">{{ res.label }}</view> <view class="list">
<view class="value">{{ res.value }}</view> <view class="label">{{ res.label }}</view>
</view> <view class="value">{{ res.value }}</view>
</block> </view>
</view> </block>
<view class="footer"> </view>
<view> <view class="footer">
<view @tap=" <view>
() => { <view @tap="
item.show = !item.show; () => {
if (item.show) item.scanIcon = 'arrow-up-fill'; item.show = !item.show;
else item.scanIcon = 'arrow-down-fill'; if (item.show) item.scanIcon = 'arrow-up-fill';
} else item.scanIcon = 'arrow-down-fill';
"> }
<u-icon :name="item.scanIcon"></u-icon> ">
关闭扫描详情 <u-icon :name="item.scanIcon"></u-icon>
关闭扫描详情
</view>
</view> </view>
<view>未备够</view>
</view> </view>
<view>未备够</view>
</view>
<view class="close" @tap="closeButton(i)"> <view class="close" @tap="closeButton(i)">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<u-icon name="close" color="#2979ff" size="18" /> <u-icon name="close" color="#2979ff" size="18" />
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<u-icon name="close" color="#2979ff" size="30" /> <u-icon name="close" color="#2979ff" size="30" />
<!-- #endif --> <!-- #endif -->
</view>
</view> </view>
</view> </view>
...@@ -83,32 +85,45 @@ ...@@ -83,32 +85,45 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, ref } from 'vue'; import { nextTick, ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad, onShow } from '@dcloudio/uni-app';
import { import {
getMetadata, getMetadata,
getDataBySerialNumber, getDataBySerialNumber,
createBusiness,
getAnalysis, getAnalysis,
getRuleSelection getRuleSelection,
getDetailList,
createBusiness,
submitBusiness,
getEmptyList,
getBillBySerialNumber
} from '@/api/apply'; } from '@/api/apply';
import { useMenuSelection } from '@/store/modules/menuSelection';
import { documentFilter, filterSpecified, flattenData, dataListFilter, mergeList } from './unils/filters';
import { toast, zconfirm, sLoading, hLoading } from '@/utils/util'
import vkHeader from '@/components/header/index.vue'; import vkHeader from '@/components/header/index.vue';
import detailForm from './components/detailForm.vue'; import detailForm from './components/detailForm.vue';
import scanInput from './components/scanInput.vue'; import scanInput from './components/scanInput.vue';
import optionsMenuPopup from './components/optionsMenuPopup.vue'; import optionsMenuPopup from './components/optionsMenuPopup.vue';
const menuSelection = useMenuSelection()
const menuSelectionData: any = computed(() => menuSelection.menuSelectionDataGet)
const sheetShow = ref(false); const sheetShow = ref(false);
const optionsMenuShow = ref(false); const optionsMenuShow = ref(false);
const list = ref([] as any); const list = ref([] as any); // 展示的数据
const optionsMenuList = ref([] as any); const optionsMenuList = ref([] as any);
const optionsMenuRef = ref([] as any); const optionsMenuRef = ref([] as any);
const saveList = ref([] as any) const saveList = ref([] as any) // 后端合并需要传的数据
const idsBill = ref([] as any) // 扫描保存的ids 提交后端需要传的原始数据的id
const metadata = ref(); const metadata = ref();
const metadataList = ref([] as any); const metadataList = ref([] as any);
const documentBodyList = ref([] as any);
const documentBodyModel = ref();
const printTemplateId = ref() // 选择打印模板id
const pageData = ref(); const pageData = ref();
const title = ref(); const title = ref();
const inputValue = ref(''); const inputValue = ref('');
const sheetList = ref([{ text: '查询' }, { text: '清空' }, { text: '选单' }]); const sheetList = ref([{ text: '查询' }, { text: '清空' }, { text: '选单' }, { text: '暂存状态' }]);
const modelData = ref({ const modelData = ref({
content: '确认提交?', content: '确认提交?',
show: false, show: false,
...@@ -120,44 +135,64 @@ onLoad(() => { ...@@ -120,44 +135,64 @@ onLoad(() => {
init(); init();
}); });
const handleInput = async (e: any) => { onShow(() => {
let barcodeList = uni.getStorageSync('barcodeList') // 判断是否为选单状态
if (!barcodeList) { console.log(menuSelection.isMenuSelection, 'menuSelection', menuSelectionData.value);
barcodeList = [] if (menuSelection.isMenuSelection) {
const { data: res } = await getAnalysis({ billNo: e.split(',')[0] }) let obj: any = {
barcodeList.push({ list: res.data, number: e.split(',')[0] }) show: true,
uni.setStorageSync('barcodeList', JSON.stringify(barcodeList)); scanIcon: 'arrow-up-fill',
} else { // serialNumber: data.serialNumber,
barcodeList = JSON.parse(barcodeList) };
if (!barcodeList.some((item: any) => item.number == e.split(',')[0])) { addBusiness(pageData.value.permTag, menuSelectionData.value, obj)
}
})
// 扫码执行逻辑
const handleInput = async () => {
try {
let e: string = '004,001,2023-07-13T00:00:00,A6514,,A6513,10,'
sLoading()
let barcodeList = uni.getStorageSync('barcodeList')
// 获取条码信息
if (!barcodeList) {
barcodeList = []
const { data: res } = await getAnalysis({ billNo: e.split(',')[0] }) const { data: res } = await getAnalysis({ billNo: e.split(',')[0] })
barcodeList.push({ list: res.data, number: e.split(',')[0] }) barcodeList.push({ list: res.data, number: e.split(',')[0] })
uni.setStorageSync('barcodeList', JSON.stringify(barcodeList)); uni.setStorageSync('barcodeList', JSON.stringify(barcodeList));
} else {
barcodeList = JSON.parse(barcodeList)
if (!barcodeList.some((item: any) => item.number == e.split(',')[0])) {
const { data: res } = await getAnalysis({ billNo: e.split(',')[0] })
barcodeList.push({ list: res.data, number: e.split(',')[0] })
uni.setStorageSync('barcodeList', JSON.stringify(barcodeList));
}
} }
} // console.log(barcodeList, 'barcodeList');
// console.log(barcodeList, 'barcodeList'); let serialNumber = ''
let serialNumber = '' barcodeList.map((item: any) => {
// 取序列号的数据
barcodeList.map((item: any) => { if (item.number == e.split(',')[0]) {
if (item.number == e.split(',')[0]) { const index = item.list.filter((filt: any) => filt.field == 'FSerialID')[0]?.seq
const index = item.list.filter((filt: any) => filt.field == 'FSerialID')[0]?.seq if (index) serialNumber = e.split(',')[index]
if (index) serialNumber = e.split(',')[index] }
} })
}) nextTick(() => {
nextTick(() => { inputValue.value = e;
inputValue.value = e; });
}); const curFormId = pageData.value.permTag
const { permTag: curFormId } = JSON.parse(uni.getStorageSync('pageData')); let data = { serialNumber, curFormId }
let data = { serialNumber, curFormId } initSerialNumberData(data)
} catch (e) {
initSerialNumberData(data) //TODO handle the exception
} finally { hLoading() }
}; };
const sheetClick = (index: number) => { const sheetClick = (index: number) => {
switch (index) { switch (index) {
case 0: case 0:
console.log('查询'); uni.navigateTo({ url: '/pages/apply/formDataPage?printTemplateId=' + printTemplateId.value });
uni.navigateTo({ url: '/pages/apply/formDataPage' });
break; break;
case 1: case 1:
console.log('撤销'); console.log('撤销');
...@@ -166,219 +201,224 @@ const sheetClick = (index: number) => { ...@@ -166,219 +201,224 @@ const sheetClick = (index: number) => {
optionsMenu() optionsMenu()
optionsMenuShow.value = true optionsMenuShow.value = true
break; break;
// 暂存记录
case 3:
stagingState()
break;
} }
}; };
// 选单,相当于下推的某个前一个步骤 // 选单,相当于下推的某个前一个步骤
const optionsMenu = async () => { const optionsMenu = async () => {
const { permTag: formId } = JSON.parse(uni.getStorageSync('pageData')); const formId = pageData.value.permTag
const { data: res } = await getRuleSelection(formId) const { data: res } = await getRuleSelection(formId)
if (res.code === 200) { if (res.code === 200) {
console.log(res.data); // console.log(res.data);
optionsMenuList.value = res.data.records optionsMenuList.value = res.data.records
optionsMenuRef.value.radioValue = optionsMenuList.value[0]?.upFormId || '' optionsMenuRef.value.radioValue = optionsMenuList.value[0]?.upFormId || ''
} }
} }
const modelConfirm = async () => { // 查询本单暂存记录
if (saveList.value.length === 0) return uni.showToast({ const stagingState = async () => {
title: '请先完成扫描', sLoading();
icon: 'none' const formId = pageData.value.permTag;
}) let data = {
let list = JSON.parse(JSON.stringify(saveList.value)) formId,
const result = mergeList(list); filters: [{
const res: any = await createBusiness(result) field: "FBillStatus",
if (res.data.code === 200) { operation: "eq",
uni.showToast({ value: "1"
title: '提交成功', }]
icon: 'none' };
}) const { data: res } = await getDetailList(data);
uni.showModal({ if (res.code === 200) {
title: '提示', let promises: any = [];
content: '是否清除数据', for (const item of res.data.data) {
showCancel: true, const obj: any = {
success: ({ confirm, cancel }) => { show: true,
if (confirm) { scanIcon: "arrow-up-fill"
reset() };
idsBill.value.push(item.id)
documentBodyModel.value.forEach((model: string) => {
if (item.hasOwnProperty(model)) {
let models = item[model].length > 1 ? item[model] : [item[model]];
// console.log(models, 'models');
models.forEach((req: any, i: number) => {
const reqModelObj = flattenData([req]);
const dataList = dataListFilter(documentBodyList.value, reqModelObj);
obj.dataList = dataList;
let itemCopy = JSON.parse(JSON.stringify(item))
itemCopy[model] = [req]
promises.push(saveDataAndPushToList(itemCopy, { ...obj }));
});
} }
} });
}) }
await Promise.all(promises);
console.log(saveList.value);
await emptyFilter(formId)
hLoading();
} }
}; };
const mergeList = (list: any[]) => {
const { subSystem, permTag: formId } = JSON.parse(uni.getStorageSync('pageData')); // 保存下推
const data = { const modelConfirm = async () => {
if (saveList.value.length === 0) return toast('请先完成扫描')
const formId = pageData.value.permTag
let data = {
formId, formId,
subSystem, idsBill: idsBill.value,
list: [] as any operationKey: 'audit'
} }
for (const item of list) { const { data: res } = await submitBusiness(data)
let isAdded = false; if (res.code === 200) {
// 如果列表为空,则添加数据 toast('提交成功')
if (data.list.length === 0) { zconfirm('是否清除数据', (result: boolean) => {
data.list.push(item); if (result) reset()
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; };
}
/**
* @brief 添加内容列表界面
* @param curFormId 表单标识
* @param serialNumber 序列号
*/
const initSerialNumberData = async (data: any) => { const initSerialNumberData = async (data: any) => {
console.log(data, 'sss'); if (list.value.some((item: any) => item.serialNumber === data.serialNumber))
// let data = { serialNumber: 'A031', curFormId: 'WMS_InStock' } return toast('已存在该扫描记录');
if (list.value.some((item: any) => item.serialNumber === data.serialNumber)) return uni.showToast({
title: '已存在该扫描记录', const { data: resBill } = await getBillBySerialNumber({ billNo: data.serialNumber, formId: data.curFormId });
icon: 'none',
mask: true let dataList: any = [];
}) let requestData: any
const { data: res } = await getDataBySerialNumber(data); let obj: any = {
if (res.code === 200) { show: true,
const metaList = JSON.parse(JSON.stringify(metadata.value.list)); scanIcon: 'arrow-up-fill',
let dataList = baseDataFilter(metaList, res.data.baseDataMap) serialNumber: data.serialNumber,
let obj = { };
dataList, const formId = pageData.value.permTag
show: true,
scanIcon: 'arrow-up-fill', if (resBill.data) {
serialNumber: data.serialNumber requestData = resBill.data.data[0];
idsBill.value.push(requestData.id)
if (menuSelection.isMenuSelection && !isBillContentConsistent(requestData)) {
return toast('该单据内容不一致');
} }
if (dataList.length !== 0) {
list.value.push(obj) promiseAll(requestData, obj)
saveList.value.push(res.data.data[0]) } else {
const { data: res } = await getDataBySerialNumber(data);
if (menuSelection.isMenuSelection && !isBillContentConsistent(res.data.data[0])) {
return toast('该单据内容不一致');
} }
addBusiness(formId, res.data.data[0], obj)
} }
};
const init = async () => { // 更新单据头数据
metadataList.value = []; metadataList.value.map((item: any) => {
const { data: res } = await getMetadata(pageData.value.permTag); const has = requestData.hasOwnProperty(item.model)
if (res.code === 200) { if (has) item.options.defaultValue = requestData[item.model]
metadata.value = JSON.parse(res.data.formJson); })
const list = JSON.parse(JSON.stringify(metadata.value.list));
await filterList(list).forEach((item: any) => { if (dataList.length) emptyFilter(formId, data);
if (item.columns) metadataList.value = [...metadataList.value, ...item.columns[0].list];
if (item.detailColumns)
item.detailColumns[0].list.forEach((res: any) => {
if (res.columns)
metadataList.value = [...metadataList.value, ...res.columns[0].list];
if (res.detailColumns)
item.columns[0].list.forEach((res1: any) => {
if (res1.columns)
metadataList.value = [
...metadataList.value,
...res1.columns[0].list,
];
});
});
if (!item.columns && !item.detailColumns)
metadataList.value = [...metadataList.value, item];
});
// console.log(metadataList.value);
}
}; };
const filterList = (list: any[]) => { const saveDataAndPushToList = async (data: any, obj: any) => {
let mobileList = [] as any[]; list.value.push(obj); // 展示的数据
const recursiveFilter = (item: any) => { saveList.value.push(data); // 后端合并需要传的数据
if (item.columns) // console.log(saveList.value, 'saveList.value');
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) => { const isBillContentConsistent = (requestData: any) => {
recursiveFilter(res); for (const key in requestData) {
}); if (typeof requestData[key] !== 'object' && requestData[key] != menuSelectionData.value[key])
return false;
}
return true;
}
if ( const addBusiness = async (formId: string, list: any[], obj: any) => {
item.options.visibility && const saveData = {
item.options.visibility.indexOf('mobile_form_visible') !== -1 formId,
) list,
mobileList = [...mobileList, item]; }
}; const { data: res } = await createBusiness(saveData);
list.forEach(item => recursiveFilter(item)); idsBill.value.push(res.data)
return mobileList; promiseAll(res.data, obj)
}; }
const baseDataFilter = (list: any[], baseList: any[]) => { const promiseAll = async (requestData: any, obj: any) => {
console.log(list, baseList); let promises: any = []
documentBodyModel.value.forEach((model: string) => {
let mobileList = [] as any[]; if (requestData.hasOwnProperty(model)) {
let dataList = [] as any[]; let models = requestData[model].length > 1 ? requestData[model] : [requestData[model]];
const recursiveFilter = (item: any) => { models.forEach((req: any) => {
if (item.columns) const reqModelObj = flattenData([req]);
item.columns[0].list.map((res: any) => { const dataList = dataListFilter(documentBodyList.value, reqModelObj);
if ( obj.dataList = dataList;
res.type == 'basic_data' || let itemCopy = JSON.parse(JSON.stringify(requestData))
res.type == 'basic_data_edit' && itemCopy[model] = [req]
res.options.remoteFunc promises.push(saveDataAndPushToList(itemCopy, { ...obj }));
)
mobileList = [...mobileList, res];
}); });
}
});
await Promise.all(promises);
}
if (item.detailColumns) // 合并展示数量接口
item.detailColumns[0].list.forEach((res: any) => { const emptyFilter = async (formId: string, data?: any) => {
recursiveFilter(res); if (saveList.value.length > 1) {
let emptyData = {
formId,
list: saveList.value
}
// 合并数量
const { data: empty } = await getEmptyList(emptyData)
list.value = []
let modelObj: any
if (typeof empty.data === 'object') empty.data = [empty.data]
empty.data.map((em: any) => {
let emptyObj = {
show: true,
scanIcon: 'arrow-up-fill',
} as any
documentBodyModel.value.map((model: string) => {
if (em.hasOwnProperty(model)) {
modelObj = { ...modelObj, ...flattenData(em[model]) };
}
}); });
// console.log(modelObj, 'modelObj');
if ( emptyObj.dataList = dataListFilter(documentBodyList.value, modelObj)
item.type == 'basic_data' || list.value.push(emptyObj)
item.type == 'basic_data_edit' &&
item.options.remoteFunc
)
mobileList = [...mobileList, item];
};
list.forEach(item => recursiveFilter(item));
console.log(mobileList, 'mobileList');
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)
}
}) })
console.log(empty, 'empty');
} }
return dataList
} }
// 初始化数据
const init = async () => {
const { data: res } = await getMetadata(pageData.value.permTag);
if (res.code === 200) {
metadata.value = JSON.parse(res.data.formJson);
const list = JSON.parse(JSON.stringify(metadata.value.list));
printTemplateId.value = metadata.value.config?.printTemplate
const { headerList, bodyList, bodyModel } = documentFilter(list)
documentBodyModel.value = bodyModel
metadataList.value = filterSpecified(headerList, "item.options.visibility && item.options.visibility.indexOf('mobile_form_visible') !== -1")
documentBodyList.value = filterSpecified(bodyList, "item.options.visibility && item.options.visibility.indexOf('mobile_form_visible') !== -1")
}
};
const closeButton = (index: number) => { const closeButton = (index: number) => {
list.value.splice(index, 1) list.value.splice(index, 1)
saveList.value.splice(index, 1) saveList.value.splice(index, 1)
idsBill.value.splice(index, 1)
} }
const radioConfirm = (upFormId: string) => { const radioConfirm = (upFormId: string) => {
...@@ -424,68 +464,74 @@ const reset = () => { ...@@ -424,68 +464,74 @@ const reset = () => {
background: linear-gradient(#cccccc, #cccccc08, #cccccc); background: linear-gradient(#cccccc, #cccccc08, #cccccc);
} }
.detail-content { .detail {
position: relative; padding-bottom: 40px;
margin: 20rpx;
background-color: rgb(218, 222, 224);
padding: 30rpx;
border-radius: 5rpx;
.list { .detail-content {
display: flex; position: relative;
flex-direction: row; margin: 20rpx;
padding: 10rpx 0; background-color: rgb(218, 222, 224);
padding: 30rpx;
border-radius: 5rpx;
.list {
display: flex;
flex-direction: row;
padding: 10rpx 0;
.label { .label {
width: 200rpx;
text-align: right;
margin-right: 20rpx;
}
.value {}
}
.label1 {
width: 200rpx; width: 200rpx;
text-align: right; text-align: right;
margin-right: 20rpx; padding: 10rpx 0;
} }
.value {} .specifications {
} width: 100%;
display: flex;
flex-direction: row;
.label1 { .list {
width: 200rpx; display: flex;
text-align: right; flex-direction: row;
padding: 10rpx 0; }
}
.specifications { .label {
width: 100%; width: 165rpx;
display: flex; text-align: right;
flex-direction: row; }
.list { .list:nth-last-child(1) .value {
display: flex; color: rgb(0, 31, 158);
flex-direction: row; font-weight: 500;
}
} }
.label { .footer {
width: 165rpx; display: flex;
text-align: right; justify-content: space-around;
color: rgb(0, 31, 158);
font-weight: 900;
padding: 10rpx 0;
} }
.list:nth-last-child(1) .value { .close {
color: rgb(0, 31, 158); position: absolute;
font-weight: 500; top: 4rpx;
right: 12rpx;
} }
} }
}
.footer {
display: flex;
justify-content: space-around;
color: rgb(0, 31, 158);
font-weight: 900;
padding: 10rpx 0;
}
.close {
position: absolute;
top: 4rpx;
right: 12rpx;
}
}
.footer-form { .footer-form {
box-sizing: border-box; box-sizing: border-box;
...@@ -494,6 +540,8 @@ const reset = () => { ...@@ -494,6 +540,8 @@ const reset = () => {
z-index: 999; z-index: 999;
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
max-height: 600rpx;
overflow-y: scroll;
} }
.aside-save { .aside-save {
......
<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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论