zhangjinxing 3 years ago
parent
commit
bef169a416

+ 3 - 6
src/apis/components/search-express.js

@@ -1,10 +1,7 @@
 import http from "@/apis/axios";
 const api = "admin/";
 export default {
-    //省份列表
-    provinceList: (data, params) => http(api + "province", data, "post", params),
-    // 城市列表
-    cityList: (data, params) => http(api + "city", data, "post", params),
-    // 县级区级列表
-    areaList: (data, params) => http(api + "area", data, "post", params),
+    // 快递列表
+    list: (data, params) => http(api + "express", data, "post", params),
+
 };

+ 4 - 1
src/apis/service/purchaseIn/goodsClass/index.js

@@ -7,12 +7,15 @@ export default {
   // 删除
   delete: (data, params) => http(api + "delete", data, "post", params),
   // 分页查询
-  list: (data, params) => http(api + "catlist", data, "post", params),
+  list: (data, params) => http(api + "catplist", 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),
+  // 商品分类列表
+  goodsList: (data, params) => http(api + "catlist", data, "post", params),
+
 };
    

+ 22 - 0
src/apis/service/serviceParam/expressSet/index.js

@@ -0,0 +1,22 @@
+// 物业管理员
+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 + "expresslist", 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 + "expressuse", data, "post", params),
+  // 可用快递列表
+  
+  canList: (data, params) => http(api + "express", data, "post", params),
+
+};
+   

+ 16 - 24
src/components/globalComponents/goodsClass/main.vue

@@ -28,6 +28,7 @@
 <script>
 import asyncRequest from "@/apis/components/goods-class";
 import resToken from "@/mixins/resToken";
+import { isArray } from "@/utils/validate";
 export default {
   name: "goodsClass",
   mixins: [resToken],
@@ -96,36 +97,27 @@ export default {
         this.$emit("searchChange", {});
       }
     },
