modal-stock-out.vue
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<Modal
v-model="showModal"
@on-ok="uploadLackNum"
width="auto"
class-name="upload-stock-modal"
cancel-text="取消"
ok-text="提交">
<div class="detail">
<Table
stripe
:columns="tableCols"
:data="tableData">
</Table>
</div>
<p class="danger-tip">
*缺货数量提交后无法更改,平台将对顾客订单商品进行退单处理,请慎重操作!
</p>
</Modal>
</template>
<script>
import Vue from 'vue';
import service from 'trade-service';
const ModalCellPrdInfo = {
name: 'ModalCellPrdInfo',
props: {
sku: {
type: [String, Number]
},
skn: {
type: [String, Number]
},
color: {
type: String
},
size: {
type: String
},
brand: {
type: String
},
price: {
type: [String, Number]
},
name: {
type: String
}
},
template:
`<div class="cell-info">
<div class="img">
<img src=""></img>
</div>
<div class="detail">
<p>SKU:{{sku}}</p>
<p>规格:{{color}}/{{size}}</p>
<p>名称:{{name}}</p>
<p>品牌:{{brand}}</p>
<p>销售价:{{price}}</p>
</div>
</div>`,
data() {
return {
};
}
};
// modal table 中的自定义组件无法识别
Vue.component('modal-cell-prd-info', ModalCellPrdInfo);
export default {
name: 'UploadStockOut',
data() {
return {
showModal: false,
showLoading: true,
tableCols: [
{
title: '商品图片',
key: 'image',
render(row) { // eslint-disable-line
return `<div>
<img v-prod-img.sku="row.productSku">
</div>`;
}
},
{
title: '商品信息',
key: 'info',
render() {
return `<modal-cell-prd-info
:sku="row.productSku"
:size="row.sizeName"
:color="row.factoryGoodsName"
:brand="row.brandName"
:name="row.productName"
:price="row.salesPrice"
></modal-cell-prd-info>`;
}
},
{
title: '缺货数',
key: 'inputLackNum'
}
],
tableData: [],
rowData: {}
};
},
created() {
},
methods: {
show(row) {
this.rowData = row;
this.tableData = [row];
this.showModal = true;
},
uploadLackNum() {
const params = {
num: this.rowData.inputLackNum,
productSku: this.rowData.productSku,
proReqFormId: this.rowData.proRequisitionFormId
};
service.allotStockOut(params)
.then(() => {
this.$emit('upload-success');
});
}
}
};
</script>
<style lang="scss">
.upload-stock-modal {
.detail {
}
.danger-tip {
margin-top: 20px;
color: #ff0000;
text-align: center;
}
.ivu-modal {
width: 70%;
}
}
</style>