zhangqing 1 năm trước cách đây
mục cha
commit
1444b4a591
1 tập tin đã thay đổi với 34 bổ sung1 xóa
  1. 34 1
      src/views/aps/presalesorder/index.vue

+ 34 - 1
src/views/aps/presalesorder/index.vue

@@ -5,7 +5,7 @@
       <search ref="search" @search="reload"></search>
 
       <ele-pro-table ref="tableRef" :columns="columns" :datasource="datasource" :pageSize="20"
-        :pageSizes="[20, 30, 40, 50, 100]" row-key="id" @selection-change="handleSelectionChange" :initLoad="false"
+        :pageSizes="[20, 30, 40, 50, 100]" row-key="id" @selection-change="handleSelectionChange" :initLoad="false" @select="handleSelect"
         @done="onDone">
         <template v-slot:toolbar>
           <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleEstimatedDelivery">交期预估</el-button>
@@ -166,6 +166,13 @@
               </el-form-item>
             </el-col>
           </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="编号" prop="productionCodes">
+                <el-input v-model="form.productionCodes" placeholder="请输入编号,用','隔开" />
+              </el-form-item>
+            </el-col>
+          </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -356,6 +363,13 @@ export default {
           align: 'center',
           width: 140,
         },
+        {
+          prop:'productionCodes',
+          label: '编号',
+          showOverflowTooltip: true,
+          align: 'center',
+          width: 140,
+        },
         {
           prop: 'factoriesName',
           label: '工厂名称',
@@ -419,6 +433,22 @@ export default {
     await this.getFactoryList();
   },
   methods: {
+    handleSelect(selection, row) {
+      const matchField = 'preSalesOrderNumber';
+      const isSelected = selection.some(item => item.id === row.id);
+      const list = this.$refs.tableRef.getData()
+      const matchedRows = list.filter(
+        item => item[matchField] === row[matchField]
+      )
+
+      // 批量设置选择状态
+      this.$nextTick(() => {
+        matchedRows.forEach(item => {
+          this.$refs.tableRef.toggleRowSelection(item, isSelected) 
+        })
+      })
+    },
+
     async getFactoryList() {
       const res = await getQueryFactory();
       console.log(res, 'data工厂')
@@ -733,6 +763,9 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
+            if (this.form.productionCodes) {
+              this.form.productionCodes = this.form.productionCodes.replace(/,/g, ",")
+            }
             updateSalesorder(this.form).then(response => {
               this.$message.success("修改成功");
               this.open = false;