From 60d0884f82141a0127fca7e2b03bf3c147436776 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 08 三月 2024 11:29:20 +0800 Subject: [PATCH] 采购订单列表接口联调和添加采购订单接口联调 --- src/components/makepager/CommonFormTableView.vue | 67 +++++++++++++++++++++------------ 1 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue index 130b958..6bd0f81 100644 --- a/src/components/makepager/CommonFormTableView.vue +++ b/src/components/makepager/CommonFormTableView.vue @@ -7,6 +7,7 @@ :show-summary="showSummary.show" :summary-method="getSummaries" :span-method="arraySpanMethod" + @row-click="rowClick" > <el-table-column type="index" @@ -50,7 +51,7 @@ " ></el-input> </el-form-item> - <el-form-item v-else-if="item.productName" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> + <el-form-item v-else-if="item.productName" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> <div class="custom-name"> <el-autocomplete :disabled="item.disabled" @@ -65,15 +66,21 @@ } " ></el-autocomplete> - <div v-if="!item.disabled" class="common-select-btn" @click="selClientClick(scope.row, item.prop, scope)"> - <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> + <div + v-if="!item.disabled" + class="common-select-btn" + @click="selClientClick(scope.row, item.prop, scope)" + > + <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> <div v-if="!item.disabled" class="common-select-btn" @click="clearupClient(scope.row, scope)"> <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> - <div class="common-select-btn" v-if="scope.$index != 0||!item.disabled" @click="deleteClient(scope.row, scope)"> - <i class="el-icon-delete" title="鍒犻櫎"></i> - </div> + <template v-if="!item.disabled"> + <div class="common-select-btn" v-if="scope.$index != 0" @click="deleteClient(scope.row, scope)"> + <i class="el-icon-delete" title="鍒犻櫎"></i> + </div> + </template> </div> </el-form-item> <el-form-item @@ -113,7 +120,7 @@ :prop="'tableData.' + scope.$index + '.' + item.prop" :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]" > - <!-- 閲囪喘绠$悊 --> + <!-- 閲囪喘绠$悊 --> <template v-if="item.multiply"> <el-input-number :disabled="item.disabled" @@ -189,8 +196,8 @@ type: Object, default: () => { return { - tableProductList:[], - disabled:false, + tableProductList: [], + disabled: false, tableData: [], // 鎺ュ彛杩斿洖鏁版嵁 tableColumn: [ // table琛ㄥ崟 @@ -229,7 +236,7 @@ infomation: {} }, productIndex: 0, - tableProductLists:[], + tableProductLists: [] } }, created() { @@ -240,9 +247,13 @@ watch: { productTableList() { this.tableList = this.productTableList - }, + } }, methods: { + // 閫夋嫨琛� + rowClick(row) { + this.$emit("rowClick", row) + }, // 浜у搧鍚嶇О async getProductList() { let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc @@ -250,10 +261,10 @@ page: 1, pageSize: 100 }).then((res) => { - if (res.data.code === 200) { - if (res.data.data.list && res.data.data.list.length > 0) { - this.productList = res.data.data.list - this.tableProductLists = res.data.data.list + if (res.code === 200) { + if (res.data.list && res.data.list.length > 0) { + this.productList = res.data.list + this.tableProductLists = res.data.list } } }) @@ -371,10 +382,9 @@ } }, handleSelectClient(item, prop, row) { - // this.clientId = item.id this.tableList.tableData.map((ite) => { if (ite.name === item.name) { - ite.ID = row.ID + ite.id = row.id ite.amount = item.amount || 1 ite.number = item.number ite.purchasePrice = item.purchasePrice @@ -385,12 +395,13 @@ } }) if (this.detailEnter) { - this.setEditName(item, row.ID) + this.setEditName(item, row.id) } + this.$emit("handleProduct", item, row) }, - setEditName(item, ID) { + setEditName(item, id) { let selRow = { - ID: ID, + id: id, deliveryTime: item.deliveryTime, maximumStock: item.maximumStock, minimumStock: item.minimumStock, @@ -418,7 +429,7 @@ console.log(this.tableList.tableData) if (this.detailEnter) { this.tableList.tableData.map((ite) => { - ite.ID + ite.id ite.name = item.name ite.amount = item.amount || 1 ite.number = item.number @@ -427,12 +438,13 @@ ite.deliveryTime = item.deliveryTime ite.shippingDuration = item.shippingDuration }) - this.setEditName(item, this.tableList.tableData[0].ID) + this.setEditName(item, this.tableList.tableData[0].id) } else { this.tableList.tableData.map((ite, index) => { if (index === this.productIndex) { ite.name = item.name - ite.productId = item.ID + ite.productId = item.id + ite.productIndex = this.productIndex + 1 ite.amount = item.amount || 1 ite.number = item.number ite.purchasePrice = item.purchasePrice @@ -443,7 +455,6 @@ this.$forceUpdate() } }) - console.log(this.tableList.tableData, "=====chanp") } }, @@ -489,10 +500,13 @@ <style lang="scss" scoped> .page-view { min-width: 100px; + .el-form-item { margin-bottom: 0; + .custom-name { display: flex; + .common-select-btn { margin-left: 5px; font-size: 18px; @@ -501,22 +515,27 @@ } } } + ::v-deep { .el-form-item__label { display: none; } + .el-table__footer-wrapper tbody td.el-table__cell { background-color: #fff; // text-align: right; font-weight: bold; } + .el-input--suffix .el-input__inner { padding-right: 0px; } + .el-table .cell, .el-table th.el-table__cell > .cell { padding: 0 5px; } + .el-input__inner { text-align: left; } -- Gitblit v1.8.0