From 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f Mon Sep 17 00:00:00 2001 From: charles <981744753@qq.com> Date: 星期二, 06 八月 2024 11:16:58 +0800 Subject: [PATCH] gitlab上面的wms转移到公司git --- src/views/overview/OverviewListView.vue | 337 ++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 256 insertions(+), 81 deletions(-) diff --git a/src/views/overview/OverviewListView.vue b/src/views/overview/OverviewListView.vue index 54d800b..a5c0e50 100644 --- a/src/views/overview/OverviewListView.vue +++ b/src/views/overview/OverviewListView.vue @@ -1,8 +1,8 @@ <template> <div class="rightContent"> - <!-- <div class="label-fixed-element"> + <div class="label-fixed-element"> <span>{{ params.name }}</span> - </div> --> + </div> <div class="top"> <SearchCommonView :add-title="'鏂板缓'" @@ -57,22 +57,35 @@ > 浜у搧淇℃伅 </div> + <!--<div + class="tab-pane" + @click="getTab(1)" + :style="{background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',color: TabsIndex == 1 ? '#fff' : '#666'}" + > + 鍗曟嵁杩芥函 + </div>--> </div> <div class="list-view"> <TableCommonView :table-list="productTableList" @selTableCol="selBottomTableCol"> - <!-- <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="160" fixed="right"> - <template slot-scope="scope"> - <el-button @click="viewClick(scope.row)" type="text" size="small">鏌ョ湅</el-button> - </template> - </el-table-column> - </template> --> + <template slot="tableButton"> + <el-table-column label="杈呭姪鏁伴噺" width="160"> + <template slot-scope="scope"> + <span>{{(scope.row.moreUnitList||[]).map(item=>item.amount).join('/')}}</span> + </template> + </el-table-column> + <el-table-column label="杈呭姪鍗曚綅" width="160"> + <template slot-scope="scope"> + <span>{{(scope.row.moreUnitList||[]).map(item=>item.unit).join('/')}}</span> + </template> + </el-table-column> + </template> </TableCommonView> </div> </div> </div> <!-- 鏂板缓/缂栬緫 --> <AddOverviewDialog + ref="addOverview" v-if="editConfig.visible" :workType="workType" :edit-common-config="editConfig" @@ -87,7 +100,7 @@ import { getOperation } from "@/api/overview/overview" // import DetailProduct from "@/views/productManage/product/DetailProduct" import AddOverviewDialog from "@/views/overview/AddOverviewDialog" - +import {getOperationInfoApi } from "@/api/product/product"; export default { name: "OverviewListView", props: {}, @@ -97,7 +110,7 @@ data() { return { tableList: {}, - showcol: ["浠撳簱浣嶇疆", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡", "鏉ユ簮鍗曟嵁", "鐘舵��"], + showcol: ["浠撳簱浣嶇疆", "鏉ユ簮","鏉ユ簮鍗曟嵁","璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡", "閿�鍞槑缁嗗崟", "鐘舵��" ,"涓荤","浼氳","淇濈鍛�",], searchOptions: [], commonDetail: { visible: false, @@ -109,7 +122,7 @@ title: "鏂板缓", infomation: {} }, - workType: this.$route.params.workType, + workType: parseInt(this.$route.query.workType), keyword: "", params: {}, displayEdit: false, @@ -120,26 +133,52 @@ numberLabel: "鍗曞彿", TabsIndex: "0", productTableList: {}, - showBottomCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О", "浜у搧瑙勬牸", "浜у搧鍨嬪彿", "璁¢噺鍗曚綅", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鏁伴噺"], + showBottomCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О", "浜у搧瑙勬牸", "浜у搧鍨嬪彿", "璁¢噺鍗曚綅", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "浠撳簱浣嶇疆","鏁伴噺","涓荤","浼氳","淇濈鍛�",'杈呭姪鏁伴噺','杈呭姪鍗曚綅','姣涢噸','鎬绘瘺閲�','鍑�閲�','鎬诲噣閲�'], tableBottomColumn: [], selectRow: {}, productColumn: [ - { label: "浜у搧缂栧彿", prop: "id", default: true }, + { label: "浜у搧缂栧彿", prop: "productId", default: true }, { label: "浜у搧鍚嶇О", prop: "productName" }, { label: "浜у搧瑙勬牸", prop: "specs" }, { label: "浜у搧鍨嬪彿", prop: "model" }, + { label: "鏁伴噺", prop: "amount" }, + { label: "璋冨嚭浣嶇疆", prop: "location" }, { label: "璁¢噺鍗曚綅", prop: "unit" }, - { label: "鏁伴噺", prop: "amount" } + /*{ label: "杈呭姪鏁伴噺", prop: "adjunctAmount" }, + { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" },*/ + { label: "姣涢噸", prop: "grossWeight" }, + { label: "鎬绘瘺閲�", prop: "totalGrossWeight" }, + { label: "鍑�閲�", prop: "netWeight" }, + { label: "鎬诲噣閲�", prop: "totalNetWeight" } ], + productColumn1:[{ label: "浜у搧缂栧彿", prop: "productId", default: true }, + { label: "浜у搧鍚嶇О", prop: "productName" }, + { label: "浜у搧瑙勬牸", prop: "specs" }, + { label: "浜у搧鍨嬪彿", prop: "model" }, + { label: "鏁伴噺", prop: "amount" }, + { label: "浠撳簱浣嶇疆", prop: "toLocation" }, + { label: "璁¢噺鍗曚綅", prop: "unit" }, + /*{ label: "杈呭姪鏁伴噺", prop: "adjunctAmount" }, + { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" },*/ + { label: "姣涢噸", prop: "grossWeight" }, + { label: "鎬绘瘺閲�", prop: "totalGrossWeight" }, + { label: "鍑�閲�", prop: "netWeight" }, + { label: "鎬诲噣閲�", prop: "totalNetWeight" }], allotProductColumn: [ - { label: "浜у搧缂栧彿", prop: "id", default: true }, + { label: "浜у搧缂栧彿", prop: "productId", default: true }, { label: "浜у搧鍚嶇О", prop: "productName" }, { label: "浜у搧瑙勬牸", prop: "specs" }, { label: "浜у搧鍨嬪彿", prop: "model" }, { label: "璁¢噺鍗曚綅", prop: "unit" }, { label: "璋冨嚭浣嶇疆", prop: "location" }, { label: "璋冨叆浣嶇疆", prop: "toLocation" }, - { label: "鏁伴噺", prop: "amount" } + { label: "鏁伴噺", prop: "amount" }, + /*{ label: "杈呭姪鏁伴噺", prop: "adjunctAmount" }, + { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" },*/ + { label: "姣涢噸", prop: "grossWeight" }, + { label: "鎬绘瘺閲�", prop: "totalGrossWeight" }, + { label: "鍑�閲�", prop: "netWeight" }, + { label: "鎬诲噣閲�", prop: "totalNetWeight" } ] } }, @@ -151,7 +190,8 @@ if (paramsData) { params = JSON.parse(sessionStorage.getItem("paramsData")) } else { - params = this.$route.params + params = this.$route.query + params.id=Number(params.id) sessionStorage.setItem("paramsData", JSON.stringify(params)) } this.params = params @@ -162,19 +202,22 @@ }, // 椤甸潰閿�姣佷箣鍓� beforeDestroy() { - sessionStorage.removeItem("paramsData") + sessionStorage.removeItem("paramsData"); }, methods: { setFormToLabel() { if (this.workType === 1) { + this.showcol=["浠撳簱浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�","鏃ユ湡", "鍒涘缓浜�" ,"鍒涘缓鏃堕棿","楠岃瘉浜�","楠岃瘉鏃堕棿", "閿�鍞槑缁嗗崟", "鐘舵��","涓荤","浼氳","淇濈鍛�",], this.formLabel = "渚涘簲鍟嗕綅缃�" - this.toLabel = "浠撳簱浣嶇疆" + this.toLabel = "璋冨叆浣嶇疆" this.numberLabel = "鍏ュ簱鍗曞彿" } else if (this.workType === 2) { - this.formLabel = "浠撳簱浣嶇疆" + this.showcol=["浠撳簱浣嶇疆", "璋冨嚭浣嶇疆", "鑱旂郴浜�","鏃ユ湡", "鍒涘缓浜�" ,"鍒涘缓鏃堕棿","楠岃瘉浜�","楠岃瘉鏃堕棿", "閿�鍞槑缁嗗崟", "鐘舵��","涓荤","浼氳","淇濈鍛�",], + this.formLabel = "璋冨嚭浣嶇疆" this.toLabel = "瀹㈡埛浣嶇疆" this.numberLabel = "鍑哄簱鍗曞彿" } else { + this.showcol=["浠撳簱浣嶇疆", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�","鏃ユ湡","鍒涘缓浜�" ,"鍒涘缓鏃堕棿","楠岃瘉浜�","楠岃瘉鏃堕棿", "閿�鍞槑缁嗗崟", "鐘舵��","涓荤","浼氳","淇濈鍛�",], this.formLabel = "璋冨嚭浣嶇疆" this.toLabel = "璋冨叆浣嶇疆" this.numberLabel = "璋冩嫧鍗曞彿" @@ -188,8 +231,8 @@ showcol: this.showcol, allcol: [], tableColumn: this.setTableColumn(this.showcol) - } - let allcol = [] + }; + let allcol = []; for (let i = 0; i < this.tableList.tableColumn.length; i++) { if (!this.tableList.tableColumn[i].default) { const label = this.tableList.tableColumn[i].label @@ -197,7 +240,7 @@ } } this.tableList.allcol = allcol - this.tableBottomColumn = this.workType == 3 ? this.allotProductColumn : this.productColumn + this.tableBottomColumn = this.workType == 3 ? this.allotProductColumn :this.workType===2 ?this.productColumn:this.productColumn1; this.setBottomList() }, setTableColumn(showcol) { @@ -207,6 +250,21 @@ prop: "number", isShowColumn: true, default: true + }, + { + label: "鏉ユ簮", + prop: "operationSource", + isShowColumn: showcol.includes("鏉ユ簮"), + default: false, + // status: true, + isCallMethod: true, + getCallMethod: this.getSourceStatus + }, + { + label: "鏉ユ簮鍗曟嵁", + prop: "sourceNumber", + isShowColumn: showcol.includes("鏉ユ簮鍗曟嵁"), + default: false }, { label: this.formLabel, @@ -239,12 +297,32 @@ default: false, date: true }, - // { - // label: "浜у搧鍙敤鎬�", - // prop: "status", - // isShowColumn: showcol.includes("浜у搧鍙敤鎬�"), - // default: false - // }, + { + label: "鍒涘缓浜�", + prop: "createBy", + isShowColumn: showcol.includes("鍒涘缓浜�"), + default: false, + }, + { + label: "鍒涘缓鏃堕棿", + prop: "createTime", + isShowColumn: showcol.includes("鍒涘缓鏃堕棿"), + default: false, + date: true + }, + { + label: "楠岃瘉浜�", + prop: "checkedBy", + isShowColumn: showcol.includes("楠岃瘉浜�"), + default: false, + }, + { + label: "楠岃瘉鏃堕棿", + prop: "auditDate", + isShowColumn: showcol.includes("楠岃瘉鏃堕棿"), + default: false, + date: true + }, // { // label: "鎴鏃ユ湡", // prop: "faultTime", @@ -258,17 +336,11 @@ // default: false // }, { - label: "鏉ユ簮鍗曟嵁", - prop: "sourceNumber", - isShowColumn: showcol.includes("鏉ユ簮鍗曟嵁"), + label: "閿�鍞槑缁嗗崟", + prop: "salesDetailsNumber", + isShowColumn: showcol.includes("閿�鍞槑缁嗗崟"), default: false }, - // { - // label: "娆犲崟", - // prop: "status", - // isShowColumn: showcol.includes("娆犲崟"), - // default: false - // }, { label: "鍏ュ簱绫诲瀷", prop: "operationTypeName", @@ -284,34 +356,52 @@ status: true, isCallMethod: true, getCallMethod: this.getStatus - } - ] - return tableColumn + }, + { + label: "涓荤", + prop: "manager", + isShowColumn: showcol.includes("涓荤"), + default: false + }, + { + label: "浼氳", + prop: "accountant", + isShowColumn: showcol.includes("浼氳"), + default: false + }, + { + label: "淇濈鍛�", + prop: "custodian", + isShowColumn: showcol.includes("淇濈鍛�"), + default: false + }, + ]; + return tableColumn; }, selTableCol(val) { - this.showcol = val - this.tableList.tableColumn = this.setTableColumn(val) + this.showcol = val; + this.tableList.tableColumn = this.setTableColumn(val); }, // 璇锋眰鏁版嵁 async getData() { await getOperation({ number: this.keyword, - operationTypeId: this.$route.params.id ? this.$route.params.id : this.params.id, + operationTypeId: this.$route.query.id ? Number(this.$route.query.id) : this.params.id, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize, - status: this.params.status + status: parseInt(this.params.status) }).then((res) => { - console.log(res.data) if (res.code === 200) { - const list = res.data.map((item) => { + const list = (res.data||[]).map((item) => { return { ...item, from: item.location.jointName, - to: item.location.jointName + to: item.toLocation.jointName, + operationDate:this.$moment(item.operationDate).format('yyyy-MM-DD') } - }) - this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.total + }); + this.tableList.tableInfomation = list || []; + this.pagerOptions.totalCount = res.total; if (res.total > 0) { this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {} this.tableRowClick(this.selectRow) @@ -322,20 +412,38 @@ }, // bottom浜у搧淇℃伅鏁版嵁澶勭悊 bottomProductData(arr) { - const list = arr.details.map((item) => { - return { - ...item, - productName: item.product.name, - unit: item.product.unit, - location: arr.location.name, - toLocation: arr.toLocation.name - } - }) + //console.log(arr); + const list = arr.details.map((item) => { + const params={ + ...item, + productName: item.product.name, + unit: item.product.unit, + model:item.product.model, + specs:item.product.specs, + /* location: arr.location.name, + toLocation: arr.toLocation.name,*/ + adjunctUnit:item.auxiliaryUnit, + adjunctAmount:item.auxiliaryAmount, + grossWeight:item.product.grossWeight==0?'':item.product.grossWeight, + totalGrossWeight:item.totalGrossWeight==0?'':item.totalGrossWeight, + netWeight:item.product.netWeight==0?'':item.product.netWeight, + totalNetWeight:item.totalNetWeight==0?'':item.totalNetWeight, + }; + if(this.workType===1){ + params.toLocation=item.toLocation.name; + }else if(this.workType===2){ + params.location=item.fromLocation.name; + }else if(this.workType===3){ + params.toLocation=item.toLocation.name; + params.location=item.fromLocation.name; + } + return params; + }); this.productTableList.tableInfomation = list }, // top 琛岀偣鍑� tableRowClick(row) { - this.selectRow = row + this.selectRow = row; this.bottomProductData(this.selectRow) }, // 鎼滅储 @@ -346,43 +454,110 @@ this.getData() }, // 鏌ョ湅 缂栬緫 - viewEditClick(row, val) { + async viewEditClick(row, val) { + const {data}=await getOperationInfoApi(row.id); + const row1=data; this.editConfig.visible = true this.editConfig.title = val this.editConfig.operationTypeId = this.params.id - this.editConfig.code = this.params.code - row.details.map((item) => { - item.fromLocationId = item.fromLocation.jointName - item.toLocationId = item.toLocation.jointName - }) - row.location = { + this.editConfig.code = this.params.code; + /*if(row1.warehouseId===0){ + if(row1.warehouse){ + row1.warehouseId=row1.warehouse.id; + } + }*/ + if(val==='鏌ョ湅'){ + row1.details.map((item,index) => { + item.fromLocationId = item.fromLocation.name; + item.toLocationId = item.toLocation.name; + item.relAmount=item.amount; + if(this.$route.query.workType!=1){ + item.amount=item.stockAmount; + } + }); + }else{ + row1.details.map((item) => { + item.fromLocationId = item.fromLocation.id; + item.toLocationId = item.toLocation.id; + item.relAmount=item.amount; + if(this.$route.query.workType!=1){ + item.fromLocationId = item.fromLocation.name; + item.toLocationId = item.toLocation.id; + item.amount=item.stockAmount; + } + }); + } + row1.location=row1.location.id; + row1.toLocation=row1.toLocation.id; + if(this.$route.query.workType==1&&row1.toLocation==0||row1.location==0){ + if(Array.isArray(row1.details)&&row1.details.length>0){ + row1.toLocation=row1.details[0].toLocation.id; + row1.location=row1.details[0].toLocation.id; + } + } + row1.managerObj={ + label:row1.manager, + value:row1.managerId + } + row1.accountantObj={ + label:row1.accountant, + value:row1.accountantId + } + row1.custodianObj={ + label:row1.custodian, + value:row1.custodianId + } + /*row.details.map((item) => { + item.fromLocationId = item.location.id + item.toLocationId = item.toLocation.id + });*/ + /*row.location = { + ...row.location, value: row.location.id || row.location.value, label: row.location.jointName || row.location.label } row.toLocation = { + ...row.toLocation, value: row.toLocation.id || row.toLocation.value, label: row.toLocation.jointName || row.toLocation.label } row.locationID = row.location.jointName row.locationId = row.location.value - + row.managerObj={ + label:row.manager, + value:row.managerId + } + row.accountantObj={ + label:row.accountant, + value:row.accountantId + } + row.custodianObj={ + label:row.custodian, + value:row.custodianId + }*/ // row.tolocationId=row.tolocation.value - this.editConfig.infomation = { ...row } - }, + this.editConfig.infomation = { ...row1 } + }, // 鏂板缓 addBtnClick() { this.editConfig.title = "鏂板缓" this.addName = this.params.name this.editConfig.operationTypeId = this.params.id - this.editConfig.code = this.params.code + this.editConfig.code = this.params.code; + this.editConfig.warehouseId=this.params.warehouseId; this.editConfig.infomation = { // location:{jointName:""} + operationDate:new Date() } this.editConfig.visible = true }, // 鐘舵�� getStatus(val) { return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : val === 4 ? "瀹屾垚" : val === 5 ? "鍙栨秷" : "" + }, + // 鏉ユ簮 + getSourceStatus(val){ + return val===0 ? '--':val === 1 ? "閲囪喘鍏ュ簱" : val === 2 ? "鐢熶骇鍏ュ簱" : val === 3 ? "濮斿鍏ュ簱" : val === 4 ? "鐢熶骇棰嗘枡" : val=== 5 ? "濮斿棰嗘枡": val === 6?"閿�鍞彂璐�": "--" }, // 鍒犻櫎鎼滅储鐘舵�� delSelectClick() { @@ -398,7 +573,7 @@ allcol: [], showcol: this.showBottomCol, tableColumn: this.setColumnVisible(this.showBottomCol, this.tableBottomColumn) - } + }; this.setTableList(this.productTableList) }, setTableList(tableList) { @@ -424,11 +599,11 @@ }, getTab(tab) { this.TabsIndex = tab - // if (this.TabsIndex == 0) { - // // 浜у搧淇℃伅鍒楄〃 - // this.setBottomList() - // this.getProductInventoryInfo(this.selectRow) - // } + if (this.TabsIndex === 0){ + // 浜у搧淇℃伅鍒楄〃 + //this.setBottomList() + //this.getProductInventoryInfo(this.selectRow) + } } } } @@ -441,7 +616,7 @@ overflow: hidden; .body { box-sizing: border-box; - padding: 10px 20px; + padding: 10px 0px; border-radius: 12px; height: calc(100% - 70px); .content-top { @@ -500,8 +675,8 @@ } } .label-fixed-element { - background: #e6ecf2; position: fixed; + background:#f8f8f9; font-size: 14px; width: calc(100% - 530px); height: 45px; -- Gitblit v1.8.0