فهرست منبع

生产管理-待排产管理-批量

damon227 11 ماه پیش
والد
کامیت
6997a4248c
1فایلهای تغییر یافته به همراه40 افزوده شده و 3 حذف شده
  1. 40 3
      src/views/modules/production/scheduling.vue

+ 40 - 3
src/views/modules/production/scheduling.vue

@@ -5,8 +5,8 @@
       <el-header style="font-size: large;text-align: center">任务处理中心</el-header>
       <el-form>
         <el-form-item>
-          <el-button type="primary" @click="batchBuyHandle()">批量转采购</el-button>
-          <el-button type="primary" @click="batchOutsourceHandle()">批量转委外</el-button>
+          <el-button v-if="isAuth('prod:production:purchase')" type="primary" @click="batchBuyHandle()" :disabled="batchIncomeBtnDisabled">批量转采购</el-button>
+          <el-button v-if="isAuth('pur:commDetail:save')" type="primary" @click="batchOutsourceHandle()" :disabled="batchBtnDisabled">批量转委外</el-button>
         </el-form-item>
       </el-form>
       <el-table
@@ -301,7 +301,9 @@ export default {
           }
         ],
         multipleSelection: [],
-        selectedRows:[]
+        selectedRows:[],
+        batchIncomeBtnDisabled: false,
+        batchBtnDisabled: false
       }
     },
     created () {
@@ -316,6 +318,9 @@ export default {
         this.purchaseVisible = false
         this.craftsVisible = false
         this.printLabelVisible = false
+        this.selectedRows = []
+        this.batchIncomeBtnDisabled = false
+        this.batchBtnDisabled = false
       },
       // 查询
       queryPage () {
@@ -324,6 +329,10 @@ export default {
       },
       // 获取数据列表
       getDataList () {
+        this.selectedRows = []
+        this.batchIncomeBtnDisabled = false
+        this.batchBtnDisabled = false
+
         this.dataListLoading = true
         let params = {
           'current': this.pageIndex,
@@ -467,9 +476,32 @@ export default {
       //监听批量选择的行
       handleSelectionChange(rows){
         this.selectedRows = rows
+
+        //控制批量操作按钮
+        this.batchIncomeBtnDisabled = false
+        this.batchBtnDisabled = false
+        for(let index=0;index<this.selectedRows.length;index++){
+          let item = this.selectedRows[index]
+          if(Number(item.prodState) === 2){
+          
+          } else {
+            this.batchIncomeBtnDisabled = true
+          }
+
+          if(Number(item.prodState) === 2){
+          
+          } else {
+            this.batchBtnDisabled = true
+          }
+        }
       },
       //批量转采购
       batchBuyHandle(){
+        if(this.selectedRows.length == 0){
+           this.$message.error("请先勾选数据")
+           return
+        }
+
         this.purchaseVisible = true
         this.$nextTick(() => {
           this.$refs.purchase.init(this.selectedRows)
@@ -477,6 +509,11 @@ export default {
       },
       //批量转委外
       batchOutsourceHandle(){
+        if(this.selectedRows.length == 0){
+           this.$message.error("请先勾选数据")
+           return
+        }
+
         this.outsourceVisible = true
         this.$nextTick(() => {
           this.$refs.outsource.init(this.selectedRows)