diff --git a/src/api/repair/stockOperate/stockOperate.js b/src/api/repair/stockOperate/stockOperate.js index c4a4c24..2ad2e32 100644 --- a/src/api/repair/stockOperate/stockOperate.js +++ b/src/api/repair/stockOperate/stockOperate.js @@ -28,3 +28,11 @@ export function voidSo(data){ data }) } + +// 查看单据 +export function getRepairSoById(id){ + return request({ + url: preUrl + "/get?id=" + id, + method: "get" + }) +} diff --git a/src/api/repair/stockOperate/stockOperateItem.js b/src/api/repair/stockOperate/stockOperateItem.js index 781b2ef..86553da 100644 --- a/src/api/repair/stockOperate/stockOperateItem.js +++ b/src/api/repair/stockOperate/stockOperateItem.js @@ -10,3 +10,11 @@ export function getSoiPage(params){ params }) } + +// 按IDS查 +export function getRepairSoiByIds(ids){ + return request({ + url: preUrl + "/get?ids=" + ids, + method: "get" + }) +} diff --git a/src/api/repair/stockTransfer/stockTransfer.js b/src/api/repair/stockTransfer/stockTransfer.js index 38660b4..a8494c6 100644 --- a/src/api/repair/stockTransfer/stockTransfer.js +++ b/src/api/repair/stockTransfer/stockTransfer.js @@ -19,3 +19,20 @@ export function getStPage(params){ params }) } + +// 作废 +export function voidSt(data){ + return request({ + url: preUrl + "/void", + method: "post", + data + }) +} + +// 查单据 +export function getSt(id){ + return request({ + url: preUrl + "/get?id=" + id, + method: "get" + }) +} diff --git a/src/api/repair/stockTransfer/stockTransferItem.js b/src/api/repair/stockTransfer/stockTransferItem.js index 02f16f2..f8b23d0 100644 --- a/src/api/repair/stockTransfer/stockTransferItem.js +++ b/src/api/repair/stockTransfer/stockTransferItem.js @@ -10,3 +10,11 @@ export function getStiPage(params){ params }) } + +// 查配件 +export function getStIsWares(ids){ + return request({ + url: preUrl + "/getWares?ids=" + ids, + method: "get" + }) +} diff --git a/src/api/repair/tickets/Tickets.js b/src/api/repair/tickets/Tickets.js index 4abf587..fc994d8 100644 --- a/src/api/repair/tickets/Tickets.js +++ b/src/api/repair/tickets/Tickets.js @@ -27,3 +27,12 @@ export function getTicketsById(id){ method: "get" }) } + +// 作废 +export function setTicketsVoid(data){ + return request({ + url: preUrl + "/void", + method: "post", + data + }) +} diff --git a/src/views/repair/Components/PartChoose.vue b/src/views/repair/Components/PartChoose.vue index bed5bf9..7a83278 100644 --- a/src/views/repair/Components/PartChoose.vue +++ b/src/views/repair/Components/PartChoose.vue @@ -101,6 +101,10 @@ export default { } }, handleSelectionChange(data) { + data = { + ...data, + wareId: data.warehouse + } this.$emit("input", data) this.$emit("selected", data) this.$refs.selectTable.blur() diff --git a/src/views/repair/Components/WarehouseChoose.vue b/src/views/repair/Components/WarehouseChoose.vue index 18e6d9c..70173bb 100644 --- a/src/views/repair/Components/WarehouseChoose.vue +++ b/src/views/repair/Components/WarehouseChoose.vue @@ -24,7 +24,7 @@ export default { name: "WarehouseChoose", props:{ value:{ - type: String, + type: [String, Object], default: "", required:false } @@ -43,7 +43,7 @@ export default { watch:{ value(val){ if (val){ - this.warehouseSelected = val + this.warehouseSelected = val.name }else { this.warehouseSelected = null } @@ -67,7 +67,7 @@ export default { return JSON.parse(JSON.stringify(result)) }, handleNodeClick(node){ - this.$emit("input", node.name) + this.$emit("input", node) this.$emit("change") this.warehouseSelected = node.name this.$refs.selectTree.blur() diff --git a/src/views/repair/stockOperate/Components/SoIndex.vue b/src/views/repair/stockOperate/Components/SoIndex.vue index e208c58..4bfd2e3 100644 --- a/src/views/repair/stockOperate/Components/SoIndex.vue +++ b/src/views/repair/stockOperate/Components/SoIndex.vue @@ -15,11 +15,11 @@ - - + + - - + + @@ -42,44 +42,44 @@ - - 导出 - - + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -69,11 +78,12 @@ import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue"; import StaffChoose from "@/views/repair/Components/StaffChoose.vue"; -import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate"; +import {getRepairSoPage, getRepairSoById} from "@/api/repair/stockOperate/stockOperate"; +import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue"; export default { name: "SoVoid", - components: {StaffChoose, SupplierChoose, CorpChoose}, + components: {SoShow, StaffChoose, SupplierChoose, CorpChoose}, props: { soByType: { type: Boolean, @@ -139,6 +149,9 @@ export default { // 搜索 handleQuery(){ this.queryParams.pageNo = 1 + if (this.queryParams.user){ + this.queryParams.userId = this.queryParams.user.id + } this.pageSo() }, // 重置 @@ -148,6 +161,11 @@ export default { this.queryParams.corp = null this.queryParams.user = null this.handleQuery() + }, + // 查看单据 + async handleShow(row){ + const res = await getRepairSoById(row.id) + await this.$refs.soShow.open(res.data) } } } diff --git a/src/views/repair/stockOperate/Components/SoiTable.vue b/src/views/repair/stockOperate/Components/SoiTable.vue index 58a0f43..f855202 100644 --- a/src/views/repair/stockOperate/Components/SoiTable.vue +++ b/src/views/repair/stockOperate/Components/SoiTable.vue @@ -12,17 +12,14 @@ end-placeholder="结束日期"> - - - - - + + - - + + 搜索 @@ -45,23 +42,35 @@ {{ scope.$index + 1 }} - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - @@ -69,7 +78,8 @@ diff --git a/src/views/repair/stockTransfer/Components/StInfo.vue b/src/views/repair/stockTransfer/Components/StInfo.vue index c6285d5..2917c54 100644 --- a/src/views/repair/stockTransfer/Components/StInfo.vue +++ b/src/views/repair/stockTransfer/Components/StInfo.vue @@ -133,7 +133,7 @@ export default { return x + y.totalPrice }, 0) const itemCount = data.reduce((x, y) => { - return x + y.goodsCount + return parseInt(x) + parseInt(y.goodsCount) }, 0) this.formData.totalPrice = tempPrice this.formData.thisDebt = tempPrice @@ -159,10 +159,14 @@ export default { // 提交 async handleSubmit() { try { - this.createInit() - await createSt(this.formData) - this.$modal.msgSuccess("新增成功") - this.init() + const flag = this.formData.oldCorp && this.formData.newCorp && this.formData.user && this.formData.goodsList.length + if (!flag) await this.$modal.msgError("请完善信息") + else { + this.createInit() + await createSt(this.formData) + this.$modal.msgSuccess("新增成功") + this.init() + } } catch { } }, @@ -171,11 +175,12 @@ export default { const data = this.formData this.formData = { ...data, - outCorpId: data.oldCorp.id, - inCorpId: data.newCorp.id, - userId: data.user.id, - userName: data.user.name, + outCorpId: data?.oldCorp?.id, + inCorpId: data?.newCorp?.id, + userId: data?.user?.id, + userName: data?.user?.name, } + this.formData.goodsList.forEach(item => item.id = null) }, // 组件初始化 init(){ diff --git a/src/views/repair/stockTransfer/Components/StShow.vue b/src/views/repair/stockTransfer/Components/StShow.vue new file mode 100644 index 0000000..7e60cf4 --- /dev/null +++ b/src/views/repair/stockTransfer/Components/StShow.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/repair/stockTransfer/Components/StTable.vue b/src/views/repair/stockTransfer/Components/StTable.vue index 680826e..5d32b79 100644 --- a/src/views/repair/stockTransfer/Components/StTable.vue +++ b/src/views/repair/stockTransfer/Components/StTable.vue @@ -14,8 +14,16 @@ - - + + + + + +
@@ -48,6 +56,8 @@ diff --git a/src/views/repair/stockTransfer/Components/StiTable.vue b/src/views/repair/stockTransfer/Components/StiTable.vue index 8bbade0..223bee5 100644 --- a/src/views/repair/stockTransfer/Components/StiTable.vue +++ b/src/views/repair/stockTransfer/Components/StiTable.vue @@ -3,6 +3,7 @@ - - + + - + @@ -38,23 +39,39 @@ {{ scope.$index + 1 }} - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -62,24 +79,25 @@ + + diff --git a/src/views/repair/tickets/Components/TicketSearch.vue b/src/views/repair/tickets/Components/TicketSearch.vue index c989c9a..1c1ea93 100644 --- a/src/views/repair/tickets/Components/TicketSearch.vue +++ b/src/views/repair/tickets/Components/TicketSearch.vue @@ -41,7 +41,7 @@ - +
diff --git a/src/views/repair/tickets/Components/TicketTable.vue b/src/views/repair/tickets/Components/TicketTable.vue index a19e4f3..fd0a71a 100644 --- a/src/views/repair/tickets/Components/TicketTable.vue +++ b/src/views/repair/tickets/Components/TicketTable.vue @@ -94,8 +94,13 @@ - - diff --git a/src/views/repair/tickets/Components/TicketsShow.vue b/src/views/repair/tickets/Components/TicketsShow.vue new file mode 100644 index 0000000..d7a009d --- /dev/null +++ b/src/views/repair/tickets/Components/TicketsShow.vue @@ -0,0 +1,192 @@ + + + + + diff --git a/src/views/repair/tickets/Components/UserInfo.vue b/src/views/repair/tickets/Components/UserInfo.vue index e92f7d3..20ec2da 100644 --- a/src/views/repair/tickets/Components/UserInfo.vue +++ b/src/views/repair/tickets/Components/UserInfo.vue @@ -156,7 +156,7 @@ - + @@ -172,7 +172,7 @@ 结算 - 挂单 + 挂单 @@ -269,7 +269,7 @@ export default { qualityDay: null, ticketType: null, itemList: [], - ticketStatus: "01" + ticketsStatus: "01" }, selectUser: {}, selectCar: {}, @@ -488,6 +488,11 @@ export default { this.partList = [itemList.find(item => item.itemType === '02')] this.otherList = [itemList.find(item => item.itemType === '03')] }catch{} + }, + // 挂单 + handlePendingSave(){ + this.formData.ticketsStatus = "06" + this.handleSave() } } }