zhangjinxing 3 years ago
parent
commit
cb37a46821

+ 10 - 10
src/apis/service/stock/allot/index.js

@@ -2,16 +2,16 @@
 import http from "@/apis/axios";
 const api = "admin/";
 export default {
-  // 添加
-  add: (data, params) => http(api + "add", data, "post", params),
-  // 删除
-  delete: (data, params) => http(api + "delete", data, "post", params),
-  // 分页查询
-  list: (data, params) => http(api + "list", data, "post", params),
-  // 详情
-  detail: (data, params) => http(api + "detail", data, "post", params),
-  // 更新
-  update: (data, params) => http(api + "update", data, "post", params),
+  // 新建调拨流程
+  add: (data, params) => http(api + "allotcreate", data, "post", params),
+  // 调拨删除
+  delete: (data, params) => http(api + "allotdelect", data, "post", params),
+  // 调拨列表
+  list: (data, params) => http(api + "allotlist", data, "post", params),
+  // 调拨详情
+  detail: (data, params) => http(api + "allotinfo", data, "post", params),
+  // 调拨流程编辑
+  update: (data, params) => http(api + "allotedit", data, "post", params),
   // 修改状态
   status: (data, params) => http(api + "accountstatus", data, "post", params),
 };

+ 1 - 1
src/views/purchaseIn/storeManage/addEdit.vue

@@ -21,7 +21,7 @@
             :rules="rules"
             status-icon
             ref="ruleForm"
-            label-width="120px"
+            label-width="150px"
           >
             <el-form-item label="商品名称" prop="goods_name">
               <el-input

+ 6 - 1
src/views/purchaseIn/storeManage/components/addEdit.vue

@@ -5,7 +5,7 @@
       :rules="rulesThis"
       status-icon
       ref="ruleForm"
-      label-width="80px"
+      label-width="120px"
       class="demo-ruleForm"
     >
       <el-row>
@@ -168,6 +168,10 @@ export default {
       },
     };
   },
