simple 5 年之前
父節點
當前提交
67490f11a2

+ 1 - 1
config/dev/zhongtongfu.js

@@ -84,7 +84,7 @@ let serverConfig = {
 }
 
 var findServer = function(serverName) {
-  debugger
+  // debugger
   console.log(serverName);
 	return serverConfig[serverName].addr + serverConfig[serverName].path;
 }

+ 0 - 1
config/download.js

@@ -3,7 +3,6 @@ const prodServer = require('./prod/' + project + '.js'); //服务信息
 
 export default (url = '', baseUrl='', data = {},dataType = 'JSON', type = 'GET', requestType='FORMDATA') => {
   var html = '<div class="ivu-spin-fullscreen ivu-spin-fullscreen-wrapper"><div class="ivu-spin ivu-spin-fix ivu-spin-show-text ivu-spin-fullscreen"><div class="ivu-spin-main"><span class="ivu-spin-dot"></span> <div class="ivu-spin-text"><div><i class="ivu-icon ivu-icon-load-c demo-spin-icon-load" style="font-size: 18px;"></i><div>Loading</div></div></div></div></div></div>'
-  debugger
 	$('#app').append(html);
 	type = type.toUpperCase();
 	if(process.env.NODE_ENV === 'development'){

+ 2 - 1
config/fetch.js

@@ -153,7 +153,8 @@ export default async(url = '',baseUrl='',data = {},dataType = 'JSON', type = 'GE
         dataType: "json",
         cache: false,//上传文件无需缓存
 	      processData: false,//用于对data参数进行序列化处理 这里必须false
-	      contentType: false, //必须
+        // contentType: "application/x-www-form-urlencoded", //必须
+        ContentType: "application/x-www-form-urlencoded"
       };
     }
 

+ 10 - 1
config/index.js

@@ -155,9 +155,18 @@ module.exports = {
           '^/file': '/'
         }
       },
