소스 검색

merge main

xiaodai2017 1 년 전
부모
커밋
166eb4dbbe

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

@@ -1,610 +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 style="display:flex">
-          <el-input :value="toponym" />
-          <el-button style="margin-left:10px" type="primary" @click="visible = true">选择地址</el-button>
-        </div>
-      </el-form-item>
-    </el-col>
-    <el-col :span="24" class="flex-end">
-      <el-button type="primary" @click="save" size="mini">保存</el-button>
-    </el-col>
-
-    <map-modal :visible.sync="visible" :toponym="toponym" @save="handleMapSelection" />
-  </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 MapModal from "./mapModal.vue"
-
-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],
-  components:{ MapModal },
-  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 {
-      visible:false,
-      parmValue: {
-        page: 1, // 页码
-        size: 99999, // 每页显示条数
-        limit: 99999,
-      },
-      toponym:"",
-      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();
-        }
-      });
-    },
-    handleMapSelection({ name, point }){
-      this.toponym = name
-    },
-    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 - 164
src/views/operate/shop/components/mapModal.vue

@@ -1,164 +0,0 @@
-<template>
-  <el-dialog :visible="_visible" title="选择地址" @close="_visible = false">
-	  <div id="r-result">
-      <p>请输入:</p>
-      <input ref="input" size="mini" type="text" id="suggestId" :value="value"/>
-    </div>
-	  <div id="l-map" ref="map" />
-	  <div 
-      id="searchResultPanel" 
-      style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;" 
-    />
-
-    <div class="flex-end" style="margin-top:10px">
-      <el-button type="primary" size="mini" @click="save">保存</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-export default {
-  name:'MapModal',
-  props:['visible', 'toponym'],
-  data(){
-    return {
-      isInit: true,
-      value: "",
-      point: []
-    }
-  },
-  computed:{
-    _visible:{
-      get(){
-        return this.visible
-      },
-      set(newVal){
-        this.$emit('update:visible',newVal)
-      }
-    }
-  },
-  watch:{
-    visible(newVal){
-      if(!newVal) return
-      this.$nextTick(() => {
-        if(this.isInit){
-          this.initMap()
-          this.isInit = false
-          return
-        }
-
-        this.initValue()
-      })  
-    }
-  },
-  methods:{
-    initMap(){
-      this.createMap()
-      this.createAutoComplete()
-      this.registerHightlightEvent()
-      this.registerConfirmEvent()
-      this.registerConfirmEvent()
-    },
-    createMap(){
-      this.map = new BMap.Map('l-map')
-      this.map.centerAndZoom('北京',28)
-    },
-    createAutoComplete(){
-      this.ac = new BMap.Autocomplete({
-        input:'suggestId',
-        localtion: this.map
-      })
-    },
-    registerHightlightEvent(){
-      this.ac.addEventListener('onhighlight',(e) => {
-         var str = "";
-		     var _value = e.fromitem.value;
-		     var value = "";
-		     if (e.fromitem.index > -1) {
-		     	value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
-		     }    
-		     str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;
-     
-		     value = "";
-		     if (e.toitem.index > -1) {
-		     	_value = e.toitem.value;
-		     	value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
-		     }    
-		     str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
-		     document.getElementById("searchResultPanel").innerHTML = str;
-      })
-    },
-    registerConfirmEvent(){
-      this.ac.addEventListener("onconfirm", (e) => {   //鼠标点击下拉列表后的事件
-        var _value = e.item.value;
-	    	this.value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
-	    	document.getElementById("searchResultPanel").innerHTML ="onconfirm<br />index = " + e.item.index + "<br />myValue = " + this.value;
-	    	this.setPlace();
-	    });
-    },
-    setPlace(){
-	    this.map.clearOverlays();    //清除地图上所有覆盖物
-	    
-      const onSearchComplete = () => {
-        const { point} = local.getResults().getPoi(0)
-
-        this.point = [point.lat , point.lng]
-        // const pp = local.getResults().getPoi(0).point;    //获取第一个智能搜索的结果
-        
-	    	this.map.centerAndZoom(point, 18);
-	    	this.map.addOverlay(new BMap.Marker(point));    //添加标注
-	    }
-
-	    var local = new BMap.LocalSearch(this.map, { //智能搜索
-	      onSearchComplete
-	    });
-
-	    local.search(this.value);
-    },
-    initValue(){
-      if(this.toponym) return
-      this.value = this.toponym
-      this.setPlace()
-    },
-    save(){
-      console.log(this.point,this.value)
-      if(this.point.length !== 2 || !this.value){
-        this.$message.warning('请选择地址')
-        return
-      }
-
-      this.$emit('save',{ point:this.point, name:this.value })
-      this._visible = false
-    }
-  }
-}
-</script>
-
-<style scoped lang="scss">
-#l-map{
-  width: 100%;
-  height: 300px;
-}
-
-#r-result{
-  width: 100%;
-  height: 34px;
-  margin-bottom: 20px;
-  font-size: 16px;
-  display: flex;
-  align-items: center;
-
-  p{
-    width:60px;
-  }
-
-  input {
-    border:1px solid #DCDFE6;
-    width: 100%;
-    height: 100%;
-    border-radius: 5px;
-    box-sizing: border-box;
-    padding: 5px;
-  }
-}
-</style>

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

