|
|
@@ -26,25 +26,28 @@
|
|
26
|
26
|
<orderDetailNewView :detail="receiptDetail" :topInfo="topInfo" :orderId="orderId"
|
|
27
|
27
|
:currentReceipt="currentReceipt" />
|
|
28
|
28
|
|
|
29
|
|
- <!-- 通用模态窗 -->
|
|
30
|
|
- <custom-modal :visible="modalVisible" :title="modalConfig.title" :value="modalConfig.value"
|
|
31
|
|
- :placeholder="modalConfig.placeholder" @cancel="handleModalCancel" @confirm="handleModalConfirm" />
|
|
|
29
|
+
|
|
32
|
30
|
|
|
33
|
31
|
<!-- 加一单选择模态窗 -->
|
|
34
|
|
- <u-modal :show="addOneModelShow" :title="'新增收件信息'" showCancelButton @cancel="addOneModelShow = false"
|
|
|
32
|
+ <u-modal :show="addOneModelShow" :title="'加一单'" showCancelButton @cancel="addOneModelShow = false"
|
|
35
|
33
|
@confirm="handleAddOneConfirm">
|
|
36
|
|
- <u--form>
|
|
37
|
|
- <u-form-item :model="checkModel" label="请选择品牌" prop="brand" borderBottom
|
|
38
|
|
- @click="showBrandSelector = true;">
|
|
39
|
|
- <u--input v-model="checkModel.brand" disabled disabledColor="#ffffff" placeholder="请选择品牌"
|
|
40
|
|
- @click="showBrandSelector = true;" border="none"></u--input>
|
|
41
|
|
- <u-icon slot="right" name="arrow-right"></u-icon>
|
|
42
|
|
- </u-form-item>
|
|
43
|
|
- </u--form>
|
|
|
34
|
+ <u-button type="primary" plain @click="showBrandSelector = true;"
|
|
|
35
|
+ :text="currentAddBrand.dictLabel || '点击请选择品牌'"></u-button>
|
|
44
|
36
|
</u-modal>
|
|
45
|
|
- <!-- 品牌选择器 -->
|
|
|
37
|
+ <!-- 加一单品牌选择器 -->
|
|
46
|
38
|
<u-picker :show="showBrandSelector" @confirm="handleBrandConfirm" :columns="brandColumns"
|
|
47
|
39
|
@cancel='showBrandSelector = false' keyName="dictLabel"></u-picker>
|
|
|
40
|
+
|
|
|
41
|
+
|
|
|
42
|
+
|
|
|
43
|
+ <!-- 修改当前品牌选择器 -->
|
|
|
44
|
+ <u-picker :show="editBrandSelector" @confirm="handleEditBrandConfirm" :columns="brandColumns"
|
|
|
45
|
+ @cancel='editBrandSelector = false' keyName="dictLabel"></u-picker>
|
|
|
46
|
+
|
|
|
47
|
+
|
|
|
48
|
+ <!-- 修改当前型号、价格弹窗 -->
|
|
|
49
|
+ <custom-modal :visible="modalVisible" :title="modalConfig.title" :value="modalConfig.value"
|
|
|
50
|
+ :placeholder="modalConfig.placeholder" @cancel="handleModalCancel" @confirm="handleModalConfirm" />
|
|
48
|
51
|
</view>
|
|
49
|
52
|
</template>
|
|
50
|
53
|
|
|
|
@@ -64,7 +67,6 @@ export default {
|
|
64
|
67
|
model: '',
|
|
65
|
68
|
price: ''
|
|
66
|
69
|
},
|
|
67
|
|
- modalVisible: false,
|
|
68
|
70
|
currentEditField: '',
|
|
69
|
71
|
modalConfig: {
|
|
70
|
72
|
title: '',
|
|
|
@@ -92,8 +94,10 @@ export default {
|
|
92
|
94
|
[]
|
|
93
|
95
|
],
|
|
94
|
96
|
//当前选择的品牌
|
|
95
|
|
- currentAddBrand: {}
|
|
96
|
|
-
|
|
|
97
|
+ currentAddBrand: {},
|
|
|
98
|
+ //修改当前品牌选择器
|
|
|
99
|
+ editBrandSelector: false,
|
|
|
100
|
+ modalVisible: false,
|
|
97
|
101
|
}
|
|
98
|
102
|
},
|
|
99
|
103
|
onLoad(option) {
|
|
|
@@ -109,41 +113,73 @@ export default {
|
|
109
|
113
|
this.getOrderDetail();
|
|
110
|
114
|
//获取收单列表
|
|
111
|
115
|
this.getReceiptList();
|
|
|
116
|
+
|
|
|
117
|
+
|
|
112
|
118
|
},
|
|
113
|
119
|
methods: {
|
|
114
|
120
|
handleBrandClick() {
|
|
115
|
|
- this.openModal('brand', '请输入品牌', this.topInfo.brand, '请输入品牌')
|
|
|
121
|
+ //修改当前选中订单的品牌brand
|
|
|
122
|
+ //打开品牌选择器
|
|
|
123
|
+ this.editBrandSelector = true
|
|
|
124
|
+
|
|
|
125
|
+ //获取品牌列表
|
|
|
126
|
+ this.$getDicts('crm_form_brand').then(res => {
|
|
|
127
|
+ this.brandColumns = [res]
|
|
|
128
|
+ })
|
|
116
|
129
|
},
|
|
117
|
130
|
handleModelClick() {
|
|
118
|
|
- this.openModal('model', '请输入型号', this.topInfo.model, '请输入型号')
|
|
|
131
|
+ //修改当前选中订单的型号model
|
|
|
132
|
+ //打开型号修改弹窗
|
|
|
133
|
+ this.modalConfig = {
|
|
|
134
|
+ title: '修改型号',
|
|
|
135
|
+ value: this.currentReceipt.model,
|
|
|
136
|
+ placeholder: '请输入型号'
|
|
|
137
|
+ }
|
|
|
138
|
+ this.currentEditField = 'model'
|
|
|
139
|
+ this.modalVisible = true
|
|
|
140
|
+
|
|
119
|
141
|
},
|
|
120
|
142
|
handlePriceClick() {
|
|
121
|
|
- this.openModal('price', '请输入价格', this.topInfo.price, '请输入价格')
|
|
122
|
|
- },
|
|
123
|
|
- openModal(field, title, value, placeholder) {
|
|
124
|
|
- this.currentEditField = field
|
|
|
143
|
+ //修改当前选中订单的价格sellingPrice
|
|
|
144
|
+ //打开价格修改弹窗
|
|
125
|
145
|
this.modalConfig = {
|
|
126
|
|
- title,
|
|
127
|
|
- value,
|
|
128
|
|
- placeholder
|
|
|
146
|
+ title: '修改价格',
|
|
|
147
|
+ value: this.currentReceipt.sellingPrice?.toString(),
|
|
|
148
|
+ placeholder: '请输入价格'
|
|
129
|
149
|
}
|
|
|
150
|
+ this.currentEditField = 'price'
|
|
130
|
151
|
this.modalVisible = true
|
|
131
|
152
|
},
|
|
132
|
|
- handleModalInput(value) {
|
|
133
|
|
- this.modalConfig.value = value
|
|
|
153
|
+
|
|
|
154
|
+ async handleModalConfirm(value) {
|
|
|
155
|
+ console.log('修改的当前的', this.currentEditField, '是', value)
|
|
|
156
|
+ if (this.currentEditField === 'model') {
|
|
|
157
|
+ //修改当前选中receiptDetail的型号
|
|
|
158
|
+ const res = await uni.$u.api.updateReceiptForm({
|
|
|
159
|
+ model: value,
|
|
|
160
|
+ id: this.currentReceipt.id
|
|
|
161
|
+ });
|
|
|
162
|
+ if (res.code == 200) {
|
|
|
163
|
+ uni.$u.toast('修改成功')
|
|
|
164
|
+ }
|
|
|
165
|
+ } else if (this.currentEditField === 'price') {
|
|
|
166
|
+ //修改当前选中receiptDetail的价格
|
|
|
167
|
+ const res = await uni.$u.api.updateReceiptForm({
|
|
|
168
|
+ sellingPrice: value,
|
|
|
169
|
+ id: this.currentReceipt.id
|
|
|
170
|
+ });
|
|
|
171
|
+ if (res.code == 200) {
|
|
|
172
|
+ uni.$u.toast('修改成功')
|
|
|
173
|
+ }
|
|
|
174
|
+ }
|
|
|
175
|
+ this.getReceiptList();
|
|
|
176
|
+ this.modalVisible = false
|
|
134
|
177
|
},
|
|
135
|
178
|
handleModalCancel() {
|
|
136
|
179
|
this.modalVisible = false
|
|
137
|
|
- this.currentEditField = ''
|
|
138
|
180
|
},
|
|
139
|
|
- handleModalConfirm(newValue) {
|
|
140
|
|
- if (this.currentEditField) {
|
|
141
|
|
- this.topInfo[this.currentEditField] = newValue
|
|
142
|
|
- }
|
|
143
|
181
|
|
|
144
|
|
- this.modalVisible = false
|
|
145
|
|
- this.currentEditField = ''
|
|
146
|
|
- },
|
|
|
182
|
+
|
|
147
|
183
|
async handleAddClick() {
|
|
148
|
184
|
|
|
149
|
185
|
console.log('加一单')
|
|
|
@@ -157,6 +193,21 @@ export default {
|
|
157
|
193
|
this.brandColumns = [res]
|
|
158
|
194
|
})
|
|
159
|
195
|
},
|
|
|
196
|
+ async handleEditBrandConfirm(data) {
|
|
|
197
|
+ console.log('修改的当前的品牌是', data.value[0])
|
|
|
198
|
+ console.log('修改的当前的品牌的value是', data.value[0].dictValue)
|
|
|
199
|
+
|
|
|
200
|
+ //修改当前选中receiptDetail的品牌
|
|
|
201
|
+ const res = await uni.$u.api.updateReceiptForm({
|
|
|
202
|
+ brand: data.value[0].dictValue,
|
|
|
203
|
+ id: this.currentReceipt.id
|
|
|
204
|
+ });
|
|
|
205
|
+ if (res.code === 200) {
|
|
|
206
|
+ uni.$u.toast('修改成功')
|
|
|
207
|
+ }
|
|
|
208
|
+ this.getReceiptList();
|
|
|
209
|
+ this.editBrandSelector = false
|
|
|
210
|
+ },
|
|
160
|
211
|
handleBrandConfirm(data) {
|
|
161
|
212
|
console.log('选择的品牌', data.value[0])
|
|
162
|
213
|
this.currentAddBrand = data.value[0]
|