From 1c50cb5546715fa21496fbdf2bdacb7ae8836b8a Mon Sep 17 00:00:00 2001 From: hdy <1105738590@qq.com> Date: 星期二, 11 三月 2025 13:17:53 +0800 Subject: [PATCH] 修改 --- billion-ui/src/views/main/bs/routeInfo/ProductSelector.vue | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 107 insertions(+), 8 deletions(-) diff --git a/billion-ui/src/views/main/bs/routeInfo/ProductSelector.vue b/billion-ui/src/views/main/bs/routeInfo/ProductSelector.vue index 35b07c5..36f5334 100644 --- a/billion-ui/src/views/main/bs/routeInfo/ProductSelector.vue +++ b/billion-ui/src/views/main/bs/routeInfo/ProductSelector.vue @@ -1,11 +1,70 @@ <template> - <el-dialog :title="title" :visible.sync="visible" @close="handleClose"> - <el-table :data="gridData" selection="single" ref="multipleTable" @selection-change="productSelectionChange"> - <el-table-column type="selection" width="55"></el-table-column> - <el-table-column property="date" label="鏃ユ湡" width="150"></el-table-column> - <el-table-column property="name" label="濮撳悕" width="200"></el-table-column> - <el-table-column property="address" label="鍦板潃"></el-table-column> + <el-dialog :title="title" :visible.sync="visible" width="1000px" @close="handleClose"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="鐗╂枡缂栧彿" prop="materialCode"> + <el-input + v-model="queryParams.materialCode" + placeholder="璇疯緭鍏ョ墿鏂欑紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鐗╂枡鍚嶇О" prop="materialName"> + <el-input + v-model="queryParams.materialName" + placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item style="float: right"> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + </el-form-item> + </el-form> + <el-table border ref="multipleTable" v-loading="loading" :data="materialInfoList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column :show-overflow-tooltip="true" label="鐗╂枡缂栧彿" align="center" prop="materialCode" /> + <el-table-column :show-overflow-tooltip="true" label="鐗╂枡鍚嶇О" align="center" prop="materialName" /> + <el-table-column :show-overflow-tooltip="true" label="瑙嗗浘" align="center" prop="materialView" /> + <el-table-column label="绉嶇被" align="center" prop="typeZ"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.type_z" :value="scope.row.typeZ"/> + </template> + </el-table-column> + <el-table-column label="绫诲瀷" align="center" prop="typeL"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.type_l" :value="scope.row.typeL"/> + </template> + </el-table-column> + <el-table-column label="鍗曚綅" align="center" prop="unit"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.unit" :value="scope.row.unit"/> + </template> + </el-table-column> + <el-table-column :show-overflow-tooltip="true" label="鐗堟湰" align="center" prop="version" /> + <el-table-column label="鐘舵��" align="center" prop="status"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> + </template> + </el-table-column> + <el-table-column :show-overflow-tooltip="true" label="鍘傚晢" align="center" prop="supplier" /> + <el-table-column :show-overflow-tooltip="true" label="澶囨敞" align="center" prop="remark" /> + <el-table-column :show-overflow-tooltip="true" label="鏁版嵁鏉ユ簮" align="center" prop="dataSource" /> + <el-table-column :show-overflow-tooltip="true" label="鍒涘缓鐢ㄦ埛" align="center" prop="createBy" /> + <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180"> + </el-table-column> + <el-table-column :show-overflow-tooltip="true" label="鏇存敼鐢ㄦ埛" align="center" prop="updateBy" /> + <el-table-column label="鏇存敼鏃堕棿" align="center" prop="updateTime" width="180"> + </el-table-column> </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> <div slot="footer" class="dialog-footer"> <el-button @click="handleClose">鍙� 娑�</el-button> <el-button type="primary" @click="confirmSelection">纭� 瀹�</el-button> @@ -14,8 +73,11 @@ </template> <script> +import {listMaterialInfo} from "@/api/main/bs/materialInfo"; + export default { name: "ProductSelector", + dicts: ['sys_normal_disable', 'type_l', 'unit', 'type_z'], props: { visible: Boolean, title: { @@ -26,14 +88,50 @@ }, data() { return { - multipleSelection: [] + // 鎬绘潯鏁� + total: 0, + // 鐗╂枡淇℃伅琛ㄦ牸鏁版嵁 + materialInfoList: [], + // 閬僵灞� + loading: true, + showSearch: true, + multipleSelection: [], + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + materialCode: null, + materialName: null, + materialView: null, + typeZ: null, + typeL: null, + unit: null, + status: null, + }, }; }, + created() { + this.getList(); + }, methods: { + /** 鏌ヨ鐗╂枡淇℃伅鍒楄〃 */ + getList() { + this.loading = true; + listMaterialInfo(this.queryParams).then(response => { + this.materialInfoList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, handleClose() { this.$emit('update:visible', false); }, - productSelectionChange(selection) { + handleSelectionChange(selection) { if (selection.length > 1) { this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.toggleRowSelection(selection[selection.length - 1], true); @@ -46,6 +144,7 @@ if (this.multipleSelection.length > 0) { this.$emit('select-product', this.multipleSelection[0]); this.handleClose(); + this.$refs.multipleTable.clearSelection(); } else { this.$message({ message: '璀﹀憡鍝︼紝鏈�夋嫨浠讳綍琛�', -- Gitblit v1.9.3