Browse Source

1.采购合同字段必填,明细增加流程跳转
2.订单维护:编辑情况下不论单据类型都可修改数量,进行删行
3.订单维护列表页面导出功能
4.订单维护:加上oa需求单号字段

002390 1 year ago
parent
commit
82b010a839

+ 7 - 0
src/api/business/purchase/contract.js

@@ -100,6 +100,13 @@ export function LINKAGREEMENT(data) {
   });
 }
 
+export const ToOA =(userName, fdId) => {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
+}
+
 const switchUrl = (prop) => {
   if (prop === "contractItemList") return "/pu/contract/item";
   if (prop === "contractClauseList") return "/pu/contract/clause";

+ 2 - 2
src/views/purchase/contract/add/columns.js

@@ -20,7 +20,7 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { key: "lastPuMoney", title: "年度采购额", width: 100 },
+      item: { key: "lastPuMoney", title: "年度采购额", width: 100 ,required: true,},
       attr: {
         is: "el-input-number",
       },
@@ -62,7 +62,7 @@ export default function useColumns() {
       attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
     },
     {
-      item: { key: "puMoneyYear", title: "合同总金额", width: 100 },
+      item: { key: "puMoneyYear", title: "合同总金额", width: 100 ,required: true,},
       attr: {
         is: "el-input-number",
       },

+ 2 - 2
src/views/purchase/contract/edit/columns.js

@@ -20,7 +20,7 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { key: "lastPuMoney", title: "年度采购额", width: 100 },
+      item: { key: "lastPuMoney", title: "年度采购额", width: 100 ,required: true,},
       attr: {
         is: "el-input-number",
       },
@@ -61,7 +61,7 @@ export default function useColumns() {
       attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
     },
     {
-      item: { key: "puMoneyYear", title: "合同总金额", width: 100 },
+      item: { key: "puMoneyYear", title: "合同总金额", width: 100,required: true, },
       attr: {
         is: "el-input-number",
       },

+ 22 - 1
src/views/purchase/contract/see/index.vue

@@ -1,6 +1,6 @@
 <script>
 import useColumns from "./columns";
-import { ITEM } from "@/api/business/purchase/contract";
+import { ITEM ,ToOA} from "@/api/business/purchase/contract";
 
 export default {
   name: "SeeFormModel",
@@ -80,6 +80,24 @@ export default {
     async hide() {
       this.$emit("close");
     },
+    async handleJump(){
+      console.log(this.params,'params');
+      const {name} = this.$store.state.user;
+
+      try {
+
+        let {code,msg,oaUrl} = await orderApi.ToOA(name,this.params.flowId);
+
+        if(code == 200){
+          window.open(oaUrl);
+        }
+        
+      } catch (error) {
+        
+      }finally{
+
+      }
+    }
   },
   created() {
     this.open();
@@ -106,6 +124,9 @@ export default {
       <h4 class="m-0" style="font-weight: 500; flex: 1">
         {{ title.split("-")[0] }}
       </h4>
+      <el-button type="primary" :size="$attrs.size" :loading="loading" @click="handleJump">
+          流程跳转
+        </el-button>
       <!-- <el-button
         type="primary"
         :size="$attrs.size"

+ 7 - 6
src/views/purchase/purchase-order/add/column.js

@@ -21,12 +21,13 @@ export const Columns = [
     isShow:true,
     require: true,
   },
-  // { 
-  //   key: "oaDemandNo", 
-  //   title: "OA需求单号", 
-  //   inputType: "Input",  
-  //   isShow:true,
-  // },
+  { 
+    key: "oaDemandNo", 
+    title: "OA需求单号", 
+    inputType: "Input",  
+    isShow:true,
+    
+  },
   { 
     key: "erpOrderCode", 
     title: "erp订单编号", 

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

@@ -111,6 +111,7 @@ export default {
             isClose:'N',
             billDate: new Date().Format('yyyy-MM-dd'),
             closeTime:'',
+            oaDemandNo:'',
             isInvoice:'N',
             isSendWms:'N',
             rebateMoney:'',

+ 6 - 6
src/views/purchase/purchase-order/column.js

@@ -317,12 +317,12 @@ export const TableColumns = [
     width:150,
   },
   // { item:{key: "flowId", title: "OA流程ID" },
-  // { 
-  //   item:{ key: "oaDemandNo", title: "OA需求单号" ,},
-  //   attr:{
-  //     isHidden:true,
-  //   },
-  // },
+  { 
+    item:{ key: "oaDemandNo", title: "OA需求单号" ,},
+    attr:{
+      isHidden:true,
+    },
+  },
   { 
     item:{
       key: "erpOrderCode", 

+ 25 - 11
src/views/purchase/purchase-order/edit/index.vue

@@ -156,18 +156,32 @@ export default {
     },
     // 删除行
     async delTableRow(prop, index) {
-      // prop.splice(index, 1);
-      for (const key in this.params) {
-
-        // if (Array.isArray(this.params[key])) {
-        if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-
-          this.params[key][index].id ? (this.params[key][index]['delFlag'] = '2') :this.params[key].splice(index, 1);
-
+      console.log(prop,'prop');
+      if(prop.length === 1){
+        this.$alert('订单行不允许为空', '提示', {
+          confirmButtonText: '确定',
+          callback: action => {
+            // this.$message({
+            //   type: 'info',
+            //   message: `action: ${ action }`
+            // });
+          }
+        });
+      }else{
+
+        // prop.splice(index, 1);
+        for (const key in this.params) {
+  
+          // if (Array.isArray(this.params[key])) {
+          if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+  
+            this.params[key][index].id ? (this.params[key][index]['delFlag'] = '2') :this.params[key].splice(index, 1);
+  
+          }
         }
+  
+        await this.handleGetPrice();
       }
-
-      await this.handleGetPrice();
     },
     // 取消
     handleCancel() {
@@ -728,7 +742,7 @@ export default {
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
                   <el-button 
-                    v-if="params.source == '3' && !handleIsRevise()" 
+                    v-if="!handleIsRevise()" 
                     @click.native.prevent="delTableRow(params[tabName], scope.$index)" 
                     type="text" 
                     size="small"

+ 2 - 1
src/views/purchase/purchase-order/edit/initColumn.js

@@ -39,7 +39,8 @@ export const forbidden = (isEdit,source) => {
 
         tab.tableColumns.forEach(cColumn => {
 
-          if(cColumn.key === 'materialName' || cColumn.key === 'qty'){
+          // || cColumn.key === 'qty'
+          if(cColumn.key === 'materialName' ){
 
             cColumn.disabled = true;
 

+ 5 - 4
src/views/purchase/purchase-order/index.vue

@@ -97,8 +97,9 @@ export default {
       }
     },
 
-    handleDownload(){
-
+    async handleDownload(){
+      console.log(this.params,'条件');
+      this.download('/pu/order/export', this.params, `采购订单维护${new Date().getTime()}.xlsx`);
     },
     async jumpFlow(row){
       const {name} = this.$store.state.user;
@@ -646,11 +647,11 @@ export default {
             @click="handlePurchaseReturn"
           >采购退货</el-button> -->
           <el-button type="primary" size="mini" @click="handlePaymentRequest">付款申请</el-button>
-          <!-- <el-button 
+          <el-button 
             type="primary" 
             size="mini" 
             @click="handleDownload" 
-          >批量导出</el-button> -->
+          >批量导出</el-button>
         </el-button-group>
         
 

+ 2 - 0
src/views/purchase/task/see/index.vue

@@ -66,6 +66,7 @@ export default {
     async hide() {
       this.visible = false;
     },
+   
   },
   created() {},
   mounted() {},
@@ -89,6 +90,7 @@ export default {
     >
       <template slot="title">
         <span>{{ title }}</span>
+        
         <el-button :size="$attrs.size" :loading="loading" @click="hide">
           取 消
         </el-button>