changhaoning 2 жил өмнө
parent
commit
dd7a9d7c10

+ 4 - 0
src/api/pages/pur/pur-enter.js

@@ -37,5 +37,9 @@ export const routeUrl = {
     entryHandle: {key: 'entryHandle', routeName: 'pur-enter-handle',chooseFlag:true},
     //入库撤回
     entryBack: {key: 'entryBack', method: 'entryBack'},
+    //作废
+    invalid: {key: 'invalid', method: 'invalid'},
+    //编辑
+    edit: {key: 'edit', routeName: 'pur-entry-edit'},
   }
 }

+ 3 - 0
src/locale/lang/zh-CN.js

@@ -513,6 +513,9 @@ export const messages = {
   W_100: '当前业务员中不存在主业务员,请重新操作',
   W_101: '待入库单据不允许进行采购退货',
   W_102: '已出库单据不允许进行作废处理',
+  W_103: '已出库数据不允许进行出库办理',
+  W_104: '已出库数据不允许进行编辑',
+  W_105: '已入库单据不允许进行作废处理',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',

+ 36 - 0
src/view/pur/pur-enter/index.vue

@@ -8,10 +8,14 @@
         <BaseIndexButton ref="search" name="search"></BaseIndexButton>
         <!--    清空条件    -->
         <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
+        <!--    编辑    -->
+        <BaseIndexButton ref="edit" name="edit"></BaseIndexButton>
         <!--    入库办理    -->
         <BaseIndexButton ref="entryHandle" name="entryHandle"></BaseIndexButton>
         <!--    入库撤回    -->
         <BaseIndexButton ref="entryBack" name="entryBack"></BaseIndexButton>
+        <!--    作废    -->
+        <BaseIndexButton ref="invalid" name="invalid"></BaseIndexButton>
       </template>
       <template #right>
         <BaseIndexButton ref="add" name="add"></BaseIndexButton>
@@ -459,6 +463,38 @@ export default {
       }
     },
 
+    /**
+     * @desc   : 作废
+     * @author : 常皓宁
+     * @date   : 2024/3/21 12:59
+     */
+    invalid() {
+      let rows = this.$refs['table-select'].batchRows;
+      if (rows && rows.length > 0) {
+        if(rows[0].intoStatus == this.$config.intoStatus.yiRuKu){
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_105')}));
+          return
+        }
+        let params ={
+          intoId:rows[0].intoId,
+        }
+        this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('invalid')}), title: this.$t('systemQuestion')},
+          {
+            ok: () => {
+              this.loading = true
+              // this.excute(this.$service.purReturnService, this.$service.purReturnService.cancel, params, false).then(res => {
+              //   if (res.code === this.$config.SUCCESS_CODE) {
+              //     this.$Message.success(this.$t('I_001', {'param': this.$t('invalid')}))
+              //   } else {
+              //     this.$Message.warning(res.message)
+              //   }
+              //   this.loading = false
+              // })
+            },
+          })
+      }
+    },
+
   },
   created() {
     this.primaryKey = 'intoId'  // 设置主键Id

+ 1 - 0
src/view/pur/pur-return/form.vue

@@ -64,6 +64,7 @@
                      :show-footer="true"
                      :add-flag="false"
                      @changeValue="changeValue"
+                     :readonly="editFlag"
           ></EditTable>
         </div>
       </DkPanel>

+ 12 - 3
src/view/pur/pur-return/index.vue

@@ -314,9 +314,10 @@ export default {
     * @author : 常皓宁
     * @date   : 2024/3/21 12:59
     */
-    invalid(rows) {
+    invalid() {
+      let rows = this.$refs['table-select'].batchRows;
       if (rows && rows.length > 0) {
-        if(rows.outStatus == this.$config.outStatus.yiChuKu){
+        if(rows[0].outStatus == this.$config.outStatus.yiChuKu){
           this.$Message.warning(this.$t('W_007', {'param': this.$t('W_102')}));
           return
         }
@@ -426,7 +427,15 @@ export default {
       if (rows && rows[0] && btnName === 'outHandle') {
         //已出库不允许进行出库办理
         if( this.tableModel=='ingOut' ){
-          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_096')}));
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_103')}));
+          return false;
+        }
+      }
+      //编辑
+      if (rows && rows[0] && btnName === 'edit') {
+        //已出库不允许进行编辑
+        if( this.tableModel=='ingOut' ){
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_104')}));
           return false;
         }
       }