zhangjinxing 3 years ago
parent
commit
71d1aa3b3c

+ 18 - 0
src/apis/service/purchaseIn/purchaseDiffOrder/index.js

@@ -0,0 +1,18 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+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),
+  // 详情
+  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),
+};
+   

+ 0 - 240
src/views/purchaseIn/goodsClass/addEdit.vue

@@ -1,240 +0,0 @@
-<template>
-  <el-dialog
-    v-loading="loading"
-    :title="title"
-    :center="true"
-    align="left"
-    top="25vh"
-    width="600px"
-    :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)"
-    append-to-body
-    @close="closeModel"
-  >
-    <el-card style="margin-top: -20px">
-      <el-row>
-        <el-col :span="24">
-          <el-form
-            ref="ruleForm"
-            :model="ruleForm"
-            is_show-icon
-            :rules="rulesThis"
-            label-width="100px"
-            class="demo-ruleForm"
-          >
-            <el-form-item label="分类名称:" prop="name">
-              <el-input
-                v-model="ruleForm.className"
-                :disabled="isDetail"
-                placeholder="请输入分类名称"
-              />
-            </el-form-item>
-          </el-form>
-        </el-col>
-        <el-col :span="24" style="text-align: right">
-          <el-button v-if="!isDetail" type="primary" @click="submitForm">
-            保 存
-          </el-button>
-          <el-button @click="showModelThis = false">{{
-            isDetail ? "关 闭" : "取 消"
-          }}</el-button>
-        </el-col>
-      </el-row>
-    </el-card>
-  </el-dialog>
-</template>
-
-<script>
-import asyncRequest from "@/apis/service/purchaseIn/goodsClass";
-import btnList from "@/assets/js/btnList";
-import resToken from "@/mixins/resToken";
-export default {
-  mixins: [resToken],
-  props: [
-    "showModel",
-    "id",
-    "isDetail",
-    "pid",
-    "level",
-    "isAdd",
-    "type",
-    "formData",
-  ],
-  data() {
-    return {
-      loading: false,
-      showIconModel: false,
-      title: "",
-      btnList,
-      showModelThis: this.showModel,
-      ruleForm: {
-        className:"",//分类名称
-      },
-      rulesThis: this.rules,
-      rules: {
-        name: [
-          {
-            required: true,
-            message: "请输入分类名称",
-            trigger: "blur",
-          },
-          {
-            min: 1,
-            max: 50,
-            message: "长度在 1 到 50 个字符",
-            trigger: "blur",
-          },
-        ],
-      },
-    };
-  },
-  watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
-      if (val) {
-        this.initForm();
-      }
-    },
-    showModelThis(val) {
-      if (!val) {
-        this.$emit("cancel");
-      }
-    },
-  },
-  methods: {
-    closeModel() {
-      console.log("closeModel!!");
-    },
-    async initForm() {
-      if (this.isAdd) {
-        this.title = "添加组织";
-        this.loading = false;
-        this.rulesThis = this.rules;
-      } else {
-        if (this.isDetail) {
-          this.title = "组织详情";
-          this.rulesThis = {};
-        } else {
-          this.title = "修改组织";
-          this.rulesThis = this.rules;
-        }
-      }
-      await this.resetForm();
-    },
-
-    async resetForm() {
-      this.ruleForm = {
-        id: this.id,
-        pid: this.pid,
-        name: this.formData && this.formData.name ? this.formData.name : "", // 名称
-      };
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          // 去掉验证信息
-          this.$refs.ruleForm.clearValidate();
-        }
-      });
-    },
-    async submitForm() {
-      if (this.loading) {
-        return false;
-      }
-      this.loading = true;
-
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          let model = {};
-          let res = {};
-          const { name } = this.ruleForm;
-
-          model = {
-            id: this.id,
-            pid: this.pid,
-            name: name,
-          };
-
-          if (this.level === 1) {
-            // delete model["pid"];
-            // delete model["menuid"];
-            // delete model["url"];
-            // delete model["action_code"];
-            // delete model["status"];
-          } else if (this.level === 2) {
-            delete model["menuid"];
-            delete model["action_code"];
-            delete model["status"];
-          } else {
-            delete model["pid"];
-            delete model["img"];
-            delete model["is_show"];
-            delete model["weight"];
-            delete model["route"];
-            delete model["is_display"];
-            delete model["url"];
-          }
-          if (this.isAdd) {
-            delete model["id"];
-          }
-          if (this.isAdd) {
-            res = await asyncRequest.add(model);
-          } else {
-            res = await asyncRequest.update(model);
-            // if (this.isAdd) {
-            //   res = await asyncRequest.actionadd(model);
-            // } else {
-            //   res = await asyncRequest.actionedit(model);
-            // }
-          }
-          this.loading = false;
-          if (res && res.code === 0) {
-            this.ruleForm = {};
-            const title = this.isAdd ? "添加成功" : "修改成功";
-            this.$notify.success({
-              title,
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            let pids = this.pid;
-            if (this.id === 0) {
-              // 添加组织
-              pids = "0";
-            }
-            this.$emit("refresh", this.id, pids, this.level);
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        } else {
-          this.loading = false;
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.g-block {
-  display: inline-block;
-  padding: 10px 5px;
-  text-align: center;
-  border: 1px #ccc dashed;
-  margin: 1px;
-  font-size: 0px;
-  cursor: pointer;
-  i {
-    font-size: 30px;
-    line-height: 30px;
-    display: block;
-    margin: 0 auto;
-    width: 30px;
-  }
-}
-</style>

+ 0 - 462
src/views/purchaseIn/goodsClass/index copy.vue

@@ -1,462 +0,0 @@
-<template>
-  <div class="organize pagePadding">
-    <div
-      v-loading="loading"
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-row>
-        <el-col :span="24">
-          <el-col :span="24" style="padding: 12px 0 15px 0">
-            <div class="my-breadcrumb clear">
-              <div
-                class="my-breadcrumb-item"
-                v-for="(item, index) in titleList"
-                :key="item + index"
-                :class="{ chover: true }"
-                @click="changeBreadcrumb(index)"
-              >
-                <span class="label">{{ item.titleName }}</span
-                ><span class="separator" v-if="index + 1 !== titleList.length"
-                  >/</span
-                >
-              </div>
-            </div>
-          </el-col>
-          <el-col :span="24">
-            <el-row style="padding: 0 0 3px 0">
-              <el-col :span="8">
-                <goods-class
-                  :value="goods_className"
-                  :size="searchSize"
-                  :placeholder="'商品分类'"
-                  :disabled="false"
-                  @selectChange="goodsClassChange"
-                ></goods-class>
-              </el-col>
-
-              <el-col :span="3" style="width: 195px; float: right">
-                <el-button
-                  type="primary"
-                  :size="searchSize"
-                  style="float: right; margin-left: 5px"
-                  @click="searchList"
-                >
-                  刷新
-                </el-button>
-                <el-button
-                  v-if="powers.some((item) => item == '003')"
-                  type="success"
-                  :size="searchSize"
-                  style="float: right"
-                  @click="
-                    addEditFn(
-                      0,
-                      parmValue && parmValue.pid !== '' ? parmValue.pid : '0',
-                      1,
-                      false,
-                      true,
-                      {}
-                    )
-                  "
-                >
-                  添加
-                </el-button>
-              </el-col>
-            </el-row>
-          </el-col>
-        </el-col>
-      </el-row>
-
-      <el-row :gutter="10">
-        <el-col
-          :span="24"
-          v-if="
-            powers && powers.length > 0 && powers.some((item) => item == '001')
-          "
-        >
-          <organize-tree
-            style="margin-left: -5px"
-            :list="depart"
-            :level="1"
-            :pid="0"
-            @addEdit="addEditFn"
-            @openChildren="openChildren"
-            @status="setstatus"
-            @del="del"
-          />
-          <staff-tree
-            style="margin-left: -5px"
-            :list="item"
-            :level="1"
-            :pid="0"
-            @setUpEdit="setUpEdit"
-          />
-        </el-col>
-        <div
-          class="no-data"
-          v-if="item && item.length === 0 && depart && depart.length === 0"
-        >
-          暂无数据
-        </div>
-      </el-row>
-
-      <add-edit
-        :id="modelId"
-        :show-model="showModel"
-        :level="level"
-        :pid="parentIds"
-        :is-add="isAdd"
-        :form-data="formData"
-        :type="parmValue.type"
-        :is-detail="isDetail"
-        @refresh="searchList"
-        @cancel="showModel = false"
-      />
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
-</template>
-<script>
-import mixinPage from "@/mixins/elPaginationHandle";
-// import asyncRequest from "@/apis/service//interest/organize";
-
-import asyncRequest from "@/apis/service/purchaseIn/goodsClass";
-import addEdit from "./addEdit";
-import statusList from "@/assets/js/statusList";
-import { mapGetters } from "vuex";
-import resToken from "@/mixins/resToken";
-export default {
-  name: "organize",
-  components: {
-    addEdit,
-  },
-  mixins: [mixinPage, resToken],
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "organize"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    return {
-      goods_className: "", //分类名称
-      titleList: [],
-      sitem: null,
-      statusList: statusList,
-      loading: true,
-      showModel: false,
-      showInterface: false,
-      isDetail: false,
-      isAdd: true,
-      level: 1,
-      modelId: 0,
-      formData: {},
-      parentIds: "",
-      parmValue: {
-        page: 1,
-        size: 100,
-        // status: "", //
-        // 分类名称字段
-      },
-      depart: [],
-      item: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      // 表格 - 数据
-      // depart: [],
-    };
-  },
-  mounted() {
-    this.searchList();
-  },
-  methods: {
-    restSearch() {
-      this.parmValue = {
-        pid: "", //父级部门ID
-        name: "", // 部门/公司名称
-        nickname: "", // 员工名称
-      };
-      this.searchList();
-    },
-
-    async changeBreadcrumb(index) {
-      if (index + 1 !== this.titleList.length) {
-        this.parmValue.pid = this.titleList[index].id;
-        this.titleList = this.titleList.slice(0, index + 1);
-      } else {
-        this.parmValue.pid = 0;
-        this.titleList = [];
-      }
-      await this.searchList();
-    },
-    async openChildren(item) {
-      console.log(item);
-      this.parmValue.pid = item.pid;
-      let model = {
-        id: item.id,
-        titleName: item.name,
-      };
-      this.titleList.push(model);
-      console.log(this.titleList);
-      await this.searchList();
-    },
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    openPasswordModal(id, isDetail) {
-      this.passwordModel = true;
-      this.passwordModelId = id;
-      this.isPasswordDetail = isDetail;
-    },
-    async setUpEdit(id, position) {
-      if (position === "1") {
-        const model = {
-          id: id,
-          position: "2",
-        };
-        let res = await asyncRequest.userp(model);
-        if (res && res.code === 0) {
-          this.$notify.success({
-            title: "设置成功!",
-            message: "",
-          });
-          await this.searchList();
-        } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(res.message);
-        }
-      } else {
-        this.$message.warning("该账户已是部门负责人!");
-      }
-    },
-    addEditFn(id, pid, level, isDetail, isAdd, formData) {
-      this.showModel = true;
-      this.modelId = id;
-      this.level = level;
-      this.parentIds = pid;
-      this.isDetail = isDetail;
-      this.isAdd = isAdd;
-      this.formData = formData;
-    },
-
-    async setstatus(id, parentIds, level, status) {
-      console.log(
-        `openChildren-id, parentIds, level:${id}-${parentIds}-${level}-${status}`
-      );
-      await this.$confirm(`确定要${status === "0" ? "启用" : "禁用"}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          const model = {
-            id: id,
-            status: status === "1" ? "0" : "1",
-          };
-          let res = await asyncRequest.status(model);
-
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "修改成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-
-    async del(id, parentIds, level, status) {
-      console.log(
-        `openChildren-id, parentIds, level:${id}-${parentIds}-${level}-${status}`
-      );
-      await this.$confirm(`确定要删除?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          const model = {
-            id: id,
-          };
-          let res = await asyncRequest.delete(model);
-
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "删除成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-
-    // async concatData(id, parentIds, level) {
-    //   console.log(id, parentIds, level);
-    //   this.loading = true;
-    //   const res = await asyncRequest.list({});
-    //   let depart = [];
-    //   if (res && res.code === 0 && res.data) {
-    //     depart = res.data;
-    //   } else if (res && res.code >= 100 && res.code <= 104) {
-    //     await this.logout();
-    //   } else {
-    //     this.$message.warning(res.message);
-    //   }
-    //   let arr = JSON.parse(JSON.stringify(this.depart));
-    //   // if (level === 1) {
-    //   arr = arr.map((val, index) => {
-    //     if (level === 1 ? id : parentIds === val.id) {
-    //       val.child = depart[index].child;
-    //     }
-    //     return val;
-    //   });
-
-    //   this.depart = arr;
-    //   this.loading = false;
-    // },
-    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("取消");
-        });
-    },
-    // 商品分类列表
-    async searchList() {
-      this.loading = true;
-      // { id: "1" }this.parmValue
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        console.log(res.data);
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.depart = [];
-        this.item = [];
-      }
-      this.loading = false;
-    },
-    async statusConfirm(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);
-          if (res && res.code === 0) {
-            this.loading = false;
-            this.$notify.success({
-              title: "状态修改成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-    //
-    goodsClassChange(e) {
-      console.log(e);
-    },
-  },
-};
-</script>
-   <style lang="scss" scoped>
-.organize {
-  .no-data {
-    padding: 25px 0;
-    text-align: center;
-    color: #909399;
-    margin: 30px 10px 0 10px;
-    border-radius: 8px;
-    border: 1px solid #dfe6ec;
-    // border-right: 1px solid #dfe6ec;
-    // border-bottom: 1px solid #dfe6ec;
-  }
-  .my-breadcrumb {
-    .my-breadcrumb-item {
-      float: left;
-      span {
-        height: 21px;
-        line-height: 21px;
-      }
-      .label {
-        padding: 0 5px 0 0;
-        color: 010101;
-      }
-      .separator {
-        color: #787878;
-        font-size: 13px;
-        padding: 0 5px 0 0;
-      }
-      &:last-child {
-        .label {
-          color: #787878;
-        }
-      }
-      &.chover {
-        cursor: pointer;
-      }
-    }
-  }
-}
-</style>

+ 0 - 456
src/views/purchaseIn/goodsClass/index.vue

@@ -1,456 +0,0 @@
-<template>
-  <div class="organize pagePadding">
-    <div
-      v-loading="loading"
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-row>
-        <el-col :span="24">
-          <el-col :span="24" style="padding: 12px 0 15px 0">
-            <div class="my-breadcrumb clear">
-              <div
-                class="my-breadcrumb-item"
-                v-for="(item, index) in titleList"
-                :key="item + index"
-                :class="{ chover: true }"
-                @click="changeBreadcrumb(index)"
-              >
-                <span class="label">{{ item.cat_name }}</span
-                ><span class="separator" v-if="index + 1 !== titleList.length"
-                  >/</span
-                >
-              </div>
-            </div>
-          </el-col>
-          <el-col :span="24">
-            <el-row style="padding: 0 0 3px 0">
-              <el-col :span="8">
-                <goods-class
-                  :value="goods_className"
-                  :size="searchSize"
-                  :placeholder="'商品分类'"
-                  :disabled="false"
-                  @selectChange="goodsClassChange"
-                ></goods-class>
-              </el-col>
-
-              <el-col :span="3" style="width: 195px; float: right">
-                <el-button
-                  type="primary"
-                  :size="searchSize"
-                  style="float: right; margin-left: 5px"
-                  @click="searchList"
-                >
-                  刷新
-                </el-button>
-                <el-button
-                  v-if="powers.some((item) => item == '003')"
-                  type="success"
-                  :size="searchSize"
-                  style="float: right"
-                  @click="
-                    addEditFn(
-                      0,
-                      parmValue && parmValue.pid !== '' ? parmValue.pid : '0',
-                      1,
-                      false,
-                      true,
-                      {}
-                    )
-                  "
-                >
-                  添加
-                </el-button>
-              </el-col>
-            </el-row>
-          </el-col>
-        </el-col>
-      </el-row>
-
-      <el-row :gutter="10">
-        <el-col
-          :span="24"
-          v-if="
-            powers && powers.length > 0 && powers.some((item) => item == '001')
-          "
-        >
-          <organize-tree
-            style="margin-left: -5px"
-            :list="depart"
-            :level="1"
-            :pid="0"
-            @addEdit="addEditFn"
-            @openChildren="openChildren"
-            @status="setstatus"
-            @del="del"
-          />
-          <staff-tree
-            style="margin-left: -5px"
-            :list="item"
-            :level="1"
-            :pid="0"
-            @setUpEdit="setUpEdit"
-          />
-        </el-col>
-        <div
-          class="no-data"
-          v-if="item && item.length === 0 && depart && depart.length === 0"
-        >
-          暂无数据
-        </div>
-      </el-row>
-
-      <add-edit
-        :id="modelId"
-        :show-model="showModel"
-        :level="level"
-        :pid="parentIds"
-        :is-add="isAdd"
-        :form-data="formData"
-        :type="parmValue.type"
-        :is-detail="isDetail"
-        @refresh="searchList"
-        @cancel="showModel = false"
-      />
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
-</template>
-<script>
-import asyncRequest from "@/apis/service/purchaseIn/goodsClass";
-
-import mixinPage from "@/mixins/elPaginationHandle";
-// import asyncRequest from "@/apis/service/interest/organize";
-import addEdit from "./addEdit";
-import statusList from "@/assets/js/statusList";
-import { mapGetters } from "vuex";
-import resToken from "@/mixins/resToken";
-export default {
-  name: "organize",
-  components: {
-    addEdit,
-  },
-  mixins: [mixinPage, resToken],
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "organize"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    return {
-      titleList: [],
-      sitem: null,
-      statusList: statusList,
-      loading: true,
-      showModel: false,
-      showInterface: false,
-      isDetail: false,
-      isAdd: true,
-      level: 1,
-      modelId: 0,
-      formData: {},
-      parentIds: "",
-      parmValue: {
-        pid: "", //父级部门ID
-        name: "", // 部门/公司名称
-        nickname: "", // 员工名称
-      },
-      depart: [],
-      item: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      // 表格 - 数据
-      // depart: [],
-    };
-  },
-  mounted() {
-    this.searchList();
-  },
-  methods: {
-    restSearch() {
-      this.parmValue = {
-        pid: "", //父级部门ID
-        name: "", // 部门/公司名称
-        nickname: "", // 员工名称
-      };
-      this.searchList();
-    },
-
-    async changeBreadcrumb(index) {
-      console.log(index);
-      if (index + 1 !== this.titleList.length) {
-        this.parmValue.pid = this.titleList[index].id;
-        this.titleList = this.titleList.slice(0, index + 1);
-      } else {
-        this.parmValue.pid = 0;
-        this.titleList = [];
-      }
-      await this.searchList();
-    },
-    async openChildren(item) {
-      this.parmValue.pid = item.id;
-      let model = {
-        id: item.id,
-        titleName: item.name,
-      };
-      this.titleList.push(model);
-      await this.searchList();
-    },
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    openPasswordModal(id, isDetail) {
-      this.passwordModel = true;
-      this.passwordModelId = id;
-      this.isPasswordDetail = isDetail;
-    },
-    async setUpEdit(id, position) {
-      if (position === "1") {
-        const model = {
-          id: id,
-          position: "2",
-        };
-        let res = await asyncRequest.userp(model);
-        if (res && res.code === 0) {
-          this.$notify.success({
-            title: "设置成功!",
-            message: "",
-          });
-          await this.searchList();
-        } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
-        } else {
-          this.$message.warning(res.message);
-        }
-      } else {
-        this.$message.warning("该账户已是部门负责人!");
-      }
-    },
-    addEditFn(id, pid, level, isDetail, isAdd, formData) {
-      this.showModel = true;
-      this.modelId = id;
-      this.level = level;
-      this.parentIds = pid;
-      this.isDetail = isDetail;
-      this.isAdd = isAdd;
-      this.formData = formData;
-    },
-
-    async setstatus(id, parentIds, level, status) {
-      console.log(
-        `openChildren-id, parentIds, level:${id}-${parentIds}-${level}-${status}`
-      );
-      await this.$confirm(`确定要${status === "0" ? "启用" : "禁用"}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          const model = {
-            id: id,
-            status: status === "1" ? "0" : "1",
-          };
-          let res = await asyncRequest.status(model);
-
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "修改成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-
-    async del(id, parentIds, level, status) {
-      console.log(
-        `openChildren-id, parentIds, level:${id}-${parentIds}-${level}-${status}`
-      );
-      await this.$confirm(`确定要删除?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          const model = {
-            id: id,
-          };
-          let res = await asyncRequest.delete(model);
-
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "删除成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-
-    async concatData(id, parentIds, level) {
-      console.log(id, parentIds, level);
-      this.loading = true;
-      const res = await asyncRequest.list({});
-      let depart = [];
-      if (res && res.code === 0 && res.data) {
-        depart = res.data;
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
-      }
-      let arr = JSON.parse(JSON.stringify(this.depart));
-      // if (level === 1) {
-      arr = arr.map((val, index) => {
-        if (level === 1 ? id : parentIds === val.id) {
-          val.child = depart[index].child;
-        }
-        return val;
-      });
-
-      this.depart = arr;
-      this.loading = false;
-    },
-    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("取消");
-        });
-    },
-    async searchList() {
-      this.loading = true;
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        console.log(res.data);
-        const { depart, item } = res.data;
-        this.depart = res.data.list;
-        this.item = item;
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.depart = [];
-        this.item = [];
-      }
-      this.loading = false;
-    },
-    async statusConfirm(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);
-          if (res && res.code === 0) {
-            this.loading = false;
-            this.$notify.success({
-              title: "状态修改成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-  },
-};
-</script>
-   <style lang="scss" scoped>
-.organize {
-  .no-data {
-    padding: 25px 0;
-    text-align: center;
-    color: #909399;
-    margin: 30px 10px 0 10px;
-    border-radius: 8px;
-    border: 1px solid #dfe6ec;
-    // border-right: 1px solid #dfe6ec;
-    // border-bottom: 1px solid #dfe6ec;
-  }
-  .my-breadcrumb {
-    .my-breadcrumb-item {
-      float: left;
-      span {
-        height: 21px;
-        line-height: 21px;
-      }
-      .label {
-        padding: 0 5px 0 0;
-        color: 010101;
-      }
-      .separator {
-        color: #787878;
-        font-size: 13px;
-        padding: 0 5px 0 0;
-      }
-      &:last-child {
-        .label {
-          color: #787878;
-        }
-      }
-      &.chover {
-        cursor: pointer;
-      }
-    }
-  }
-}
-</style>

+ 0 - 0
src/views/purchaseIn/goodsClass/商品分类


+ 362 - 0
src/views/purchaseIn/purchaseDiffOrder/addEdit.vue

@@ -0,0 +1,362 @@
+<template>
+  <el-dialog
+    :title="title"
+    :center="true"
+    align="left"
+    top="5vh"
+    width="1040px"
+    @close="closeModel"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    v-loading="loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+  >
+    <el-card>
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            ref="ruleForm"
+            label-width="110px"
+            class="demo-ruleForm"
+          >
+            <el-form-item
+              label="登录名"
+              prop="loginName"
+              v-if="id === 'add' || isDetail"
+            >
+              <el-input
+                v-model="ruleForm.loginName"
+                :disabled="isDetail"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="姓名" prop="fullName">
+              <el-input
+                v-model="ruleForm.fullName"
+                :disabled="isDetail"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="手机号" prop="tel">
+              <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input>
+            </el-form-item>
+            <el-form-item label="密码" prop="password" v-if="id === 'add'">
+              <el-input
+                type="password"
+                placeholder="密码"
+                :maxlength="20"
+                v-model="ruleForm.password"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="确认密码" prop="password2" v-if="id === 'add'">
+              <el-input
+                type="password"
+                placeholder="再次输入密码"
+                :maxlength="20"
+                v-model="ruleForm.password2"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <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-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+   </template>
+   <script>
+   import asyncRequest from "@/apis/service/purchaseIn/purchaseDiffOrder";
+   import resToken from "@/mixins/resToken";
+   import {
+    isnumber,
+    isMobile,
+    validEmail,
+    isAlphanumeric,
+    isChinese,
+    isEmoticon,
+    validAlphabets,
+  } from "@/utils/validate";
+   export default {
+    name: 'purchaseDiffOrder',
+    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 (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();
+            }
+          }
+        }
+      };
+      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 (!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();
+        } 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",
+            },
+          ],
+        }
+      };
+    },
+    watch: {
+      showModel: function(val) {
+        this.showModelThis = val;
+        if (val) {
+          this.initForm();
+        }
+      },
+      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 {
+            this.title = "修改账号";
+            this.rulesThis = this.rules;
+          }
+          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;
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } 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 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);
+            }
+          } else {
+            console.log("error submit!!");
+            return false;
+          }
+        });
+      },
+    },
+ 
+  };
+  </script>
+
+   <style lang="scss" scoped>
+   .purchaseDiffOrder {
+    
+   }
+   </style>
+   

