|
|
@@ -29,6 +29,22 @@
|
|
29
|
29
|
<!-- 通用模态窗 -->
|
|
30
|
30
|
<custom-modal :visible="modalVisible" :title="modalConfig.title" :value="modalConfig.value"
|
|
31
|
31
|
:placeholder="modalConfig.placeholder" @cancel="handleModalCancel" @confirm="handleModalConfirm" />
|
|
|
32
|
+
|
|
|
33
|
+ <!-- 加一单选择模态窗 -->
|
|
|
34
|
+ <u-modal :show="addOneModelShow" :title="'新增收件信息'" showCancelButton @cancel="addOneModelShow = false"
|
|
|
35
|
+ @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>
|
|
|
44
|
+ </u-modal>
|
|
|
45
|
+ <!-- 品牌选择器 -->
|
|
|
46
|
+ <u-picker :show="showBrandSelector" @confirm="handleBrandConfirm" :columns="brandColumns"
|
|
|
47
|
+ @cancel='showBrandSelector = false' keyName="dictLabel"></u-picker>
|
|
32
|
48
|
</view>
|
|
33
|
49
|
</template>
|
|
34
|
50
|
|
|
|
@@ -65,7 +81,19 @@ export default {
|
|
65
|
81
|
//接单单个订单的receiptList
|
|
66
|
82
|
receiptList: [],
|
|
67
|
83
|
//当前选中的收单订单
|
|
68
|
|
- currentReceipt: {}
|
|
|
84
|
+ currentReceipt: {},
|
|
|
85
|
+ // 新加一件的信息
|
|
|
86
|
+ addOneModelShow: false,
|
|
|
87
|
+ showBrandSelector: false,
|
|
|
88
|
+ checkModel: {
|
|
|
89
|
+ brand: '',
|
|
|
90
|
+ },
|
|
|
91
|
+ brandColumns: [
|
|
|
92
|
+ ['中国', '美国', '日本']
|
|
|
93
|
+ ],
|
|
|
94
|
+ //当前选择的品牌
|
|
|
95
|
+ currentAddBrand: {}
|
|
|
96
|
+
|
|
69
|
97
|
}
|
|
70
|
98
|
},
|
|
71
|
99
|
onLoad(option) {
|
|
|
@@ -116,21 +144,25 @@ export default {
|
|
116
|
144
|
this.modalVisible = false
|
|
117
|
145
|
this.currentEditField = ''
|
|
118
|
146
|
},
|
|
119
|
|
- handleAddClick() {
|
|
|
147
|
+ async handleAddClick() {
|
|
120
|
148
|
|
|
121
|
149
|
console.log('加一单')
|
|
122
|
150
|
//判断如果当前有收单的id是‘’的话,说明是新增的收单订单
|
|
123
|
|
- if (this.receiptList.some(item => item.id === '')) {
|
|
124
|
|
- uni.$u.toast('请先保存新增的收单订单')
|
|
125
|
|
- return
|
|
126
|
|
- }
|
|
127
|
|
-
|
|
128
|
|
- this.receiptList.push({
|
|
129
|
|
- "id": "",//订单id
|
|
130
|
|
- "sendFormId": this.orderId,
|
|
131
|
|
- "clueId": this.clueId,
|
|
132
|
|
- "brand": "新加一单",
|
|
133
|
|
- });
|
|
|
151
|
+ //打开模态窗
|
|
|
152
|
+ //选择品牌,型号。价格
|
|
|
153
|
+ this.addOneModelShow = true
|
|
|
154
|
+
|
|
|
155
|
+ this.$getDicts('crm_form_brand').then(res => {
|
|
|
156
|
+ console.log('品牌', res)
|
|
|
157
|
+ this.brandColumns = [res]
|
|
|
158
|
+ })
|
|
|
159
|
+ },
|
|
|
160
|
+ handleBrandConfirm(data) {
|
|
|
161
|
+ console.log('选择的品牌', data.value[0])
|
|
|
162
|
+ this.currentAddBrand = data.value[0]
|
|
|
163
|
+ this.checkModel.brand = this.currentAddBrand.dictLabel
|
|
|
164
|
+ //关闭品牌选择器
|
|
|
165
|
+ this.showBrandSelector = false
|
|
134
|
166
|
},
|
|
135
|
167
|
|
|
136
|
168
|
//查询订单详情
|
|
|
@@ -155,6 +187,17 @@ export default {
|
|
155
|
187
|
clickReceipt(item) {
|
|
156
|
188
|
// console.log('点击了', item);
|
|
157
|
189
|
this.currentReceipt = item;
|
|
|
190
|
+ },
|
|
|
191
|
+ async handleAddOneConfirm() {
|
|
|
192
|
+ console.log('确认添加', this.currentAddBrand)
|
|
|
193
|
+
|
|
|
194
|
+ //调新加一单的接口
|
|
|
195
|
+ await uni.$u.api.addReceiptForm({
|
|
|
196
|
+ brand: this.currentAddBrand.dictValue,
|
|
|
197
|
+ sendFormId: this.orderId,
|
|
|
198
|
+
|
|
|
199
|
+ })
|
|
|
200
|
+
|
|
158
|
201
|
}
|
|
159
|
202
|
}
|
|
160
|
203
|
}
|