diff --git a/api/declaration.js b/api/declaration.js new file mode 100644 index 0000000..9d5c44c --- /dev/null +++ b/api/declaration.js @@ -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, +}; diff --git a/api/home.js b/api/home.js new file mode 100644 index 0000000..ffcfdce --- /dev/null +++ b/api/home.js @@ -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, +}; diff --git a/api/inventoryInfo.js b/api/inventoryInfo.js new file mode 100644 index 0000000..210c960 --- /dev/null +++ b/api/inventoryInfo.js @@ -0,0 +1,6 @@ +import { request } from "./request"; +//库龄查看 +const inventoryList = (params) => { + return request("/worn/statistics/aging/list", params, "get"); +}; +export { inventoryList }; diff --git a/api/report.js b/api/report.js new file mode 100644 index 0000000..8ad3fd3 --- /dev/null +++ b/api/report.js @@ -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 }; diff --git a/api/request.js b/api/request.js index ca79cb4..2e77222 100644 --- a/api/request.js +++ b/api/request.js @@ -1,6 +1,6 @@ //存放主站域名 -// const BASE_URL = 'http://192.168.1.5:8082' // w -const BASE_URL = "http://192.168.1.9:8082"; // yx +// const BASE_URL = 'http://192.168.1.5:8081' // w +const BASE_URL = "http://192.168.1.9:8081"; // yx // 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.5:8088' // 测试环境接口 @@ -274,12 +274,13 @@ const uploadMultipleFiles = async ( success: (res) => { try { const result = JSON.parse(res.data); - console.log("成功,", res); - if (result.code === 200 && result.data?.url) { + console.log("成功,", result, res); + if (result.code === 200 && result.data?.fileUrlList[0].url) { resolve({ index, // 保留原文件在数组中的索引(方便对应) - file, // 原始文件信息 - url: result.data.url, // 上传后的 URL + // file, // 原始文件信息 + url: result.data.fileUrlList[0].url, + name: result.data.fileUrlList[0].name, success: true, error: null, }); @@ -338,15 +339,18 @@ const uploadMultipleFiles = async ( url: BASE_URL + url, filePath: currentFile, name: "file", + formData, header, success: (res) => { + const result = JSON.parse(res.data); + console.log("成功1,", result, res); try { - const result = JSON.parse(res.data); - if (result.code === 200 && result.data?.url) { + if (result.code === 200 && result.data?.fileUrlList[0].url) { uploadResults.push({ index, - file: currentFile, + // file: currentFile, url: result.data.fileUrlList[0].url, + name: result.data.fileUrlList[0].name, success: true, error: null, }); diff --git a/api/stockOut.js b/api/stockOut.js index 6ef7a40..fb306d2 100644 --- a/api/stockOut.js +++ b/api/stockOut.js @@ -1,4 +1,4 @@ -import { request, Upload,uploadMultipleFiles } from "./request"; +import { request, Upload, uploadMultipleFiles } from "./request"; const api = "/worn/outboundBill/"; // 新建:出库单 const addStockOut = (params) => { @@ -29,9 +29,21 @@ const addWithFiles = (params) => { const myList = (params) => { 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) => { - return uploadMultipleFiles("/worn/technicalFile/upload", files, formData,true); + return uploadMultipleFiles( + "/worn/technicalFile/upload", + files, + formData, + true, + ); }; export { @@ -42,5 +54,6 @@ export { outBoundFinish, addWithFiles, uploadTechnicalFile, - myList + myList, + deleteAppraisal, }; diff --git a/pages.json b/pages.json index 4a5543f..4eef192 100644 --- a/pages.json +++ b/pages.json @@ -26,7 +26,7 @@ }, { "path": "pages/intelligent/index", - "style": { "navigationBarTitleText": "智能"} + "style": { "navigationBarTitleText": "智能" } }, { "path": "pages/my/index", @@ -59,56 +59,111 @@ "navigationStyle": "custom" } }, + { + "path": "pages/components/EquipmentInfo", + "style": { + "navigationBarTitleText": "设备详情", + "navigationStyle": "custom" + } + }, // { // "path": "pages/uniqueCode/bindRfid", // "style": { "navigationBarTitleText": "绑定RFID" } // }, // ========== 库存信息模块 ========== - // { - // "path": "pages/inventory/checkUniqueCode", - // "style": { "navigationBarTitleText": "唯一码盘点" } - // }, - // { - // "path": "pages/inventory/age", - // "style": { "navigationBarTitleText": "库龄查看" } - // }, - // { - // "path": "pages/inventory/alert", - // "style": { "navigationBarTitleText": "库存预警" } - // }, + { + "path": "pages/warehousing/InventoryInfo/checkUniqueCode", + "style": { "navigationBarTitleText": "唯一码盘点" } + }, + { + "path": "pages/warehousing/InventoryInfo/inventoryAgeView", + "style": { + "navigationBarTitleText": "库龄查看", + "navigationStyle": "custom" + } + }, + { + "path": "pages/warehousing/InventoryInfo/alert", + "style": { "navigationBarTitleText": "库存预警" } + }, + { + "path": "pages/warehousing/InventoryInfo/components/inventoryAgeDetail", + "style": { + "navigationBarTitleText": "库存库龄查看", + "navigationStyle": "custom" + } + }, // ========== 报表模块 ========== - // { - // "path": "pages/report/daily", - // "style": { "navigationBarTitleText": "库存日报" } - // }, - // { - // "path": "pages/report/monthly", - // "style": { "navigationBarTitleText": "库存月报" } - // }, - // { - // "path": "pages/report/company", - // "style": { "navigationBarTitleText": "公司库存报表" } - // }, - // { - // "path": "pages/report/warehouse", - // "style": { "navigationBarTitleText": "仓库库存报表" } - // }, + { + "path": "pages/warehousing/report/daily", + "style": { "navigationBarTitleText": "库存日报" } + }, + { + "path": "pages/warehousing/Report/monthly", + "style": { "navigationBarTitleText": "库存月报" } + }, + { + "path": "pages/warehousing/Report/company", + "style": { "navigationBarTitleText": "公司库存报表" } + }, + { + "path": "pages/warehousing/Report/warehouse", + "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", - // "style": { "navigationBarTitleText": "物资查询" } - // }, - // { - // "path": "pages/declaration/create", - // "style": { "navigationBarTitleText": "申报单开单" } - // }, - // { - // "path": "pages/declaration/my", - // "style": { "navigationBarTitleText": "我的申报单" } - // }, + { + "path": "pages/warehousing/Declaration/materialQuery", + "style": { "navigationBarTitleText": "物资查询" } + }, + { + "path": "pages/warehousing/Declaration/create", + "style": { + "navigationBarTitleText": "申报单开单", + "navigationStyle": "custom" + } + }, + { + "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" + } + }, // ========== 入库单模块 ========== { @@ -189,6 +244,20 @@ "navigationBarTitleText": "我提交的技术鉴定表", "navigationStyle": "custom" } + }, + { + "path": "pages/warehousing/Transport/checkIn", + "style": { + "navigationBarTitleText": "运输打卡", + "navigationStyle": "custom" + } + }, + { + "path": "pages/warehousing/Transport/my", + "style": { + "navigationBarTitleText": "我的运输打卡", + "navigationStyle": "custom" + } } ], "globalStyle": { diff --git a/pages/components/ChooseList.vue b/pages/components/ChooseList.vue index 58abc8a..6576811 100644 --- a/pages/components/ChooseList.vue +++ b/pages/components/ChooseList.vue @@ -1,6 +1,6 @@ diff --git a/pages/warehousing/StockIn/create.vue b/pages/warehousing/StockIn/create.vue index b89d521..3dfff5b 100644 --- a/pages/warehousing/StockIn/create.vue +++ b/pages/warehousing/StockIn/create.vue @@ -3,13 +3,14 @@ + :pathParams="{ ...pathParams, type: pathParams.type === 'my' ? 'my' : 'stockIn' }" /> - + - 扫码添加 - 提交 + 扫码添加 + 提交 @@ -35,7 +36,17 @@ const OPERATE_CONFIG = { stockIn: { back: '/pages/warehousing/stockIn/components/detail', title: '' - } + }, + // + declaration: { + back: '/pages/warehousing/Declaration/components/detail', + title: '' + }, + // + my: { + back: '/pages/warehousing/Declaration/components/detail', + title: '' + }, } // 数据:路径参数 const pathParams = ref('') @@ -125,15 +136,15 @@ const scanCode = () => { // 提交表单 const submitForm = () => { const info = warehousingInfoRef.value.getWarehousingInfo() - const materialInfo = materialRef.value.getMaterialList() + const materialInfo = materialRef.value.getMaterialList() || [] let params = { - warehouseCode: info.warehousing?.[0].deptCode || info.warehousing?.[0].deptId, - warehouseName: info.warehousing?.[0].deptName, - areaCode: info.storageArea?.[0].deptCode || info.storageArea?.[0].deptId, - areaName: info.storageArea?.[0].deptName, - remark: info.remark, - billRemark: info.remark, + warehouseCode: info?.warehousing?.[0]?.deptCode || info?.warehousing?.[0]?.deptId, + warehouseName: info?.warehousing?.[0]?.deptName, + areaCode: info?.storageArea?.[0]?.deptCode || info.storageArea?.[0]?.deptId, + areaName: info?.storageArea?.[0]?.deptName, + remark: info?.remark, + billRemark: info?.remark, itemList: _.map(materialInfo, (i) => ({ ...i.material })) } try { @@ -142,7 +153,13 @@ const submitForm = () => { addStockIn(params).then((res) => { if (res.code == 200) { 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 { @@ -169,7 +186,7 @@ onLoad((options) => { console.log('options==>', options); // 若有billNo传入 修改标题且为编辑 stockIn:入库编辑 stockIn-putAway:入库单入库编辑 - if (options?.billNo) { + if (options?.billNo && options?.type != 'my') { const query = objectToQuery(options) title.value = options.billNo backUrl.value = OPERATE_CONFIG.stockIn.back + query; diff --git a/pages/warehousing/StockOut/components/myTechnicalEvaluation.vue b/pages/warehousing/StockOut/components/myTechnicalEvaluation.vue index fa6d670..a2c5a79 100644 --- a/pages/warehousing/StockOut/components/myTechnicalEvaluation.vue +++ b/pages/warehousing/StockOut/components/myTechnicalEvaluation.vue @@ -11,23 +11,23 @@ - + @@ -124,7 +124,7 @@ onMounted(() => { getMaterialList() }) const toTechnical = () => { - const query = objectToQuery(pathParams.value) + const query = objectToQuery(pathParams?.value) uni.navigateTo({ url: `/pages/warehousing/stockOut/components/technicalEvaluation${query}` diff --git a/pages/warehousing/StockOut/components/technicalEvaluation.vue b/pages/warehousing/StockOut/components/technicalEvaluation.vue index c6b171c..7de1a9b 100644 --- a/pages/warehousing/StockOut/components/technicalEvaluation.vue +++ b/pages/warehousing/StockOut/components/technicalEvaluation.vue @@ -1,7 +1,7 @@ @@ -27,36 +28,33 @@ import { ref } from 'vue'; import { onLoad } from "@dcloudio/uni-app"; import { objectToQuery } from '../../../until'; import Navigation from '../../../components/Navigation.vue'; -import { uploadTechnicalFile, addWithFiles } from '@/api/stockOut' +import { uploadTechnicalFile, addWithFiles, deleteAppraisal } from '@/api/stockOut' import _ from 'lodash'; const queryParams = ref('') const formModel = ref({ billNo: null, remark: '', + appraisalNo: '', + id: '', fileList: [], }) const backUrl = ref('') const afterRead = async (event) => { - // scene = outbound - // bizType = technical_appraisal // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 console.log(event, '上传') let files = event.file?.map(file => file.url); - // console.log('files', files); - let formData = { scene: 'OUTBOUND', bizType: 'TECHNICAL_APPRAISAL', } - // files = files.map(p => ({ name: "files", uri: p })) uploadTechnicalFile(files, formData).then(res => { const some = _.some(res, { success: false }) - console.log(some,'上传接口调取成功', res) + console.log(some, '上传接口调取成功', res) if (some) return; if (!formModel.value.fileList || formModel.value.fileList.length == 0) { 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' }) }) }) @@ -67,15 +65,49 @@ const deleteImg = (index, type) => { } // 提交 const submitForm = () => { - console.log(formModel, 'formModel==>'); - addWithFiles({ ...formModel.value, billNo: queryParams.value.billNo }).then((res) => { + const params = { + remark: formModel.value.remark, + billNo: queryParams.value.billNo, + fileList: formModel.value.fileList, + } + addWithFiles(params).then((res) => { if (res.code == 200) { 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) => { const query = objectToQuery(options) @@ -84,7 +116,6 @@ onLoad((options) => { }) const toMyTechnicalList = () => { - console.log('1111111111'); const query = objectToQuery(queryParams.value) uni.navigateTo({ url: `/pages/warehousing/stockOut/components/myTechnicalEvaluation${query}` @@ -93,7 +124,7 @@ const toMyTechnicalList = () => { // 获取技术鉴定编数据 const getTechnicalList = () => { const list = uni.getStorageSync('app_technical'); - formModel.value.fileList = list?.fileList + formModel.value.fileList = list?.fileList || [] formModel.value.remark = list?.remark } getTechnicalList() diff --git a/pages/warehousing/StockOut/create.vue b/pages/warehousing/StockOut/create.vue index b58008c..c320d25 100644 --- a/pages/warehousing/StockOut/create.vue +++ b/pages/warehousing/StockOut/create.vue @@ -9,8 +9,8 @@ :pathParams="{...pathParams.value, type: 'stockOut' }" /> - 扫码添加 - 提交 + 扫码添加 + 提交 diff --git a/pages/warehousing/Transport/checkIn.vue b/pages/warehousing/Transport/checkIn.vue new file mode 100644 index 0000000..1e320cb --- /dev/null +++ b/pages/warehousing/Transport/checkIn.vue @@ -0,0 +1,113 @@ + + + + + \ No newline at end of file diff --git a/pages/warehousing/Transport/my.vue b/pages/warehousing/Transport/my.vue new file mode 100644 index 0000000..ada3c99 --- /dev/null +++ b/pages/warehousing/Transport/my.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/pages/warehousing/index.vue b/pages/warehousing/index.vue index 59d90af..a468040 100644 --- a/pages/warehousing/index.vue +++ b/pages/warehousing/index.vue @@ -5,7 +5,7 @@ - +

{{ value.title }}

@@ -15,7 +15,7 @@