Browse Source

Merge branch 'edit' of http://192.168.10.210:3000/daiyanrong/order-ui-pc into edit

戴艳蓉 3 years ago
parent
commit
350a8a89e7

+ 4 - 4
src/apis/service/purchaseIn/storeGoods/index.js

@@ -6,13 +6,13 @@ export default {
   add: (data, params) => http(api + "add", data, "post", params),
   // 删除
   delete: (data, params) => http(api + "delete", data, "post", params),
-  // 分页查询
-  list: (data, params) => http(api + "list", data, "post", params),
+  // 商品列表查询
+  list: (data, params) => http(api + "goodlist", data, "post", params),
   // 详情
   detail: (data, params) => http(api + "detail", data, "post", params),
   // 更新
   update: (data, params) => http(api + "update", data, "post", params),
-  // 修改状态
-  status: (data, params) => http(api + "accountstatus", data, "post", params),
+  // 修改商品上下架状态
+  status: (data, params) => http(api + "goodstatus", data, "post", params),
 };
    

+ 257 - 257
src/views/purchaseIn/storeGoods/addEdit.vue

@@ -61,217 +61,219 @@
             </el-form-item>
           </el-form>
         </el-col>
-        <el-col :span="24" style="text-align: right;">
+        <el-col :span="24" style="text-align: right">
           <el-button type="primary" @click="submitForm" v-if="!isDetail"
             >保 存
           </el-button>
-          <el-button @click="showModelThis = false">{{ isDetail ? "关 闭" : "取 消" }}</el-button>
+          <el-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
         </el-col>
       </el-row>
     </el-card>
   </el-dialog>
-   </template>
+</template>
    <script>
-   import asyncRequest from "@/apis/service/purchaseIn/storeGoods";
-   import resToken from "@/mixins/resToken";
-   import {
-    isnumber,
-    isMobile,
-    validEmail,
-    isAlphanumeric,
-    isChinese,
-    isEmoticon,
-    validAlphabets,
-  } from "@/utils/validate";
-   export default {
-    name: 'storeGoods',
-    props: ["showModel", "id", "isDetail","sitem"],
-    mixins: [resToken],
-    data() {
-      const validateusername = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("账号不能为空!"));
+import asyncRequest from "@/apis/service/purchaseIn/storeGoods";
+import resToken from "@/mixins/resToken";
+import {
+  isnumber,
+  isMobile,
+  validEmail,
+  isAlphanumeric,
+  isChinese,
+  isEmoticon,
+  validAlphabets,
+} from "@/utils/validate";
+export default {
+  name: "storeGoods",
+  props: ["showModel", "id", "isDetail", "sitem"],
+  mixins: [resToken],
+  data() {
+    const validateusername = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("账号不能为空!"));
+      } else {
+        if (value.length < 6 || value.length > 18) {
+          callback(new Error("账号规则为6~18位数字与字母组合!"));
         } else {
-          if (value.length < 6 || value.length > 18) {
+          if (isnumber(value)) {
+            callback(new Error("账号规则为6~18位数字与字母组合!"));
+          } else if (validAlphabets(value)) {
+            callback(new Error("账号规则为6~18位数字与字母组合!"));
+          } else if (!isAlphanumeric(value)) {
             callback(new Error("账号规则为6~18位数字与字母组合!"));
           } else {
-            if (isnumber(value)) {
-              callback(new Error("账号规则为6~18位数字与字母组合!"));
-            } else if (validAlphabets(value)) {
-              callback(new Error("账号规则为6~18位数字与字母组合!"));
-            } else if (!isAlphanumeric(value)) {
-              callback(new Error("账号规则为6~18位数字与字母组合!"));
-            } else {
-              callback();
-            }
+            callback();
           }
         }
-      };
-      const validatename = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("真实姓名不能为空!"));
+      }
+    };
+    const validatename = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("真实姓名不能为空!"));
+      } else {
+        if (value.length < 2 || value.length > 12) {
+          callback(new Error("真实姓名规则为2~12位汉字!"));
         } else {
-          if (value.length < 2 || value.length > 12) {
+          if (!isChinese(value)) {
+            console.log(9999);
+            callback(new Error("真实姓名规则为2~12位汉字!"));
+          } else if (isEmoticon(value)) {
+            console.log(2345);
             callback(new Error("真实姓名规则为2~12位汉字!"));
-          } else {
-            if (!isChinese(value)) {
-              console.log(9999);
-              callback(new Error("真实姓名规则为2~12位汉字!"));
-            } else if (isEmoticon(value)) {
-              console.log(2345);
-              callback(new Error("真实姓名规则为2~12位汉字!"));
-            } else {
-              callback();
-            }
-          }
-        }
-      };
-      const validatemobile = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("手机号不能为空!"));
-        } else {
-          if (!isMobile(value)) {
-            callback(new Error("手机号格式不正确!"));
           } else {
             callback();
           }
         }
