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/api/purchaseManage/purchase.js | 69 +++++---
src/views/purchaseManage/purchase/components/AddPurchase.vue | 61 ++++++-
src/views/purchaseManage/purchase/index.vue | 111 +++++++++----
src/components/makepager/CommonFormTableView.vue | 197 +++++++++++++++++-------
4 files changed, 302 insertions(+), 136 deletions(-)
diff --git a/src/api/purchaseManage/purchase.js b/src/api/purchaseManage/purchase.js
index 73373b2..37a8b1e 100644
--- a/src/api/purchaseManage/purchase.js
+++ b/src/api/purchaseManage/purchase.js
@@ -49,7 +49,7 @@
method: "get"
})
}
-// 閲囪喘鍗曞垪琛�
+// 閲囪喘鍗曞垪琛�
// export const getPurchaseList = async (data) => {
// return await axios.get(`/api/purchase/purchaseList`, {
// params: data
@@ -72,36 +72,36 @@
}
// 鏇存柊閲囪喘鍗�
export function updatePurchase(data) {
- return request({
- url: "/api/purchase/purchase",
- method: "put",
- data
- })
- }
+ return request({
+ url: "/api/purchase/purchase",
+ method: "put",
+ data
+ })
+}
// 鑾峰彇閲囪喘鍗曚俊鎭�
export function getPurchaseInfo(data) {
- return request({
- url: "/api/purchase/purchase/"+data.id,
- method: "get",
- data
- })
- }
- // 鍒犻櫎閲囪喘鍗曚俊鎭�
+ return request({
+ url: "/api/purchase/purchase/" + data.id,
+ method: "get",
+ data
+ })
+}
+// 鍒犻櫎閲囪喘鍗曚俊鎭�
export function deletePurchase(data) {
- return request({
- url: "/api/purchase/purchase/"+data.id,
- method: "delete",
- data
- })
- }
+ return request({
+ url: "/api/purchase/purchase/" + data.id,
+ method: "delete",
+ data
+ })
+}
// 鎻愪氦閲囪喘鍗�
export function submitPurchase(data) {
- return request({
- url: "/api/purchase/submit",
- method: "post",
- data
- })
- }
+ return request({
+ url: "/api/purchase/submit",
+ method: "post",
+ data
+ })
+}
// 鏂板缓閲囪喘绫诲瀷
export function savePurchaseType(data) {
return request({
@@ -123,4 +123,19 @@
return await axios.get(`/api/purchase/qualityInspectList`, {
params: data
})
-}
\ No newline at end of file
+}
+// 鑾峰彇浠撳簱鍒楄〃
+export function getWarehouseInfo() {
+ return request({
+ url: "/api/purchase/getWarehouseInfo/",
+ method: "get"
+ })
+}
+// 鑾峰彇浜у搧/鏀惰揣淇℃伅
+export function getOperationInfo(data) {
+ return request({
+ url: "/api/purchase/getOperationInfo/" + data.id,
+ method: "get",
+ data
+ })
+}
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index eeffb91..6bd0f81 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -1,18 +1,30 @@
<template>
<div class="page-view">
<el-form ref="form" :model="tableList" :show-message="false" label-position="right">
- <el-table
- :data="tableList.tableData"
- style="width: 100%"
- :show-summary="showSummary.show"
- :summary-method="getSummaries"
- :span-method="arraySpanMethod"
- @row-click="rowClick"
+ <el-table
+ :data="tableList.tableData"
+ style="width: 100%"
+ :show-summary="showSummary.show"
+ :summary-method="getSummaries"
+ :span-method="arraySpanMethod"
+ @row-click="rowClick"
>
- <el-table-column type="index" v-if="tableList.tableColumn && tableList.tableColumn.length > 0" label="缂栧彿"
- width="50" align="center"></el-table-column>
- <el-table-column v-for="(item, i) in tableList.tableColumn" :key="i" :prop="item.prop" :label="item.label"
- :width="item.width" :min-width="item.min" align="center">
+ <el-table-column
+ type="index"
+ v-if="tableList.tableColumn && tableList.tableColumn.length > 0"
+ label="缂栧彿"
+ width="50"
+ align="center"
+ ></el-table-column>
+ <el-table-column
+ v-for="(item, i) in tableList.tableColumn"
+ :key="i"
+ :prop="item.prop"
+ :label="item.label"
+ :width="item.width"
+ :min-width="item.min"
+ align="center"
+ >
<!-- 琛ㄥご鏍峰紡 -->
<template slot="header">
<span v-if="item.isRequird" style="color: #f56c6c">*</span>
@@ -21,64 +33,127 @@
<!-- column鏍峰紡 -->
<template slot-scope="scope">
<!-- <template v-if="!detailEnter"> -->
- <el-form-item v-if="item.input" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"
- :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]">
- <el-input :disabled="item.disabled" v-model.trim="scope.row[item.prop]" maxlength="50" size="mini" @change="(val) => {
- commonInputChange(val, item.prop, scope.row)
- }
- "></el-input>
+ <el-form-item
+ v-if="item.input"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input
+ :disabled="item.disabled"
+ v-model.trim="scope.row[item.prop]"
+ maxlength="50"
+ size="mini"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row)
+ }
+ "
+ ></el-input>
</el-form-item>
<el-form-item v-else-if="item.productName" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
<div class="custom-name">
- <el-autocomplete :disabled="item.disabled" v-model="scope.row[item.prop]"
- :fetch-suggestions="querySearchAsync" value-key="name" style="width: calc(100% - 70px)" size="mini"
- @select="(val) => {
- handleSelectClient(val, item.prop, scope.row)
- }
- "></el-autocomplete>
- <div v-if="!item.disabled" class="common-select-btn" @click="selClientClick(scope.row, item.prop, scope)">
+ <el-autocomplete
+ :disabled="item.disabled"
+ v-model="scope.row[item.prop]"
+ :fetch-suggestions="querySearchAsync"
+ value-key="name"
+ style="width: calc(100% - 70px)"
+ size="mini"
+ @select="
+ (val) => {
+ handleSelectClient(val, item.prop, scope.row)
+ }
+ "
+ ></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>
<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 v-else-if="item.date" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"
- :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]">
+ <el-form-item
+ v-else-if="item.date"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
<!-- <el-input v-model.trim="scope.row[item.prop]" maxlength="50" size="mini"></el-input> -->
<el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px">
</el-date-picker>
</el-form-item>
- <el-form-item v-else-if="item.inputNumber" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"
- :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]">
- <el-input-number :disabled="item.disabled" v-model="scope.row[item.prop]" placeholder="" :min="0"
- :controls="false" size="mini" style="width: 100%; margin-right: 5px" @change="(val) => {
- commonInputChange(val, item.prop, scope.row)
- }
- "></el-input-number>
+ <el-form-item
+ v-else-if="item.inputNumber"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ :disabled="item.disabled"
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :controls="false"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row)
+ }
+ "
+ ></el-input-number>
</el-form-item>
- <el-form-item v-else-if="item.inputFloat" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"
- :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]">
+ <el-form-item
+ v-else-if="item.inputFloat"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
<!-- 閲囪喘绠$悊 -->
<template v-if="item.multiply">
- <el-input-number :disabled="item.disabled"
- :value="scope.row[showSummary.multiply[0]] * scope.row[showSummary.multiply[1]]" placeholder="" :min="0"
- :precision="2" :controls="false" size="mini" style="width: 100%; margin-right: 5px" @input="(val) => {
- commonInputChange(val, item.prop, scope.row)
- }
- "></el-input-number>
+ <el-input-number
+ :disabled="item.disabled"
+ :value="scope.row[showSummary.multiply[0]] * scope.row[showSummary.multiply[1]]"
+ placeholder=""
+ :min="0"
+ :precision="2"
+ :controls="false"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @input="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row)
+ }
+ "
+ ></el-input-number>
</template>
<template v-else>
- <el-input-number :disabled="item.disabled" v-model="scope.row[item.prop]" placeholder="" :min="0"
- :precision="2" :controls="false" size="mini" style="width: 100%; margin-right: 5px" @change="(val) => {
- commonInputChange(val, item.prop, scope.row)
- }
- "></el-input-number>
+ <el-input-number
+ :disabled="item.disabled"
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :precision="2"
+ :controls="false"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row)
+ }
+ "
+ ></el-input-number>
</template>
</el-form-item>
<span v-else>{{ scope.row[item.prop] }}</span>
@@ -93,8 +168,12 @@
<el-button :disabled="tableList.disabled" size="small" type="primary" @click="empty">娓呯┖</el-button>
</div>
<!-- 浜у搧鍚嶇О -->
- <SelectCommonDialog v-if="editSelCommonConfig.editVisible" :edit-common-config="editSelCommonConfig" :sign="sign"
- @selClient="selClient" />
+ <SelectCommonDialog
+ v-if="editSelCommonConfig.editVisible"
+ :edit-common-config="editSelCommonConfig"
+ :sign="sign"
+ @selClient="selClient"
+ />
</div>
</template>
@@ -157,7 +236,7 @@
infomation: {}
},
productIndex: 0,
- tableProductLists: [],
+ tableProductLists: []
}
},
created() {
@@ -168,12 +247,12 @@
watch: {
productTableList() {
this.tableList = this.productTableList
- },
+ }
},
methods: {
// 閫夋嫨琛�
- rowClick(row){
- this.$emit("rowClick",row)
+ rowClick(row) {
+ this.$emit("rowClick", row)
},
// 浜у搧鍚嶇О
async getProductList() {
@@ -318,7 +397,7 @@
if (this.detailEnter) {
this.setEditName(item, row.id)
}
- this.$emit("handleProduct",item,row)
+ this.$emit("handleProduct", item, row)
},
setEditName(item, id) {
let selRow = {
@@ -365,7 +444,7 @@
if (index === this.productIndex) {
ite.name = item.name
ite.productId = item.id
- ite.productIndex = this.productIndex+1
+ ite.productIndex = this.productIndex + 1
ite.amount = item.amount || 1
ite.number = item.number
ite.purchasePrice = item.purchasePrice
@@ -453,7 +532,7 @@
}
.el-table .cell,
- .el-table th.el-table__cell>.cell {
+ .el-table th.el-table__cell > .cell {
padding: 0 5px;
}
diff --git a/src/views/purchaseManage/purchase/components/AddPurchase.vue b/src/views/purchaseManage/purchase/components/AddPurchase.vue
index 38d1c0e..10641ed 100644
--- a/src/views/purchaseManage/purchase/components/AddPurchase.vue
+++ b/src/views/purchaseManage/purchase/components/AddPurchase.vue
@@ -163,35 +163,51 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鏀惰揣浠撳簱" prop="receiveWarehouse">
+ <el-form-item label="鏀惰揣浠撳簱" prop="warehouse">
<el-select
placeholder="璇烽�夋嫨鏀惰揣浠撳簱"
- v-model="editConfig.infomation.receiveWarehouse"
+ v-model="editConfig.infomation.warehouse"
clearable
style="width: calc(100% - 0px)"
+ :disabled="editConfig.isDisabled"
>
<el-option
v-for="(ele, index) in receiveWhouseList"
:key="index"
:label="ele.name"
- :value="ele.id"
+ :value="ele.name"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍦板潃" prop="address">
- <el-input v-model="editConfig.infomation.address" placeholder="璇峰~鍐�" clearable></el-input>
+ <el-form-item label="鍦板潃" prop="warehouseAddress">
+ <el-input
+ :disabled="editConfig.isDisabled"
+ v-model="editConfig.infomation.warehouseAddress"
+ placeholder="璇峰~鍐�"
+ clearable
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鎺ユ敹浜�" prop="recipient">
- <el-input v-model="editConfig.infomation.recipient" placeholder="璇峰~鍐�" clearable></el-input>
+ <el-form-item label="鎺ユ敹浜�" prop="principal">
+ <el-input
+ :disabled="editConfig.isDisabled"
+ v-model="editConfig.infomation.principal"
+ placeholder="璇峰~鍐�"
+ clearable
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鏉ユ簮鍗曟嵁" prop="sourceDoc">
- <el-input v-model="editConfig.infomation.sourceDoc" placeholder="璇峰~鍐�" clearable></el-input>
+ <el-form-item label="鏉ユ簮鍗曟嵁" prop="sourceOrder">
+ <el-input
+ :disabled="editConfig.isDisabled"
+ v-model="editConfig.infomation.sourceOrder"
+ placeholder="璇峰~鍐�"
+ clearable
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -319,7 +335,13 @@
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import BomDialog from "@/components/makepager/BomDialog"
import { getProductList } from "@/api/productManage/product"
-import { addPurchase, updatePurchase, savePurchaseType, getPurchaseType } from "@/api/purchaseManage/purchase"
+import {
+ addPurchase,
+ updatePurchase,
+ savePurchaseType,
+ getPurchaseType,
+ getWarehouseInfo
+} from "@/api/purchaseManage/purchase"
import SelectSupplierDialog from "@/views/purchaseManage/purchase/components/SelectSupplierDialog"
// import { formToJSON } from "axios";
import codeMixin from "@/components/mixin/codeMixin"
@@ -401,12 +423,14 @@
total: 0,
totalTwo: 0,
productListIdx: 0,
- lacks: []
+ lacks: [],
+ receiveWhouseList: [] // 鏀惰揣浠撳簱鍒楄〃
}
},
created() {
- console.log(this.editConfig,"鍙傛暟")
+ console.log(this.editConfig, "鍙傛暟")
this.handleGetBomKindDictList()
+ this.getWarehouseInfo()
this.$store.dispatch("getSupplier")
this.formInfo()
},
@@ -683,7 +707,11 @@
realTotalPrice: this.total ? Number(this.total) : 0,
totalPrice: this.totalTwo ? Number(this.totalTwo) : 0,
status: data.status,
- quantity: data.quantity // 閲囪喘鏁伴噺
+ quantity: data.quantity, // 閲囪喘鏁伴噺
+ warehouse: data.warehouse || "", // 鏀惰揣浠撳簱
+ warehouseAddress: data.warehouseAddress || "", // 鏀惰揣浠撳簱鍦板潃
+ principal: data.principal || "", // 浠撳簱璐熻矗浜�
+ sourceOrder: data.sourceOrder || "" // 鏉ユ簮鍗曟嵁
}
}
if (data.id) {
@@ -897,6 +925,13 @@
handleProduct(item) {
this.tableData[this.productListIdx].productId = Number(item.id)
console.log(item, "閫変腑浜у搧", this.tableData)
+ },
+ // 鑾峰彇鏀惰揣浠撳簱鍒楄〃
+ async getWarehouseInfo() {
+ await getWarehouseInfo().then((res) => {
+ console.log(res)
+ this.receiveWhouseList = res.data.info
+ })
}
}
}
diff --git a/src/views/purchaseManage/purchase/index.vue b/src/views/purchaseManage/purchase/index.vue
index 85207f3..4cf3246 100644
--- a/src/views/purchaseManage/purchase/index.vue
+++ b/src/views/purchaseManage/purchase/index.vue
@@ -23,6 +23,8 @@
:table-list="tableList"
@selCommonClick="selCommonClick"
@selTableCol="selTableCol"
+ @tableRowClick="tableRowClick"
+ :selectClassRow="selectRow"
>
<template slot="tableButton">
<el-table-column label="鐘舵��" width="120">
@@ -120,7 +122,13 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
-import { getPurchaseList, getPurchaseInfo, submitPurchase, deletePurchase } from "@/api/purchaseManage/purchase"
+import {
+ getPurchaseList,
+ getPurchaseInfo,
+ submitPurchase,
+ deletePurchase,
+ getOperationInfo
+} from "@/api/purchaseManage/purchase"
import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier"
import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase"
import { getSupplierList } from "@/api/supplierManage/supplier"
@@ -134,12 +142,13 @@
data() {
// 浜у搧淇℃伅
const productColumn = [
- { label: "浜у搧缂栧彿", prop: "number", default: true },
- { label: "浜у搧鍚嶇О", prop: "name" },
- { label: "瑙勬牸鍨嬪彿", prop: "desc" },
- { label: "閲囪喘鏁伴噺", prop: "purchaseAmount" },
- { label: "宸插彂璐ф暟閲�", prop: "margin" },
- { label: "宸插叆搴撴暟閲�", prop: "amount" },
+ { label: "浜у搧缂栧彿", prop: "productId", default: true },
+ { label: "浜у搧鍚嶇О", prop: "productName" },
+ { label: "瑙勬牸", prop: "specifications" },
+ { label: "鍨嬪彿", prop: "modelNumber" },
+ { label: "閲囪喘鏁伴噺", prop: "amount" },
+ { label: "宸插彂璐ф暟閲�", prop: "sendAmount" },
+ { label: "宸插叆搴撴暟閲�", prop: "overAmount" },
{ label: "鍗曚綅", prop: "unit" },
{ label: "閲囪喘鍗曚环", prop: "price", price: true },
{ label: "浠风◣鍚堣", prop: "total", price: true }
@@ -147,13 +156,13 @@
// 鏀惰揣淇℃伅
const recriveColumn = [
{ label: "鍏ュ簱鍗曞彿", prop: "number", default: true },
- { label: "鏀惰揣浠撳簱", prop: "name" },
- { label: "浜у搧鍚嶇О", prop: "orderAmount" },
- { label: "浜у搧缂栫爜", prop: "invoice" },
- { label: "鏁伴噺", prop: "carrier" },
- { label: "鍏ュ簱鏃堕棿", prop: "waybill" },
- { label: "鏀惰揣浜�", prop: "warehouse" },
- { label: "鐘舵��", prop: "amount" }
+ { label: "鏀惰揣浠撳簱", prop: "warehouseName" },
+ { label: "浜у搧鍚嶇О", prop: "productName" },
+ { label: "浜у搧缂栫爜", prop: "productId" },
+ { label: "鏁伴噺", prop: "amount" },
+ { label: "鍏ュ簱鏃堕棿", prop: "overTime" },
+ { label: "鏀惰揣浜�", prop: "principal" },
+ { label: "鐘舵��", prop: "status" }
]
return {
purchaseStatusList: getDataByType("purchaseStatus"),
@@ -195,7 +204,8 @@
showProductCol: [
"浜у搧缂栧彿",
"浜у搧鍚嶇О",
- "瑙勬牸鍨嬪彿",
+ "瑙勬牸",
+ "鍨嬪彿",
"閲囪喘鏁伴噺",
"宸插彂璐ф暟閲�",
"宸插叆搴撴暟閲�",
@@ -205,8 +215,9 @@
],
// 鏀惰揣淇℃伅
recriveColumn: recriveColumn,
- showReceiveCol: ["鍏ュ簱鍗曞彿", "鏀惰揣浠撳簱", "浜у搧鍚嶇О", "浜у搧缂栧彿", "鏁伴噺", "鍏ュ簱鏃堕棿", "鏀惰揣浜�", "鐘舵��"],
- loading: false
+ showReceiveCol: ["鍏ュ簱鍗曞彿", "鏀惰揣浠撳簱", "浜у搧鍚嶇О", "浜у搧缂栫爜", "鏁伴噺", "鍏ュ簱鏃堕棿", "鏀惰揣浜�", "鐘舵��"],
+ loading: false,
+ selectRow: {}
}
},
created() {
@@ -289,6 +300,10 @@
})
this.tableList.tableInfomation = list || []
this.pagerOptions.totalCount = res.data.total
+ if (res.data.total > 0) {
+ this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
+ this.tableRowClick(this.selectRow)
+ }
}
})
.catch((err) => {
@@ -490,6 +505,29 @@
this.tableLoading = false
}, 3000)
},
+ // top 琛岀偣鍑�
+ tableRowClick(row) {
+ this.selectRow = row
+ if (row.status == 1 && this.TabsIndex == 0) {
+ getPurchaseInfo({ id: row.id }).then((res) => {
+ if (res.code == 200) {
+ this.productTableList.tableInfomation = res.data.productList
+ } else {
+ this.$message.error(res.msg ? res.msg + "," : "" + "鑾峰彇淇℃伅澶辫触锛�")
+ }
+ })
+ } else if (this.TabsIndex == 1 && row.status == 1) {
+ this.productTableList.tableInfomation = []
+ } else {
+ getOperationInfo({ id: row.id }).then((res) => {
+ if (res.code == 200) {
+ this.productTableList.tableInfomation = res.data
+ } else {
+ this.$message.error(res.msg ? res.msg + "," : "" + "鑾峰彇淇℃伅澶辫触锛�")
+ }
+ })
+ }
+ },
// bom 鍒楄〃
setBottomList() {
this.productTableList = {
@@ -529,11 +567,7 @@
this.tableBottomColumn = this.recriveColumn
this.showBottomCol = this.showReceiveCol
this.setBottomList()
- // if (this.selectRow.status == 1) {
- // this.productTableList.tableInfomation = []
- // } else {
this.getProductInventoryInfo(this.selectRow)
- // }
}
},
// 鐘舵��
@@ -543,22 +577,25 @@
// 鑾峰彇浜у搧/鏀惰揣淇℃伅
async getProductInventoryInfo(row) {
console.log(row)
- // if (this.TabsIndex == 0 || row.status == 1) {
- // this.productTableList.tableInfomation = row.products || []
- // } else {
- // if (row.number) {
- // this.loading = true
- // await getProductInventoryInfo(row.number)
- // .then((res) => {
- // this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : []
- // this.loading = false
- // })
- // .catch(() => {
- // this.productTableList.tableInfomation = []
- // this.loading = false
- // })
- // }
- // }
+ if (this.TabsIndex == 0 && row.status == 1) {
+ getPurchaseInfo({ id: row.id }).then((res) => {
+ if (res.code == 200) {
+ this.productTableList.tableInfomation = res.data.productList
+ } else {
+ this.$message.error(res.msg ? res.msg + "," : "" + "鑾峰彇淇℃伅澶辫触锛�")
+ }
+ })
+ } else if (this.TabsIndex == 1 && row.status == 1) {
+ this.productTableList.tableInfomation = []
+ } else {
+ getOperationInfo({ id: row.id }).then((res) => {
+ if (res.code == 200) {
+ this.productTableList.tableInfomation = res.data
+ } else {
+ this.$message.error(res.msg ? res.msg + "," : "" + "鑾峰彇淇℃伅澶辫触锛�")
+ }
+ })
+ }
}
}
}
--
Gitblit v1.8.0