mo 3 years ago
parent
commit
c2ec85e971
1 changed files with 68 additions and 42 deletions
  1. 68 42
      src/views/businessManager/shopManager/shopList.vue

+ 68 - 42
src/views/businessManager/shopManager/shopList.vue

@@ -143,7 +143,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="replacementShowOrganId" v-if="tenantId==1">
+        <el-form-item prop="replacementShowOrganId" v-if="tenantId == 1">
           <el-select
             v-model.trim="searchForm.replacementShowOrganId"
             clearable
@@ -315,7 +315,12 @@
               />
             </template>
           </el-table-column> -->
-          <el-table-column align="center" label="是否库存预警" v-if="tenantId==1" :key="Math.random()">
+          <el-table-column
+            align="center"
+            label="是否库存预警"
+            v-if="tenantId == 1"
+            :key="Math.random()"
+          >
             <template slot-scope="scope">
               <span v-if="!scope.row.complementGoodsIdList">
                 {{ scope.row.stockWarning ? "是" : "否" }}
@@ -347,7 +352,13 @@
               }}</span>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="stockCount" label="内部库存" v-if="tenantId==1" :key="Math.random()">
+          <el-table-column
+            align="center"
+            prop="stockCount"
+            label="内部库存"
+            v-if="tenantId == 1"
+            :key="Math.random()"
+          >
             <template slot-scope="scope">
               <!-- 先判断是否是组合商品 -->
               <span v-if="scope.row.complementGoodsIdList">
@@ -365,7 +376,13 @@
               <span v-else>{{ scope.row.taxStockCount }}</span>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="stockType" label="库存类型" v-if="tenantId==1" :key="Math.random()">
+          <el-table-column
+            align="center"
+            prop="stockType"
+            label="库存类型"
+            v-if="tenantId == 1"
+            :key="Math.random()"
+          >
             <template slot-scope="scope">
               {{ scope.row.stockType | stockTypeStatus }}
             </template>
@@ -421,7 +438,7 @@
             align="center"
             width="180px"
             label="操作"
- fixed="right"
+            fixed="right"
             key="caozuo"
           >
             <template slot-scope="scope">
@@ -496,7 +513,7 @@
 
     <el-dialog
       :title="addString[addType] + '组合商品'"
-v-if="routeShopStatus"
+      v-if="routeShopStatus"
       :visible.sync="routeShopStatus"
       @close="onFormClose('ruleForm')"
       width="1000px"
@@ -656,11 +673,11 @@ v-if="routeShopStatus"
         />
         <el-form-item
           label="市场价"
-           class="hiddenStart"
+          class="hiddenStart"
           prop="marketPrice"
           :label-width="formLabelWidth"
         >
-        <template slot="label">
+          <template slot="label">
             <p style="position: relative">
               <span style="color: #f56c6c; margin-right: 4px">*</span>
               市场价
@@ -691,11 +708,11 @@ v-if="routeShopStatus"
         </el-form-item>
         <el-form-item
           label="零售价"
-           class="hiddenStart"
+          class="hiddenStart"
           prop="discountPrice"
           :label-width="formLabelWidth"
         >
-         <template slot="label">
+          <template slot="label">
             <p style="position: relative">
               <span style="color: #f56c6c; margin-right: 4px">*</span>
               零售价
@@ -727,10 +744,10 @@ v-if="routeShopStatus"
         <el-form-item
           label="商品团购价"
           prop="groupPurchasePrice"
-           class="hiddenStart"
+          class="hiddenStart"
           :label-width="formLabelWidth"
         >
-         <template slot="label">
+          <template slot="label">
             <p style="position: relative">
               <span style="color: #f56c6c; margin-right: 4px">*</span>
               团购价
@@ -890,7 +907,7 @@ v-if="routeShopStatus"
             style="width: 400px !important"
             multiple
             clearable
-             :disabled="addDisabled"
+            :disabled="addDisabled"
           >
             <el-option
               v-for="item in selects.branchs"
@@ -913,7 +930,7 @@ v-if="routeShopStatus"
             style="width: 400px !important"
             multiple
             clearable
-             :disabled="addDisabled"
+            :disabled="addDisabled"
           >
             <el-option
               v-for="item in selects.branchs"
@@ -936,7 +953,7 @@ v-if="routeShopStatus"
             style="width: 400px !important"
             multiple
             clearable
-             :disabled="addDisabled"
+            :disabled="addDisabled"
           >
             <el-option
               v-for="item in selects.branchs"
@@ -947,7 +964,8 @@ v-if="routeShopStatus"
           </select-all>
         </el-form-item>
         <!--  :disabled="pageDisabled || pageType == 'update'"  -->
-        <el-form-item  v-if="tenantId==1"
+        <el-form-item
+          v-if="tenantId == 1"
           label="乐器置换可售分部"
           prop="replacementShowOrganId"
           :label-width="formLabelWidth"
@@ -959,7 +977,7 @@ v-if="routeShopStatus"
             style="width: 400px !important"
             multiple
             clearable
