|
|
@@ -3,8 +3,8 @@
|
|
3
|
3
|
<view class="add_page">
|
|
4
|
4
|
<u-navbar class="nav-bar" title="商品入库" :autoBack="true" :placeholder="true" v-hideNav>
|
|
5
|
5
|
<view class="u-nav-slot" slot="right">
|
|
6
|
|
- <u-checkbox-group v-model="checkboxValue" placement="column" @change="checkboxChange">
|
|
7
|
|
- <u-checkbox label="连续入库" name="continuous"></u-checkbox>
|
|
|
6
|
+ <u-checkbox-group v-model="continuousWarehousing" placement="column">
|
|
|
7
|
+ <u-checkbox label="连续入库" name="1"></u-checkbox>
|
|
8
|
8
|
</u-checkbox-group>
|
|
9
|
9
|
</view>
|
|
10
|
10
|
</u-navbar>
|
|
|
@@ -22,12 +22,17 @@
|
|
22
|
22
|
</u--textarea>
|
|
23
|
23
|
<view class="btn_group_recognition">
|
|
24
|
24
|
<u-button text="清除" @click="clearRecognitionContent()"></u-button>
|
|
25
|
|
- <u-button text="粘贴识别" type="primary" @click="handlePasteRecognition(recognitionContent)"></u-button>
|
|
|
25
|
+ <u-button text="粘贴识别" type="primary"
|
|
|
26
|
+ @click="handlePasteRecognition(recognitionContent)"></u-button>
|
|
26
|
27
|
</view>
|
|
27
|
28
|
</u-form-item>
|
|
28
|
29
|
<u-form-item label="商品图片" required prop="imgs" borderBottom>
|
|
29
|
|
- <u-upload :fileList="goodPicFileList" @afterRead="afterReadGoodPic" @delete="deleteGoodPic"
|
|
30
|
|
- name="3" multiple :maxCount="9" :previewFullImage="true"></u-upload>
|
|
|
30
|
+ <ImgsRowScroll v-if="formData.goodPicFileList.length > 0" :isShowDeleteIcon="true"
|
|
|
31
|
+ @deleteImgInfo="getDeleteGoodPicInfo" imgMode="aspectFill" :totalWidth="400"
|
|
|
32
|
+ :images="formData.goodPicFileList" :previewEnabled="true" :imageWidth="150"
|
|
|
33
|
+ :imageHeight="150"></ImgsRowScroll>
|
|
|
34
|
+ <u-upload @afterRead="afterReadGoodPic" name="3" multiple :maxCount="9"
|
|
|
35
|
+ :previewFullImage="true"></u-upload>
|
|
31
|
36
|
</u-form-item>
|
|
32
|
37
|
<u-form-item label="商品描述(详细的描述让用户更好的了解您的产品)" required prop="desc" borderBottom>
|
|
33
|
38
|
<u--textarea v-model="formData.desc" clearable placeholder="95新 WHZ19219H
|
|
|
@@ -36,11 +41,14 @@
|
|
36
|
41
|
配件中溯卡" count autoHeight maxlength="250" height="100" confirmType="done"></u--textarea>
|
|
37
|
42
|
</u-form-item>
|
|
38
|
43
|
<u-form-item label="商品分类" required prop="type" borderBottom>
|
|
39
|
|
- <TabSelect :tabList="typeList" @tabChange="handleTabChangeType" :colNum="4" mode="single">
|
|
|
44
|
+ <TabSelect :tabList="typeList" :isClear="typeIsClear" @tabChange="handleTabChangeType"
|
|
|
45
|
+ :colNum="4" mode="single">
|
|
40
|
46
|
</TabSelect>
|
|
41
|
47
|
</u-form-item>
|
|
42
|
|
- <u-form-item label="品牌" required prop="brand" class="u-form-item-row" borderBottom @click="showBrandList">
|
|
43
|
|
- <FormSelectToPage :val="formData.brand"></FormSelectToPage>
|
|
|
48
|
+ <u-form-item label="品牌" required prop="dictLabel" class="u-form-item-row" borderBottom
|
|
|
49
|
+ @click="showBrandList">
|
|
|
50
|
+ <FormSelectToPage :val="formData.dictLabel"></FormSelectToPage>
|
|
|
51
|
+ <BrandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></BrandList>
|
|
44
|
52
|
</u-form-item>
|
|
45
|
53
|
<u-form-item label="系列" class="u-form-item-row" borderBottom>
|
|
46
|
54
|
<u--input v-model="formData.series" placeholder="请输入" clearable border="none"></u--input>
|
|
|
@@ -49,7 +57,7 @@
|
|
49
|
57
|
<u--input v-model="formData.model" placeholder="请输入" clearable border="none"></u--input>
|
|
50
|
58
|
</u-form-item>
|
|
51
|
59
|
<u-form-item label="机芯类型" class="u-form-item-row" borderBottom>
|
|
52
|
|
- <u--input v-model="formData.brand" placeholder="请输入" clearable border="none"></u--input>
|
|
|
60
|
+ <u--input v-model="formData.dialType" placeholder="请输入" clearable border="none"></u--input>
|
|
53
|
61
|
</u-form-item>
|
|
54
|
62
|
<u-form-item label="表壳材质" class="u-form-item-row" borderBottom>
|
|
55
|
63
|
<u--input v-model="formData.caseMaterial" placeholder="请输入" clearable border="none"></u--input>
|
|
|
@@ -70,14 +78,28 @@
|
|
70
|
78
|
<u--input v-model="formData.price" placeholder="请输入" clearable border="none"></u--input>
|
|
71
|
79
|
</u-form-item>
|
|
72
|
80
|
<u-form-item label="商品成色" required prop="productCondition" borderBottom>
|
|
73
|
|
- <TabSelect :tabList="productConditionList" :colNum="2" mode="single"
|
|
74
|
|
- @tabChange="handleTabChangeProductCondition"></TabSelect>
|
|
|
81
|
+ <TabSelect :tabList="productConditionList" :isClear="productConditionIsClear"
|
|
|
82
|
+ @tabChange="handleTabChangeProductCondition" :colNum="2" mode="single"></TabSelect>
|
|
75
|
83
|
</u-form-item>
|
|
76
|
84
|
<u-form-item label="细节图" borderBottom>
|
|
77
|
|
- <u-upload :fileList="detailVideoFileList" @afterRead="afterReadDeatilVideo"
|
|
78
|
|
- @delete="deleteDetailVideo" name="2" multiple :maxCount="10" accept="video"></u-upload>
|
|
79
|
|
- <u-upload :fileList="detailPicFileList" @afterRead="afterReadDetailPic"
|
|
80
|
|
- @delete="deleteDetailPic" name="1" multiple :maxCount="10"></u-upload>
|
|
|
85
|
+ <view class="detail_pic_container">
|
|
|
86
|
+ <!-- <view>
|
|
|
87
|
+ <text class="tip">视频:</text>
|
|
|
88
|
+ <ImgsRowScroll v-if="formData.detailVideoFileList.length > 0" :isShowDeleteIcon="true"
|
|
|
89
|
+ @deleteVideoInfo="getDeleteDetailVideoInfo" imgMode="aspectFill" :totalWidth="400"
|
|
|
90
|
+ :videos="formData.detailVideoFileList" :previewEnabled="true" :imageWidth="150"
|
|
|
91
|
+ :imageHeight="150" accept="video"></ImgsRowScroll>
|
|
|
92
|
+ <u-upload @afterRead="afterReadDeatilVideo" name="2" multiple :maxCount="10" accept="video"></u-upload>
|
|
|
93
|
+ </view> -->
|
|
|
94
|
+ <view>
|
|
|
95
|
+ <!-- <text class="tip">图片:</text> -->
|
|
|
96
|
+ <ImgsRowScroll v-if="formData.detailPicFileList.length > 0" :isShowDeleteIcon="true"
|
|
|
97
|
+ @deleteImgInfo="getDeleteDetailPicInfo" imgMode="aspectFill" :totalWidth="400"
|
|
|
98
|
+ :images="formData.detailPicFileList" :previewEnabled="true" :imageWidth="150"
|
|
|
99
|
+ :imageHeight="150"></ImgsRowScroll>
|
|
|
100
|
+ <u-upload @afterRead="afterReadDetailPic" name="1" multiple :maxCount="10"></u-upload>
|
|
|
101
|
+ </view>
|
|
|
102
|
+ </view>
|
|
81
|
103
|
</u-form-item>
|
|
82
|
104
|
<u-form-item label="商品标题" borderBottom>
|
|
83
|
105
|
<u--textarea v-model="formData.title" clearable :placeholder="titlePlaceholder" count autoHeight
|
|
|
@@ -87,8 +109,9 @@
|
|
87
|
109
|
<u--input v-model="formData.productNo" placeholder="请输入" clearable border="none"></u--input>
|
|
88
|
110
|
</u-form-item>
|
|
89
|
111
|
<u-form-item label="商品属性" required prop="productAttribute" borderBottom>
|
|
90
|
|
- <TabSelect :tabList="productAttributeList" :colNum="4" mode="single"
|
|
91
|
|
- @tabChange="handleTabChangeProductAttribute"></TabSelect>
|
|
|
112
|
+ <TabSelect :tabList="productAttributeList" :colNum="4" mode="single"
|
|
|
113
|
+ :isClear="productAttributeIsClear" @tabChange="handleTabChangeProductAttribute">
|
|
|
114
|
+ </TabSelect>
|
|
92
|
115
|
</u-form-item>
|
|
93
|
116
|
<u-form-item label="库存数量" required prop="stock" class="u-form-item-row" borderBottom>
|
|
94
|
117
|
<u--input v-model="formData.stock" placeholder="请输入" clearable border="none"></u--input>
|
|
|
@@ -112,24 +135,37 @@
|
|
112
|
135
|
<u-form-item label="手表年份" class="u-form-item-row" borderBottom>
|
|
113
|
136
|
<u--input v-model="formData.watchYear" placeholder="请输入" clearable border="none"></u--input>
|
|
114
|
137
|
</u-form-item>
|
|
115
|
|
- <u-form-item label="鉴定人员" class="u-form-item-row" borderBottom>
|
|
116
|
|
- <u--input v-model="formData.identifyingPerson" placeholder="请输入" clearable
|
|
117
|
|
- border="none"></u--input>
|
|
|
138
|
+ <u-form-item label="鉴定人员" class="u-form-item-row" borderBottom @click="identifyingPersonClick">
|
|
|
139
|
+ <FormSelectToPage :val="formData.identifyingPerson" :isDelete="true"
|
|
|
140
|
+ @handleClear="clear('identifyingPerson')"></FormSelectToPage>
|
|
|
141
|
+ <PersonPicker ref="identifyingPersonPickerRef" title="请选择鉴定人员"
|
|
|
142
|
+ @selectPerson="handleSelectIdentifyingPerson"></PersonPicker>
|
|
118
|
143
|
</u-form-item>
|
|
119
|
144
|
<u-form-item label="回收类型" borderBottom>
|
|
120
|
|
- <TabSelect :tabList="recycleTypeList" :colNum="4" mode="single"
|
|
121
|
|
- @tabChange="handleTabChangeRecycleType">
|
|
|
145
|
+ <TabSelect :tabList="recycleTypeList" :colNum="4" mode="single"
|
|
|
146
|
+ :isClear="recycleTypeIsClear" @tabChange="handleTabChangeRecycleType">
|
|
122
|
147
|
</TabSelect>
|
|
123
|
148
|
</u-form-item>
|
|
124
|
|
- <u-form-item label="回收人员" class="u-form-item-row" borderBottom>
|
|
125
|
|
- <u--input v-model="formData.recyclePerson" disabledColor="#fff" disabled clearable border="none"></u--input>
|
|
|
149
|
+ <u-form-item label="回收人员" class="u-form-item-row" borderBottom @click="recyclePersonClick">
|
|
|
150
|
+ <!-- <u--input v-model="formData.recyclePerson" disabledColor="#fff" disabled clearable
|
|
|
151
|
+ border="none"></u--input> -->
|
|
|
152
|
+ <FormSelectToPage :val="formData.recyclePerson" :isDelete="true"
|
|
|
153
|
+ @handleClear="clear('recyclePerson')"></FormSelectToPage>
|
|
|
154
|
+ <PersonPicker ref="recyclePersonPickerRef" title="请选择回收人员"
|
|
|
155
|
+ @selectPerson="handleSelectRecyclePerson"></PersonPicker>
|
|
126
|
156
|
</u-form-item>
|
|
127
|
157
|
<u-form-item label="回收留底图" borderBottom>
|
|
128
|
158
|
<view class="recycle_bottom_desc">
|
|
129
|
159
|
<u--textarea v-model="formData.recycleBottomDesc" clearable count autoHeight maxlength="250"
|
|
130
|
160
|
height="100" confirmType="done"></u--textarea>
|
|
131
|
|
- <u-upload :fileList="recycleBottomFileList" @afterRead="afterReadRecycleBottom"
|
|
132
|
|
- @delete="deleteRecycleBottom" name="1" multiple :maxCount="1" accept="image"></u-upload>
|
|
|
161
|
+ <view>
|
|
|
162
|
+ <ImgsRowScroll v-if="formData.recycleBottomPicList.length > 0" :isShowDeleteIcon="true"
|
|
|
163
|
+ @deleteImgInfo="getDeleteRecycleBottomPicInfo" imgMode="aspectFill"
|
|
|
164
|
+ :totalWidth="400" :images="formData.recycleBottomPicList" :previewEnabled="true"
|
|
|
165
|
+ :imageWidth="150" :imageHeight="150"></ImgsRowScroll>
|
|
|
166
|
+ <u-upload @afterRead="afterReadRecycleBottom" name="1" multiple :maxCount="1"
|
|
|
167
|
+ accept="image"></u-upload>
|
|
|
168
|
+ </view>
|
|
133
|
169
|
</view>
|
|
134
|
170
|
</u-form-item>
|
|
135
|
171
|
<u-form-item label="回收时间" required prop="recycleTime" class="u-form-item-row" borderBottom
|
|
|
@@ -162,8 +198,11 @@
|
|
162
|
198
|
border="none"></u--input>
|
|
163
|
199
|
</u-form-item>
|
|
164
|
200
|
<u-form-item label="保卡图片或独立编码照片留底(仅内部人员可见)" borderBottom>
|
|
165
|
|
- <u-upload :fileList="productCardFileList" @afterRead="afterReadProductCard"
|
|
166
|
|
- @delete="deleteProductCard" name="3" multiple :maxCount="9"
|
|
|
201
|
+ <ImgsRowScroll v-if="formData.productCardPicFileList.length > 0" :isShowDeleteIcon="true"
|
|
|
202
|
+ @deleteImgInfo="getDeleteProductCardPicInfo" imgMode="aspectFill" :totalWidth="400"
|
|
|
203
|
+ :images="formData.productCardPicFileList" :previewEnabled="true" :imageWidth="150"
|
|
|
204
|
+ :imageHeight="150"></ImgsRowScroll>
|
|
|
205
|
+ <u-upload @afterRead="afterReadProductCardPic" name="3" multiple :maxCount="9"
|
|
167
|
206
|
:previewFullImage="true"></u-upload>
|
|
168
|
207
|
</u-form-item>
|
|
169
|
208
|
<u-form-item label="商品标签" class="u-form-item-row" borderBottom>
|
|
|
@@ -177,13 +216,19 @@
|
|
177
|
216
|
<view class="recycle_bottom_desc">
|
|
178
|
217
|
<u--textarea v-model="formData.productDesc" clearable count autoHeight maxlength="250"
|
|
179
|
218
|
height="100" confirmType="done"></u--textarea>
|
|
180
|
|
- <u-upload :fileList="productCardFileList" @afterRead="afterReadProductCard"
|
|
181
|
|
- @delete="deleteProductCard" name="1" multiple :maxCount="1" accept="image"></u-upload>
|
|
|
219
|
+ <view>
|
|
|
220
|
+ <ImgsRowScroll v-if="formData.productDescPicFileList.length > 0"
|
|
|
221
|
+ :isShowDeleteIcon="true" @deleteImgInfo="getDeleteProductDescPicInfo"
|
|
|
222
|
+ imgMode="aspectFill" :totalWidth="400" :images="formData.productDescPicFileList"
|
|
|
223
|
+ :previewEnabled="true" :imageWidth="150" :imageHeight="150"></ImgsRowScroll>
|
|
|
224
|
+ <u-upload @afterRead="afterReadProductDescPic" name="1" multiple :maxCount="1"
|
|
|
225
|
+ accept="image"></u-upload>
|
|
|
226
|
+ </view>
|
|
182
|
227
|
</view>
|
|
183
|
228
|
</u-form-item>
|
|
184
|
229
|
<u-form-item label="付款方式" borderBottom>
|
|
185
|
|
- <TabSelect :tabList="paymentTabList" :echoInfo="payTypeEcho" :colNum="4" mode="single"
|
|
186
|
|
- @tabChange="handlePaymentTabChange">
|
|
|
230
|
+ <TabSelect :tabList="paymentTabList" :echoInfo="payTypeEcho" :colNum="4" mode="single"
|
|
|
231
|
+ :isClear="payTypeIsClear" @tabChange="handlePayTypeTabChange">
|
|
187
|
232
|
</TabSelect>
|
|
188
|
233
|
</u-form-item>
|
|
189
|
234
|
</u--form>
|
|
|
@@ -194,31 +239,36 @@
|
|
194
|
239
|
<u-button plain type="primary" @click="submitForm('onlyIn')">仅入库</u-button>
|
|
195
|
240
|
<u-button type="primary" @click="submitForm('inAndUp')">入库并上架</u-button>
|
|
196
|
241
|
</view>
|
|
197
|
|
- <BrandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></BrandList>
|
|
198
|
242
|
</view>
|
|
199
|
243
|
</template>
|
|
200
|
244
|
<script>
|
|
201
|
245
|
import TabSelect from '@/components/custom-tab-select/index.vue'
|
|
202
|
246
|
import FormSelectToPage from '@/components/form-select-to-page/index.vue'
|
|
203
|
247
|
import BrandList from '@/components/brand-list/index.vue'
|
|
|
248
|
+import ImgsRowScroll from '@/components/imgs-row-scroll/index.vue'
|
|
|
249
|
+import PersonPicker from '@/components/person-picker/index.vue'
|
|
|
250
|
+
|
|
204
|
251
|
export default {
|
|
205
|
252
|
components: {
|
|
206
|
253
|
TabSelect,
|
|
207
|
254
|
FormSelectToPage,
|
|
208
|
255
|
BrandList,
|
|
|
256
|
+ ImgsRowScroll,
|
|
|
257
|
+ PersonPicker
|
|
209
|
258
|
},
|
|
210
|
259
|
data() {
|
|
211
|
260
|
return {
|
|
212
|
261
|
checkboxValue: [],
|
|
213
|
262
|
recognitionContent: '',
|
|
214
|
263
|
formData: {
|
|
215
|
|
- imgs: [],
|
|
|
264
|
+ goodPicFileList: [],//商品图片
|
|
216
|
265
|
desc: '',
|
|
217
|
266
|
type: '',
|
|
218
|
|
- brand: '',
|
|
219
|
|
- brandId: '',
|
|
|
267
|
+ dictLabel: '',
|
|
|
268
|
+ dictValue: '',
|
|
220
|
269
|
series: '',
|
|
221
|
270
|
model: '',
|
|
|
271
|
+ dialType: '',
|
|
222
|
272
|
caseMaterial: '',
|
|
223
|
273
|
dialDiameter: '',
|
|
224
|
274
|
material: '',
|
|
|
@@ -226,6 +276,8 @@ export default {
|
|
226
|
276
|
yardage: '',
|
|
227
|
277
|
price: '',
|
|
228
|
278
|
productCondition: '',
|
|
|
279
|
+ detailPicFileList: [],//细节图片
|
|
|
280
|
+ // detailVideoFileList:[],
|
|
229
|
281
|
productNo: '',
|
|
230
|
282
|
stock: null,
|
|
231
|
283
|
costPrice: '',
|
|
|
@@ -235,21 +287,27 @@ export default {
|
|
235
|
287
|
productPosition: '',
|
|
236
|
288
|
watchYear: '',
|
|
237
|
289
|
identifyingPerson: '',
|
|
|
290
|
+ identifyingPersonId: '',
|
|
238
|
291
|
recycleType: '',
|
|
239
|
292
|
recyclePerson: '',
|
|
|
293
|
+ recyclePersonId: '',
|
|
240
|
294
|
recycleBottomDesc: '',
|
|
241
|
|
- recycleTime: null,
|
|
|
295
|
+ recycleBottomPicList: [],//回收留底图
|
|
|
296
|
+ recycleTime: this.$dayjs().format('YYYY-MM-DD'),
|
|
242
|
297
|
indentifyCode: '',
|
|
243
|
298
|
targetAudience: '',
|
|
244
|
299
|
productCard: '',
|
|
245
|
300
|
cardYear: '',
|
|
|
301
|
+ productCardPicFileList: [],//商品保卡图片或独立编码照片留底
|
|
246
|
302
|
productTag: '',
|
|
247
|
303
|
productAttachment: '',
|
|
248
|
304
|
productDesc: '',
|
|
249
|
|
- paymentType: '',
|
|
|
305
|
+ productDescPicFileList: [],//商品备注图片
|
|
|
306
|
+ payType: '',
|
|
250
|
307
|
},
|
|
|
308
|
+ continuousWarehousing: [],//是否连续入库 1:是 0:否
|
|
251
|
309
|
rules: {
|
|
252
|
|
- imgs: [
|
|
|
310
|
+ goodPicFileList: [
|
|
253
|
311
|
{ required: true, message: '请上传商品图片', trigger: 'blur' },
|
|
254
|
312
|
],
|
|
255
|
313
|
desc: [
|
|
|
@@ -258,7 +316,7 @@ export default {
|
|
258
|
316
|
type: [
|
|
259
|
317
|
{ required: true, message: '请选择商品分类', trigger: 'blur' },
|
|
260
|
318
|
],
|
|
261
|
|
- brand: [
|
|
|
319
|
+ dictLabel: [
|
|
262
|
320
|
{ required: true, message: '请选择品牌', trigger: 'blur' },
|
|
263
|
321
|
],
|
|
264
|
322
|
productCondition: [
|
|
|
@@ -337,19 +395,19 @@ export default {
|
|
337
|
395
|
],
|
|
338
|
396
|
recycleTypeList: [
|
|
339
|
397
|
{
|
|
340
|
|
- name: '其它',
|
|
|
398
|
+ name: '线上',
|
|
341
|
399
|
value: '1',
|
|
342
|
400
|
},
|
|
343
|
401
|
{
|
|
344
|
|
- name: '线上',
|
|
|
402
|
+ name: '同行',
|
|
345
|
403
|
value: '2',
|
|
346
|
404
|
},
|
|
347
|
405
|
{
|
|
348
|
|
- name: '同行',
|
|
|
406
|
+ name: '门店',
|
|
349
|
407
|
value: '3',
|
|
350
|
408
|
},
|
|
351
|
409
|
{
|
|
352
|
|
- name: '门店',
|
|
|
410
|
+ name: '其它',
|
|
353
|
411
|
value: '4',
|
|
354
|
412
|
},
|
|
355
|
413
|
],
|
|
|
@@ -379,39 +437,127 @@ export default {
|
|
379
|
437
|
value: 6,
|
|
380
|
438
|
},
|
|
381
|
439
|
],
|
|
382
|
|
- brandToUrl: '/pages/wareHouse/components/brandList',
|
|
383
|
|
- // 上传
|
|
384
|
|
- goodPicFileList: [{ url: 'https://uviewui.com/swiper/1.jpg' }],//商品图片
|
|
385
|
|
- detailPicFileList: [],//细节图片
|
|
386
|
|
- detailVideoFileList: [],//细节视频
|
|
387
|
|
- recycleBottomFileList: [],//回收留底图
|
|
388
|
|
- productCardFileList: [],//商品保卡图片或独立编码照片留底
|
|
389
|
|
- productTagFileList: [],//商品标签图片留底
|
|
390
|
|
- payTypeEcho:''//付款方式识别回显
|
|
|
440
|
+ typeIsClear: false,//商品分类是否清空
|
|
|
441
|
+ productConditionIsClear: false,//商品成色是否清空
|
|
|
442
|
+ productAttributeIsClear: false,//商品属性是否清空
|
|
|
443
|
+ recycleTypeIsClear: false,//回收类型是否清空
|
|
|
444
|
+ payTypeIsClear: false,//付款方式是否清空
|
|
|
445
|
+ payTypeEcho: ''//付款方式识别回显
|
|
391
|
446
|
}
|
|
392
|
447
|
},
|
|
393
|
448
|
methods: {
|
|
394
|
|
- handleSelectedBrand(info) {
|
|
395
|
|
- this.formData.brand = info.dictLabel;
|
|
396
|
|
- this.formData.brandId = info.dictValue;
|
|
397
|
|
- },
|
|
398
|
|
- // 显示品牌列表
|
|
399
|
|
- showBrandList() {
|
|
400
|
|
- this.$refs.brandListRef.showBrandList();
|
|
401
|
|
- },
|
|
402
|
|
- submitForm() {
|
|
|
449
|
+ // 提交表单
|
|
|
450
|
+ submitForm(submitType) {
|
|
403
|
451
|
this.$refs.addForm.validate().then((valid) => {
|
|
404
|
452
|
if (valid) {
|
|
405
|
|
- console.log('表单校验通过');
|
|
|
453
|
+ if (this.formData.title == '') {
|
|
|
454
|
+ this.formData.title = this.formData.desc.substring(0, 50);
|
|
|
455
|
+ }
|
|
|
456
|
+ const data = {
|
|
|
457
|
+ ...this.formData,
|
|
|
458
|
+ submitType: submitType, //提交类型 onlyIn:仅入库 inAndUp:入库并上架
|
|
|
459
|
+ continuousWarehousing: this.continuousWarehousing[0] || '0',//是否连续入库 1:是 0:否
|
|
|
460
|
+ }
|
|
|
461
|
+ uni.$u.api.wareHouseAdd(data).then(res => {
|
|
|
462
|
+ console.log(res);
|
|
|
463
|
+ if (res.code === 200) {
|
|
|
464
|
+ uni.$u.toast('新增成功');
|
|
|
465
|
+ if (data.continuousWarehousing == '0') {
|
|
|
466
|
+ setTimeout(() => {
|
|
|
467
|
+ uni.navigateBack({
|
|
|
468
|
+ delta: 1
|
|
|
469
|
+ });
|
|
|
470
|
+ }, 1000);
|
|
|
471
|
+ } else {
|
|
|
472
|
+ this.clearForm();
|
|
|
473
|
+ }
|
|
|
474
|
+ } else {
|
|
|
475
|
+ uni.$u.toast(res.msg);
|
|
|
476
|
+ }
|
|
|
477
|
+ })
|
|
406
|
478
|
} else {
|
|
407
|
479
|
console.log('表单校验不通过');
|
|
408
|
480
|
}
|
|
409
|
481
|
});
|
|
410
|
482
|
},
|
|
411
|
|
- handleTabChange(e) {
|
|
412
|
|
- console.log(e);
|
|
|
483
|
+ clearForm() {
|
|
|
484
|
+ this.formData = {
|
|
|
485
|
+ goodPicFileList: [],//商品图片
|
|
|
486
|
+ desc: '',
|
|
|
487
|
+ type: '',
|
|
|
488
|
+ dictLabel: '',
|
|
|
489
|
+ dictValue: '',
|
|
|
490
|
+ series: '',
|
|
|
491
|
+ model: '',
|
|
|
492
|
+ dialType: '',
|
|
|
493
|
+ caseMaterial: '',
|
|
|
494
|
+ dialDiameter: '',
|
|
|
495
|
+ material: '',
|
|
|
496
|
+ size: '',
|
|
|
497
|
+ yardage: '',
|
|
|
498
|
+ price: '',
|
|
|
499
|
+ productCondition: '',
|
|
|
500
|
+ detailPicFileList: [],//细节图片
|
|
|
501
|
+ // detailVideoFileList:[],
|
|
|
502
|
+ productNo: '',
|
|
|
503
|
+ stock: null,
|
|
|
504
|
+ costPrice: '',
|
|
|
505
|
+ samePrice: '',
|
|
|
506
|
+ agentPrice: '',
|
|
|
507
|
+ salePrice: '',
|
|
|
508
|
+ productPosition: '',
|
|
|
509
|
+ watchYear: '',
|
|
|
510
|
+ identifyingPerson: '',
|
|
|
511
|
+ identifyingPersonId: '',
|
|
|
512
|
+ recycleType: '',
|
|
|
513
|
+ recyclePerson: '',
|
|
|
514
|
+ recyclePersonId: '',
|
|
|
515
|
+ recycleBottomDesc: '',
|
|
|
516
|
+ recycleBottomPicList: [],//回收留底图
|
|
|
517
|
+ recycleTime: this.$dayjs().format('YYYY-MM-DD'),
|
|
|
518
|
+ indentifyCode: '',
|
|
|
519
|
+ targetAudience: '',
|
|
|
520
|
+ productCard: '',
|
|
|
521
|
+ cardYear: '',
|
|
|
522
|
+ productCardPicFileList: [],//商品保卡图片或独立编码照片留底
|
|
|
523
|
+ productTag: '',
|
|
|
524
|
+ productAttachment: '',
|
|
|
525
|
+ productDesc: '',
|
|
|
526
|
+ productDescPicFileList: [],//商品备注图片
|
|
|
527
|
+ payType: '',
|
|
|
528
|
+ }
|
|
|
529
|
+ this.typeIsClear = true;
|
|
|
530
|
+ this.productConditionIsClear = true;
|
|
|
531
|
+ this.productAttributeIsClear = true;
|
|
|
532
|
+ this.recycleTypeIsClear = true;
|
|
|
533
|
+ this.payTypeIsClear = true;
|
|
|
534
|
+ this.continuousWarehousing = [];
|
|
|
535
|
+ this.$refs.addForm.resetFields();
|
|
|
536
|
+ },
|
|
|
537
|
+ // 选择品牌
|
|
|
538
|
+ handleSelectedBrand(info) {
|
|
|
539
|
+ this.formData.dictLabel = info.dictLabel;
|
|
|
540
|
+ this.formData.dictValue = info.dictValue;
|
|
|
541
|
+ this.$refs.addForm.validateField('dictLabel');
|
|
|
542
|
+ },
|
|
|
543
|
+ // 显示品牌列表
|
|
|
544
|
+ showBrandList() {
|
|
|
545
|
+ this.$refs.brandListRef.showBrandList();
|
|
413
|
546
|
},
|
|
|
547
|
+ // 清空输入框
|
|
414
|
548
|
clear(key) {
|
|
|
549
|
+ // 鉴定人
|
|
|
550
|
+ if (key == 'identifyingPerson') {
|
|
|
551
|
+ this.formData.identifyingPerson = '';
|
|
|
552
|
+ this.formData.identifyingPersonId = '';
|
|
|
553
|
+ return;
|
|
|
554
|
+ }
|
|
|
555
|
+ // 回收人
|
|
|
556
|
+ if (key == 'recyclePerson') {
|
|
|
557
|
+ this.formData.recyclePerson = '';
|
|
|
558
|
+ this.formData.recyclePersonId = '';
|
|
|
559
|
+ return;
|
|
|
560
|
+ }
|
|
415
|
561
|
this.formData[key] = '';
|
|
416
|
562
|
},
|
|
417
|
563
|
// 商品分类
|
|
|
@@ -435,90 +581,116 @@ export default {
|
|
435
|
581
|
this.formData.recycleType = e;
|
|
436
|
582
|
},
|
|
437
|
583
|
// 付款方式
|
|
438
|
|
- handlePaymentTabChange(e) {
|
|
439
|
|
- console.log(e);
|
|
|
584
|
+ handlePayTypeTabChange(e) {
|
|
|
585
|
+ this.formData.payType = e;
|
|
440
|
586
|
},
|
|
|
587
|
+ // 打开回收时间选择器
|
|
441
|
588
|
clickRecycleTimeRow() {
|
|
442
|
589
|
this.recycleTimeShow = true;
|
|
443
|
590
|
},
|
|
|
591
|
+ // 确认回收时间
|
|
444
|
592
|
confirmRecycleTime(val) {
|
|
445
|
|
- this.formData.recycleTime = this.$dayjs(val.value).format('YYYY-MM-DD');
|
|
446
|
|
- console.log(val, this.formData.recycleTime);
|
|
447
|
|
- this.recycleTimeShow = false;
|
|
|
593
|
+ this.$nextTick(() => {
|
|
|
594
|
+ this.formData.recycleTime = this.$dayjs(val.value).format('YYYY-MM-DD');
|
|
|
595
|
+ this.recycleTimeShow = false;
|
|
|
596
|
+ })
|
|
448
|
597
|
},
|
|
|
598
|
+ // 关闭回收时间选择器
|
|
449
|
599
|
closeRecycleTimePicker(val) {
|
|
450
|
600
|
this.recycleTimeShow = false;
|
|
451
|
601
|
},
|
|
452
|
|
- cancelRecycleTimePicker(val) {
|
|
453
|
|
- console.log(val);
|
|
454
|
|
- this.recycleTimeShow = false;
|
|
|
602
|
+ // 打开鉴定人选择器
|
|
|
603
|
+ identifyingPersonClick() {
|
|
|
604
|
+ this.$refs.identifyingPersonPickerRef.open();
|
|
455
|
605
|
},
|
|
456
|
|
- recycleTimeFormatter(value) {
|
|
457
|
|
- if (value) {
|
|
458
|
|
- console.log(value);
|
|
459
|
|
-
|
|
460
|
|
- }
|
|
461
|
|
- return ''
|
|
|
606
|
+ // 选择鉴定人
|
|
|
607
|
+ handleSelectIdentifyingPerson(info) {
|
|
|
608
|
+ this.formData.identifyingPerson = info.label;
|
|
|
609
|
+ this.formData.identifyingPersonId = info.id;
|
|
|
610
|
+ },
|
|
|
611
|
+ // 打开回收人选择器
|
|
|
612
|
+ recyclePersonClick() {
|
|
|
613
|
+ this.$refs.recyclePersonPickerRef.open();
|
|
462
|
614
|
},
|
|
463
|
|
- // 删除商品图片
|
|
464
|
|
- deleteGoodPic(event) {
|
|
465
|
|
- console.log(event);
|
|
466
|
|
- // this[`fileList${event.name}`].splice(event.index, 1);
|
|
|
615
|
+ // 选择回收人
|
|
|
616
|
+ handleSelectRecyclePerson(info) {
|
|
|
617
|
+ this.formData.recyclePerson = info.label;
|
|
|
618
|
+ this.formData.recyclePersonId = info.id;
|
|
467
|
619
|
},
|
|
468
|
620
|
// 新增商品图片
|
|
469
|
621
|
async afterReadGoodPic(event) {
|
|
470
|
|
- console.log(event);
|
|
471
|
|
- // this.fileList = [...this.fileList, ...event.fileList];
|
|
472
|
|
- },
|
|
473
|
|
- // 删除细节视频
|
|
474
|
|
- deleteVideo(event) {
|
|
475
|
|
- console.log(event);
|
|
476
|
|
- // this[`fileList${event.name}`].splice(event.index, 1);
|
|
|
622
|
+ event.file.forEach(item => {
|
|
|
623
|
+ uni.$u.api.uploadFile(item.url).then((res) => {
|
|
|
624
|
+ this.formData.goodPicFileList.push(res.data.url);
|
|
|
625
|
+ uni.$u.toast("文件上传成功");
|
|
|
626
|
+ }).catch(() => {
|
|
|
627
|
+ uni.$u.toast("上传文件失败");
|
|
|
628
|
+ })
|
|
|
629
|
+ })
|
|
477
|
630
|
},
|
|
478
|
|
- // 新增细节视频
|
|
479
|
|
- async afterReadVideo(event) {
|
|
480
|
|
- console.log(event);
|
|
481
|
|
- // this.fileList2 = [...this.fileList2, ...event.fileList];
|
|
|
631
|
+ // 获取删除商品图片信息
|
|
|
632
|
+ getDeleteGoodPicInfo(info) {
|
|
|
633
|
+ this.formData.goodPicFileList = info.newImages
|
|
482
|
634
|
},
|
|
483
|
|
- // 删除细节图片
|
|
484
|
|
- deleteDetailPic(event) {
|
|
485
|
|
- console.log(event);
|
|
486
|
|
- // this[`fileList${event.name}`].splice(event.index, 1);
|
|
|
635
|
+ // 获取删除细节图片信息
|
|
|
636
|
+ getDeleteDetailPicInfo(info) {
|
|
|
637
|
+ this.formData.detailPicFileList = info.newImages
|
|
487
|
638
|
},
|
|
488
|
639
|
// 新增细节图片
|
|
489
|
640
|
async afterReadDetailPic(event) {
|
|
490
|
|
- console.log(event);
|
|
491
|
|
- // this.fileList1 = [...this.fileList1, ...event.fileList];
|
|
|
641
|
+ event.file.forEach(item => {
|
|
|
642
|
+ uni.$u.api.uploadFile(item.url).then((res) => {
|
|
|
643
|
+ this.formData.detailPicFileList.push(res.data.url);
|
|
|
644
|
+ uni.$u.toast("文件上传成功");
|
|
|
645
|
+ }).catch(() => {
|
|
|
646
|
+ uni.$u.toast("上传文件失败");
|
|
|
647
|
+ })
|
|
|
648
|
+ })
|
|
492
|
649
|
},
|
|
493
|
|
- // 删除回收留底图
|
|
494
|
|
- deleteRecycleBottom(event) {
|
|
495
|
|
- console.log(event);
|
|
496
|
|
- // this[`fileList${event.name}`].splice(event.index, 1);
|
|
|
650
|
+ // 获取删除回收留底图信息
|
|
|
651
|
+ getDeleteRecycleBottomPicInfo(info) {
|
|
|
652
|
+ this.formData.recycleBottomPicList = info.newImages
|
|
497
|
653
|
},
|
|
498
|
654
|
// 新增回收留底图
|
|
499
|
655
|
async afterReadRecycleBottom(event) {
|
|
500
|
|
- console.log(event);
|
|
501
|
|
- // this.fileList3 = [...this.fileList3, ...event.fileList];
|
|
|
656
|
+ event.file.forEach(item => {
|
|
|
657
|
+ uni.$u.api.uploadFile(item.url).then((res) => {
|
|
|
658
|
+ this.formData.recycleBottomPicList.push(res.data.url);
|
|
|
659
|
+ uni.$u.toast("文件上传成功");
|
|
|
660
|
+ }).catch(() => {
|
|
|
661
|
+ uni.$u.toast("上传文件失败");
|
|
|
662
|
+ })
|
|
|
663
|
+ })
|
|
502
|
664
|
},
|
|
503
|
665
|
// 删除商品保卡图片或独立编码照片留底
|
|
504
|
|
- deleteProductCard(event) {
|
|
505
|
|
- console.log(event);
|
|
506
|
|
- // this[`fileList${event.name}`].splice(event.index, 1);
|
|
|
666
|
+ getDeleteProductCardPicInfo(info) {
|
|
|
667
|
+ this.formData.productCardPicFileList = info.newImages
|
|
507
|
668
|
},
|
|
508
|
669
|
// 新增商品保卡图片或独立编码照片留底
|
|
509
|
|
- async afterReadProductCard(event) {
|
|
510
|
|
- console.log(event);
|
|
511
|
|
- // this.fileList4 = [...this.fileList4, ...event.fileList];
|
|
|
670
|
+ async afterReadProductCardPic(event) {
|
|
|
671
|
+ event.file.forEach(item => {
|
|
|
672
|
+ uni.$u.api.uploadFile(item.url).then((res) => {
|
|
|
673
|
+ this.formData.productCardPicFileList.push(res.data.url);
|
|
|
674
|
+ uni.$u.toast("文件上传成功");
|
|
|
675
|
+ }).catch(() => {
|
|
|
676
|
+ uni.$u.toast("上传文件失败");
|
|
|
677
|
+ })
|
|
|
678
|
+ })
|
|
512
|
679
|
},
|
|
513
|
|
- // 删除商品标签图片留底
|
|
514
|
|
- deleteProductTag(event) {
|
|
515
|
|
- console.log(event);
|
|
516
|
|
- // this[`fileList${event.name}`].splice(event.index, 1);
|
|
|
680
|
+ // 获取删除商品备注图片信息
|
|
|
681
|
+ getDeleteProductDescPicInfo(info) {
|
|
|
682
|
+ this.formData.productDescPicFileList = info.newImages
|
|
517
|
683
|
},
|
|
518
|
|
- // 新增商品标签图片留底
|
|
519
|
|
- async afterReadProductTag(event) {
|
|
520
|
|
- console.log(event);
|
|
521
|
|
- // this.fileList5 = [...this.fileList5, ...event.fileList];
|
|
|
684
|
+ // 新增商品备注图片
|
|
|
685
|
+ async afterReadProductDescPic(event) {
|
|
|
686
|
+ event.file.forEach(item => {
|
|
|
687
|
+ uni.$u.api.uploadFile(item.url).then((res) => {
|
|
|
688
|
+ this.formData.productDescPicFileList.push(res.data.url);
|
|
|
689
|
+ uni.$u.toast("文件上传成功");
|
|
|
690
|
+ }).catch(() => {
|
|
|
691
|
+ uni.$u.toast("上传文件失败");
|
|
|
692
|
+ })
|
|
|
693
|
+ })
|
|
522
|
694
|
},
|
|
523
|
695
|
async handlePasteRecognition(text) {
|
|
524
|
696
|
// 品牌:浪琴
|
|
|
@@ -534,55 +706,52 @@ export default {
|
|
534
|
706
|
}
|
|
535
|
707
|
try {
|
|
536
|
708
|
if (!text) return {};
|
|
537
|
|
-
|
|
|
709
|
+
|
|
538
|
710
|
const result = {};
|
|
539
|
711
|
// 支持中文冒号和英文冒号
|
|
540
|
712
|
const lines = text.split(/[\n\r]+/);
|
|
541
|
|
-
|
|
|
713
|
+
|
|
542
|
714
|
lines.forEach(line => {
|
|
543
|
|
- const lineStr = line.trim();
|
|
544
|
|
- if (!lineStr) return;
|
|
545
|
|
-
|
|
546
|
|
- // 尝试中文冒号
|
|
547
|
|
- let separatorIndex = lineStr.indexOf(':');
|
|
548
|
|
- // 如果没有中文冒号,尝试英文冒号
|
|
549
|
|
- if (separatorIndex === -1) {
|
|
550
|
|
- separatorIndex = lineStr.indexOf(':');
|
|
551
|
|
- }
|
|
552
|
|
-
|
|
553
|
|
- if (separatorIndex > 0) {
|
|
554
|
|
- const key = lineStr.substring(0, separatorIndex).trim();
|
|
555
|
|
- const value = lineStr.substring(separatorIndex + 1).trim();
|
|
556
|
|
- result[key] = value;
|
|
557
|
|
- }
|
|
|
715
|
+ const lineStr = line.trim();
|
|
|
716
|
+ if (!lineStr) return;
|
|
|
717
|
+
|
|
|
718
|
+ // 尝试中文冒号
|
|
|
719
|
+ let separatorIndex = lineStr.indexOf(':');
|
|
|
720
|
+ // 如果没有中文冒号,尝试英文冒号
|
|
|
721
|
+ if (separatorIndex === -1) {
|
|
|
722
|
+ separatorIndex = lineStr.indexOf(':');
|
|
|
723
|
+ }
|
|
|
724
|
+
|
|
|
725
|
+ if (separatorIndex > 0) {
|
|
|
726
|
+ const key = lineStr.substring(0, separatorIndex).trim();
|
|
|
727
|
+ const value = lineStr.substring(separatorIndex + 1).trim();
|
|
|
728
|
+ result[key] = value;
|
|
|
729
|
+ }
|
|
558
|
730
|
});
|
|
559
|
|
- console.log(result);
|
|
560
|
|
- if(result['品牌']){
|
|
561
|
|
- this.formData.brand = result['品牌'];
|
|
|
731
|
+ if (result['品牌']) {
|
|
|
732
|
+ this.formData.dictLabel = result['品牌'];
|
|
562
|
733
|
}
|
|
563
|
|
- if(result['来源']){
|
|
|
734
|
+ if (result['来源']) {
|
|
564
|
735
|
this.formData.desc = result['来源'];
|
|
565
|
736
|
}
|
|
566
|
|
- if(result['实价']){
|
|
|
737
|
+ if (result['实价']) {
|
|
567
|
738
|
this.formData.costPrice = result['实价'];
|
|
568
|
739
|
}
|
|
569
|
|
- if(result['型号']){
|
|
|
740
|
+ if (result['型号']) {
|
|
570
|
741
|
this.formData.model = result['型号'];
|
|
571
|
742
|
}
|
|
572
|
|
- if(result['编码']){
|
|
|
743
|
+ if (result['编码']) {
|
|
573
|
744
|
this.formData.indentifyCode = result['编码'];
|
|
574
|
745
|
}
|
|
575
|
|
- if(result['日期']){
|
|
|
746
|
+ if (result['日期']) {
|
|
576
|
747
|
this.formData.recycleTime = result['日期'];
|
|
577
|
748
|
}
|
|
578
|
|
- if(result['备注']){
|
|
|
749
|
+ if (result['备注']) {
|
|
579
|
750
|
this.formData.productDesc = result['备注'];
|
|
580
|
751
|
}
|
|
581
|
|
- if(result['付款方式']){
|
|
582
|
|
- console.log(result['付款方式']);
|
|
583
|
|
-
|
|
|
752
|
+ if (result['付款方式']) {
|
|
584
|
753
|
this.getPaymentType(result['付款方式'])
|
|
585
|
|
- this.formData.paymentType = result['付款方式'];
|
|
|
754
|
+ this.formData.payType = result['付款方式'];
|
|
586
|
755
|
|
|
587
|
756
|
}
|
|
588
|
757
|
// return result;
|
|
|
@@ -590,15 +759,17 @@ export default {
|
|
590
|
759
|
uni.$u.toast("文本识别异常");
|
|
591
|
760
|
}
|
|
592
|
761
|
},
|
|
593
|
|
- clearRecognitionContent(){
|
|
|
762
|
+ // 清空识别内容
|
|
|
763
|
+ clearRecognitionContent() {
|
|
594
|
764
|
this.recognitionContent = '';
|
|
595
|
765
|
},
|
|
|
766
|
+ // 识别内容 回显付款方式
|
|
596
|
767
|
getPaymentType(val) {
|
|
597
|
768
|
let arr = []
|
|
598
|
|
- this.paymentTabList.filter(item=>{
|
|
599
|
|
- if(item.name == val) arr.push(item.value)
|
|
|
769
|
+ this.paymentTabList.filter(item => {
|
|
|
770
|
+ if (item.name == val) arr.push(item.value)
|
|
600
|
771
|
})
|
|
601
|
|
- if(arr.length > 0){
|
|
|
772
|
+ if (arr.length > 0) {
|
|
602
|
773
|
this.payTypeEcho = arr[0]
|
|
603
|
774
|
}
|
|
604
|
775
|
}
|