Browse Source

Merge remote-tracking branch 'origin/master'

yusm 1 week ago
parent
commit
999f10b760

+ 55 - 12
fhKeeper/formulahousekeeper/course-pc/src/views/hotTopicCarousel/hotTopicCarousel.vue

@@ -11,7 +11,7 @@
           </el-upload>
         </div>
         <!-- 视频或图片 -->
-        <div class="image-list">
+        <draggable v-model="fileList" class="image-list" @end="onDragEnd">
           <div v-for="(file, index) in fileList" :key="index"
             :class="`${!file.loading ? 'image-item-hover' : ''} image-item`">
             <img :src="require('../../assets/image/yunketang.png')" class="cert-image" @click="previewImage(index)">
@@ -22,13 +22,14 @@
             <div class="image-actions-loging" v-if="file.loading">
               文件上传中...
             </div>
+            <div class="image-name">{{ file.name }}</div>
           </div>
-        </div>
+        </draggable>
       </div>
     </div>
 
     <!-- 预览视频 -->
-    <el-dialog title="预览视频" append-to-body :visible.sync="previewingVideoVisable" width="900px" top="6.5vh" :before-close="handleClose">
+    <el-dialog :title="previewVideoName" append-to-body :visible.sync="previewingVideoVisable" width="900px" top="6.5vh" :before-close="handleClose">
       <div class="previewingVideo">
         <video :src="previewVideoSrc" :poster="require('../../assets/image/yunketang.png')" controls></video>
       </div>
@@ -38,6 +39,7 @@
 
 <script>
 import { post, checkAndAddUpload } from '../../api'
