Bladeren bron

feat:开单记录

zhangxin 1 maand geleden
bovenliggende
commit
b04b210f43

+ 8 - 197
components/add-inquiry-dialog/index.vue

@@ -1,11 +1,10 @@
1 1
 <template>
2 2
 	<view>
3 3
 		<u-modal :show="showModal" ref="uModal" :title="(editOrAdd === 'add' || editOrAdd === 'receptFormAdd') ? '新增' : '编辑'" :asyncClose="false" showCancelButton @cancel="closeDialog" cancelColor="#909399" :confirmText="'确定'" confirmColor="#2979ff" @confirm="confirm" @close="closeDialog" :closeOnClickOverlay="false">
4
-            <u--text type="info" text="输入型号可查看价格趋势"></u--text>
5 4
             <view class="modal_wrap">
6 5
                 <text @click="handleBrandClick" class="item" :class="info.dictLabel ? 'brand' : 'brand placeholder'">{{ info.dictLabel || '品牌' }}</text>
7 6
                 <text class="divider">|</text>
8
-                <u--input placeholder="型号" class="item" border="none" v-model="info.model" clearable @blur="handleModelBlur"></u--input>
7
+                <u--input placeholder="型号" class="item" border="none" v-model="info.model" clearable></u--input>
9 8
                 <text class="divider">|</text>
10 9
                 <u--input class="code-input item" placeholder="编码" border="none" v-model="info.code" clearable></u--input>
11 10
             </view>
@@ -19,12 +18,6 @@
19 18
                 ></u-upload>
20 19
             </view>
21 20
             <u--input v-if="editOrAdd === 'edit'" class="price" placeholder="价格" border="bottom" v-model="info.price" clearable></u--input>
22
-            <view class="charts_box" v-show="chartShow">
23
-                 <u--text type="primary" :text="`最大价格:${Math.max(...maxPrice)}元`"></u--text>
24
-                 <u--text type="warning" :text="`最小价格:${Math.min(...minPrice)}元`"></u--text>
25
-                <qiun-data-charts type="line" :chartData="chartData" canvasId="trendChart" :opts="opts" :ontouch="true" tooltipFormat="tooltipFormatPrice"
26
-                    width="700rpx" height="500rpx" backgroundColor="#ffffff" />
27
-            </view>
28 21
         </u-modal>
29 22
         <brandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></brandList>
30 23
 	</view>
@@ -79,58 +72,7 @@ export default {
79 72
                     { required: true, message: '请输入品牌', trigger: 'blur' }
80 73
                 ]
81 74
             },
82
-            chartData:{},
83
-            color:[],
84
-            opts: {
85
-                color: this.color,
86
-                padding: [20, 10, 20, 0],
87
-                dataLabel: true,
88
-                dataPointShape: true,
89
-                enableScroll: true,
90
-                
91
-                xAxis: {
92
-                    disableGrid: true,
93
-                    scrollShow: true,
94
-                    itemCount: 10,
95
-                    rotateLabel: true,
96
-                    rotateAngle: 45,
97
-                },
98
-                yAxis: {
99
-                    gridType: "dash",
100
-                    dashLength: 7,
101
-                },
102
-                legend: {
103
-                    show: false,
104
-                    type: 'scroll',
105
-                    orient: 'horizontal',
106
-                    pageSize: 3,
107
-                    pageIconSize: 12,
108
-                    pageIconColor: '#666',
109
-                    pageIconInactiveColor: '#ccc',
110
-                    pageTextStyle: {
111
-                        color: '#666',
112
-                        fontSize: 12
113
-                    },
114
-                    bottom: 0
115
-                },
116
-                extra: {
117
-                    line: {
118
-                        type: "curve",
119
-                        width: 3,
120
-                        activeType: "hollow",
121
-                        linearType: "custom",
122
-                        onShadow: true,
123
-                        animation: "horizontal"
124
-                    },
125
-                    tooltip:{
126
-                        legendShow: true,
127
-                        bgOpacity: 0.6
128
-                    }
129
-                }
130
-            },
131
-            chartShow: false,
132
-            maxPrice: [],
133
-            minPrice: [],
75
+            
134 76
 		}
135 77
 	},
136 78
 	watch: {
@@ -142,133 +84,11 @@ export default {
142 84
 		}
143 85
 	},
144 86
 	methods: {
145
-        getChartData() {
146
-            uni.$u.api.inquiryChart({
147
-                model: this.info.model,
148
-            }).then(res => {
149
-                if (res.code == 200) {
150
-                    const response = res.data
151
-                    this.maxPrice = []
152
-                    this.minPrice = []
153
-                    // const response = [
154
-                    //     {
155
-                    //         model:'AAA',
156
-                    //         list:[
157
-                    //             {
158
-                    //                 recycleTime: '2023-07-30',
159
-                    //                 price: 300,
160
-                    //             },
161
-                    //             {
162
-                    //                 recycleTime: '2023-07-31',
163
-                    //                 price: 500,
164
-                    //             },
165
-                    //             {
166
-                    //                 recycleTime: '2023-08-01',
167
-                    //                 price: null,
168
-                    //             },
169
-                    //             {
170
-                    //                 recycleTime: '2023-08-02',
171
-                    //                 price: 200,
172
-                    //             },
173
-                    //             {
174
-                    //                 recycleTime: '2023-08-03',
175
-                    //                 price: 300,
176
-                    //             }
177
-                    //         ]
178
-                    //     },
179
-                    //     {
180
-                    //         model:'BBB',
181
-                    //         list:[
182
-                    //             {
183
-                    //                 recycleTime: '2023-08-01',
184
-                    //                 price:400,
185
-                    //             },
186
-                    //             {
187
-                    //                 recycleTime: '2023-08-02',
188
-                    //                 price: 100,
189
-                    //             },
190
-                    //             {
191
-                    //                 recycleTime: '2023-08-03',
192
-                    //                 price: 200,
193
-                    //             }
194
-                    //         ]
195
-                    //     },
196
-                    //     {
197
-                    //         model:'CCC',
198
-                    //         list:[
199
-                    //             {
200
-                    //                 recycleTime: '2023-08-01',
201
-                    //                 price: 500,
202
-                    //             },
203
-                    //             {
204
-                    //                 recycleTime: '2023-08-02',
205
-                    //                 price: 400,
206
-                    //             },
207
-                    //             {
208
-                    //                 recycleTime: '2023-08-03',
209
-                    //                 price: 600,
210
-                    //             }
211
-                    //         ]
212
-                    //     }
213
-                    // ]
214
-                    this.color = []
215
-                    const categories = []
216
-                    const dateMap = {}
217
-                    response.forEach(item => {
218
-                        this.maxPrice.push(item.max)
219
-                        this.minPrice.push(item.min)
220
-                        item.list.forEach(i => {
221
-                            if (!dateMap[i.recycleTime]) {
222
-                                dateMap[i.recycleTime] = true
223
-                                categories.push(i.recycleTime)
224
-                            }
225
-                        })
226
-                    })
227
-                    const series = response.map((item) => {
228
-                        const color = this.getRandomColor()
229
-                        this.color.push(color)
230
-                        const data = categories.map(date => {
231
-                            const itemData = item.list.find(i => i.recycleTime === date)
232
-                            return itemData ? itemData.price : null
233
-                        })
234
-                        return {
235
-                            name: item.model,
236
-                            data: data,
237
-                            setShadow: [
238
-                                3,
239
-                                8,
240
-                                15,
241
-                                color
242
-                            ],
243
-                        }
244
-                    })
245
-                    this.opts.color = this.color
246
-                    const chartData = {
247
-                        categories: categories,
248
-                        series: series
249
-                    }
250
-                    this.chartData = JSON.parse(JSON.stringify(chartData))
251
-                    this.chartShow = true
252
-                }
253
-            })
254
-            
255
-        },
256
-        getRandomColor(){
257
-            var letters = '0123456789ABCDEF';
258
-            var color = '#';
259
-            for (var i = 0; i < 6; i++) {
260
-                color += letters[Math.floor(Math.random() * 16)];
261
-            }
262
-            return color;
263
-        },
264 87
         // 编辑回显
265 88
         initData() {
266 89
             this.$nextTick(()=>{
267 90
                 this.info = JSON.parse(JSON.stringify(this.editInfo))
268 91
                 this.showModal = true;
269
-                if(this.info.model && this.info.dictValue){
270
-                    this.getChartData()
271
-                }
272 92
             })
273 93
         },
274 94
         // 获取删除图片信息
@@ -343,14 +163,11 @@ export default {
343 163
                 type: this.type
344 164
             }
345 165
             uni.$u.api.addInquiry(data).then(res => {
346
-                if (res.code == 200) {
347
-                    uni.showToast({
348
-                        title: '添加成功',
349
-                        icon: 'success'
350
-                    })
351
-                    this.closeDialog()
352
-                    this.$emit('submitSuccess')
353
-                }
166
+                uni.$u.toast(this.type == 1 ? "询价成功" : "核价成功")
167
+                this.closeDialog()
168
+                this.$emit('submitSuccess')
169
+            }).catch((err) => {
170
+                uni.$u.toast(err)
354 171
             })
355 172
         },
356 173
         showDialog() {
@@ -374,14 +191,8 @@ export default {
374 191
         },
375 192
         closeDialog() {
376 193
             this.showModal = false;
377
-            this.chartShow = false
378
-            this.chartData = {}
379
-        },
380
-        handleModelBlur() {
381
-            if (this.info.model !== ''){
382
-                this.getChartData()
383
-            }
384 194
         },
195
+        
385 196
 	}
386 197
 };
387 198
 </script>

+ 13 - 5
components/custom-tab-select/index.vue

@@ -3,7 +3,7 @@
3 3
     <view 
4 4
       class="tab-item"
5 5
       :class="{ 
6
-        'tab-item--active': isMultiple ? activeValues.includes(item[valueKey]) : activeValue === item[valueKey],
6
+        'tab-item--active': isMultiple ? activeValues.includes(item[valueKey]) : activeValue == item[valueKey],
7 7
         'tab-item--multiple': isMultiple
8 8
       }"
9 9
       v-for="(item, index) in tabList"
@@ -59,7 +59,7 @@ export default {
59 59
   },
60 60
   computed: {
61 61
     isMultiple() {
62
-      return this.mode === "multiple";
62
+      return this.mode == "multiple";
63 63
     }
64 64
   },
