Преглед изворни кода

commit -m 发布商品添加商品资质信息

zhengjinyi пре 4 година
родитељ
комит
0cc2a265ff

+ 2 - 2
services/ajax.env.js

@@ -2,10 +2,10 @@ let URL_CONFIG = ''
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.68:8008'	 //涛涛联调地址
-	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.81:8008'
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 2 - 2
services/config.env.js

@@ -2,8 +2,8 @@ let URL_CONFIG = ''
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
-	// URL_CONFIG = 'http://192.168.2.67:18002'	 //裴裴联调地址
-	URL_CONFIG = 'https://core-b.caimei365.com'
+	URL_CONFIG = 'http://192.168.2.67:18002'	 //裴裴联调地址
+	// URL_CONFIG = 'https://core-b.caimei365.com'
 	// URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境

+ 24 - 0
services/shop.service.js

@@ -89,6 +89,30 @@ export default class ShopService {
 			isHost:true
 		})
 	}
+	/* 发货-添加商品资质初始化查询商品 */
+	GetSupplierLogisticsRecord (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/supplier/logisticsRecord', 
+			data, 
+			isLoading: false 
+		})
+	}
+	/* 发货-商品资质回显 */
+	GetSupplierQualificationData (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/supplier/qualification/data', 
+			data, 
+			isLoading: false 
+		})
+	}
+	/* 发货-保存商品资质 */
+	GetSupplierQualificationUpdata (data = {}) {
+		return this.AjaxService.post({ 
+			url:'/supplier/qualification', 
+			data, 
+			isLoading: false 
+		})
+	}
 	/* 小程序供应商我的订单 */
 	GetSupplierMyOrderList (data = {}) {
 		return this.AjaxService.get({ url:'/supplier/myOrderList', data, isLoading: true })

+ 2 - 1
supplier/pages/deliver/deliver-record.vue

@@ -206,6 +206,7 @@
 			handShowAlert(data){//判断点击的按钮类型并执行...
 				let hanldType = data.hanldType
 				let hanldData = data.hanldData
+				console.log(hanldData);
 				switch(hanldType){
 					case 'cancel':
 						this.handCenceConfirm(hanldData)
@@ -227,7 +228,7 @@
 						this.$api.navigateTo(`/supplier/pages/deliver/add-logistics?type=reple&shopOrderId=${this.shopOrderId}&data=${JSON.stringify(data)}`)
 						break
 					case 'qualifications':
-						this.$api.navigateTo(`/supplier/pages/deliver/qualifications-details?shopOrderId=${this.shopOrderId}`)
+						this.$api.navigateTo(`/supplier/pages/deliver/qualifications-details?logisticsBatchId=${hanldData.id}&shopOrderId=${this.shopOrderId}`)
 						break
 						
 				}

+ 101 - 45
supplier/pages/deliver/qualifications-add.vue

@@ -15,7 +15,7 @@
 					<view class="list-view-label">商品</view>
 					<view class="list-view-text">
 						<picker @change="bindPickerChange(item,$event)" :value="index" :range="productActions" range-key="name">
-							<input class="input" type="text" v-model="item.name" placeholder="请选择商品" disabled="true">
+							<input class="input" type="text" v-model="item.productName" placeholder="请选择商品" disabled="true">
 							<text class="iconfont icon-xiayibu"></text>
 						</picker>
 					</view>
@@ -23,7 +23,7 @@
 				<view class="list-view">
 					<view class="list-view-label">SN码</view>
 					<view class="list-view-text">
-						<input class="input" type="text" v-model="item.code" placeholder="请输入商品SN码">
+						<input class="input" type="text" v-model="item.sn" placeholder="请输入商品SN码">
 					</view>
 				</view>
 				<view class="list-view" v-for="(file,fileIndex) in item.fileList" :key="fileIndex">
@@ -41,9 +41,9 @@
 				</view>	
 				<view class="list-view-title none">图片<text class="none">(若不方便上传文件,可用图片代替)</text></view>
 				<view class="list-view-upload clearfix">
-					<view class="photo-item" v-for="(image, index) in item.imageList" :key="index">
-						<image :src="image" mode="aspectFill" @click.stop="previewImg(item.imageList,index)"></image>
-						<text class="iconfont icon-iconfontguanbi" @click.stop="deletePhotoFn(item.imageList,index)"></text>
+					<view class="photo-item" v-for="(image, imageIndex) in item.imageList" :key="index">
+						<image :src="image" mode="aspectFill" @click.stop="previewImg(item.imageList,imageIndex)"></image>
+						<text class="iconfont icon-iconfontguanbi" @click.stop="deletePhotoFn(item.imageList,imageIndex)"></text>
 					</view>
 					<view class="photo-item add" @click.stop="uploadPhotoFn(item.imageList)" v-if="item.imageList.length<10 || item.imageList.length == 0">
 						<text class="iconfont icon-jiahao"></text>
@@ -58,8 +58,8 @@
 			</view>
 		</view>
 		<view class="qualifications-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0'}">
-			<view class="edit-button-canel">暂不填写</view>
-			<view class="edit-button">确定</view>
+			<view class="edit-button-canel" @click="editButtonCanel">暂不填写</view>
+			<view class="edit-button" @click="editButtonConfim">确定</view>
 		</view>
 	</view>
 </template>
@@ -74,65 +74,118 @@
 		data() {
 			return{
 				isIphoneX:this.$store.state.isIphoneX,
-				productActions:[
-					{
-						id:1,
-						name:'asdasdasM22'
-					},
-					{
-						id:2,
-						name:'奥术大师大所打M22'
-					},
-					{
-						id:3,
-						name:'美国第六代光子多功能智能平台M22'
-					},
-				],
+				shopOrderId:0,
+				logisticsBatchId:0,
+				productActions:[],
 				qualificationsList:[
 					{
-						name:'美国第六代光子多功能智能平台M22',
-						code:'SN2562659874565',
-						fileList:[
-							{
-								fileName:'深圳市和创元文件.pdf',
-								ossName:'深圳市和创元文件.pdf'
-							}
-						],
+						name:'',
+						recordId:'',
+						sn:'',
+						fileList:[],
 						imageList:[
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg'
+							'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1194131577,2954769920&fm=26&gp=0.jpg',
+							'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1194131577,2954769920&fm=26&gp=0.jpg'
 						]
 					}
 				]
 			}
 		},
 		onLoad(option) {
-			
+			console.log(option)
+			if(option.type == 'add'){
+				this.logisticsBatchId = option.logisticsBatchId
+				this.shopOrderId = option.shopOrderId
+				this.GetSupplierLogisticsRecord()
+			}else{
+				this.logisticsBatchId = option.logisticsBatchId
+				this.shopOrderId = option.shopOrderId
+				this.GetSupplierLogisticsRecord()
+				this.GetSupplierQualificationData()
+			}
 		},
 		methods:{
 			...mapMutations(['login']),
-			initGetLogisticsInfo(){
-				this.ShopService.GetLogisticsInfo({ logisticsBatchId : this.logisticsBatchId, shopOrderId:this.info.shopOrderId }).then(response =>{
-					const data = response.data.logisticsBatch
-					if(data.remarkImages!=null){
-						this.photoLists = data.remarkImages
+			GetSupplierQualificationData(){//编辑回显商品资质信息
+				this.ShopService.GetSupplierQualificationData(
+					{ 
+						logisticsBatchId : this.logisticsBatchId ,
+					}
+				)
+				.then(response =>{
+					const data = response.data
+					if(data && data.length > 0){
+						this.qualificationsList = data
+						this.isEmpty = false
 					}else{
-						this.photoLists =[]
+						this.isEmpty = true
+					}
+				})
+				.catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},
+			GetSupplierLogisticsRecord(){//添加商品资质初始化查询商品信息
+				this.ShopService.GetSupplierLogisticsRecord(
+					{ 
+						logisticsBatchId : this.logisticsBatchId
+					}
+				)
+				.then(response =>{
+					const data = response.data
+					data.forEach((el,index) => {
+						let obj = {
+								value : el.id,
+								name : el.productName
+						}
+						this.productActions.push(obj)
+					})
+				})
+				.catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},
+			editButtonConfim(){//确定
+				let params = [];
+				this.qualificationsList.forEach((el,index) => {
+					let obj = {
+							recordId : el.recordId,
+							sn : el.sn,
+							files : el.fileList,
+							images : el.imageList
+						}
+					params.push(obj)	
+				})
+				this.ShopService.GetSupplierQualificationUpdata(
+					{
+						params:JSON.stringify(params)
 					}
-					this.info.note = data.remark
-				}).catch(error =>{
+				)
+				.then(response =>{
+					this.$util.msg('保存成功',2000);
+					setTimeout(()=>{
+						this.$api.navigateTo(`/supplier/pages/deliver/deliver-record?shopOrderId=${this.shopOrderId}`)
+					},2000)
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},
 			bindPickerChange: function(item,e) {//选择筛选条件
-				item.name = this.productActions[e.target.value].name
+				item.recordId =  this.productActions[e.target.value].value
+				item.productName = this.productActions[e.target.value].name
 			},
 			addListFn(){//添加
 				let obj ={
-					name:'',
-					code:'',
-					fileList:[],
-					imageList:[],
-				};
+						name:'',
+						recordId:'',
+						sn:'',
+						files:[],
+						images:[
+							'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1194131577,2954769920&fm=26&gp=0.jpg',
+							'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1194131577,2954769920&fm=26&gp=0.jpg'
+						]
+					};
 				this.qualificationsList.push(obj)
 			},
 			deleteLogistItemFn(item,index){
@@ -183,6 +236,9 @@
 					longPressActions:''
 				})
 			},
+			editButtonCanel(){
+				this.$api.navigateTo(`/supplier/pages/deliver/deliver-record?shopOrderId=${this.shopOrderId}`)
+			},
 		},
 		onShow() {
 			

+ 38 - 66
supplier/pages/deliver/qualifications-details.vue

@@ -5,32 +5,32 @@
 				<view class="list-view-title">商品{{ index+1 }}</view>
 				<view class="list-view">
 					<view class="list-view-label">商品</view>
-					<view class="list-view-text">{{ item.name }}</view>
+					<view class="list-view-text">{{ item.productName }}</view>
 				</view>
 				<view class="list-view">
 					<view class="list-view-label">SN码</view>
-					<view class="list-view-text">{{ item.code }}</view>
+					<view class="list-view-text">{{ item.sn }}</view>
 				</view>
 				<view class="list-view" v-for="(file,fileIndex) in item.fileList" :key="fileIndex">
 					<view class="list-view-label">资质文件</view>
-					<view class="list-view-text">{{ file.ossName }}</view>
+					<view class="list-view-text">{{ file.fileName }}</view>
 				</view>	
 				<view class="list-view-title none">图片</view>
 				<view class="list-view-upload clearfix">
-					<view class="photo-item" v-for="(image, index) in item.imageList" :key="index">
-						<image :src="image" mode="aspectFill" @click.stop="previewImg(item.imageList,index)"></image>
+					<view class="photo-item" v-for="(image, imageIndex) in item.imageList" :key="index">
+						<image :src="image" mode="aspectFill" @click.stop="previewImg(item.imageList,imageIndex)"></image>
 					</view>
 				</view>
 			</view>
 			<view class="qualifications-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0'}">
-				<view class="edit-button">编辑</view>
+				<view class="edit-button" @click="editSubmitFn('edit')">编辑</view>
 			</view>
 		</view>
 		<view v-else class="cart-content empty">
 			<view  class="empty-container">
 				<image class="empty-container-image" src="https://static.caimei365.com/app/img/icon/icon-ques-empty@2x.png" mode="aspectFit"></image>
 				<text class="error-text">暂无商品资质信息</text>
-				<view class="login-btn"  @click="goIndex">去补充</view>
+				<view class="login-btn"  @click="editSubmitFn('add')">去补充</view>
 			</view>
 		</view>
 	</view>
@@ -43,78 +43,50 @@
 	export default{
 		data() {
 			return{
+				logisticsBatchId:0,
+				shopOrderId:0,
 				isIphoneX:this.$store.state.isIphoneX,
 				isEmpty:false,
-				qualificationsList:[
-					{
-						name:'美国第六代光子多功能智能平台M22',
-						code:'SN2562659874565',
-						fileList:[
-							{
-								ossName:'深圳市和创元文件.pdf'
-							},
-							{
-								ossName:'深圳市和创元文件.pdf'
-							},
-						],
-						imageList:[
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-						]
-					},
-					{
-						name:'美国第六代光子多功能智能平台M22',
-						code:'SN2562659874565',
-						fileList:[
-							{
-								ossName:'深圳市和创元文件.pdf'
-							},
-							{
-								ossName:'深圳市和创元文件.pdf'
-							},
-						],
-						imageList:[
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-							'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2306696130,3636777462&fm=26&gp=0.jpg',
-						]
-					},
-				]
+				qualificationsList:[]
 			}
 		},
 		onLoad(option) {
-			
+			this.shopOrderId = option.shopOrderId
+			this.logisticsBatchId = option.logisticsBatchId
+			console.log('shopOrderId',this.shopOrderId)
+			this.GetSupplierQualificationData(option.logisticsBatchId)
 		},
 		methods:{
 			...mapMutations(['login']),
-			initGetLogisticsInfo(){
-				this.ShopService.GetLogisticsInfo({ logisticsBatchId : this.logisticsBatchId, shopOrderId:this.info.shopOrderId }).then(response =>{
-					const data = response.data.logisticsBatch
-					if(data.remarkImages!=null){
-						this.photoLists = data.remarkImages
+			GetSupplierQualificationData(logisticsBatchId){
+				this.ShopService.GetSupplierQualificationData(
+					{ 
+						logisticsBatchId : logisticsBatchId ,
+					}
+				)
+				.then(response =>{
+					const data = response.data
+					if(data && data.length > 0){
+						this.qualificationsList = data
+						this.isEmpty = false
 					}else{
-						this.photoLists =[]
+						this.isEmpty = true
 					}
-					this.info.note = data.remark
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},
+			editSubmitFn(type){
+				switch(type){
+					case 'edit':
+						this.$api.navigateTo(`/supplier/pages/deliver/qualifications-add?type=edit&logisticsBatchId=${this.logisticsBatchId}&shopOrderId=${this.shopOrderId}`)
+						break;
+					case 'add':
+						this.$api.navigateTo(`/supplier/pages/deliver/qualifications-add?type=add&logisticsBatchId=${this.logisticsBatchId}&shopOrderId=${this.shopOrderId}`)
+						break;
+				}
+			},
 			previewImg (Array,index) {//顶部商品图片预览
 				console.log(Array)
 				isPreviewImg = true