+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -238,10 +332,11 @@
import VueQr from 'vue-qr'
import VueEasyPrint from 'vue-easy-print'
import {addBasProductCode, delBasProductCode, listBasProductCode, updateBasProductCode} from "@/api/bas/BasProductCode"
+import { listBasProduct } from "@/api/bas/BasProduct"
// 常量配置
const FORM_FIELDS = [
- { prop: 'spare4', label: '品号', placeholder: '请输入品号', required: true },
+ { prop: 'spare4', label: '品号', placeholder: '点击选择品号', required: true, readonly: true },
{ prop: 'model', label: '型号', placeholder: '请输入型号', required: true },
{ prop: 'serial', label: '序列号', placeholder: '请输入序列号', required: true },
{ prop: 'color', label: '颜色', placeholder: '请输入颜色', required: true },
@@ -338,7 +433,22 @@ export default {
// 表单字段配置
formFields: FORM_FIELDS,
// 表格列配置
- tableColumns: TABLE_COLUMNS
+ tableColumns: TABLE_COLUMNS,
+ // 物资选择弹框显示状态
+ productSelectVisible: false,
+ // 物资查询参数
+ productQueryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ productId: undefined,
+ productName: undefined
+ },
+ // 物资表格数据
+ productTableData: [],
+ // 物资表格加载状态
+ productTableLoading: false,
+ // 物资总条数
+ productTotal: 0
}
},
computed: {
@@ -561,6 +671,50 @@ export default {
this.selectedRows = selection
},
+ // 打开物资选择弹框
+ openProductSelect() {
+ this.productSelectVisible = true;
+ this.getProductList();
+ },
+
+ // 获取物资列表
+ async getProductList() {
+ this.productTableLoading = true;
+ try {
+ const response = await listBasProduct(this.productQueryParams);
+ this.productTableData = response.rows || [];
+ this.productTotal = response.total || 0;
+ } catch (error) {
+ this.$message.error('获取物资数据失败:' + error.message);
+ } finally {
+ this.productTableLoading = false;
+ }
+ },
+
+ // 物资查询按钮操作
+ handleProductQuery() {
+ this.productQueryParams.pageNum = 1;
+ this.getProductList();
+ },
+
+ // 重置物资查询表单
+ resetProductQuery() {
+ this.$refs.queryForm.resetFields();
+ this.productQueryParams = {
+ pageNum: 1,
+ pageSize: 10,
+ productId: undefined,
+ productName: undefined
+ };
+ this.getProductList();
+ },
+
+ // 选择物资
+ handleProductSelect(row) {
+ this.form.spare4 = row.productId;
+ this.productSelectVisible = false;
+ },
+
// 二维码编码方法
procode(text) {
const key = "0"
@@ -659,7 +813,7 @@ export default {
}
.form-container {
- margin-bottom: 20px;
+ margin-bottom: 0px;
}
.preview-container {
@@ -733,11 +887,10 @@ export default {
/* 表单样式 */
.form-container .el-form {
- padding: 0 20px 20px;
+ padding: 0 20px 10px;
}
.form-actions {
- margin-top: 20px;
text-align: center;
}