+  mounted() {
+    console.log("addEdit");
+    this.initForm();
+  },
   watch: {
     showModel: function (val) {
       this.showModelThis = val;
@@ -233,6 +237,7 @@ export default {
       this.loading = true;
       // await this.getRole();
       if (this.id === "add") {
+        console.log(this.rules);
         this.rulesThis = this.rules;
         await this.resetForm();
       } else {

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

@@ -120,7 +120,7 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="showDetail(scope.row.id, true, scope.row)"
+              @click="gotoDetail(scope.row.id)"
             ></i>
           </el-tooltip>
         </template>
@@ -154,7 +154,7 @@ export default {
     addEdit,
   },
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size",]),
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       let tran =
         this.$store.getters.btnList.find(
@@ -184,10 +184,6 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
-      tableData: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      isPasswordDetail: false,
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -255,24 +251,19 @@ export default {
   },
 
   methods: {
-    // 点击行操作
-    async showDetail(id, isDetail, sitem) {},
-
-    gotoDetail(path, id) {
+    // 选择时间操作
+    handleTime(e) {
+      console.log(e);
+    },
+    // 点击详情操作
+    gotoDetail(id) {
       window.vm.$router.push({
-        path: path,
+        path: "storeManageFlow",
         query: {
           id: id,
         },
       });
     },
-    handleClick() {
-      console.log("采购反馈");
-      window.vm.$router.push({
-        path: "storeManageFlow",
-      });
-    },
-
     restSearch() {
       this.parmValue = {
         page: 1, // 页码
@@ -364,8 +355,4 @@ export default {
   },
 };
 </script>
-   <style lang="scss" scoped>
-.storeManage {
-}
-</style>
    

+ 8 - 27
src/views/stock/allotFlow/index.vue → src/views/stock/allot/addDetail.vue

@@ -3,29 +3,12 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <div class="box">
-        <!-- <CompanySearch @searchCard="handClick"></CompanySearch>
-        <StockSearch :companyName="company"></StockSearch> -->
-        <!-- <CompanySearch
-          style="dispaly: inline-block; padding-left: 10px"
-          @searchCard="getCompany"
-        ></CompanySearch>
-        <StockSearch :isDisabled="isDesabled"></StockSearch> -->
-      </div>
+      <!-- 详情 -->
       <NewApply :myType="type"></NewApply>
-      <InStock :myType="type" v-if="type != 1"></InStock>
-      <GoStock :myType="type" v-if="type != 1 && type != 2"></GoStock>
-      <InStockCheck
-        :myType="type"
-        v-if="type != 1 && type != 2 && type != 3"
-      ></InStockCheck>
-      <CheckStock :myType="type" v-if="type === 5"></CheckStock>
-      <!-- <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> -->
+      <!-- 发货 -->
+      <GoStock :myType="type"></GoStock>
+      <InStockCheck :myType="type"></InStockCheck>
+      <CheckStock :myType="type"></CheckStock>
       <add-edit
         :id="modelId"
         :sitem="sitem"
@@ -43,13 +26,12 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import statusList from "@/assets/js/statusList";
+// import statusList from "@/assets/js/statusList";
 // import asyncRequest from "@/apis/service/stock/newApply";
 import asyncRequest from "@/mock/service/stock/newApply";
 import { mapGetters } from "vuex";
-import NewApply from "./components/newApply"; //新建申请页面
-import InStock from "./components/inStock-audit.vue"; //入库方审核界面
-import GoStock from "./components//goStock-audit.vue"; //出库方发货
+import NewApply from "./components/newApply.vue"; //新建申请页面
+import GoStock from "./components/goStock-audit.vue"; //出库方发货
 import InStockCheck from "./components/inStock-check.vue"; //入库方验货
 import CheckStock from "./components/checkStock.vue"; //验货审核
 
@@ -58,7 +40,6 @@ export default {
   mixins: [mixinPage, resToken],
   components: {
     NewApply,
-    InStock,
     GoStock,
     InStockCheck,
     CheckStock,

+ 17 - 316
src/views/stock/allot/addEdit.vue

@@ -4,7 +4,7 @@
     :center="true"
     align="left"
     top="5vh"
-    width="1040px"
+    width="700px"
     @close="closeModel"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
@@ -13,218 +13,37 @@
     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-row :gutter="10">
+      <el-col :span="24">
+        <add-form :id="id" @closeModel="closeModel" />
+      </el-col>
+    </el-row>
   </el-dialog>
 </template>
    <script>
-import asyncRequest from "@/apis/service/stock/allot";
+// import asyncRequest from "@/apis/service/stock/allot";
 import resToken from "@/mixins/resToken";
-import {
-  isnumber,
-  isMobile,
-  validEmail,
-  isAlphanumeric,
-  isChinese,
-  isEmoticon,
-  validAlphabets,
-} from "@/utils/validate";
+import AddForm from "./components/addForm"; //新建表单
 export default {
   name: "allot",
   props: ["showModel", "id", "isDetail", "sitem"],
   mixins: [resToken],
+  components: {
+    AddForm,
+  },
   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 {
+      // showGoodsModel: false, //打开商品弹窗
+      isDisabled: true,
+      isDisabledIn: true,
       loading: false,
-      title: "添加账号",
+      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) {
@@ -235,128 +54,10 @@ export default {
   methods: {
     closeModel() {
       console.log("closeModel!!");
+      this.showModelThis = false;
     },
-    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;
-        }
-      });
-    },
+    closeModell() {},
   },
 };
 </script>
-
-   <style lang="scss" scoped>
-.allot {
-}
-</style>
    

+ 0 - 0
src/views/stock/allotFlow/components/addEdit-newApply.vue → src/views/stock/allot/components/addEdit-newApply.vue


+ 439 - 0
src/views/stock/allot/components/addForm.vue

@@ -0,0 +1,439 @@
+<template>
+  <div class="addForm">
+    <el-row :gutter="10">
+      <el-col :span="24">
+        <el-form
+          :model="ruleForm"
+          status-icon
+          :rules="rulesThis"
+          ref="ruleForm"
+          label-width="150px"
+          class="demo-ruleForm"
+        >
+          <!-- 出库供应商 -->
+          <el-form-item label="出库供应商名称" prop="supplier_code">
+            <search-supplier
+              style="width: calc(100% - 150px)"
+              :value="ruleForm.supplier_code"
+              :placeholder="'请选择供应商'"
+              @searchChange="selectSupplier"
+            />
+          </el-form-item>
+          <!-- 出库仓库 -->
+          <el-form-item label="出库仓库名称" prop="stock_code">
+            <search-stock
+              style="width: calc(100% - 150px)"
+              :value="ruleForm.stock_code"
+              :isDetail="true"
+              :disabled="isDisabled"
+              :placeholder="'请选择出口仓库'"
+              :isRelation="true"
+              :companyCode="supplier_code"
+              :names="''"
+              @searchChange="selectStock"
+            />
+          </el-form-item>
+          <!-- 入库供应商 -->
+          <el-form-item label="入库供应商名称" prop="supplier_in_code">
+            <search-supplier
+              style="width: calc(100% - 150px)"
+              :value="ruleForm.supplier_in_code"
+              :placeholder="'请选择供应商'"
+              @searchChange="selectSupplierIn"
+            />
+          </el-form-item>
+          <!-- 入库仓库 -->
+          <el-form-item label="入库仓库名称" prop="stock_in_code">
+            <search-stock
+              style="width: calc(100% - 150px)"
+              :value="ruleForm.stock_in_code"
+              :isDetail="true"
+              :disabled="isDisabledIn"
+              :placeholder="'请选择入口仓库'"
+              :isRelation="true"
+              :companyCode="stock_in_code"
+              :names="''"
+              @searchChange="selectStockIn"
+            />
+          </el-form-item>
+          <el-form-item label="出库商品" prop="tableData">
+            <el-table :data="tableData" border :size="'mini'">
+              <el-table-column
+                fixed
+                prop="date"
+                :label="item.label"
+                v-for="(item, index) in columns"
+                :key="index"
+              >
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="100">
+                <template slot-scope="scope">
+                  <el-button
+                    @click.native.prevent="deleteRow(scope.$index, tableData)"
+                    type="text"
+                    size="small"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form-item>
+          isDisabled:{{ isDisabled }}-----isDetail:{{ isDetail }}---id:{{ id }}
+        </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="closeModel">{{
+          isDetail ? "关 闭" : "取 消"
+        }}</el-button>
+      </el-col>
+    </el-row>
+    <!-- <search-good-modal
+      :show-model="showGoodsModel"
+      @cancel="showGoodsModel = false"
+      @resultList="addGoodsRes"
+    /> -->
+  </div>
+</template>
+   <script>
+import asyncRequest from "@/apis/service/stock/allot";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "allot",
+  props: ["showModel", "id", "isDetail", "sitem"],
+  mixins: [resToken],
+  data() {
+    return {
+      supplier_code: "",
+      stock_in_code: "",
+      isDisabled: true,
+      isDisabledIn: true,
+      loading: false,
+      title: "新建调拨申请",
+      showModelThis: this.showModel,
+      ruleForm: {
+        supplier_code: [], //出库供应商名称
+        stock_code: [], //出库仓库名称
+        supplier_in_code: [], //入库供应商名称
+        stock_in_code: [], //入库仓库名称
+        product_go: [], //出库商品选择
+        product_type_code: "", //商品属性code
+        status: "", //审核状态
+      },
+      // tableData: [],
+      rulesThis: this.rules,
+      rules: {
+        supplier_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择供应商",
+            trigger: "change",
+          },
+        ],
+        stock_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择仓库",
+            trigger: "change",
+          },
+        ],
+        supplier_in_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择供应商",
+            trigger: "change",
+          },
+        ],
+        stock_in_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择仓库",
+            trigger: "change",
+          },
+        ],
+        product_go: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择商品",
+            trigger: "change",
+          },
+        ],
+      },
+      columns: [
+        {
+          prop: "product_sn",
+          label: "商品编号",
+        },
+        {
+          prop: "product_name",
+          label: "商品名称",
+        },
+        {
+          prop: "product_num",
+          label: "总数量",
+        },
+      ],
+      tableData: [
+        {
+          date: "2016-05-02",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-04",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1517 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-01",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1519 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-03",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1516 弄",
+          zip: 200333,
+        },
+      ],
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    // 删除行操作
+    deleteRow(index, rows) {
+      //   console.log(index, rows);
+      rows.splice(index, 1);
+    },
+    // 通知弹窗关闭
+    closeModel() {
+      this.$emit("closeModel");
+    },
+
+    async initForm() {
+      this.loading = true;
+      // await this.getRole();
+      console.log(this.id);
+      if (this.id === "add") {
+        this.rulesThis = this.rules;
+        await this.resetForm();
+      } else {
+        if (this.isDetail) {
+          this.rulesThis = {};
+        } else {
+          this.rulesThis = this.rules;
+        }
+        await this.resetForm(this.sitem);
+        // await this.initData()
+      }
+      this.loading = false;
+    },
+
+    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() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            stock_code: [], //出库仓库编码
+            supplier_code: [], //出库供应商编码
+            supplier_in_code: [], //入库供应商编码
+            stock_in_code: [], //入库仓库编码
+            product_go: [], //出库商品
+            product_type_code: "", //商品属性code
+            status: "", //审核状态
+          };
+          if (this.id === "add" || this.isDetail) {
+            // this.rules.username[0].required = false;
+            console.log("当前是add或者 this.isDetail是true");
+          }
+        }
+      });
+    },
+
+    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 { stock_code, stock_in_code, supplier_code, supplier_in_code } =
+            JSON.parse(JSON.stringify(this.ruleForm));
+          console.log(
+            stock_code,
+            stock_in_code,
+            supplier_code,
+            supplier_in_code,
+          );
+          console.log(this.ruleForm);
+          const model = {
+            id: this.id,
+            wsm_out: stock_code.toString(), //出库仓库
+            wsm_in: stock_in_code.toString(), //入库仓库
+            supplier_code: supplier_code.toString(),
+            supplier_in_code: supplier_in_code.toString(),
+            status: "",
+            good: [
+              {
+                good_code: "df12fa1",
+                allot_num: 100,
+                type_code: "fafa131",
+              },
+            ],
+          };
+          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;
+        }
+      });
+    },
+
+    // 执行点击商品名称的抛出事件
+    addGoodsRes(e) {
+      console.log(e);
+
+      let { good_code, good_name, type_code } = e[0];
+      // this.ruleForm.goods_name = good_name;
+      // this.ruleForm.good_type_code = type_code;
+      // this.ruleForm.good_code = good_code;
+      // this.$refs.ruleForm.validateField("goods_name");
+    },
+
+    // 选择出库仓库
+    selectStock(e) {
+      if (e && e.id) {
+        this.ruleForm.stock_code = [e.code];
+        this.stockCode = e.code;
+        if (this.stockCode == this.stock_in_code) {
+          this.$message({
+            message: "出库供应商仓库不能和入库供应商仓库相同",
+            type: "warning",
+          });
+          return;
+        }
+      } else {
+        this.ruleForm.stockCode = [];
+        this.stockCode = "";
+      }
+      this.$refs.ruleForm.validateField("stock_code");
+    },
+    // 选择出库供应商
+    selectSupplier(e) {
+      if (e && e.id) {
+        this.ruleForm.supplier_code = [e.code];
+        this.supplier_code = e.code;
+        this.isDisabled = false;
+      } else {
+        this.ruleForm.supplier_code = [];
+        this.supplier_code = "";
+      }
+      this.$refs.ruleForm.validateField("supplier_code");
+    },
+    // 选择入库仓库
+    selectStockIn(e) {
+      if (e && e.id) {
+        this.ruleForm.stock_in_code = [e.code];
+        this.stock_in_code = e.code;
+        if (this.stockCode == this.stock_in_code) {
+          this.$message({
+            message: "出库供应商仓库不能和入库供应商仓库相同",
+            type: "warning",
+          });
+          return;
+        }
+      } else {
+        this.ruleForm.stock_in_code = [];
+        this.stock_in_code = "";
+      }
+      this.$refs.ruleForm.validateField("stock_in_code");
+    },
+    // 选择入库供应商
+    selectSupplierIn(e) {
+      if (e && e.id) {
+        this.ruleForm.supplier_in_code = [e.code];
+        this.stock_in_code = e.code;
+        this.isDisabledIn = false;
+      } else {
+        this.ruleForm.supplier_in_code = [];
+        this.stock_in_code = "";
+      }
+      this.$refs.ruleForm.validateField("supplier_in_code");
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.allot {
+}
+</style>
+   

+ 0 - 0
src/views/stock/allotFlow/components/checkStock.vue → src/views/stock/allot/components/checkStock.vue


+ 0 - 0
src/views/stock/allotFlow/components/companySearch.vue → src/views/stock/allot/components/companySearch.vue


+ 157 - 0
src/views/stock/allot/components/goStock-audit.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="newApply pagePadding">
+    <div
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="150px"
+      >
+        <el-row>
+          <el-col :span="24"
+            ><el-form-item label="发货物流公司" prop="expressage_company">
+              <el-input
+                style="width: calc(100% - 150px)"
+                placeholder="请输入物流公司"
+                v-model="ruleForm.expressage_company"
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="24"
+            ><el-form-item label="发货物流编号" prop="expressage_sn">
+              <el-input
+                type="number"
+                :rows="2"
+                style="width: calc(100% - 150px)"
+                placeholder="请输入物流单号"
+                v-model="ruleForm.expressage"
+                clearable
+              >
+              </el-input> </el-form-item
+          ></el-col>
+          <el-col :span="24"
+            ><el-form-item label="发货物流费用" prop="expressage_cost">
+              <el-input
+                type="number"
+                style="width: calc(100% - 150px)"
+                placeholder="请输入物流费用"
+                v-model="ruleForm.expressage_cost"
+                clearable
+              >
+                <template slot="append">元</template>
+              </el-input>
+            </el-form-item></el-col
+          >
+        </el-row>
+
+        <el-form-item>
+          <el-col :span="24" style="text-align: right; margin-top: 10px">
+            <el-button type="primary" @click="save">保 存 </el-button>
+            <el-button type="">关 闭 </el-button>
+
+            <!-- <el-button type="warning" @click="submitForm"
+              >保 存 并 发 起 流 程
+            </el-button> -->
+          </el-col>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import statusList from "@/assets/js/statusList";
+// import asyncRequest from "@/apis/service/stock/newApply";
+import addEdit from "./addEdit-newApply";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "allotFlow",
+  mixins: [mixinPage, resToken],
+  props: ["myType"],
+  components: {
+    addEdit,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "allotFlow"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      ruleForm: {
+        expressage_company: "", //发货物流公司
+        expressage_sn: "", //物流单号
+        expressage_cost: 0,
+      },
+      rules: {
+        //出入库规则
+        expressage_company: [
+          {
+            required: true,
+            message: "请选择发货公司",
+            trigger: "blur",
+          },
+        ],
+        expressage_sn: [
+          {
+            required: true,
+            message: "请输入物流单号",
+            trigger: "blur",
+          },
+        ],
+        expressage_cost: [
+          {
+            required: true,
+            message: "请输入物流费用",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    restSearch() {
+      //重置入参
+      this.ruleForm = {
+        expressage_company: "", //发货物流公司
+        expressage_sn: "", //物流单号
+        expressage_cost: 0,
+      };
+      this.searchList();
+    },
+    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;
+    },
+  },
+};
+</script>

+ 5 - 179
src/views/stock/allotFlow/components/inStock-check.vue → src/views/stock/allot/components/inStock-check.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="newApply pagePadding">
-    {{ myType }}
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
@@ -103,21 +102,10 @@
         </el-form-item>
         <el-form-item>
           <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="save" v-show="myType === 4"
-              >保 存
-            </el-button>
+            <el-button type="primary" @click="save">保 存 </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>
@@ -128,9 +116,8 @@
 <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import asyncRequest from "@/mock/service/stock/newApply";
+import asyncRequest from "@/apis/service/stock/newApply";
+// import asyncRequest from "@/mock/service/stock/newApply";
 import addEdit from "./addEdit-newApply";
 import { mapGetters } from "vuex";
 
@@ -158,11 +145,6 @@ export default {
   data() {
     return {
       value: "",
-      // selectStock_in: "", //选择的入库仓库名称
-      // selectStock_go: "", //选择的出库仓库名称
-      // stock_go: "", //出库仓库name
-      // stock_in: "", //入库仓库name
-      //   options: [], //用于渲染二级仓库名
       ruleForm: {},
       rules: {
         //出入库规则
@@ -174,8 +156,7 @@ export default {
           },
         ],
       },
-      expressage: "",
-      expressage_cost: 0,
+
       loading: true,
       showModel: false,
       isDetail: false,
@@ -226,38 +207,21 @@ export default {
           _slot_: "operation",
         },
       ],
-      // sitem: null,
-      // // 状态
-      // statusOptions: [
-      //   { id: "0", label: "禁用" },
-      //   { id: "1", label: "启用" },
-      // ],
+      //入参
       parmValue: {
-        //入参
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
         // page: 1, // 页码
         // size: 15, // 每页显示条数
       },
-      // passwordModel: false,
-      // passwordModelId: 0,
-      // isPasswordDetail: false,
-      // statusList: statusList,
     };
   },
   mounted() {
     this.searchList();
-    // this.stockName(); //假数据,获取二级仓库名
   },
 
   methods: {
     restSearch() {
       //重置入参
       this.parmValue = {
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
         // page: 1, // 页码
         // size: 10, // 每页显示条数
       };
@@ -270,34 +234,6 @@ export default {
       this.isDetail = isDetail;
       this.sitem = sitem;
     },
-    async deleteById(id, status) {
-      // await this.$confirm("确定要删除?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.$notify.success({
-      //         title: "删除成功",
-      //         message: "",
-      //       });
-      //       this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
     async searchList() {
       // this.loading = true;
       // const res = await asyncRequest.list(this.parmValue);
@@ -312,117 +248,7 @@ export default {
       // }
       // 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("取消");
-      //   });
-    },
-    // async stockName() {
-    //   //获取多级仓库名称的方法
-    //   const res = await asyncRequest.listAll(this.parmValue);
-    //   // console.log(res.data);
-    //   // this.openModal("005", true);
-    //   // console.log(this.selectStock_go);
-    //   // console.log(this.selectStock_in);
-    //   // this.options = res.data;
-    //   // console.log(this.options);
-    //   let arr = res.data;
-    //   // console.log(arr);
-    //   arr.forEach((ele) => {
-    //     //重新封装后台传递来的数据,转换格式
-    //     let item = {
-    //       value: ele.id,
-    //       label: ele.name,
-    //       children: [],
-    //     };
-    //     ele.child.forEach((elem) => {
-    //       let model = {
-    //         value: elem.id,
-    //         label: elem.name,
-    //       };
-    //       item.children.push(model);
-    //     });
-    //     this.options.push(item);
-    //   });
-    //   this.options.forEach((ele) => {
-    //     //从数据表中筛选出我们要用的数据
-    //     if (ele.value === this.selectStock_go[0]) {
-    //       ele.children.forEach((elem) => {
-    //         if (elem.value === this.selectStock_go[1]) {
-    //           this.stock_go = ele.label + "/" + elem.label;
-    //         }
-    //       });
-    //     }
-    //     if (ele.value === this.selectStock_in[0]) {
-    //       ele.children.forEach((elem) => {
-    //         if (elem.value === this.selectStock_in[1]) {
-    //           this.stock_in = ele.label + "/" + elem.label;
-    //         }
-    //       });
-    //     }
-    //   });
-    //   if (this.selectStock_in != "" || this.selectStock_go != "") {
-    //     console.log("选择了一个项目");
-    //     this.openModal("005", true);
-    //   }
-    //   // console.log(this.stock_go);
-    //   // console.log(this.stock_in);
-    //   // console.log(this.pageInfo.total);
-    //   this.compareStock(); //比较出库仓库和入库仓库是否相同
-    // },
-
-    compareStock() {
-      //比较出库仓库和入库仓库是否相同
-      if (
-        this.stock_go === this.stock_in &&
-        this.stock_go !== "" &&
-        this.stock_go != ""
-      ) {
-        console.log("出库仓库和入库仓库相同");
-        this.$message({
-          message: "出库仓库不能和入库仓库相同",
-          type: "error",
-        });
-      }
-    },
   },
 };
 </script>
-   <style lang="scss" >
-.newApply {
-}
-.el-form-item__content {
-  margin: 0 !important;
-}
-.setcol-table-lie {
-  // margin: 0 !important;
-}
-</style>
    

+ 143 - 0
src/views/stock/allot/components/newApply.vue

@@ -0,0 +1,143 @@
+<template>
+  <div class="newApply pagePadding">
+    <div
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
+      <add-form :id="id" @closeModel="closeModel" />
+      id:{{ id }}
+    </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 "@/mock/service/stock/newApply";
+import AddForm from "./addForm"; //新建表单
+
+import { mapGetters } from "vuex";
+
+export default {
+  name: "allotFlow",
+  mixins: [mixinPage, resToken],
+  components: {
+    AddForm,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "allotFlow"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    const validateStock = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("手机号不能为空!"));
+      }
+    };
+
+    return {
+      stock_go: "", //出库仓库name
+      stock_in: "", //入库仓库name
+      options: [], //用于渲染二级仓库名
+      ruleForm: {
+        selectStock_go: "",
+        selectStock_in: "",
+      },
+     
+      loading: true,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      tableData: [], //渲染表格
+      //
+      // 表格 - 数据
+      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: "",
+          label: "操作",
+          fixed: "right",
+          _noset_: true,
+          _slot_: "operation",
+        },
+      ],
+      parmValue: {},
+    };
+  },
+  mounted() {
+    // this.searchList();
+    // this.stockName(); //假数据,获取二级仓库名
+  },
+
+  methods: {
+    submitForm(formName) {
+      console.log("sds");
+      console.log(formName);
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          alert("submit!");
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+  restSearch() {
+    //重置入参
+    this.parmValue = {};
+    // this.searchList();
+  },
+  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;
+  },
+};
+</script>
+   

