diff --git a/src/views/order/orderCancellate.vue b/src/views/order/orderCancellate.vue
index b5ff3af..c332192 100644
--- a/src/views/order/orderCancellate.vue
+++ b/src/views/order/orderCancellate.vue
@@ -1,60 +1,55 @@
-
+
-
-
-
- 搜索
-
-
- {{orderData.order_sn}}
-
-
-
-
-
+
+
+
+ 搜索
+
+
+ {{ orderData.order_sn }}
+
+
+
+
+
-
+
-
{{scope.row.cart_info.product.store_name}}
+
{{ scope.row.cart_info.product.store_name }}
- {{scope.row.cart_info.productAttr.sku}}
+ {{ scope.row.cart_info.productAttr.sku }}
- {{scope.row.cart_info.productAttr.price}}
+ {{ scope.row.cart_info.productAttr.price }}
待核销
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
@@ -88,7 +83,7 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team
// +----------------------------------------------------------------------
-import { orderCancellationApi, goCancellationApi } from '@/api/order'
+import { orderCancellationApi, goCancellationApi } from '@/api/order'
export default {
name: 'OrderCancellate',
@@ -101,50 +96,60 @@ export default {
orderData: "",
multipleSelection: [],
ids: [],
+ verify_code: '', //核销码
isColum: false,
productList: []
}
},
methods: {
searchOrder() {
- if(!this.code){
+ if (!this.code) {
return this.$message.warning('输入核销码!')
}
this.productDetails(this.code)
},
- judgeSelect(row,index){
- return row.is_refund==0
+ judgeSelect(row, index) {
+ return row.is_refund == 0
},
handleCancellation() {
- if(!this.code){
+ // if (!this.code) {
+ // return this.$message.warning('输入核销码!')
+ // }
+ if (!this.verify_code) {
return this.$message.warning('输入核销码!')
}
+
if (!this.multipleSelection.length) {
return this.$message.warning('请选择核销商品!')
}
const data = []
this.multipleSelection.map((item) => {
- if(item.refund_num>0){
- data.push({id:item.order_product_id,num:item.refund_num})
+ if (item.refund_num > 0) {
+ data.push({ id: item.order_product_id, num: item.refund_num })
}
-
+
})
- goCancellationApi(this.order_id,{verify_code: this.code,data: data}).then(res => {
- this.$message.success(res.message)
- this.dialogVisible = false
- this.$emit('getList','')
+ goCancellationApi(this.order_id, { verify_code: this.verify_code, data: data }).then(res => {
+ this.$message.success(res.message)
+ this.dialogVisible = false
+ this.$emit('getList', '')
}).catch(({ message }) => {
this.$message.error(message)
})
},
- productDetails(code) {
- this.code = code
+ productDetails(code, type = false) {
+ if (type) { this.code = code }
+ else {
+ this.code = "";
+ this.verify_code = "";
+ }
this.loading = true
orderCancellationApi(code).then(res => {
this.orderData = res.data
this.order_id = res.data.order_id
+ if (type) this.verify_code = res.data.verify_code
this.productList = res.data.orderProduct
- this.productList.forEach((item, index)=>{
+ this.productList.forEach((item, index) => {
item.max_num = item.refund_num
})
this.loading = false
@@ -153,19 +158,19 @@ export default {
this.$message.error(message)
})
},
- resetData(){
+ resetData() {
this.orderData = {},
- this.productList = [];
+ this.productList = [];
this.code = ""
},
- // 选择商品
+ // 选择商品
handleSelectionChange(val) {
this.multipleSelection = val
},
- limitNum(row){
- if(row.refund_num > row.max_num){
+ limitNum(row) {
+ if (row.refund_num > row.max_num) {
row.refund_num = row.max_num
- }else if(row.refund_num < 1){
+ } else if (row.refund_num < 1) {
row.refund_num = 1
}
}
@@ -174,7 +179,7 @@ export default {