Selaa lähdekoodia

采购合同、补充协议修改

zxz 3 vuotta sitten
vanhempi
commit
4b9b97ed11

+ 2 - 0
src/api/V2/contract/index.js

@@ -18,6 +18,8 @@ export const API_POST_EXPORT = '/contractManagementInfo/export'
 export const API_GET_BILL_OPERATE_HIS = '/billOperateHis/query/commonBillOperateHis'
 // 修改状态
 export const API_POST_EDITSTATUS = '/contractManagementInfo/editStatus'
+// 补充协议查看关联合同
+export const API_GET_RELATION_CONTRACTNO = '/contractManagementInfo/selectContract'
 //删除销售合同
 export const API_POST_CONTRACT_DELETE = '/contractManagementInfo/deleteInfo '
 //销售合同修改编辑 

+ 3 - 0
src/model/contarct/index.js

@@ -14,6 +14,7 @@ import {
     API_POST_EDITSTATUS,
     API_GET_CONTRACT_MANAGEMENTINFO,
     API_POST_EDITINFO,
+    API_GET_RELATION_CONTRACTNO,
     API_POST_CONTRACT_DELETE,
     API_GET_TRAN_TASK_WAREHOUSE,
     API_GET_SELECTCONFIRMATIONSHEET,
@@ -43,6 +44,8 @@ export const export1 = appRx.get(API_POST_EXPORT)
 export const billoperatehis = appRx.get(API_GET_BILL_OPERATE_HIS, errorCatcher, errorHandle, filter)
 // 修改状态
 export const editstatus = appRx.post(API_POST_EDITSTATUS, errorCatcher, errorHandle, filter)
+// 补充协议查看关联合同
+export const getRelationContractNo = appRx.get(API_GET_RELATION_CONTRACTNO, errorCatcher, errorHandle, filter)
 //删除销售合同
 export const deletecontract = appRx.post(API_POST_CONTRACT_DELETE, errorCatcher, errorHandle, filter)
 //修改销售合同编辑

+ 95 - 8
src/views/contractManagement/purchaseContractAdd.vue

@@ -28,10 +28,31 @@
         </p>
       </div>
       <ws-info-table>
+        <!--合同类型-->
+        <ws-form-item
+          label="合同类型"
+          span="1"
+          prop="agreementType"
+        >
+          <ws-select
+            v-model="deptBudgetList.agreementType"
+            placeholder
+            class="deal"
+            @change="selectType"
+          >
+            <ws-option
+              v-for="item in agreementList"
+              :key="item.constKey"
+              :label="item.constValue"
+              :value="item.constValue"
+            />
+          </ws-select>
+        </ws-form-item>
         <!--合同编号-->
         <ws-form-item
           label="合同编号"
           span="1"
+          v-if="deptBudgetList.agreementType == '采购合同'"
           prop="contractNo"
           class="readonly"
           required
@@ -43,7 +64,40 @@
             size="small"
           />
         </ws-form-item>
-
+        <!--关联合同-->
+        <ws-form-item
+          prop="contractNo"
+          label="关联合同"
+          span="1"
+          v-if="deptBudgetList.agreementType == '补充协议'"
+        >
+          <ws-select
+            v-model="deptBudgetList.contractNo"
+            placeholder="请选择编号"
+            @change="selectRelation"
+          >
+            <ws-option
+              v-for="item in contractNoList"
+              :key="item.constKey"
+              :label="item.contractNo"
+              :value="item.contractNo"
+            ></ws-option>
+          </ws-select>
+        </ws-form-item>
+        <!--补充协议编号-->
+        <ws-form-item
+          v-show="deptBudgetList.agreementType == '补充协议'"
+          label="补充协议编号"
+          span="1"
+          prop="agreementNo"
+        >
+          <ws-input
+            v-model="deptBudgetList.agreementNo"
+            placeholder="请输入补充协议编号"
+            maxlength="100"
+            size="small"
+          />
+        </ws-form-item>
         <!--运输方式-->
         <ws-form-item label="运输方式" span="1" prop="shippingType">
           <ws-input
@@ -550,6 +604,7 @@ import {
   editxiala,
   delxiala,
   getstafffind,
+  getRelationContractNo
 } from '@/model/contarct/index'
 import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
 import { dayjs, fmoney, EventBus } from 'base-core-lib'
@@ -601,12 +656,23 @@ export default {
       appendixIdsAdd: '',
       size: 10,
       unitList: [],
+      agreementList: [
+        {
+          constValue: '采购合同',
+          constKey: '1'
+        },        
+        {
+          constValue: '补充协议',
+          constKey: '2'
+        },
+      ],
+      contractNoList: [],
       goodnameList: [],
       value1: '袋装',
       value2: '未回收',
       gradeList: [],
       ChapterTwoList: [],
-
+      agreementType:'',
       deptBudgetList: {
         deliverType: '1',
         addressUrl:'',
@@ -730,6 +796,19 @@ export default {
         .then((response) => {
           this.ChapterTwoList = response
         })
+      //关联合同
+      getRelationContractNo({
+        agreementType: '采购合同',
+        goodsType: 1
+      })
+        .toPromise()
+        .then((response) => {
+          this.contractNoList = response
+        })
+    },
+    selectRelation(e){
+        // this.deptBudgetList.agreementNo = e
+        this.$set(this.deptBudgetList,'agreementNo',e)
     },
     onChange() {
      this.$refs.upload
@@ -1360,6 +1439,14 @@ export default {
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()
     },
+    //选择合同类型
+    selectType(e) {
+      for (var i = 0; i < this.invoiceList.length; i++) {
+        if (this.agreementList[i].constValue == e) {
+          this.deptBudgetList.agreementType = this.agreementList[i].constValue
+        }
+      }
+    },
     addClick() {
       this.unitList.push({
         flag: 'add',
@@ -1596,7 +1683,7 @@ export default {
 .wenzi p {
   display: inline-block;
 }
-.upload-demo{
+.upload-demo {
   margin-top: 10px;
 }
 .center {
@@ -1707,10 +1794,10 @@ export default {
 }
 //上传文件成功标识
 /deep/.el-upload-list__item-status-label {
-    position: absolute;
-    right: 22px;
-    top: -1px;
-    line-height: inherit;
-    display: none;
+  position: absolute;
+  right: 22px;
+  top: -1px;
+  line-height: inherit;
+  display: none;
 }
 </style>