simple 3 年之前
父节点
当前提交
da03fa7afe

+ 1 - 1
config/download.js

@@ -9,7 +9,7 @@ export default (url = '', baseUrl = '', data = {}, dataType = 'JSON', type = 'GE
     baseUrl = baseUrl;
   } else if (process.env.NODE_ENV === 'production') {
     if (baseUrl) {
-      let buildUrl = "https://pms.hajwy.com/"
+      let buildUrl = "https://test.hajwy.com/"
       // let buildUrl = "https://test.hajwy.com/"
       switch (baseUrl) {
         case '/landcrm':

+ 1 - 1
config/fetch.js

@@ -28,7 +28,7 @@ export default async (url = '', baseUrl = '', data = {}, dataType = 'JSON', type
     baseUrl = baseUrl;
   } else if (process.env.NODE_ENV === 'production') {
     if (baseUrl) {
-      let buildUrl = "https://pms.hajwy.com/"
+      let buildUrl = "https://test.hajwy.com/"
       // let buildUrl = "https://test.hajwy.com/"
       switch (baseUrl) {
         case '/landcrm':

+ 66 - 16
src/page/baseInfo/supply.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!addShow && !editShow">
+    <Card
+      style="width: 100%"
+      :bordered="false"
+      :dis-hover="true"
+      v-show="!addShow && !editShow"
+    >
       <p slot="title">供应商列表</p>
       <div slot="extra">
         <Button @click="gystb" v-if="buttonShow.sync">供应商同步</Button>
@@ -21,7 +26,8 @@
               v-for="item in ssqyList"
               :value="item.areaId"
               :key="item.areaId"
-            >{{ item.areaName }}</Option>
+              >{{ item.areaName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
@@ -30,7 +36,8 @@
               v-for="item in gysflList"
               :value="item.detailId"
               :key="item.detailId"
-            >{{ item.detailName }}</Option>
+              >{{ item.detailName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
@@ -39,7 +46,8 @@
               v-for="item in gyspjList"
               :value="item.detailId"
               :key="item.detailId"
-            >{{ item.detailName }}</Option>
+              >{{ item.detailName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
@@ -49,26 +57,48 @@
           <Input v-model="searchForm.gysmc" placeholder="供应商名称" />
         </Col>
         <Col span="4">
-          <Input v-model="searchForm.lxr" placeholder="供应商联系人或联系电话" />
+          <Input
+            v-model="searchForm.lxr"
+            placeholder="供应商联系人或联系电话"
+          />
         </Col>
       </Row>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
-          <Select clearable filterable v-model="searchForm.fgcgy" placeholder="分管采购员">
+          <Select
+            clearable
+            filterable
+            v-model="searchForm.fgcgy"
+            placeholder="分管采购员"
+          >
             <Option
               v-for="item in fgcgyList"
               :value="item.userId"
               :key="item.userId"
-            >{{ item.userName }}</Option>
+              >{{ item.userName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
           <Select clearable v-model="searchForm.qyzt" placeholder="启用状态">
-            <Option v-for="item in qyztList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <Option
+              v-for="item in qyztList"
+              :value="item.value"
+              :key="item.value"
+              >{{ item.label }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
-          <Button type="primary" style="width: 80px" @click="pageNum = 1 ;searchTableData()">查询</Button>
+          <Button
+            type="primary"
+            style="width: 80px"
+            @click="
+              pageNum = 1;
+              searchTableData();
+            "
+            >查询</Button
+          >
         </Col>
       </Row>
       <Table
@@ -82,7 +112,7 @@
         border
       >
         <template slot-scope="{ row, index }" slot="gpEnabledState">
-          <span>{{ row.gpEnabledState == "1" ? "未启用" : "启用"}}</span>
+          <span>{{ row.gpEnabledState == "1" ? "未启用" : "启用" }}</span>
         </template>
         <template slot-scope="{ row, index }" slot="action">
           <div>
@@ -90,16 +120,24 @@
               href="javascript:;"
               v-if="buttonShow.edit"
               @click="editRow(row.gpId, row.gpInfoType)"
-            >编辑</a>
+              >编辑</a
+            >
             <a
               v-if="buttonShow.delete && row.gpInfoType == 1"
               href="javascript:;"
               @click="deleteRow(row.gpId)"
-            >删除</a>
+              >删除</a
+            >
           </div>
         </template>
       </Table>
-      <Page align="right" :current="pageNum" @on-change="pageChange" :total="pageTotal" show-total />
+      <Page
+        align="right"
+        :current="pageNum"
+        @on-change="pageChange"
+        :total="pageTotal"
+        show-total
+      />
     </Card>
     <supplyAdd
       ref="add"
@@ -107,7 +145,12 @@
       :gysflList="gysflList"
       :gyspjList="gyspjList"
       :fgcgyList="fgcgyList"
-      @return="() => {addShow = false ; this.getTableData()}"
+      @return="
+        () => {
+          addShow = false;
+          this.getTableData();
+        }
+      "
       v-show="addShow"
     />
     <supplyEdit
@@ -119,7 +162,12 @@
       :fgcgyList="fgcgyList"
       :gp-id="editId"
       :canBeEdit="canBeEdit"
-      @return="() => {editShow = false ; this.getTableData()}"
+      @return="
+        () => {
+          editShow = false;
+          this.getTableData();
+        }
+      "
       v-show="editShow"
     />
   </div>
@@ -304,7 +352,9 @@ export default {
     getUserAuth() {
       //获取用户在当前页面的权限
       var self = this;
-      let menuId = sessionStorage.getItem("refresh_child_id");
+      let menuId = this.$route.query.menuId
+        ? this.$route.query.menuId
+        : sessionStorage.getItem("refresh_child_id");
       let userForm = {
         userId: localStorage.user_id,
         menuId: menuId ? menuId : this.menuId,

+ 1 - 1
src/page/purchase/components/pool/poolAdd.vue

@@ -961,6 +961,7 @@ export default {
               inventory: Number(
                 data.detailList[item].detailList[0].inventory
               ).toFixed(3),
+              storehouseId: data.detailList[item].detailList[0].storehouseId,
               storehouseName:
                 data.detailList[item].detailList[0].storehouseName,
               price: data.detailList[item].price,
@@ -995,7 +996,6 @@ export default {
     //新增明细
     mxAddShow() {
       this.contentShow = false;
-      debugger;
       if (this.tableData.length > 0) {
         this.$refs.mxAdd.searchForm.ck = String(this.tableData[0].storehouseId);
         this.$refs.mxAdd.ckLock = true;

+ 14 - 13
src/page/purchase/components/pool/poolMxAdd.vue

@@ -146,35 +146,35 @@ export default {
       tableColumn: [
         {
           type: "selection",
-          width: 60,
+          minWidth: 60,
           align: "center",
           resizable: true,
         },
         {
           title: "申购计划",
           key: "code",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "物料编码",
           key: "materialCode",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "物料分类",
           key: "firstClassName",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "物料名称",
           key: "materialName",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
@@ -186,21 +186,21 @@ export default {
         {
           title: "规格型号",
           key: "specs",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "单位",
           key: "unit",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "库存量",
           key: "inventory",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
@@ -208,27 +208,27 @@ export default {
           title: "参考单价(元)",
           key: "referencePrice",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         {
           title: "计划数量",
           key: "amount",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "已下订数量",
           key: "billedAmount",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         },
         {
           title: "可下订数量",
           key: "noBilledAmout",
-          width: 120,
+          minWidth: 120,
           tooltip: true,
           resizable: true,
         }
@@ -273,6 +273,7 @@ export default {
         areaIds: this.areaId.split(",")[0],
         queryText1: this.searchForm.wlmc,
         queryText2: "",
+        purchaserId: this.searchForm.purchaserId,
         projectIds: this.projectId.split(",")[0],
         // projectIds: 10,
         storehouseId: this.searchForm.ck
@@ -364,7 +365,7 @@ export default {
               price: Number(resArr[item].price),
               purchaseNum: Number(this.tableSelect[item].noBilledAmount),
               plannedArrivalTime: dateArr,
-              isNumControl: 1,
+              isNumControl: 0,
               isTimeControl: 1,
               checkNum: null,
               applySurplusNum: this.tableSelect[item].noBilledAmount,

+ 102 - 22
src/page/purchase/purchaseBalance.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!addShow && !printShow">
+    <Card
+      style="width: 100%"
+      :bordered="false"
+      :dis-hover="true"
+      v-show="!addShow && !printShow"
+    >
       <p slot="title">采购结算列表</p>
       <div slot="extra">
         <Button @click="addxShow" v-if="buttonShow.add">新增采购结算</Button>
@@ -9,26 +14,48 @@
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
-          <Select clearable v-model="searchForm.ssqy" placeholder="所属区域" @on-change="ssqyChange">
+          <Select
+            clearable
+            v-model="searchForm.ssqy"
+            placeholder="所属区域"
+            @on-change="ssqyChange"
+          >
             <Option
               v-for="item in ssqyList"
               :value="item.areaId"
               :key="item.areaId"
-            >{{ item.areaName }}</Option>
+              >{{ item.areaName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
-          <Select clearable v-model="searchForm.glxm" placeholder="关联项目" @on-change="glxmChange">
+          <Select
+            clearable
+            v-model="searchForm.glxm"
+            placeholder="关联项目"
+            @on-change="glxmChange"
+          >
             <Option
               v-for="item in glxmList"
               :value="item.projectId"
               :key="item.projectId"
-            >{{ item.projectName }}</Option>
+              >{{ item.projectName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
-          <Select clearable filterable v-model="searchForm.gys" placeholder="供应商">
-            <Option v-for="item in gysList" :value="item.gpId" :key="item.gpId">{{ item.gpName }}</Option>
+          <Select
+            clearable
+            filterable
+            v-model="searchForm.gys"
+            placeholder="供应商"
+          >
+            <Option
+              v-for="item in gysList"
+              :value="item.gpId"
+              :key="item.gpId"
+              >{{ item.gpName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
@@ -46,14 +73,24 @@
         </Col>
         <Col span="4">
           <Select clearable v-model="searchForm.djlx" placeholder="单据类型">
-            <Option v-for="item in djlxList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <Option
+              v-for="item in djlxList"
+              :value="item.value"
+              :key="item.value"
+              >{{ item.label }}</Option
+            >
           </Select>
         </Col>
       </Row>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
           <Select clearable v-model="searchForm.spzt" placeholder="审批状态">
-            <Option v-for="item in spztList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <Option
+              v-for="item in spztList"
+              :value="item.value"
+              :key="item.value"
+              >{{ item.label }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
@@ -63,7 +100,15 @@
           <Input v-model="searchForm.jsbh" placeholder="结算申请编号或标题" />
         </Col>
         <Col span="4">
-          <Button type="primary" style="width: 80px" @click="pageNum = 1;getTableData()">查询</Button>
+          <Button
+            type="primary"
+            style="width: 80px"
+            @click="
+              pageNum = 1;
+              getTableData();
+            "
+            >查询</Button
+          >
         </Col>
       </Row>
       <Table
@@ -86,37 +131,69 @@
         </template>
         <template slot-scope="{ row, index }" slot="action">
           <div>
-            <a href="javascript:;" v-if="buttonShow.check" @click="checkRow(row)">{{'查看'}}</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.check"
+              @click="checkRow(row)"
+              >{{ "查看" }}</a
+            >
             <a
               href="javascript:;"
               @click="editRow(row)"
               v-if="buttonShow.edit && row.creator == userId"
-            >{{'编辑'}}</a>
+              >{{ "编辑" }}</a
+            >
             <a
               href="javascript:;"
-              v-if="buttonShow.delete && row.approvalState == '1' && row.creator == userId"
+              v-if="
+                buttonShow.delete &&
+                row.approvalState == '1' &&
+                row.creator == userId
+              "
               @click="deleteRow(row)"
-            >删除</a>
+              >删除</a
+            >
             <a
               href="javascript:;"
-              v-if="buttonShow.submit &&row.approvalState == '1' && row.creator == userId"
+              v-if="
+                buttonShow.submit &&
+                row.approvalState == '1' &&
+                row.creator == userId
+              "
               @click="submitRow(row)"
-            >提交</a>
+              >提交</a
+            >
           </div>
         </template>
       </Table>
-      <Page align="right" :current="pageNum" :total="pageTotal" @on-change="pageChange" show-total />
+      <Page
+        align="right"
+        :current="pageNum"
+        :total="pageTotal"
+        @on-change="pageChange"
+        show-total
+      />
     </Card>
     <balanceAdd
       ref="add"
       :glqyList="ssqyList"
       :djlxList="djlxList"
-      @return="() => {addShow = false ; getTableData()}"
+      @return="
+        () => {
+          addShow = false;
+          getTableData();
+        }
+      "
       v-show="addShow"
     />
     <balancePrint
       ref="print"
-      @return="() => {printShow = false ; getTableData()} "
+      @return="
+        () => {
+          printShow = false;
+          getTableData();
+        }
+      "
       v-show="printShow"
     />
   </div>
@@ -311,9 +388,8 @@ export default {
     };
   },
   created() {
-    this.searchForm.sgr = localStorage.user_name
+    this.searchForm.sgr = localStorage.user_name;
     this.getTableData();
-    this.getUserAuth();
     selectGoodProviderSelectionList().then((res) => {
       this.gysList = res.data;
     });
@@ -336,7 +412,10 @@ export default {
     getUserAuth() {
       //获取用户在当前页面的权限
       var self = this;
-      let menuId = sessionStorage.getItem("refresh_child_id");
+      console.log(this.$route)
+      let menuId = this.$route.query.menuId
+        ? this.$route.query.menuId
+        : sessionStorage.getItem("refresh_child_id");
       let userForm = {
         userId: localStorage.user_id,
         menuId: menuId,
@@ -518,6 +597,7 @@ export default {
     },
   },
   mounted: function () {
+    this.getUserAuth();
     //  监听浏览器页面尺寸
     window.addEventListener("resize", this.resizePage);
     this.resizePage();

+ 5 - 2
src/page/purchase/purchaseOrder.vue

@@ -409,7 +409,6 @@ export default {
   created() {
     this.searchForm.cgr = localStorage.user_name;
     this.getTableData();
-    this.getUserAuth();
     getAreaList(localStorage.user_id).then((res) => {
       this.ssqyList = res.items;
     });
@@ -436,7 +435,10 @@ export default {
     getUserAuth() {
       //获取用户在当前页面的权限
       var self = this;
-      let menuId = sessionStorage.getItem("refresh_child_id");
+      console.log(this.$route)
+      let menuId = this.$route.query.menuId
+        ? this.$route.query.menuId
+        : sessionStorage.getItem("refresh_child_id");
       let userForm = {
         userId: localStorage.user_id,
         menuId: menuId,
@@ -672,6 +674,7 @@ export default {
     tableOnSelect(selection, row) {},
   },
   mounted: function () {
+    this.getUserAuth();
     //  监听浏览器页面尺寸
     window.addEventListener("resize", this.resizePage);
     this.resizePage();

+ 125 - 34
src/page/purchase/purchasePlan.vue

@@ -1,75 +1,121 @@
 <template>
   <div>
-    <Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!printShow && !addShow">
+    <Card
+      style="width: 100%"
+      :bordered="false"
+      :dis-hover="true"
+      v-show="!printShow && !addShow"
+    >
       <p slot="title">申购计划列表</p>
       <div slot="extra">
-        <Button @click="addShow = true" v-if="buttonShow.add">新增申购计划</Button>
+        <Button @click="addShow = true" v-if="buttonShow.add"
+          >新增申购计划</Button
+        >
         <Button @click="exportData" v-if="buttonShow.export">导出明细</Button>
         <!-- <Button @click="printShow = true">打印---测试</Button> -->
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
-          <Select clearable v-model="searchForm.ssqy" placeholder="所属区域" @on-change="ssqyChange">
+          <Select
+            clearable
+            v-model="searchForm.ssqy"
+            placeholder="所属区域"
+            @on-change="ssqyChange"
+          >
             <Option
               v-for="item in ssqyList"
               :value="item.areaId"
               :key="item.areaId"
-            >{{ item.areaName }}</Option>
+              >{{ item.areaName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
-          <Select clearable v-model="searchForm.glxm" placeholder="关联项目" @on-change="glxmChange">
+          <Select
+            clearable
+            v-model="searchForm.glxm"
+            placeholder="关联项目"
+            @on-change="glxmChange"
+          >
             <Option
               v-for="item in glxmList"
               :value="item.projectId"
               :key="item.projectId"
-            >{{ item.projectName }}</Option>
+              >{{ item.projectName }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
           <Select clearable v-model="searchForm.jhlx" placeholder="计划类型">
-            <Option v-for="item in jhlxList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <Option
+              v-for="item in jhlxList"
+              :value="item.value"
+              :key="item.value"
+              >{{ item.label }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
           <DatePicker
             format="yyyy年MM月"
             :value="searchForm.jhyf"
-            @on-change="searchForm.jhyf=$event"
+            @on-change="searchForm.jhyf = $event"
             type="month"
             placeholder="计划月份"
           ></DatePicker>
         </Col>
         <Col span="4">
           <DatePicker
-            :value="searchForm.zdrq"
-            @on-change="searchForm.zdrq=$event"
+            v-model="searchForm.zdrq"
             format="yyyy/MM/dd HH:mm"
             type="datetimerange"
             placeholder="制单日期"
           ></DatePicker>
         </Col>
+        <!-- @on-change="searchForm.zdrq=$event" -->
         <Col span="4">
-          <Select clearable filterable v-model="searchForm.fgcgy" placeholder="分管采购员">
+          <Select
+            clearable
+            filterable
+            v-model="searchForm.fgcgy"
+            placeholder="分管采购员"
+          >
             <Option
               v-for="item in fgcgyList"
               :value="item.userId"
               :key="item.userId"
-            >{{ item.userName }}</Option>
+              >{{ item.userName }}</Option
+            >
           </Select>
         </Col>
       </Row>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
           <Select clearable v-model="searchForm.spzt" placeholder="审批状态">
-            <Option v-for="item in spztList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <Option
+              v-for="item in spztList"
+              :value="item.value"
+              :key="item.value"
+              >{{ item.label }}</Option
+            >
           </Select>
         </Col>
         <Col span="4">
-          <Input v-model="searchForm.title" placeholder="申请人/物料名称/计划单据号/标题" />
+          <Input
+            v-model="searchForm.title"
+            placeholder="申请人/物料名称/计划单据号/标题"
+          />
         </Col>
         <Col span="4">
-          <Button type="primary" style="width: 80px" @click="pageNum = 1; getTableData()">查询</Button>
+          <Button
+            type="primary"
+            style="width: 80px"
+            @click="
+              pageNum = 1;
+              getTableData();
+            "
+            >查询</Button
+          >
         </Col>
       </Row>
       <!-- <Row style="margin-bottom: 10px; text-align: right">
@@ -113,46 +159,89 @@
         </template>
         <template slot-scope="{ row, index }" slot="action">
           <div>
-            <a href="javascript:;" v-if="buttonShow.check" @click="checkRow(row)">查看</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.check"
+              @click="checkRow(row)"
+              >查看</a
+            >
             <a
               href="javascript:;"
               v-if="buttonShow.edit && row.creator == userId"
               @click="editRow(row)"
-            >{{'编辑'}}</a>
+              >{{ "编辑" }}</a
+            >
             <!-- <a href="javascript:;">复制</a> -->
             <a
               href="javascript:;"
-              v-if="buttonShow.delete && row.applyStatus == '0' && row.creator == userId"
+              v-if="
+                buttonShow.delete &&
+                row.applyStatus == '0' &&
+                row.creator == userId
+              "
               @click="deleteRow(row)"
-            >删除</a>
+              >删除</a
+            >
             <a
               href="javascript:;"
-              v-if="buttonShow.copy && (row.applyStatus == '2' || row.applyStatus == '3')"
+              v-if="
+                buttonShow.copy &&
+                (row.applyStatus == '2' || row.applyStatus == '3')
+              "
               @click="copyRow(row)"
-            >复制</a>
+              >复制</a
+            >
             <a
               href="javascript:;"
-              v-if="buttonShow.print && row.applyStatus != '3' && row.status != '5'"
+              v-if="
+                buttonShow.print && row.applyStatus != '3' && row.status != '5'
+              "
               @click="printRow(row)"
-            >打印</a>
+              >打印</a
+            >
             <a
               href="javascript:;"
-              v-if="buttonShow.submit && row.applyStatus == '0' && row.creator == userId"
+              v-if="
+                buttonShow.submit &&
+                row.applyStatus == '0' &&
+                row.creator == userId
+              "
               @click="submitRow(row)"
-            >提交</a>
+              >提交</a
+            >
           </div>
         </template>
       </Table>
-      <Page align="right" :current="pageNum" :total="pageTotal" @on-change="pageChange" show-total />
+      <Page
+        align="right"
+        :current="pageNum"
+        :total="pageTotal"
+        @on-change="pageChange"
+        show-total
+      />
     </Card>
     <planAdd
       ref="add"
-      @return="() => {addShow = false; getTableData()}"
+      @return="
+        () => {
+          addShow = false;
+          getTableData();
+        }
+      "
       :ssqyList="ssqyList"
       :cgyList="fgcgyList"
       v-show="addShow"
     />
-    <planPrint ref="print" @return="() => {printShow = false ; getTableData()}" v-show="printShow" />
+    <planPrint
+      ref="print"
+      @return="
+        () => {
+          printShow = false;
+          getTableData();
+        }
+      "
+      v-show="printShow"
+    />
   </div>
 </template>
 
@@ -348,9 +437,8 @@ export default {
     };
   },
   created() {
-    this.searchForm.title = localStorage.user_name
+    this.searchForm.title = localStorage.user_name;
     this.getTableData();
-    this.getUserAuth();
     getAreaList(localStorage.user_id).then((res) => {
       this.ssqyList = res.items;
     });
@@ -367,7 +455,10 @@ export default {
     getUserAuth() {
       //获取用户在当前页面的权限
       var self = this;
-      let menuId = sessionStorage.getItem("refresh_child_id");
+      console.log(this.$route);
+      let menuId = this.$route.query.menuId
+        ? this.$route.query.menuId
+        : sessionStorage.getItem("refresh_child_id");
       let userForm = {
         userId: localStorage.user_id,
         menuId: menuId,
@@ -457,11 +548,10 @@ export default {
       if (!this.searchForm.glxm) {
         postData.projectIds = allProject.join(",");
       }
-      if (this.searchForm.zdrq.length > 0) {
+      if (this.searchForm.zdrq.length > 0 && this.searchForm.zdrq[0]) {
         postData.createStartTime = this.searchForm.zdrq[0];
         postData.createEndTime = this.searchForm.zdrq[1];
       }
-      console.log(postData, 11111111111111111);
       exportPurchaseInfo(postData);
     },
     //打印
@@ -494,7 +584,7 @@ export default {
       if (!this.searchForm.glxm) {
         postData.projectIds = allProject.join(",");
       }
-      if (this.searchForm.zdrq.length > 0) {
+      if (this.searchForm.zdrq.length > 0 && this.searchForm.zdrq[0]) {
         postData.createStartTime = this.searchForm.zdrq[0];
         postData.createEndTime = this.searchForm.zdrq[1];
       }
@@ -636,6 +726,7 @@ export default {
     tableOnSelect(selection, row) {},
   },
   mounted: function () {
+    this.getUserAuth();
     //  监听浏览器页面尺寸
     window.addEventListener("resize", this.resizePage);
     this.resizePage();

+ 4 - 1
src/page/purchase/purchasePool.vue

@@ -475,7 +475,10 @@ export default {
     getUserAuth() {
       //获取用户在当前页面的权限
       var self = this;
-      let menuId = sessionStorage.getItem("refresh_child_id");
+      console.log(this.$route)
+      let menuId = this.$route.query.menuId
+        ? this.$route.query.menuId
+        : sessionStorage.getItem("refresh_child_id");
       let userForm = {
         userId: localStorage.user_id,
         menuId: menuId,

+ 254 - 177
src/page/slide/VASlideItem.vue

@@ -1,224 +1,301 @@
 <template>
-    <li class="main-menu" v-if="router || link" :id="id" @click="menuClick(name,'',1,link,target,router,id,$event)" v-bind:class="{'active':active}">
-      <router-link :target="target" :to="router" v-if="router">
-        <i :class="icon"></i> <span>{{ name }}</span>
-        <span class="pull-right-container" v-show="badge">
-        <small class="label pull-right" :class="[badge.type==='String'?'bg-green':'label-primary']">{{ badge.data }}</small>
+  <li
+    class="main-menu"
+    v-if="router || link"
+    :id="id"
+    @click="menuClick(name, '', 1, link, target, router, id, $event)"
+    v-bind:class="{ active: active }"
+  >
+    <router-link :target="target" :to="router" v-if="router">
+      <i :class="icon"></i> <span>{{ name }}</span>
+      <span class="pull-right-container" v-show="badge">
+        <small
+          class="label pull-right"
+          :class="[badge.type === 'String' ? 'bg-green' : 'label-primary']"
+          >{{ badge.data }}</small
+        >
       </span>
-      </router-link>
-      <a v-bind:href="link" v-bind:target="target" v-else-if="target=='_blank'">
-        <i :class="icon"></i>
-        <span>{{ name }}</span>
-      </a>
-      <a v-bind:target="target" v-else>
-        <i :class="icon"></i>
-        <span>{{ name }}</span>
-      </a>
-    </li>
-    <li :class="getType" :id="id" v-else>
-      {{ isHeader ? name : '' }}
-      <a v-if="!isHeader" @click="menuClick(name,'',0,link,target,router,id,$event)">
-        <i :class="icon"></i> <span style="padding-bottom: 16px;margin-left:0px">{{ name }}</span>
-        <span class="pull-right-container">
-        <small v-if="badge && badge.data" class="label pull-right" :class="[badge.type==='String'?'bg-green':'label-primary']">{{ badge.data }}</small>
+    </router-link>
+    <a v-bind:href="link" v-bind:target="target" v-else-if="target == '_blank'">
+      <i :class="icon"></i>
+      <span>{{ name }}</span>
+    </a>
+    <a v-bind:target="target" v-else>
+      <i :class="icon"></i>
+      <span>{{ name }}</span>
+    </a>
+  </li>
+  <li :class="getType" :id="id" v-else>
+    {{ isHeader ? name : "" }}
+    <a
+      v-if="!isHeader"
+      @click="menuClick(name, '', 0, link, target, router, id, $event)"
+    >
+      <i :class="icon"></i>
+      <span style="padding-bottom: 16px; margin-left: 0px">{{ name }}</span>
+      <span class="pull-right-container">
+        <small
+          v-if="badge && badge.data"
+          class="label pull-right"
+          :class="[badge.type === 'String' ? 'bg-green' : 'label-primary']"
+          >{{ badge.data }}</small
+        >
         <i v-else class="fa fa-angle-left pull-right"></i>
       </span>
-      </a>
-      <ul class="treeview-menu" style="margin-top:0;" v-if="items.length > 0">
-        <li v-bind:class="{'active':item.active}" class="sub-menu" v-for="item in items" :id="item.id" @click="menuClick(name,item.name,1,item.link,item.target,item.router,item.id,$event)">
-                <router-link :target="target" :to="item.router" :title="item.name" v-if="item.router">
-                  <i :class="item.icon"></i>
-                  <span>{{ item.name }}</span>
-                </router-link>
-                <a v-bind:href="item.link" v-bind:target="item.target" :title="item.name" v-else-if="item.target=='_blank'">
-                  <i :class="item.icon"></i>
-                  <span>{{ item.name }}</span>
-                </a>
-                <a v-bind:target="item.target" :title="item.name" v-else>
-                  <i :class="item.icon"></i>
-                  <span>{{ item.name }}</span>
-                </a>
-        </li>
-      </ul>
-    </li>
+    </a>
+    <ul class="treeview-menu" style="margin-top: 0" v-if="items.length > 0">
+      <li
+        v-bind:class="{ active: item.active }"
+        class="sub-menu"
+        v-for="item in items"
+        :id="item.id"
+        @click="
+          menuClick(
+            name,
+            item.name,
+            1,
+            item.link,
+            item.target,
+            item.router,
+            item.id,
+            $event
+          )
+        "
+      >
+        <a
+          :target="target"
+          :to="item.router"
+          :title="item.name"
+          v-if="item.router"
+        >
+          <i :class="item.icon"></i>
+          <span>{{ item.name }}</span>
+        </a>
+        <a
+          v-bind:href="item.link"
+          v-bind:target="item.target"
+          :title="item.name"
+          v-else-if="item.target == '_blank'"
+        >
+          <i :class="item.icon"></i>
+          <span>{{ item.name }}</span>
+        </a>
+        <a v-bind:target="item.target" :title="item.name" v-else>
+          <i :class="item.icon"></i>
+          <span>{{ item.name }}</span>
+        </a>
+      </li>
+    </ul>
+  </li>
 </template>
 
 <script>
-  import {mapGetters,mapActions} from 'vuex'
-  export default {
-    name: 'va-slide-item',
-    props: {
-      type: {
-        type: String,
-        default: 'item'
+import { mapGetters, mapActions } from "vuex";
+export default {
+  name: "va-slide-item",
+  props: {
+    type: {
+      type: String,
+      default: "item",
+    },
+    isHeader: {
+      type: Boolean,
+      default: false,
+    },
+    icon: {
+      type: String,
+      default: "",
+    },
+    name: {
+      type: String,
+    },
+    id: {
+      type: Number,
+    },
+    active: {
+      type: Boolean,
+      default: false,
+    },
+    badge: {
+      type: Object,
+      default() {
+        return {};
       },
-      isHeader: {
-        type: Boolean,
-        default: false
+    },
+    items: {
+      type: Array,
+      default() {
+        return [];
       },
-      icon: {
-        type: String,
-        default: ''
-      },
-      name: {
-        type: String
-      },
-      id: {
-        type: Number
-      },
-      active: {
-        type: Boolean,
-        default: false
-      },
-      badge: {
-        type: Object,
-        default () {
-    return {}
-  }
-  },
-  items: {
-    type: Array,
-  default () {
-      return []
-    }
-  },
-  router: {
-    type: String,
-  default:''
-  },
-  link: {
-    type: String,
-  default: ''
-  },
-  target: {
-    type: String,
-  default: ''
-  }
+    },
+    router: {
+      type: String,
+      default: "",
+    },
+    link: {
+      type: String,
+      default: "",
+    },
+    target: {
+      type: String,
+      default: "",
+    },
   },
-  created () {
-  },
-  methods:{
-  ...mapActions([
-      'storeMenuInfo'
-    ]),
-      menuClick:function(menuName,subMenuName,type,linkUrl,target,router,id,e){
-        if(type==0){
-          sessionStorage.setItem('refresh_sub_id',id);
-        }else{
-          sessionStorage.setItem('refresh_child_id',id);
-        }
-//    if(target && target=='_blank')
-//    {
-//      console.log("新起页面访问:"+linkUrl);
-//      return;
-//    }
+  created() {},
+  methods: {
+    ...mapActions(["storeMenuInfo"]),
+    menuClick: function (
+      menuName,
+      subMenuName,
+      type,
+      linkUrl,
+      target,
+      router,
+      id,
+      e
+    ) {
+      if (type == 0) {
+        sessionStorage.setItem("refresh_sub_id", id);
+      } else {
+        sessionStorage.setItem("refresh_child_id", id);
+      }
+      //    if(target && target=='_blank')
+      //    {
+      //      console.log("新起页面访问:"+linkUrl);
+      //      return;
+      //    }
       var menuBtn = $(e.target).closest("li");
 
-      if($(menuBtn).hasClass("treeview"))
-      {
-      	$("ul.treeview-menu").slideUp();
+      if ($(menuBtn).hasClass("treeview")) {
+        $("ul.treeview-menu").slideUp();
         var flag = $(menuBtn).hasClass("menu-open");
         $("li.main-menu").removeClass("active");
         $(".treeview").removeClass("active menu-open");
-        $("#treeview-menu").css({display:"none"});
-        if(!flag) {
-//        $("li.sub-menu").removeClass("active");
+        $("#treeview-menu").css({ display: "none" });
+        if (!flag) {
+          //        $("li.sub-menu").removeClass("active");
           $(menuBtn).addClass("menu-open");
-//        $(e.target).find(".treeview-menu").css({display:"block"});
+          //        $(e.target).find(".treeview-menu").css({display:"block"});
           $(menuBtn).find(".treeview-menu").slideDown();
+        } else {
+          $(menuBtn).find(".treeview-menu").slideUp();
         }
-        else{
-        	 $(menuBtn).find(".treeview-menu").slideUp();
-        }
-      }
-      else if((router || (linkUrl && target=="_self")) && $(menuBtn).hasClass("main-menu"))
-      {
-
+      } else if (
+        (router || (linkUrl && target == "_self")) &&
+        $(menuBtn).hasClass("main-menu")
+      ) {
         $(".treeview").removeClass("menu-open");
-        $("#treeview-menu").css({display:"none"});
+        $("#treeview-menu").css({ display: "none" });
         $("li.main-menu").removeClass("active");
         $(menuBtn).addClass("active");
-      }
-      else if((router || (linkUrl && target=="_self")) && $(menuBtn).hasClass("sub-menu"))
-      {
+      } else if (
+        (router || (linkUrl && target == "_self")) &&
+        $(menuBtn).hasClass("sub-menu")
+      ) {
         $("li.sub-menu").removeClass("active");
         $(menuBtn).addClass("active");
       }
-      if(type==1)
-      {
+      if (type == 1) {
         var menuInfo = {};
         menuInfo.menuName = menuName;
-        if(subMenuName)
-        {
+        if (subMenuName) {
           menuInfo.subMenuName = subMenuName;
         }
-        if(linkUrl || router)
-        {
-          if(linkUrl)
-          {
+        if (linkUrl || router) {
+          if (linkUrl) {
             menuInfo.linkUrl = linkUrl;
           }
-          if(router)
-          {
+          if (router) {
             menuInfo.router = router;
           }
           this.storeMenuInfo(menuInfo);
         }
-        if(router)
-        {
-          	this.$router.push(router);
+        if (router) {
+          this.$router.push({ path: router, query: { menuId: id } });
         }
       }
-    }
-
+    },
   },
   computed: {
-    getType () {
-      let className="";
+    getType() {
+      let className = "";
       if (this.isHeader) {
-        return 'header'
+        return "header";
       }
-      if(this.type !== 'item'){
-        if(this.active)
-        {
-          className+="active menuOpen";
+      if (this.type !== "item") {
+        if (this.active) {
+          className += "active menuOpen";
         }
-        className+=" treeview";
+        className += " treeview";
       }
       return className;
-    }
-  }
-  }
+    },
+  },
+};
 </script>
 <style scoped>
-  a:active,
-  a:visited,
-  a:focus,
-  a:hover {
-    outline: 0;
-    text-decoration: none !important;
-  }
- .skin-blue .sidebar-menu>li>.treeview-menu .sub-menu a{
-    text-overflow: ellipsis;
-    overflow: hidden;
-    white-space: nowrap;
-  }
-  .skin-blue .sidebar a,.skin-blue .sidebar a span{color:hsla(0,0%,100%,.7); font-size: 14px; font-weight: normal;}
-  .skin-blue .sidebar-menu .treeview-menu>li>a{color:#fff;}
-  .skin-blue .sidebar-menu>li:hover>a, .skin-blue .sidebar-menu>li.active>a, .skin-blue .sidebar-menu>li.menu-open>a{
-	background: #484f61; color: #fff;border-left:none;
+a:active,
+a:visited,
+a:focus,
+a:hover {
+  outline: 0;
+  text-decoration: none !important;
+}
+.skin-blue .sidebar-menu > li > .treeview-menu .sub-menu a {
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+}
+.skin-blue .sidebar a,
+.skin-blue .sidebar a span {
+  color: hsla(0, 0%, 100%, 0.7);
+  font-size: 14px;
+  font-weight: normal;
+}
+.skin-blue .sidebar-menu .treeview-menu > li > a {
+  color: #fff;
+}
+.skin-blue .sidebar-menu > li:hover > a,
+.skin-blue .sidebar-menu > li.active > a,
+.skin-blue .sidebar-menu > li.menu-open > a {
+  background: #484f61;
+  color: #fff;
+  border-left: none;
+}
+.sidebar-menu li > a > .pull-right-container > .fa-angle-left {
+  margin-right: 3px;
+}
+.skin-blue .sidebar-menu > li > a:hover {
+  background: #484f61;
+}
+.skin-blue .sidebar-menu > li.active > a {
+  border-left-color: none;
+}
+.skin-blue .sidebar-menu > li > .treeview-menu {
+  padding: 0 0;
+  background: #353d50;
+}
+.skin-blue .sidebar-menu > li > .treeview-menu .sub-menu a {
+  padding: 0 0 0 8px;
+}
+.skin-blue .sidebar-menu > li > .treeview-menu .sub-menu {
+  margin: 0;
+  padding: 14px 24px;
+}
+.skin-blue .sidebar-menu .treeview-menu > li.active {
+  background: #2d8cf0;
+  color: #fff;
+}
+.skin-blue .sidebar-menu .treeview-menu > li:hover {
+  background: #50aaec;
+  color: #fff;
+}
+.skin-blue .sidebar-menu .treeview-menu > li.active a,
+.skin-blue .sidebar-menu .treeview-menu > li:hover a {
+  color: #fff;
+}
+.skin-blue .sidebar-menu .treeview-menu > li.active a span,
+.skin-blue .sidebar-menu .treeview-menu > li:hover a span {
+  color: #fff;
 }
-  .sidebar-menu li>a>.pull-right-container>.fa-angle-left{
-    margin-right: 3px;
-  }
-.skin-blue .sidebar-menu>li>a:hover{background: #484f61;}
-.skin-blue .sidebar-menu>li.active>a{border-left-color:none;}
-.skin-blue .sidebar-menu>li>.treeview-menu{padding:0 0; background: #353d50;}
-.skin-blue .sidebar-menu>li>.treeview-menu .sub-menu a{padding:0 0 0 8px;}
-.skin-blue .sidebar-menu>li>.treeview-menu .sub-menu{margin:0;padding:14px 24px;}
-.skin-blue .sidebar-menu .treeview-menu>li.active{ background: #2d8cf0;color:#fff;}
-.skin-blue .sidebar-menu .treeview-menu>li:hover{ background:#50aaec;color:#fff;}
-.skin-blue .sidebar-menu .treeview-menu>li.active a,.skin-blue .sidebar-menu .treeview-menu>li:hover a{color:#fff;}
-.skin-blue .sidebar-menu .treeview-menu>li.active a span,.skin-blue .sidebar-menu .treeview-menu>li:hover a span{color:#fff;}
-
 </style>