戴艳蓉 3 years ago
parent
commit
b2005fb00f

+ 15 - 0
src/apis/service/stock/allot/detail.js

@@ -0,0 +1,15 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 新建程
+  add: (data, params) => http(api + "allotcreate", data, "post", params),
+  // 删除
+  delete: (data, params) => http(api + "allotdelect", 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 + "allotstatus", data, "post", params),
+};

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

@@ -2,17 +2,8 @@
 import http from "@/apis/axios";
 const api = "admin/";
 export default {
-  // 新建调拨流程
-  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),
+
 };
    

+ 3 - 0
src/assets/js/btnList.js

@@ -15,5 +15,8 @@ const btnList = [
   { code: "014", name: "取消流程" },
   { code: "015", name: "作废数据" },
   { code: "016", name: "离职交接审核" },
+  { code: "017", name: "盘点结果上传" },
+  { code: "018", name: "盘点结果审核" },
+  { code: "019", name: "盘点商品导出" },
 ];
 export default btnList;

+ 28 - 36
src/views/stock/allot/components/addForm.vue

@@ -162,12 +162,13 @@
       </el-form>
     </el-col>
     <el-col :span="24" style="text-align: right">
-      <el-button type="primary" @click="submitForm" v-if="!isDetail"
+      <el-button
+        type="primary"
+        :size="'mini'"
+        @click="submitForm"
+        v-if="!isDetail"
         >保 存
       </el-button>
-      <el-button @click="closeModel">{{
-        isDetail ? "关 闭" : "取 消"
-      }}</el-button>
     </el-col>
     <el-col :span="24">
       <search-stock-good-modal
@@ -180,7 +181,7 @@
   </el-row>
 </template>
    <script>