+ 0 - 0
src/views/stock/allotFlow/components/stockSearch.vue → src/views/stock/allot/components/stockSearch.vue


+ 106 - 151
src/views/stock/allot/index.vue

@@ -28,72 +28,63 @@
             <el-row style="padding: 0 0 0 80px">
               <el-col :span="24">
                 <el-col :span="6" style="width: 292px">
-                  <PeriodDatePicker
-                    :start="parmValue.total_low"
-                    :end="parmValue.total_up"
+                  <period-date-picker
                     :type="1"
                     :width="'135px'"
-                    :title="'预警量'"
+                    :title="'时间搜索'"
                     :size="searchSize"
-                    @numReturned="numReturned($event, 0)"
+                    @timeReturned="handleTime"
                   />
+                  <!-- @numReturned="numReturned($event, 0)" -->
                 </el-col>
-
-                <el-col :span="4" style="width: 120px; padding: 0 0 0 10px">
+                <el-col :span="4" style="width: 220px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
-                    v-model="parmValue.allot_sn"
+                    v-model="parmValue.allot_code"
                     :maxlength="40"
                     placeholder="调拨编号"
                   />
                 </el-col>
-                <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
-                  <el-input
-                    :size="searchSize"
-                    v-model="parmValue.stayStock_name"
-                    :maxlength="40"
-                    placeholder="入库仓库名称"
-                  />
-                </el-col>
-                <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
-                  <el-input
+                <!--搜索按钮 -->
+                <el-col :span="4" style="width: 54px; padding-left: 10px">
+                  <el-button
+                    style="width: 100%"
+                    type="primary"
+                    class="fr mr10"
+                    icon="el-icon-search"
                     :size="searchSize"
