From fbdb1d15b6cf692d27598806eee6be6f16e1f36d Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 22 九月 2023 17:54:55 +0800 Subject: [PATCH] 产品出入库明细接口联调、调拨列表接口联调、出入库搜索功能增加 --- src/views/operate/allot/index.vue | 178 +++++++++++++++-------------- src/views/overview/AddOverviewDialog.vue | 11 + src/views/overview/OverviewListView.vue | 18 +- src/views/productManage/product/index.vue | 25 +++ src/views/reportForm/inboundOutboundDetail/index.vue | 69 ++++++---- src/api/product/product.js | 8 + src/router/index.js | 7 - src/api/overview/overview.js | 17 ++ src/views/productManage/product/AddProductDialog.vue | 8 + 9 files changed, 200 insertions(+), 141 deletions(-) diff --git a/src/api/overview/overview.js b/src/api/overview/overview.js index 5809158..51b6e6a 100644 --- a/src/api/overview/overview.js +++ b/src/api/overview/overview.js @@ -33,9 +33,11 @@ } // 鏌ヨ鍏ュ簱/鍑哄簱鍒楄〃 -export const getOperation = async (data) => { - return await axios.get(`/api-wms/v1/operation/operation`, { - params: data +export function getOperation(data) { + return request({ + url: "/api-wms/v1/operation/list", + method: "post", + data }) } // 娣诲姞鍏ュ簱/鍑哄簱 @@ -79,3 +81,12 @@ data }) } + +// 鑾峰彇鍏ㄩ儴璋冩嫧鍒楄〃 +export function getAllList(data) { + return request({ + url: "/api-wms/v1/operation/listAll", + method: "post", + data + }) +} diff --git a/src/api/product/product.js b/src/api/product/product.js index 9d105aa..7af33ac 100644 --- a/src/api/product/product.js +++ b/src/api/product/product.js @@ -39,3 +39,11 @@ params: data }) } +// 浜у搧鍘嗗彶鍑哄叆搴撲俊鎭� +export function getProductOperatonList(data) { + return request({ + url: "/api-wms/v1/product/listOperaton", + method: "post", + data + }) +} diff --git a/src/router/index.js b/src/router/index.js index e37ce73..acd90c0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -97,12 +97,7 @@ const router = createRouter() router.afterEach((to, from, next) => { - if ( - (to.path === "/overview/overviewList" || - to.path === "/reportForm/inOutboundDetail" || - to.path === "/productManage/productList") && - to.params.name - ) { + if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) { console.log(from, next) to.meta.title = to.params.name document.title = to.meta.title diff --git a/src/views/operate/allot/index.vue b/src/views/operate/allot/index.vue index 042e54b..53dc714 100644 --- a/src/views/operate/allot/index.vue +++ b/src/views/operate/allot/index.vue @@ -3,7 +3,7 @@ <div class="top"> <SearchCommonView :add-title="'鏂板缓'" - :placeholder="'璇疯緭鍏ュ崟鍙�'" + :placeholder="'璇疯緭鍏ュ崟鍙�/鏉ユ簮鍗曟嵁'" :amount-view="false" @addCommonClick="addBtnClick" @searchClick="getList" @@ -29,7 +29,7 @@ <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getProductList } from "@/api/product/product" +import { getAllList } from "@/api/overview/overview" // import DetailProduct from "@/views/productManage/product/DetailProduct" import AddOverviewDialog from "@/views/overview/AddOverviewDialog" @@ -53,7 +53,8 @@ visible: false, title: "鏂板缓", infomation: {} - } + }, + keyword: "" } }, created() { @@ -82,121 +83,123 @@ let tableColumn = [ { label: "鍗曞彿", - prop: "id", + prop: "number", isShowColumn: true, default: true }, { label: "浠�", - prop: "deviceName", + prop: "from", isShowColumn: showcol.includes("浠�"), default: false }, { label: "鑷�", - prop: "id", + prop: "to", isShowColumn: showcol.includes("鑷�"), default: false }, { label: "鑱旂郴浜�", - prop: "deviceId", + prop: "companyName", isShowColumn: showcol.includes("鑱旂郴浜�"), default: false }, { label: "璐熻矗浜�", - prop: "shopName", + prop: "contacterName", isShowColumn: showcol.includes("璐熻矗浜�"), default: false }, { label: "鏃ユ湡", - prop: "preTime", + prop: "operationDate", isShowColumn: showcol.includes("鏃ユ湡"), default: false, date: true }, - { - label: "浜у搧鍙敤鎬�", - prop: "status", - isShowColumn: showcol.includes("浜у搧鍙敤鎬�"), - width: 100, - default: false - }, - { - label: "鎴鏃ユ湡", - prop: "faultTime", - isShowColumn: showcol.includes("鎴鏃ユ湡"), - default: false - }, - { - label: "瀹為檯鏃ユ湡", - prop: "shopName", - isShowColumn: showcol.includes("瀹為檯鏃ユ湡"), - default: false - }, + // { + // label: "浜у搧鍙敤鎬�", + // prop: "status", + // isShowColumn: showcol.includes("浜у搧鍙敤鎬�"), + // width: 100, + // default: false + // }, + // { + // label: "鎴鏃ユ湡", + // prop: "faultTime", + // isShowColumn: showcol.includes("鎴鏃ユ湡"), + // default: false + // }, + // { + // label: "瀹為檯鏃ユ湡", + // prop: "shopName", + // isShowColumn: showcol.includes("瀹為檯鏃ユ湡"), + // default: false + // }, { label: "鏉ユ簮鍗曟嵁", - prop: "faultLevel", + prop: "sourceNumber", isShowColumn: showcol.includes("鏉ユ簮鍗曟嵁"), default: false }, + // { + // label: "娆犲崟", + // prop: "status", + // isShowColumn: showcol.includes("娆犲崟"), + // default: false + // }, + // { + // label: "杩借釜鍙傝��", + // prop: "status", + // isShowColumn: showcol.includes("杩借釜鍙傝��"), + // default: false + // }, + // { + // label: "鎵胯繍鍟�", + // prop: "status", + // isShowColumn: showcol.includes("鎵胯繍鍟�"), + // default: false + // }, + // { + // label: "鐩殑鍦�", + // prop: "status", + // isShowColumn: showcol.includes("鐩殑鍦�"), + // default: false + // }, + // { + // label: "閲嶉噺", + // prop: "status", + // isShowColumn: showcol.includes("閲嶉噺"), + // default: false + // }, + // { + // label: "鐗╂祦閲嶉噺", + // prop: "status", + // isShowColumn: showcol.includes("鐗╂祦閲嶉噺"), + // default: false + // }, { - label: "娆犲崟", - prop: "status", - isShowColumn: showcol.includes("娆犲崟"), - default: false - }, - { - label: "杩借釜鍙傝��", - prop: "status", - isShowColumn: showcol.includes("杩借釜鍙傝��"), - default: false - }, - { - label: "鎵胯繍鍟�", - prop: "status", - isShowColumn: showcol.includes("鎵胯繍鍟�"), - default: false - }, - { - label: "鐩殑鍦�", - prop: "status", - isShowColumn: showcol.includes("鐩殑鍦�"), - default: false - }, - { - label: "閲嶉噺", - prop: "status", - isShowColumn: showcol.includes("閲嶉噺"), - default: false - }, - { - label: "鐗╂祦閲嶉噺", - prop: "status", - isShowColumn: showcol.includes("鐗╂祦閲嶉噺"), - default: false - }, - { - label: "鎿嶄綔绫诲瀷", - prop: "faultTime", + label: "鍏ュ簱绫诲瀷", + prop: "operationTypeName", isShowColumn: showcol.includes("鎿嶄綔绫诲瀷"), default: false }, - { - label: "鍏徃", - prop: "faultTime", - isShowColumn: showcol.includes("鍏徃"), - default: false - }, + // { + // label: "鍏徃", + // prop: "faultTime", + // isShowColumn: showcol.includes("鍏徃"), + // default: false + // }, { label: "鐘舵��", prop: "status", width: 120, isShowColumn: showcol.includes("鐘舵��"), default: false, - status: true + status: true, + isCallMethod: true, + getCallMethod: this.getStatus } ] return tableColumn @@ -206,29 +209,32 @@ this.tableList.tableColumn = this.setTableColumn(val) }, // 璇锋眰鏁版嵁 - async getData(val, content) { - await getProductList({ - [val]: content, + async getData() { + await getAllList({ + number: this.keyword, page: this.pagerOptions.currPage, - pageSize: this.pagerOptions.pageSize + pageSize: this.pagerOptions.pageSize, + sourceNumber: this.keyword }).then((res) => { - if (res.data.code === 200) { - const list = res.data.data.list.map((item) => { + if (res.code === 200) { + const list = res.data.map((item) => { return { ...item, - supplierNumber: item.supplier.number, - status: "灏辩华", - preTime: "2023-09-04 11:20:00" + from: item.fromLocation.name, + to: item.toLocation.name } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.data.total + this.pagerOptions.totalCount = res.total } }) }, // 鎼滅储 getList(val) { console.log(val) + this.keyword = val + this.pagerOptions.currPage = 1 + this.getData() }, // 琛岀偣鍑� tableRowClick(row) { @@ -241,6 +247,10 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" + }, + // 鐘舵�� + getStatus(val) { + return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚" } } } diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue index 94908bd..b984d55 100644 --- a/src/views/overview/AddOverviewDialog.vue +++ b/src/views/overview/AddOverviewDialog.vue @@ -8,7 +8,7 @@ > <!-- 澶� --> <div slot="title" class="dialog-header"> - <span>{{ editCommonConfig.title + addName }}</span> + <span>{{ editCommonConfig.title === "鏌ョ湅" ? editCommonConfig.title : editCommonConfig.title + addName }}</span> <div class="header_btns"> <span class="btn"> <i class="el-icon-printer"></i> @@ -321,7 +321,7 @@ detailId: 0, isNoDetail: false, // 娣诲姞璇︽儏鏄庣粏琛屾椂鏄惁鏈�夋嫨 tableColumn: [], - receiptType: this.addName, // 鍏ュ簱绫诲瀷 + receiptType: "", // 鍏ュ簱绫诲瀷 companyObj: {}, contacterObj: {}, isValidateClick: false // 楠岃瘉鏄惁鏄剧ず @@ -333,6 +333,7 @@ this.setDetailTableForm() this.getCompanyList() this.getLocationList() + this.receiptType = this.editConfig.title === "鏌ョ湅" ? this.editConfig.infomation.operationTypeName : this.addName }, methods: { // 鑾峰彇鍏徃鍒楄〃 @@ -443,9 +444,9 @@ let contacterName = "" if (this.editConfig.title === "鏂板缓") { companyID = Object.keys(this.companyObj).length === 0 ? 0 : this.companyObj.value - companyName = Object.keys(this.companyObj).length === 0 ? 0 : this.companyObj.label + companyName = Object.keys(this.companyObj).length === 0 ? "" : this.companyObj.label contacterID = Object.keys(this.contacterObj).length === 0 ? 0 : this.contacterObj.value - contacterName = Object.keys(this.contacterObj).length === 0 ? 0 : this.contacterObj.label + contacterName = Object.keys(this.contacterObj).length === 0 ? "" : this.contacterObj.label } else { companyID = Object.keys(this.companyObj).length === 0 ? data.companyID : this.companyObj.value companyName = Object.keys(this.companyObj).length === 0 ? data.companyName : this.companyObj.label @@ -668,7 +669,7 @@ ::v-deep { .el-dialog__headerbtn { position: absolute; - top: 18px; + top: 15px; } .el-button { &:hover { diff --git a/src/views/overview/OverviewListView.vue b/src/views/overview/OverviewListView.vue index b5a8f1e..555dab7 100644 --- a/src/views/overview/OverviewListView.vue +++ b/src/views/overview/OverviewListView.vue @@ -3,7 +3,7 @@ <div class="top"> <SearchCommonView :add-title="'鏂板缓'" - :placeholder="'璇疯緭鍏ュ崟鍙�'" + :placeholder="'璇疯緭鍏ュ崟鍙�/鏉ユ簮鍗曟嵁'" :amount-view="false" @addCommonClick="addBtnClick" @searchClick="getList" @@ -59,7 +59,8 @@ title: "鏂板缓", infomation: {} }, - workType: this.$route.params.workType + workType: this.$route.params.workType, + keyword: "" } }, created() { @@ -180,13 +181,15 @@ // 璇锋眰鏁版嵁 async getData() { await getOperation({ + number: this.keyword, operationTypeId: this.$route.params.id, page: this.pagerOptions.currPage, - pageSize: this.pagerOptions.pageSize + pageSize: this.pagerOptions.pageSize, + sourceNumber: this.keyword }).then((res) => { - console.log(res.data.data) - if (res.data.code === 200) { - const list = res.data.data.map((item) => { + console.log(res.data) + if (res.code === 200) { + const list = res.data.map((item) => { return { ...item, from: item.fromLocation.name, @@ -194,13 +197,14 @@ } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.total + this.pagerOptions.totalCount = res.total } }) }, // 鎼滅储 getList(val) { console.log(val) + this.keyword = val this.pagerOptions.currPage = 1 this.getData() }, diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue index 56214dd..b939663 100644 --- a/src/views/productManage/product/AddProductDialog.vue +++ b/src/views/productManage/product/AddProductDialog.vue @@ -538,7 +538,7 @@ showButton: true, activeName: "first", productTableList: {}, - tableData: [{ name: "ssss" }], + tableData: [], isNoProduct: false, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨 showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳 isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑� @@ -748,7 +748,11 @@ // 杩涘嚭鐐瑰嚮 inOutBoundClick() { if (this.editConfig.title !== "鏂板缓") { - this.$router.push({ path: "/reportForm/inOutboundDetail", query: { name: "浜у搧鍚嶇О/鍑哄叆搴撴槑缁�" } }) + console.log(this.editConfig.infomation) + this.$router.push({ + name: "inOutboundDetail", + params: { name: this.editConfig.infomation.name, id: this.editConfig.infomation.id } + }) } }, // 鍙攢鍞�/鍙噰璐� diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue index 7120876..92938f3 100644 --- a/src/views/productManage/product/index.vue +++ b/src/views/productManage/product/index.vue @@ -31,7 +31,12 @@ <div v-if="isIconIndex === '1'" class="product-view"> <div class="product-box" v-for="item in tableList.tableInfomation" :key="item.id" @click="tableRowClick(item)"> <div class="left"> - <el-image style="width: 60px; height: 80px" :src="url"></el-image> + <!-- <el-image style="width: 60px; height: 80px" :src="url"></el-image> --> + <el-image class="img-view"> + <div slot="error" class="image-slot"> + <i class="el-icon-picture-outline"></i> + </div> + </el-image> </div> <div class="right"> <div class="label"> @@ -100,7 +105,8 @@ }, isIconIndex: "1", // 1 鍥炬爣 2 鍒楄〃 url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - pageSizes: [15, 30] + pageSizes: [15, 30], + keyWord: "" } }, created() { @@ -212,9 +218,9 @@ this.tableList.tableColumn = this.setTableColumn(val) }, // 璇锋眰鏁版嵁 - async getData(val) { + async getData() { await getProductList({ - keyWord: val, + keyWord: this.keyWord, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { @@ -232,8 +238,9 @@ // 鎼滅储 searchClick(val) { console.log(val) + this.keyWord = val this.pagerOptions.currPage = 1 - this.getData(val) + this.getData() }, // 鏂板缓 addBtnClick() { @@ -318,6 +325,14 @@ .left { width: 60px; text-align: center; + .img-view { + width: 60px; + height: 80px; + line-height: 80px; + border: 1px solid #dee2e6; + font-size: 22px; + color: #b8babb; + } } .right { flex: 1; diff --git a/src/views/reportForm/inboundOutboundDetail/index.vue b/src/views/reportForm/inboundOutboundDetail/index.vue index 8ac2cc1..d65260c 100644 --- a/src/views/reportForm/inboundOutboundDetail/index.vue +++ b/src/views/reportForm/inboundOutboundDetail/index.vue @@ -21,18 +21,20 @@ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> + <!-- 缂栬緫 --> + <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" :add-name="this.$route.params.name" /> </div> </template> <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getProductList } from "@/api/product/product" -// import DetailProduct from "@/views/productManage/product/DetailProduct" +import { getProductOperatonList } from "@/api/product/product" +import AddOverviewDialog from "@/views/overview/AddOverviewDialog" export default { name: "InboundOutboundDetail", props: {}, - components: {}, + components: { AddOverviewDialog }, mixins: [pageMixin], computed: {}, data() { @@ -49,7 +51,9 @@ visible: false, title: "鏂板缓", infomation: {} - } + }, + productId: this.$route.params.id, + productName: this.$route.params.name } }, created() { @@ -78,43 +82,44 @@ let tableColumn = [ { label: "鏃ユ湡", - prop: "id", + prop: "operationDate", isShowColumn: true, - default: true + default: true, + date: true }, { - label: "鍙傝��", - prop: "id", + label: "鍗曞彿", + prop: "number", isShowColumn: true, default: true }, { label: "浜у搧", - prop: "id", + prop: "productName", isShowColumn: true, default: true }, { label: "浠�", - prop: "deviceName", + prop: "from", isShowColumn: true, default: true }, { label: "鑷�", - prop: "id", + prop: "to", isShowColumn: true, default: true }, { - label: "鍏徃", - prop: "shopName", - isShowColumn: showcol.includes("鍏徃"), - default: false + label: "鏁伴噺", + prop: "amount", + isShowColumn: true, + default: true }, { - label: "鏁伴噺", - prop: "deviceId", + label: "鍗曚綅", + prop: "unit", isShowColumn: true, default: true }, @@ -124,11 +129,13 @@ width: 120, isShowColumn: showcol.includes("鐘舵��"), default: false, - status: true + status: true, + isCallMethod: true, + getCallMethod: this.getStatus }, { label: "瀹屾垚鑰�", - prop: "preTime", + prop: "admin", isShowColumn: showcol.includes("瀹屾垚鑰�"), default: false } @@ -140,23 +147,23 @@ this.tableList.tableColumn = this.setTableColumn(val) }, // 璇锋眰鏁版嵁 - async getData(val, content) { - await getProductList({ - [val]: content, + async getData() { + await getProductOperatonList({ + productId: this.productId, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - if (res.data.code === 200) { - const list = res.data.data.list.map((item) => { + if (res.code === 200) { + const list = res.data.map((item) => { return { ...item, - supplierNumber: item.supplier.number, - status: "灏辩华", - preTime: "2023-09-04 11:20:00" + from: item.fromLocation.name, + to: item.toLocation.name, + productName: this.productName } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.data.total + this.pagerOptions.totalCount = res.total } }) }, @@ -168,13 +175,17 @@ tableRowClick(row) { console.log(row) this.editConfig.visible = true - this.editConfig.title = "缂栬緫" + this.editConfig.title = "鏌ョ湅" this.editConfig.infomation = { ...row } }, // 鏂板缓 addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" + }, + // 鐘舵�� + getStatus(val) { + return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚" } } } -- Gitblit v1.8.0