Przeglądaj źródła

feat(工单): 添加工单变更记录组件并更新跟进表单

在工单历史页面添加变更记录组件展示工单变更历史
跟进表单提交时增加updateType参数标识变更类型
调整部分样式代码格式
ylong 3 tygodni temu
rodzic
commit
da75f3d70d

+ 6 - 0
pages/index/work-order/history.vue

@@ -63,6 +63,9 @@
             </view>
         </view>
 
+        <!-- 工单变更记录 -->
+        <TrackRecord :records="records" />
+
         <!-- 底部操作按钮 -->
         <view class="fixed-bottom" v-if="showButtons">
             <template v-if="isCreator">
@@ -95,6 +98,7 @@
 <script setup>
 import { ref, computed, onMounted } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
+import TrackRecord from '@/pages/order/components/track-record.vue'
 
 const workOrderId = ref('')
 const orderType = ref('') // 1-卖书 2-回收
@@ -102,6 +106,7 @@ const waybillCode = ref('')
 const orderId = ref('')
 const workOrderDetail = ref(null)
 const currentUserId = ref(null)
+const records = ref([])
 
 // 判断是否为创建人
 const isCreator = computed(() => {
@@ -145,6 +150,7 @@ const getWorkOrderDetail = async () => {
         
         if (res.code === 200 && res.data) {
             workOrderDetail.value = res.data
+            records.value = res.data.changeRecords || []
         } else {
             uni.$u.toast(res.msg || '获取工单详情失败')
         }

+ 9 - 2
pages/order/components/track-form.vue

@@ -13,7 +13,8 @@
             <cy-upload :filename="files" @update:filename="files = $event" @update:loading="uploading = $event" />
         </view>
         <view class="actions">
-            <u-button type="primary" :loading="uploading" :disabled="uploading || submitting" @click="submit">跟进</u-button>
+            <u-button type="primary" :loading="uploading" :disabled="uploading || submitting"
+                @click="submit">跟进</u-button>
         </view>
     </view>
 </template>
@@ -32,7 +33,7 @@ const submitting = ref(false)
 const submit = () => {
     if (uploading.value || submitting.value) return
     submitting.value = true
-    emit('submit', { content: content.value, files: files.value })
+    emit('submit', { content: content.value, files: files.value, updateType: 1 })
     content.value = ''
     files.value = []
     submitting.value = false
@@ -45,31 +46,37 @@ const submit = () => {
     border-radius: 12rpx;
     padding: 24rpx;
 }
+
 .header {
     display: flex;
     align-items: center;
     gap: 12rpx;
     margin-bottom: 12rpx;
 }
+
 .line {
     width: 8rpx;
     height: 32rpx;
     background: #22ac38;
     border-radius: 4rpx;
 }
+
 .title {
     font-size: 30rpx;
     color: #333333;
 }
+
 .field {
     margin-top: 16rpx;
 }
+
 .label {
     display: block;
     font-size: 28rpx;
     color: #666666;
     margin-bottom: 8rpx;
 }
+
 .actions {
     display: flex;
     justify-content: flex-end;