ソースを参照

新增顶部修改

Yannay 2 ヶ月 前
コミット
1ac92a8473

+ 3 - 4
pages/orderDetailNew/components/orderDetailNewView.vue

@@ -20,8 +20,7 @@
20 20
         </view>
21 21
 
22 22
         <ul class="page">
23
-            <li v-for="(tab, index) in tabs" :key="index" :class="{ 'active': activeIndex === index }"
24
-                @click="activeIndex = index">{{ tab }}</li>
23
+            <li v-for="(tab, index) in tabs" :key="index" :class="{ 'active': activeIndex === index }">{{ tab }}</li>
25 24
         </ul>
26 25
     </view>
27 26
 </template>
@@ -152,7 +151,7 @@ export default {
152 151
                 // "freight": 30,         //运费page4加上
153 152
                 // "checkCodeFee": null,  //查码费
154 153
                 // "totalCost": "60230.00",   // 成本合计 =   运费 + 好处费 + 查码费 + 表款(支付总额) + 维修费。
155
-                "sellingPrice": this.topInfo.price.replace(/,/g, ''),   //实际价格(售价)顶上tab里面的第三栏
154
+                "sellingPrice": this.topInfo.price,   //实际价格(售价)顶上tab里面的第三栏
156 155
                 // "performance": "29772.00",  //sellingPrice - totalCost
157 156
                 // "receiptRemark":     //"收单之后还需再跟进", 先不传
158 157
                 // "repairAmount": null, //维修总金额 ,先不传
@@ -223,7 +222,7 @@ export default {
223 222
                 "freight": warehouseInfo.freight || '',         //运费page4加上
224 223
                 "checkCodeFee": warehouseInfo.checkCodeFee || '',  //查码费
225 224
                 // "totalCost": "60230.00",   // 成本合计 =   运费 + 好处费 + 查码费 + 表款(支付总额) + 维修费。
226
-                "sellingPrice": this.topInfo.price.replace(/,/g, ''),   //实际价格(售价)顶上tab里面的第三栏
225
+                "sellingPrice": this.topInfo.price,   //实际价格(售价)顶上tab里面的第三栏
227 226
                 // "performance": "29772.00",  //sellingPrice - totalCost
228 227
                 "receiptRemark": warehouseInfo.remarks + ';' + warehouseInfo.uploadedImage || '',//"收单之后还需再跟进", 先不传
229 228
                 "repairAmount": warehouseInfo.repairAmount || '', //维修总金额 ,先不传

+ 19 - 9
pages/orderDetailNew/components/pageOne.vue

@@ -152,16 +152,26 @@ export default {
152 152
             console.log('电话卡片被点击', '电话号码:', this.orderDetail.phone)
153 153
             if (this.orderDetail.phone) {
154 154
                 //拨打电话
155
-                uni.makePhoneCall({
156
-                    phoneNumber: this.orderDetail.phone,
155
+                // uni.makePhoneCall({
156
+                //     phoneNumber: this.orderDetail.phone,
157
+                //     success: () => {
158
+                //         this.$store.commit("call/SET_FORM", {
159
+                //             clueId: this.orderDetail.clueId,
160
+                //             type: "3",
161
+                //             callee: this.orderDetail.phone,
162
+                //         });
163
+                //     },
164
+                // });
165
+                //先暂时复制电话号码
166
+                uni.setClipboardData({
167
+                    data: this.orderDetail.phone,
157 168
                     success: () => {
158
-                        this.$store.commit("call/SET_FORM", {
159
-                            clueId: this.orderDetail.clueId,
160
-                            type: "3",
161
-                            callee: this.orderDetail.phone,
162
-                        });
163
-                    },
164
-                });
169
+                        uni.showToast({
170
+                            title: '电话号码已复制',
171
+                            icon: 'none'
172
+                        })
173
+                    }
174
+                })
165 175
             } else {
166 176
                 uni.showToast({
167 177
                     title: '该订单暂时没有电话号码',

+ 86 - 35
pages/orderDetailNew/index.vue

@@ -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]

+ 1 - 1
pages/orderDetailNew/mixin/imgUploadAndDownLoad.js

@@ -56,7 +56,7 @@ export default {
56 56
                     this.detailImages = response.rows.filter(item => item.sourceId == receiptID) || []
57 57
                 }
58 58
             } catch (error) {
59
-                uni.$u.toast(`获取列表失败:${error.message}`)
59
+                uni.$u.toast(`获取列表失败:${error}`)
60 60
                 this.trueUploadList = []
61 61
                 this.chatRecordsUploadList = []
62 62
             }