From 9c1e0958af114e4ae2bfaaade28d49753268e9f1 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 06 七月 2026 13:54:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_新疆_大罗素马铃薯new' into dev_新疆_大罗素马铃薯new
---
src/views/procurementManagement/procurementLedger/index.vue | 145 +++++++++++++++++++++++++++++++++++++++--------
1 files changed, 119 insertions(+), 26 deletions(-)
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 83089cf..47ec1e4 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -27,13 +27,13 @@
clearable
:prefix-icon="Search" />
</el-form-item>
- <el-form-item label="閿�鍞悎鍚屽彿锛�">
- <el-input v-model="searchForm.salesContractNo"
- placeholder="璇疯緭鍏�"
- clearable
- prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
+<!-- <el-form-item label="璁㈠崟鍙凤細">-->
+<!-- <el-input v-model="searchForm.salesContractNo"-->
+<!-- placeholder="璇疯緭鍏�"-->
+<!-- clearable-->
+<!-- prefix-icon="Search"-->
+<!-- @change="handleQuery" />-->
+<!-- </el-form-item>-->
<el-form-item label="椤圭洰鍚嶇О锛�">
<el-input v-model="searchForm.projectName"
placeholder="璇疯緭鍏�"
@@ -217,10 +217,10 @@
prop="purchaseContractNumber"
width="160"
show-overflow-tooltip />
- <el-table-column label="閿�鍞悎鍚屽彿"
- prop="salesContractNo"
- width="160"
- show-overflow-tooltip />
+<!-- <el-table-column label="璁㈠崟鍙�"-->
+<!-- prop="salesContractNo"-->
+<!-- width="160"-->
+<!-- show-overflow-tooltip />-->
<el-table-column label="渚涘簲鍟嗗悕绉�"
prop="supplierName"
width="160"
@@ -324,21 +324,21 @@
clearable />
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="閿�鍞悎鍚屽彿锛�"
- prop="salesLedgerId">
- <el-select v-model="form.salesLedgerId"
- placeholder="璇烽�夋嫨"
- filterable
- clearable
- @change="salesLedgerChange">
- <el-option v-for="item in salesContractList"
- :key="item.id"
- :label="item.salesContractNo"
- :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
+<!-- <el-col :span="12">-->
+<!-- <el-form-item label="璁㈠崟鍙凤細"-->
+<!-- prop="salesLedgerId">-->
+<!-- <el-select v-model="form.salesLedgerId"-->
+<!-- placeholder="璇烽�夋嫨"-->
+<!-- filterable-->
+<!-- clearable-->
+<!-- @change="salesLedgerChange">-->
+<!-- <el-option v-for="item in salesContractList"-->
+<!-- :key="item.id"-->
+<!-- :label="item.salesContractNo"-->
+<!-- :value="item.id" />-->
+<!-- </el-select>-->
+<!-- </el-form-item>-->
+<!-- </el-col>-->
</el-row>
<el-row :gutter="30">
<el-col :span="12">
@@ -585,6 +585,35 @@
<el-tag v-else :type="scope.row.isChecked ? 'success' : 'info'">
{{ scope.row.isChecked ? '鏄�' : '鍚�' }}
</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="閫夋嫨璁惧"
+ prop="deviceId"
+ width="150">
+ <template #default="scope">
+ <span v-if="scope.row.productType === 2">--</span>
+ <el-select v-else
+ v-model="scope.row.deviceId"
+ placeholder="璇烽�夋嫨璁惧"
+ filterable
+ clearable
+ @change="handleDeviceChange(scope.row, scope.$index)">
+ <el-option v-for="device in iotDeviceList"
+ :key="device.id"
+ :label="device.deviceName"
+ :value="device.id" />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="搴撲綅"
+ prop="storageLocation"
+ width="120">
+ <template #default="scope">
+ <span v-if="scope.row.productType === 2">--</span>
+ <el-input v-else
+ v-model="scope.row.storageLocation"
+ placeholder="鑷姩鑾峰彇"
+ disabled />
</template>
</el-table-column>
<el-table-column label="鍏ュ簱瀹℃牳鐘舵��"
@@ -853,6 +882,32 @@
</el-row>
<el-row :gutter="30" v-if="productForm.productType !== 2">
<el-col :span="12">
+ <el-form-item label="閫夋嫨璁惧锛�"
+ prop="deviceId">
+ <el-select v-model="productForm.deviceId"
+ placeholder="璇烽�夋嫨璁惧"
+ filterable
+ clearable
+ style="width: 100%"
+ @change="handleProductDeviceChange">
+ <el-option v-for="device in iotDeviceList"
+ :key="device.id"
+ :label="device.deviceName"
+ :value="device.id" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="搴撲綅锛�"
+ prop="storageLocation">
+ <el-input v-model="productForm.storageLocation"
+ placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄨ幏鍙�"
+ disabled />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30" v-if="productForm.productType !== 2">
+ <el-col :span="12">
<el-form-item label="鏄惁璐ㄦ锛�"
prop="isChecked">
<el-radio-group v-model="productForm.isChecked">
@@ -950,6 +1005,7 @@
const salesContractList = ref([]);
const supplierList = ref([]);
const contractList = ref([]); // 渚涘簲鍟嗗悎鍚屽垪琛�
+ const iotDeviceList = ref([]); // IoT璁惧鍒楄〃
const contractFileDialogVisible = ref(false);
const contractFileList = ref([]);
const tableLoading = ref(false);
@@ -965,6 +1021,7 @@
import { modelList, productTreeList } from "@/api/basicData/product.js";
import { getSparePartsList } from "@/api/equipmentManagement/spareParts.js";
import { getSupplierContractList, getSupplierContractFilesByNo } from "@/api/basicData/supplierContract.js";
+ import { getIotDeviceList as getIotDeviceListApi } from "@/api/equipmentManagement/ledger.js";
import dayjs from "dayjs";
import FileUpload from "@/components/AttachmentUpload/file/index.vue";
@@ -1185,6 +1242,8 @@
invoiceType: "",
warnNum: "",
isChecked: false,
+ deviceId: "",
+ storageLocation: "",
},
productRules: {
productId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -2284,6 +2343,39 @@
}
};
+ // 鑾峰彇IoT璁惧鍒楄〃
+ // 鑾峰彇IoT璁惧鍒楄〃
+ const getIotDeviceList = async () => {
+ try {
+ const res = await getIotDeviceListApi();
+ if (res.data) {
+ iotDeviceList.value = res.data;
+ }
+ } catch (error) {
+ console.error("鑾峰彇IoT璁惧鍒楄〃澶辫触:", error);
+ }
+ };
+
+ // 璁惧閫夋嫨鍙樻洿鏃讹紝鑷姩濉厖搴撲綅
+ const handleDeviceChange = (row, index) => {
+ const device = iotDeviceList.value.find(d => d.id === row.deviceId);
+ if (device) {
+ row.storageLocation = device.storageLocation || '';
+ } else {
+ row.storageLocation = '';
+ }
+ };
+
+ // 浜у搧寮圭獥涓澶囬�夋嫨鍙樻洿鏃讹紝鑷姩濉厖搴撲綅
+ const handleProductDeviceChange = (deviceId) => {
+ const device = iotDeviceList.value.find(d => d.id === deviceId);
+ if (device) {
+ productForm.value.storageLocation = device.storageLocation || '';
+ } else {
+ productForm.value.storageLocation = '';
+ }
+ };
+
// 鏍煎紡鍖栨枃浠跺ぇ灏�
const formatFileSize = (bytes) => {
if (!bytes) return '0 B';
@@ -2296,6 +2388,7 @@
onMounted(() => {
getList();
getTemplateList();
+ getIotDeviceList();
});
</script>
--
Gitblit v1.9.3