Compare commits
2 Commits
26fcb18746
...
b099b45466
| Author | SHA1 | Date | |
|---|---|---|---|
| b099b45466 | |||
| 5ca85c1f0d |
35
api/declaration.js
Normal file
35
api/declaration.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { request } from "./request";
|
||||||
|
// 新建:
|
||||||
|
const addDeclareBill = (params) => {
|
||||||
|
return request("/worn/declareBill/add", params, "POST");
|
||||||
|
};
|
||||||
|
// 列表
|
||||||
|
const declareList = (params) => {
|
||||||
|
return request("/worn/declareBill/list", params, "get");
|
||||||
|
};
|
||||||
|
// 物资查询
|
||||||
|
const stockList = (params) => {
|
||||||
|
return request("/worn/statistics/stock/list", params, "get");
|
||||||
|
};
|
||||||
|
// http://192.168.1.9:8081/worn/aging/stock/list?warehouseCode=101&keyword=蓄电池
|
||||||
|
// 详情
|
||||||
|
const declareBillDetail = (params) => {
|
||||||
|
return request("/worn/declareBill/detail", params, "get");
|
||||||
|
};
|
||||||
|
// 编辑
|
||||||
|
const declareBillUpdate = (params) => {
|
||||||
|
return request("/worn/declareBill/update", params, "put");
|
||||||
|
};
|
||||||
|
// 作废
|
||||||
|
const declareBillVoid = (params) => {
|
||||||
|
return request(`/worn/declareBill/cancel/${params.id}`, params, "put");
|
||||||
|
};
|
||||||
|
|
||||||
|
export {
|
||||||
|
addDeclareBill,
|
||||||
|
declareList,
|
||||||
|
declareBillDetail,
|
||||||
|
declareBillVoid,
|
||||||
|
declareBillUpdate,
|
||||||
|
stockList,
|
||||||
|
};
|
||||||
50
api/home.js
Normal file
50
api/home.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { request } from "./request";
|
||||||
|
// 新建:
|
||||||
|
const addDeclareBill = (params) => {
|
||||||
|
return request("/worn/declareBill/add", params, "POST");
|
||||||
|
};
|
||||||
|
// 当前用户仓库列表
|
||||||
|
const warehouseList = (params) => {
|
||||||
|
return request("/home/warehouse/list", params, "get");
|
||||||
|
};
|
||||||
|
const listMqttDevice = (params) => {
|
||||||
|
return request("/worn/mqttDevice/list", params, "get");
|
||||||
|
};
|
||||||
|
const listMqttData = (params) => {
|
||||||
|
return request("/worn/mqttData/list", params, "get");
|
||||||
|
};
|
||||||
|
const listMqttEvent = (params) => {
|
||||||
|
return request("/worn/mqttEvent/list", params, "get");
|
||||||
|
};
|
||||||
|
// 智能排风远程开关
|
||||||
|
const controlSocket = (data) => {
|
||||||
|
const payload = {
|
||||||
|
devEui: data.devEui,
|
||||||
|
deviceId: data.deviceId,
|
||||||
|
status: data.status,
|
||||||
|
};
|
||||||
|
return request(`/worn/socket/control?devEui=${payload.devEui}&deviceId=${payload.deviceId}&status=${payload.status}`, payload, "post");
|
||||||
|
};
|
||||||
|
|
||||||
|
// 智慧照明开关远程控制
|
||||||
|
const controlLightSwitch = (data) => {
|
||||||
|
const payload = {
|
||||||
|
devEui: data.devEui,
|
||||||
|
channel: data.channel,
|
||||||
|
status: data.status,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
`/worn/socket/switch?devEui=${payload.devEui}&channel=${payload.channel}&status=${payload.status}`,
|
||||||
|
payload,
|
||||||
|
"post",
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export {
|
||||||
|
warehouseList,
|
||||||
|
controlLightSwitch,
|
||||||
|
listMqttDevice,
|
||||||
|
listMqttData,
|
||||||
|
listMqttEvent,
|
||||||
|
controlSocket,
|
||||||
|
};
|
||||||
6
api/inventoryInfo.js
Normal file
6
api/inventoryInfo.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { request } from "./request";
|
||||||
|
//库龄查看
|
||||||
|
const inventoryList = (params) => {
|
||||||
|
return request("/worn/statistics/aging/list", params, "get");
|
||||||
|
};
|
||||||
|
export { inventoryList };
|
||||||
10
api/report.js
Normal file
10
api/report.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { request } from "./request";
|
||||||
|
// 日报月报
|
||||||
|
const dailyReportList = (params) => {
|
||||||
|
return request("/worn/statistics/dailyReport", params, "post");
|
||||||
|
};
|
||||||
|
// 公司库存报表
|
||||||
|
const companyStockReportList = (params) => {
|
||||||
|
return request("/worn/statistics/companyStockReport/list", params, "get");
|
||||||
|
};
|
||||||
|
export { dailyReportList, companyStockReportList };
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//存放主站域名
|
//存放主站域名
|
||||||
// const BASE_URL = 'http://192.168.1.5:8082' // w
|
// const BASE_URL = 'http://192.168.1.5:8081' // w
|
||||||
const BASE_URL = "http://192.168.1.9:8082"; // yx
|
const BASE_URL = "http://192.168.1.9:8081"; // yx
|
||||||
// const BASE_URL = 'http://47.100.212.83:18088' // 正式环境接口
|
// const BASE_URL = 'http://47.100.212.83:18088' // 正式环境接口
|
||||||
// const BASE_URL = 'http://192.168.1.9:8088' // 测试环境接口
|
// const BASE_URL = 'http://192.168.1.9:8088' // 测试环境接口
|
||||||
// const BASE_URL = 'http://192.168.1.5:8088' // 测试环境接口
|
// const BASE_URL = 'http://192.168.1.5:8088' // 测试环境接口
|
||||||
@@ -274,12 +274,13 @@ const uploadMultipleFiles = async (
|
|||||||
success: (res) => {
|
success: (res) => {
|
||||||
try {
|
try {
|
||||||
const result = JSON.parse(res.data);
|
const result = JSON.parse(res.data);
|
||||||
console.log("成功,", res);
|
console.log("成功,", result, res);
|
||||||
if (result.code === 200 && result.data?.url) {
|
if (result.code === 200 && result.data?.fileUrlList[0].url) {
|
||||||
resolve({
|
resolve({
|
||||||
index, // 保留原文件在数组中的索引(方便对应)
|
index, // 保留原文件在数组中的索引(方便对应)
|
||||||
file, // 原始文件信息
|
// file, // 原始文件信息
|
||||||
url: result.data.url, // 上传后的 URL
|
url: result.data.fileUrlList[0].url,
|
||||||
|
name: result.data.fileUrlList[0].name,
|
||||||
success: true,
|
success: true,
|
||||||
error: null,
|
error: null,
|
||||||
});
|
});
|
||||||
@@ -338,15 +339,18 @@ const uploadMultipleFiles = async (
|
|||||||
url: BASE_URL + url,
|
url: BASE_URL + url,
|
||||||
filePath: currentFile,
|
filePath: currentFile,
|
||||||
name: "file",
|
name: "file",
|
||||||
|
formData,
|
||||||
header,
|
header,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
const result = JSON.parse(res.data);
|
||||||
|
console.log("成功1,", result, res);
|
||||||
try {
|
try {
|
||||||
const result = JSON.parse(res.data);
|
if (result.code === 200 && result.data?.fileUrlList[0].url) {
|
||||||
if (result.code === 200 && result.data?.url) {
|
|
||||||
uploadResults.push({
|
uploadResults.push({
|
||||||
index,
|
index,
|
||||||
file: currentFile,
|
// file: currentFile,
|
||||||
url: result.data.fileUrlList[0].url,
|
url: result.data.fileUrlList[0].url,
|
||||||
|
name: result.data.fileUrlList[0].name,
|
||||||
success: true,
|
success: true,
|
||||||
error: null,
|
error: null,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { request, Upload,uploadMultipleFiles } from "./request";
|
import { request, Upload, uploadMultipleFiles } from "./request";
|
||||||
const api = "/worn/outboundBill/";
|
const api = "/worn/outboundBill/";
|
||||||
// 新建:出库单
|
// 新建:出库单
|
||||||
const addStockOut = (params) => {
|
const addStockOut = (params) => {
|
||||||
@@ -29,9 +29,21 @@ const addWithFiles = (params) => {
|
|||||||
const myList = (params) => {
|
const myList = (params) => {
|
||||||
return request("/worn/appraisal/myList", params, "get");
|
return request("/worn/appraisal/myList", params, "get");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 技术鉴定表
|
||||||
|
const deleteAppraisal = (params) => {
|
||||||
|
console.log(params,params);
|
||||||
|
|
||||||
|
return request(`/worn/appraisal/${params.id}`, params, "delete");
|
||||||
|
};
|
||||||
// 上传图片
|
// 上传图片
|
||||||
const uploadTechnicalFile = (files, formData) => {
|
const uploadTechnicalFile = (files, formData) => {
|
||||||
return uploadMultipleFiles("/worn/technicalFile/upload", files, formData,true);
|
return uploadMultipleFiles(
|
||||||
|
"/worn/technicalFile/upload",
|
||||||
|
files,
|
||||||
|
formData,
|
||||||
|
true,
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@@ -42,5 +54,6 @@ export {
|
|||||||
outBoundFinish,
|
outBoundFinish,
|
||||||
addWithFiles,
|
addWithFiles,
|
||||||
uploadTechnicalFile,
|
uploadTechnicalFile,
|
||||||
myList
|
myList,
|
||||||
|
deleteAppraisal,
|
||||||
};
|
};
|
||||||
|
|||||||
151
pages.json
151
pages.json
@@ -26,7 +26,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/intelligent/index",
|
"path": "pages/intelligent/index",
|
||||||
"style": { "navigationBarTitleText": "智能"}
|
"style": { "navigationBarTitleText": "智能" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/my/index",
|
"path": "pages/my/index",
|
||||||
@@ -66,56 +66,111 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/components/EquipmentInfo",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "设备详情",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// "path": "pages/uniqueCode/bindRfid",
|
// "path": "pages/uniqueCode/bindRfid",
|
||||||
// "style": { "navigationBarTitleText": "绑定RFID" }
|
// "style": { "navigationBarTitleText": "绑定RFID" }
|
||||||
// },
|
// },
|
||||||
|
|
||||||
// ========== 库存信息模块 ==========
|
// ========== 库存信息模块 ==========
|
||||||
// {
|
{
|
||||||
// "path": "pages/inventory/checkUniqueCode",
|
"path": "pages/warehousing/InventoryInfo/checkUniqueCode",
|
||||||
// "style": { "navigationBarTitleText": "唯一码盘点" }
|
"style": { "navigationBarTitleText": "唯一码盘点" }
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// "path": "pages/inventory/age",
|
"path": "pages/warehousing/InventoryInfo/inventoryAgeView",
|
||||||
// "style": { "navigationBarTitleText": "库龄查看" }
|
"style": {
|
||||||
// },
|
"navigationBarTitleText": "库龄查看",
|
||||||
// {
|
"navigationStyle": "custom"
|
||||||
// "path": "pages/inventory/alert",
|
}
|
||||||
// "style": { "navigationBarTitleText": "库存预警" }
|
},
|
||||||
// },
|
{
|
||||||
|
"path": "pages/warehousing/InventoryInfo/alert",
|
||||||
|
"style": { "navigationBarTitleText": "库存预警" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/InventoryInfo/components/inventoryAgeDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "库存库龄查看",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// ========== 报表模块 ==========
|
// ========== 报表模块 ==========
|
||||||
// {
|
{
|
||||||
// "path": "pages/report/daily",
|
"path": "pages/warehousing/report/daily",
|
||||||
// "style": { "navigationBarTitleText": "库存日报" }
|
"style": { "navigationBarTitleText": "库存日报" }
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// "path": "pages/report/monthly",
|
"path": "pages/warehousing/Report/monthly",
|
||||||
// "style": { "navigationBarTitleText": "库存月报" }
|
"style": { "navigationBarTitleText": "库存月报" }
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// "path": "pages/report/company",
|
"path": "pages/warehousing/Report/company",
|
||||||
// "style": { "navigationBarTitleText": "公司库存报表" }
|
"style": { "navigationBarTitleText": "公司库存报表" }
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// "path": "pages/report/warehouse",
|
"path": "pages/warehousing/Report/warehouse",
|
||||||
// "style": { "navigationBarTitleText": "仓库库存报表" }
|
"style": { "navigationBarTitleText": "仓库库存报表" }
|
||||||
// },
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Report/components/dailyDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "库存日报",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Report/components/monthlyDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "库存月报",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Report/components/warehouseDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "仓库库存报表",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// ========== 申报单模块 ==========
|
// ========== 申报单模块 ==========
|
||||||
// {
|
{
|
||||||
// "path": "pages/declaration/materialQuery",
|
"path": "pages/warehousing/Declaration/materialQuery",
|
||||||
// "style": { "navigationBarTitleText": "物资查询" }
|
"style": { "navigationBarTitleText": "物资查询" }
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// "path": "pages/declaration/create",
|
"path": "pages/warehousing/Declaration/create",
|
||||||
// "style": { "navigationBarTitleText": "申报单开单" }
|
"style": {
|
||||||
// },
|
"navigationBarTitleText": "申报单开单",
|
||||||
// {
|
"navigationStyle": "custom"
|
||||||
// "path": "pages/declaration/my",
|
}
|
||||||
// "style": { "navigationBarTitleText": "我的申报单" }
|
},
|
||||||
// },
|
{
|
||||||
|
"path": "pages/warehousing/Declaration/my",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的申报单",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Declaration/components/detail",
|
||||||
|
"style": { "navigationBarTitleText": "详情", "navigationStyle": "custom" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Declaration/components/materialQueryDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "物资详情",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// ========== 入库单模块 ==========
|
// ========== 入库单模块 ==========
|
||||||
{
|
{
|
||||||
@@ -196,6 +251,20 @@
|
|||||||
"navigationBarTitleText": "我提交的技术鉴定表",
|
"navigationBarTitleText": "我提交的技术鉴定表",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Transport/checkIn",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "运输打卡",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/warehousing/Transport/my",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的运输打卡",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- 仓库/存储区选择 -->
|
<!-- 仓库/存储区选择 -->
|
||||||
<template>
|
<template>
|
||||||
<navigation :title="isWarehousing.value ? '仓库选择' : '存储区选择'" :back-url="backUrl"></navigation>
|
<navigation :title="title" :back-url="backUrl"></navigation>
|
||||||
|
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<view class="topSearch">
|
<view class="topSearch">
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<!-- 仓库/存储列表 -->
|
<!-- 仓库/存储列表 -->
|
||||||
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getList">
|
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getList">
|
||||||
<uni-list class="listBox">
|
<uni-list class="listBox">
|
||||||
<uni-list-item v-for="item in infoList" :key="item.id" clickable @click="onChecked(item)">
|
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<view style="display: flex; flex-direction: column; width: 100%;" v-if="isWarehousing">
|
<view style="display: flex; flex-direction: column; width: 100%;" v-if="isWarehousing">
|
||||||
<view class="line title">
|
<view class="line title">
|
||||||
@@ -34,8 +34,8 @@
|
|||||||
<view class="line content">
|
<view class="line content">
|
||||||
<p>备注</p>
|
<p>备注</p>
|
||||||
<p>
|
<p>
|
||||||
<span v-if="item?.remark"></span>
|
<text v-if="item?.remark"></text>
|
||||||
<span v-else class="empty">未填写</span>
|
<text v-else class="empty">未填写</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -46,8 +46,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="line content">
|
<view class="line content">
|
||||||
<p>
|
<p>
|
||||||
<span v-if="item?.remark">{{ item?.remark }}</span>
|
<text v-if="item?.remark">{{ item?.remark }}</text>
|
||||||
<span v-else class="empty">未填写</span>
|
<text v-else class="empty">未填写</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -58,14 +58,36 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, toRefs } from 'vue';
|
import { ref, toRefs } from 'vue';
|
||||||
import { onShow } from "@dcloudio/uni-app";
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
import { getWarehousingInfo } from '@/api/system';
|
import { getWarehousingInfo } from '@/api/system';
|
||||||
import getRepository from "@/api/getRepository";
|
import getRepository from "@/api/getRepository";
|
||||||
import { objectToQuery } from '../until';
|
import { objectToQuery } from '../until';
|
||||||
import Navigation from '../components/Navigation.vue';
|
import Navigation from '../components/Navigation.vue';
|
||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
|
const OPERATE_CONFIG = {
|
||||||
|
materialQuery: {
|
||||||
|
toCheckUrl: '/pages/warehousing/Declaration/components/materialQueryDetail',
|
||||||
|
title: '请选择物资查询仓库',
|
||||||
|
},
|
||||||
|
inventoryAgeView: {
|
||||||
|
toCheckUrl: '/pages/warehousing/InventoryInfo/components/inventoryAgeDetail',
|
||||||
|
title: '请选择物资库龄查询仓库'
|
||||||
|
},
|
||||||
|
dailyReport: {
|
||||||
|
toCheckUrl: '/pages/warehousing/Report/components/dailyDetail',
|
||||||
|
title: '请选择查看日报表的仓库'
|
||||||
|
},
|
||||||
|
monthlyReport: {
|
||||||
|
toCheckUrl: '/pages/warehousing/Report/components/monthlyDetail',
|
||||||
|
title: '请选择查看月报表的仓库'
|
||||||
|
},
|
||||||
|
warehouseReport: {
|
||||||
|
toCheckUrl: '/pages/warehousing/Report/components/warehouseDetail',
|
||||||
|
title: '请选择查看库存的仓库'
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 是否为仓库查询
|
// 是否为仓库查询
|
||||||
isWarehousing: {
|
isWarehousing: {
|
||||||
@@ -85,9 +107,8 @@ const { isWarehousing, pathParams } = toRefs(props)
|
|||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
keyword: ''
|
keyword: ''
|
||||||
})
|
})
|
||||||
|
const title = ref('')
|
||||||
const backUrl = ref('')
|
const backUrl = ref('')
|
||||||
// stockIn 入库单开单 stockIn_Detail入库单编辑 issueUniqueCode唯一码 issueUniqueCode_inbound入库生成唯一码
|
|
||||||
const keyType = computed(() => pathParams.value.type || pathParams.value.back)
|
|
||||||
// 绑定:加载屏
|
// 绑定:加载屏
|
||||||
const pagingRef = ref(null)
|
const pagingRef = ref(null)
|
||||||
// 数据:仓库/存储区
|
// 数据:仓库/存储区
|
||||||
@@ -115,6 +136,7 @@ const getWarehousing = () => {
|
|||||||
res.data.forEach(e => {
|
res.data.forEach(e => {
|
||||||
e.showMore = false;
|
e.showMore = false;
|
||||||
});
|
});
|
||||||
|
infoList.value = res.data
|
||||||
pagingRef.value.complete(res.data)
|
pagingRef.value.complete(res.data)
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
pagingRef.value.complete(false)
|
pagingRef.value.complete(false)
|
||||||
@@ -126,6 +148,7 @@ const getRepositoryInfo = async () => {
|
|||||||
res.data.forEach(e => {
|
res.data.forEach(e => {
|
||||||
e.showMore = false;
|
e.showMore = false;
|
||||||
});
|
});
|
||||||
|
infoList.value = res.data
|
||||||
pagingRef.value.complete(res.data)
|
pagingRef.value.complete(res.data)
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
pagingRef.value.complete(false)
|
pagingRef.value.complete(false)
|
||||||
@@ -136,10 +159,12 @@ const getRepositoryInfo = async () => {
|
|||||||
const toBack = (keyType) => {
|
const toBack = (keyType) => {
|
||||||
console.log('监听', keyType);
|
console.log('监听', keyType);
|
||||||
let url = ''
|
let url = ''
|
||||||
|
let query = objectToQuery(pathParams.value)
|
||||||
switch (keyType) {
|
switch (keyType) {
|
||||||
case 'stockIn':
|
case 'stockIn':
|
||||||
// 入库单开单
|
// 入库单开单
|
||||||
url = '/pages/warehousing/stockIn/create'
|
url = '/pages/warehousing/stockIn/create'
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'stockOut':
|
case 'stockOut':
|
||||||
// 出库单开单
|
// 出库单开单
|
||||||
@@ -149,45 +174,75 @@ const toBack = (keyType) => {
|
|||||||
// 出库单出库
|
// 出库单出库
|
||||||
url = '/pages/warehousing/stockOut/components/outAway'
|
url = '/pages/warehousing/stockOut/components/outAway'
|
||||||
break;
|
break;
|
||||||
|
case 'my':
|
||||||
|
// 出库单出库
|
||||||
|
url = '/pages/warehousing/stockIn/create'
|
||||||
|
break;
|
||||||
|
case 'materialQuery':
|
||||||
|
// 物资查询
|
||||||
|
url = 'pages/warehousing/index'
|
||||||
|
query = ''
|
||||||
|
break;
|
||||||
|
case 'inventoryAgeView':
|
||||||
|
// 库龄
|
||||||
|
url = 'pages/warehousing/index'
|
||||||
|
query = ''
|
||||||
|
break;
|
||||||
|
case 'dailyReport':
|
||||||
|
// 日报
|
||||||
|
query = ''
|
||||||
|
url = 'pages/warehousing/index'
|
||||||
|
break;
|
||||||
|
case 'monthlyReport':
|
||||||
|
// 月报
|
||||||
|
query = ''
|
||||||
|
url = 'pages/warehousing/index'
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
url = 'pages/warehousing/index';
|
||||||
|
query = '';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
backUrl.value = query ? `${url}${query}` : url
|
||||||
const query = objectToQuery(pathParams.value)
|
|
||||||
backUrl.value = `${url}${query}`
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 选择:仓库/存储区
|
// 选择:仓库/存储区
|
||||||
const onChecked = (val) => {
|
const onChecked = (val) => {
|
||||||
const flag = isWarehousing.value ? 'app_warehousing' : 'app_storageArea'
|
const toUrl = OPERATE_CONFIG?.[pathParams.value?.type]?.toCheckUrl;
|
||||||
let infoChecked = uni.getStorageSync(flag);
|
let params = val.materialId ? { warehouseCode: val.deptId, materialId: val.materialId } : { warehouseCode: val.deptId }
|
||||||
if (!Array.isArray(infoChecked)) {
|
if (pathParams.value.type === 'warehouseReport') {
|
||||||
infoChecked = [];
|
params.title = val.deptName
|
||||||
|
}
|
||||||
|
const query = objectToQuery(params);
|
||||||
|
if (toUrl) {
|
||||||
|
uni.navigateTo({ url: toUrl + query });
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const flag = isWarehousing.value ? "app_warehousing" : "app_storageArea";
|
||||||
|
let infoChecked = uni.getStorageSync(flag) || [];
|
||||||
|
if (!Array.isArray(infoChecked)) infoChecked = [];
|
||||||
if (val) {
|
if (val) {
|
||||||
infoChecked = [{ ...val }]
|
infoChecked = [{ ...val }];
|
||||||
uni.setStorageSync(flag, infoChecked);
|
uni.setStorageSync(flag, infoChecked);
|
||||||
}
|
}
|
||||||
|
uni.navigateTo({ url: backUrl.value });
|
||||||
// 返回list
|
};
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: backUrl.value
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
// 监听:确保 pathParams 变化时一定执行 toBack()
|
|
||||||
watch(
|
watch(
|
||||||
() => pathParams.value,
|
() => pathParams.value,
|
||||||
(d) => {
|
(d) => {
|
||||||
console.log('pathParams 变化:', d);
|
if (!d) return;
|
||||||
if (!d) return
|
|
||||||
const type = d.type || d.back;
|
const type = d.type || d.back;
|
||||||
console.log(type, 'eeeeeee');
|
const titleStr = OPERATE_CONFIG?.[d.type]?.title;
|
||||||
|
if (titleStr) {
|
||||||
toBack(type)
|
title.value = titleStr;
|
||||||
|
} else {
|
||||||
|
title.value = isWarehousing.value ? "仓库选择" : "存储区选择";
|
||||||
|
}
|
||||||
|
toBack(type);
|
||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
)
|
);
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
pagingRef.value?.reload?.()
|
pagingRef.value?.reload?.()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,29 +4,29 @@
|
|||||||
<view class="detailInfo mb-2">
|
<view class="detailInfo mb-2">
|
||||||
<view class="line title">
|
<view class="line title">
|
||||||
<p> {{ typeName + '单号' }}:{{ detailInfo?.billNo }}</p>
|
<p> {{ typeName + '单号' }}:{{ detailInfo?.billNo }}</p>
|
||||||
<span :style="getColor(detailInfo?.billType)">
|
<text :style="getColor(detailInfo?.billType)">
|
||||||
{{ getBillType(detailInfo?.billType, detailInfo?.status, flag) }}
|
{{ getBillType(detailInfo?.billType, detailInfo?.status, flag) }}
|
||||||
</span>
|
</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<p class="line content">仓库:
|
<p class="line content">仓库:
|
||||||
<span> {{ detailInfo?.warehouseName }}</span>
|
<text> {{ detailInfo?.warehouseName }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p class="line content">存储区:
|
<p class="line content">存储区:
|
||||||
<span> {{ detailInfo?.areaName }}</span>
|
<text> {{ detailInfo?.areaName }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p class="line content">开单时间:
|
<p class="line content">开单时间:
|
||||||
<span>{{ formatDate(detailInfo?.createTime) }}</span>
|
<text>{{ formatDate(detailInfo?.createTime) }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p class="line content" v-if="detailInfo?.inboundTime">{{ typeName + '时间' }} :
|
<p class="line content" v-if="detailInfo?.inboundTime">{{ typeName + '时间' }} :
|
||||||
<span>{{ formatDate(detailInfo?.inboundTime) }}</span>
|
<text>{{ formatDate(detailInfo?.inboundTime) }}</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
<view class="detailInfo mb-6">
|
<view class="detailInfo mb-6">
|
||||||
<p class="line content">
|
<p class="line content">
|
||||||
<span class="grey" style="font-weight: 600;">详细备注:</span>
|
<text class="grey" style="font-weight: 600;">详细备注:</text>
|
||||||
|
|
||||||
<span>{{ detailInfo?.billRemark || '-' }}</span>
|
<text>{{ detailInfo?.billRemark || '-' }}</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
844
pages/components/EquipmentInfo.vue
Normal file
844
pages/components/EquipmentInfo.vue
Normal file
@@ -0,0 +1,844 @@
|
|||||||
|
<template>
|
||||||
|
<navigation :title="title" back-url="pages/intelligent/index"> </navigation>
|
||||||
|
<view class="warehouse-page contentBox">
|
||||||
|
<view class="warehouse-hero">
|
||||||
|
<view>
|
||||||
|
<text class="hero-sub">{{ projectName || '项目仓库' }}</text>
|
||||||
|
<view class="hero-title">{{ warehouseName || '仓库传感器看板' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="hero-meta ">
|
||||||
|
<view class="warehouse-hero-box">
|
||||||
|
<div class="summary-card mr-16 total">
|
||||||
|
<span class="label">设备总数</span>
|
||||||
|
<strong class="value">{{ sensorCards.length }}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary-card mr-16 online">
|
||||||
|
<span class="label">在线设备</span>
|
||||||
|
<strong class="value">{{ onlineCount }}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="summary-card offline">
|
||||||
|
<span class="label">离线设备</span>
|
||||||
|
<strong class="value">{{ offlineCount }}</strong>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<view class="report"> 最近上报:{{ latestReportTime || '--' }} </view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="sensor-grid">
|
||||||
|
<view v-if="loading" class="loading-view">加载中...</view>
|
||||||
|
|
||||||
|
<view v-else-if="sensorCards.length === 0" class="empty-state">
|
||||||
|
当前仓库暂无传感器设备
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-for="item in sensorCards" :key="item.cardKey" :class="['sensor-card', item.statusClass]">
|
||||||
|
<view class="sensor-content">
|
||||||
|
<view class="sensor-main">
|
||||||
|
<view class="sensor-top">
|
||||||
|
<view :class="['sensor-icon', item.type]">
|
||||||
|
<text>{{ item.icon }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="sensor-state">
|
||||||
|
<text class="dot"></text>
|
||||||
|
{{ item.onlineText }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="sensor-body">
|
||||||
|
<text class="location">{{ item.locationName }}</text>
|
||||||
|
<view class="type-name">{{ item.typeName }}</view>
|
||||||
|
<text class="summary">{{ item.summary }}</text>
|
||||||
|
|
||||||
|
<view v-if="isSocketControlType(item.type)" class="socket-actions">
|
||||||
|
<button class="control-btn on" :disabled="!!controlLoadingMap[item.cardKey]"
|
||||||
|
@tap="handleSocketControl(item, 'on')">
|
||||||
|
{{ getSocketActionText(item.type, 'on', !!controlLoadingMap[item.cardKey]) }}
|
||||||
|
</button>
|
||||||
|
<button class="control-btn off" :disabled="!!controlLoadingMap[item.cardKey]"
|
||||||
|
@tap="handleSocketControl(item, 'off')">
|
||||||
|
{{ getSocketActionText(item.type, 'off', !!controlLoadingMap[item.cardKey]) }}
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-else-if="item.type === 'switch'" class="switch-actions">
|
||||||
|
<view v-for="channel in [1, 2, 3]" :key="channel" class="switch-row">
|
||||||
|
<text class="ch-label">开关{{ channel }}</text>
|
||||||
|
<button class="control-btn on"
|
||||||
|
:disabled="!!controlLoadingMap[`${item.cardKey}-ch-${channel}`]"
|
||||||
|
@tap="handleLightSwitchControl(item, channel, 'on')">
|
||||||
|
{{ !!controlLoadingMap[`${item.cardKey}-ch-${channel}`] ? '发送中...' : '开' }}
|
||||||
|
</button>
|
||||||
|
<button class="control-btn off"
|
||||||
|
:disabled="!!controlLoadingMap[`${item.cardKey}-ch-${channel}`]"
|
||||||
|
@tap="handleLightSwitchControl(item, channel, 'off')">
|
||||||
|
{{ !!controlLoadingMap[`${item.cardKey}-ch-${channel}`] ? '发送中...' : '关' }}
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="metric-panel">
|
||||||
|
<text class="panel-title">实时指标</text>
|
||||||
|
<view class="metric-list">
|
||||||
|
<view v-for="metric in item.metrics" :key="metric.label" class="metric-item">
|
||||||
|
<text class="label">{{ metric.label }}</text>
|
||||||
|
<text class="value">{{ metric.value }}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.metrics.length === 0" class="metric-item muted">
|
||||||
|
<text class="label">状态</text>
|
||||||
|
<text class="value">等待数据</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="sensor-footer">
|
||||||
|
<text>DevEUI:{{ item.devEui || '--' }}</text>
|
||||||
|
<text>{{ item.reportTime || '暂无上报' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||||
|
import { controlLightSwitch, controlSocket, listMqttDevice, listMqttData, listMqttEvent } from '@/api/home'
|
||||||
|
import { closeWs, connectWs } from '../utils/ws'
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
import Navigation from './Navigation.vue';
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const devices = ref([])
|
||||||
|
const title = ref('')
|
||||||
|
const latestDataMap = reactive({})
|
||||||
|
const controlLoadingMap = reactive({})
|
||||||
|
const ENV_CARD_TYPES = ['tempHum', 'toxicGas', 'hydrogenSulfide']
|
||||||
|
|
||||||
|
const deptId = ref('')
|
||||||
|
const projectName = ref('')
|
||||||
|
const warehouseName = ref('')
|
||||||
|
onLoad((options) => {
|
||||||
|
deptId.value = options?.deptId
|
||||||
|
projectName.value = options?.projectName
|
||||||
|
warehouseName.value = options?.warehouseName
|
||||||
|
title.value = options?.warehouseName
|
||||||
|
})
|
||||||
|
const sensorCards = computed(() => devices.value.flatMap((device) => expandDeviceCards(device)))
|
||||||
|
const onlineCount = computed(() => sensorCards.value.filter(i => i.isOnline).length)
|
||||||
|
const offlineCount = computed(() => Math.max(sensorCards.value.length - onlineCount.value, 0))
|
||||||
|
const latestReportTime = computed(() => {
|
||||||
|
const times = sensorCards.value.map(i => i.reportTime).filter(Boolean)
|
||||||
|
return times[0] || ''
|
||||||
|
})
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadDevices() {
|
||||||
|
if (!deptId.value) {
|
||||||
|
devices.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
listMqttDevice({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100,
|
||||||
|
deptId: deptId.value
|
||||||
|
}).then(res => {
|
||||||
|
devices.value = res.rows || []
|
||||||
|
return loadLatestData()
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadLatestData() {
|
||||||
|
const tasks = devices.value.map(device => {
|
||||||
|
if (!device.id) return Promise.resolve()
|
||||||
|
const reqs = [
|
||||||
|
listMqttData({ pageNum: 1, pageSize: 1, deviceId: device.id }).then(res => {
|
||||||
|
const row = (res.rows || [])[0]
|
||||||
|
if (row) {
|
||||||
|
const key = getDeviceKey(device)
|
||||||
|
latestDataMap[key] = normalizePayload({ ...latestDataMap[key] || {}, ...row })
|
||||||
|
}
|
||||||
|
}).catch(() => { })
|
||||||
|
]
|
||||||
|
if (isStateDevice(device)) {
|
||||||
|
reqs.push(listMqttEvent({ pageNum: 1, pageSize: 1, deviceId: device.id }).then(res => {
|
||||||
|
const row = (res.rows || [])[0]
|
||||||
|
if (row) {
|
||||||
|
const key = getDeviceKey(device)
|
||||||
|
latestDataMap[key] = normalizePayload({ ...latestDataMap[key] || {}, ...row, ...deriveStateFromEvent(row) })
|
||||||
|
}
|
||||||
|
}).catch(() => { }))
|
||||||
|
}
|
||||||
|
return Promise.all(reqs)
|
||||||
|
})
|
||||||
|
return Promise.all(tasks)
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleWsMessage(data) {
|
||||||
|
if (!data || String(data.deptId || '') !== String(deptId.value || '')) return
|
||||||
|
const runtimeStatus = data.deviceStatus != null ? String(data.deviceStatus) : null
|
||||||
|
|
||||||
|
const index = devices.value.findIndex(device =>
|
||||||
|
String(device.id || '') === String(data.deviceId || '') ||
|
||||||
|
String(device.devEui || '').toLowerCase() === String(data.devEui || '').toLowerCase()
|
||||||
|
)
|
||||||
|
|
||||||
|
if (index > -1) {
|
||||||
|
const device = devices.value[index]
|
||||||
|
const key = getDeviceKey(device)
|
||||||
|
const patched = patchRealtimeState(latestDataMap[key] || {}, data)
|
||||||
|
latestDataMap[key] = normalizePayload({ ...latestDataMap[key] || {}, ...patched })
|
||||||
|
devices.value[index] = { ...device, status: runtimeStatus ?? '0' }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const key = getDeviceKey(data)
|
||||||
|
const patched = patchRealtimeState(latestDataMap[key] || {}, data)
|
||||||
|
latestDataMap[key] = normalizePayload({ ...latestDataMap[key] || {}, ...patched })
|
||||||
|
}
|
||||||
|
|
||||||
|
function patchRealtimeState(prev, next) {
|
||||||
|
const res = { ...next }
|
||||||
|
const s1 = next.switch_1 ?? next.switch1
|
||||||
|
const s2 = next.switch_2 ?? next.switch2
|
||||||
|
const s3 = next.switch_3 ?? next.switch3
|
||||||
|
if (s1 != null) res.switch_1 = res.switch1 = s1
|
||||||
|
if (s2 != null) res.switch_2 = res.switch2 = s2
|
||||||
|
if (s3 != null) res.switch_3 = res.switch3 = s3
|
||||||
|
|
||||||
|
const water = deriveWaterStatus({ ...prev, ...next })
|
||||||
|
if (water != null) res.waterStatus = res.water_status = water
|
||||||
|
const door = deriveDoorStatus({ ...prev, ...next })
|
||||||
|
if (door != null) res.doorStatus = res.door_status = door
|
||||||
|
const socket = deriveSocketStatus({ ...prev, ...next })
|
||||||
|
if (socket != null) res.switchStatus = res.socket_status = res.socketStatus = socket
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleSocketControl(item, action) {
|
||||||
|
const deviceId = item.id || item.deviceId
|
||||||
|
const devEui = item.devEui || item.devEUI || item.dev_eui
|
||||||
|
if (!devEui) return uni.showToast({ title: '未找到设备', icon: 'none' })
|
||||||
|
const k = item.cardKey || String(deviceId)
|
||||||
|
if (controlLoadingMap[k]) return
|
||||||
|
controlLoadingMap[k] = true
|
||||||
|
try {
|
||||||
|
const status = action === 'on' ? 1 : 0
|
||||||
|
await controlSocket({ devEui, deviceId, status })
|
||||||
|
syncSocketLocalState(item, status)
|
||||||
|
uni.showToast({ title: '指令已发送', icon: 'success' })
|
||||||
|
} finally {
|
||||||
|
controlLoadingMap[k] = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleLightSwitchControl(item, ch, action) {
|
||||||
|
const devEui = item.devEui || item.devEUI || item.dev_eui
|
||||||
|
if (!devEui) return uni.showToast({ title: '未找到设备', icon: 'none' })
|
||||||
|
const k = `${item.cardKey}-ch-${ch}`
|
||||||
|
if (controlLoadingMap[k]) return
|
||||||
|
controlLoadingMap[k] = true
|
||||||
|
try {
|
||||||
|
const status = action === 'on' ? 1 : 0
|
||||||
|
await controlLightSwitch({ devEui, channel: ch, status })
|
||||||
|
syncLightSwitchLocalState(item, ch, status)
|
||||||
|
uni.showToast({ title: '指令已发送', icon: 'success' })
|
||||||
|
} finally {
|
||||||
|
controlLoadingMap[k] = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncSocketLocalState(item, status) {
|
||||||
|
const key = getDeviceKey(item)
|
||||||
|
if (!key) return
|
||||||
|
const now = new Date().toISOString()
|
||||||
|
latestDataMap[key] = normalizePayload({
|
||||||
|
...latestDataMap[key] || {},
|
||||||
|
socket_status: status, socketStatus: status, switchStatus: status,
|
||||||
|
gatewayTime: now, createTime: now
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncLightSwitchLocalState(item, ch, status) {
|
||||||
|
const key = getDeviceKey(item)
|
||||||
|
if (!key) return
|
||||||
|
const now = new Date().toISOString()
|
||||||
|
latestDataMap[key] = normalizePayload({
|
||||||
|
...latestDataMap[key] || {},
|
||||||
|
deviceId: item.deviceId || item.id,
|
||||||
|
devEui: item.devEui || item.devEUI || item.dev_eui,
|
||||||
|
deviceName: item.deviceName,
|
||||||
|
[`switch_${ch}`]: status, [`switch${ch}`]: status,
|
||||||
|
gatewayTime: now, createTime: now
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function expandDeviceCards(device) {
|
||||||
|
const data = latestDataMap[getDeviceKey(device)] || {}
|
||||||
|
const type = getSensorType(device, data)
|
||||||
|
if (type === 'env') return ENV_CARD_TYPES.map(t => buildSensorCard(device, t))
|
||||||
|
return [buildSensorCard(device)]
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildSensorCard(device, displayType) {
|
||||||
|
const data = latestDataMap[getDeviceKey(device)] || {}
|
||||||
|
const type = displayType || getSensorType(device, data)
|
||||||
|
const metrics = buildDisplayMetrics(data, type)
|
||||||
|
const reportTime = formatTime(data.createTime || data.gatewayTime)
|
||||||
|
const isOnline = String(device.status) === '0'
|
||||||
|
return {
|
||||||
|
...device,
|
||||||
|
cardKey: `${getDeviceKey(device) || 's'}-${type}`,
|
||||||
|
type,
|
||||||
|
icon: getDisplayIcon(type),
|
||||||
|
typeName: getDisplayTypeName(type),
|
||||||
|
locationName: getLocationName(device, data),
|
||||||
|
summary: getDisplaySummary(data, type),
|
||||||
|
metrics,
|
||||||
|
reportTime,
|
||||||
|
isOnline,
|
||||||
|
onlineText: isOnline ? '在线' : '离线',
|
||||||
|
statusClass: isOnline ? 'online' : 'offline'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSocketControlType(type) {
|
||||||
|
return type === 'socket' || type === 'acSocket'
|
||||||
|
}
|
||||||
|
function getSocketActionText(type, action, loading) {
|
||||||
|
if (loading) return '发送中...'
|
||||||
|
if (type === 'acSocket') return action === 'on' ? '开启空调' : '关闭空调'
|
||||||
|
return action === 'on' ? '开启排风' : '关闭排风'
|
||||||
|
}
|
||||||
|
function getDisplayIcon(type) {
|
||||||
|
return type === 'acSocket' ? '空' : getSensorIcon(type)
|
||||||
|
}
|
||||||
|
function getDisplayTypeName(type) {
|
||||||
|
return type === 'acSocket' ? '智能空调插座' : getSensorTypeName(type)
|
||||||
|
}
|
||||||
|
function getDisplaySummary(data, type) {
|
||||||
|
if (type === 'acSocket') return `空调状态:${translateSwitch(data.switchStatus)}`
|
||||||
|
return getSensorSummary(data, type)
|
||||||
|
}
|
||||||
|
function buildDisplayMetrics(data, type) {
|
||||||
|
const m = buildMetrics(data, type === 'acSocket' ? 'socket' : type)
|
||||||
|
if (type === 'acSocket') {
|
||||||
|
return m.map(i => i.label === '插座状态' ? { ...i, label: '空调状态' } : i)
|
||||||
|
}
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDeviceKey(d) {
|
||||||
|
return d.deviceId || d.id || d.devEui || d.devEUI || d.dev_eui
|
||||||
|
}
|
||||||
|
function normalizePayload(row) {
|
||||||
|
const json = parseJson(row.dataJson) || parseJson(row.payload) || {}
|
||||||
|
const nested = parseJson(row.data) || {}
|
||||||
|
const water = deriveWaterStatus({ ...json, ...nested, ...row })
|
||||||
|
return {
|
||||||
|
...json, ...nested, ...row,
|
||||||
|
devEui: row.devEui || row.devEUI || json.devEui,
|
||||||
|
waterStatus: row.waterStatus ?? row.water_status ?? water,
|
||||||
|
water_status: row.water_status ?? row.waterStatus ?? water,
|
||||||
|
socket_status: row.socket_status ?? row.socketStatus,
|
||||||
|
switchStatus: row.switchStatus ?? row.socket_status,
|
||||||
|
switch_1: row.switch_1 ?? row.switch1, switch1: row.switch1 ?? row.switch_1,
|
||||||
|
switch_2: row.switch_2 ?? row.switch2, switch2: row.switch2 ?? row.switch_2,
|
||||||
|
switch_3: row.switch_3 ?? row.switch3, switch3: row.switch3 ?? row.switch_3,
|
||||||
|
doorStatus: row.doorStatus ?? row.door_status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function parseJson(v) {
|
||||||
|
if (typeof v !== 'string') return null
|
||||||
|
try { return JSON.parse(v) } catch { return null }
|
||||||
|
}
|
||||||
|
function deriveStateFromEvent(row) {
|
||||||
|
const evt = (row.eventType || row.event || '').toLowerCase()
|
||||||
|
const desc = (row.eventDesc || row.statusDesc || '').toLowerCase()
|
||||||
|
const res = {}
|
||||||
|
if (evt.includes('open') || desc.includes('打开')) res.doorStatus = 1
|
||||||
|
if (evt.includes('close') || desc.includes('关闭')) res.doorStatus = 0
|
||||||
|
if (evt.includes('on') || desc.includes('通电')) res.socket_status = res.switchStatus = 1
|
||||||
|
if (evt.includes('off') || desc.includes('断电')) res.socket_status = res.switchStatus = 0
|
||||||
|
const water = deriveWaterStatus(row)
|
||||||
|
if (water != null) res.waterStatus = res.water_status = water
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
function deriveWaterStatus(data) {
|
||||||
|
const evt = (data.eventType || data.status || '').toLowerCase()
|
||||||
|
const desc = (data.eventDesc || data.statusDesc || '').toLowerCase()
|
||||||
|
if (evt === 'alarm' || desc.includes('浸水') || desc.includes('水浸')) return 1
|
||||||
|
if (evt === 'normal' || desc.includes('正常')) return 0
|
||||||
|
return data.waterStatus ?? data.water_status
|
||||||
|
}
|
||||||
|
function deriveDoorStatus(data) {
|
||||||
|
return data.doorStatus ?? data.door_status
|
||||||
|
}
|
||||||
|
function deriveSocketStatus(data) {
|
||||||
|
return data.switchStatus ?? data.socket_status ?? data.socketStatus
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSensorType(device, data) {
|
||||||
|
const t = (device.deviceType || '').toLowerCase()
|
||||||
|
const name = (device.deviceName || '').toLowerCase()
|
||||||
|
if (t === 'smoke') return 'smoke'
|
||||||
|
if (t === 'water') return 'water'
|
||||||
|
if (t === 'door') return 'door'
|
||||||
|
if (t === 'env') return 'env'
|
||||||
|
if (t === 'switch') return 'switch'
|
||||||
|
if (t === 'socket') return name.includes('空调') ? 'acSocket' : 'socket'
|
||||||
|
if (name.includes('smoke')) return 'smoke'
|
||||||
|
if (name.includes('water')) return 'water'
|
||||||
|
if (name.includes('空调')) return 'acSocket'
|
||||||
|
if (name.includes('socket')) return 'socket'
|
||||||
|
if (name.includes('switch')) return 'switch'
|
||||||
|
if (name.includes('door')) return 'door'
|
||||||
|
if (name.includes('temp') || name.includes('hum')) return 'env'
|
||||||
|
return 'sensor'
|
||||||
|
}
|
||||||
|
|
||||||
|
function isStateDevice(device) {
|
||||||
|
const s = `${device.deviceType} ${device.deviceName}`.toLowerCase()
|
||||||
|
return s.includes('door') || s.includes('socket') || s.includes('switch')
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSensorIcon(type) {
|
||||||
|
const map = { smoke: '烟', water: '水', socket: '电', switch: '灯', door: '门', env: '温', tempHum: '温', toxicGas: '氨', hydrogenSulfide: '硫' }
|
||||||
|
return map[type] || '测'
|
||||||
|
}
|
||||||
|
function getSensorTypeName(type) {
|
||||||
|
const map = { smoke: '烟雾传感器', water: '水浸传感器', socket: '智能排风', switch: '智慧照明', door: '门禁状态', env: '环境传感器', tempHum: '温湿度', toxicGas: '有毒气体', hydrogenSulfide: '硫化氢' }
|
||||||
|
return map[type] || '传感器'
|
||||||
|
}
|
||||||
|
function getLocationName(device) {
|
||||||
|
return device.deptName || warehouseName.value || '仓库'
|
||||||
|
}
|
||||||
|
function getSensorSummary(data, type) {
|
||||||
|
if (!Object.keys(data).length) return '等待上报'
|
||||||
|
if (type === 'water') return `水浸:${translateNormalAlarm(data.waterStatus)}`
|
||||||
|
if (type === 'smoke') return `烟雾:${translateSmokeStatus(data.status)}`
|
||||||
|
if (type === 'socket') return `插座:${translateSwitch(data.switchStatus)}`
|
||||||
|
if (type === 'switch') {
|
||||||
|
const arr = []
|
||||||
|
if (data.switch_1 != null) arr.push(`1${translateSwitchShort(data.switch_1)}`)
|
||||||
|
if (data.switch_2 != null) arr.push(`2${translateSwitchShort(data.switch_2)}`)
|
||||||
|
if (data.switch_3 != null) arr.push(`3${translateSwitchShort(data.switch_3)}`)
|
||||||
|
return arr.length ? `开关:${arr.join(' ')}` : '开关状态'
|
||||||
|
}
|
||||||
|
if (type === 'door') return `门禁:${translateSwitch(data.doorStatus)}`
|
||||||
|
if (type === 'tempHum') return `${data.temperature || '--'}℃/${data.humidity || '--'}%`
|
||||||
|
if (type === 'toxicGas') return `氨气:${data.nh3 || '--'}ppm`
|
||||||
|
if (type === 'hydrogenSulfide') return `硫化氢:${data.h2s || '--'}ppm`
|
||||||
|
if (type === 'env') return `${data.temperature || '--'}℃/${data.humidity || '--'}%`
|
||||||
|
return '已上报'
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildMetrics(data, type) {
|
||||||
|
if (type === 'tempHum') return [{ label: '温度', value: data.temperature + '℃' }, { label: '湿度', value: data.humidity + '%' }, { label: '电量', value: data.battery + '%' }].filter(i => i.value)
|
||||||
|
if (type === 'toxicGas') return [{ label: '氨气', value: data.nh3 + 'ppm' }, { label: '电量', value: data.battery + '%' }].filter(i => i.value)
|
||||||
|
if (type === 'hydrogenSulfide') return [{ label: '硫化氢', value: data.h2s + 'ppm' }, { label: '电量', value: data.battery + '%' }].filter(i => i.value)
|
||||||
|
const list = []
|
||||||
|
if (data.temperature != null) list.push({ label: '温度', value: data.temperature + '℃' })
|
||||||
|
if (data.humidity != null) list.push({ label: '湿度', value: data.humidity + '%' })
|
||||||
|
if (data.nh3 != null) list.push({ label: '氨气', value: data.nh3 + 'ppm' })
|
||||||
|
if (data.h2s != null) list.push({ label: '硫化氢', value: data.h2s + 'ppm' })
|
||||||
|
if (data.battery != null) list.push({ label: '电量', value: data.battery + '%' })
|
||||||
|
if (type === 'water' && data.waterStatus != null) list.unshift({ label: '水浸', value: translateNormalAlarm(data.waterStatus) })
|
||||||
|
if (type === 'socket' && data.switchStatus != null) list.unshift({ label: '插座', value: translateSwitch(data.switchStatus) })
|
||||||
|
if (type === 'door' && data.doorStatus != null) list.unshift({ label: '门禁', value: translateSwitch(data.doorStatus) })
|
||||||
|
if (type === 'switch') {
|
||||||
|
const sw = []
|
||||||
|
if (data.switch_1 != null) sw.push({ label: '开关1', value: translateSwitchShort(data.switch_1) })
|
||||||
|
if (data.switch_2 != null) sw.push({ label: '开关2', value: translateSwitchShort(data.switch_2) })
|
||||||
|
if (data.switch_3 != null) sw.push({ label: '开关3', value: translateSwitchShort(data.switch_3) })
|
||||||
|
return [...sw, ...list].slice(0, 6)
|
||||||
|
}
|
||||||
|
return list.slice(0, 6)
|
||||||
|
}
|
||||||
|
|
||||||
|
function translateNormalAlarm(v) {
|
||||||
|
const s = String(v)
|
||||||
|
return s === '0' ? '正常' : s === '1' ? '告警' : '未知'
|
||||||
|
}
|
||||||
|
function translateSmokeStatus(v) {
|
||||||
|
const s = String(v).toLowerCase()
|
||||||
|
return s === '0' || s === 'normal' ? '正常' : s === '1' || s === 'alarm' ? '告警' : '正常'
|
||||||
|
}
|
||||||
|
function translateSwitch(v) {
|
||||||
|
const s = String(v).toLowerCase()
|
||||||
|
return s === '0' || s === 'off' ? '关闭' : s === '1' || s === 'on' ? '开启' : '--'
|
||||||
|
}
|
||||||
|
function translateSwitchShort(v) {
|
||||||
|
const s = String(v).toLowerCase()
|
||||||
|
return s === '0' || s === 'off' ? '关' : s === '1' || s === 'on' ? '开' : '-'
|
||||||
|
}
|
||||||
|
function formatTime(t) {
|
||||||
|
if (!t) return ''
|
||||||
|
return t.replace('T', ' ').substring(5, 16)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loadDevices()
|
||||||
|
connectWs(handleWsMessage)
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
closeWs(handleWsMessage)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.warehouse-page {
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #f5f7fa;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warehouse-hero {
|
||||||
|
background: linear-gradient(135deg, #085f52, #0a7c70);
|
||||||
|
color: #fff;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.warehouse-hero-box {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-sub {
|
||||||
|
font-size: 24rpx;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-title {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 8rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-num {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-label {
|
||||||
|
font-size: 24rpx;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #111;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.online .num {
|
||||||
|
color: #07a186;
|
||||||
|
}
|
||||||
|
|
||||||
|
.offline .num {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-card::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 8rpx;
|
||||||
|
background: #08a089;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-card.offline {
|
||||||
|
opacity: 0.6;
|
||||||
|
filter: grayscale(0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-main {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-icon {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
background: #e6f7f5;
|
||||||
|
color: #088a77;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-state {
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
background: #e6f7f5;
|
||||||
|
color: #088a77;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 12rpx;
|
||||||
|
height: 12rpx;
|
||||||
|
background: #09a089;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-body {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.location {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type-name {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 8rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary {
|
||||||
|
font-size: 26rpx;
|
||||||
|
background: #f0f0f0;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.socket-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-actions {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12rpx;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-label {
|
||||||
|
width: 80rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.control-btn {
|
||||||
|
padding: 12rpx 24rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.control-btn.on {
|
||||||
|
background: #d1fae5;
|
||||||
|
color: #065f46;
|
||||||
|
}
|
||||||
|
|
||||||
|
.control-btn.off {
|
||||||
|
background: #ffedd5;
|
||||||
|
color: #9a3412;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-panel {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-title {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-item {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 200rpx;
|
||||||
|
background: #fff;
|
||||||
|
padding: 16rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #666;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #088a77;
|
||||||
|
margin-top: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.muted {
|
||||||
|
background: #f1f1f1;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sensor-footer {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding-top: 16rpx;
|
||||||
|
border-top: 1rpx dashed #eee;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
text-align: center;
|
||||||
|
padding: 60rpx;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.summary-card {
|
||||||
|
padding: 18px 20px;
|
||||||
|
border-radius: 18px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 30%;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #334155;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设备总数
|
||||||
|
.summary-card.total {
|
||||||
|
background: #eef2ff;
|
||||||
|
color: #6366f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在线设备
|
||||||
|
.summary-card.online {
|
||||||
|
background: #ecfdf5;
|
||||||
|
color: #059669;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 离线设备
|
||||||
|
.summary-card.offline {
|
||||||
|
background: #F5F5F5;
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最近上报
|
||||||
|
.summary-card.report {
|
||||||
|
background: #f0f9ff;
|
||||||
|
color: #0ea5e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-view {
|
||||||
|
text-align: center;
|
||||||
|
padding: 40rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-meta {
|
||||||
|
// background-color: #F8FAFC;
|
||||||
|
border-color: #CBD5E1;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
// padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.report {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,16 +4,16 @@
|
|||||||
<view class="remarkLine">
|
<view class="remarkLine">
|
||||||
<text>物料列表</text>
|
<text>物料列表</text>
|
||||||
<uv-button type="primary" v-if="isAddMaterial" :plain="true" size="small" text="添加物料"
|
<uv-button type="primary" v-if="isAddMaterial" :plain="true" size="small" text="添加物料"
|
||||||
@click="toMaterial"></uv-button>
|
@tap="toMaterial"></uv-button>
|
||||||
|
|
||||||
<view v-if="isShowRqCode" class="flex align-center justify-between">
|
<view v-if="isShowRqCode" class="flex align-center justify-between">
|
||||||
<span class="f-12 mr-16 grey" style="font-size: 12px;" v-if="num > 0">
|
<text class="f-12 mr-16 grey" style="font-size: 12px;" v-if="num > 0">
|
||||||
剩余<span style="color: red;">
|
剩余<text style="color: red;">
|
||||||
{{ num }}
|
{{ num }}
|
||||||
</span>种物料未生成唯一码
|
</text>种物料未生成唯一码
|
||||||
</span>
|
</text>
|
||||||
<uv-button type="primary" :plain="true" size="small" text="快速生成唯一码"
|
<uv-button type="primary" :plain="true" size="small" text="快速生成唯一码"
|
||||||
@click="toGenerateUniqueCodeQuickly"></uv-button>
|
@tap="toGenerateUniqueCodeQuickly"></uv-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -30,18 +30,18 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 副标题:简称/型号/规格/类型 -->
|
<!-- 副标题:简称/型号/规格/类型 -->
|
||||||
<view class="subTitle mb-2">
|
<view class="subTitle mb-2">
|
||||||
<span v-if="item.materialShortName">{{ item.materialShortName }} / </span>
|
<text v-if="item.materialShortName">{{ item.materialShortName }} / </text>
|
||||||
<span v-if="item.model">{{ item.model }} / </span>
|
<text v-if="item.model">{{ item.model }} / </text>
|
||||||
<span v-if="item.specification">{{ item.specification }} / </span>
|
<text v-if="item.specification">{{ item.specification }} / </text>
|
||||||
<span v-if="item.typeName">{{ item.typeName }}</span>
|
<text v-if="item.typeName">{{ item.typeName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- uniqueCode -->
|
<!-- uniqueCode -->
|
||||||
<view class="uniqueCode mb-2">
|
<view class="uniqueCode mb-2">
|
||||||
<span class="f-12 " v-if="item.uniqueCode">唯一码:{{ item?.uniqueCode }}</span>
|
<text class="f-12 " v-if="item.uniqueCode">唯一码:{{ item?.uniqueCode }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 数量 + 单位 -->
|
<!-- 数量 + 单位 -->
|
||||||
<view class="tag-row mb-2">
|
<view class="tag-row mb-2">
|
||||||
<span class="tag-error">{{ getTypeParentNames(item.typeParentNames) }}</span>
|
<text class="tag-error">{{ getTypeParentNames(item.typeParentNames) }}</text>
|
||||||
<view class="quantity-form">
|
<view class="quantity-form">
|
||||||
<uni-forms-item :name="`material[${idx}].quantity`" label-width="0">
|
<uni-forms-item :name="`material[${idx}].quantity`" label-width="0">
|
||||||
<uni-easyinput :disabled="!edit || isEdit == '5'"
|
<uni-easyinput :disabled="!edit || isEdit == '5'"
|
||||||
@@ -52,24 +52,24 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 库存状态 -->
|
<!-- 库存状态 -->
|
||||||
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && isStockIn">
|
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && includes(keyType, 'stockIn')">
|
||||||
<p style="font-size: 13px;">
|
<p style="font-size: 13px;">
|
||||||
已入库:
|
已入库:
|
||||||
<span style="color:green">{{ getStockQuantity(item, 'complete') }}</span>
|
<text style="color:green">{{ getStockQuantity(item, 'complete') }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p style="font-size: 13px;">
|
<p style="font-size: 13px;">
|
||||||
剩余:
|
剩余:
|
||||||
<span style="color:red">{{ getStockQuantity(item, 'remaining') }}</span>
|
<text style="color:red">{{ getStockQuantity(item, 'remaining') }}</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && !isStockIn">
|
<view class="flex justify-between mb-2 " v-if="isEdit == 3 && includes(keyType, 'stockOut')">
|
||||||
<p style="font-size: 13px;">
|
<p style="font-size: 13px;">
|
||||||
已出库:
|
已出库:
|
||||||
<span style="color:green">{{ getStockQuantity(item, 'complete') }}</span>
|
<text style="color:green">{{ getStockQuantity(item, 'complete') }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p style="font-size: 13px;">
|
<p style="font-size: 13px;">
|
||||||
剩余:
|
剩余:
|
||||||
<span style="color:red">{{ getStockQuantity(item, 'remaining') }}</span>
|
<text style="color:red">{{ getStockQuantity(item, 'remaining') }}</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
@@ -92,8 +92,9 @@
|
|||||||
<!-- 选择物料 -->
|
<!-- 选择物料 -->
|
||||||
<uv-modal ref="modalRef" class="chooseModal" :title="none" :showConfirmButton="false" :showCancelButton="false">
|
<uv-modal ref="modalRef" class="chooseModal" :title="none" :showConfirmButton="false" :showCancelButton="false">
|
||||||
<p class="title">请选择称重来源</p>
|
<p class="title">请选择称重来源</p>
|
||||||
<p class="link" @click="toMaterialSelection('0')">无线液位计</p>
|
<p class="link" v-if="includes(keyType, 'declaration')" @tap="toMaterialSelection('2')">蓝牙电子秤</p>
|
||||||
<p class="link" @click="toMaterialSelection('1')">手动输入</p>
|
<p class="link" @tap="toMaterialSelection('0')">无线液位计</p>
|
||||||
|
<p class="link" @tap="toMaterialSelection('1')">手动输入</p>
|
||||||
|
|
||||||
</uv-modal>
|
</uv-modal>
|
||||||
|
|
||||||
@@ -123,71 +124,84 @@ const OPERATE_CONFIG = {
|
|||||||
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/index',
|
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/index',
|
||||||
title: '入库单开单'
|
title: '入库单开单'
|
||||||
},
|
},
|
||||||
|
// 申报单开单
|
||||||
|
declaration: {
|
||||||
|
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/materialSelection',
|
||||||
|
title: '申报单开单'
|
||||||
|
},
|
||||||
|
my: {
|
||||||
|
toMaterialUrl: '/pages/warehousing/uniqueCode/issueUniqueCode/index',
|
||||||
|
title: '申报单开单'
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formData: { type: Object, default: () => ({ material: [], remark: '' }), required: true },//物料信息
|
formData: { type: Object, default: () => ({ material: [], remark: '' }), required: true },//物料信息
|
||||||
isEdit: { type: Boolean, default: true, required: true }, //编辑1 / 物料只读2 / 入库单只读3 /入库生成唯一码编辑4 /5数量不可编辑 备注可编辑
|
isEdit: { type: Boolean, default: true, required: true }, //编辑1 / 物料只读2 / 入/出库单只读3 /入库生成唯一码编辑4 /5数量不可编辑 备注可编辑
|
||||||
pathParams: { type: Object, default: {} }, //只读时传入对应的code、id
|
pathParams: { type: Object, default: {} }, //只读时传入对应的code、id
|
||||||
extendData: { type: Object, default: {} }, //其他额外参数
|
extendData: { type: Object, default: {} }, //其他额外参数
|
||||||
})
|
})
|
||||||
|
const emit = defineEmits(["setStorage"]); //申报开单 选择物料存储所填数据
|
||||||
|
|
||||||
const { formData, isEdit, pathParams, extendData } = toRefs(props)
|
const { formData, isEdit, pathParams, extendData } = toRefs(props)
|
||||||
|
|
||||||
|
// 标识:页面
|
||||||
const keyType = computed(() => pathParams.value.type)
|
const keyType = computed(() => pathParams.value.type)
|
||||||
//是否为编辑状态
|
// 标识:是否为编辑状态
|
||||||
const edit = computed(() => includes(['1', '4', '5'], `${isEdit.value}`))
|
const edit = computed(() => includes(['1', '4', '5'], `${isEdit.value}`))
|
||||||
// 显示添加物料按钮 isEdit编辑、
|
// 标识:显示添加物料按钮 编辑1且非开单页面以及非出库相关页面
|
||||||
const isAddMaterial = computed(() => `${isEdit.value}` === '1' && keyType != 'issueUniqueCode_inbound' && !includes(keyType.value, 'stockOut'))
|
const isAddMaterial = computed(() => `${isEdit.value}` === '1' && keyType.value != 'stockIn_inbound' && !includes(keyType.value, 'stockOut'))
|
||||||
// 显示快速生成唯一码 isShowRqCode
|
// 标识:显示快速生成唯一码 编辑5数量不可编辑 备注可编辑且非出库相关页面
|
||||||
const isShowRqCode = computed(() => `${isEdit.value}` === '5' && !includes(keyType.value, 'stockOut'))
|
const isShowRqCode = computed(() => `${isEdit.value}` === '5' && !includes(keyType.value, 'stockOut'))
|
||||||
const isStockIn = computed(() => includes(keyType.value, 'stockIn'))
|
|
||||||
// 删除:数据
|
// 删除:数据
|
||||||
const delItem = ref(null)
|
const delItem = ref(null)
|
||||||
// 删除:开关
|
// 删除:开关
|
||||||
const alertDialog = ref(null)
|
const alertDialog = ref(null)
|
||||||
// 删除:开关
|
// 删除:开关
|
||||||
const isDialog = ref(false)
|
const isDialog = ref(false)
|
||||||
|
// 数据:开单-可选择的物料列表
|
||||||
const selectMaterialList = computed(() => extendData.value?.selectMaterialList)
|
const selectMaterialList = computed(() => extendData.value?.selectMaterialList)
|
||||||
const num = computed(() => selectMaterialList.value?.length || 0)
|
const num = computed(() => selectMaterialList.value?.length || 0)
|
||||||
// 弹窗开关:入库单开单
|
// 弹窗:入库单开单
|
||||||
const modalRef = ref()
|
const modalRef = ref()
|
||||||
|
|
||||||
// 按钮:添加物料
|
// 按钮:添加物料
|
||||||
const toMaterial = () => {
|
const toMaterial = () => {
|
||||||
if (keyType.value == 'stockIn') { // 入库单开单 - 添加物料可选择手输入/无线液位计
|
if (keyType.value == 'stockIn' || includes(keyType.value, 'declaration')) { // 入库单开单 - 添加物料可选择手输入/无线液位计
|
||||||
modalRef.value.open()
|
modalRef.value.open()
|
||||||
} else {
|
} else {
|
||||||
const path = objectToQuery(pathParams.value)
|
const path = objectToQuery(pathParams.value)
|
||||||
// 唯一码 - 编辑/新增
|
|
||||||
const value = uni.getStorageSync('app_material');
|
const value = uni.getStorageSync('app_material');
|
||||||
uni.setStorageSync('app_material', [{ ...value[0], uniqueCodeRemark: formData.value?.remark }]); // 将最新的唯一码备注写入缓存
|
uni.setStorageSync('app_material', [{ ...value[0], uniqueCodeRemark: formData.value?.remark }]); // 将最新的唯一码备注写入缓存
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${OPERATE_CONFIG.issueUniqueCode.toMaterialUrl}${path}`
|
url: `${OPERATE_CONFIG.issueUniqueCode.toMaterialUrl}${path}`
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 添加物料弹窗: 入库单入库 时可选择手动/无线液
|
// 添加物料弹窗: 入库单入库、申报开单 时可选择手动/无线液
|
||||||
const toMaterialSelection = (type) => {
|
const toMaterialSelection = (type) => {
|
||||||
// 0无线液 1手动输入
|
// 0无线液 1手动输入 2蓝牙
|
||||||
let url = ''
|
let url = ''
|
||||||
const path = objectToQuery(pathParams.value)
|
const path = objectToQuery(pathParams.value)
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
|
emit("setStorage");
|
||||||
url = `${OPERATE_CONFIG.issueUniqueCode.toMaterialUrl}`
|
url = `${OPERATE_CONFIG.issueUniqueCode.toMaterialUrl}`
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${url}${path}`
|
url: `${url}${path}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 快速生成唯一码 -
|
|
||||||
|
// 快速生成唯一码 -
|
||||||
const toGenerateUniqueCodeQuickly = () => {
|
const toGenerateUniqueCodeQuickly = () => {
|
||||||
const path = objectToQuery(pathParams.value)
|
const path = objectToQuery(pathParams.value)
|
||||||
console.log(path, 'path==>');
|
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${OPERATE_CONFIG.stockIn.toMaterialUrl}${path}`
|
url: `${OPERATE_CONFIG.stockIn.toMaterialUrl}${path}`
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除弹窗:显示 长按事件
|
// 删除弹窗:显示 长按事件
|
||||||
const handleItemLongPress = (val) => {
|
const handleItemLongPress = (val) => {
|
||||||
alertDialog.value.open()
|
alertDialog.value.open()
|
||||||
@@ -204,7 +218,6 @@ const dialogConfirm = () => {
|
|||||||
const idx = findIndex(formData.value.material, (i) => `${i.id}` === `${delItem.value.id}`)
|
const idx = findIndex(formData.value.material, (i) => `${i.id}` === `${delItem.value.id}`)
|
||||||
assign(formData.value.material[idx], { isDelete: '1' });
|
assign(formData.value.material[idx], { isDelete: '1' });
|
||||||
uni.setStorageSync('app_material', formData.value.material)
|
uni.setStorageSync('app_material', formData.value.material)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -251,7 +264,7 @@ defineExpose({
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- <view class="nav-placeholder" :style="{ height: 35 + 'px' }"></view> -->
|
<!-- <view class="nav-placeholder" :style="{ height: 35 + 'px' }"></view> -->
|
||||||
|
|
||||||
<view class="navbar" :style="{ height: navHeight + 'rpx' }">
|
<view class="navbar" :style="{ height: navHeight + 'rpx' }">
|
||||||
<view class="left" @click="goBack">
|
<view class="left" @tap="goBack">
|
||||||
<uni-icons type="left" size="18" v-if="showBack" />
|
<uni-icons type="left" size="18" v-if="showBack" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
55
pages/components/ProjectOverView.vue
Normal file
55
pages/components/ProjectOverView.vue
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<script setup>
|
||||||
|
import { warehouseList } from '@/api/home';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { transformData, objectToQuery } from '../until'
|
||||||
|
|
||||||
|
const myWarehouseList = ref([])
|
||||||
|
|
||||||
|
const onChecked = (item) => {
|
||||||
|
if (!item.deptId) return
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/components/EquipmentInfo?deptId=${item.deptId}&warehouseName=${item.warehouseName || ''}&projectName=${item.parentName || ''}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const getMyWarehouseList = () => {
|
||||||
|
warehouseList().then((res) => {
|
||||||
|
myWarehouseList.value = transformData(res.data)
|
||||||
|
console.log('我的仓库===>', res, transformData(res.data));
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getMyWarehouseList()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<uv-list v-for="(item, index) in myWarehouseList" :key="index" class="list">
|
||||||
|
<view class="title line">{{ item.parentName }}</view>
|
||||||
|
<uv-list-item v-for="(i, idx) in item.items" :key="idx" link clickable @tap="onChecked(i)"
|
||||||
|
:title="i.warehouseName">
|
||||||
|
<template v-slot:footer>
|
||||||
|
<view :style="i?.onlineRate > 0 ? 'color :#9CCC65;font-size: 14px;' : 'color :#000;font-size: 14px;'">
|
||||||
|
<text>在线率:</text>
|
||||||
|
<text>{{ i?.onlineRate }}%</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</uv-list-item>
|
||||||
|
|
||||||
|
|
||||||
|
</uv-list>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.list {
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
padding: 8px 30rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
399
pages/components/ReportExcel.vue
Normal file
399
pages/components/ReportExcel.vue
Normal file
@@ -0,0 +1,399 @@
|
|||||||
|
<template>
|
||||||
|
<navigation :title="typeInfo?.title" :back-url="typeInfo?.backUrl"></navigation>
|
||||||
|
|
||||||
|
<view class="report-page contentBox">
|
||||||
|
<uv-form v-if="typeInfo?.mode" labelPosition="top" labelWidth="100" class="form" :model="formData"
|
||||||
|
ref="formRef">
|
||||||
|
|
||||||
|
<uv-form-item prop="beginDate">
|
||||||
|
<view class="carPickerText" :style="formData.beginDate ? 'color: #303133;' : ''"
|
||||||
|
@tap="openCalendar('start')">
|
||||||
|
<text class="mr-16"> {{ formData.beginDate || '请选择开始月份' }}</text>
|
||||||
|
<uv-icon name="arrow-down-fill" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</uv-form-item>
|
||||||
|
<text style="width: 20%; text-align: center;">至</text>
|
||||||
|
<uv-form-item prop="endDate ">
|
||||||
|
<view class="carPickerText" :style="formData.endDate ? 'color: #303133;' : ''"
|
||||||
|
@tap=" openCalendar('end')">
|
||||||
|
<text class="mr-16">{{ formData.endDate || '请选择结束月份' }}</text>
|
||||||
|
<uv-icon name="arrow-down-fill" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</uv-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</uv-form>
|
||||||
|
|
||||||
|
<view class="topSearch " v-if="!typeInfo?.mode">
|
||||||
|
<uni-easyinput type="text" v-model="formData.keyword" prefixIcon="search" :inputBorder="false"
|
||||||
|
@iconClick="getReport" placeholder="请输入搜索内容" />
|
||||||
|
</view>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<scroll-view class="table-scroll containerBox" scroll-x>
|
||||||
|
<view class="table-box">
|
||||||
|
<view class="table-header" border>
|
||||||
|
<view class="th key-col"></view>
|
||||||
|
<view class="th">A</view>
|
||||||
|
<view class="th">B</view>
|
||||||
|
<view class="th">C</view>
|
||||||
|
<view class="th">D</view>
|
||||||
|
<view class="th">E</view>
|
||||||
|
<view class="th">F</view>
|
||||||
|
<view class="th">G</view>
|
||||||
|
<view class="th">H</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="table-header" v-if="keyType === 'dailyReport' || keyType === 'monthlyReport'">
|
||||||
|
<view class="th key-col"></view>
|
||||||
|
<view class="th">物料编码</view>
|
||||||
|
<view class="th">物料名称</view>
|
||||||
|
<view class="th">物料规格</view>
|
||||||
|
<view class="th">计量单位</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view v-if="keyType === 'dailyReport'" class="th">上日结余</view>
|
||||||
|
<view v-if="keyType === 'dailyReport'" class="th">日入库</view>
|
||||||
|
<view v-if="keyType === 'dailyReport'" class="th">日出库</view>
|
||||||
|
<view v-if="keyType === 'dailyReport'" class="th">日结余</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view v-if="keyType === 'monthlyReport'" class="th">上月结余</view>
|
||||||
|
<view v-if="keyType === 'monthlyReport'" class="th">月入库</view>
|
||||||
|
<view v-if="keyType === 'monthlyReport'" class="th">月出库</view>
|
||||||
|
<view v-if="keyType === 'monthlyReport'" class="th">日结余</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="table-header" v-if="keyType === 'companyReport' || keyType === 'warehouseReport'">
|
||||||
|
<view class="th key-col"></view>
|
||||||
|
<view class="th">物料编码</view>
|
||||||
|
<view class="th">物料名称</view>
|
||||||
|
<view class="th">库存量</view>
|
||||||
|
<view class="th">计量单位</view>
|
||||||
|
<view class="th">物料类别</view>
|
||||||
|
<view class="th">物料分类</view>
|
||||||
|
<view class="th">物料规格</view>
|
||||||
|
<view class="th">物料型号</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="table-body" v-if="keyType === 'dailyReport' || keyType === 'monthlyReport'">
|
||||||
|
<view class="tr" v-for="(item, index) in list" :key="item.materialId">
|
||||||
|
<view class="td key-col">{{ index + 1 }}</view>
|
||||||
|
<view class="td">{{ item.materialCode }}</view>
|
||||||
|
<view class="td">{{ item.materialName }}</view>
|
||||||
|
<view class="td">{{ item.specification || '-' }}</view>
|
||||||
|
<view class="td">{{ item.unitName }}</view>
|
||||||
|
<view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="td">{{ item.previousBalance }}</view>
|
||||||
|
<view class="td">{{ item.dailyInbound }}</view>
|
||||||
|
<view class="td">{{ item.dailyOutbound }}</view>
|
||||||
|
<view class="td">{{ item.dailyBalance }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="empty" v-if="list.length === 0">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="table-body" v-if="keyType === 'companyReport' || keyType === 'warehouseReport'">
|
||||||
|
<view class="tr" v-for="(item, index) in list" :key="item.materialId">
|
||||||
|
<view class="td key-col">{{ index + 1 }}</view>
|
||||||
|
<view class="td">{{ item.materialCode }}</view>
|
||||||
|
<view class="td">{{ item.materialName }}</view>
|
||||||
|
<view class="td">{{ item?.stockQty || item?.quantity }}</view>
|
||||||
|
<view class="td">{{ item.unitName }}</view>
|
||||||
|
<view class="td">{{ item.typeName }}</view>
|
||||||
|
<view class="td">{{ item.materialShortName }}</view>
|
||||||
|
<view class="td">{{ item.specification }}</view>
|
||||||
|
<view class="td">{{ item.model }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="empty" v-if="list.length === 0">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<uv-datetime-picker :mode="typeInfo?.mode" v-model="pickerValue" ref="calendarRef"
|
||||||
|
@confirm="confirm"></uv-datetime-picker>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { dailyReportList, companyStockReportList } from "@/api/report";
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
import { ref, reactive, toRefs, watch } from 'vue';
|
||||||
|
import { formatDate } from "../until";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import Navigation from '../components/Navigation.vue';
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import { inventoryList } from '@/api/inventoryInfo';
|
||||||
|
|
||||||
|
const OPERATE_CONFIG = {
|
||||||
|
dailyReport: {
|
||||||
|
mode: 'date',
|
||||||
|
title: '库存日报',
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
backUrl: '/pages/warehousing/Report/daily'
|
||||||
|
},
|
||||||
|
monthlyReport: {
|
||||||
|
mode: 'year-month',
|
||||||
|
title: '库存月报',
|
||||||
|
format: 'YYYY-MM',
|
||||||
|
backUrl: '/pages/warehousing/Report/monthly'
|
||||||
|
},
|
||||||
|
companyReport: {
|
||||||
|
mode: '',
|
||||||
|
title: '公司库存报表',
|
||||||
|
format: '',
|
||||||
|
backUrl: 'pages/warehousing/index'
|
||||||
|
},
|
||||||
|
warehouseReport: {
|
||||||
|
mode: '',
|
||||||
|
title: '',
|
||||||
|
format: '',
|
||||||
|
backUrl: 'pages/warehousing/Report/warehouse'
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
const props = defineProps({
|
||||||
|
keyType: { //报表:日、月
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { keyType } = toRefs(props)
|
||||||
|
|
||||||
|
let currentType = '' // start / end
|
||||||
|
const pickerValue = ref('')
|
||||||
|
const calendarRef = ref(null)
|
||||||
|
|
||||||
|
const list = ref([])
|
||||||
|
const pathParams = ref({})
|
||||||
|
const typeInfo = ref({
|
||||||
|
mode: '',
|
||||||
|
title: '库存日报',
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
backUrl: '/pages/warehousing/report/daily'
|
||||||
|
})
|
||||||
|
|
||||||
|
const formData = reactive({
|
||||||
|
beginDate: formatDate(dayjs(), typeInfo.value.format),
|
||||||
|
endDate: formatDate(dayjs(), typeInfo.value.format),
|
||||||
|
keyword: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取数据
|
||||||
|
const getReport = () => {
|
||||||
|
let params = {}
|
||||||
|
if (keyType.value == 'monthlyReport') {
|
||||||
|
params.warehouseCode = pathParams.value.warehouseCode
|
||||||
|
params.beginDate = dayjs(formData.beginDate).startOf('month').format('YYYY-MM-DD')
|
||||||
|
params.endDate = dayjs(params.endDate).endOf('month').format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
|
if (keyType.value == 'dailyReport') {
|
||||||
|
params.warehouseCode = pathParams.value.warehouseCode
|
||||||
|
params.beginDate = formData.beginDate
|
||||||
|
params.endDate = formData.endDate
|
||||||
|
}
|
||||||
|
if (keyType.value == 'companyReport') {
|
||||||
|
params.keyword = formData.keyword
|
||||||
|
|
||||||
|
}
|
||||||
|
if (keyType.value == 'warehouseReport') {
|
||||||
|
params.keyword = formData.keyword
|
||||||
|
params.warehouseCode = pathParams.value.warehouseCode
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log(params, '参数===》');
|
||||||
|
if (keyType.value == 'companyReport') {
|
||||||
|
companyStockReportList(params).then(res => {
|
||||||
|
if (res && res.code == 200) {
|
||||||
|
list.value = res.data || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (keyType.value == 'monthlyReport' || keyType.value == 'dailyReport') {
|
||||||
|
dailyReportList(params).then(res => {
|
||||||
|
if (res && res.code == 200) {
|
||||||
|
list.value = res.data || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else if (keyType.value == 'warehouseReport') {
|
||||||
|
inventoryList(params).then(res => {
|
||||||
|
if (res && res.code == 200) {
|
||||||
|
list.value = res.data || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getReport()
|
||||||
|
if (keyType.value == 'monthlyReport' || keyType.value == 'dailyReport') {
|
||||||
|
formData.beginDate = formatDate(dayjs(), typeInfo.value.format)
|
||||||
|
formData.endDate = formatDate(dayjs(), typeInfo.value.format)
|
||||||
|
}
|
||||||
|
if (keyType.value == 'companyReport') {
|
||||||
|
formData.keyword = ''
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
// 确定选择
|
||||||
|
const confirm = (val) => {
|
||||||
|
console.log('确定按钮');
|
||||||
|
|
||||||
|
if (currentType === 'start') {
|
||||||
|
formData.beginDate = formatDate(val.value, typeInfo.value.format)
|
||||||
|
} else {
|
||||||
|
formData.endDate = formatDate(val.value, typeInfo.value.format)
|
||||||
|
}
|
||||||
|
getReport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开始、结束日期选择器
|
||||||
|
const openCalendar = (val) => {
|
||||||
|
if (val == 'start') pickerValue.value = formData.beginDate
|
||||||
|
else pickerValue.value = formData.endDate
|
||||||
|
currentType = val
|
||||||
|
calendarRef.value.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options || {}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(() => keyType.value,
|
||||||
|
(d) => {
|
||||||
|
if (!d) return;
|
||||||
|
typeInfo.value = OPERATE_CONFIG[d]
|
||||||
|
if (pathParams.value.title) {
|
||||||
|
typeInfo.value.title = pathParams.value.title + '库存报表'
|
||||||
|
}
|
||||||
|
|
||||||
|
}, { deep: true, immediate: true })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.report-page {
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-item {
|
||||||
|
flex: 1;
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-scroll {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-box {
|
||||||
|
width: 1000rpx;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-header {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.th,
|
||||||
|
.td {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 120rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.th {
|
||||||
|
color: #333;
|
||||||
|
border: 1rpx solid #f0f0f0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.td {
|
||||||
|
color: #666;
|
||||||
|
border: 1rpx solid #f0f0f0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tr:last-child {
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-col {
|
||||||
|
width: 40px;
|
||||||
|
background: #f8f9fa;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tr {
|
||||||
|
display: flex;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.form {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.uv-form-item {
|
||||||
|
width: 45%;
|
||||||
|
|
||||||
|
.uv-form-item__body {
|
||||||
|
text-align: center;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.carPickerText {
|
||||||
|
border-bottom: 1px solid #D3D3D3;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topSearch {
|
||||||
|
position: fixed;
|
||||||
|
top: 65rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
padding: 4rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -12,24 +12,24 @@
|
|||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
|
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
|
||||||
<uni-list class="listBox">
|
<uni-list class="listBox">
|
||||||
<uni-list-item v-for="item in list" :key="item.id" clickable @click="onDetail(item)">
|
<uni-list-item v-for="item in list" :key="item.id" clickable @tap="onDetail(item)">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<view style="display: flex; flex-direction: column; width: 100%;">
|
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||||
<view class="line title">
|
<view class="line title">
|
||||||
<p> {{ typeName }}编号:{{ item.billNo }}</p>
|
<p> {{ typeName }}编号:{{ item.billNo }}</p>
|
||||||
<span :style="getColor(item?.billType)">
|
<text :style="getColor(item?.billType)">
|
||||||
{{ getBillType(item?.billType, item?.status, flag) }}
|
{{ getBillType(item?.billType, item?.status, flag) }}
|
||||||
</span>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<p class="line content">{{ typeName }}类型:
|
<p class="line content">{{ typeName }}类型:
|
||||||
<span>{{ getOrderType(item.status) }}</span>
|
<text>{{ getOrderType(item.status) }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p class="line content">库位:
|
<p class="line content">库位:
|
||||||
<span v-if="item.warehouseName">{{ item.warehouseName }}/</span>
|
<text v-if="item.warehouseName">{{ item.warehouseName }}/</text>
|
||||||
<span v-if="item.areaName"> {{ item.areaName }}</span>
|
<text v-if="item.areaName"> {{ item.areaName }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p class="line content">开单时间:
|
<p class="line content">开单时间:
|
||||||
<span>{{ item.createTime }}</span>
|
<text>{{ item.createTime }}</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<!-- 获取仓库数据 -->
|
<!-- 获取仓库数据 -->
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<uv-form ref="formRef" class="form" :model="formData" label-width="150rpx">
|
<uv-form ref="formRef" class="form" :model="formData" label-width="150rpx">
|
||||||
<!-- 仓库 -->
|
<!-- 仓库 -->
|
||||||
<uv-form-item label="仓库" prop="warehouse">
|
<uv-form-item label="仓库" prop="warehouse">
|
||||||
<u-cell @click="onClick('warehouse')">
|
<u-cell @tap="onClick('warehouse')">
|
||||||
<view slot="title" class="u-slot-title">
|
<view slot="title" class="u-slot-title">
|
||||||
<text class="u-cell-text" v-if="formData?.warehousing?.[0]?.deptName">
|
<text class="u-cell-text" v-if="formData?.warehousing?.[0]?.deptName">
|
||||||
{{ formData?.warehousing?.[0].deptName }}
|
{{ formData?.warehousing?.[0].deptName }}
|
||||||
@@ -16,7 +17,18 @@
|
|||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<!-- 存储区 -->
|
<!-- 存储区 -->
|
||||||
<uv-form-item label="存储区" prop="storageArea">
|
<uv-form-item label="存储区" prop="storageArea">
|
||||||
<u-cell @click="onClick('storageArea')">
|
<u-cell @tap="onClick('storageArea')">
|
||||||
|
<view slot="title" class="u-slot-title">
|
||||||
|
<text class="u-cell-text" v-if="formData?.storageArea?.[0]?.deptName">
|
||||||
|
{{ formData?.storageArea?.[0].deptName }}
|
||||||
|
</text>
|
||||||
|
<text class="placeholder" v-else> 请选择运输单元</text>
|
||||||
|
<uni-icons type="right" size="10" />
|
||||||
|
</view>
|
||||||
|
</u-cell>
|
||||||
|
</uv-form-item>
|
||||||
|
<uv-form-item v-if="pathParams.type === 'transport'" label="运输单元" prop="storageArea">
|
||||||
|
<u-cell @tap="onClick('storageArea')">
|
||||||
<view slot="title" class="u-slot-title">
|
<view slot="title" class="u-slot-title">
|
||||||
<text class="u-cell-text" v-if="formData?.storageArea?.[0]?.deptName">
|
<text class="u-cell-text" v-if="formData?.storageArea?.[0]?.deptName">
|
||||||
{{ formData?.storageArea?.[0].deptName }}
|
{{ formData?.storageArea?.[0].deptName }}
|
||||||
@@ -26,6 +38,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
|
<!-- 打卡图片 -->
|
||||||
|
<uv-form-item v-if="pathParams.type === 'transport'" label="打卡图片" prop="fileList" class="topLabel">
|
||||||
|
<uv-upload :fileList="formData?.fileList" name="1" multiple :maxCount="6" @afterRead="afterRead"
|
||||||
|
@delete="deleteImg" :previewFullImage="true"></uv-upload>
|
||||||
|
|
||||||
|
</uv-form-item>
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
<uv-form-item label="备注">
|
<uv-form-item label="备注">
|
||||||
<uv-input v-model="formData.remark" placeholder="请输入备注" align="right" border="none" />
|
<uv-input v-model="formData.remark" placeholder="请输入备注" align="right" border="none" />
|
||||||
@@ -57,6 +75,7 @@ const { warehouseInfo, pathParams } = toRefs(props)
|
|||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = ref({ remark: '', warehousing: '', storageArea: '' })
|
const formData = ref({ remark: '', warehousing: '', storageArea: '' })
|
||||||
|
|
||||||
|
|
||||||
// 赋值:更新列表值
|
// 赋值:更新列表值
|
||||||
const setFormData = (d) => {
|
const setFormData = (d) => {
|
||||||
if (!d) return;
|
if (!d) return;
|
||||||
@@ -101,6 +120,21 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.topLabel {
|
||||||
|
.uv-form-item__body {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-textarea {
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-upload {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.uv-form-item__body {
|
.uv-form-item__body {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 12rpx;
|
padding: 12rpx;
|
||||||
|
|||||||
@@ -1,24 +1,12 @@
|
|||||||
<!-- 底部导航栏:智能 -->
|
<!-- 底部导航栏:智能 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
智能
|
<ProjectOverView />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import ProjectOverView from '../components/ProjectOverView.vue'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
title: 'Hello'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-form-item label="验证码" prop="userInfo.code" v-if="captchaEnabled" borderBottom>
|
<uv-form-item label="验证码" prop="userInfo.code" v-if="captchaEnabled" borderBottom>
|
||||||
<uv-input v-model="formModel.userInfo.code" border="none" placeholder="请输入验证码" />
|
<uv-input v-model="formModel.userInfo.code" border="none" placeholder="请输入验证码" />
|
||||||
<uv-image :src="codeUrl" @click="getCode" width="200rpx" height="70rpx"></uv-image>
|
<uv-image :src="codeUrl" @tap="getCode" width="200rpx" height="70rpx"></uv-image>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-button type="primary" size="large" text="登 录" shape="circle" color="#199793" customStyle="margin-top: 50px"
|
<uv-button type="primary" size="large" text="登 录" shape="circle" color="#199793" customStyle="margin-top: 50px"
|
||||||
@click="submit"></uv-button>
|
@tap="submit"></uv-button>
|
||||||
</uv-form>
|
</uv-form>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<!-- 底部导航栏:我的 -->
|
<!-- 底部导航栏:我的 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="contentBox">
|
<view class="content">
|
||||||
|
|
||||||
<view class="userInfo">
|
<view class="userInfo">
|
||||||
<uv-image src="../../static/avatar.png" width="120rpx" height="120rpx" shape="circle" />
|
<uv-image src="../../static/avatar.png" width="80rpx" height="80rpx" shape="circle" />
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<h3 class="nickName">{{ userInfo?.nickName }}</h3>
|
<h3 class="nickName">{{ userInfo?.nickName }}</h3>
|
||||||
<p class="tag">{{ userInfo?.dept.deptName }}</p>
|
<p class="tag">{{ userInfo?.dept.deptName }}</p>
|
||||||
@@ -14,7 +13,7 @@
|
|||||||
<view style="margin-top: 24rpx;">
|
<view style="margin-top: 24rpx;">
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item v-for="(item, index) in menuList" :key="item.id" :title="item.title" :thumb="item.thumb"
|
<uni-list-item v-for="(item, index) in menuList" :key="item.id" :title="item.title" :thumb="item.thumb"
|
||||||
thumb-size="sm" link @click="item.click" clickable />
|
thumb-size="sm" link @tap="item.click" clickable />
|
||||||
</uni-list>
|
</uni-list>
|
||||||
</view>
|
</view>
|
||||||
<uni-popup ref="popupRef" type="center" background-color="#fff" borderRadius="8px">
|
<uni-popup ref="popupRef" type="center" background-color="#fff" borderRadius="8px">
|
||||||
@@ -22,8 +21,8 @@
|
|||||||
<view class="popup-body">
|
<view class="popup-body">
|
||||||
<p>确定退出登录吗?</p>
|
<p>确定退出登录吗?</p>
|
||||||
<view class="popup-btn">
|
<view class="popup-btn">
|
||||||
<uv-button type="primary" @click="toLogout" text="确定"></uv-button>
|
<uv-button type="primary" @tap="toLogout" text="确定"></uv-button>
|
||||||
<uv-button @click="close" type="info " text="取消"></uv-button>
|
<uv-button @tap="close" type="info " text="取消"></uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -96,12 +95,13 @@ getUserInfo();
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.userInfo {
|
.userInfo {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 36rpx;
|
padding: 24rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
margin-left: 48rpx;
|
margin-left: 48rpx;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import { find } from "lodash";
|
||||||
import numeral from "numeral";
|
import numeral from "numeral";
|
||||||
|
// 状态(0草稿,1已提交,9已作废)
|
||||||
|
export const declareType = [
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
label: "草稿",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "1",
|
||||||
|
label: "提交申报",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "9",
|
||||||
|
label: "已取消 ",
|
||||||
|
},
|
||||||
|
];
|
||||||
// 订单状态
|
// 订单状态
|
||||||
// 0=入库申请,1=入库成功,2=出库申请,3=出库成功,4=作废
|
// 0=入库申请,1=入库成功,2=出库申请,3=出库成功,4=作废
|
||||||
const billTypeMenu = [
|
const billTypeMenu = [
|
||||||
@@ -98,8 +114,12 @@ export const formatDate = (t, fmt = "YYYY-MM-DD HH:mm:ss") =>
|
|||||||
export const formatNum = (num, fmt = "0.00") =>
|
export const formatNum = (num, fmt = "0.00") =>
|
||||||
num ? numeral(num).format(fmt) : "-";
|
num ? numeral(num).format(fmt) : "-";
|
||||||
|
|
||||||
// 入库单/出库单:获取已入库、出库数量
|
/**
|
||||||
// item:此列数据 type:已入库、剩余数量
|
* 入库单/出库单:获取已入库、出库数量
|
||||||
|
* @param {object} item - 此列数据
|
||||||
|
* @param {string|number} type - 已入库、剩余数量
|
||||||
|
* @returns {string|number} 数量
|
||||||
|
*/
|
||||||
export const getStockQuantity = (item, type) => {
|
export const getStockQuantity = (item, type) => {
|
||||||
const num = item.quantity;
|
const num = item.quantity;
|
||||||
const status = item.status;
|
const status = item.status;
|
||||||
@@ -126,6 +146,8 @@ export const removeStorage = () => {
|
|||||||
uni.removeStorageSync("app_billRemark");
|
uni.removeStorageSync("app_billRemark");
|
||||||
uni.removeStorageSync("app_material");
|
uni.removeStorageSync("app_material");
|
||||||
uni.removeStorageSync("app_material_select_list");
|
uni.removeStorageSync("app_material_select_list");
|
||||||
|
uni.removeStorageSync("app_technical");
|
||||||
|
uni.removeStorageSync("app_declaration");
|
||||||
};
|
};
|
||||||
|
|
||||||
// 对象转 URL 查询字符串 ?a=1&b=2
|
// 对象转 URL 查询字符串 ?a=1&b=2
|
||||||
@@ -140,29 +162,45 @@ export const objectToQuery = (params) => {
|
|||||||
};
|
};
|
||||||
// 获取配置的导航路由
|
// 获取配置的导航路由
|
||||||
export const getTabBarList = () => {
|
export const getTabBarList = () => {
|
||||||
// 1. 从 uni-app 全局配置中读取 tabBar
|
|
||||||
const tabBarConfig = __uniConfig.tabBar || {};
|
const tabBarConfig = __uniConfig.tabBar || {};
|
||||||
// 2. 获取 list 数组
|
|
||||||
const tabList = tabBarConfig.list || [];
|
const tabList = tabBarConfig.list || [];
|
||||||
return tabList;
|
return tabList;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 根据数组以及状态值获取对应的label
|
||||||
|
* @param {Array} list - 数组
|
||||||
|
* @param {object} obj - 数组对应的name和value字段名
|
||||||
|
* @param {string} val - 当前状态值
|
||||||
|
* @returns {string|number} 数量
|
||||||
|
*/
|
||||||
|
export const getLabel = (
|
||||||
|
list,
|
||||||
|
val,
|
||||||
|
obj = { name: "label", value: "value" },
|
||||||
|
) => {
|
||||||
|
if (val) {
|
||||||
|
return find(list, (i) => i?.[obj?.value] === `${val}`)?.[obj?.name];
|
||||||
|
}
|
||||||
|
return "-";
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* 数组分组转换方法:按 parentName 分组
|
||||||
|
* @param {Array} arr 原始数组
|
||||||
|
* @returns {Array} 转换后的分组数组 [{parentName: '', items: []}]
|
||||||
|
*/
|
||||||
|
export function transformData(arr) {
|
||||||
|
const groupMap = arr.reduce((map, item) => {
|
||||||
|
const key = item.parentName;
|
||||||
|
if (!map[key]) {
|
||||||
|
map[key] = { parentName: key, items: [] };
|
||||||
|
}
|
||||||
|
map[key].items.push(item);
|
||||||
|
return map;
|
||||||
|
}, {});
|
||||||
|
|
||||||
// ======================
|
// 把对象转成数组返回
|
||||||
// 工具函数:blobUrl 转 可上传的临时文件路径
|
return Object.values(groupMap);
|
||||||
// ======================
|
|
||||||
export function blobToTempFilePath(blobUrl) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
// 1. 下载 blob 数据
|
|
||||||
uni.downloadFile({
|
|
||||||
url: blobUrl,
|
|
||||||
success: (res) => {
|
|
||||||
if (res.statusCode === 200) {
|
|
||||||
resolve(res.tempFilePath);
|
|
||||||
} else {
|
|
||||||
reject("下载失败");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: reject,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
export const getToken = () => {
|
||||||
|
return uni.getStorageSync("app_token");
|
||||||
|
};
|
||||||
|
|||||||
178
pages/utils/ws.js
Normal file
178
pages/utils/ws.js
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
import { getToken } from "../until";
|
||||||
|
|
||||||
|
let ws = null;
|
||||||
|
let reconnectTimer = null;
|
||||||
|
let manualClose = false;
|
||||||
|
let retryCount = 0;
|
||||||
|
const subscribers = new Set();
|
||||||
|
|
||||||
|
const WS_PATH = "/ws";
|
||||||
|
const MAX_RECONNECT_DELAY = 30000;
|
||||||
|
|
||||||
|
function getWsBaseUrl() {
|
||||||
|
const baseApi = import.meta.env.VITE_APP_BASE_API || "";
|
||||||
|
|
||||||
|
if (/^https?:\/\//.test(baseApi)) {
|
||||||
|
return baseApi.replace(/^http/, "ws").replace(/\/$/, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// UniApp 没有 window,用 uni 接口获取
|
||||||
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
|
const isH5 = platform === "h5";
|
||||||
|
const protocol =
|
||||||
|
isH5 && window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||||
|
|
||||||
|
let host = "";
|
||||||
|
if (isH5) {
|
||||||
|
host = window.location.host;
|
||||||
|
} else {
|
||||||
|
// 非H5(小程序/App)需要你配置真实域名
|
||||||
|
host = "你的后端域名";
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${protocol}//${host}${baseApi}`.replace(/\/$/, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildWsUrl() {
|
||||||
|
const baseUrl = getWsBaseUrl();
|
||||||
|
const url = `${baseUrl}${WS_PATH}`;
|
||||||
|
const token = getToken();
|
||||||
|
|
||||||
|
const params = new URLSearchParams();
|
||||||
|
if (token) {
|
||||||
|
params.append("token", token);
|
||||||
|
}
|
||||||
|
|
||||||
|
const query = params.toString();
|
||||||
|
return query ? `${url}?${query}` : url;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function connectWs(onMessage) {
|
||||||
|
if (!getToken()) {
|
||||||
|
console.warn("[WebSocket] missing token");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof onMessage === "function") {
|
||||||
|
subscribers.add(onMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
manualClose = false;
|
||||||
|
clearReconnectTimer();
|
||||||
|
|
||||||
|
if (ws) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== UniApp 专用 ==========
|
||||||
|
ws = uni.connectSocket({
|
||||||
|
url: buildWsUrl(),
|
||||||
|
success: () => {},
|
||||||
|
});
|
||||||
|
|
||||||
|
ws.onOpen = () => {
|
||||||
|
retryCount = 0;
|
||||||
|
console.log("[WebSocket] connected");
|
||||||
|
};
|
||||||
|
|
||||||
|
ws.onMessage = (event) => {
|
||||||
|
let data = event.data;
|
||||||
|
try {
|
||||||
|
data = JSON.parse(event.data);
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
subscribers.forEach((handler) => {
|
||||||
|
try {
|
||||||
|
handler(data, event);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("[WebSocket] subscriber error", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ws.onClose = () => {
|
||||||
|
console.log("[WebSocket] closed");
|
||||||
|
ws = null;
|
||||||
|
|
||||||
|
if (!manualClose && subscribers.size > 0) {
|
||||||
|
reconnectTimer = setTimeout(() => {
|
||||||
|
console.log("[WebSocket] reconnecting");
|
||||||
|
connectWs();
|
||||||
|
}, getReconnectDelay());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ws.onError = (error) => {
|
||||||
|
console.error("[WebSocket] error", error);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function closeWs(onMessage) {
|
||||||
|
if (typeof onMessage === "function") {
|
||||||
|
subscribers.delete(onMessage);
|
||||||
|
} else {
|
||||||
|
subscribers.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subscribers.size > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualClose = true;
|
||||||
|
retryCount = 0;
|
||||||
|
clearReconnectTimer();
|
||||||
|
|
||||||
|
if (ws) {
|
||||||
|
ws.close();
|
||||||
|
ws = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function reconnectWs(onMessage) {
|
||||||
|
if (typeof onMessage === "function") {
|
||||||
|
subscribers.add(onMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
manualClose = false;
|
||||||
|
retryCount = 0;
|
||||||
|
clearReconnectTimer();
|
||||||
|
|
||||||
|
if (ws) {
|
||||||
|
ws.close();
|
||||||
|
ws = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualClose = false;
|
||||||
|
connectWs();
|
||||||
|
}
|
||||||
|
|
||||||
|
export function sendWs(data) {
|
||||||
|
if (!ws) {
|
||||||
|
console.warn("[WebSocket] send failed, socket is not open");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ws.send({
|
||||||
|
data: typeof data === "string" ? data : JSON.stringify(data),
|
||||||
|
success: () => {},
|
||||||
|
fail: () => {},
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWsState() {
|
||||||
|
if (!ws) return 3; // CLOSED
|
||||||
|
return ws.readyState;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getReconnectDelay() {
|
||||||
|
retryCount += 1;
|
||||||
|
return Math.min(5000 * retryCount, MAX_RECONNECT_DELAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearReconnectTimer() {
|
||||||
|
if (reconnectTimer) {
|
||||||
|
clearTimeout(reconnectTimer);
|
||||||
|
reconnectTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
214
pages/warehousing/Declaration/components/detail.vue
Normal file
214
pages/warehousing/Declaration/components/detail.vue
Normal file
@@ -0,0 +1,214 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 自定义导航栏 -->
|
||||||
|
<navigation :title="pathParams.billNo" :back-url="backUrl">
|
||||||
|
<template #right>
|
||||||
|
<view class="right-btn flex align-center justify-center ">
|
||||||
|
<uv-image @tap="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
|
||||||
|
style="margin-top:10rpx" />
|
||||||
|
<uv-image v-if="detailInfo.status != '9'" @tap="toEditOrAway('2')" src="../../../../static/edit.png"
|
||||||
|
class="ml-24" width="20px" height="20px" style="margin-top:10rpx" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</navigation>
|
||||||
|
<view class="contentBox">
|
||||||
|
<view class="detailInfo mb-2">
|
||||||
|
<view class="line title">
|
||||||
|
<p> 申报单号:{{ detailInfo?.billNo }}</p>
|
||||||
|
<text>{{ getLabel(declareType, detailInfo?.status) }}</text>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<p class="line content">联系人:
|
||||||
|
<text> {{ detailInfo?.contactName || '-' }}</text>
|
||||||
|
</p>
|
||||||
|
<p class="line content">联系电话:
|
||||||
|
<text> {{ detailInfo?.contactPhone || '-' }}</text>
|
||||||
|
</p>
|
||||||
|
<p class="line content">地址:
|
||||||
|
<text>{{ detailInfo?.address || '-' }}</text>
|
||||||
|
</p>
|
||||||
|
<p class="line content">交付时间:
|
||||||
|
<text>{{ detailInfo?.deliveryTime ? detailInfo?.deliveryTime === '0' ? '15天' :
|
||||||
|
detailInfo?.deliveryTime === '1' ? '立即' : '其他' : '-' }}</text>
|
||||||
|
</p>
|
||||||
|
<p class="line content">申报时间:
|
||||||
|
<text>{{ detailInfo?.createTime || '-' }}</text>
|
||||||
|
</p>
|
||||||
|
<view class="detailInfo mb-2 mt-4">
|
||||||
|
<view class="line title">
|
||||||
|
<p> 打卡图片</p>
|
||||||
|
</view>
|
||||||
|
<view class="line">
|
||||||
|
<uv-upload :fileList="detailInfo?.fileList" name="3" multiple
|
||||||
|
:maxCount="detailInfo?.fileList?.length" :previewFullImage="true"></uv-upload>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 物料列表 -只读 -->
|
||||||
|
|
||||||
|
<material-list ref="materialRef" isEdit="3" :extendData="{ billType: detailInfo?.billType }"
|
||||||
|
:pathParams="{ billNo: detailInfo?.billNo }" backStr="declarationDetail"
|
||||||
|
:formData="{ material: detailInfo.itemList }" />
|
||||||
|
|
||||||
|
<!-- 底部按钮 -->
|
||||||
|
<view :class="detailInfo.status == '9' ? 'bottom1' : 'bottom'">
|
||||||
|
<uv-button type="error" v-if="detailInfo.status != '9'" text="作废" @tap="toObsolete"></uv-button>
|
||||||
|
<uv-button type="primary" text="申报单转入库单" @tap="toEditOrAway('1')"></uv-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import _ from 'lodash';
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
import { objectToQuery, getLabel, declareType, removeStorage } from '../../../until';
|
||||||
|
import { declareBillDetail, declareBillVoid } from '@/api/declaration';
|
||||||
|
import MaterialList from '../../../components/MaterialList.vue';
|
||||||
|
import Navigation from '../../../components/Navigation.vue';
|
||||||
|
// ref:返回路径
|
||||||
|
const backUrl = ref('')
|
||||||
|
// 数据:路径参数
|
||||||
|
const pathParams = ref('')
|
||||||
|
// 数据:详情
|
||||||
|
const detailInfo = ref('')
|
||||||
|
// type
|
||||||
|
const OPERATE_CONFIG = {
|
||||||
|
declaration: {
|
||||||
|
back: '/pages/warehousing/Declaration/my',
|
||||||
|
backType: 'declaration_detail',
|
||||||
|
|
||||||
|
},
|
||||||
|
my: {
|
||||||
|
back: '/pages/warehousing/Declaration/my',
|
||||||
|
backType: 'declaration_detail'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打印
|
||||||
|
const onPrinter = () => { }
|
||||||
|
// 获取详情
|
||||||
|
const getDetailInfo = () => {
|
||||||
|
declareBillDetail({ billNo: pathParams.value.billNo }).then((res) => {
|
||||||
|
const fileList = _.map(res.data?.fileList, (i) => ({ ...i, url: i.fileUrl, name: i?.fileName, }))
|
||||||
|
detailInfo.value = { ...res.data, fileList: fileList }
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 作废
|
||||||
|
const toObsolete = () => {
|
||||||
|
declareBillVoid({
|
||||||
|
id: detailInfo.value.id
|
||||||
|
}).then((res) => {
|
||||||
|
console.log();
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '申报单作废成功',
|
||||||
|
mask: true,
|
||||||
|
icon: 'success',
|
||||||
|
})
|
||||||
|
getDetailInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const setStorage = () => {
|
||||||
|
removeStorage()
|
||||||
|
uni.setStorageSync('app_material', detailInfo.value.itemList)
|
||||||
|
uni.setStorageSync('app_declaration', detailInfo.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路径跳转操作 编辑、转为入库单
|
||||||
|
* @param {any} type - 类型标识,1 转为入库单 2 编辑
|
||||||
|
*/
|
||||||
|
const toEditOrAway = (key) => {
|
||||||
|
const query = objectToQuery(pathParams.value)
|
||||||
|
setStorage()
|
||||||
|
|
||||||
|
if (key === '1') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/stockIn/create${query}`
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/Declaration/create${query}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 接收路径参数
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options;
|
||||||
|
const { type } = options;
|
||||||
|
let queryStr = objectToQuery(options);
|
||||||
|
let query = { ...options }
|
||||||
|
if (!options.billNo) {
|
||||||
|
uni.showToast({ title: '参数错误,无唯一码ID', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type != 'my') {
|
||||||
|
const { billNo, ...restParams } = options;
|
||||||
|
queryStr = objectToQuery(restParams);
|
||||||
|
}
|
||||||
|
backUrl.value = OPERATE_CONFIG?.[pathParams.value.type]?.back + `${queryStr}`
|
||||||
|
getDetailInfo()
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
// 底部按钮
|
||||||
|
.bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
height: 60rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.uv-button-wrapper {
|
||||||
|
width: 50%;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
align-items: center;
|
||||||
|
padding: 6rpx 20rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: 600;
|
||||||
|
border-bottom: 0.5px solid #ECEFF1;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom1 {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
height: 60rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
// justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.uv-button-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
170
pages/warehousing/Declaration/components/materialQueryDetail.vue
Normal file
170
pages/warehousing/Declaration/components/materialQueryDetail.vue
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<template>
|
||||||
|
<navigation title="物料库存查询" back-url="/pages/warehousing/Declaration/materialQuery" />
|
||||||
|
|
||||||
|
<view class="contentBox">
|
||||||
|
<view class="topSearch">
|
||||||
|
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
|
||||||
|
@iconClick="getList" placeholder="请输入搜索内容" />
|
||||||
|
</view>
|
||||||
|
<!-- 物料库存查询 -->
|
||||||
|
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getDetailInfo">
|
||||||
|
<uni-list class="listBox">
|
||||||
|
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
|
||||||
|
<template v-slot:body>
|
||||||
|
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||||
|
<view class="line title">
|
||||||
|
<p>{{ item.materialName }} - {{ item.materialCode }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content" style="color: #F44336;">
|
||||||
|
<p>库存量</p>
|
||||||
|
<p>{{ item.stockQty }}{{ item.unitName }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>所在仓库</p>
|
||||||
|
<p>{{ item.warehouseName }} - {{ item.areaName }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料类别</p>
|
||||||
|
<p>{{ item.typeName }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料规格</p>
|
||||||
|
<p>{{ item.specification }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料型号</p>
|
||||||
|
<p> <text v-if="item?.model">{{ item?.model }}</text>
|
||||||
|
<text v-else class="empty">未填写</text>
|
||||||
|
</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料说明</p>
|
||||||
|
<p>
|
||||||
|
<text v-if="item?.materialDesc">{{ item?.materialDesc }}</text>
|
||||||
|
<text v-else class="empty">未填写</text>
|
||||||
|
</p>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
</z-paging>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||||
|
import { stockList } from '@/api/declaration';
|
||||||
|
import Navigation from '../../../components/Navigation.vue';
|
||||||
|
import { objectToQuery } from '../../../until';
|
||||||
|
|
||||||
|
const pathParams = ref('')
|
||||||
|
const queryParams = ref({
|
||||||
|
keyword: ''
|
||||||
|
})
|
||||||
|
const pagingRef = ref(null)
|
||||||
|
const infoList = ref([])
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options;
|
||||||
|
})
|
||||||
|
|
||||||
|
const getDetailInfo = () => {
|
||||||
|
const val = pathParams.value.warehouseCode
|
||||||
|
const params = {
|
||||||
|
warehouseCode: val,
|
||||||
|
keyword: queryParams.value.keyword
|
||||||
|
}
|
||||||
|
stockList(params).then(res => {
|
||||||
|
res.data.forEach(e => {
|
||||||
|
e.showMore = false;
|
||||||
|
});
|
||||||
|
infoList.value = res.data
|
||||||
|
pagingRef.value.complete(res.data)
|
||||||
|
}).catch(res => {
|
||||||
|
pagingRef.value.complete(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onChecked = (val) => {
|
||||||
|
const query = objectToQuery({ ...pathParams.value, materialId: val.materialId })
|
||||||
|
console.log(query);
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/InventoryInfo/components/inventoryAgeDetail${query}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onShow(() => {
|
||||||
|
pagingRef.value?.reload?.()
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.topSearch {
|
||||||
|
position: fixed;
|
||||||
|
top: 65rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
padding: 4rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerBox {
|
||||||
|
padding-top: 120rpx !important;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.zp-l-text-rpx {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.listBox {
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
|
||||||
|
.uni-list-item {
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list-item__container {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 4rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
background: #08a089;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
color: #D3D3D3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
385
pages/warehousing/Declaration/create.vue
Normal file
385
pages/warehousing/Declaration/create.vue
Normal file
@@ -0,0 +1,385 @@
|
|||||||
|
<template>
|
||||||
|
<navigation :title="title" :back-url="backUrl">
|
||||||
|
<template #right>
|
||||||
|
<my-link @tap="toMyDeclaration" style="font-size: 14px;">我的</my-link>
|
||||||
|
</template>
|
||||||
|
</navigation>
|
||||||
|
<view class="contentBox">
|
||||||
|
<uv-form ref="formRef" labelPosition="left" class="form" :model="formData" label-width="150rpx">
|
||||||
|
<!-- 联系人 -->
|
||||||
|
<uv-form-item label="联系人" prop="contactName">
|
||||||
|
<uv-input placeholder="请输入联系人" v-model="formData.contactName" clearable border="none" />
|
||||||
|
</uv-form-item>
|
||||||
|
<!-- 联系电话 -->
|
||||||
|
<uv-form-item label="联系电话" prop="contactPhone">
|
||||||
|
<uv-input placeholder="请输入联系电话" maxlength="11" type="number" v-model="formData.contactPhone" clearable
|
||||||
|
border="none" />
|
||||||
|
</uv-form-item>
|
||||||
|
<!-- 交付时间 -->
|
||||||
|
<uv-form-item label="交付时间" @tap="toChooseTime">
|
||||||
|
<view v-if="formData?.deliveryTime">{{ formData.deliveryTime
|
||||||
|
=== '0' ? '15天' : formData.deliveryTime === '1' ? '立即' : '其他' }}</view>
|
||||||
|
</uv-form-item>
|
||||||
|
<!-- 存放地址 -->
|
||||||
|
<uv-form-item label="存放地址" prop="address" class="topLabel">
|
||||||
|
<uv-textarea v-model="formData.address" placeholder="请输入存放地址" border="none"></uv-textarea>
|
||||||
|
</uv-form-item>
|
||||||
|
<!-- 申报图片 -->
|
||||||
|
<uv-form-item label="申报图片" prop="fileList" class="topLabel">
|
||||||
|
<uv-upload :fileList="formData?.fileList" name="1" multiple :maxCount="6" @afterRead="afterRead"
|
||||||
|
@delete="deleteImg" :previewFullImage="true"></uv-upload>
|
||||||
|
|
||||||
|
</uv-form-item>
|
||||||
|
</uv-form>
|
||||||
|
<!-- 物料列表 - 添加物料 -->
|
||||||
|
<MaterialList ref="materialRef" :formData="{ material: formData?.itemList }"
|
||||||
|
:isEdit="flag == 'declaration_edit' ? 5 : 1" :pathParams="{ ...pathParams.value, type: 'declaration' }"
|
||||||
|
@setStorage="toSetStorage" />
|
||||||
|
<!-- 底部操作栏 -->
|
||||||
|
<view class="bottom">
|
||||||
|
<uv-button @tap="scanCode">扫码添加</uv-button>
|
||||||
|
<uv-button type="primary" @tap="submitForm">提交</uv-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 选择物料 -->
|
||||||
|
<uv-modal ref="modalRef" class="chooseModal" :title="none" :showConfirmButton="false" :showCancelButton="false">
|
||||||
|
<p class="link" @tap="toCheckTime('0')">15天</p>
|
||||||
|
<p class="link" @tap="toCheckTime('1')">立即</p>
|
||||||
|
<p class="link" @tap="toCheckTime('2')">其他</p>
|
||||||
|
|
||||||
|
</uv-modal>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import _ from 'lodash';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
|
||||||
|
import { objectToQuery, removeStorage } from '../../until';
|
||||||
|
|
||||||
|
import { addDeclareBill, declareBillUpdate } from '@/api/declaration'
|
||||||
|
import { uploadTechnicalFile } from '@/api/stockOut'
|
||||||
|
import { getMaterialByQrCodeInfo } from '@/api/uniqueCode';
|
||||||
|
|
||||||
|
import Navigation from '../../components/Navigation.vue';
|
||||||
|
import MaterialList from '../../components/MaterialList.vue';
|
||||||
|
const OPERATE_CONFIG = {
|
||||||
|
declaration: {
|
||||||
|
title: '申报单开单',
|
||||||
|
back: 'pages/warehousing/index'
|
||||||
|
},
|
||||||
|
my: {
|
||||||
|
title: '',//申报单编辑
|
||||||
|
back: '/pages/warehousing/Declaration/components/detail'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
const title = ref('申报单开单')// ref:标题
|
||||||
|
const backUrl = ref('')
|
||||||
|
const formData = ref({ itemList: [], contactName: '', contactPhone: '', address: '', fileList: [], deliveryTime: '' })
|
||||||
|
// 数据:路径参数
|
||||||
|
const pathParams = ref('')
|
||||||
|
// 标志:区分页面
|
||||||
|
const flag = ref('')
|
||||||
|
// ref:物料绑定
|
||||||
|
const materialRef = ref([])
|
||||||
|
// 弹窗:交付时间选择
|
||||||
|
const modalRef = ref()
|
||||||
|
// 交付时间选择
|
||||||
|
const toChooseTime = () => {
|
||||||
|
modalRef.value.open()
|
||||||
|
}
|
||||||
|
const toCheckTime = (val) => {
|
||||||
|
formData.value.deliveryTime = val
|
||||||
|
modalRef.value.close()
|
||||||
|
}
|
||||||
|
// 上传申报图片
|
||||||
|
const afterRead = async (event) => {
|
||||||
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||||
|
let files = event.file?.map(file => file.url);
|
||||||
|
let formDataVal = {
|
||||||
|
scene: 'DECLARE',
|
||||||
|
bizType: 'DECLARE_ADDRESS',
|
||||||
|
}
|
||||||
|
uploadTechnicalFile(files, formDataVal).then(res => {
|
||||||
|
const some = _.some(res, { success: false })
|
||||||
|
if (some) return;
|
||||||
|
if (!formData.value?.fileList || formData.value?.fileList.length == 0) {
|
||||||
|
formData.value.fileList = []
|
||||||
|
}
|
||||||
|
res?.forEach(item => {
|
||||||
|
formData.value.fileList.push({ url: item?.url, name: item?.name, scene: 'DECLARE', bizType: 'DECLARE_ADDRESS' })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const toMyDeclaration = () => {
|
||||||
|
const query = objectToQuery(pathParams.value)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/Declaration/my${query}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 数据:缓存当前填入数据
|
||||||
|
const toSetStorage = () => {
|
||||||
|
uni.setStorageSync('app_declaration', formData.value)
|
||||||
|
}
|
||||||
|
// 数据:获取缓存信息
|
||||||
|
const getDeclarationInfo = () => {
|
||||||
|
|
||||||
|
const declarationInfo = uni.getStorageSync('app_declaration');// 申报信息
|
||||||
|
formData.value = declarationInfo || { itemList: [], contactName: '', contactPhone: '', address: '', fileList: [], deliveryTime: '' }
|
||||||
|
|
||||||
|
const material = uni.getStorageSync('app_material') || []; // 物料信息
|
||||||
|
formData.value.itemList = material
|
||||||
|
}
|
||||||
|
|
||||||
|
// 扫码添加
|
||||||
|
const scanCode = () => {
|
||||||
|
// 先校验是否支持扫码
|
||||||
|
uni.scanCode({
|
||||||
|
scanType: ['qrCode', 'barCode'], // 支持二维码 + 条形码
|
||||||
|
success: (res) => {
|
||||||
|
const idx = includes(existList, res.result)
|
||||||
|
if (idx) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '该物料已添加,请勿重复添加!',
|
||||||
|
mask: true,
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (res.result) {
|
||||||
|
getMaterialByQrCodeInfo({ code: res.result, existList: existList.value }).then((response) => {
|
||||||
|
if (`${response.code}` === '200') {
|
||||||
|
const material = uni.getStorageSync('app_material');
|
||||||
|
// 处理物料信息 合并
|
||||||
|
const materialInfo = _.filter(material, { isDelete: '0' });
|
||||||
|
console.log('materialInfo====>', materialInfo);
|
||||||
|
const materialId = response.data?.[0]?.materialId;
|
||||||
|
console.log('materialId====>', materialId);
|
||||||
|
// const idx = _.findIndex(materialInfo, (i) => i.materialId ? i.materialId == materialId : i.id == materialId);
|
||||||
|
// console.log('已选中是否有重复数据====>', idx);
|
||||||
|
|
||||||
|
// if (idx != -1) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '该物料已添加,请勿重复添加!',
|
||||||
|
// mask: true,
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
let _material = [...materialInfo, { ...response.data[0], uniqueCode: res.result }]
|
||||||
|
console.log('新的物料数组====>', _material);
|
||||||
|
formData.value.material = _material
|
||||||
|
uni.setStorageSync('app_material', formData.value.material)
|
||||||
|
existList.value.push(res.result)
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
console.log(response.code, 'response.code');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({ title: '扫码失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 新增/编辑
|
||||||
|
const submitForm = () => {
|
||||||
|
const materialInfo = materialRef.value.getMaterialList()
|
||||||
|
if (!materialInfo || (materialInfo && materialInfo.length == 0)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请填写物料信息',
|
||||||
|
mask: true,
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let params = {
|
||||||
|
itemList: _.map(materialInfo, (i) => ({ ...i.material })),
|
||||||
|
contactName: formData.value.contactName,
|
||||||
|
contactPhone: formData.value.contactPhone,
|
||||||
|
deliveryTime: formData.value.deliveryTime,
|
||||||
|
address: formData.value.address,
|
||||||
|
fileList: formData.value.fileList,
|
||||||
|
}
|
||||||
|
// 新建
|
||||||
|
if (!pathParams.value.billNo) {
|
||||||
|
addDeclareBill(params).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '申报单创建成功',
|
||||||
|
mask: true,
|
||||||
|
icon: 'success',
|
||||||
|
})
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: backUrl.value,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '申报单创建失败',
|
||||||
|
mask: true,
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 编辑
|
||||||
|
params.billNo = pathParams.value?.billNo
|
||||||
|
params.id = formData.value?.id
|
||||||
|
declareBillUpdate(params).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '申报单编辑成功',
|
||||||
|
mask: true,
|
||||||
|
icon: 'success',
|
||||||
|
})
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: backUrl.value,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '申报单编辑失败',
|
||||||
|
mask: true,
|
||||||
|
icon: 'error',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 删除图片
|
||||||
|
const deleteImg = (index, type) => {
|
||||||
|
formData.value.fileList?.splice(index, 1)
|
||||||
|
}
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options
|
||||||
|
flag.value = options.type
|
||||||
|
const query = objectToQuery(options)
|
||||||
|
if (options.billNo) {
|
||||||
|
title.value = options.billNo
|
||||||
|
backUrl.value = OPERATE_CONFIG?.my?.back + query
|
||||||
|
} else {
|
||||||
|
backUrl.value = OPERATE_CONFIG?.[options.type]?.back
|
||||||
|
}
|
||||||
|
console.log(backUrl, options.type);
|
||||||
|
|
||||||
|
})
|
||||||
|
getDeclarationInfo();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.carPickerText {
|
||||||
|
color: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 底部按钮 */
|
||||||
|
::v-deep .bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
height: 60rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.uv-button-wrapper {
|
||||||
|
width: 50%;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-button--info {
|
||||||
|
background-color: #07c160;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .form {
|
||||||
|
// background-color: #fff;
|
||||||
|
padding: 0 0 12rpx 0;
|
||||||
|
|
||||||
|
.uv-input__content {
|
||||||
|
.uv-input__content__field-wrapper__field {
|
||||||
|
text-align: right !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-form-item__body {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 12rpx;
|
||||||
|
margin-bottom: 2rpx;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-form-item__body__left__content__label {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-line {
|
||||||
|
border-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-form-item__body__right__content__slot {
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-cell__body {
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-icons {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-slot-title {
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topLabel {
|
||||||
|
.uv-form-item__body {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-textarea {
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-upload {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.chooseModal {
|
||||||
|
.uv-modal__content {
|
||||||
|
display: block;
|
||||||
|
padding-top: 24rpx !important;
|
||||||
|
padding: 48rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 16px;
|
||||||
|
margin: 16rpx 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
color: #999;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
8
pages/warehousing/Declaration/materialQuery.vue
Normal file
8
pages/warehousing/Declaration/materialQuery.vue
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 仓库信息 -->
|
||||||
|
<choose-list :isWarehousing="true" :pathParams="{ type: 'materialQuery' }" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ChooseList from '../../components/ChooseList.vue'
|
||||||
|
</script>
|
||||||
|
<style lang="sass" scoped></style>
|
||||||
155
pages/warehousing/Declaration/my.vue
Normal file
155
pages/warehousing/Declaration/my.vue
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
<template>
|
||||||
|
<!-- -->
|
||||||
|
<navigation title="我的申报单" :back-url="backUrl"></navigation>
|
||||||
|
<view class="contentBox">
|
||||||
|
<!-- 搜索框 -->
|
||||||
|
<view class="topSearch">
|
||||||
|
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :input-border="false"
|
||||||
|
@icon-click="getList" placeholder="请输入搜索内容" />
|
||||||
|
</view>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
|
||||||
|
<uni-list class="listBox">
|
||||||
|
<uni-list-item v-for="item in list" :key="item.id" clickable @tap="onDetail(item)">
|
||||||
|
<template v-slot:body>
|
||||||
|
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||||
|
<view class="line title">
|
||||||
|
<p> 申报单号:{{ item.billNo }}</p>
|
||||||
|
<p>{{ getLabel(declareType, item?.status) }}</p>
|
||||||
|
</view>
|
||||||
|
<p class="line content">联系人:<text>{{ item?.contactName || '-' }}</text></p>
|
||||||
|
<p class="line content">联系电话:<text>{{ item?.contactPhone || '-' }}</text></p>
|
||||||
|
<p class="line content">地址:<text>{{ item?.address || '-' }}</text></p>
|
||||||
|
<p class="line content">申报时间: <text>{{ item?.createTime || '-' }}</text></p>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
</z-paging>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import _ from 'lodash';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||||
|
import { declareList } from '@/api/declaration';
|
||||||
|
import Navigation from '../../components/Navigation.vue';
|
||||||
|
import { objectToQuery, getLabel, declareType } from '../../until';
|
||||||
|
|
||||||
|
const OPERATE_CONFIG = {
|
||||||
|
declaration: {
|
||||||
|
back: '/pages/warehousing/Declaration/create'
|
||||||
|
},
|
||||||
|
my: {
|
||||||
|
back: 'pages/warehousing/index'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
const pagingRef = ref(null)
|
||||||
|
const list = ref([])
|
||||||
|
const backUrl = ref('')
|
||||||
|
const pathParams = ref('')
|
||||||
|
const queryParams = ref({ keyword: '' })
|
||||||
|
|
||||||
|
const onDetail = (item) => {
|
||||||
|
const query = objectToQuery({ ...pathParams.value, billNo: item.billNo })
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/Declaration/components/detail${query}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const getList = (pageNo, pageSize) => {
|
||||||
|
queryParams.value.pageNum = pageNo
|
||||||
|
declareList({ ...queryParams.value }).then(res => {
|
||||||
|
res.rows.forEach(e => {
|
||||||
|
e.showMore = false;
|
||||||
|
});
|
||||||
|
pagingRef.value.complete(res.rows)
|
||||||
|
}).catch(() => {
|
||||||
|
pagingRef.value.complete(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
// 数据:路径参数
|
||||||
|
onLoad(options => {
|
||||||
|
pathParams.value = options;
|
||||||
|
const { type } = options;
|
||||||
|
|
||||||
|
let queryStr = '';
|
||||||
|
if (type !== 'my') {
|
||||||
|
const { billNo, ...restParams } = options;
|
||||||
|
queryStr = objectToQuery(restParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseBackUrl = OPERATE_CONFIG?.[type]?.back;
|
||||||
|
backUrl.value = queryStr ? `${baseBackUrl}${queryStr}` : baseBackUrl;
|
||||||
|
})
|
||||||
|
onShow(() => {
|
||||||
|
pagingRef.value?.reload?.()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 搜索框:放在导航栏下面,不覆盖 */
|
||||||
|
.topSearch {
|
||||||
|
position: fixed;
|
||||||
|
top: 65rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 99;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerBox {
|
||||||
|
padding-top: 125rpx !important;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .listBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
|
||||||
|
.zp-l-text-rpx {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list--border-bottom {
|
||||||
|
padding: 8px 12px 8px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list {
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list-item {
|
||||||
|
margin-bottom: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #696969;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
0
pages/warehousing/InventoryInfo/alert.vue
Normal file
0
pages/warehousing/InventoryInfo/alert.vue
Normal file
0
pages/warehousing/InventoryInfo/checkUniqueCode.vue
Normal file
0
pages/warehousing/InventoryInfo/checkUniqueCode.vue
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
<template>
|
||||||
|
<navigation title="物料库存查询" back-url="/pages/warehousing/Declaration/materialQuery" />
|
||||||
|
|
||||||
|
<view class="contentBox">
|
||||||
|
<view class="topSearch">
|
||||||
|
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
|
||||||
|
@iconClick="getList" placeholder="请输入搜索内容" />
|
||||||
|
</view>
|
||||||
|
<!-- 物料库存查询 -->
|
||||||
|
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getDetailInfo">
|
||||||
|
<uni-list class="listBox">
|
||||||
|
<uni-list-item v-for="item in infoList" :key="item.id">
|
||||||
|
|
||||||
|
<template v-slot:body>
|
||||||
|
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||||
|
<view class="line title">
|
||||||
|
<p>{{ item.materialName }} - {{ item.materialCode }}</p>
|
||||||
|
<p>{{ item.quantity }}{{ item.unitName }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content" style="color: #F44336;">
|
||||||
|
<p>库龄</p>
|
||||||
|
<p>{{ item.agingDays }}天</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content ">
|
||||||
|
<p class="flex align-center">
|
||||||
|
<text class="mr-4"> 唯一码<text class="mr-4 ml-4">|</text>RFID</text>
|
||||||
|
<text @tap.stop="getQRcodeDetail(item)">
|
||||||
|
<uv-image src="../../../../static/qrcode.png" width="20rpx" height="20rpx" />
|
||||||
|
</text>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<text v-if="item.uniqueCode" class="mr-4">{{ item.uniqueCode }}</text>
|
||||||
|
<text v-if="item.rfidCode"> |{{ item.rfidCode }}</text>
|
||||||
|
</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>入库日期</p>
|
||||||
|
<p>{{ formatDate(item.inboundTime) }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>所在仓库</p>
|
||||||
|
<p>{{ item.warehouseName }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>所在存储区</p>
|
||||||
|
<p> {{ item.areaName }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料类别</p>
|
||||||
|
<p>{{ item.typeName }}</p>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="line content">
|
||||||
|
<p>物料分类</p>
|
||||||
|
<p>{{ item.materialName }}</p>
|
||||||
|
</view> -->
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料规格</p>
|
||||||
|
<p>{{ item.specification }}</p>
|
||||||
|
</view>
|
||||||
|
<view class="line content">
|
||||||
|
<p>物料型号</p>
|
||||||
|
<p> <text v-if="item?.model">{{ item?.model }}</text>
|
||||||
|
<text v-else class="empty">未填写</text>
|
||||||
|
</p>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
</z-paging>
|
||||||
|
</view>
|
||||||
|
<!-- 唯一码图形显示弹窗 -->
|
||||||
|
<uv-modal ref="modalRef" :title="none" class="qrCodeModal" :showConfirmButton="false">
|
||||||
|
<qr-code-modal :detail="materialList" />
|
||||||
|
</uv-modal>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||||
|
import { inventoryList } from '@/api/inventoryInfo';
|
||||||
|
import Navigation from '../../../components/Navigation.vue';
|
||||||
|
import { formatDate } from '../../../until';
|
||||||
|
import QrCodeModal from '../../uniqueCode/myUniqueCode/QrCodeModal.vue';
|
||||||
|
|
||||||
|
import { getDetail } from '../../uniqueCode/until'
|
||||||
|
import { detailUniqueCode } from '@/api/uniqueCode'
|
||||||
|
// 开关:唯一码图形
|
||||||
|
const modalRef = ref()
|
||||||
|
const pathParams = ref('')
|
||||||
|
const materialList = ref({
|
||||||
|
material: []
|
||||||
|
})
|
||||||
|
const queryParams = ref({
|
||||||
|
keyword: ''
|
||||||
|
})
|
||||||
|
const pagingRef = ref(null)
|
||||||
|
const infoList = ref([])
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options;
|
||||||
|
})
|
||||||
|
|
||||||
|
const getDetailInfo = () => {
|
||||||
|
const params = {
|
||||||
|
warehouseCode: pathParams.value.warehouseCode,
|
||||||
|
materialId: pathParams.value.materialId,
|
||||||
|
keyword: queryParams.value.keyword
|
||||||
|
}
|
||||||
|
inventoryList(params).then(res => {
|
||||||
|
res.data.forEach(e => {
|
||||||
|
e.showMore = false;
|
||||||
|
});
|
||||||
|
infoList.value = res.data
|
||||||
|
pagingRef.value.complete(res.data)
|
||||||
|
}).catch(res => {
|
||||||
|
pagingRef.value.complete(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情:唯一码
|
||||||
|
const getQRcodeDetail = (row) => {
|
||||||
|
detailUniqueCode({ id: row.uniqueCodeId }).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
materialList.value.material = [{ ...res.data.material, ...getDetail(res.data.material.wornMaterial), qrCode: res.data.qrCode, code: res.data.code, uniqueCodeRemark: res.data.remark }]
|
||||||
|
setTimeout(() => {
|
||||||
|
modalRef.value.open()
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
pagingRef.value?.reload?.()
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.topSearch {
|
||||||
|
position: fixed;
|
||||||
|
top: 65rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
padding: 4rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerBox {
|
||||||
|
padding-top: 120rpx !important;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.zp-l-text-rpx {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.listBox {
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
|
||||||
|
.uni-list-item {
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list-item__container {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 4rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
background: #08a089;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
color: #D3D3D3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.qrCodeModal {
|
||||||
|
.uv-modal__content {
|
||||||
|
display: block;
|
||||||
|
padding: 24rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
7
pages/warehousing/InventoryInfo/inventoryAgeView.vue
Normal file
7
pages/warehousing/InventoryInfo/inventoryAgeView.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<choose-list :isWarehousing="true" :pathParams="{ type: 'inventoryAgeView' }" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ChooseList from '../../components/ChooseList.vue'
|
||||||
|
</script>
|
||||||
|
<style lang="sass" scoped></style>
|
||||||
7
pages/warehousing/Report/company.vue
Normal file
7
pages/warehousing/Report/company.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<report-excel keyType="companyReport" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ReportExcel from '../../components/ReportExcel.vue'
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
7
pages/warehousing/Report/components/dailyDetail.vue
Normal file
7
pages/warehousing/Report/components/dailyDetail.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<report-excel keyType="dailyReport" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ReportExcel from '../../../components/ReportExcel.vue'
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
7
pages/warehousing/Report/components/monthlyDetail.vue
Normal file
7
pages/warehousing/Report/components/monthlyDetail.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<report-excel keyType="monthlyReport" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ReportExcel from '../../../components/ReportExcel.vue'
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
7
pages/warehousing/Report/components/warehouseDetail.vue
Normal file
7
pages/warehousing/Report/components/warehouseDetail.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<report-excel keyType="warehouseReport" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ReportExcel from '../../../components/ReportExcel.vue'
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
7
pages/warehousing/Report/daily.vue
Normal file
7
pages/warehousing/Report/daily.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<choose-list :isWarehousing="true" :pathParams="{ type: 'dailyReport' }" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ChooseList from '../../components/ChooseList.vue'
|
||||||
|
</script>
|
||||||
|
<style lang="sass" scoped></style>
|
||||||
7
pages/warehousing/Report/monthly.vue
Normal file
7
pages/warehousing/Report/monthly.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<choose-list :isWarehousing="true" :pathParams="{ type: 'monthlyReport' }" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ChooseList from '../../components/ChooseList.vue'
|
||||||
|
</script>
|
||||||
|
<style lang="sass" scoped></style>
|
||||||
7
pages/warehousing/Report/warehouse.vue
Normal file
7
pages/warehousing/Report/warehouse.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<choose-list :isWarehousing="true" :pathParams="{ type: 'warehouseReport' }" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import ChooseList from '../../components/ChooseList.vue'
|
||||||
|
</script>
|
||||||
|
<style lang="sass" scoped></style>
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
<navigation :title="pathParams.billNo" :back-url="backUrl">
|
<navigation :title="pathParams.billNo" :back-url="backUrl">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="right-btn flex align-center justify-center ">
|
<view class="right-btn flex align-center justify-center ">
|
||||||
<uv-image @click="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
|
<uv-image @tap="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
|
||||||
style="margin-top:10rpx" />
|
style="margin-top:10rpx" />
|
||||||
<uv-image @click="toEditOrAway('2')" src="../../../../static/edit.png" class="ml-24" width="20px"
|
<uv-image @tap="toEditOrAway('2')" src="../../../../static/edit.png" class="ml-24" width="20px"
|
||||||
height="20px" style="margin-top:10rpx" />
|
height="20px" style="margin-top:10rpx" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
<view v-if="detailInfo?.billType == '0' && !flag"
|
<view v-if="detailInfo?.billType == '0' && !flag"
|
||||||
:class="getBillType(detailInfo?.billType, detailInfo?.status) != '物料部分入库' ? 'bottom' : 'bottom1'">
|
:class="getBillType(detailInfo?.billType, detailInfo?.status) != '物料部分入库' ? 'bottom' : 'bottom1'">
|
||||||
<uv-button type="error" v-if="getBillType(detailInfo?.billType, detailInfo?.status, flag) != '物料部分入库'"
|
<uv-button type="error" v-if="getBillType(detailInfo?.billType, detailInfo?.status, flag) != '物料部分入库'"
|
||||||
text="作废" @click="toObsolete"></uv-button>
|
text="作废" @tap="toObsolete"></uv-button>
|
||||||
<uv-button type="primary" text="入库单入库" @click="toEditOrAway('1')"></uv-button>
|
<uv-button type="primary" text="入库单入库" @tap="toEditOrAway('1')"></uv-button>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="detailInfo?.billType == '0' && flag" class="bottom1">
|
<view v-if="detailInfo?.billType == '0' && flag" class="bottom1">
|
||||||
<uv-button type="primary" text="出库单出库" @click="toEditOrAway('1')"></uv-button>
|
<uv-button type="primary" text="出库单出库" @tap="toEditOrAway('1')"></uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -145,6 +145,16 @@ const setDetailInfoToStorage = (type) => {
|
|||||||
// 有 type:直接存储全部 itemList
|
// 有 type:直接存储全部 itemList
|
||||||
uni.setStorageSync('app_material', itemList)
|
uni.setStorageSync('app_material', itemList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 技术鉴定表
|
||||||
|
const technicalEvaluationList = {
|
||||||
|
fileList: data?.appraisalFileList,
|
||||||
|
remark: data?.appraisalRemark,
|
||||||
|
createTime: data?.appraisalTime,
|
||||||
|
id: data?.appraisalId,
|
||||||
|
appraisalNo: data?.appraisalNo,
|
||||||
|
}
|
||||||
|
uni.setStorageSync('app_technical', technicalEvaluationList)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<material-list ref="materialRef" :formData="formData" isEdit="5" :pathParams="pathParams":extendData="{ selectMaterialList }" />
|
<material-list ref="materialRef" :formData="formData" isEdit="5" :pathParams="pathParams":extendData="{ selectMaterialList }" />
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<uv-button type="primary" @click="submitForm">入库</uv-button>
|
<uv-button type="primary" @tap="submitForm">入库</uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<!-- 仓库信息 - 仓库、存储区 -->
|
<!-- 仓库信息 - 仓库、存储区 -->
|
||||||
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
|
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
|
||||||
:pathParams="{ ...pathParams, type: 'stockIn' }" />
|
:pathParams="{ ...pathParams, type: pathParams.type === 'my' ? 'my' : 'stockIn' }" />
|
||||||
<!-- 物料列表 - 添加物料 -->
|
<!-- 物料列表 - 添加物料 -->
|
||||||
<material-list ref="materialRef" :formData="formData" isEdit="1" backStr="stockIn" :pathParams="pathParams" />
|
<material-list ref="materialRef" :formData="formData" isEdit="1"
|
||||||
|
:backStr="pathParams.type === 'my' ? 'my' : 'stockIn'" :pathParams="pathParams" />
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<uv-button @click="scanCode">扫码添加</uv-button>
|
<uv-button @tap="scanCode">扫码添加</uv-button>
|
||||||
<uv-button type="primary" @click="submitForm">提交</uv-button>
|
<uv-button type="primary" @tap="submitForm">提交</uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,7 +36,17 @@ const OPERATE_CONFIG = {
|
|||||||
stockIn: {
|
stockIn: {
|
||||||
back: '/pages/warehousing/stockIn/components/detail',
|
back: '/pages/warehousing/stockIn/components/detail',
|
||||||
title: ''
|
title: ''
|
||||||
}
|
},
|
||||||
|
//
|
||||||
|
declaration: {
|
||||||
|
back: '/pages/warehousing/Declaration/components/detail',
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
//
|
||||||
|
my: {
|
||||||
|
back: '/pages/warehousing/Declaration/components/detail',
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
}
|
}
|
||||||
// 数据:路径参数
|
// 数据:路径参数
|
||||||
const pathParams = ref('')
|
const pathParams = ref('')
|
||||||
@@ -125,15 +136,15 @@ const scanCode = () => {
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
const info = warehousingInfoRef.value.getWarehousingInfo()
|
const info = warehousingInfoRef.value.getWarehousingInfo()
|
||||||
const materialInfo = materialRef.value.getMaterialList()
|
const materialInfo = materialRef.value.getMaterialList() || []
|
||||||
|
|
||||||
let params = {
|
let params = {
|
||||||
warehouseCode: info.warehousing?.[0].deptCode || info.warehousing?.[0].deptId,
|
warehouseCode: info?.warehousing?.[0]?.deptCode || info?.warehousing?.[0]?.deptId,
|
||||||
warehouseName: info.warehousing?.[0].deptName,
|
warehouseName: info?.warehousing?.[0]?.deptName,
|
||||||
areaCode: info.storageArea?.[0].deptCode || info.storageArea?.[0].deptId,
|
areaCode: info?.storageArea?.[0]?.deptCode || info.storageArea?.[0]?.deptId,
|
||||||
areaName: info.storageArea?.[0].deptName,
|
areaName: info?.storageArea?.[0]?.deptName,
|
||||||
remark: info.remark,
|
remark: info?.remark,
|
||||||
billRemark: info.remark,
|
billRemark: info?.remark,
|
||||||
itemList: _.map(materialInfo, (i) => ({ ...i.material }))
|
itemList: _.map(materialInfo, (i) => ({ ...i.material }))
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -142,7 +153,13 @@ const submitForm = () => {
|
|||||||
addStockIn(params).then((res) => {
|
addStockIn(params).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.showToast({ title: '入库单创建成功', icon: 'success', mask: true })
|
uni.showToast({ title: '入库单创建成功', icon: 'success', mask: true })
|
||||||
uni.navigateTo({ url: OPERATE_CONFIG.list.back })
|
if (pathParams.value.type == 'my') {
|
||||||
|
const queryStr = objectToQuery(pathParams.value)
|
||||||
|
uni.navigateTo({ url: OPERATE_CONFIG.my.back + queryStr })
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({ url: OPERATE_CONFIG.list.back })
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -169,7 +186,7 @@ onLoad((options) => {
|
|||||||
console.log('options==>', options);
|
console.log('options==>', options);
|
||||||
|
|
||||||
// 若有billNo传入 修改标题且为编辑 stockIn:入库编辑 stockIn-putAway:入库单入库编辑
|
// 若有billNo传入 修改标题且为编辑 stockIn:入库编辑 stockIn-putAway:入库单入库编辑
|
||||||
if (options?.billNo) {
|
if (options?.billNo && options?.type != 'my') {
|
||||||
const query = objectToQuery(options)
|
const query = objectToQuery(options)
|
||||||
title.value = options.billNo
|
title.value = options.billNo
|
||||||
backUrl.value = OPERATE_CONFIG.stockIn.back + query;
|
backUrl.value = OPERATE_CONFIG.stockIn.back + query;
|
||||||
|
|||||||
@@ -11,23 +11,23 @@
|
|||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getTechnicalList">
|
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getTechnicalList">
|
||||||
<uni-list class="listBox">
|
<uni-list class="listBox">
|
||||||
<uni-list-item v-for="item in infoList" :key="item.id" clickable @click="onChecked(item)">
|
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<view style="display: flex; flex-direction: column; width: 100%;">
|
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||||
<view class="line title">
|
<!-- <view class="line title">
|
||||||
<p>技术鉴定表</p>
|
<p>技术鉴定表</p>
|
||||||
<p>{{ item?.appraisalNo }}</p>
|
<p>{{ item?.appraisalNo }}</p>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="line content">
|
<view class="line content">
|
||||||
<uv-upload :fileList="item?.fileUrlList" name="3" multiple :maxCount="6"
|
<uv-upload :fileList="item?.fileUrlList" name="3" multiple
|
||||||
:previewFullImage="true"></uv-upload>
|
:maxCount="item?.fileUrlList?.length" :previewFullImage="true"></uv-upload>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="line content">
|
<view class="line content">
|
||||||
<p>备注</p>
|
<p>备注</p>
|
||||||
<p>
|
<p>
|
||||||
<span v-if="item?.appraisalDesc">{{ item?.appraisalDesc }}</span>
|
<text v-if="item?.remark">{{ item?.remark }}</text>
|
||||||
<span v-else class="empty">未填写</span>
|
<text v-else class="empty">未填写</text>
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
<view class="line content">
|
<view class="line content">
|
||||||
@@ -69,7 +69,8 @@ const infoList = ref([])
|
|||||||
// 选中技术鉴定表
|
// 选中技术鉴定表
|
||||||
const onChecked = (item) => {
|
const onChecked = (item) => {
|
||||||
if (item.appraisalNo) {
|
if (item.appraisalNo) {
|
||||||
uni.setStorageSync('app_technical', item);
|
|
||||||
|
uni.setStorageSync('app_technical', { ...item, appraisalNo: undefined });
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: backUrl.value
|
url: backUrl.value
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<!-- 技术鉴定表 -->
|
<!-- 技术鉴定表 -->
|
||||||
<uv-form ref="formRef" class="form" :model="technicalEvaluationList" label-width="150rpx">
|
<uv-form ref="formRef" class="form" :model="technicalEvaluationList" label-width="150rpx">
|
||||||
<uv-form-item label="技术鉴定表" prop="fileList" @click="toTechnical">
|
<uv-form-item label="技术鉴定表" prop="fileList" @tap="toTechnical">
|
||||||
<u-cell>
|
<u-cell>
|
||||||
<view slot="title" class="u-slot-title">
|
<view slot="title" class="u-slot-title">
|
||||||
<text class="u-cell-text" v-if="technicalEvaluationList">
|
<text class="u-cell-text" v-if="technicalEvaluationList">
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<material-list ref="materialRef" :formData="formData" isEdit="5" backStr="stockOut" :pathParams="pathParams" />
|
<material-list ref="materialRef" :formData="formData" isEdit="5" backStr="stockOut" :pathParams="pathParams" />
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<uv-button type="primary" @click="submitForm">出库</uv-button>
|
<uv-button type="primary" @tap="submitForm">出库</uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -124,7 +124,7 @@ onMounted(() => {
|
|||||||
getMaterialList()
|
getMaterialList()
|
||||||
})
|
})
|
||||||
const toTechnical = () => {
|
const toTechnical = () => {
|
||||||
const query = objectToQuery(pathParams.value)
|
const query = objectToQuery(pathParams?.value)
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/warehousing/stockOut/components/technicalEvaluation${query}`
|
url: `/pages/warehousing/stockOut/components/technicalEvaluation${query}`
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<navigation title="技术鉴定表详情" :back-url="backUrl">
|
<navigation title="技术鉴定表详情" :back-url="backUrl">
|
||||||
<template #right>
|
<template #right>
|
||||||
<my-link @click="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
|
<my-link @tap="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
|
||||||
</template>
|
</template>
|
||||||
</navigation>
|
</navigation>
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
</uv-form>
|
</uv-form>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<uv-button type="primary" @click="submitForm">提交信息</uv-button>
|
<uv-button type="primary" v-if="!formModel?.appraisalNo" @tap="submitForm">提交信息</uv-button>
|
||||||
|
<uv-button type="error" v-else @tap="delForm">删除</uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -27,36 +28,33 @@ import { ref } from 'vue';
|
|||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { objectToQuery } from '../../../until';
|
import { objectToQuery } from '../../../until';
|
||||||
import Navigation from '../../../components/Navigation.vue';
|
import Navigation from '../../../components/Navigation.vue';
|
||||||
import { uploadTechnicalFile, addWithFiles } from '@/api/stockOut'
|
import { uploadTechnicalFile, addWithFiles, deleteAppraisal } from '@/api/stockOut'
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
const queryParams = ref('')
|
const queryParams = ref('')
|
||||||
const formModel = ref({
|
const formModel = ref({
|
||||||
billNo: null,
|
billNo: null,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
appraisalNo: '',
|
||||||
|
id: '',
|
||||||
fileList: [],
|
fileList: [],
|
||||||
})
|
})
|
||||||
const backUrl = ref('')
|
const backUrl = ref('')
|
||||||
const afterRead = async (event) => {
|
const afterRead = async (event) => {
|
||||||
// scene = outbound
|
|
||||||
// bizType = technical_appraisal
|
|
||||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||||
console.log(event, '上传')
|
console.log(event, '上传')
|
||||||
let files = event.file?.map(file => file.url);
|
let files = event.file?.map(file => file.url);
|
||||||
// console.log('files', files);
|
|
||||||
|
|
||||||
let formData = {
|
let formData = {
|
||||||
scene: 'OUTBOUND',
|
scene: 'OUTBOUND',
|
||||||
bizType: 'TECHNICAL_APPRAISAL',
|
bizType: 'TECHNICAL_APPRAISAL',
|
||||||
}
|
}
|
||||||
// files = files.map(p => ({ name: "files", uri: p }))
|
|
||||||
uploadTechnicalFile(files, formData).then(res => {
|
uploadTechnicalFile(files, formData).then(res => {
|
||||||
const some = _.some(res, { success: false })
|
const some = _.some(res, { success: false })
|
||||||
console.log(some,'上传接口调取成功', res)
|
console.log(some, '上传接口调取成功', res)
|
||||||
if (some) return;
|
if (some) return;
|
||||||
if (!formModel.value.fileList || formModel.value.fileList.length == 0) {
|
if (!formModel.value.fileList || formModel.value.fileList.length == 0) {
|
||||||
formModel.value.fileList = []
|
formModel.value.fileList = []
|
||||||
}
|
}
|
||||||
res?.data?.fileUrlList.forEach(item => {
|
res?.forEach(item => {
|
||||||
formModel.value.fileList.push({ url: item?.url, name: item?.name, scene: 'OUTBOUND', bizType: 'TECHNICAL_APPRAISAL' })
|
formModel.value.fileList.push({ url: item?.url, name: item?.name, scene: 'OUTBOUND', bizType: 'TECHNICAL_APPRAISAL' })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -67,15 +65,49 @@ const deleteImg = (index, type) => {
|
|||||||
}
|
}
|
||||||
// 提交
|
// 提交
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
console.log(formModel, 'formModel==>');
|
const params = {
|
||||||
addWithFiles({ ...formModel.value, billNo: queryParams.value.billNo }).then((res) => {
|
remark: formModel.value.remark,
|
||||||
|
billNo: queryParams.value.billNo,
|
||||||
|
fileList: formModel.value.fileList,
|
||||||
|
}
|
||||||
|
addWithFiles(params).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
|
uni.setStorageSync('app_technical', {
|
||||||
|
remark: res.data?.remark,
|
||||||
|
appraisalNo: res.data.appraisalNo,
|
||||||
|
id: res.data.id,
|
||||||
|
createTime: res.data.createTime,
|
||||||
|
fileList: res.data?.fileUrlList || [],
|
||||||
|
});
|
||||||
|
uni.navigateTo({
|
||||||
|
url: backUrl.value
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
const delForm = () => {
|
||||||
|
deleteAppraisal({ id: formModel.value?.id }).then((res) => {
|
||||||
|
console.log(res, '删除');
|
||||||
|
formModel.value = {
|
||||||
|
billNo: null,
|
||||||
|
remark: '',
|
||||||
|
appraisalNo: '',
|
||||||
|
id: '',
|
||||||
|
fileList: [],
|
||||||
|
}
|
||||||
|
uni.removeStorageSync("app_technical");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 数据:获取缓存信息
|
||||||
|
const getMaterialList = () => {
|
||||||
|
// 获取技术鉴定表数据
|
||||||
|
const list = uni.getStorageSync('app_technical') || {};
|
||||||
|
formModel.value = list
|
||||||
|
}
|
||||||
|
getMaterialList()
|
||||||
// 数据:路径参数
|
// 数据:路径参数
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
const query = objectToQuery(options)
|
const query = objectToQuery(options)
|
||||||
@@ -84,7 +116,6 @@ onLoad((options) => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
const toMyTechnicalList = () => {
|
const toMyTechnicalList = () => {
|
||||||
console.log('1111111111');
|
|
||||||
const query = objectToQuery(queryParams.value)
|
const query = objectToQuery(queryParams.value)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/warehousing/stockOut/components/myTechnicalEvaluation${query}`
|
url: `/pages/warehousing/stockOut/components/myTechnicalEvaluation${query}`
|
||||||
@@ -93,7 +124,7 @@ const toMyTechnicalList = () => {
|
|||||||
// 获取技术鉴定编数据
|
// 获取技术鉴定编数据
|
||||||
const getTechnicalList = () => {
|
const getTechnicalList = () => {
|
||||||
const list = uni.getStorageSync('app_technical');
|
const list = uni.getStorageSync('app_technical');
|
||||||
formModel.value.fileList = list?.fileList
|
formModel.value.fileList = list?.fileList || []
|
||||||
formModel.value.remark = list?.remark
|
formModel.value.remark = list?.remark
|
||||||
}
|
}
|
||||||
getTechnicalList()
|
getTechnicalList()
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
:pathParams="{...pathParams.value, type: 'stockOut' }" />
|
:pathParams="{...pathParams.value, type: 'stockOut' }" />
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<uv-button @click="scanCode">扫码添加</uv-button>
|
<uv-button @tap="scanCode">扫码添加</uv-button>
|
||||||
<uv-button type="primary" @click="submitForm">提交</uv-button>
|
<uv-button type="primary" @tap="submitForm">提交</uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
113
pages/warehousing/Transport/checkIn.vue
Normal file
113
pages/warehousing/Transport/checkIn.vue
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<navigation :title="title" :back-url="backUrl">
|
||||||
|
<template #right>
|
||||||
|
<my-link @tap="toMyTransport" style="font-size: 14px;">我的</my-link>
|
||||||
|
</template>
|
||||||
|
</navigation>
|
||||||
|
<view class="contentBox">
|
||||||
|
<!-- 仓库信息 - 仓库、存储区 -->
|
||||||
|
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
|
||||||
|
:pathParams="{ ...pathParams, type: 'transport' }" />
|
||||||
|
<!-- 物料列表 - 添加物料 -->
|
||||||
|
<material-list ref="materialRef" :formData="formData" isEdit="4" :backStr="transport"
|
||||||
|
:pathParams="pathParams" />
|
||||||
|
<!-- 底部操作栏 -->
|
||||||
|
<view class="bottom">
|
||||||
|
<uv-button @tap="scanCode">扫码添加</uv-button>
|
||||||
|
<uv-button type="primary" @tap="submitForm">打卡</uv-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { objectToQuery, } from '../../until';
|
||||||
|
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
|
import MaterialList from '../../components/MaterialList.vue';
|
||||||
|
import WarehousingInfo from '../../components/WarehousingInfo.vue';
|
||||||
|
import Navigation from '../../components/Navigation.vue';
|
||||||
|
// const OPERATE_CONFIG = {
|
||||||
|
// // 创建
|
||||||
|
// transport: {
|
||||||
|
// back: 'pages/warehousing/index',
|
||||||
|
// title: '运输打卡'
|
||||||
|
// },
|
||||||
|
// // 编辑
|
||||||
|
// transport_edit: {
|
||||||
|
// back: '/pages/warehousing/stockIn/components/detail',
|
||||||
|
// title: ''
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
// 数据:路径参数
|
||||||
|
const pathParams = ref('')
|
||||||
|
// 标志:是否为编辑
|
||||||
|
const isEdit = ref('')
|
||||||
|
|
||||||
|
// ref:标题
|
||||||
|
const title = ref('运输打卡')
|
||||||
|
const backUrl = ref('pages/warehousing/index')
|
||||||
|
const formData = ref([{ remark: '', material: [] }])
|
||||||
|
// 数据:仓库信息
|
||||||
|
const warehouseInfo = ref({ warehousing: {}, storageArea: {}, remark: '' })
|
||||||
|
|
||||||
|
// 数据:获取缓存信息
|
||||||
|
const getMaterialList = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
getMaterialList();
|
||||||
|
|
||||||
|
// 扫码添加
|
||||||
|
const scanCode = () => {
|
||||||
|
|
||||||
|
};
|
||||||
|
const toMyTransport = () => {
|
||||||
|
const query = objectToQuery(pathParams.value)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/Transport/my${query}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 提交表单
|
||||||
|
const submitForm = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据:路径参数
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.contentBox {
|
||||||
|
background: #f5f5f5;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 底部按钮 */
|
||||||
|
::v-deep .bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
height: 60rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.uv-button-wrapper {
|
||||||
|
width: 50%;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uv-button--info {
|
||||||
|
background-color: #07c160;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
132
pages/warehousing/Transport/my.vue
Normal file
132
pages/warehousing/Transport/my.vue
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<template>
|
||||||
|
<!-- -->
|
||||||
|
<navigation title="我的运输打卡" :back-url="backUrl"></navigation>
|
||||||
|
<view class="contentBox">
|
||||||
|
<!-- 搜索框 -->
|
||||||
|
<view class="topSearch">
|
||||||
|
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :input-border="false"
|
||||||
|
@icon-click="getList" placeholder="请输入搜索内容" />
|
||||||
|
</view>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
|
||||||
|
<uni-list class="listBox">
|
||||||
|
<uni-list-item v-for="item in list" :key="item.id" clickable @tap="onDetail(item)">
|
||||||
|
<template v-slot:body>
|
||||||
|
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||||
|
<view class="line title">
|
||||||
|
<p> 申报单号:{{ item.billNo }}</p>
|
||||||
|
<p>{{ getLabel(declareType, item?.status) }}</p>
|
||||||
|
</view>
|
||||||
|
<p class="line content">联系人:<text>{{ item?.contactName || '-' }}</text></p>
|
||||||
|
<p class="line content">联系电话:<text>{{ item?.contactPhone || '-' }}</text></p>
|
||||||
|
<p class="line content">地址:<text>{{ item?.address || '-' }}</text></p>
|
||||||
|
<p class="line content">申报时间: <text>{{ item?.createTime || '-' }}</text></p>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
</z-paging>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import _ from 'lodash';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||||
|
import Navigation from '../../components/Navigation.vue';
|
||||||
|
import { getLabel, declareType } from '../../until';
|
||||||
|
|
||||||
|
const OPERATE_CONFIG = {
|
||||||
|
transport: {
|
||||||
|
back: '/pages/warehousing/Transport/checkIn'
|
||||||
|
},
|
||||||
|
my: {
|
||||||
|
back: 'pages/warehousing/index'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
const pagingRef = ref(null)
|
||||||
|
const list = ref([])
|
||||||
|
const backUrl = ref('')
|
||||||
|
const pathParams = ref('')
|
||||||
|
const queryParams = ref({ keyword: '' })
|
||||||
|
|
||||||
|
const onDetail = () => { }
|
||||||
|
|
||||||
|
const getList = (pageNo, pageSize) => {
|
||||||
|
queryParams.value.pageNum = pageNo
|
||||||
|
}
|
||||||
|
// 数据:路径参数
|
||||||
|
onLoad(options => {
|
||||||
|
pathParams.value = options;
|
||||||
|
backUrl.value = OPERATE_CONFIG[options.type]?.back
|
||||||
|
|
||||||
|
})
|
||||||
|
onShow(() => {
|
||||||
|
pagingRef.value?.reload?.()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 搜索框:放在导航栏下面,不覆盖 */
|
||||||
|
.topSearch {
|
||||||
|
position: fixed;
|
||||||
|
top: 65rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 99;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerBox {
|
||||||
|
padding-top: 125rpx !important;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .listBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
|
||||||
|
.zp-l-text-rpx {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list--border-bottom {
|
||||||
|
padding: 8px 12px 8px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list {
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-list-item {
|
||||||
|
margin-bottom: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #696969;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<uni-card v-for="(item, index) in menuList" :key="item.id" :title="item.title" :isFull="true"
|
<uni-card v-for="(item, index) in menuList" :key="item.id" :title="item.title" :isFull="true"
|
||||||
class="custom-card">
|
class="custom-card">
|
||||||
<view v-for="value in item.menuItem" :key="value.id" class="card_items" @click="value.click">
|
<view v-for="value in item.menuItem" :key="value.id" class="card_items" @tap="value.click">
|
||||||
<uv-image :src="value.icon" width="40rpx" height="40rpx" style="margin-top:10rpx" />
|
<uv-image :src="value.icon" width="40rpx" height="40rpx" style="margin-top:10rpx" />
|
||||||
<p> {{ value.title }} </p>
|
<p> {{ value.title }} </p>
|
||||||
</view>
|
</view>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onShow } from '@dcloudio/uni-app';
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { removeStorage } from '../until';
|
import { objectToQuery, removeStorage } from '../until';
|
||||||
import Navigation from '../components/Navigation.vue';
|
import Navigation from '../components/Navigation.vue';
|
||||||
|
|
||||||
const menuList = [
|
const menuList = [
|
||||||
@@ -37,6 +37,11 @@ const menuList = [
|
|||||||
title: '库龄查看',
|
title: '库龄查看',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('库龄查看')
|
console.log('库龄查看')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/InventoryInfo/inventoryAgeView'
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -60,14 +65,23 @@ const menuList = [
|
|||||||
title: '库存日报',
|
title: '库存日报',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('库存日报')
|
console.log('库存日报')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/report/daily'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "report_ inventoryMonthlyReport",
|
id: "report_ inventoryMonthlyReport",
|
||||||
icon: '../../static/report/inventoryMonthlyReport.png',
|
icon: '../../static/report/inventoryMonthlyReport.png',
|
||||||
title: '库存月报',
|
title: '库存月报',
|
||||||
|
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('库存月报')
|
console.log('库存月报')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/Report/monthly'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -76,16 +90,23 @@ const menuList = [
|
|||||||
title: '公司库存报表',
|
title: '公司库存报表',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('公司库存报表')
|
console.log('公司库存报表')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/Report/company'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "report_ warehouseInventoryReport",
|
id: "report_ warehouseInventoryReport",
|
||||||
icon: '../../static/report/warehouseInventoryReport.png',
|
icon: '../../static/report/warehouseInventoryReport.png',
|
||||||
title: '仓库库存报表',
|
title: '仓库库存报表',
|
||||||
|
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('仓库库存报表')
|
console.log('仓库库存报表')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/Report/warehouse'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -100,6 +121,11 @@ const menuList = [
|
|||||||
title: '物资查询',
|
title: '物资查询',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('物资查询')
|
console.log('物资查询')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/Declaration/materialQuery'
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -108,6 +134,11 @@ const menuList = [
|
|||||||
title: '申报单开单',
|
title: '申报单开单',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('申报单开单')
|
console.log('申报单开单')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/Declaration/create?type=declaration'
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -116,6 +147,11 @@ const menuList = [
|
|||||||
title: '我的申报单',
|
title: '我的申报单',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('我的申报单')
|
console.log('我的申报单')
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/warehousing/Declaration/my?type=my'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -216,7 +252,7 @@ const menuList = [
|
|||||||
title: '唯一码发放',
|
title: '唯一码发放',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('唯一码发放')
|
console.log('唯一码发放')
|
||||||
uni.removeStorage('app_material')
|
removeStorage()
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
|
url: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
|
||||||
});
|
});
|
||||||
@@ -254,6 +290,11 @@ const menuList = [
|
|||||||
title: '运输打卡',
|
title: '运输打卡',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('运输打卡')
|
console.log('运输打卡')
|
||||||
|
const query = objectToQuery({ type: 'transport' })
|
||||||
|
removeStorage()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/Transport/checkIn${query}`
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -262,6 +303,11 @@ const menuList = [
|
|||||||
title: '我的运输打卡',
|
title: '我的运输打卡',
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log('我的运输打卡')
|
console.log('我的运输打卡')
|
||||||
|
removeStorage()
|
||||||
|
const query = objectToQuery({ type: 'my' })
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/warehousing/Transport/my${query}`
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
<navigation :title="title" :back-url="backUrl"></navigation>
|
<navigation :title="title" :back-url="backUrl"></navigation>
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<view class="remarkLine">
|
<view class="remarkLine">
|
||||||
<span>备注:</span>
|
<text>备注:</text>
|
||||||
<uni-easyinput type="text" v-model="formData.remark" :inputBorder="false" placeholder="请输入备注" />
|
<uni-easyinput type="text" v-model="formData.remark" :inputBorder="false" placeholder="请输入备注" />
|
||||||
</view>
|
</view>
|
||||||
<!-- 物料列表 - 添加物料 -->
|
<!-- 物料列表 - 添加物料 -->
|
||||||
<material-list ref="materialRef" :formData="formData" :remark="formData.remark" isEdit="1"
|
<material-list ref="materialRef" :formData="formData" :remark="formData.remark" isEdit="1"
|
||||||
:pathParams="pathParams" />
|
:pathParams="pathParams" />
|
||||||
<button class="bottom-btn" type="primary" @click="handleSubmit">提交</button>
|
<button class="bottom-btn" type="primary" @tap="handleSubmit">提交</button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -73,7 +73,7 @@ const handleSubmit = () => {
|
|||||||
remark: formData.value.remark,
|
remark: formData.value.remark,
|
||||||
material: { ...material.material, unitId: '23' }
|
material: { ...material.material, unitId: '23' }
|
||||||
}
|
}
|
||||||
if (pathParams.value.type == `issueUniqueCode_inbound`) {
|
if (pathParams.value.type == `stockIn_inbound`) {
|
||||||
params.billNo = pathParams.value.billNo
|
params.billNo = pathParams.value.billNo
|
||||||
}
|
}
|
||||||
if (pathParams.value.id) {
|
if (pathParams.value.id) {
|
||||||
@@ -139,7 +139,7 @@ const getMaterialList = () => {
|
|||||||
margin-bottom: 8rpx;
|
margin-bottom: 8rpx;
|
||||||
min-height: 40rpx;
|
min-height: 40rpx;
|
||||||
|
|
||||||
span {
|
text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,16 +11,16 @@
|
|||||||
v-if="!isInbound">
|
v-if="!isInbound">
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
|
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
|
||||||
@click="onMaterial(item)">
|
@tap="onMaterial(item)">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p style="display: flex; flex-direction: column; width: 100%;">
|
<p style="display: flex; flex-direction: column; width: 100%;">
|
||||||
<p class="title">{{ item.materialName }} ({{ item.materialCode }})</p>
|
<p class="title">{{ item.materialName }} ({{ item.materialCode }})</p>
|
||||||
<p class="subTitle">
|
<p class="subTitle">
|
||||||
<!-- 简称/型号/规格/类型 -->
|
<!-- 简称/型号/规格/类型 -->
|
||||||
<span v-if="item.materialShortName">{{ item.materialShortName }} / </span>
|
<text v-if="item.materialShortName">{{ item.materialShortName }} / </text>
|
||||||
<span v-if="item.model">{{ item.model }} / </span>
|
<text v-if="item.model">{{ item.model }} / </text>
|
||||||
<span v-if="item.specification">{{ item.specification }} / </span>
|
<text v-if="item.specification">{{ item.specification }} / </text>
|
||||||
<span v-if="item.typeName">{{ item.typeName }} </span>
|
<text v-if="item.typeName">{{ item.typeName }} </text>
|
||||||
</p>
|
</p>
|
||||||
<p class="tag">
|
<p class="tag">
|
||||||
<uni-tag :text="getTypeParentNames(item.typeParentNames)" type="error" />
|
<uni-tag :text="getTypeParentNames(item.typeParentNames)" type="error" />
|
||||||
@@ -36,16 +36,16 @@
|
|||||||
<view v-if="isInbound">
|
<view v-if="isInbound">
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
|
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
|
||||||
@click="onMaterial(item)">
|
@tap="onMaterial(item)">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p style="display: flex; flex-direction: column; width: 100%;">
|
<p style="display: flex; flex-direction: column; width: 100%;">
|
||||||
<p class="title">{{ item.materialName }} ({{ item.materialCode }})</p>
|
<p class="title">{{ item.materialName }} ({{ item.materialCode }})</p>
|
||||||
<p class="subTitle">
|
<p class="subTitle">
|
||||||
<!-- 简称/型号/规格/类型 -->
|
<!-- 简称/型号/规格/类型 -->
|
||||||
<span v-if="item.materialShortName">{{ item.materialShortName }} / </span>
|
<text v-if="item.materialShortName">{{ item.materialShortName }} / </text>
|
||||||
<span v-if="item.model">{{ item.model }} / </span>
|
<text v-if="item.model">{{ item.model }} / </text>
|
||||||
<span v-if="item.specification">{{ item.specification }} / </span>
|
<text v-if="item.specification">{{ item.specification }} / </text>
|
||||||
<span v-if="item.typeName">{{ item.typeName }} </span>
|
<text v-if="item.typeName">{{ item.typeName }} </text>
|
||||||
</p>
|
</p>
|
||||||
<p class="tag">
|
<p class="tag">
|
||||||
<uni-tag :text="getTypeParentNames(item.typeParentNames)" type="error" />
|
<uni-tag :text="getTypeParentNames(item.typeParentNames)" type="error" />
|
||||||
@@ -87,6 +87,16 @@ const OPERATE_CONFIG = {
|
|||||||
stockIn_detail: {
|
stockIn_detail: {
|
||||||
back: '/pages/warehousing/stockIn/create'
|
back: '/pages/warehousing/stockIn/create'
|
||||||
},
|
},
|
||||||
|
// 申报单开单
|
||||||
|
declaration: {
|
||||||
|
back: '/pages/warehousing/Declaration/create',
|
||||||
|
title: '申报单开单'
|
||||||
|
},
|
||||||
|
// 申报单开单
|
||||||
|
my: {
|
||||||
|
back: '/pages/warehousing/stockIn/create',
|
||||||
|
title: '申报单开单'
|
||||||
|
},
|
||||||
}
|
}
|
||||||
// ref:下拉加载
|
// ref:下拉加载
|
||||||
const pagingRef = ref(null)
|
const pagingRef = ref(null)
|
||||||
@@ -117,14 +127,6 @@ const getMaterialListInbound = () => {
|
|||||||
const list = uni.getStorageSync('app_material_select_list')
|
const list = uni.getStorageSync('app_material_select_list')
|
||||||
materialList.value = list
|
materialList.value = list
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
|
||||||
pagingRef.value?.reload?.()
|
|
||||||
})
|
|
||||||
onLoad((options) => {
|
|
||||||
pathParams.value = options
|
|
||||||
getMaterialListInbound()
|
|
||||||
})
|
|
||||||
// 方法:获取缓存物料信息
|
// 方法:获取缓存物料信息
|
||||||
const getStorageMaterial = (val) => {
|
const getStorageMaterial = (val) => {
|
||||||
// 唯一码编辑进入 数量默认1\唯一码物料表id\物料id
|
// 唯一码编辑进入 数量默认1\唯一码物料表id\物料id
|
||||||
@@ -147,7 +149,7 @@ const onMaterial = (val) => {
|
|||||||
const idx = _.findIndex(materialChecked, (i) => i.materialId ? i.materialId === val.id : i.id === val.id)
|
const idx = _.findIndex(materialChecked, (i) => i.materialId ? i.materialId === val.id : i.id === val.id)
|
||||||
|
|
||||||
if (idx != -1 && item?.isDelete == '0') { // isDelete为0表示未删除 1为已删除数据不在对比范围内
|
if (idx != -1 && item?.isDelete == '0') { // isDelete为0表示未删除 1为已删除数据不在对比范围内
|
||||||
if (keyType.value === 'stockIn') {
|
if (keyType.value === 'stockIn' || _.includes(keyType.value, 'declaration')) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '该物料已添加,请勿重复添加!',
|
title: '该物料已添加,请勿重复添加!',
|
||||||
mask: true,
|
mask: true,
|
||||||
@@ -157,7 +159,7 @@ const onMaterial = (val) => {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (keyType.value == 'stockIn') {
|
if (keyType.value == 'stockIn' || _.includes(keyType.value, 'declaration')) {
|
||||||
materialChecked = [...materialChecked, { ...val, quantity: 1, isDelete: '0' }];
|
materialChecked = [...materialChecked, { ...val, quantity: 1, isDelete: '0' }];
|
||||||
} else {
|
} else {
|
||||||
materialChecked = getStorageMaterial(val)
|
materialChecked = getStorageMaterial(val)
|
||||||
@@ -170,7 +172,13 @@ const onMaterial = (val) => {
|
|||||||
url: OPERATE_CONFIG?.[keyType.value].back + path
|
url: OPERATE_CONFIG?.[keyType.value].back + path
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
onShow(() => {
|
||||||
|
pagingRef.value?.reload?.()
|
||||||
|
})
|
||||||
|
onLoad((options) => {
|
||||||
|
pathParams.value = options
|
||||||
|
getMaterialListInbound()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.topSearch {
|
.topSearch {
|
||||||
|
|||||||
@@ -9,21 +9,24 @@
|
|||||||
|
|
||||||
<view class="content mt-16">
|
<view class="content mt-16">
|
||||||
<p>物料:
|
<p>物料:
|
||||||
<span>{{ material?.materialName }}</span>
|
<text>{{ material?.materialName }}</text>
|
||||||
<span v-if="material?.quantity">x {{ material?.quantity }}</span>
|
<text v-if="material?.quantity">x {{ material?.quantity }}</text>
|
||||||
</p>
|
</p>
|
||||||
<p>描述:
|
<p>描述:
|
||||||
<span v-if="material?.description">{{ material?.description || '-' }}</span>
|
<text v-if="material?.description">{{ material?.description || '-' }}</text>
|
||||||
<span v-else>
|
<text v-else>
|
||||||
<span v-if="material?.materialShortName">{{ material?.materialShortName }} / </span>
|
<text v-if="material?.materialShortName">{{ material?.materialShortName }} / </text>
|
||||||
<span v-if="material?.model">{{ material?.model }} / </span>
|
<text v-if="material?.model">{{ material?.model }} / </text>
|
||||||
<span v-if="material?.specification">{{ material?.specification }} / </span>
|
<text v-if="material?.specification">{{ material?.specification }} / </text>
|
||||||
<span v-if="material?.typeName">{{ material?.typeName }} </span>
|
<text v-if="material?.typeName">{{ material?.typeName }} </text>
|
||||||
</span>
|
</text>
|
||||||
</p>
|
</p>
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<p>备注:
|
<p>备注:
|
||||||
<span>{{ material?.uniqueCodeRemark || '' }}</span>
|
<text>
|
||||||
|
<text v-if="item?.uniqueCodeRemark">{{ item?.uniqueCodeRemark }}</text>
|
||||||
|
<text v-else class="empty">未填写</text>
|
||||||
|
</text>
|
||||||
</p>
|
</p>
|
||||||
<uv-image :src="qrCode" width="80rpx" height="80rpx" />
|
<uv-image :src="qrCode" width="80rpx" height="80rpx" />
|
||||||
</view>
|
</view>
|
||||||
@@ -43,6 +46,7 @@ const props = defineProps({
|
|||||||
const qrCode = computed(() => props.detail?.material?.[0]?.qrCode);
|
const qrCode = computed(() => props.detail?.material?.[0]?.qrCode);
|
||||||
const material = computed(() => props.detail?.material?.[0]);
|
const material = computed(() => props.detail?.material?.[0]);
|
||||||
const barcodeValue = computed(() => props.detail?.material?.[0]?.code || '');
|
const barcodeValue = computed(() => props.detail?.material?.[0]?.code || '');
|
||||||
|
console.log(props.detail?.material?.[0]?.code, 'code==>');
|
||||||
|
|
||||||
|
|
||||||
// iPad 兼容核心:不用 document,只用 uni 官方 API
|
// iPad 兼容核心:不用 document,只用 uni 官方 API
|
||||||
@@ -98,12 +102,16 @@ watch(
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
text {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
color: #D3D3D3;
|
||||||
|
}
|
||||||
|
|
||||||
/* 必须给宽度高度,iPad 才会显示 */
|
/* 必须给宽度高度,iPad 才会显示 */
|
||||||
.barcode-canvas {
|
.barcode-canvas {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<navigation :title="title" :back-url="backUrl">
|
<navigation :title="title" :back-url="backUrl">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="right-btn flex align-center justify-center ">
|
<view class="right-btn flex align-center justify-center ">
|
||||||
<uv-image @click="toEdit" src="../../../../static/edit.png" class="ml-24" width="20px" height="20px"
|
<uv-image @tap="toEdit" src="../../../../static/edit.png" class="ml-24" width="20px" height="20px"
|
||||||
style="margin-top:10rpx" />
|
style="margin-top:10rpx" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -24,19 +24,19 @@
|
|||||||
<!-- 内容行 -->
|
<!-- 内容行 -->
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<p>RFID:
|
<p>RFID:
|
||||||
<span v-if="item.rfidCode">{{ item.remark }}</span>
|
<text v-if="item.rfidCode">{{ item.remark }}</text>
|
||||||
<span v-else style="color: #999;">未绑定RFID</span>
|
<text v-else style="color: #999;">未绑定RFID</text>
|
||||||
</p>
|
</p>
|
||||||
<p>生成时间:
|
<p>生成时间:
|
||||||
<span>{{ item?.createTime }}</span>
|
<text>{{ item?.createTime }}</text>
|
||||||
</p>
|
</p>
|
||||||
<!-- 备注行-->
|
<!-- 备注行-->
|
||||||
<view class="flex-center qrCode">
|
<view class="flex-center qrCode">
|
||||||
<p>备注:
|
<p>备注:
|
||||||
<span v-if="item.remark">{{ item.remark }}</span>
|
<text v-if="item.remark">{{ item.remark }}</text>
|
||||||
<span v-else style="color: #999;">未填写</span>
|
<text v-else style="color: #999;">未填写</text>
|
||||||
</p>
|
</p>
|
||||||
<view @click="toViewQrCode">
|
<view @tap="toViewQrCode">
|
||||||
<uv-image src="../../../../static/qrcode.png" width="40rpx" height="40rpx"
|
<uv-image src="../../../../static/qrcode.png" width="40rpx" height="40rpx"
|
||||||
style="margin-top:10rpx" />
|
style="margin-top:10rpx" />
|
||||||
</view>
|
</view>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<uv-button type="primary" text="唯一码打印" @tap="goPrint"></uv-button>
|
<uv-button type="primary" text="唯一码打印" @tap="goPrint"></uv-button>
|
||||||
<uv-button type="success" text="溯源" @click="toTraceability"></uv-button>
|
<uv-button type="success" text="溯源" @tap="toTraceability"></uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uv-skeletons>
|
</uv-skeletons>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<z-paging ref="pagingRef" class="containerBox" v-model="uniqueCodeList" @query="getMaterialList">
|
<z-paging ref="pagingRef" class="containerBox" v-model="uniqueCodeList" @query="getMaterialList">
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item v-for="item in uniqueCodeList" :key="item.id" clickable class="material-card"
|
<uni-list-item v-for="item in uniqueCodeList" :key="item.id" clickable class="material-card"
|
||||||
@longpress="() => handleItemLongPress(item, index)" @click="toDetail(item)">
|
@longpress="() => handleItemLongPress(item, index)" @tap="toDetail(item)">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<p style="display: flex; flex-direction: column; width: 100%;">
|
<p style="display: flex; flex-direction: column; width: 100%;">
|
||||||
<!-- 编码、状态行 -->
|
<!-- 编码、状态行 -->
|
||||||
@@ -23,19 +23,19 @@
|
|||||||
<!-- 内容行 -->
|
<!-- 内容行 -->
|
||||||
<view class="text ">
|
<view class="text ">
|
||||||
<p>RFID:
|
<p>RFID:
|
||||||
<span v-if="item.rfidCode">{{ item.remark }}</span>
|
<text v-if="item.rfidCode">{{ item.remark }}</text>
|
||||||
<span v-else style="color: #999;">未绑定RFID</span>
|
<text v-else style="color: #999;">未绑定RFID</text>
|
||||||
</p>
|
</p>
|
||||||
<p>生成时间:
|
<p>生成时间:
|
||||||
<span>{{ item?.createTime }}</span>
|
<text>{{ item?.createTime }}</text>
|
||||||
</p>
|
</p>
|
||||||
<!-- 备注行-->
|
<!-- 备注行-->
|
||||||
<view class="flex-center qrCode">
|
<view class="flex-center qrCode">
|
||||||
<p>备注:
|
<p>备注:
|
||||||
<span v-if="item.remark">{{ item.remark }}</span>
|
<text v-if="item.remark">{{ item.remark }}</text>
|
||||||
<span v-else style="color: #999;">未填写</span>
|
<text v-else style="color: #999;">未填写</text>
|
||||||
</p>
|
</p>
|
||||||
<view @click.stop="getDetailInfo(item)">
|
<view @tap.stop="getDetailInfo(item)">
|
||||||
<uv-image src="../../../../static/qrcode.png" width="40rpx" height="40rpx"
|
<uv-image src="../../../../static/qrcode.png" width="40rpx" height="40rpx"
|
||||||
style="margin-top:10rpx" />
|
style="margin-top:10rpx" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
span {
|
text {
|
||||||
color: #616161;
|
color: #616161;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,6 +68,9 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 4rpx;
|
||||||
|
}
|
||||||
.mt-8 {
|
.mt-8 {
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
@@ -86,12 +89,18 @@
|
|||||||
.mt-16 {
|
.mt-16 {
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
}
|
}
|
||||||
|
.mr-4 {
|
||||||
|
margin-right: 4rpx;
|
||||||
|
}
|
||||||
.mr-8 {
|
.mr-8 {
|
||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
}
|
}
|
||||||
.mr-16 {
|
.mr-16 {
|
||||||
margin-right: 16rpx;
|
margin-right: 16rpx;
|
||||||
}
|
}
|
||||||
|
.ml-4 {
|
||||||
|
margin-left:4rpx;
|
||||||
|
}
|
||||||
.ml-8 {
|
.ml-8 {
|
||||||
margin-left: 8rpx;
|
margin-left: 8rpx;
|
||||||
}
|
}
|
||||||
@@ -214,7 +223,7 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
span {
|
text {
|
||||||
color: #616161;
|
color: #616161;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user