huangmp 1 rok temu
rodzic
commit
1de6612eed

+ 2 - 2
src/components/VideoBox/index.vue

@@ -477,7 +477,7 @@ export default {
     },
     // 视频预上传
     onUploadChange (file, fileList) {
-      if (['video/mp4', 'video/ogg', 'video/webm'].indexOf(file.raw.type) === -1) {
+      if (['video/mp4', 'video/mkv', 'video/quicktime', 'video/ogg', 'video/webm'].indexOf(file.raw.type) === -1) {
         this.$message.error(this.$i18n.t('videoManager.tips2'))
         return false
       }
@@ -508,7 +508,7 @@ export default {
      * @returns {boolean}
      */
     beforeUploadVideo (file) {
-      const isLt20M = file.size / 1024 / 1024 < 20
+      const isLt20M = file.size / 1024 / 1024 < 100
       if (!isLt20M) {
         this.$message.error('上传视频大小不能超过20MB哦!')
         return false

+ 215 - 59
src/components/order-card-item/index.vue

@@ -4,73 +4,77 @@
       <div v-if="showFlagBtn">
         <el-radio v-model="mode" label="view">预览模式</el-radio>
         <el-radio v-model="mode" label="edit">编辑模式</el-radio>
+        <el-radio v-model="mode" label="choose">选图模式</el-radio>
         <el-button @click="openCanvasParamPicFormByOrderNumber(orderItem)" size="mini" type="text" v-if="orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1">查看工艺</el-button>
       </div>
 
       <div style="border: 2px solid pink; display: inline-block;margin-right: 5px;" v-for="(item, index) in cardItemList" :key="item.cardItemId">
-        <el-row :gutter="12" style="padding-top: 5px">
-          <el-col :span="12">
-            <el-card :body-style="{ padding: '0px' }">
-              <div style="padding: 3px; text-align: center">
-                <span>正面</span>
-              </div>
-              <div v-if="mode=='view'" style="width: 100px;height: auto">
-                <img :src="resourcesUrl + item.frontPic" @click="previewPic(item, item.frontPic, item.prodName, 'front')"/>
-              </div>
-              <el-upload v-else
-                class="avatar-uploader"
-                accept="image/jpg"
-                :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
-                :action="$http.adornUrl('/admin/file/simpleUpload')"
-                :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
-                :on-success="(res,file)=>{onFrontUploadSuccess(item,res,file)}"
-                :show-file-list="false">
-                <img v-if="item.frontPic" style="width: 100px;height: auto" :src="resourcesUrl + item.frontPic" class="avatar">
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-              </el-upload>
-            </el-card>
-          </el-col>
-          <el-col :span="12">
-            <el-card :body-style="{ padding: '0px' }">
-              <div style="padding: 3px; text-align: center">
-                <span>背面</span>
-              </div>
-              <div v-if="mode=='view'" style="width: 100px;height: auto">
-                <img :src="resourcesUrl + item.backPic" @click="previewPic(item, item.backPic, item.prodName, 'back')"/>
-              </div>
-              <el-upload v-else
-                         class="avatar-uploader"
-                         :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
-                         :action="$http.adornUrl('/admin/file/simpleUpload')"
-                         :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
-                         :on-success="(res,file)=>{onBackUploadSuccess(item,res,file)}"
-                         :show-file-list="false">
-                <img v-if="item.backPic" style="width: 100px;height: auto" :src="resourcesUrl + item.backPic" class="avatar">
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-              </el-upload>
-            </el-card>
-          </el-col>
-        </el-row>
-        <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
+        <div :style="mode === 'choose' && item.isSelected? divLightStyle : {border: '3px solid #fff'}" @click="cardItemSelect(item, index)">
+          <el-row :gutter="12" style="padding-top: 5px">
+            <el-col :span="12">
+              <el-card :body-style="{ padding: '0px' }">
+                <div style="padding: 3px; text-align: center">
+                  <span>正面</span>
+                </div>
+                <div v-if="mode=='view' || mode === 'choose'" style="width: 100px;height: auto">
+                  <img :src="resourcesUrl + item.frontPic" @click="previewPic(item, item.frontPic, item.prodName, 'front')"/>
+                </div>
+                <el-upload v-else
+                           class="avatar-uploader"
+                           accept="image/jpg"
+                           :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
+                           :action="$http.adornUrl('/admin/file/simpleUpload')"
+                           :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
+                           :on-success="(res,file)=>{onFrontUploadSuccess(item,res,file)}"
+                           :show-file-list="false">
+                  <img v-if="item.frontPic" style="width: 100px;height: auto" :src="resourcesUrl + item.frontPic" class="avatar">
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-card>
+            </el-col>
+            <el-col :span="12">
+              <el-card :body-style="{ padding: '0px' }">
+                <div style="padding: 3px; text-align: center">
+                  <span>背面</span>
+                </div>
+                <div v-if="mode=='view' || mode === 'choose'" style="width: 100px;height: auto">
+                  <img :src="resourcesUrl + item.backPic" @click="previewPic(item, item.backPic, item.prodName, 'back')"/>
+                </div>
+                <el-upload v-else
+                           class="avatar-uploader"
+                           :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
+                           :action="$http.adornUrl('/admin/file/simpleUpload')"
+                           :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
+                           :on-success="(res,file)=>{onBackUploadSuccess(item,res,file)}"
+                           :show-file-list="false">
+                  <img v-if="item.backPic" style="width: 100px;height: auto" :src="resourcesUrl + item.backPic" class="avatar">
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-card>
+            </el-col>
+          </el-row>
+          <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
           <span v-if="showFlagBtn">
           <el-button v-if="item.flag==0 && mode=='view'" type="success" size="mini" style="margin-right: 20px" @click="handleFlag(item, index)">待标记</el-button>
           <el-button v-if="item.flag==1 && mode=='view'" type="warning" size="mini" style="margin-right: 5px" @click="handleFlag(item, index)">已标记</el-button>
-            <el-button v-if="mode=='view'" type="text" size="mini" @click="openOrgPicForm(item, index)">原图</el-button>
-            <el-button v-if="mode=='view' && (orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1)" type="text" size="mini" @click="openCanvasParamPicFormByItem(item, index)">工艺</el-button>
+          <el-button v-if="mode==='choose'" type="text" size="mini" @click="openAddToCardLibDialog(item)">加入图集</el-button>
+          <el-button v-if="mode==='view'" type="text" size="mini" @click="openOrgPicForm(item, index)">原图</el-button>
+          <el-button v-if="mode==='view' && (orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1)" type="text" size="mini" @click="openCanvasParamPicFormByItem(item, index)">工艺</el-button>
           <el-button v-if="(item.prodName.indexOf('语音') !== -1 || item.prodName.toLowerCase().indexOf('ar') !== -1) && mode=='view'" type="text" size="mini" @click="openYYForm(item, index)">查看语音</el-button>
           <el-button v-if="mode==='edit'" type="primary" size="mini" style="margin-right: 5px" @click="addOrUpdateCardItem(item)">保存</el-button>
           <el-button v-if="mode==='edit' && item.cardItemId" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(item, index)">删除</el-button>
         </span>
-        </el-row>
-        <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
-          <span>No.{{index + 1}}</span>
-          <span v-if="showFlagBtn" style="color: white">
+          </el-row>
+          <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
+            <span>No.{{index + 1}}</span>
+            <span v-if="showFlagBtn" style="color: white">
             __________
           </span>
-          <span>X</span>
-          <span v-if="mode=='view'">{{item.prodCount}}</span>
-          <el-input type="number" size="mini" style="width: 60px;height: 20px" v-if="mode=='edit'" v-model="item.prodCount"></el-input>
-        </el-row>
+            <span>X</span>
+            <span v-if="mode=='view'">{{item.prodCount}}</span>
+            <el-input type="number" size="mini" style="width: 60px;height: 20px" v-if="mode=='edit'" v-model="item.prodCount"></el-input>
+          </el-row>
+        </div>
       </div>
       <div v-if="mode=='edit'" style="display: inline-block;">
         <el-button
@@ -84,7 +88,58 @@
     <YuyinPreview ref="yuYinPreviewRef"></YuyinPreview>
     <OrgPicPreview ref="orgPicPreviewRef"></OrgPicPreview>
     <CanvasParamPicPreview ref="canvasParamPicPreviewRef"></CanvasParamPicPreview>
-
+    <el-dialog title="加入图集" :visible.sync="addToCardLibVisible" :modal="false" width="80%">
+      <el-form
+        :model="cardLibItemDataForm"
+        size="small"
+        ref="dataForm"
+        label-width="80px">
+        <el-form-item prop="seriesId" label="团队组合">
+          <el-select v-model="cardLibItemDataForm.seriesId" clearable filterable @change="selectSeries">
+            <el-option
+              v-for="node in seriesList"
+              :key="node.seriesId"
+              :label="node.seriesName"
+              :value="node.seriesId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="personId" label="成员名称" class="search-form-item">
+          <el-select v-model="cardLibItemDataForm.personId" placeholder="请选择爱豆" clearable filterable>
+            <el-option v-for="person in personList" :label="person.personName" :value="person.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <div class="create-card-lib" v-for="(card, index) in cardLibItemDataForm.orderCardItemList" :key="index">
+          <el-row :gutter="12" style="padding-top: 5px">
+            <span class="num">{{card.num}}</span>
+            <el-col :span="12">
+              <el-card :body-style="{ padding: '0px' }">
+                <div style="padding: 3px; text-align: center">
+                  <span>正面</span>
+                </div>
+                <div style="width: 100px;height: auto">
+                  <img :src="resourcesUrl + card.frontPic"/>
+                </div>
+              </el-card>
+            </el-col>
+            <el-col :span="12">
+              <el-card :body-style="{ padding: '0px' }">
+                <div style="padding: 3px; text-align: center">
+                  <span>背面</span>
+                </div>
+                <div style="width: 100px;height: auto">
+                  <img :src="resourcesUrl + card.backPic"/>
+                </div>
+              </el-card>
+            </el-col>
+          </el-row>
+        </div>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button class="default-btn">{{$t("crud.filter.cancelBtn")}}</el-button>
+        <el-button :loading="addToCardLibLoading" class="default-btn primary-btn" type="primary" @click="addToCardLibSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -97,6 +152,8 @@
     components: {CanvasPreview, YuyinPreview,OrgPicPreview, CanvasParamPicPreview},
     data () {
       return {
+        addToCardLibLoading: false,
+        cardLibItemDataForm:{},
         lang: localStorage.getItem('lang') || 'zh_CN',
         cardItemList:[],
         previewPicUrl: null,
@@ -109,6 +166,10 @@
         previewWidth: 0,
         previewHeight: 0,
         bloodWidth: 0,
+        addToCardLibVisible: false,
+        seriesList:[],
+        personList:[],
+        divLightStyle: {border: '3px solid red'},
       }
     },
     props: {
@@ -127,6 +188,73 @@
       })
     },
     methods: {
+      cardItemSelect(cardItem, index){
+        if (cardItem.isSelected) {
+          cardItem.isSelected = false
+        } else {
+          cardItem.isSelected = true
+        }
+        this.$set(this.cardItemList, index, cardItem)
+      },
+      addToCardLibSubmit(){
+        this.$http({
+          url: this.$http.adornUrl('/prod/orderCardItem/addToCardLib'),
+          method: 'POST',
+          data: this.cardLibItemDataForm
+        }).then(({data}) => {
+          this.addToCardLibLoading = false
+          this.$message({
+            message: '加入成功',
+            type: 'success',
+            duration: 300,
+            onClose: () => {
+              this.addToCardLibLoading = false
+              this.cardLibItemDataForm = {}
+              this.addToCardLibVisible = false
+            }
+          })
+        })
+      },
+      getSeriesList () {
+        this.$http({
+          url: this.$http.adornUrl('/prod/prodTemplateSeries/page'),
+          method: 'get',
+          params: this.$http.adornParams(
+            Object.assign({
+                size: 100,
+                shopId: 1
+              },
+            )
+          )
+        }).then(({data}) => {
+          this.seriesList = data.records
+        })
+      },
+      selectSeries(seriesId){
+        this.personList = []
+        this.getPersonList(seriesId)
+      },
+      getPersonList (seriesId) {
+        this.$http({
+          url: this.$http.adornUrl('/cardLib/cardPerson/page'),
+          method: 'get',
+          params: this.$http.adornParams(
+            Object.assign({
+                size: 100,
+                seriesId: seriesId
+              },
+            )
+          )
+        }).then(({data}) => {
+          this.personList = data.records
+        })
+      },
+      openAddToCardLibDialog(cardItem){
+        let addToCardLibList = this.cardItemList.filter(item => item.isSelected === true)
+        this.cardLibItemDataForm.orderCardItemList = addToCardLibList
+        this.addToCardLibVisible = true
+        this.getSeriesList()
+      },
       openYYForm(item, index){
         this.$nextTick(() =>{
           this.$refs.yuYinPreviewRef.init(item)
@@ -248,20 +376,26 @@
           }else if(prodName.indexOf("游戏") !== -1){
             width = 803;
             height = 1098;
+          }else if(prodName.indexOf("大3寸") !== -1){
+            width = 732;
+            height = 1028;
+          }else if(prodName.indexOf("透明胶片拍立得") !== -1){
+            width = 768;
+            height = 768;
           }
           let _URL = window.URL || window.webkitURL;
           let img = new Image();
           img.onload = function() {
-            let valid = img.width == width && img.height == height;
-            valid ? resolve() : reject();
+            let valid = img.width === width && img.height === height
+            valid ? resolve() : reject()
           };
-          img.src = _URL.createObjectURL(file);
+          img.src = _URL.createObjectURL(file)
         }).then(
           () => {
             return file;
           },
           () => {
-            this.$message.error("上传的图片宽高必须是" + width + "*" + height);
+            this.$message.error("上传的图片宽高必须是" + width + "*" + height)
             return Promise.reject();
           }
         );
@@ -403,6 +537,10 @@
           this.prodType = '5寸直角卡';
         }else if(prodName.indexOf('游戏') != -1){
           this.prodType = '游戏';
+        }else if(prodName.indexOf('大3寸') != -1){
+          this.prodType = '大3寸';
+        }else if(prodName.indexOf('透明胶片拍立得') != -1){
+          this.prodType = '透明胶片拍立得';
         }
         this.$nextTick(() =>{
           this.$refs.canvasPreviewRef.init(cardItem, this.resourcesUrl + picUrl, this.prodType, side)
@@ -481,4 +619,22 @@
       }
     }
   }
+  .create-card-lib{
+    border: 2px solid pink;
+    display: inline-block;
+    margin-right: 15px;
+    .num{
+      position: absolute;
+      display:flex;
+      justify-content: center;
+      align-items: center;
+      left: 5px;
+      top: 0px;
+      color: white;
+      border-radius: 100%;
+      background-color: red;
+      width: 20px;
+      height: 20px
+    }
+  }
 </style>

+ 6 - 2
src/components/yuyin-preview/index.vue

@@ -45,8 +45,12 @@
           <el-form-item label="语音/视频内容">
             <el-button size="mini" @click="changeAudio" v-if="dataForm.cardNote.type === 'AI' || dataForm.cardNote.type === 'NORMAL'">更换音频</el-button>
             <el-button size="mini" @click="changeVideo" v-if="dataForm.cardNote.type === 'AR'">更换视频</el-button>
-            <br/>
-            <span size="mini" v-if="dataForm.cardNote.type === 'AR'">原始分辨率:{{dataForm.cardNote.originVideoWidth + "x" + dataForm.cardNote.originVideoHeight}}</span>
+            <el-select v-model="dataForm.cardNote.compress">
+              <el-option key="1" :value="true" label="压缩">压缩</el-option>
+              <el-option key="2" :value="false" label="不压缩">不压缩</el-option>
+            </el-select>
+<!--            <br/>-->
+<!--            <span size="mini" v-if="dataForm.cardNote.type === 'AR'">原始分辨率:{{dataForm.cardNote.originVideoWidth + "x" + dataForm.cardNote.originVideoHeight}}</span>-->
             <br/>
             <span size="mini" v-if="dataForm.cardNote.type === 'AR'">检测的分辨率:{{videoResolution}}</span>
             <video v-if="dataForm.cardNote.audioUrl"

+ 1 - 0
src/views/modules/afterSales/thirdAfterSales-add-or-update.vue

@@ -62,6 +62,7 @@
               <el-option label="物流" value="物流"></el-option>
               <el-option label="改地址" value="改地址"></el-option>
               <el-option label="改快递" value="改快递"></el-option>
+              <el-option label="开发票" value="开发票"></el-option>
               <el-option label="其他" value="其他"></el-option>
             </el-select>
           </el-form-item>

+ 1 - 0
src/views/modules/afterSales/thirdAfterSales.vue

@@ -29,6 +29,7 @@
               <el-option label="丢件" value="丢件"></el-option>
               <el-option label="改地址" value="改地址"></el-option>
               <el-option label="改快递" value="改快递"></el-option>
+              <el-option label="开发票" value="开发票"></el-option>
               <el-option label="其他" value="其他"></el-option>
             </el-select>
           </el-form-item>

+ 1 - 1
src/views/modules/prod/card-common-lib.vue

@@ -878,7 +878,7 @@
         flex-direction: column;
         width: 50%;
         padding: 10px;
-        height: 700px;
+        height: 800px;
         overflow-y: auto; /* 当内容超出时显示垂直滚动条 */
         overflow-x: hidden; /* 隐藏水平滚动条 */
 

+ 76 - 14
src/views/modules/prod/card-set-lib-add-or-update.vue

@@ -10,6 +10,11 @@
       <el-form-item label="图集名称" prop="seriesName">
         <span>{{dataForm.seriesName}}</span>
       </el-form-item>
+      <el-form-item label="成员" prop="personName">
+        <el-select v-model="dataForm.personId" placeholder="请选择爱豆" clearable filterable @change="handleChangePerson">
+          <el-option v-for="person in personList" :label="person.personName" :value="person.id"></el-option>
+        </el-select>
+      </el-form-item>
     </el-form>
     <div v-if="mode === 'choose' && selectNum > 0" class="default-btn primary-btn" @click="openAddToGroupBuyDialog">加入团购</div>
     <div>
@@ -19,7 +24,8 @@
       <el-radio v-model="mode" label="check">检测模式</el-radio>
       <span v-if="(mode === 'choose')" style="color: red; font-size: 16px;font-weight: bold">已选数量:{{selectNum}}</span>
     </div>
-    <div class="create-card-lib" v-for="(cardItem, index) in cardLibItemList" :key="index">
+    <div class="card-box" @scroll="backScrollEvent">
+      <div class="create-card-lib" v-for="(cardItem, index) in cardLibItemList" :key="index">
         <div :style="(mode === 'choose' && cardItem.isSelected? divLightStyle : {border: '3px solid #fff'})" @click="mode==='choose'? cardItemSelect(cardItem) : (mode==='check'? cardItemCheck(cardItem): '')">
           <el-row :gutter="12" style="padding-top: 5px">
             <el-col :span="12">
@@ -48,6 +54,7 @@
           <el-button v-if="mode==='edit' && cardItem.id" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(cardItem, index)">删除</el-button>
         </el-row>
       </div>
+    </div>
     <span slot="footer" class="dialog-footer">
       <el-button class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</el-button>
     </span>
@@ -102,29 +109,77 @@ export default {
       divLightStyle: {border: '3px solid red'},
       addToGroupBuyVisible: false,
       groupBuyData: {},
-      prodList: []
+      prodList: [],
+      personList: [],
+      page: {
+        total: 0, // 总页数
+        currentPage: 1, // 当前页数
+        pageSize: 50 // 每页显示多少条
+      },
     }
+  },
+  created() {
+
   },
   methods: {
     init (cardLib) {
       this.dataForm.seriesName = cardLib.seriesName
       this.dataForm.seriesId = cardLib.seriesId
+      this.dataForm.cardLibId = cardLib.id
       this.visible = true
       this.$nextTick(() => {
-        this.$http({
-          url: this.$http.adornUrl('/card/cardLibItem/page'),
-          method: 'get',
-          params: this.$http.adornParams(
-            Object.assign({
-                size: 500,
-                shopId: 1,
-                cardLibId: cardLib.id
-              }
-            )
+        this.getCardItemList()
+      })
+      this.getPersonList(this.dataForm.seriesId)
+    },
+    backScrollEvent (e) {
+      if (e.srcElement.scrollTop + e.srcElement.clientHeight + 1 > e.srcElement.scrollHeight){
+        this.loadMore()
+      }
+    },
+    loadMore () {
+      this.page.currentPage = this.page.currentPage + 1
+      this.getCardItemList(true)
+    },
+    handleChangePerson(value){
+      this.page.currentPage = 1
+      this.getCardItemList()
+    },
+    getCardItemList(isLoadMore){
+      this.$http({
+        url: this.$http.adornUrl('/card/cardLibItem/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+              size: this.page.pageSize,
+              current: this.page.currentPage,
+              shopId: 1,
+              cardLibId: this.dataForm.cardLibId,
+              personId: this.dataForm.personId
+            }
           )
-        }).then(({data}) => {
+        )
+      }).then(({data}) => {
+        if(isLoadMore === true){
+          this.cardLibItemList.push(...data.records)
+        }else{
           this.cardLibItemList = data.records
-        })
+        }
+      })
+    },
+    getPersonList (seriesId) {
+      this.$http({
+        url: this.$http.adornUrl('/cardLib/cardPerson/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+              size: 20,
+              seriesId: seriesId
+            },
+          )
+        )
+      }).then(({data}) => {
+        this.personList = data.records
       })
     },
     groupBuyDataSubmit(){
@@ -227,4 +282,11 @@ export default {
     display: inline-block;
     margin-right: 15px
   }
+  .card-box {
+    width: 100%;
+    padding: 10px;
+    height: 700px;
+    overflow-y: auto; /* 当内容超出时显示垂直滚动条 */
+    overflow-x: hidden; /* 隐藏水平滚动条 */
+  }
 </style>

+ 6 - 1
src/views/modules/prod/card-set-lib.vue

@@ -17,6 +17,10 @@
         </div>
       </el-form>
     </div>
+    <!--<div class="operation-bar">
+      <div class="default-btn primary-btn" @click="addOrUpdateHandle()"
+      >新增图集</div>
+    </div>-->
     <!-- 列表相关区域 -->
     <div class="main-container">
       <div class="table-con spec-table">
@@ -76,6 +80,7 @@ import AddOrUpdatePerson from './cardPerson-add-or-update'
 export default {
   data () {
     return {
+      dataForm:{},
       dataList: [],
       page: {
         total: 0, // 总页数
@@ -135,7 +140,7 @@ export default {
         this.seriesList = this.dataList
       })
     },
-    // 新增 / 修改
+    // 修改
     addOrUpdateHandle (cardLib) {
       this.addOrUpdateVisible = true
       this.$nextTick(() => {

+ 202 - 14
src/views/modules/prod/groupBuyLib-add-or-update.vue

@@ -10,12 +10,28 @@
       <el-form-item label="关联产品" prop="prodId">
         <span>{{dataForm.prodName}}</span>
       </el-form-item>
-      <div>
-        <el-radio v-model="mode" label="view">预览模式</el-radio>
-        <el-radio v-model="mode" label="edit">编辑模式</el-radio>
-      </div>
-      <div class="card-box" @scroll="backScrollEvent">
-        <div class="create-card-lib" v-for="(cardItem, index) in cardLibItemList" :key="cardItem.id">
+      <el-form-item prop="inCardLib" label="图集状态" class="search-form-item">
+        <el-select size="small" v-model="dataForm.inCardLib" placeholder="请是否已加入图集" clearable>
+          <el-option label="未加入" value="0"></el-option>
+          <el-option label="已加入" value="1"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="分类" prop="category">
+        <el-select size="small" v-model="dataForm.category" placeholder="请选择分类" clearable filterable @change="handleCategoryChange">
+          <el-option v-for="category in categoryList" :label="category" :value="category"></el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div v-if="mode === 'choose' && selectNum > 0" class="default-btn primary-btn" @click="openAddToCardLibDialog">加入图集</div>
+    <div>
+      <el-radio v-model="mode" label="view">预览模式</el-radio>
+      <el-radio v-model="mode" label="edit">编辑模式</el-radio>
+      <el-radio v-model="mode" label="choose">选图模式</el-radio>
+      <span v-if="(mode === 'choose')" style="color: red; font-size: 16px;font-weight: bold">已选数量:{{selectNum}}</span>
+    </div>
+    <div class="card-box" @scroll="backScrollEvent">
+      <div class="create-card-lib" v-for="(cardItem, index) in cardLibItemList" :key="cardItem.id">
+        <div :style="(mode === 'choose' && cardItem.isSelected? divLightStyle : {border: '3px solid #fff'})" @click="mode==='choose'? cardItemSelect(cardItem) : ''">
           <el-row :gutter="12" style="padding-top: 5px">
             <el-col :span="12">
               <el-card :body-style="{ padding: '0px' }">
@@ -38,16 +54,57 @@
               </el-card>
             </el-col>
           </el-row>
-          <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
-            <el-button v-if="mode === 'edit'" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(cardItem, index)">删除</el-button>
-          </el-row>
         </div>
-      </div>
 
-    </el-form>
+        <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
+          <el-button v-if="mode === 'edit'" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(cardItem, index)">删除</el-button>
+        </el-row>
+      </div>
+    </div>
     <span slot="footer" class="dialog-footer">
       <el-button class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</el-button>
     </span>
+    <el-dialog
+      title="加入图集选择"
+      :close-on-click-modal="false"
+      :append-to-body="true"
+      :visible.sync="addToCardLibVisible">
+      <el-form
+        ref="dataForm"
+        size="small"
+        label-width="auto"
+        :model="cardLibData">
+        <el-form-item label="选择图集" prop="prodType">
+          <el-select v-model="cardLibData.cardLibId" clearable filterable>
+            <el-option v-for="(cardLib, index) in cardLibList"
+                       :key="cardLib.id"
+                       :label="cardLib.seriesName + '_' + cardLib.libNo"
+                       :value="cardLib.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="seriesId" label="团体组合" class="search-form-item">
+          <el-select v-model="cardLibData.seriesId" placeholder="请选择所属团体组合" clearable filterable @change="handleSeriesChange">
+            <el-option v-for="series in seriesList" :label="series.seriesName" :value="series.seriesId"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="成员名称" prop="personName">
+          <el-select v-model="cardLibData.personId" placeholder="请选择爱豆" clearable filterable>
+            <el-option v-for="person in personList" :label="person.personName" :value="person.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="指定模式" prop="personName">
+          <el-select v-model="cardLibData.chooseMode" placeholder="请选择爱豆" clearable filterable>
+            <el-option label="指定图片加入" value="choose"></el-option>
+            <el-option label="全选图片加入" value="all"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addToCardLibVisible = false">取消</el-button>
+        <el-button type="primary" @click="cardLibDataSubmit()">确认</el-button>
+      </span>
+    </el-dialog>
   </el-dialog>
 </template>
 
@@ -71,8 +128,10 @@ export default {
         isDelete: 0,
         category: null,
         backCopyNum: 1,
-        shopId: 1,
+        shopId: 1
       },
+      divLightStyle: {border: '3px solid red'},
+      selectNum: 0,
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
@@ -80,21 +139,86 @@ export default {
       },
       resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
       prodList: [],
+      personList: [],
+      categoryList: [],
+      cardLibList: [],
+      seriesList: [],
       dataRule: {
       },
-      cardLibItemList: []
+      cardLibItemList: [],
+      addToCardLibVisible: false,
+      cardLibData: {}
     }
   },
   created(){
 
   },
   methods: {
+    handleSeriesChange(seriesId){
+      this.personList = []
+      this.getPersonList(seriesId)
+    },
+    // handleCardLibChange(value){
+    //   this.getPersonList(value)
+    // },
+    handleCategoryChange(category){
+      this.page.currentPage = 1
+      this.getCardItemList()
+    },
+    cardLibDataSubmit(){
+      this.$confirm('确定要加入到图集吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let cardLibItemList = this.cardLibItemList.filter(item => item.isSelected === true)
+        this.cardLibData.cardLibItemList = cardLibItemList
+        this.$http({
+          url: this.$http.adornUrl('/print/printPicLib/addToCardLib'),
+          method: 'post',
+          data: this.$http.adornData(this.cardLibData)
+        }).then(({data}) => {
+          this.$message({
+            message: this.$i18n.t('publics.operation'),
+            type: 'success',
+            duration: 300,
+            onClose: () => {
+              this.closeDialog()
+            }
+          })
+        })
+      })
+    },
+    openAddToCardLibDialog(){
+      this.cardLibData.prodId = this.dataForm.prodId
+      this.cardLibData.category = this.dataForm.category
+      this.addToCardLibVisible = true
+      this.getCardLibList()
+      this.getSeriesList()
+    },
+    getCardLibList(){
+      this.$http({
+        url: this.$http.adornUrl('/card/cardLib/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+              size: 200,
+              shopId: 1
+            }
+          )
+        )
+      }).then(({data}) => {
+        this.cardLibList = data.records
+      })
+    },
     closeDialog(){
       this.dataForm = {}
       this.cardLibItemList = []
       this.visible = false
       this.page.currentPage = 1
       this.mode = 'view'
+      this.addToCardLibVisible = false
+      this.selectNum = 0
     },
     backScrollEvent (e) {
       if (e.srcElement.scrollTop + e.srcElement.clientHeight + 1 > e.srcElement.scrollHeight){
@@ -105,6 +229,66 @@ export default {
       this.page.currentPage = this.page.currentPage + 1
       this.getCardItemList(true)
     },
+    cardItemSelect(cardItem){
+      let idx = this.cardLibItemList.findIndex(item => item.id === cardItem.id)
+      if (idx !== -1) {
+        if (cardItem.isSelected) {
+          cardItem.isSelected = false
+          if (this.selectNum !== 0) {
+            this.selectNum = this.selectNum - 1
+          }
+        } else {
+          cardItem.isSelected = true
+          this.selectNum = this.selectNum + 1
+        }
+        this.$set(this.cardLibItemList, idx, cardItem)
+      }
+    },
+    getSeriesList () {
+      this.$http({
+        url: this.$http.adornUrl('/prod/prodTemplateSeries/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+              size: 100,
+              shopId: 1
+            },
+          )
+        )
+      }).then(({data}) => {
+        this.seriesList = data.records
+      })
+    },
+    getPersonList (seriesId) {
+      this.$http({
+        url: this.$http.adornUrl('/cardLib/cardPerson/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+              size: 100,
+              seriesId: seriesId
+            },
+          )
+        )
+      }).then(({data}) => {
+        this.personList = data.records
+      })
+    },
+    getCategoryList (prodId) {
+      this.$http({
+        url: this.$http.adornUrl('/print/printPicLib/categoryList'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+              size: 100,
+              prodId: prodId
+            }
+          )
+        )
+      }).then(({data}) => {
+        this.categoryList = data
+      })
+    },
     deleteCardItem (cardItem, index) {
       this.$confirm('确定要删除吗?', '提示', {
         confirmButtonText: '确定',
@@ -133,7 +317,9 @@ export default {
               size: this.page.pageSize,
               current: this.page.currentPage,
               shopId: 1,
-              prodId: this.dataForm.prodId
+              prodId: this.dataForm.prodId,
+              category: this.dataForm.category,
+              inCardLib: this.dataForm.inCardLib
             }
           ))
       }).then(({data}) => {
@@ -147,10 +333,12 @@ export default {
     init (groupBuy) {
       this.dataForm.prodId = groupBuy.prodId || null
       this.dataForm.prodName = groupBuy.prodName || null
+      this.dataForm.id = groupBuy.id || null
       this.visible = true
       this.$nextTick(() => {
         if (this.dataForm.prodId) {
           this.getCardItemList()
+          this.getCategoryList(this.dataForm.prodId)
         }
       })
     },

+ 3 - 4
src/views/modules/prod/prodTemplateSeries-add-or-update.vue

@@ -48,7 +48,7 @@ export default {
       dataForm: {
         seriesId: null,
         seriesName: null,
-        shopId: this.$store.state.user.shopId
+        shopId: 1
       },
       usageList:[],
       dataRule: {
@@ -59,8 +59,7 @@ export default {
     init (series) {
       this.visible = true
       this.$nextTick(() => {
-        this.$refs['dataForm'].resetFields()
-        if (series.seriesName) {
+        if (series) {
           this.$http({
             url: this.$http.adornUrl('/prod/prodTemplateSeries/info/' + series.seriesName),
             method: 'get',
@@ -85,7 +84,7 @@ export default {
             this.$message({
               message: this.$i18n.t('publics.operation'),
               type: 'success',
-              duration: 1500,
+              duration: 500,
               onClose: () => {
                 this.visible = false
                 this.$emit('refreshDataList')

+ 1 - 1
src/views/modules/resource/video-store/upload-video.vue

@@ -237,7 +237,7 @@ export default {
         this.$refs.upload.uploadFiles.splice(-1, 1)
         return
       }
-      if (['video/mp4', 'video/ogg', 'video/webm'].indexOf(file.raw.type) === -1) {
+      if (['video/mp4', 'video/mkv', 'video/quicktime', 'video/ogg', 'video/webm'].indexOf(file.raw.type) === -1) {
         this.$message.error(this.$i18n.t('videoManager.tips2'))
         this.$refs.upload.uploadFiles.splice(-1, 1)
         return false

+ 1 - 1
src/views/modules/resource/video-store/video-store.vue

@@ -571,7 +571,7 @@ export default {
     },
     // 视频预上传
     onUploadChange (file, fileList) {
-      if (['video/mp4', 'video/ogg', 'video/webm'].indexOf(file.raw.type) === -1) {
+      if (['video/mp4', 'video/mkv', 'video/quicktime', 'video/ogg', 'video/webm'].indexOf(file.raw.type) === -1) {
         this.$message.error(this.$i18n.t('videoManager.tips2'))
         return false
       }