Explorar el Código

1、画布更新

huangmp hace 2 años
padre
commit
86d836a13e

+ 44 - 23
src/components/order-card-item/index.vue

@@ -124,27 +124,48 @@
         }
         let isSize = true;
         //如果当前是编辑的小卡,就需要判断是否符合尺寸
-        if(item.prodName.indexOf("小卡") != -1){
-          isSize = new Promise(function(resolve, reject) {
-            let width = 709;
-            let height = 1087;
-            let _URL = window.URL || window.webkitURL;
-            let img = new Image();
-            img.onload = function() {
-              let valid = img.width == width && img.height == height;
-              valid ? resolve() : reject();
-            };
-            img.src = _URL.createObjectURL(file);
-          }).then(
-            () => {
-              return file;
-            },
-            () => {
-              this.$message.error("上传的图片宽高必须是709*1087!");
-              return Promise.reject();
-            }
-          );
-        }
+        let width = 709;
+        let height = 1087;
+        let prodName = item.prodName;
+        isSize = new Promise(function(resolve, reject) {
+          if(prodName.indexOf("小卡") !== -1 || prodName.indexOf("仿拍立得") !== -1){
+            width = 709;
+            height = 1087;
+          }else if(prodName.indexOf("票根") !== -1){
+            width = 780;
+            height = 1489;
+          }else if(prodName.indexOf("直拍封面") !== -1){
+            width = 697;
+            height = 1217;
+          }else if(prodName.indexOf("明信片") !== -1){
+            width = 1252;
+            height = 1819;
+          }else if(prodName.indexOf("书签") !== -1){
+            width = 638;
+            height = 1819;
+          }else if(prodName.indexOf("方卡") !== -1){
+            width = 1217;
+            height = 1217;
+          }else if(templateUsage.indexOf("手幅") !== -1){
+            width = 1252;
+            height = 3614;
+          }
+          let _URL = window.URL || window.webkitURL;
+          let img = new Image();
+          img.onload = function() {
+            let valid = img.width == width && img.height == height;
+            valid ? resolve() : reject();
+          };
+          img.src = _URL.createObjectURL(file);
+        }).then(
+          () => {
+            return file;
+          },
+          () => {
+            this.$message.error("上传的图片宽高必须是" + width + "*" + height);
+            return Promise.reject();
+          }
+        );
         return isJpg && isSize;
       },
       deleteCardItem(item, index){
@@ -237,8 +258,8 @@
         this.side = side;
         if(prodName.indexOf('小卡') != -1){
           this.prodType = '小卡';
-        } else if(prodName.indexOf('拍立得') != -1){
-          this.prodType = '拍立得';
+        } else if(prodName.indexOf('仿拍立得') != -1){
+          this.prodType = '仿拍立得';
         }else if(prodName.indexOf('直拍封面') != -1){
           this.prodType = '直拍封面';
         }else if(prodName.indexOf('票根') != -1){

+ 16 - 6
src/views/modules/order/order.vue

@@ -354,7 +354,7 @@
           </ul>
           <ul class="nav-right"></ul>
         </div>
-        <el-checkbox @change="checked=>handleSelectAll(checked)" class="all-check-btn" >全选 </el-checkbox>
+        <el-checkbox @change="checked=>handleSelectAll(checked)" class="all-check-btn" v-model="selectAll">全选 </el-checkbox>
         <span v-if="dataListSelections.size" class="had-selected">已选 {{dataListSelections.size}}</span>
         <div
             class="default-btn"
@@ -979,8 +979,8 @@
       label-width="80px">
       <el-form-item label="打印渠道" prop="printChannel">
         <el-select v-model="printChannel" clearable filterable>
-          <el-option key="GSART" label="广森" value="GSART"></el-option>
-          <el-option key="WoNiu" label="蜗牛" value="WoNiu"></el-option>
+<!--          <el-option key="GSART" label="广森" value="GSART"></el-option>-->
+<!--          <el-option key="WoNiu" label="蜗牛" value="WoNiu"></el-option>-->
           <el-option key="KuaiYin" label="快印" value="KuaiYin"></el-option>
           <el-option key="Lightning" label="闪电" value="Lightning"></el-option>
         </el-select>
@@ -1004,8 +1004,8 @@
       >
         <el-form-item label="打印渠道" prop="printChannel">
           <el-select v-model="printChannel" clearable filterable>
-            <el-option key="GSART" label="广森" value="GSART"></el-option>
-            <el-option key="WoNiu" label="蜗牛" value="WoNiu"></el-option>
+            <!--<el-option key="GSART" label="广森" value="GSART"></el-option>
+            <el-option key="WoNiu" label="蜗牛" value="WoNiu"></el-option>-->
             <el-option key="KuaiYin" label="快印" value="KuaiYin"></el-option>
             <el-option key="Lightning" label="闪电" value="Lightning"></el-option>
           </el-select>
@@ -1191,7 +1191,7 @@ export default {
       infoWidth: '400px',
       generatePrintPdfBatchVisible: false,
       orderCreateBatchVisible: false,
-      printChannel: "GSART",
+      printChannel: "KuaiYin",
       orderCreateBatchLoading: false
     }
   },
@@ -1896,6 +1896,16 @@ export default {
     },
     // 搜索查询
     searchChange (newData = false) {
+      let it = this;
+      this.dataList.forEach((item, index) => {
+        it.$set(item,'checkStatus',false)
+        it.dataListSelections.delete(item.orderNumber);
+        it.selectAll = false;
+        it.checked = false;
+      })
+      this.dataListSelections = new Set();
+      this.selectAll = false;
+      this.selectSheets = 0;
       this.page.currentPage = 1
       // this.getDataList(this.page, null, newData)
       if(this.status === 8){

+ 2 - 2
src/views/modules/prod/post-product/posting-edit-product.vue

@@ -576,7 +576,6 @@ export default {
         shopCategoryId: '',
         prodLangList: [],
         brandName: '',
-        customType: null,
         deliveryMode: {
           hasShopDelivery: true,
           hasUserPickUp: false,
@@ -607,7 +606,8 @@ export default {
           //   parameterValueEn: ''
           // }
         ],
-        customized: 0
+        customized: 0,
+        customType: 1
       },
       dataRule: {
         prodNameCn: [

+ 24 - 11
src/views/modules/prod/printPicLib-add-or-update.vue

@@ -97,21 +97,32 @@ export default {
         }
       });
     },
-    //验证图片尺寸
-    checkImageSize(imageStr, index) {
+    getProdTypeSize(){
       let width = 0;
       let height = 0;
-      let templateUsage = "smallcard";
+      let prodName = this.dataForm.prodName;
+      if(prodName.indexOf('小卡') !== -1 || prodName.indexOf("仿拍立得") !== -1){
+        width = 709;
+        height = 1087;
+      }else if(prodName.indexOf("票根") !== -1){
+        width = 780;
+        height = 1489;
+      }else if(prodName.indexOf("圆形徽章") !== -1){
+        width = 850;
+        height = 850;
+      }else if(prodName.indexOf("明信片") !== -1){
+        width = 1252;
+        height = 1819;
+      }
+      return {width, height};
+    },
+    //验证图片尺寸
+    checkImageSize(imageStr, index) {
+      let width = this.getProdTypeSize().width;
+      let height = this.getProdTypeSize().height;
       return new Promise((resolve, reject) => {
         let image = new Image();
         image.onload = function() {
-          if(templateUsage.indexOf("smallcard") !== -1 || templateUsage.indexOf("polaroid") !== -1){
-            width = 709;
-            height = 1087;
-          }else if(templateUsage.indexOf("stub") !== -1){
-            width = 780;
-            height = 1489;
-          }
           let imageFormat = imageStr.split('.').pop();
           if(imageFormat !== 'jpg'){
             reject(index);
@@ -140,7 +151,9 @@ export default {
       try{
         let imgs = [];
         imgs[0] = this.dataForm.frontUrl ? this.dataForm.frontUrl:null;
-        imgs[1] = this.dataForm.backUrl ? this.dataForm.backUrl:null;
+        if(this.dataForm.backUrl){
+          imgs[1] = this.dataForm.backUrl ? this.dataForm.backUrl:null;
+        }
         await Promise.all(imgs.map(this.checkImageSize));
         this.$http({
           url: this.$http.adornUrl('/print/printPicLib'),

+ 10 - 0
src/views/modules/prod/prodTemplate-add-or-update.vue

@@ -135,12 +135,22 @@ export default {
           }else if(templateUsage.indexOf("stub") !== -1){
             width = 780;
             height = 1489;
+          }else if(templateUsage.indexOf("bookmark") !== -1){
+            width = 638;
+            height = 1819;
+          }else if(templateUsage.indexOf("postcard") !== -1){
+            width = 1252;
+            height = 1819;
           }
           if(isBack){
             let imageFormat = imageStr.split('.').pop();
             if(imageFormat != 'jpg'){
               reject(index);
             }
+          }else if(!isBack && templateUsage.indexOf("polaroid") !== -1){
+            if(imageFormat != 'png'){
+              reject(index);
+            }
           }
           if ((image.width === width && image.height === height)) {
             resolve();