+      "/hajwy": { //采购结算明细对接
+        target: 'https://test.hajwy.com/qpi/rest',
+        secure: false,
+        changeOrigin: true,
+        pathRewrite: {
+          '^/hajwy': '/'
+        }
+      },
       "/purchase": { //采购供应商管理测试
         //target: "http://www.jihengcc.cn:17080/purchase", //采购供应商管理测试
-        target: "http://172.18.1.40:8080/purchase", //采购供应商管理测试
+        //target: "http://172.18.1.40:8888/purchase", //采购供应商管理测试
+        target: "http://172.18.1.253:8888/purchase",
         secure: false,
         changeOrigin: true,
         pathRewrite: {

+ 268 - 66
src/page/purchase/components/balance/balanceAdd.vue

@@ -5,20 +5,21 @@
       <Card style="width:100%" :bordered="false" :dis-hover="true">
         <p slot="title">采购结算详情</p>
         <div slot="extra">
-          <Button>保存</Button>
+          <Button @click="addJs">保存</Button>
           <Button>提交</Button>
-          <Button @click="$emit('return')">取消</Button>
+          <Button @click="cancel">取消</Button>
         </div>
         <Row class="mainCont">
           <Col span="4" class-name="tables">结算申请编号</Col>
-          <Col span="4" class-name="tables">计算属性</Col>
+          <Col span="4" class-name="tables">{{ form.jssqbh == "" ? "新增成功之后生成" : form.jssqbh }}</Col>
           <Col span="4" class-name="tables">标题</Col>
-          <Col span="12" class-name="tables">
-            <Input v-model="form.bt" placeholder="请输入" style="width: 99%" />
+          <Col span="12" class-name="tables">{{ form.bt == "" ? "新增成功之后生成" : form.bt }}</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">
-            <Select v-model="form.glqy" style="width: 95%">
+            <Select v-model="form.glqy" :disabled="balanceType == 'edit'" style="width: 95%">
               <Option
                 v-for="item in glqyList"
                 :value="item.value"
@@ -26,9 +27,12 @@
               >{{ item.label }}</Option>
             </Select>
           </Col>
-          <Col span="4" class-name="tables">关联项目</Col>
           <Col span="4" class-name="tables">
-            <Select v-model="form.glxm" style="width: 95%">
+            关联项目
+            <span class="mustSpan">*</span>
+          </Col>
+          <Col span="4" class-name="tables">
+            <Select v-model="form.glxm" :disabled="balanceType == 'edit'" style="width: 95%">
               <Option
                 v-for="item in glxmList"
                 :value="item.value"
@@ -38,7 +42,10 @@
           </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">
+            供应商
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Select v-model="form.gys" style="width: 95%">
               <Option v-for="item in gysList" :value="item.value" :key="item.value">{{ item.label }}</Option>
@@ -58,15 +65,24 @@
               >{{ item.label }}</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">
             <Input v-model="form.khh" 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="form.zh" 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">
             <Select v-model="form.djlx" style="width: 95%">
               <Option
@@ -77,22 +93,31 @@
             </Select>
           </Col>
           <Col span="4" class-name="tables">下单时间</Col>
-          <Col span="4" class-name="tables">系统带出,不可编辑</Col>
+          <Col span="4" class-name="tables">{{ form.xdsj == "" ? "新增成功之后生成" : form.xdsj }}</Col>
           <Col span="4" class-name="tables">收货人</Col>
           <Col span="4" class-name="tables">
             <Input v-model="form.shr" placeholder="请输入" style="width: 95%" />
           </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>
+          <Col span="4" class-name="tables">
+            总价(元)
+            <span class="mustSpan">*</span>
+          </Col>
+          <Col span="4" class-name="tables">{{ form.total }}</Col>
           <Col span="4" class-name="tables">调整金额(元)</Col>
           <Col span="4" class-name="tables">
             <Input v-model="form.tzje" placeholder="请输入" style="width: 95%" />
           </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">
+            实际支付金额(元)
+            <span class="mustSpan">*</span>
+          </Col>
+          <Col span="4" class-name="tables">{{ Number(form.total) + Number(form.tzje) }}</Col>
+          <Col span="4" class-name="tables">
+            申请人
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Select v-model="form.sqr" style="width: 95%">
               <Option v-for="item in sqrList" :value="item.value" :key="item.value">{{ item.label }}</Option>
@@ -100,7 +125,12 @@
           </Col>
           <Col span="4" class-name="tables">审批状态</Col>
           <Col span="4" class-name="tables">
-            系统带出,不可编辑
+            <div>
+              <span v-if="form.spzt == '1'">未提交</span>
+              <span v-if="form.spzt == '2'">审核中</span>
+              <span v-if="form.spzt == '3'">审核通过</span>
+              <span v-if="form.spzt == '4'">审核拒绝</span>
+            </div>
           </Col>
           <Col span="4" class-name="tables"></Col>
           <Col span="4" class-name="tables"></Col>
@@ -127,7 +157,7 @@
           </Col>
           <Col span="10" class="upl" style="padding: 5px">
             <div v-for="(item, index) in form.filesList" :key="index">
-              <a href="javascript:;">{{ item.fullName }}</a>
+              <a href="javascript:;">{{ item.fileName }}</a>
               <span style="float: right; cursor:pointer" @click="form.filesList.splice(index, 1)">x</span>
             </div>
             <p v-if="uploading" style="text-align: center">上传中...</p>
@@ -144,29 +174,35 @@
       <Card style="width:100%" :bordered="false" :dis-hover="true">
         <p slot="title">结算明细</p>
         <div slot="extra">
-          <Button type="primary" @click="contentShow = false">新增明细</Button>
+          <Button type="primary" :disabled="balanceType == 'add'" @click="addMxShow">新增明细</Button>
         </div>
-        <Table
-          :columns="tableColumn"
-          style="width: 100%"
-          :data="tableData"
-          :loading="tableLoading"
-          @on-select="tableOnSelect"
-        >
+        <Table :columns="tableColumn" style="width: 100%" :data="tableData" :loading="tableLoading">
           <template slot-scope="{ row, index }" slot="cz">
             <div>
-              <a href="javascript:;">删除</a>
+              <a href="javascript:;" @click="deleteMx(row, index)">删除</a>
             </div>
           </template>
         </Table>
       </Card>
     </div>
     <!-- 采购明细新增 -->
-    <balanceMxAdd @return="contentShow = true" v-show="!contentShow" />
+    <balanceMxAdd
+      ref="mxAdd"
+      :ssxmList="glqyList"
+      @addMx="addMx"
+      @return="contentShow = true"
+      v-show="!contentShow"
+    />
   </div>
 </template>
 
 <script>
+import {
+  addPurchaseSettlement,
+  queryPurchaseSettlementInfo,
+  editPurchaseSettlement,
+  selectGoodProviderSelectionList
+} from "@/service/getData";
 import balanceMxAdd from "./balanceMxAdd";
 export default {
   components: {
@@ -174,9 +210,12 @@ export default {
   },
   data() {
     return {
+      balanceType: "add",
+      settlementId: "",
       spinShow: true,
       contentShow: true,
       form: {
+        jssqbh: "", //结算申请编号
         bt: "", //标题
         glqy: "", //关联区域
         glxm: "", //关联项目
@@ -188,16 +227,19 @@ export default {
         djlx: "", //单据类型
         shr: "", //收货人
         tzje: "", //调整金额
+        xdsj: "", //下单时间
         sqr: "", //申请人
+        spzt: 1, //审批状态
         sm: "", //说明
+        total: 0, //总价
         filesList: []
       },
-      glqyList: [],
-      glxmList: [],
-      gysList: [],
-      gyslxdhList: [],
-      djlxList: [],
-      sqrList: [],
+      glqyList: [{ value: 1, label: "test" }],
+      glxmList: [{ value: 1, label: "test" }],
+      gysList: [{ value: 1, label: "test" }],
+      gyslxdhList: [{ value: 1, label: "test" }],
+      djlxList: [{ value: 1, label: "test" }],
+      sqrList: [{ value: 1, label: "test" }],
       uploading: false,
       // 批量设置
       plszShow: false,
@@ -205,51 +247,45 @@ export default {
       pldhsj: "",
       // table
       tableColumn: [
-        {
-          type: "selection",
-          width: 60,
-          align: "center",
-          fixed: "left"
-        },
         {
           title: "入库单",
-          key: "rkd",
-          tooltip: "true",
+          key: "warehouseEntry",
+          tooltip: "true"
         },
         {
           title: "总价(元)",
-          key: "zj",
-          tooltip: "true",
+          key: "totalPrice",
+          tooltip: "true"
         },
         {
           title: "采购人",
-          key: "cgr",
-          tooltip: "true",
+          key: "purchaserName",
+          tooltip: "true"
         },
         {
           title: "采购人联系方式",
-          key: "cgrlxfs",
-          tooltip: "true",
+          key: "purchaserTel",
+          tooltip: "true"
         },
         {
           title: "下单时间",
-          key: "xdsj",
-          tooltip: "true",
+          key: "orderTime",
+          tooltip: "true"
         },
         {
           title: "入库时间",
-          key: "rksj",
-          tooltip: "true",
+          key: "storehouseTime",
+          tooltip: "true"
         },
         {
           title: "入库仓库",
-          key: "rkck",
-          tooltip: "true",
+          key: "storehouseName",
+          tooltip: "true"
         },
         {
           title: "仓管员",
-          key: "cgy",
-          tooltip: "true",
+          key: "warehouseKeeper",
+          tooltip: "true"
         },
         {
           title: "操作",
@@ -266,6 +302,9 @@ export default {
   },
   created() {
     this.getTableData();
+    selectGoodProviderSelectionList().then(res => {
+      console.log(res);
+    })
   },
   methods: {
     //批量设置弹窗
@@ -282,26 +321,188 @@ export default {
     uploadFilesSuccess(response, file, fileList) {
       this.uploading = false;
       this.form.filesList.push({
-        fileName: response.fileInfo.fileName,
-        fullName: response.fileInfo.fName,
-        resPath: response.fileInfo.resPath,
-        fileDetailType: ""
+        fileName: response.fileInfo.fName,
+        // fullName: response.fileInfo.fName,
+        filePath: response.fileInfo.resPath
+        // fileDetailType: ""
       });
     },
+    //查询结算详情
+    getJs(settlementId) {
+      this.spinShow = true;
+      queryPurchaseSettlementInfo(settlementId).then(res => {
+        this.spinShow = false;
+        if (res.status == 200) {
+          let data = res.data;
+          this.form.glqy = Number(data.areaId);
+          this.form.glxm = Number(data.projectId);
+          this.form.gys = Number(data.supplierId);
+          this.form.gffzr = data.supplierPrincipal;
+          this.form.gyslxdh = Number(data.supplierTel);
+          this.form.khh = data.depositBank;
+          this.form.zh = data.accountNumber;
+          this.form.djlx = data.type;
+          this.form.shr = data.receivedName;
+          this.form.spzt = data.approvalState;
+          this.form.sqr = Number(data.applicantId);
+          this.form.xdsj = data.orderTime;
+          this.form.jssqbh = data.settlementCode;
+          this.form.sm = data.instruction;
+          this.balanceType = "edit";
+          this.form.filesList = data.attachmentList;
+          this.tableData = data.detailList;
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+    },
+    //编辑结算详情
+    editJs() {
+      let postData = {
+        settlementId: this.settlementId,
+        areaId: this.form.glqy,
+        areaName: this.glqyList.filter(a => a.value == this.form.glqy)[0].label,
+        supplierId: this.form.gys,
+        supplierPrincipal: this.form.gffzr,
+        supplierTel: this.form.gyslxdh,
+        depositBank: this.form.khh,
+        accountNumber: this.form.zh,
+        type: this.form.djlx,
+        receivedName: this.form.shr,
+        adjustmentPrice: this.form.tzje,
+        instruction: this.form.sm,
+        attachmentList: this.form.filesList,
+        applicantId: this.form.sqr,
+        applicantName: this.sqrList.filter(a => a.value == this.form.sqr)[0]
+          .label,
+        attachmentList: this.form.filesList,
+        detailList: this.tableData
+      };
+      // console.log(postData);
+      editPurchaseSettlement(postData).then(res => {
+        if (res.status == 200) {
+          this.$Message.success("编辑结算详情成功!");
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+    },
+    //新增结算
+    addJs() {
+      if (this.balanceType == "edit") {
+        this.editJs();
+        return false;
+      }
+      let mArr = ["glqy", "glxm", "gys", "khh", "zh", "djlx", "sqr"];
+      for (let item in mArr) {
+        let it = mArr[item];
+        if (this.form[it] == "" || this.form[it].length == 0) {
+          this.$Message.error("请将信息填写完整!");
+          return false;
+        }
+      }
+      let postData = {
+        areaId: this.form.glqy,
+        projectId: this.form.glxm,
+        areaName: this.glqyList.filter(a => a.value == this.form.glqy)[0].label,
+        projectName: this.glxmList.filter(a => a.value == this.form.glxm)[0]
+          .label,
+        supplierId: this.form.gys,
+        supplierPrincipal: this.form.gffzr,
+        supplierTel: this.form.gyslxdh,
+        depositBank: this.form.khh,
+        accountNumber: this.form.zh,
+        type: this.form.djlx,
+        receivedName: this.form.shr,
+        // recivedTel: this,
+        adjustmentPrice: Number(this.form.tzje),
+        instruction: this.form.sm,
+        projectCode: "1234",
+        attachmentList: this.form.filesList,
+        applicantId: this.form.sqr,
+        applicantName: this.sqrList.filter(a => a.value == this.form.sqr)[0]
+          .label
+      };
+      addPurchaseSettlement(postData).then(res => {
+        if (res.status == 200) {
+          this.$Message.success("新增采购结算成功");
+          this.form.jssqbh = res.data.settlementCode;
+          this.form.xdsj = res.data.orderTime;
+          this.settlementId = res.data.settlementId;
+          this.balanceType = "edit";
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+    },
+    // 新增明细弹窗
+    addMxShow() {
+      this.contentShow = false;
+      this.$refs.mxAdd.gysId = this.form.gys;
+      this.$refs.mxAdd.getTableData();
+    },
     //列表方法
     getTableData() {
       this.spinShow = false;
     },
     tableOnSelect(selection, row) {},
+    //添加明细
+    addMx(list) {
+      for (let item in list) {
+        list[item].orderTime += " 00:00:00";
+        list[item].storehouseTime += " 00:00:00";
+      }
+      this.tableData = list;
+    },
+    //删除明细
+    deleteMx(row, index) {
+      this.tableData.splice(index, 1);
+    },
     //取消、返回
     cancel() {
-      this.spinShow = true;
+      this.spinShow = false;
+      this.balanceType = "add";
+      this.form = {
+        jssqbh: "", //结算申请编号
+        bt: "", //标题
+        glqy: "", //关联区域
+        glxm: "", //关联项目
+        gys: "", //供应商
+        gffzr: "", //供方负责人
+        gyslxdh: "", //供应商联系电话
+        khh: "", //开户行
+        zh: "", //账号
+        djlx: "", //单据类型
+        shr: "", //收货人
+        tzje: "", //调整金额
+        xdsj: "", //下单时间
+        sqr: "", //申请人
+        spzt: 1, //审批状态
+        sm: "", //说明
+        total: 0, //总价
+        filesList: []
+      };
+      this.tableData = [];
+      this.$emit("return");
+    }
+  },
+  watch: {
+    tableData(val) {
+      let num = 0;
+      for (let item in val) {
+        num += val[item].totalPrice;
+      }
+      this.form.total = num;
     }
   }
 };
 </script>
 
 <style lang="scss" scoped>
+.mustSpan {
+  color: red;
+  margin-left: 2px;
+}
 button {
   min-width: 80px;
 }
@@ -328,8 +529,9 @@ button {
   height: 50px;
   border-right: 1px solid #e4e4e4;
   border-bottom: 1px solid #e4e4e4;
-  line-height: 50px;
-  text-align: center;
+  display: flex;
+  align-items: center;
+  justify-content: center;
   &:nth-child(2n + 1) {
     background: #f8f9fb;
   }

+ 68 - 20
src/page/purchase/components/balance/balanceMxAdd.vue

@@ -7,7 +7,14 @@
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
-          <Input v-model="addForm.xmmc" placeholder="项目名称" :disabled="true" style="width: 95%" />
+          <Select v-model="addForm.ssxm" placeholder="项目名称" style="width: 95%">
+            <Option
+              disabled
+              v-for="item in ssxmList"
+              :value="item.value"
+              :key="item.value"
+            >{{ item.label }}</Option>
+          </Select>
         </Col>
         <Col span="4">
           <DatePicker
@@ -31,8 +38,8 @@
           <Input v-model="addForm.rkd" placeholder="入库单" style="width: 95%" />
         </Col>
         <Col span="8">
-          <Button type="primary" style="width: 80px">查询</Button>
-          <Button type="primary" style="width: 80px">添加</Button>
+          <Button type="primary" style="width: 80px" @click="getTableData">查询</Button>
+          <Button type="primary" style="width: 80px" @click="addMx">添加</Button>
         </Col>
       </Row>
       <Table
@@ -41,6 +48,9 @@
         :data="tableData"
         :loading="tableLoading"
         @on-select="tableOnSelect"
+        @on-select-cancel="tableOnCancel"
+        @on-select-all="tableOnSelect"
+        @on-select-all-cancel="tableOnCancel"
       >
         <template slot-scope="{ row, index }" slot="action">
           <div>
@@ -56,14 +66,17 @@
 </template>
 
 <script>
+import { hajwySettlementList } from "@/service/getData";
 export default {
+  props: ["ssxmList"],
   data() {
     return {
+      gysId: "",
       //新增结算明细表单
       addForm: {
-        xmmc: "", //项目名称
-        xdsj: "", //下单时间
-        rksj: "", //入库时间
+        ssxm: "", //项目名称
+        xdsj: ["", ""], //下单时间
+        rksj: ["", ""], //入库时间
         rkd: "" //入库单
       },
       //表格查询内容
@@ -90,53 +103,52 @@ export default {
         {
           type: "selection",
           width: 60,
-          align: "center",
-          fixed: "left"
+          align: "center"
         },
         {
           title: "入库单",
-          key: "rkd",
+          key: "warehouseEntry",
           tooltip: "true"
         },
         {
           title: "物料名称",
-          key: "wlmc",
+          key: "sgNames",
           tooltip: "true"
         },
         {
           title: "总价(元)",
-          key: "zj",
+          key: "totalPrice",
           tooltip: "true"
         },
         {
           title: "采购人",
-          key: "cgr",
+          key: "purchaserName",
           tooltip: "true"
         },
         {
           title: "采购人联系方式",
-          key: "cgrlxfs",
+          key: "purchaserTel",
           tooltip: "true"
         },
         {
           title: "下单时间",
-          key: "xdsj",
+          key: "orderTime",
           tooltip: "true"
         },
         {
           title: "入库时间",
-          key: "rksj",
+          key: "storehouseTime",
           tooltip: "true"
         },
         {
           title: "入库仓库",
-          key: "rkck",
+          key: "storehouseName",
           tooltip: "true"
         },
         {
           title: "仓管员",
-          key: "cgy",
-          tooltip: "true",
+          key: "warehouseKeeper",
+          tooltip: "true"
         }
       ],
       tableData: [],
@@ -145,8 +157,44 @@ export default {
   },
   methods: {
     //列表方法
-    getTableData() {},
-    tableOnSelect(selection, row) {}
+    getTableData() {
+      let postData = {
+        // projectId: this.addForm.ssxm,
+        projectId: 10,
+        orderTimeStart: this.addForm.xdsj[0],
+        orderTimeEnd: this.addForm.xdsj[1],
+        storehouseTimeStart: this.addForm.rksj[0],
+        storehouseTimeEnd: this.addForm.rksj[1],
+        warehouseEntry: this.addForm.rkd,
+        supplierId: this.gysId
+      };
+      let postStr = "";
+      for (let item in postData) {
+        if (postData[item] == "") {
+        } else {
+          postStr += `${item}=${postData[item]}&`;
+        }
+      }
+      postStr = postStr.replace(/\&$/, "");
+      this.tableLoading = true;
+      hajwySettlementList(postStr).then(res => {
+        this.tableLoading = false;
+        if (res.status == 200) {
+          this.tableData = res.data;
+        }
+      });
+    },
+    tableOnSelect(selection, row) {
+      this.tableSelect = selection;
+    },
+    tableOnCancel(selection, row) {
+      this.tableSelect = selection;
+    },
+    //添加明细
+    addMx() {
+      this.$emit("addMx", this.tableSelect);
+      this.$emit("return");
+    }
   }
 };
 </script>

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

@@ -0,0 +1,169 @@
+<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>
+        </div>
+        <table border="1">
+          <thead>
+            <tr>
+              <th>结算申请编号</th>
+              <th>标题</th>
+              <th>总价(元)</th>
+              <th>供应商编码</th>
+              <th>供应商名称</th>
+              <th>联系人</th>
+              <th>联系电话</th>
+              <th>申请人</th>
+              <th>下单时间</th>
+              <th>入库时间</th>
+              <th>所属区域</th>
+              <th>所属项目</th>
+              <th>创建时间</th>
+              <th>创建人</th>
+              <th>审核状态</th>
+              <th>入库单号</th>
+              <th>入库总价(元)</th>
+              <th>采购人</th>
+              <th>采购人联系方式</th>
+              <th>入库仓库</th>
+              <th>仓管员</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr v-for="item in printData" :key="item.settlementCode">
+              <td>{{ item.settlementCode }}</td>
+              <td>{{ item.title }}</td>
+              <td>{{ item.totalPrice }}</td>
+              <td>{{ item.supplierId }}</td>
+              <td>{{ item.supplierPrincipal }}</td>
+              <td>{{ item.supplierPrincipal }}</td>
+              <td>{{ item.supplierTel }}</td>
+              <td>{{ item.applicantName }}</td>
+              <td>{{ item.orderTime }}</td>
+              <td>{{ item.storehouseTime }}</td>
+              <td>{{ item.areaName }}</td>
+              <td>{{ item.projectName }}</td>
+              <td>{{ item.createTime }}</td>
+              <td>{{ item.creator }}</td>
+              <td>
+                <span v-if="item.approvalState == '1'">未提交</span>
+                <span v-if="item.approvalState == '2'">审核中</span>
+                <span v-if="item.approvalState == '3'">审核通过</span>
+                <span v-if="item.approvalState == '4'">审核拒绝</span>
+              </td>
+              <td>{{ item.warehouseEntry }}</td>
+              <td>{{ item.detailTotalPrice }}</td>
+              <td>{{ item.purchaserName }}</td>
+              <td>{{ item.purchaserTel }}</td>
+              <td>{{ item.storehouseName }}</td>
+              <td>{{ item.warehouseKeeper }}</td>
+            </tr>
+          </tbody>
+        </table>
+        <Row>
+          <Col :span="12" class="foot">下单日期:</Col>
+          <Col :span="12" class="foot">审核日期:</Col>
+        </Row>
+      </div>
+    </Card>
+  </div>
+</template>
+
+<script>
+import { printPurchaseSettlementDetailVO } from "@/service/getData";
+export default {
+  data() {
+    return {
+      settlementId: "",
+      printData: []
+    };
+  },
+  methods: {
+    getPrintData(id) {
+      printPurchaseSettlementDetailVO(id).then(res => {
+        if (res.status == 200) {
+          this.printData = res.data;
+        }
+      });
+    }
+  }
+};
+</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: 35px;
+      letter-spacing: 15px;
+    }
+    p {
+      font-size: 18px;
+    }
+  }
+  .line {
+    height: 1px;
+    background: #000;
+    margin-bottom: 3px;
+  }
+  .infor {
+    line-height: 30px;
+  }
+  .foot {
+    line-height: 40px;
+    text-align: center;
+  }
+  table {
+    margin-top: 5px;
+    th,
+    td {
+      text-align: center;
+      height: 30px;
+      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>

+ 79 - 30
src/page/purchase/components/order/orderAdd.vue

@@ -221,28 +221,28 @@
           :loading="tableLoading"
           @on-select="tableOnSelect"
         >
-          <template slot-scope="{ row, index }" slot="cgsl">
-            <Input v-model="tableData[index].cgsl" placeholder="请输入" style="width: 95%" />
+          <template slot-scope="{ row, index }" slot="purchaseNum">
+            <Input v-model="tableData[index].purchaseNum" placeholder="请输入" style="width: 95%" />
           </template>
-          <template slot-scope="{ row, index }" slot="dj">
-            <Input v-model="tableData[index].dj" placeholder="请输入" style="width: 95%" />
+          <template slot-scope="{ row, index }" slot="price">
+            <Input v-model="tableData[index].price" placeholder="请输入" style="width: 95%" />
           </template>
           <template slot-scope="{ row, index }" slot="zj">
             <div>计算属性</div>
           </template>
-          <template slot-scope="{ row, index }" slot="jhdhsj">
+          <template slot-scope="{ row, index }" slot="plannedArrivalTime">
             <DatePicker
               :transfer="true"
-              format="yyyy-MM-dd"
-              type="date"
-              :value="tableData[index].jhdhsj"
-              @on-change="tableData[index].jhdhsj=$event"
+              format="yyyy-MM-dd HH:mm:ss"
+              type="datetime"
+              :value="tableData[index].plannedArrivalTime"
+              @on-change="tableData[index].plannedArrivalTime=$event"
               placeholder="请选择"
               style="width: 95%"
             ></DatePicker>
           </template>
-          <template slot-scope="{ row, index }" slot="slgk">
-            <RadioGroup v-model="tableData[index].slgk">
+          <template slot-scope="{ row, index }" slot="isNumControl">
+            <RadioGroup v-model="tableData[index].isNumControl">
               <Radio label="1">
                 <span>是</span>
               </Radio>
@@ -251,8 +251,8 @@
               </Radio>
             </RadioGroup>
           </template>
-          <template slot-scope="{ row, index }" slot="sjgk">
-            <RadioGroup v-model="tableData[index].sjgk">
+          <template slot-scope="{ row, index }" slot="isTimeControl">
+            <RadioGroup v-model="tableData[index].isTimeControl">
               <Radio label="1">
                 <span>是</span>
               </Radio>
@@ -297,7 +297,11 @@
 </template>
 
 <script>
-import { addPurchaseOrder, findPurchaseOrder } from "@/service/getData";
+import {
+  addPurchaseOrder,
+  findPurchaseOrder,
+  editPurchaseOrder
+} from "@/service/getData";
 import orderMxAdd from "./orderMxAdd";
 export default {
   components: {
@@ -357,61 +361,61 @@ export default {
         },
         {
           title: "申购计划",
-          key: "sgjh",
+          key: "code",
           tooltip: "true",
           width: 100
         },
         {
           title: "物料编码",
-          key: "wlbm",
+          key: "materialCode",
           tooltip: "true",
           width: 100
         },
         {
           title: "物料分类",
-          key: "wlfl",
+          key: "firstClassName",
           tooltip: "true",
           width: 100
         },
         {
           title: "物料名称",
-          key: "wlmc",
+          key: "materialName",
           tooltip: "true",
           width: 100
         },
         {
           title: "品牌",
-          key: "pp",
+          key: "brandName",
           tooltip: "true",
           width: 100
         },
         {
           title: "规格型号",
-          key: "ggxh",
+          key: "specs",
           tooltip: "true",
           width: 100
         },
         {
           title: "单位",
-          key: "dw",
+          key: "unit",
           tooltip: "true",
           width: 100
         },
         {
           title: "计划数量",
-          key: "jhsl",
+          key: "amount",
           tooltip: "true",
           width: 100
         },
         {
           title: "已下订数量",
-          slot: "yxdsl",
+          slot: "billedAmount",
           tooltip: "true",
           width: 100
         },
         {
           title: "累计入库数量",
-          key: "ljrksl",
+          key: "noBilledAmout",
           tooltip: "true",
           width: 120
         },
@@ -423,13 +427,13 @@ export default {
         },
         {
           title: "采购数量",
-          slot: "cgsl",
+          slot: "purchaseNum",
           tooltip: "true",
           width: 100
         },
         {
           title: "单价(元)",
-          slot: "dj",
+          slot: "price",
           tooltip: "true",
           width: 100
         },
@@ -447,19 +451,19 @@ export default {
         },
         {
           title: "计划到货时间",
-          slot: "jhdhsj",
+          slot: "plannedArrivalTime",
           tooltip: "true",
           width: 150
         },
         {
           title: "数量管控",
-          slot: "slgk",
+          slot: "isNumControl",
           tooltip: "true",
           width: 100
         },
         {
           title: "时间管控",
-          slot: "sjgk",
+          slot: "isTimeControl",
           tooltip: "true",
           width: 100
         },
@@ -500,6 +504,7 @@ export default {
         fileDetailType: ""
       });
     },
+    //获取采购订单详情
     getCgddXq(id) {
       this.orderId = id;
       let postData = {
@@ -510,6 +515,7 @@ export default {
         this.spinShow = false;
         if (res.status == 200) {
           let data = res.data;
+          let tableArr = [];
           this.form.dgbh = data.orderCode;
           this.form.bt = data.title;
           this.form.glqy = data.areaId + "," + data.areaName;
@@ -528,14 +534,54 @@ export default {
           this.form.ddzt = data.orderState;
           this.form.gysmc = data.gpName;
           this.orderType = "edit";
+          for (let item in data.detailList) {
+            
+          }
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+    },
+    //编辑采购订单
+    editCgdd() {
+      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: this.form.cgr.split(",")[0],
+        purchaserName: this.form.cgr.split(",")[1],
+        purchaserTel: this.form.cgrlxfs,
+        receivedName: this.form.shr,
+        receivedTel: this.form.shrlxfs,
+        orderTime: this.form.xdrq,
+        deliveryStartTime: this.form.jhsj[0],
+        deliveryEndTime: this.form.jhsj[1],
+        deliveryPlace: this.form.jhdd,
+        type: this.form.djlx,
+        instruction: this.form.sm,
+        attachmentList: this.form.filesList,
+        gpId: "1000574", //供应商ID
+        gpNmae: "", //供应商Name
+        orderId: this.orderId,
+        deleteId: "",
+        attachmentList: [],
+        detailList: []
+      };
+      editPurchaseOrder(postData).then(res => {
+        if (res.status == 200) {
+          this.$Message.success("编辑采购订单成功!");
         } else {
           this.$Message.error(res.message);
         }
       });
     },
-    editCgdd() {},
     //新增采购订单
     addCgdd() {
+      if (this.orderType == "edit") {
+        this.editCgdd();
+        return false;
+      }
       let postData = {
         areaId: this.form.glqy.split(",")[0],
         areaName: this.form.glqy.split(",")[1],
@@ -574,6 +620,9 @@ export default {
     mxAddShow() {
       this.contentShow = false;
       this.$refs.mxAdd.getTableData();
+      this.$refs.mxAdd.orderId = this.orderId;
+      this.$refs.mxAdd.approvalState = this.form.spzt;
+      this.$refs.mxAdd.orderState = this.form.ddzt;
     },
     //列表方法
     getTableData() {

+ 37 - 16
src/page/purchase/components/order/orderMxAdd.vue

@@ -26,7 +26,7 @@
         </Col>
         <Col span="8">
           <Button type="primary" style="width: 80px" @click="getTableData">查询</Button>
-          <Button type="primary">批量添加</Button>
+          <Button type="primary" @click="plAdd">批量添加</Button>
         </Col>
       </Row>
       <Table
@@ -35,6 +35,9 @@
         :data="tableData"
         :loading="tableLoading"
         @on-select="tableOnSelect"
+        @on-select-cancel="tableOnCancel"
+        @on-select-all="tableOnSelect"
+        @on-select-all-cancel="tableOnCancel"
       >
         <template slot-scope="{ row, index }" slot="action">
           <div>
@@ -55,6 +58,11 @@ import { queryPurchasePoolList } from "@/service/getData";
 export default {
   data() {
     return {
+      orderId: "",
+      approvalState: "",
+      orderState: "",
+      areaId: "",
+      type: "",
       //新增物料申请表单
       addForm: {
         ck: "", //仓库名
@@ -98,63 +106,63 @@ export default {
         },
         {
           title: "申购计划",
-          key: "sgjh",
+          key: "code",
           tooltip: "true"
         },
         {
           title: "物料编码",
-          key: "wlbm",
+          key: "materialCode",
           tooltip: "true"
         },
         {
           title: "物料分类",
-          key: "wlfl",
+          key: "firstClassName",
           tooltip: "true"
         },
         {
           title: "物料名称",
-          key: "wlmc",
+          key: "materialName",
           tooltip: "true"
         },
         {
           title: "品牌",
-          key: "pp",
+          key: "brandName",
           tooltip: "true"
         },
         {
           title: "型号规格",
-          key: "xhgg",
+          key: "specs",
           tooltip: "true"
         },
         {
           title: "单位",
-          key: "dw",
+          key: "unit",
           tooltip: "true"
         },
         {
           title: "库存量",
-          key: "kcl",
+          key: "inventory",
           tooltip: "true"
         },
         {
           title: "参考单价(元)",
-          key: "ckdj",
+          key: "referencePrice",
           tooltip: "true",
           width: 120
         },
         {
           title: "计划数量",
-          key: "jhsl",
+          key: "amount",
           tooltip: "true"
         },
         {
           title: "已下订数量",
-          key: "yxdsl",
+          key: "billedAmount",
           tooltip: "true"
         },
         {
           title: "可下订数量",
-          key: "kxdsl",
+          key: "noBilledAmout",
           tooltip: "true"
         }
       ],
@@ -170,20 +178,33 @@ export default {
         pageSize: 10,
         firstClassId: this.searchForm.yjfl,
         secondClassId: this.searchForm.ejfl,
-        areaIds: "",
+        areaIds: this.areaId,
         queryText1: this.searchForm.wlmc,
         queryText2: "",
         projectIds: "",
         storehouseId: this.searchForm.ck
       };
       queryPurchasePoolList(postData).then(res => {
-        console.log(res);
+        if (res.status == 200) {
+          this.tableData = res.data.records;
+          this.pageTotal = res.data.total;
+        }
       });
     },
     pageChange(val) {
       this.pageNum = val;
     },
-    tableOnSelect(selection, row) {}
+    tableOnSelect(selection, row) {
+      console.log(selection);
+      // let arr = [];
+      // for (let i = 0; i < selection.length; i++) {
+      // }
+    },
+    tableOnCancel(selection, row) {
+      console.log(selection);
+    },
+    //批量添加物料
+    plAdd() {}
   }
 };
 </script>

+ 121 - 49
src/page/purchase/purchaseBalance.vue

@@ -4,8 +4,8 @@
       <p slot="title">采购结算列表</p>
       <div slot="extra">
         <Button @click="addShow = true">新增采购结算</Button>
-        <Button>导出明细</Button>
-        <Button @click="printShow = true">打印---测试</Button>
+        <Button @click="exportData">导出明细</Button>
+        <!-- <Button @click="printShow = true">打印---测试</Button> -->
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
@@ -32,20 +32,12 @@
         </Col>
         <Col span="4">
           <Select v-model="searchForm.gys" placeholder="供应商">
-            <Option
-              v-for="item in gysList"
-              :value="item.value"
-              :key="item.value"
-            >{{ item.label }}</Option>
+            <Option v-for="item in gysList" :value="item.value" :key="item.value">{{ item.label }}</Option>
           </Select>
         </Col>
         <Col span="4">
-          <Select v-model="searchForm.sgr" placeholder="供应商">
-            <Option
-              v-for="item in sgrList"
-              :value="item.value"
-              :key="item.value"
-            >{{ item.label }}</Option>
+          <Select v-model="searchForm.sgr" placeholder="申购人">
+            <Option v-for="item in sgrList" :value="item.value" :key="item.value">{{ item.label }}</Option>
           </Select>
         </Col>
         <Col span="4">
@@ -59,22 +51,14 @@
         </Col>
         <Col span="4">
           <Select 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 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">
@@ -84,7 +68,7 @@
           <Input v-model="searchForm.jsbh" placeholder="结算申请编号或标题" />
         </Col>
         <Col span="4">
-          <Button type="primary" style="width: 80px">查询</Button>
+          <Button type="primary" style="width: 80px" @click="getTableData">查询</Button>
         </Col>
       </Row>
       <Table
@@ -95,24 +79,39 @@
         :loading="tableLoading"
         @on-select="tableOnSelect"
       >
+        <template slot-scope="{ row, index }" slot="approvalState">
+          <span v-if="row.approvalState == '1'">未提交</span>
+          <span v-if="row.approvalState == '2'">审核中</span>
+          <span v-if="row.approvalState == '3'">审核通过</span>
+          <span v-if="row.approvalState == '4'">审核拒绝</span>
+        </template>
         <template slot-scope="{ row, index }" slot="action">
           <div>
-            <a href="javascript:;">编辑</a>
-            <a href="javascript:;">删除</a>
-            <a href="javascript:;">打印</a>
+            <a href="javascript:;" @click="editRow(row)">编辑</a>
+            <a href="javascript:;" v-if="row.approvalState == '1'" @click="deleteRow(row)">删除</a>
+            <a href="javascript:;" @click="printRow(row)">打印</a>
           </div>
         </template>
       </Table>
       <Page align="right" :total="pageTotal" @on-change="pageChange" show-total />
     </Card>
-    <balanceAdd @return="addShow = false" v-show="addShow" />
-    <balancePrint @return="printShow = false" v-show="printShow" />
+    <balanceAdd ref="add" @return="() => {addShow = false ; getTableData()}" v-show="addShow" />
+    <balancePrint
+      ref="print"
+      @return="() => {printShow = false ; getTableData()} "
+      v-show="printShow"
+    />
   </div>
 </template>
 
 <script>
+import {
+  queryPurchaseSettlementList,
+  deletePurchaseSettlement,
+  exportPurchaseSettlementDetailVO
+} from "@/service/getData";
 import balanceAdd from "./components/balance/balanceAdd";
-import balancePrint from "./components/balance/balancePrint";
+import balancePrint from "./components/balance/newBPrint";
 export default {
   components: {
     balanceAdd,
@@ -130,13 +129,13 @@ export default {
       searchForm: {
         ssqy: [], //所属区域
         glxm: [], //关联项目
-        gys: "",//供应商
+        gys: "", //供应商
         sgr: "", //申购人
         xdsj: "", //下单时间
         djlx: "", //单据类型
         spzt: "", //审批状态
         rkd: "", //入库单
-        jsbh: "", //结算申请编号或标题
+        jsbh: "" //结算申请编号或标题
       },
       ssqyList: [
         { label: "1", value: "1" },
@@ -154,16 +153,17 @@ export default {
       spztList: [],
       //   表格参数
       pageTotal: 0,
+      pageNum: 1,
       tableLoading: false,
       tableColumn: [
         {
           type: "selection",
           width: 60,
-          align: "center",
+          align: "center"
         },
         {
           title: "结算申请编号",
-          key: "jssqbh",
+          key: "settlementCode",
           tooltip: "true"
         },
         {
@@ -178,74 +178,77 @@ export default {
         },
         {
           title: "供应商编码",
-          key: "gysbm",
+          key: "supplierCode",
           tooltip: "true"
         },
         {
           title: "供应商名称",
-          key: "gysmc",
+          key: "supplierName",
           tooltip: "true"
         },
         {
           title: "联系人",
-          key: "lxr",
+          key: "supplierPrincipal",
           tooltip: "true"
         },
         {
           title: "联系电话",
-          key: "lxdh",
+          key: "supplierTel",
           tooltip: "true"
         },
         {
           title: "申请人",
-          key: "sqr",
+          key: "applicantName",
           tooltip: "true"
         },
         {
           title: "下单时间",
-          key: "xdsj",
+          key: "orderTime",
           tooltip: "true"
         },
         {
           title: "入库时间",
-          key: "rksj",
+          key: "warehouseTime",
           tooltip: "true"
         },
         {
           title: "所属区域",
-          key: "ssqy",
+          key: "areaName",
           tooltip: "true"
         },
         {
           title: "所属项目",
-          key: "ssxm",
+          key: "projectName",
           tooltip: "true"
         },
         {
           title: "创建时间",
-          key: "cjsj",
+          key: "createTime",
           tooltip: "true"
         },
         {
           title: "创建人",
-          key: "cjr",
+          key: "creator",
           tooltip: "true"
         },
         {
           title: "审批状态",
-          key: "spzt",
+          slot: "approvalState",
           tooltip: "true"
         },
         {
           title: "操作",
           slot: "action",
           fixed: "right",
-          width: 180
+          width: 140
         }
       ],
       tableData: []
     };
   },
+  created() {
+    this.getTableData();
+  },
   methods: {
     resizePage() {
       this.resizeHeight = window.innerHeight - 282;
@@ -262,10 +265,79 @@ export default {
         this.searchForm.glxm = ["all"];
       }
     },
+    //导出明细
+    exportData() {
+      let postData = {
+        areaIds: this.searchForm.ssqy.join(","),
+        projectIds: this.searchForm.glxm.join(","),
+        supplierId: this.searchForm.gys,
+        applicantId: this.searchForm.sgr,
+        orderTimeStart: this.searchForm.xdsj[0],
+        orderTimeEnd: this.searchForm.xdsj[1],
+        type: this.searchForm.djlx,
+        approvalState: this.searchForm.spzt,
+        warehouseEntry: this.searchForm.rkd,
+        settlementCode: this.searchForm.jsbh
+      };
+      exportPurchaseSettlementDetailVO(postData).then(res => {});
+    },
     //列表方法
-    getTableData() {},
+    getTableData() {
+      let postData = {
+        page: this.pageNum,
+        pageSize: 10,
+        areaIds: this.searchForm.ssqy.join(","),
+        projectIds: this.searchForm.glxm.join(","),
+        supplierId: this.searchForm.gys,
+        applicantId: this.searchForm.sgr,
+        orderTimeStart: this.searchForm.xdsj[0],
+        orderTimeEnd: this.searchForm.xdsj[1],
+        type: this.searchForm.djlx,
+        approvalState: this.searchForm.spzt,
+        warehouseEntry: this.searchForm.rkd,
+        settlementCode: this.searchForm.jsbh
+      };
+      this.tableLoading = true;
+      queryPurchaseSettlementList(postData).then(res => {
+        this.tableLoading = false;
+        if (res.status == 200) {
+          this.tableData = res.data.records;
+          this.pageTotal = res.data.total;
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+    },
+    printRow(row) {
+      this.printShow = true;
+      this.$refs.print.getPrintData(row.settlementId);
+    },
+    editRow(row) {
+      this.addShow = true;
+      this.$refs.add.settlementId = row.settlementId;
+      this.$refs.add.getJs(row.settlementId);
+    },
+    deleteRow(row) {
+      this.$Modal.confirm({
+        title: "删除",
+        content: "是否确定删除该采购结算?",
+        okText: "确定",
+        onOk: () => {
+          deletePurchaseSettlement(row.settlementId).then(res => {
+            if ((res.status = 200)) {
+              this.$Message.success("删除成功!");
+              this.getTableData();
+            } else {
+              this.$Message.error(res.message);
+            }
+          });
+        }
+      });
+    },
     tableOnSelect(selection, row) {},
-    pageChange(val) {}
+    pageChange(val) {
+      this.pageNum = val;
+    }
   },
   mounted: function() {
     //  监听浏览器页面尺寸

+ 7 - 3
src/page/purchase/purchaseOrder.vue

@@ -121,8 +121,8 @@
           <div>
             <a href="javascript:;" @click="editRow(row)">编辑</a>
             <a href="javascript:;">复制</a>
-            <a href="javascript:;" @click="deleteRow(row)">删除</a>
-            <a href="javascript:;">打印</a>
+            <a href="javascript:;" v-if="row.orderState == '1'" @click="deleteRow(row)">删除</a>
+            <a href="javascript:;" v-if="row.orderState != '6' || row.approvalState != '4'">打印</a>
           </div>
         </template>
       </Table>
@@ -134,7 +134,11 @@
 </template>
 
 <script>
-import { getPurchaseOrder, deletePurchaseOrder, findPurchaseOrder } from "@/service/getData";
+import {
+  getPurchaseOrder,
+  deletePurchaseOrder,
+  findPurchaseOrder
+} from "@/service/getData";
 import orderAdd from "./components/order/orderAdd";
 import orderPrint from "./components/order/orderPrint";
 export default {

+ 39 - 1
src/service/getData.js

@@ -33,6 +33,8 @@ export const accountLogin = (data) => fetch('/rest/userInfo/qpiUserLogin', '/mkf
 
 //字典
 export const getDictInfoList = (data) => fetch(`/goodProvider/getDictInfoList?type=${data}`, '/purchase', data, 'JSON2', 'POST');
+//字典 --- 供应商下拉选列表
+export const selectGoodProviderSelectionList = (data) => fetch(`/goodProvider/selectGoodProviderSelectionList`, '/purchase', data, 'JSON2', 'GET');
 /*
  *采购管理
  *供应商模块接口
@@ -98,9 +100,15 @@ export const queryPurchasePoolList = (data) => fetch(`
  *采购管理
  *采购订单模块接口
  */
+//采购订单 ---  提交采购订单(调用审批流)
+export const submitPurchaseOrder = (data) => fetch(`
+/purchaseOrder/submitPurchaseOrder`, '/purchase', data, 'JSON2', 'POST');
+//采购订单 ---  编辑采购订单审核状态(临时)
+export const editOrderApprovalState = (data) => fetch(`
+/purchaseOrder/editOrderApprovalState?orderId=${data.id}&state=${data.state}`, '/purchase', data, 'JSON2', 'POST');
 //采购订单 ---  获取采购订单
 export const getPurchaseOrder = (data) => fetch(`
-/purchaseOrder/getPurchaseOrder`, '/purchase', data, 'JSON2', 'POSt');
+/purchaseOrder/getPurchaseOrder`, '/purchase', data, 'JSON2', 'POST');
 //采购订单 ---  删除采购订单
 export const deletePurchaseOrder = (data) => fetch(`
 /purchaseOrder/deletePurchaseOrderById?orderId=${data}`, '/purchase', data, 'JSON2', 'POST');
@@ -110,3 +118,33 @@ export const addPurchaseOrder = (data) => fetch(`
 //采购订单 ---  获取采购订单详情
 export const findPurchaseOrder = (data) => fetch(`
 /purchaseOrder/findPurchaseOrderById`, '/purchase', data, 'JSON2', 'GET');
+//采购订单 ---  编辑采购订单详情
+export const editPurchaseOrder = (data) => fetch(`
+purchaseOrder/editPurchaseOrder`, '/purchase', data, 'JSON2', 'GET');
+/*
+ *采购管理
+ *采购结算模块接口
+ */
+//采购结算 ---  获取采购结算列表
+export const queryPurchaseSettlementList = (data) => fetch(`
+/purchaseSettlement/queryPurchaseSettlementList`, '/purchase', data, 'JSON2', 'POST');
+//采购结算 ---  导出采购结算明细
+export const exportPurchaseSettlementDetailVO = (data) => download(`
+/purchaseSettlement/exportPurchaseSettlementDetailVO`, '/purchase', data, 'JSON', 'POST', 'JSON');
+//采购结算 ---  打印单条明细
+export const printPurchaseSettlementDetailVO = (data) => fetch(`
+/purchaseSettlement/printPurchaseSettlementDetailVO`, '/purchase', data, 'JSON', 'POST');
+//采购结算 ---  采购结算列表删除
+export const deletePurchaseSettlement = (data) => fetch(`
+/purchaseSettlement/deletePurchaseSettlement/${data}`, '/purchase', data, 'JSON2', 'POST');
+//采购结算 ---  新增采购结算
+export const addPurchaseSettlement = (data) => fetch(`
+/purchaseSettlement/addPurchaseSettlement`, '/purchase', data, 'JSON2', 'POST');
+//采购结算 ---  查看采购结算详情
+export const queryPurchaseSettlementInfo = (data) => fetch(`
+/purchaseSettlement/queryPurchaseSettlementInfo/${data}`, '/purchase', data, 'JSON2', 'POST');
+//采购结算 ---  编辑采购结算详情
+export const editPurchaseSettlement = (data) => fetch(`
+/purchaseSettlement/editPurchaseSettlement`, '/purchase', data, 'JSON2', 'POST');
+//采购结算 ---  获取结算明细列表
+export const hajwySettlementList = (data) => fetch(`/inventoryInfo/settlementList`, '/hajwy', data, 'FORMDATA', 'POST')