Ver Fonte

整单关闭后,,单据不能再做其他操作(编辑,提交,删除,退回)等等

002390 há 1 ano atrás
pai
commit
59d413c664

+ 4 - 0
src/views/purchase/purchase-order/add/index.vue

@@ -127,6 +127,10 @@ export default {
               this.params[key].forEach((v) => {
                 v.id = "";
                 v.demandCode = "";
+                v['isInvoice'] && (v['isInvoice'] = 'N');
+                v['isStorage'] && (v['isStorage'] = 'N');
+                v['isArrival'] && (v['isArrival'] = 'N');
+                v['isPayment'] && (v['isPayment'] = 'N');
               });
 
             }

+ 7 - 18
src/views/purchase/purchase-order/column.js

@@ -11,8 +11,6 @@ export const TableColumns = [
     item:{ 
       key: "billType",
       title: "订单类型",
-      // inputType: "Select",
-      // referName: "sys_order_type",
     },
     attr:{
       isHidden:true,
@@ -20,7 +18,13 @@ export const TableColumns = [
       dictName: "sys_order_type",
     },
   },
-  { item:{key: "code", title: "订单编号",  inputType: "Input",width:150, },
+  { 
+    item:{
+      key: "code", 
+      title: "订单编号", 
+      inputType: "Input",
+      width:150, 
+    },
     attr:{
       isHidden:true,
     },
@@ -30,8 +34,6 @@ export const TableColumns = [
       key: "status",
       title: "单据状态",
       width:80,
-      // inputType: "Select",
-      // referName: "documents_status", // 字典名
     },
     attr:{
       is: "el-dict-tag",
@@ -58,8 +60,6 @@ export const TableColumns = [
     item:{
       key: "source",
       title: "订单来源",  
-      // inputType: "Select",
-      // referName: "order_source", // 字典名
       width:80,
     },
     attr:{
@@ -96,7 +96,6 @@ export const TableColumns = [
     item:{
       key: "isArrival",
       title: "到货超期",
-      // inputType: 'Checkbox',
       width:80,
     },
     attr:{
@@ -110,7 +109,6 @@ export const TableColumns = [
   {
     item:{key: "isBack",
     title: "退货",
-    // inputType: 'Checkbox',
     width:80,},
     attr:{
       is: "el-checkbox",
@@ -160,7 +158,6 @@ export const TableColumns = [
   {
     item:{key: "isInvoice",
     title: "发票标识",
-    // inputType: 'Checkbox',
     width:80,},
     attr:{
       is: "el-checkbox",
@@ -313,7 +310,6 @@ export const TableColumns = [
   {
     item:{key: "isSendWms",
     title: "已同步WMS",
-    // inputType: 'Checkbox',
     width:120,},
     attr:{
       is: "el-checkbox",
@@ -340,7 +336,6 @@ export const TableColumns = [
 },
   { item:{
       key: "isEnd", title: "整单关闭标识" ,
-      // inputType: "Checkbox",
     },
   attr:{
     is: "el-checkbox",
@@ -679,8 +674,6 @@ export const TabColumns = [
           
           key: "storageCondition",
           title: "存储条件",
-          // inputType: "Select",
-          // referName: "sys_storage_condition", // 字典名
         },
         attr:{
           is: "el-dict-tag",
@@ -692,8 +685,6 @@ export const TabColumns = [
           
           key: "carriageCondition",
           title: "运输条件",
-          // inputType: "Select",
-          // referName: "sys_conditions_carriage", // 字典名
         },
         attr:{
           is: "el-dict-tag",
@@ -794,8 +785,6 @@ export const TabColumns = [
           
           key: "priceType",
           title: "价格类型",
-          // inputType: "Select",
-          // referName: "sys_price_type", // 字典名
         },
         attr:{
           is: "el-dict-tag",

+ 34 - 10
src/views/purchase/purchase-order/index.vue

@@ -270,7 +270,7 @@ export default {
     // 批量提交
     handleBatchSubmit(){
 
-      let inconformity = this.checkedList.filter(row => !(row.status == '0' || row.status == '3'));
+      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3') && row.isEnd === 'N'));
 
       if(!inconformity.length && this.checkedList.length){
 
@@ -318,7 +318,10 @@ export default {
       if (this.checkedList.length == 1) {
 
         // 非手工、状态:自由/驳回
-        if (this.checkedList[0].source != 3 && (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)) {
+        if (this.judgeIsOption('return',this.checkedList[0])) {
+        // if (this.checkedList[0].source != 3 &&
+        //     (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)
+        //  ) {
 
           return false
         }
@@ -337,8 +340,9 @@ export default {
       if (this.checkedTabList.length == 1) {
 
         // 主信息:非手工、状态:自由/驳回
-        if(this.primaryResource.source != 3 && 
-          (this.primaryResource.status == 0 || this.primaryResource.status == 3) ){
+        if(this.judgeIsOption('return',this.primaryResource)){
+        // if(this.primaryResource.source != 3 && 
+        //   (this.primaryResource.status == 0 || this.primaryResource.status == 3) ){
 
           return false
         }
@@ -397,7 +401,8 @@ export default {
 
       if (this.checkedList.length == 1) {
 
-        if (this.checkedList[0].status == 0) {
+        // if (this.checkedList[0].status == 0) {
+        if (this.judgeIsOption('allClose',this.checkedList[0])) {
           // 未审批状态下整单关闭
           return false
         }
@@ -502,6 +507,25 @@ export default {
         return '';
 
       }
+    },
+    judgeIsOption(type,source){
+      switch(type){
+        case 'edit':
+          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+        case 'revise':
+            return source.status == '2' && source.isEnd === 'N';
+        case 'del':
+          return (source.status == '0' || source.status == '3') && source.source == '3' && source.isEnd === 'N';
+        case 'submit':
+          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+        case 'allClose':
+          return source.status == 0 && source.isEnd === 'N';
+        case 'return':
+          return source.source != 3 && source.isEnd === 'N' &&
+                (source.status == 0 || source.status == 3);
+        default:
+         return false;
+      }
     }
   }
 };
@@ -510,7 +534,7 @@ export default {
 <template>
   <el-card 
     v-loading="loading" 
-    style="width: calc(100% - 24px); height: 100%; margin: 10px" 
+    style="width: calc(100% - 24px); height: 100%; margin: 10px;padding: 10px;" 
     :body-style="{ padding: 0 }"
   >
     <SeeDrawer ref="seeDrawerRef"></SeeDrawer>
@@ -575,7 +599,7 @@ export default {
           <template slot-scope="scope">
           <!-- <template #operation="{scope}"> -->
             <el-button 
-              v-if="scope.row.status == '2'"
+              v-if="judgeIsOption('revise',scope.row)"
               type="text" 
               size="small" 
               @click.stop="handleOpenEditDrawer(scope.row)"
@@ -583,7 +607,7 @@ export default {
             修订
             </el-button>
             <el-button 
-              v-if="scope.row.status == '0' || scope.row.status == '3'"
+              v-if="judgeIsOption('edit',scope.row)"
               type="text" 
               size="small" 
               @click.stop="handleOpenEditDrawer(scope.row)"
@@ -592,14 +616,14 @@ export default {
             </el-button>
             <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中-->
             <el-button 
-              v-if="(scope.row.status == '0' || scope.row.status == '3') && scope.row.source == '3'" 
+              v-if="judgeIsOption('del',scope.row)" 
               type="text" 
               size="small" 
               @click.stop="handleDeleteList(scope.row)"
               v-hasPermi="['material:order:remove']"
             >删除</el-button>
             <el-button 
-              v-if="scope.row.status == '0' || scope.row.status == '3'" 
+              v-if="judgeIsOption('submit',scope.row)" 
               type="text" 
               size="mini"
               v-hasPermi="['material:order:toOa']"