-      };
-  
-      const validateEmail = (rule, value, callback) => {
-        if (value === "") {
-          callback();
+      }
+    };
+    const validatemobile = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("手机号不能为空!"));
+      } else {
+        if (!isMobile(value)) {
+          callback(new Error("手机号格式不正确!"));
         } else {
-          if (!validEmail(value)) {
-            callback(new Error("邮箱格式不正确!"));
-          } else {
-            callback();
-          }
-        }
-      };
-      return {
-        loading: false,
-        title: "添加账号",
-        showModelThis: this.showModel,
-        ruleForm: {
-          username: "", // 账号
-          name: "", // 真实姓名
-          mobile: "",
-          email: "",
-          role_id: "",
-          status: "1",
-          item: [],
-        },
-        rulesThis: this.rules,
-        rules: {
-          name: [
-            {
-              required: true,
-              validator: validatename,
-              trigger: "blur",
-            },
-          ],
-          username: [
-            {
-              required: true,
-              validator: validateusername,
-              trigger: "blur",
-            },
-          ],
-          mobile: [
-            {
-              required: true,
-              validator: validatemobile,
-              trigger: "blur",
-            },
-          ],
-          email: [
-            {
-              required: false,
-              validator: validateEmail,
-              trigger: "blur",
-            },
-          ],
-          role_id: [
-            {
-              required: true,
-              message: "请选择角色",
-              trigger: "change",
-            },
-          ],
-          item: [
-            {
-              type: "array",
-              required: true,
-              message: "请选择所在部门",
-              trigger: "change",
-            },
-          ],
-          status: [
-            {
-              required: true,
-              message: "请选择状态",
-              trigger: "change",
-            },
-          ],
+          callback();
         }
-      };
-    },
-    watch: {
-      showModel: function(val) {
-        this.showModelThis = val;
-        if (val) {
-          this.initForm();
+      }
+    };
+
+    const validateEmail = (rule, value, callback) => {
+      if (value === "") {
+        callback();
+      } else {
+        if (!validEmail(value)) {
+          callback(new Error("邮箱格式不正确!"));
+        } else {
+          callback();
         }
+      }
+    };
+    return {
+      loading: false,
+      title: "添加账号",
+      showModelThis: this.showModel,
+      ruleForm: {
+        username: "", // 账号
+        name: "", // 真实姓名
+        mobile: "",
+        email: "",
+        role_id: "",
+        status: "1",
+        item: [],
       },
-      showModelThis(val) {
-        if (!val) {
-          this.$emit("cancel");
-        }
+      rulesThis: this.rules,
+      rules: {
+        name: [
+          {
+            required: true,
+            validator: validatename,
+            trigger: "blur",
+          },
+        ],
+        username: [
+          {
+            required: true,
+            validator: validateusername,
+            trigger: "blur",
+          },
+        ],
+        mobile: [
+          {
+            required: true,
+            validator: validatemobile,
+            trigger: "blur",
+          },
+        ],
+        email: [
+          {
+            required: false,
+            validator: validateEmail,
+            trigger: "blur",
+          },
+        ],
+        role_id: [
+          {
+            required: true,
+            message: "请选择角色",
+            trigger: "change",
+          },
+        ],
+        item: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择所在部门",
+            trigger: "change",
+          },
+        ],
+        status: [
+          {
+            required: true,
+            message: "请选择状态",
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
       }
     },
-    methods: {
-      closeModel() {
-        console.log("closeModel!!");
-      },
-      async initForm() {
-        this.loading = true;
-        // await this.getRole();
-        if (this.id === "add") {
-          this.title = "添加账号";
-          this.rulesThis = this.rules;
-          await this.resetForm();
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    closeModel() {
+      console.log("closeModel!!");
+    },
+    async initForm() {
+      this.loading = true;
+      // await this.getRole();
+      if (this.id === "add") {
+        this.title = "添加账号";
+        this.rulesThis = this.rules;
+        await this.resetForm();
+      } else {
+        if (this.isDetail) {
+          this.title = "账号详情";
+          this.rulesThis = {};
         } else {
-          if (this.isDetail) {
-            this.title = "账号详情";
-            this.rulesThis = {};
-          } else {
-            this.title = "修改账号";
-            this.rulesThis = this.rules;
-          }
-          await this.resetForm(this.sitem);
-          // await this.initData()
+          this.title = "修改账号";
+          this.rulesThis = this.rules;
         }
-        this.loading = false;
-      },
-      // async getRole() {
-      //   const model = {
-      //     status: "", // 状态
-      //     level: "", // 姓名
-      //     role_name: "",
-      //   };
-      //   const res = await asyncRequest.getRole(model);
-      //   if (res && res.code === 0 && res.data) {
-      //     this.roleList = res.data;
-      //     this.roleList.map((v1) => {
-      //       v1.id += "";
-      //       v1.status += "";
-      //       return v1;
-      //     });
-      //   }
-      // },
-      async initData() {
-        const res = await asyncRequest.detail({ id: this.id });
+        await this.resetForm(this.sitem);
+        // await this.initData()
+      }
+      this.loading = false;
+    },
+    // async getRole() {
+    //   const model = {
+    //     status: "", // 状态
+    //     level: "", // 姓名
+    //     role_name: "",
+    //   };
+    //   const res = await asyncRequest.getRole(model);
+    //   if (res && res.code === 0 && res.data) {
+    //     this.roleList = res.data;
+    //     this.roleList.map((v1) => {
+    //       v1.id += "";
+    //       v1.status += "";
+    //       return v1;
+    //     });
+    //   }
+    // },
+    async initData() {
+      const res = await asyncRequest.detail({ id: this.id });
       if (res && res.code === 0 && res.data) {
         this.ruleForm = res.data;
         this.ruleForm.role_id = this.ruleForm.role;
@@ -280,83 +282,81 @@
       } else {
         this.$message.warning(res.message);
       }
-      },
-      async resetForm(sitem) {
-        // 重置
-        await this.$nextTick(() => {
-          if (this.$refs.ruleForm) {
-            this.$refs.ruleForm.resetFields();
-            this.$refs.ruleForm.clearValidate();
-            const { username, nickname, mobile, email, roleid, status, item } =
-              sitem;
-            this.ruleForm = {
-              username: username || "", // 账号
-              name: nickname || "", // 真实姓名
-              mobile: mobile || "",
-              email: email || "",
-              role_id: roleid || "",
-              status: status || "",
-              item: item || [],
-            };
-            if (this.id === "add" || this.isDetail) {
-              this.rules.username[0].required = false;
-            }
+    },
+    async resetForm(sitem) {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { username, nickname, mobile, email, roleid, status, item } =
+            sitem;
+          this.ruleForm = {
+            username: username || "", // 账号
+            name: nickname || "", // 真实姓名
+            mobile: mobile || "",
+            email: email || "",
+            role_id: roleid || "",
+            status: status || "",
+            item: item || [],
+          };
+          if (this.id === "add" || this.isDetail) {
+            this.rules.username[0].required = false;
           }
-        });
-      },
-    
-      async submitForm() {
-        await this.$refs.ruleForm.validate(async (valid) => {
-          if (valid) {
-            this.loading = true;
-            const { username, name, mobile, email, role_id, status } = JSON.parse(
-              JSON.stringify(this.ruleForm)
-            );
-            const model = {
-              id: this.id,
-              username: username || "", // 账号
-              nickname: name || "", // 真实姓名
-              mobile: mobile || "",
-              email: email || "",
-              role: role_id || "",
-              status: status || "",
-            };
-            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 === 0) {
-              const title = this.id === "add" ? "添加成功" : "修改成功";
-              this.$notify.success({
-                title,
-                message: "",
-              });
-              this.showModelThis = false;
-              // 刷新
-              this.$emit("refresh");
-            } else if (res && res.code >= 100 && res.code <= 104) {
-              await this.logout();
-            } else {
-              this.$message.warning(res.message);
-            }
+        }
+      });
+    },
+
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          const { username, name, mobile, email, role_id, status } = JSON.parse(
+            JSON.stringify(this.ruleForm)
+          );
+          const model = {
+            id: this.id,
+            username: username || "", // 账号
+            nickname: name || "", // 真实姓名
+            mobile: mobile || "",
+            email: email || "",
+            role: role_id || "",
+            status: status || "",
+          };
+          let res = {};
+          if (this.id === "add") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
           } else {
-            console.log("error submit!!");
-            return false;
+            res = await asyncRequest.update(model);
           }
-        });
-      },
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功" : "修改成功";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
     },
