Pārlūkot izejas kodu

前端复制当前合同

gjy 3 gadi atpakaļ
vecāks
revīzija
59880dfce4

+ 73 - 5
src/views/contractManagement/purchaseContractAdd.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="container">
     <el-row>
-      <el-col :span="12">
+      <el-col :span="12"  class="bg">
         <h2 class="bg-left title">创建采购合同</h2>
       </el-col>
-      <el-col :span="12" class="bg-right">
+      <el-col :span="12" class="bg-right bg">
         <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
             style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
         </el-button>
@@ -13,9 +13,22 @@
     <ws-form ref="deptBudgetList" :rules="rules" :model="deptBudgetList">
       <div class="remark">
         <h3>基本信息</h3>
+        <el-row>
+      <el-col :span="12">
         <p style="color: #8890b1">
           注:基本信息和货物信息均为必填项,“<span style="color:red">*</span>” 标记的条目提交后不可修改。
         </p>
+        </el-col>
+      <el-col :span="12" style='text-align:right;'>
+        <el-select v-model="contractNo" placeholder="请选择要复制的合同" class="typeselect" filterable clearable
+              @change="copySelect">
+              <el-option v-for="(item,index) in outContractNo" :key="'hetong'+index" :label="item.contractNo"
+                :value="item.contractNo" />
+            </el-select>
+            <el-button class="bg-bottom" type="primary" size="small" @click="cancelcopy()">取消复制
+        </el-button>
+         </el-col>
+    </el-row>
       </div>
       <ws-info-table>
         <!--合同类型-->
@@ -395,10 +408,11 @@
     delxiala,
     getstafffind,
     getRelationContractNo,
-    getcustomerinfo
+    getcustomerinfo,
+    examineList
   } from '@/model/contarct/index'
   import {
-    getstaff,
+    getstaff,xialaNo,
   } from '@/model/warehouse/index'
   import {
     regionData,
@@ -442,6 +456,7 @@ import { isUndefined } from 'xe-utils/methods'
         dialogApproveFormVisible: false,
         // 船舶类型
         monetaryKey: null,
+        contractNo:'',
         // 表格显示数据
         tableDate: [],
         // 是否显示
@@ -574,6 +589,50 @@ import { isUndefined } from 'xe-utils/methods'
           this.deptBudgetList.deliverType = '1'
         }
       },
