|
|
@@ -25,8 +25,16 @@
|
|
25
|
25
|
</view>
|
|
26
|
26
|
<u--input v-if="editOrAdd === 'edit'" class="price" placeholder="价格" border="bottom" v-model="info.price"
|
|
27
|
27
|
clearable></u--input>
|
|
|
28
|
+ <u--input v-if="editOrAdd === 'edit'" placeholder="备注" border="bottom" v-model="info.remark"
|
|
|
29
|
+ clearable></u--input>
|
|
28
|
30
|
<qiun-data-charts v-if="isShowChart" type="column" :chartData="chartData" canvasId="priceChart" :opts="opts" :ontouch="true"
|
|
29
|
31
|
width="700rpx" height="600rpx" backgroundColor="#fff" />
|
|
|
32
|
+ <view v-if="isShowHistory" class="history_wrap">
|
|
|
33
|
+ <view class="title">
|
|
|
34
|
+ 询价历史
|
|
|
35
|
+ </view>
|
|
|
36
|
+ <u-cell v-for="(item, index) in historyList" :key="index" :title="(index+1)+'. ¥'+item.price" :value="'备注:'+ (item.remark || '无') "></u-cell>
|
|
|
37
|
+ </view>
|
|
30
|
38
|
</u-modal>
|
|
31
|
39
|
<brandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></brandList>
|
|
32
|
40
|
</view>
|
|
|
@@ -73,6 +81,10 @@ export default {
|
|
73
|
81
|
isShowChart: {
|
|
74
|
82
|
type: Boolean,
|
|
75
|
83
|
default: false
|
|
|
84
|
+ },
|
|
|
85
|
+ isShowHistory: {
|
|
|
86
|
+ type: Boolean,
|
|
|
87
|
+ default: false
|
|
76
|
88
|
}
|
|
77
|
89
|
},
|
|
78
|
90
|
emits: ['submitSuccess'],
|
|
|
@@ -91,8 +103,10 @@ export default {
|
|
91
|
103
|
price: '',
|
|
92
|
104
|
dictLabel: '',
|
|
93
|
105
|
dictValue: '',
|
|
94
|
|
- imgsUrl: []
|
|
|
106
|
+ imgsUrl: [],
|
|
|
107
|
+ remark: ''
|
|
95
|
108
|
},
|
|
|
109
|
+ historyList: [],
|
|
96
|
110
|
rules: {
|
|
97
|
111
|
brand: [
|
|
98
|
112
|
{ required: true, message: '请输入品牌', trigger: 'blur' }
|
|
|
@@ -152,7 +166,6 @@ export default {
|
|
152
|
166
|
initData() {
|
|
153
|
167
|
this.$nextTick(() => {
|
|
154
|
168
|
this.info = JSON.parse(JSON.stringify(this.editInfo))
|
|
155
|
|
- console.log(this.info)
|
|
156
|
169
|
if(this.isShowChart){
|
|
157
|
170
|
this.chartData = {
|
|
158
|
171
|
categories: this.info.priceChart.map((item, index) => item.userName),
|
|
|
@@ -164,6 +177,9 @@ export default {
|
|
164
|
177
|
]
|
|
165
|
178
|
};
|
|
166
|
179
|
}
|
|
|
180
|
+ if(this.isShowHistory){
|
|
|
181
|
+ this.historyList = JSON.parse(this.info.myPriceHistory)
|
|
|
182
|
+ }
|
|
167
|
183
|
this.showModal = true;
|
|
168
|
184
|
})
|
|
169
|
185
|
},
|
|
|
@@ -212,13 +228,13 @@ export default {
|
|
212
|
228
|
})
|
|
213
|
229
|
return
|
|
214
|
230
|
}
|
|
215
|
|
- if (this.info.imgsUrl.length == 0) {
|
|
216
|
|
- uni.showToast({
|
|
217
|
|
- title: '请上传图片',
|
|
218
|
|
- icon: 'none'
|
|
219
|
|
- })
|
|
220
|
|
- return
|
|
221
|
|
- }
|
|
|
231
|
+ // if (this.info.imgsUrl.length == 0) {
|
|
|
232
|
+ // uni.showToast({
|
|
|
233
|
+ // title: '请上传图片',
|
|
|
234
|
+ // icon: 'none'
|
|
|
235
|
+ // })
|
|
|
236
|
+ // return
|
|
|
237
|
+ // }
|
|
222
|
238
|
if (this.editOrAdd === 'edit' && !this.info.price) {
|
|
223
|
239
|
uni.showToast({
|
|
224
|
240
|
title: '请输入价格',
|
|
|
@@ -236,7 +252,8 @@ export default {
|
|
236
|
252
|
price: this.editOrAdd === 'edit' ? this.info.price : '',
|
|
237
|
253
|
imgsUrl: this.info.imgsUrl,
|
|
238
|
254
|
status: this.editOrAdd === 'edit' ? '2' : '1',
|
|
239
|
|
- type: this.type
|
|
|
255
|
+ type: this.type,
|
|
|
256
|
+ remark: this.info.remark
|
|
240
|
257
|
}
|
|
241
|
258
|
uni.$u.api.addInquiry(data).then(res => {
|
|
242
|
259
|
uni.$u.toast('保存成功')
|