asd26269546 2 роки тому
батько
коміт
52ad7c697f

+ 4 - 6
src/libs/http.js

@@ -147,9 +147,7 @@ export function get(url, params = {}) {
         }
         axios.get(getUrl, {params:params})
             .then(response => {
-                setTimeout(() => {
-                }, 500)
-                resolve(response.data);
+                if(response) resolve(response.data);
             }, err => {
                 reject(err)
             })
@@ -176,9 +174,9 @@ export function post(url, data,params,headers) {
             headers:headers || null
         })
             .then(response => {
-                setTimeout(() => {
-                }, 500)
-                resolve(response.data);
+                
+                if(response) resolve(response.data);
+                
             }, err => {
                 reject(err)
             })

+ 31 - 32
src/view/base-manage/provider-maintenance/provider-maintenance2.vue

@@ -6,8 +6,8 @@
         <Poptip trigger="focus"  width="250" placement="bottom">
             <div slot="content">
               <ul style="" class="commons-select-search">
-                <li :key="i.id" v-for="i in supplierList" @click="params.keyword = i.name">
-                  {{i.name}}
+                <li :key="i.id" v-for="i in supplierList" @click="params.keyword = i.supplierName">
+                  {{i.supplierName}}
                 </li>
               </ul>
             </div>
@@ -1000,16 +1000,8 @@ export default {
                   },
                   on: {
                     click: () => {
-                      this.show = true
-                      this.$post('/api/storage-restructure/supplier/details',{id:params.row.id}).then(res=>{
-                        
-                        v.$set(v,'formData',res.data)
-                        
-                        console.log(this.formData)
-                        this.formType = 'form'
-                        this.title = '供应商详情'
-                        this.show = true
-                      })
+                      this.getDtl('form',params.row.id)
+                      
                       
                     }
                   }
@@ -1029,14 +1021,8 @@ export default {
                   },
                   on: {
                     click: () => {
+                      this.getDtl('edit',params.row.id)
                       
-                      this.$post('/api/storage-restructure/supplier/details',{id:params.row.id}).then(res=>{
-                        this.formData = res.data
-                        
-                        this.formType = 'edit'
-                        this.title = '修改'
-                        this.show = true
-                      })
                     }
                   }
                 },
@@ -1053,9 +1039,9 @@ export default {
                   on: {
                     click: () => {
                       this.$MyModal.show({ text: '是否删除?' }).$on('confirm', () => {
-                        axios.post('/cloudApi/supplier/delete',{id:params.row.id}).then(res=>{
-                          if (res.data.code == 200) {
-                            v.$Message.info(res.data.msg)
+                        this.$post('/api/storage-restructure/supplier/delete',{id:params.row.id}).then(res=>{
+                          if (res.code == 200) {
+                            v.$Message.info(res.msg)
                             v.getList()
                           }
                         })
@@ -1142,6 +1128,21 @@ export default {
     }
   },
   methods: {
+    getDtl(formType,id){
+      this.$post('/api/storage-restructure/supplier/details',{id:id}).then(res=>{    
+        this.formData = {...this.formData,...res.data}
+        this.formType = formType
+        this.title = '供应商详情'
+        this.show = true
+      })
+      this.$post('/api/storage-restructure/supplierContacts/details',{id:id}).then(res=>{    
+        this.formData = {...this.formData,...res.data}
+      })
+      this.$post('/api/storage-restructure/supplierBank/details',{id:id}).then(res=>{    
+        this.formData = {...this.formData,...res.data}
+      })
+      
+    },
     getSafetyWarnDayList(){
       const v = this
       this.$post('/api/storage-restructure/supplier/getSafetyWarnDay',{}).then(res=>{
@@ -1194,7 +1195,6 @@ export default {
 
         this.$post('/api/storage-restructure/supplier/add',formDataCopy).then(res=>{
           this.show = false
-          this.$Message.info(res.data.msg)
           if(res.code === 200){
             this.show = false
             this.$Message.info(res.msg)
@@ -1202,11 +1202,10 @@ export default {
           }
         })
       } else if (type === 'edit') {
-        
         this.$post('/api/storage-restructure/supplier/edit',formDataCopy).then(res=>{
-          this.show = false
-          this.$Message.info(res.data.msg)
+          this.$Message.info(res.msg)
           this.getList()
+          this.show = false
         })
         
       }
@@ -1302,13 +1301,13 @@ export default {
     getSupplierSelectList(req){
       const v = this
       v.loading = true
-      axios
-        .post('/cloudApi/supplier/selectList', {keyword:this.params.keyword})
-        .then((res) => {
-          v.supplierList = res.data.data
+      this.$post('/api/storage-restructure/supplier/page', {pageNum:1,pageSize:999})
+				.then((res) => {
+					this.supplierList = res.data.records
+          this.params.total = res.data.total
           v.loading = false
-          console.log(v.supplierList)
-        })
+				})  
+      
     },
     getStatisticsClassify(){
       this

+ 15 - 19
src/view/base-manage/provider-maintenance/purchaseList.vue

@@ -592,10 +592,11 @@ export default {
 				pageNum: 1,
 				pageSize: 10,
 				total: 0,
-				TechnologyType: null,
-				Purpose: null,
-				search: null,
-				PurposeIndex: null,
+				purpose: null,
+				keyword: null,
+				accountDate:null,
+				safetyWarnDay:null,
+				type:null,
 			},
 			statisticsClassifyData: [],
 			supplierList: [],
@@ -734,21 +735,16 @@ export default {
 		},
 		getList() {
 			this.$Spin.show()
-			axios
-				.post('/cloudApi/supplier/purchase/list', {
-					...this.params,
-				})
-				.then((res) => {
-					this.$Spin.hide()
-					this.data = res.data.data
-				})
-			axios
-				.post('/cloudApi/supplier/list/count', {
-					...this.params,
-				})
-				.then((res) => {
-					this.params.total = res.data.data
-				})
+
+			this.$post("/api/storage-restructure/supplier/pagePurchase",{...this.params}).then(res=>{
+				this.$Spin.hide()
+				if(res.code == 200){
+					this.data = res.data.records
+					this.params.total = res.data.total
+				}
+				
+			})
+			
 		},
 	},
 	mounted() {

+ 1 - 2
src/view/material-manege/material-apply-detail/material-apply-detail.vue

@@ -1,4 +1,4 @@
-<!-- 供应商价格维护 -->
+<!-- 物料申购 -->
 <template>
   <div class="container">
     <div class="tab-nav">
@@ -303,7 +303,6 @@ export default {
       })
     },
     getData(num, name) {
-      console.log(this.typeList)
       if (this.typeList[num] && this.typeList[num][name]) {
         
         return this.typeList[num][name]

+ 1 - 1
vue.config.js

@@ -28,7 +28,7 @@ const BASE_URL = process.env.NODE_ENV === 'production'
 const ip = 'http://36.134.91.96:10001/api'
 //const ip = 'https://cfm.bytesail.cn/api'
 
-const ip2 = 'http://120.79.80.64:8050'
+const ip2 = 'http://120.79.80.64:80501111'
 module.exports = {
   devServer: {
     port: "8081", //代理端口