From 13ff42ea68f709d7ee79b41466ea8fbfb1104ac0 Mon Sep 17 00:00:00 2001 From: huanghui <2397241381@qq.com> Date: Tue, 15 Aug 2023 17:39:42 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/processing/orderProcessing.vue | 74 +++++++++++++++++-- .../PurchaseOrderConfirmationList.vue | 30 ++++++-- 2 files changed, 90 insertions(+), 14 deletions(-) diff --git a/src/views/purchase/processing/orderProcessing.vue b/src/views/purchase/processing/orderProcessing.vue index 1da0188..deebd4f 100644 --- a/src/views/purchase/processing/orderProcessing.vue +++ b/src/views/purchase/processing/orderProcessing.vue @@ -1,11 +1,15 @@ @@ -52,6 +72,7 @@ export default { sysOrgCode: Vue.ls.get(USER_INFO).orgCode, supplierList: [], tableData: [], + dataShow: false, } }, computed: { @@ -81,14 +102,21 @@ export default { }) }, getTableData() { + this.dataShow = false; getAction(this.getdata,).then(res => { //如果为200,则获取数据 if (res.code == 200) { this.tableData = res.result.records; - this.activeKey = [0]; - this.tableData.forEach(item => { - item.procurementContent = JSON.parse(item.procurementContent); - }); + //判断数据是否为空 + if (this.tableData.length == 0) { + this.dataShow = false; + } else { + this.activeKey = [0]; + this.tableData.forEach(item => { + item.procurementContent = JSON.parse(item.procurementContent); + }); + this.dataShow = true; + } } else { this.$message.error(res.message); } @@ -97,7 +125,7 @@ export default { receiveNO(item) { //深拷贝一份item let newItem = Object.assign({}, item); - newItem.procurementContent = String(newItem.procurementContent); + newItem.procurementContent = JSON.stringify(newItem.procurementContent); postAction(this.receiveNOurl, newItem).then(res => { //如果为200,则获取数据 if (res.code == 200) { @@ -107,7 +135,37 @@ export default { this.$message.error(res.message); } }) + }, downloadFile(text) { + if (!text) { + this.$message.warning("未知的文件") + return; + } + if (text.indexOf(",") > 0) { + text = text.substring(0, text.indexOf(",")) + } + let url = this.getFileAccessHttpUrl(text) + window.open(url); }, + getFileAccessHttpUrl(avatar, subStr) { + if (!subStr) subStr = 'http' + try { + if (avatar && avatar.startsWith(subStr)) { + return avatar; + } else { + if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) { + return window._CONFIG['staticDomainURL'] + "/" + avatar; + } + } + } catch (err) { + return; + } + }, generateOrder(item) { + console.log(item); + this.$message.success('生成订单中'); + }, arrange(item) { + console.log(item); + this.$message.success('正在整理'); + } } } diff --git a/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue b/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue index 31ee1f8..89503ad 100644 --- a/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue +++ b/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue @@ -1,6 +1,9 @@ @@ -64,7 +90,7 @@ export default { return { url: { getPurchaseSupplier: "Try/purchaseSupplier/list", - getdata: "/Try/purchaseRequest/receivedList", + getdata: "/Try/purchaseOrderConfirmation/joinList", receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving", }, activeKey: [], @@ -73,6 +99,9 @@ export default { supplierList: [], tableData: [], dataShow: false, + arrange: false, + arrangeData: [], + classifyData: [], } }, computed: { @@ -103,10 +132,10 @@ export default { }, getTableData() { this.dataShow = false; - getAction(this.getdata,).then(res => { + getAction(this.getdata).then(res => { //如果为200,则获取数据 if (res.code == 200) { - this.tableData = res.result.records; + this.tableData = res.result; //判断数据是否为空 if (this.tableData.length == 0) { this.dataShow = false; @@ -135,7 +164,12 @@ export default { this.$message.error(res.message); } }) - }, downloadFile(text) { + }, + Refresh() { + this.getSupplierData(); + this.getTableData(); + }, + downloadFile(text) { if (!text) { this.$message.warning("未知的文件") return; @@ -159,14 +193,51 @@ export default { } catch (err) { return; } - }, generateOrder(item) { - console.log(item); - this.$message.success('生成订单中'); - }, arrange(item) { - console.log(item); - this.$message.success('正在整理'); + }, + generateOrder(item) { + this.$message.success('生成订单成功'); + }, + arrangeOpen(item) { + this.classifyData = []; + this.arrangeData = Object.assign({}, item); + this.arrange = true; + }, + arrangeOk() { + this.$message.success('整理成功'); + this.arrange = false; + }, + arrangeCancel() { + this.$message.success('整理取消'); + this.arrange = false; + }, + addSupplier() { + //在classifyData添加一个空对象公司 + this.classifyData.push({ + supplier: "哈哈公司", + goods: [{ + name: "哈哈", + number: "1", + unit: "个", + }, { + name: "哈哈", + number: "1", + unit: "个", + } + ], + }); } - } + }, } - \ No newline at end of file + + + + diff --git a/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue b/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue index 89503ad..b80085d 100644 --- a/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue +++ b/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue @@ -124,6 +124,7 @@ export default { item.procurementContent = JSON.parse(item.procurementContent); }); this.dataShow = true; + console.log(this.dataList); } } else { this.$message.error(res.message); From bce709dd64797c5ba42878081ea16a99ebdd10fd Mon Sep 17 00:00:00 2001 From: huanghui <2397241381@qq.com> Date: Wed, 16 Aug 2023 17:43:06 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/processing/orderProcessing.vue | 278 +++++++++++++++--- .../PurchaseOrderConfirmationList.vue | 2 +- 2 files changed, 238 insertions(+), 42 deletions(-) diff --git a/src/views/purchase/processing/orderProcessing.vue b/src/views/purchase/processing/orderProcessing.vue index e422061..578cd79 100644 --- a/src/views/purchase/processing/orderProcessing.vue +++ b/src/views/purchase/processing/orderProcessing.vue @@ -30,7 +30,8 @@ - +
{{ item2.name }} @@ -40,7 +41,30 @@ 物品和供应商整理 - 123 + + + +
+ + + + + + + + + + + +
+
+ + 物品和供应商整理 +
@@ -55,27 +79,63 @@ -
- 暂未数据分类 + 暂无数据
-
- +
+ -
- {{ item2.name }} +
+ + + {{ food.name }} + + + + 导入 +
+
+ + + + + + + + + + + + + + + + + + + +
+
- 添加供应商 +
+ + + {{ supplier.name }} + + + 添加供应商 +
-
@@ -92,6 +152,7 @@ export default { getPurchaseSupplier: "Try/purchaseSupplier/list", getdata: "/Try/purchaseOrderConfirmation/joinList", receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving", + editUrl: '/Try/purchaseOrderConfirmation/edit' }, activeKey: [], username: Vue.ls.get(USER_INFO).username, @@ -100,8 +161,13 @@ export default { tableData: [], dataShow: false, arrange: false, - arrangeData: [], + classifyData: [], + classSupplier: [], + selectedSuppliers: '', + classFood: [], + selectedFoods: [], + poenNmber: '', } }, computed: { @@ -114,6 +180,9 @@ export default { receiveNOurl: function () { return `${window._CONFIG['domianURL']}/${this.url.receiveNOurl}`; }, + editUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.editUrl}`; + }, }, created() { this.getSupplierData(); @@ -135,15 +204,22 @@ export default { getAction(this.getdata).then(res => { //如果为200,则获取数据 if (res.code == 200) { - this.tableData = res.result; + this.tableData = res.result.records; //判断数据是否为空 if (this.tableData.length == 0) { this.dataShow = false; } else { - this.activeKey = [0]; + this.activeKey = ['']; + //将采购详情转化为对象 this.tableData.forEach(item => { item.procurementContent = JSON.parse(item.procurementContent); }); + //将supplierSelection转化为对象 + this.tableData.forEach(item => { + if (item.supplierSelection != null && item.supplierSelection != '') { + item.supplierSelection = JSON.parse(item.supplierSelection); + } + }); this.dataShow = true; } } else { @@ -155,6 +231,7 @@ export default { //深拷贝一份item let newItem = Object.assign({}, item); newItem.procurementContent = JSON.stringify(newItem.procurementContent); + newItem.supplierSelection = JSON.stringify(newItem.supplierSelection); postAction(this.receiveNOurl, newItem).then(res => { //如果为200,则获取数据 if (res.code == 200) { @@ -197,47 +274,166 @@ export default { generateOrder(item) { this.$message.success('生成订单成功'); }, - arrangeOpen(item) { - this.classifyData = []; - this.arrangeData = Object.assign({}, item); - this.arrange = true; - }, + //整理弹窗的确认提交 arrangeOk() { - this.$message.success('整理成功'); - this.arrange = false; + this.classifyData.forEach((item, index) => { + //遍历item中的goods + item.goods.forEach((item2, index2) => { + //如果有一项为空,则删除这一项 + let flag1 = item2.name == null || item2.name == '' || item2.name == undefined; + let flag2 = item2.number == null || item2.number == '' || item2.number == undefined; + let flag3 = item2.unit == null || item2.unit == '' || item2.unit == undefined; + if (flag1 && flag2 && flag3) { + item.goods.splice(index2, 1); + } + }); + }); + + let data = { + associationNumber: this.poenNmber, + supplierSelection: JSON.stringify(this.classifyData), + } + if (data.supplierSelection == '[]') { + data.supplierSelection = ''; + } + postAction(this.editUrl, data).then(res => { + if (res.code == 200) { + this.$message.success('整理成功'); + this.arrange = false; + this.getTableData(); + //将相关数据清空 + this.classifyData = []; + this.classSupplier = []; + this.classFood = []; + this.selectedSuppliers = ''; + this.selectedFoods = []; + this.poenNmber = ''; + } else { + this.$message.error(res.message); + } + }) }, + //取消整理 arrangeCancel() { - this.$message.success('整理取消'); this.arrange = false; + //将相关数据清空 + this.classifyData = []; + this.classSupplier = []; + this.classFood = []; + this.selectedSuppliers = ''; + this.selectedFoods = []; + this.poenNmber = ''; + }, + //打开整理弹窗,整理弹窗的数据初始化 + arrangeOpen(item) { + //获取供应商数据 + this.classifyData = []; + this.classSupplier = []; + this.supplierList.forEach(item => { + this.classSupplier.push({ + id: item.id, + name: item.name, + }); + }); + this.classSupplier = Object.assign([], this.classSupplier); + //获取物品数据 + this.classFood = Object.assign([], item.procurementContent); + this.poenNmber = item.requirementNumber; + //判断supplierSelection是否为空或者null + if (item.supplierSelection == null || item.supplierSelection == '') { + this.arrange = true; + } + else { + //将其转化为对象 + let newData = JSON.parse(JSON.stringify(item.supplierSelection)) + //将被选择的供应商从classSupplier中删除 + newData.forEach(item => { + this.classSupplier.forEach((item2, index2) => { + if (item2.id == item.supplierID) { + this.classSupplier.splice(index2, 1); + } + }); + }); + //将其添加到classifyData中 + this.classifyData = JSON.parse(JSON.stringify(newData)) + this.arrange = true; + } + }, + //以下为整理的相关操作 + delSupplier(item) { + //搜索ID将这一行从classifyData中删除 + this.classifyData.forEach((item2, index2) => { + if (item2.supplierID == item.supplierID) { + this.classifyData.splice(index2, 1); + } + }); + //将其添加到classSupplier中 + this.classSupplier.push({ + id: item.supplierID, + name: item.supplier, + }); }, addSupplier() { - //在classifyData添加一个空对象公司 + //如果选中的供应商为空,则不添加 + if (this.selectedSuppliers == '') { + this.$message.warning('请选择供应商'); + return; + } + let selectedID = this.selectedSuppliers; + let selectedSupplier = {}; + this.classSupplier.forEach((item, index) => { + if (item.id == selectedID) { + selectedSupplier = Object.assign({}, item); + this.classSupplier.splice(index, 1); + } + }); this.classifyData.push({ - supplier: "哈哈公司", + supplierID: selectedSupplier.id, + supplier: selectedSupplier.name, goods: [{ - name: "哈哈", - number: "1", - unit: "个", - }, { - name: "哈哈", - number: "1", - unit: "个", + name: '', + number: '', + unit: '', } ], }); - } + //将选中制空 + this.selectedSuppliers = ''; + }, + addRow(item, index) { + this.classifyData[index].goods.push({ + name: '', + number: '', + unit: '', + }); + }, + removeRow(index1, index2) { + this.classifyData[index1].goods.splice(index2, 1); + }, + importFoods(index) { + let selectedFoods = this.selectedFoods; + let selectedGoods = []; + this.classFood.forEach(item => { + selectedFoods.forEach(item2 => { + if (item.name == item2) { + selectedGoods.push(item); + } + }); + }); + //push而不是赋值,因为要保留原来的数据 + selectedGoods.forEach(item => { + this.classifyData[index].goods.push({ + name: item.name, + number: item.number, + unit: item.unit, + }); + }); + this.selectedFoods = []; + }, }, } - + diff --git a/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue b/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue index b80085d..3c471ce 100644 --- a/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue +++ b/src/views/purchase/receiving/PurchaseOrderConfirmationList.vue @@ -118,7 +118,7 @@ export default { if (this.dataList.length == 0) { this.dataShow = false; } else { - this.activeKey = [0]; + this.activeKey = ['']; //将其procurementContent转为json this.dataList.forEach(item => { item.procurementContent = JSON.parse(item.procurementContent); From 8d93800f5765633ec1c954c94562c036a2c3695b Mon Sep 17 00:00:00 2001 From: hh <2397241381@qq.com> Date: Thu, 17 Aug 2023 00:56:17 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/processing/orderProcessing.vue | 34 ++++++++++++- .../purchase/progress/procurementProgress.vue | 51 +++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 src/views/purchase/progress/procurementProgress.vue diff --git a/src/views/purchase/processing/orderProcessing.vue b/src/views/purchase/processing/orderProcessing.vue index 578cd79..ff07bf3 100644 --- a/src/views/purchase/processing/orderProcessing.vue +++ b/src/views/purchase/processing/orderProcessing.vue @@ -9,6 +9,9 @@
采购订单号:HL-{{ item.requirementNumber }}   部门:{{ item.sysOrgCode }}   采购方向:{{ item.procurementDirection }} + + 开始采购 生成订单 取消接单
@@ -152,7 +155,8 @@ export default { getPurchaseSupplier: "Try/purchaseSupplier/list", getdata: "/Try/purchaseOrderConfirmation/joinList", receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving", - editUrl: '/Try/purchaseOrderConfirmation/edit' + editUrl: '/Try/purchaseOrderConfirmation/edit', + finshUrl: '/Try/purchaseOrderConfirmation/finish' }, activeKey: [], username: Vue.ls.get(USER_INFO).username, @@ -183,12 +187,40 @@ export default { editUrl: function () { return `${window._CONFIG['domianURL']}/${this.url.editUrl}`; }, + finshUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.finshUrl}`; + }, }, created() { this.getSupplierData(); this.getTableData(); }, methods: { + finish(item) { + let newItem = Object.assign({}, item); + newItem.procurementContent = JSON.stringify(newItem.procurementContent); + if (newItem.supplierSelection != null && newItem.supplierSelection != '') { + newItem.supplierSelection = JSON.stringify(newItem.supplierSelection); + } else { + newItem.supplierSelection = ''; + } + // 新增procurementLog为 + newItem.procurementLog = { + '0': newItem.supplierSelection + } + newItem.procurementLog = JSON.stringify(newItem.procurementLog); + //将newItem将requirementNumber修改associationNumber + newItem.associationNumber = newItem.requirementNumber; + postAction(this.finshUrl, newItem).then(res => { + //如果为200,则获取数据 + if (res.code == 200) { + this.$message.success('完成订单成功'); + this.getTableData(); + } else { + this.$message.error(res.message); + } + }) + }, getSupplierData() { getAction(this.getPurchaseSupplier).then(res => { //如果为200,则获取数据 diff --git a/src/views/purchase/progress/procurementProgress.vue b/src/views/purchase/progress/procurementProgress.vue new file mode 100644 index 0000000..e71d4ce --- /dev/null +++ b/src/views/purchase/progress/procurementProgress.vue @@ -0,0 +1,51 @@ + + + \ No newline at end of file From 37c644df056a77c384d089204ad56ac63685c2ca Mon Sep 17 00:00:00 2001 From: huanghui <2397241381@qq.com> Date: Thu, 17 Aug 2023 17:41:57 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/processing/orderProcessing.vue | 11 +- .../purchase/progress/procurementProgress.vue | 155 ++++++++++++++++-- 2 files changed, 154 insertions(+), 12 deletions(-) diff --git a/src/views/purchase/processing/orderProcessing.vue b/src/views/purchase/processing/orderProcessing.vue index ff07bf3..b03ccbd 100644 --- a/src/views/purchase/processing/orderProcessing.vue +++ b/src/views/purchase/processing/orderProcessing.vue @@ -12,6 +12,7 @@ 开始采购 + 生成二维码 生成订单 取消接单
@@ -138,7 +139,9 @@ 添加供应商
- + + 生成失败 + @@ -151,6 +154,7 @@ export default { name: 'PurchaseOrderConfirmationList', data() { return { + QRvis: false, url: { getPurchaseSupplier: "Try/purchaseSupplier/list", getdata: "/Try/purchaseOrderConfirmation/joinList", @@ -172,6 +176,8 @@ export default { classFood: [], selectedFoods: [], poenNmber: '', + + QRcode: '', } }, computed: { @@ -462,6 +468,9 @@ export default { }); this.selectedFoods = []; }, + GenerateQRcode(item) { + this.QRvis = true; + } }, } diff --git a/src/views/purchase/progress/procurementProgress.vue b/src/views/purchase/progress/procurementProgress.vue index e71d4ce..10c1c3f 100644 --- a/src/views/purchase/progress/procurementProgress.vue +++ b/src/views/purchase/progress/procurementProgress.vue @@ -1,10 +1,70 @@ \ No newline at end of file