Procházet zdrojové kódy

1.新增行退回功能
2.发票标识,已同步WMS,紧急程度,最终关闭,最终关闭日期字段的值都是回显传的,应控制成只读,不允许编辑
3.业务人员参照需要显示编码

002390 před 2 roky
rodič
revize
fc0e75f082

+ 8 - 8
src/components/popover-select/components/PSNLICENSE_PARAM.js

@@ -1,18 +1,18 @@
 // 人员证照参照
 export default [
-  {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
   // {
-  //   key: "code",
-  //   title: "编码",
+  //   key: "id",
+  //   title: "ID",
   //   type: "Input",
   //   search: true,
   // },
   {
+    key: "code",
+    title: "编码",
+    type: "Input",
+    search: true,
+  },
+  {
     key: "name",
     title: "名称",
     type: "Input",

+ 29 - 4
src/views/purchase/purchase-order/add/column.js

@@ -191,7 +191,13 @@ export const Columns = [
     width: 200,
   },
   // { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
-  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", isShow:true,},
+  { 
+    key: "isInvoice", 
+    title: "发票标识", 
+    inputType: "Checkbox", 
+    isShow:true,
+    disabled:true,
+  },
   { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
   { 
     key: "rebateMoney", 
@@ -277,8 +283,20 @@ export const Columns = [
     }),
     width: 200,
   },
-  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox",isShow:true, },
-  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox",isShow:true, },
+  { 
+    key: "isUrgency", 
+    title: "紧急程度", 
+    inputType: "Checkbox",
+    isShow:true,
+    disabled:true,
+   },
+  { 
+    key: "isSendWms", 
+    title: "已同步WMS", 
+    inputType: "Checkbox",
+    isShow:true,
+    disabled:true,
+   },
   // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
   {
     key: "agentName",
@@ -294,13 +312,20 @@ export const Columns = [
     queryParams: () => ({}),
     width: 200,
   },
-  { key: "isClose", title: "最终关闭", inputType: "Checkbox", isShow:true, },
+  { 
+    key: "isClose", 
+    title: "最终关闭", 
+    inputType: "Checkbox", 
+    isShow:true,
+    disabled:true,
+   },
   {
     key: "closeTime",
     title: "最终关闭日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     isShow:true,
+    disabled:true,
   },
   { 
     key: "applyPaymentMoney", 

+ 140 - 70
src/views/purchase/purchase-order/index.vue

@@ -38,6 +38,10 @@ export default {
         puOrderExecuteList: [],
       },
       checkedList: [],
+      // 子表Select
+      checkedTabList: [],
+      // 主表点击信息
+      primaryResource:{},
     };
   },
   computed: {
@@ -134,6 +138,8 @@ export default {
     // 获取子表信息
     async handleDetailsData(row) {
       try {
+        this.primaryResource = row;
+        this.checkedTabList = [];
         const { code, msg, data } = await orderApi.details(row.id);
         if (code === 200) {
           // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
@@ -186,30 +192,6 @@ export default {
           }
         })
 
-        // this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
-        //   confirmButtonText: '确定',
-        //   cancelButtonText: '取消',
-        //   type: 'warning'
-        // }).then( async() => {
-
-        //   const { id } = row;
-
-        //   const { code } = await orderApi.remove(id);
-          
-        //   if (code === 200) {
-
-        //     this.fetchList(this.params, this.page);
-
-        //   }
-
-        // }).catch(() => {
-
-        //   this.$message({
-        //     type: 'info',
-        //     message: '已取消删除'
-        //   });          
-        // });
-        
       } catch (err) {
         //
       } finally {
@@ -236,11 +218,11 @@ export default {
       } finally {
       }
     },
-    // 判断“退回”按钮
-    judgeIsAllSendBack() {
+    // 判断“整单退回”按钮
+    judgeIsAllReturn() {
       if (this.checkedList.length == 1) {
 
-        // 非手工、状态非审批通过  
+        // 非手工、状态:自由/驳回
         if (this.checkedList[0].source != 3 && (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)) {
 
           return false
@@ -249,8 +231,62 @@ export default {
       return true;
     },
     //  整单退回
-    handleAllSendBack() {
+    handleAllReturn() {
+
+      this.handleReturn(this.checkedList[0].id,[]);
+      // this.$prompt('请输入退回原因', '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonText: '取消',
+      //     inputPattern: /\s*\S+?/,
+      //     inputErrorMessage: '退回原因不能为空'
+      //   }).then(async ({ value }) => {
+
+      //     let data = {
+      //       id: this.checkedList[0].id,
+      //       documentIds: [],
+      //       baskCause: value,
+      //     };
+
+      //     console.log(data);
+
+      //     try {
+
+      //       let { code, msg } = await orderApi.documentsReturn(data);
+
+      //       if (code === 200) {
+
+      //         this.fetchList(this.params, this.page);
+
+      //       }
+      //     } catch (error) {
+      //       console.log(error,'error------------');
+      //     }
+      //   }).catch(() => {   });
+      
+    },
+     // 判断“行退回”按钮
+     judgeIsLineReturn() {
+
+      if (this.checkedTabList.length == 1) {
+
+        // 主信息:非手工、状态:自由/驳回
+        if(this.primaryResource.source != 3 && 
+          (this.primaryResource.status == 0 || this.primaryResource.status == 3) ){
+
+          return false
+        }
 
+      }
+      return true;
+    },
+    // 行退回
+    handleLineReturn(){
+      let ids = this.checkedTabList.map(checked => checked.id);
+      console.log(ids,'行退回ids');
+      this.handleReturn(this.primaryResource.id,ids);
+    },
+    // 退回接口
+    handleReturn(id,documentIds){
       this.$prompt('请输入退回原因', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -259,8 +295,8 @@ export default {
         }).then(async ({ value }) => {
 
           let data = {
-            id: this.checkedList[0].id,
-            documentIds: [],
+            id,
+            documentIds,
             baskCause: value,
           };
 
@@ -274,12 +310,17 @@ export default {
 
               this.fetchList(this.params, this.page);
 
+              this.checkedList = [];
+              
+              this.checkedTabList = [];
+
+              this.primaryResource = {};
+
             }
           } catch (error) {
             console.log(error,'error------------');
           }
         }).catch(() => {   });
-      
     },
     // 判断是否满足整单关闭
     judgeIsAllClose() {
@@ -341,6 +382,7 @@ export default {
       }
       
     },
+    // 主表Select框
     handleSelect(selection, row) {
 
       this.checkedList = selection;
@@ -348,6 +390,13 @@ export default {
       console.log(this.checkedList, 'this.checkedList');
 
     },
+    // 子表Select框
+    handleTabSelect(selection, row){
+
+      this.checkedTabList = selection;
+
+      console.log(this.checkedTabList, 'this.checkedTabList');
+    },
   }
 };
 </script>
@@ -477,7 +526,7 @@ export default {
         </el-button-group>
 
         <el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
-          <el-button size="mini" @click="handleAllSendBack" :disabled="judgeIsAllSendBack()">整单退回</el-button>
+          <el-button size="mini" @click="handleAllReturn" :disabled="judgeIsAllReturn()">整单退回</el-button>
           <el-button size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button>
         </el-button-group>
 
@@ -501,7 +550,7 @@ export default {
       height="450"
       style="width: 100%; margin: 20px 0 0 0"
     >
-      <el-table-column type="selection" width="45"></el-table-column>
+      <el-table-column type="selection" width="45" ></el-table-column>
       <el-table-column type="index" width="50" label="序号"></el-table-column>
       <el-table-column 
         v-for="(column, index) in tableColumns" 
@@ -574,43 +623,64 @@ export default {
       :limit.sync="page.pageSize"
       @pagination="fetchList(params, page)"
     />
-
-    <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
-      <el-tab-pane 
-        v-for="(column, index) in tabColumns" 
-        :key="index" 
-        :label="column.title" 
-        :name="column.key"
-      >
-        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
-          :height="tabTableDatas[column.key].length ? 300 : 100">
-          <el-table-column type="index" width="50" label="序号"></el-table-column>
-          <el-table-column 
-            v-for="(cColumn, cIndex)  in column.tableColumns" 
-            :key="cIndex" 
-            :prop="cColumn.key"
-            :label="cColumn.title" 
-            :width="cColumn.width || 180"
-            :show-overflow-tooltip="cColumn.showOverflowTooltip || true"
+   
+    <div style="position: relative; padding-top: 10px;">
+      <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
+        <el-button 
+          size="mini" 
+          @click="handleLineReturn"
+          :disabled="judgeIsLineReturn()"
+        >行退回</el-button>
+      </el-row>
+      <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
+       
+        <el-tab-pane 
+          v-for="(column, index) in tabColumns" 
+          :key="index" 
+          :label="column.title" 
+          :name="column.key"
+        >
+          <el-table 
+            :data="tabTableDatas[column.key]" 
+            style="width: 100%" 
+            highlight-current-row
+            :height="tabTableDatas[column.key].length ? 300 : 100"
+            @select="handleTabSelect"
           >
-            <template slot-scope="scope">
-              <dict-tag v-if="cColumn.referName" 
-                size="small" 
-                :value="scope.row[cColumn.key]"
-                :options="dict.type[cColumn.referName]"
-               />
-              <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'" 
-                v-model="scope.row[cColumn.key]"
-                disabled
-                true-label="Y" 
-                false-label="N"
-              ></el-checkbox>
-              <span v-else>{{ scope.row[cColumn.key] }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-      </el-tab-pane>
-    </el-tabs>
-
+            <el-table-column
+              v-if=" tabName === 'puOrderItemList'" 
+              type="selection" 
+              width="45"
+            ></el-table-column>
+            <el-table-column type="index" width="50" label="序号"></el-table-column>
+            <el-table-column 
+              v-for="(cColumn, cIndex)  in column.tableColumns" 
+              :key="cIndex" 
+              :prop="cColumn.key"
+              :label="cColumn.title" 
+              :width="cColumn.width || 180"
+              :show-overflow-tooltip="cColumn.showOverflowTooltip || true"
+            >
+              <template slot-scope="scope">
+                <dict-tag v-if="cColumn.referName" 
+                  size="small" 
+                  :value="scope.row[cColumn.key]"
+                  :options="dict.type[cColumn.referName]"
+                 />
+                <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'" 
+                  v-model="scope.row[cColumn.key]"
+                  disabled
+                  true-label="Y" 
+                  false-label="N"
+                ></el-checkbox>
+                <span v-else>{{ scope.row[cColumn.key] }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        
+      </el-tabs>
+      
+    </div>
   </el-card>
 </template>