zhangjinxing 3 years ago
parent
commit
f1d43ffa21

+ 10 - 10
src/apis/service/purchaseIn/storeManage/index.js

@@ -4,15 +4,15 @@ const api = "admin/";
 export default {
   // 添加
   add: (data, params) => http(api + "purchadd", data, "post", params),
-  // 删除
-  delete: (data, params) => http(api + "delete", data, "post", params),
-  // 分页查询
-  list: (data, params) => http(api + "list", data, "post", params),
-  // 详情
-  detail: (data, params) => http(api + "detail", data, "post", params),
-  // 更新
-  update: (data, params) => http(api + "update", data, "post", params),
-  // 修改状态
-  status: (data, params) => http(api + "accountstatus", data, "post", params),
+  // 备货申请 删除
+  delete: (data, params) => http(api + "purchdel", data, "post", params),
+  // 备货申请列表
+  list: (data, params) => http(api + "purchlist", data, "post", params),
+  // 备货详情
+  detail: (data, params) => http(api + "purchinfo", data, "post", params),
+  // 更新申请单
+  update: (data, params) => http(api + "purchedit", data, "post", params),
+  // 备库状态更新
+  status: (data, params) => http(api + "purchstatus", data, "post", params),
 };
    

+ 11 - 14
src/apis/service/purchaseIn/storeManageFlow/index.js

@@ -3,19 +3,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),
-  // 修改状态
-  status: (data, params) => http(api + "accountstatus", data, "post", params),  // 
-  // 获取仓库列表
-  listAll: (data, params) => http(api + "warelist", data, "post", params),
-
+  add: (data, params) => http(api + "purchadd", data, "post", params),
+  // 备货申请 删除
+  delete: (data, params) => http(api + "purchdel", data, "post", params),
+  // 备货申请列表
+  list: (data, params) => http(api + "purchlist", data, "post", params),
+  // 备货详情
+  detail: (data, params) => http(api + "purchinfo", data, "post", params),
+  // 更新申请单
+  update: (data, params) => http(api + "purchedit", data, "post", params),
+  // 备库状态更新
+  status: (data, params) => http(api + "purchstatus", data, "post", params),
 };
    

+ 1 - 1
src/components/search-good-modal/main.vue

@@ -144,7 +144,7 @@ export default {
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
   },
