simple 4 gadi atpakaļ
vecāks
revīzija
0108a0be09

+ 2 - 2
config/download.js

@@ -54,10 +54,10 @@ export default (url = '', baseUrl = '', data = {}, dataType = 'JSON', type = 'GE
           baseUrl = prodServer("apartment");
           break;
         case '/purchase': //
-          baseUrl = "https://test.hajwy.com/purchase";
+          baseUrl = "https://pms.hajwy.com/purchase";
           break;
         case '/hajwy': //
-          baseUrl = "https://test.hajwy.com/qpi/rest";
+          baseUrl = "https://pms.hajwy.com/qpi/rest";
           break;
         case '/mkf': //
           baseUrl = "https://pms.hajwy.com/landcrm";

+ 3 - 3
config/fetch.js

@@ -29,13 +29,13 @@ export default async (url = '', baseUrl = '', data = {}, dataType = 'JSON', type
     if (baseUrl) {
       switch (baseUrl) {
         case '/landcrm':
-          baseUrl = 'https://test.hajwy.com/landcrm';
+          baseUrl = 'https://pms.hajwy.com/landcrm';
           break;
         case '/purchase': //
-          baseUrl = "https://test.hajwy.com/purchase";
+          baseUrl = "https://pms.hajwy.com/purchase";
           break;
         case '/hajwy': //
-          baseUrl = "https://test.hajwy.com/qpi/rest";
+          baseUrl = "https://pms.hajwy.com/qpi/rest";
           break;
         case '/mkf': //
           baseUrl = "https://pms.hajwy.com/landcrm";

+ 1 - 1
config/index.js

@@ -67,7 +67,7 @@ module.exports = {
       "/purchase": { //采采购管理整体测试
         // target: "http://www.jihengcc.cn:17080/purchase", //采购供应商管理测试
         target: "https://test.hajwy.com/purchase", //采购供应商管理测试
-        // target: "http://172.18.1.79:8989/purchase",
+        // target: "http://172.18.1.40:8989/purchase",
         secure: false,
         changeOrigin: true,
         pathRewrite: {

+ 36 - 38
src/page/purchase/components/balance/balanceAdd.vue

@@ -115,7 +115,7 @@
             <span style="color: gray" v-if="form.khh == ''">系统自动生成,不可编辑</span>
             <span v-else>{{ form.khh }}</span>
           </Col>
-          <Col span="4" class-name="tables">
+          <!-- <Col span="4" class-name="tables">
             单据类型
             <span class="mustSpan">*</span>
           </Col>
@@ -127,7 +127,7 @@
                 :key="item.value"
               >{{ item.label }}</Option>
             </Select>
-          </Col>
+          </Col>-->
           <Col span="4" class-name="tables">下单时间</Col>
           <Col span="4" class-name="tables">
             <span style="color: gray" v-if="form.xdsj == ''">系统自动生成,不可编辑</span>
@@ -144,10 +144,7 @@
           </Col>
           <Col span="4" class-name="tables">入库时间(首次)</Col>
           <Col span="4" class-name="tables">{{ form.rksj }}</Col>
-          <Col span="4" class-name="tables">
-            总价(元)
-            <span class="mustSpan">*</span>
-          </Col>
+          <Col span="4" class-name="tables">总价(元)</Col>
           <Col span="4" class-name="tables">{{ form.total }}</Col>
           <Col span="4" class-name="tables">调整金额(元)</Col>
           <Col span="4" class-name="tables">
@@ -159,18 +156,12 @@
               style="width: 95%"
             />
           </Col>
-          <Col span="4" class-name="tables">
-            实际支付金额(元)
-            <span class="mustSpan">*</span>
-          </Col>
+          <Col span="4" class-name="tables">实际支付金额(元)</Col>
           <Col
             span="4"
             class-name="tables"
           >{{ (Number(form.total) + Number(form.tzje)).toFixed(2) }}</Col>
-          <Col span="4" class-name="tables">
-            申请人
-            <span class="mustSpan">*</span>
-          </Col>
+          <Col span="4" class-name="tables">申请人</Col>
           <Col span="4" class-name="tables">{{ form.sqr }}</Col>
           <Col span="4" class-name="tables">审批状态</Col>
           <Col span="4" class-name="tables">
@@ -182,8 +173,8 @@
               <span v-if="form.spzt == '5'">已付款</span>
             </div>
           </Col>
-          <!-- <Col span="4" class-name="tables"></Col>
-          <Col span="4" class-name="tables"></Col>-->
+          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables"></Col>
         </Row>
         <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
           <Col span="4" class-name="upl">附件</Col>
@@ -277,6 +268,7 @@ import {
 } from "@/service/getData";
 import balanceMxAdd from "./balanceMxAdd";
 export default {
+  name: "balanceAdd",
   props: ["glqyList", "djlxList"],
   components: {
     balanceMxAdd
@@ -469,7 +461,7 @@ export default {
     zhChange(val) {
       if (val != "" && val) {
         this.form.khh = this.zhList.filter(a => a.gpbcId == val)[0].bank;
-        this.form.zh = this.zhList.filter(a => a.gpbcId == val)[0].bank;
+        this.form.zh = this.zhList.filter(a => a.gpbcId == val)[0].unionpay;
       }
     },
     //查询结算详情
@@ -488,7 +480,7 @@ export default {
           this.form.khh = data.depositBank;
           this.form.zh = data.accountNumber;
           this.form.gyszh = data.gpbcId;
-          this.form.djlx = data.type;
+          // this.form.djlx = data.type;
           this.form.shr = data.receivedName;
           this.form.spzt = data.approvalState;
           this.form.sqr = data.applicantName;
@@ -564,7 +556,7 @@ export default {
         depositBank: this.form.khh,
         accountNumber: this.form.zh,
         gpbcId: this.form.gyszh,
-        type: this.form.djlx,
+        // type: this.form.djlx,
         receivedName: this.form.shr,
         adjustmentPrice: this.form.tzje.toFixed(2),
         instruction: this.form.sm,
@@ -575,26 +567,32 @@ export default {
         detailList: this.tableData
       };
       // console.log(postData);
-      editPurchaseSettlement(postData).then(res => {
-        if (res.status == 200) {
-          this.$Message.success("编辑结算详情成功!");
-          this.getJs(this.settlementId);
-        } else {
-          this.$Message.error(res.message);
-        }
+      return new Promise((resolve, reject) => {
+        editPurchaseSettlement(postData).then(res => {
+          if (res.status == 200) {
+            this.$Message.success("编辑结算详情成功!");
+            this.getJs(this.settlementId);
+            resolve();
+          } else {
+            this.$Message.error(res.message);
+            reject();
+          }
+        });
       });
     },
     submitJs() {
-      let postData = {
-        settlementId: this.settlementId
-      };
-      submitPurchaseSettlement(postData).then(res => {
-        if (res.status == 200) {
-          this.$Message.success("提交结算详情成功!");
-          this.form.spzt = "2";
-        } else {
-          this.$Message.error(res.message);
-        }
+      this.editJs().then(() => {
+        let postData = {
+          settlementId: this.settlementId
+        };
+        submitPurchaseSettlement(postData).then(res => {
+          if (res.status == 200) {
+            this.$Message.success("提交结算详情成功!");
+            this.form.spzt = "2";
+          } else {
+            this.$Message.error(res.message);
+          }
+        });
       });
     },
     //审批记录跳转
@@ -604,7 +602,7 @@ export default {
     },
     //新增结算
     addJs() {
-      let mArr = ["glqy", "glxm", "gys", "khh", "zh", "djlx", "sqr"];
+      let mArr = ["glqy", "glxm", "gys", "khh", "zh", "sqr"];
       for (let item in mArr) {
         let it = mArr[item];
         if (!this.form[it]) {
@@ -645,7 +643,7 @@ export default {
         depositBank: this.form.khh,
         accountNumber: this.form.zh,
         gpbcId: this.form.gyszh,
-        type: this.form.djlx,
+        // type: this.form.djlx,
         receivedName: this.form.shr,
         // recivedTel: this,
         adjustmentPrice: Number(this.form.tzje).toFixed(2),

+ 1 - 0
src/page/purchase/components/balance/balanceMxAdd.vue

@@ -67,6 +67,7 @@
 <script>
 import { hajwySettlementList } from "@/service/getData";
 export default {
+  name: "balanceMxAdd",
   props: ["ssxmList"],
   data() {
     return {

+ 2 - 1
src/page/purchase/components/balance/balancePrint.vue

@@ -8,7 +8,7 @@
       </div>
       <div id="printForm">
         <div class="head">
-          <img class="logo" src="../../../../assets/images/dgdlogo.png" alt="">
+          <img class="logo" src="../../../../assets/images/dgdlogo.png" alt />
           <h2>结算单</h2>
         </div>
         <Row>
@@ -74,6 +74,7 @@
 
 <script>
 export default {
+  name: "balancePrint",
   data() {
     return {};
   }

+ 1 - 0
src/page/purchase/components/balance/newBPrint.vue

@@ -75,6 +75,7 @@
 <script>
 import { printPurchaseSettlementDetailVO } from "@/service/getData";
 export default {
+  name: "newBPrint",
   data() {
     return {
       settlementId: "",

+ 86 - 58
src/page/purchase/components/order/orderAdd.vue

@@ -1,13 +1,18 @@
 <template>
   <div>
     <!-- 页面主体内容 -->
-    <div class="planAddContent" v-show="contentShow">
+    <div class="planAddContent" v-show="contentShow && !printShow">
       <Card style="width:100%" :bordered="false" :dis-hover="true">
         <p slot="title">采购订单详情</p>
         <div slot="extra">
           <Button v-if="form.spzt != '1'" @click="toSpjl">查看审批记录</Button>
           <Button @click="submitCgdd" v-if="orderType == 'edit' && form.spzt == '1'">提交</Button>
           <Button @click="addCgdd" v-if="form.spzt == '1'">保存</Button>
+          <Button
+            href="javascript:;"
+            v-if="form.ddzt != '6' && form.spzt != '4'"
+            @click="printRow()"
+          >打印</Button>
           <Button @click="cancel">返回</Button>
         </div>
         <Row class="mainCont">
@@ -59,7 +64,7 @@
             </Select>
             <span v-else>{{ form.glxm.split(',')[1] }}</span>
           </Col>
-          <Col span="4" class-name="tables">
+          <!-- <Col span="4" class-name="tables">
             单据类型
             <span class="mustSpan">*</span>
           </Col>
@@ -71,7 +76,7 @@
                 :key="item.value"
               >{{ item.label }}</Option>
             </Select>
-          </Col>
+          </Col>-->
 
           <Col span="4" class-name="tables">采购人</Col>
           <Col span="4" class-name="tables">{{ form.cgr }}</Col>
@@ -199,6 +204,8 @@
             <span v-if="form.ddzt == '5'">已入库</span>
             <span v-if="form.ddzt == '6'">已取消</span>
           </Col>
+          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables"></Col>
         </Row>
         <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
           <Col span="4" class-name="upl">附件</Col>
@@ -365,6 +372,7 @@
     </div>
     <!-- 计划明细新增 -->
     <orderMxAdd ref="mxAdd" @plAdd="plAdd" @return="contentShow = true" v-show="!contentShow" />
+    <orderPrint ref="print" @return="() => {printShow = false;}" v-show="printShow" />
   </div>
 </template>
 
@@ -383,10 +391,13 @@ import {
   editPurchaseOrderDetailState
 } from "@/service/getData";
 import orderMxAdd from "./orderMxAdd";
+import orderPrint from "./orderPrint";
 export default {
+  name: "orderAdd",
   props: ["glqyList"],
   components: {
-    orderMxAdd
+    orderMxAdd,
+    orderPrint
   },
   data() {
     return {
@@ -399,6 +410,7 @@ export default {
       },
       spinShow: false,
       contentShow: true,
+      printShow: false,
       form: {
         dgbh: "", //订购编号
         bt: "", //标题
@@ -596,9 +608,16 @@ export default {
   },
   methods: {
     goDetail(id) {
-      window.open(
-        `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${id}`
-      );
+      let routeUrl = this.$router.resolve({
+        path: "/viewPurchaseApply",
+        query: {
+          id: id
+        }
+      });
+      window.open(routeUrl.href, "_blank");
+      // window.open(
+      //   `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${id}`
+      // );
       // this.$router.push(`/viewPurchaseApply?code=${code}`)
     },
     //批量设置弹窗
@@ -667,7 +686,7 @@ export default {
           this.form.bt = data.title;
           this.form.glqy = data.areaId + "," + data.areaName;
           this.form.glxm = data.projectId + "," + data.projectName;
-          this.form.djlx = data.type;
+          // this.form.djlx = data.type;
           this.form.cgr = data.purchaserName;
           this.form.cgrlxfs = data.purchaserTel;
           this.form.xdrq = data.orderTime;
@@ -887,57 +906,63 @@ export default {
           this.tableData[i].price * this.tableData[i].purchaseNum
         );
       }
-      let postData = {
-        areaId: this.form.glqy.split(",")[0],
-        areaName: this.form.glqy.split(",")[1],
-        projectId: this.form.glxm.split(",")[0],
-        projectName: this.form.glxm.split(",")[1],
-        purchaserId: localStorage.user_id,
-        purchaserName: localStorage.user_name,
-        purchaserTel: this.form.cgrlxfs,
-        receivedName: this.form.shr,
-        receivedTel: this.form.shrlxfs,
-        orderTime: this.form.xdrq,
-        invoiceTitleCode: this.form.fptt,
-        // deliveryStartTime: this.form.jhsj[0],
-        // deliveryEndTime: this.form.jhsj[1],
-        deliveryTime: this.form.jhsj,
-        deliveryPlace: this.form.jhdd,
-        type: this.form.djlx,
-        instruction: this.form.sm,
-        attachmentList: this.form.filesList,
-        gpId: this.form.gys, //供应商ID
-        gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
-        orderId: this.orderId,
-        // deleteId: this.deleteIds.join(","),
-        attachmentList: this.form.filesList,
-        detailList: this.tableData
-      };
-      this.spinShow = true;
-      this.tableLoading = true;
-      editPurchaseOrder(postData).then(res => {
-        this.spinShow = false;
-        this.tableLoading = false;
-        if (res.status == 200) {
-          this.$Message.success("编辑采购订单成功!");
-          this.getCgddXq(this.orderId);
-        } else {
-          this.$Message.error(res.message);
-        }
+      return new Promise((resolve, reject) => {
+        let postData = {
+          areaId: this.form.glqy.split(",")[0],
+          areaName: this.form.glqy.split(",")[1],
+          projectId: this.form.glxm.split(",")[0],
+          projectName: this.form.glxm.split(",")[1],
+          purchaserId: localStorage.user_id,
+          purchaserName: localStorage.user_name,
+          purchaserTel: this.form.cgrlxfs,
+          receivedName: this.form.shr,
+          receivedTel: this.form.shrlxfs,
+          orderTime: this.form.xdrq,
+          invoiceTitleCode: this.form.fptt,
+          // deliveryStartTime: this.form.jhsj[0],
+          // deliveryEndTime: this.form.jhsj[1],
+          deliveryTime: this.form.jhsj,
+          deliveryPlace: this.form.jhdd,
+          // type: this.form.djlx,
+          instruction: this.form.sm,
+          attachmentList: this.form.filesList,
+          gpId: this.form.gys, //供应商ID
+          gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
+          orderId: this.orderId,
+          // deleteId: this.deleteIds.join(","),
+          attachmentList: this.form.filesList,
+          detailList: this.tableData
+        };
+        this.spinShow = true;
+        this.tableLoading = true;
+        editPurchaseOrder(postData).then(res => {
+          this.spinShow = false;
+          this.tableLoading = false;
+          if (res.status == 200) {
+            this.$Message.success("编辑采购订单成功!");
+            this.getCgddXq(this.orderId);
+            resolve();
+          } else {
+            this.$Message.error(res.message);
+            reject();
+          }
+        });
       });
     },
     submitCgdd() {
-      let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
-      let postData = {
-        orderId: this.orderId
-      };
-      submitPurchaseOrder(postData).then(res => {
-        if (res.status == 200) {
-          this.$Message.success("提交采购订单成功!");
-          this.form.spzt = "2";
-        } else {
-          this.$Message.error(res.message);
-        }
+      this.editCgdd().then(() => {
+        let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
+        let postData = {
+          orderId: this.orderId
+        };
+        submitPurchaseOrder(postData).then(res => {
+          if (res.status == 200) {
+            this.$Message.success("提交采购订单成功!");
+            this.form.spzt = "2";
+          } else {
+            this.$Message.error(res.message);
+          }
+        });
       });
     },
     //新增采购订单
@@ -945,7 +970,6 @@ export default {
       let mustArr = [
         "glqy",
         "glxm",
-        "djlx",
         "xdrq",
         "jhsj",
         "cgrlxfs",
@@ -1003,7 +1027,7 @@ export default {
         // deliveryEndTime: this.form.jhsj[1],
         deliveryTime: this.form.jhsj,
         deliveryPlace: this.form.jhdd,
-        type: this.form.djlx,
+        // type: this.form.djlx,
         instruction: this.form.sm,
         attachmentList: this.form.filesList,
         gpId: this.form.gys, //供应商ID
@@ -1091,6 +1115,10 @@ export default {
         }
       }
     },
+    printRow() {
+      this.printShow = true;
+      this.$refs.print.getData(this.orderId);
+    },
     tableOnSelect(selection, row) {},
     //取消、返回
     cancel() {

+ 2 - 1
src/page/purchase/components/order/orderMxAdd.vue

@@ -61,6 +61,7 @@ import {
   getMaterialPrice
 } from "@/service/getData";
 export default {
+  name: "orderMxAdd",
   data() {
     return {
       orderId: "",
@@ -289,7 +290,7 @@ export default {
               storehouseId: this.tableSelect[item].storehouseId,
               price: Number(resArr[item].price),
               purchaseNum: Number(this.tableSelect[item].noBilledAmount),
-              plannedArrivalTime: dateArr,
+              plannedArrivalTime: this.tableSelect[item].arriveTime,
               isNumControl: 1,
               isTimeControl: 1,
               checkNum: null,

+ 3 - 2
src/page/purchase/components/order/orderPrint.vue

@@ -3,10 +3,10 @@
     <Card style="width:100%" :bordered="false" :dis-hover="true">
       <p slot="title">打印采购单</p>
       <div slot="extra">
-        <Button style="width: 80px" v-print="'#printForm'">打印</Button>
+        <Button style="width: 80px" v-print="'#printForm1'">打印</Button>
         <Button @click="$emit('return')" style="width: 80px">返回</Button>
       </div>
-      <div id="printForm">
+      <div id="printForm1">
         <div class="head">
           <img class="logo" src="../../../../assets/images/dgdlogo.png" alt />
           <h2>订购单</h2>
@@ -123,6 +123,7 @@
 import { findPurchaseOrder } from "@/service/getData";
 import { toChinesNum } from "../../../../../config/util";
 export default {
+  name: "orderPrint",
   data() {
     return {
       printData: {

+ 233 - 0
src/page/purchase/components/order/orderPrint2.vue

@@ -0,0 +1,233 @@
+<template>
+  <div>
+    <Card style="width:100%" :bordered="false" :dis-hover="true">
+      <p slot="title">打印采购单</p>
+      <div slot="extra">
+        <Button style="width: 80px" v-print="'#printForm'">打印</Button>
+        <Button @click="$emit('return')" style="width: 80px">返回</Button>
+      </div>
+      <div id="printForm">
+        <div class="head">
+          <img class="logo" src="../../../../assets/images/dgdlogo.png" alt />
+          <h2>订购单</h2>
+          <!-- <p>东莞市光大物业管理有限公司 DONGGUAN GUANGDA PROPERTY MANAGEMENT CO.,LTD</p>
+          <p>ADDRESS:广东省东莞市东城街道东骏路东城段1号景湖花园26栋301室</p>
+          <p>
+            <span style="margin-right: 10px">TEL:0769-22986803</span> MAIL:gdpm@en.gdpmdg.com
+          </p>-->
+          <p v-for="(item, index) in printTitle">{{ item }}</p>
+        </div>
+        <div class="line"></div>
+        <div class="line"></div>
+        <Row>
+          <Col :span="12" class="infor">供应商:{{ printData.gpName }}</Col>
+          <Col :span="6" class="infor">订购单号:{{ printData.orderCode }}</Col>
+          <Col
+            :span="6"
+            class="infor"
+          >申购单号:{{ printData.applyRuleCodes ? printData.applyRuleCodes.join(',') : ""}}</Col>
+          <Col :span="7" class="infor">供方负责人:{{ printData.gpcName }}</Col>
+          <Col :span="7" class="infor">FAX:{{ printData.gpcFax }}</Col>
+          <Col :span="10" class="infor">TEL:{{ printData.gpcPhone }}</Col>
+          <Col :span="7" class="infor">申购部门:{{ printData.archName }}</Col>
+          <Col :span="7" class="infor">申购人:{{ printData.purchaserName }}</Col>
+          <Col :span="10" class="infor">TEL:{{ printData.purchaserTel}}</Col>
+          <Col
+            :span="7"
+            class="infor"
+          >仓库名称:{{ printData.detailList.length == 0 ? "" : printData.detailList[0].detailList[0].storehouseName }}</Col>
+          <Col :span="7" class="infor">交货时间:{{ printData.deliveryTime }}</Col>
+          <Col :span="5" class="infor">收货人:{{ printData.receivedName }}</Col>
+          <Col :span="5" class="infor">TEL:{{ printData.receivedTel }}</Col>
+          <Col :span="24" class="infor">交货地点:{{ printData.deliveryPlace }}</Col>
+        </Row>
+        <table border="1">
+          <thead>
+            <tr>
+              <th style="width: 50px">序号</th>
+              <th style="width: 150px">物料编码</th>
+              <th style="width: 100px">物料名称</th>
+              <th style="width: 120px">规格型号</th>
+              <th style="width: 60px">单位</th>
+              <th style="width: 70px">申购数量</th>
+              <th style="width: 70px">采购数量</th>
+              <th style="width: 50px">单价</th>
+              <th style="width: 80px">金额</th>
+              <th style="width: 220px">备注</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr v-for="(item, index) in printData.detailList" :key="index">
+              <td>{{ index + 1 }}</td>
+              <td>{{ item.detailList[0].code }}</td>
+              <td>{{ item.detailList[0].materialName }}</td>
+              <td>{{ item.detailList[0].specs }}</td>
+              <td>{{ item.detailList[0].unit }}</td>
+              <td>{{ item.detailList[0].amount }}</td>
+              <td>{{ item.purchaseNum }}</td>
+              <td>{{ item.price }}</td>
+              <td>{{ item.totalPrice }}</td>
+              <td>{{ item.remark }}</td>
+            </tr>
+            <tr>
+              <td colspan="2">总金额:</td>
+              <td>大写:</td>
+              <td colspan="5">{{ chinesePrice }}</td>
+              <td>小写:</td>
+              <td>¥{{ printData.totalPrice }} -</td>
+            </tr>
+            <tr>
+              <td>说明:</td>
+              <td colspan="10" style="text-align: left">
+                <p>
+                  1、承包范围:
+                  <span class="square" />不包运输/
+                  <span class="square" />包运输不含卸车/
+                  <span class="square" />包运输含卸车/
+                  <span class="square" />包工包料包验收。
+                </p>
+                <p>
+                  2、供货期/工期:
+                  <span class="square" />签订订单后______天/
+                  <span class="square" />按需方申购部门要求、确认的到货时间。
+                </p>
+                <p>3、质量要求:须达到国家和行业标准、企业标准、按定板标准供货,规格/尺寸按使用部门要求供货。</p>
+                <p>
+                  4、保质期:保用_____年;
+                  <span style="margin-right:20px"></span>付款方式:
+                  <span class="square" />批结/
+                  <span class="square" />现金
+                  <span class="square" />/现金(约45天付款)。
+                </p>
+                <p>5、供方如向我司相关人员行贿或所供产品出现规格、数量与送货单不符、以假充真等情形的,我司有权按该产品金额“以一罚十”标准要求乙方承担违约责任;如发现有假发票,我司将有权不给予付款并追究其相关法律责任。</p>
+                <p>6、以上价格已包含发票,发票抬头:{{ fptt }}。</p>
+                <p>7、备注:订单日期{{ printData.orderTime ? printData.orderTime.split(' ')[0] : "" }}</p>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+        <Row>
+          <Col :span="3" class="foot">
+            <p style="width:1px;height:1px"></p>
+          </Col>
+          <Col :span="7" class="foot">审批:</Col>
+          <Col :span="7" class="foot">审核:</Col>
+          <Col :span="7" class="foot">采购:</Col>
+        </Row>
+      </div>
+    </Card>
+  </div>
+</template>
+
+<script>
+import { findPurchaseOrder } from "@/service/getData";
+import { toChinesNum } from "../../../../../config/util";
+export default {
+  name: "orderPrint2",
+  data() {
+    return {
+      printData: {
+        detailList: []
+      },
+      printTitle: [],
+      fptt: "",
+      chinesePrice: ""
+    };
+  },
+  methods: {
+    getData(id) {
+      let postData = {
+        orderId: id
+      };
+      findPurchaseOrder(postData).then(res => {
+        if (res.status == 200) {
+          let arr = [];
+          this.printData = res.data;
+          for (let it in res.data.detailList) {
+            if (res.data.detailList[it].isCancel != "0") {
+            } else {
+              arr.push(res.data.detailList[it]);
+            }
+          }
+          this.printData.detailList = arr;
+          let pops = res.data.invoiceTitleDesc.split("|");
+          let tt = pops.pop();
+          this.printTitle = pops;
+          this.fptt = tt;
+          if (!res.data.totalPrice) {
+            res.data.totalPrice = 0;
+            this.chinesePrice = "零元整";
+          } else {
+            this.chinesePrice = toChinesNum(res.data.totalPrice);
+          }
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+ivu-card-head-inner,
+.ivu-card-head p {
+  display: inline-block;
+  width: 100%;
+  height: 20px;
+  line-height: 20px;
+  font-size: 14px;
+  color: #17233d;
+  font-weight: 700;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  font-weight: normal;
+}
+#printForm {
+  width: 1000px;
+  margin: 0 auto;
+  .head {
+    text-align: center;
+    position: relative;
+    .logo {
+      position: absolute;
+      top: 0;
+      left: 0;
+      height: 40px;
+    }
+    h2 {
+      font-size: 30px;
+      letter-spacing: 20px;
+    }
+  }
+  .line {
+    height: 1px;
+    background: #000;
+    margin-bottom: 3px;
+  }
+  .infor {
+    line-height: 30px;
+    word-break: break-all;
+  }
+  .foot {
+    line-height: 40px;
+  }
+  table {
+    th,
+    td {
+      text-align: center;
+      line-height: 30px;
+      font-weight: normal;
+      .square {
+        display: inline-block;
+        width: 10px;
+        height: 10px;
+        border: 1px solid black;
+        margin-right: 2px;
+      }
+      p {
+        padding-left: 5px;
+      }
+    }
+  }
+}
+</style>

+ 59 - 51
src/page/purchase/components/plan/planAdd.vue

@@ -231,7 +231,7 @@
           <template slot-scope="{ row, index }" slot="linkedPersonName">
             <span>{{ row.linkedPersonName }}</span>
           </template>
-          <template slot-scope="{ row, index }" slot="billType">
+          <!-- <template slot-scope="{ row, index }" slot="billType">
             <Select
               :disabled="form.spzt == '2'  || form.spzt == '1'"
               v-model="tableData[index].billType"
@@ -240,7 +240,7 @@
             >
               <Option v-for="item in djList" :value="item.value" :key="item.value">{{ item.label }}</Option>
             </Select>
-          </template>
+          </template>-->
           <template slot-scope="{ row, index }" slot="referenceTotalPrice">
             <span>{{ (row.amount * row.referencePrice).toFixed(2) }}</span>
           </template>
@@ -337,6 +337,7 @@ import {
 } from "@/service/getData";
 import planMxAdd from "./planMxAdd";
 export default {
+  name: "planAdd",
   components: {
     planMxAdd
   },
@@ -470,12 +471,12 @@ export default {
           tooltip: "true",
           width: 100
         },
-        {
-          title: "单据类型",
-          slot: "billType",
-          tooltip: "true",
-          width: 100
-        },
+        // {
+        //   title: "单据类型",
+        //   slot: "billType",
+        //   tooltip: "true",
+        //   width: 100
+        // },
         {
           title: "计划到货时间",
           slot: "arriveTime",
@@ -507,13 +508,13 @@ export default {
     };
   },
   created() {
-    getLabelByCode4Purchase({ dictCode: "billType" }).then(res => {
-      if (res.status == 200) {
-        this.djList = res.data;
-      } else {
-        this.$Message.error(res.message);
-      }
-    });
+    // getLabelByCode4Purchase({ dictCode: "billType" }).then(res => {
+    //   if (res.status == 200) {
+    //     this.djList = res.data;
+    //   } else {
+    //     this.$Message.error(res.message);
+    //   }
+    // });
   },
   methods: {
     //批量设置弹窗
@@ -659,12 +660,12 @@ export default {
                 tooltip: "true",
                 width: 100
               },
-              {
-                title: "单据类型",
-                slot: "billType",
-                tooltip: "true",
-                width: 100
-              },
+              // {
+              //   title: "单据类型",
+              //   slot: "billType",
+              //   tooltip: "true",
+              //   width: 100
+              // },
               {
                 title: "计划到货时间",
                 slot: "arriveTime",
@@ -797,10 +798,10 @@ export default {
           this.$Message.error("计划明细申购数量不能小于或等于0!");
           return false;
         }
-        if (this.tableData[i].billType == "") {
-          this.$Message.error("请选择计划明细单据类型!");
-          return false;
-        }
+        // if (this.tableData[i].billType == "") {
+        //   this.$Message.error("请选择计划明细单据类型!");
+        //   return false;
+        // }
         this.tableData[i].referenceTotalPrice = (
           this.tableData[i].amount * this.tableData[i].referencePrice
         ).toFixed(2);
@@ -831,15 +832,19 @@ export default {
         detailList: this.tableData
       };
       this.spinShow = true;
-      editPurchaseApply(postData).then(res => {
-        this.spinShow = false;
-        if (res.status == 200) {
-          this.$Message.success("编辑申购计划成功!");
-          this.getSgjh(this.id);
-          // this.cancel();
-        } else {
-          this.$Message.error(res.message);
-        }
+      return new Promise((resolve, reject) => {
+        editPurchaseApply(postData).then(res => {
+          this.spinShow = false;
+          if (res.status == 200) {
+            this.$Message.success("编辑申购计划成功!");
+            this.getSgjh(this.id);
+            resolve();
+            // this.cancel();
+          } else {
+            this.$Message.error(res.message);
+            reject();
+          }
+        });
       });
     },
     tableOnSelect(selection, row) {
@@ -871,18 +876,21 @@ export default {
       if (!cango) {
         return false;
       }
-      let postData = {
-        id: this.id
-      };
       this.spinShow = true;
-      submitPurchaseApply(postData).then(res => {
-        this.spinShow = false;
-        if (res.status == 200) {
-          this.$Message.success("提交申购计划成功!");
-          this.form.spzt = "1";
-        } else {
-          this.$Message.error(res.message);
-        }
+      this.editSgjh().then(() => {
+        console.log(123);
+        let postData = {
+          id: this.id
+        };
+        submitPurchaseApply(postData).then(res => {
+          this.spinShow = false;
+          if (res.status == 200) {
+            this.$Message.success("提交申购计划成功!");
+            this.form.spzt = "1";
+          } else {
+            this.$Message.error(res.message);
+          }
+        });
       });
     },
     //所属区域切换
@@ -1009,12 +1017,12 @@ export default {
           tooltip: "true",
           width: 100
         },
-        {
-          title: "单据类型",
-          slot: "billType",
-          tooltip: "true",
-          width: 100
-        },
+        // {
+        //   title: "单据类型",
+        //   slot: "billType",
+        //   tooltip: "true",
+        //   width: 100
+        // },
         {
           title: "计划到货时间",
           slot: "arriveTime",

+ 3 - 2
src/page/purchase/components/plan/planMxAdd.vue

@@ -138,6 +138,7 @@ import {
   getLabelByCode
 } from "@/service/getData";
 export default {
+  name: "planMxAdd",
   data() {
     return {
       projectId: "",
@@ -233,7 +234,7 @@ export default {
         }
       }
     });
-    getLabelByCode({ dictCode: "goodsTypes" }).then(res => {
+    getLabelByCode({ dictCode: "goodsType" }).then(res => {
       this.wllxList = res.data;
     });
     getLabelByCode({ dictCode: "measure_unit" }).then(res => {
@@ -334,7 +335,7 @@ export default {
           1}-${date.getDate()} 00:00:00`;
         arr.push({
           code: this.tableSelect[item].sgNo,
-          billType: "", //待确认  预测为单据类型
+          // billType: "", //待确认  预测为单据类型
           materialId: this.tableSelect[item].sgId, //待确认 物料ID?
           materialName: this.tableSelect[item].sgName,
           arriveTime: dateStr, //待确认  预测为计划到货时间

+ 1 - 0
src/page/purchase/components/plan/planPrint.vue

@@ -59,6 +59,7 @@
 <script>
 import { printPurchaseApplyDetailVO } from "@/service/getData";
 export default {
+  name: "planPrint",
   data() {
     return {
       printData: {

+ 44 - 14
src/page/purchase/components/pool/poolAdd.vue

@@ -29,7 +29,10 @@
           </Col>
           <Col span="4" class-name="tables">总价(元)</Col>
           <Col span="4" class-name="tables">{{ form.totalPrice }}</Col>
-          <Col span="4" class-name="tables">关联区域</Col>
+          <Col span="4" class-name="tables">
+            关联区域
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Select
               clearable
@@ -47,7 +50,10 @@
             </Select>
             <span v-else>{{ form.glqy.split(',')[1] }}</span>
           </Col>
-          <Col span="4" class-name="tables">关联项目</Col>
+          <Col span="4" class-name="tables">
+            关联项目
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Select
               clearable
@@ -64,7 +70,7 @@
             </Select>
             <span v-else>{{ form.glxm.split(',')[1] }}</span>
           </Col>
-          <Col span="4" class-name="tables">单据类型</Col>
+          <!-- <Col span="4" class-name="tables">单据类型</Col>
           <Col span="4" class-name="tables">
             <Select clearable v-model="form.djlx" style="width: 95%">
               <Option
@@ -74,7 +80,7 @@
                 :disabled="form.spzt == '2' || form.spzt == '3'"
               >{{ item.label }}</Option>
             </Select>
-          </Col>
+          </Col>-->
 
           <Col span="4" class-name="tables">采购人</Col>
           <Col span="4" class-name="tables">{{ form.cgr }}</Col>
@@ -87,7 +93,10 @@
               style="width: 95%"
             />
           </Col>
-          <Col span="4" class-name="tables">下单日期</Col>
+          <Col span="4" class-name="tables">
+            下单日期
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <DatePicker
               style="width: 95%"
@@ -100,7 +109,10 @@
               :disabled="form.spzt == '2' || form.spzt == '3'"
             ></DatePicker>
           </Col>
-          <Col span="4" class-name="tables">交货时间</Col>
+          <Col span="4" class-name="tables">
+            交货时间
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <DatePicker
               :disabled="form.xdrq == '' || form.spzt != '1'"
@@ -115,7 +127,10 @@
           </Col>
           <Col span="4" class-name="tables">交货地点</Col>
           <Col span="4" class-name="tables">{{ form.jhdd }}</Col>
-          <Col span="4" class-name="tables">收货人</Col>
+          <Col span="4" class-name="tables">
+            收货人
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Input
               v-model="form.shr"
@@ -124,7 +139,10 @@
               style="width: 95%"
             />
           </Col>
-          <Col span="4" class-name="tables">收货人联系方式</Col>
+          <Col span="4" class-name="tables">
+            收货人联系方式
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Input
               v-model="form.shrlxfs"
@@ -133,7 +151,10 @@
               style="width: 95%"
             />
           </Col>
-          <Col span="4" class-name="tables">供应商</Col>
+          <Col span="4" class-name="tables">
+            供应商
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="12" class-name="tables">
             <Select
               clearable
@@ -152,9 +173,15 @@
             </Select>
             <span v-else>{{ this.gysList.filter(a => a.gpId == form.gys)[0].gpName }}</span>
           </Col>
-          <Col span="4" class-name="tables">供方负责人</Col>
+          <Col span="4" class-name="tables">
+            供方负责人
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">{{ form.gffzr }}</Col>
-          <Col span="4" class-name="tables">供应商联系电话</Col>
+          <Col span="4" class-name="tables">
+            供应商联系电话
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">{{ form.gyslxdh }}</Col>
           <Col span="4" class-name="tables">关联申购计划</Col>
           <Col span="4" class-name="tables">{{ form.glsgjh }}</Col>
@@ -180,6 +207,8 @@
             <span v-if="form.ddzt == '5'">已入库</span>
             <span v-if="form.ddzt == '6'">已取消</span>
           </Col>
+          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables"></Col>
         </Row>
         <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
           <Col span="4" class-name="upl">附件</Col>
@@ -322,6 +351,7 @@
 </template>
 
 <script>
+import { phoneFun } from "../../../../../config/util";
 import {
   addPurchaseOrder,
   findPurchaseOrder,
@@ -333,6 +363,7 @@ import {
 } from "@/service/getData";
 import poolMxAdd from "./poolMxAdd";
 export default {
+  name: "poolAdd",
   props: ["gysList", "glqyList", "djlxList", "fpttList"],
   components: {
     poolMxAdd
@@ -600,7 +631,6 @@ export default {
       let mustArr = [
         "glqy",
         "glxm",
-        "djlx",
         "xdrq",
         "jhsj",
         "cgrlxfs",
@@ -668,7 +698,7 @@ export default {
         orderTime: this.form.xdrq,
         deliveryTime: this.form.jhsj,
         deliveryPlace: this.form.jhdd,
-        type: this.form.djlx,
+        // type: this.form.djlx,
         instruction: this.form.sm,
         attachmentList: this.form.filesList,
         invoiceTitleCode: this.form.fptt,
@@ -723,7 +753,7 @@ export default {
           this.form.bt = data.title;
           this.form.glqy = data.areaId + "," + data.areaName;
           this.form.glxm = data.projectId + "," + data.projectName;
-          this.form.djlx = data.type;
+          // this.form.djlx = data.type;
           this.form.cgr = data.purchaserName;
           this.form.cgrlxfs = data.purchaserTel;
           this.form.xdrq = data.orderTime;

+ 1 - 0
src/page/purchase/components/pool/poolMxAdd.vue

@@ -61,6 +61,7 @@ import {
   getMaterialPrice
 } from "@/service/getData";
 export default {
+  name: "poolMxAdd",
   data() {
     return {
       orderId: "",

+ 53 - 5
src/page/purchase/purchaseBalance.vue

@@ -3,8 +3,8 @@
     <Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!addShow && !printShow">
       <p slot="title">采购结算列表</p>
       <div slot="extra">
-        <Button @click="addxShow">新增采购结算</Button>
-        <Button @click="exportData">导出明细</Button>
+        <Button @click="addxShow" 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">
@@ -86,9 +86,18 @@
             <a
               href="javascript:;"
               @click="editRow(row)"
+              v-if="buttonShow.edit"
             >{{ row.approvalState == '1' ? '编辑' : '查看' }}</a>
-            <a href="javascript:;" v-if="row.approvalState == '1'" @click="deleteRow(row)">删除</a>
-            <a href="javascript:;" v-if="row.approvalState == '1'" @click="submitRow(row)">提交</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.delete && row.approvalState == '1'"
+              @click="deleteRow(row)"
+            >删除</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.submit &&row.approvalState == '1'"
+              @click="submitRow(row)"
+            >提交</a>
           </div>
         </template>
       </Table>
@@ -119,11 +128,13 @@ import {
   getLabelByCode,
   selectGoodProviderSelectionList,
   getLabelByCode4Purchase,
-  submitPurchaseSettlement
+  submitPurchaseSettlement,
+  getUserButtons
 } from "@/service/getData";
 import balanceAdd from "./components/balance/balanceAdd";
 import balancePrint from "./components/balance/newBPrint";
 export default {
+  name: "purchaseBalance",
   components: {
     balanceAdd,
     balancePrint
@@ -136,6 +147,13 @@ export default {
       resizeHeight: 100,
       resizeWidth: 100,
       handleWidth: 100,
+      buttonShow: {
+        add: false,
+        export: false,
+        submit: false,
+        edit: false,
+        delete: false
+      },
       //   查询参数
       searchForm: {
         ssqy: "", //所属区域
@@ -271,6 +289,7 @@ export default {
   },
   created() {
     this.getTableData();
+    this.getUserAuth();
     selectGoodProviderSelectionList().then(res => {
       this.gysList = res.data;
     });
@@ -282,6 +301,35 @@ export default {
     });
   },
   methods: {
+    //获取按钮权限
+    getUserAuth() {
+      //获取用户在当前页面的权限
+      var self = this;
+      let menuId = sessionStorage.getItem("refresh_child_id");
+      let userForm = {
+        userId: localStorage.user_id,
+        menuId: menuId
+      };
+      let buttons = [
+        "add",
+        "submit",
+        "export",
+        "order",
+        "edit",
+        "delete",
+        "print"
+      ];
+      getUserButtons(userForm).then(result => {
+        if (result.resultCode == "200") {
+          result.data.forEach(item => {
+            //  item.code
+            if (buttons.includes(item.code)) {
+              self.buttonShow[item.code] = true;
+            }
+          });
+        }
+      });
+    },
     goDetail(row) {
       this.editRow(row);
       // window.open(

+ 58 - 8
src/page/purchase/purchaseOrder.vue

@@ -3,8 +3,8 @@
     <Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!addShow && !printShow">
       <p slot="title">采购订单列表</p>
       <div slot="extra">
-        <Button @click="addShow = true">新增采购订单</Button>
-        <Button @click="exportData">导出明细</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">
@@ -106,19 +106,28 @@
             <a
               href="javascript:;"
               @click="editRow(row)"
+              v-if="buttonShow.edit"
             >{{ row.approvalState == '1' ? '编辑' : '查看' }}</a>
             <a
               href="javascript:;"
-              v-if="row.approvalState == '1'"
+              v-if="buttonShow.submit && row.approvalState == '1'"
               @click="submitRow(row.orderId)"
             >提交</a>
-            <a href="javascript:;" v-if="row.approvalState == '1'" @click="deleteRow(row)">删除</a>
             <a
               href="javascript:;"
-              v-if="row.orderState != '6' && row.approvalState != '4'"
+              v-if="buttonShow.delete && row.approvalState == '1'"
+              @click="deleteRow(row)"
+            >删除</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.print && row.orderState != '6' && row.approvalState != '4'"
               @click="printRow(row)"
             >打印</a>
-            <a href="javascript:;" @click="cgddxd(row.orderId)" v-if="row.orderState == '2'">下单</a>
+            <a
+              href="javascript:;"
+              @click="cgddxd(row.orderId)"
+              v-if="buttonShow.order && row.orderState == '2'"
+            >下单</a>
             <!-- <a href="javascript:;" @click="cgddqx(row.orderId)" v-if="row.orderState == '2'">取消订单</a> -->
           </div>
         </template>
@@ -145,11 +154,13 @@ import {
   getAreaList,
   getProjectList,
   editPurchaseOrderState,
-  submitPurchaseOrder
+  submitPurchaseOrder,
+  getUserButtons
 } from "@/service/getData";
 import orderAdd from "./components/order/orderAdd";
-import orderPrint from "./components/order/orderPrint";
+import orderPrint from "./components/order/orderPrint2";
 export default {
+  name: "purchaseOrder",
   components: {
     orderAdd,
     orderPrint
@@ -162,6 +173,15 @@ export default {
       resizeHeight: 100,
       resizeWidth: 100,
       handleWidth: 100,
+      buttonShow: {
+        add: false,
+        submit: false,
+        export: false,
+        order: false,
+        edit: false,
+        delete: false,
+        print: false
+      },
       //   查询参数
       searchForm: {
         ssqy: [], //所属区域
@@ -277,6 +297,7 @@ export default {
   },
   created() {
     this.getTableData();
+    this.getUserAuth();
     getAreaList(localStorage.user_id).then(res => {
       this.ssqyList = res.items;
     });
@@ -285,6 +306,35 @@ export default {
     });
   },
   methods: {
+    //获取按钮权限
+    getUserAuth() {
+      //获取用户在当前页面的权限
+      var self = this;
+      let menuId = sessionStorage.getItem("refresh_child_id");
+      let userForm = {
+        userId: localStorage.user_id,
+        menuId: menuId
+      };
+      let buttons = [
+        "add",
+        "submit",
+        "export",
+        "order",
+        "edit",
+        "delete",
+        "print"
+      ];
+      getUserButtons(userForm).then(result => {
+        if (result.resultCode == "200") {
+          result.data.forEach(item => {
+            //  item.code
+            if (buttons.includes(item.code)) {
+              self.buttonShow[item.code] = true;
+            }
+          });
+        }
+      });
+    },
     goDetail(row) {
       this.editRow(row);
       // window.open(

+ 81 - 15
src/page/purchase/purchasePlan.vue

@@ -3,8 +3,8 @@
     <Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!printShow && !addShow">
       <p slot="title">申购计划列表</p>
       <div slot="extra">
-        <Button @click="addShow = true">新增申购计划</Button>
-        <Button @click="exportData">导出明细</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">
@@ -111,20 +111,32 @@
         </template>
         <template slot-scope="{ row, index }" slot="action">
           <div>
-            <a href="javascript:;" @click="editRow(row)">{{ row.applyStatus == '0' ? '编辑': '查看' }}</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.edit"
+              @click="editRow(row)"
+            >{{ row.applyStatus == '0' ? '编辑': '查看' }}</a>
             <!-- <a href="javascript:;">复制</a> -->
-            <a href="javascript:;" v-if="row.applyStatus == '0'" @click="deleteRow(row)">删除</a>
             <a
               href="javascript:;"
-              v-if="row.applyStatus == '2' || row.applyStatus == '3'"
+              v-if="buttonShow.delete && row.applyStatus == '0'"
+              @click="deleteRow(row)"
+            >删除</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.copy && (row.applyStatus == '2' || row.applyStatus == '3')"
               @click="copyRow(row)"
             >复制</a>
             <a
               href="javascript:;"
-              v-if="row.applyStatus != '3' && row.status != '5'"
+              v-if="buttonShow.print && row.applyStatus != '3' && row.status != '5'"
               @click="printRow(row)"
             >打印</a>
-            <a href="javascript:;" v-if="row.applyStatus == '0'" @click="submitRow(row)">提交</a>
+            <a
+              href="javascript:;"
+              v-if="buttonShow.submit && row.applyStatus == '0'"
+              @click="submitRow(row)"
+            >提交</a>
           </div>
         </template>
       </Table>
@@ -151,11 +163,13 @@ import {
   exportPurchaseInfo,
   submitPurchaseApply,
   queryPurchaseApplyInfo,
-  addPurchaseApply
+  addPurchaseApply,
+  getUserButtons
 } from "@/service/getData";
 import planAdd from "./components/plan/planAdd";
 import PlanPrint from "./components/plan/planPrint";
 export default {
+  name: "purchasePlan",
   components: {
     planAdd,
     PlanPrint
@@ -168,6 +182,15 @@ export default {
       resizeHeight: 100,
       resizeWidth: 100,
       handleWidth: 100,
+      buttonShow: {
+        add: false,
+        edit: false,
+        delete: false,
+        submit: false,
+        copy: false,
+        export: false,
+        print: false
+      },
       //   顶部搜索
       searchForm: {
         ssqy: "", //所属区域
@@ -305,6 +328,7 @@ export default {
   },
   created() {
     this.getTableData();
+    this.getUserAuth();
     getAreaList(localStorage.user_id).then(res => {
       this.ssqyList = res.items;
     });
@@ -317,15 +341,50 @@ export default {
     });
   },
   methods: {
+    //获取按钮权限
+    getUserAuth() {
+      //获取用户在当前页面的权限
+      var self = this;
+      let menuId = sessionStorage.getItem("refresh_child_id");
+      let userForm = {
+        userId: localStorage.user_id,
+        menuId: menuId
+      };
+      let buttons = [
+        "add",
+        "submit",
+        "export",
+        "copy",
+        "edit",
+        "delete",
+        "print"
+      ];
+      getUserButtons(userForm).then(result => {
+        if (result.resultCode == "200") {
+          result.data.forEach(item => {
+            //  item.code
+            if (buttons.includes(item.code)) {
+              self.buttonShow[item.code] = true;
+            }
+          });
+        }
+      });
+    },
     goDetail(row, index) {
       if (row.applyStatus != "3") {
         this.editRow(row);
       } else {
-        window.open(
-          `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
-        );
+        let routeUrl = this.$router.resolve({
+          path: "/viewPurchaseApply",
+          query: {
+            id: row.id
+          }
+        });
+        window.open(routeUrl.href, "_blank");
+        // window.open(
+        //   `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
+        // );
       }
-      // window.open(`/#/viewPurchaseApply?id=${row.id}`);
     },
     resizePage() {
       this.resizeHeight = window.innerHeight - 282;
@@ -412,9 +471,16 @@ export default {
         this.$refs.add.planType = "edit";
         this.$refs.add.getSgjh(row.id);
       } else {
-        window.open(
-          `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
-        );
+        let routeUrl = this.$router.resolve({
+          path: "/viewPurchaseApply",
+          query: {
+            id: row.id
+          }
+        });
+        window.open(routeUrl.href, "_blank");
+        // window.open(
+        //   `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
+        // );
       }
     },
     //行删除

+ 101 - 19
src/page/purchase/purchasePool.vue

@@ -41,9 +41,14 @@
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="24" style="text-align: right">
           <Button type="primary" style="width: 80px" @click="getTableData">查询</Button>
-          <Button type="primary" style="width: 100px" @click="plcg">批量采购</Button>
+          <Button type="primary" style="width: 100px" @click="plcg" v-if="buttonShow.add">批量采购</Button>
           <!-- 下面这行是赵书广加的,不客气 -->
-          <Button type="primary" style="width: 100px" @click="handleExcelClick">导出Excel</Button>
+          <Button
+            type="primary"
+            style="width: 100px"
+            @click="handleExcelClick"
+            v-if="buttonShow.export"
+          >导出Excel</Button>
         </Col>
       </Row>
       <Table
@@ -70,20 +75,29 @@
     />
     <Modal v-model="poolModalShow" title="新增采购订单" :width="900">
       <Row class="mainCont">
-        <Col span="4" class-name="tables">单据类型</Col>
+        <!-- <Col span="4" class-name="tables">单据类型</Col>
         <Col span="4" class-name="tables">
           <Select clearable v-model="addForm.djlx" style="width: 95%">
             <Option v-for="item in djlxList" :value="item.value" :key="item.value">{{ item.label }}</Option>
           </Select>
-        </Col>
+        </Col>-->
 
-        <Col span="4" class-name="tables">采购人</Col>
+        <Col span="4" class-name="tables">
+          采购人
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">{{ addForm.cgr }}</Col>
-        <Col span="4" class-name="tables">采购人联系方式</Col>
+        <Col span="4" class-name="tables">
+          采购人联系方式
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">
           <Input v-model="addForm.cgrlxfs" placeholder="请输入" style="width: 95%" />
         </Col>
-        <Col span="4" class-name="tables">下单日期</Col>
+        <Col span="4" class-name="tables">
+          下单日期
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">
           <DatePicker
             transfer
@@ -96,7 +110,10 @@
             placeholder="请选择"
           ></DatePicker>
         </Col>
-        <Col span="4" class-name="tables">交货时间</Col>
+        <Col span="4" class-name="tables">
+          交货时间
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">
           <DatePicker
             transfer
@@ -109,15 +126,24 @@
             placeholder="请选择"
           ></DatePicker>
         </Col>
-        <Col span="4" class-name="tables">收货人</Col>
+        <Col span="4" class-name="tables">
+          收货人
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">
           <Input v-model="addForm.shr" placeholder="请输入" style="width: 95%" />
         </Col>
-        <Col span="4" class-name="tables">收货人联系方式</Col>
+        <Col span="4" class-name="tables">
+          收货人联系方式
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">
           <Input v-model="addForm.shrlxfs" placeholder="请输入" style="width: 95%" />
         </Col>
-        <Col span="4" class-name="tables">供应商</Col>
+        <Col span="4" class-name="tables">
+          供应商
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="12" class-name="tables">
           <Select
             transfer
@@ -130,16 +156,27 @@
             <Option v-for="item in gysList" :value="item.gpId" :key="item.gpId">{{ item.gpName }}</Option>
           </Select>
         </Col>
-        <Col span="4" class-name="tables">供方负责人</Col>
+        <Col span="4" class-name="tables">
+          供方负责人
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">{{ addForm.gffzr }}</Col>
-        <Col span="4" class-name="tables">供应商联系电话</Col>
+        <Col span="4" class-name="tables">
+          供应商联系电话
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">{{ addForm.gyslxdh }}</Col>
-        <Col span="4" class-name="tables">发票抬头</Col>
+        <Col span="4" class-name="tables">
+          发票抬头
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="4" class-name="tables">
           <Select v-model="addForm.fptt" style="width: 95%" transfer>
             <Option v-for="item in fpttList" :value="item.value" :key="item.value">{{ item.label }}</Option>
           </Select>
         </Col>
+        <Col span="4" class-name="tables"></Col>
+        <Col span="4" class-name="tables"></Col>
       </Row>
       <div slot="footer">
         <Button @click="poolModalCancel">取消</Button>
@@ -159,9 +196,11 @@ import {
   tbiGoodsCategoryList,
   selectGoodProviderSelectionList,
   getLabelByCode4Purchase,
-  addPurchaseOrder
+  addPurchaseOrder,
+  getUserButtons
 } from "@/service/getData";
 export default {
+  name: "purchasePool",
   components: { poolAdd },
   data() {
     return {
@@ -171,6 +210,10 @@ export default {
       resizeHeight: 100,
       resizeWidth: 100,
       handleWidth: 100,
+      buttonShow: {
+        add: false,
+        export: false
+      },
       //   顶部搜索
       searchForm: {
         ssqy: "",
@@ -324,6 +367,7 @@ export default {
   },
   created() {
     this.getTableData();
+    this.getUserAuth();
     getAreaList(localStorage.user_id).then(res => {
       this.ssqyList = res.items;
     });
@@ -355,6 +399,27 @@ export default {
     });
   },
   methods: {
+    //获取按钮权限
+    getUserAuth() {
+      //获取用户在当前页面的权限
+      var self = this;
+      let menuId = sessionStorage.getItem("refresh_child_id");
+      let userForm = {
+        userId: localStorage.user_id,
+        menuId: menuId
+      };
+      let buttons = ["add", "export"];
+      getUserButtons(userForm).then(result => {
+        if (result.resultCode == "200") {
+          result.data.forEach(item => {
+            //  item.code
+            if (buttons.includes(item.code)) {
+              self.buttonShow[item.code] = true;
+            }
+          });
+        }
+      });
+    },
     // 导出excel
     async handleExcelClick() {
       let postData = {
@@ -438,7 +503,7 @@ export default {
       this.poolModalShow = false;
     },
     poolModalOk() {
-      let mustArr = ["djlx", "xdrq", "jhsj", "shr", "shrlxfs", "gys", "fptt"];
+      let mustArr = ["xdrq", "jhsj", "shr", "shrlxfs", "gys", "fptt"];
       for (let i in mustArr) {
         if (
           this.addForm[mustArr[i]] == "" ||
@@ -468,7 +533,7 @@ export default {
         orderTime: this.addForm.xdrq,
         deliveryTime: this.addForm.jhsj,
         deliveryPlace: this.addForm.jhdd,
-        type: this.addForm.djlx,
+        // type: this.addForm.djlx,
         invoiceTitleCode: this.addForm.fptt,
         instruction: "",
         attachmentList: [],
@@ -504,8 +569,8 @@ export default {
               price: Number(this.tableSelect[i].referencePrice),
               purchaseNum: Number(this.tableSelect[i].noBilledAmount),
               plannedArrivalTime: dateArr,
-              isNumControl: 2,
-              isTimeControl: 2,
+              isNumControl: 1,
+              isTimeControl: 1,
               applySurplusNum: this.tableSelect[i].noBilledAmount,
               warehousedNum: 0,
               remark: ""
@@ -523,12 +588,15 @@ export default {
     plcg() {
       let project = "";
       let area = "";
+      let applicantId = "";
+      let doShr = true;
       if (this.tableSelect.length == 0) {
         this.$Message.error("请至少选择一条采购物料信息!");
         return false;
       } else {
         area = this.tableSelect[0].areaId;
         project = this.tableSelect[0].projectId;
+        applicantId = this.tableSelect[0].applicantId;
       }
       for (let i in this.tableSelect) {
         if (this.tableSelect[i].projectId != project) {
@@ -536,6 +604,16 @@ export default {
           return false;
         }
       }
+      for (let i in this.tableSelect) {
+        if (this.tableSelect[i].applicantId != applicantId) {
+          doShr = false;
+        }
+      }
+      if (doShr) {
+        this.addForm.shr = this.tableSelect[0].applicantName;
+        this.addForm.shrlxfs = this.tableSelect[0].applicantTel;
+      }
+      this.addForm.cgrlxfs = this.tableSelect[0].purchaseTel;
       this.addForm.xdrq = `${new Date().getFullYear()}-${new Date().getMonth() +
         1}-${new Date().getDate()} ${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()}`;
       this.poolModalShow = true;
@@ -584,6 +662,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.mustSpan {
+  color: red;
+  margin-left: 2px;
+}
 .mainCont .tables {
   min-height: 50px;
   border-right: 1px solid #e4e4e4;

+ 1 - 0
src/page/purchaseView/allot.vue

@@ -47,6 +47,7 @@
 <script>
 import { getDetailRecord } from "@/service/getData";
 export default {
+  name: "allot",
   data() {
     return {
       form: {

+ 12 - 9
src/page/purchaseView/balance.vue

@@ -40,14 +40,14 @@
             <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">{{ form.zh }}</Col>
-          <Col span="4" class-name="tables">
+          <!-- <Col span="4" class-name="tables">
             单据类型
             <span class="mustSpan">*</span>
           </Col>
           <Col
             span="4"
             class-name="tables"
-          >{{ form.djlx == "" ? "" : djlxList.filter(a => a.value == form.djlx)[0].label }}</Col>
+          >{{ form.djlx == "" ? "" : djlxList.filter(a => a.value == form.djlx)[0].label }}</Col>-->
           <Col span="4" class-name="tables">下单时间</Col>
           <Col span="4" class-name="tables">{{ form.xdsj }}</Col>
           <Col span="4" class-name="tables">收货人</Col>
@@ -83,6 +83,8 @@
           </Col>
           <Col span="4" class-name="tables"></Col>
           <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables"></Col>
         </Row>
         <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
           <Col span="4" class-name="upl">附件</Col>
@@ -115,6 +117,7 @@ import {
   queryPurchaseSettlementInfo
 } from "@/service/getData";
 export default {
+  name: "balance",
   data() {
     return {
       balanceType: "add",
@@ -202,19 +205,19 @@ export default {
     };
   },
   created() {
-    if(this.$route.query.param){
+    if (this.$route.query.param) {
       this.getJs();
-    }else{
-      this.getInfo()
+    } else {
+      this.getInfo();
     }
     getLabelByCode4Purchase({ dictCode: "billType" }).then(res => {
       this.djlxList = res.data;
     });
   },
   methods: {
-    getInfo(){
-      queryPurchaseSettlementInfo(this.$route.query.id).then(res=>{
-          if (res.status == 200) {
+    getInfo() {
+      queryPurchaseSettlementInfo(this.$route.query.id).then(res => {
+        if (res.status == 200) {
           let data = res.data;
           this.form.bt = data.title;
           this.form.glqy = data.areaName;
@@ -245,7 +248,7 @@ export default {
         } else {
           this.$Message.error(res.message);
         }
-      })
+      });
     },
     //表单上传
     beforeUpload() {},

+ 18 - 14
src/page/purchaseView/order.vue

@@ -28,11 +28,11 @@
             <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">{{form.glxm}}</Col>
-          <Col span="4" class-name="tables">
+          <!-- <Col span="4" class-name="tables">
             单据类型
             <span class="mustSpan">*</span>
           </Col>
-          <Col span="4" class-name="tables">{{ form.djlx }}</Col>
+          <Col span="4" class-name="tables">{{ form.djlx }}</Col>-->
           <Col span="4" class-name="tables">采购人</Col>
           <Col span="4" class-name="tables">{{ form.cgr }}</Col>
           <Col span="4" class-name="tables">
@@ -95,6 +95,8 @@
             <span v-if="form.ddzt == '5'">已入库</span>
             <span v-if="form.ddzt == '6'">已取消</span>
           </Col>
+          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables"></Col>
         </Row>
         <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
           <Col span="4" class-name="upl">附件</Col>
@@ -146,6 +148,7 @@ import {
   findPurchaseOrder
 } from "@/service/getData";
 export default {
+  name: "order",
   data() {
     return {
       orderType: "add",
@@ -309,10 +312,10 @@ export default {
     };
   },
   created() {
-    if(this.$route.query.id){
-      console.log(666)
-      this.getInfo()
-    }else{
+    if (this.$route.query.id) {
+      console.log(666);
+      this.getInfo();
+    } else {
       this.getCgddXq();
     }
   },
@@ -330,12 +333,11 @@ export default {
         fileDetailType: ""
       });
     },
-    getInfo(){
+    getInfo() {
       findPurchaseOrder({
-          orderId:this.$route.query.id
-        })
-        .then(res=>{
-          if (res.status == 200) {
+        orderId: this.$route.query.id
+      }).then(res => {
+        if (res.status == 200) {
           let data = res.data;
           let tableArr = [];
           this.form.dgbh = data.orderCode;
@@ -391,7 +393,8 @@ export default {
             let total = 0;
             let arr = [];
             for (let item in this.tableData) {
-              total += this.tableData[item].price * this.tableData[item].purchaseNum;
+              total +=
+                this.tableData[item].price * this.tableData[item].purchaseNum;
               arr.push(this.tableData[item].applyRuleCode);
             }
             this.form.totalPrice = total.toFixed(2);
@@ -420,7 +423,7 @@ export default {
           let tableArr = [];
           this.form.dgbh = data.orderCode;
           this.form.bt = data.title;
-          this.form.glqy =  data.areaName;
+          this.form.glqy = data.areaName;
           this.form.glxm = data.projectName;
           this.form.djlx = data.typeName;
           this.form.cgr = data.purchaserName;
@@ -471,7 +474,8 @@ export default {
             let total = 0;
             let arr = [];
             for (let item in this.tableData) {
-              total += this.tableData[item].price * this.tableData[item].purchaseNum;
+              total +=
+                this.tableData[item].price * this.tableData[item].purchaseNum;
               arr.push(this.tableData[item].applyRuleCode);
             }
             this.form.totalPrice = total.toFixed(2);

+ 8 - 7
src/page/purchaseView/plan.vue

@@ -78,7 +78,7 @@
           <template slot-scope="{ row, index }" slot="linkedPersonName">
             <span>{{ row.linkedPersonName }}</span>
           </template>
-          <template slot-scope="{ row, index }" slot="billType">{{ row.billTypeName }}</template>
+          <!-- <template slot-scope="{ row, index }" slot="billType">{{ row.billTypeName }}</template> -->
           <template slot-scope="{ row, index }" slot="referenceTotalPrice">
             <span>{{ row.amount * row.referencePrice }}</span>
           </template>
@@ -100,6 +100,7 @@ import {
   queryPurchaseApplyInfo
 } from "@/service/getData";
 export default {
+  name: "plan",
   data() {
     return {
       id: "",
@@ -209,12 +210,12 @@ export default {
           tooltip: "true"
           // width: 100
         },
-        {
-          title: "单据类型",
-          slot: "billType",
-          tooltip: "true"
-          // width: 100
-        },
+        // {
+        //   title: "单据类型",
+        //   slot: "billType",
+        //   tooltip: "true"
+        //   // width: 100
+        // },
         {
           title: "计划到货时间",
           slot: "arriveTime",

+ 4 - 0
src/service/getData.js

@@ -39,6 +39,10 @@ export const accountLogin = (data) => fetch('/rest/userInfo/qpiUserLogin', '/mkf
 
 export const getFunctionButtons2 = (data) => fetch(`/rest/postInfo/getFunctionButtons2`, '/landcrm', data, 'FORMDATA', 'POST');
 
+//按钮 -------------------------
+
+export const getUserButtons = (data) => fetch(`/rest/postInfo/getUserButtons`, '/landcrm', data, 'JSON', 'POST');
+
 //------------------------------i
 
 //字典