-    delChild(item) {
-      if (item.child === []) {
-        delete item["child"];
-      } else {
-        item.child.map((sitem) => {
-          if (sitem.child === []) {
-            delete sitem["child"];
-          } else {
-            this.delChild(sitem);
-          }
-          return sitem;
-        });
-      }
-      return item;
+    delChild(list) {
+      let arr = [];
+      list.forEach((v) => {
+        let sitem = JSON.parse(JSON.stringify(v));
+        if (isArray(sitem.child) && sitem.child.length === 0) {
+          delete sitem["child"];
+        } else if (isArray(sitem.child) && sitem.child.length > 0) {
+          sitem.child = this.delChild(sitem.child);
+        }
+        arr.push(sitem);
+      });
+      return arr;
     },
     async getInfo() {
       this.selectLoading = true;
       let res = await asyncRequest.list({});
       if (res && res.code === 0 && res.data) {
         let arr = res.data;
-        arr.map((v) => {
-          if (v.child === []) {
-            delete v["child"];
-          } else {
-            v = this.delChild(v);
-          }
-          return v;
-        });
-        // this.options = res.data;
-        console.log(arr);
+        let list = [];
+        list = this.delChild(arr);
+        this.options = list;
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {

+ 41 - 36
src/components/globalComponents/search-express/main.vue

@@ -12,6 +12,8 @@
     :disabled="disabled"
     :remote-method="remoteMethod"
     :loading="selectLoading"
+    :type="type"
+    :name="name"
     @change="selectChange"
   >
     <el-option
@@ -19,7 +21,7 @@
       :key="item.id + index"
       :label="item.label"
       :value="item.value"
-      :disabled="item.status !== '1'"
+      :disabled="item.canOrder !== '1'"
     >
     </el-option>
   </el-select>
@@ -31,7 +33,16 @@ import resToken from "@/mixins/resToken";
 export default {
   name: "SearchExpress",
   mixins: [resToken],
-  props: ["size", "value", "placeholder", "isDetail", "disabled", "names"],
+  props: [
+    "size",
+    "value",
+    "placeholder",
+    "isDetail",
+    "disabled",
+    "names",
+    "type",
+    "name",
+  ],
   /**
    * 属性集合
    * @param {String}        size             : 组件大小            非必填
@@ -40,6 +51,10 @@ export default {
    * @param {Boolean}       isDetail          : 是否是详情逻辑       必填
    * @param {Boolean}       disabled         : 是否禁用            必填
    * @param {String}        names            : 选中值label         展示详情必填
+   * @param {String}        type            :快递列表状态
+   * @param {String}        name            : 快递模糊查询
+   *
+   *
    */
   /**
    * 事件集合
@@ -50,6 +65,10 @@ export default {
       selectLoading: false,
       searchName: "",
       options: [],
+      formValue: {
+        type: "",
+        name: "",
+      },
     };
   },
   watch: {
@@ -62,32 +81,7 @@ export default {
     },
   },
   created() {
-    this.options = [
-      {
-        id: "1",
-        value: "value1",
-        label: "顺丰",
-        status: "1",
-      },
-      {
-        id: "2",
-        value: "value2",
-        label: "极兔",
-        status: "1",
-      },
-      {
-        id: "3",
-        value: "value3",
-        label: "邮政",
-        status: "1",
-      },
-      {
-        id: "4",
-        value: "value4",
-        label: "中通",
-        status: "1",
-      },
-    ];
+    this.options = [];
     this.selectLoading = false;
   },
   methods: {
@@ -110,20 +104,31 @@ export default {
       }
     },
     async remoteMethod(query) {
+      console.log(query);
       this.selectLoading = true;
       if (query !== "") {
         this.options = [];
-        let formValue = {//看接口入参字段
-          page: 1,
-          size: 100,
-          companyName: query,
-          companyNo: "",
-          itemid: "",
+        let formValue = {
+          //看接口入参字段
+          type: "",
+          name: query,
         };
+        console.log(formValue);
         let res = await asyncRequest.list(formValue);
         if (res && res.code === 0 && res.data) {
-          const { item } = res.data;
-          this.options = item;
+          console.log(res.data);
+          let arr = res.data;
+          arr.forEach((element) => {
+            let obj = {
+              value: element.name,
+              label: element.name,
+              type: element.type,
+              id: element.id,
+              canOrder: element.canOrder,
+            };
+            this.options.push(obj);
+          });
+          console.log(this.options, "options");
         } else if (res && res.code >= 100 && res.code <= 104) {
           await this.logout();
         } else {

+ 7 - 5
src/views/purchaseIn/goodsClass/addEdit.vue

@@ -25,11 +25,11 @@
             label-width="100px"
             class="demo-ruleForm"
           >
-            <el-form-item label="组织名称:" prop="name">
+            <el-form-item label="分类名称:" prop="name">
               <el-input
-                v-model="ruleForm.name"
+                v-model="ruleForm.className"
                 :disabled="isDetail"
-                placeholder="请输入组织名称"
+                placeholder="请输入分类名称"
               />
             </el-form-item>
           </el-form>
@@ -70,13 +70,15 @@ export default {
       title: "",
       btnList,
       showModelThis: this.showModel,
-      ruleForm: {},
+      ruleForm: {
+        className:"",//分类名称
+      },
       rulesThis: this.rules,
       rules: {
         name: [
           {
             required: true,
-            message: "请输入组织名称",
+            message: "请输入分类名称",
             trigger: "blur",
           },
           {

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

@@ -0,0 +1,462 @@
+<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>

+ 12 - 25
src/views/purchaseIn/goodsClass/index.vue

@@ -15,7 +15,7 @@
                 :class="{ chover: true }"
                 @click="changeBreadcrumb(index)"
               >
-                <span class="label">{{ item.titleName }}</span
+                <span class="label">{{ item.cat_name }}</span
                 ><span class="separator" v-if="index + 1 !== titleList.length"
                   >/</span
                 >
@@ -30,7 +30,7 @@
                   :size="searchSize"
                   :placeholder="'商品分类'"
                   :disabled="false"
-                  @searchChange="supplierChange"
+                  @selectChange="goodsClassChange"
                 ></goods-class>
               </el-col>
 
@@ -119,10 +119,10 @@
   </div>
 </template>
 <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-// import asyncRequest from "@/apis/service//interest/organize";
-
 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";
@@ -149,7 +149,6 @@ export default {
   },
   data() {
     return {
-      goods_className: "", //分类名称
       titleList: [],
       sitem: null,
       statusList: statusList,
@@ -189,6 +188,7 @@ export default {
     },
 
     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);
@@ -199,14 +199,12 @@ export default {
       await this.searchList();
     },
     async openChildren(item) {
-      console.log(item);
-      this.parmValue.pid = item.pid;
+      this.parmValue.pid = item.id;
       let model = {
         id: item.id,
         titleName: item.name,
       };
       this.titleList.push(model);
-      console.log(this.titleList);
       await this.searchList();
     },
     openModal(id, isDetail, sitem) {
@@ -369,23 +367,12 @@ export default {
     },
     async searchList() {
       this.loading = true;
-      // { id: "1" }this.parmValue
-      const res = await asyncRequest.list({});
+      const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
-        // const { depart, item } = res.data;
-        // this.depart = depart;
-        // this.item = item;
-        // this.depart = res.data;
-        let obj = {};
-        res.data.forEach((element) => {
-          const { pid, cat_name, child } = element;
-          obj = {
-            name: cat_name,
-            pid: pid,
-            child,
-          };
-          this.depart.push(obj);
-        });
+        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 {

+ 3 - 21
src/views/sellOut/goodsService/components/returnExpress.vue

@@ -9,6 +9,7 @@
     style="width: 100%"
     class="demo-ruleForm"
   >
+    {{ ruleForm }}
     <el-row>
       <el-col :span="12">
         <el-form-item label="物流公司" prop="express_company">
@@ -147,25 +148,6 @@ export default {
           },
         ],
       },
-      express_company_options: [
-        {
-          value: "value1",
-          label: "顺丰",
-        },
-        {
-          value: "value2",
-          label: "极兔",
-        },
-        {
-          value: "value3",
-          label: "邮政",
-        },
-        {
-          value: "value4",
-          label: "中通",
-        },
-      ],
-      return_value: "", //退回仓库
     };
   },
   computed: {
@@ -233,6 +215,8 @@ export default {
             express_company: [], //物流公司
             express_numbres: "", //物流单号
             express_fee: "", //物流费用
+            type: "",
+            name: "",
           };
         }
       });
@@ -290,8 +274,6 @@ export default {
       if (e && e.code) {
         this.ruleForm.express_company = [e.code];
         this.ruleForm.page = 1;
-        // 调接口
-        console.log(this.ruleForm);
       }
     },
   },

+ 362 - 0
src/views/serviceParam/expressSet/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/serviceParam/expressSet";
+   import resToken from "@/mixins/resToken";
+   import {
+    isnumber,
+    isMobile,
+    validEmail,
+    isAlphanumeric,
+    isChinese,
+    isEmoticon,
+    validAlphabets,
+  } from "@/utils/validate";
+   export default {
+    name: 'expressSet',
+    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>
+   .expressSet {
+    
+   }
+   </style>
+   

+ 387 - 0
src/views/serviceParam/expressSet/index.vue

@@ -0,0 +1,387 @@
+<template>
+  <div class="expressSet 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: 150px">
+                  <el-select
+                    :size="searchSize"
+                    v-model="parmValue.type"
+                    filterable
+                    clearable
+                    placeholder="快递属性"
+                    style="width: 100%"
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
+                    <el-option
+                      v-for="item in expressType"
+                      :key="'status' + item.type"
+                      :label="item.label"
+                      :value="item.type"
+                    />
+                  </el-select>
+                </el-col>
+                <el-col :span="4" style="width: 220px; padding: 0 0 0 10px">
+                  <el-input
+                    :size="searchSize"
+                    v-model="parmValue.name"
+                    :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.canOrder == '0' ? 'warning' : ''"
+            v-text="
+              (
+                statusOptions.find((item) => item.id == scope.row.canOrder) ||
+                {}
+              ).label || '--'
+            "
+          ></el-tag>
+        </template>
+        <template #type="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.type == '0' ? 'warning' : ''"
+            v-text="
+              (expressType.find((item) => item.type == 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.canOrder === '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.canOrder === '0'
+            "
+            effect="dark"
+            content="启用"
+            placement="top"
+          >
+            <i
+              class="el-icon-video-play tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.canOrder)"
+            ></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 asyncRequest from "@/apis/service/serviceParam/expressSet";
+import addEdit from "./addEdit";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "expressSet",
+  mixins: [mixinPage, resToken],
+  components: {
+    addEdit,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "expressSet"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      sitem: null,
+      expressType: [
+        {
+          type: "0",
+          label: "国内",
+        },
+        {
+          type: "1",
+          label: "国际",
+        },
+        {
+          type: "2",
+          label: "国际邮政",
+        },
+      ],
+      // 状态
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
+      ],
+      loading: true,
+      parmValue: {
+        type: "", //快递属性
+        name: "", //快递名称
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: [
+        {
+          prop: "comTypeName",
+          label: "快递类型名称",
+        },
+        {
+          prop: "name",
+          label: "快递名称",
+        },
+        {
+          prop: "shortName",
+          label: "快递简称",
+        },
+        {
+          prop: "shortNameEn",
+          label: "快递英文",
+        },
+        {
+          prop: "type",
+          label: "快递属性",
+          _slot_: "type",
+          width: "100px",
+        },
+        {
+          prop: "canOrder",
+          label: "状态",
+          _slot_: "status",
+          width: "80px",
+        },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          _noset_: true,
+          _slot_: "operation",
+          width: "50px",
+        },
+      ],
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    restSearch() {
+      this.parmValue = {
+        type: "", //快递属性
+        name: "", //快递名称
+        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 searchList() {
+      this.loading = true;
+      console.log(this.parmValue);
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.tableData.map((v) => {
+          v.status = v.type;
+          return v;
+        });
+
+        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) {
+      console.log(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>
+</style>
+