瀏覽代碼

付款管理优化版本~

zhengjinyi 4 年之前
父節點
當前提交
ee87033aac

+ 0 - 31
api/order.js

@@ -6,37 +6,6 @@
  */
 import request from '@/common/config/caimeiApi.js'
 import $reg from '@/common/config/common.js'
-
-/**
- *@发票信息回显
- *@param userId	机构的userID
- */
-export function getFindInvoice(params) {
-	return new Promise(function(resolve,reject) {
-		request.get('/personalCenter/findInvoice',params,res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
-/**
- *@保存发票信息
- *@param userId	机构的userID
- */
-export function updateInvoice(params) {
-	return new Promise(function(resolve,reject) {
-		request.post('/personalCenter/invoice',params, true,res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
 /**
  *@获取订单列表
  *@param orderState 订单状态 1 2 3 4

+ 2 - 2
common/config/config.js

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

+ 16 - 17
components/cm-module/creatOrder/invoiceTent.vue

@@ -23,7 +23,7 @@
 							</label>
 						</radio-group>
 					</view>
-					<view class="invoice-main from" v-if="invoiceType == '3'">
+					<view class="invoice-main from" v-if="invoiceType == '2'">
 						<view class="invoice-from">
 							<view class="label">单位名称:</view>
 							<input class="form-input" type="text" v-model="invoiceData.invoiceTitle" placeholder="请填写单位信息(必填)" maxlength="20">
@@ -53,7 +53,7 @@
 								   maxlength="19">
 						</view>
 					</view>
-					<view class="invoice-main" v-if="invoiceType == '2'">
+					<view class="invoice-main" v-if="invoiceType == '3'">
 						<view class="invoice-ltitle">发票内容</view>
 						<view class="invoice-group tit">
 							<checkbox-group class="row-group" @change="checkboxChange">
@@ -95,7 +95,6 @@
 </template>
 
 <script>
-	import { getFindInvoice,updateInvoice } from "@/api/order.js"
 	export default{
 		name:"invoice",
 		data() {
@@ -107,9 +106,8 @@
 				titleCurrent:0,
 				inventoryChecked:false,
 				invoiceTypeList:[
-					{value:'1',name:'不开发票'},
-					{value:'2',name:'普通发票'},
-					{value:'3',name:'增值税发票'},
+					{value:'1',name:'不要发票'},
+					{value:'2',name:'要发票'},
 				],
 				invoiceTitleList:[
 					{value:'0',name:'个人'},
@@ -141,7 +139,7 @@
 		methods:{
 			getUseFindInvoice(){//获取发票信息
 				this.$api.getStorage().then((resolve) => {
-					getFindInvoice({userId:resolve.userID}).then(response =>{
+					this.OrderService.GetFindInvoice({userId:resolve.userID}).then(response =>{
 						if(response.data == null){
 							this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
 						}else{
@@ -153,7 +151,7 @@
 			updateInvoiceFn(){//保存发票信息
 				this.$api.getStorage().then((resolve) => {
 					let params =Object.assign(this.invoiceData,'',{userId:resolve.userID})
-					updateInvoice(params).then(response =>{})
+					this.OrderService.UpdateInvoice(params).then(response =>{})
 				})
 			},
 			choiceaInvoiceConfim(){
@@ -162,11 +160,11 @@
 						this.choiceaInvoiceThree()
 						this.invoiceText = '不开发票'
 						break;
+					// case '2':
+					// 	this.choiceaInvoiceTwo()
+					// 	this.invoiceText = this.peopleInvoiceData.invoiceTitle
+					// 	break;
 					case '2':
-						this.choiceaInvoiceTwo()
-						this.invoiceText = this.peopleInvoiceData.invoiceTitle
-						break;
-					case '3':
 						this.choiceaInvoiceFirst()
 						this.invoiceText = this.invoiceData.invoiceTitle
 						break;	
@@ -204,7 +202,7 @@
 				this.$emit('handleChoiceaInvoice',Object.assign(this.invoiceData,'',{type:2}))
 				this.hideSpec()
 			},
-			choiceaInvoiceTwo(){//普通发票
+			choiceaInvoiceTwo(){//取消普通发票.(可删除)	
 				switch(this.peopleInvoiceData.invoiceTitleType){
 					case '0':
 						if(this.peopleInvoiceData.invoiceContent == ''){
@@ -258,12 +256,13 @@
 				}
 				switch(this.invoiceType){
 					case '2':
-						this.peopleInvoiceData.invoiceTitleType = "0"
-						this.titleCurrent = 0
-						break;
-					case '3':
 						this.getUseFindInvoice()
 						break;
+					//取消普通发票.(可删除)	
+					// case '3':
+					// 	this.peopleInvoiceData.invoiceTitleType = "0"
+					// 	this.titleCurrent = 0
+					// 	break;
 				}		
 			},
 			radioChangeTitle(e) {

+ 9 - 11
components/cm-module/creatOrder/sellerInvoice.vue

@@ -23,7 +23,7 @@
 							</label>
 						</radio-group>
 					</view>
-					<view class="invoice-main from" v-if="invoiceType == '3'">
+					<view class="invoice-main from" v-if="invoiceType == '2'">
 						<view class="invoice-from">
 							<view class="label">单位名称:</view>
 							<input class="form-input" type="text" v-model="invoiceData.invoiceTitle" placeholder="请填写单位信息(必填)" maxlength="20">
@@ -53,7 +53,7 @@
 								   maxlength="19">
 						</view>
 					</view>
-					<view class="invoice-main" v-if="invoiceType == '2'">
+					<view class="invoice-main" v-if="invoiceType == '3'">
 						<view class="invoice-ltitle">发票内容</view>
 						<view class="invoice-group tit">
 							<checkbox-group class="row-group" @change="checkboxChange">
@@ -95,7 +95,6 @@
 </template>
 
 <script>
-	import { getFindInvoice,updateInvoice } from "@/api/order.js"
 	export default{
 		name:"invoice",
 		data() {
@@ -108,8 +107,7 @@
 				inventoryChecked:false,
 				invoiceTypeList:[
 					{value:'1',name:'不开发票'},
-					{value:'2',name:'普通发票'},
-					{value:'3',name:'增值税发票'},
+					{value:'2',name:'增值税发票'},
 				],
 				invoiceTitleList:[
 					{value:'0',name:'个人'},
@@ -141,7 +139,7 @@
 		methods:{
 			getUseFindInvoice(){//获取发票信息
 				this.$api.getComStorage('orderUserInfo').then((resolve) =>{
-					getFindInvoice({userId:resolve.userID}).then(response =>{
+					this.OrderService.GetFindInvoice({userId:resolve.userID}).then(response =>{
 						if(response.data == null){
 							this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
 						}else{
@@ -153,7 +151,7 @@
 			updateInvoiceFn(){//保存发票信息
 				this.$api.getComStorage('orderUserInfo').then((resolve) =>{
 					let params =Object.assign(this.invoiceData,'',{userId:resolve.userID})
-					updateInvoice(params).then(response =>{})
+					this.OrderService.UpdateInvoice(params).then(response =>{})
 				})
 			},
 			choiceaInvoiceConfim(){
@@ -162,10 +160,10 @@
 						this.choiceaInvoiceThree()
 						this.invoiceText = '不开发票'
 						break;
-					case '2':
-						this.choiceaInvoiceTwo()
-						this.invoiceText = this.peopleInvoiceData.invoiceTitle
-						break;
+					// case '2':
+					// 	this.choiceaInvoiceTwo()
+					// 	this.invoiceText = this.peopleInvoiceData.invoiceTitle
+					// 	break;
 					case '3':
 						this.choiceaInvoiceFirst()
 						this.invoiceText = this.invoiceData.invoiceTitle

+ 0 - 1
components/cm-module/orderDetails/orderInformation.vue

@@ -40,7 +40,6 @@
 				<view class="view-num" v-if="orderData.freePostFlag == '0'">运费:包邮</view>
 				<view class="view-num" v-if="orderData.freePostFlag == '-1'">运费:到付</view>
 				<view class="view-num" v-if="orderData.freePostFlag == '1'">运费:¥{{ orderData.freight | NumFormat}}</view>
-				<view class="view-man">税费:¥{{ orderData.expensesOfTaxation == null ? '0.00' : orderData.expensesOfTaxation | NumFormat }}</view>
 			</view>
 			<view class="information-view">
 				<view class="view-num">已支付:¥{{ orderData.receiptAmount == null ? '0.00' : orderData.receiptAmount | NumFormat }}</view>

+ 2 - 2
services/ajax.env.js

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

+ 14 - 0
services/order.service.js

@@ -25,6 +25,20 @@ export default class OrderService {
 	GetOrderPostage (data = {}) {
 		return this.AjaxService.get({ url:'/order/postage', data, isLoading: false })
 	}
+	/**
+	 *@确认订单-获取发票信息
+	 *@param userId		用户ID
+	 */
+	GetFindInvoice (data = {}) {
+		return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
+	}
+	/**
+	 *@确认订单-保存发票信息
+	 *@param userId		用户ID
+	 */
+	UpdateInvoice (data = {}) {
+		return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
+	}
 	/* 提交订单 orderId 订单ID */
 	CreatedOrderSubmit (data = {}) {
 		return this.AjaxService.post({ url:'/order/submit', data, isLoading: true })