From 5200b8b5a92b707ae7f115c7fd07cb7afc109980 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期四, 03 七月 2025 15:44:03 +0800 Subject: [PATCH] 更新配置和扩展功能,优化代码结构 修改 `http.js` 中的 `axios.defaults.baseURL` 配置,调整开发环境 URL。 - 在 `Dt_BillGroupStock_Hty.jsx` 和 `Dt_OutTime.jsx` 中添加作者信息和文档链接,增强组件扩展功能。 - 新增 `tables.js` 中的路由配置,包含 `Dt_BillGroupStock_Hty` 的路径。 - 在 `Dt_BillGroupStock_Hty.vue` 和 `Dt_OutTime.vue` 中定义表格列、编辑和搜索表单字段。 - 新增 `IStockInfoHtyRepository.cs` 和 `IStockInfoHtyService.cs` 接口定义。 - 在 `StockInfoHtyRepository.cs` 和 `StockInfoHtyService.cs` 中实现分页查询和批量删除功能。 - 更新 `appsettings.json` 中的数据库连接字符串,修改数据库名称。 --- Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock_Hty.jsx | 201 ++++++++++++++++ Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 4 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoHtyRepository.cs | 9 Code Management/WMS/WIDESEA_WMSClient/src/api/http.js | 4 Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock_Hty.vue | 94 +++++++ Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue | 21 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoHtyService.cs | 158 +++++++++++++ Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_OutTime.jsx | 201 ++++++++++++++++ Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js | 7 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoHtyRepository.cs | 6 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoHtyvice.cs | 5 11 files changed, 695 insertions(+), 15 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js b/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js index fd526c5..baab04e 100644 --- a/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js +++ b/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js @@ -11,8 +11,8 @@ let loadingInstance let loadingStatus = false if (process.env.NODE_ENV == 'development') { - // axios.defaults.baseURL = 'http://localhost:5000/'; - axios.defaults.baseURL = 'http://192.168.20.253:5000/'; + axios.defaults.baseURL = 'http://localhost:5000/'; + // axios.defaults.baseURL = 'http://192.168.20.253:5000/'; } else if (process.env.NODE_ENV == 'debug') { axios.defaults.baseURL = 'http://192.168.20.253:5000/'; diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock_Hty.jsx b/Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock_Hty.jsx new file mode 100644 index 0000000..a301399 --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock_Hty.jsx @@ -0,0 +1,201 @@ +/***************************************************************************************** + ** Author:jxx 2022 + ** QQ:283591387 + **瀹屾暣鏂囨。瑙侊細http://v2.volcore.xyz/document/api 銆愪唬鐮佺敓鎴愰〉闈iewGrid銆� + **甯哥敤绀轰緥瑙侊細http://v2.volcore.xyz/document/vueDev + **鍚庡彴鎿嶄綔瑙侊細http://v2.volcore.xyz/document/netCoreDev + *****************************************************************************************/ +//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜 + +// import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; +import gridBody from "./extend/SupplementationData.vue" +let extension = { + components: { + //鏌ヨ鐣岄潰鎵╁睍缁勪欢 + gridHeader: '', + gridBody: gridBody, + gridFooter: '', + //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓) + buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽� + methods: { + //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄� + onInit() { + //妗嗘灦鍒濆鍖栭厤缃墠锛� + let OutBoundBtn = this.buttons.find((x) => x.value == 'OutBound') + if (OutBoundBtn) { + OutBoundBtn.onClick = function () { + // this.$Message.success('鐐瑰嚮浜嗘寜閽�') + let row = this.$refs.table.getSelected() //鑾峰彇閫変腑鐨勮 + if (row <= 0) { + //濡傛灉娌℃湁閫変腑琛� + this.$Message.error('璇烽�夋嫨涓�琛屾暟鎹�') + return + } + let locationCode = row[0].locationCode + let palletCode = row[0].palletCode + this.http + .get( + `/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`, + {}, + '姝e湪鍒涘缓浠诲姟' + ) + .then((res) => { + //绀轰緥锛氳皟鐢ㄥ悗鍙版帴鍙� + if (res.status) { + this.$Message.success('鍒涘缓浠诲姟鎴愬姛') + console.log(res) + this.refresh() //鍒锋柊琛ㄦ牸 + } else { + this.$Message.error(res.message) //閿欒鎻愮ず + } + }) + } + } + + + var btnSupplementationData = this.buttons.find(x => x.value == "SupplementationData"); + if (btnSupplementationData != null) { + btnSupplementationData.onClick = () => { + let rows = this.$refs.table.getSelected(); + if (rows.length == 0) { + return this.$error("璇烽�夋嫨鏁版嵁!"); + } else if (rows.length > 1) { + return this.$error("鍙兘閫夋嫨鍗曟潯鏁版嵁"); + } + this.$refs.gridBody.open(rows[0].palletCode); + this.refresh(); + } + + } + //绀轰緥锛氬湪鎸夐挳鐨勬渶鍓嶉潰娣诲姞涓�涓寜閽� + // this.buttons.unshift({ + // //涔熷彲浠ョ敤push鎴栬�卻plice鏂规硶鏉ヤ慨鏀筨uttons鏁扮粍 + // name: '鐩存帴鍑哄簱', //鎸夐挳鍚嶇О + // icon: 'el-icon-document', //鎸夐挳鍥炬爣vue2鐗堟湰瑙乮view鏂囨。icon锛寁ue3鐗堟湰瑙乪lement ui鏂囨。icon(娉ㄦ剰涓嶆槸element puls鏂囨。) + // type: 'primary', //鎸夐挳鏍峰紡vue2鐗堟湰瑙乮view鏂囨。button锛寁ue3鐗堟湰瑙乪lement ui鏂囨。button + // onClick: function () { + // this.$Message.success('鐐瑰嚮浜嗘寜閽�') + // let row = this.$refs.table.getSelected() //鑾峰彇閫変腑鐨勮 + // if (row <= 0) { + // //濡傛灉娌℃湁閫変腑琛� + // this.$Message.error('璇烽�夋嫨涓�琛屾暟鎹�') + // return + // } + // let locationCode = row[0].locationCode + // let palletCode = row[0].palletCode + // this.http.get(`/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`, {}, "姝e湪鍒涘缓浠诲姟").then((res) => { + // //绀轰緥锛氳皟鐢ㄥ悗鍙版帴鍙� + // if (res.status) { + // this.$Message.success('鍒涘缓浠诲姟鎴愬姛') + // } else { + // this.$Message.error(res.message) //閿欒鎻愮ず + // } + // }) + // } + // }) + + //绀轰緥锛氳缃慨鏀规柊寤恒�佺紪杈戝脊鍑烘瀛楁鏍囩鐨勯暱搴� + this.boxOptions.labelWidth = 150 + + // this.columns.push({ + // title: "鎿嶄綔", + // field: "鎿嶄綔", + // width: 150, + // align: "left", // 'center', + // render: (h, { row, column, index }) => { + // return ( + // <div> + // <el-button + // onClick={($e) => { + // this.$refs.gridHeader.openModel1(row); + // }} + // type="primary" + // plain + // style="height:26px; padding: 10px !important;" + // > + // 鏌ョ湅搴撳瓨鏄庣粏 + // </el-button> + // </div> + // ); + // }, + // }); + + this.columns.forEach((column) => { + //淇敼棰滆壊 + if (column.field == 'roadwayNo') { + column.formatter = (row) => { + // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' + return row?.locationInfo?.roadwayNo + } + } + if (column.field == 'materielCode') { + column.formatter = (row) => { + // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' + return row?.stockInfoDetails[0]?.materielCode + } + } + //鏍煎紡鍖栨棩鏈� + // 妫�鏌ュ綋鍓嶅垪鐨勫瓧娈垫槸鍚︿负 'locationStatus' + if (column.field == 'locationStatus') { + // 浣跨敤瀵硅薄瀛楅潰閲忔潵鏄犲皠 'locationStatus' 鐨勫�煎拰瀵瑰簲鐨勬枃鏈� + const statusMap = { + '-1': '鍏ㄩ儴', + '0': '绌洪棽', + '1': '閿佸畾', + '2': '鏈夎揣', + '3': '鏈夎揣绂佺敤', + '4': '鏃犺揣绂佺敤' + }; + // 瀹氫箟涓�涓牸寮忓寲鍑芥暟锛屾牴鎹� 'locationStatus' 鐨勫�艰繑鍥炵浉搴旂殑鏂囨湰 + column.formatter = (row) => { + // 浣跨敤 statusMap 瀵硅薄鏉ヨ幏鍙栧搴旂殑鏂囨湰锛屽鏋滄病鏈夊尮閰嶅垯杩斿洖 '鏈煡鐘舵��' + return statusMap[row?.locationInfo?.locationStatus] || '鏈煡鐘舵��'; + } + } + }) + }, + onInited() { + //妗嗘灦鍒濆鍖栭厤缃悗 + //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔 + this.detailOptions.columns.forEach(column=>{ + console.log(column) + }); + }, + searchBefore(param) { + //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟 + //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ + return true + }, + searchAfter(result) { + console.log(result) + return true + }, + addBefore(formData) { + //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫�� + return true + }, + updateBefore(formData) { + //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d + return true + }, + rowClick({ row, column, event }) { + //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠� + // this.$refs.table.$refs.table.toggleRowSelection(row) //鍗曞嚮琛屾椂閫変腑褰撳墠琛�; + }, + modelOpenAfter(row) { + + //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁 + //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add'; + //(2)缁欏脊鍑烘璁剧疆榛樿鍊� + //(3)this.editFormFields.瀛楁='xxx'; + //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊� + //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions) + } + } +} +export default extension diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_OutTime.jsx b/Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_OutTime.jsx new file mode 100644 index 0000000..a301399 --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_OutTime.jsx @@ -0,0 +1,201 @@ +/***************************************************************************************** + ** Author:jxx 2022 + ** QQ:283591387 + **瀹屾暣鏂囨。瑙侊細http://v2.volcore.xyz/document/api 銆愪唬鐮佺敓鎴愰〉闈iewGrid銆� + **甯哥敤绀轰緥瑙侊細http://v2.volcore.xyz/document/vueDev + **鍚庡彴鎿嶄綔瑙侊細http://v2.volcore.xyz/document/netCoreDev + *****************************************************************************************/ +//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜 + +// import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; +import gridBody from "./extend/SupplementationData.vue" +let extension = { + components: { + //鏌ヨ鐣岄潰鎵╁睍缁勪欢 + gridHeader: '', + gridBody: gridBody, + gridFooter: '', + //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓) + buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽� + methods: { + //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄� + onInit() { + //妗嗘灦鍒濆鍖栭厤缃墠锛� + let OutBoundBtn = this.buttons.find((x) => x.value == 'OutBound') + if (OutBoundBtn) { + OutBoundBtn.onClick = function () { + // this.$Message.success('鐐瑰嚮浜嗘寜閽�') + let row = this.$refs.table.getSelected() //鑾峰彇閫変腑鐨勮 + if (row <= 0) { + //濡傛灉娌℃湁閫変腑琛� + this.$Message.error('璇烽�夋嫨涓�琛屾暟鎹�') + return + } + let locationCode = row[0].locationCode + let palletCode = row[0].palletCode + this.http + .get( + `/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`, + {}, + '姝e湪鍒涘缓浠诲姟' + ) + .then((res) => { + //绀轰緥锛氳皟鐢ㄥ悗鍙版帴鍙� + if (res.status) { + this.$Message.success('鍒涘缓浠诲姟鎴愬姛') + console.log(res) + this.refresh() //鍒锋柊琛ㄦ牸 + } else { + this.$Message.error(res.message) //閿欒鎻愮ず + } + }) + } + } + + + var btnSupplementationData = this.buttons.find(x => x.value == "SupplementationData"); + if (btnSupplementationData != null) { + btnSupplementationData.onClick = () => { + let rows = this.$refs.table.getSelected(); + if (rows.length == 0) { + return this.$error("璇烽�夋嫨鏁版嵁!"); + } else if (rows.length > 1) { + return this.$error("鍙兘閫夋嫨鍗曟潯鏁版嵁"); + } + this.$refs.gridBody.open(rows[0].palletCode); + this.refresh(); + } + + } + //绀轰緥锛氬湪鎸夐挳鐨勬渶鍓嶉潰娣诲姞涓�涓寜閽� + // this.buttons.unshift({ + // //涔熷彲浠ョ敤push鎴栬�卻plice鏂规硶鏉ヤ慨鏀筨uttons鏁扮粍 + // name: '鐩存帴鍑哄簱', //鎸夐挳鍚嶇О + // icon: 'el-icon-document', //鎸夐挳鍥炬爣vue2鐗堟湰瑙乮view鏂囨。icon锛寁ue3鐗堟湰瑙乪lement ui鏂囨。icon(娉ㄦ剰涓嶆槸element puls鏂囨。) + // type: 'primary', //鎸夐挳鏍峰紡vue2鐗堟湰瑙乮view鏂囨。button锛寁ue3鐗堟湰瑙乪lement ui鏂囨。button + // onClick: function () { + // this.$Message.success('鐐瑰嚮浜嗘寜閽�') + // let row = this.$refs.table.getSelected() //鑾峰彇閫変腑鐨勮 + // if (row <= 0) { + // //濡傛灉娌℃湁閫変腑琛� + // this.$Message.error('璇烽�夋嫨涓�琛屾暟鎹�') + // return + // } + // let locationCode = row[0].locationCode + // let palletCode = row[0].palletCode + // this.http.get(`/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`, {}, "姝e湪鍒涘缓浠诲姟").then((res) => { + // //绀轰緥锛氳皟鐢ㄥ悗鍙版帴鍙� + // if (res.status) { + // this.$Message.success('鍒涘缓浠诲姟鎴愬姛') + // } else { + // this.$Message.error(res.message) //閿欒鎻愮ず + // } + // }) + // } + // }) + + //绀轰緥锛氳缃慨鏀规柊寤恒�佺紪杈戝脊鍑烘瀛楁鏍囩鐨勯暱搴� + this.boxOptions.labelWidth = 150 + + // this.columns.push({ + // title: "鎿嶄綔", + // field: "鎿嶄綔", + // width: 150, + // align: "left", // 'center', + // render: (h, { row, column, index }) => { + // return ( + // <div> + // <el-button + // onClick={($e) => { + // this.$refs.gridHeader.openModel1(row); + // }} + // type="primary" + // plain + // style="height:26px; padding: 10px !important;" + // > + // 鏌ョ湅搴撳瓨鏄庣粏 + // </el-button> + // </div> + // ); + // }, + // }); + + this.columns.forEach((column) => { + //淇敼棰滆壊 + if (column.field == 'roadwayNo') { + column.formatter = (row) => { + // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' + return row?.locationInfo?.roadwayNo + } + } + if (column.field == 'materielCode') { + column.formatter = (row) => { + // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>' + return row?.stockInfoDetails[0]?.materielCode + } + } + //鏍煎紡鍖栨棩鏈� + // 妫�鏌ュ綋鍓嶅垪鐨勫瓧娈垫槸鍚︿负 'locationStatus' + if (column.field == 'locationStatus') { + // 浣跨敤瀵硅薄瀛楅潰閲忔潵鏄犲皠 'locationStatus' 鐨勫�煎拰瀵瑰簲鐨勬枃鏈� + const statusMap = { + '-1': '鍏ㄩ儴', + '0': '绌洪棽', + '1': '閿佸畾', + '2': '鏈夎揣', + '3': '鏈夎揣绂佺敤', + '4': '鏃犺揣绂佺敤' + }; + // 瀹氫箟涓�涓牸寮忓寲鍑芥暟锛屾牴鎹� 'locationStatus' 鐨勫�艰繑鍥炵浉搴旂殑鏂囨湰 + column.formatter = (row) => { + // 浣跨敤 statusMap 瀵硅薄鏉ヨ幏鍙栧搴旂殑鏂囨湰锛屽鏋滄病鏈夊尮閰嶅垯杩斿洖 '鏈煡鐘舵��' + return statusMap[row?.locationInfo?.locationStatus] || '鏈煡鐘舵��'; + } + } + }) + }, + onInited() { + //妗嗘灦鍒濆鍖栭厤缃悗 + //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔 + this.detailOptions.columns.forEach(column=>{ + console.log(column) + }); + }, + searchBefore(param) { + //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟 + //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ + return true + }, + searchAfter(result) { + console.log(result) + return true + }, + addBefore(formData) { + //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫�� + return true + }, + updateBefore(formData) { + //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d + return true + }, + rowClick({ row, column, event }) { + //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠� + // this.$refs.table.$refs.table.toggleRowSelection(row) //鍗曞嚮琛屾椂閫変腑褰撳墠琛�; + }, + modelOpenAfter(row) { + + //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁 + //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add'; + //(2)缁欏脊鍑烘璁剧疆榛樿鍊� + //(3)this.editFormFields.瀛楁='xxx'; + //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊� + //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions) + } + } +} +export default extension diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js b/Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js index 8167dd3..805cad8 100644 --- a/Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js +++ b/Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js @@ -260,6 +260,13 @@ meta: { keepAlive: false } + },{ + path: '/Dt_BillGroupStock_Hty', + name: 'Dt_BillGroupStock_Hty', + component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStock_Hty.vue'), + meta: { + keepAlive: false + } }, ] export default tables diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock_Hty.vue b/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock_Hty.vue new file mode 100644 index 0000000..71f6c38 --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock_Hty.vue @@ -0,0 +1,94 @@ +<!-- +*Author锛歫xx + *Contact锛�283591387@qq.com + *浠g爜鐢辨鏋剁敓鎴�,浠讳綍鏇存敼閮藉彲鑳藉鑷磋浠g爜鐢熸垚鍣ㄨ鐩� + *涓氬姟璇峰湪@/extension/widesea_wms/stock/Dt_BillGroupStock.js姝ゅ缂栧啓 + --> + +<template> + <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" + :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" + :table="table" :extend="extend"> + </view-grid> +</template> +<script> +import extend from "@/extension/widesea_wms/stock/Dt_BillGroupStock_Hty.jsx"; +import { ref, defineComponent } from "vue"; +export default defineComponent({ + setup() { + const table = ref({ + key: 'id', + footer: "Foots", + cnName: '搴撳瓨鍘嗗彶淇℃伅', + name: 'stock/Dt_BillGroupStock_Hty', + url: "/StockInfoHty/", + sortName: "createDate" + }); + const editFormFields = ref({ + "palletCode": "", + "productionLine": "", + "outboundTime": "", + // "groupType": "" + }); + const editFormOptions = ref([ + [ + { "title": "鎵樼洏鏉$爜", "field": "palletCode", type: "text" }, + { "title": "鐢熶骇浜х嚎", "field": "productionLine", type: "text" }, + { "title": "搴斿嚭搴撴椂闂�", "field": "outboundTime", type: "datetime" }, + // { "title": "缁勭洏绫诲瀷", "field": "groupType", type: "select", dataKey: "GroupType", data: [] }, + ] + ]); + const searchFormFields = ref({}); + const searchFormOptions = ref([ + [ + { "title": "鎵樼洏鏉$爜", "field": "palletCode", type: "text" }, + { "title": "鐢熶骇浜х嚎", "field": "productionLine", type: "select", dataKey: "ProductionLine", data: [] }, + { "title": "搴撳尯", "field": "areaCode", type: "select", dataKey: "AreaType", data: [] }, + { "title": "搴撳瓨绫诲瀷", "field": "isFull", type: "select", dataKey: "isFull", data: [] }, + ], [ + { "title": "搴撲綅鍙�", "field": "locationCode", type: "text" }, + { "title": "宸烽亾", "field": "roadwayNo", type: "text" }, + { "title": "璐т綅鐘舵��", "field": "locationStatus", type: "select", dataKey: "LocationState", data: [] }, + { "title": "鐗╂枡缂栫爜", "field": "materielCode", type: "text"}, + ] + ]); + const columns = ref( + [{ field: 'id', title: '搴撳瓨ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' }, + { field: 'locationCode', title: '搴撲綅', type: 'string', width: 100, align: 'left', }, + { field: 'palletCode', title: '鎵樼洏鏉$爜', type: 'string', width: 110, align: 'left', }, + { field: 'isFull', title: '搴撳瓨绫诲瀷', type: 'bool', width: 60, align: 'left', bind: { key: "isFull", data: [{ key: false, value: '绌虹洏' }, { key: true, value: '瀹炵洏' }] }, }, + { field: 'linedProcessFeedbackTime', title: '宸ヨ壓寮�濮嬫椂闂�', type: 'string', width: 110, align: 'left', }, + { field: 'roadwayNo', title: '宸烽亾', type: 'string', width: 60, align: 'left', sort: true }, + { field: 'materielCode', title: '鐗╂枡缂栫爜', type: 'string', width: 90, align: 'left', sort: true }, + // { field: 'locationStatus', title: '璐т綅鐘舵��', type: 'int', width: 60, align: 'left', bind: { key: "LocationState", data: [] } }, + { field: 'specialParameterDuration', title: '宸ヨ壓鏃堕暱', type: 'string', width: 60, align: 'left', sort: true }, + { field: 'outboundTime', title: '搴斿嚭搴撴椂闂�', type: 'string', width: 110, align: 'left', sort: true }, + { field: 'productionLine', title: '鐢熶骇浜х嚎', type: 'string', width: 60, align: 'left', bind: { key: "ProductionLine", data: [] } }, + { field: 'areaCode', title: '搴撳尯', type: 'string', width: 60, align: 'left', bind: { key: "AreaType", data: [] } }, + { field: 'remark', title: '鐢佃姱鏁伴噺', type: 'string', width: 60, align: 'left', }, + { field: 'creater', title: '鍒涘缓浜�', type: 'string', sort: true, width: 110, align: 'left', hidden: true }, + { field: 'createDate', title: '鍒涘缓鏃堕棿', type: 'datetime', sort: true, width: 150, align: 'left', }, + { field: 'modifier', title: '鏈�鍚庝慨鏀逛汉', type: 'string', sort: true, width: 100, hidden: true, align: 'left' }, + // { field: 'modifyDate', title: '鏈�鍚庝慨鏀规椂闂�', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, + ] + ); + const detail = ref({ + cnName: "#detailCnName", + table: "#detailTable", + columns: [], + sortName: "", + key: "" + }); + return { + table, + extend, + editFormFields, + editFormOptions, + searchFormFields, + searchFormOptions, + columns, + detail, + }; + }, +}); +</script> diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue b/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue index 7cf35e1..000f539 100644 --- a/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue +++ b/Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue @@ -7,21 +7,21 @@ <template> <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" - :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" + :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> </view-grid> </template> <script> -import extend from "@/extension/widesea_wms/stock/Dt_BillGroupStock.jsx"; +import extend from "@/extension/widesea_wms/stock/Dt_OutTime.jsx"; import { ref, defineComponent } from "vue"; export default defineComponent({ setup() { const table = ref({ key: 'id', footer: "Foots", - cnName: '瓒呮椂淇℃伅', - name: 'stock/Dt_BillGroupStock', - url:"/StockInfoTimeout/", + cnName: '瓒呮椂搴撳瓨淇℃伅', + name: 'stock/StockInfoTimeout', + url: "/StockInfo/", sortName: "createDate" }); const editFormFields = ref({ @@ -49,18 +49,18 @@ { "title": "搴撲綅鍙�", "field": "locationCode", type: "text" }, { "title": "宸烽亾", "field": "roadwayNo", type: "text" }, { "title": "璐т綅鐘舵��", "field": "locationStatus", type: "select", dataKey: "LocationState", data: [] }, - { "title": "鍑哄簱鏃堕棿", "field": "outboundTime", type: "datetime"}, + { "title": "鐗╂枡缂栫爜", "field": "materielCode", type: "text"}, ] ]); - const now = new Date(); - // 鐩存帴鍑忓幓 3 灏忔椂锛堝彲鑳借法澶╋紝Date 瀵硅薄浼氳嚜鍔ㄥ鐞嗭級 - now.setHours(now.getHours() - 3); const columns = ref( [{ field: 'id', title: '搴撳瓨ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' }, { field: 'locationCode', title: '搴撲綅', type: 'string', width: 100, align: 'left', }, { field: 'palletCode', title: '鎵樼洏鏉$爜', type: 'string', width: 110, align: 'left', }, - { field: 'isFull', title: '搴撳瓨绫诲瀷', type: 'bool', width: 80, align: 'left', bind: { key: "isFull", data: [{ key: false, value: '绌虹洏' }, { key: true, value: '瀹炵洏' }] }, }, + { field: 'isFull', title: '搴撳瓨绫诲瀷', type: 'bool', width: 60, align: 'left', bind: { key: "isFull", data: [{ key: false, value: '绌虹洏' }, { key: true, value: '瀹炵洏' }] }, }, { field: 'linedProcessFeedbackTime', title: '宸ヨ壓寮�濮嬫椂闂�', type: 'string', width: 110, align: 'left', }, + { field: 'roadwayNo', title: '宸烽亾', type: 'string', width: 60, align: 'left', sort: true }, + { field: 'materielCode', title: '鐗╂枡缂栫爜', type: 'string', width: 90, align: 'left', sort: true }, + { field: 'locationStatus', title: '璐т綅鐘舵��', type: 'int', width: 60, align: 'left', bind: { key: "LocationState", data: [] } }, { field: 'specialParameterDuration', title: '宸ヨ壓鏃堕暱', type: 'string', width: 60, align: 'left', sort: true }, { field: 'outboundTime', title: '搴斿嚭搴撴椂闂�', type: 'string', width: 110, align: 'left', sort: true }, { field: 'productionLine', title: '鐢熶骇浜х嚎', type: 'string', width: 60, align: 'left', bind: { key: "ProductionLine", data: [] } }, @@ -72,7 +72,6 @@ // { field: 'modifyDate', title: '鏈�鍚庝慨鏀规椂闂�', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, ] ); - const detail = ref({ cnName: "#detailCnName", table: "#detailTable", diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoHtyRepository.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoHtyRepository.cs new file mode 100644 index 0000000..2beb08b --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoHtyRepository.cs @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IStockInfoHtyRepository : IRepository<DtStockInfo_Hty> + { + } +} \ No newline at end of file diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoHtyvice.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoHtyvice.cs new file mode 100644 index 0000000..8837b61 --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoHtyvice.cs @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IStockInfoHtyService : IService<DtStockInfo_Hty> +{ +} \ No newline at end of file diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoHtyRepository.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoHtyRepository.cs new file mode 100644 index 0000000..e16d05a --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoHtyRepository.cs @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class StockInfoHtyRepository : RepositoryBase<DtStockInfo_Hty>, IStockInfoHtyRepository + { + public StockInfoHtyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoHtyService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoHtyService.cs new file mode 100644 index 0000000..d234d42 --- /dev/null +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoHtyService.cs @@ -0,0 +1,158 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using Masuit.Tools; +using SqlSugar; +using System.Collections; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq.Expressions; +using System.Threading.Tasks; +using WIDESEA_Cache; +using WIDESEA_Common; +using WIDESEA_Core; + +namespace WIDESEA_StorageBasicService; + +public class StockInfoHtyService : ServiceBase<DtStockInfo_Hty, IStockInfoHtyRepository>, IStockInfoHtyService +{ + + private readonly ISimpleCacheService _simpleCacheService; + private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; + public StockInfoHtyService(IStockInfoHtyRepository BaseDal, ISimpleCacheService simpleCacheService, ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal) + { + _simpleCacheService = simpleCacheService; + _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; + } + + /// <summary> + /// 鍒嗛〉 + /// </summary> + /// <param name="options"></param> + /// <returns></returns> + public override PageGridData<DtStockInfo_Hty> GetPageData(PageDataOptions options) + { + string wheres = ValidatePageOptions(options); + //鑾峰彇鎺掑簭瀛楁 + Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties); + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderbyDic) + { + OrderByModel orderByModel = new() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + + + int totalCount = 0; + List<SearchParameters> searchParametersList = new List<SearchParameters>(); + if (!string.IsNullOrEmpty(options.Wheres)) + { + try + { + searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); + options.Filter = searchParametersList; + } + catch { } + } + + Expression<Func<DtStockInfo_Hty, bool>> locationStatus = null; + Expression<Func<DtStockInfo_Hty, bool>> roadwayNo = null; + Expression<Func<DtStockInfo_Hty, bool>> materielCode = null; + foreach (var item in searchParametersList) + { + if (item.Name.Contains("locationStatus")) + { + locationStatus = x => x.LocationInfo.LocationStatus == Convert.ToInt32(item.Value); + } + else if (item.Name.Contains("roadwayNo")) + { + roadwayNo = x => x.LocationInfo.RoadwayNo.Contains(item.Value); + } + else if (item.Name.Contains("materielCode")) + { + materielCode = x => x.StockInfoDetails.Any(d => d.MaterielCode.Contains(item.Value)); + } + } + //.IncludesAllFirstLayer() + var data = BaseDal.Db.Queryable<DtStockInfo_Hty>() + .Includes(x => x.StockInfoDetails) + .Includes(x => x.LocationInfo) + .WhereIF(!wheres.IsNullOrEmpty(), wheres) + .WhereIF(locationStatus != null, locationStatus) + .WhereIF(roadwayNo != null, roadwayNo) + .WhereIF(materielCode != null, materielCode) + .OrderBy(orderByModels) + .ToPageList(options.Page, options.Rows, ref totalCount); + return new PageGridData<DtStockInfo_Hty>(totalCount, data); + } + + /// <summary> + /// 鎵归噺鍒犻櫎 + /// </summary> + /// <param name="keys"></param> + /// <returns></returns> + public override WebResponseContent DeleteData(object[] keys) + { + try + { + List<DtStockInfo_Hty> stockInfos = new List<DtStockInfo_Hty>(); + List<DtLocationInfo> locationInfos = new List<DtLocationInfo>(); + + + var stocks = new List<string>(); + + foreach (var item in keys) + { + var stock = BaseDal.QueryFirstNavAsync(x => x.Id == item.ObjToInt()).Result; + var stockHty = stock.Adapt<DtStockInfo_Hty>(); + stockInfos.Add(stockHty); + + var location = SqlSugarHelper.DbWMS.Queryable<DtLocationInfo>().FirstAsync(x => x.Id == stock.LocationId).Result; + var lastStatus = location.LocationStatus; + location.LocationStatus = (int)LocationEnum.Free; + locationInfos.Add(location); + stocks.Add(stock.PalletCode); + _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.ManualOperation, 0); + } + + //_simpleCacheService.HashDel<DtStockInfo>(CacheConst.Cache_DtStockInfo, stocks.ToArray()); + //var hty = BaseDal.Db.InsertNav(stockInfos) + // .Include(x => x.StockInfoDetails) + // .ExecuteCommand(); + + //var locationd = SqlSugarHelper.DbWMS.Updateable(locationInfos).ExecuteCommandHasChange(); + //return base.DeleteData(keys); + + var hty = BaseDal.Db.InsertNav(stockInfos) + .Include(x => x.StockInfoDetails) + .ExecuteCommand(); + + var locationd = SqlSugarHelper.DbWMS.Updateable(locationInfos).ExecuteCommandHasChange(); + return base.DeleteData(keys); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + // 鏍规嵁浼犲叆搴撳瓨绫诲瀷鑾峰彇涓嶅悓宸烽亾鐨勫簱瀛� + public async Task<Dictionary<string, int>> GetLocationByStockType(bool stockType, string areaCode) + { + var stockInfos = await BaseDal.Db.Queryable<DtStockInfo>().Where(x => x.IsFull == stockType && x.AreaCode == areaCode) + .Includes(x => x.LocationInfo).ToListAsync(); + + var result = stockInfos + .GroupBy(x => x.LocationInfo.RoadwayNo) + .ToDictionary(x => x.Key, x => x.Count()); + return result; + } + + //public override WebResponseContent UpdateData(DtStockInfo entity) + //{ + // return base.UpdateData(entity); + //} +} \ No newline at end of file diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json index 78cc774..a884209 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json @@ -11,11 +11,11 @@ //杩炴帴瀛楃涓� //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", //"ConnectionString": "Data Source=192.168.15.253;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", - "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionStringWCS": "Data Source=192.168.15.253;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", - "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //璺ㄥ煙 "Cors": { "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О -- Gitblit v1.9.3