- 
-  };
-  </script>
+  },
+};
+</script>
 
    <style lang="scss" scoped>
-   .storeGoods {
-    
-   }
-   </style>
+.storeGoods {
+}
+</style>
    

+ 275 - 82
src/views/purchaseIn/storeGoods/index.vue

@@ -27,7 +27,24 @@
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
               <el-col :span="24">
-                <el-col :span="4" style="width: 120px">
+                <el-col :span="8" style="width: 470px">
+                  <period-date-picker :size="searchSize"></period-date-picker>
+                </el-col>
+
+                <!-- <el-col :span="4">
+                  <company-search :size="searchSize"></company-search>
+                </el-col> -->
+
+                <el-col :span="4">
+                  <el-autocomplete
+                    v-model="state"
+                    :fetch-suggestions="querySearchAsync"
+                    placeholder="请输入内容"
+                    @select="handleSelect"
+                  ></el-autocomplete>
+                </el-col>
+
+                <!-- <el-col :span="4" style="width: 120px">
                   <el-select
                     :size="searchSize"
                     v-model="parmValue.status"
@@ -48,32 +65,32 @@
                       :value="item.code"
                     />
                   </el-select>
-                </el-col>
-                <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
+                </el-col> -->
+                <!-- <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
                     v-model="parmValue.name"
                     :maxlength="40"
                     placeholder="业务员姓名"
                   />