+      copySelect(e){
+        for (let i = 0; i < this.outContractNo.length; i++) {
+          if(this.outContractNo[i].contractNo==e){
+            examineList({
+            id: this.outContractNo[i].id
+          })
+          .toPromise()
+          .then((response) => {
+            this.deptBudgetList = response
+            if(this.deptBudgetList.personPhone){
+              this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.split(',')
+            }
+            
+            if (this.deptBudgetList.deliverType == 1) {
+              this.deptBudgetList.deliverType1 = '我方自提'
+            } else if (this.deptBudgetList.deliverType == 2) {
+              this.deptBudgetList.deliverType1 = '对方送货'
+            }
+          })
+          }
+          
+        }
+      },
+      cancelcopy(){
+        this.contractNo=''
+        this.deptBudgetList={
+          deliverType: '1',
+          sourceGoods:'',
+          placeDelivery:'',
+          agreementType: '采购合同',
+          addressUrl: '',
+          sellerPhone:'',
+          personPhone:'',
+          personCharge:'',
+          personChargeKey:'',
+          finalTradingVolume: 0,
+          totalContractPrice: 0,
+          contractGoodsInfo: {
+            goodsName: '',
+          },
+          contractProcessInfo: {},
+          settlementWeightMethod: '1',
+        }
+      },
       feedbackLeaderChange(e){
          this.deptBudgetList.feedbackLeaderPhone = ""
         for(var num = 0 ; num < e.length ; num++){
@@ -758,6 +817,15 @@ import { isUndefined } from 'xe-utils/methods'
         })
       },
       loaddata() {
+        // 合同编号
+        xialaNo({
+            compId: localStorage.getItem('ws-pf_compId'),
+            flag: 0,
+          })
+          .toPromise()
+          .then((response) => {
+            this.outContractNo = response
+          })
         // 包装方式
         packList({
             constId: 'CON1'
@@ -1721,7 +1789,7 @@ import { isUndefined } from 'xe-utils/methods'
     border-color: #5878e8;
   }
 
-  .el-col {
+  .bg {
     background: #f6f7fc;
   }
 

+ 74 - 10
src/views/contractManagement/salesContractAdd.vue

@@ -2,9 +2,9 @@
   <div class="container">
     <el-row>
       <el-col :span="12">
-        <h2 class="bg-left title">创建销售合同</h2>
+        <h2 class="bg-left title bg">创建销售合同</h2>
       </el-col>
-      <el-col :span="12" class="bg-right">
+      <el-col :span="12" class="bg-right bg">
         <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
             style="vertion-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
         </el-button>
@@ -14,10 +14,22 @@
       <ws-form ref="deptBudgetList" :model="deptBudgetList">
         <div class="remark">
           <h3>基本信息</h3>
-          <p style="color: #8890b1">
-            &nbsp;&nbsp;注:基本信息均为必填项,“<span style="color:red">*</span>”
-            标记的条目提交后不可修改。
-          </p>
+           <el-row>
+      <el-col :span="12">
+        <p style="color: #8890b1">
+          注:基本信息和货物信息均为必填项,“<span style="color:red">*</span>” 标记的条目提交后不可修改。
+        </p>
+        </el-col>
+      <el-col :span="12" style='text-align:right;'>
+        <el-select v-model="contractNo" placeholder="请选择要复制的合同" class="typeselect" filterable clearable
+              @change="copySelect">
+              <el-option v-for="(item,index) in outContractNo" :key="'hetong'+index" :label="item.contractNo"
+                :value="item.contractNo" />
+            </el-select>
+            <el-button class="bg-bottom" type="primary" size="small" @click="cancelcopy()">取消复制
+        </el-button>
+         </el-col>
+    </el-row>
         </div>
         <!--基本信息-->
         <ws-info-table>
@@ -385,10 +397,11 @@
     editxiala,
     delxiala,
     getRelationContractNo,
-     getcustomerinfo
+     getcustomerinfo,
+     examineList,
   } from '@/model/contarct/index'
-   import {
-    getstaff,
+  import {
+    getstaff,xialaNo,
   } from '@/model/warehouse/index'
   import WsUpload from '@/components/WsUpload'
   import {
@@ -421,6 +434,7 @@
         customerinfo:[],
         //弹出框
         dialogViewSpareMoney: false,
+        contractNo:'',
         dialogApproveFormVisible: false,
         // 船舶类型
         monetaryKey: null,
@@ -454,6 +468,7 @@
         goodnameList: [],
         gradeList: [],
         ChapterTwoList: [],
+        outContractNo:[],
         deptBudgetList: {
           deliverType: '1',
           agreementType: '销售合同',
@@ -524,6 +539,47 @@
       if (!this.restaurants4) this.restaurants4 = [];
     },
     methods: {
+      copySelect(e){
+        for (let i = 0; i < this.outContractNo.length; i++) {
+          if(this.outContractNo[i].contractNo==e){
+            examineList({
+            id: this.outContractNo[i].id
+          })
+          .toPromise()
+          .then((response) => {
+            this.deptBudgetList = response
+            if(this.deptBudgetList.personPhone){
+              this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.split(',')
+            }
+            
+            if (this.deptBudgetList.deliverType == 1) {
+              this.deptBudgetList.deliverType1 = '我方自提'
+            } else if (this.deptBudgetList.deliverType == 2) {
+              this.deptBudgetList.deliverType1 = '对方送货'
+            }
+          })
+          }
+          
+        }
+      },
+      cancelcopy(){
+        this.contractNo=''
+        this.deptBudgetList={
+          deliverType: '1',
+          agreementType: '销售合同',
+          finalTradingVolume: 0,
+          totalContractPrice: 0,
+          contractGoodsInfo: {
+            goodsName: '',
+          },
+          buyerPhone:'',
+          contractProcessInfo: {},
+          addressUrl: '',
+          sourceGoods: '',
+          placeDelivery: '',
+          settlementWeightMethod: '1',
+        }
+      },
       feedbackLeaderChange(e){
         this.deptBudgetList.feedbackLeader = this.feedbackLeaders[e].staffName
         this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[e].staffMobilePhone
@@ -632,6 +688,14 @@
         })
       },
       loaddata() {
+        xialaNo({
+            compId: localStorage.getItem('ws-pf_compId'),
+            flag: 1,
+          })
+          .toPromise()
+          .then((response) => {
+            this.outContractNo = response
+          })
         // 包装方式
         packList({
             constId: 'CON1',
@@ -1616,7 +1680,7 @@
     margin-top: 10px;
   }
 
-  .el-col {
+  .bg {
     background: #f6f7fc;
   }