Procházet zdrojové kódy

✨ feat(【SPD售后问题收集】):

1.文件上传类型与数量限制;2.部分情况下复制电话失效;3.进度查询列表,页面上滑之后部分被遮挡;4.进度详情,工单处理流程,将内容、处理人与处理人联系方式分开展示,并支持联系方式复制与拨号;5.注释index.html中的vconsole

20240425292
002390 před 11 měsíci
rodič
revize
e612fcbe12

+ 2 - 2
public/index.html

@@ -216,8 +216,8 @@
 
 </html>
 
-<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
+<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
 <script>
   // VConsole 默认会挂载到 `window.VConsole` 上
   var vConsole = new window.VConsole();
-</script>
+</script> -->

+ 0 - 1
src/views/business/as/after-sales/components/image-preview/index.vue

@@ -14,7 +14,6 @@ export default {
   computed: {
     fileList: {
       get() {
-        console.log(this.$props.value, "this.$props.value--");
         return this.$props.value.map((item) => {
           return {
             ...item,

+ 41 - 2
src/views/business/as/after-sales/components/image-upload/index.vue

@@ -8,13 +8,31 @@ export default {
       type: [Number, String],
       default: 9,
     },
+    fileType: {
+      type: Array,
+      default: () => ["jpg", "jpeg", "png"],
+    },
+    // fileSize: {
+    //   type: Number,
+    // },
   },
   data() {
     return {
       fileList: [],
     };
   },
-  computed: {},
+  computed: {
+    accept: {
+      get() {
+        const { fileType } = this.$props;
+        const typeList = fileType.reduce((str, item) => {
+          return (str += "." + item + ",");
+        }, "");
+        return typeList;
+      },
+      set() {},
+    },
+  },
   methods: {
     afterRead(file) {
       let {
@@ -30,6 +48,25 @@ export default {
     useDelete(file) {
       this.$emit("input", this.fileList);
     },
+    beforeRead(file, detail) {
+      const fileTypeList = file.type.split("/");
+      const fileExt = fileTypeList[fileTypeList.length - 1];
+      const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
+      console.log(isTypeOk, "isTypeOk");
+      if (!isTypeOk) {
+        this.$toast(
+          `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+        );
+        return false;
+      }
+      return true;
+      // const { fileSize, accept } = this.$props;
+      // const imgformat = /image\/(png|jpg|jpeg)$/;
+      // if (!imgformat.test(file.type)) {
+      //   this.$toast.fail(`请上传 ${accept} 格式图片`);
+      //   return false;
+      // }
+    },
   },
   created() {},
 };
@@ -41,8 +78,10 @@ export default {
       v-model="fileList"
       multiple
       preview-size="60px"
-      :after-read="afterRead"
+      :accept="accept"
       :max-count="maxCount"
+      :after-read="afterRead"
+      :before-read="beforeRead"
       @delete="useDelete"
     />
   </div>

+ 14 - 2
src/views/business/as/after-sales/contact-us/index.vue

@@ -22,8 +22,20 @@ export default {
         return;
       }
       if (key === "copy") {
-        await navigator.clipboard.writeText(this.phone);
-        return this.$toast("已复制到剪贴板");
+        let clipboard = navigator.clipboard || {
+          writeText: (text) => {
+            let copyInput = document.createElement("input");
+            copyInput.value = text;
+            document.body.appendChild(copyInput);
+            copyInput.select();
+            document.execCommand("copy");
+            document.body.removeChild(copyInput);
+          },
+        };
+        if (clipboard) {
+          await clipboard.writeText(this.phone);
+          return this.$toast("已复制到剪贴板");
+        }
       }
     },
     onCancel() {},

+ 5 - 1
src/views/business/as/after-sales/feedback/index.vue

@@ -65,6 +65,7 @@ export default {
     async fetchUser() {
       try {
         // const { id } = this.$store.state.salesUser;
+        this.loading = true;
         const id = Cookies.get("salesId");
         let { code, data } = await GetUser({ id });
         if (code === 200) {
@@ -77,7 +78,10 @@ export default {
             questionerWay: data.userPhone,
           };
         }
-      } catch (error) {}
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
     },
   },
   created() {

+ 59 - 10
src/views/business/as/after-sales/progress/details.vue

@@ -9,7 +9,6 @@ export default {
       type: [String, Number],
       require: true,
     },
-   
   },
   components: {
     ElFormatValue: () => import("../components/format-value/index.vue"),
@@ -30,6 +29,12 @@ export default {
         problemPicture: [],
       },
       imgUrl: require("../images/order.png"),
+      phone: "",
+      show: false,
+      actions: [
+        { name: "拨号", key: "call" },
+        { name: "复制", key: "copy" },
+      ],
     };
   },
   computed: {
@@ -68,6 +73,37 @@ export default {
         this.loading = false;
       }
     },
+    useCall(prop) {
+      // this.phone = prop.phone;
+      this.phone = prop.processorWay;
+      this.show = true;
+    },
+    async onSelect({ key, name }) {
+      this.show = false;
+      if (key === "call") {
+        window.location.href = `tel:${this.phone}`;
+        return;
+      }
+      if (key === "copy") {
+        let clipboard = navigator.clipboard || {
+          writeText: (text) => {
+            let copyInput = document.createElement("input");
+            copyInput.value = text;
+            document.body.appendChild(copyInput);
+            copyInput.select();
+            document.execCommand("copy");
+            document.body.removeChild(copyInput);
+          },
+        };
+        if (clipboard) {
+          await clipboard.writeText(this.phone);
+          return this.$toast("已复制到剪贴板");
+        }
+        // await navigator.clipboard.writeText(this.phone);
+        //
+      }
+    },
+    onCancel() {},
   },
   created() {},
 };
@@ -123,12 +159,6 @@ export default {
           v-for="({ item, attr }, index) in formColumns"
           :label="item.title"
         >
-          <!-- <el-image
-            v-if="attr.is === 'el-image-preview'"
-            style="width: 50px; height: 50px; margin-right: 10px"
-            src="https://dev-sy.derom.com/document-center/minio/1f196e04-7524-4bbf-991d-c5072599a6fd_2a991c4c9dc966b7bb5d3d0686fa3c14.jpg"
-            fit="contain"
-          ></el-image> -->
           <el-format-value
             v-if="attr.is === 'el-select'"
             v-model="params[item.key]"
@@ -157,11 +187,30 @@ export default {
             color="#0095ff"
             size="large"
           >
-            {{ flow.content }}
+            <div>
+              <span>{{ flow.content }}</span>
+              <div>
+                <span>处理人:{{ flow.processorName }}</span>
+                <el-button
+                  type="text"
+                  @click="useCall(flow)"
+                  style="padding: 6px 12px 0px"
+                  >{{ flow.processorWay }}</el-button
+                >
+              </div>
+            </div>
           </el-timeline-item>
           <el-timeline-item color="#ff8500" size="large"></el-timeline-item>
         </el-timeline>
       </el-card>
+      <van-action-sheet
+        v-model="show"
+        :actions="actions"
+        cancel-text="取消"
+        close-on-click-action
+        @cancel="onCancel"
+        @select="onSelect"
+      />
     </el-form>
   </el-drawer>
 </template>
@@ -184,14 +233,14 @@ export default {
 }
 ::v-deep .el-descriptions__header {
   margin: 0 0 12px;
-  color: #606266;
+  color: #303133;
 }
 ::v-deep .el-descriptions__title {
   width: 100%;
 }
 .mes_title {
   width: 100%;
-  font-size: 13px;
+  font-size: 14px;
   display: flex;
   align-items: center;
   justify-content: space-between;

+ 4 - 2
src/views/business/as/after-sales/progress/index.vue

@@ -111,12 +111,14 @@ export default {
 .el-card {
   width: 100%;
   height: 100vh;
-  overflow-y: auto;
-  overflow-x: hidden;
+  overflow: hidden;
   background-color: #f7f7f7;
 }
 .el-row {
   width: 100%;
+  height: calc(100vh - 46px);
+  overflow-x: hidden;
+  overflow-y: auto;
   padding: 16px;
   box-sizing: border-box;
   border-radius: 4px;