-                    v-model="parmValue.stayOutStock_name"
-                    :maxlength="40"
-                    placeholder="出库仓库名称"
-                  />
+                    @click="searchList"
+                  >
+                  </el-button>
                 </el-col>
-
-                <el-col :span="4" style="width: 76px; margin-left: 10px">
+                <el-col :span="4" style="width: 66px; padding-left: 10px">
                   <el-button
                     style="width: 100%"
-                    type="primary"
+                    type="success"
                     class="fr"
                     :size="searchSize"
-                    @click="addSearch"
+                    @click="addSearch('add', false)"
                   >
                     新建
                   </el-button>
                 </el-col>
 
-                <el-col :span="4" style="width: 76px; margin-left: 10px">
+                <el-col :span="3" style="width: 66px; float: right">
                   <el-button
-                    style="width: 100%"
-                    type="primary"
-                    class="fr mr10"
-                    icon="el-icon-search"
                     :size="searchSize"
+                    type="primary"
+                    style="float: right; margin-left: 5px"
                     @click="searchList"
                   >
-                    搜索
+                    刷新
                   </el-button>
                 </el-col>
 
-                <el-col :span="4" style="width: 76px; margin-left: 10px">
+                <el-col :span="4" style="width: 66px; padding-left: 10px">
                   <el-button
                     style="width: 100%"
                     type="warning"
