浏览代码

详情回显修改

pengyh 1 年之前
父节点
当前提交
2040065c46

+ 19 - 26
src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.vue

@@ -139,7 +139,7 @@
 					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
 					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
 					<el-table-column prop="" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods.price">
+						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods && scope.row.goods.price">
 							{{(scope.row.goods.price * 100) * scope.row.salesQty / 100}}
 						</template>
 					</el-table-column>
@@ -205,7 +205,8 @@
 					workerName: '',
 					workerId: '',
 					idcard: '',
-					phone: ''
+					phone: '',
+					remark: ''
 				},
 				isEdit: 0,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
@@ -239,9 +240,9 @@
 			goBack() {
 				this.$emit('back');
 			},
-			getDetail(salesId){
+			async getDetail(salesId){
 				const that = this
-				getDetail({salesId}).then(res => {
+				getDetail({salesId}).then(async res => {
 					this.formData.flag = res.data.flag
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -258,21 +259,17 @@
 					this.formData.idcard = res.data.identity
 					this.formData.phone = res.data.workerMobile
 					this.formData.remark = res.data.remark
-					res.data.items.forEach(item=>{
-						that.getGoods(item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.items
-					},200)
-					console.log(this.dataList)
+					for(var item of res.data.items){
+						var ress = await that.getGoods(item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.items
 				})
 			},
-			getNewDetail(){
+			async getNewDetail(){
 				const that = this
-				getNewDetail({id: this.id}).then(res => {
+				getNewDetail({id: this.id}).then(async res => {
 					this.formData.flag = res.data.flag
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -290,16 +287,12 @@
 					this.formData.idcard = res.data.identity
 					this.formData.phone = res.data.workerMobile
 					this.formData.remark = res.data.remark
-					res.data.websitPartsRetItemList.forEach(item=>{
-						that.getGoods(item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.websitPartsRetItemList
-					},200)
-					console.log(this.dataList)
+					for(var item of res.data.websitPartsRetItemList){
+						var ress = await that.getGoods(item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.websitPartsRetItemList
 				})
 			},
 			getWebsit(){

+ 32 - 27
src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.vue

@@ -114,6 +114,11 @@
 				<span>配件信息</span>
 			</div>
 			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
+			<label>使用类型: </label>
+			<el-radio-group v-model="formData.orderUseType">
+			    <el-radio :disabled="formType == 2" label="INSIDE">保内</el-radio>
+			    <el-radio :disabled="formType == 2" label="OUT">保外</el-radio>
+			  </el-radio-group>
 			<div class="table">
 				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
 					<el-table-column label="配件名称" align="center">
@@ -139,12 +144,12 @@
 					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
 					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
 					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.retQty && scope.row.goods.price">
+						<template slot-scope="scope" v-if="scope.row.retQty && scope.row.goods && scope.row.goods.price">
 							{{(scope.row.goods.price * 100) * scope.row.retQty / 100}}
 						</template>
 					</el-table-column>
 					<!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
-					<el-table-column prop="" align="center" label="退款金额" >
+					<el-table-column prop="" align="center" label="退款金额" v-if="formData.orderUseType == 'INSIDE'">
 						<template slot-scope="scope">
 							<el-input type="number" v-model="scope.row.refundAmount" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
 						</template>
@@ -206,7 +211,9 @@
 					workerName: '',
 					workerId: '',
 					idcard: '',
-					phone: ''
+					phone: '',
+					remark: '',
+					orderUseType: 'INSIDE'
 				},
 				isEdit: 0,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
@@ -240,9 +247,9 @@
 			goBack() {
 				this.$emit('back');
 			},
-			getDetail(salesId){
+			async getDetail(salesId){
 				const that = this
-				getDetail({salesId}).then(res => {
+				getDetail({salesId}).then(async res => {
 					this.formData.flag = res.data.flag
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -259,21 +266,18 @@
 					this.formData.idcard = res.data.identity
 					this.formData.phone = res.data.workerMobile
 					this.formData.remark = res.data.remark
-					res.data.items.forEach(item=>{
-						that.getGoods(item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.items
-					},200)
-					console.log(this.dataList)
+					this.formData.orderUseType = res.data.orderUseType
+					for(var item of res.data.items){
+						var ress = await that.getGoods(item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.items
 				})
 			},
-			getNewDetail(){
+			async getNewDetail(){
 				const that = this
-				getNewDetail({id: this.id}).then(res => {
+				getNewDetail({id: this.id}).then(async res => {
 					this.formData.flag = res.data.flag
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -291,16 +295,13 @@
 					this.formData.idcard = res.data.identity
 					this.formData.phone = res.data.workerMobile
 					this.formData.remark = res.data.remark
-					res.data.websitPartsRetItemList.forEach(item=>{
-						that.getGoods(item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.websitPartsRetItemList
-					},200)
-					console.log(this.dataList)
+					this.formData.orderUseType = res.data.orderUseType
+					for(var item of res.data.websitPartsRetItemList){
+						var ress = await that.getGoods(item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price,retQty: 1}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price,retQty: 1}] : []
+					}
+					this.dataList = res.data.websitPartsRetItemList
 				})
 			},
 			getWebsit(){
@@ -372,6 +373,7 @@
 					refundAmount: '',
 					saleAmount: '',
 					salesQty: 1,
+					retQty: 1,
 					qty: '',
 					goodsType: 'P'
 				})
@@ -413,6 +415,7 @@
 						identity: this.formData.idcard,
 						workerMobile: this.formData.phone,
 						websitPartsRetItems: this.dataList,
+						orderUseType: this.formData.orderUseType,
 						file_url: this.formData.file_url.map(item=>item.url).join(","),
 					}).then(res => {
 						if(res.code == 200){
@@ -438,6 +441,7 @@
 								identity: this.formData.idcard,
 								workerMobile: this.formData.phone,
 								websitPartsRetItems: this.dataList,
+								orderUseType: this.formData.orderUseType,
 								file_url: this.formData.file_url.map(item=>item.url).join(","),
 							}).then(res => {
 								if(res.code == 200){
@@ -459,6 +463,7 @@
 								identity: this.formData.idcard,
 								workerMobile: this.formData.phone,
 								websitPartsRetItems: this.dataList,
+								orderUseType: this.formData.orderUseType,
 								file_url: this.formData.file_url.map(item=>item.url).join(","),
 							}).then(res => {
 								if(res.code == 200){

+ 8 - 12
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -152,7 +152,7 @@
 					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
 					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
 					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods.price">
+						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods && scope.row.goods.price">
 							{{(scope.row.goods.price * 100) * scope.row.salesQty / 100}}
 						</template>
 					</el-table-column>
@@ -266,7 +266,7 @@
 			},
 			async getDetail(){
 				const that = this
-				getDetail({salesId: this.id}).then(res => {
+				getDetail({salesId: this.id}).then(async res => {
 					this.formData.flag = res.data.flag
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -285,16 +285,12 @@
 					this.formData.source = res.data.source
 					this.formData.payType = res.data.payType
 					this.formData.remark = res.data.remark
-					res.data.items.forEach(item=>{
-						that.getGoods(item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.items
-					},200)
-					console.log(this.dataList)
+					for(var item of res.data.items){
+						var ress = await that.getGoods(item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.items
 				})
 			},
 			getWebsit(){

+ 7 - 11
src/views/auxiliaryFittings/salesManagement/components/auxiliaryAdjustPriceOrderDetail.vue

@@ -220,7 +220,7 @@
 			},
 			async getDetail(){
 				const that = this
-				getDetail({sheetId: this.id}).then(res => {
+				getDetail({sheetId: this.id}).then(async res => {
 					this.formData.flag = res.data.flag
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -232,18 +232,14 @@
 					this.formData.confirmTime = res.data.confirmTime
 					this.getCategory(res.data.websitId)
 					this.formData.remark = res.data.remark
-					res.data.items.forEach(item=>{
+					for(var item of res.data.items){
 						item.productCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
 						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.items
-					},200)
-					console.log(this.dataList)
+						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.items
 				})
 			},
 			getWebsit(){

+ 18 - 26
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesReturnOrderDetail.vue

@@ -161,7 +161,7 @@
 						</template>
 					</el-table-column>
 					<el-table-column prop="goods.saleAmount" align="center" label="退货金额" >
-						<template slot-scope="scope" v-if="scope.row.retQty && scope.row.goods.price">
+						<template slot-scope="scope" v-if="scope.row.retQty && scope.row.goods && scope.row.goods.price">
 							{{(scope.row.goods.price * 100) * scope.row.retQty / 100}}
 						</template>
 					</el-table-column>
@@ -170,7 +170,7 @@
 					<el-table-column prop="salesQty" align="center" label="销售数量"></el-table-column>
 					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
 					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods.price">
+						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods && scope.row.goods.price">
 							{{(scope.row.goods.price * 100) * scope.row.salesQty / 100}}
 						</template>
 					</el-table-column>
@@ -265,9 +265,9 @@
 			goBack() {
 				this.$emit('back');
 			},
-			getDetail(salesId){
+			async getDetail(salesId){
 				const that = this
-				getDetail({salesId}).then(res => {
+				getDetail({salesId}).then(async res => {
 					this.formData.retState = res.data.retState
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -285,23 +285,19 @@
 					this.formData.phone = res.data.workerMobile
 					this.getCategory(res.data.websitId)
 					this.formData.remark = res.data.remark
-					res.data.items.forEach(item=>{
+					for(var item of res.data.items){
 						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
 						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.items
-					},200)
-					console.log(this.dataList)
+						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.items
 				})
 			},
-			getReturnDetail(){
+			async getReturnDetail(){
 				const that = this
-				getReturnDetail({id: this.id}).then(res => {
+				getReturnDetail({id: this.id}).then(async res => {
 					this.formData.retState = res.data.retState
 					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
 					this.formData.websitId = res.data.websitId
@@ -320,18 +316,14 @@
 					this.formData.phone = res.data.workerMobile
 					this.getCategory(res.data.websitId)
 					this.formData.remark = res.data.remark
-					res.data.websitSalesRetItems.forEach(item=>{
+					for(var item of res.data.websitSalesRetItems){
 						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
 						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
-							item.goods = {...ress.data,oldPrice:ress.data.price}
-							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
-						})
-					})
-					setTimeout(()=>{
-						this.dataList = res.data.websitSalesRetItems
-					},200)
-					console.log(this.dataList)
+						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
+						item.goods = {...ress.data,oldPrice:ress.data.price}
+						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
+					}
+					this.dataList = res.data.websitSalesRetItems
 				})
 			},
 			getWebsit(){