-                </el-col>
-                <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
+                </el-col> -->
+                <!-- <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
                     v-model="parmValue.username"
                     :maxlength="40"
                     placeholder="手机号"
                   />
-                </el-col>
-                <el-col :span="4" style="width: 54px">
+                </el-col> -->
+                <!-- <el-col :span="4" style="width: 54px">
                   <el-button
                     :size="searchSize"
                     type="primary"
                     class="fr"
                     icon="el-icon-search"
                     @click="searchList"
-                /></el-col>
-                <el-col :span="4" style="width: 66px">
+                /></el-col> -->
+                <!-- <el-col :span="4" style="width: 66px">
                   <el-button
                     type="warning"
                     class="fr"
@@ -82,8 +99,8 @@
                   >
                     重置
                   </el-button>
-                </el-col>
-                <el-col :span="3" style="width: 66px; float: right">
+                </el-col> -->
+                <!-- <el-col :span="3" style="width: 66px; float: right">
                   <el-button
                     :size="searchSize"
                     type="primary"
@@ -92,7 +109,7 @@
                   >
                     刷新
                   </el-button>
-                </el-col>
+                </el-col> -->
               </el-col>
             </el-row>
           </div>
@@ -102,7 +119,7 @@
             :size="tablebtnSize"
             :type="scope.row.status == '0' ? 'warning' : ''"
             v-text="
-              (statusOptions.find((item) => item.id == scope.row.status) || {})
+              (statusOptions.find((item) => item.id == scope.row.bstatus) || {})
                 .label || '--'
             "
           ></el-tag>
@@ -131,7 +148,7 @@
               @click="openModal(scope.row.id, true, scope.row)"
             ></i>
           </el-tooltip>
-          <el-tooltip
+          <!-- <el-tooltip
             v-if="powers.some((item) => item == '005')"
             effect="dark"
             content="修改"
@@ -141,32 +158,27 @@
               class="el-icon-edit tb-icon"
               @click="openModal(scope.row.id, false, scope.row)"
             ></i>