-                    class="fr mr5"
+                    class="mr5"
                     :size="searchSize"
                     @click="restSearch"
                   >
@@ -102,6 +93,25 @@
                 </el-col>
               </el-col>
             </el-row>
+            <el-row>
+              <!-- 入库仓库 -->
+              <el-col :span="4" style="width: 220px; padding: 10px 0 0 0px">
+                <el-input
+                  :size="searchSize"
+                  v-model="parmValue.wsm_in"
+                  :maxlength="40"
+                  placeholder="入库仓库名称"
+                />
+              </el-col>
+              <!-- 出库仓库 -->
+              <el-col :span="4" style="width: 230px; padding: 10px 0 0 10px">
+                <el-input
+                  :size="searchSize"
+                  v-model="parmValue.wsm_out"
+                  :maxlength="40"
+                  placeholder="出库仓库名称"
+                /> </el-col
+            ></el-row>
           </div>
         </template>
         <template #status="{ scope }">
@@ -123,14 +133,13 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="openModal(scope.row.id, true, scope.row)"
+              @click="handleClick(scope.row.id)"
             ></i>
           </el-tooltip>
         </template>
       </ex-table>
       <add-edit
         :id="modelId"
-        :sitem="sitem"
         :show-model="showModel"
         :is-detail="isDetail"
         @refresh="searchList"
@@ -146,12 +155,10 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/allot";
-import asyncRequest from "@/mock/service/stock/allot";
-
+import asyncRequest from "@/apis/service/stock/allot";
+import columns from "./utils/columns"; //表格列参数
 import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
