yusheng hace 1 año
padre
commit
1452fa55e6

+ 11 - 0
src/api/pro/index.js

@@ -11,3 +11,14 @@ export async function projectsPageAPI(data) {
     }
     return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 项目详情
+ * @id id
+ */
+export async function projectsGetByIdAPI(id) {
+    const res = await request.get(`/pro/projects/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }

+ 1 - 1
src/views/contractManage/contractBook/index.vue

@@ -427,7 +427,7 @@ export default {
     async getTreeData() {
       try {
         this.treeLoading = true;
-        const res = await contactTypeTree({ id: '17' });
+        const res = await contactTypeTree({ id: '20' });
         this.treeLoading = false;
         if (res?.code === '0') {
           this.treeList = res.data;

+ 4 - 1
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -28,6 +28,7 @@
               clearable
               v-model="form.projectName"
               @click.native="handleProjectBtn"
+              @clear="clearContrcat"
               placeholder="请选择"
             />
           </el-form-item>
@@ -422,7 +423,8 @@ export default {
       contractId: '',
       orderFiles: [],
       contractName: '',
-      // deliveryDate: '',
+      projectName:'',
+      projectId:'',
       pricingWay: 1,
       payAmount: '',
       generatePurchase: 0,
@@ -830,6 +832,7 @@ export default {
         orderFiles,
         remark
       });
+      this.projectData={}
 
       this.$store.commit('order/setContractId', '');
       this.$store.commit('order/setAllcountAmount', 0);

+ 18 - 0
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -251,6 +251,7 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import { carBookPageListAPI } from '@/api/transportManager/carBook';
   import modalTitle from '@/BIZComponents/modalTitle.vue';
+  import { projectsGetByIdAPI } from '@/api/pro';
 
   export default {
     mixins: [dictMixins],
@@ -425,6 +426,9 @@
             this.$refs.taskInfoTableRef &&
               this.$refs.taskInfoTableRef.putTableValue(trakNoteList);
             this.setAddress();
+            if (projectId) {
+              this.getProjectData(projectId);
+            }
           });
         }
       },
@@ -434,7 +438,21 @@
           this.form.receiveAddress
         );
       },
+      async getProjectData(id) {
+        const data = await projectsGetByIdAPI(id);
+        if (data.contactAddressId) {
+          this.form.receiveAddress =
+            data.contactAddressName + data.contactAddress;
+          this.setAddress();
+        }
 
+        if (data.contactRelationPhone) {
+          this.form.linkPhone = data.contactRelationPhone;
+        }
+        if(data.contactRelationUserName){
+          this.form.linkName=data.contactRelationUserName
+        }
+      },
       //发货单详情
       async getSendSaleOrderDetail(id) {
         this.businessId = id;