Browse Source

Merge branch 'live' into edit

戴艳蓉 3 years ago
parent
commit
fc87d4bb2c

+ 3 - 3
src/apis/service/stock/check/detail.js

@@ -5,13 +5,13 @@ export default {
   // 添加
   add: (data, params) => http(api + "add", data, "post", params),
   // 删除
-  delete: (data, params) => http(api + "delete", data, "post", params),
+  delete: (data, params) => http(api + "checkedell", data, "post", params),
   // 分页查询
   list: (data, params) => http(api + "list", data, "post", params),
   // 详情
-  detail: (data, params) => http(api + "detail", data, "post", params),
+  detail: (data, params) => http(api + "checkinfo", data, "post", params),
   // 更新
-  update: (data, params) => http(api + "update", data, "post", params),
+  update: (data, params) => http(api + "checkedit", data, "post", params),
   // 修改状态
   status: (data, params) => http(api + "accountstatus", data, "post", params),
 };

+ 2 - 12
src/apis/service/stock/check/index.js

@@ -2,17 +2,7 @@
 import http from "@/apis/axios";
 const api = "admin/";
 export default {
-  // 添加
-  add: (data, params) => http(api + "checkcreate", data, "post", params),
-  // 删除
-  delete: (data, params) => http(api + "delete", data, "post", params),
-  // 分页查询
-  list: (data, params) => http(api + "checklist", 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),
+   // 分页查询
+   list: (data, params) => http(api + "checklist", data, "post", params),
 };
    

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

@@ -135,12 +135,11 @@
 import asyncRequest from "@/apis/components/search-good-modal";
 import resToken from "@/mixins/resToken";
 import mixinPage from "@/mixins/elPaginationHandle";
-import setNum from "@/mixins/setNum";
 import { mapGetters } from "vuex";
 import columns from "./columns";
 export default {
   name: "searchGoodModal",
-  mixins: [resToken, mixinPage, setNum],
+  mixins: [resToken, mixinPage],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
   },

+ 1 - 1
src/layout/components/AppMain.vue

@@ -35,7 +35,7 @@ export default {
 }
 
 .fixed-header + .app-main {
-  padding: 110px 0 0 0;
+  padding: 50px 0 0 0;
 }
 
 .hasTagsView {

+ 1 - 0
src/layout/components/TagsView/index.vue

@@ -2,6 +2,7 @@
   <div id="tags-view-container" class="tags-view-container">
     <scroll-pane
       ref="scrollPane"
+      
       class="tags-view-wrapper"
       @scroll="handleScroll"
     >

+ 9 - 1
src/mixins/resToken.js

@@ -7,9 +7,17 @@ export default {
       console.log(this.$route.path !== "/login")
       if (this.$route.path !== "/login") {
         await this.$store.dispatch("user/logout");
-        // window.vm.$router.push("login");
         this.$router.push(`/login`);
       }
     },
+    async routeGoto(path, query) {
+      window.vm.$router.push({
+        path: path,
+        query: query,
+      });
+    },
+    setNum(s) {
+      return s ? parseFloat(s + "").toFixed(2) : "-";
+    },
   }
 }

+ 0 - 7
src/mixins/setNum.js

@@ -1,7 +0,0 @@
-export default {
-  methods: {
-    setNum(s) {
-      return s ? parseFloat(s + "").toFixed(2) : "-";
-    },
-  }
-}

+ 1 - 1
src/settings.js

