diff --git a/src/api/outStorage/outStorage.js b/src/api/outStorage/outStorage.js index ca57f77..4093168 100644 --- a/src/api/outStorage/outStorage.js +++ b/src/api/outStorage/outStorage.js @@ -5,7 +5,7 @@ export default { // 查询分页列表 listPage: function(params) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", url: '/wms/apiadmin/warehouseoutbill/listPage', method: 'post', data: params, @@ -15,53 +15,80 @@ export default { }) }, + // 修改承运商 + updateCarrier: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/updateCarrier', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }); + }, + + // 修改运单号 + updateWaybillNumber: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/updateWaybillNumber', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }); + }, + + // 订单商品明细 orderGoodsDetail: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", url: '/wms/apiadmin/warehouseoutbilldetail/selectDetailsByBillSid', method: 'get', - data: data + params: data }); }, // 库位分配 orderRackDistributionDetail: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", - url: '/wms/apiadmin/warehouseinvoice/details', + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutlocation/details', method: 'get', - data: data + params: data }); }, // 收货地址 orderReceivingAddressDetail: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", - url: '/wms/apiadmin/warehouseinvoice/details', + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/getAddresseeBySid', method: 'get', - data: data + params: data }); }, // 发票明细 orderInvoiveDetail: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", url: '/wms/apiadmin/warehouseinvoice/details', method: 'get', - data: data + params: data }); }, // 保存发票明细 saveOrderInvoive: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", - url: '/apiadmin/warehouseinvoice/saveOrUpdate', + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseinvoice/saveOrUpdate', method: 'post', - data: params, + data: data, headers: { 'Content-Type': 'application/json' } @@ -71,24 +98,99 @@ export default { // 备注/留言 orderRemarksDetail: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", url: '/wms/apiadmin/warehouseinvoice/details', method: 'get', - data: data + params: data }); }, // 操作记录 orderOperationDetail: function(data) { return request({ - baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", - url: '/wms/apiadmin/warehouseinvoice/details', + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/operationrecord/details', + method: 'get', + params: data + }); + }, + + // 查询商品可用库位分配 + selAvailableBySkuSid: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseinventory/selAvailableBySkuSid', method: 'get', - data: data + params: data + }); + }, + + // 保存商品可用库位分配 + saveSelAvailable: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutlocation/saveOrUpdate', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } }); }, + // 打到零拣 --> 零拣打单 + toBePickOut: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/toBePickOut', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }); + }, + + // 撤回待分配 -->待分配 + toBeAllocated: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/toBeAllocated', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }); + }, + + // 确认打单-->待出库 + toBeOutbound: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/toBeOutbound', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }); + }, + + // 待出库-->确认出库 + confirmOutbound: function(data) { + return request({ + // baseURL: "http://127.0.0.1:4523/m1/4061550-0-default", + url: '/wms/apiadmin/warehouseoutbill/confirmOutbound', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }); + }, + // // 查询分页列表 // listPage: function(params) { // return request({ diff --git a/src/views/outStorage/alreadyOutStorage/index.vue b/src/views/outStorage/alreadyOutStorage/index.vue index e9bd4cc..d4a5f15 100644 --- a/src/views/outStorage/alreadyOutStorage/index.vue +++ b/src/views/outStorage/alreadyOutStorage/index.vue @@ -1,7 +1,7 @@ @@ -309,21 +438,23 @@ data() { return { activeName: "first", - activeIndex: "1", + activeIndex: "first", dialogVisible: false, + dialogVisible2: false, btndisabled: false, viewState: 1, // 1、列表 2、添加 3、修改 4、查看 isSearchShow: false, searchxianshitit: '显示查询条件', tableLoading: false, dataList: [], - btnList: [{ - type: 'primary', - size: 'small', - icon: 'plus', - btnKey: 'toAdd', - btnLabel: '打到零拣' - }, + btnList: [ + // { + // type: 'primary', + // size: 'small', + // icon: 'plus', + // btnKey: 'toAdd', + // btnLabel: '打到零拣' + // }, // { // type: 'success', // size: 'small', @@ -366,20 +497,28 @@ "menuUrl": "", "orgPath": "", "userSid": "", - "billState": "0", //0 待分配 1零拣打单 2待出库 3已出库 + "billState": "3", //0 待分配 1零拣打单 2待出库 3已出库 } }, sids: [], selectionList: [], + rowItemSid: "", billingTypeList: [], + carrierList: [], outboundTypeList: [{ sid: "1", name: "销售出库" }], from: { - detailsList: [], - operationList: [] + first: [], + two: [], + three: {}, + four: {}, + five: {}, + six: [] }, + goodsList: [], + goodsStockList: [] } }, @@ -402,12 +541,17 @@ } }) - }, - + typeValues({ + type: 'carrier' + }).then((res) => { + if (res.success) { + this.carrierList = res.data + } + }) - rowItemClick(row) { - console.log("row", row); - this.rowItemSid = row.sid + }, + handleClick(table) { + console.log("handleClick", table.name); if (this.rowItemSid == '') { this.$message({ @@ -417,20 +561,82 @@ }) return } + this.activeIndex = table.name + + // 订单明细 + if (table.name == 'first') { + this.from.first = [] + req.orderGoodsDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.first = resp.data + }).catch(() => {}) + } + // 库位分配 + if (table.name == 'two') { + this.from.two = [] + req.orderRackDistributionDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.two = resp.data + }).catch(() => {}) + } + // 收件地址 + if (table.name == 'three') { + this.from.three = {} + req.orderReceivingAddressDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.three = resp.data + }).catch(() => {}) + } + // 发票信息 + if (table.name == 'four') { + this.from.four = {} + req.orderInvoiveDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.four = resp.data + }).catch(() => {}) + } + // 备注/留言 + if (table.name == 'five') { + this.from.five = {} + req.orderRemarksDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.five = resp.data + }).catch(() => {}) + } + // 操作记录 + if (table.name == 'six') { + this.from.six = [] + req.orderOperationDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.six = resp.data + }).catch(() => {}) + } - req.init({ - sid: row.sid - }).then((resp) => { - this.from = resp.data - }).catch(() => {}) + }, + rowItemClick(row) { + console.log("row", row); - // this.handleSelect(this.activeIndex) - }, + if (row.sid == '') { + this.$message({ + type: 'warning', + showClose: true, + message: '暂无数据' + }) + return + } + this.rowItemSid = row.sid + var table = { + name: this.activeIndex + } + this.handleClick(table) - handleSelect(val) { - console.log("val", val); - this.activeIndex = val }, selectionLineChangeHandle(val) { @@ -486,6 +692,14 @@ this.queryParams.total = data.total this.dataList = data.records this.rowItemClick(this.dataList[0]) + this.from = { + first: [], + two: [], + three: {}, + four: {}, + five: {}, + six: [] + } } else { // 根据resp.code进行异常情况处理 this.dataList = [] @@ -527,24 +741,49 @@ "menuUrl": "", "orgPath": "", "userSid": "", - "billState": "0", //0 待分配 1零拣打单 2待出库 3已出库 + "billState": "3", //0 待分配 1零拣打单 2待出库 3已出库 } } this.loadList() }, toAdd() { - this.dialogParams.params.userSid = window.sessionStorage.getItem('userSid') - this.dialogParams.params.orgPath = window.sessionStorage.getItem('orgSidPath') - this.dialogParams.params.menuUrl = this.$route.path - req.getReservationBill(this.dialogParams).then((resp) => { - console.log("rgetReservationBill>>>>>", resp) - if (resp.success) { - this.billList = resp.data.records - this.dialogVisible = true - } - }).catch(() => {}) - + if (this.sids.length > 0) { + const tip = '请确认是否提交所选 ' + this.sids.length + ' 条记录?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + req.toBePickOut(this.sids).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ + type: 'success', + message: resp.msg, + showClose: true + }) + this.loadList() + } else { + // 根据resp.code进行异常情况处理 + } + }).catch(e => { + loading.close() + }) + }).catch(() => {}) + } else { + this.$message({ + type: 'warning', + showClose: true, + message: '请至少选择一条记录进行操作' + }) + } }, toPrintBill() { @@ -589,13 +828,128 @@ resetState() { this.viewState = 1 }, + selectInvoiceTypeChange(val) { + + const choose = this.billingTypeList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectInvoiceTypeChange', choose) + this.from.four.invoiceType = choose[0].dictKey + this.from.four.invoiceTypeValue = choose[0].dictValue + }, saveInvoice() { + req.saveOrderInvoive(this.from.four).then((resp) => { + }).catch(() => {}) }, chooseGoods() { + this.goodsList = [] + this.dialogVisible = true + + }, + handleClose() { + this.dialogVisible = false + }, + handleSelectionChange(val) { + console.log("val", val); + this.goodsList = val + }, + saveData() { + this.from.four.detailsList = this.goodsList + this.dialogVisible = false + }, + delGoods(index) { + this.from.four.detailsList.splice(index, 1) + }, + selectCarrier(row, val) { + console.log("selectCarrier", val); + + const choose = this.carrierList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectCarrier', choose) + row.carrier = choose[0].dictValue + row.carrierSid = choose[0].dictKey + + var query = { + sid: row.sid, + carrier: row.carrier, + carrierSid: row.carrierSid, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateCarrier(query).then((res) => {}) + }, + itemWaybillNumber(row) { + console.log("itemWaybillNumber", row); + + var query = { + sid: row.sid, + waybillNumber: row.waybillNumber, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateWaybillNumber(query).then((res) => {}) + + }, + showStock(row) { + console.log("showStock", row); + + req.selAvailableBySkuSid({ + skuSid: row.sid, + sourceBillSid: this.rowItemSid, + orgSid: window.sessionStorage.getItem('orgSid') + }).then((res) => { + console.log("selAvailableBySkuSid", res); + + if (res.success) { + this.goodsStockList = res.data + this.dialogVisible2 = true + + } else { + // 根据resp.code进行异常情况处理 + } + + }) + }, + handleClose2() { + this.dialogVisible2 = false + }, + saveData2() { + console.log("saveData2", this.goodsStockList); + + var goodsStocks = [] + + for (var i = 0; i < this.goodsStockList.length; i++) { + + var item = this.goodsStockList[i] + + if (Number(item.count) > 0) { + + goodsStocks.push({ + "sid": item.locationSid, + "sourceBillSid": this.rowItemSid, + "goodsSkuSid": item.goodsSkuSid, + "goodsSpuName": item.goodsSpuName, + "goodsSpuTitle": "", + "goodsSkuCode": '', + "count": item.count, + "rackSid": item.rackSid, + "rackCode": item.rackCode, + "inventorySid": item.sid, + "initialCount": item.initialCount + }) + } + } + + req.saveSelAvailable(goodsStocks).then((res) => { + console.log("saveSelAvailable", res); + + if (res.success) { + this.dialogVisible2 = false + } else { + // 根据resp.code进行异常情况处理 + } + + }) } + } } diff --git a/src/views/outStorage/toAllocated/index.vue b/src/views/outStorage/toAllocated/index.vue index 9a69dff..b9b99b8 100644 --- a/src/views/outStorage/toAllocated/index.vue +++ b/src/views/outStorage/toAllocated/index.vue @@ -13,7 +13,10 @@ - + + + + @@ -62,20 +65,32 @@ - - - + + + - - + + + + + + - - + + @@ -104,32 +119,40 @@ 订单明细(共: {{from.first .length}} 笔) - - + + - + - - - - - - - - - + + + + + + + + + + + - + - - + + + @@ -218,7 +241,7 @@
内容类型
- 发票商品 自定义明细 @@ -231,7 +254,7 @@ -
+
选择商品
@@ -245,8 +268,8 @@ - - + +
@@ -278,7 +301,7 @@
- + @@ -291,17 +314,17 @@ - + - + - - + +
@@ -310,6 +333,28 @@ + + + + + + + + + + + + + + +
+ 确 定 +
+ +
@@ -338,8 +383,9 @@ data() { return { activeName: "first", - activeIndex: "1", + activeIndex: "first", dialogVisible: false, + dialogVisible2: false, btndisabled: false, viewState: 1, // 1、列表 2、添加 3、修改 4、查看 isSearchShow: false, @@ -402,6 +448,7 @@ selectionList: [], rowItemSid: "", billingTypeList: [], + carrierList: [], outboundTypeList: [{ sid: "1", name: "销售出库" @@ -414,7 +461,8 @@ five: {}, six: [] }, - goodsList: [] + goodsList: [], + goodsStockList: [] } }, @@ -437,17 +485,36 @@ } }) + typeValues({ + type: 'carrier' + }).then((res) => { + if (res.success) { + this.carrierList = res.data + } + }) + }, handleClick(table) { console.log("handleClick", table.name); - + if (this.rowItemSid == '') { + this.$message({ + type: 'warning', + showClose: true, + message: '暂无数据' + }) + return + } + this.activeIndex = table.name // 订单明细 if (table.name == 'first') { this.from.first = [] req.orderGoodsDetail({ sid: this.rowItemSid }).then((resp) => { - this.from.first = resp.data + + if (resp.success && resp.data != null) { + this.from.first = resp.data + } }).catch(() => {}) } // 库位分配 @@ -456,7 +523,10 @@ req.orderRackDistributionDetail({ sid: this.rowItemSid }).then((resp) => { - this.from.two = resp.data + + if (resp.success && resp.data != null) { + this.from.two = resp.data + } }).catch(() => {}) } // 收件地址 @@ -465,7 +535,10 @@ req.orderReceivingAddressDetail({ sid: this.rowItemSid }).then((resp) => { - this.from.three = resp.data + if (resp.success && resp.data != null) { + this.from.three = resp.data + } + }).catch(() => {}) } // 发票信息 @@ -474,7 +547,10 @@ req.orderInvoiveDetail({ sid: this.rowItemSid }).then((resp) => { - this.from.four = resp.data + if (resp.success && resp.data != null) { + this.from.four = resp.data + } + }).catch(() => {}) } // 备注/留言 @@ -483,7 +559,10 @@ req.orderRemarksDetail({ sid: this.rowItemSid }).then((resp) => { - this.from.five = resp.data + if (resp.success && resp.data != null) { + this.from.five = resp.data + } + }).catch(() => {}) } // 操作记录 @@ -492,7 +571,10 @@ req.orderOperationDetail({ sid: this.rowItemSid }).then((resp) => { - this.from.six = resp.data + if (resp.success && resp.data != null) { + this.from.six = resp.data + } + }).catch(() => {}) } @@ -500,9 +582,8 @@ rowItemClick(row) { console.log("row", row); - this.rowItemSid = row.sid - if (this.rowItemSid == '') { + if (row.sid == '') { this.$message({ type: 'warning', showClose: true, @@ -510,6 +591,11 @@ }) return } + this.rowItemSid = row.sid + var table = { + name: this.activeIndex + } + this.handleClick(table) }, selectionLineChangeHandle(val) { @@ -573,10 +659,6 @@ five: {}, six: [] } - var table = { - name: 'first' - } - this.handleClick(table) } else { // 根据resp.code进行异常情况处理 this.dataList = [] @@ -625,17 +707,49 @@ }, toAdd() { - this.dialogParams.params.userSid = window.sessionStorage.getItem('userSid') - this.dialogParams.params.orgPath = window.sessionStorage.getItem('orgSidPath') - this.dialogParams.params.menuUrl = this.$route.path - req.getReservationBill(this.dialogParams).then((resp) => { - console.log("rgetReservationBill>>>>>", resp) - if (resp.success) { - this.billList = resp.data.records - this.dialogVisible = true - } - }).catch(() => {}) + if (this.sids.length > 0) { + const tip = '请确认是否提交所选 ' + this.sids.length + ' 条记录?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + + var params = { + billState: "1", // 下一步骤的单据状态0 待分配 1 零拣 2待出库 3已出库 + userSid: window.sessionStorage.getItem('userSid'), + sid: this.sids.join(",") + } + req.toBePickOut(params).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ + type: 'success', + message: resp.msg, + showClose: true + }) + this.loadList() + } else { + // 根据resp.code进行异常情况处理 + } + }).catch(e => { + loading.close() + }) + }).catch(() => {}) + } else { + this.$message({ + type: 'warning', + showClose: true, + message: '请至少选择一条记录进行操作' + }) + } }, toPrintBill() { @@ -689,7 +803,11 @@ }, saveInvoice() { req.saveOrderInvoive(this.from.four).then((resp) => { - + this.$message({ + type: 'success', + message: "保存成功", + showClose: true + }) }).catch(() => {}) }, chooseGoods() { @@ -710,6 +828,95 @@ }, delGoods(index) { this.from.four.detailsList.splice(index, 1) + }, + selectCarrier(row, val) { + console.log("selectCarrier", val); + + const choose = this.carrierList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectCarrier', choose) + row.carrier = choose[0].dictValue + row.carrierSid = choose[0].dictKey + + var query = { + sid: row.sid, + carrier: row.carrier, + carrierSid: row.carrierSid, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateCarrier(query).then((res) => {}) + }, + itemWaybillNumber(row) { + console.log("itemWaybillNumber", row); + + var query = { + sid: row.sid, + waybillNumber: row.waybillNumber, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateWaybillNumber(query).then((res) => {}) + + }, + showStock(row) { + console.log("showStock", row); + + req.selAvailableBySkuSid({ + skuSid: row.goodsSkuSid, + sourceBillSid: this.rowItemSid, + orgSid: window.sessionStorage.getItem('orgSid') + }).then((res) => { + console.log("selAvailableBySkuSid", res); + + if (res.success) { + this.goodsStockList = res.data + this.dialogVisible2 = true + + } else { + // 根据resp.code进行异常情况处理 + } + + }) + }, + handleClose2() { + this.dialogVisible2 = false + }, + saveData2() { + console.log("saveData2", this.goodsStockList); + + var goodsStocks = [] + + for (var i = 0; i < this.goodsStockList.length; i++) { + + var item = this.goodsStockList[i] + + if (Number(item.count) > 0) { + + goodsStocks.push({ + "sid": item.locationSid, + "sourceBillSid": this.rowItemSid, + "goodsSkuSid": item.goodsSkuSid, + "goodsSpuName": item.goodsSpuName, + "goodsSpuTitle": "", + "goodsSkuCode": '', + "count": item.count, + "rackSid": item.rackSid, + "rackCode": item.rackCode, + "inventorySid": item.sid, + "initialCount": item.initialCount + }) + } + } + + req.saveSelAvailable(goodsStocks).then((res) => { + console.log("saveSelAvailable", res); + + if (res.success) { + this.dialogVisible2 = false + } else { + // 根据resp.code进行异常情况处理 + } + + }) + } } diff --git a/src/views/outStorage/toOutStorage/index.vue b/src/views/outStorage/toOutStorage/index.vue index e9bd4cc..eb9ad54 100644 --- a/src/views/outStorage/toOutStorage/index.vue +++ b/src/views/outStorage/toOutStorage/index.vue @@ -1,7 +1,7 @@ @@ -309,8 +384,9 @@ data() { return { activeName: "first", - activeIndex: "1", + activeIndex: "first", dialogVisible: false, + dialogVisible2: false, btndisabled: false, viewState: 1, // 1、列表 2、添加 3、修改 4、查看 isSearchShow: false, @@ -322,7 +398,7 @@ size: 'small', icon: 'plus', btnKey: 'toAdd', - btnLabel: '打到零拣' + btnLabel: '确认出库' }, // { // type: 'success', @@ -366,20 +442,28 @@ "menuUrl": "", "orgPath": "", "userSid": "", - "billState": "0", //0 待分配 1零拣打单 2待出库 3已出库 + "billState": "2", //0 待分配 1零拣打单 2待出库 3已出库 } }, sids: [], selectionList: [], + rowItemSid: "", + carrierList: [], billingTypeList: [], outboundTypeList: [{ sid: "1", name: "销售出库" }], from: { - detailsList: [], - operationList: [] + first: [], + two: [], + three: {}, + four: {}, + five: {}, + six: [] }, + goodsList: [], + goodsStockList: [] } }, @@ -402,12 +486,17 @@ } }) - }, - + typeValues({ + type: 'carrier' + }).then((res) => { + if (res.success) { + this.carrierList = res.data + } + }) - rowItemClick(row) { - console.log("row", row); - this.rowItemSid = row.sid + }, + handleClick(table) { + console.log("handleClick", table.name); if (this.rowItemSid == '') { this.$message({ @@ -418,19 +507,80 @@ return } - req.init({ - sid: row.sid - }).then((resp) => { - this.from = resp.data - }).catch(() => {}) - + this.activeIndex = table.name + // 订单明细 + if (table.name == 'first') { + this.from.first = [] + req.orderGoodsDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.first = resp.data + }).catch(() => {}) + } + // 库位分配 + if (table.name == 'two') { + this.from.two = [] + req.orderRackDistributionDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.two = resp.data + }).catch(() => {}) + } + // 收件地址 + if (table.name == 'three') { + this.from.three = {} + req.orderReceivingAddressDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.three = resp.data + }).catch(() => {}) + } + // 发票信息 + if (table.name == 'four') { + this.from.four = {} + req.orderInvoiveDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.four = resp.data + }).catch(() => {}) + } + // 备注/留言 + if (table.name == 'five') { + this.from.five = {} + req.orderRemarksDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.five = resp.data + }).catch(() => {}) + } + // 操作记录 + if (table.name == 'six') { + this.from.six = [] + req.orderOperationDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.six = resp.data + }).catch(() => {}) + } - // this.handleSelect(this.activeIndex) }, - handleSelect(val) { - console.log("val", val); - this.activeIndex = val + rowItemClick(row) { + console.log("row", row); + + if (row.sid == '') { + this.$message({ + type: 'warning', + showClose: true, + message: '暂无数据' + }) + return + } + this.rowItemSid = row.sid + var table = { + name: this.activeIndex + } + this.handleClick(table) }, selectionLineChangeHandle(val) { @@ -486,6 +636,14 @@ this.queryParams.total = data.total this.dataList = data.records this.rowItemClick(this.dataList[0]) + this.from = { + first: [], + two: [], + three: {}, + four: {}, + five: {}, + six: [] + } } else { // 根据resp.code进行异常情况处理 this.dataList = [] @@ -527,24 +685,56 @@ "menuUrl": "", "orgPath": "", "userSid": "", - "billState": "0", //0 待分配 1零拣打单 2待出库 3已出库 + "billState": "2", //0 待分配 1零拣打单 2待出库 3已出库 } } this.loadList() }, toAdd() { - this.dialogParams.params.userSid = window.sessionStorage.getItem('userSid') - this.dialogParams.params.orgPath = window.sessionStorage.getItem('orgSidPath') - this.dialogParams.params.menuUrl = this.$route.path - req.getReservationBill(this.dialogParams).then((resp) => { - console.log("rgetReservationBill>>>>>", resp) - if (resp.success) { - this.billList = resp.data.records - this.dialogVisible = true - } - }).catch(() => {}) - + if (this.sids.length > 0) { + const tip = '请确认是否提交所选 ' + this.sids.length + ' 条记录?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + + var params = { + billState: "3", // 下一步骤的单据状态0 待分配 1 零拣 2待出库 3已出库 + userSid: window.sessionStorage.getItem('userSid'), + sid: this.sids.join(",") + } + + req.confirmOutbound(params).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ + type: 'success', + message: resp.msg, + showClose: true + }) + this.loadList() + } else { + // 根据resp.code进行异常情况处理 + } + }).catch(e => { + loading.close() + }) + }).catch(() => {}) + } else { + this.$message({ + type: 'warning', + showClose: true, + message: '请至少选择一条记录进行操作' + }) + } }, toPrintBill() { @@ -589,10 +779,123 @@ resetState() { this.viewState = 1 }, + selectInvoiceTypeChange(val) { + + const choose = this.billingTypeList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectInvoiceTypeChange', choose) + this.from.four.invoiceType = choose[0].dictKey + this.from.four.invoiceTypeValue = choose[0].dictValue + }, saveInvoice() { + req.saveOrderInvoive(this.from.four).then((resp) => { + }).catch(() => {}) }, chooseGoods() { + this.goodsList = [] + this.dialogVisible = true + + }, + handleClose() { + this.dialogVisible = false + }, + handleSelectionChange(val) { + console.log("val", val); + this.goodsList = val + }, + saveData() { + this.from.four.detailsList = this.goodsList + this.dialogVisible = false + }, + delGoods(index) { + this.from.four.detailsList.splice(index, 1) + }, + selectCarrier(row, val) { + console.log("selectCarrier", val); + + const choose = this.carrierList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectCarrier', choose) + row.carrier = choose[0].dictValue + row.carrierSid = choose[0].dictKey + + var query = { + sid: row.sid, + carrier: row.carrier, + carrierSid: row.carrierSid, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateCarrier(query).then((res) => {}) + }, + itemWaybillNumber(row) { + console.log("itemWaybillNumber", row); + + var query = { + sid: row.sid, + waybillNumber: row.waybillNumber, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateWaybillNumber(query).then((res) => {}) + + }, + showStock(row) { + console.log("showStock", row); + + req.selAvailableBySkuSid({ + skuSid: row.goodsSkuSid, + sourceBillSid: this.rowItemSid, + orgSid: window.sessionStorage.getItem('orgSid') + }).then((res) => { + console.log("selAvailableBySkuSid", res); + + if (res.success) { + this.goodsStockList = res.data + this.dialogVisible2 = true + + } else { + // 根据resp.code进行异常情况处理 + } + + }) + }, + handleClose2() { + this.dialogVisible2 = false + }, + saveData2() { + console.log("saveData2", this.goodsStockList); + var goodsStocks = [] + + for (var i = 0; i < this.goodsStockList.length; i++) { + + var item = this.goodsStockList[i] + + if (Number(item.count) > 0) { + + goodsStocks.push({ + "sid": item.locationSid, + "sourceBillSid": this.rowItemSid, + "goodsSkuSid": item.goodsSkuSid, + "goodsSpuName": item.goodsSpuName, + "goodsSpuTitle": "", + "goodsSkuCode": '', + "count": item.count, + "rackSid": item.rackSid, + "rackCode": item.rackCode, + "inventorySid": item.sid, + "initialCount": item.initialCount + }) + } + } + + req.saveSelAvailable(goodsStocks).then((res) => { + console.log("saveSelAvailable", res); + + if (res.success) { + this.dialogVisible2 = false + } else { + // 根据resp.code进行异常情况处理 + } + + }) } diff --git a/src/views/outStorage/zeroPicking/index.vue b/src/views/outStorage/zeroPicking/index.vue index e9bd4cc..d8f7565 100644 --- a/src/views/outStorage/zeroPicking/index.vue +++ b/src/views/outStorage/zeroPicking/index.vue @@ -1,7 +1,7 @@ @@ -309,8 +384,9 @@ data() { return { activeName: "first", - activeIndex: "1", + activeIndex: "first", dialogVisible: false, + dialogVisible2: false, btndisabled: false, viewState: 1, // 1、列表 2、添加 3、修改 4、查看 isSearchShow: false, @@ -322,7 +398,14 @@ size: 'small', icon: 'plus', btnKey: 'toAdd', - btnLabel: '打到零拣' + btnLabel: '确认打单' + }, + { + type: 'danger', + size: 'small', + icon: 'del', + btnKey: 'doDel', + btnLabel: '撤回分配' }, // { // type: 'success', @@ -366,20 +449,28 @@ "menuUrl": "", "orgPath": "", "userSid": "", - "billState": "0", //0 待分配 1零拣打单 2待出库 3已出库 + "billState": "1", //0 待分配 1零拣打单 2待出库 3已出库 } }, sids: [], selectionList: [], + rowItemSid: "", billingTypeList: [], + carrierList: [], outboundTypeList: [{ sid: "1", name: "销售出库" }], from: { - detailsList: [], - operationList: [] + first: [], + two: [], + three: {}, + four: {}, + five: {}, + six: [] }, + goodsList: [], + goodsStockList: [] } }, @@ -402,12 +493,18 @@ } }) - }, + typeValues({ + type: 'carrier' + }).then((res) => { + if (res.success) { + this.carrierList = res.data + } + }) - rowItemClick(row) { - console.log("row", row); - this.rowItemSid = row.sid + }, + handleClick(table) { + console.log("handleClick", table.name); if (this.rowItemSid == '') { this.$message({ @@ -417,20 +514,80 @@ }) return } + this.activeIndex = table.name + // 订单明细 + if (table.name == 'first') { + this.from.first = [] + req.orderGoodsDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.first = resp.data + }).catch(() => {}) + } + // 库位分配 + if (table.name == 'two') { + this.from.two = [] + req.orderRackDistributionDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.two = resp.data + }).catch(() => {}) + } + // 收件地址 + if (table.name == 'three') { + this.from.three = {} + req.orderReceivingAddressDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.three = resp.data + }).catch(() => {}) + } + // 发票信息 + if (table.name == 'four') { + this.from.four = {} + req.orderInvoiveDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.four = resp.data + }).catch(() => {}) + } + // 备注/留言 + if (table.name == 'five') { + this.from.five = {} + req.orderRemarksDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.five = resp.data + }).catch(() => {}) + } + // 操作记录 + if (table.name == 'six') { + this.from.six = [] + req.orderOperationDetail({ + sid: this.rowItemSid + }).then((resp) => { + this.from.six = resp.data + }).catch(() => {}) + } - req.init({ - sid: row.sid - }).then((resp) => { - this.from = resp.data - }).catch(() => {}) - - - // this.handleSelect(this.activeIndex) }, - handleSelect(val) { - console.log("val", val); - this.activeIndex = val + rowItemClick(row) { + console.log("row", row); + + if (row.sid == '') { + this.$message({ + type: 'warning', + showClose: true, + message: '暂无数据' + }) + return + } + this.rowItemSid = row.sid + var table = { + name: this.activeIndex + } + this.handleClick(table) }, selectionLineChangeHandle(val) { @@ -458,6 +615,9 @@ case 'toAdd': this.toAdd() break + case 'doDel': + this.doDel() + break case 'toPrintBill': this.toPrintBill() break @@ -486,6 +646,14 @@ this.queryParams.total = data.total this.dataList = data.records this.rowItemClick(this.dataList[0]) + this.from = { + first: [], + two: [], + three: {}, + four: {}, + five: {}, + six: [] + } } else { // 根据resp.code进行异常情况处理 this.dataList = [] @@ -527,25 +695,101 @@ "menuUrl": "", "orgPath": "", "userSid": "", - "billState": "0", //0 待分配 1零拣打单 2待出库 3已出库 + "billState": "1", //0 待分配 1零拣打单 2待出库 3已出库 } } this.loadList() }, toAdd() { - this.dialogParams.params.userSid = window.sessionStorage.getItem('userSid') - this.dialogParams.params.orgPath = window.sessionStorage.getItem('orgSidPath') - this.dialogParams.params.menuUrl = this.$route.path - req.getReservationBill(this.dialogParams).then((resp) => { - console.log("rgetReservationBill>>>>>", resp) - if (resp.success) { - this.billList = resp.data.records - this.dialogVisible = true - } - }).catch(() => {}) + if (this.sids.length > 0) { + const tip = '请确认是否提交所选 ' + this.sids.length + ' 条记录?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + var params = { + billState: "2", // 下一步骤的单据状态0 待分配 1 零拣 2待出库 3已出库 + userSid: window.sessionStorage.getItem('userSid'), + sid: this.sids.join(",") + } + + req.toBeOutbound(params).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ + type: 'success', + message: resp.msg, + showClose: true + }) + this.loadList() + } else { + // 根据resp.code进行异常情况处理 + } + }).catch(e => { + loading.close() + }) + }).catch(() => {}) + } else { + this.$message({ + type: 'warning', + showClose: true, + message: '请至少选择一条记录进行操作' + }) + } + }, + doDel() { + + if (this.sids.length > 0) { + const tip = '请确认是否撤回所选 ' + this.sids.length + ' 条记录?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + var params = { + billState: "0", // 下一步骤的单据状态0 待分配 1 零拣 2待出库 3已出库 + userSid: window.sessionStorage.getItem('userSid'), + sid: this.sids.join(",") + } + req.toBeAllocated(params).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ + type: 'success', + message: resp.msg, + showClose: true + }) + this.loadList() + } else { + // 根据resp.code进行异常情况处理 + } + }).catch(e => { + loading.close() + }) + }).catch(() => {}) + } else { + this.$message({ + type: 'warning', + showClose: true, + message: '请至少选择一条记录进行操作' + }) + } }, toPrintBill() { if (this.selectionList.length != 1) { @@ -589,10 +833,125 @@ resetState() { this.viewState = 1 }, + selectInvoiceTypeChange(val) { + + const choose = this.billingTypeList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectInvoiceTypeChange', choose) + this.from.four.invoiceType = choose[0].dictKey + this.from.four.invoiceTypeValue = choose[0].dictValue + }, saveInvoice() { + req.saveOrderInvoive(this.from.four).then((resp) => { + }).catch(() => {}) }, chooseGoods() { + this.goodsList = [] + this.dialogVisible = true + + }, + handleClose() { + this.dialogVisible = false + }, + handleSelectionChange(val) { + console.log("val", val); + this.goodsList = val + }, + saveData() { + this.from.four.detailsList = this.goodsList + this.dialogVisible = false + }, + delGoods(index) { + this.from.four.detailsList.splice(index, 1) + }, + selectCarrier(row, val) { + console.log("selectCarrier", val); + + const choose = this.carrierList.filter((item) => item.dictKey == val) + console.log('>>>>>>>>>selectCarrier', choose) + row.carrier = choose[0].dictValue + row.carrierSid = choose[0].dictKey + + var query = { + sid: row.sid, + carrier: row.carrier, + carrierSid: row.carrierSid, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateCarrier(query).then((res) => {}) + }, + itemWaybillNumber(row) { + console.log("itemWaybillNumber", row); + + var query = { + sid: row.goodsSkuSid, + waybillNumber: row.waybillNumber, + userSid: window.sessionStorage.getItem('userSid') + } + req.updateWaybillNumber(query).then((res) => {}) + + }, + showStock(row) { + console.log("showStock", row); + + req.selAvailableBySkuSid({ + skuSid: row.sid, + sourceBillSid: this.rowItemSid, + orgSid: window.sessionStorage.getItem('orgSid') + }).then((res) => { + console.log("selAvailableBySkuSid", res); + + if (res.success) { + this.goodsStockList = res.data + this.dialogVisible2 = true + + } else { + // 根据resp.code进行异常情况处理 + } + + }) + }, + handleClose2() { + this.dialogVisible2 = false + }, + saveData2() { + console.log("saveData2", this.goodsStockList); + + var goodsStocks = [] + + for (var i = 0; i < this.goodsStockList.length; i++) { + + var item = this.goodsStockList[i] + + if (Number(item.count) > 0) { + + goodsStocks.push({ + "sid": item.locationSid, + "sourceBillSid": this.rowItemSid, + "goodsSkuSid": item.goodsSkuSid, + "goodsSpuName": item.goodsSpuName, + "goodsSpuTitle": "", + "goodsSkuCode": '', + "count": item.count, + "rackSid": item.rackSid, + "rackCode": item.rackCode, + "inventorySid": item.sid, + "initialCount": item.initialCount + }) + } + } + + req.saveSelAvailable(goodsStocks).then((res) => { + console.log("saveSelAvailable", res); + + if (res.success) { + this.dialogVisible2 = false + } else { + // 根据resp.code进行异常情况处理 + } + + }) + } diff --git a/src/views/system/organizationManage/organizationManage.vue b/src/views/system/organizationManage/organizationManage.vue index bc28d02..1beee49 100644 --- a/src/views/system/organizationManage/organizationManage.vue +++ b/src/views/system/organizationManage/organizationManage.vue @@ -216,7 +216,7 @@ 主管人员 - + @@ -443,8 +443,16 @@ getOrgTree() { // 获取树形列表 orgList(window.sessionStorage.getItem('orgSid')).then(res => { this.treedata = res.data + }) }, + zgNamesChange(val) { + console.log('zgNamesChange:', val) + const choose = this.staffdata.filter((item) => item.sid == val) + console.log('>>>>>>>>>zgNamesChange', choose) + this.form.zgNames = choose[0].name + this.form.zgStaffSid = choose[0].sid + }, save() { if (this.fgStaffSid.length > 0) { this.form.fgStaffSid = this.fgStaffSid.join() @@ -514,7 +522,7 @@ if (this.form.fgStaffSid) { this.fgStaffSid = response.data.fgStaffSid.split(',') } - this.form.zgStaffName = response.data.zgNames + this.form.zgNames = response.data.zgNames this.form.zgStaffSid = response.data.zgStaffSid console.log('编辑回显的数据', this.form) }