Browse Source

Merge branch 'sit' into dev

xiaodai2022 2 years ago
parent
commit
4b05582e59

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


+ 6 - 5
src/views/sellOut/project/components/addForm.vue

@@ -381,8 +381,9 @@ export default {
       if (index + "" === "-1") {
         this.ruleForm.ladder.push(item);
       } else {
+        console.log(item);
         this.ruleForm.ladder.forEach((i, findex) => {
-          if (i.id === id && findex === parseInt(i.index)) {
+          if (findex === parseInt(index)) {
             this.ruleForm.ladder[findex].id = id;
             this.ruleForm.ladder[findex].budget_price = budget_price;
             this.ruleForm.ladder[findex].num = num;
@@ -420,9 +421,9 @@ export default {
     },
     //平台选择
     platform_codesearchChange(e) {
-        const { id, code, label } = e;
-        this.ruleForm.platform = id||"";
-        this.$refs.ruleForm.validateField("platform");
+      const { id, code, label } = e;
+      this.ruleForm.platform = id || "";
+      this.$refs.ruleForm.validateField("platform");
     },
     //销售方公司选择
     company_idsearchChange(e) {
@@ -506,7 +507,7 @@ export default {
           this.platform_name = platform_name || "";
           this.ruleForm = {
             name: project_name || "",
-            platform: platform_id ||"",
+            platform: platform_id || "",
             companyNo: companyNo || "",
             khNo: khNo ? [khNo] : [],
             customer_name: khName || "",

+ 11 - 4
src/views/sellOut/zixunOrder/columns.js

@@ -133,7 +133,7 @@ const rules = {
   ],
   total_weight: [
     {
-      required: true,
+      required: false,
       validator: validate_total_weight,
       trigger: "blur",
     },
@@ -183,7 +183,7 @@ const rules = {
   ],
   cost_desc: [
     {
-      required: true,
+      required: false,
       message: "工艺说明不能为空",
       trigger: "blur",
     },
@@ -216,6 +216,13 @@ const rules = {
       trigger: "blur",
     },
   ],
+  enclosure_file: [
+    {
+      required: false,
+      message: "请上传附件",
+      trigger: "change",
+    },
+  ],
 };
 const edutRules = {
   companyNo: [
@@ -393,7 +400,7 @@ const edutRules = {
   ],
   cost_desc: [
     {
-      required: true,
+      required: false,
       message: "工艺说明不能为空",
       trigger: "blur",
     },
@@ -488,7 +495,7 @@ const feedbackListCol = [
     label: "负责人",
     "width": "60"
   },
-  
+
   {
     prop: "addtime",
     label: "添加时间",

+ 86 - 0
src/views/sellOut/zixunOrder/components/addEditGoodModal.vue

@@ -334,6 +334,45 @@
                       </div>
                     </el-form-item>
                   </el-col>
+                  <el-col :span="8" class="clear">
+                    <el-form-item
+                      label="附件"
+                      prop="enclosure_file"
+                      class="activity-upload"
+                    >
+                      <div v-if="ruleForm&&ruleForm.enclosure_file" class="clearfix">
+                        <a :href="ruleForm.enclosure_file" download="附件">点击下载</a>
+
+                        <el-link
+                          :underline="false"
+                          @click="deleteUrl()"
+                          type="warning"
+                          style="margin: 0 0 0 16px"
+                          >删除</el-link
+                        >
+                      </div>
+
+                      <div class="activity-upload" v-else>
+                        <div class="btnupload" style="position: relative">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                          <file-upload-pdf
+                            class="Upload"
+                            :accept="'.zip,.rar,.7z'"
+                            :multiple="false"
+                            :uploadcondition="beforeOtherUpload"
+                            @UploadErrorEvent="UploadErrorOtherenclosure_file"
+                            @UploadSuccessEvent="
+                              UploadSuccessOtherenclosure_file
+                            "
+                          />
+                        </div>
+                        <div class="txt-tips fl">
+                          <p>建议大小:小于5MB</p>
+                          <p>文件格式:.zip,.rar,.7z</p>
+                        </div>
+                      </div>
+                    </el-form-item>
+                  </el-col>
                   <el-col :span="8" v-if="is_noble">
                     <el-form-item label="金属种类" prop="metal_id">
                       <search-metal-kind
@@ -465,6 +504,7 @@ export default {
         remark: "",
         metal_id: "",
         gold_price: "0",
+        enclosure_file: "",
       },
       rulesThis: this.rules,
       rules: rules,
@@ -572,6 +612,7 @@ export default {
             specinfo,
             cat_id_name,
             cat_arr_id,
+            enclosure_file,
           } = this.sitem;
           console.log(this.sitem);
           // console.log(p_cat_info);
@@ -625,6 +666,7 @@ export default {
             gold_price: gold_price || "0",
             unit: unit ? unit : [],
             unit_name: unit_name ? unit_name : "",
+            enclosure_file: enclosure_file || "",
           };
           this.is_noble = false;
           if (cat_arr_id && cat_arr_id.length > 0) {
@@ -767,6 +809,50 @@ export default {
         this.$refs.ruleForm.validateField("good_img");
       }
     },
+    //其他文件上传失败
+    UploadErrorOtherenclosure_file(res) {
+      if (res !== "break") {
+        this.$refs.ruleForm.validateField("enclosure_file");
+      }
+    },
+
+    //判断其他文件规格
+    beforeOtherUpload(file) {
+      let isJPG = false;
+      if (file.type === "application/x-zip-compressed") {
+        isJPG = true;
+      }
+      let name = file.name;
+      let list = name.split(".");
+      if (list[list.length - 1] === "rar" || list[list.length - 1] === "7z") {
+        isJPG = true;
+      }
+
+      const isLt2M = file.size / 1024 / 1024 < 5;
+      if (!isJPG) {
+        this.$message.error("文件格式不正确!");
+      }
+      if (!isLt2M) {
+        this.$message.error("文件大小不能超过 5MB!");
+      }
+      return isJPG && isLt2M;
+    },
+
+    deleteUrl() {
+      this.ruleForm.enclosure_file = "";
+      this.$refs.ruleForm.validateField("enclosure_file");
+    },
+    // 其他文件上传成功
+    async UploadSuccessOtherenclosure_file(data) {
+      const { url } = data;
+    console.log(url);
+      if (url === "noToken") {
+        await this.logout();
+      } else {
+        this.ruleForm.enclosure_file = url;
+        this.$message.success("附件上传成功!");
+      }
+    },
   },
 };
 </script>

Some files were not shown because too many files changed in this diff