65 65
   data() {
@@ -100,7 +100,7 @@ export default {
100 100
       handler(newMode) {
101 101
         // 当 mode 变化时,重新初始化选中值
102 102
         const initialValue = this.echoInfo || this.defaultActive;
103
-        if (newMode === 'multiple') {
103
+        if (newMode == 'multiple') {
104 104
           this.activeValues = Array.isArray(initialValue) ? initialValue : [];
105 105
           this.activeValue = '';
106 106
         } else {
@@ -129,8 +129,16 @@ export default {
129 129
       }
130 130
     },
131 131
     handleSingleSelect(item) {
132
-      this.activeValue = item[this.valueKey];
133
-      this.$emit("tabChange", item[this.valueKey]);
132
+      const itemValue = item[this.valueKey];
133
+      // 如果当前项已经被选中,则取消选中
134
+      if (this.activeValue === itemValue) {
135
+        this.activeValue = '';
136
+        this.$emit("tabChange", '');
137
+      } else {
138
+        // 否则设置为当前项的值
139
+        this.activeValue = itemValue;
140
+        this.$emit("tabChange", itemValue);
141
+      }
134 142
     },
135 143
     handleMultipleSelect(item) {
136 144
       const index = this.activeValues.indexOf(item[this.valueKey]);

+ 0 - 0
components/person-picker/index.scss


+ 2 - 4
components/person-picker/index.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <view class="">
2
+  <view>
3 3
     <u-picker :show="show" :title="title" :columns="columns" keyName="label" ref="uPicker"
4 4
                 @confirm="recyclePersonConfirm" @change="recyclePersonChange" @cancel='close'></u-picker>
5 5
   </view>
@@ -81,9 +81,7 @@ export default {
81 81
     recyclePersonClick() {
82 82
         uni.$u.api.getCustomerManagerAllList().then(res => {
83 83
             this.columns = [res.data] || [];
84
-            
85
-            // 如果第一层只有一个选项,自动处理下一层级
86
-            if (res.data && res.data.length === 1) {
84
+            if (res.data && res.data.length > 0) {
87 85
                 // 如果当前项不是用户且有子级,添加下一层
88 86
                 if (!res.data[0].isUser && res.data[0].children && res.data[0].children.length > 0) {
89 87
                     this.columns.push(res.data[0].children);

+ 145 - 20
pages/clue/mixins/clue.js

@@ -127,8 +127,62 @@ export default {
127 127
 				advId: "",
128 128
 				promotionId: "",
129 129
 				titleId: "",
130
-				videoId: ""
130
+				videoId: "",
131 131
 			},
132
+			trendModal: false,
133
+			chartData:{},
134
+			color:[],
135
+			opts: {
136
+				color: this.color,
137
+				padding: [20, 10, 20, 0],
138
+				dataLabel: true,
139
+				dataPointShape: true,
140
+				enableScroll: true,
141
+				
142
+				xAxis: {
143
+					disableGrid: true,
144
+					scrollShow: true,
145
+					itemCount: 10,
146
+					rotateLabel: true,
147
+					rotateAngle: 45,
148
+				},
149
+				yAxis: {
150
+					gridType: "dash",
151
+					dashLength: 7,
152
+				},
153
+				legend: {
154
+					show: false,
155
+					type: 'scroll',
156
+					orient: 'horizontal',
157
+					pageSize: 3,
158
+					pageIconSize: 12,
159
+					pageIconColor: '#666',
160
+					pageIconInactiveColor: '#ccc',
161
+					pageTextStyle: {
162
+						color: '#666',
163
+						fontSize: 12
164
+					},
165
+					bottom: 0
166
+				},
167
+				extra: {
168
+					line: {
169
+						type: "curve",
170
+						width: 3,
171
+						activeType: "hollow",
172
+						linearType: "custom",
173
+						onShadow: true,
174
+						animation: "horizontal"
175
+					},
176
+					tooltip:{
177
+						legendShow: true,
178
+						bgOpacity: 0.6,
179
+					}
180
+				}
181
+			},
182
+			model: "",
183
+			maxPrice: [],
184
+			minPrice: [],
185
+			chartShow: false,
132 186
 		}
133 187
 	},
134 188
 	onPullDownRefresh() {
@@ -153,25 +207,96 @@ export default {
153 207
 	// onShow() {
154 208
 	// 	this.resetData();
155 209
 	// },
156
-	methods: {
157
-		handleAddClue() {
158
-			uni.navigateTo({
159
-				url: "/pages/addClue/index"
160
-			})
161
-		},
162
-		handleClueStateClick(item) {
163
-			this.queryParams.clueState = item.clueState;
164
-			this.resetData();
165
-		},
166
-		handleKeyword() {
167
-			this.resetData();
168
-		},
169
-		handleKeywordClear() {
170
-			// 组件有bug 清空后的值还是存在
171
-			this.queryParams.conditionContent = "";
172
-			this.resetData();
173
-		},
174
-		handleShowTag() {
210
+		methods: {
211
+			handleTrend() {
212
+				this.trendModal = true;
213
+			},
214
+			handleTrendConfirm() {
215
+				this.model = ""
216
+				this.chartShow = false
217
+				this.trendModal = false;
218
+			},
219
+			searchTrend(val) {
220
+				if (val !== ''){
221
+					uni.$u.api.inquiryChart({
222
+						model: val,
223
+					}).then(res => {
224
+						if(res.data.length == 0){
225
+							uni.$u.toast("暂无数据")
226
+							return
227
+						}
228
+						const response = res.data
229
+						this.maxPrice = []
230
+						this.minPrice = []
231
+						this.color = []
232
+						const categories = []
233
+						const dateMap = {}
234
+						response.forEach(item => {
235
+							this.maxPrice.push(item.max)
236
+							this.minPrice.push(item.min)
237
+							item.list.forEach(i => {
238
+								if (!dateMap[i.recycleTime]) {
239
+									dateMap[i.recycleTime] = true
240
+									categories.push(i.recycleTime)
241
+								}
242
+							})
243
+						})
244
+						const series = response.map((item) => {
245
+							const color = this.getRandomColor()
246
+							this.color.push(color)
247
+							const data = categories.map(date => {
248
+								const itemData = item.list.find(i => i.recycleTime === date)
249
+								return itemData ? itemData.price : null
250
+							})
251
+							return {
252
+								name: item.model,
253
+								data: data,
254
+								setShadow: [
255
+									3,
256
+									8,
257
+									15,
258
+									color
259
+								],
260
+							}
261
+						})
262
+						this.opts.color = this.color
263
+						const chartData = {
264
+							categories: categories,
265
+							series: series
266
+						}
267
+						this.chartData = JSON.parse(JSON.stringify(chartData))
268
+						this.chartShow = true
269
+					}).catch((err) => {
270
+						uni.$u.toast(err)
271
+					})
272
+				}
273
+			},
274
+			getRandomColor(){
275
+				var letters = '0123456789ABCDEF';
276
+				var color = '#';
277
+				for (var i = 0; i < 6; i++) {
278
+					color += letters[Math.floor(Math.random() * 16)];
279
+				}
280
+				return color;
281
+			},
282
+			handleAddClue() {
283
+				uni.navigateTo({
284
+					url: "/pages/addClue/index"
285
+				})
286
+			},
287
+			handleClueStateClick(item) {
288
+				this.queryParams.clueState = item.clueState;
289
+				this.resetData();
290
+			},
291
+			handleKeyword() {
292
+				this.resetData();
293
+			},
294
+			handleKeywordClear() {
295
+				// 组件有bug 清空后的值还是存在
296
+				this.queryParams.conditionContent = "";
297
+				this.resetData();
298
+			},
299
+			handleShowTag() {
175 300
 			this.$refs.clueTag.showModal();
176 301
 		},
177 302
 		async handleClueTagConfirm() {

+ 11 - 0
pages/clue/scss/clue.scss

@@ -11,6 +11,11 @@
11 11
 	background-color: #4c8afe;
12 12
 }
13 13
 
14
+.trend {
15
+	bottom: 320rpx;
16
+	background-color: #fe9c4c;
17
+}
18
+
14 19
 .clueDetail_tabber {
15 20
 	::v-deep .u-tabbar__content {
16 21
 		background: #108cff;
@@ -101,4 +106,10 @@
101 106
 	.case_main_wrap {
102 107
 		padding: 15px;
103 108
 	}
109
+}
110
+.trend_modal{
111
+	width:100%;
112
+	display: flex;
113
+	flex-direction: column;
114
+	gap: 20rpx;
104 115
 }

+ 15 - 2
pages/publicClue/index.vue

@@ -48,8 +48,21 @@
48 48
 			groupChild="clueTagDataList" label-key="name" value-key="id" placeholder="请选择线索标签"
49 49
 			v-model="queryParams.allTagList" multiple clearable ref="clueTag"
50 50
 			@confirm="handleClueTagConfirm"></group-select>
51
-			
52
-			
51
+		<u-modal :show="trendModal" title="价格趋势" @confirm="handleTrendConfirm" confirmText="关闭弹窗">
52
+			<view class="trend_modal">
53
+				<u-search placeholder="请输入型号" v-model="model" @custom="searchTrend"></u-search>
54
+				<view class="charts_box" v-if="chartShow">
55
+					<u--text type="primary" :text="`最大价格:${Math.max(...maxPrice)}元`"></u--text>
56
+					<u--text type="warning" :text="`最小价格:${Math.min(...minPrice)}元`"></u--text>
57
+					<qiun-data-charts type="line" :chartData="chartData" canvasId="trendChart" :opts="opts" :ontouch="true" tooltipFormat="tooltipFormatPrice"
58
+						width="700rpx" height="500rpx" backgroundColor="#ffffff" />
59
+				</view>
60
+			</view>
61
+		</u-modal>
62
+		
63
+		<view class="suspension_button trend" @click="handleTrend">
64
+			趋势
65
+		</view>
53 66
 		<view class="suspension_button" @click="handleAddClue">
54 67
 			新增
55 68
 		</view>

+ 0 - 1
pages/setting/index.vue

@@ -120,7 +120,6 @@
120 120
 				})
121 121
 			},
122 122
 			confirmSwitchRole(e) {
123
-				console.log(e);
124 123
 				uni.navigateBack({
125 124
 					delta: 1
126 125
 				}).then(()=>{

+ 11 - 2
pages/wareHouse/components/detail.vue

@@ -146,7 +146,15 @@
146 146
                         <span v-else>¥{{ coreInfo.salePrice || '-' }}</span>
147 147
                     </view>
148 148
                 </view>
149
-                <view class="price_item"></view>
149
+                <view class="price_item">
150
+                    <view class="price_label">实价</view>
151
+                    <view class="price_value suggested"
152
+                        @click.stop="toggleEditField('actualPrice', coreInfo.actualPrice)">
153
+                        <u-input v-if="editMode.actualPrice" v-model="tempValues.actualPrice" :autoFocus="true"
154
+                            @blur="!globalEditMode && saveEditField('actualPrice', tempValues.actualPrice, 'actualPrice')" />
155
+                        <span v-else>¥{{ coreInfo.actualPrice || '-' }}</span>
156
+                    </view>
157
+                </view>
150 158
             </view>
151 159
         </view>
152 160
 
@@ -247,6 +255,7 @@ export default {
247 255
                 peerPrice: false,
248 256
                 agentPrice: false,
249 257
                 salePrice: false,
258
+                actualPrice: false,
250 259
                 price: false,
251 260
                 productPosition: false,
252 261
             },
@@ -414,7 +423,7 @@ export default {
414 423
                 price: this.coreInfo.price,
415 424
                 recyclePerson: this.coreInfo.recyclePerson,
416 425
                 recyclePersonId: this.coreInfo.recyclePersonId,
417
-                createTime: this.coreInfo.createTime,
426
+                type: this.coreInfo.type,
418 427
             }
419 428
             uni.navigateTo({
420 429
                 url: '/pages/wareHouse/components/openOrder?params=' + JSON.stringify(params),

+ 51 - 114
pages/wareHouse/components/edit.vue

@@ -78,9 +78,6 @@
78 78
                     <u-form-item label="尺码" class="u-form-item-row" borderBottom>
79 79
                         <u--input v-model="formData.yardage" placeholder="请输入" clearable border="none"></u--input>
80 80
                     </u-form-item>
81
-                    <u-form-item label="官方指导价" class="u-form-item-row" borderBottom>
82
-                        <u--input v-model="formData.price" placeholder="请输入" clearable border="none"></u--input>
83
-                    </u-form-item>
84 81
                     <u-form-item label="商品成色" required prop="productCondition" borderBottom>
85 82
                         <TabSelect :tabList="productConditionList" :isClear="productConditionIsClear"
86 83
                             @tabChange="handleTabChangeProductCondition" :colNum="2" mode="single" :echoInfo="echoInfoProductCondition">
@@ -125,12 +122,18 @@
125 122
                         <u--input v-model="formData.stock" placeholder="请输入" clearable border="none"
126 123
                             type="number"></u--input>
127 124
                     </u-form-item>
125
+                    <u-form-item label="官方指导价" required prop="price" class="u-form-item-row" borderBottom>
126
+                        <u--input v-model="formData.price" placeholder="请输入" clearable border="none"></u--input>
127
+                    </u-form-item>
128 128
                     <u-form-item label="总成本价" class="u-form-item-row" borderBottom v-if="isWareHouser">
129 129
                         <u--input v-model="formData.costPrice" placeholder="请输入" clearable border="none"></u--input>
130 130
                     </u-form-item>
131 131
                     <u-form-item label="同行价格" class="u-form-item-row" borderBottom v-if="isWareHouser">
132 132
                         <u--input v-model="formData.peerPrice" placeholder="请输入" clearable border="none"></u--input>
133 133
                     </u-form-item>
134
+                    <u-form-item label="实价" class="u-form-item-row" borderBottom>
135
+                        <u--input v-model="formData.actualPrice" placeholder="请输入" clearable border="none" type="number" @blur="handleBlurActualPrice"></u--input>
136
+                    </u-form-item>
134 137
                     <u-form-item label="代理价格" class="u-form-item-row" borderBottom>
135 138
                         <u--input v-model="formData.agentPrice" placeholder="请输入" clearable border="none"></u--input>
136 139
                     </u-form-item>
@@ -265,7 +268,8 @@ import Cell from '@/components/custom-cell/index.vue'
265 268
 import BrandList from '@/components/brand-list/index.vue'
266 269
 import ImgsRowScroll from '@/components/imgs-row-scroll/index.vue'
267 270
 import PersonPicker from '@/components/person-picker/index.vue'
268
-import { permissionCheck } from '@/utils/util.js'
271
+import { permissionCheck,getRoles } from '@/utils/util.js'
272
+import { productConditionList,productAttributeList,stockStatusList,recycleTypeList,labelList,paymentTabList } from '../js/public.js'
269 273
 export default {
270 274
     components: {
271 275
         TabSelect,
@@ -293,7 +297,7 @@ export default {
293 297
                 material: '',
294 298
                 size: '',
295 299
                 yardage: '',
296
-                price: '',
300
+                price: 0,
297 301
                 productCondition: '1',
298 302
                 detailPicFileList: [],//细节图片
299 303
                 // detailVideoFileList:[],
@@ -302,7 +306,8 @@ export default {
302 306
                 productAttribute: '1',
303 307
                 stock: 1,
304 308
                 costPrice: '',
305
-                samePrice: '',
309
+                peerPrice: '',
310
+                actualPrice: '',
306 311
                 agentPrice: '',
307 312
                 salePrice: '',
308 313
                 productPosition: '',
@@ -348,7 +353,10 @@ export default {
348 353
                     { required: true, message: '请选择商品属性', trigger: ['blur', 'change'] },
349 354
                 ],
350 355
                 stock: [
351
-                    { required: true, message: '请输入库存数量' },
356
+                    { required: true, message: '请输入库存数量' }
357
+                ],
358
+                price: [
359
+                    { required: true, message: '请输入官方指导价' }
352 360
                 ],
353 361
                 stockStatus: [
354 362
                     { required: true, message: '请选择是否入库', trigger: [ 'change'] },
@@ -361,110 +369,6 @@ export default {
361 369
             recycleTimeShow: false,
362 370
             titlePlaceholder: '如不填,自动截取商品描述前50字',
363 371
             typeList: [],
364
-            productConditionList: [
365
-                {
366
-                    name: '闲置未使用',
367
-                    value: '1',
368
-                },
369
-                {
370
-                    name: '二手',
371
-                    value: '2',
372
-                },
373
-            ],
374
-            productAttributeList: [
375
-                {
376
-                    name: '自有商品',
377
-                    value: '1',
378
-                },
379
-                {
380
-                    name: '寄卖商品',
381
-                    value: '2',
382
-                },
383
-                {
384
-                    name: '质押商品',
385
-                    value: '3',
386
-                },
387
-                {
388
-                    name: '其它',
389
-                    value: '4',
390
-                },
391
-            ],
392
-            stockStatusList: [
393
-                {
394
-                    name: '待入库',
395
-                    value: '0',
396
-                },
397
-                {
398
-                    name: '已入库',
399
-                    value: '1',
400
-                },
401
-            ],
402
-            recycleTypeList: [
403
-                {
404
-                    name: '线上',
405
-                    value: '1',
406
-                },
407
-                {
408
-                    name: '同行',
409
-                    value: '2',
410
-                },
411
-                {
412
-                    name: '门店',
413
-                    value: '3',
414
-                },
415
-                {
416
-                    name: '其它',
417
-                    value: '4',
418
-                },
419
-            ],
420
-            labelList: [
421
-                {
422
-                    name: '完美',
423
-                    value: '1',
424
-                },
425
-                {
426
-                    name: '普通',
427
-                    value: '2',
428
-                },
429
-                {
430
-                    name: '瑕疵',
431
-                    value: '3',
432
-                },
433
-                {
434
-                    name: '假货',
435
-                    value: '4',
436
-                },
437
-                {
438
-                    name: '亏损',
439
-                    value: '5',
440
-                },
441
-            ],
442
-            paymentTabList: [
443
-                {
444
-                    name: '微信',
445
-                    value: "1",
446
-                },
447
-                {
448
-                    name: '支付宝',
449
-                    value: "2",
450
-                },
451
-                {
452
-                    name: '银行卡',
453
-                    value: "3",
454
-                },
455
-                {
456
-                    name: '现金',
457
-                    value: "4",
458
-                },
459
-                {
460
-                    name: '数字货币',
461
-                    value: "5",
462
-                },
463
-                {
464
-                    name: '挂账',
465
-                    value: "6",
466
-                },
467
-            ],
468 372
             typeIsClear: false,//商品分类是否清空
469 373
             productConditionIsClear: false,//商品成色是否清空
470 374
             productAttributeIsClear: false,//商品属性是否清空
@@ -481,10 +385,18 @@ export default {
481 385
             echoInfoStockStatus:'',//入库回显的时候 是否入库回显
482 386
             isWareHouser: permissionCheck('WAREHOUSER',false),
483 387
             formType: '',//表单类型 add:新增 edit:编辑
388
+            xhlSystemSetList: [],//系统设置-列表
389
+            productConditionList:productConditionList,
390
+            productAttributeList: productAttributeList,
391
+            stockStatusList: stockStatusList,
392
+            recycleTypeList: recycleTypeList,
393
+            labelList: labelList,
394
+            paymentTabList: paymentTabList,
484 395
         }
485 396
     },
486 397
     onLoad(options) {
487 398
         this.getTypeList();
399
+        this.getXhlSystemSetList()
488 400
         this.$nextTick(async()=>{
489 401
             this.formType = options.formType
490 402
             if(options.formType == 'add'){
@@ -505,12 +417,13 @@ export default {
505 417
                 this.echoInfoStockStatus = res.data.stockStatus || '0'//是否入库回显
506 418
                 this.formData.stockStatus = res.data.stockStatus || '0'//是否入库校验
507 419
                 this.formData.stock = res.data.stock ? res.data.stock : 1//入库数量校验
420
+                this.formData.price = res.data.price || 0//官方指导价校验
508 421
                 this.echoInfoPayType = res.data.payType//付款方式回显
509 422
                 this.echoInfoRecycleType = res.data.recycleType//回收类型回显
510 423
                 this.echoInfoLabel = res.data.label//商品标签回显
511 424
                 this.recognitionContent = `品牌:${res.data.dictLabel || '-'}
512 425
 来源:${res.data.origin || '-'}
513
-实价:${res.data.costPrice || '-'}
426
+实价:${res.data.actualPrice || '-'}
514 427
 型号:${res.data.model || '-'}
515 428
 编码:${res.data.indentifyCode || '-'}
516 429
 日期:${res.data.recycleTime || '-'}
@@ -521,6 +434,30 @@ export default {
521 434
         })
522 435
     },
523 436
     methods: {
437
+        getXhlSystemSetList(){
438
+            uni.$u.api.xhlSystemSetList({
439
+                pageNum: 1,
440
+                pageSize: 99,
441
+            }).then(res => {
442
+                this.xhlSystemSetList = res.rows || []
443
+            })
444
+        },
445
+        handleBlurActualPrice() {
446
+            if (this.formData.actualPrice) {
447
+                const actualPrice = Number(this.formData.actualPrice)
448
+                let obj = {}
449
+                // 只要账号权限里面有销售权限,就按照销售的计算规则,没有就固定计算
450
+                if(getRoles().includes('SALESMAN')){
451
+                    obj = this.xhlSystemSetList.find(item => item.agentType == 'SALESMAN') || {}
452
+                }else{
453
+                    obj = {
454
+                        goodsRate: 0.003,
455
+                        goodsAmount: 500,
456
+                    }
457
+                }
458
+                this.formData.agentPrice = (actualPrice + actualPrice*obj.goodsRate + obj.goodsAmount).toFixed(2)
459
+            }
460
+        },
524 461
         getTypeList() {
525 462
             this.$getDicts("crm_form_category").then(res => {
526 463
                 this.typeList = res
@@ -592,7 +529,7 @@ export default {
592 529
                 material: '',
593 530
                 size: '',
594 531
                 yardage: '',
595
-                price: '',
532
+                price: 0,
596 533
                 productCondition: '1',
597 534
                 detailPicFileList: [],//细节图片
598 535
                 // detailVideoFileList:[],
@@ -852,7 +789,7 @@ export default {
852 789
                     this.formData.origin = result['来源'];
853 790
                 }
854 791
                 if (result['实价']) {
855
-                    this.formData.costPrice = result['实价'];
792
+                    this.formData.actualPrice = result['实价'];
856 793
                 }
857 794
                 if (result['型号']) {
858 795
                     this.formData.model = result['型号'];

+ 32 - 77
pages/wareHouse/components/openOrder.vue

@@ -15,7 +15,8 @@
15 15
                   </view>
16 16
                   <view class="advice_price">
17 17
                      <view class="advice_price_title">建议标价</view>
18
-                     <view class="advice_price_price">¥<u--input v-model="openOrderForm.price" placeholder="建议标价" border="none" type="number"></u--input></view>
18
+                     <view class="advice_price_price">¥<u--input v-model="openOrderForm.price" placeholder="建议标价"
19
+                           border="none" type="number"></u--input></view>
19 20
                   </view>
20 21
                </view>
21 22
             </view>
@@ -23,7 +24,8 @@
23 24
          <u--form labelPosition="top" :model="openOrderForm" :rules="rules" ref="openOrderForm" label-width="200rpx">
24 25
             <view class="card_item">
25 26
                <u-form-item label="成交金额" required prop="dealPrice">
26
-                  ¥<u--input v-model="openOrderForm.dealPrice" placeholder="成交金额" border="none" type="number"></u--input>
27
+                  ¥<u--input v-model="openOrderForm.dealPrice" placeholder="成交金额" border="none"
28
+                     type="number"></u--input>
27 29
                </u-form-item>
28 30
             </view>
29 31
             <view class="card_item">
@@ -33,8 +35,8 @@
33 35
             </view>
34 36
             <view class="card_item">
35 37
                <u-form-item label="订单类型">
36
-                  <TabSelect :tabList="orderTypeList" mode="single" :colNum="4" :defaultIndex="1" labelKey="dictLabel" valueKey="dictValue"
37
-                     @tabChange="changeOrderType">
38
+                  <TabSelect :tabList="orderTypeList" mode="single" :colNum="4" :defaultIndex="1" labelKey="dictLabel"
39
+                     valueKey="dictValue" @tabChange="changeOrderType">
38 40
                   </tabSelect>
39 41
                </u-form-item>
40 42
             </view>
@@ -44,20 +46,20 @@
44 46
                      <u-icon name="man-add" size="36rpx" color="#374151"></u-icon>
45 47
                      <view class="text">{{ openOrderForm.recyclePerson }}</view>
46 48
                      <PersonPicker ref="recyclePersonPickerRef" title="请选择回收人员"
47
-                            @selectPerson="handleSelectRecyclePerson"></PersonPicker>
49
+                        @selectPerson="handleSelectRecyclePerson"></PersonPicker>
48 50
                   </view>
49 51
                   <view class="sales_person_box" @click="dateShow = true">
50 52
                      <u-icon name="calendar" size="36rpx" color="#374151"></u-icon>
51 53
                      <view class="text">{{ openOrderForm.orderDate }}</view>
52
-                     <u-datetime-picker :show="dateShow" v-model="openOrderForm.orderDate" mode="date" @confirm="confirmDate"
53
-                        @close="closeDate" @cancel="closeDate"></u-datetime-picker>
54
+                     <u-datetime-picker :show="dateShow" v-model="openOrderForm.orderDate" mode="date"
55
+                        @confirm="confirmDate" @close="closeDate" @cancel="closeDate"></u-datetime-picker>
54 56
                   </view>
55 57
 
56 58
                </u-form-item>
57 59
             </view>
58 60
             <view class="card_item">
59 61
                <u-form-item label="收款方式">
60
-                  <TabSelect :tabList="payTypeList" mode="single" :colNum="4" :defaultIndex="1"
62
+                  <TabSelect :tabList="paymentTabList" mode="single" :colNum="4" :defaultIndex="1"
61 63
                      @tabChange="changepayType">
62 64
                   </tabSelect>
63 65
                </u-form-item>
@@ -70,11 +72,12 @@
70 72
                </u-form-item>
71 73
             </view>
72 74
             <view class="card_item">
73
-               <u-form-item label="支付凭证上传">
75
+               <u-form-item label="支付凭证图片">
74 76
                   <view class="imgs_scroll">
75
-                     <ImgsRowScroll v-if="payTypeProofPicFileList.length > 0" :isShowDeleteIcon="true"
76
-                        @deleteImgInfo="getDeleteGoodPicInfo" imgMode="aspectFill" :totalWidth="400"
77
-                        :images="payTypeProofPicFileList" :previewEnabled="true" :imageWidth="150" :imageHeight="150">
77
+                     <ImgsRowScroll :isShowDeleteIcon="true"
78
+                        @deleteImgInfo="getDeletePayTypeProofPicInfo" imgMode="aspectFill" :totalWidth="400"
79
+                        :images="openOrderForm.payTypeProofPicFileList" :previewEnabled="true" :imageWidth="150"
80
+                        :imageHeight="150">
78 81
                      </ImgsRowScroll>
79 82
                      <u-upload @afterRead="afterReadpayTypeProofPic" name="1" multiple :maxCount="10"></u-upload>
80 83
                   </view>
@@ -105,6 +108,7 @@
105 108
 import TabSelect from '@/components/custom-tab-select/index.vue'
106 109
 import ImgsRowScroll from '@/components/imgs-row-scroll/index.vue'
107 110
 import PersonPicker from '@/components/person-picker/index.vue'
111
+import { afterSaleTabList, paymentTabList } from '../js/public.js'
108 112
 export default {
109 113
    components: {
110 114
       TabSelect,
@@ -131,56 +135,11 @@ export default {
131 135
             afterSaleTab: [],
132 136
             remark: '',
133 137
             address: '',
138
+            type: '',
134 139
          },
140
+         afterSaleTabList: afterSaleTabList,
141
+         paymentTabList: paymentTabList,
135 142
          orderTypeList: [],
136
-         payTypeList: [
137
-            {
138
-               name: '微信',
139
-               value: 1,
140
-            },
141
-            {
142
-               name: '支付宝',
143
-               value: 2,
144
-            },
145
-            {
146
-               name: '银行卡',
147
-               value: 3,
148
-            },
149
-            {
150
-               name: '现金',
151
-               value: 4,
152
-            },
153
-            {
154
-               name: '数字货币',
155
-               value: 5,
156
-            },
157
-            {
158
-               name: '挂账',
159
-               value: 6,
160
-            },
161
-         ],
162
-         afterSaleTabList: [
163
-            {
164
-               name: '假一赔三',
165
-               value: 1,
166
-            },
167
-            {
168
-               name: '一年质保',
169
-               value: 2,
170
-            },
171
-            {
172
-               name: '一年内八折回收',
173
-               value: 3,
174
-            },
175
-            {
176
-               name: '送保养一次',
177
-               value: 4,
178
-            },
179
-            {
180
-               name: '原厂配件保证',
181
-               value: 5,
182
-            },
183
-         ],
184 143
          rules: {
185 144
             dealPrice: [
186 145
                { required: true, message: '请输入成交金额', trigger: ['blur'] },
@@ -191,14 +150,12 @@ export default {
191 150
    },
192 151
    onLoad(options) {
193 152
       const params = options.params || '{}'
194
-      
153
+
195 154
       if (params) {
196 155
          this.openOrderForm.quantity = 1
197 156
          Object.keys(JSON.parse(params)).forEach(key => {
198 157
             this.openOrderForm[key] = JSON.parse(params)[key]
199 158
          })
200
-         console.log(this.openOrderForm);
201
-         
202 159
          this.getOrderTypeList()
203 160
       }
204 161
    },
@@ -224,8 +181,6 @@ export default {
224 181
       handleSelectRecyclePerson(person) {
225 182
          this.openOrderForm.recyclePerson = person.label
226 183
          this.openOrderForm.recyclePersonId = person.id
227
-         console.log(this.openOrderForm);
228
-         
229 184
       },
230 185
       handleClickOutside() {
231 186
          this.personShow = false
@@ -239,19 +194,19 @@ export default {
239 194
       closeDate() {
240 195
          this.dateShow = false
241 196
       },
242
-      getDeleteGoodPicInfo(info) {
243
-         this.payTypeProofPicFileList = info.newImages
197
+      getDeletePayTypeProofPicInfo(info) {
198
+         this.openOrderForm.payTypeProofPicFileList = info.newImages
244 199
       },
245
-       async afterReadpayTypeProofPic(event) {
246
-            event.file.forEach(item => {
247
-                uni.$u.api.uploadFile(item.url).then((res) => {
248
-                    this.payTypeProofPicFileList.push(res.data.url);
249
-                    uni.$u.toast("文件上传成功");
250
-                }).catch(() => {
251
-                    uni.$u.toast("上传文件失败");
252
-                })
200
+      async afterReadPayTypeProofPic(event) {
201
+         event.file.forEach(item => {
202
+            uni.$u.api.uploadFile(item.url).then((res) => {
203
+               this.openOrderForm.payTypeProofPicFileList.push(res.data.url);
204
+               uni.$u.toast("文件上传成功");
205
+            }).catch(() => {
206
+               uni.$u.toast("上传文件失败");
253 207
             })
254
-        },
208
+         })
209
+      },
255 210
       submitForm() {
256 211
          this.$refs.openOrderForm.validate().then(res => {
257 212
             if (res) {
@@ -264,7 +219,7 @@ export default {
264 219
                   uni.$u.toast("开单成功");
265 220
                   setTimeout(() => {
266 221
                      uni.navigateBack({
267
-                           delta: 2
222
+                        delta: 2
268 223
                      });
269 224
                   }, 1000);
270 225
                }).catch((error) => {

+ 273 - 0
pages/wareHouse/components/orderList/edit.vue

@@ -0,0 +1,273 @@
1
+<template>
2
+    <u-modal :show="show" :title="title" :showCancelButton="true" @cancel="hideModal" @confirm="confirmEdit">
3
+        <view class="form-container">
4
+            <u-form :model="info" ref="formRef" labelPosition="top">
5
+                <u-form-item label="品牌" class="u-form-item-row" borderBottom @click="showBrandList" labelWidth="70">
6
+                    <Cell :val="info.dictLabel" :isDelete="true" @handleClear="clear('brand')"></Cell>
7
+                    <BrandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></BrandList>
8
+                </u-form-item>
9
+                <u-form-item label="付款方式" borderBottom labelWidth="70">
10
+                    <TabSelect :tabList="paymentTabList" :echoInfo="info.payType"
11
+                        :colNum="3" mode="single"
12
+                        :isClear="payTypeIsClear" @tabChange="handlePayTypeTabChange">
13
+                    </TabSelect>
14
+                </u-form-item>
15
+                <u-form-item label="开单人" class="u-form-item-row" borderBottom labelWidth="70"
16
+                    @click="showRecyclePersonPicker">
17
+                    <Cell :val="info.recyclePerson" :isDelete="true" @handleClear="clear('recyclePerson')"></Cell>
18
+                    <PersonPicker ref="recyclePersonPickerRef" title="请选择回收人员"
19
+                        @selectPerson="handleSelectRecyclePerson">
20
+                    </PersonPicker>
21
+                </u-form-item>
22
+                <u-form-item label="开单数量" class="u-form-item-row" labelWidth="70" borderBottom>
23
+                    <u-number-box v-model="info.quantity" button-size="26"></u-number-box>
24
+                </u-form-item>
25
+                <u-form-item label="开单日期" class="u-form-item-row" labelWidth="70" borderBottom
26
+                    @click="showOrderDatePicker">
27
+                    <Cell :val="info.orderDate" :isDelete="true" @handleClear="clear('orderDate')"></Cell>
28
+                    <u-datetime-picker @confirm="confirmOrderDate" @close="closeOrderDatePicker"
29
+                        @cancel="closeOrderDatePicker" :show="orderDateShow" v-model="info.orderDate"
30
+                        mode="date"></u-datetime-picker>
31
+                </u-form-item>
32
+                <u-form-item label="订单类型" borderBottom labelWidth="70">
33
+                    <TabSelect :tabList="orderTypeList" :isClear="orderTypeIsClear" mode="single" :colNum="4"
34
+                        :echoInfo="info.orderType" labelKey="dictLabel" valueKey="dictValue"
35
+                        @tabChange="changeOrderType">
36
+                    </TabSelect>
37
+                </u-form-item>
38
+                <u-form-item label="商品分类" labelWidth="70" borderBottom>
39
+                    <TabSelect :tabList="typeList" :isClear="typeIsClear" @tabChange="handleTabChangeType"
40
+                        labelKey="dictLabel" valueKey="dictValue" :colNum="4" mode="single" :echoInfo="info.type">
41
+                    </TabSelect>
42
+                </u-form-item>
43
+                <u-form-item label="成交金额" class="u-form-item-row" labelWidth="70" borderBottom>
44
+                    ¥<u--input v-model="info.dealPrice" placeholder="成交金额" border="none" type="number"></u--input>元
45
+                </u-form-item>
46
+                <u-form-item label="实收总计" class="u-form-item-row" labelWidth="70" borderBottom>
47
+                    ¥<u--input v-model="info.amountReceived" placeholder="实收总计" border="none" type="number"></u--input>元
48
+                </u-form-item>
49
+                <u-form-item label="开单备注" labelWidth="70" borderBottom>
50
+                    <u--textarea v-model="info.orderRemark" clearable placeholder="备注" count autoHeight maxlength="50"
51
+                        height="100" confirmType="done"></u--textarea>
52
+                </u-form-item>
53
+                <u-form-item label="收货地址" labelWidth="70" borderBottom>
54
+                    <u--textarea v-model="info.address" clearable placeholder="收货地址" count autoHeight maxlength="50"
55
+                        height="100" confirmType="done"></u--textarea>
56
+                </u-form-item>
57
+                <u-form-item label="售后保障配置" labelWidth="100">
58
+                    <TabSelect :tabList="afterSaleTabList" :echoInfo="info.afterSaleTab" mode="multiple" :colNum="2"
59
+                        @tabChange="changeAfterSaleTab">
60
+                    </TabSelect>
61
+                </u-form-item>
62
+                <u-form-item label="支付凭证图片" labelWidth="100">
63
+                  <view class="imgs_scroll">
64
+                     <ImgsRowScroll :isShowDeleteIcon="true"
65
+                        @deleteImgInfo="getDeletePayTypeProofPicInfo" imgMode="aspectFill" :totalWidth="400"
66
+                        :images="info.payTypeProofPicFileList" :previewEnabled="true" :imageWidth="150" :imageHeight="150">
67
+                     </ImgsRowScroll>
68
+                     <u-upload @afterRead="afterReadPayTypeProofPic" name="1" multiple :maxCount="10"></u-upload>
69
+                  </view>
70
+               </u-form-item>
71
+            </u-form>
72
+        </view>
73
+    </u-modal>
74
+</template>
75
+
76
+<script>
77
+import { afterSaleTabList, paymentTabList } from '../../js/public.js'
78
+import Cell from '@/components/custom-cell/index.vue'
79
+import BrandList from '@/components/brand-list/index.vue'
80
+import TabSelect from '@/components/custom-tab-select/index.vue'
81
+import PersonPicker from '@/components/person-picker/index.vue'
82
+import ImgsRowScroll from '@/components/imgs-row-scroll/index.vue'
83
+export default {
84
+    name: 'OrderListEdit',
85
+    components: {
86
+        Cell,
87
+        BrandList,
88
+        TabSelect,
89
+        PersonPicker,
90
+        ImgsRowScroll
91
+    },
92
+    data() {
93
+        return {
94
+            show: false,
95
+            info: {
96
+                dictValue: '',
97
+                dictLabel: '',
98
+                payType: '',
99
+                recyclePerson: '',
100
+                recyclePersonId: '',
101
+                quantity: 0,
102
+                orderDate: this.$dayjs().format('YYYY-MM-DD'),
103
+                orderType: '',
104
+                type: '',
105
+                dealPrice: 0,
106
+                amountReceived: 0,
107
+                orderRemark: '',
108
+                address: '',
109
+                afterSaleTab: [],
110
+            },
111
+            paymentTabList: paymentTabList,
112
+            afterSaleTabList: afterSaleTabList,
113
+            payTypeIsClear: true,
114
+            orderTypeIsClear: true,
115
+            typeIsClear: true,
116
+            orderDateShow: false,
117
+            orderTypeList: [],
118
+            typeList: [],
119
+        }
120
+    },
121
+    props: {
122
+        title: {
123
+            type: String,
124
+            default: '编辑'
125
+        },
126
+        orderInfo: {
127
+            type: Object,
128
+            default: () => { }
129
+        }
130
+    },
131
+    emits: ['confirm'],
132
+    methods: {
133
+        showModal() {
134
+            this.getOrderTypeList();
135
+            this.getTypeList();
136
+            uni.$u.api.wareHouseOrderDetail({
137
+                id: this.orderInfo.id
138
+            }).then(res => {
139
+                this.show = true;
140
+                this.$nextTick(() => {
141
+                    this.info = res.data;
142
+                    this.info.payType = res.data.payType || '';
143
+                    this.info.orderDate = this.$dayjs(this.info.orderDate).format('YYYY-MM-DD');
144
+                })
145
+            })
146
+        },
147
+        hideModal() {
148
+            this.show = false;
149
+            this.info= {
150
+                dictValue: '',
151
+                dictLabel: '',
152
+                payType: '',
153
+                recyclePerson: '',
154
+                recyclePersonId: '',
155
+                quantity: 0,
156
+                orderDate: '',
157
+                orderType: '',
158
+                type: '',
159
+                dealPrice: 0,
160
+                amountReceived: 0,
161
+                orderRemark: '',
162
+                address: '',
163
+                afterSaleTab: [],
164
+            }
165
+        },
166
+        confirmEdit() {
167
+            uni.$u.api.wareHouseOrderUpdate({
168
+                id: this.info.id,
169
+                dictValue: this.info.dictValue,
170
+                dictLabel: this.info.dictLabel,
171
+                payType: this.info.payType,
172
+                recyclePerson: this.info.recyclePerson,
173
+                recyclePersonId: this.info.recyclePersonId,
174
+                quantity: this.info.quantity,
175
+                orderDate: this.info.orderDate,
176
+                orderType: this.info.orderType,
177
+                type: this.info.type,
178
+                dealPrice: this.info.dealPrice,
179
+                amountReceived: this.info.amountReceived,
180
+                orderRemark: this.info.orderRemark,
181
+                address: this.info.address,
182
+                afterSaleTab: this.info.afterSaleTab,
183
+                payTypeProofPicFileList: this.info.payTypeProofPicFileList,
184
+            }).then(() => {
185
+                uni.$u.toast('更新成功');
186
+                this.$emit('confirm');
187
+                this.hideModal();
188
+            }).catch(err => {
189
+                uni.$u.toast(err);
190
+            })
191
+        },
192
+        showBrandList() {
193
+            this.$refs.brandListRef.showBrandList();
194
+        },
195
+        handleSelectedBrand(info) {
196
+            this.$set(this.info, 'dictLabel', info.dictLabel);
197
+            this.$set(this.info, 'dictValue', info.dictValue);
198
+        },
199
+        handlePayTypeTabChange(e) {
200
+            this.info.payType = e;
201
+        },
202
+        showRecyclePersonPicker() {
203
+            this.$refs.recyclePersonPickerRef.open();
204
+        },
205
+        handleSelectRecyclePerson(info) {
206
+            this.info.recyclePerson = info.label;
207
+            this.info.recyclePersonId = info.id;
208
+        },
209
+        clear(field) {
210
+            if (field === 'brand') {
211
+                this.info.dictLabel = '';
212
+                this.info.dictValue = '';
213
+            }
214
+            if (field === 'recyclePerson') {
215
+                this.info.recyclePerson = '';
216
+                this.info.recyclePersonId = '';
217
+            }
218
+            this.info[field] = '';
219
+        },
220
+        confirmOrderDate() {
221
+            this.$nextTick(() => {
222
+                this.info.orderDate = this.$dayjs(this.info.orderDate).format('YYYY-MM-DD');
223
+                this.orderDateShow = false;
224
+            })
225
+        },
226
+        showOrderDatePicker() {
227
+            this.$nextTick(() => {
228
+                this.orderDateShow = true;
229
+            })
230
+        },
231
+        closeOrderDatePicker() {
232
+            this.orderDateShow = false;
233
+        },
234
+        getOrderTypeList() {
235
+            this.$getDicts("crm_sendOrder_type").then(res => {
236
+                this.orderTypeList = res
237
+            })
238
+        },
239
+        getTypeList() {
240
+            this.$getDicts("crm_form_category").then(res => {
241
+                this.typeList = res
242
+            })
243
+        },
244
+        changeOrderType(val) {
245
+            this.info.orderType = val
246
+        },
247
+        handleTabChangeType(e) {
248
+            this.info.type = e;
249
+        },
250
+        changeAfterSaleTab(val) {
251
+            this.info.afterSaleTab = val
252
+        },
253
+        getDeletePayTypeProofPicInfo(info) {
254
+            this.openOrderForm.payTypeProofPicFileList = info.newImages
255
+        },
256
+        afterReadPayTypeProofPic(event) {
257
+            event.file.forEach(item => {
258
+                uni.$u.api.uploadFile(item.url).then((res) => {
259
+                    this.info.payTypeProofPicFileList.push(res.data.url);
260
+                    uni.$u.toast("文件上传成功");
261
+                }).catch(() => {
262
+                    uni.$u.toast("上传文件失败");
263
+                })
264
+            })
265
+        },
266
+
267
+    }
268
+}
269
+</script>
270
+
271
+<style lang="scss" scoped>
272
+@import '../../styles/orderList/edit.scss';
273
+</style>

File diff suppressed because it is too large
+ 300 - 0
pages/wareHouse/components/orderList/index.vue


+ 7 - 35
pages/wareHouse/components/searchFilter.vue

@@ -5,7 +5,7 @@
5 5
                 <Cell :val="formData.dictLabel" :isDelete="true" :border="true" @handleClear="clear('dictLabel')"></Cell>
6 6
                 <BrandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></BrandList>
7 7
             </u-form-item>
8
-            <u-form-item label="价范围" labelWidth="70">
8
+            <u-form-item label="价范围" labelWidth="70">
9 9
                 <u-input v-model="formData.minPrice" placeholder="最小价格" fontSize="14" border="bottom" clearable></u-input>
10 10
                 &nbsp;&nbsp;——&nbsp;&nbsp;
11 11
                 <u-input v-model="formData.maxPrice" placeholder="最大价格" fontSize="14" border="bottom" clearable></u-input>
@@ -30,7 +30,7 @@
30 30
                 <TabSelect :tabList="productAttributeList" :colNum="3" :echoInfo="formData.productAttribute" mode="multiple" @tabChange="handleTabChangeProductAttribute"></TabSelect>
31 31
             </u-form-item>
32 32
             <u-form-item label="是否入库" labelWidth="70">
33
-                <TabSelect :tabList="stockStatusList" :colNum="4" :echoInfo="formData.stockStatus" mode="single" @tabChange="handleTabChangeStockStatus"></TabSelect>
33
+                <TabSelect :tabList="stockStatusListAll" :colNum="4" :echoInfo="formData.stockStatus" mode="single" @tabChange="handleTabChangeStockStatus"></TabSelect>
34 34
             </u-form-item>
35 35
         </u--form>
36 36
         <view class="btns">
@@ -45,6 +45,7 @@ import Cell from '@/components/custom-cell/index.vue'
45 45
 import BrandList from '@/components/brand-list/index.vue'
46 46
 import PersonPicker from '@/components/person-picker/index.vue'
47 47
 import TabSelect from '@/components/custom-tab-select/index.vue'
48
+import { productAttributeList, stockStatusListAll } from '../js/public.js'
48 49
 export default {
49 50
     components: {
50 51
         Cell,
@@ -74,39 +75,10 @@ export default {
74 75
             recycleTimeDefault: new Date().getTime(),
75 76
             recycleTimeShow: false,
76 77
             recyclePersonList: [],
77
-            productAttributeList: [
78
-                {
79
-                    name: '自有商品',
80
-                    value: '1',
81
-                },
82
-                {
83
-                    name: '寄卖商品',
84
-                    value: '2',
85
-                },
86
-                {
87
-                    name: '质押商品',
88
-                    value: '3',
89
-                },
90
-                {
91
-                    name: '其它',
92
-                    value: '4',
93
-                },
94
-            ],
95
-            stockStatusList: [
96
-                {
97
-                    name: '全部',
98
-                    value: '',
99
-                },
100
-                {
101
-                    name: '待入库',
102
-                    value: '0',
103
-                },
104
-                {
105
-                    name: '已入库',
106
-                    value: '1',
107
-                },
108
-
109
-            ],
78
+            // 将导入的变量在data中重新定义,确保模板能够访问
79
+            productAttributeList: productAttributeList,
80
+            stockStatusListAll: stockStatusListAll,
81
+            
110 82
         }
111 83
     },
112 84
     props: {

+ 175 - 118
pages/wareHouse/index.vue

@@ -11,7 +11,12 @@
11 11
 					</view>
12 12
 					<text class="asset-value">{{ wareHouseCard.totalCost }}</text>
13 13
 				</view>
14
-				<u-button class="view-btn" type="text" size="mini" @click="navigateToFakeRegistration">假货登记</u-button>
14
+				<view class="btn-group">
15
+					<u-button type="success" shape="circle" plain size="mini" @click="openOrderList">开单记录</u-button>
16
+					<order-list ref="orderListRef"></order-list>
17
+					<u-button type="primary" shape="circle" plain size="mini"
18
+						@click="navigateToFakeRegistration">假货登记</u-button>
19
+				</view>
15 20
 			</view>
16 21
 			<view class="data-cards">
17 22
 				<view class="card-item">
@@ -27,27 +32,30 @@
27 32
 					<text class="card-value">{{ wareHouseCard.totalNum }}</text>
28 33
 				</view>
29 34
 			</view>
30
-			<!-- <u-upload @afterRead="uploadTestAfter" name="1" multiple :maxCount="10"></u-upload> -->
31 35
 			<view class="search-wrapper">
32 36
 				<u-search placeholder="搜索编号、名称、品牌..." v-model="searchString" bg-color="#f9fafb" border-radius="4rpx"
33
-					:show-action="false" class="search-input-wrap" showAction @clear="handleSearch" @custom="handleSearch"></u-search>
37
+					:show-action="false" class="search-input-wrap" showAction @clear="handleSearch"
38
+					@custom="handleSearch"></u-search>
34 39
 			</view>
35 40
 
36 41
 			<view class="category-tabs-wrap">
37
-				<u-tabs :list="tabList" :is-scroll="true" active-color="#007aff" inactive-color="#666666" font-size="28rpx" keyName="dictLabel"
38
-					border-bottom="none" @change="switchTab" class="u-tabs-custom"></u-tabs>
42
+				<u-tabs :list="tabList" :is-scroll="true" active-color="#007aff" inactive-color="#666666"
43
+					font-size="28rpx" keyName="dictLabel" border-bottom="none" @change="switchTab"
44
+					class="u-tabs-custom"></u-tabs>
39 45
 			</view>
40 46
 
41 47
 			<view class="filter-bar">
42 48
 				<view class="sort-btn" @click="sortPickerShow = true">
43 49
 					<text class="sort-text">{{ curSortType.label }}</text>
44 50
 					<u-icon name="arrow-down" size="12" color="#666666" class="sort-icon"></u-icon>
45
-					<u-picker :show="sortPickerShow" :columns="sortColumns" keyName="label" @confirm="handleSortChange" @cancel="sortPickerShow = false"></u-picker>
51
+					<u-picker :show="sortPickerShow" :columns="sortColumns" keyName="label" @confirm="handleSortChange"
52
+						@cancel="sortPickerShow = false"></u-picker>
46 53
 				</view>
47 54
 
48 55
 				<view class="price-layout-btn">
49 56
 					<view class="price-btn" type="text" @click="priceVisibleChange">
50
-						<u-icon :name="priceVisible ? 'eye' : 'eye-off'" size="18" color="#1890ff" class="price-icon"></u-icon>
57
+						<u-icon :name="priceVisible ? 'eye' : 'eye-off'" size="18" color="#1890ff"
58
+							class="price-icon"></u-icon>
51 59
 						<text class="price-text">价格可见</text>
52 60
 					</view>
53 61
 					<view class="layout-btn" type="text" size="mini" @click="openSearchFilter">
@@ -59,52 +67,80 @@
59 67
 			</view>
60 68
 
61 69
 			<scroll-view class="goods-list" scroll-y @scrolltolower="handleLoadMore" enable-back-to-top>
62
-				<view @click="clickItem(goods)" class="goods-item" v-for="(goods, goodsIndex) in goodsList" :key="`goods-${goodsIndex}`">
63
-					<view class="goods-img-container">
64
-						<image class="goods-img" :src="goods.imgUrl ? goods.imgUrl : '/static/no-img.png'" mode="aspectFill" lazy-load></image>
65
-						<!-- <image class="goods-img" src="/static/no-img.png" mode="aspectFill" lazy-load></image> -->
66
-						<view :class="['stock-indicator', goods.downStatus == '1' ? 'up-indicator' : 'down-indicator']"></view>
67
-					</view>
70
+				<view @click.stop="clickItem(goods)" class="goods-item" v-for="(goods, goodsIndex) in goodsList"
71
+					:key="`goods-${goodsIndex}`">
72
+					<u-swipe-action>
73
+						<u-swipe-action-item :options="swipeOptions" @click="(e) => handleSwipeClick(e, goods)">
74
+							<view class="goods-info">
75
+								<view class="goods-img-container">
76
+									<image class="goods-img" :src="goods.imgUrl ? goods.imgUrl : '/static/no-img.png'"
77
+										mode="aspectFill" lazy-load></image>
78
+									<!-- <image class="goods-img" src="/static/no-img.png" mode="aspectFill" lazy-load></image> -->
79
+									<view
80
+										:class="['stock-indicator', goods.downStatus == '1' ? 'up-indicator' : 'down-indicator']">
81
+									</view>
82
+								</view>
83
+								<view class="info-content">
84
+									<view class="goods-brand">
85
+										<view>
86
+											{{ goods.dictLabel || '' }}
87
+										</view>
88
+										<image v-if="goods.indentifyCode" src="../../static/icons/code.png"
89
+											class="code-icon" mode="aspectFill" lazy-load></image>
90
+										<view>
91
+											{{ goods.indentifyCode || '' }}
92
+										</view>
93
+									</view>
94
+									<text class="goods-name">{{ goods.model || '' }}</text>
68 95
 
69
-					<view class="goods-info">
70
-						<text class="goods-brand">{{ goods.dictLabel || '' }}</text>
71
-						<text class="goods-name">{{ goods.model || '' }}</text>
96
+									<view class="price-group">
97
+										<view class="price-item" v-if="isWareHouseRole">
98
+											<text class="price-type">成本价</text>
99
+											<text class="price">¥{{ priceVisible ? goods.costPrice || '-' : '****'
100
+												}}</text>
101
+										</view>
102
+										<view class="price-item" v-if="isWareHouseRole">
103
+											<text class="price-type">销售价</text>
104
+											<text class="price sales">¥{{ priceVisible ? goods.salePrice || '-' : '****'
105
+												}}</text>
106
+										</view>
107
+										<view class="price-item" v-if="isWareHouseRole">
108
+											<text class="price-type">同行价</text>
109
+											<text class="price">¥{{ priceVisible ? goods.peerPrice || '-' : '****'
110
+												}}</text>
111
+										</view>
112
+										<view class="price-item">
113
+											<text class="price-type">代理价</text>
114
+											<text class="price">¥{{ priceVisible ? goods.agentPrice || '-' : '****'
115
+												}}</text>
116
+										</view>
117
+										<view class="price-item" v-if="isWareHouseRole">
118
+											<text class="price-type">实价</text>
119
+											<text class="price">¥{{ priceVisible ? goods.actualPrice || '-' : '****'
120
+												}}</text>
121
+										</view>
122
+										<view class="price-item" v-if="isWareHouseRole">
123
+											<text class="price-type">指导价</text>
124
+											<text class="price">¥{{ priceVisible ? goods.price || '-' : '****' }}</text>
125
+										</view>
72 126
 
73
-						<view class="price-group">
74
-							<view class="price-items" v-if="isWareHouseRole">
75
-								<view class="price-item">
76
-									<text class="price-type">成本价</text>
77
-									<text class="price">¥{{ priceVisible ? goods.costPrice || '-' : '****' }}</text>
78
-								</view>
79
-								<view class="price-item">
80
-									<text class="price-type">销售价</text>
81
-									<text class="price sales">¥{{ priceVisible ? goods.salePrice || '-' : '****' }}</text>
82
-								</view>
83
-							</view>
84
-							<view class="price-items">
85
-								<view class="price-item" v-if="isWareHouseRole">
86
-									<text class="price-type">同行价</text>
87
-									<text class="price">¥{{ priceVisible ? goods.peerPrice || '-' : '****' }}</text>
127
+									</view>
128
+
129
+									<!-- <view class="others">
130
+									<view class="other-item stock" >得</view>
131
+									<view class="other-item">得</view>
132
+									<view class="other-item">得</view>
133
+								</view> -->
88 134
 								</view>
89
-								<view class="price-item">
90
-									<text class="price-type">代理价</text>
91
-									<text class="price">¥{{ priceVisible ? goods.agentPrice || '-' : '****' }}</text>
135
+								<view class="more">
136
+									<view @click.stop="showMoreOptions(goods)">
137
+										<u-icon name="more-dot-fill" size="16" color="#666666"></u-icon>
138
+									</view>
139
+									<text class="goods-stock">数量:{{ goods.stock || 0 }}</text>
92 140
 								</view>
93 141
 							</view>
94
-						</view>
95
-
96
-						<!-- <view class="others">
97
-							<view class="other-item stock" >得</view>
98
-							<view class="other-item">得</view>
99
-							<view class="other-item">得</view>
100
-						</view> -->
101
-					</view>
102
-					<view class="more">
103
-						<view @click.stop="showMoreOptions(goods)">
104
-							<u-icon name="more-dot-fill" size="16" color="#666666"></u-icon>
105
-						</view>
106
-						<text class="goods-stock">数量:{{ goods.stock}}</text>
107
-					</view>
142
+						</u-swipe-action-item>
143
+					</u-swipe-action>
108 144
 				</view>
109 145
 			</scroll-view>
110 146
 		</view>
@@ -116,26 +152,28 @@
116 152
 	</view>
117 153
 </template>
118 154
 <script>
119
-	import searchFilter from './components/searchFilter.vue'
120
-	import moreInfo from './components/moreInfo.vue'
121
-	import { permissionCheck } from '../../utils/util.js'
155
+import searchFilter from './components/searchFilter.vue'
156
+import moreInfo from './components/moreInfo.vue'
157
+import { permissionCheck } from '../../utils/util.js'
158
+import orderList from './components/orderList/index.vue'
122 159
 export default {
123 160
 	components: {
124 161
 		searchFilter,
125 162
 		moreInfo,
163
+		orderList,
126 164
 	},
127 165
 	data() {
128 166
 		return {
129
-			searchString:'',//搜索编号、名称、品牌...
130
-			type:'',
131
-			searchInfo:{},
132
-			pageNum:1,
133
-			pageSize:10,
134
-			curSortType:{
135
-				id:4,
167
+			searchString: '',//搜索编号、名称、品牌...
168
+			type: '',
169
+			searchInfo: {},
170
+			pageNum: 1,
171
+			pageSize: 10,
172
+			curSortType: {
173
+				id: 4,
136 174
 				label: '按入库最新',
137 175
 			},
138
-			wareHouseCard:{
176
+			wareHouseCard: {
139 177
 				totalCost: '-',
140 178
 				uploadCostToday: '-',
141 179
 				outStockToday: '-',
@@ -159,96 +197,95 @@ export default {
159 197
 			sortPickerShow: false,
160 198
 			sortColumns: [[
161 199
 				{
162
-					label:'按最久未下载',
163
-					id:1
200
+					label: '按最久未下载',
201
+					id: 1
164 202
 				},
165 203
 				{
166
-					label:'按最近更新',
167
-					id:2
204
+					label: '按最近更新',
205
+					id: 2
168 206
 				},
169 207
 				{
170
-					label:'按最久更新',
171
-					id:3
208
+					label: '按最久更新',
209
+					id: 3
172 210
 				},
173 211
 				{
174
-					label:'按入库最新',
175
-					id:4
212
+					label: '按入库最新',
213
+					id: 4
176 214
 				},
177 215
 				{
178
-					label:'按入库最久',
179
-					id:5
216
+					label: '按入库最久',
217
+					id: 5
180 218
 				},
181 219
 				{
182
-					label:'按价格最高',
183
-					id:6
220
+					label: '按价格最高',
221
+					id: 6
184 222
 				},
185 223
 				{
186
-					label:'按价格最低',
187
-					id:7
224
+					label: '按价格最低',
225
+					id: 7
188 226
 				},
189 227
 			]],
190
-			priceVisible:true,
191
-			searchPopShow:false,
192
-			total:0,
193
-			moreOptions:{},
194
-			moreOptionsShow:false,
195
-			isWareHouseRole:permissionCheck('WAREHOUSER',false),
228
+			priceVisible: true,
229
+			searchPopShow: false,
230
+			total: 0,
231
+			moreOptions: {},
232
+			moreOptionsShow: false,
233
+			isWareHouseRole: permissionCheck('WAREHOUSER', false),
234
+			swipeOptions: [
235
+				{
236
+					text: '删除',
237
+					style: {
238
+						backgroundColor: '#f56c6c'
239
+					}
240
+				},
241
+			],
242
+			isSwipeClick: false,
196 243
 		};
197 244
 	},
198 245
 	onLoad() {
199 246
 		this.getTypeList();
200 247
 	},
201 248
 	methods: {
202
-		showMoreOptions(goods){
249
+		showMoreOptions(goods) {
203 250
 			this.moreOptions = goods;
204 251
 			this.$refs.moreInfoRef.showMoreInfo();
205 252
 		},
206
-		getTypeList(){
207
-            this.$getDicts("crm_form_category").then(res => {
208
-                this.tabList = [...res]
209
-                this.tabList.unshift({ dictLabel: "全部", dictValue: '' })
210
-            })
211
-        },
212
-		uploadTestAfter(info){
213
-			console.log(info);
214
-			info.file.forEach(item=>{
215
-				uni.$u.api.uploadFile(item.url).then((res) => {
216
-					uni.$u.toast("文件上传成功");
217
-				}).catch(() => {
218
-					uni.$u.toast("上传文件失败");
219
-				})
253
+		getTypeList() {
254
+			this.$getDicts("crm_form_category").then(res => {
255
+				this.tabList = [...res]
256
+				this.tabList.unshift({ dictLabel: "全部", dictValue: '' })
220 257
 			})
221 258
 		},
222
-		getList(){
259
+		getList() {
223 260
 			uni.$u.api.wareHouseList({
224 261
 				pageNum: this.pageNum,
225 262
 				pageSize: this.pageSize,
226 263
 			},
227
-			{
228
-				searchString:this.searchString,
229
-				sortType:this.curSortType.id,
230
-				type:this.type,
231
-				...this.searchInfo
232
-			}).then(res => {
233
-				if(this.pageNum == 1){
234
-					this.goodsList = res.rows;
235
-				}else{
236
-					this.goodsList = this.goodsList.concat(res.rows);
237
-				}
238
-				this.total = res.total;
239
-			});
264
+				{
265
+					searchString: this.searchString,
266
+					sortType: this.curSortType.id,
267
+					type: this.type,
268
+					...this.searchInfo
269
+				}).then(res => {
270
+					if (this.pageNum == 1) {
271
+						this.goodsList = res.rows;
272
+					} else {
273
+						this.goodsList = this.goodsList.concat(res.rows);
274
+					}
275
+					this.total = res.total;
276
+				});
240 277
 		},
241 278
 		// 加载更多
242 279
 		handleLoadMore() {
243 280
 			console.log("加载更多");
244
-			if(this.goodsList.length >= this.total){
281
+			if (this.goodsList.length >= this.total) {
245 282
 				uni.$u.toast("没有更多了");
246 283
 				return;
247 284
 			}
248 285
 			this.pageNum++;
249 286
 			this.getList();
250 287
 		},
251
-		handleSearch(info){
288
+		handleSearch(info) {
252 289
 			this.pageNum = 1;
253 290
 			this.searchInfo = info;
254 291
 			this.goodsList = [];
@@ -258,25 +295,42 @@ export default {
258 295
 			this.type = item.dictValue;
259 296
 			this.handleSearch();
260 297
 		},
261
-		clickItem(item){
298
+		clickItem(item) {
299
+			if (this.isSwipeClick) {
300
+				this.isSwipeClick = false;
301
+				return;
302
+			}
262 303
 			// 如果是待入库商品,点击后跳转到添加页面补全信息
263
-			if(item.stockStatus === '0'){
304
+			if (item.stockStatus == '0') {
264 305
 				this.handleEdit(item)
265
-			}else{
306
+			} else {
266 307
 				this.handleToDetail(item);
267 308
 			}
268 309
 		},
310
+		handleSwipeClick(e, item) {
311
+			if (e.index == 0) {//删除
312
+				this.isSwipeClick = true;
313
+				uni.$u.api.wareHouseDelete({
314
+					id: item.id
315
+				}).then(() => {
316
+					uni.$u.toast("删除成功");
317
+					this.handleSearch();
318
+				}).catch((err) => {
319
+					uni.$u.toast(err);
320
+				});
321
+			}
322
+		},
269 323
 		handleToDetail(item) {
270 324
 			uni.navigateTo({
271 325
 				url: `/pages/wareHouse/components/detail?id=${item.id}`,
272 326
 			});
273 327
 		},
274 328
 		handleEdit(item) {
275
-			if(item.id){
329
+			if (item.id) {
276 330
 				uni.navigateTo({
277 331
 					url: `/pages/wareHouse/components/edit?formType=edit&id=${item.id}`
278 332
 				});
279
-			}else{
333
+			} else {
280 334
 				uni.navigateTo({
281 335
 					url: `/pages/wareHouse/components/edit?formType=add`
282 336
 				});
@@ -290,15 +344,15 @@ export default {
290 344
 				}
291 345
 			});
292 346
 		},
293
-		handleSortChange(e){
347
+		handleSortChange(e) {
294 348
 			this.curSortType = e.value[0];
295 349
 			this.sortPickerShow = false;
296 350
 			this.handleSearch();
297 351
 		},
298
-		priceVisibleChange(){
352
+		priceVisibleChange() {
299 353
 			this.priceVisible = !this.priceVisible;
300 354
 		},
301
-		openSearchFilter(){
355
+		openSearchFilter() {
302 356
 			this.$refs.searchFilter.open();
303 357
 		},
304 358
 		navigateToFakeRegistration() {
@@ -306,6 +360,9 @@ export default {
306 360
 				url: '/pages/wareHouse/components/fakeRegistration',
307 361
 			});
308 362
 		},
363
+		openOrderList() {
364
+			this.$refs.orderListRef.openList();
365
+		},
309 366
 	},
310 367
 	onShow() {
311 368
 		this.pageNum = 1;

+ 182 - 0
pages/wareHouse/js/public.js

@@ -0,0 +1,182 @@
1
+export const afterSaleTabList = [
2
+    {
3
+        name: '假一赔三',
4
+        value: 1,
5
+    },
6
+    {
7
+        name: '一年质保',
8
+        value: 2,
9
+    },
10
+    {
11
+        name: '一年内八折回收',
12
+        value: 3,
13
+    },
14
+    {
15
+        name: '送保养一次',
16
+        value: 4,
17
+    },
18
+    {
19
+        name: '原厂配件保证',
20
+        value: 5,
21
+    },
22
+]
23
+export const productConditionList = [
24
+    {
25
+        name: '闲置未使用',
26
+        value: '1',
27
+    },
28
+    {
29
+        name: '二手',
30
+        value: '2',
31
+    },
32
+]
33
+export const productAttributeList = [
34
+    {
35
+        name: '自有商品',
36
+        value: '1',
37
+    },
38
+    {
39
+        name: '寄卖商品',
40
+        value: '2',
41
+    },
42
+    {
43
+        name: '质押商品',
44
+        value: '3',
45
+    },
46
+    {
47
+        name: '其它',
48
+        value: '4',
49
+    },
50
+]
51
+export const stockStatusList = [
52
+    {
53
+        name: '待入库',
54
+        value: '0',
55
+    },
56
+    {
57
+        name: '已入库',
58
+        value: '1',
59
+    },
60
+]
61
+export const stockStatusListAll = [
62
+    {
63
+        name: '全部',
64
+        value: '',
65
+    },
66
+    {
67
+        name: '待入库',
68
+        value: '0',
69
+    },
70
+    {
71
+        name: '已入库',
72
+        value: '1',
73
+    },
74
+
75
+]
76
+export const recycleTypeList = [
77
+    {
78
+        name: '线上',
79
+        value: '1',
80
+    },
81
+    {
82
+        name: '同行',
83
+        value: '2',
84
+    },
85
+    {
86
+        name: '门店',
87
+        value: '3',
88
+    },
89
+    {
90
+        name: '其它',
91
+        value: '4',
92
+    },
93
+]
94
+export const labelList = [
95
+    {
96
+        name: '完美',
97
+        value: '1',
98
+    },
99
+    {
100
+        name: '普通',
101
+        value: '2',
102
+    },
103
+    {
104
+        name: '瑕疵',
105
+        value: '3',
106
+    },
107
+    {
108
+        name: '假货',
109
+        value: '4',
110
+    },
111
+    {
112
+        name: '亏损',
113
+        value: '5',
114
+    },
115
+]
116
+export const paymentTabList = [
117
+    {
118
+        name: '微信',
119
+        value: "1",
120
+    },
121
+    {
122
+        name: '支付宝',
123
+        value: "2",
124
+    },
125
+    {
126
+        name: '银行卡',
127
+        value: "3",
128
+    },
129
+    {
130
+        name: '现金',
131
+        value: "4",
132
+    },
133
+    {
134
+        name: '数字货币',
135
+        value: "5",
136
+    },
137
+    {
138
+        name: '挂账',
139
+        value: "6",
140
+    },
141
+]
142
+export const shortTimeList = [{
143
+    unit: 'day',
144
+    key: '全部',
145
+    value: 0
146
+},
147
+{
148
+    unit: 'day',
149
+    key: '今天',
150
+    value: 1
151
+},
152
+{
153
+    unit: 'day',
154
+    key: '昨天',
155
+    value: -1
156
+},
157
+{
158
+    unit: 'day',
159
+    key: '近3天',
160
+    value: 3
161
+},
162
+{
163
+    unit: 'day',
164
+    key: '近7天',
165
+    value: 7
166
+},
167
+{
168
+    unit: 'day',
169
+    key: '近15天',
170
+    value: 15
171
+},
172
+{
173
+    unit: 'month',
174
+    key: '本月',
175
+    value: 1
176
+},
177
+{
178
+    unit: 'month',
179
+    key: '上月',
180
+    value: -1
181
+},
182
+]

+ 152 - 103
pages/wareHouse/styles/index.scss

@@ -1,22 +1,25 @@
1 1
 /* 页面容器 */
2
-.page{
2
+.page {
3 3
   width: 100%;
4 4
   height: 100vh;
5 5
   background-color: #fff;
6 6
   display: flex;
7 7
   flex-direction: column;
8 8
 }
9
+
9 10
 .page-container {
10 11
   flex: 1;
11 12
   display: flex;
12 13
   flex-direction: column;
13 14
   background-color: #f9fafb;
14
-  padding-bottom:20rpx;
15
+  padding-bottom: 20rpx;
15 16
   overflow: hidden;
16 17
 }
17
-.nav-bar{
18
+
19
+.nav-bar {
18 20
   border-bottom: 1px solid #f7f6f6 !important;
19 21
 }
22
+
20 23
 /* 总资产区域 */
21 24
 .asset-header {
22 25
   width: 100%;
@@ -32,11 +35,20 @@
32 35
   .asset-text-wrap {
33 36
     flex: 1;
34 37
   }
35
-  .asset-title-con{
36
-      display: flex;
37
-      align-items: center;
38
-      justify-content: flex-start;
39
-      margin-bottom: 12rpx;
38
+
39
+  .btn-group {
40
+    display: flex;
41
+    align-items: center;
42
+    justify-content: flex-end;
43
+    gap: 10rpx;
44
+  }
45
+
46
+  .asset-title-con {
47
+    display: flex;
48
+    align-items: center;
49
+    justify-content: flex-start;
50
+    margin-bottom: 12rpx;
51
+
40 52
     .asset-title {
41 53
       font-size: 26rpx;
42 54
       color: #999999;
@@ -52,20 +64,6 @@
52 64
     font-weight: 600;
53 65
     letter-spacing: 2rpx;
54 66
   }
55
-
56
-  .view-btn {
57
-    width: auto;
58
-    padding: 0 25rpx;
59
-    background-color: #e3eefd;
60
-    color: #0d83f1;
61
-    font-size: 20rpx;
62
-    border-radius: 30rpx;
63
-    font-weight: 500;
64
-    text-align: center;
65
-    border: none;
66
-    margin: 0;
67
-    float: none;
68
-  }
69 67
 }
70 68
 
71 69
 /* 数据卡片 */
@@ -75,6 +73,7 @@
75 73
   padding-bottom: 20rpx;
76 74
   background-color: #fff;
77 75
   padding: 8rpx 15rpx;
76
+
78 77
   .card-item {
79 78
     flex: 1;
80 79
     text-align: center;
@@ -82,29 +81,34 @@
82 81
     padding: 24rpx 0;
83 82
     margin: 0 10rpx;
84 83
     border-radius: 24rpx;
84
+
85 85
     .card-label {
86 86
       font-size: 26rpx;
87 87
       color: #666;
88 88
       display: block;
89 89
       margin-bottom: 8rpx;
90 90
     }
91
+
91 92
     .card-value {
92 93
       font-size: 36rpx;
93 94
       font-weight: 700;
94 95
       color: #333;
95 96
       display: block;
97
+
96 98
       &.green {
97 99
         color: #09bb07;
98 100
       }
99 101
     }
100
-	&:nth-of-type(1){
101
-		margin-left:0;
102
-	}
103
-	&:nth-last-of-type(1){
104
-		margin-right:0;
105
-	}
102
+
103
+    &:nth-of-type(1) {
104
+      margin-left: 0;
105
+    }
106
+
107
+    &:nth-last-of-type(1) {
108
+      margin-right: 0;
109
+    }
106 110
   }
107
-	
111
+
108 112
 }
109 113
 
110 114
 /* 搜索框区域 */
@@ -116,6 +120,7 @@
116 120
   justify-content: space-between;
117 121
   align-items: center;
118 122
   background-color: #fff;
123
+
119 124
   .search-input-wrap {
120 125
     height: 100%;
121 126
     --u-search-bg-color: #ffffff !important;
@@ -127,6 +132,7 @@
127 132
     border: none !important;
128 133
     box-shadow: none !important;
129 134
   }
135
+
130 136
   .search-filter-btn {
131 137
     margin-left: 20rpx;
132 138
     width: 60rpx;
@@ -145,9 +151,10 @@
145 151
   padding: 8rpx 15rpx;
146 152
   margin-bottom: 20rpx;
147 153
   background: #ffffff !important;
154
+
148 155
   .u-tabs-custom {
149 156
     --u-tabs-bg-color: #ffffff !important;
150
-    background: #ffffff !important; 
157
+    background: #ffffff !important;
151 158
     --u-tabs-border-bottom: none !important;
152 159
     --u-tabs-item-padding: 10rpx 20rpx !important;
153 160
     --u-tabs-item-margin: 0 10rpx !important;
@@ -200,10 +207,12 @@
200 207
       }
201 208
     }
202 209
   }
203
-  .price-layout-btn{
210
+
211
+  .price-layout-btn {
204 212
     display: flex;
205 213
     justify-content: space-between;
206 214
     align-items: center;
215
+
207 216
     .price-btn {
208 217
       background: transparent;
209 218
       padding: 0;
@@ -246,9 +255,11 @@
246 255
   background-color: #f9fafb;
247 256
   overflow: hidden;
248 257
   height: 100%;
249
-  ::v-deep .uni-scroll-view{
258
+
259
+  ::v-deep .uni-scroll-view {
250 260
     height: 100%;
251 261
   }
262
+
252 263
   .goods-item {
253 264
     margin: 10rpx 15rpx;
254 265
     background-color: #fff;
@@ -259,6 +270,18 @@
259 270
     align-items: stretch;
260 271
     gap: 20rpx;
261 272
 
273
+    .u-swipe-action {
274
+      flex: 1;
275
+      display: flex;
276
+      align-items: stretch;
277
+    }
278
+
279
+    .u-swipe-action-item {
280
+      flex: 1;
281
+      display: flex;
282
+      align-items: stretch;
283
+    }
284
+
262 285
     .goods-img-container {
263 286
       position: relative;
264 287
       flex-shrink: 0;
@@ -273,96 +296,123 @@
273 296
 
274 297
     .stock-indicator {
275 298
       position: absolute;
276
-      bottom: 14rpx;
277
-      right: 6rpx;
299
+      top: 140rpx;
300
+      right: 0;
278 301
       width: 20rpx;
279 302
       height: 20rpx;
280 303
       border-radius: 50%;
281 304
       border: 2rpx solid #ffffff;
282 305
     }
283
-    .up-indicator{
306
+
307
+    .up-indicator {
284 308
       background-color: #09bb07;
285 309
     }
286
-    .down-indicator{
310
+
311
+    .down-indicator {
287 312
       background-color: #c7d5c7;
288 313
     }
314
+
289 315
     .goods-info {
290 316
       flex: 1;
291
-      .goods-brand {
292
-        font-size: 32rpx;
293
-        font-weight: 700;
294
-        color: #333333;
295
-        display: block;
296
-        line-height: 1.2;
297
-      }
317
+      display: flex;
318
+      align-items: stretch;
319
+      gap: 20rpx;
298 320
 
299
-      .goods-name {
300
-        font-size: 26rpx;
301
-        color: #666666;
302
-        display: block;
303
-        font-weight: 600;
304
-        line-height: 1.4;
305
-        word-break: break-all;
306
-      }
307
-      .price-group{
308
-        .price-items{
321
+      .info-content {
322
+        flex: 1;
323
+
324
+        .goods-brand {
325
+          font-size: 32rpx;
326
+          font-weight: 700;
327
+          color: #333333;
328
+          display: block;
329
+          line-height: 1.2;
309 330
           display: flex;
310
-          justify-content: space-between;
311
-          .price-item{
312
-            display: flex;
313
-            flex-direction: column;
314
-            justify-content: flex-start;
315
-            .price-type{
316
-              color: #d1d5db;
317
-              font-size: 24rpx;
318
-            }
319
-            .price{
320
-              font-weight: 700;
321
-            }
322
-            .sales{
323
-              color: red;
324
-            }
331
+          align-items: center;
332
+          gap: 8rpx;
333
+
334
+          .code-icon {
335
+            width: 28rpx;
336
+            height: 22rpx;
325 337
           }
326 338
         }
327
-      }
328
-      .others{
329
-        margin-top: 20rpx;
330
-        display: flex;
331
-        align-items: center;
332
-        gap: 12rpx;
333
-        .other-item{
339
+
340
+        .goods-name {
341
+          font-size: 26rpx;
342
+          color: #666666;
343
+          display: block;
344
+          font-weight: 600;
345
+          line-height: 1.4;
346
+          word-break: break-all;
347
+        }
348
+
349
+        .price-group {
350
+          display: grid;
351
+          grid-template-columns: repeat(2, 1fr);
352
+            .price-item {
353
+              display: flex;
354
+              flex-direction: column;
355
+              justify-content: flex-start;
356
+
357
+              .price-type {
358
+                color: #d1d5db;
359
+                font-size: 24rpx;
360
+              }
361
+
362
+              .price {
363
+                font-weight: 700;
364
+              }
365
+
366
+              .sales {
367
+                color: red;
368
+              }
369
+            }
370
+        }
371
+
372
+        .others {
373
+          margin-top: 20rpx;
334 374
           display: flex;
335 375
           align-items: center;
336
-          justify-content: center;
337
-          width: 26rpx;
338
-          height: 26rpx;
339
-          font-size: 20rpx;
340
-          color: #c5c3c3;
341
-          background-color: #f5f5f5;
342
-          padding:6rpx;
343
-          border-radius:50%;
344
-          &.stock{
345
-            background-color: #007aff;
346
-            color: #fff;
376
+          gap: 12rpx;
377
+
378
+          .other-item {
379
+            display: flex;
380
+            align-items: center;
381
+            justify-content: center;
382
+            width: 26rpx;
383
+            height: 26rpx;
384
+            font-size: 20rpx;
385
+            color: #c5c3c3;
386
+            background-color: #f5f5f5;
387
+            padding: 6rpx;
388
+            border-radius: 50%;
389
+
390
+            &.stock {
391
+              background-color: #007aff;
392
+              color: #fff;
393
+            }
347 394
           }
348 395
         }
349 396
       }
350
-    }
351
-    .more{
352
-      display: flex;
353
-      flex-direction: column;
354
-      align-items: flex-end;
355
-      justify-content: space-between;
356
-      gap: 20rpx;
357
-      .goods-stock {
358
-        font-size: 24rpx;
359
-        color: #666666;
360
-        align-self: flex-end;
361
-        flex-shrink: 0;
362
-        padding-left: 10rpx;
397
+
398
+      .more {
399
+        display: flex;
400
+        flex-direction: column;
401
+        align-items: flex-end;
402
+        justify-content: space-between;
403
+        gap: 20rpx;
404
+
405
+        .goods-stock {
406
+          font-size: 24rpx;
407
+          color: #666666;
408
+          align-self: flex-end;
409
+          flex-shrink: 0;
410
+          padding-left: 10rpx;
411
+        }
363 412
       }
364 413
     }
365 414
   }
415
+
366 416
 }
367 417
 
368 418
 /* 添加按钮 */
@@ -378,12 +428,11 @@
378 428
   align-items: center;
379 429
   justify-content: center;
380 430
   box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
381
-  z-index: 999;
431
+  z-index: 20;
382 432
   cursor: pointer;
383 433
   transition: all 0.3s ease;
384
-  
434
+
385 435
   &:active {
386 436
     transform: scale(0.95);
387 437
   }
388
-}
389
-
438
+}

+ 40 - 0
pages/wareHouse/styles/orderList/edit.scss

@@ -0,0 +1,40 @@
1
+.form-container {
2
+    max-height: 70vh;
3
+    overflow: auto;
4
+    padding-right: 10rpx;
5
+    
6
+    &::-webkit-scrollbar {
7
+        width: 6rpx;
8
+    }
9
+    
10
+    &::-webkit-scrollbar-track {
11
+        background: #f1f1f1;
12
+        border-radius: 3rpx;
13
+    }
14
+    
15
+    &::-webkit-scrollbar-thumb {
16
+        background: #c1c1c1;
17
+        border-radius: 3rpx;
18
+    }
19
+    
20
+    &::-webkit-scrollbar-thumb:hover {
21
+        background: #a1a1a1;
22
+    }
23
+}
24
+
25
+::v-deep .u-form {
26
+    width: 100%;
27
+
28
+    .u-form-item {
29
+
30
+        &.u-form-item-row {
31
+            .u-form-item__body {
32
+                flex-direction: row !important;
33
+
34
+                .u-form-item__body__left {
35
+                    width: auto !important;
36
+                }
37
+            }
38
+        }
39
+    }
40
+}

+ 48 - 0
pages/wareHouse/styles/orderList/index.scss

@@ -0,0 +1,48 @@
1
+::v-deep .u-transition{
2
+    z-index: 999 !important;//解决预览图片层级问题
3
+}
4
+::v-deep .order_list{
5
+    overflow: hidden;
6
+    padding:0 20rpx;
7
+    font-size: 28rpx;
8
+    .search_form{
9
+        display: flex;
10
+        align-items: center;
11
+        justify-content: space-between;
12
+        gap: 10rpx;
13
+    }
14
+    .btns{
15
+        display: flex;
16
+        gap:20rpx;
17
+        padding: 20rpx;
18
+    }
19
+    .list_wrap{
20
+        margin-top: 20rpx;
21
+        overflow: auto;
22
+        height: calc(100vh - 200rpx);
23
+        width: 100%;
24
+        .order_item{
25
+            background-color: #ffffff;
26
+            border-radius: 20rpx;
27
+            padding: 20rpx;
28
+            margin-bottom: 20rpx;
29
+            border: 1px solid #f7f6f6;
30
+            box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
31
+            line-height: 44rpx;
32
+            .order_col_1{
33
+                display: grid;
34
+                flex:1;
35
+            }
36
+            .order_col_2{
37
+                display: grid;
38
+                grid-template-columns: repeat(2, 1fr);
39
+            }
40
+            .scroll_img{
41
+                width: calc(100vw - 80rpx);
42
+            }
43
+        }
44
+    }
45
+    .search_pop{
46
+        padding: 40rpx 20rpx;
47
+    }
48
+}

BIN
static/icons/code.png


+ 1 - 1
uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js

@@ -72,7 +72,7 @@ const cfu = {
72 72
       }
73 73
     },
74 74
 	'tooltipFormatPrice':function(item, category, index, opts){
75
-		return item.name + category.substring(2) + ':' + item.data + '元'
75
+		return item.name + '  ' + category.substring(2) + ':' + item.data + '元'
76 76
     },
77 77
   },
78 78
   //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。

+ 8 - 11
utils/api.js

@@ -3,7 +3,7 @@ import qs from 'qs';
3 3
 
4 4
 import store from "../store/index.js";
5 5
 import config from '../uni_modules/uview-ui/libs/config/config.js';
6
-const mockApi = 'http://192.168.0.243:3001/mock-api/prod-api/crm';
6
+const mockApi = 'http://192.168.0.243:3001/mock-api/prod-api/crm';//本地mock服务地址
7 7
 
8 8
 const install = (Vue, vm) => {
9 9
 	vm.$u.api = {
@@ -115,10 +115,7 @@ const install = (Vue, vm) => {
115 115
 		// 支付相关接口
116 116
 		saveOrderFileAndTransfer:(data={})=>http.post(store.state.user.path + '/storeInfo/saveOrderFileAndTransfer',data),
117 117
 
118
-		// ========== Mock接口(开发环境使用,本地Mock服务器)==========
119
-		// 服务器地址: http://192.168.0.243:3001
120
-		// 手机预览时需要使用电脑局域网IP,不能用localhost
121
-		// 切换真实接口时,将 baseUrl 改为真实接口地址即可
118
+		//启动mock服务,把store.state.user.path换成mockApi 手机预览时需要使用电脑局域网IP,不能用localhost
122 119
 		getPersonCards:(params)=>http.get(store.state.user.path+'/personCenter/getPersonCards',{ params }),//个人中心-获取个人中心数据
123 120
 		getPersonLatestClue:(params)=>http.get(store.state.user.path+'/personCenter/getPersonLatestClue',{ params }),//个人中心-获取最新线索
124 121
 		getPersonRanking:(params)=>http.get(store.state.user.path+'/personCenter/getPersonRanking',{ params }),//个人中心-获取个人排名
@@ -138,17 +135,17 @@ const install = (Vue, vm) => {
138 135
 		wareHouseFakeAdd:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseFakeAdd',data),//仓库中心-假货新增
139 136
 		wareHouseFakeEdit:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseFakeEdit',data),//仓库中心-假货编辑
140 137
 		wareHouseFakeList:(params,data)=>http.post(store.state.user.path+'/warehouse/wareHouseFakeList?' + qs.stringify(params), data),//仓库中心-假货列表
141
-
142
-
143
-
138
+		xhlSystemSetList:(data)=>http.post(store.state.user.path+'/xhlSystemSet/list', data),//系统设置-列表
139
+		wareHouseOrderList:(data)=>http.post(store.state.user.path+'/wareHouseOrder/list',data),//开单列表
140
+		wareHouseOrderDelete:(data)=>http.delete(store.state.user.path+'/wareHouseOrder/' + data.id ),//删除开单
141
+		wareHouseOrderDetail:(params)=>http.get(store.state.user.path+'/wareHouseOrder/'+params.id),//开单详情
142
+		wareHouseOrderUpdate:(data)=>http.put(store.state.user.path+'/wareHouseOrder',data),//开单编辑
143
+		wareHouseDelete:(data)=>http.delete(store.state.user.path+'/warehouse/' + data.id ),//仓库删除
144 144
 		saveOrderFileAndTransfer: (data = {}) => http.post(store.state.user.path + '/storeInfo/saveOrderFileAndTransfer', data),
145 145
 
146 146
 		// 删除订单分成数据
147 147
 		deleteClueCommissionForm: (id, config = {}) => http.delete(store.state.user.path + '/clueCommissionForm/' + id),
148 148
 
149
-
150
-
151
-
152 149
 	}
153 150
 }
154 151
 

+ 3 - 1
utils/util.js

@@ -406,5 +406,7 @@ export function permissionCheck(roleKey,isShowToast = true) {
406 406
     if(!getRoles().includes(roleKey)){
407 407
         if(isShowToast) uni.$u.toast('无权限');
408 408
         return false
409
-    }
409
+    }else{
410
+		return true
411
+	}
410 412
 }