ソースを参照

采购需求处理更改编辑后只传修改的行

黄梓星 1 年間 前
コミット
43816d0fbd

+ 18 - 4
src/views/purchase/DemandSummary/index.vue

@@ -283,14 +283,14 @@
           <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.modifyReason" label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$index)"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.suggestionPurchase" label="建议采购量" align="center" prop="suggestionPurchase"  width="80px"/>
           <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
           <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
             <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$index)"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyTwoName" label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
@@ -504,6 +504,8 @@ export default {
       //   isPage: true,
       //   title: ''
       // }
+      // 用于保存临时记录修改行的数组
+      record:[]
     }
   },
   created() {
@@ -664,7 +666,15 @@ export default {
       this.getList(this.queryParams)
     },
     saveList() {
-      editSummaryList(this.tableList).then(res => {
+      // console.log('记录',this.record)
+      // 对记录的数据进行去重
+      let newRecord = Array.from(new Set(this.record))
+      // console.log('去重后的', newRecord)
+      let changeList = newRecord.map(i => {
+        return this.tableList[i]
+      })
+      // console.log('shuzu', changeList)
+      editSummaryList(changeList).then(res => {
         if (res.code === 200) {
           this.$modal.notifySuccess("保存成功");
           this.lineDisable = true
@@ -791,6 +801,7 @@ export default {
       }
       if (this.referCondition.title == '明细采购员') {
         console.log('选择进了吗',this.tableList)
+        this.record.push(this.tableIndex)
         this.tableList[this.tableIndex].buyer = selection[0].code
         this.tableList[this.tableIndex].buyerName = selection[0].name
       }
@@ -856,7 +867,10 @@ export default {
       this.referCondition.isPage = isPage
       this.referCondition.title = title
       this.$refs.refer.init(this.referCondition)
-    }
+    },
+    jilu(index) {
+      this.record.push(index)
+    },
   }
 }
 </script>

+ 29 - 4
src/views/purchase/workSpace/index.vue

@@ -67,6 +67,17 @@
         </el-table-column>
       </el-table>
 
+      <el-pagination
+        background
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="queryParams.pageNum"
+        :page-sizes="[10, 20, 50, 100, 200, 500]"
+        :page-size="20"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total=total>
+      </el-pagination>
+
     </el-card>
   </div>
 </template>
@@ -82,7 +93,7 @@ export default {
         modelIds:[],
         docSubject: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 20
       },
       loading: false,
       tableList: [],
@@ -113,11 +124,21 @@ export default {
     rowSelect() {},
     doubleClick() {},
     xxxx() {},
-    check() {},
-    agree(row) {
+    check(row) {
       console.log(row)
       this.$router.push({path: row.linkUrl ,query: {billCode: row.billCode}})
-    }
+    },
+    agree(row) {
+      
+    },
+    handleSizeChange(val) {
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    handleCurrentChange(val) {
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
   }
 }
 </script>
@@ -133,6 +154,10 @@ export default {
   display: flex;
   justify-content: flex-end;
 }
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>
 <style>
 .exporttable {