-  props: ["showModel"],
+  props: ["showModel", "once"],
 
   /**
    * 属性集合

+ 0 - 5
src/views/interest/handover/addEdit.vue

@@ -193,11 +193,6 @@ export default {
       });
     },
     async submitForm() {
-      // console.log(this.resign_uid);
-      // console.log(this.hand_uid);
-      // console.log(this.ruleForm.leaves_part);
-      // console.log(this.ruleForm.Handover_part);
-
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;

+ 16 - 45
src/views/interest/handover/components/addEditForm.vue

@@ -38,8 +38,8 @@
       </el-form>
     </el-col>
     <el-col :span="24" style="text-align: right">
-      <el-button type="primary" @click="save">保 存 </el-button>
-      <el-button type="primary" @click="submitForm" v-if="isBtn"
+      <el-button type="primary" @click="submitForm">保 存 </el-button>
+      <el-button type="primary" @click="submitForm('flow')" v-if="isBtn"
         >保 存 并 发 起 流 程
       </el-button>
       <el-button @click="closeAddEdit" v-if="isBtn"
@@ -154,6 +154,7 @@ export default {
           type: status,
           id,
         };
+        console.log(this.ruleForm.type);
         // this.$emit("refreshList");
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
@@ -176,46 +177,7 @@ export default {
         }
       });
     },
-    async save() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          let resign_uid = this.ruleForm.resign_uid;
-          let hand_uid = this.ruleForm.hand_uid;
-          if (resign_uid.toString() !== hand_uid.toString()) {
-            this.loading = true;
-            const model = {
-              id: this.ruleForm.id,
-              resign_uid: resign_uid.toString(),
-              hand_uid: hand_uid.toString(),
-            };
-            const res = await asyncRequest.update(model);
-            window.vm.$router.push({
-              path: "handover",
-            });
-            this.loading = false;
-            if (res && res.code === 0) {
-              this.$notify.success({
-                title: "修改成功!",
-                message: "",
-              });
-              this.showModelThis = false;
-              // 刷新
-              this.$emit("refresh", false);
-            } else if (res && res.code >= 100 && res.code <= 104) {
-              await this.logout();
-            } else {
-              this.$message.warning(res.message);
-            }
-          } else {
-            this.$message.error("离职人和接收人不能相同");
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    async submitForm() {
+    async submitForm(flow) {
       console.log(this.ruleForm);
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
@@ -229,6 +191,7 @@ export default {
               hand_uid: hand_uid.toString(),
             };
             console.log(model);
+            console.log(this.id);
             let res = {};
             if (this.id === "add") {
               delete model["id"];
@@ -236,8 +199,14 @@ export default {
               console.log(res);
             } else {
               res = await asyncRequest.update(model);
-              this.updateStatus();
+              if (flow == "flow") {
+                console.log("状态更新接口");
+                this.updateStatus();
+              }
             }
+            window.vm.$router.push({
+              path: "handover",
+            });
             this.loading = false;
             if (res && res.code === 0) {
               const title = this.id === "add" ? "添加成功!" : "修改成功!";
@@ -263,10 +232,12 @@ export default {
       });
     },
     async updateStatus() {
+      console.log(this.ruleForm);
+      let { id, type } = this.ruleForm;
       let model = {
-        id: this.ruleForm.id,
+        id: id,
         remark: "123",
-        status: this.ruleForm.type,
+        status: "1",
       };
       console.log(model);
       const res = await asyncRequest.updateStatus(model);

+ 0 - 13
src/views/interest/handover/index.vue

@@ -186,18 +186,6 @@ export default {
           value: "2",
           label: "状态2",
         },
-        {
-          value: "3",
-          label: "状态3",
-        },
-        {
-          value: "4",
-          label: "状态4",
-        },
-        {
-          value: "5",
-          label: "状态5",
-        },
       ],
       statusList: statusList,
       loading: true,
@@ -263,7 +251,6 @@ export default {
   methods: {
     // 表格行选中的方法
     RowClick(e) {
-      console.log(e);
       window.vm.$router.push({
         path: "newProcess",
         query: {

+ 115 - 53
src/views/purchaseIn/storeManage/addEdit.vue

@@ -25,14 +25,14 @@
           >
             <el-form-item label="商品名称" prop="goods_name">
               <el-input
-                style="width: 80%"
                 v-model="ruleForm.goods_name"
+                readonly="true"
+                @focus="hand"
               ></el-input>
               <!-- <search-good-modal /> -->
             </el-form-item>
             <el-form-item label="采购数量" prop="goods_num">
               <el-input
-                style="width: 80%"
                 v-model="ruleForm.goods_num"
                 placeholder="请输入内容"
                 :size="searchSize"
@@ -40,31 +40,33 @@
             </el-form-item>
             <el-form-item label="最晚入库时间" prop="last_go_stock">
               <el-date-picker
-                style="width: 80%"
                 :size="searchSize"
                 v-model="ruleForm.last_go_stock"
                 type="date"
-                value-format="timestamp"
+                style="width: 100%"
+                value-format="yyyy-MM-dd HH:mm:ss"
                 placeholder="选择日期"
                 @change="selectTime"
               >
               </el-date-picker>
             </el-form-item>
-            <el-form-item label="入库仓库" prop="stock_in_rule">
-              <el-cascader
-                placeholder="请选择入库仓库"
-                filterable
-                clearable
-                :size="searchSize"
-                v-model="ruleForm.stock_in_rule"
-                :options="options"
-                style="width: 80%"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  stockName();
-                "
-              ></el-cascader>
+            <el-form-item label="供应商名称" prop="supplier_code">
+              <search-supplier
+                :value="ruleForm.supplier_code"
+                :placeholder="'请选择供应商'"
+                @searchChange="selectSupplier"
+              />
+            </el-form-item>
+            <el-form-item label="仓库名称" prop="stock_code">
+              <search-stock
+                :value="ruleForm.stock_code"
+                :isDetail="true"
+                :placeholder="'请选择盘点仓库'"
+                :isRelation="true"
+                :companyCode="companyCode"
+                :names="''"
+                @searchChange="selectStock"
+              />
             </el-form-item>
           </el-form>
         </el-col>
@@ -79,6 +81,12 @@
         </el-col>
       </el-row>
     </el-card>
+    <search-good-modal
+      :once="true"
+      :show-model="showGoodsModel"
+      @cancel="showGoodsModel = false"
+      @resultList="addGoodsRes"
+    />
   </el-dialog>
 </template>
    <script>
@@ -90,14 +98,20 @@ export default {
   mixins: [resToken],
   data() {
     return {
+      stockCode: "",
+      companyCode: "",
+      showGoodsModel: "", //打开新弹窗
       loading: false,
       title: "新建备货申请",
       showModelThis: this.showModel,
       ruleForm: {
+        good_code: "",
+        good_type_code: "",
         goods_name: "", //商品名称
         goods_num: "", //商品数量
         last_go_stock: "", //最晚入库时间
-        stock_in_rule: "", //入库仓库
+        supplier_code: [], //供应商名称
+        stock_code: [],
       },
       rulesThis: this.rules,
       rules: {
@@ -125,10 +139,19 @@ export default {
             trigger: ["blur", "change"],
           },
         ],
-        stock_in_rule: [
+        supplier_code: [
           {
+            type: "array",
             required: true,
-            message: "请选择入库仓库",
+            message: "请选择供应商",
+            trigger: "change",
+          },
+        ],
+        stock_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择仓库",
             trigger: "change",
           },
         ],
@@ -149,6 +172,52 @@ export default {
     },
   },
   methods: {
+    // 选择仓库
+    selectStock(e) {
+      if (e && e.id) {
+        this.ruleForm.stock_code = [e.code];
+        this.stockCode = e.code;
+      } else {
+        this.ruleForm.stockCode = [];
+        this.stockCode = "";
+      }
+      this.$refs.ruleForm.validateField("stock_code");
+    },
+    // 选择供应商
+    selectSupplier(e) {
+      console.log(e);
+      console.log(this.ruleForm);
+      if (e && e.id) {
+        this.ruleForm.supplier_code = [e.code];
+        this.companyCode = e.code;
+      } else {
+        this.ruleForm.supplier_code = [];
+        this.companyCode = "";
+      }
+      this.$refs.ruleForm.validateField("supplier_code");
+    },
+    // 执行点击商品名称的抛出事件
+    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;
+      // let oldList = JSON.parse(JSON.stringify(this.ruleForm.good_type_code)),
+      //   addList = JSON.parse(JSON.stringify(e)),
+      //   newList = [].concat(...oldList);
+      // addList.forEach((v1, index) => {
+      //   let oldindex = oldList.findIndex((v2) => v1.good_code === v2.good_code);
+      //   if (oldindex === -1) {
+      //     newList.push(addList[index]);
+      //   }
+      // });
+      // this.ruleForm.good_type_code = [].concat(...newList);
+      this.$refs.ruleForm.validateField("goods_name");
+    },
+    hand() {
+      this.showGoodsModel = true;
+    },
     // 最晚入库时间选择
     selectTime(e) {
       console.log(e);
@@ -174,32 +243,16 @@ export default {
       }
       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);
-      }
+      // 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() {
       // 重置
@@ -208,7 +261,11 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
-            goods_name: "GD-GY199803100001", //商品名称
+            stock_code: [],
+            supplier_code: [],
+            good_code: "",
+            good_type_code: "",
+            goods_name: "", //商品名称
             goods_num: "100", //商品数量
             last_go_stock: "", //最晚入库时间
             stock_in_rule: "WSMcmpk211008104949", //入库仓库
@@ -225,16 +282,21 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
+          // if
           console.log(this.ruleForm);
           // const { username, name, mobile, email, role_id, status } = JSON.parse(
           //
           // );
-
-          const { goods_num, goods_name, last_go_stock, stock_in_rule } =
-            this.ruleForm;
+          const {
+            good_code,
+            good_type_code,
+            last_go_stock,
+            stock_in_rule,
+            goods_num,
+          } = this.ruleForm;
           const model = {
-            good_code: goods_name || "",
-            good_type_code: "GY199803100001",
+            good_code: good_code || "",
+            good_type_code: good_type_code || "",
             good_num: goods_num || "",
             wsm_code: stock_in_rule || "",
             lastime: last_go_stock || "",

+ 31 - 29
src/views/purchaseIn/storeManage/index.vue

@@ -10,6 +10,7 @@
         :columns="columns"
         :page="pageInfo"
         :size="size"
+        @RowClick="RowClick"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
         @screen-reset="
@@ -72,16 +73,6 @@
                     重置
                   </el-button>
                 </el-col>
-                <el-col :span="4" style="width: 66px">
-                  <el-button
-                    type="warning"
-                    class="fr"
-                    :size="searchSize"
-                    @click="handleClick"
-                  >
-                    进入详情
-                  </el-button>
-                </el-col>
                 <el-col :span="3" style="width: 66px; float: right">
                   <el-button
                     :size="searchSize"
@@ -267,32 +258,32 @@ export default {
       // 表格 - 列参数
       columns: [
         {
-          prop: "nickname",
+          prop: "bk_code",
           label: "申请编号",
         },
         {
-          prop: "role_name",
+          prop: "apply_name",
           label: "申请人",
         },
         {
-          prop: "mobile",
+          prop: "good_name",
           label: "商品名称",
         },
         {
-          prop: "email",
+          prop: "good_type_code",
           label: "商品属性",
         },
+        // {
+        //   prop: "unit",
+        //   label: "单位",
+        // },
         {
-          prop: "unit",
-          label: "单位",
-        },
-        {
-          prop: "num",
+          prop: "good_num",
           label: "数量",
         },
         {
-          prop: "time",
-          label: "期望入库时间",
+          prop: "lasttime",
+          label: "最晚入库时间",
         },
         {
           prop: "status",
@@ -305,21 +296,32 @@ export default {
           label: "创建时间",
           sortable: true,
         },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
+        // {
+        //   prop: "",
+        //   label: "操作",
+        //   fixed: "right",
+        //   _noset_: true,
+        //   _slot_: "operation",
+        // },
       ],
     };
   },
   mounted() {
-    // this.searchList();
+    this.searchList();
   },
 
   methods: {
+    // 点击行操作
+    RowClick(e) {
+      // console.log(e);
+      window.vm.$router.push({
+        path: "storeManageFlow",
+        query: {
+          id: e.id,
+        },
+      });
+    },
+
     //跳转到新建页面
 
     handleClick() {

+ 167 - 242
src/views/purchaseIn/storeManageFlow/components/newSetStock.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="newApply pagePadding">
-    {{ ruleForm }}
+    {{ ruleForm }}id{{ id }}
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
@@ -23,16 +23,7 @@
               ></el-input>
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="12">
-            <el-form-item label="商品数量" prop="goods_name">
-              <el-input
-                style="width: 100%"
-                v-model="ruleForm.goods_name"
-                placeholder="请输入内容"
-                :size="searchSize"
-              ></el-input>
-            </el-form-item>
-          </el-col> -->
+
           <el-col :span="12">
             <el-form-item label="采购数量" prop="goods_num">
               <el-input
@@ -78,86 +69,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-form-item label="收件人" prop="consignee">
-              <search-account
-                :value="ruleForm.consignee"
-                :size="searchSize"
-                style="width: 100%"
-                @searchChange="handleResignName"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="电话" prop="mobile">
-              <el-input
-                v-model="ruleForm.mobile"
-                placeholder="请输入电话"
-                :size="searchSize"
-                style="width: 100%"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row> -->
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-form-item label="收货地址" prop="receivedArea">
-              <select-area
-                :value="ruleForm.receivedArea"
-                :size="searchSize"
-                :placeholder="'请输入收货地址'"
-                style="width: 100%"
-                @selectChange="selectArea"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="详细地址" prop="detailArea">
-              <el-input
-                :size="searchSize"
-                v-model="ruleForm.detailArea"
-                style="width: 100%"
-                placeholder="详细地址"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row> -->
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-form-item label="物流单号" prop="express_number">
-              <el-input
-                :size="searchSize"
-                style="width: 100%"
-                placeholder="物流单号"
-                v-model="ruleForm.express_number"
-              /> </el-form-item
-          ></el-col>
-          <el-col :span="12">
-            <el-form-item label="发货时间" prop="send_out_time">
-              <el-date-picker
-                style="width: 100%"
-                :size="searchSize"
-                v-model="ruleForm.send_out_time"
-                value-format="timestamp"
-                type="date"
-                placeholder="选择日期"
-                @change="selectOutTime"
-              >
-              </el-date-picker> </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('ruleForm')"
-              >保 存
-            </el-button>
-            <el-button type="warning" @click="submitForm('ruleForm')"
-              >保 存 并 发 起 流 程
-            </el-button>
-          </el-col>
-        </el-form-item> -->
       </el-form>
       <el-divider content-position="center">采购反馈</el-divider>
       <el-form
@@ -248,7 +159,6 @@ import { isMobile, isAlphanumeric } from "@/utils/validate";
 export default {
   name: "allotFlow",
   mixins: [mixinPage, resToken],
-
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -289,6 +199,7 @@ export default {
       }
     };
     return {
+      id: "", //路由传过来的id
       inTime: "",
       goTime: "",
       ruleForm: {
@@ -461,6 +372,10 @@ export default {
       parmValue: {},
     };
   },
+  mounted() {
+    this.id = this.$route.query.id;
+    this.searchList();
+  },
   methods: {
     // 选择省市区
     selectArea(e) {
@@ -529,164 +444,174 @@ export default {
         });
       }
     },
-  },
-  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;
-  },
+    restSearch() {
+      //重置入参
+      this.parmValue = {};
+      // this.searchList();
+    },
 
-  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;
-          }
-        });
+    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.detail({ id: this.id });
+      if (res && res.code === 0 && res.data) {
+        console.log(res);
+        let {
+          bk_code,
+          apply_id,
+          apply_name,
+          good_code,
+          good_name,
+          good_num,
+          good_type_code,
+          wsm_code,
+          lasttime,
+          wsm_name,
+          status,
+          is_del,
+        } = 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;
       }
-      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;
-          }
+      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);
       }
-    });
-    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.stock_go);
+      console.log(this.stock_in);
+      //   if(){
 
-    //   }
-    // console.log(this.pageInfo.total);
+      //   }
+      // console.log(this.pageInfo.total);
 
-    this.compareStock(); //比较出库仓库和入库仓库是否相同
-  },
+      this.compareStock(); //比较出库仓库和入库仓库是否相同
+    },
 
-  compareStock() {
-    //比较出库仓库和入库仓库是否相同
-    if (
-      this.stock_go === this.stock_in &&
-      this.stock_go !== "" &&
-      this.stock_go != ""
-    ) {
-      console.log("出库仓库和入库仓库相同");
-      this.$message({
-        message: "出库仓库不能和入库仓库相同",
-        type: "error",
-      });
-    }
+    compareStock() {
+      //比较出库仓库和入库仓库是否相同
+      if (
+        this.stock_go === this.stock_in &&
+        this.stock_go !== "" &&
+        this.stock_go != ""
+      ) {
+        console.log("出库仓库和入库仓库相同");
+        this.$message({
+          message: "出库仓库不能和入库仓库相同",
+          type: "error",
+        });
+      }
+    },
   },
 };
 </script>