Browse Source

Merge branch 'live' into edit

戴艳蓉 3 years ago
parent
commit
87e09bc6c0

+ 0 - 26
src/apis/service/purchaseIn/addStore/index.js

@@ -1,26 +0,0 @@
-// 物业管理员
-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 + "wareinfo", data, "post", params),
-  // 更新
-  update: (data, params) => http(api + "update", data, "post", params),
-  // 修改状态
-  status: (data, params) => http(api + "accountstatus", data, "post", params),
-  // 获取仓库负责人列表
-  getlist: (data, params) => http(api + 'userlist', data, 'post', params),
-  // 获取仓库归属公司列表
-  getCompany: (data, params) => http(api + 'supplierlist', data, 'post', params),
-  //新建仓库
-  add: (data, params) => http(api + 'WareHouse/add', data, 'post', params),
-  
-  
-};
-   

+ 1 - 0
src/components/all-organize/main.vue

@@ -5,6 +5,7 @@
     :placeholder="placeholder"
     v-model="value"
     :options="options"
+    :size="size || 'medium'"
     @change="selectChange"
     :props="{
       expandTrigger: 'hover',

+ 1 - 1
src/components/search-account/main.vue

@@ -32,7 +32,7 @@ export default {
   mixins: [resToken],
   props: [
     "size",
-    "code",
+    "value",
     "placeholder",
     "isDetail",
     "disabled",

+ 1 - 1
src/components/search-supplier/main.vue

@@ -31,7 +31,7 @@ import resToken from "@/mixins/resToken";
 export default {
   name: "SearchSupplier",
   mixins: [resToken],
-  props: ["size", "code", "placeholder", "isDetail", "disabled", "names"],
+  props: ["size", "value", "placeholder", "isDetail", "disabled", "names"],
   /**
    * 属性集合
    * @param {String}        size             : 组件大小            非必填

+ 0 - 13
src/views/interest/account/addEdit.vue

@@ -47,19 +47,6 @@
                 :placeholder="'请选择所在部门'"
                 @searchChange="itemidChange"
               />
-              <!-- <el-cascader
-                style="width: 100%"
-                :disabled="isDetail"
-                :placeholder="'请选择所在部门'"
-                v-model="ruleForm.itemid"
-                :options="organizeList"
-                :props="{
-                  expandTrigger: 'hover',
-                  children: 'child',
-                  multiple: true,
-                  checkStrictly: true,
-                }"
-              ></el-cascader> -->
             </el-form-item>
             <el-form-item label="邮箱" prop="email">
               <el-input v-model="ruleForm.email" :disabled="isDetail" />

+ 0 - 363
src/views/purchaseIn/addStore/addEdit.vue

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

+ 0 - 517
src/views/purchaseIn/addStore/index.vue

@@ -1,517 +0,0 @@
-<template>
-  <div class="addStore pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      
- 
-      <el-col :span="24" style="text-align: right">
-        <el-button
-          v-if="addId === 'add'"
-          type="primary"
-          @click="submitForm('ruleForm')"
-          >保 存
-        </el-button>
-        <el-button @click="showModelThis = false">{{
-          isDetail ? "关 闭" : "取 消"
-        }}</el-button>
-      </el-col>
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
-  </div>
-</template>
-<script>
-import asyncRequest from "@/apis/service/purchaseIn/addStore";
-// import resToken from "@/mixins/resToken";
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-// import statusList from "@/assets/js/statusList";
-import addEdit from "./addEdit";
-import { mapGetters } from "vuex";
-import { isMobile } from "@/utils/validate";
-export default {
-  name: "addStore",
-  // props: ["showModel", "id", "isDetail", "sitem"],
-  // mixins: [resToken],
-  mixins: [mixinPage, resToken],
-  components: {
-    addEdit,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "addStore"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    const validatemobile = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      } else {
-        if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
-        } else {
-          callback();
-        }
-      }
-    };
-    return {
-      stockNo: [""],
-      stockNames: "",
-      accountDutyer: "", //仓库负责人
-      // addId: this.$route.query.id,
-      addId: "",
-      // route: this.$route,
-      roleList: [],
-      loading: false,
-      title: "添加账号",
-      organizeList: [],
-      showModelThis: this.showModel,
-      //省市区接口入参
-      addr_code: {
-        provice_code: "",
-        city_code: "",
-        area_code: "",
-      },
-      ruleForm: {
-        storeToCompany: "",
-        selectaccount_go: "", //公司
-        accountName: "", //仓库名称
-        accountDutyer: "", //仓库负责人
-        dutyer_mobile: "",
-        linker: "", //收发货联系人
-        linker_mobile: "", //收发货人联系电话
-        linker_detail: "",
-      }, //
-      rulesThis: this.rules,
-      rules: {
-        storeToCompany: [
-          {
-            // type: "array",
-            required: true,
-            message: "请选择仓库所在公司",
-            trigger: "blur",
-            // trigger: "change",
-          },
-        ],
-        accountName: [
-          {
-            required: true,
-            message: "请输入仓库名称",
-            trigger: "blur",
-          },
-        ],
-        accountDutyer: [
-          {
-            // type: "array",
-            required: true,
-            message: "请选择仓库负责人",
-            // trigger: "change",
-            trigger: "blur",
-          },
-        ],
-        accountToArea: [
-          {
-            type: "array",
-            required: true,
-            message: "请选择仓库所在地址",
-            trigger: "change",
-          },
-        ],
-        accountDetail: [
-          {
-            required: true,
-            message: "请选择仓库详细地址",
-            trigger: "blur",
-          },
-        ],
-        linker: [
-          {
-            required: true,
-            message: "请填写收发货联系人",
-            trigger: "blur",
-          },
-        ],
-        linker_mobile: [
-          {
-            required: true,
-            trigger: "blur",
-            validator: validatemobile,
-          },
-        ],
-        dutyer_mobile: [
-          {
-            required: true,
-            trigger: "blur",
-            validator: validatemobile,
-          },
-        ],
-        linker_addr: [
-          {
-            type: "array",
-            required: true,
-            message: "请填写收发货联系人地址",
-            trigger: "change",
-          },
-        ],
-        linker_detail: [
-          {
-            required: true,
-            message: "请输入详细地址",
-            trigger: "blur",
-          },
-        ],
-      },
-      parmValue: {
-        //入参
-        name: "", //仓库名称
-        supplierNo: "", //供应商编码
-        wsmtype: 1, //仓库类型
-        addr: "", //仓库地址
-        contactor: "", //仓库联系人
-        mobile: "", //仓库联系方式
-        position: "", //联系人职位
-        wsm_name: "", //	收发货联系人
-        wsm_mobile: "", //收发货联系方式
-        addr_code: {
-          provice_code: "",
-          city_code: "",
-          area_code: "",
-        },
-        wsm_addr: "", //地址详细
-      },
-    };
-  },
-  mounted() {
-    this.addId = this.$route.query.id;
-    this.getCompany();
-    this.initForm();
-  },
-  methods: {
-    stockChange(e) {
-      console.log(e);
-    },
-    // 获取公司列表
-    getCompanyName(val) {
-      this.ruleForm.storeToCompany = val[1];
-      console.log(this.ruleForm.storeToCompany);
-    },
-    // 联系人电话
-    linkerMobile(val) {
-      this.parmValue.wsm_mobile = val;
-    },
-    // 联系人
-    linker(val) {
-      this.parmValue.wsm_name = val;
-    },
-    // 仓库详细地址
-    accountDetail(val) {
-      console.log(val);
-      this.parmValue.addr = val;
-    },
-    //仓库地址选择
-    areaSelect(val) {
-      console.log(val);
-      this.ruleForm.accountToArea = val;
-      this.parmValue.addr = val;
-    },
-    // 收发货地址选择
-    selectArea(val) {
-      this.parmValue.addr_code.provice_code = val[0];
-      this.parmValue.addr_code.city_code = val[1];
-      this.parmValue.addr_code.area_code = val[2];
-      this.ruleForm.linker_addr = val;
-    },
-    // 收发货详细地址
-    linkerDetail(val) {
-      this.parmValue.wsm_addr = val;
-    },
-    // 仓库所在公司
-    getValue(val) {
-      this.parmValue.supplierNo = val;
-    },
-    // 仓库名
-    getValue1(val) {
-      this.parmValue.name = val;
-    },
-    // 负责人
-    getValue2(val) {
-      console.log(val);
-      this.accountDutyer = val;
-    },
-    closeModel() {
-      console.log("closeModel!!");
-    },
-    async initForm() {
-      this.loading = true;
-      // await this.getClist();
-      // await this.getRole();
-      this.ruleForm = {
-        accountName: "my-account", //仓库名称
-        accountDutyer: "", //仓库负责人
-        linker: "", //收发货联系人
-
-        linker_mobile: "", //收发货人联系电话
-        linker_addr: "", //收发货地址
-        selectaccount_go_options: [],
-        accountDutyer_options: [],
-      };
-      console.log(this.addId);
-      if (this.addId === "add") {
-        console.log("新建仓库节点");
-        console.log(this.ruleForm);
-        this.rulesThis = this.rules;
-        await this.resetForm();
-      } else if (this.addId === "detail") {
-        console.log("detail");
-        this.rulesThis = {};
-        await this.resetForm(this.sitem);
-        // await this.initData()
-      } else {
-        console.log("当前是编辑按钮");
-        this.rulesThis = this.rules;
-      }
-      this.loading = false;
-    },
-
-    async getClist() {
-      this.organizeList = [];
-      const res = await asyncRequest.getClist({});
-      if (res && res.code === 0 && res.data) {
-        this.organizeList = res.data;
-        this.recursion(this.organizeList);
-      }
-    },
-    recursion(list) {
-      list.map((v) => {
-        if (v && Array.isArray(v.child)) {
-          v.value = v.id + "";
-          v.label = v.name;
-          if (v.child.length === 0) {
-            delete v["child"];
-          } else {
-            this.recursion(v.child);
-          }
-        }
-        return v;
-      });
-    },
-    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 resetForm(sitem) {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.ruleForm = {
-            dutyer_mobile: "18818818818",
-            accountDetail: "顺义区宏远888",
-            selectaccount_go: "", //出库仓库
-            selectaccount_go_options: [], //出库仓库列表
-            accountName: "my-account", //仓库名称
-            linker: "张三",
-            linker_mobile: "13223289230",
-            linker_detail: "朝阳区太阳城666",
-            accountDutyer: "", //仓库负责人
-            accountDutyer_options: [], //仓库负责人列表
-          };
-          if (this.id === "add" || this.isDetail) {
-            this.rules.username[0].required = false;
-          }
-        }
-      });
-    },
-    async submitForm(formName) {
-      let paraValue = {
-        name: this.ruleForm.accountName,
-        supplierNo: this.ruleForm.storeToCompany,
-        wsmtype: "1", //仓库类型
-        addr: this.ruleForm.accountDetail, //仓库地址
-        contactor: this.accountDutyer, //仓库联系人职位
-        mobile: this.ruleForm.dutyer_mobile, //仓库联系人
-        position: "采购",
-        // wsm_type:"",后台暂时不用
-        wsm_name: this.ruleForm.linker,
-        wsm_mobile: this.ruleForm.linker_mobile,
-        addr_code: {
-          // provice_code: this.ruleForm.linker_addr[0],
-          // city_code: this.ruleForm.linker_addr[1],
-          // area_code: this.ruleForm.linker_addr[2],
-        },
-        wsm_addr: this.ruleForm.linker_detail,
-        addrs_code: {
-          // provice_code: this.ruleForm.accountToArea[0],
-          // city_code: this.ruleForm.accountToArea[1],
-          // area_code: this.ruleForm.accountToArea[2],
-        },
-      };
-      console.log(paraValue);
-      console.log(this.ruleForm);
-      this.$refs[formName].validate((valid) => {
-        console.log(valid);
-        if (valid) {
-          console.log("submit!");
-          this.getList(paraValue);
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    // 表单提交
-    async getList(paraValue) {
-      const res = await asyncRequest.add(paraValue);
-      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.loading = false;
-    },
-    async getDutyer() {
-      this.loading = true;
-      const obj = {
-        name: "",
-        page: 1,
-        size: 15,
-        status: "",
-        username: "",
-      };
-      const res = await asyncRequest.getlist(obj);
-      if (res && res.code === 0 && res.data) {
-        const { list } = res.data;
-        this.ruleForm.accountDutyer_options = list;
-        console.log(this.ruleForm.accountDutyer_options);
-        // console.log(res.data.list);
-        // res.data.list.forEach((element) => {
-        //   // let dutyer = {
-        //   //   label: element.nickname,
-        //   //   value: element.depart[0] ? element.depart[0].name : "",
-        //   // };
-        //   // console.log(this.ruleForm.accountDutyer_options);
-        //   this.ruleForm.accountDutyer_options.push(element);
-        // });
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.tableData = [];
-        this.pageInfo.total = 0;
-      }
-      this.loading = false;
-    },
-    async getCompany() {
-      this.loading = true;
-      const obj = {
-        page: 1,
-        size: 15,
-      };
-      const res = await asyncRequest.getCompany(obj);
-      if (res && res.code === 0 && res.data) {
-        console.log(res.data.list);
-        res.data.list.forEach((element) => {
-          let company = {
-            label: element.name,
-            value: element.code,
-          };
-          // console.log(this.ruleForm.selectaccount_go_options);
-          this.ruleForm.selectaccount_go_options.push(company);
-          // this.ruleForm.accountDutyer_options.push(dutyer);
-        });
-        // console.log(this.ruleForm.selectaccount_go_options);
-        // 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.getDutyer();
-      this.loading = false;
-    },
-    // 新建仓库
-    async addaccount() {
-      this.loading = true;
-      console.log(this.parmValue);
-      const res = await asyncRequest.addaccount(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        console.log(res.data.list);
-        res.data.list.forEach((element) => {
-          // console.log(element.nickname);
-          let company = {
-            label: element.name,
-            value: element.code,
-          };
-          this.ruleForm.selectaccount_go_options.push(company);
-          // this.ruleForm.accountDutyer_options.push(dutyer);
-        });
-        console.log(this.ruleForm.selectaccount_go_options);
-        // 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 getStocDetail() {
-      this.loading = true;
-      // console.log(this.parmValue);
-      const res = await asyncRequest.detail(5);
-      if (res && res.code === 0 && res.data) {
-        console.log(res.data.list);
-        res.data.list.forEach((element) => {
-          // console.log(element.nickname);
-          let company = {
-            label: element.name,
-            value: element.code,
-          };
-          this.ruleForm.selectaccount_go_options.push(company);
-          // this.ruleForm.accountDutyer_options.push(dutyer);
-        });
-        console.log(this.ruleForm.selectaccount_go_options);
-        // 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;
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-</style>

+ 165 - 76
src/views/purchaseIn/storeSet/addEdit.vue

@@ -3,7 +3,7 @@
     :title="title"
     :center="true"
     align="left"
-    top="5vh"
+    top="8vh"
     width="1040px"
     @close="closeModel"
     :close-on-click-modal="false"
@@ -13,7 +13,7 @@
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.8)"
   >
-    <el-card>
+    <el-card style="margin-top: -20px">
       <el-row :gutter="10">
         <el-col :span="24">
           <el-form
@@ -23,9 +23,8 @@
             :rules="rulesThis"
             label-width="100px"
             class="demo-ruleForm"
-            v-if="addId === 'add'"
           >
-            <div style="padding: 12px 0">
+            <div style="padding: 8px 0 12px 0">
               <el-divider content-position="center">仓库信息</el-divider>
             </div>
 
@@ -38,8 +37,10 @@
                 >
                   <search-supplier
                     :value="supplierNo"
+                    :names="supplier_name"
+                    :disabled="isDetail"
                     :placeholder="'请输入公司名称'"
-                    @searchChange="getCompanyName"
+                    @searchChange="supplierChange"
                   />
                 </el-form-item>
               </el-col>
@@ -48,6 +49,8 @@
                   <el-input
                     placeholder="请输入仓库名称"
                     filterable
+                    :disabled="isDetail"
+                    maxlength="20"
                     clearable
                     v-model="ruleForm.name"
                   >
@@ -55,77 +58,79 @@
                 </el-form-item>
               </el-col>
             </el-row>
-            <el-row>
-              <el-col :span="12">
-                <el-form-item label="省/市/区" prop="addr_code">
-                  <select-area
-                    :value="ruleForm.addr_code"
-                    @selectChange="areaSelect"
-                  />
-                </el-form-item>
-              </el-col>
-              <el-col :span="12">
-                <el-form-item label="详细地址" prop="addr">
-                  <el-input
-                    placeholder="请输入内容"
-                    v-model="ruleForm.addr"
-                    clearable
-                  >
-                  </el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
 
             <el-row>
               <el-col :span="12">
                 <el-form-item
                   label="负责人"
-                  prop="accountDutyer"
+                  prop="contactor"
                   style="width: 100%"
                 >
                   <search-account
                     :size="searchSize"
-                    :code="accountNo"
+                    :value="ruleForm.contactor"
                     :placeholder="'请输入负责人'"
-                    :is-detail="true"
-                    :disabled="false"
+                    :is-detail="isDetail"
+                    :disabled="isDetail"
                     :names="accountNames"
-                    @change="accountChange"
+                    @searchChange="accountChange"
                   /> </el-form-item
               ></el-col>
               <el-col :span="12">
-                <el-form-item label="负责人电话" prop="dutyer_mobile">
+                <el-form-item label="负责人电话" prop="mobile">
                   <el-input
-                    type="number"
                     placeholder="请输入联系人电话"
-                    v-model="ruleForm.dutyer_mobile"
+                    v-model="ruleForm.mobile"
+                    maxlength="11"
                     clearable
                   >
                   </el-input> </el-form-item
               ></el-col>
             </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="省/市/区" prop="addr_code">
+                  <select-area
+                    :placeholder="'请选择省/市/区'"
+                    :value="ruleForm.addr_code"
+                    @selectChange="selectAreaAddr_code"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="详细地址" prop="addr">
+                  <el-input
+                    placeholder="请输入详细地址"
+                    v-model="ruleForm.addr"
+                    maxlength="100"
+                    clearable
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
             <div style="padding: 0 0 12px 0">
               <el-divider content-position="center">收发货信息</el-divider>
             </div>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="联系人" prop="linker">
+                <el-form-item label="联系人" prop="wsm_name">
                   <el-input
                     placeholder="请填写联系人"
-                    v-model="ruleForm.linker"
+                    maxlength="20"
+                    :disabled="isDetail"
+                    v-model="ruleForm.wsm_name"
                     clearable
-                    @change="linker"
                   >
                   </el-input> </el-form-item
               ></el-col>
               <el-col :span="12">
-                <el-form-item label="电话" prop="linker_mobile">
+                <el-form-item label="电话" prop="wsm_mobile">
                   <el-input
-                    type="number"
                     placeholder="请输入联系人电话"
-                    v-model="ruleForm.linker_mobile"
+                    v-model="ruleForm.wsm_mobile"
+                    maxlength="11"
                     clearable
-                    @change="linkerMobile"
                   >
                   </el-input> </el-form-item
               ></el-col>
@@ -135,17 +140,19 @@
               <el-col :span="12">
                 <el-form-item label="省/市/区" prop="addrs_code">
                   <select-area
+                    :disabled="isDetail"
                     :value="ruleForm.addrs_code"
-                    @selectChange="selectArea"
+                    :placeholder="'请选择省/市/区'"
+                    @selectChange="selectAreaAddrs_code"
                   /> </el-form-item
               ></el-col>
               <el-col :span="12">
-                <el-form-item label="详细地址" prop="linker_detail">
+                <el-form-item label="详细地址" prop="wsm_addr">
                   <el-input
                     placeholder="请输入详细地址"
-                    v-model="ruleForm.linker_detail"
+                    maxlength="100"
+                    v-model="ruleForm.wsm_addr"
                     clearable
-                    @change="linkerDetail"
                   >
                   </el-input> </el-form-item
               ></el-col>
@@ -178,15 +185,15 @@ import {
 } from "@/utils/validate";
 export default {
   name: "storeSet",
-  props: ["showModel", "id", "isDetail", "sitem"],
+  props: ["showModel", "id", "isDetail"],
   mixins: [resToken],
   data() {
     const validatemobile = (rule, value, callback) => {
       if (value === "") {
-        callback(new Error("负责人联系方式不能为空!"));
+        callback(new Error("联系方式不能为空!"));
       } else {
         if (!isMobile(value)) {
-          callback(new Error("负责人联系方式格式不正确!"));
+          callback(new Error("联系方式格式不正确!"));
         } else {
           callback();
         }
@@ -194,10 +201,10 @@ export default {
     };
     const validatewsmmobile = (rule, value, callback) => {
       if (value === "") {
-        callback(new Error("收发货联系方式不能为空!"));
+        callback(new Error("联系方式不能为空!"));
       } else {
         if (!isMobile(value)) {
-          callback(new Error("收发货联系方式格式不正确!"));
+          callback(new Error("联系方式格式不正确!"));
         } else {
           callback();
         }
@@ -205,19 +212,20 @@ export default {
     };
 
     return {
+      supplier_name: "",
       loading: false,
-      title: "添加账号",
+      title: "添加仓库",
       showModelThis: this.showModel,
       ruleForm: {
         name: "", // 仓库名称
         supplierNo: [], //供应商编码
-        wsmtype: "", //仓库类型 目前随便填
+        // wsmtype: "", //仓库类型 目前随便填
         addr_code: [], //仓库省市区
         addr: "", //仓库详细地址
         contactor: [], //仓库联系人
         mobile: "", //仓库联系方式
-        position: "", //联系人职位  目前随便填
-        wsm_type: "", //目前随便填
+        // position: "", //联系人职位  目前随便填
+        // wsm_type: "", //目前随便填
 
         wsm_name: "", //收发货联系人
         wsm_mobile: "", //收发货联系方式
@@ -331,7 +339,7 @@ export default {
       console.log("closeModel!!");
     },
     //供应商公司选择
-    searchChange(e) {
+    supplierChange(e) {
       if (e && e.id) {
         this.ruleForm.supplierNo = [e.code]; //供应商编码
       } else {
@@ -339,7 +347,27 @@ export default {
       }
       this.$refs.ruleForm.validateField("supplierNo");
     },
+    //仓库省市区
+    selectAreaAddr_code(e) {
+      this.ruleForm.addr_code = e;
+      this.$refs.ruleForm.validateField("addr_code");
+    },
+    //收发货省市区
+    selectAreaAddrs_code(e) {
+      this.ruleForm.addrs_code = e;
+      this.$refs.ruleForm.validateField("addrs_code");
+    },
+    //负责人选择
+    accountChange(e) {
+      if (e && e.id) {
+        this.ruleForm.contactor = [e.id];
+      } else {
+        this.ruleForm.contactor = [];
+      }
+      this.$refs.ruleForm.validateField("contactor");
+    },
     async initForm() {
+      this.supplier_name = "";
       this.loading = true;
       if (this.id === "add") {
         this.title = "新建仓库";
@@ -353,7 +381,7 @@ export default {
           this.title = "修改账号";
           this.rulesThis = this.rules;
         }
-        await this.resetForm(this.sitem);
+        await this.resetForm();
         await this.initData();
       }
       this.loading = false;
@@ -361,8 +389,42 @@ export default {
     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;
+        const {
+          addr,
+          addr_code,
+          addrs_code,
+          contactor,
+          mobile,
+          name,
+          supplierNo,
+          supplier_name,
+          wsm_addr,
+          wsm_code,
+          wsm_mobile,
+          wsm_name,
+        } = res.data;
+
+        this.supplier_name = supplierNo;
+        this.ruleForm = {
+          name: name, // 仓库名称
+          supplierNo: [supplierNo], //供应商编码
+          // wsmtype: "", //仓库类型 目前随便填
+          addr_code: [], //仓库省市区
+          addr: addr, //仓库详细地址
+          contactor: [], //仓库联系人
+          mobile: mobile, //仓库联系方式
+          // position: "", //联系人职位  目前随便填
+          // wsm_type: "", //目前随便填
+
+          wsm_name: wsm_name, //收发货联系人
+          wsm_mobile: wsm_mobile, //收发货联系方式
+          wsm_addr: wsm_addr, //收发货地址详细
+          addrs_code: [], //收发货省市区
+        };
+        console.log(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 {
@@ -376,40 +438,67 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
-            name: "", // 仓库名称
+            name: "测试测试", // 仓库名称
             supplierNo: [], //供应商编码
-            wsmtype: "", //仓库类型 目前随便填
+            // wsmtype: "", //仓库类型 目前随便填
             addr_code: [], //仓库省市区
-            addr: "", //仓库详细地址
+            addr: "测试地址测试地址", //仓库详细地址
             contactor: [], //仓库联系人
-            mobile: "", //仓库联系方式
-            position: "", //联系人职位  目前随便填
-            wsm_type: "", //目前随便填
+            mobile: "1989898977", //仓库联系方式
+            // position: "", //联系人职位  目前随便填
+            // wsm_type: "", //目前随便填
 
-            wsm_name: "", //收发货联系人
-            wsm_mobile: "", //收发货联系方式
-            wsm_addr: "", //收发货地址详细
+            wsm_name: "张三", //收发货联系人
+            wsm_mobile: "19888888888", //收发货联系方式
+            wsm_addr: "测试1", //收发货地址详细
             addrs_code: [], //收发货省市区
           };
         }
       });
     },
-
+    setCode(list) {
+      let model = {
+        provice_code: list[0],
+        city_code: list[2],
+        area_code: list[2],
+      };
+      return model;
+    },
+    getId(list) {
+      let arr = JSON.parse(JSON.stringify(list));
+      return arr.join(",");
+    },
     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 {
+            name,
+            supplierNo,
+            addr_code,
+            addr,
+            contactor,
+            mobile,
+            wsm_name,
+            wsm_mobile,
+            wsm_addr,
+            addrs_code,
+          } = JSON.parse(JSON.stringify(this.ruleForm));
           const model = {
             id: this.id,
-            username: username || "", // 账号
-            nickname: name || "", // 真实姓名
-            mobile: mobile || "",
-            email: email || "",
-            role: role_id || "",
-            status: status || "",
+            name,
+            supplierNo: this.getId(supplierNo),
+            addr_code: this.setCode(addr_code),
+            addr,
+            contactor: this.getId(contactor),
+            mobile,
+            wsm_name,
+            wsm_mobile,
+            wsm_addr,
+            addrs_code: this.setCode(addrs_code),
+            position: "1", //暂时随便填
+            wsm_type: "1", //后台暂时不用
+            wsmtype: "1", //后台暂时不用
           };
           let res = {};
           if (this.id === "add") {

+ 0 - 10
src/views/purchaseIn/storeSet/index.vue

@@ -180,20 +180,11 @@
     <div v-else>
       <no-auth></no-auth>
     </div>
-
-    <add-edit
-      :showModel="showModel"
-      :id="modelId"
-      :isDetail="isDetail"
-      @refresh="searchList"
-      @cancel="showModel = false"
-    ></add-edit>
   </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/storeSet";
 import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
@@ -225,7 +216,6 @@ export default {
       stock_sn: "", //企业/仓库编码
       stock_name: "", //企业/仓库名称
       link: "", //联系电话/联系人
-      statusList: statusList,
       loading: true,
       showModel: false,
       isDetail: false,