|
@@ -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){
|