|
@@ -1,369 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="addStore pagePadding">
|
|
|
- <div
|
|
|
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
|
|
|
- >
|
|
|
- {{ title }}
|
|
|
- <el-form
|
|
|
- :model="ruleForm"
|
|
|
- :rules="rules"
|
|
|
- ref="ruleForm"
|
|
|
- label-width="150px"
|
|
|
- >
|
|
|
- <el-form-item label="仓库所在公司" prop="storeToCompany">
|
|
|
- <el-cascader
|
|
|
- placeholder="请选择出库仓库"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- v-model="ruleForm.selectStock_go"
|
|
|
- :options="ruleForm.selectStock_go_options"
|
|
|
- style="width: 30%"
|
|
|
- @change="stockName(true)"
|
|
|
- ></el-cascader>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="请输入仓库名称" prop="stockName">
|
|
|
- <el-input
|
|
|
- placeholder="请输入仓库名称"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- v-model="ruleForm.stockName"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="仓库负责人" prop="stockCharge">
|
|
|
- <el-cascader
|
|
|
- placeholder="请选择仓库负责人"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- v-model="ruleForm.stockDutyer"
|
|
|
- :options="ruleForm.stockDutyer_options"
|
|
|
- style="width: 30%"
|
|
|
- @change="stockName()"
|
|
|
- ></el-cascader>
|
|
|
- </el-form-item>
|
|
|
- <!-- 省/市/区选择组件 -->
|
|
|
- <el-form-item label="仓库所在省/市/区" prop="stockToArea">
|
|
|
- <AreaSelect @areaSelect="areaSelect"></AreaSelect>
|
|
|
- </el-form-item>
|
|
|
- <!-- 仓库详细地址 -->
|
|
|
- <el-form-item label="仓库所在详细地址" prop="stockDetail">
|
|
|
- <el-input
|
|
|
- :size="searchSize"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="input"
|
|
|
- clearable
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <!-- 保 存 并 发 起 流 程 -->
|
|
|
- <el-form-item label="" prop="stock_go_product">
|
|
|
- <el-col :span="24" style="text-align: right; margin-top: 10px">
|
|
|
- <el-button type="primary" @click="save">保 存 </el-button>
|
|
|
- <el-button type="warning" @click="submitForm"
|
|
|
- >保 存 并 发 起 流 程
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <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 ExTable from "@/components/ExTableNew.vue";
|
|
|
-import statusList from "@/assets/js/statusList";
|
|
|
-import asyncRequest from "@/apis/service/purchaseIn/addStore";
|
|
|
-import addEdit from "./addEdit";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
-import AreaSelect from "@/components/AreaSelect.vue"; //省/市/区选择组件
|
|
|
-
|
|
|
-// let id = 10;
|
|
|
-export default {
|
|
|
- name: "addStore",
|
|
|
- mixins: [mixinPage, resToken],
|
|
|
- components: {
|
|
|
- addEdit,
|
|
|
- ExTable,
|
|
|
- AreaSelect, //省/市/区选择组件
|
|
|
- },
|
|
|
- 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() {
|
|
|
- return {
|
|
|
- title: "",
|
|
|
- ruleForm: {
|
|
|
- selectStock_go: "", //出库仓库
|
|
|
- selectStock_go_options: [], //出库仓库列表
|
|
|
- stockName: "", //仓库名称
|
|
|
- stockDutyer: "", //仓库负责人
|
|
|
- stockDutyer_options: [], //仓库负责人列表
|
|
|
- },
|
|
|
- //省市区接口入参
|
|
|
- addr_code: {
|
|
|
- provice_code: "",
|
|
|
- city_code: "",
|
|
|
- area_code: "",
|
|
|
- },
|
|
|
- rules: {
|
|
|
- storeToCompany: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择仓库所在公司",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- stockName: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请输入仓库名称",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- stockCharge: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择仓库负责人",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- stockToArea: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择仓库所在地址",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- stockDetail: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择仓库所在地址",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- sitem: null,
|
|
|
- // 状态
|
|
|
- // statusOptions: [
|
|
|
- // { id: "0", label: "禁用" },
|
|
|
- // { id: "1", label: "启用" },
|
|
|
- // ],
|
|
|
- // statusList: statusList,
|
|
|
- loading: true,
|
|
|
- showModel: false,
|
|
|
- isDetail: false,
|
|
|
- modelId: 0,
|
|
|
- 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() {},
|
|
|
-
|
|
|
- methods: {
|
|
|
- async initForm() {
|
|
|
- console.log(this.id);
|
|
|
- this.loading = true;
|
|
|
- // await this.getClist();
|
|
|
- // 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;
|
|
|
- },
|
|
|
-
|
|
|
- // 省市区组件抛出的执行事件
|
|
|
- areaSelect(val) {
|
|
|
- this.addr_code.provice_code = val[0];
|
|
|
- this.addr_code.city_code = val[1];
|
|
|
- this.addr_code.area_code = val[1];
|
|
|
- console.log(this.addr_code);
|
|
|
- },
|
|
|
- submitForm(formName) {
|
|
|
- console.log("submitForm");
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- alert("submit!");
|
|
|
- } else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- 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>
|
|
|
-</style>
|
|
|
-
|