Преглед на файлове

1.新增业务层次字段(学时审核标签)

xiexaing преди 1 година
родител
ревизия
fc4e8b1507

+ 28 - 19
src/views/Marketing/order/offlineOrder/goodsMatch/goodsMatchToBusin.vue

@@ -71,7 +71,7 @@
               </span>
               <div v-else-if="item.scope === 'img'">
                 <img
-                  style="width: 50%; height: 50%"
+                  style="width: 100px; height: 80px"
                   v-if="!item.data"
                   src="@/assets/404_images/wuyuxaog.png"
                   alt=""
@@ -161,7 +161,7 @@
           <el-form-item label="上传主图" props="img">
             <div
               style="
-              width: 35%;
+              width: 120px;
               height: 120px;
               border: 2px dashed #999;
               border-radius: 28px;
@@ -178,12 +178,12 @@
                 type="file"
                 ref="fileMianImg"
                 style="display: none"
-                @change="uploadImg(listData.mainImg)"
+                @change="uploadImg"
               />
             </div>
             <el-image
               v-else
-              style="width: 100%"
+              style="width: 120px;height: 120px;"
               :src="$methodsTools.splitImgHost(listData.mainImg)"
               :preview-src-list="[
                 $methodsTools.splitImgHost(listData.mainImg),
@@ -191,11 +191,13 @@
             >
             </el-image>
             <el-button
-              style="margin-top: 10px;"
-              :type="!listData.mainImg ? 'success' : 'danger'"
-              size="mini" onclick="document.querySelector('#mainImg').click()"
+              v-if="listData.mainImg"
+              style="margin-top: 10px;display: block;"
+              type="danger"
+              size="mini"
+              @click="clearImgs()"
             >
-              {{ !listData.mainImg ? "上传" : "删除" }}
+              删除
             </el-button>
           </el-form-item>
           <el-form-item label="状态" prop="status">
@@ -386,20 +388,21 @@ export default {
     loadingClose() {
       this.disabledBtn = false;
     },
-    // 上传主图
-    uploadImg(row) {
+    // 上传主图操作
+    uploadImg(e) {
+      console.log(e)
       var self = this;
-      var file = self.$refs.fileMianImg.files[0];
+      var file = e.target.files[0]
       if (file === undefined) {
         self.$set(self.listData, "mainImg", "");
-        row.data = ""
+        e.target.value = "";
         return;
       }
       if (file.size > 2 * 1024 * 1024) {
         self.$message.error("图片不得大于2MB");
         return;
       }
-      var type = self.$refs.fileMianImg.value.toLowerCase().split(".").splice(-1);
+      var type = e.target.value.toLowerCase().split(".").splice(-1);
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -407,13 +410,19 @@ export default {
         type[0] != "gif"
       ) {
         self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
-        self.$refs.fileMianImg.value = "";
+        e.target.value = "";
         return;
       }
-      // this.$upload.upload(file, 0).then((res) => {
-      //   self.listData.mainImg = res;
-      //   console.log(self.listData.mainImg)
-      // });
+      this.$upload.upload(file, 0).then((res) => {
+        this.$set(this.listData, 'mainImg', res)
+        console.log(self.listData.mainImg)
+      }).finally(()=>{
+        e.target.value = "";
+      })
+    },
+    // 清除上传图片
+    clearImgs() {
+      this.$set(this.listData,'mainImg', "")
     },
     /**
      * 表单验证
@@ -662,4 +671,4 @@ export default {
     margin: 5px 0px;
   }
 }
-</style>
+</style>

+ 36 - 1
src/views/resource/baseManageInfos/resource/businessLevel/index.vue

@@ -366,12 +366,28 @@ export default {
             },
           ],
         },
+        {
+          label: "学时审核标签",
+          prop: "periodCheckSign",
+          hidden: true,
+          scope: "isOptions",
+          options: [
+            {
+              label: "开启",
+              value: 1,
+            },
+            {
+              label: "关闭",
+              value: 2,
+            }
+          ],
+        },
         {
           label: "状态",
           prop: "status",
           hidden: true,
           scope: "status",
-        },
+        }
       ],
       tableData: [], //表单数据
       total: 0, //一共多少条
@@ -429,6 +445,21 @@ export default {
             },
           ],
         },
+        {
+          label: "学时审核标签",
+          prop: "periodCheckSign",
+          scope: "status",
+          options: [
+            {
+              label: "开启",
+              value: 1,
+            },
+            {
+              label: "关闭",
+              value: 2,
+            },
+          ],
+        },
         {
           label: "状态",
           prop: "status",
@@ -492,6 +523,9 @@ export default {
         periodNumber: [
           { required: true, message: "请选择学时审核层级", trigger: "change" },
         ],
+        periodCheckSign: [
+          { required: true, message: "学时审核标签", trigger: "change" },
+        ],
         status: [{ required: true, message: "请选择状态", trigger: "change" }],
       },
       dialogVisibleSet: false,
@@ -789,6 +823,7 @@ export default {
           status: 1,
           periodType: 1,
           periodNumber: 2,
+          periodCheckSign: 1,
         };
       } else {
         this.statusPop = int;