-import AllotFlow from "@/views/stock/allotFlow";
 export default {
   name: "allot",
   mixins: [mixinPage, resToken],
@@ -174,7 +181,6 @@ export default {
   },
   data() {
     return {
-      sitem: null,
       // 状态
       statusOptions: [
         { id: "0", label: "禁用" },
@@ -186,16 +192,14 @@ export default {
       isDetail: false,
       modelId: 0,
       parmValue: {
-        total_low: "", //开始日期
-        total_up: "", //结束日期
-        allot_sn: "", //调拨编号
-        stayStock_name: "", //入仓库名称
-        stayOutStock_name: "", //出仓库名称
+        startTime: "", //开始日期
+        endTime: "", //结束日期
+        allot_code: "", //调拨编号
+        wsm_in: "", //入仓库名称
+        wsm_out: "", //出仓库名称
+        page: 1,
+        size: 15,
       },
-      tableData: [],
-      passwordModel: false,
-      passwordModelId: 0,
-      isPasswordDetail: false,
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -210,44 +214,7 @@ export default {
         curr: 1,
         total: 0,
       },
-      // 表格 - 列参数
-      columns: [
-        {
-          prop: "allot_sn",
-          label: "调拨编号",
-        },
-        {
-          prop: "applicant",
-          label: "申请人",
-        },
-        {
-          prop: "stayStock_name",
-          label: "入库仓库名称",
-        },
-        {
-          prop: "stayOutStock_name",
-          label: "出库仓库名称",
-        },
-        {
-          prop: "express_cost",
-          label: "物流总费用",
-        },
-        {
-          prop: "status",
-          label: "当前状态",
-          // sortable: true,
-        },
-        {
-          prop: "apply_time",
-          label: "申请时间",
-        },
-        {
-          prop: "",
-          label: "操作",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
+      columns: columns,
     };
   },
   mounted() {
@@ -255,71 +222,72 @@ export default {
   },
 
   methods: {
-    addSearch() {
-      //跳转到新建页面
+    // 时间选择
+    async handleTime(val) {
+      if (val.startTime !== "") {
+        this.parmValue.startTime = val.startTime;
+      } else {
+        this.parmValue.startTime = "";
+      }
+      if (val.endTime !== "") {
+        this.parmValue.endTime = val.endTime;
+      } else {
+        this.parmValue.endTime = "";
+      }
+      if (this.parmValue.startTime !== "" && this.parmValue.endTime !== "") {
+        this.parmValue.page = 1;
+        await this.searchList();
+      }
+    },
+    //点击新建按钮
+    addSearch(id, isDetail) {
       console.log("新建申请");
-      window.vm.$router.push({
-        path: "allotFlow",
-      });
+      this.openModal(id, isDetail);
     },
+    // 重置搜索框
     restSearch() {
       this.parmValue = {
-        name: "", // 业务员名字
-        username: "", // 账号
-        status: "", //
+        allot_code: "", //调拨编号
+        wsm_in: "", //入仓库名称
+        wsm_out: "", //出仓库名称
+        startTime: "", //开始日期
+        endTime: "", //结束日期
         page: 1, // 页码
         size: 10, // 每页显示条数
       };
       this.searchList();
     },
 
-    openModal(id, isDetail, sitem) {
+    openModal(id, isDetail) {
       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("取消");
-      //   });
+    // 点击详情按钮
+    handleClick(id) {
+      window.vm.$router.push({
+        path: "allotFlow",
+        query: {
+          id,
+        },
+      });
     },
+    // 获取调拨列表
     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;
+      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.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) {
@@ -355,17 +323,4 @@ export default {
     },
   },
 };
-</script>
-<style lang="scss" scoped>
-@media screen and (max-width: 1312px) {
-  .mr5 {
-    margin-top: 10px;
-  }
-}
-@media screen and (max-width: 1223px) {
-  .mr10 {
-    margin-top: 10px;
-  }
-}
-</style>
-   
+</script>

+ 64 - 0
src/views/stock/allot/utils/columns.js

@@ -0,0 +1,64 @@
+    
+      export default [
+  // 表格 - 列参数
+       
+        {
+          prop: "allot_code",
+          label: "调拨编号",
+          width:"180"
+        },
+        
+        {
+          prop: "wsm_in",
+          label: "入库仓库名称",
+          width:"180"
+
+        },
+        {
+          prop: "wsm_out",
+          label: "出库仓库名称",
+          width:"180"
+
+        },
+        {
+          prop: "apply_name",
+          label: "申请人",
+          width:"80"
+        },
+        {
+          prop:"post_name",
+          label:"物流名称",
+        },
+        {
+          prop:"post_code",
+          label:"物流单号",
+        },
+        {
+          prop: "post_fee",
+          label: "物流总费用",
+        },
+        {
+          prop: "status",
+          label: "当前状态",
+          // sortable: true,
+          width:"50"
+        },
+        {
+          prop: "addtime",
+          label: "申请时间",
+        },
+        {
+          prop:"remark",
+          label:"备注",
+        },
+        {
+          prop: "",
+          label: "操作",
+          _noset_: true,
+          fixed:"right",
+          _slot_: "operation",
+          width:"50"
+        },
+      
+]
+    

+ 0 - 380
src/views/stock/allotFlow/addEdit.vue

@@ -1,380 +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">
-          <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%; height: 40px"></div>
-            </template>
-          </ex-table>
-        </el-col>
-        <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">123 </el-button>
-        </el-col>
-      </el-row>
-    </el-card>
-  </el-dialog>
-</template>
-   <script>
-import asyncRequest from "@/apis/service/stock/newApply";
-import resToken from "@/mixins/resToken";
-
-import {
-  isnumber,
-  isMobile,
-  validEmail,
-  isAlphanumeric,
-  isChinese,
-  isEmoticon,
-  validAlphabets,
-} from "@/utils/validate";
-export default {
-  name: "newApply",
-  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: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      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: "数量",
-        },
-      ],
-      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;
-      this.title = "可调拨的商品";
-      {
-        //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;
-        //   }
-        // }
-      });
-    },
-    save() {
-      console.log("点击了保存");
-    },
-    async submitForm() {
-      console.log("点击了保存并发起流程");
-      // 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>
-.newApply {
-}
-</style>
-   

+ 0 - 0
src/views/stock/allotFlow/components/addEdit-goStock-audit.vue


+ 0 - 0
src/views/stock/allotFlow/components/addEdit-inStock-audit.vue


+ 0 - 399
src/views/stock/allotFlow/components/goStock-audit.vue

@@ -1,399 +0,0 @@
-<template>
-  <div class="newApply pagePadding">
-    出库方发货{{ myType }}
-
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-form
-        :disabled="myType !== 3"
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="150px"
-      >
-        <el-form-item label="发货物流公司" prop="expressage_company">
-          <el-select
-            v-model="value"
-            placeholder="请选择发货公司"
-            :size="searchSize"
-          >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="发货物流编号" prop="expressage_sn">
-          <el-input
-            type="number"
-            :rows="2"
-            style="width: 30%"
-            placeholder="请输入物流单号"
-            :size="searchSize"
-            v-model="expressage"
-            clearable
-          >
-          </el-input>
-        </el-form-item>
-        <el-form-item label="发货物流费用" prop="expressage_cost">
-          <el-input
-            type="number"
-            style="width: 20%"
-            placeholder="请输入物流费用"
-            :size="searchSize"
-            v-model="expressage_cost"
-            clearable
-          >
-          </el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="save" v-show="myType === 3"
-              >保 存
-            </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 statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import asyncRequest from "@/mock/service/stock/newApply";
-import addEdit from "./addEdit-newApply";
-import { mapGetters } from "vuex";
-
-export default {
-  name: "allotFlow",
-  mixins: [mixinPage, resToken],
-  props: ["myType"],
-  components: {
-    addEdit,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "allotFlow"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    return {
-      options: [
-        {
-          value: "选项1",
-          label: "顺丰",
-        },
-        {
-          value: "选项2",
-          label: "韵达",
-        },
-        {
-          value: "选项3",
-          label: "中通",
-        },
-      ],
-      value: "",
-      // selectStock_in: "", //选择的入库仓库名称
-      // selectStock_go: "", //选择的出库仓库名称
-      // stock_go: "", //出库仓库name
-      // stock_in: "", //入库仓库name
-      //   options: [], //用于渲染二级仓库名
-      ruleForm: {},
-      rules: {
-        //出入库规则
-        expressage_company: [
-          {
-            required: true,
-            message: "请选择发货公司",
-            trigger: "blur",
-          },
-        ],
-        expressage_sn: [
-          {
-            required: true,
-            message: "请输入物流单号",
-            trigger: "blur",
-          },
-        ],
-        expressage_cost: [
-          {
-            required: true,
-            message: "请输入物流费用",
-            trigger: "blur",
-          },
-        ],
-      },
-      expressage: "",
-      expressage_cost: 0,
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      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: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      // sitem: null,
-      // // 状态
-      // statusOptions: [
-      //   { id: "0", label: "禁用" },
-      //   { id: "1", label: "启用" },
-      // ],
-      parmValue: {
-        //入参
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 15, // 每页显示条数
-      },
-      // passwordModel: false,
-      // passwordModelId: 0,
-      // isPasswordDetail: false,
-      // statusList: statusList,
-    };
-  },
-  mounted() {
-    this.searchList();
-    // this.stockName(); //假数据,获取二级仓库名
-  },
-
-  methods: {
-    restSearch() {
-      //重置入参
-      this.parmValue = {
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 10, // 每页显示条数
-      };
-      this.searchList();
-    },
-
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    async deleteById(id, status) {
-      // await this.$confirm("确定要删除?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.$notify.success({
-      //         title: "删除成功",
-      //         message: "",
-      //       });
-      //       this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    async searchList() {
-      // this.loading = true;
-      // const res = await asyncRequest.list(this.parmValue);
-      // if (res && res.code === 0 && res.data) {
-      //   this.tableData = res.data.list;
-      //   this.pageInfo.total = Number(res.data.count);
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.tableData = [];
-      //   this.pageInfo.total = 0;
-      // }
-      // this.loading = false;
-    },
-
-    async statusConfirm(id, status) {
-      // let str = status === "1" ? "禁用" : "启用";
-      // await this.$confirm("确定要改为" + str + "?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     this.loading = true;
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.loading = false;
-      //       this.$notify.success({
-      //         title: "状态修改成功!",
-      //         message: "",
-      //       });
-      //       await this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    // async stockName() {
-    //   //获取多级仓库名称的方法
-    //   const res = await asyncRequest.listAll(this.parmValue);
-    //   // console.log(res.data);
-    //   // this.openModal("005", true);
-    //   // console.log(this.selectStock_go);
-    //   // console.log(this.selectStock_in);
-    //   // this.options = res.data;
-    //   // console.log(this.options);
-    //   let arr = res.data;
-    //   // console.log(arr);
-    //   arr.forEach((ele) => {
-    //     //重新封装后台传递来的数据,转换格式
-    //     let item = {
-    //       value: ele.id,
-    //       label: ele.name,
-    //       children: [],
-    //     };
-    //     ele.child.forEach((elem) => {
-    //       let model = {
-    //         value: elem.id,
-    //         label: elem.name,
-    //       };
-    //       item.children.push(model);
-    //     });
-    //     this.options.push(item);
-    //   });
-    //   this.options.forEach((ele) => {
-    //     //从数据表中筛选出我们要用的数据
-    //     if (ele.value === this.selectStock_go[0]) {
-    //       ele.children.forEach((elem) => {
-    //         if (elem.value === this.selectStock_go[1]) {
-    //           this.stock_go = ele.label + "/" + elem.label;
-    //         }
-    //       });
-    //     }
-    //     if (ele.value === this.selectStock_in[0]) {
-    //       ele.children.forEach((elem) => {
-    //         if (elem.value === this.selectStock_in[1]) {
-    //           this.stock_in = ele.label + "/" + elem.label;
-    //         }
-    //       });
-    //     }
-    //   });
-    //   if (this.selectStock_in != "" || this.selectStock_go != "") {
-    //     console.log("选择了一个项目");
-    //     this.openModal("005", true);
-    //   }
-    //   // console.log(this.stock_go);
-    //   // console.log(this.stock_in);
-    //   // console.log(this.pageInfo.total);
-    //   this.compareStock(); //比较出库仓库和入库仓库是否相同
-    // },
-
-    compareStock() {
-      //比较出库仓库和入库仓库是否相同
-      if (
-        this.stock_go === this.stock_in &&
-        this.stock_go !== "" &&
-        this.stock_go != ""
-      ) {
-        console.log("出库仓库和入库仓库相同");
-        this.$message({
-          message: "出库仓库不能和入库仓库相同",
-          type: "error",
-        });
-      }
-    },
-  },
-};
-</script>
-   <style lang="scss" >
-.newApply {
-}
-.el-form-item__content {
-  margin: 0 !important;
-}
-.setcol-table-lie {
-  // margin: 0 !important;
-}
-</style>
-   

+ 0 - 318
src/views/stock/allotFlow/components/inStock-audit.vue

@@ -1,318 +0,0 @@
-<template>
-  <div class="newApply pagePadding">
-    入库方审核
-    {{ myType }}
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-form
-        :disabled="myType !== 2"
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="165px"
-      >
-        <el-form-item label="入库方审核状态" prop="stock_go_rule">
-          <el-select
-            v-model="value"
-            placeholder="入库方审核"
-            :size="searchSize"
-          >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <!-- 入库方审核备注 -->
-        <el-form-item label="入库方审核备注" prop="stock_remark">
-          <el-input
-            type="textarea"
-            :rows="2"
-            style="width: 30%"
-            placeholder="请输入审核备注"
-            :size="searchSize"
-            v-model="remark"
-            clearable
-          >
-          </el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="save" v-show="myType === 2"
-              >保 存
-            </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 statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import asyncRequest from "@/mock/service/stock/newApply";
-import addEdit from "./addEdit-newApply";
-import { mapGetters } from "vuex";
-
-export default {
-  name: "allotFlow",
-  mixins: [mixinPage, resToken],
-  props: ["myType"],
-  components: {
-    addEdit,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "allotFlow"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    return {
-      options: [
-        {
-          value: "选项1",
-          label: "请选择入库方审核状态",
-        },
-        {
-          value: "选项2",
-          label: "通过",
-        },
-        {
-          value: "选项3",
-          label: "驳回",
-        },
-      ],
-      value: "",
-      // selectStock_in: "", //选择的入库仓库名称
-      // selectStock_go: "", //选择的出库仓库名称
-      // stock_go: "", //出库仓库name
-      // stock_in: "", //入库仓库name
-      //   options: [], //用于渲染二级仓库名
-      ruleForm: {},
-      rules: {
-        //出入库规则
-        stock_go_rule: [
-          {
-            required: true,
-            message: "请选择审核状态",
-            trigger: "blur",
-          },
-        ],
-        stock_remark: [
-          {
-            required: true,
-            message: "请输入审核备注",
-            trigger: "change",
-          },
-        ],
-      },
-      remark: "a",
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      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: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      // sitem: null,
-      // // 状态
-      // statusOptions: [
-      //   { id: "0", label: "禁用" },
-      //   { id: "1", label: "启用" },
-      // ],
-      parmValue: {
-        //入参
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 15, // 每页显示条数
-      },
-      // passwordModel: false,
-      // passwordModelId: 0,
-      // isPasswordDetail: false,
-      // statusList: statusList,
-    };
-  },
-  mounted() {
-    this.searchList();
-    // this.stockName(); //假数据,获取二级仓库名
-  },
-
-  methods: {
-    restSearch() {
-      //重置入参
-      this.parmValue = {};
-      this.searchList();
-    },
-
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    async deleteById(id, status) {
-      // await this.$confirm("确定要删除?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.$notify.success({
-      //         title: "删除成功",
-      //         message: "",
-      //       });
-      //       this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    async searchList() {
-      // this.loading = true;
-      // const res = await asyncRequest.list(this.parmValue);
-      // if (res && res.code === 0 && res.data) {
-      //   this.tableData = res.data.list;
-      //   this.pageInfo.total = Number(res.data.count);
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.tableData = [];
-      //   this.pageInfo.total = 0;
-      // }
-      // this.loading = false;
-    },
-
-    async statusConfirm(id, status) {
-      // let str = status === "1" ? "禁用" : "启用";
-      // await this.$confirm("确定要改为" + str + "?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     this.loading = true;
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.loading = false;
-      //       this.$notify.success({
-      //         title: "状态修改成功!",
-      //         message: "",
-      //       });
-      //       await this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    compareStock() {
-      //比较出库仓库和入库仓库是否相同
-      if (
-        this.stock_go === this.stock_in &&
-        this.stock_go !== "" &&
-        this.stock_go != ""
-      ) {
-        console.log("出库仓库和入库仓库相同");
-        this.$message({
-          message: "出库仓库不能和入库仓库相同",
-          type: "error",
-        });
-      }
-    },
-  },
-};
-</script>
-   <style lang="scss" >
-.newApply {
-}
-.el-form-item__content {
-  margin: 0 !important;
-}
-</style>
-   

+ 0 - 462
src/views/stock/allotFlow/components/newApply.vue

@@ -1,462 +0,0 @@
-<template>
-  <div class="newApply pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
-      <el-form
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="100px"
-      >
-        <el-form-item label="出库仓库" prop="stock_go_rule">
-          <el-cascader
-            placeholder="请选择出库仓库"
-            filterable
-            clearable
-            :size="searchSize"
-            v-model="ruleForm.selectStock_go"
-            :options="options"
-            style="width: 30%"
-            @change="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              stockName(true);
-            "
-          ></el-cascader>
-        </el-form-item>
-        <el-form-item label="入库仓库" prop="stock_in_rule">
-          <el-cascader
-            placeholder="请选择入库仓库"
-            filterable
-            clearable
-            :size="searchSize"
-            v-model="ruleForm.selectStock_in"
-            :options="options"
-            style="width: 30%"
-            @change="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              stockName();
-            "
-          ></el-cascader>
-        </el-form-item>
-        <el-form-item label="出库商品" prop="stock_go_product">
-          <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%; height: 40px"></div>
-            </template>
-            <template #operation="{ scope }">
-              <el-tooltip
-                v-if="powers.some((item) => item == '002')"
-                effect="dark"
-                content="重置密码"
-                placement="top"
-              >
-                <i
-                  class="el-icon-refresh-left tb-icon"
-                  @click="openPasswordModal(scope.row.id, false)"
-                ></i>
-              </el-tooltip>
-
-              <el-tooltip
-                v-if="powers.some((item) => item == '007')"
-                effect="dark"
-                content="详情"
-                placement="top"
-              >
-                <i
-                  class="el-icon-view tb-icon"
-                  @click="openModal(scope.row.id, true, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="powers.some((item) => item == '005')"
-                effect="dark"
-                content="修改"
-                placement="top"
-              >
-                <i
-                  class="el-icon-edit tb-icon"
-                  @click="openModal(scope.row.id, false, scope.row)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '1'
-                "
-                effect="dark"
-                content="禁用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-pause tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-              <el-tooltip
-                v-if="
-                  powers.some((item) => item == '004') &&
-                  scope.row.status === '0'
-                "
-                effect="dark"
-                content="启用"
-                placement="top"
-              >
-                <i
-                  class="el-icon-video-play tb-icon"
-                  @click="statusConfirm(scope.row.id, scope.row.status)"
-                ></i>
-              </el-tooltip>
-            </template>
-          </ex-table>
-          <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 statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import asyncRequest from "@/mock/service/stock/newApply";
-import addEdit from "./addEdit-newApply";
-import { mapGetters } from "vuex";
-
-export default {
-  name: "allotFlow",
-  mixins: [mixinPage, resToken],
-  components: {
-    addEdit,
-  },
-  computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "allotFlow"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  data() {
-    const validateStock = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      }
-    };
-
-    return {
-      // selectStock_in: "", //选择的入库仓库名称
-      // selectStock_go: [], //选择的出库仓库名称
-      stock_go: "", //出库仓库name
-      stock_in: "", //入库仓库name
-      options: [], //用于渲染二级仓库名
-      ruleForm: {
-        selectStock_go: "",
-        selectStock_in: "",
-      },
-      rules: {
-        //出入库规则
-        stock_go_rule: [
-          {
-            required: true,
-            message: "请选择出库仓库",
-            trigger: "blur",
-          },
-          { validator: validateStock, trigger: "blur" },
-        ],
-        stock_in_rule: [
-          {
-            required: true,
-            message: "请选择入库仓库",
-            trigger: "blur",
-          },
-          { validator: validateStock, trigger: "blur" },
-        ],
-        stock_go_product: [
-          {
-            required: true,
-            message: "请选择入库仓库",
-            trigger: "blur",
-          },
-        ],
-      },
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      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: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      parmValue: {},
-    };
-  },
-  mounted() {
-    // this.searchList();
-    // this.stockName(); //假数据,获取二级仓库名
-  },
-
-  methods: {
-    submitForm(formName) {
-      console.log("sds");
-      console.log(formName);
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          alert("submit!");
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-  },
-  restSearch() {
-    //重置入参
-    this.parmValue = {};
-    // this.searchList();
-  },
-
-  openModal(id, isDetail, sitem) {
-    this.showModel = isDetail;
-    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("取消");
-    //   });
-  },
-  async stockName(isShowModal = false) {
-    //获取多级仓库名称的方法
-    const res = await asyncRequest.listAll(this.parmValue);
-    // console.log(res.data);
-    // this.openModal("005", true);
-    // console.log(this.selectStock_go);
-    // console.log(this.selectStock_in);
-    // this.options = res.data;
-    // console.log(this.options);
-    let arr = res.data;
-    // console.log(arr);
-    arr.forEach((ele) => {
-      //重新封装后台传递来的数据,转换格式
-      let item = {
-        value: ele.id,
-        label: ele.name,
-        children: [],
-      };
-      ele.child.forEach((elem) => {
-        let model = {
-          value: elem.id,
-          label: elem.name,
-        };
-        item.children.push(model);
-      });
-      this.options.push(item);
-    });
-    this.options.forEach((ele) => {
-      //从数据表中筛选出我们要用的数据
-      if (ele.value === this.selectStock_go[0]) {
-        ele.children.forEach((elem) => {
-          if (elem.value === this.selectStock_go[1]) {
-            this.stock_go = ele.label + "/" + elem.label;
-          }
-        });
-      }
-      if (ele.value === this.selectStock_in[0]) {
-        ele.children.forEach((elem) => {
-          if (elem.value === this.selectStock_in[1]) {
-            this.stock_in = ele.label + "/" + elem.label;
-          }
-        });
-      }
-    });
-    if (this.selectStock_in != "" || this.selectStock_go != "") {
-      console.log("选择了一个项目");
-      this.openModal("005", isShowModal);
-    }
-    console.log(this.stock_go);
-    console.log(this.stock_in);
-    //   if(){
-
-    //   }
-    // console.log(this.pageInfo.total);
-
-    this.compareStock(); //比较出库仓库和入库仓库是否相同
-  },
-
-  compareStock() {
-    //比较出库仓库和入库仓库是否相同
-    if (
-      this.stock_go === this.stock_in &&
-      this.stock_go !== "" &&
-      this.stock_go != ""
-    ) {
-      console.log("出库仓库和入库仓库相同");
-      this.$message({
-        message: "出库仓库不能和入库仓库相同",
-        type: "error",
-      });
-    }
-  },
-};
-</script>
-   <style lang="scss" >
-.newApply {
-}
-.el-form-item__content {
-  margin: 0 !important;
-}
-.setcol-table-lie {
-  // margin: 0 !important;
-}
-</style>
-   

+ 0 - 0
src/views/stock/allotFlow/新建申请