@@ -10,7 +10,7 @@ module.exports = {
    * @type {boolean} true | false
    * @description Whether need tagsView
    */
-  tagsView: true,
+  tagsView: false,
 
   /**
    * @type {boolean} true | false

+ 1 - 2
src/views/sellOut/consultOrder/addEdit.vue

@@ -36,12 +36,11 @@
    <script>
 import asyncRequest from "@/apis/service/sellOut/consultOrder";
 import resToken from "@/mixins/resToken";
-import setNum from "@/mixins/setNum";
 import columns from "./columnsForm";
 export default {
   name: "consultOrder",
   props: ["showModel", "id", "isDetail"],
-  mixins: [resToken, setNum],
+  mixins: [resToken],
   data() {
     return {
       loading: false,

+ 1 - 2
src/views/sellOut/consultOrder/index.vue

@@ -150,7 +150,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import setNum from "@/mixins/setNum";
 import addEdit from "./addEdit";
 import statusList from "@/assets/js/statusList";
 import asyncRequest from "@/apis/service/sellOut/consultOrder";
@@ -158,7 +157,7 @@ import { mapGetters } from "vuex";
 
 export default {
   name: "consultOrder",
-  mixins: [mixinPage, resToken, setNum],
+  mixins: [mixinPage, resToken],
   components: {
     addEdit,
   },

+ 62 - 8
src/views/stock/check/components/addEdit.vue

@@ -13,7 +13,10 @@
           <el-form-item label="盘点公司" prop="wsm_supplier">
             <search-supplier
               :value="ruleForm.wsm_supplier"
+              :disabled="status !== '0'"
+              :isDetail="id !== 'add'"
               :placeholder="'请选择盘点公司'"
+              :names="companyName"
               @searchChange="supplierChange"
             />
           </el-form-item>
@@ -23,6 +26,7 @@
             <search-stock
               :value="ruleForm.wsm_code"
               :isDetail="true"
+              :disabled="status !== '0'"
               :placeholder="'请选择盘点仓库'"
               :isRelation="true"
               :companyCode="companyCode"
@@ -36,6 +40,7 @@
             <el-select
               v-model="ruleForm.type"
               placeholder="请选择盘点类型"
+              :disabled="status !== '0'"
               style="width: 100%"
             >
               <el-option
@@ -49,9 +54,26 @@
           </el-form-item>
         </el-col>
         <el-col :span="24" style="text-align: right">
-          <el-button type="primary" @click="submitForm" v-if="!isDetail"
+          <el-button
+            @click="deleteById()"
+            plain
+            v-if="status !== '4'"
+            type="danger"
+            >作废盘点申请
+          </el-button>
+          <el-button
+            type="primary"
+            v-if="status === '1'"
+            plain
+            @click="submitForm"
+            >取消流程
+          </el-button>
+          <el-button type="primary" @click="submitForm" v-if="status === '0'"
             >保 存
           </el-button>
+          <el-button type="primary" @click="submitForm" v-if="status === '0'"
+            >保存并发起流程
+          </el-button>
         </el-col>
       </el-row>
     </el-form>
@@ -63,7 +85,7 @@
   </div>
 </template>
    <script>
-import asyncRequest from "@/apis/service/stock/check";
+import asyncRequest from "@/apis/service/stock/check/detail";
 import resToken from "@/mixins/resToken";
 import columns from "./columns";
 export default {
@@ -72,7 +94,9 @@ export default {
   mixins: [resToken],
   data() {
     return {
+      status: "0",
       companyCode: "",
+      companyName: "",
       loading: false,
       showGoodsModel: false,
       typeList: [
@@ -125,7 +149,7 @@ export default {
   },
   watch: {
     id: function (val) {
-      console.log(val);
+      // console.log(val);
       if (val) {
         this.initForm();
       }
@@ -157,13 +181,36 @@ export default {
       }
       this.$refs.ruleForm.validateField("wsm_code");
     },
-    deleteById(index) {
-      this.ruleForm.good_type_code.splice(index, 1);
-      this.$refs.ruleForm.validateField("good_type_code");
+    async deleteById() {
+      await this.$confirm("确定要作废?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            id: this.id,
+          };
+          const res = await asyncRequest.delete(model);
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "作废成功!",
+              message: "",
+            });
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
     },
     async initForm() {
       this.loading = true;
       if (this.id === "add") {
+        this.status = "";
         this.rulesThis = this.rules;
         await this.resetForm();
       } else {
@@ -176,8 +223,15 @@ export default {
     async initData() {
       const res = await asyncRequest.detail({ id: this.id });
       if (res && res.code === 0 && res.data) {
-        this.ruleForm = res.data;
-        this.ruleForm.role_id = this.ruleForm.role;
+        const { status, type, wsm_code } = res.data;
+        this.status = status;
+        this.companyCode = "GYS-20210517-0009";
+        this.companyName = "北京长跃科技发展有限公司";
+        this.ruleForm = {
+          wsm_code: [wsm_code],
+          type: type,
+          wsm_supplier: [this.companyCode],
+        };
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {

+ 1 - 1
src/views/stock/check/detail.vue

@@ -156,7 +156,7 @@ export default {
               title: "删除成功",
               message: "",
             });
-            this.searchList();
+            this.routeGoto("check", {});
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();
           } else {

+ 1 - 9
src/views/stock/check/index.vue

@@ -180,7 +180,7 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="gotoDetail(scope.row.id)"
+              @click="routeGoto('checkDetail', { id: scope.row.id })"
             ></i>
           </el-tooltip>
         </template>
@@ -394,14 +394,6 @@ export default {
       }
       this.loading = false;
     },
-    gotoDetail(id) {
-      window.vm.$router.push({
-        path: checkDetail,
-        query: {
-          id: id,
-        },
-      });
-    },
   },
 };
 </script>