Kaynağa Gözat

供货商名称修改

shish 2 yıl önce
ebeveyn
işleme
90dcc10cc1

+ 4 - 0
ghsApp/src/api/ghs/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
+export const changeGhsName = data => {
+	return https.get('/ghs/modify-name', data)
+}
+
 /** *
 /** *
  * 供货商列表 姜枫 2021.04.01  ghs/add
  * 供货商列表 姜枫 2021.04.01  ghs/add
  */
  */

+ 58 - 17
ghsApp/src/pagesPurchase/supplier.vue

@@ -24,7 +24,7 @@
             >本地</view>
             >本地</view>
 
 
             <view class="store_name">
             <view class="store_name">
-              <view class="store_title">
+              <view class="store_title" @click.stop="nameModify(item)">
                 {{item.name}}
                 {{item.name}}
               </view>
               </view>
               <view class="accumulative"></view>
               <view class="accumulative"></view>
@@ -57,17 +57,34 @@
       </block>
       </block>
     </view>
     </view>
   </view>
   </view>
+
+		<modal-module :show="modifyGhsShow" @click="modifyConfirm" :maskClosable="true" title="修改名称" padding="30rpx 30rpx" >
+		<template v-slot:content>
+			<div class="app-modal-input-wrap">
+			<div class="inp-list-line">
+				<div class="line-input">
+				<input type="number" ref="input" style="width:90%;text-align:center;" v-model="modifyGhsName" :adjust-position="false" class="inp-input" />
+				</div>
+			</div>
+			</div>
+		</template>
+		</modal-module>
+
 </view>
 </view>
 </template>
 </template>
 <script>
 <script>
 import Tabs from "@/components/plugin/tabs";
 import Tabs from "@/components/plugin/tabs";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getList } from "@/api/ghs";
+import { getList,changeGhsName } from "@/api/ghs";
 import AppSearchModule from "@/components/module/app-search";
 import AppSearchModule from "@/components/module/app-search";
+import ModalModule from "@/components/plugin/modal"
 export default {
 export default {
-  components: { AppWrapperEmpty, AppSearchModule,Tabs },
+  components: { AppWrapperEmpty, AppSearchModule,Tabs,ModalModule },
   data () {
   data () {
     return {
     return {
+      modifyGhsId:0,
+      modifyGhsName:'',
+      modifyGhsShow:false,
       list: {
       list: {
         data: []
         data: []
       },
       },
@@ -90,12 +107,13 @@ export default {
 					value: "0"
 					value: "0"
 				}
 				}
 			],
 			],
-      info:{}
+      info:{},
+      search:''
     }
     }
   },
   },
 	onShow(){
 	onShow(){
 		uni.removeStorageSync('newGhs')
 		uni.removeStorageSync('newGhs')
-		this.getGHSList('')
+		this.getGHSList()
 	},
 	},
   onPullDownRefresh() {
   onPullDownRefresh() {
     this.getGHSList().then(res => {
     this.getGHSList().then(res => {
@@ -103,6 +121,29 @@ export default {
     }) 
     }) 
   },
   },
   methods: {
   methods: {
+    modifyConfirm(val){
+			let that=this;
+			if (val.index == 0) {
+        this.modifyGhsId = 0
+        this.modifyGhsName = ''
+				this.modifyGhsShow = false
+				return
+			}
+      changeGhsName({id:this.modifyGhsId,name:this.modifyGhsName}).then(res=>{
+        if(res.code == 1){
+          that.$msg(res.msg)
+          that.modifyGhsId = 0
+          that.modifyGhsName = ''
+          that.modifyGhsShow = false
+          that.init()
+        }
+      })
+    },
+    nameModify(ghs){
+      this.modifyGhsId = ghs.id ? ghs.id : 0
+      this.modifyGhsName = ghs.name ? ghs.name : ''
+      this.modifyGhsShow = true
+    },
     cgList(item){
     cgList(item){
       if(item.location && item.location == 1){
       if(item.location && item.location == 1){
         this.pageTo({url:'/pagesPurchase/wcOrder?ghsId='+item.id})
         this.pageTo({url:'/pagesPurchase/wcOrder?ghsId='+item.id})
@@ -116,7 +157,7 @@ export default {
 				return false;
 				return false;
 			} 
 			} 
 			this.tabIndex = index;
 			this.tabIndex = index;
-      this.getGHSList('')
+      this.getGHSList()
 		},
 		},
 		addGhs(){
 		addGhs(){
 			this.pageTo({url:'/pagesPurchase/suppAdd'})
 			this.pageTo({url:'/pagesPurchase/suppAdd'})
@@ -128,13 +169,15 @@ export default {
       //this.pageTo({ url: '/pagesPurchase/gathering?id='+item.id})
       //this.pageTo({ url: '/pagesPurchase/gathering?id='+item.id})
     },
     },
     init() {
     init() {
-      this.getGHSList('')
+      this.getGHSList()
     },
     },
     searchFn(e) {
     searchFn(e) {
-      this.getGHSList(e)
+      this.search = e
+      this.getGHSList()
     },
     },
-    getGHSList (name) {
+    getGHSList() {
       let location = this.tabs[this.tabIndex].key
       let location = this.tabs[this.tabIndex].key
+      let name = this.search
       return getList({ pageSize:300, name:name,location:location }).then(res => {
       return getList({ pageSize:300, name:name,location:location }).then(res => {
         this.supplierList = res.data.list
         this.supplierList = res.data.list
         this.info = res.data
         this.info = res.data
@@ -147,7 +190,7 @@ export default {
       this.pageTo({url: '/pagesGys/details?id='+item.id})
       this.pageTo({url: '/pagesGys/details?id='+item.id})
 		},
 		},
     goToCg (item) {
     goToCg (item) {
-      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name+'&location='+item.location,type:2})
+      this.pageTo({url: '/pagesPurchase/add?ghsId='+item.id+'&ghsName='+item.name+'&location='+item.location})
     }
     }
   }
   }
 }
 }
@@ -252,15 +295,13 @@ export default {
           float:left;
           float:left;
         }
         }
         & > .store_title {
         & > .store_title {
-          margin-bottom: 58upx;
-          margin-left:10upx;
-          width: 400upx;
+          margin-bottom:58upx;
+          margin-left:0upx;
+          width: 420upx;
           white-space: nowrap;
           white-space: nowrap;
-          text-overflow: ellipsis;
-          overflow: hidden;
           word-break: break-all;
           word-break: break-all;
-          font-size: 34upx;
-          font-weight: 700;
+          font-size: 32upx;
+          font-weight:700;
           color: #333;
           color: #333;
           display:inline-block;
           display:inline-block;
         }
         }