-          </el-tooltip>
+            <p @click="openModal(scope.row.id, false, scope.row)">修改</p>
+          </el-tooltip> -->
           <el-tooltip
             v-if="
-              powers.some((item) => item == '004') && scope.row.status === '1'
+              powers.some((item) => item == '004') && scope.row.bstatus === '1'
             "
             effect="dark"
-            content="禁用"
+            content="下架"
             placement="top"
           >
-            <i
-              class="el-icon-video-pause tb-icon"
-              @click="statusConfirm(scope.row.id, scope.row.status)"
-            ></i>
+            <p @click="statusConfirm(scope.row.id, scope.row.bstatus)">上架</p>
           </el-tooltip>
           <el-tooltip
             v-if="
-              powers.some((item) => item == '004') && scope.row.status === '0'
+              powers.some((item) => item == '004') && scope.row.bstatus === '0'
             "
             effect="dark"
-            content="启用"
+            content="上架"
             placement="top"
           >
-            <i
-              class="el-icon-video-play tb-icon"
-              @click="statusConfirm(scope.row.id, scope.row.status)"
-            ></i>
+            <p @click="statusConfirm(scope.row.id, scope.row.bstatus)">下架</p>
           </el-tooltip>
         </template>
       </ex-table>
@@ -222,11 +234,17 @@ export default {
   },
   data() {
     return {
+      restaurants: [],
+      state: "",
+      timeout: null,
+
+      // 饿了么的
+      product: "", //商品名称绑定的数据
       sitem: null,
-      // 状态
+      // 渲染当前状态
       statusOptions: [
-        { id: "0", label: "禁用" },
-        { id: "1", label: "启用" },
+        { id: "0", label: "使用中" },
+        { id: "1", label: "已下架" },
       ],
       statusList: statusList,
       loading: true,
@@ -234,9 +252,6 @@ export default {
       isDetail: false,
       modelId: 0,
       parmValue: {
-        name: "", // 业务员名字
-        username: "", // 账号
-        status: "", //
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
@@ -261,31 +276,58 @@ export default {
       // 表格 - 列参数
       columns: [
         {
-          prop: "nickname",
-          label: "真实姓名",
+          prop: "good_code",
+          label: "商品编号",
         },
         {
-          prop: "role_name",
-          label: "角色名称",
+          prop: "brand",
+          label: "品牌",
         },
         {
-          prop: "mobile",
-          label: "联系电话",
+          prop: "good_name",
+          label: "商品名称",
         },
+        // {
+        //   prop: "good_desc",
+        //   label: "商品描述",
+        // },
         {
-          prop: "email",
-          label: "邮箱",
+          prop: "type_code",
+          label: "商品属性", //商品属性code
         },
         {
-          prop: "status",
-          label: "状态",
-          _slot_: "status",
-          width: "80px",
+          prop: "original_price",
+          label: "采购价",
+        },
+        {
+          prop: "da", //接口未返回
+          label: "单位",
+        },
+        // {
+        //   prop: "status",
+        //   label: "商品名状态",
+        // },
+        {
+          prop: "type_code",
+          label: "商品属性",
+        },
+        {
+          prop: "usable_stock",
+          label: "当前库存",
+        },
+        {
+          prop: "qq", //接口未返回
+          label: "供应商编码",
         },
         {
-          prop: "addtime",
-          label: "创建时间",
-          sortable: true,
+          prop: "aa", //接口未返回
+          label: "公司编码",
+        },
+        {
+          prop: "bstatus",
+          label: "当前状态",
+          _slot_: "status",
+          width: "80px",
         },
         {
           prop: "",
@@ -294,19 +336,22 @@ export default {
           _noset_: true,
           _slot_: "operation",
         },
+        // {
+        //   prop: "addtime",
+        //   label: "创建时间",
+        //   sortable: true,
+        // },
       ],
     };
   },
   mounted() {
     this.searchList();
+    this.restaurants = this.loadAll(); //饿了么的
   },
 
   methods: {
     restSearch() {
       this.parmValue = {
-        name: "", // 业务员名字
-        username: "", // 账号
-        status: "", //
         page: 1, // 页码
         size: 10, // 每页显示条数
       };
@@ -319,38 +364,42 @@ export default {
       this.isDetail = isDetail;
       this.sitem = sitem;
     },
+    // 删除功能函数
     async deleteById(id, status) {
-      await this.$confirm("确定要删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          const model = {
-            id: id,
-            status: status === "1" ? "0" : "1",
-          };
-          const res = await asyncRequest.status(model);
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "删除成功",
-              message: "",
-            });
-            this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
+      // await this.$confirm("确定要删除?", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(async () => {
+      //     const model = {
+      //       id: id,
+      //       status: status === "1" ? "0" : "1",
+      //     };
+      //     const res = await asyncRequest.status(model);
+      //     if (res && res.code === 0) {
+      //       this.$notify.success({
+      //         title: "删除成功",
+      //         message: "",
+      //       });
+      //       this.searchList();
+      //     } else if (res && res.code >= 100 && res.code <= 104) {
+      //       await this.logout();
+      //     } else {
+      //       this.$message.warning(res.message);
+      //     }
+      //   })
+      //   .catch(() => {
+      //     console.log("取消");
+      //   });
     },
+    // 获取商品列表功能函数
     async searchList() {
       this.loading = true;
+      // console.log(this.tableData);
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
+        console.log(res.data.list);
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
       } else if (res && res.code >= 100 && res.code <= 104) {
@@ -361,9 +410,10 @@ export default {
       }
       this.loading = false;
     },
-
+    // 上下架功能的切换
     async statusConfirm(id, status) {
-      let str = status === "1" ? "禁用" : "启用";
+      console.log(id, status);
+      let str = status === "1" ? "下架" : "上架";
       await this.$confirm("确定要改为" + str + "?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -371,11 +421,14 @@ export default {
       })
         .then(async () => {
           this.loading = true;
+          console.log("修改成功");
           const model = {
             id: id,
             status: status === "1" ? "0" : "1",
           };
+          // console.log(model);
           const res = await asyncRequest.status(model);
+          // console.log(res);
           if (res && res.code === 0) {
             this.loading = false;
             this.$notify.success({
@@ -393,11 +446,151 @@ export default {
           console.log("取消");
         });
     },
+
+    // 饿了么的
+    loadAll() {
+      return [
+        { value: "三全鲜食(北新泾店)", address: "长宁区新渔路144号" },
+        {
+          value: "Hot honey 首尔炸鸡(仙霞路)",
+          address: "上海市长宁区淞虹路661号",
+        },
+        {
+          value: "新旺角茶餐厅",
+          address: "上海市普陀区真北路988号创邑金沙谷6号楼113",
+        },
+        { value: "泷千家(天山西路店)", address: "天山西路438号" },
+        {
+          value: "胖仙女纸杯蛋糕(上海凌空店)",
+          address: "上海市长宁区金钟路968号1幢18号楼一层商铺18-101",
+        },
+        { value: "贡茶", address: "上海市长宁区金钟路633号" },
+        {
+          value: "豪大大香鸡排超级奶爸",
+          address: "上海市嘉定区曹安公路曹安路1685号",
+        },
+        {
+          value: "茶芝兰(奶茶,手抓饼)",
+          address: "上海市普陀区同普路1435号",
+        },
+        { value: "十二泷町", address: "上海市北翟路1444弄81号B幢-107" },
+        { value: "星移浓缩咖啡", address: "上海市嘉定区新郁路817号" },
+        { value: "阿姨奶茶/豪大大", address: "嘉定区曹安路1611号" },
+        { value: "新麦甜四季甜品炸鸡", address: "嘉定区曹安公路2383弄55号" },
+        {
+          value: "Monica摩托主题咖啡店",
+          address: "嘉定区江桥镇曹安公路2409号1F,2383弄62号1F",
+        },
+        {
+          value: "浮生若茶(凌空soho店)",
+          address: "上海长宁区金钟路968号9号楼地下一层",
+        },
+        { value: "NONO JUICE  鲜榨果汁", address: "上海市长宁区天山西路119号" },
+        { value: "CoCo都可(北新泾店)", address: "上海市长宁区仙霞西路" },
+        {
+          value: "快乐柠檬(神州智慧店)",
+          address: "上海市长宁区天山西路567号1层R117号店铺",
+        },
+        {
+          value: "Merci Paul cafe",
+          address: "上海市普陀区光复西路丹巴路28弄6号楼819",
+        },
+        {
+          value: "猫山王(西郊百联店)",
+          address: "上海市长宁区仙霞西路88号第一层G05-F01-1-306",
+        },
+        { value: "枪会山", address: "上海市普陀区棕榈路" },
+        { value: "纵食", address: "元丰天山花园(东门) 双流路267号" },
+        { value: "钱记", address: "上海市长宁区天山西路" },
+        { value: "壹杯加", address: "上海市长宁区通协路" },
+        {
+          value: "唦哇嘀咖",
+          address: "上海市长宁区新泾镇金钟路999号2幢(B幢)第01层第1-02A单元",
+        },
+        { value: "爱茜茜里(西郊百联)", address: "长宁区仙霞西路88号1305室" },
+        {
+          value: "爱茜茜里(近铁广场)",
+          address:
+            "上海市普陀区真北路818号近铁城市广场北区地下二楼N-B2-O2-C商铺",
+        },
+        {
+          value: "鲜果榨汁(金沙江路和美广店)",
+          address: "普陀区金沙江路2239号金沙和美广场B1-10-6",
+        },
+        {
+          value: "开心丽果(缤谷店)",
+          address: "上海市长宁区威宁路天山路341号",
+        },
+        { value: "超级鸡车(丰庄路店)", address: "上海市嘉定区丰庄路240号" },
+        { value: "妙生活果园(北新泾店)", address: "长宁区新渔路144号" },
+        { value: "香宜度麻辣香锅", address: "长宁区淞虹路148号" },
+        {
+          value: "凡仔汉堡(老真北路店)",
+          address: "上海市普陀区老真北路160号",
+        },
+        { value: "港式小铺", address: "上海市长宁区金钟路968号15楼15-105室" },
+        { value: "蜀香源麻辣香锅(剑河路店)", address: "剑河路443-1" },
+        { value: "北京饺子馆", address: "长宁区北新泾街道天山西路490-1号" },
+        {
+          value: "饭典*新简餐(凌空SOHO店)",
+          address: "上海市长宁区金钟路968号9号楼地下一层9-83室",
+        },
+        {
+          value: "焦耳·川式快餐(金钟路店)",
+          address: "上海市金钟路633号地下一层甲部",
+        },
+        { value: "动力鸡车", address: "长宁区仙霞西路299弄3号101B" },
+        { value: "浏阳蒸菜", address: "天山西路430号" },
+        { value: "四海游龙(天山西路店)", address: "上海市长宁区天山西路" },
+        {
+          value: "樱花食堂(凌空店)",
+          address: "上海市长宁区金钟路968号15楼15-105室",
+        },
+        { value: "壹分米客家传统调制米粉(天山店)", address: "天山西路428号" },
+        {
+          value: "福荣祥烧腊(平溪路店)",
+          address: "上海市长宁区协和路福泉路255弄57-73号",
+        },
+        {
+          value: "速记黄焖鸡米饭",
+          address: "上海市长宁区北新泾街道金钟路180号1层01号摊位",
+        },
+        { value: "红辣椒麻辣烫", address: "上海市长宁区天山西路492号" },
+        {
+          value: "(小杨生煎)西郊百联餐厅",
+          address: "长宁区仙霞西路88号百联2楼",
+        },
+        { value: "阳阳麻辣烫", address: "天山西路389号" },
+        {
+          value: "南拳妈妈龙虾盖浇饭",
+          address: "普陀区金沙江路1699号鑫乐惠美食广场A13",
+        },
+      ];
+    },
+    querySearchAsync(queryString, cb) {
+      var restaurants = this.restaurants;
+      var results = queryString
+        ? restaurants.filter(this.createStateFilter(queryString))
+        : restaurants;
+
+      clearTimeout(this.timeout);
+      this.timeout = setTimeout(() => {
+        cb(results);
+      }, 3000 * Math.random());
+    },
+    createStateFilter(queryString) {
+      return (state) => {
+        return (
+          state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+        );
+      };
+    },
+    handleSelect(item) {
+      console.log(item);
+    },
   },
 };
 </script>
-   <style lang="scss" scoped>
-.storeGoods {
-}
+<style lang="scss" scoped>
 </style>