xiaodai2017 1 rok temu
rodzic
commit
fd408374e7

+ 0 - 1
src/views/operate/account/index.vue

@@ -143,7 +143,6 @@
         </template>
         <template #operation="{ scope }">
           <el-tooltip
-            v-if="powers.some((i) => i == '007')"
             effect="dark"
             content="详情"
             placement="top"

+ 367 - 0
src/views/operate/shop/addEdit.vue

@@ -0,0 +1,367 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="10vh"
+    width="900px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin-top: -20px">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            v-loading="loading"
+            :model="ruleForm"
+            status-icon
+            size="small"
+            :rules="rulesThis"
+            label-width="60px"
+            class="supplierAdd"
+          >
+            <el-row>
+              <el-col :span="24">
+                <el-divider content-position="left">店铺信息:</el-divider></el-col
+              >
+              <el-col :span="8">
+                <el-form-item label="类型" prop="type_id">
+                  <el-select
+                    v-model="ruleForm.type_id"
+                    style="width: 100%"
+                    :disabled="isDetail"
+                    placeholder="类型"
+                  >
+                    <el-option
+                      v-for="item in storeTypeOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                      :disabled="Number(item.status) === 0"
+                    />
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="主图" prop="store_image" class="activity-upload">
+                  <div v-if="ruleForm.store_image" class="img-find">
+                    <img
+                      v-viewer
+                      :src="ruleForm.store_image"
+                      class="avatar hover fl"
+                      style="width: 40px; height: 40px"
+                    />
+                    <i class="el-icon-close img-close" />
+                    <!-- <el-link
+              v-if="type !== 'view'"
+              class="fl"
+              :underline="false"
+              type="warning"
+              style="margin: 0 0 0 16px"
+              @click="deleteimg()"
+            >删除</el-link> -->
+                  </div>
+                  <div v-else class="btnupload" style="position: relative">
+                    <i class="el-icon-plus avatar-uploader-icon" />
+                    <file-upload
+                      v-if="type !== 'view'"
+                      class="Upload"
+                      :disabled="isDetail"
+                      :accept="'.jpg,.png,.jpeg'"
+                      :multiple="true"
+                      :uploadcondition="beforeAvatarUpload"
+                      @UploadErrorEvent="imgUploadError"
+                      @UploadSuccessEvent="UploadSuccessEvent"
+                    />
+                  </div>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="供应商" prop="supplier_code" label-width="75px">
+                  <el-select
+                    v-model="ruleForm.supplier_code"
+                    style="width: 100%"
+                    :disabled="isDetail"
+                    placeholder="供应商"
+                  >
+                    <el-option
+                      v-for="item in supplierOptions"
+                      :key="item.code"
+                      :label="item.name"
+                      :value="item.code"
+                      :disabled="Number(item.status) === 0"
+                    />
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="名称" prop="store_name" label-width="75px">
+                  <el-input
+                    v-model="ruleForm.store_name"
+                    style="width: 100%"
+                    :disabled="isDetail"
+                    placeholder="店铺名称"
+                  />
+                </el-form-item>
+                <el-form-item label="地址" prop="store_addr" label-width="75px" >
+                  <el-input
+                    v-model="ruleForm.store_addr"
+                    :disabled="isDetail"
+                    placeholder="地址"
+                    maxlength="200"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-divider content-position="left">店铺联系人:</el-divider></el-col
+              >
+              <el-col :span="5">
+                <el-form-item label="姓名" prop="contactor">
+                  <el-input
+                    v-model="ruleForm.contactor"
+                    :disabled="isDetail"
+                    placeholder="姓名"
+                    maxlength="20"
+                  /> </el-form-item
+              ></el-col>
+              <el-col :span="5">
+                <el-form-item label="职位" prop="position">
+                  <el-input
+                    v-model="ruleForm.position"
+                    :disabled="isDetail"
+                    placeholder="职位"
+                    maxlength="20"
+                  /> </el-form-item
+              ></el-col>
+              <el-col :span="6">
+                <el-form-item label="电话" prop="mobile">
+                  <el-input
+                    v-model="ruleForm.mobile"
+                    :disabled="isDetail"
+                    placeholder="电话"
+                    maxlength="11"
+                  /> </el-form-item
+              ></el-col>
+              <el-col :span="8">
+                <el-form-item label="邮箱" prop="email">
+                  <el-input
+                    v-model="ruleForm.email"
+                    :disabled="isDetail"
+                    placeholder="邮箱"
+                    maxlength="50"
+                  /> </el-form-item
+              ></el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="24" class="bottom-btn tr">
+          <el-button v-if="!isDetail" type="primary" @click="submitForm" :size="'mini'"
+            >保 存
+          </el-button>
+          <el-button @click="showModelThis = false" :size="'mini'">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/operate/shop";
+import asyncRequestStoreType from "@/apis/service/serviceParam/storeType";
+import asyncRequestSupplier from "@/apis/service/operate/supplier";
+import { formItem, rules, parmValue } from "./columns";
+
+export default {
+  name: "shop",
+  props: ["showModel", "id", "isDetail", "sitem"],
+
+  data() {
+    return {
+      parmValue,
+      loading: false,
+      storeTypeOptions: [],
+      supplierOptions: [],
+      title: "添加供应商店铺",
+      showModelThis: this.showModel,
+      ruleForm: {},
+      rules,
+      rulesThis: this.rules,
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  mounted() {
+    this.ruleForm = {
+      ...formItem,
+    };
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      if (this.id === "add") {
+        this.title = "添加供应商店铺";
+        this.rulesThis = this.rules;
+      } else {
+        if (this.isDetail) {
+          this.title = "供应商店铺详情";
+          this.rulesThis = {};
+        } else {
+          this.title = "修改供应商店铺";
+          this.rulesThis = this.rules;
+        }
+      }
+      await this.resetForm();
+      await this.searchTypeList();
+      await this.searchSupplierList();
+      this.loading = false;
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          if (this.sitem && this.sitem.id) {
+            const { email, password, username, nickname, mobile, id } = this.sitem;
+            this.ruleForm = {
+              id,
+              email: email || "",
+              password: password || "",
+              username: username || "",
+              nickname: nickname || "",
+              mobile: mobile || "",
+            };
+          } else {
+            this.ruleForm = {
+              ...formItem,
+            };
+          }
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (!this.loading) {
+            this.loading = true;
+            const { username, nickname, password, mobile, email, id } = JSON.parse(
+              JSON.stringify(this.ruleForm)
+            );
+
+            const model = {
+              password,
+              nickname,
+              username,
+              mobile,
+              email,
+              id,
+            };
+
+            let res = {};
+            if (this.id === "add") {
+              delete model["id"];
+              res = await asyncRequest.register(model);
+            } else {
+              res = await asyncRequest.update(model);
+            }
+            this.loading = false;
+            if (res && res.code === 1) {
+              const title = this.id === "add" ? "添加成功" : "修改成功";
+              this.$notify.success({
+                title,
+                message: "",
+              });
+              this.showModelThis = false;
+              // 刷新
+              this.$emit("refresh");
+            }
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    // 刷新表格
+    async searchTypeList() {
+      const { code, data } = await asyncRequestStoreType.list(this.parmValue);
+      this.storeTypeOptions = code === 1 ? data.list : [];
+    },
+    // 刷新表格
+    async searchSupplierList() {
+      const { code, data } = await asyncRequestSupplier.list(this.parmValue);
+      this.supplierOptions = code === 1 ? data.list : [];
+    },
+    deleteimg() {
+      this.ruleForm.store_image = "";
+      this.$refs.ruleForm.validateField("store_image");
+    },
+
+    // 图片上传成功
+    async UploadSuccessEvent(data) {
+      const { url } = data;
+      if (url === "noToken") {
+        await this.logout();
+      } else {
+        this.ruleForm.store_image = url;
+        this.$refs.ruleForm.validateField("store_image");
+        this.$message.success("图片上传成功!");
+      }
+    },
+
+    // 图片上传失败
+    imgUploadError(res) {
+      if (res !== "break") {
+        this.$message.error("图片上传失败!");
+        this.$refs.ruleForm.validateField("store_image");
+      }
+    },
+    // 判断图片规格
+    beforeAvatarUpload(file) {
+      let isJPG = false;
+      if (
+        file.type === "image/jpg" ||
+        file.type === "image/png" ||
+        file.type === "image/jpeg"
+      ) {
+        isJPG = true;
+      }
+      const isLt2M = file.size / 1024 / 1024 < 1;
+      if (!isJPG) {
+        this.$message.error("图片格式不正确!");
+      }
+      if (!isLt2M) {
+        this.$message.error("图片大小不能超过 1MB!");
+      }
+      return isJPG && isLt2M;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.account {
+  .bottom-btn {
+    position: absolute;
+    bottom: 0px;
+    right: 0;
+    text-align: right;
+    z-index: 2;
+  }
+}
+</style>

+ 62 - 208
src/views/operate/shop/columns.js

@@ -1,209 +1,66 @@
-//曾举办活动
-const activityColumns = [
-  {
-    prop:'hdmc',
-    label:'活动名称',
-    type:'text'
-  }
-]
-
-const activityRules = {}
-
-//详情图片
-const pictureColumns = [
-  {
-    prop:'index',
-    label:'顺序',
-    type:'index'
-  },
-  {
-    prop:'tpmz',
-    label:'图片名称',
-    type:'text'
-  },
-  {
-    prop:'tp',
-    label:'图片',
-    type:'image'
-  }
-]
-
-const pictureRules = {}
-
-// 会议室
-const conferenceColumns = [
-  {
-    prop:'index',
-    label:'顺序',
-    type:'index'
-  },
-  {
-    prop:'zt',
-    label:'主图',
-    type:'image'
-  },
-  {
-    prop:'hys',
-    label:'会议室名称',
-    type:'text'
-  },
-  {
-    prop:'mj',
-    type:'number',
-    label:'面积(m²)',
-    otherProps:{
-      append:"",
-      precision:0
-    }
-  },
-  {
-    prop:'cd',
-    type:'number',
-    label:'长度(m)',
-    otherProps:{
-      append:"",
-      precision:1
-    }
-  },
-  {
-    type:'number',
-    prop:"rs",
-    label:'最高容纳人数(人)',
-    otherProps:{
-      append:"",
-      precision:0
-    }
-  },
-  {
-    prop:"ck",
-    type:'number',
-    label:'参考价',
-    otherProps:{
-      append:"",
+import {
+  isMobile,
+  validEmail,
+} from "@/utils/validate";
+const validatemobile = (rule, value, callback) => {
+  if (value === "") {
+    callback(new Error("手机号不能为空!"));
+  } else {
+    if (!isMobile(value)) {
+      callback(new Error("手机号格式不正确!"));
+    } else {
+      callback();
     }
   }
-]
+};
 
-const conferenceRules = {}
-
-
-//客房
-const guestColumns = [
-  {
-    prop:'index',
-    label:'顺序',
-    type:'index'
-  },
-  {
-    prop:'zt',
-    label:'主图',
-    type:'image'
-  },
-  {
-    prop:'kfmc',
-    label:'客房名称',
-    type:'text'
-  },
-  {
-    prop:'mj',
-    type:'number',
-    label:'面积(m²)',
-    otherProps:{
-      append:"",
-      precision:0
-    }
-  },
-  {
-    prop:'sfyc',
-    type:'是否用窗',
-    label:'长度(m)',
-    otherProps:{
-      append:"",
-      precision:1
-    }
-  },
-  {
-    type:'wl',
-    prop:"网络",
-    label:'网络',
-    otherProps:{
-      append:"",
-      precision:0
-    }
-  },
-  {
-    prop:"sl",
-    type:'number',
-    label:'数量(间)',
-    otherProps:{
-      append:"",
-      precision:0,
-    }
-  },
-  {
-    prop:"ckj",
-    type:'number',
-    label:'参考价',
-    otherProps:{
-      append:"",
+const validateEmail = (rule, value, callback) => {
+  if (value === "") {
+    callback(new Error("邮箱不能为空!"));
+  } else {
+    if (!validEmail(value)) {
+      callback(new Error("邮箱格式不正确!"));
+    } else {
+      callback();
     }
   }
-]
-
-const guestRules = {}
-
-
-//会议服务
-const serviceColumns = [
-  {
-    prop:'index',
-    label:'顺序',
-    type:'index'
-  },
-  {
-    prop:'zt',
-    label:'主图',
-    type:'image'
-  },
-  {
-    prop:'szmc',
-    label:'设置名称',
-    type:'text'
-  },
-  {
-    prop:'dw',
-    label:'单位',
-    type:'text'
-  },
-  {
-    prop:'ckj',
-    label:'参考价',
-    type:'number'
-  },
-  {
-    prop:'bz',
-    label:'备注',
-    type:'text'
-  }
-]
+};
+const rules = {
+  supplier_code: [
+    { required: true, message: "请选择供应商", trigger: "change" },
+  ],
+  store_name: [
+    { required: true, message: "请输入门店名称", trigger: "change" },
+  ],
+  type_id: [{ required: true, message: "请选择门店类型", trigger: "change" }],
+  store_image: [
+    { required: true, message: "请上传门店主图", trigger: "change" },
+  ],
+  contactor: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
+  mobile: [{ required: true, validator: validatemobile, trigger: "blur" }],
+  email: [{ required: true, validator: validateEmail, trigger: "blur" }],
+  position: [{ required: true, message: "职位不能为空", trigger: "blur" }],
+  store_addr: [
+    { required: true, message: "店铺地址不能为空", trigger: "blur,change" },
+  ],
+};
 
-const serviceRules = {}
-const formItem={
-  storeName: "测试店铺",
-  storeType: "",
-  storeImage: "http://hwpro.test241.wanyuhengtong.com/storage/default/20230607/6c4b040420fb5a1d01837d0f120d60ec5c92ea62.jpg",
-  storeAddr: [115.70340104103089, 39.40107657164336],
-  addrs:'顺义区',
-  // contactor:"",
-  // mobile:"",
-  // email:"",
-  // position:"",
+const formItem = {
+  id: "",
+  supplier_code: "QS20230605170528",
+  type_id: 34,
+  store_name: "测试店铺",
+  store_image:
+    "http://hwpro.test241.wanyuhengtong.com/storage/default/20230607/6c4b040420fb5a1d01837d0f120d60ec5c92ea62.jpg",
+  map_addr: [115.70340104103089, 39.40107657164336],
+  store_addr: "顺义区",
+  store_city: ["010000", "010000", "010000"],
   contactor: "张三",
   mobile: "17777777777",
   email: "11@qq.com",
   position: "经理",
-}
-const columns= [
+};
+const columns = [
   {
     prop: "code",
     label: "编号",
@@ -254,18 +111,15 @@ const columns= [
     _slot_: "operation",
   },
 ];
+const parmValue = {
+  page: 1, // 页码
+  size: 999999, // 每页显示条数
+  limit: 999999,
+};
 
 export {
-  pictureColumns,
-  pictureRules,
-  conferenceColumns,
-  conferenceRules,
-  guestColumns,
-  guestRules,
-  serviceColumns,
-  serviceRules,
-  activityRules,
-  activityColumns,
   formItem,
-  columns
-}
+  columns,
+  rules,
+  parmValue,
+};

+ 0 - 597
src/views/operate/shop/components/baseForm.vue

@@ -1,597 +0,0 @@
-<template>
-  <el-form
-    ref="ruleForm"
-    v-loading="loading"
-    :model="ruleForm"
-    status-icon
-    :rules="rulesThis"
-    label-width="90px"
-    class="supplierAdd"
-  >
-    <el-row>
-      <el-col :span="24">
-        <div class="supplierAdd-title">基础信息</div>
-      </el-col>
-      <el-col :span="24" class="clear">
-        <div class="supplierAdd-title-left fl">
-          <el-form-item
-            label="门店主图"
-            prop="storeImage"
-            :disabled="id == 'view'"
-            class="activity-upload"
-          >
-            <div v-if="ruleForm.storeImage" class="img-find">
-              <img
-                v-viewer
-                :src="ruleForm.storeImage"
-                class="avatar hover fl"
-                style="width: 40px; height: 40px"
-              />
-              <i class="el-icon-close img-close" />
-              <!-- <el-link
-              v-if="type !== 'view'"
-              class="fl"
-              :underline="false"
-              type="warning"
-              style="margin: 0 0 0 16px"
-              @click="deleteimg()"
-            >删除</el-link> -->
-            </div>
-            <div v-else class="btnupload" style="position: relative">
-              <i class="el-icon-plus avatar-uploader-icon" />
-              <file-upload
-                v-if="type !== 'view'"
-                class="Upload"
-                :disabled="id == 'view'"
-                :accept="'.jpg,.png,.jpeg'"
-                :multiple="true"
-                :uploadcondition="beforeAvatarUpload"
-                @UploadErrorEvent="imgUploadError"
-                @UploadSuccessEvent="UploadSuccessEvent"
-              />
-            </div>
-          </el-form-item>
-        </div>
-        <div class="supplierAdd-title-right fr">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="供应商" prop="supplier">
-                <el-select
-                  v-model="ruleForm.supplier"
-                  style="width: 100%"
-                  :disabled="type !== 'add' && type !== 'edit'"
-                  placeholder="供应商"
-                >
-                  <el-option
-                    v-for="item in supplierOptions"
-                    :key="item.code"
-                    :label="item.name"
-                    :value="item.code"
-                    :disabled="Number(item.status) === 0"
-                  />
-                </el-select>
-              </el-form-item>
-            </el-col>
-
-            <el-col :span="8">
-              <el-form-item label="门店名称" prop="storeName">
-                <el-input
-                  v-model="ruleForm.storeName"
-                  style="width: 100%"
-                  :disabled="type !== 'add' && type !== 'edit'"
-                  placeholder="门店名称"
-                />
-              </el-form-item>
-            </el-col>
-
-            <el-col :span="8">
-              <el-form-item label="门店类型" prop="storeType">
-                <el-select
-                  v-model="ruleForm.storeType"
-                  style="width: 100%"
-                  :disabled="type !== 'add' && type !== 'edit'"
-                  placeholder="门店类型"
-                >
-                  <el-option
-                    v-for="item in storeTypeOptions"
-                    :key="item.id"
-                    :label="item.name"
-                    :value="item.id"
-                    :disabled="Number(item.status) === 0"
-                  />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">联系人信息</div></el-col>
-      <el-col :span="6">
-        <el-form-item label="姓名" prop="contactor" label-width="75px">
-          <el-input
-            v-model="ruleForm.contactor"
-            :disabled="type !== 'add' && type !== 'edit'"
-            placeholder="姓名"
-            maxlength="20"
-          />
-        </el-form-item>
-      </el-col>
-      <el-col :span="6">
-        <el-form-item label="手机号" prop="mobile" label-width="75px">
-          <el-input
-            v-model="ruleForm.mobile"
-            :disabled="type !== 'add' && type !== 'edit'"
-            placeholder="手机号"
-            maxlength="20"
-          />
-        </el-form-item>
-      </el-col>
-      <el-col :span="6">
-        <el-form-item label="邮箱" prop="email" label-width="75px">
-          <el-input
-            v-model="ruleForm.email"
-            :disabled="type !== 'add' && type !== 'edit'"
-            placeholder="邮箱"
-            maxlength="50"
-          />
-        </el-form-item>
-      </el-col>
-
-      <el-col :span="6">
-        <el-form-item label="职位" prop="position" label-width="75px">
-          <el-input
-            v-model="ruleForm.position"
-            :disabled="type !== 'add' && type !== 'edit'"
-            placeholder="职位"
-            maxlength="20"
-          />
-        </el-form-item>
-      </el-col>
-    </el-row>
-    <el-col :span="24"><div class="supplierAdd-title">门店信息</div></el-col>
-    <el-col :span="24">
-      <el-form-item label="门店地址" prop="storeAddr">
-        <div id="map" />
-      </el-form-item>
-    </el-col>
-    <el-col :span="24" class="flex-end">
-      <el-button type="primary" @click="save" size="mini">保存</el-button>
-    </el-col>
-  </el-form>
-</template>
-<script>
-import asyncRequest from "@/apis/service/operate/shop";
-import asyncRequestStoreType from "@/apis/service/serviceParam/storeType";
-import asyncRequestSupplier from "@/apis/service/operate/supplier";
-import Map from "ol/Map"; //地图初始化
-import * as source from "ol/source";
-import Feature from "ol/Feature";
-import Point from "ol/geom/Point";
-import TileLayer from "ol/layer/Tile";
-import * as olProj from "ol/proj";
-import * as style from "ol/style";
-import * as layer from "ol/layer";
-import "ol/ol.css";
-import View from "ol/View";
-import resToken from "@/mixins/resToken";
-import { formItem } from "../columns";
-import {
-  isLicense,
-  isMobile,
-  isqz,
-  isSpecialSymbol,
-  hasSpace,
-  isAddr,
-  validEmail,
-} from "@/utils/validate";
-
-let key = "4c3306473a0aa048196208f774b491a5";
-
-/***
- * @props
- *  供应商   supplier
- *  门店名称 storeName
- *  门店类型 storeType
- *  门店主图 storeImage
- *  门店地址 storeAddr
- *  姓名 contactor
- *  手机号 mobile
- *  电子邮箱 email
- *  职位 position
- */
-export default {
-  name: "SupplierAdd",
-  mixins: [resToken],
-  props: ["showModel", "id", "type", "sitem"],
-  data() {
-    const validatemobile = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      } else {
-        if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
-        } else {
-          callback();
-        }
-      }
-    };
-    const validateAddr = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("详细地址不能为空!"));
-      } else {
-        if (hasSpace(value)) {
-          callback(new Error("不能出现/回车/换行符!"));
-        } else if (isSpecialSymbol(value)) {
-          callback(new Error("不能使用英文特殊字符!"));
-        } else if (isAddr(value)) {
-          callback();
-        } else {
-          callback(new Error("详细地址填写不规范!"));
-        }
-      }
-    };
-    const validateEmail = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("邮箱不能为空!"));
-      } else {
-        if (!validEmail(value)) {
-          callback(new Error("邮箱格式不正确!"));
-        } else {
-          callback();
-        }
-      }
-    };
-    return {
-      parmValue: {
-        page: 1, // 页码
-        size: 99999, // 每页显示条数
-        limit: 99999,
-      },
-      map: null,
-      feature: null,
-      loading: false,
-      hand_name: "",
-      storeTypeOptions: [],
-      supplierOptions: [],
-      title: "添加供应商",
-      showModelThis: this.showModel,
-      ruleForm: {},
-      rulesThis: this.rules,
-      rules: {
-        supplier: [{ required: true, message: "请选择供应商", trigger: "change" }],
-        storeName: [{ required: true, message: "请输入门店名称", trigger: "change" }],
-        storeType: [{ required: true, message: "请选择门店类型", trigger: "change" }],
-        storeImage: [{ required: true, message: "请上传门店主图", trigger: "change" }],
-        storeAddr: [
-          {
-            required: true,
-            message: "请选择门店地址",
-            trigger: "change",
-            validator(rule, value, callback) {
-              console.log(value);
-              if (
-                (!Array.isArray(value) && !value) ||
-                (Array.isArray(value) && value.length === 0)
-              ) {
-                callback(new Error("门店地址不能为空!"));
-              } else {
-                callback();
-              }
-            },
-          },
-        ],
-        contactor: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
-        mobile: [{ required: true, validator: validatemobile, trigger: "blur" }],
-        email: [{ required: true, validator: validEmail, trigger: "blur" }],
-        position: [{ required: true, message: "职位不能为空", trigger: "blur" }],
-      },
-    };
-  },
-  mounted() {
-    this.initMap();
-    this.registerMapEvent();
-    this.initForm();
-  },
-  methods: {
-    initMap() {
-      this.map = new Map({
-        layers: [
-          new TileLayer({
-            source: new source.XYZ({
-              url:
-                "http://t{0-7}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=" +
-                key,
-            }),
-          }),
-          new TileLayer({
-            source: new source.XYZ({
-              url:
-                "http://t3.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=" + key,
-            }),
-          }),
-        ],
-        target: "map",
-        view: new View({
-          projection: "EPSG:4326",
-          center: [115.7, 39.4],
-          zoom: 16,
-        }),
-      });
-
-      const iconFeature = new Feature();
-      const feature = new Feature({
-        geometry: new Point([0, 0]),
-      });
-
-      feature.setStyle(this.createLabelStyle());
-
-      const vectorSource = new source.Vector({
-        features: [iconFeature, feature],
-      });
-      const vectorLayer = new layer.Vector({
-        source: vectorSource,
-      });
-
-      this.feature = feature;
-      this.map.addLayer(vectorLayer);
-    },
-    createLabelStyle() {
-      return new style.Style({
-        image: new style.Icon({
-          anchor: [95, 45],
-          scale: 0.2, // 图标缩小显示
-          anchorOrigin: "bottom-right", // 标注样式的起点位置
-          anchorXUnits: "pixels", // X方向单位:分数
-          anchorYUnits: "pixels", // Y方向单位:像素
-          offsetOrigin: "bottom-left", // 偏移起点位置的方向
-          opacity: 1, // 透明度
-          src: "dian.png", //图标的URL
-        }),
-        text: new style.Text({
-          textAlign: "center", //位置
-          textBaseline: "middle", //基准线
-          font: "normal 14px 微软雅黑", //文字样式
-          fill: new style.Fill({
-            //文本填充样式(即文字颜色)
-            color: "#000",
-          }),
-          stroke: new style.Stroke({
-            color: "#F00",
-            width: 2,
-          }),
-        }),
-      });
-    },
-    registerMapEvent() {
-      this.map.on("click", (evt) => {
-        const { coordinate } = evt;
-        this.ruleForm.storeAddr = [...coordinate];
-        this.feature.set("geometry", new Point(coordinate));
-      });
-    },
-    async initForm() {
-      this.hand_name = "";
-      this.loading = true;
-      await this.searchTypeList();
-      await this.searchSupplierList();
-      this.resetFormData();
-      this.rulesThis = this.rules;
-      await this.resetForm();
-      this.loading = false;
-    },
-    async resetForm() {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.resetFormData();
-        }
-      });
-    },
-    resetFormData() {
-      this.ruleForm = {
-        ...formItem,
-      };
-      if (this.sitem) {
-        const {
-          id,
-          code,
-          supplier,
-          storeName,
-          type,
-          category,
-          delivery_way,
-          supplier_type,
-          level,
-          pay_type,
-          storeImage,
-          prove_img,
-          contactor,
-          mobile,
-          position,
-          registercode,
-          name,
-          nature,
-          addr,
-          legaler,
-          registertime,
-          scope,
-          personid,
-          person,
-          telephone,
-          email,
-        } = this.sitem;
-        this.hand_name = person || "";
-      }
-    },
-    closeImg(index) {
-      this.ruleForm.prove_img.splice(index, 1);
-      this.$refs.ruleForm.validateField("prove_img");
-    },
-    // 刷新表格
-    async searchTypeList() {
-      const { code, data } = await asyncRequestStoreType.list(this.parmValue);
-      this.storeTypeOptions = code === 1 ? data.list : [];
-    },
-    // 刷新表格
-    async searchSupplierList() {
-      const { code, data } = await asyncRequestSupplier.list(this.parmValue);
-      this.supplierOptions = code === 1 ? data.list : [];
-    },
-    async save() {
-      console.log(111);
-      await this.$refs.ruleForm.validate(async (valid) => {
-        console.log(valid);
-        if (valid) {
-          console.log(this.ruleForm);
-        }
-      });
-      // try {
-
-      //   await this.$refs.ruleForm.validate();
-      //   console.log(this.ruleForm);
-      //   //TODO....
-      // } catch (err) {
-      //   console.log(err);
-      // }
-    },
-    deleteimg() {
-      this.ruleForm.storeImage = "";
-      this.$refs.ruleForm.validateField("storeImage");
-    },
-
-    // 图片上传成功
-    async UploadSuccessEvent(data) {
-      const { url } = data;
-      if (url === "noToken") {
-        await this.logout();
-      } else {
-        this.ruleForm.storeImage = url;
-        this.$refs.ruleForm.validateField("storeImage");
-        this.$message.success("图片上传成功!");
-      }
-    },
-
-    // 图片上传失败
-    imgUploadError(res) {
-      if (res !== "break") {
-        this.$message.error("图片上传失败!");
-        this.$refs.ruleForm.validateField("storeImage");
-      }
-    },
-    // 判断图片规格
-    beforeAvatarUpload(file) {
-      let isJPG = false;
-      if (
-        file.type === "image/jpg" ||
-        file.type === "image/png" ||
-        file.type === "image/jpeg"
-      ) {
-        isJPG = true;
-      }
-      const isLt2M = file.size / 1024 / 1024 < 1;
-      if (!isJPG) {
-        this.$message.error("图片格式不正确!");
-      }
-      if (!isLt2M) {
-        this.$message.error("图片大小不能超过 1MB!");
-      }
-      return isJPG && isLt2M;
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.supplierAdd {
-  .good_info_img_div {
-    ul {
-      width: 100%;
-      li {
-        float: left;
-        width: 55px;
-        height: 55px;
-        padding: 0 5px 0 0;
-        .img-show-li-div {
-          width: 50px;
-          height: 50px;
-          border: 1px solid #dfe4ed;
-          background: #dfe4ed;
-          position: relative;
-          img.img-show {
-            width: 100%;
-            height: 100%;
-            position: relative;
-            display: inline-block;
-          }
-          i.el-icon-close {
-            position: absolute;
-            z-index: 2;
-            top: 0;
-            right: 0;
-            color: #dfe4ed;
-          }
-          &:hover {
-            i.el-icon-close {
-              cursor: pointer;
-              color: #6954f0;
-            }
-          }
-        }
-      }
-    }
-  }
-  .supplierAdd-title {
-    border-left: 5px solid #006eff;
-    margin: 6px 0 25px 10px;
-    width: 100%;
-    box-sizing: border-box;
-    padding: 0 0 0 10px;
-  }
-  .supplierAdd-title-left {
-    width: 120px;
-    .btnupload {
-      width: 40px;
-      height: 40px;
-      line-height: 40px;
-    }
-    .avatar-uploader-icon {
-      width: 40px;
-      height: 40px;
-      line-height: 40px;
-    }
-    .img-find {
-      position: relative;
-      width: 40px;
-      height: 40px;
-      line-height: 40px;
-      &:hover {
-        .img-close {
-          color: #409eff;
-        }
-      }
-    }
-    .img-close {
-      position: absolute;
-      top: 0;
-      right: 0;
-      z-index: 999999;
-      &:hover {
-        cursor: pointer;
-      }
-    }
-  }
-  .supplierAdd-title-right {
-    width: calc(100% - 120px);
-  }
-}
-
-#map {
-  width: 100%;
-  height: 400px;
-
-  cursor: pointer;
-}
-</style>

+ 0 - 222
src/views/operate/shop/detail.vue

@@ -1,222 +0,0 @@
-<template>
-  <div class="supplierDetail">
-    <div class="supplierDetail-main" v-if="powers.some((i) => i == '001')">
-      <el-tabs v-model="activeTabs">
-        <el-tab-pane :label="'新建' + title" name="0" v-if="queryType === 'add'">
-          <base-form
-            v-if="newTime !== ''"
-            :type="queryType"
-            :id="queryId"
-            :newTime="newTime"
-            :sitem="sitem"
-            @refresh="refresh"
-          />
-        </el-tab-pane>
-        <el-tab-pane :label="title + '详情'" name="1" v-if="queryType !== 'add'">
-          <base-form
-            v-if="newTime !== ''"
-            :type="queryType"
-            :id="queryId"
-            :newTime="newTime"
-            :sitem="sitem"
-            @refresh="refresh"
-          />
-        </el-tab-pane>
-      </el-tabs>
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
-</template>
-<script>
-import asyncRequest from "@/apis/service/operate/shop";
-import resToken from "@/mixins/resToken";
-import { mapGetters } from "vuex";
-import baseForm from "./components/baseForm";
-export default {
-  name: "shopDetail",
-  mixins: [resToken],
-  components: {
-    baseForm,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      const tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "shopDetail") || {};
-      const { action } = tran ?? {};
-      return action ?? [];
-    },
-  },
-
-  data() {
-    return {
-      title: "供应商店铺",
-      size: "small",
-      activeTabs: "1",
-      activeNames: ["0", "1"],
-      editColumns: [
-        {
-          prop: "code",
-          label: "供应商编号",
-          span: 6,
-        },
-        {
-          prop: "status",
-          label: "使用状态",
-          _slot_: "status",
-          span: 4,
-        },
-        {
-          prop: "ocr_status",
-          label: "执照识别状态",
-          _slot_: "ocr_status",
-          span: 5,
-        },
-
-        {
-          prop: "creater",
-          label: "创建人",
-          span: 4,
-        },
-        {
-          prop: "addtime",
-          label: "创建时间",
-          span: 5,
-        },
-      ],
-      ocr_status: [
-        { id: "0", label: "未上传" },
-        { id: "1", label: "识别成功" },
-        { id: "2", label: "识别失败" },
-      ],
-      newTime: "",
-      loading: false,
-      queryType: "",
-      queryId: "",
-      status: "",
-      sitem: null,
-    };
-  },
-  mounted() {
-    this.initForm();
-  },
-  methods: {
-    async initForm() {
-      const { id, type } = this.$route.query;
-      this.queryId = id;
-      this.queryType = type;
-      this.activeTabs = type === "add" ? "0" : "1";
-      this.loading = true;
-      if (this.queryType === "add") {
-        this.sitem = {};
-        this.getNewTime();
-      } else {
-        await this.initData();
-      }
-
-      this.loading = false;
-    },
-    // 点击业务审核的保存按钮
-
-    // async examForm(e) {
-    //   console.log(e);
-    //   if (!this.loading) {
-    //     let type = e.state === "1" ? "1" : e.rebut;
-    //     await this.setstatus(type, "提交采购部门审核", e.remark);
-    //   }
-    // },
-    async setstatus(type, detail, remark) {
-      await this.$confirm(`确定要${detail}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          let _model = {
-            spuCode: this.queryId,
-            status: type,
-            remark: remark,
-          };
-          let res = await asyncRequest.status(_model);
-          if (res && res.code === 1) {
-            this.$notify.success({
-              title: "提交成功!",
-              message: "",
-            });
-            await this.initForm();
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-    handleClick(row) {
-      console.log(row);
-    },
-    async refresh(e) {
-      this.routeReGoto("supplier", {});
-    },
-    async initData() {
-      this.loading = true;
-      const { code, data } = await asyncRequest.detail({
-        code: this.queryId,
-      });
-      this.loading = false;
-      if (code === 1) {
-        this.sitem = JSON.parse(JSON.stringify(data));
-        const { status } = this.sitem;
-        this.status = status;
-        this.getNewTime();
-      }
-    },
-    getNewTime() {
-      this.newTime = new Date().valueOf();
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-.supplierDetail {
-  position: relative;
-  height: 100%;
-  width: 100%;
-  box-sizing: border-box;
-  .supplierDetail-main {
-    position: relative;
-    padding: 10px;
-    height: 100%;
-    width: 100%;
-  }
-  .supplierDetail-title {
-    border-top: 1px solid #ebeef5;
-    span {
-      height: 50px;
-      line-height: 50px;
-      font-family: "微软雅黑", sans-serif;
-      font-weight: 400;
-      font-style: normal;
-      font-size: 16fpx;
-      text-align: left;
-    }
-  }
-  /deep/ .ddiv {
-    border-top: 1px solid #dcdfe6;
-  }
-  /deep/ .dtitle {
-    width: 40px;
-    text-align: center;
-    height: 100%;
-    min-height: 100%;
-    ul {
-      padding: 12px 0 0 0;
-    }
-  }
-  /deep/ .dmain {
-    padding: 20px 0 0 0;
-    width: calc(100% - 40px);
-    border-left: 1px solid #dcdfe6;
-  }
-}
-</style>

+ 38 - 30
src/views/operate/shop/index.vue

@@ -109,7 +109,7 @@
                 :size="searchSize"
                 type="success"
                 style="float: right"
-                @click="routeGoto('shopDetail', { id: 'add', type: 'add' })"
+                @click="openModal('add', false, {})"
               >
                 添加
               </el-button>
@@ -161,20 +161,14 @@
       </template>
 
       <template #operation="{ scope }">
-        <el-tooltip
-          v-if="powers.some((i) => i == '007')"
-          effect="dark"
-          content="详情"
-          placement="top"
-        >
+        <el-tooltip effect="dark" content="详情" placement="top">
           <i
             class="el-icon-view tb-icon"
-            @click="getRouter('shopDetail', scope.row.code)"
+            @click="openModal(scope.row.id, false, scope.row)"
           ></i>
         </el-tooltip>
 
-        <el-tooltip
-          v-if="powers.some((i) => i == '007')"
+        <!-- <el-tooltip
           effect="dark"
           content="店铺装修"
           placement="top"
@@ -183,7 +177,7 @@
             class="el-icon-s-open tb-icon"
             @click="routeGoto('storeDecoration', { id: 'add', type: 'add' })"
           ></i>
-        </el-tooltip>
+        </el-tooltip> -->
 
         <el-tooltip
           v-if="powers.some((i) => i == '005')"
@@ -191,7 +185,10 @@
           content="修改"
           placement="top"
         >
-          <i class="el-icon-edit tb-icon" @click="gotoEdit(scope.row, '005')"></i>
+          <i
+            class="el-icon-edit tb-icon"
+            @click="openModal(scope.row.id, true, scope.row)"
+          ></i>
         </el-tooltip>
         <el-tooltip
           v-if="powers.some((i) => i == '004') && scope.row.status + '' === '1'"
@@ -225,6 +222,14 @@
         </el-tooltip>
       </template>
     </ex-table>
+    <add-edit
+      :id="modelId"
+      :sitem="sitem"
+      :show-model="showModel"
+      :is-detail="isDetail"
+      @refresh="searchList"
+      @cancel="showModel = false"
+    />
   </div>
 </template>
 <script>
@@ -235,7 +240,7 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import { mapGetters } from "vuex";
 import resToken from "@/mixins/resToken";
 import { columns } from "./columns";
-
+import addEdit from "./addEdit";
 /**
  * @props
   createStart //创建开始时间
@@ -248,6 +253,9 @@ import { columns } from "./columns";
 export default {
   name: "shop",
   mixins: [mixinPage, resToken],
+  components: {
+    addEdit,
+  },
   computed: {
     //组件SIZE设置
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
@@ -262,7 +270,7 @@ export default {
     return {
       statusList,
       roleLevel: roleLevel,
-      loading: true,
+      loading: false,
       showModel: false,
       modelId: "",
       modelSitem: null,
@@ -304,19 +312,19 @@ export default {
     };
   },
   mounted() {
-    const { back } = this.$route.query;
-    if (back) {
-      this.parmValue = JSON.parse(back);
-      const { page, size } = this.parmValue;
-      this.pageInfo = {
-        size: size,
-        curr: page,
-        total: 0,
-      };
-      //多选条件
-    } else {
-    }
-    this.searchList();
+    // const { back } = this.$route.query;
+    // if (back) {
+    //   this.parmValue = JSON.parse(back);
+    //   const { page, size } = this.parmValue;
+    //   this.pageInfo = {
+    //     size: size,
+    //     curr: page,
+    //     total: 0,
+    //   };
+    //   //多选条件
+    // } else {
+    // }
+    // this.searchList();
   },
   methods: {
     getRouter(toRouter, queryId) {
@@ -356,11 +364,11 @@ export default {
       };
       this.searchList();
     },
-    openModal(row) {
-      const { id } = row;
+    openModal(id, isDetail, sitem) {
       this.showModel = true;
       this.modelId = id;
-      this.modelSitem = row;
+      this.isDetail = isDetail;
+      this.sitem = sitem;
     },
     // 时间
     async handleTime(e) {

+ 0 - 0
src/views/operate/shop/供应商店铺管理 → src/views/operate/shop/店铺管理


+ 204 - 0
src/views/operate/shopTrim/columns.js

@@ -0,0 +1,204 @@
+//曾举办活动
+const activityColumns = [
+  {
+    prop:'hdmc',
+    label:'活动名称',
+    type:'text'
+  }
+]
+
+const activityRules = {}
+
+//详情图片
+const pictureColumns = [
+  {
+    prop:'index',
+    label:'顺序',
+    type:'index'
+  },
+  {
+    prop:'tpmz',
+    label:'图片名称',
+    type:'text'
+  },
+  {
+    prop:'tp',
+    label:'图片',
+    type:'image'
+  }
+]
+
+const pictureRules = {}
+
+// 会议室
+const conferenceColumns = [
+  {
+    prop:'index',
+    label:'顺序',
+    type:'index'
+  },
+  {
+    prop:'zt',
+    label:'主图',
+    type:'image'
+  },
+  {
+    prop:'hys',
+    label:'会议室名称',
+    type:'text'
+  },
+  {
+    prop:'mj',
+    type:'number',
+    label:'面积(m²)',
+    otherProps:{
+      append:"",
+      precision:0
+    }
+  },
+  {
+    prop:'cd',
+    type:'number',
+    label:'长度(m)',
+    otherProps:{
+      append:"",
+      precision:1
+    }
+  },
+  {
+    type:'number',
+    prop:"rs",
+    label:'最高容纳人数(人)',
+    otherProps:{
+      append:"",
+      precision:0
+    }
+  },
+  {
+    prop:"ck",
+    type:'number',
+    label:'参考价',
+    otherProps:{
+      append:"",
+    }
+  }
+]
+
+const conferenceRules = {}
+
+
+//客房
+const guestColumns = [
+  {
+    prop:'index',
+    label:'顺序',
+    type:'index'
+  },
+  {
+    prop:'zt',
+    label:'主图',
+    type:'image'
+  },
+  {
+    prop:'kfmc',
+    label:'客房名称',
+    type:'text'
+  },
+  {
+    prop:'mj',
+    type:'number',
+    label:'面积(m²)',
+    otherProps:{
+      append:"",
+      precision:0
+    }
+  },
+  {
+    prop:'sfyc',
+    type:'是否用窗',
+    label:'长度(m)',
+    otherProps:{
+      append:"",
+      precision:1
+    }
+  },
+  {
+    type:'wl',
+    prop:"网络",
+    label:'网络',
+    otherProps:{
+      append:"",
+      precision:0
+    }
+  },
+  {
+    prop:"sl",
+    type:'number',
+    label:'数量(间)',
+    otherProps:{
+      append:"",
+      precision:0,
+    }
+  },
+  {
+    prop:"ckj",
+    type:'number',
+    label:'参考价',
+    otherProps:{
+      append:"",
+    }
+  }
+]
+
+const guestRules = {}
+
+
+//会议服务
+const serviceColumns = [
+  {
+    prop:'index',
+    label:'顺序',
+    type:'index'
+  },
+  {
+    prop:'zt',
+    label:'主图',
+    type:'image'
+  },
+  {
+    prop:'szmc',
+    label:'设置名称',
+    type:'text'
+  },
+  {
+    prop:'dw',
+    label:'单位',
+    type:'text'
+  },
+  {
+    prop:'ckj',
+    label:'参考价',
+    type:'number'
+  },
+  {
+    prop:'bz',
+    label:'备注',
+    type:'text'
+  }
+]
+
+const serviceRules = {}
+
+
+export {
+  pictureColumns,
+  pictureRules,
+  conferenceColumns,
+  conferenceRules,
+  guestColumns,
+  guestRules,
+  serviceColumns,
+  serviceRules,
+  activityRules,
+  activityColumns,
+}

+ 467 - 0
src/views/operate/shopTrim/index.vue

@@ -0,0 +1,467 @@
+<template>
+  <div class="shopTrim pagePadding">
+    <ex-table
+      v-loading="loading"
+      :table="table"
+      :data="tableData"
+      :columns="columns"
+      :page="pageInfo"
+      :size="size"
+      @page-curr-change="handlePageChange"
+      @page-size-change="handleSizeChange"
+      @screen-reset="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+      @screen-submit="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+    >
+      <template #table-header="{}">
+        <div style="width: 100%">
+          <el-row style="padding: 0 0 10px 80px">
+            <el-col :span="6" style="width: 303px">
+              <period-date-picker
+                :type="1"
+                :width="'135px'"
+                :size="searchSize"
+                :start="parmValue.createStart"
+                :end="parmValue.createEnd"
+                @timeReturned="handleTime"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 160px">
+              <el-select
+                v-model="parmValue.status"
+                filterable
+                clearable
+                :size="searchSize"
+                placeholder="状态"
+                style="width: 100%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+              >
+                <el-option
+                  v-for="item in statusList"
+                  :key="'status' + item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-col>
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="primary" :size="searchSize" @click="searchList">
+                刷新
+              </el-button>
+            </el-col>
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="warning" :size="searchSize" @click="restSearch">
+                重置
+              </el-button>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="4" style="width: 333px">
+              <el-input
+                :size="searchSize"
+                v-model="parmValue.supplierName"
+                :maxlength="40"
+                clearable
+                @blur="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+                @clear="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+                placeholder="供应商名称"
+              ></el-input>
+            </el-col>
+            <el-col :span="4" style="width: 120px; padding: 0 0 0 10px">
+              <el-input
+                :size="searchSize"
+                v-model="parmValue.creator"
+                :maxlength="40"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+                placeholder="创建人"
+              ></el-input>
+            </el-col>
+            <el-col
+              :span="3"
+              class="fr"
+              style="width: 66px; padding: 0 0 0 10px"
+              v-if="powers.some((i) => i == '002')"
+            >
+              <el-button
+                :size="searchSize"
+                type="success"
+                style="float: right"
+                @click="routeGoto('shopDetail', { id: 'add', type: 'add' })"
+              >
+                添加
+              </el-button>
+            </el-col>
+          </el-row>
+        </div></template
+      >
+      <template #status="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          :type="scope.row.status == '0' ? 'warning' : ''"
+          v-text="
+            (
+              statusList.find((item) => Number(item.code) == Number(scope.row.status)) ||
+              {}
+            ).name || '--'
+          "
+        ></el-tag>
+      </template>
+      <template #ocr_status="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          :type="
+            scope.row.ocr_status == '0'
+              ? 'info'
+              : scope.row.ocr_status == '1'
+              ? 'primary'
+              : scope.row.ocr_status == '2'
+              ? 'danger'
+              : ''
+          "
+          v-text="
+            (ocr_status.find((item) => item.id == scope.row.ocr_status) || {}).label ||
+            '--'
+          "
+        ></el-tag>
+      </template>
+      <template #is_upgrade="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          :type="scope.row.is_upgrade + '' === '1' ? 'success' : ''"
+          v-text="
+            (
+              is_upgrade_options.find((item) => item.id == scope.row.is_upgrade + '') ||
+              {}
+            ).label || '--'
+          "
+        ></el-tag>
+      </template>
+
+      <template #operation="{ scope }">
+        <el-tooltip effect="dark" content="详情" placement="top">
+          <i
+            class="el-icon-view tb-icon"
+            @click="openModal(scope.row.id, false, scope.row)"
+          ></i>
+        </el-tooltip>
+
+        <!-- <el-tooltip
+          effect="dark"
+          content="店铺装修"
+          placement="top"
+        >
+          <i
+            class="el-icon-s-open tb-icon"
+            @click="routeGoto('storeDecoration', { id: 'add', type: 'add' })"
+          ></i>
+        </el-tooltip> -->
+
+        <el-tooltip
+          v-if="powers.some((i) => i == '005')"
+          effect="dark"
+          content="修改"
+          placement="top"
+        >
+          <i class="el-icon-edit tb-icon"  @click="openModal(scope.row.id, true, scope.row)"></i>
+        </el-tooltip>
+        <el-tooltip
+          v-if="powers.some((i) => i == '004') && scope.row.status + '' === '1'"
+          effect="dark"
+          content="禁用"
+          placement="top"
+        >
+          <i
+            class="el-icon-video-pause tb-icon"
+            @click="changeStatus(scope.row.id, scope.row.status)"
+          ></i>
+        </el-tooltip>
+        <el-tooltip
+          v-if="powers.some((i) => i == '003') && scope.row.status + '' === '0'"
+          effect="dark"
+          content="启用"
+          placement="top"
+        >
+          <i
+            class="el-icon-video-play tb-icon"
+            @click="changeStatus(scope.row.id, scope.row.status)"
+          ></i>
+        </el-tooltip>
+        <el-tooltip
+          v-if="powers.some((i) => i == '006')"
+          effect="dark"
+          content="删除"
+          placement="top"
+        >
+          <i class="el-icon-delete tb-icon" @click="deleteItem(scope.row.id)"></i>
+        </el-tooltip>
+      </template>
+    </ex-table>
+ 
+  </div>
+</template>
+<script>
+import asyncRequest from "@/apis/service/operate/shop";
+import { statusList } from "@/assets/js/statusList";
+import roleLevel from "@/assets/js/roleLevel";
+import mixinPage from "@/mixins/elPaginationHandle";
+import { mapGetters } from "vuex";
+import resToken from "@/mixins/resToken";
+import { columns } from "./columns";
+/**
+ * @props
+  createStart //创建开始时间
+  createEnd   //创建结束时间
+  status //当前状态
+  supplierName  //供应商名称
+  creator //创建人 
+*/
+
+export default {
+  name: "shopTrim",
+  mixins: [mixinPage, resToken],
+  computed: {
+    //组件SIZE设置
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find((item) => item.menu_route == "shopTrim") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      statusList,
+      roleLevel: roleLevel,
+      loading: true,
+      showModel: false,
+      modelId: "",
+      modelSitem: null,
+      stype: {},
+      is_upgrade_options: [
+        { id: "1", label: "已升级" },
+        { id: "0", label: "未升级" },
+      ],
+      parmValue: {
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        createStart: "", //创建开始时间
+        createEnd: "", //创建结束时间
+        status: "", //当前状态
+        supplierName: "", //供应商名称
+        creator: "", //创建人
+      },
+      ocr_status: [
+        { id: "0", label: "未上传" },
+        { id: "1", label: "识别成功" },
+        { id: "2", label: "识别失败" },
+      ],
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns,
+    };
+  },
+  mounted() {
+    const { back } = this.$route.query;
+    if (back) {
+      this.parmValue = JSON.parse(back);
+      const { page, size } = this.parmValue;
+      this.pageInfo = {
+        size: size,
+        curr: page,
+        total: 0,
+      };
+      //多选条件
+    } else {
+    }
+    this.searchList();
+  },
+  methods: {
+    getRouter(toRouter, queryId) {
+      if (toRouter && queryId) {
+        let model = {
+          id: queryId,
+          type: "view",
+        };
+
+        console.log(queryId);
+        let routerModel = {
+          options: JSON.parse(JSON.stringify(this.parmValue)),
+          router: this.$route.path,
+        };
+        model.preModel = JSON.stringify(routerModel);
+
+        this.routeGoto(toRouter, model);
+      } else {
+        this.$message.warning("暂未找到相关流程!");
+      }
+    },
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.parmValue = {
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        createStart: "", //创建开始时间
+        createEnd: "", //创建结束时间
+        status: "", //当前状态
+        supplierName: "", //供应商名称
+        creator: "", //创建人
+      };
+      this.searchList();
+    },
+    openModal(id, isDetail, sitem) {
+      this.showModel = true;
+      this.modelId = id;
+      this.isDetail = isDetail;
+      this.sitem = sitem;
+    },
+    // 时间
+    async handleTime(e) {
+      this.parmValue.createStart = e.startTime || "";
+      this.parmValue.createEnd = e.endTime || "";
+      if (
+        (this.parmValue.createStart !== "" && this.parmValue.createEnd !== "") ||
+        (this.parmValue.createEnd === "" && this.parmValue.createEnd === "")
+      ) {
+        this.pageInfo.curr = 1;
+        this.parmValue.page = 1;
+        await this.searchList();
+      }
+    },
+    gotoEdit(row, type) {
+      const { status } = row;
+      if (type === "005" && status + "" === "1") {
+        this.$message.warning("禁用后,才可以修改!");
+        return;
+      }
+      this.routeGoto("shopDetail", {
+        id: row.code,
+        type: "edit",
+      });
+    },
+    /**
+     * 启用/禁用
+     * @param {String} id id
+     * @param {String} status 0-禁用 1-启用
+     */
+    async changeStatus(id, status) {
+      await this.$confirm(`确定要改为${status + "" === "1" ? "禁用" : "启用"}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            id: id,
+            status: status + "" === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          this.loading = false;
+          if (res && res.code === 1) {
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async deleteItem(id) {
+      await this.$confirm("确定要删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            ids: id,
+          };
+          const res = await asyncRequest.delete(model);
+          if (res && res.code === 1) {
+            this.$notify.success({
+              title: "删除成功",
+              message: "",
+            });
+            this.searchList();
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    // 刷新表格
+    async searchList() {
+      if (
+        (this.parmValue.createStart !== "" && this.parmValue.createEnd === "") ||
+        (this.parmValue.createStart == "" && this.parmValue.createEnd !== "")
+      ) {
+        this.$message.warning("开始时间和结束时间不能为空");
+        return;
+      }
+      this.loading = true;
+      const model = {
+        ...this.parmValue,
+        limit: this.parmValue.size,
+      };
+      const { code, data, msg } = await asyncRequest.list(model);
+      let scode = parseInt(code + "");
+      if (scode === 1) {
+        const { list, total } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(total + "");
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 0 - 0
src/views/operate/shop/storeDecoration.vue → src/views/operate/shopTrim/storeDecoration.vue


+ 0 - 0
src/views/operate/shopTrim/店铺装修