@@ -1,225 +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 {
-      visible: false,
-      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>

+ 0 - 440
src/views/operate/shopTrim/storeDecoration copy.vue

@@ -1,440 +0,0 @@
-<template>
-  <el-form
-    ref="ruleForm"
-    v-loading="loading"
-    :model="ruleForm"
-    status-icon
-    :rules="rulesThis"
-    :size="'small'"
-    label-width="80px"
-    class="supplierAdd"
-  >
-    <!--:disabled="type !== 'add' && type !== 'edit'"-->
-    <el-row >
-      <el-col :span="12">
-        <el-form-item label="店铺名称" prop="storeSpec">
-          <el-checkbox-group v-model="ruleForm.storeSpec">
-            <el-checkbox label="1" />
-          </el-checkbox-group>
-        </el-form-item>
-      </el-col>
-
-      <el-col :span="12">
-        <el-form-item label="供应商" prop="storeSpec">
-          <el-checkbox-group v-model="ruleForm.storeSpec">
-            <el-checkbox label="1" />
-          </el-checkbox-group>
-        </el-form-item>
-      </el-col>
-    </el-row>
-
-    <el-row>
-      <el-col :span="24"
-        ><div class="supplierAdd-title" style="margin: 6px 0 0 10px">
-          店铺简介
-        </div></el-col
-      >
-      <div style="padding: 0">
-        <el-col :span="6">
-          <el-form-item label="最近装修" prop="最近装修时间属性">
-            <el-date-picker
-              style="width: 100%"
-              placeholder="最近装修时间"
-              v-model="ruleForm['最近装修时间属性']"
-            />
-          </el-form-item>
-          <el-form-item label="停车位数" prop="停车位数属性">
-            <el-input-number
-              style="width: 100%"
-              placeholder="停车位数"
-              v-model="ruleForm['停车位数属性']"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="18">
-          <el-form-item label="店铺简介" prop="店铺简介属性">
-            <el-input
-              type="textarea"
-              placeholder="店铺简介"
-              :autosize="{ minRows: 4, maxRows: 4 }"
-              v-model="ruleForm['店铺简介属性']"
-            />
-          </el-form-item>
-        </el-col>
-      </div>
-      <el-col :span="24"><div class="supplierAdd-title">曾举办活动</div></el-col>
-      <el-col :span="24" style="padding: 20px; padding-top: 0px">
-        <table-editor
-          mode="table"
-          :columns="activityColumns"
-          :data="[]"
-          :rules="activityRules"
-        />
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">酒店服务设施</div></el-col>
-      <el-col :span="24">
-        <div style="padding: 35px; padding-top: 0px; box-sizing: border-box">
-          <dynamic-tags />
-        </div>
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">餐饮设施</div></el-col>
-      <el-col :span="24">
-        <div style="padding: 35px; padding-top: 0px; box-sizing: border-box">
-          <dynamic-tags />
-        </div>
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">客房服务设施</div></el-col>
-      <el-col :span="24">
-        <div style="padding: 35px; padding-top: 0px; box-sizing: border-box">
-          <dynamic-tags />
-        </div>
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">详情图片</div></el-col>
-      <el-col :span="24" style="padding: 20px; padding-top: 0px">
-        <table-editor
-          mode="modal"
-          :columns="pictureColumns"
-          :data="[]"
-          :rules="pictureRules"
-        />
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">会议室</div></el-col>
-      <el-col :span="24" style="padding: 20px; padding-top: 0px">
-        <table-editor
-          mode="modal"
-          :columns="conferenceColumns"
-          :data="[]"
-          :rules="conferenceRules"
-        />
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">客房</div></el-col>
-      <el-col :span="24" style="padding: 20px; padding-top: 0px">
-        <table-editor
-          mode="modal"
-          :columns="guestColumns"
-          :data="[]"
-          :rules="guestRules"
-        />
-      </el-col>
-
-      <el-col :span="24"><div class="supplierAdd-title">会议服务设施</div></el-col>
-      <el-col :span="24" style="padding: 20px; padding-top: 0px">
-        <table-editor
-          mode="table"
-          :columns="serviceColumns"
-          :data="[]"
-          :rules="serviceRules"
-        />
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-<script>
-import asyncRequest from "@/apis/service/operate/shop";
-import resToken from "@/mixins/resToken";
-import DynamicTags from "@/components/dynamic-tags";
-import {
-  pictureColumns,
-  pictureRules,
-  conferenceColumns,
-  conferenceRules,
-  guestColumns,
-  guestRules,
-  serviceColumns,
-  serviceRules,
-  activityColumns,
-  activityRules,
-} from "./columns";
-
-export default {
-  name: "SupplierAdd",
-  mixins: [resToken],
-  components: {
-    DynamicTags,
-  },
-  props: ["showModel", "id", "type", "sitem"],
-  data() {
-    return {
-      loading: false,
-      hand_name: "",
-      pictureColumns,
-      pictureRules,
-      conferenceColumns,
-      conferenceRules,
-      guestColumns,
-      guestRules,
-      serviceColumns,
-      serviceRules,
-      activityColumns,
-      activityRules,
-      showModelThis: this.showModel,
-      ruleForm: {},
-      rulesThis: this.rules,
-      rules: {},
-    };
-  },
-  mounted() {
-    this.initForm();
-  },
-  methods: {
-    async initForm() {
-      this.hand_name = "";
-      this.loading = true;
-      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() {
-      const {
-        id,
-        code,
-        coop_state,
-        source,
-        type,
-        category,
-        delivery_way,
-        supplier_type,
-        level,
-        pay_type,
-        supplier_img,
-        prove_img,
-        contactor,
-        mobile,
-        position,
-        registercode,
-        name,
-        nature,
-        addr,
-        legaler,
-        registertime,
-        scope,
-        personid,
-        person,
-        telephone,
-        email,
-      } = this.sitem || {};
-
-      this.hand_name = person || "";
-      this.ruleForm = {
-        id: id || "",
-        code: code || "",
-        coop_state: coop_state || "",
-        source: source || "",
-        type: type || "",
-        category: category || "",
-        delivery_way: delivery_way || "",
-        supplier_type: supplier_type || "",
-        level: level || "",
-        pay_type: pay_type || "",
-        supplier_img: supplier_img || "",
-        prove_img: prove_img ? (prove_img || "").split(",") : [],
-        contactor: contactor || "",
-        mobile: mobile || "",
-        telephone: telephone || "",
-        position: position || "",
-        registercode: registercode || "",
-        name: name || "",
-        email: email || "",
-        nature: nature || "",
-        addr: addr || "",
-        legaler: legaler || "",
-        registertime: registertime || "",
-        scope: scope || "",
-        personid: personid ? [personid] : [],
-      };
-    },
-    closeImg(index) {
-      this.ruleForm.prove_img.splice(index, 1);
-      this.$refs.ruleForm.validateField("prove_img");
-    },
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          if (this.loading) {
-            return;
-          }
-          this.loading = true;
-          const model = JSON.parse(JSON.stringify(this.ruleForm));
-          model.prove_img = model.prove_img.toString();
-          model.personid = model.personid.toString();
-          let res = {};
-          if (this.id === "add") {
-            delete model["id"];
-            res = await asyncRequest.add(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", res.data);
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    deleteimg() {
-      this.ruleForm.supplier_img = "";
-      this.$refs.ruleForm.validateField("supplier_img");
-    },
-    handleHandoverName(e) {
-      if (e && e.id) {
-        this.ruleForm.personid = [e.id];
-      } else {
-        this.ruleForm.personid = [];
-      }
-      this.$refs.ruleForm.validateField("personid");
-    },
-    type_search_change(e) {
-      const { id } = e;
-      this.ruleForm.nature = id || "";
-      this.$refs.ruleForm.validateField("nature");
-    },
-
-    // 图片上传成功
-    async UploadSuccessEventsupplier_img(data) {
-      await this.UploadSuccessEvent(1, data);
-    },
-    // //图片上传成功
-    // async UploadSuccessEventgood_img(data) {
-    //   await this.UploadSuccessEvent(2, data);
-    // },
-    // 图片上传成功
-    async UploadSuccessEventgood_info_img(data) {
-      await this.UploadSuccessEvent(3, data);
-    },
-    // 图片上传成功
-    async UploadSuccessEvent(type, data) {
-      const { url } = data;
-      if (url === "noToken") {
-        await this.logout();
-      } else {
-        if (type === 1) {
-          this.ruleForm.supplier_img = url;
-          this.$refs.ruleForm.validateField("supplier_img");
-        } else if (type === 2) {
-          this.ruleForm.good_img = url;
-          this.$refs.ruleForm.validateField("good_img");
-        } else {
-          this.ruleForm.prove_img.push(url);
-          this.$refs.ruleForm.validateField("prove_img");
-        }
-        this.$message.success("图片上传成功!");
-      }
-    },
-    // 图片上传失败
-    UploadErrorEventsupplier_img(res) {
-      this.imgUploadError(1, res);
-    },
-    // //图片上传失败
-    // UploadErrorEventgood_img(res) {
-    //   this.imgUploadError(2, res);
-    // },
-    // 图片上传失败
-    UploadErrorEventgood_info_img(res) {
-      this.imgUploadError(3, res);
-    },
-    imgUploadError(type, res) {
-      if (res !== "break") {
-        this.$message.error("图片上传失败!");
-        this.$refs.ruleForm.validateField(
-          type === 1 ? "supplier_img" : type === 2 ? "good_img" : "good_info_img"
-        );
-      }
-    },
-    // 判断图片规格
-    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;
-    height: 120%;
-    box-sizing: border-box;
-    padding: 0 0 0 10px;
-  }
-}
-</style>