+import draggable from 'vuedraggable'
 export default {
   name: 'GcpCertification',
   data() {
@@ -46,13 +48,15 @@ export default {
       imageList: [],
       imageListTime: null,
       previewingVideoVisable: false,
-      previewVideoSrc: ''
+      previewVideoSrc: '',
+      previewVideoName: ''
     }
   },
   methods: {
     previewingVideo(index) {
       const row = this.fileList[index]
       this.previewVideoSrc = row.url
+      this.previewVideoName = row.name
       this.previewingVideoVisable = true
     },
     uploadGCPImg(file) {
@@ -69,14 +73,16 @@ export default {
         const formData = new FormData()
         formData.append('coverImage', this.imageList[i])
         this.fileList.unshift({
-          name: 'a',
+          name: (this.imageList[i].name || '').split('.')[0],
           loading: true,
           url: '',
-          imgError: ''
+          imgError: '',
+          id: '',
         })
         this.http.uploadFile(`/course-carousel/uploadAndSave`, formData, res => {
           this.fileList[i].url = checkAndAddUpload(res.data.courseUrl)
-          this.fileList[i].name = res.data.id
+          this.fileList[i].name = (res.data.fileName || '').split('.')[0]
+          this.fileList[i].id = res.data.id
           this.fileList[i].loading = false
         }, err => {
           this.fileList.splice(i, 1)
@@ -111,13 +117,41 @@ export default {
       post(`/course-carousel/list`, {}).then(res => {
         this.fileList = res.data.map(item => {
           return {
-            name: item.id,
+            name: (item.fileName || '').split('.')[0],
+            url: checkAndAddUpload(item.courseUrl),
+            loading: false,
+            imgError: '',
+            id: item.id
+          }
+        }).reverse()
+      })
+    },
+    onDragEnd() {
+      console.log(this.fileList, '<==== fileList')
+      const list = this.fileList.map((item, index) => {
+        return {
+          id: item.id,
+          seq: index
+        }
+      })
+      post(`/course-carousel/sortSeq`, { jsonStr: JSON.stringify(list) }).then(res => {
+        this.fileList = res.data.map(item => {
+          return {
+            name: (item.fileName || '').split('.')[0],
             url: checkAndAddUpload(item.courseUrl),
             loading: false,
-            imgError: ''
+            imgError: '',
+            id: item.id
           }
         }).reverse()
       })
+    },
+    previewImage(index) {
+      // Placeholder for image preview functionality
+    },
+    handleClose(done) {
+      this.previewingVideoVisable = false
+      done()
     }
   },
   mounted() {
@@ -167,12 +201,16 @@ export default {
 
 .image-item {
   position: relative;
-  width: 148px;
+  width: 240px;
   height: 148px;
   border-radius: 4px;
   overflow: hidden;
   box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
   transition: all 0.3s;
+  display: flex;
+  justify-content: center;
+  flex-direction: column;
+  align-items: center;
 }
 
 .image-item:hover {
@@ -185,12 +223,17 @@ export default {
 }
 
 .cert-image {
-  width: 100%;
-  height: 100%;
+  width: 80%;
+  height: 80%;
   object-fit: cover;
   cursor: pointer;
 }
 
+.image-name {
+  font-size: 12px;
+  margin-top: 4px;
+}
+
 .image-actions {
   position: absolute;
   top: 0;

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue

@@ -10,6 +10,7 @@
           <div class="planComponent_ItemTop">
             <div>{{ item.productName}}</div>
             <div>{{ item.productSchedulingNum }}</div>
+            <div>{{ item.productOrderNum || '' }}</div>
             <div>
               <p>{{ item.startDate.replace(/-/g, '') }}-{{ !item.endDate?"":item.endDate.replace(/-/g, '') }}</p><span @click="workShowHide(index)">{{ item.flg ? paiArr[0] : paiArr[1] }}</span>
             </div>

+ 74 - 41
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/todayPlan.vue

@@ -2,17 +2,27 @@
   <div class="flexCoum">
     <van-nav-bar title="今日计划" left-text="返回" @click-left="back" fixed left-arrow />
     <div class="seachPlan">
-      <van-search
+      <!-- <van-search
         v-model="searchValue"
         placeholder="请输入搜索关键词"
         clearable
         @input="debouncedPlanSeach"
         @search="debouncedPlanSeach"
         @clear="debouncedPlanSeach"
-      />
+      /> -->
+      <van-search v-model="searchValue" placeholder="请输入" @input="debouncedPlanSeach" @search="debouncedPlanSeach" @clear="debouncedPlanSeach">
+        <template #left>
+          <div class="searchDropdownMenu">
+            <van-dropdown-menu>
+              <van-dropdown-item v-model="searchTypeValue" :options="searchTypeList" />
+            </van-dropdown-menu>
+          </div>
+        </template>
+      </van-search>
     </div>
     <div class="todayPlan flexCoum-box">
-      <PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0" @planClick="getPlanList"></PlanComponent>
+      <PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0" @planClick="getPlanList">
+      </PlanComponent>
       <van-empty description="暂无数据" v-else />
     </div>
   </div>
@@ -28,8 +38,16 @@ export default {
   data() {
     return {
       planList: [], // 今日计划数据
+      searchTypeList: [
+        { text: '排产工单号', value: 1 },
+        { text: '项目名称', value: 2 },
+        { text: '产品名称', value: 3 },
+        { text: '订单号', value: 4 },
+        { text: '工序', value: 5 },
+      ],
+      searchTypeValue: 1,
       searchValue: '',
-      debouncedPlanSeach: () => {},
+      debouncedPlanSeach: () => { },
     };
   },
   computed: {},
@@ -65,46 +83,46 @@ export default {
         pageIndex: 0,
         pageSize: 10000,
         planType: 0,
-        isMob:1,
-        searchType: 5,
+        isMob: 1,
+        searchType: this.searchTypeValue,
         searchValue: this.searchValue,
         // date: this.getNowFormatDate()
       })
-      .then(res => {
-        if (res.code == "ok") {
-          res.data.records.forEach(item => { item.flg = false })
-          // this.planList = res.data.records;
-          this.planList = []
-          this.planListCopy = []
-          // res.data.records.forEach((item => {
-          //   const newProgress = item.progress && item.progress.split('%')[0]
-          //   const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
-          //   if(item.progress) {
-          //     item.newProgress = newProgress
-          //   }
-          //   const { hasAllocation, hasAllAllocation } = item
-          //   if(hasAllocation && !hasAllAllocation) {
-          //     item.backgroundClass = 'blues'
-          //     return
-          //   }
-          //   if(progressFlag) {
-          //     item.backgroundClass = 'reds'
-          //     return
-          //   }
-          //   if(hasAllocation && hasAllAllocation) {
-          //     item.backgroundClass = 'greens'
-          //     return
-          //   }
-          // }))
-          setTimeout(() => {
-            this.$set(this, 'planList', res.data.records)
-          }, 100)
-          this.$toast.clear();
-        } else {
-          this.$toast.clear();
-          this.$toast.fail(res.msg);
-        }
-      }).catch(err => { this.$toast.clear(); });
+        .then(res => {
+          if (res.code == "ok") {
+            res.data.records.forEach(item => { item.flg = false })
+            // this.planList = res.data.records;
+            this.planList = []
+            this.planListCopy = []
+            // res.data.records.forEach((item => {
+            //   const newProgress = item.progress && item.progress.split('%')[0]
+            //   const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
+            //   if(item.progress) {
+            //     item.newProgress = newProgress
+            //   }
+            //   const { hasAllocation, hasAllAllocation } = item
+            //   if(hasAllocation && !hasAllAllocation) {
+            //     item.backgroundClass = 'blues'
+            //     return
+            //   }
+            //   if(progressFlag) {
+            //     item.backgroundClass = 'reds'
+            //     return
+            //   }
+            //   if(hasAllocation && hasAllAllocation) {
+            //     item.backgroundClass = 'greens'
+            //     return
+            //   }
+            // }))
+            setTimeout(() => {
+              this.$set(this, 'planList', res.data.records)
+            }, 100)
+            this.$toast.clear();
+          } else {
+            this.$toast.clear();
+            this.$toast.fail(res.msg);
+          }
+        }).catch(err => { this.$toast.clear(); });
     },
     // 返回当天的日期 格式:yyyy-MM-dd
     getNowFormatDate() {
@@ -130,11 +148,26 @@ export default {
 * {
   box-sizing: border-box;
 }
+
 .seachPlan {
   padding-top: 46px;
 }
+
 .todayPlan {
   height: 100%;
   background-color: #F4F4F4;
 }
+
+.searchDropdownMenu {
+  width: 120px;
+  padding: 0 10px 0 0;
+}
+
+::v-deep .van-dropdown-menu__bar {
+  box-shadow: none;
+}
+
+::v-deep .van-dropdown-item__option {
+  padding: 10px 20px;
+}
 </style>