-             :disabled="addDisabled"
+            :disabled="addDisabled"
           >
             <el-option
               v-for="item in selects.branchs"
@@ -986,10 +1004,14 @@ v-if="routeShopStatus"
             :disabled="addDisabled"
             :imageHeightM="400"
           ></upload> -->
-          <image-cropper :options="cropperOptions" :disabled="addDisabled" :imgSize="2" :imageUrl="form.image"  @crop-upload-success="cropSuccess" />
-          <p style="color: red">
-            请上传大小2M以内,格式为jpg、png、gif图片
-          </p>
+          <image-cropper
+            :options="cropperOptions"
+            :disabled="addDisabled"
+            :imgSize="2"
+            :imageUrl="form.image"
+            @crop-upload-success="cropSuccess"
+          />
+          <p style="color: red">请上传大小2M以内,格式为jpg、png、gif图片</p>
         </el-form-item>
         <br />
         <el-form-item
@@ -1046,7 +1068,7 @@ import { getToken, getTenantId } from "@/utils/auth";
 import { goodsType } from "@/utils/searchArray";
 import load from "@/utils/loading";
 import { permission } from "@/utils/directivePage";
-import ImageCropper from '@/components/ImageCropper'
+import ImageCropper from "@/components/ImageCropper";
 // import courseEvaluateVue from '@/views/teamDetail/componentCourse/courseEvaluate.vue';
 let validPrice = (rule, value, callback) => {
   if ((value == "" && typeof value == "string") || value == null) {
@@ -1073,7 +1095,7 @@ export default {
     pagination,
     Tooltip,
     Upload,
-    ImageCropper
+    ImageCropper,
   },
   name: "shopList",
   data() {
@@ -1098,15 +1120,15 @@ export default {
         musicGroupShow: null,
         courseViewType: null,
         replacementShow: null,
-        courseFeeShowOrganId:null,
-        educationShowOrganId:null,
-        memberFeeShowOrganId:null,
-        replacementShowOrganId:null,
-        studentShowOrganId:null
+        courseFeeShowOrganId: null,
+        educationShowOrganId: null,
+        memberFeeShowOrganId: null,
+        replacementShowOrganId: null,
+        studentShowOrganId: null,
       },
       headers: {
         Authorization: getToken(),
-        tenantId: getTenantId()
+        tenantId: getTenantId(),
       },
       searchLsit: [],
       tableList: [],
@@ -1318,21 +1340,21 @@ export default {
         ],
       },
       selectGoodsList: [],
-      tenantId:'',
+      tenantId: "",
       cropperOptions: {
         autoCrop: true, //是否默认生成截图框
         autoCropWidth: 300, //默认生成截图框宽度
         autoCropHeight: 300, //默认生成截图框高度
         fixedBox: true, //是否固定截图框大小 不允许改变
         previewsCircle: false, //预览图是否是圆形
-        title: '商品图片', //模态框上显示的标题
+        title: "商品图片", //模态框上显示的标题
       },
     };
   },
-async  mounted() {
+  async mounted() {
     // 获取分部
-    this.tenantId = this.$helpers.tenantId
-  await  this.$store.dispatch("setBranchs");
+    this.tenantId = this.$helpers.tenantId;
+    await this.$store.dispatch("setBranchs");
     this.init();
   },
   methods: {
@@ -1522,7 +1544,6 @@ async  mounted() {
     onShopOperation(type, row) {
       // 添加或修改
 
-
       let params = {
         type: type,
       };
@@ -1539,7 +1560,7 @@ async  mounted() {
       ) {
         this.routeShopStatus = true;
 
-        let form =this.form ;
+        let form = this.form;
         for (let i in form) {
           form[i] = row[i];
         }
@@ -1727,9 +1748,15 @@ async  mounted() {
           if (form.replacementShowOrganId) {
             form.replacementShowOrganId = form.replacementShowOrganId.join(",");
           }
-          if(!form.studentShowOrganId&&!form.educationShowOrganId&&!form.courseFeeShowOrganId&&!form.courseFeeShowOrganId&&!form.replacementShowOrganId){
-            this.$message.error('请至少选择一个可见分部')
-            return
+          if (
+            !form.studentShowOrganId &&
+            !form.educationShowOrganId &&
+            !form.courseFeeShowOrganId &&
+            !form.courseFeeShowOrganId &&
+            !form.replacementShowOrganId
+          ) {
+            this.$message.error("请至少选择一个可见分部");
+            return;
           }
           form.goodsList = null;
           if (this.addType == "create" || this.addType == "copy") {
@@ -1810,8 +1837,8 @@ async  mounted() {
 };
 </script>
 <style lang="scss" scoped>
-.el-table__fixed-right{
-  height: 100%!important;
+.el-table__fixed-right {
+  height: 100% !important;
 }
 .alert {
   margin-bottom: 22px;
@@ -1836,5 +1863,4 @@ async  mounted() {
     margin-right: 4px;
   }
 }
-
 </style>