+ 402 - 0
src/views/purchaseIn/purchaseDiffOrder/index.vue

@@ -0,0 +1,402 @@
+<template>
+  <div class="purchaseDiffOrder pagePadding">
+    <div
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
+      <!--loading  -->
+      <ex-table
+        v-loading="false"
+        :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 0 80px">
+              <el-col :span="24">
+                <el-col :span="4" style="width: 120px">
+                  <el-select
+                    :size="searchSize"
+                    v-model="parmValue.status"
+                    filterable
+                    clearable
+                    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="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-input
+                    :size="searchSize"
+                    v-model="parmValue.username"
+                    :maxlength="40"
+                    placeholder="手机号"
+                  />
+                </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-button
+                    type="warning"
+                    class="fr"
+                    :size="searchSize"
+                    @click="restSearch"
+                  >
+                    重置
+                  </el-button>
+                </el-col>
+                <el-col :span="3" style="width: 66px; float: right">
+                  <el-button
+                    :size="searchSize"
+                    type="primary"
+                    style="float: right; margin-left: 5px"
+                    @click="searchList"
+                  >
+                    刷新
+                  </el-button>
+                </el-col>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((item) => item == '002')"
+            effect="dark"
+            content="重置密码"
+            placement="top"
+          >
+            <i
+              class="el-icon-refresh-left tb-icon"
+              @click="openPasswordModal(scope.row.id, false)"
+            ></i>
+          </el-tooltip>
+
+          <el-tooltip
+            v-if="powers.some((item) => item == '007')"
+            effect="dark"
+            content="详情"
+            placement="top"
+          >
+            <i
+              class="el-icon-view tb-icon"
+              @click="openModal(scope.row.id, true, scope.row)"
+            ></i>
+          </el-tooltip>
+          <el-tooltip
+            v-if="powers.some((item) => item == '005')"
+            effect="dark"
+            content="修改"
+            placement="top"
+          >
+            <i
+              class="el-icon-edit tb-icon"
+              @click="openModal(scope.row.id, false, scope.row)"
+            ></i>
+          </el-tooltip>
+          <el-tooltip
+            v-if="
+              powers.some((item) => item == '004') && scope.row.status === '1'
+            "
+            effect="dark"
+            content="禁用"
+            placement="top"
+          >
+            <i
+              class="el-icon-video-pause tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.status)"
+            ></i>
+          </el-tooltip>
+          <el-tooltip
+            v-if="
+              powers.some((item) => item == '004') && scope.row.status === '0'
+            "
+            effect="dark"
+            content="启用"
+            placement="top"
+          >
+            <i
+              class="el-icon-video-play tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.status)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+      <add-edit
+        :id="modelId"
+        :sitem="sitem"
+        :show-model="showModel"
+        :is-detail="isDetail"
+        @refresh="searchList"
+        @cancel="showModel = false"
+      />
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import statusList from "@/assets/js/statusList";
+import asyncRequest from "@/apis/service/purchaseIn/purchaseDiffOrder";
+import addEdit from "./addEdit";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "purchaseDiffOrder",
+  mixins: [mixinPage, resToken],
+  components: {
+    addEdit,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "purchaseDiffOrder"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
+      ],
+      statusList: statusList,
+      loading: true,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        name: "", // 业务员名字
+        username: "", // 账号
+        status: "", //
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      tableData: [],
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: [
+        {
+          prop: "nickname",
+          label: "真实姓名",
+        },
+        {
+          prop: "role_name",
+          label: "角色名称",
+        },
+        {
+          prop: "mobile",
+          label: "联系电话",
+        },
+        {
+          prop: "email",
+          label: "邮箱",
+        },
+        {
+          prop: "status",
+          label: "状态",
+          _slot_: "status",
+          width: "80px",
+        },
+        {
+          prop: "addtime",
+          label: "创建时间",
+          sortable: true,
+        },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          _noset_: true,
+          _slot_: "operation",
+        },
+      ],
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    restSearch() {
+      this.parmValue = {
+        name: "", // 业务员名字
+        username: "", // 账号
+        status: "", //
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.searchList();
+    },
+
+    openModal(id, isDetail, sitem) {
+      this.showModel = true;
+      this.modelId = id;
+      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("取消");
+        });
+    },
+    async searchList() {
+      this.loading = true;
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+
+    async statusConfirm(id, status) {
+      let str = status === "1" ? "禁用" : "启用";
+      await this.$confirm("确定要改为" + str + "?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            id: id,
+            status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+  },
+};
+</script>
+   <style lang="scss" scoped>
+.purchaseDiffOrder {
+}
+</style>
+   

+ 1 - 1
src/views/purchaseIn/purchaseOrder/components/columns-table.js

@@ -55,7 +55,7 @@ export default {
   columns: [
     // 表格 - 列参数
     {
-      prop: "post_company",
+      prop: "post_name",
       label: "快递公司",
       width: "125",
       show: true,

+ 5 - 2
src/views/purchaseIn/purchaseOrder/components/purchase-order-in-table.vue

@@ -28,7 +28,9 @@
           <el-table-column fixed="right" width="80">
             <template slot="header" slot-scope="scope">
               <span>操作</span>
-              <el-tooltip  class="fr" style="margin:3px 0 0 0;"
+              <el-tooltip
+                class="fr"
+                style="margin: 3px 0 0 0"
                 v-if="
                   (status === '1' && powers.some((item) => item == '028')) ||
                   (status === '2' && powers.some((item) => item == '028'))
@@ -39,7 +41,7 @@
               >
                 <i
                   class="el-icon-circle-plus-outline tb-icon"
-                  style="color:#63cbe7"
+                  style="color: #63cbe7"
                   @click="openModal('add', '028')"
                 ></i>
               </el-tooltip>
@@ -121,6 +123,7 @@ export default {
     },
   },
   mounted() {
+    console.log(this.tableForm);
     this.initForm();
   },
   methods: {

+ 15 - 6
src/views/purchaseIn/purchaseOrder/components/wsm-in-order-addEdit-form.vue

@@ -61,11 +61,11 @@
             maxlength="100"
           >
           </el-input> -->
+          <!-- :disabled="!(status == '2' && powers.some((item) => item == '021'))" -->
           <search-express
             :value="ruleForm.post_name"
             :placeholder="'请输入物流公司'"
             :names="''"
-            :disabled="!(status == '2' && powers.some((item) => item == '021'))"
             :is-detail="false"
             @searchChange="handleCompany"
           />
@@ -254,7 +254,7 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           console.log(this.sitem);
-          const { post_company, post_code, post_fee, sendtime, send_num } =
+          const { post_name, post_code, post_fee, sendtime, send_num } =
             this.sitem;
           const {
             wsm_mobile,
@@ -271,7 +271,7 @@ export default {
             wsend_num,
             cgdNo: cgdNo || "",
             wsm_code: wsm_code || "",
-            post_name: post_name || [],
+            post_name: [],
             post_code: post_code || "",
             post_fee: post_fee || "",
             post_time: sendtime || "",
@@ -286,11 +286,11 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
-          const item = JSON.parse(JSON.stringify(this.ruleForm));
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.post_name = model.post_name.toString();
 
-          console.log(item);
 
-          const res = await asyncRequest.orderinadd(item);
+          const res = await asyncRequest.orderinadd(model);
           this.loading = false;
           if (res && res.code === 0) {
             this.$notify.success({
@@ -309,6 +309,15 @@ export default {
         }
       });
     },
+    handleCompany(e) {
+      console.log(e);
+      if (e && e.code) {
+        this.ruleForm.post_name = [e.code];
+        this.ruleForm.page = 1;
+      }
+      console.log(this.ruleForm.express_company);
+      this.$refs.ruleForm.validateField("post_name");
+    },
   },
 };
 </script>

+ 41 - 9
src/views/purchaseIn/storeManage/index.vue

@@ -46,12 +46,22 @@
                     @searchChange="handleResignName"
                   />
                 </el-col>
-                <el-col style="width: 110px; padding: 0 0 0 10px">
-                  <el-input
+                <el-col style="width: 160px; padding: 0 0 0 10px">
+                  <el-select
+                    clearable
+                    :size="searchSize"
                     v-model="parmValue.status"
                     placeholder="节点查询"
-                    :size="searchSize"
-                  />
+                    @change="searchList"
+                  >
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
                 </el-col>
 
                 <el-col :span="3" style="width: 66px; float: right">
@@ -203,12 +213,34 @@ export default {
   },
   data() {
     return {
+      options: [
+        {
+          value: "0",
+          label: "待备货申请",
+        },
+        {
+          value: "1",
+          label: "待采购反馈",
+        },
+        {
+          value: "2",
+          label: "待反馈认同",
+        },
+        {
+          value: "3",
+          label: "同意下单",
+        },
+        {
+          value: "4",
+          label: "取消订单",
+        },
+      ],
       statusOptions: [
-        { id: "0", label: "待申请" },
-        { id: "1", label: "待反馈" },
-        { id: "2", label: "已反馈" },
-        { id: "3", label: "同意反馈" },
-        { id: "4", label: "拒绝反馈" },
+        { id: "0", label: "待备货申请" },
+        { id: "1", label: "待采购反馈" },
+        { id: "2", label: "待反馈认同" },
+        { id: "3", label: "同意下单" },
+        { id: "4", label: "取消订单" },
       ],
       loading: true,
       showModel: false,

+ 1 - 1
src/views/sellOut/salesOrder/components/out-order-add-model.vue

@@ -340,7 +340,7 @@ export default {
         this.ruleForm.page = 1;
       }
       console.log(this.ruleForm);
-      // this.$refs.ruleForm.validateField("post_name");
+      this.$refs.ruleForm.validateField("post_name");
     },
   },
 };

+ 11 - 1
src/views/stock/allot/components/goStock-audit.vue

@@ -158,9 +158,19 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
+          console.log(this.ruleForm);
           const model = JSON.parse(JSON.stringify(this.ruleForm));
           model.allot_code = this.sitem.allot_code;
-          model.status = "3";
+          model.post_name = model.post_name.toString();
+          // if (model) {
+          //   model.allot_code = this.sitem.allot_code;
+          //   model.status = "3";
+          //   model.post_name = model;
+          //   model.post_code = model.post_name.toString();
+          // }
+
+          console.log(model);
+
           let res = await asyncRequest.allotgetont(model);
           this.loading = false;
           if (res && res.code === 0) {