-import asyncRequest from "@/apis/service/stock/allot";
+import asyncRequest from "@/apis/service/stock/allot/detail";
 import resToken from "@/mixins/resToken";
 export default {
   name: "allot",
@@ -189,6 +190,7 @@ export default {
   data() {
     return {
       showGoodsModel: false,
+      status: "",
       // id: "",
       supplier_code: "",
       stock_in_code: "",
@@ -396,40 +398,17 @@ export default {
 
     async initForm() {
       this.loading = true;
-      // await this.getRole();
-      console.log(this.id);
       if (this.id === "add") {
-        this.rulesThis = this.rules;
-        await this.resetForm();
-      } else {
-        this.rulesThis = this.rules;
-        await this.resetForm();
-        await this.initData();
+        this.status = "";
       }
+      this.rulesThis = this.rules;
+      await this.resetForm();
       this.loading = false;
     },
 
     async initData() {
       const res = await asyncRequest.detail({ id: this.id });
       if (res && res.code === 0 && res.data) {
-        const { item, wsm_in, wsm_out, wsm_in_name, wsm_out_name } = res.data;
-        this.supplier_code = wsm_out;
-        this.stock_in_code = wsm_in;
-        this.supplier_name = wsm_out_name;
-        this.supplier_in_name = wsm_in_name;
-        this.ruleForm = {
-          supplier_code: [], //出库供应商code
-          stock_code: [wsm_out], //出库仓库code
-          supplier_in_code: [], //入库供应商code
-          stock_in_code: [wsm_in], //入库仓库code
-          product_go: item, //出库商品
-        };
-        this.ruleForm.product_go.map((v) => {
-          v.usable_stock = v.usable_num;
-          v.type_code = v.good_type_code;
-          v.edit=f
-          return v;
-        });
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
@@ -442,13 +421,26 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
+          const { item, wsm_in, wsm_out, wsm_in_name, wsm_out_name, status } =
+            this.sitem;
+          this.supplier_code = wsm_out || "";
+          this.stock_in_code = wsm_in || "";
+          this.supplier_name = wsm_out_name || "";
+          this.supplier_in_name = wsm_in_name || "";
+          this.status = status;
           this.ruleForm = {
-            supplier_code: [], //出库供应商code
-            stock_code: [], //出库仓库code
-            supplier_in_code: [], //入库供应商code
-            stock_in_code: [], //入库仓库code
-            product_go: [], //出库商品
+            supplier_code: [] || [], //出库供应商code
+            stock_code: [wsm_out] || [], //出库仓库code
+            supplier_in_code: [] || [], //入库供应商code
+            stock_in_code: [wsm_in] || [], //入库仓库code
+            product_go: item||[], //出库商品
           };
+          this.ruleForm.product_go.map((v) => {
+            v.usable_stock = v.usable_num;
+            v.type_code = v.good_type_code;
+            v.edit = false
+            return v;
+          });
         }
       });
     },

+ 129 - 50
src/views/stock/allot/detail.vue

@@ -4,10 +4,49 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
+      {{ status }},{{ powers }}
+      <div class="tr" style="padding: 10px 0">
+        <span class="fl" style="padding: 3px 0 0 3px">调拨详情</span>
+        <el-button
+          type="primary"
+          plain
+          :size="'mini'"
+          @click="statusConfirm('1', '发起审核流程')"
+          v-if="status === '0' && powers.some((item) => item == '012')"
+          >发起审核流程
+        </el-button>
+
+        <el-button
+          type="primary"
+          :size="'mini'"
+          @click="statusConfirm('-2', '导出盘点商品')"
+          v-if="status === '1' && powers.some((item) => item == '014')"
+          >导出盘点商品
+        </el-button>
+        <el-button
+          @click="statusConfirm('0', '取消审核流程')"
+          plain
+          :size="'mini'"
+          v-if="status === '1' && powers.some((item) => item == '014')"
+          >取消审核流程</el-button
+        >
+        <el-button
+          @click="statusConfirm('-1', '作废该条信息')"
+          type="danger"
+          plain
+          :size="'mini'"
+          v-if="
+            (status === '0' || status === '1') &&
+            powers.some((item) => item == '015')
+          "
+          >作废该条信息</el-button
+        >
+      </div>
       <add-form
-        v-if="$route.query.id"
-        :id="$route.query.id"
-        @closeModel="closeModel"
+        :newTime="newTime"
+        v-if="newTime !== ''"
+        :sitem="sitem"
+        :id="queryId"
       />
       <!-- 详情 -->
 
@@ -26,14 +65,6 @@
         v-if="$route.query.id"
         :myType="type"
       ></CheckStock> -->
-      <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>
@@ -43,6 +74,7 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/stock/allot/detail";
 import { mapGetters } from "vuex";
 import addForm from "./components/addForm"; //新建申请页面
 // import GoStock from "./components/goStock-audit.vue"; //出库方发货
@@ -77,57 +109,104 @@ export default {
   },
   data() {
     return {
-      company: "",
-      type: 1, //假数据,用于表示后台的操作流程节点
-      /**
-       * type=1,那么表示当前是新建申请流程,只显示新建申请组件。newApply
-       * type=2,入库方审核流程   inStock-audit
-       * type=3,出库方发货流程   goStock-audit
-       * type=4,入库方验货流程   inStock-check
-       * type=5,验货审核流程     checkStock
-       *
-       */
+      activeNames: [],
+      sitem: null,
+      status: "",
+      newTime: "",
       loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      //入参
-      parmValue: {
-        //page: 1,  页码
-        //size: 15,  每页显示条数
-      },
+      queryId: "",
     };
   },
   mounted() {
-    this.searchList();
+    this.status = "";
+    this.queryId = this.$route.query.id;
+    this.initData();
   },
-
   methods: {
     handClick(value) {
       console.log("执行子组件事件", value);
       this.company = value;
     },
-    restSearch() {
-      //重置入参
-      this.parmValue = {
-        page: 1, // 页码
-        size: 10, // 每页显示条数
+    async statusConfirm(status, message) {
+      await this.$confirm(`确定要${message}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          if (status === "-1") {
+            await this.deleteById(message);
+          } else if (status === "-2") {
+            await this.exportGood(message);
+          } else {
+            await this.setStatus(status, message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+
+    async deleteById(message) {
+      const res = await asyncRequest.delete({ id: this.queryId });
+      if (res && res.code === 0) {
+        this.$notify.success({
+          title: message + "成功!",
+          message: "",
+        });
+
+        this.routeGoto("check", {});
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+
+    async setStatus(status, message, remark) {
+      let model = {
+        id: this.queryId,
+        remark: remark || "",
+        status: status,
       };
-      this.searchList();
+      const res = await asyncRequest.status(model);
+      this.loading = false;
+      if (res && res.code === 0) {
+        this.$notify.success({
+          title: message + "成功!",
+          message: "",
+        });
+        this.initData();
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+    async examForm(e) {
+      if (!loading) {
+        let type = e.state === "1" ? "2" : "0";
+        await this.setStatus(type, message, e.remark);
+      }
     },
-    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 initData() {
+      this.loading = true;
+      const res = await asyncRequest.detail({ id: this.queryId });
+      if (res && res.code === 0 && res.data) {
+        this.sitem = res.data;
+        this.status = this.sitem.status;
+        this.activeNames = [this.status];
+        //;
+        this.getNewTime();
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+      this.loading = false;
     },
   },
 };

+ 43 - 40
src/views/stock/allot/index.vue

@@ -45,29 +45,6 @@
                     placeholder="调拨编号"
                   />
                 </el-col>
-                <!--搜索按钮 -->
-                <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"
-                    @click="searchList"
-                  >
-                  </el-button>
-                </el-col>
-                <el-col :span="4" style="width: 66px; padding-left: 10px">
-                  <el-button
-                    style="width: 100%"
-                    type="success"
-                    class="fr"
-                    :size="searchSize"
-                    @click="addSearch('add', false)"
-                  >
-                    新建
-                  </el-button>
-                </el-col>
 
                 <el-col :span="3" style="width: 66px; float: right">
                   <el-button
@@ -79,23 +56,11 @@
                     刷新
                   </el-button>
                 </el-col>
-
-                <el-col :span="4" style="width: 66px; padding-left: 10px">
-                  <el-button
-                    style="width: 100%"
-                    type="warning"
-                    class="mr5"
-                    :size="searchSize"
-                    @click="restSearch"
-                  >
-                    重置
-                  </el-button>
-                </el-col>
               </el-col>
             </el-row>
-            <el-row>
+            <el-row style="padding:10px 0 0 0;">
               <!-- 入库仓库 -->
-              <el-col :span="4" style="width: 220px; padding: 10px 0 0 0px">
+              <el-col :span="4" style="width: 220px; ">
                 <el-input
                   :size="searchSize"
                   v-model="parmValue.wsm_in"
@@ -104,14 +69,52 @@
                 />
               </el-col>
               <!-- 出库仓库 -->
-              <el-col :span="4" style="width: 230px; padding: 10px 0 0 10px">
+              <el-col :span="4" style="width: 230px; padding: 0 0 0 10px;">
                 <el-input
                   :size="searchSize"
                   v-model="parmValue.wsm_out"
                   :maxlength="40"
                   placeholder="出库仓库名称"
-                /> </el-col
-            ></el-row>
+                />
+              </el-col>
+              <!--搜索按钮 -->
+              <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"
+                  @click="searchList"
+                >
+                </el-button>
+              </el-col>
+              <el-col :span="4" style="width: 66px; padding-left: 10px">
+                <el-button
+                  style="width: 100%"
+                  type="warning"
+                  class="mr5"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>
+              <el-col
+                :span="4"
+                style="width: 66px; padding-left: 10px; float: right"
+              >
+                <el-button
+                  style="width: 100%"
+                  type="success"
+                  class="fr"
+                  :size="searchSize"
+                  @click="addSearch('add', false)"
+                >
+                  新建
+                </el-button>
+              </el-col>
+            </el-row>
           </div>
         </template>
         <template #status="{ scope }">

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

@@ -216,17 +216,15 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          console.log(this.sitem);
           const { status, type, wsm_code, code, name } = this.sitem;
-          this.status = status||"";
-          this.companyCode = code||"";
-          this.companyName = name||"";
+          this.status = status || "";
+          this.companyCode = code || "";
+          this.companyName = name || "";
           this.ruleForm = {
-            wsm_code: [wsm_code]||[],
-            type: type||"",
-            wsm_supplier: [this.companyCode]||[],
+            wsm_code: wsm_code ? [wsm_code] : [],
+            type: type || "2",
+            wsm_supplier: this.companyCode ? [this.companyCode] : [],
           };
-       
         }
       });
     },
@@ -258,11 +256,8 @@ export default {
               title,
               message: "",
             });
-            // 刷新
-            if (this.id === "add") {
-              this.showModelThis = false;
-              this.$emit("refresh", false);
-            }
+            this.showModelThis = false;
+            this.$emit("refresh");
           } else if (res && res.code >= 100 && res.code <= 104) {
             await this.logout();
           } else {

+ 59 - 82
src/views/stock/check/components/resultUplod.vue

@@ -20,31 +20,31 @@
         searchList();
       "
     >
-      <template #table-header="{}">
+      <template
+        #table-header="{}"
+        v-if="
+          tableData.length === 0 &&
+          status == '1' &&
+          powers.some((item) => item == '017')
+        "
+      >
         <div style="width: 100%">
-          <el-row style="0">
-            <el-col :span="24">
-              <el-col :span="3" style="width: 66px; float: right">
-                <el-button
-                  v-if="tableData.length === 0"
-                  @click="importshowModel = true"
-                  :size="'mini'"
-                  type="success"
-                  style="float: right; margin-left: 5px"
-                >
-                  添加
-                </el-button>
-              </el-col>
-            </el-col>
-          </el-row>
+          <el-button
+            @click="importshowModel = true"
+            :size="'mini'"
+            type="success"
+            style="float: right"
+          >
+            添加
+          </el-button>
         </div>
       </template>
-      <template #status="{ scope }">
+      <template #is_profit="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '0' ? 'warning' : ''"
+          :type="scope.row.is_profit == '0' ? 'success' : 'warning'"
           v-text="
-            (statusOptions.find((item) => item.id == scope.row.status) || {})
+            (typeOptions.find((item) => item.id == scope.row.is_profit) || {})
               .label || '--'
           "
         ></el-tag>
@@ -59,41 +59,25 @@
           "
         ></el-tag>
       </template>
-      <template #operation="{ scope }">
-        <el-tooltip
-          v-if="powers.some((item) => item == '007')"
-          effect="dark"
-          content="详情"
-          placement="top"
-        >
-          <i
-            class="el-icon-view tb-icon"
-            @click="routeGoto('checkDetail', { id: scope.row.id })"
-          ></i>
-        </el-tooltip>
-      </template>
     </ex-table>
     <result-uplod-model
       :show-model="importshowModel"
       :id="id"
-      @refresh="
-        pageInfo.curr = 1;
-        parmValue.page = 1;
-        searchList();
-      "
+      @refresh="refresh"
       @cancel="importshowModel = false"
     />
   </div>
 </template>
    <script>
 import asyncRequest from "@/apis/service/stock/check/detail";
+import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import resultUplodModel from "./resultUplodModel";
 import { mapGetters } from "vuex";
 export default {
   name: "addEdit",
-  props: ["id"],
-  mixins: [resToken],
+  props: ["id", "newTime", "sitem"],
+  mixins: [mixinPage, resToken],
   components: {
     resultUplodModel,
   },
@@ -113,16 +97,16 @@ export default {
   },
 
   watch: {
-    id: function (val) {
+    newTime: function (val) {
       if (val) {
-        this.initForm();
+        this.restSearch();
       }
     },
   },
   data() {
     return {
       importshowModel: false,
-      sitem: null,
+      status: "",
       // 节点状态
       statusOptions: [
         { id: "0", label: "待发起流程" },
@@ -133,8 +117,8 @@ export default {
       ],
       // 盘点类型
       typeOptions: [
-        { id: "1", label: "全盘" },
-        { id: "2", label: "抽盘" },
+        { id: "0", label: "盘盈" },
+        { id: "1", label: "盘亏" },
       ],
       loading: true,
       showModel: false,
@@ -155,7 +139,7 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"],
+        // _defaultHeader_: ["setcol"],
       },
       // 表格 - 分页
       pageInfo: {
@@ -166,65 +150,54 @@ export default {
       // 表格 - 列参数
       columns: [
         {
-          prop: "check_code",
-          label: "盘点编号",
-          width: "155px",
+          prop: "good_type_code",
+          label: "商品属性编号",
+          "min-width": "130px",
         },
 
         {
-          prop: "wsm_code",
-          label: "仓库编码",
-          width: "170px",
+          prop: "good_name",
+          label: "商品名称",
+          "min-width": "200px",
         },
         {
-          prop: "name",
-          label: "仓库名称",
+          prop: "is_profit",
+          label: "盘盈/盘亏",
+          _slot_: "is_profit",
+          "min-width": "100px",
         },
-
         {
-          prop: "code",
-          label: "公司编码",
-          width: "140px",
+          prop: "origin_num",
+          label: "盘点前数量",
+          "min-width": "110px",
         },
+
         {
-          prop: "caname",
-          label: "公司名称",
+          prop: "check_num",
+          label: "盘点后数量",
+          "min-width": "110px",
         },
         {
-          prop: "status",
-          label: "盘点状态",
-          _slot_: "status",
-          width: "120px",
+          prop: "diff_num",
+          label: "差额数量",
+          "min-width": "100px",
         },
 
-        {
-          prop: "type",
-          label: "盘点类型",
-          _slot_: "type",
-          width: "70px",
-        },
         {
           prop: "addtime",
-          label: "创建时间",
-          width: "140px",
-        },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          width: "50px",
-          _slot_: "operation",
+          label: "结果上传时间",
+          width: "145px",
         },
       ],
     };
   },
   mounted() {
-    this.searchList();
+    this.restSearch();
   },
 
   methods: {
     restSearch() {
+      this.status = this.sitem.status;
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
@@ -238,6 +211,12 @@ export default {
       };
       this.searchList();
     },
+    refresh() {
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      this.searchList();
+      this.$emit("refresh");
+    },
     async searchList() {
       this.loading = true;
       this.parmValue.id = this.id;
@@ -258,7 +237,5 @@ export default {
 </script>
 
    <style lang="scss" scoped>
-.check {
-}
 </style>
    

+ 27 - 21
src/views/stock/check/components/resultUplodModel.vue

@@ -39,7 +39,11 @@
           </el-table>
         </el-col>
         <el-col :span="24" style="text-align: right; margin: 15px 0 0 0">
-          <el-button v-if="!isDetail" :size="'mini'" type="primary" @click="submitForm"
+          <el-button
+            v-if="!isDetail"
+            :size="'mini'"
+            type="primary"
+            @click="submitForm"
             >保 存
           </el-button>
           <el-button :size="'mini'" @click="showModelThis = false">{{
@@ -57,7 +61,7 @@ import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/stock/check/detail";
 export default {
   name: "resultUplodModel",
-  props: ["showModel",'id'],
+  props: ["showModel", "id"],
   mixins: [resToken],
   data() {
     return {
@@ -175,25 +179,27 @@ export default {
       });
     },
     async submitForm() {
- 
-          if (!this.loading) {
-            this.loading = true;
-            let model = {
-              id: this.id,
-              data: this.tableData,
-            };
-            const res = await asyncRequest.checkimport(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);
-            }
-          }
+      if (!this.loading) {
+        this.loading = true;
+        let model = {
+          id: this.id,
+          data: this.tableData,
+        };
+        const res = await asyncRequest.checkimport(model);
+        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);
+        }
+      }
     },
   },
 };

+ 87 - 20
src/views/stock/check/detail.vue

@@ -4,8 +4,7 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      {{ status }}
-      <div class="tr" style="padding: 10px 0">
+      <div class="tr" style="padding: 10px 0; height: 50px">
         <span class="fl" style="padding: 3px 0 0 3px">盘点详情</span>
         <el-button
           type="primary"
@@ -20,7 +19,7 @@
           type="primary"
           :size="'mini'"
           @click="statusConfirm('-2', '导出盘点商品')"
-          v-if="status === '1' && powers.some((item) => item == '014')"
+          v-if="status === '1' && powers.some((item) => item == '019')"
           >导出盘点商品
         </el-button>
         <el-button
@@ -48,21 +47,39 @@
         v-if="newTime !== ''"
         :sitem="sitem"
         :id="queryId"
+        @refresh="initData()"
       />
 
       <el-collapse
-        v-if="status !== '' && status !== '0'"
+        v-if="
+          status == '3' ||
+          (status == '1' && powers.some((item) => item == '017')) ||
+          (status == '2' && powers.some((item) => item == '018'))
+        "
         v-model="activeNames"
         @change="handleChange"
       >
         <el-collapse-item
-          v-if="status !== '' && status !== '0'"
+          v-if="
+            status == '3' ||
+            (status == '1' && powers.some((item) => item == '017')) ||
+            (status == '2' && powers.some((item) => item == '018'))
+          "
           title="盘点结果记录"
           name="1"
         >
-          <result-uplod :newTime="newTime" :id="queryId" />
+          <result-uplod
+            :newTime="newTime"
+            :sitem="sitem"
+            :id="queryId"
+            @refresh="initData()"
+          />
         </el-collapse-item>
-        <el-collapse-item v-if="status === '2'" title="盘点审核" name="2">
+        <el-collapse-item
+          v-if="status == '2' && powers.some((item) => item == '018')"
+          title="盘点审核"
+          name="2"
+        >
           <exam-form
             :statusList="statusList"
             :newTime="newTime"
@@ -111,7 +128,7 @@ export default {
   },
   data() {
     return {
-      activeNames: [],
+      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
       sitem: null,
       status: "",
       newTime: "",
@@ -132,9 +149,8 @@ export default {
       const res = await asyncRequest.detail({ id: this.queryId });
       if (res && res.code === 0 && res.data) {
         this.sitem = res.data;
-        this.status = "2";
-        this.activeNames = [this.status];
-        //this.sitem.status;
+        this.status = this.sitem.status;
+        // this.activeNames = [this.status];
         this.getNewTime();
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
@@ -168,25 +184,30 @@ export default {
     async exportGood(message) {
       if (!this.loading) {
         this.loading = true;
+        let httpType = `aplication/zip`;
+        let model = {
+          id: this.queryId,
+          token: getToken(),
+        };
         axios({
           method: "post",
-          url: this.fileUrl + "admin/checkexport",
+          url: urlConfig.baseURL + "admin/checkexport",
           responseType: "blob",
-          data: { id: this.queryId, token: getToken() },
+          data: model,
           headers: {
-            Accept: `aplication/zip`,
+            Accept: httpType,
           },
         })
           .then((res) => {
             if (res && res.status == 200 && res.data) {
               let blob = new Blob([res.data], {
-                type: `aplication/zip`,
+                type: httpType,
               });
               let url = window.URL.createObjectURL(blob);
               let aLink = document.createElement("a");
               aLink.style.display = "none";
               aLink.href = url;
-              aLink.setAttribute("download", `${message}.zip`);
+              aLink.setAttribute("download", `提成数据报表.zip`);
               document.body.appendChild(aLink);
               aLink.click();
               document.body.removeChild(aLink); //下载完成移除元素
@@ -197,16 +218,62 @@ export default {
                 this.loading = false;
               }, 500);
             } else {
-              this.$message.error(res.data.message);
+              // this.$message.error(res.data.message);
               setTimeout(() => {
                 this.loading = false;
               }, 500);
             }
           })
           .catch((error) => {
+            console.log(error);
             this.loading = false;
           });
       }
+      // if (!this.loading) {
+      //   this.loading = true;
+      //   let httpType = `aplication/zip`;
+      //   let model = {
+      //     id: this.queryId,
+      //     token: getToken(),
+      //   };
+      //   axios({
+      //     method: "post",
+      //     url: this.fileUrl + "admin/checkexport",
+      //     responseType: "blob",
+      //     data: model,
+      //     headers: {
+      //       Accept: httpType,
+      //     },
+      //   })
+      //     .then((res) => {
+      //       if (res && res.status == 200 && res.data) {
+      //         let blob = new Blob([res.data], {
+      //           type: httpType,
+      //         });
+      //         let url = window.URL.createObjectURL(blob);
+      //         let aLink = document.createElement("a");
+      //         aLink.style.display = "none";
+      //         aLink.href = url;
+      //         aLink.setAttribute("download", `${message}.zip`);
+      //         document.body.appendChild(aLink);
+      //         aLink.click();
+      //         document.body.removeChild(aLink); //下载完成移除元素
+      //         window.URL.revokeObjectURL(url); //释放掉blob对象
+      //         this.$message.success(message + `信息导出成功!`);
+      //         setTimeout(() => {
+      //           this.loading = false;
+      //         }, 500);
+      //       } else {
+      //         this.$message.error(`信息导出失败!`);
+      //         setTimeout(() => {
+      //           this.loading = false;
+      //         }, 500);
+      //       }
+      //     })
+      //     .catch((error) => {
+      //       this.loading = false;
+      //     });
+      // }
     },
     async deleteById(message) {
       const res = await asyncRequest.delete({ id: this.queryId });
@@ -245,9 +312,9 @@ export default {
       }
     },
     async examForm(e) {
-      if (!loading) {
-        let type = e.state === "1" ? "2" : "0";
-        await this.setStatus(type, message, e.remark);
+      if (!this.loading) {
+        let type = e.state === "1" ? "3" : "1";
+        await this.setStatus(type, "盘点审核", e.remark);
       }
     },
   },